From efc383d4dc005046a76da4134cd25e8aa11b8042 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Tue, 20 Nov 2018 17:40:17 +0100 Subject: add register for insertBefore and insertAfter --- src/animation/Timeline.js | 10 +++------- src/modules/optional/arrange.js | 13 ++++++++++++- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index 6abcb80..6e1ed8d 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -38,16 +38,11 @@ export default class Timeline extends EventTarget { this._lastStepTime = 0 } - /** - * - */ - // schedules a runner on the timeline schedule (runner, delay, when) { - // FIXME: how to sort? maybe by runner id? if (runner == null) { return this._runners.map(makeSchedule).sort(function (a, b) { - return (a.start - b.start) || (a.duration - b.duration) + return a.runner.id - b.runner.id }) } @@ -189,7 +184,7 @@ export default class Timeline extends EventTarget { // Update the time this._time += dtTime this._lastStepTime = this._time - // this.fire('time', this._time) + this.fire('time', this._time) // Run all of the runners directly var runnersLeft = false @@ -238,6 +233,7 @@ export default class Timeline extends EventTarget { if (runnersLeft) { this._nextFrame = Animator.frame(this._step.bind(this)) } else { + this.fire('finished') this._nextFrame = null } return this diff --git a/src/modules/optional/arrange.js b/src/modules/optional/arrange.js index 6ce2eea..f06509a 100644 --- a/src/modules/optional/arrange.js +++ b/src/modules/optional/arrange.js @@ -107,5 +107,16 @@ export function insertAfter (element) { } registerMethods('Dom', { - siblings, position, next, prev, forward, backward, front, back, before, after + siblings, + position, + next, + prev, + forward, + backward, + front, + back, + before, + after, + insertBefore, + insertAfter }) -- cgit v1.2.3 From ddf28b67dd55aab000a5e6c44f2089c9f0b91ff8 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 21 Nov 2018 21:33:03 +0100 Subject: add default parameter for timeSource --- dirty.html | 6 +++--- dist/svg.js | 26 ++++++++++++-------------- src/animation/Timeline.js | 12 +++++++----- 3 files changed, 22 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/dirty.html b/dirty.html index 8824c6b..712c13c 100644 --- a/dirty.html +++ b/dirty.html @@ -135,9 +135,9 @@ var mover = canvas.line(100, 100, 100, 300).attr('stroke', 'black') mover.clone().insertAfter(mover) canvas.line(100, 300, 800, 300).attr('stroke', 'black') -// t.on('time', function (e) { -// mover.x(100 + e.detail/10) -// }) +t.on('time', function (e) { + mover.x(100 + e.detail/10) +}) console.log(schedule) diff --git a/dist/svg.js b/dist/svg.js index 6abe275..9d7a861 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Tue Nov 20 2018 16:59:18 GMT+0100 (GMT+01:00) +* BUILT: Wed Nov 21 2018 10:58:56 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -5010,6 +5010,11 @@ var SVG = (function () { }; }; + var defaultSource = function defaultSource() { + var w = globals.window; + return (w.performance || w.Date).now(); + }; + var Timeline = /*#__PURE__*/ function (_EventTarget) { @@ -5019,15 +5024,12 @@ var SVG = (function () { function Timeline() { var _this; + var timeSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSource; + _classCallCheck(this, Timeline); _this = _possibleConstructorReturn(this, _getPrototypeOf(Timeline).call(this)); - - _this._timeSource = function () { - var w = globals.window; - return (w.performance || w.Date).now(); - }; // Store the timing variables - + _this._timeSource = timeSource; // Store the timing variables _this._startTime = 0; _this._speed = 1.0; // Play control variables control how the animation proceeds @@ -5043,20 +5045,15 @@ var SVG = (function () { _this._lastSourceTime = 0; _this._lastStepTime = 0; return _this; - } - /** - * - */ - // schedules a runner on the timeline + } // schedules a runner on the timeline _createClass(Timeline, [{ key: "schedule", value: function schedule(runner, delay, when) { - // FIXME: how to sort? maybe by runner id? if (runner == null) { return this._runners.map(makeSchedule).sort(function (a, b) { - return a.runner.id - b.runner.id; // return (a.start - b.start) || (a.duration - b.duration) + return a.runner.id - b.runner.id; }); } @@ -5256,6 +5253,7 @@ var SVG = (function () { if (runnersLeft) { this._nextFrame = Animator.frame(this._step.bind(this)); } else { + this.fire('finished'); this._nextFrame = null; } diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index 6e1ed8d..a0d8069 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -10,15 +10,17 @@ var makeSchedule = function (runnerInfo) { return { start: start, duration: duration, end: end, runner: runnerInfo.runner } } +const defaultSource = function () { + let w = globals.window + return (w.performance || w.Date).now() +} + export default class Timeline extends EventTarget { // Construct a new timeline on the given element - constructor () { + constructor (timeSource = defaultSource) { super() - this._timeSource = function () { - let w = globals.window - return (w.performance || w.Date).now() - } + this._timeSource = timeSource // Store the timing variables this._startTime = 0 -- cgit v1.2.3 From da216c2af803c50ee4bc82ec0e954a1efc1e8a4e Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 21 Nov 2018 22:06:38 +0100 Subject: rewrite few lines of adopter --- dist/svg.js | 20 +++++++++----------- src/utils/adopter.js | 21 +++++++++------------ 2 files changed, 18 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/dist/svg.js b/dist/svg.js index 9d7a861..5407a1a 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Wed Nov 21 2018 10:58:56 GMT+0100 (GMT+01:00) +* BUILT: Wed Nov 21 2018 22:04:17 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -437,19 +437,17 @@ var SVG = (function () { } // initialize variables - var element; // adopt with element-specific settings + var className = capitalize(node.nodeName); - if (node.nodeName === 'svg') { - element = new elements[root](node); - } else if (node.nodeName === 'linearGradient' || node.nodeName === 'radialGradient') { - element = new elements.Gradient(node); - } else if (elements[capitalize(node.nodeName)]) { - element = new elements[capitalize(node.nodeName)](node); - } else { - element = new elements.Bare(node); + if (className === 'LinearGradient' || className === 'RadialGradient') { + className = 'Gradient'; } - return element; + if (!elements[className]) { + className = 'Bare'; + } + + return new elements[className](node); } function register(element) { var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element.name; diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 80bfd8a..6109f22 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -55,20 +55,17 @@ export function adopt (node) { } // initialize variables - var element - - // adopt with element-specific settings - if (node.nodeName === 'svg') { - element = new elements[root](node) - } else if (node.nodeName === 'linearGradient' || node.nodeName === 'radialGradient') { - element = new elements.Gradient(node) - } else if (elements[capitalize(node.nodeName)]) { - element = new elements[capitalize(node.nodeName)](node) - } else { - element = new elements.Bare(node) + var className = capitalize(node.nodeName) + + if (className === 'LinearGradient' || className === 'RadialGradient') { + className = 'Gradient' } - return element + if (!elements[className]) { + className = 'Bare' + } + + return new elements[className](node) } export function register (element, name = element.name, asRoot = false) { -- cgit v1.2.3 From d5c01a7848154d240f434b38d802fdb65727fd7f Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Thu, 22 Nov 2018 15:56:39 +0100 Subject: fix Timeline so that play, pause, stop, reverse... work correctly. Update runners accordingly --- dirty.html | 68 +++++++++++++++++++++++++++++++++++++++-- dist/svg.js | 78 +++++++++++++++++++++++++++++++---------------- src/animation/Animator.js | 4 +-- src/animation/Runner.js | 14 +++++++++ src/animation/Timeline.js | 54 ++++++++++++++++++++------------ 5 files changed, 168 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/dirty.html b/dirty.html index 712c13c..9380cf5 100644 --- a/dirty.html +++ b/dirty.html @@ -14,8 +14,21 @@ -
-
+ + + + + + + + + + + + + + @@ -109,7 +122,8 @@ canvas.attr('viewBox', null) SVG.defaults.timeline.ease = '-' var r = new SVG.Runner(1000) -var t = new SVG.Timeline() +var t = new SVG.Timeline().persist(true) + r.schedule(t, 200) .animate(500).loop(5, true, 100) .animate(600, 200, 'absolute') @@ -135,8 +149,56 @@ var mover = canvas.line(100, 100, 100, 300).attr('stroke', 'black') mover.clone().insertAfter(mover) canvas.line(100, 300, 800, 300).attr('stroke', 'black') +const text = SVG('#displayText') + t.on('time', function (e) { mover.x(100 + e.detail/10) + text.node.textContent = e.detail +}) + +t.on('finished', () => { + console.log('finished') +}) + +SVG('button[name="back100"]').on('click', () => { + t.seek(-100) +}) +SVG('button[name="back1000"]').on('click', () => { + t.seek(-1000) +}) +SVG('button[name="forth100"]').on('click', () => { + t.seek(100) +}) +SVG('button[name="forth1000"]').on('click', () => { + t.seek(1000) +}) + +SVG('button[name="speed2"]').on('click', () => { + t.speed(2) +}) + +SVG('button[name="speed05"]').on('click', () => { + t.speed(0.5) +}) + +SVG('button[name="pause"]').on('click', () => { + t.pause() +}) + +SVG('button[name="play"]').on('click', () => { + t.play() +}) + +SVG('button[name="stop"]').on('click', () => { + t.stop() +}) + +SVG('button[name="finish"]').on('click', () => { + t.finish() +}) + +SVG('button[name="reverse"]').on('click', () => { + t.reverse() }) diff --git a/dist/svg.js b/dist/svg.js index 5407a1a..544f337 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Wed Nov 21 2018 22:04:17 GMT+0100 (GMT+01:00) +* BUILT: Thu Nov 22 2018 15:30:35 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -4957,10 +4957,10 @@ var SVG = (function () { return node; }, cancelFrame: function cancelFrame(node) { - Animator.frames.remove(node); + node != null && Animator.frames.remove(node); }, clearTimeout: function clearTimeout(node) { - Animator.timeouts.remove(node); + node != null && Animator.timeouts.remove(node); }, _draw: function _draw(now) { // Run all the timeouts we can run, if they are not ready yet, add them @@ -5041,7 +5041,9 @@ var SVG = (function () { _this._order = []; _this._time = 0; _this._lastSourceTime = 0; - _this._lastStepTime = 0; + _this._lastStepTime = 0; // Make sure that step is always called in class context + + _this._step = _this._step.bind(_assertThisInitialized(_assertThisInitialized(_this))); return _this; } // schedules a runner on the timeline @@ -5098,7 +5100,8 @@ var SVG = (function () { this._runners[runner.id] = { persist: this.persist(), runner: runner, - start: absoluteStartTime // Save order and continue + start: absoluteStartTime // + delay + // Save order and continue }; @@ -5127,26 +5130,26 @@ var SVG = (function () { value: function play() { // Now make sure we are not paused and continue the animation this._paused = false; + this._lastSourceTime = this._timeSource(); return this._continue(); } }, { key: "pause", value: function pause() { - // Cancel the next animation frame and pause - this._nextFrame = null; this._paused = true; - return this; + return this._continue(); } }, { key: "stop", value: function stop() { - // Cancel the next animation frame and go to start + // Go to start and pause this.seek(-this._time); return this.pause(); } }, { key: "finish", value: function finish() { + // Go to Infinity and pause this.seek(Infinity); return this.pause(); } @@ -5168,8 +5171,9 @@ var SVG = (function () { }, { key: "seek", value: function seek(dt) { - this._time += dt; - return this._continue(); + this._time += dt; // this._lastStepTime = this._time + + return this._continue(true); } }, { key: "time", @@ -5195,16 +5199,22 @@ var SVG = (function () { }, { key: "_step", value: function _step() { - // If the timeline is paused, just do nothing - if (this._paused) return; // Get the time delta from the last time and update the time + var immediateStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + // Get the time delta from the last time and update the time var time = this._timeSource(); var dtSource = time - this._lastSourceTime; + if (immediateStep) dtSource = 0; var dtTime = this._speed * dtSource + (this._time - this._lastStepTime); - this._lastSourceTime = time; // Update the time + this._lastSourceTime = time; // Only update the time if we use the timeSource. + // Otherwise use the current time + + if (!immediateStep) { + // Update the time + this._time += dtTime; + } - this._time += dtTime; this._lastStepTime = this._time; this.fire('time', this._time); // Run all of the runners directly @@ -5219,8 +5229,12 @@ var SVG = (function () { var dtToStart = this._time - runnerInfo.start; // Dont run runner if not started yet - if (dtToStart < 0) { - runnersLeft = true; + if (dtToStart <= 0) { + runnersLeft = true; // This is for the case that teh timeline was seeked so that the time + // is now before the startTime of the runner. Thats why we need to set + // the runner to position 0 + + runner.reset(); continue; } else if (dtToStart < dt) { // Adjust dt to make sure that animation is on point @@ -5245,11 +5259,10 @@ var SVG = (function () { runner.timeline(null); } } - } // Get the next animation frame to keep the simulation going - + } if (runnersLeft) { - this._nextFrame = Animator.frame(this._step.bind(this)); + this._continue(); } else { this.fire('finished'); this._nextFrame = null; @@ -5261,12 +5274,12 @@ var SVG = (function () { }, { key: "_continue", value: function _continue() { + var immediateStep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + Animator.cancelFrame(this._nextFrame); + this._nextFrame = null; + if (immediateStep) return this._step(true); if (this._paused) return this; - - if (!this._nextFrame) { - this._nextFrame = Animator.frame(this._step.bind(this)); - } - + this._nextFrame = Animator.frame(this._step); return this; } }, { @@ -5318,7 +5331,9 @@ var SVG = (function () { _this.enabled = true; _this._time = 0; - _this._last = 0; // Save transforms applied to this runner + _this._last = 0; // At creation, the runner is in reseted state + + _this._reseted = true; // Save transforms applied to this runner _this.transforms = new Matrix(); _this.transformId = 1; // Looping variables @@ -5563,6 +5578,9 @@ var SVG = (function () { this.done = !declarative && !justFinished && this._time >= duration; // Call initialise and the run function if (running || declarative) { + // Runner is running. So its not in reseted state anymore + this._reseted = false; + this._initialise(running); // clear the transforms on this runner so they dont get added again and again @@ -5584,6 +5602,14 @@ var SVG = (function () { return this; } }, { + key: "reset", + value: function reset() { + if (this._reseted) return this; + this.loops(0); + this._reseted = true; + return this; + } + }, { key: "finish", value: function finish() { return this.step(Infinity); diff --git a/src/animation/Animator.js b/src/animation/Animator.js index 9b460f5..1392daa 100644 --- a/src/animation/Animator.js +++ b/src/animation/Animator.js @@ -43,11 +43,11 @@ const Animator = { }, cancelFrame (node) { - Animator.frames.remove(node) + node != null && Animator.frames.remove(node) }, clearTimeout (node) { - Animator.timeouts.remove(node) + node != null && Animator.timeouts.remove(node) }, _draw (now) { diff --git a/src/animation/Runner.js b/src/animation/Runner.js index 47929fd..63c95d6 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -50,6 +50,9 @@ export default class Runner extends EventTarget { this._time = 0 this._last = 0 + // At creation, the runner is in reseted state + this._reseted = true + // Save transforms applied to this runner this.transforms = new Matrix() this.transformId = 1 @@ -276,11 +279,15 @@ export default class Runner extends EventTarget { // Call initialise and the run function if (running || declarative) { + // Runner is running. So its not in reseted state anymore + this._reseted = false + this._initialise(running) // clear the transforms on this runner so they dont get added again and again this.transforms = new Matrix() var converged = this._run(declarative ? dt : position) + this.fire('step', this) } // correct the done flag here @@ -292,6 +299,13 @@ export default class Runner extends EventTarget { return this } + reset () { + if (this._reseted) return this + this.loops(0) + this._reseted = true + return this + } + finish () { return this.step(Infinity) } diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index a0d8069..bafd319 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -38,6 +38,9 @@ export default class Timeline extends EventTarget { this._time = 0 this._lastSourceTime = 0 this._lastStepTime = 0 + + // Make sure that step is always called in class context + this._step = this._step.bind(this) } // schedules a runner on the timeline @@ -92,7 +95,7 @@ export default class Timeline extends EventTarget { this._runners[runner.id] = { persist: this.persist(), runner: runner, - start: absoluteStartTime + start: absoluteStartTime// + delay } // Save order and continue @@ -115,23 +118,23 @@ export default class Timeline extends EventTarget { play () { // Now make sure we are not paused and continue the animation this._paused = false + this._lastSourceTime = this._timeSource() return this._continue() } pause () { - // Cancel the next animation frame and pause - this._nextFrame = null this._paused = true - return this + return this._continue() } stop () { - // Cancel the next animation frame and go to start + // Go to start and pause this.seek(-this._time) return this.pause() } finish () { + // Go to Infinity and pause this.seek(Infinity) return this.pause() } @@ -152,7 +155,8 @@ export default class Timeline extends EventTarget { seek (dt) { this._time += dt - return this._continue() + // this._lastStepTime = this._time + return this._continue(true) } time (time) { @@ -173,18 +177,22 @@ export default class Timeline extends EventTarget { return this } - _step () { - // If the timeline is paused, just do nothing - if (this._paused) return - + _step (immediateStep = false) { // Get the time delta from the last time and update the time var time = this._timeSource() var dtSource = time - this._lastSourceTime + + if (immediateStep) dtSource = 0 + var dtTime = this._speed * dtSource + (this._time - this._lastStepTime) this._lastSourceTime = time - // Update the time - this._time += dtTime + // Only update the time if we use the timeSource. + // Otherwise use the current time + if (!immediateStep) { + // Update the time + this._time += dtTime + } this._lastStepTime = this._time this.fire('time', this._time) @@ -201,8 +209,13 @@ export default class Timeline extends EventTarget { let dtToStart = this._time - runnerInfo.start // Dont run runner if not started yet - if (dtToStart < 0) { + if (dtToStart <= 0) { runnersLeft = true + + // This is for the case that teh timeline was seeked so that the time + // is now before the startTime of the runner. Thats why we need to set + // the runner to position 0 + runner.reset() continue } else if (dtToStart < dt) { // Adjust dt to make sure that animation is on point @@ -231,22 +244,25 @@ export default class Timeline extends EventTarget { } } - // Get the next animation frame to keep the simulation going if (runnersLeft) { - this._nextFrame = Animator.frame(this._step.bind(this)) + this._continue() } else { this.fire('finished') this._nextFrame = null } + return this } // Checks if we are running and continues the animation - _continue () { + _continue (immediateStep = false) { + Animator.cancelFrame(this._nextFrame) + this._nextFrame = null + + if (immediateStep) return this._step(true) if (this._paused) return this - if (!this._nextFrame) { - this._nextFrame = Animator.frame(this._step.bind(this)) - } + + this._nextFrame = Animator.frame(this._step) return this } -- cgit v1.2.3 From 8555e13b252f07f8079b08c0b29f4399d389b1e0 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Fri, 23 Nov 2018 15:06:37 +0100 Subject: fixed lots of bugs in the timeline. Its now working as expected in all cases. - refactor code into functions - handle timeSource correctly - allow for immediate updates - Runners dont know about their delay anymore. Thats far more simple. - Timeline is paused on creation --- dirty.html | 9 ++++++ dist/svg.js | 74 ++++++++++++++++++++++++++--------------------- spec/spec/runner.js | 6 ++-- src/animation/Runner.js | 2 +- src/animation/Timeline.js | 65 ++++++++++++++++++++++------------------- 5 files changed, 90 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/dirty.html b/dirty.html index 9380cf5..decb180 100644 --- a/dirty.html +++ b/dirty.html @@ -145,6 +145,8 @@ schedule.forEach((s, i) => { // s.runner.during(console.log) }) +// t.play() + var mover = canvas.line(100, 100, 100, 300).attr('stroke', 'black') mover.clone().insertAfter(mover) canvas.line(100, 300, 800, 300).attr('stroke', 'black') @@ -202,6 +204,13 @@ SVG('button[name="reverse"]').on('click', () => { }) +canvas.rect(100, 100).on('click', (e) => { + e.target.instance.animate().move(Math.random()*1000, Math.random()*750).timeline().on('finished', () => { + console.log('rect finished') + }) +}) + + console.log(schedule) // var bla = SVG('').size(0, 0).move(200, 200).addTo('svg') diff --git a/dist/svg.js b/dist/svg.js index 544f337..b55a529 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Thu Nov 22 2018 15:30:35 GMT+0100 (GMT+01:00) +* BUILT: Fri Nov 23 2018 14:47:42 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -5030,13 +5030,12 @@ var SVG = (function () { _this._timeSource = timeSource; // Store the timing variables _this._startTime = 0; - _this._speed = 1.0; // Play control variables control how the animation proceeds + _this._speed = 1.0; // Determines how long a runner is hold in memory. Can be a dt or true/false - _this._reverse = false; _this._persist = 0; // Keep track of the running animations and their starting parameters _this._nextFrame = null; - _this._paused = false; + _this._paused = true; _this._runners = []; _this._order = []; _this._time = 0; @@ -5055,25 +5054,18 @@ var SVG = (function () { return this._runners.map(makeSchedule).sort(function (a, b) { return a.runner.id - b.runner.id; }); - } - - if (!this.active()) { - this._step(); - - if (when == null) { - when = 'now'; - } } // The start time for the next animation can either be given explicitly, // derived from the current timeline time or it can be relative to the // last start time to chain animations direclty var absoluteStartTime = 0; + var endTime = this.getEndTime(); delay = delay || 0; // Work out when to start the animation if (when == null || when === 'last' || when === 'after') { // Take the last time and increment - absoluteStartTime = this._startTime; + absoluteStartTime = endTime; } else if (when === 'absolute' || when === 'start') { absoluteStartTime = delay; delay = 0; @@ -5092,22 +5084,19 @@ var SVG = (function () { runner.unschedule(); - runner.timeline(this); - runner.time(-delay); // Save startTime for next runner - - this._startTime = absoluteStartTime + runner.duration() + delay; // Save runnerInfo + runner.timeline(this); // runner.time(-delay) + // Save runnerInfo this._runners[runner.id] = { persist: this.persist(), runner: runner, - start: absoluteStartTime // + delay - // Save order and continue + start: absoluteStartTime + delay // Save order, update Time if needed and continue }; this._order.push(runner.id); - this._continue(); + this.updateTime()._continue(); return this; } // Remove the runner from this timeline @@ -5123,6 +5112,25 @@ var SVG = (function () { this._order.splice(index, 1); runner.timeline(null); + return this; + } // Calculates the end of the timeline + + }, { + key: "getEndTime", + value: function getEndTime() { + var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]; + var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0; + var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0; + return lastStartTime + lastDuration; + } // Makes sure, that after pausing the time doesn't jump + + }, { + key: "updateTime", + value: function updateTime() { + if (!this.active()) { + this._lastSourceTime = this._timeSource(); + } + return this; } }, { @@ -5130,8 +5138,7 @@ var SVG = (function () { value: function play() { // Now make sure we are not paused and continue the animation this._paused = false; - this._lastSourceTime = this._timeSource(); - return this._continue(); + return this.updateTime()._continue(); } }, { key: "pause", @@ -5143,14 +5150,14 @@ var SVG = (function () { key: "stop", value: function stop() { // Go to start and pause - this.seek(-this._time); + this.time(0); return this.pause(); } }, { key: "finish", value: function finish() { - // Go to Infinity and pause - this.seek(Infinity); + // Go to end and pause + this.time(this.getEndTime() + 1); return this.pause(); } }, { @@ -5171,16 +5178,14 @@ var SVG = (function () { }, { key: "seek", value: function seek(dt) { - this._time += dt; // this._lastStepTime = this._time - - return this._continue(true); + return this.time(this._time + dt); } }, { key: "time", value: function time(_time) { if (_time == null) return this._time; this._time = _time; - return this; + return this._continue(true); } }, { key: "persist", @@ -5213,6 +5218,7 @@ var SVG = (function () { if (!immediateStep) { // Update the time this._time += dtTime; + this._time = this._time < 0 ? 0 : this._time; } this._lastStepTime = this._time; @@ -5259,13 +5265,15 @@ var SVG = (function () { runner.timeline(null); } } - } + } // Basically: we continue when there are runners right from us in time + // when -->, and when runners are left from us when <-- + - if (runnersLeft) { + if (runnersLeft && !(this._speed < 0 && this._time === 0) || this._order.length && this._speed < 0 && this._time > 0) { this._continue(); } else { this.fire('finished'); - this._nextFrame = null; + this.pause(); } return this; @@ -5915,7 +5923,7 @@ var SVG = (function () { animate: function animate(duration, delay, when) { var o = Runner.sanitise(duration, delay, when); var timeline$$1 = this.timeline(); - return new Runner(o.duration).loop(o).element(this).timeline(timeline$$1).schedule(delay, when); + return new Runner(o.duration).loop(o).element(this).timeline(timeline$$1.play()).schedule(delay, when); }, delay: function delay(by, when) { return this.animate(0, by, when); diff --git a/spec/spec/runner.js b/spec/spec/runner.js index 0f231a3..ff9df7b 100644 --- a/spec/spec/runner.js +++ b/spec/spec/runner.js @@ -742,11 +742,11 @@ describe('SVG.Runner', function () { var t = timeline.time() expect(runner2.timeline()).toBe(timeline) - expect(runner2.time()).toBe(-1000) + expect(runner2.time()).toBe(0) - expect(timeline.schedule()).toEqual(jasmine.objectContaining([ + expect(timeline.schedule()).toEqual(jasmine.arrayContaining([ jasmine.objectContaining({start: t, duration: 1000, end: t+1000, runner: runner}), - jasmine.objectContaining({start: t+1000, duration: 500, end: t+1500, runner: runner2}) + jasmine.objectContaining({start: t+2000, duration: 500, end: t+2500, runner: runner2}) ])) }) }) diff --git a/src/animation/Runner.js b/src/animation/Runner.js index 63c95d6..5551162 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -578,7 +578,7 @@ registerMethods({ return new Runner(o.duration) .loop(o) .element(this) - .timeline(timeline) + .timeline(timeline.play()) .schedule(delay, when) }, diff --git a/src/animation/Timeline.js b/src/animation/Timeline.js index bafd319..c3ad07c 100644 --- a/src/animation/Timeline.js +++ b/src/animation/Timeline.js @@ -26,13 +26,12 @@ export default class Timeline extends EventTarget { this._startTime = 0 this._speed = 1.0 - // Play control variables control how the animation proceeds - this._reverse = false + // Determines how long a runner is hold in memory. Can be a dt or true/false this._persist = 0 // Keep track of the running animations and their starting parameters this._nextFrame = null - this._paused = false + this._paused = true this._runners = [] this._order = [] this._time = 0 @@ -51,23 +50,18 @@ export default class Timeline extends EventTarget { }) } - if (!this.active()) { - this._step() - if (when == null) { - when = 'now' - } - } - // The start time for the next animation can either be given explicitly, // derived from the current timeline time or it can be relative to the // last start time to chain animations direclty + var absoluteStartTime = 0 + var endTime = this.getEndTime() delay = delay || 0 // Work out when to start the animation if (when == null || when === 'last' || when === 'after') { // Take the last time and increment - absoluteStartTime = this._startTime + absoluteStartTime = endTime } else if (when === 'absolute' || when === 'start') { absoluteStartTime = delay delay = 0 @@ -86,21 +80,18 @@ export default class Timeline extends EventTarget { // Manage runner runner.unschedule() runner.timeline(this) - runner.time(-delay) - - // Save startTime for next runner - this._startTime = absoluteStartTime + runner.duration() + delay + // runner.time(-delay) // Save runnerInfo this._runners[runner.id] = { persist: this.persist(), runner: runner, - start: absoluteStartTime// + delay + start: absoluteStartTime + delay } - // Save order and continue + // Save order, update Time if needed and continue this._order.push(runner.id) - this._continue() + this.updateTime()._continue() return this } @@ -115,11 +106,26 @@ export default class Timeline extends EventTarget { return this } + // Calculates the end of the timeline + getEndTime () { + var lastRunnerInfo = this._runners[this._order[this._order.length - 1]] + var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0 + var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0 + return lastStartTime + lastDuration + } + + // Makes sure, that after pausing the time doesn't jump + updateTime () { + if (!this.active()) { + this._lastSourceTime = this._timeSource() + } + return this + } + play () { // Now make sure we are not paused and continue the animation this._paused = false - this._lastSourceTime = this._timeSource() - return this._continue() + return this.updateTime()._continue() } pause () { @@ -129,13 +135,13 @@ export default class Timeline extends EventTarget { stop () { // Go to start and pause - this.seek(-this._time) + this.time(0) return this.pause() } finish () { - // Go to Infinity and pause - this.seek(Infinity) + // Go to end and pause + this.time(this.getEndTime() + 1) return this.pause() } @@ -154,15 +160,13 @@ export default class Timeline extends EventTarget { } seek (dt) { - this._time += dt - // this._lastStepTime = this._time - return this._continue(true) + return this.time(this._time + dt) } time (time) { if (time == null) return this._time this._time = time - return this + return this._continue(true) } persist (dtOrForever) { @@ -192,6 +196,7 @@ export default class Timeline extends EventTarget { if (!immediateStep) { // Update the time this._time += dtTime + this._time = this._time < 0 ? 0 : this._time } this._lastStepTime = this._time this.fire('time', this._time) @@ -244,11 +249,13 @@ export default class Timeline extends EventTarget { } } - if (runnersLeft) { + // Basically: we continue when there are runners right from us in time + // when -->, and when runners are left from us when <-- + if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) { this._continue() } else { this.fire('finished') - this._nextFrame = null + this.pause() } return this -- cgit v1.2.3 From 858f19e9f8b9ba26eee8d3aeb8ba8b5b5058472b Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sat, 24 Nov 2018 11:17:13 +0100 Subject: Get rid of HTMLNode and Bare in favor of Dom - words() and element() added to Dom - svg() now returns the _parent_ of the imported element, when outerHTML is true (which means an element gets replaces) --- CHANGELOG.md | 2 + bench/tests/10000-textContent.js | 21 ++++ dirty.html | 18 ++- dist/svg.js | 97 +++++---------- spec/spec/adopter.js | 6 +- spec/spec/bare.js | 41 ------- spec/spec/element.js | 35 ++++++ spec/spec/svg.js | 8 +- src/animation/Morphable.js | 246 +++++++++++++++++++++++++++++++++++++++ src/animation/Runner.js | 2 +- src/elements/Bare.js | 31 ----- src/elements/Dom.js | 15 ++- src/elements/HtmlNode.js | 6 - src/elements/Style.js | 6 +- src/main.js | 4 +- src/types/Morphable.js | 246 --------------------------------------- src/utils/adopter.js | 11 +- 17 files changed, 375 insertions(+), 420 deletions(-) create mode 100644 bench/tests/10000-textContent.js delete mode 100644 spec/spec/bare.js create mode 100644 src/animation/Morphable.js delete mode 100644 src/elements/Bare.js delete mode 100644 src/elements/HtmlNode.js delete mode 100644 src/types/Morphable.js (limited to 'src') diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eeba9b..ceb62a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http: - added possibility to pass attributes into a constructor like: `new SVG.Rect({width:100})` - added possibility to pass in additional attribues to element creators e.g. `canvas.rect({x:100})` or `canvas.rect(100, 100, {x:100})` (#796) - added `SVG.List` (#645) +- added `words()` and `element()` to `Dom` because of (#935) ### Removed - removed `SVG.Array.split()` function @@ -42,6 +43,7 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http: - removed `size()` from `SVG.Text` to avoid name clash (#799) - removed `move(), dmove()` etc for groups to avoid inconsistencies, we will expect users to use transforms to move around groups as they should (especially since they are much simpler now). - removed `native()` function +- removed `Bare` in favour of `Dom` (#935) ### Changed - gradients now have there corresponding node as type and not only radial/linear diff --git a/bench/tests/10000-textContent.js b/bench/tests/10000-textContent.js new file mode 100644 index 0000000..9a02308 --- /dev/null +++ b/bench/tests/10000-textContent.js @@ -0,0 +1,21 @@ +SVG.bench.describe('Change textContent 10000 times', function(bench) { + var data = 'M 100 200 C 200 100 300 0 400 100 C 500 200 600 300 700 200 C 800 100 900 100 900 100' + + var node = bench.draw.plain('').node + + + bench.test('using appendChild', function() { + for (var i = 0; i < 1000000; i++) { + while (node.hasChildNodes()) { + node.removeChild(node.lastChild) + } + + node.appendChild(document.createTextNode('test'+i)) + } + }) + bench.test('using textContent', function() { + for (var i = 0; i < 1000000; i++) { + node.textContent = 'test'+i + } + }) +}) diff --git a/dirty.html b/dirty.html index decb180..3fd1412 100644 --- a/dirty.html +++ b/dirty.html @@ -210,9 +210,23 @@ canvas.rect(100, 100).on('click', (e) => { }) }) - console.log(schedule) + + + + + + + + + + + + + + + // var bla = SVG('').size(0, 0).move(200, 200).addTo('svg') // bla.animate().size(220, 200).queue(null, console.log) @@ -353,7 +367,7 @@ rectangle.animate().transform({ // // moon.animate(10000).loop().ease('-') // .transform({rotate: 360, origin: [500, 300]}, true) -// .transform({rotate: 1080, origin: [1000, 300]}, true) +// .transform({rotate: 3600, origin: [1000, 300]}, true) diff --git a/dist/svg.js b/dist/svg.js index b55a529..701b906 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Fri Nov 23 2018 14:47:42 GMT+0100 (GMT+01:00) +* BUILT: Sat Nov 24 2018 11:07:45 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -430,21 +430,14 @@ var SVG = (function () { // check for presence of node if (!node) return null; // make sure a node isn't already adopted - if (node.instance instanceof Base) return node.instance; + if (node.instance instanceof Base) return node.instance; // initialize variables - if (!(node instanceof globals.window.SVGElement)) { - return new elements.HtmlNode(node); - } // initialize variables - - - var className = capitalize(node.nodeName); + var className = capitalize(node.nodeName); // Make sure that gradients are adopted correctly if (className === 'LinearGradient' || className === 'RadialGradient') { - className = 'Gradient'; - } - - if (!elements[className]) { - className = 'Bare'; + className = 'Gradient'; // Fallback to Dom if element is not known + } else if (!elements[className]) { + className = 'Dom'; } return new elements[className](node); @@ -2372,6 +2365,11 @@ var SVG = (function () { } return this; + } + }, { + key: "element", + value: function element(nodeName) { + return this.put(new Dom(makeNode(nodeName))); } // Get first child }, { @@ -2572,10 +2570,18 @@ var SVG = (function () { for (len = well.children.length; len--;) { fragment.appendChild(well.firstElementChild); - } // Add the whole fragment at once + } + var parent = this.parent(); // Add the whole fragment at once - return outerHTML ? this.replace(fragment) : this.add(fragment); + return outerHTML ? this.replace(fragment) && parent : this.add(fragment); + } + }, { + key: "words", + value: function words(text) { + // This is faster than removing all children and adding a new one + this.node.textContent = text; + return this; } // write svgjs data to the dom }, { @@ -6604,41 +6610,6 @@ var SVG = (function () { }); register(Tspan); - var Bare = - /*#__PURE__*/ - function (_Container) { - _inherits(Bare, _Container); - - function Bare(node, attrs) { - _classCallCheck(this, Bare); - - return _possibleConstructorReturn(this, _getPrototypeOf(Bare).call(this, nodeOrNew(node, typeof node === 'string' ? null : node), attrs)); - } - - _createClass(Bare, [{ - key: "words", - value: function words(text) { - // remove contents - while (this.node.hasChildNodes()) { - this.node.removeChild(this.node.lastChild); - } // create text node - - - this.node.appendChild(globals.document.createTextNode(text)); - return this; - } - }]); - - return Bare; - }(Container); - register(Bare); - registerMethods('Container', { - // Create an element that is not described by SVG.js - element: wrapWithAttrCheck(function (node) { - return this.put(new Bare(node)); - }) - }); - var ClipPath = /*#__PURE__*/ function (_Container) { @@ -6719,21 +6690,6 @@ var SVG = (function () { }); register(G); - var HtmlNode = - /*#__PURE__*/ - function (_Dom) { - _inherits(HtmlNode, _Dom); - - function HtmlNode() { - _classCallCheck(this, HtmlNode); - - return _possibleConstructorReturn(this, _getPrototypeOf(HtmlNode).apply(this, arguments)); - } - - return HtmlNode; - }(Dom); - register(HtmlNode); - var A = /*#__PURE__*/ function (_Container) { @@ -6867,9 +6823,10 @@ var SVG = (function () { } _createClass(Style, [{ - key: "words", - value: function words(w) { - this.node.textContent += w || ''; + key: "addText", + value: function addText() { + var w = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + this.node.textContent += w; return this; } }, { @@ -6884,7 +6841,7 @@ var SVG = (function () { }, { key: "rule", value: function rule(selector, obj) { - return this.words(cssRule(selector, obj)); + return this.addText(cssRule(selector, obj)); } }]); @@ -7090,7 +7047,6 @@ var SVG = (function () { Point: Point, PointArray: PointArray, List: List, - Bare: Bare, Circle: Circle, ClipPath: ClipPath, Container: Container, @@ -7100,7 +7056,6 @@ var SVG = (function () { Ellipse: Ellipse, Gradient: Gradient, G: G, - HtmlNode: HtmlNode, A: A, Image: Image, Line: Line, diff --git a/spec/spec/adopter.js b/spec/spec/adopter.js index 38d55f4..6beb63b 100644 --- a/spec/spec/adopter.js +++ b/spec/spec/adopter.js @@ -71,11 +71,9 @@ describe('Adopter', function() { }) describe('with node that has no matching svg.js class', function() { - it('wraps the node in the base SVG.Element class', function() { + it('wraps the node in the Dom class', function() { var desc = SVG('#inlineSVG').find('desc')[0] - expect(desc instanceof SVG.Element).toBeTruthy() + expect(desc instanceof SVG.Dom).toBeTruthy() }) }) - - }) diff --git a/spec/spec/bare.js b/spec/spec/bare.js deleted file mode 100644 index 5601a37..0000000 --- a/spec/spec/bare.js +++ /dev/null @@ -1,41 +0,0 @@ -describe('Bare', function() { - - describe('element()', function() { - var element - - beforeEach(function() { - element = draw.element('rect') - }) - - it('creates an instance of SVG.Bare', function() { - expect(element instanceof SVG.Bare).toBeTruthy() - }) - it('creates element in called parent', function() { - expect(element.parent()).toBe(draw) - }) - // it('inherits from given parent', function() { - // expect(draw.element('g', SVG.Container).rect).toBeTruthy() - // expect(draw.element('g', SVG.Container).group).toBeTruthy() - // }) - }) - - describe('words()', function() { - it('inserts plain text in a node', function() { - var element = draw.element('title').words('These are some words.').id(null) - var result = element.svg() - expect( - result == 'These are some words.' - || result == 'These are some words.' - ).toBe(true) - }) - it('removes all nodes before adding words', function() { - var element = draw.element('title').words('These are some words.').id(null) - element.words('These are some words.') - var result = element.svg() - expect( - result == 'These are some words.' - || result == 'These are some words.' - ).toBe(true) - }) - }) -}) diff --git a/spec/spec/element.js b/spec/spec/element.js index 4845f03..6fb1ff4 100644 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -1045,4 +1045,39 @@ describe('Element', function() { })) }) }) + + describe('words()', function() { + it('inserts plain text in a node', function() { + var element = draw.element('title').words('These are some words.').id(null) + var result = element.svg() + expect( + result == 'These are some words.' + || result == 'These are some words.' + ).toBe(true) + }) + it('removes all nodes before adding words', function() { + var element = draw.element('title').words('These are some words.').id(null) + element.words('These are some words.') + var result = element.svg() + expect( + result == 'These are some words.' + || result == 'These are some words.' + ).toBe(true) + }) + }) + + describe('element()', function() { + var element + + beforeEach(function() { + element = draw.element('rect') + }) + + it('creates an instance of Dom', function() { + expect(element instanceof SVG.Dom).toBeTruthy() + }) + it('creates element in called parent', function() { + expect(element.parent()).toBe(draw) + }) + }) }) diff --git a/spec/spec/svg.js b/spec/spec/svg.js index acdd686..a3e33b5 100644 --- a/spec/spec/svg.js +++ b/spec/spec/svg.js @@ -23,15 +23,15 @@ describe('SVG', function() { expect(SVG().node.nodeName).toBe('svg') }) - it('creates an instanceof SVG.HtmlNode with html node', function() { + it('creates an instanceof SVG.Dom with html node', function() { var el = SVG(wrapperHTML) - expect(el instanceof SVG.HtmlNode).toBe(true) + expect(el instanceof SVG.Dom).toBe(true) expect(el.node).toBe(wrapperHTML) }) - it('creates new SVG.HtmlNode when called with css selector pointing to html node', function() { + it('creates new SVG.Dom when called with css selector pointing to html node', function() { var el = SVG('#testDiv') - expect(el instanceof SVG.HtmlNode).toBe(true) + expect(el instanceof SVG.Dom).toBe(true) expect(el.node).toBe(wrapperHTML) }) diff --git a/src/animation/Morphable.js b/src/animation/Morphable.js new file mode 100644 index 0000000..a02ba31 --- /dev/null +++ b/src/animation/Morphable.js @@ -0,0 +1,246 @@ +import { Ease } from './Controller.js' +import { + delimiter, + numberAndUnit, + pathLetters +} from '../modules/core/regex.js' +import { extend } from '../utils/adopter.js' +import Color from '../types/Color.js' +import PathArray from '../types/PathArray.js' +import SVGArray from '../types/SVGArray.js' +import SVGNumber from '../types/SVGNumber.js' + +export default class Morphable { + constructor (stepper) { + this._stepper = stepper || new Ease('-') + + this._from = null + this._to = null + this._type = null + this._context = null + this._morphObj = null + } + + from (val) { + if (val == null) { + return this._from + } + + this._from = this._set(val) + return this + } + + to (val) { + if (val == null) { + return this._to + } + + this._to = this._set(val) + return this + } + + type (type) { + // getter + if (type == null) { + return this._type + } + + // setter + this._type = type + return this + } + + _set (value) { + if (!this._type) { + var type = typeof value + + if (type === 'number') { + this.type(SVGNumber) + } else if (type === 'string') { + if (Color.isColor(value)) { + this.type(Color) + } else if (delimiter.test(value)) { + this.type(pathLetters.test(value) + ? PathArray + : SVGArray + ) + } else if (numberAndUnit.test(value)) { + this.type(SVGNumber) + } else { + this.type(NonMorphable) + } + } else if (morphableTypes.indexOf(value.constructor) > -1) { + this.type(value.constructor) + } else if (Array.isArray(value)) { + this.type(SVGArray) + } else if (type === 'object') { + this.type(ObjectBag) + } else { + this.type(NonMorphable) + } + } + + var result = (new this._type(value)).toArray() + this._morphObj = this._morphObj || new this._type() + this._context = this._context || + Array.apply(null, Array(result.length)).map(Object) + return result + } + + stepper (stepper) { + if (stepper == null) return this._stepper + this._stepper = stepper + return this + } + + done () { + var complete = this._context + .map(this._stepper.done) + .reduce(function (last, curr) { + return last && curr + }, true) + return complete + } + + at (pos) { + var _this = this + + return this._morphObj.fromArray( + this._from.map(function (i, index) { + return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context) + }) + ) + } +} + +export class NonMorphable { + constructor (...args) { + this.init(...args) + } + + init (val) { + val = Array.isArray(val) ? val[0] : val + this.value = val + return this + } + + valueOf () { + return this.value + } + + toArray () { + return [this.value] + } +} + +export class TransformBag { + constructor (...args) { + this.init(...args) + } + + init (obj) { + if (Array.isArray(obj)) { + obj = { + scaleX: obj[0], + scaleY: obj[1], + shear: obj[2], + rotate: obj[3], + translateX: obj[4], + translateY: obj[5], + originX: obj[6], + originY: obj[7] + } + } + + Object.assign(this, TransformBag.defaults, obj) + return this + } + + toArray () { + var v = this + + return [ + v.scaleX, + v.scaleY, + v.shear, + v.rotate, + v.translateX, + v.translateY, + v.originX, + v.originY + ] + } +} + +TransformBag.defaults = { + scaleX: 1, + scaleY: 1, + shear: 0, + rotate: 0, + translateX: 0, + translateY: 0, + originX: 0, + originY: 0 +} + +export class ObjectBag { + constructor (...args) { + this.init(...args) + } + + init (objOrArr) { + this.values = [] + + if (Array.isArray(objOrArr)) { + this.values = objOrArr + return + } + + var entries = Object.entries(objOrArr || {}).sort((a, b) => { + return a[0] - b[0] + }) + + this.values = entries.reduce((last, curr) => last.concat(curr), []) + return this + } + + valueOf () { + var obj = {} + var arr = this.values + + for (var i = 0, len = arr.length; i < len; i += 2) { + obj[arr[i]] = arr[i + 1] + } + + return obj + } + + toArray () { + return this.values + } +} + +const morphableTypes = [ + NonMorphable, + TransformBag, + ObjectBag +] + +export function registerMorphableType (type = []) { + morphableTypes.push(...[].concat(type)) +} + +export function makeMorphable () { + extend(morphableTypes, { + to (val) { + return new Morphable() + .type(this.constructor) + .from(this.valueOf()) + .to(val) + }, + fromArray (arr) { + this.init(arr) + return this + } + }) +} diff --git a/src/animation/Runner.js b/src/animation/Runner.js index 5551162..bb8d5e7 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -9,7 +9,7 @@ import Animator from './Animator.js' import Box from '../types/Box.js' import EventTarget from '../types/EventTarget.js' import Matrix from '../types/Matrix.js' -import Morphable, { TransformBag } from '../types/Morphable.js' +import Morphable, { TransformBag } from './Morphable.js' import Point from '../types/Point.js' import SVGNumber from '../types/SVGNumber.js' import Timeline from './Timeline.js' diff --git a/src/elements/Bare.js b/src/elements/Bare.js deleted file mode 100644 index a057634..0000000 --- a/src/elements/Bare.js +++ /dev/null @@ -1,31 +0,0 @@ -import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js' -import { registerMethods } from '../utils/methods.js' -import Container from './Container.js' -import { globals } from '../utils/window.js' - -export default class Bare extends Container { - constructor (node, attrs) { - super(nodeOrNew(node, typeof node === 'string' ? null : node), attrs) - } - - words (text) { - // remove contents - while (this.node.hasChildNodes()) { - this.node.removeChild(this.node.lastChild) - } - - // create text node - this.node.appendChild(globals.document.createTextNode(text)) - - return this - } -} - -register(Bare) - -registerMethods('Container', { - // Create an element that is not described by SVG.js - element: wrapWithAttrCheck(function (node) { - return this.put(new Bare(node)) - }) -}) diff --git a/src/elements/Dom.js b/src/elements/Dom.js index 2fcedce..5d7dbac 100644 --- a/src/elements/Dom.js +++ b/src/elements/Dom.js @@ -4,6 +4,7 @@ import { eid, extend, makeInstance, + makeNode, register } from '../utils/adopter.js' import { find } from '../modules/core/selector' @@ -88,6 +89,10 @@ export default class Dom extends EventTarget { return this } + element (nodeName) { + return this.put(new Dom(makeNode(nodeName))) + } + // Get first child first () { return adopt(this.node.firstChild) @@ -285,12 +290,20 @@ export default class Dom extends EventTarget { fragment.appendChild(well.firstElementChild) } + let parent = this.parent() + // Add the whole fragment at once return outerHTML - ? this.replace(fragment) + ? this.replace(fragment) && parent : this.add(fragment) } + words (text) { + // This is faster than removing all children and adding a new one + this.node.textContent = text + return this + } + // write svgjs data to the dom writeDataToDom () { // dump variables recursively diff --git a/src/elements/HtmlNode.js b/src/elements/HtmlNode.js deleted file mode 100644 index 009b122..0000000 --- a/src/elements/HtmlNode.js +++ /dev/null @@ -1,6 +0,0 @@ -import { register } from '../utils/adopter.js' -import Dom from './Dom.js' - -export default class HtmlNode extends Dom {} - -register(HtmlNode) diff --git a/src/elements/Style.js b/src/elements/Style.js index 50ec50e..0b1cdb7 100644 --- a/src/elements/Style.js +++ b/src/elements/Style.js @@ -23,8 +23,8 @@ export default class Style extends Element { super(nodeOrNew('style', node), node) } - words (w) { - this.node.textContent += (w || '') + addText (w = '') { + this.node.textContent += w return this } @@ -37,7 +37,7 @@ export default class Style extends Element { } rule (selector, obj) { - return this.words(cssRule(selector, obj)) + return this.addText(cssRule(selector, obj)) } } diff --git a/src/main.js b/src/main.js index 919fb25..696dfdd 100644 --- a/src/main.js +++ b/src/main.js @@ -30,7 +30,7 @@ import Morphable, { TransformBag, makeMorphable, registerMorphableType -} from './types/Morphable.js' +} from './animation/Morphable.js' import Path from './elements/Path.js' import PathArray from './types/PathArray.js' import Pattern from './elements/Pattern.js' @@ -85,7 +85,6 @@ export { default as PointArray } from './types/PointArray.js' export { default as List } from './types/List.js' /* Elements */ -export { default as Bare } from './elements/Bare.js' export { default as Circle } from './elements/Circle.js' export { default as ClipPath } from './elements/ClipPath.js' export { default as Container } from './elements/Container.js' @@ -95,7 +94,6 @@ export { default as Element } from './elements/Element.js' export { default as Ellipse } from './elements/Ellipse.js' export { default as Gradient } from './elements/Gradient.js' export { default as G } from './elements/G.js' -export { default as HtmlNode } from './elements/HtmlNode.js' export { default as A } from './elements/A.js' export { default as Image } from './elements/Image.js' export { default as Line } from './elements/Line.js' diff --git a/src/types/Morphable.js b/src/types/Morphable.js deleted file mode 100644 index 703cc00..0000000 --- a/src/types/Morphable.js +++ /dev/null @@ -1,246 +0,0 @@ -import { Ease } from '../animation/Controller.js' -import { - delimiter, - numberAndUnit, - pathLetters -} from '../modules/core/regex.js' -import { extend } from '../utils/adopter.js' -import Color from './Color.js' -import PathArray from './PathArray.js' -import SVGArray from './SVGArray.js' -import SVGNumber from './SVGNumber.js' - -export default class Morphable { - constructor (stepper) { - this._stepper = stepper || new Ease('-') - - this._from = null - this._to = null - this._type = null - this._context = null - this._morphObj = null - } - - from (val) { - if (val == null) { - return this._from - } - - this._from = this._set(val) - return this - } - - to (val) { - if (val == null) { - return this._to - } - - this._to = this._set(val) - return this - } - - type (type) { - // getter - if (type == null) { - return this._type - } - - // setter - this._type = type - return this - } - - _set (value) { - if (!this._type) { - var type = typeof value - - if (type === 'number') { - this.type(SVGNumber) - } else if (type === 'string') { - if (Color.isColor(value)) { - this.type(Color) - } else if (delimiter.test(value)) { - this.type(pathLetters.test(value) - ? PathArray - : SVGArray - ) - } else if (numberAndUnit.test(value)) { - this.type(SVGNumber) - } else { - this.type(NonMorphable) - } - } else if (morphableTypes.indexOf(value.constructor) > -1) { - this.type(value.constructor) - } else if (Array.isArray(value)) { - this.type(SVGArray) - } else if (type === 'object') { - this.type(ObjectBag) - } else { - this.type(NonMorphable) - } - } - - var result = (new this._type(value)).toArray() - this._morphObj = this._morphObj || new this._type() - this._context = this._context || - Array.apply(null, Array(result.length)).map(Object) - return result - } - - stepper (stepper) { - if (stepper == null) return this._stepper - this._stepper = stepper - return this - } - - done () { - var complete = this._context - .map(this._stepper.done) - .reduce(function (last, curr) { - return last && curr - }, true) - return complete - } - - at (pos) { - var _this = this - - return this._morphObj.fromArray( - this._from.map(function (i, index) { - return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context) - }) - ) - } -} - -export class NonMorphable { - constructor (...args) { - this.init(...args) - } - - init (val) { - val = Array.isArray(val) ? val[0] : val - this.value = val - return this - } - - valueOf () { - return this.value - } - - toArray () { - return [this.value] - } -} - -export class TransformBag { - constructor (...args) { - this.init(...args) - } - - init (obj) { - if (Array.isArray(obj)) { - obj = { - scaleX: obj[0], - scaleY: obj[1], - shear: obj[2], - rotate: obj[3], - translateX: obj[4], - translateY: obj[5], - originX: obj[6], - originY: obj[7] - } - } - - Object.assign(this, TransformBag.defaults, obj) - return this - } - - toArray () { - var v = this - - return [ - v.scaleX, - v.scaleY, - v.shear, - v.rotate, - v.translateX, - v.translateY, - v.originX, - v.originY - ] - } -} - -TransformBag.defaults = { - scaleX: 1, - scaleY: 1, - shear: 0, - rotate: 0, - translateX: 0, - translateY: 0, - originX: 0, - originY: 0 -} - -export class ObjectBag { - constructor (...args) { - this.init(...args) - } - - init (objOrArr) { - this.values = [] - - if (Array.isArray(objOrArr)) { - this.values = objOrArr - return - } - - var entries = Object.entries(objOrArr || {}).sort((a, b) => { - return a[0] - b[0] - }) - - this.values = entries.reduce((last, curr) => last.concat(curr), []) - return this - } - - valueOf () { - var obj = {} - var arr = this.values - - for (var i = 0, len = arr.length; i < len; i += 2) { - obj[arr[i]] = arr[i + 1] - } - - return obj - } - - toArray () { - return this.values - } -} - -const morphableTypes = [ - NonMorphable, - TransformBag, - ObjectBag -] - -export function registerMorphableType (type = []) { - morphableTypes.push(...[].concat(type)) -} - -export function makeMorphable () { - extend(morphableTypes, { - to (val) { - return new Morphable() - .type(this.constructor) - .from(this.valueOf()) - .to(val) - }, - fromArray (arr) { - this.init(arr) - return this - } - }) -} diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 6109f22..52d589e 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -50,19 +50,16 @@ export function adopt (node) { // make sure a node isn't already adopted if (node.instance instanceof Base) return node.instance - if (!(node instanceof globals.window.SVGElement)) { - return new elements.HtmlNode(node) - } - // initialize variables var className = capitalize(node.nodeName) + // Make sure that gradients are adopted correctly if (className === 'LinearGradient' || className === 'RadialGradient') { className = 'Gradient' - } - if (!elements[className]) { - className = 'Bare' + // Fallback to Dom if element is not known + } else if (!elements[className]) { + className = 'Dom' } return new elements[className](node) -- cgit v1.2.3 From f5413db6783d197ed5e7967957e89833a7d3c173 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sat, 24 Nov 2018 14:35:14 +0100 Subject: Moved utils, namespaces, regex... to a subobject of SVG. Renamed SVGArray and SVGNumber on export to Array and Number --- dist/svg.js | 52 ++++---- spec/spec/adopter.js | 4 +- spec/spec/array.js | 14 +-- spec/spec/element.js | 6 +- spec/spec/fx.js | 22 ++-- spec/spec/morphing.js | 32 ++--- spec/spec/number.js | 36 +++--- spec/spec/sugar.js | 12 +- spec/spec/text.js | 4 +- spec/spec/transformations.js | 281 ------------------------------------------- spec/spec/use.js | 8 +- src/main.js | 14 ++- src/svg.js | 5 - 13 files changed, 107 insertions(+), 383 deletions(-) delete mode 100644 spec/spec/transformations.js (limited to 'src') diff --git a/dist/svg.js b/dist/svg.js index 701b906..eb0d90d 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Sat Nov 24 2018 11:07:45 GMT+0100 (GMT+01:00) +* BUILT: Sat Nov 24 2018 14:31:28 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -372,12 +372,31 @@ var SVG = (function () { return [ox, oy]; } + var utils = /*#__PURE__*/Object.freeze({ + map: map, + filter: filter, + radians: radians, + degrees: degrees, + camelCase: camelCase, + unCamelCase: unCamelCase, + capitalize: capitalize, + proportionalSize: proportionalSize, + getOrigin: getOrigin + }); + // Default namespaces 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 namespaces = /*#__PURE__*/Object.freeze({ + ns: ns, + xmlns: xmlns, + xlink: xlink, + svgjs: svgjs + }); + var globals = { window: typeof window === 'undefined' ? null : window, document: typeof document === 'undefined' ? null : document @@ -6999,6 +7018,7 @@ var SVG = (function () { register(Use); /* Optional Modules */ + var SVG = makeInstance; extend([Svg$1, Symbol, Image, Pattern, Marker], getMethodsFor('viewbox')); extend([Line, Polyline, Polygon, Path], getMethodsFor('marker')); extend(Text, getMethodsFor('Text')); @@ -7025,6 +7045,10 @@ var SVG = (function () { ObjectBag: ObjectBag, NonMorphable: NonMorphable, defaults: defaults, + utils: utils, + namespaces: namespaces, + regex: regex, + SVG: SVG, parser: parser, find: baseFind, registerWindow: registerWindow, @@ -7037,12 +7061,12 @@ var SVG = (function () { Queue: Queue, Runner: Runner, Timeline: Timeline, - SVGArray: SVGArray, + Array: SVGArray, Box: Box, Color: Color, EventTarget: EventTarget, Matrix: Matrix, - SVGNumber: SVGNumber, + Number: SVGNumber, PathArray: PathArray, Point: Point, PointArray: PointArray, @@ -7075,19 +7099,6 @@ var SVG = (function () { TextPath: TextPath, Tspan: Tspan, Use: Use, - map: map, - filter: filter, - radians: radians, - degrees: degrees, - camelCase: camelCase, - unCamelCase: unCamelCase, - capitalize: capitalize, - proportionalSize: proportionalSize, - getOrigin: getOrigin, - ns: ns, - xmlns: xmlns, - xlink: xlink, - svgjs: svgjs, on: on, off: off, dispatch: dispatch, @@ -7105,14 +7116,11 @@ var SVG = (function () { wrapWithAttrCheck: wrapWithAttrCheck }); - function SVG(element) { + function SVG$1(element) { return makeInstance(element); } - Object.assign(SVG, svgMembers); - SVG.utils = SVG; - SVG.regex = regex; - SVG.get = SVG; + Object.assign(SVG$1, svgMembers); - return SVG; + return SVG$1; }()); diff --git a/spec/spec/adopter.js b/spec/spec/adopter.js index 6beb63b..05c1517 100644 --- a/spec/spec/adopter.js +++ b/spec/spec/adopter.js @@ -14,13 +14,13 @@ describe('Adopter', function() { expect(path.parent() instanceof SVG.Svg).toBeTruthy() }) it('defines a xmlns attribute', function() { - expect(path.parent().node.getAttribute('xmlns')).toBe(SVG.ns) + expect(path.parent().node.getAttribute('xmlns')).toBe(SVG.namespaces.ns) }) it('defines a version attribute', function() { expect(path.parent().node.getAttribute('version')).toBe('1.1') }) it('defines a xmlns:xlink attribute', function() { - expect(path.parent().node.getAttribute('xmlns:xlink')).toBe(SVG.xlink) + expect(path.parent().node.getAttribute('xmlns:xlink')).toBe(SVG.namespaces.xlink) }) it('initializes a defs node', function() { expect(path.defs() instanceof SVG.Defs).toBe(true) diff --git a/spec/spec/array.js b/spec/spec/array.js index eeccdca..03cffa3 100644 --- a/spec/spec/array.js +++ b/spec/spec/array.js @@ -2,7 +2,7 @@ describe('Array', function () { var array, arr1, arr2 it('parses a matrix array correctly to string', function() { - array = new SVG.SVGArray([ .343, .669, .119, 0, 0 + array = new SVG.Array([ .343, .669, .119, 0, 0 , .249, -.626, .130, 0, 0 , .172, .334, .111, 0, 0 , .000, .000, .000, 1, -0 ]) @@ -10,31 +10,31 @@ describe('Array', function () { expect(array + '').toBe('0.343 0.669 0.119 0 0 0.249 -0.626 0.13 0 0 0.172 0.334 0.111 0 0 0 0 0 1 0') }) it('parses space seperated string and converts it to array', function() { - expect((new SVG.SVGArray('1 2 3 4')).valueOf()).toEqual([1,2,3,4]) + expect((new SVG.Array('1 2 3 4')).valueOf()).toEqual([1,2,3,4]) }) it('parses comma seperated string and converts it to array', function() { - expect((new SVG.SVGArray('1,2,3,4')).valueOf()).toEqual([1,2,3,4]) + expect((new SVG.Array('1,2,3,4')).valueOf()).toEqual([1,2,3,4]) }) describe('reverse()', function() { it('reverses the array', function() { - array = new SVG.SVGArray([1 ,2 ,3, 4, 5]).reverse() + array = new SVG.Array([1 ,2 ,3, 4, 5]).reverse() expect(array.valueOf()).toEqual([5, 4, 3, 2, 1]) }) it('returns itself', function() { - array = new SVG.SVGArray() + array = new SVG.Array() expect(array.reverse()).toBe(array) }) }) describe('clone()', function() { it('creates a deep clone of the array', function() { - array = new SVG.SVGArray([1, 2, 3, 4, 5]) + array = new SVG.Array([1, 2, 3, 4, 5]) clone = array.clone() expect(array).toEqual(clone) expect(array).not.toBe(clone) - array = new SVG.SVGArray([[1,2], [3, 4], [5]]) + array = new SVG.Array([[1,2], [3, 4], [5]]) clone = array.clone() expect(array).toEqual(array) diff --git a/spec/spec/element.js b/spec/spec/element.js index 6fb1ff4..8d685a4 100644 --- a/spec/spec/element.js +++ b/spec/spec/element.js @@ -111,7 +111,7 @@ describe('Element', function() { expect(draw.defs().find('pattern image').length).toBe(1) expect(draw.defs().find('pattern image')[0].attr('href')).toBe(imageUrl) }) - it('correctly creates SVG.SVGArray if array given', function() { + it('correctly creates SVG.Array if array given', function() { rect.attr('something', [2,3,4]) expect(rect.attr('something')).toBe('2 3 4') }) @@ -939,7 +939,7 @@ describe('Element', function() { it('set all properties in el.dom to the svgjs:data attribute', function(){ var rect = draw.rect(100,100) rect.dom.foo = 'bar' - rect.dom.number = new SVG.SVGNumber('3px') + rect.dom.number = new SVG.Number('3px') rect.writeDataToDom() @@ -949,7 +949,7 @@ describe('Element', function() { var g = draw.group() rect = g.rect(100,100) g.dom.foo = 'bar' - rect.dom.number = new SVG.SVGNumber('3px') + rect.dom.number = new SVG.Number('3px') g.writeDataToDom() diff --git a/spec/spec/fx.js b/spec/spec/fx.js index cc4e6d8..365a196 100644 --- a/spec/spec/fx.js +++ b/spec/spec/fx.js @@ -2143,7 +2143,7 @@ // it('should be possible to animate numeric attributes', function () { // var startValue = 0 // , endValue = 150 -// , morph = new SVG.SVGNumber(startValue).morph(endValue) +// , morph = new SVG.Number(startValue).morph(endValue) // // var text = draw.text(function(add) { // add.tspan('We go ') @@ -2213,7 +2213,7 @@ // it('should be possible to pass percentage strings to numeric attributes', function () { // var startValue = '0%' // , endValue = '80%' -// , morph = new SVG.SVGNumber(startValue).morph(endValue) +// , morph = new SVG.Number(startValue).morph(endValue) // // var text = draw.text(function(add) { // add.tspan('We go ') @@ -2288,7 +2288,7 @@ // it('should be possible to animate numeric styles', function () { // var startValue = 0 // , endValue = 5 -// , morph = new SVG.SVGNumber(startValue).morph(endValue) +// , morph = new SVG.Number(startValue).morph(endValue) // // rect.css('stroke-width', startValue) // fx.css('stroke-width', endValue) @@ -2352,7 +2352,7 @@ // it('should be possible to pass percentage strings to numeric styles', function () { // var startValue = '0%' // , endValue = '5%' -// , morph = new SVG.SVGNumber(startValue).morph(endValue) +// , morph = new SVG.Number(startValue).morph(endValue) // // rect.css('stroke-width', startValue) // fx.css('stroke-width', endValue) @@ -2398,14 +2398,14 @@ // // describe('add()', function() { // it('adds to animations obj by default', function() { -// fx.add('x', new SVG.SVGNumber(20)) +// fx.add('x', new SVG.Number(20)) // expect(fx.situation.animations.x.value).toBe(20) // }) // // it('adds to specified obj', function() { -// fx.add('x', new SVG.SVGNumber(20), 'animations') -// fx.add('x', new SVG.SVGNumber(20), 'attrs') -// fx.add('x', new SVG.SVGNumber(20), 'styles') +// fx.add('x', new SVG.Number(20), 'animations') +// fx.add('x', new SVG.Number(20), 'attrs') +// fx.add('x', new SVG.Number(20), 'styles') // expect(fx.situation.animations.x.value).toBe(20) // expect(fx.situation.attrs.x.value).toBe(20) // expect(fx.situation.styles.x.value).toBe(20) @@ -2836,12 +2836,12 @@ // expect(obj instanceof SVG.Color).toBeTruthy() // }) // -// it('accepts numbers and converts them to SVG.SVGNumber', function() { +// it('accepts numbers and converts them to SVG.Number', function() { // var obj = new SVG.MorphObj('0', '10') -// expect(obj instanceof SVG.SVGNumber).toBeTruthy() +// expect(obj instanceof SVG.Number).toBeTruthy() // // var obj = new SVG.MorphObj(0, 10) -// expect(obj instanceof SVG.SVGNumber).toBeTruthy() +// expect(obj instanceof SVG.Number).toBeTruthy() // }) // // it('accepts any other values', function() { diff --git a/spec/spec/morphing.js b/spec/spec/morphing.js index 7fc0c06..0557428 100644 --- a/spec/spec/morphing.js +++ b/spec/spec/morphing.js @@ -5,8 +5,8 @@ describe('Morphing', function () { var morpher = new SVG.Morphable().from(10).to(5) expect(morpher instanceof SVG.Morphable).toBe(true) - expect(morpher.type()).toBe(SVG.SVGNumber) - expect(morpher.at(0.5) instanceof SVG.SVGNumber).toBe(true) + expect(morpher.type()).toBe(SVG.Number) + expect(morpher.at(0.5) instanceof SVG.Number).toBe(true) expect(morpher.at(0.5).valueOf()).toBe(7.5) }) @@ -29,12 +29,12 @@ describe('Morphing', function () { expect(morpher.at(0.5).valueOf()).toEqual(jasmine.objectContaining({a: 7.5, b: 15})) }) - it(`Creates a morphable out of an SVG.SVGNumber`, function () { - var morpher = new SVG.SVGNumber(5).to(10) + it(`Creates a morphable out of an SVG.Number`, function () { + var morpher = new SVG.Number(5).to(10) expect(morpher instanceof SVG.Morphable).toBe(true) - expect(morpher.type()).toBe(SVG.SVGNumber) - expect(morpher.at(0.5) instanceof SVG.SVGNumber).toBe(true) + expect(morpher.type()).toBe(SVG.Number) + expect(morpher.at(0.5) instanceof SVG.Number).toBe(true) expect(morpher.at(0.5).valueOf()).toBe(7.5) }) @@ -65,12 +65,12 @@ describe('Morphing', function () { expect(morpher.at(0.5)).toEqual(jasmine.objectContaining(new SVG.Matrix(2, 3, 4, 5, 6, 7))) }) - it(`Creates a morphable out of an SVG.SVGArray`, function () { - var morpher = new SVG.SVGArray([1,2,3,4,5,6]).to([3,4,5,6,7,8]) + it(`Creates a morphable out of an SVG.Array`, function () { + var morpher = new SVG.Array([1,2,3,4,5,6]).to([3,4,5,6,7,8]) expect(morpher instanceof SVG.Morphable).toBe(true) - expect(morpher.type()).toBe(SVG.SVGArray) - expect(morpher.at(0.5) instanceof SVG.SVGArray).toBe(true) + expect(morpher.type()).toBe(SVG.Array) + expect(morpher.at(0.5) instanceof SVG.Array).toBe(true) expect(morpher.at(0.5).toArray()).toEqual(jasmine.arrayContaining([2, 3, 4, 5, 6, 7])) }) @@ -126,7 +126,7 @@ describe('Morphing', function () { describe('from()', function () { it('sets the type of the runner', function () { var morpher = new SVG.Morphable().from(5) - expect(morpher.type()).toBe(SVG.SVGNumber) + expect(morpher.type()).toBe(SVG.Number) }) it('sets the from attribute to an array representation of the morphable type', function () { @@ -137,20 +137,20 @@ describe('Morphing', function () { describe('type()', function () { it('sets the type of the runner', function () { - var morpher = new SVG.Morphable().type(SVG.SVGNumber) - expect(morpher._type).toBe(SVG.SVGNumber) + var morpher = new SVG.Morphable().type(SVG.Number) + expect(morpher._type).toBe(SVG.Number) }) it('gets the type of the runner', function () { - var morpher = new SVG.Morphable().type(SVG.SVGNumber) - expect(morpher.type()).toBe(SVG.SVGNumber) + var morpher = new SVG.Morphable().type(SVG.Number) + expect(morpher.type()).toBe(SVG.Number) }) }) describe('to()', function () { it('sets the type of the runner', function () { var morpher = new SVG.Morphable().to(5) - expect(morpher.type()).toBe(SVG.SVGNumber) + expect(morpher.type()).toBe(SVG.Number) }) it('sets the from attribute to an array representation of the morphable type', function () { diff --git a/spec/spec/number.js b/spec/spec/number.js index a6ae80e..eb98fd5 100644 --- a/spec/spec/number.js +++ b/spec/spec/number.js @@ -2,7 +2,7 @@ describe('Number', function() { var number beforeEach(function() { - number = new SVG.SVGNumber + number = new SVG.Number }) describe('new', function() { @@ -13,40 +13,40 @@ describe('Number', function() { expect(number.unit).toBe('') }) it('accepts the unit as a second argument', function() { - number = new SVG.SVGNumber(30, '%') + number = new SVG.Number(30, '%') expect(number.value).toBe(30) expect(number.unit).toBe('%') }) it('parses a pixel value', function() { - number = new SVG.SVGNumber('20px') + number = new SVG.Number('20px') expect(number.value).toBe(20) expect(number.unit).toBe('px') }) it('parses a percent value', function() { - number = new SVG.SVGNumber('99%') + number = new SVG.Number('99%') expect(number.value).toBe(0.99) expect(number.unit).toBe('%') }) it('parses a seconds value', function() { - number = new SVG.SVGNumber('2s') + number = new SVG.Number('2s') expect(number.value).toBe(2000) expect(number.unit).toBe('s') }) it('parses a negative percent value', function() { - number = new SVG.SVGNumber('-89%') + number = new SVG.Number('-89%') expect(number.value).toBe(-0.89) expect(number.unit).toBe('%') }) it('falls back to 0 if given value is NaN', function() { - number = new SVG.SVGNumber(NaN) + number = new SVG.Number(NaN) expect(number.value).toBe(0) }) it('falls back to maximum value if given number is positive infinite', function() { - number = new SVG.SVGNumber(1.7976931348623157E+10308) + number = new SVG.Number(1.7976931348623157E+10308) expect(number.value).toBe(3.4e+38) }) it('falls back to minimum value if given number is negative infinite', function() { - number = new SVG.SVGNumber(-1.7976931348623157E+10308) + number = new SVG.Number(-1.7976931348623157E+10308) expect(number.value).toBe(-3.4e+38) }) }) @@ -75,17 +75,17 @@ describe('Number', function() { describe('valueOf()', function() { it('returns a numeric value for default units', function() { expect(typeof number.valueOf()).toBe('number') - number = new SVG.SVGNumber('12') + number = new SVG.Number('12') expect(typeof number.valueOf()).toBe('number') - number = new SVG.SVGNumber(13) + number = new SVG.Number(13) expect(typeof number.valueOf()).toBe('number') }) it('returns a numeric value for pixel units', function() { - number = new SVG.SVGNumber('10px') + number = new SVG.Number('10px') expect(typeof number.valueOf()).toBe('number') }) it('returns a numeric value for percent units', function() { - number = new SVG.SVGNumber('20%') + number = new SVG.Number('20%') expect(typeof number.valueOf()).toBe('number') }) it('converts to a primitive when multiplying', function() { @@ -97,7 +97,7 @@ describe('Number', function() { describe('plus()', function() { it('returns a new instance', function() { expect(number.plus(4.5)).not.toBe(number) - expect(number.plus(4.5) instanceof SVG.SVGNumber).toBeTruthy() + expect(number.plus(4.5) instanceof SVG.Number).toBeTruthy() }) it('adds a given number', function() { expect(number.plus(3.5).valueOf()).toBe(3.5) @@ -109,7 +109,7 @@ describe('Number', function() { expect(number.plus('83px').valueOf()).toBe(83) }) it('use the unit of this number as the unit of the returned number by default', function (){ - expect(new SVG.SVGNumber('12s').plus('3%').unit).toBe('s') + expect(new SVG.Number('12s').plus('3%').unit).toBe('s') }) it('use the unit of the passed number as the unit of the returned number when this number as no unit', function() { expect(number.plus('15%').unit).toBe('%') @@ -127,7 +127,7 @@ describe('Number', function() { expect(number.minus('85px').valueOf()).toBe(-85) }) it('use the unit of this number as the unit of the returned number by default', function (){ - expect(new SVG.SVGNumber('12s').minus('3%').unit).toBe('s') + expect(new SVG.Number('12s').minus('3%').unit).toBe('s') }) it('use the unit of the passed number as the unit of the returned number when this number as no unit', function() { expect(number.minus('15%').unit).toBe('%') @@ -148,7 +148,7 @@ describe('Number', function() { expect(number.times('85px').valueOf()).toBe(340) }) it('use the unit of this number as the unit of the returned number by default', function (){ - expect(new SVG.SVGNumber('12s').times('3%').unit).toBe('s') + expect(new SVG.Number('12s').times('3%').unit).toBe('s') }) it('use the unit of the passed number as the unit of the returned number when this number as no unit', function() { expect(number.times('15%').unit).toBe('%') @@ -169,7 +169,7 @@ describe('Number', function() { expect(number.divide('45px').valueOf()).toBe(2) }) it('use the unit of this number as the unit of the returned number by default', function (){ - expect(new SVG.SVGNumber('12s').divide('3%').unit).toBe('s') + expect(new SVG.Number('12s').divide('3%').unit).toBe('s') }) it('use the unit of the passed number as the unit of the returned number when this number as no unit', function() { expect(number.divide('15%').unit).toBe('%') diff --git a/spec/spec/sugar.js b/spec/spec/sugar.js index 906dfe7..704643d 100644 --- a/spec/spec/sugar.js +++ b/spec/spec/sugar.js @@ -247,8 +247,8 @@ describe('Sugar', function() { it('redirects to x() / y() with adding the current value', function() { rect.dx(5) rect.dy(5) - expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('5'))) - expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('5'))) + expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('5'))) + expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('5'))) }) it('allows to add a percentage value', function() { @@ -257,16 +257,16 @@ describe('Sugar', function() { rect.dx('5%') rect.dy('5%') - expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('10%'))) - expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('10%'))) + expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('10%'))) + expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('10%'))) }) it('allows to add a percentage value when no x/y is set', function() { rect.dx('5%') rect.dy('5%') - expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('5%'))) - expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.SVGNumber('5%'))) + expect(rect.x).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('5%'))) + expect(rect.y).toHaveBeenCalledWith(jasmine.objectContaining(new SVG.Number('5%'))) }) }) diff --git a/spec/spec/text.js b/spec/spec/text.js index b5d0b59..a541e98 100644 --- a/spec/spec/text.js +++ b/spec/spec/text.js @@ -15,7 +15,7 @@ describe('Text', function() { describe('leading()', function() { it('returns the leading value of the text without an argument', function() { - expect(text.leading() instanceof SVG.SVGNumber) + expect(text.leading() instanceof SVG.Number) expect(text.leading().valueOf()).toBe(1.3) }) it('sets the leading value of the text with the first argument', function() { @@ -283,7 +283,7 @@ describe('Text', function() { text.setData(JSON.parse(text.attr('svgjs:data'))) expect(text.dom.foo).toBe('bar') - expect(text.dom.leading instanceof SVG.SVGNumber).toBeTruthy() + expect(text.dom.leading instanceof SVG.Number).toBeTruthy() expect(text.dom.leading.value).toBe(3) expect(text.dom.leading.unit).toBe('px') }) diff --git a/spec/spec/transformations.js b/spec/spec/transformations.js deleted file mode 100644 index 242e798..0000000 --- a/spec/spec/transformations.js +++ /dev/null @@ -1,281 +0,0 @@ -// describe('Transformations:', function() { -// var translated, scaled, rotated, skewed -// -// beforeEach(function() { -// translated = draw.rect(100,100).translate(100,100) -// scaled = draw.rect(100,100).scale(2) -// rotated = draw.rect(100,100).rotate(45, 50, 50) -// skewed = draw.rect(100,100).skew(30) -// }) -// -// /* SVG.Transformation is not tested because it is an abstract prototype */ -// -// describe('SVG.Transformation', function() { -// it('marks the transformation as inversed when inverse flag given', function() { -// var trans = new SVG.Transformation([], true) -// expect(trans.inversed).toBeTruthy() -// }) -// }) -// -// describe('SVG.Translate', function() { -// var trans -// -// beforeEach(function(){ -// trans = new SVG.Translate(translated.transform()) -// }) -// -// -// it('creates an object of type SVG.Transformation', function() { -// expect(trans instanceof SVG.Transformation).toBeTruthy() -// }) -// -// it('uses transformedX and transformedY as arguments', function() { -// expect(trans.arguments).toEqual(['transformedX', 'transformedY']) -// }) -// -// it('s method is translate()', function() { -// expect(trans.method).toEqual('translate') -// }) -// -// it('sets the necessary parameters at creation', function() { -// expect(trans.transformedX).toBe(100) -// expect(trans.transformedY).toBe(100) -// }) -// -// describe('undo', function() { -// it('sets the undo matrix which can undo the translation', function() { -// var extracted = (new SVG.Matrix(1,0,0,1,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.toString()).toEqual('matrix(1,0,0,1,-20,-20)') -// -// var extracted = (new SVG.Matrix(10,0,0,10,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.toString()).toEqual('matrix(1,0,0,1,-2,-2)') -// -// var extracted = (new SVG.Matrix(10,50,50,30,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.e).toBeCloseTo(-extracted.transformedX) -// expect(trans._undo.f).toBeCloseTo(-extracted.transformedY) -// }) -// }) -// -// describe('at', function() { -// it('creates a matrix at a certain position', function() { -// expect(trans.at(0.3).toString()).toEqual('matrix(1,0,0,1,30,30)') -// }) -// it('returns the inversed matrix from a specific position when created with inverse flag', function() { -// expect((new SVG.Translate(translated.transform(), true)).at(0.3).toString()).toEqual('matrix(1,0,0,1,-30,-30)') -// }) -// it('returns the resulting transformation which has to be made to set an absolute translation', function() { -// trans.undo(new SVG.Matrix(10,50,50,30,20,20).extract()) -// -// expect(trans.at(0.4).a).toEqual(1) -// expect(trans.at(0.4).b).toEqual(0) -// expect(trans.at(0.4).c).toEqual(0) -// expect(trans.at(0.4).d).toEqual(1) -// expect(trans.at(0.4).e).toBeCloseTo(100 * 0.4 + trans._undo.e * 0.4) -// expect(trans.at(0.4).f).toBeCloseTo(100 * 0.4 + trans._undo.f * 0.4) -// }) -// }) -// }) -// -// describe('SVG.Rotate', function() { -// var trans -// -// beforeEach(function(){ -// trans = new SVG.Rotate(45, 50, 50) -// }) -// -// -// it('creates an object of type SVG.Transformation', function() { -// expect(trans instanceof SVG.Transformation).toBeTruthy() -// }) -// -// it('uses rotation, cx and cy as arguments', function() { -// expect(trans.arguments).toEqual(['rotation', 'cx', 'cy']) -// }) -// -// it('s method is rotate()', function() { -// expect(trans.method).toEqual('rotate') -// }) -// -// it('sets the necessary parameters at creation', function() { -// expect(trans.rotation).toBe(45) -// expect(trans.cx).toBe(50) -// expect(trans.cy).toBe(50) -// }) -// -// describe('undo', function() { -// it('sets an undo object which holds rotation', function() { -// var extracted = (new SVG.Matrix(1,0,0,1,0,0)).rotate(20, 50, 50).extract() -// trans.undo(extracted) -// expect(trans._undo.rotation).toBeCloseTo(20) -// }) -// }) -// -// describe('at', function() { -// it('creates a matrix at a certain position', function() { -// expect(trans.at(0.3).toString()).toEqual((new SVG.Matrix()).rotate(0.3 * 45, 50, 50).toString()) -// }) -// it('returns the resulting transformation which has to be made to set an absolute translation', function() { -// trans.undo((new SVG.Matrix()).rotate(20, 50, 50).extract()) -// -// expect(trans.at(0.4).a).toBeCloseTo(1,1) -// expect(trans.at(0.4).b).toEqual(jasmine.any(Number)) -// expect(trans.at(0.4).c).toEqual(jasmine.any(Number)) -// expect(trans.at(0.4).d).toBeCloseTo(1,1) -// expect(trans.at(0.4).e).toEqual(jasmine.any(Number)) -// expect(trans.at(0.4).f).toEqual(jasmine.any(Number)) -// }) -// }) -// }) -// -// -// describe('SVG.Scale', function() { -// var trans -// -// beforeEach(function(){ -// trans = new SVG.Scale(2,2,50,50) -// }) -// -// -// it('creates an object of type SVG.Transformation', function() { -// expect(trans instanceof SVG.Transformation).toBeTruthy() -// }) -// -// it('uses scaleX, scaleY, cx and cy as arguments', function() { -// expect(trans.arguments).toEqual(['scaleX', 'scaleY', 'cx', 'cy']) -// }) -// -// it('s method is scale()', function() { -// expect(trans.method).toEqual('scale') -// }) -// -// it('sets the necessary parameters at creation', function() { -// expect(trans.scaleX).toBe(2) -// expect(trans.scaleY).toBe(2) -// expect(trans.cx).toBe(50) -// expect(trans.cy).toBe(50) -// }) -// -// describe('undo', function() { -// it('sets the undo matrix which can undo the translation', function() { -// var extracted = (new SVG.Matrix(4,0,0,4,0,0)).extract() -// trans.undo(extracted) -// expect(trans._undo.toString()).toEqual('matrix(0.25,0,0,0.25,37.5,37.5)') -// -// var extracted = (new SVG.Matrix(10,0,0,10,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.a).toBeCloseTo(1/extracted.scaleX) -// expect(trans._undo.d).toBeCloseTo(1/extracted.scaleY) -// expect(trans._undo.e).toBeCloseTo(45) -// expect(trans._undo.f).toBeCloseTo(45) -// -// var extracted = (new SVG.Matrix(10,50,50,30,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.a).toBeCloseTo(1/extracted.scaleX) -// expect(trans._undo.d).toBeCloseTo(1/extracted.scaleY) -// }) -// }) -// -// describe('at', function() { -// it('creates a matrix at a certain position', function() { -// expect(trans.at(0.75).toString()).toEqual('matrix(1.75,0,0,1.75,-37.5,-37.5)') -// }) -// it('returns the inversed matrix from a specific position when created with inverse flag', function() { -// var morphed = (new SVG.Scale(scaled.transform(2,2,50,50), true)).at(0.25) -// -// expect(morphed.a).toBeCloseTo(0.8) -// expect(morphed.d).toBeCloseTo(0.8) -// }) -// it('returns the resulting transformation which has to be made to set an absolute translation', function() { -// -// var morphed = trans.undo((new SVG.Matrix(10,0,0,10,0,0)).extract()).at(0.5) -// -// expect(morphed.a).toBeCloseTo(0.6) -// expect(morphed.b).toEqual(0) -// expect(morphed.c).toEqual(0) -// expect(morphed.d).toBeCloseTo(0.6) -// expect(morphed.e).toBeCloseTo(20) -// expect(morphed.f).toBeCloseTo(20) -// }) -// }) -// }) -// -// describe('SVG.Skew', function() { -// var trans -// -// beforeEach(function(){ -// trans = new SVG.Skew(30,-30,50,50) -// }) -// -// -// it('creates an object of type SVG.Transformation', function() { -// expect(trans instanceof SVG.Transformation).toBeTruthy() -// }) -// -// it('uses scaleX, scaleY, cx and cy as arguments', function() { -// expect(trans.arguments).toEqual(['skewX', 'skewY', 'cx', 'cy']) -// }) -// -// it('s method is skew()', function() { -// expect(trans.method).toEqual('skew') -// }) -// -// it('sets the necessary parameters at creation', function() { -// expect(trans.skewX).toBe(30) -// expect(trans.skewY).toBe(-30) -// expect(trans.cx).toBe(50) -// expect(trans.cy).toBe(50) -// }) -// -// describe('undo', function() { -// it('sets the undo matrix which can undo the translation', function() { -// var extracted = (new SVG.Matrix()).skew(90, 90, 0, 0).extract() -// trans.undo(extracted) -// expect(trans._undo.a).toBeCloseTo(0) -// expect(trans._undo.b).toBeCloseTo(0) -// expect(trans._undo.c).toBeCloseTo(0) -// expect(trans._undo.d).toBeCloseTo(0) -// expect(trans._undo.e).toBeCloseTo(50) -// expect(trans._undo.f).toBeCloseTo(50) -// -// var extracted = (new SVG.Matrix(10,0,0,10,20,20)).extract() -// trans.undo(extracted) -// expect(trans._undo.a).toBeCloseTo(1) -// expect(trans._undo.b).toBeCloseTo(0) -// expect(trans._undo.c).toBeCloseTo(0) -// expect(trans._undo.d).toBeCloseTo(1) -// expect(trans._undo.e).toBeCloseTo(0) -// expect(trans._undo.f).toBeCloseTo(0) -// }) -// }) -// -// describe('at', function() { -// it('creates a matrix at a certain position', function() { -// expect(trans.at(0.75)).toEqual((new SVG.Matrix()).morph((new SVG.Matrix()).skew(30, -30, 50, 50)).at(0.75)) -// }) -// it('returns the inversed matrix from a specific position when created with inverse flag', function() { -// var morphed = (new SVG.Scale(skewed.transform(20,-20,50,50), true)).at(0.25) -// -// expect(morphed.a).toBeCloseTo(0.963) -// expect(morphed.b).toBeCloseTo(0) -// expect(morphed.c).toBeCloseTo(0) -// expect(morphed.d).toBeCloseTo(0.963) -// expect(morphed.e).toBeCloseTo(0) -// expect(morphed.f).toBeCloseTo(0) -// }) -// it('returns the resulting transformation which has to be made to set an absolute translation', function() { -// -// var morphed = trans.undo((new SVG.Matrix(10,0,0,10,0,0)).skew(20, 30, 20, 10).extract()).at(0.5) -// -// expect(morphed.a).toBeCloseTo(1.266) -// expect(morphed.b).toBeCloseTo(-0.7310) -// expect(morphed.c).toBeCloseTo(0.1351) -// expect(morphed.d).toBeCloseTo(0.9220) -// expect(morphed.e).toBeCloseTo(-20.05593) -// expect(morphed.f).toBeCloseTo(40.4468) -// }) -// }) -// }) -// }) diff --git a/spec/spec/use.js b/spec/spec/use.js index 0de5b39..5935710 100644 --- a/spec/spec/use.js +++ b/spec/spec/use.js @@ -14,7 +14,7 @@ describe('Use', function() { }) it('sets the target element id to its href attribute', function() { - expect(use.node.getAttributeNS(SVG.xlink, 'href')).toBe('#' + rect) + expect(use.node.getAttributeNS(SVG.namespaces.xlink, 'href')).toBe('#' + rect) }) it('adopts the geometry of the target element', function() { @@ -35,9 +35,9 @@ describe('Use', function() { }) it('sets the target element id and file path to its href attribute', function() { - expect(use.node.getAttributeNS(SVG.xlink, 'href')).toBe(file + '#' + id) + expect(use.node.getAttributeNS(SVG.namespaces.xlink, 'href')).toBe(file + '#' + id) }) }) - -}) \ No newline at end of file + +}) diff --git a/src/main.js b/src/main.js index 696dfdd..1ce11f7 100644 --- a/src/main.js +++ b/src/main.js @@ -7,7 +7,7 @@ import './modules/optional/memory.js' import './modules/optional/sugar.js' import './modules/optional/transform.js' -import { extend } from './utils/adopter.js' +import { extend, makeInstance } from './utils/adopter.js' import { getMethodNames, getMethodsFor } from './utils/methods.js' import Box from './types/Box.js' import Circle from './elements/Circle.js' @@ -46,6 +46,9 @@ import Svg from './elements/Svg.js' import Text from './elements/Text.js' import Tspan from './elements/Tspan.js' import * as defaults from './modules/core/defaults.js' +import * as utils from './utils/utils.js' +import * as namespaces from './modules/core/namespaces.js' +import * as regex from './modules/core/regex.js' export { Morphable, @@ -56,9 +59,8 @@ export { NonMorphable } -export { defaults } -export * from './utils/utils.js' -export * from './modules/core/namespaces.js' +export { defaults, utils, namespaces, regex } +export const SVG = makeInstance export { default as parser } from './modules/core/parser.js' export { default as find } from './modules/core/selector.js' export * from './modules/core/event.js' @@ -73,12 +75,12 @@ export { default as Runner } from './animation/Runner.js' export { default as Timeline } from './animation/Timeline.js' /* Types */ -export { default as SVGArray } from './types/SVGArray.js' +export { default as Array } from './types/SVGArray.js' export { default as Box } from './types/Box.js' export { default as Color } from './types/Color.js' export { default as EventTarget } from './types/EventTarget.js' export { default as Matrix } from './types/Matrix.js' -export { default as SVGNumber } from './types/SVGNumber.js' +export { default as Number } from './types/SVGNumber.js' export { default as PathArray } from './types/PathArray.js' export { default as Point } from './types/Point.js' export { default as PointArray } from './types/PointArray.js' diff --git a/src/svg.js b/src/svg.js index 4026598..e88b825 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1,5 +1,4 @@ import * as svgMembers from './main.js' -import * as regex from './modules/core/regex.js' import { makeInstance } from './utils/adopter' // The main wrapping element @@ -8,7 +7,3 @@ export default function SVG (element) { } Object.assign(SVG, svgMembers) - -SVG.utils = SVG -SVG.regex = regex -SVG.get = SVG -- cgit v1.2.3 From aaefd015deaea6e49c32311e0dc76286662408fd Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Mon, 26 Nov 2018 22:47:27 +0100 Subject: fix bugs in runner, fix imports --- dist/svg.js | 15 +++++++-------- src/animation/Runner.js | 10 +++++----- src/elements/Dom.js | 2 +- src/svg.js | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/dist/svg.js b/dist/svg.js index eb0d90d..3406d4a 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,12 +1,12 @@ /*! -* svg.js - A lightweight library for manipulating and animating SVG. +* @svgdotjs/svg.js - A lightweight library for manipulating and animating SVG. * @version 3.0.0 * https://svgdotjs.github.io/ * * @copyright Wout Fierens * @license MIT * -* BUILT: Sat Nov 24 2018 14:31:28 GMT+0100 (GMT+01:00) +* BUILT: Mon Nov 26 2018 22:45:55 GMT+0100 (GMT+01:00) */; var SVG = (function () { 'use strict'; @@ -5364,7 +5364,7 @@ var SVG = (function () { _this.enabled = true; _this._time = 0; - _this._last = 0; // At creation, the runner is in reseted state + _this._lastTime = 0; // At creation, the runner is in reseted state _this._reseted = true; // Save transforms applied to this runner @@ -5596,7 +5596,7 @@ var SVG = (function () { this._lastPosition = position; // Figure out if we just started var duration = this.duration(); - var justStarted = this._lastTime < 0 && this._time > 0; + var justStarted = this._lastTime <= 0 && this._time > 0; var justFinished = this._lastTime < this._time && this.time > duration; this._lastTime = this._time; @@ -5608,12 +5608,11 @@ var SVG = (function () { var declarative = this._isDeclarative; - this.done = !declarative && !justFinished && this._time >= duration; // Call initialise and the run function + this.done = !declarative && !justFinished && this._time >= duration; // Runner is running. So its not in reseted state anymore - if (running || declarative) { - // Runner is running. So its not in reseted state anymore - this._reseted = false; + this._reseted = false; // Call initialise and the run function + if (running || declarative) { this._initialise(running); // clear the transforms on this runner so they dont get added again and again diff --git a/src/animation/Runner.js b/src/animation/Runner.js index bb8d5e7..125c4c5 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -48,7 +48,7 @@ export default class Runner extends EventTarget { // Store the state of the runner this.enabled = true this._time = 0 - this._last = 0 + this._lastTime = 0 // At creation, the runner is in reseted state this._reseted = true @@ -264,7 +264,7 @@ export default class Runner extends EventTarget { // Figure out if we just started var duration = this.duration() - var justStarted = this._lastTime < 0 && this._time > 0 + var justStarted = this._lastTime <= 0 && this._time > 0 var justFinished = this._lastTime < this._time && this.time > duration this._lastTime = this._time if (justStarted) { @@ -277,11 +277,11 @@ export default class Runner extends EventTarget { var declarative = this._isDeclarative this.done = !declarative && !justFinished && this._time >= duration + // Runner is running. So its not in reseted state anymore + this._reseted = false + // Call initialise and the run function if (running || declarative) { - // Runner is running. So its not in reseted state anymore - this._reseted = false - this._initialise(running) // clear the transforms on this runner so they dont get added again and again diff --git a/src/elements/Dom.js b/src/elements/Dom.js index 5d7dbac..f6e72c9 100644 --- a/src/elements/Dom.js +++ b/src/elements/Dom.js @@ -7,7 +7,7 @@ import { makeNode, register } from '../utils/adopter.js' -import { find } from '../modules/core/selector' +import { find } from '../modules/core/selector.js' import { globals } from '../utils/window.js' import { map } from '../utils/utils.js' import { ns } from '../modules/core/namespaces.js' diff --git a/src/svg.js b/src/svg.js index e88b825..f6c4bc5 100644 --- a/src/svg.js +++ b/src/svg.js @@ -1,5 +1,5 @@ import * as svgMembers from './main.js' -import { makeInstance } from './utils/adopter' +import { makeInstance } from './utils/adopter.js' // The main wrapping element export default function SVG (element) { -- cgit v1.2.3 From 58fd0d68bc8b46b23f8cdc65190f08d4e524eb57 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 28 Nov 2018 12:57:52 +0100 Subject: Fix build chain so that we now have multiple builds. Details below: - svg.js: The esm bundle - svg.min.js: The bundle for all browsers for maximum support - svg.node.js: The bundle for node - polyfill.js: Using svg.min.js requires this polyfill in case the Browser does not understand all of ./config/polyfillList.js - polyfillIE.js: This is required when you use IE11 (polyfill.js still required) Please note, that not all test pass for IE11 due to its rounding issues and wrong calculation of bbox. Also note, that `defaultPrevented` is not working for CustomEvents in IE11. --- .config/karma.conf.common.js | 4 +- .config/karma.conf.js | 10 +- .config/karma.conf.saucelabs.js | 39 +- .config/polyfillList.js | 9 +- .config/polyfillListIE.js | 31 + .config/pretest.js | 24 +- .config/rollup.config.js | 174 +- .config/rollup.polyfills.js | 36 +- .travis.yml | 7 +- bower.json | 4 +- dirty.html | 59 +- dist/polyfills.js | 2 +- dist/polyfillsIE.js | 1 + dist/svg.js | 12176 +++++++++++++++++++------------------- dist/svg.js.map | 1 + dist/svg.min.js | 3 + dist/svg.min.js.map | 1 + dist/svg.node.js | 6430 ++++++++++++++++++++ dist/svg.node.js.map | 1 + package-lock.json | 48 +- package.json | 29 +- spec/SpecRunner.html | 4 +- spec/spec/arrange.js | 15 +- spec/spec/event.js | 3 +- spec/spec/helper.js | 2 +- spec/spec/morphing.js | 20 +- spec/spec/runner.js | 10 +- spec/spec/svg.js | 4 +- src/animation/Morphable.js | 9 +- src/main.js | 1 + src/polyfills/children.js | 8 + src/polyfills/innerHTML.js | 95 + src/utils/adopter.js | 2 +- src/utils/methods.js | 13 +- 34 files changed, 12813 insertions(+), 6462 deletions(-) create mode 100644 .config/polyfillListIE.js create mode 100644 dist/polyfillsIE.js create mode 100644 dist/svg.js.map create mode 100644 dist/svg.min.js create mode 100644 dist/svg.min.js.map create mode 100644 dist/svg.node.js create mode 100644 dist/svg.node.js.map create mode 100644 src/polyfills/children.js create mode 100644 src/polyfills/innerHTML.js (limited to 'src') diff --git a/.config/karma.conf.common.js b/.config/karma.conf.common.js index 56c249f..a89c8e6 100644 --- a/.config/karma.conf.common.js +++ b/.config/karma.conf.common.js @@ -31,7 +31,7 @@ module.exports = function (config) { included: false, served: true }, - 'dist/svg.js', + 'dist/svg.min.js', 'spec/spec/*.js' ], @@ -61,6 +61,6 @@ module.exports = function (config) { concurrency: cpuCount || Infinity, // list of files to exclude - exclude: [], + exclude: [] } } diff --git a/.config/karma.conf.js b/.config/karma.conf.js index 57cf14f..ccda070 100644 --- a/.config/karma.conf.js +++ b/.config/karma.conf.js @@ -23,7 +23,7 @@ module.exports = function (config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'dist/svg.js': ['coverage'] + 'dist/svg.min.js': ['coverage'] }, // this specifies which plugins karma should load @@ -35,7 +35,7 @@ module.exports = function (config) { 'karma-chrome-launcher', 'karma-coverage', 'karma-firefox-launcher', - 'karma-jasmine', + 'karma-jasmine' ], // test results reporter to use @@ -48,15 +48,15 @@ module.exports = function (config) { // Specify a reporter type. type: 'lcov', dir: 'coverage/', - subdir: function(browser) { + subdir: function (browser) { // normalization process to keep a consistent browser name accross different OS - return browser.toLowerCase().split(/[ /-]/)[0]; // output the results into: './coverage/firefox/' + return browser.toLowerCase().split(/[ /-]/)[0] // output the results into: './coverage/firefox/' } }, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: [chromeBin, 'FirefoxHeadless'], + browsers: [chromeBin, 'FirefoxHeadless'] }) ) } diff --git a/.config/karma.conf.saucelabs.js b/.config/karma.conf.saucelabs.js index 922d749..089f25a 100644 --- a/.config/karma.conf.saucelabs.js +++ b/.config/karma.conf.saucelabs.js @@ -9,8 +9,8 @@ const karmaCommon = require('./karma.conf.common.js') const SauceLabsLaunchers = { /** Real mobile devices are not available * Your account does not have access to Android devices. - * Please contact sales@saucelabs.com to add this feature to your account.*/ - /*sl_android_chrome: { + * Please contact sales@saucelabs.com to add this feature to your account. */ + /* sl_android_chrome: { base: 'SauceLabs', appiumVersion: '1.5.3', deviceName: 'Samsung Galaxy S7 Device', @@ -18,13 +18,13 @@ const SauceLabsLaunchers = { browserName: 'Chrome', platformVersion: '6.0', platformName: 'Android' - },*/ + }, */ /* sl_android: { base: 'SauceLabs', browserName: 'Android', deviceName: 'Android Emulator', deviceOrientation: 'portrait' - },*/ + }, */ SL_firefox_latest: { base: 'SauceLabs', browserName: 'firefox', @@ -39,7 +39,7 @@ const SauceLabsLaunchers = { base: 'SauceLabs', browserName: 'internet explorer', version: '11.0' - },/* + }/* sl_windows_edge: { base: 'SauceLabs', browserName: 'MicrosoftEdge', @@ -83,12 +83,10 @@ const SauceLabsLaunchers = { } */ } - -module.exports = function(config) { - +module.exports = function (config) { if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) { - console.error("SAUCE_USERNAME and SAUCE_ACCESS_KEY must be provided as environment variables.") - console.warn("Aborting Sauce Labs test") + console.error('SAUCE_USERNAME and SAUCE_ACCESS_KEY must be provided as environment variables.') + console.warn('Aborting Sauce Labs test') process.exit(1) } const settings = Object.assign(karmaCommon(config), { @@ -104,7 +102,7 @@ module.exports = function(config) { // get possible karma plugins by `ls node_modules | grep 'karma-*'` plugins: [ 'karma-jasmine', - 'karma-sauce-launcher', + 'karma-sauce-launcher' ], // logLevel: config.LOG_DEBUG, @@ -119,15 +117,15 @@ module.exports = function(config) { // start these browsers browsers: Object.keys(SauceLabsLaunchers), sauceLabs: { - testName: 'SVG.js Unit Tests', - // connectOptions: { - // noSslBumpDomains: "all" - // }, - // connectOptions: { - // port: 5757, - // logfile: 'sauce_connect.log' - // }, - }, + testName: 'SVG.js Unit Tests' + // connectOptions: { + // noSslBumpDomains: "all" + // }, + // connectOptions: { + // port: 5757, + // logfile: 'sauce_connect.log' + // }, + } // The number of disconnections tolerated. // browserDisconnectTolerance: 0, // well, sometimes it helps to just restart @@ -144,5 +142,4 @@ module.exports = function(config) { console.log(settings) config.set(settings) - } diff --git a/.config/polyfillList.js b/.config/polyfillList.js index 34ef4b6..37f80bd 100644 --- a/.config/polyfillList.js +++ b/.config/polyfillList.js @@ -1,11 +1,8 @@ -import 'core-js/modules/es6.function.name' +import 'core-js/modules/es6.object.assign' import 'core-js/modules/es6.object.keys' +import 'core-js/modules/es6.function.name' import 'core-js/modules/es6.symbol' import 'core-js/modules/es6.set' import 'core-js/modules/es7.array.includes' import 'core-js/modules/es6.string.includes' -import 'core-js/modules/es6.array.iterator' -import 'core-js/modules/es7.object.entries' -import 'core-js/modules/es6.object.assign' -import CustomEventPolyfill from '@target/custom-event-polyfill' -CustomEventPolyfill() +import 'core-js/modules/es6.array.from' diff --git a/.config/polyfillListIE.js b/.config/polyfillListIE.js new file mode 100644 index 0000000..dbffbc5 --- /dev/null +++ b/.config/polyfillListIE.js @@ -0,0 +1,31 @@ +/* global SVGElement */ +/* eslint no-new-object: "off" */ + +import CustomEventPolyfill from '@target/custom-event-polyfill/src/index.js6' +import children from '../src/polyfills/children.js' + +/* IE 11 has no innerHTML on SVGElement */ +import '../src/polyfills/innerHTML.js' + +/* IE 11 has no correct CustomEvent implementation */ +CustomEventPolyfill() + +/* IE 11 has no children on SVGElement */ +try { + if (!SVGElement.prototype.children) { + Object.defineProperty(SVGElement.prototype, 'children', { + get: function () { return children(this) } + }) + } +} catch (e) {} + +/* IE 11 cannot handle getPrototypeOf(not_obj) */ +try { + delete Object.getPrototypeOf('test') +} catch (e) { + var old = Object.getPrototypeOf + Object.getPrototypeOf = function (o) { + if (typeof o !== 'object') o = new Object(o) + return old.call(this, o) + } +} diff --git a/.config/pretest.js b/.config/pretest.js index 834e8d8..23b989e 100644 --- a/.config/pretest.js +++ b/.config/pretest.js @@ -1,20 +1,20 @@ +/* global XMLHttpRequest */ 'use strict' -function get(uri) { - var xhr = new XMLHttpRequest() - xhr.open('GET', uri, false) - xhr.send() - if(xhr.status !== 200) - console.error('SVG.js fixture could not be loaded. Tests will fail.') - return xhr.responseText +function get (uri) { + var xhr = new XMLHttpRequest() + xhr.open('GET', uri, false) + xhr.send() + if (xhr.status !== 200) { console.error('SVG.js fixture could not be loaded. Tests will fail.') } + return xhr.responseText } -function main() { - var style = document.createElement("style") - document.head.appendChild(style) - style.sheet.insertRule( get('/fixtures/fixture.css'), 0 ) +function main () { + var style = document.createElement('style') + document.head.appendChild(style) + style.sheet.insertRule(get('/fixtures/fixture.css'), 0) - document.body.innerHTML = get('/fixtures/fixture.svg') + document.body.innerHTML = get('/fixtures/fixture.svg') } main() diff --git a/.config/rollup.config.js b/.config/rollup.config.js index b7ad5d8..32096e5 100644 --- a/.config/rollup.config.js +++ b/.config/rollup.config.js @@ -1,7 +1,10 @@ import babel from 'rollup-plugin-babel' import * as pkg from '../package.json' -// import filesize from 'rollup-plugin-filesize' -import { terser } from 'rollup-plugin-terser' +import filesize from 'rollup-plugin-filesize' +// import { terser } from 'rollup-plugin-terser' +import resolve from 'rollup-plugin-node-resolve' +import commonjs from 'rollup-plugin-commonjs' +import { uglify } from 'rollup-plugin-uglify' const buildDate = Date() @@ -18,94 +21,97 @@ const headerLong = `/*! const headerShort = `/*! ${pkg.name} v${pkg.version} ${pkg.license}*/;` +const getBabelConfig = (esm, targets = { esmodules: true }, corejs = false) => babel({ + include: 'src/**', + runtimeHelpers: true, + babelrc: false, + presets: [['@babel/preset-env', { + modules: false, + targets: esm ? targets : pkg.browserslist, + useBuiltIns: 'usage' + }]], + plugins: [['@babel/plugin-transform-runtime', { + corejs: corejs, + helpers: true, + useESModules: true + }]] +}) + +// When few of these get mangled nothing works anymore +// We loose literally nothing by let these unmangled +const classes = [ + 'A', + 'ClipPath', + 'Defs', + 'Element', + 'G', + 'Image', + 'Marker', + 'Path', + 'Polygon', + 'Rect', + 'Stop', + 'Svg', + 'Text', + 'Tspan', + 'Circle', + 'Container', + 'Dom', + 'Ellipse', + 'Gradient', + 'Line', + 'Mask', + 'Pattern', + 'Polyline', + 'Shape', + 'Style', + 'Symbol', + 'TextPath', + 'Use' +] + const config = esm => ({ - input: './src/svg.js', + input: esm ? './src/main.js' : './src/svg.js', output: { file: esm ? './dist/svg.js' : './dist/svg.min.js', name: 'SVG', - sourceMap: !esm, + sourcemap: 'external', format: esm ? 'esm' : 'iife', - banner: esm ? headerShort : headerLong, - plugins: - esm - ? [] - : [ - babel({ - include: 'src/**', - runtimeHelpers: true, - babelrc: false, - presets: [["@babel/preset-env", { - modules: false, - targets: { - ie: 9, - chrome: 49, - edge: 14, - firefox: 45, - safari: 10 - }, - useBuiltIns: 'usage' - }]] - }), - terser() - ] - } + banner: esm ? headerLong : headerShort + }, + plugins: [ + resolve({ browser: true }), + commonjs(), + getBabelConfig(esm), + filesize(), + esm ? {} : uglify({ + mangle: { + reserved: classes + }, + output: { + preamble: headerShort + } + }) + ] }) -const modes = [true, false] +const nodeConfig = () => ({ + input: './src/main.js', + output: { + file: './dist/svg.node.js', + name: 'SVG', + sourcemap: 'external', + format: 'cjs', + banner: headerLong + }, + plugins: [ + resolve(), + commonjs(), + getBabelConfig(true, 'maintained node versions'), + filesize() + ] +}) -// console.log(modes.map(config)) -export default modes.map(config) +const modes = [true, false] -// export default [ -// { -// input: './src/svg.js', -// output: { -// file: 'dist/svg.js', -// name: 'SVG', -// sourceMap: true, -// format: 'iife', -// banner: headerLong -// }, -// plugins: [ -// // resolve({browser: true}), -// // commonjs(), -// babel({ -// include: 'src/**', -// runtimeHelpers: true, -// babelrc: false, -// presets: [["@babel/preset-env", { -// modules: false, -// targets: { -// ie: "9" -// }, -// useBuiltIns: 'usage' -// }]], -// }), -// filesize() -// ] -// },{ -// input: './.config/polyfills.js', -// output: { -// file: 'dist/polyfills.js', -// name: 'SVG', -// sourceMap: true, -// format: 'umd', -// banner: headerLong -// }, -// treeshake: false, -// plugins: [ -// // babel({ -// // runtimeHelpers: true, -// // babelrc: false, -// // presets: [["@babel/preset-env", { -// // modules: false, -// // targets: { -// // ie: "11" -// // }, -// // useBuiltIns: 'usage' -// // }]], -// // }), -// filesize() -// ] -// }, -// ] +export default modes.map(config).concat(nodeConfig()) diff --git a/.config/rollup.polyfills.js b/.config/rollup.polyfills.js index 810db91..1df059a 100644 --- a/.config/rollup.polyfills.js +++ b/.config/rollup.polyfills.js @@ -1,20 +1,22 @@ -import { uglify } from "rollup-plugin-uglify" import resolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs' +import { terser } from 'rollup-plugin-terser' +import filesize from 'rollup-plugin-filesize' -export default [ - { - input: './.config/polyfillList.js', - output: { - file: 'dist/polyfills.js', - name: 'polyfills', - sourceMap: 'external', - format: 'iife' - }, - plugins: [ - resolve({browser: true}), - commonjs(), - uglify() - ] - } -] +// We dont need babel. All polyfills are compatible +const config = (ie) => ({ + input: ie ? './.config/polyfillListIE.js' : './.config/polyfillList.js', + output: { + file: ie ? 'dist/polyfillsIE.js' : 'dist/polyfills.js', + sourceMap: false, + format: 'iife' + }, + plugins: [ + resolve({ browser: true }), + commonjs(), + terser(), + filesize() + ] +}) + +export default [false, true].map(config) diff --git a/.travis.yml b/.travis.yml index 9b7ad70..2a833bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,12 @@ node_js: - "stable" script: - npm run build - - npm run test:ci + - npm run test +# - npm run test:ci # - cat coverage/firefox/lcov.info | node_modules/.bin/coveralls addons: -# firefox: "latest" -# chrome: "stable" + firefox: "latest" + chrome: "stable" # hosts: # - karmalocal.com before_install: diff --git a/bower.json b/bower.json index 8480d11..83a41a3 100644 --- a/bower.json +++ b/bower.json @@ -7,7 +7,7 @@ "Jon Ege Ronnenberg " ], "description": "A lightweight library for manipulating and animating SVG", - "main": "dist/svg.js", + "main": "dist/svg.min.js", "keywords": [ "svg", "vector", "graphics" ], @@ -18,4 +18,4 @@ "src/", "gulpfile.js" ] -} \ No newline at end of file +} diff --git a/dirty.html b/dirty.html index 3fd1412..900c738 100644 --- a/dirty.html +++ b/dirty.html @@ -4,7 +4,9 @@ - + + + @@ -29,27 +31,30 @@ +
- + - - - - - - - - - - - - - Some description - - - - - - - - - - - A - B - C - - - - - - + diff --git a/spec/fixtures/fixture.css b/spec/fixtures/fixture.css index e72e421..4fad17b 100644 --- a/spec/fixtures/fixture.css +++ b/spec/fixtures/fixture.css @@ -3,4 +3,4 @@ height: 500px; position: fixed; z-index: -1; -} \ No newline at end of file +} diff --git a/spec/helpers.js b/spec/helpers.js new file mode 100644 index 0000000..23f92bb --- /dev/null +++ b/spec/helpers.js @@ -0,0 +1,159 @@ +import { getWindow } from '../src/utils/window.js' + +function tag(name, attrs, children) { + let doc = getWindow().document + var el = doc.createElement(name) + + for(var i in attrs){ + el.setAttribute(i, attrs[i]) + } + + for(var i in children){ + if(typeof children[i] == 'string') + children[i] = doc.createTextNode(children[i]) + + el.appendChild(children[i]) + } + + return el +} + +export function fixtures () { + return tag('svg', { + height:0, + width:0, + id:'inlineSVG' + },[ + tag('defs', {}, [ + tag('linearGradient', {}, [ + tag('stop', {offset: '5%', 'stop-color': 'green'}), + tag('stop', {offset: '95%', 'stop-color': 'gold'}), + ]), + tag('radialGradient', {}, [ + tag('stop', {offset: '5%', 'stop-color': 'green'}), + tag('stop', {offset: '95%', 'stop-color': 'gold'}), + ]) + ]), + tag('desc', {}, ['Some description']), + tag('path', { + id: 'lineAB', + d: 'M 100 350 l 150 -300', + stroke: 'red', + 'stroke-width': '3', + fill: 'none' + }), + tag('path', { + id: 'lineBC', + d: 'M 250 50 l 150 300', + stroke: 'red', + 'stroke-width': '3', + fill: 'none' + }), + tag('path', { + d: 'M 175 200 l 150 0', + stroke: 'green', + 'stroke-width': '3', + fill: 'none' + }), + tag('path', { + d: 'M 100 350 q 150 -300 300 0', + stroke: 'blue', + 'stroke-width': '5', + fill: 'none' + }), + tag('g', { + stroke: 'black', + 'stroke-width': '2', + fill: 'black', + id: 'pointGroup' + },[ + tag('circle', { + id: 'pointA', + cx: '100', + cy: '350', + r: '3', + }), + tag('circle', { + id: 'pointB', + cx: '250', + cy: '50', + r: '50', + }), + tag('circle', { + id: 'pointC', + cx: '400', + cy: '350', + r: '50', + }) + ]), + tag('g', { + 'font-size': '30', + font: 'sans-serif', + fill: 'black', + stroke: 'none', + 'text-anchor': 'middle', + id: 'labelGroup' + },[ + tag('text', { + x: '100', + y: '350', + dy: '-30', + }, ['A']), + tag('text', { + x: '250', + y: '50', + dy: '-10', + }, ['B']), + tag('text', { + x: '400', + y: '350', + dx: '30', + }, ['C']) + ]), + tag('polygon', {points: '200,10 250,190 160,210'}), + tag('polyline', {points: '20,20 40,25 60,40 80,120 120,140 200,180'}) + ]) +} + +export function buildFixtures () { + let doc = getWindow().document + let body = doc.body || doc.documentElement + + let div = doc.createElement('div') + div.id = 'fixtures' + + try { + // FIXME: doesnt work in svgdom + div.style.position = 'absolute' + div.style.top = 0 + div.style.left = 0 + } catch (e) {} + + div.appendChild(fixtures()) + body.appendChild(div) +} + +export function buildCanvas () { + let doc = getWindow().document + let body = doc.body || doc.documentElement + + let div = doc.createElement('div') + div.id = 'canvas' + + try { + // FIXME: doesnt work in svgdom + div.style.position = 'absolute' + div.style.top = 0 + div.style.left = 0 + } catch (e) {} + body.appendChild(div) +} + +export function clear () { + let doc = getWindow().document + let canvas = doc.getElementById('canvas') + //let fixtures = doc.getElementById('fixtures') + + //fixtures.parentNode.removeChild(fixtures) + canvas.parentNode.removeChild(canvas) +} diff --git a/spec/run.js b/spec/run.js index 1173cc2..19c5027 100644 --- a/spec/run.js +++ b/spec/run.js @@ -1,4 +1,9 @@ import Jasmine from 'jasmine' +import svgdom from 'svgdom' + +import { buildCanvas, buildFixtures, clear } from './helpers.js' +import { registerWindow } from '../src/main.js' + const jasmine = new Jasmine() //jasmine.loadConfigFile('spec/support/jasmine.json') @@ -14,4 +19,18 @@ jasmine.loadConfig({ ] }) +jasmine.jasmine.currentEnv_.beforeEach(() => { + let win = /*new*/ svgdom + registerWindow(win, win.document) + buildCanvas() + buildFixtures() + global.container = win.document.getElementById('canvas') +}) + +jasmine.jasmine.currentEnv_.afterEach(() => { + clear() + global.container = null + registerWindow() +}) + jasmine.execute() diff --git a/spec/setupBrowser.js b/spec/setupBrowser.js new file mode 100644 index 0000000..6ec7816 --- /dev/null +++ b/spec/setupBrowser.js @@ -0,0 +1,12 @@ +import { buildCanvas, buildFixtures, clear } from './helpers.js' + +beforeEach(() => { + //buildFixtures() + buildCanvas() + window.container = document.getElementById('canvas') +}) + +afterEach(() => { + clear() + window.container = null +}) diff --git a/spec/spec/animator.js b/spec/spec/animator.js index b1834b4..5ccdcca 100644 --- a/spec/spec/animator.js +++ b/spec/spec/animator.js @@ -2,7 +2,6 @@ describe('SVG.Animator', function () { beforeEach(function () { jasmine.RequestAnimationFrame.install() - SVG.Animator.timer = jasmine.RequestAnimationFrame.mockPerf SVG.Animator.timeouts = new SVG.Queue() SVG.Animator.frames = new SVG.Queue() SVG.Animator.nextDraw = null @@ -10,7 +9,6 @@ describe('SVG.Animator', function () { afterEach(function () { jasmine.RequestAnimationFrame.uninstall() - SVG.Animator.timer = jasmine.RequestAnimationFrame.realPerf }) describe('timeout()', function () { diff --git a/spec/spec/types/Box.js b/spec/spec/types/Box.js index d431121..1e98982 100644 --- a/spec/spec/types/Box.js +++ b/spec/spec/types/Box.js @@ -1,27 +1,20 @@ -import { makeInstance as SVG, extend } from '../../../src/utils/adopter.js' +import { + Box, + Gradient, + Matrix, + Rect, + makeInstance as SVG +} from '../../../src/main.js' import { getMethodsFor } from '../../../src/utils/methods.js' -import { registerWindow } from '../../../src/utils/window.js' -import Box from '../../../src/types/Box.js' -import Dom from '../../Dom.js' -import Gradient from '../../../src/elements/Gradient.js' -import Matrix from '../../../src/types/Matrix.js' -import Rect from '../../../src/elements/Rect.js' +import { getWindow, withWindow } from '../../../src/utils/window.js' const viewbox = getMethodsFor('viewbox').viewbox const { any, objectContaining, arrayContaining } = jasmine -const getDocument = () => { - return typeof document !== "undefined" ? document : Dom.document -} - -const getWindow = () => { - return typeof window !== "undefined" ? window : Dom.window -} - const getBody = () => { - const doc = getDocument() - return doc.body || doc.documentElement + let win = getWindow() + return win.document.body || win.document.documentElement } describe('Box.js', () => { @@ -107,12 +100,11 @@ describe('Box.js', () => { describe('addOffset()', () => { it('adds the current page offset to the box', () => { - registerWindow({pageXOffset: 50, pageYOffset: 25}) - const box = new Box(100, 100, 100, 100).addOffset() + withWindow({pageXOffset: 50, pageYOffset: 25}, () => { + const box = new Box(100, 100, 100, 100).addOffset() - expect(box.toArray()).toEqual([150, 125, 100, 100]) - - registerWindow() + expect(box.toArray()).toEqual([150, 125, 100, 100]) + }) }) }) @@ -137,16 +129,8 @@ describe('Box.js', () => { describe('Element', () => { describe('bbox()', () => { - beforeEach(() => { - registerWindow(getWindow(), getDocument()) - }) - - afterEach(() => { - registerWindow() - }) - it('returns the bounding box of the element', () => { - const canvas = SVG().addTo(getBody()) + const canvas = SVG().addTo(container) const rect = new Rect().size(100, 200).move(20, 30).addTo(canvas) expect(rect.bbox()).toEqual(any(Box)) @@ -158,23 +142,15 @@ describe('Box.js', () => { expect(rect.bbox().toArray()).toEqual([20, 30, 100, 200]) }) - it('throws when it is not possible to get a bbox', () => { - const gradient = new Gradient('radial') - expect(() => gradient.bbox()).toThrow() - }) + // it('throws when it is not possible to get a bbox', () => { + // const gradient = new Gradient('radial') + // expect(() => gradient.bbox()).toThrow() + // }) }) describe('rbox()', () => { - beforeEach(() => { - registerWindow(getWindow(), getDocument()) - }) - - afterEach(() => { - registerWindow() - }) - it('returns the BoundingClientRect of the element', () => { - const canvas = SVG().addTo(getBody()) + const canvas = SVG().addTo(container) const rect = new Rect().size(100, 200).move(20, 30).addTo(canvas) .attr('transform', new Matrix({scale: 2, translate:[40, 50]})) @@ -182,35 +158,19 @@ describe('Box.js', () => { expect(rect.rbox().toArray()).toEqual([80, 110, 200, 400]) }) - it('returns the BoundingClientRect of the element even if the node is not in the dom', () => { - const rect = new Rect().size(100, 200).move(20, 30) - .attr('transform', new Matrix({scale: 2, translate:[40, 50]})) - - expect(rect.rbox().toArray()).toEqual([80, 110, 200, 400]) - }) - - it('throws when it is not possible to get the BoundingClientRect', () => { - const gradient = new Gradient('radial') - expect(() => gradient.rbox()).toThrow() + it('throws when element is not in dom', () => { + expect(() => new Rect().rbox()).toThrow() }) }) describe('viewbox()', () => { - beforeEach(() => { - registerWindow(getWindow(), getDocument()) - }) - - afterEach(() => { - registerWindow() - }) - it('sets the viewbox of the element', () => { - const canvas = viewbox.call(SVG().addTo(getBody()), 10, 10, 200, 200) + const canvas = viewbox.call(SVG().addTo(container), 10, 10, 200, 200) expect(canvas.attr('viewBox')).toEqual('10 10 200 200') }) it('gets the viewbox of the element', () => { - const canvas = viewbox.call(SVG().addTo(getBody()), 10, 10, 200, 200) + const canvas = viewbox.call(SVG().addTo(container), 10, 10, 200, 200) expect(viewbox.call(canvas)).toEqual(any(Box)) expect(viewbox.call(canvas).toArray()).toEqual([10, 10, 200, 200]) }) diff --git a/src/animation/Animator.js b/src/animation/Animator.js index 1392daa..0119cba 100644 --- a/src/animation/Animator.js +++ b/src/animation/Animator.js @@ -5,7 +5,7 @@ const Animator = { nextDraw: null, frames: new Queue(), timeouts: new Queue(), - timer: globals.window.performance || globals.window.Date, + timer: () => globals.window.performance || globals.window.Date, transforms: [], frame (fn) { @@ -29,7 +29,7 @@ const Animator = { delay = delay || 0 // Work out when the event should fire - var time = Animator.timer.now() + delay + var time = Animator.timer().now() + delay // Add the timeout to the end of the queue var node = Animator.timeouts.push({ run: fn, time: time }) diff --git a/src/types/Box.js b/src/types/Box.js index e55f114..a08ad67 100644 --- a/src/types/Box.js +++ b/src/types/Box.js @@ -104,7 +104,7 @@ export default class Box { } } -function getBox (cb) { +function getBox (cb, retry) { let box try { @@ -114,23 +114,29 @@ function getBox (cb) { throw new Error('Element not in the dom') } } catch (e) { - try { - let clone = this.clone().addTo(parser().svg).show() - box = cb(clone.node) - clone.remove() - } catch (e) { - throw new Error('Getting a bounding box of element "' + this.node.nodeName + '" is not possible') - } + box = retry(this) } + return box } export function bbox () { - return new Box(getBox.call(this, (node) => node.getBBox())) + return new Box(getBox.call(this, (node) => node.getBBox(), (el) => { + try { + let clone = el.clone().addTo(parser().svg).show() + let box = clone.node.getBBox() + clone.remove() + return box + } catch (e) { + throw new Error('Getting bbox of element "' + el.node.nodeName + '" is not possible') + } + })) } export function rbox (el) { - let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect())) + let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect(), (el) => { + throw new Error('Getting rbox of element "' + el.node.nodeName + '" is not possible') + })) if (el) return box.transform(el.screenCTM().inverse()) return box.addOffset() } diff --git a/src/utils/window.js b/src/utils/window.js index 9e51339..626fde3 100644 --- a/src/utils/window.js +++ b/src/utils/window.js @@ -7,3 +7,26 @@ export function registerWindow (win = null, doc = null) { globals.window = win globals.document = doc } + +const save = {} + +export function saveWindow () { + save.window = globals.window + save.document = globals.document +} + +export function restoreWindow () { + globals.window = save.window + globals.document = save.document +} + +export function withWindow (win, fn) { + saveWindow() + registerWindow(win, win.document) + fn(win, win.document) + restoreWindow() +} + +export function getWindow () { + return globals.window +} -- cgit v1.2.3 From b5bd292b7d042690336e08dcd423894449c36c66 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sun, 18 Nov 2018 19:13:28 +0100 Subject: add tests for all exports of adopter --- spec/SpecRunnerEs6.html | 1 + spec/helpers.js | 5 +- spec/spec/utils/adopter.js | 161 +++++++++++++++++++++++++++++++++++++++++++++ src/utils/adopter.js | 18 +++-- 4 files changed, 177 insertions(+), 8 deletions(-) create mode 100644 spec/spec/utils/adopter.js (limited to 'src') diff --git a/spec/SpecRunnerEs6.html b/spec/SpecRunnerEs6.html index fadc3a7..cca33c0 100644 --- a/spec/SpecRunnerEs6.html +++ b/spec/SpecRunnerEs6.html @@ -24,6 +24,7 @@ + diff --git a/spec/helpers.js b/spec/helpers.js index 23f92bb..a584b6a 100644 --- a/spec/helpers.js +++ b/spec/helpers.js @@ -152,8 +152,9 @@ export function buildCanvas () { export function clear () { let doc = getWindow().document let canvas = doc.getElementById('canvas') - //let fixtures = doc.getElementById('fixtures') + let fixtures = doc.getElementById('fixtures') - //fixtures.parentNode.removeChild(fixtures) + // remove if present + fixtures && fixtures.parentNode.removeChild(fixtures) canvas.parentNode.removeChild(canvas) } diff --git a/spec/spec/utils/adopter.js b/spec/spec/utils/adopter.js new file mode 100644 index 0000000..e038a5d --- /dev/null +++ b/spec/spec/utils/adopter.js @@ -0,0 +1,161 @@ +const { any, createSpy, objectContaining } = jasmine + +import { + makeNode, + makeInstance, + nodeOrNew, + register, + getClass, + eid, + extend, + wrapWithAttrCheck, + Rect, + Element, + adopt, + root +} from '../../../src/main.js' + +import { getWindow } from '../../../src/utils/window.js' +import { mockAdopt } from '../../../src/utils/adopter.js' +import { buildFixtures } from '../../helpers.js' + +const Node = getWindow().Node + +describe('Adopter.js', () => { + describe('makeNode()', () => { + it('creates a node of the specified type', () => { + let rect = makeNode('rect') + expect(rect).toEqual(any(Node)) + expect(rect.nodeName).toBe('rect') + }) + }) + + describe('makeInstance()', () => { + const adoptSpy = createSpy('adopt') + + beforeEach(() => { + adoptSpy.calls.reset() + mockAdopt(adoptSpy) + }) + + afterEach(() => { + mockAdopt() + }) + + it('creates a root-object when no argument given', () => { + let doc = makeInstance() + + expect(doc).toEqual(any(getClass(root))) + expect(doc).toEqual(any(Element)) + }) + + it('returns a given svg.js object directly', () => { + let rect = new Rect() + let samerect = makeInstance(rect) + expect(rect).toBe(samerect) + }) + + it('creates an element from passed svg string', () => { + makeInstance('') + + expect(adoptSpy).toHaveBeenCalledWith(any(Node)) + expect(adoptSpy).toHaveBeenCalledWith(objectContaining({nodeName: 'rect'})) + }) + + it('searches for element in dom if selector given', () => { + buildFixtures() + + let path = getWindow().document.getElementById('lineAB') + + makeInstance('#lineAB') + makeInstance('#doesNotExist') + + expect(adoptSpy).toHaveBeenCalledWith(path) + expect(adoptSpy).toHaveBeenCalledWith(null) + }) + + it('calls adopt when passed a node', () => { + makeInstance(makeNode('rect')) + + expect(adoptSpy).toHaveBeenCalledWith(any(Node)) + expect(adoptSpy).toHaveBeenCalledWith(objectContaining({nodeName: 'rect'})) + }) + }) + + describe('nodeOrNew()', () => { + it('creates a node of node argument is null', () => { + let rect = nodeOrNew('rect', null) + expect(rect).toEqual(any(Node)) + expect(rect.nodeName).toBe('rect') + }) + + it('returns the node if one is passed', () => { + let div = document.createElement('div') + expect(nodeOrNew('something', div)).toBe(div) + }) + }) + + describe('register()/getClass()', () => { + it('sets and gets a class from the class register', () => { + const a = class {} + register(a) + expect(getClass('a')).toBe(a) + }) + }) + + describe('edi()', () => { + it('returns a unique id', () => { + expect(eid('foo')).not.toBe(eid('foo')) + }) + }) + + describe('extend()', () => { + it('adds all functions in the given object to the target object', () => { + const a = class {} + + extend(a, { + test () { this.prop = 'test'; return this } + }) + + expect(typeof a.prototype.test).toBe('function') + expect(new a().test().prop).toBe('test') + }) + it('accepts and extend multiple modules at once', () => { + const a = class {} + const b = class {} + const c = class {} + + extend([a, b, c], { + test () { this.prop = 'test'; return this } + }) + + expect(typeof a.prototype.test).toBe('function') + expect(new a().test().prop).toBe('test') + expect(typeof b.prototype.test).toBe('function') + expect(new b().test().prop).toBe('test') + expect(typeof c.prototype.test).toBe('function') + expect(new c().test().prop).toBe('test') + }) + }) + + describe('wrapWithAttrCheck()', () => { + it('wraps a function so that it calles an attr function if an object is passed', () => { + const attrSpy = createSpy('attr') + + const a = class {} + extend(a, { + test: wrapWithAttrCheck(function () { + this.prop = 'test'; return this + }), + attr: attrSpy + }) + + const obj = {} + + expect(new a().test().prop).toBe('test') + expect(attrSpy).not.toHaveBeenCalled() + new a().test(obj) + expect(attrSpy).toHaveBeenCalledWith(obj) + }) + }) +}) diff --git a/src/utils/adopter.js b/src/utils/adopter.js index a4c60de..5c1b0b6 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -17,7 +17,7 @@ export function makeInstance (element) { if (element instanceof Base) return element if (typeof element === 'object') { - return adopt(element) + return adopter(element) } if (element == null) { @@ -25,7 +25,7 @@ export function makeInstance (element) { } if (typeof element === 'string' && element.charAt(0) !== '<') { - return adopt(globals.document.querySelector(element)) + return adopter(globals.document.querySelector(element)) } var node = makeNode('svg') @@ -33,7 +33,7 @@ export function makeInstance (element) { // We can use firstChild here because we know, // that the first char is < and thus an element - element = adopt(node.firstChild) + element = adopter(node.firstChild) return element } @@ -65,6 +65,12 @@ export function adopt (node) { return new elements[className](node) } +let adopter = adopt + +export function mockAdopt(mock = adopt) { + adopter = mock +} + export function register (element, name = element.name, asRoot = false) { elements[name] = element if (asRoot) elements[root] = element @@ -117,9 +123,9 @@ export function extend (modules, methods, attrCheck) { } } -export function extendWithAttrCheck (...args) { - extend(...args, true) -} +// export function extendWithAttrCheck (...args) { +// extend(...args, true) +// } export function wrapWithAttrCheck (fn) { return function (...args) { -- cgit v1.2.3 From a6629cb654d3156ddf7235943f2c1ee836f58f69 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Wed, 28 Nov 2018 13:51:28 +0100 Subject: run build --- dist/svg.js | 12164 ++++++++++++++++++++++++------------------------- dist/svg.js.map | 2 +- dist/svg.min.js | 2 +- dist/svg.min.js.map | 2 +- dist/svg.node.js | 51 +- dist/svg.node.js.map | 2 +- src/utils/adopter.js | 2 +- 7 files changed, 5983 insertions(+), 6242 deletions(-) (limited to 'src') diff --git a/dist/svg.js b/dist/svg.js index f55f5ae..97d9a67 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,7130 +1,6862 @@ /*! -* svg.js - A lightweight library for manipulating and animating SVG. +* @svgdotjs/svg.js - A lightweight library for manipulating and animating SVG. * @version 3.0.0 * https://svgdotjs.github.io/ * * @copyright Wout Fierens * @license MIT * -* BUILT: Mon Nov 19 2018 22:29:52 GMT+0100 (GMT+01:00) +* BUILT: Wed Nov 28 2018 13:48:04 GMT+0100 (GMT+01:00) */; -var SVG = (function () { - 'use strict'; - - function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function (obj) { - return typeof obj; - }; - } else { - _typeof = function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - } - - return _typeof(obj); +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var _core = createCommonjsModule(function (module) { +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef +}); +var _core_1 = _core.version; + +var _global = createCommonjsModule(function (module) { +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef +}); + +var _library = false; + +var _shared = createCommonjsModule(function (module) { +var SHARED = '__core-js_shared__'; +var store = _global[SHARED] || (_global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: _core.version, + mode: _library ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); +}); + +var id = 0; +var px = Math.random(); +var _uid = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + +var _wks = createCommonjsModule(function (module) { +var store = _shared('wks'); + +var Symbol = _global.Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name)); +}; + +$exports.store = store; +}); + +var _isObject = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + +var _anObject = function (it) { + if (!_isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + +var _fails = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; } - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } +}; + +// Thank's IE8 for his funny defineProperty +var _descriptors = !_fails(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + +var document$1 = _global.document; +// typeof document.createElement is 'object' in old IE +var is = _isObject(document$1) && _isObject(document$1.createElement); +var _domCreate = function (it) { + return is ? document$1.createElement(it) : {}; +}; + +var _ie8DomDefine = !_descriptors && !_fails(function () { + return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + +// 7.1.1 ToPrimitive(input [, PreferredType]) + +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +var _toPrimitive = function (it, S) { + if (!_isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + +var dP = Object.defineProperty; + +var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { + _anObject(O); + P = _toPrimitive(P, true); + _anObject(Attributes); + if (_ie8DomDefine) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + +var _objectDp = { + f: f +}; + +var _propertyDesc = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + +var _hide = _descriptors ? function (object, key, value) { + return _objectDp.f(object, key, _propertyDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = _wks('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) _hide(ArrayProto, UNSCOPABLES, {}); +var _addToUnscopables = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + +var _iterStep = function (done, value) { + return { value: value, done: !!done }; +}; + +var _iterators = {}; + +var toString = {}.toString; + +var _cof = function (it) { + return toString.call(it).slice(8, -1); +}; + +// fallback for non-array-like ES3 and non-enumerable old V8 strings + +// eslint-disable-next-line no-prototype-builtins +var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return _cof(it) == 'String' ? it.split('') : Object(it); +}; + +// 7.2.1 RequireObjectCoercible(argument) +var _defined = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + +// to indexed object, toObject with fallback for non-array-like ES3 strings + + +var _toIobject = function (it) { + return _iobject(_defined(it)); +}; + +var hasOwnProperty = {}.hasOwnProperty; +var _has = function (it, key) { + return hasOwnProperty.call(it, key); +}; + +var _redefine = createCommonjsModule(function (module) { +var SRC = _uid('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +_core.inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) _has(val, 'name') || _hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === _global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + _hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + _hide(O, key, val); } - - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); +}); + +var _aFunction = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + +// optional / simple context binding + +var _ctx = function (fn, that, length) { + _aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; } - - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) _defineProperties(Constructor.prototype, protoProps); - if (staticProps) _defineProperties(Constructor, staticProps); - return Constructor; + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; + // extend global + if (target) _redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) _hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; } +}; +_global.core = _core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +var _export = $export; + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +var _toInteger = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + +// 7.1.15 ToLength + +var min = Math.min; +var _toLength = function (it) { + return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + +var max = Math.max; +var min$1 = Math.min; +var _toAbsoluteIndex = function (index, length) { + index = _toInteger(index); + return index < 0 ? max(index + length, 0) : min$1(index, length); +}; + +// false -> Array#indexOf +// true -> Array#includes + + + +var _arrayIncludes = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = _toIobject($this); + var length = _toLength(O.length); + var index = _toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + +var shared = _shared('keys'); + +var _sharedKey = function (key) { + return shared[key] || (shared[key] = _uid(key)); +}; + +var arrayIndexOf = _arrayIncludes(false); +var IE_PROTO = _sharedKey('IE_PROTO'); + +var _objectKeysInternal = function (object, names) { + var O = _toIobject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (_has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; +// IE 8- don't enum bug keys +var _enumBugKeys = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) + + + +var _objectKeys = Object.keys || function keys(O) { + return _objectKeysInternal(O, _enumBugKeys); +}; + +var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { + _anObject(O); + var keys = _objectKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]); + return O; +}; + +var document$2 = _global.document; +var _html = document$2 && document$2.documentElement; + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) + + + +var IE_PROTO$1 = _sharedKey('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE$1 = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = _domCreate('iframe'); + var i = _enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + _html.appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]]; + return createDict(); +}; + +var _objectCreate = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE$1] = _anObject(O); + result = new Empty(); + Empty[PROTOTYPE$1] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO$1] = O; + } else result = createDict(); + return Properties === undefined ? result : _objectDps(result, Properties); +}; + +var def = _objectDp.f; + +var TAG = _wks('toStringTag'); + +var _setToStringTag = function (it, tag, stat) { + if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +_hide(IteratorPrototype, _wks('iterator'), function () { return this; }); + +var _iterCreate = function (Constructor, NAME, next) { + Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); + _setToStringTag(Constructor, NAME + ' Iterator'); +}; + +// 7.1.13 ToObject(argument) + +var _toObject = function (it) { + return Object(_defined(it)); +}; + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) + + +var IE_PROTO$2 = _sharedKey('IE_PROTO'); +var ObjectProto = Object.prototype; + +var _objectGpo = Object.getPrototypeOf || function (O) { + O = _toObject(O); + if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + +var ITERATOR = _wks('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + _iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = _objectGpo($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + _setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!_library && typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis); } - - return obj; } - - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); - } - - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + _hide(proto, ITERATOR, $default); + } + // Plug for library + _iterators[NAME] = $default; + _iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) _redefine(proto, key, methods[key]); + } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { + this._t = _toIobject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return _iterStep(1); + } + if (kind == 'keys') return _iterStep(0, index); + if (kind == 'values') return _iterStep(0, O[index]); + return _iterStep(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +_iterators.Arguments = _iterators.Array; + +_addToUnscopables('keys'); +_addToUnscopables('values'); +_addToUnscopables('entries'); + +var ITERATOR$1 = _wks('iterator'); +var TO_STRING_TAG = _wks('toStringTag'); +var ArrayValues = _iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = _global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR$1]) _hide(proto, ITERATOR$1, ArrayValues); + if (!proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME); + _iterators[NAME] = ArrayValues; + if (explicit) for (key in es6_array_iterator) if (!proto[key]) _redefine(proto, key, es6_array_iterator[key], true); + } +} + +const methods = {}; +const names = []; +function registerMethods(name, m) { + if (Array.isArray(name)) { + for (let _name of name) { + registerMethods(_name, m); } - return target; + return; } - function _inherits(subClass, superClass) { - if (typeof superClass !== "function" && superClass !== null) { - throw new TypeError("Super expression must either be null or a function"); + if (typeof name === 'object') { + for (let _name in name) { + registerMethods(_name, name[_name]); } - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - writable: true, - configurable: true - } - }); - if (superClass) _setPrototypeOf(subClass, superClass); + return; } - function _getPrototypeOf(o) { - _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { - return o.__proto__ || Object.getPrototypeOf(o); - }; - return _getPrototypeOf(o); + addMethodNames(Object.keys(m)); + methods[name] = Object.assign(methods[name] || {}, m); +} +function getMethodsFor(name) { + return methods[name] || {}; +} +function getMethodNames() { + return [...new Set(names)]; +} +function addMethodNames(_names) { + names.push(..._names); +} + +var _fixReWks = function (KEY, length, exec) { + var SYMBOL = _wks(KEY); + var fns = exec(_defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (_fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + _redefine(String.prototype, KEY, strfn); + _hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + +// @@replace logic +_fixReWks('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); + +// Map function +function map(array, block) { + var i; + var il = array.length; + var result = []; + + for (i = 0; i < il; i++) { + result.push(block(array[i])); } - function _setPrototypeOf(o, p) { - _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { - o.__proto__ = p; - return o; - }; + return result; +} // Filter function - return _setPrototypeOf(o, p); - } +function filter(array, block) { + var i; + var il = array.length; + var result = []; - function _assertThisInitialized(self) { - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + for (i = 0; i < il; i++) { + if (block(array[i])) { + result.push(array[i]); } - - return self; } - function _possibleConstructorReturn(self, call) { - if (call && (typeof call === "object" || typeof call === "function")) { - return call; - } + return result; +} // Degrees to radians - return _assertThisInitialized(self); - } +function radians(d) { + return d % 360 * Math.PI / 180; +} // Radians to degrees - function _superPropBase(object, property) { - while (!Object.prototype.hasOwnProperty.call(object, property)) { - object = _getPrototypeOf(object); - if (object === null) break; - } +function degrees(r) { + return r * 180 / Math.PI % 360; +} // Convert dash-separated-string to camelCase - return object; - } +function camelCase(s) { + return s.toLowerCase().replace(/-(.)/g, function (m, g) { + return g.toUpperCase(); + }); +} // Convert camel cased string to string seperated - function _get(target, property, receiver) { - if (typeof Reflect !== "undefined" && Reflect.get) { - _get = Reflect.get; - } else { - _get = function _get(target, property, receiver) { - var base = _superPropBase(target, property); +function unCamelCase(s) { + return s.replace(/([A-Z])/g, function (m, g) { + return '-' + g.toLowerCase(); + }); +} // Capitalize first letter of a string - if (!base) return; - var desc = Object.getOwnPropertyDescriptor(base, property); +function capitalize(s) { + return s.charAt(0).toUpperCase() + s.slice(1); +} // Calculate proportional width and height values when necessary - if (desc.get) { - return desc.get.call(receiver); - } +function proportionalSize(element, width, height) { + if (width == null || height == null) { + var box = element.bbox(); - return desc.value; - }; + if (width == null) { + width = box.width / box.height * height; + } else if (height == null) { + height = box.height / box.width * width; } - - return _get(target, property, receiver || target); } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); - } + return { + width: width, + height: height + }; +} +function getOrigin(o, element) { + // Allow origin or around as the names + let origin = o.origin; // o.around == null ? o.origin : o.around - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); - } + let ox, oy; // Allow the user to pass a string to rotate around a given point - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + if (typeof origin === 'string' || origin == null) { + // Get the bounding box of the element with no transformations applied + const string = (origin || 'center').toLowerCase().trim(); - return arr2; - } + const _element$bbox = element.bbox(), + height = _element$bbox.height, + width = _element$bbox.width, + x = _element$bbox.x, + y = _element$bbox.y; // Calculate the transformed x and y coordinates + + + let bx = string.includes('left') ? x : string.includes('right') ? x + width : x + width / 2; + let by = string.includes('top') ? y : string.includes('bottom') ? y + height : y + height / 2; // Set the bounds eg : "bottom-left", "Top right", "middle" etc... + + ox = o.ox != null ? o.ox : bx; + oy = o.oy != null ? o.oy : by; + } else { + ox = origin[0]; + oy = origin[1]; + } // Return the origin as it is if it wasn't a string + + + return [ox, oy]; +} + +var utils = /*#__PURE__*/Object.freeze({ + map: map, + filter: filter, + radians: radians, + degrees: degrees, + camelCase: camelCase, + unCamelCase: unCamelCase, + capitalize: capitalize, + proportionalSize: proportionalSize, + getOrigin: getOrigin +}); + +// Default namespaces +let ns = 'http://www.w3.org/2000/svg'; +let xmlns = 'http://www.w3.org/2000/xmlns/'; +let xlink = 'http://www.w3.org/1999/xlink'; +let svgjs = 'http://svgjs.com/svgjs'; + +var namespaces = /*#__PURE__*/Object.freeze({ + ns: ns, + xmlns: xmlns, + xlink: xlink, + svgjs: svgjs +}); + +const globals = { + window: typeof window === 'undefined' ? null : window, + document: typeof document === 'undefined' ? null : document +}; +function registerWindow(win = null, doc = null) { + globals.window = win; + globals.document = doc; +} + +class Base {// constructor (node/*, {extensions = []} */) { + // // this.tags = [] + // // + // // for (let extension of extensions) { + // // extension.setup.call(this, node) + // // this.tags.push(extension.name) + // // } + // } +} + +const elements = {}; +const root = '___SYMBOL___ROOT___'; // Method for element creation + +function makeNode(name) { + // create element + return globals.document.createElementNS(ns, name); +} +function makeInstance(element) { + if (element instanceof Base) return element; + + if (typeof element === 'object') { + return adopter(element); } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) return arr; + if (element == null) { + return new elements[root](); } - function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof element === 'string' && element.charAt(0) !== '<') { + return adopter(globals.document.querySelector(element)); } - function _iterableToArrayLimit(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; + var node = makeNode('svg'); + node.innerHTML = element; // We can use firstChild here because we know, + // that the first char is < and thus an element - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); + element = adopter(node.firstChild); + return element; +} +function nodeOrNew(name, node) { + return node instanceof globals.window.Node ? node : makeNode(name); +} // Adopt existing svg elements - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) _i["return"](); - } finally { - if (_d) throw _e; - } - } +function adopt(node) { + // check for presence of node + if (!node) return null; // make sure a node isn't already adopted + + if (node.instance instanceof Base) return node.instance; // initialize variables - return _arr; + var className = capitalize(node.nodeName); // Make sure that gradients are adopted correctly + + if (className === 'LinearGradient' || className === 'RadialGradient') { + className = 'Gradient'; // Fallback to Dom if element is not known + } else if (!elements[className]) { + className = 'Dom'; } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + return new elements[className](node); +} +let adopter = adopt; +function mockAdopt(mock = adopt) { + adopter = mock; +} +function register(element, name = element.name, asRoot = false) { + elements[name] = element; + if (asRoot) elements[root] = element; + addMethodNames(Object.keys(element.prototype)); + return element; +} +function getClass(name) { + return elements[name]; +} // Element id sequence + +let did = 1000; // Get next named element id + +function eid(name) { + return 'Svgjs' + capitalize(name) + did++; +} // Deep new id assignment + +function assignNewId(node) { + // do the same for SVG child nodes as well + for (var i = node.children.length - 1; i >= 0; i--) { + assignNewId(node.children[i]); } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); + if (node.id) { + return adopt(node).id(eid(node.nodeName)); } - var methods = {}; - var names = []; - function registerMethods(name, m) { - if (Array.isArray(name)) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + return adopt(node); +} // Method for extending objects - try { - for (var _iterator = name[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var _name = _step.value; - registerMethods(_name, m); - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } +function extend(modules, methods, attrCheck) { + var key, i; + modules = Array.isArray(modules) ? modules : [modules]; + + for (i = modules.length - 1; i >= 0; i--) { + for (key in methods) { + let method = methods[key]; + + if (attrCheck) { + method = wrapWithAttrCheck(methods[key]); } - return; + modules[i].prototype[key] = method; } + } +} // export function extendWithAttrCheck (...args) { +// extend(...args, true) +// } - if (_typeof(name) === 'object') { - var _arr = Object.entries(name); +function wrapWithAttrCheck(fn) { + return function (...args) { + let o = args[args.length - 1]; - for (var _i = 0; _i < _arr.length; _i++) { - var _arr$_i = _slicedToArray(_arr[_i], 2), - _name2 = _arr$_i[0], - _m = _arr$_i[1]; + if (o && o.constructor === Object && !(o instanceof Array)) { + return fn.apply(this, args.slice(0, -1)).attr(o); + } else { + return fn.apply(this, args); + } + }; +} - registerMethods(_name2, _m); - } +function siblings() { + return this.parent().children(); +} // Get the curent position siblings - return; - } +function position() { + return this.parent().index(this); +} // Get the next element (will return null if there is none) - addMethodNames(Object.keys(m)); - methods[name] = Object.assign(methods[name] || {}, m); - } - function getMethodsFor(name) { - return methods[name] || {}; - } - function getMethodNames() { - return _toConsumableArray(new Set(names)); - } - function addMethodNames(_names) { - names.push.apply(names, _toConsumableArray(_names)); - } +function next() { + return this.siblings()[this.position() + 1]; +} // Get the next element (will return null if there is none) - // Map function - function map(array, block) { - var i; - var il = array.length; - var result = []; +function prev() { + return this.siblings()[this.position() - 1]; +} // Send given element one step forward - for (i = 0; i < il; i++) { - result.push(block(array[i])); - } +function forward() { + var i = this.position() + 1; + var p = this.parent(); // move node one step forward - return result; - } // Filter function + p.removeElement(this).add(this, i); // make sure defs node is always at the top - function filter(array, block) { - var i; - var il = array.length; - var result = []; + if (typeof p.isRoot === 'function' && p.isRoot()) { + p.node.appendChild(p.defs().node); + } - for (i = 0; i < il; i++) { - if (block(array[i])) { - result.push(array[i]); - } - } + return this; +} // Send given element one step backward - return result; - } // Degrees to radians +function backward() { + var i = this.position(); - function radians(d) { - return d % 360 * Math.PI / 180; - } // Radians to degrees + if (i > 0) { + this.parent().removeElement(this).add(this, i - 1); + } - function degrees(r) { - return r * 180 / Math.PI % 360; - } // Convert dash-separated-string to camelCase + return this; +} // Send given element all the way to the front - function camelCase(s) { - return s.toLowerCase().replace(/-(.)/g, function (m, g) { - return g.toUpperCase(); - }); - } // Convert camel cased string to string seperated +function front() { + var p = this.parent(); // Move node forward - function unCamelCase(s) { - return s.replace(/([A-Z])/g, function (m, g) { - return '-' + g.toLowerCase(); - }); - } // Capitalize first letter of a string + p.node.appendChild(this.node); // Make sure defs node is always at the top - function capitalize(s) { - return s.charAt(0).toUpperCase() + s.slice(1); - } // Calculate proportional width and height values when necessary + if (typeof p.isRoot === 'function' && p.isRoot()) { + p.node.appendChild(p.defs().node); + } - function proportionalSize(element, width, height) { - if (width == null || height == null) { - var box = element.bbox(); + return this; +} // Send given element all the way to the back - if (width == null) { - width = box.width / box.height * height; - } else if (height == null) { - height = box.height / box.width * width; - } - } +function back() { + if (this.position() > 0) { + this.parent().removeElement(this).add(this, 0); + } - return { - width: width, - height: height + return this; +} // Inserts a given element before the targeted element + +function before(element) { + element = makeInstance(element); + element.remove(); + var i = this.position(); + this.parent().add(element, i); + return this; +} // Inserts a given element after the targeted element + +function after(element) { + element = makeInstance(element); + element.remove(); + var i = this.position(); + this.parent().add(element, i + 1); + return this; +} +function insertBefore(element) { + element = makeInstance(element); + element.before(this); +} +function insertAfter(element) { + element = makeInstance(element); + element.after(this); +} +registerMethods('Dom', { + siblings, + position, + next, + prev, + forward, + backward, + front, + back, + before, + after, + insertBefore, + insertAfter +}); + +// 7.2.8 IsRegExp(argument) + + +var MATCH = _wks('match'); +var _isRegexp = function (it) { + var isRegExp; + return _isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof(it) == 'RegExp'); +}; + +// @@split logic +_fixReWks('split', 2, function (defined, SPLIT, $split) { + var isRegExp = _isRegexp; + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); }; } - function getOrigin(o, element) { - // Allow origin or around as the names - var origin = o.origin; // o.around == null ? o.origin : o.around + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); - var ox, oy; // Allow the user to pass a string to rotate around a given point +// Parse unit value +let numberAndUnit = /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i; // Parse hex value - if (typeof origin === 'string' || origin == null) { - // Get the bounding box of the element with no transformations applied - var string = (origin || 'center').toLowerCase().trim(); +let hex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; // Parse rgb value - var _element$bbox = element.bbox(), - height = _element$bbox.height, - width = _element$bbox.width, - x = _element$bbox.x, - y = _element$bbox.y; // Calculate the transformed x and y coordinates +let rgb = /rgb\((\d+),(\d+),(\d+)\)/; // Parse reference id +let reference = /(#[a-z0-9\-_]+)/i; // splits a transformation chain - var bx = string.includes('left') ? x : string.includes('right') ? x + width : x + width / 2; - var by = string.includes('top') ? y : string.includes('bottom') ? y + height : y + height / 2; // Set the bounds eg : "bottom-left", "Top right", "middle" etc... +let transforms = /\)\s*,?\s*/; // Whitespace - ox = o.ox != null ? o.ox : bx; - oy = o.oy != null ? o.oy : by; - } else { - ox = origin[0]; - oy = origin[1]; - } // Return the origin as it is if it wasn't a string +let whitespace = /\s/g; // Test hex value +let isHex = /^#[a-f0-9]{3,6}$/i; // Test rgb value - return [ox, oy]; - } +let isRgb = /^rgb\(/; // Test css declaration - // Default namespaces - 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'; +let isCss = /[^:]+:[^;]+;?/; // Test for blank string - var globals = { - window: typeof window === 'undefined' ? null : window, - document: typeof document === 'undefined' ? null : document - }; - function registerWindow() { - var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var doc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - globals.window = win; - globals.document = doc; - } +let isBlank = /^(\s+)?$/; // Test for numeric string - var Base = function Base() { - _classCallCheck(this, Base); - }; +let isNumber = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; // Test for percent value - var elements = {}; - var root = Symbol('root'); // Method for element creation +let isPercent = /^-?[\d.]+%$/; // Test for image url - function makeNode(name) { - // create element - return globals.document.createElementNS(ns, name); - } - function makeInstance(element) { - if (element instanceof Base) return element; +let isImage = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i; // split at whitespace and comma - if (_typeof(element) === 'object') { - return adopt(element); - } +let delimiter = /[\s,]+/; // The following regex are used to parse the d attribute of a path +// Matches all hyphens which are not after an exponent - if (element == null) { - return new elements[root](); - } +let hyphen = /([^e])-/gi; // Replaces and tests for all path letters - if (typeof element === 'string' && element.charAt(0) !== '<') { - return adopt(globals.document.querySelector(element)); - } +let pathLetters = /[MLHVCSQTAZ]/gi; // yes we need this one, too - var node = makeNode('svg'); - node.innerHTML = element; // We can use firstChild here because we know, - // that the first char is < and thus an element +let isPathLetter = /[MLHVCSQTAZ]/i; // matches 0.154.23.45 - element = adopt(node.firstChild); - return element; - } - function nodeOrNew(name, node) { - return node instanceof globals.window.Node ? node : makeNode(name); - } // Adopt existing svg elements +let numbersWithDots = /((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi; // matches . - function adopt(node) { - // check for presence of node - if (!node) return null; // make sure a node isn't already adopted +let dots = /\./g; - if (node.instance instanceof Base) return node.instance; +var regex = /*#__PURE__*/Object.freeze({ + numberAndUnit: numberAndUnit, + hex: hex, + rgb: rgb, + reference: reference, + transforms: transforms, + whitespace: whitespace, + isHex: isHex, + isRgb: isRgb, + isCss: isCss, + isBlank: isBlank, + isNumber: isNumber, + isPercent: isPercent, + isImage: isImage, + delimiter: delimiter, + hyphen: hyphen, + pathLetters: pathLetters, + isPathLetter: isPathLetter, + numbersWithDots: numbersWithDots, + dots: dots +}); - if (!(node instanceof globals.window.SVGElement)) { - return new elements.HtmlNode(node); - } // initialize variables +function classes() { + var attr = this.attr('class'); + return attr == null ? [] : attr.trim().split(delimiter); +} // Return true if class exists on the node, false otherwise +function hasClass(name) { + return this.classes().indexOf(name) !== -1; +} // Add class to the node - var element; // adopt with element-specific settings +function addClass(name) { + if (!this.hasClass(name)) { + var array = this.classes(); + array.push(name); + this.attr('class', array.join(' ')); + } - if (node.nodeName === 'svg') { - element = new elements[root](node); - } else if (node.nodeName === 'linearGradient' || node.nodeName === 'radialGradient') { - element = new elements.Gradient(node); - } else if (elements[capitalize(node.nodeName)]) { - element = new elements[capitalize(node.nodeName)](node); - } else { - element = new elements.Bare(node); - } + return this; +} // Remove class from the node - return element; +function removeClass(name) { + if (this.hasClass(name)) { + this.attr('class', this.classes().filter(function (c) { + return c !== name; + }).join(' ')); } - function register(element) { - var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : element.name; - var asRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - elements[name] = element; - if (asRoot) elements[root] = element; - addMethodNames(Object.keys(element.prototype)); - return element; + + return this; +} // Toggle the presence of a class on the node + +function toggleClass(name) { + return this.hasClass(name) ? this.removeClass(name) : this.addClass(name); +} +registerMethods('Dom', { + classes, + hasClass, + addClass, + removeClass, + toggleClass +}); + +function css(style, val) { + let ret = {}; + + if (arguments.length === 0) { + // get full style as object + this.node.style.cssText.split(/\s*;\s*/).filter(function (el) { + return !!el.length; + }).forEach(function (el) { + let t = el.split(/\s*:\s*/); + ret[t[0]] = t[1]; + }); + return ret; } - function getClass(name) { - return elements[name]; - } // Element id sequence - var did = 1000; // Get next named element id + if (arguments.length < 2) { + // get style properties in the array + if (Array.isArray(style)) { + for (let name of style) { + let cased = camelCase(name); + ret[cased] = this.node.style[cased]; + } - function eid(name) { - return 'Svgjs' + capitalize(name) + did++; - } // Deep new id assignment + return ret; + } // get style for property - function assignNewId(node) { - // do the same for SVG child nodes as well - for (var i = node.children.length - 1; i >= 0; i--) { - assignNewId(node.children[i]); - } - if (node.id) { - return adopt(node).id(eid(node.nodeName)); - } + if (typeof style === 'string') { + return this.node.style[camelCase(style)]; + } // set styles in object - return adopt(node); - } // Method for extending objects - function extend(modules, methods, attrCheck) { - var key, i; - modules = Array.isArray(modules) ? modules : [modules]; + if (typeof style === 'object') { + for (let name in style) { + // set empty string if null/undefined/'' was given + this.node.style[camelCase(name)] = style[name] == null || isBlank.test(style[name]) ? '' : style[name]; + } + } + } // set style for property - for (i = modules.length - 1; i >= 0; i--) { - for (key in methods) { - var method = methods[key]; - if (attrCheck) { - method = wrapWithAttrCheck(methods[key]); - } + if (arguments.length === 2) { + this.node.style[camelCase(style)] = val == null || isBlank.test(val) ? '' : val; + } - modules[i].prototype[key] = method; - } + return this; +} // Show element + +function show() { + return this.css('display', ''); +} // Hide element + +function hide() { + return this.css('display', 'none'); +} // Is element visible? + +function visible() { + return this.css('display') !== 'none'; +} +registerMethods('Dom', { + css, + show, + hide, + visible +}); + +function data(a, v, r) { + if (typeof a === 'object') { + for (v in a) { + this.data(v, a[v]); } - } - function extendWithAttrCheck() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + } 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)); + } - extend.apply(void 0, args.concat([true])); + return this; +} +registerMethods('Dom', { + data +}); + +function remember(k, v) { + // remember every item in an object individually + if (typeof arguments[0] === 'object') { + for (var key in k) { + this.remember(key, k[key]); + } + } else if (arguments.length === 1) { + // retrieve memory + return this.memory()[k]; + } else { + // store memory + this.memory()[k] = v; } - function wrapWithAttrCheck(fn) { - return function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - var o = args[args.length - 1]; + return this; +} // Erase a given memory - if (o && o.constructor === Object && !(o instanceof Array)) { - return fn.apply(this, args.slice(0, -1)).attr(o); - } else { - return fn.apply(this, args); - } - }; +function forget() { + if (arguments.length === 0) { + this._memory = {}; + } else { + for (var i = arguments.length - 1; i >= 0; i--) { + delete this.memory()[arguments[i]]; + } } - function siblings() { - return this.parent().children(); - } // Get the curent position siblings + return this; +} // This triggers creation of a new hidden class which is not performant +// However, this function is not rarely used so it will not happen frequently +// Return local memory object - function position() { - return this.parent().index(this); - } // Get the next element (will return null if there is none) +function memory() { + return this._memory = this._memory || {}; +} +registerMethods('Dom', { + remember, + forget, + memory +}); - function next() { - return this.siblings()[this.position() + 1]; - } // Get the next element (will return null if there is none) +let listenerId = 0; - function prev() { - return this.siblings()[this.position() - 1]; - } // Send given element one step forward +function getEvents(node) { + const n = makeInstance(node).getEventHolder(); + if (!n.events) n.events = {}; + return n.events; +} - function forward() { - var i = this.position() + 1; - var p = this.parent(); // move node one step forward +function getEventTarget(node) { + return makeInstance(node).getEventTarget(); +} - p.removeElement(this).add(this, i); // make sure defs node is always at the top +function clearEvents(node) { + const n = makeInstance(node).getEventHolder(); + if (n.events) n.events = {}; +} // Add event binder in the SVG namespace - if (typeof p.isRoot === 'function' && p.isRoot()) { - p.node.appendChild(p.defs().node); - } - return this; - } // Send given element one step backward +function on(node, events, listener, binding, options) { + var l = listener.bind(binding || node); + var bag = getEvents(node); + var n = getEventTarget(node); // events can be an array of events or a string of events - function backward() { - var i = this.position(); + events = Array.isArray(events) ? events : events.split(delimiter); // add id to listener - if (i > 0) { - this.parent().removeElement(this).add(this, i - 1); - } + if (!listener._svgjsListenerId) { + listener._svgjsListenerId = ++listenerId; + } - return this; - } // Send given element all the way to the front + events.forEach(function (event) { + var ev = event.split('.')[0]; + var ns = event.split('.')[1] || '*'; // ensure valid object - function front() { - var p = this.parent(); // Move node forward + bag[ev] = bag[ev] || {}; + bag[ev][ns] = bag[ev][ns] || {}; // reference listener - p.node.appendChild(this.node); // Make sure defs node is always at the top + bag[ev][ns][listener._svgjsListenerId] = l; // add listener - if (typeof p.isRoot === 'function' && p.isRoot()) { - p.node.appendChild(p.defs().node); - } + n.addEventListener(ev, l, options || false); + }); +} // Add event unbinder in the SVG namespace + +function off(node, events, listener, options) { + var bag = getEvents(node); + var n = getEventTarget(node); // listener can be a function or a number + + if (typeof listener === 'function') { + listener = listener._svgjsListenerId; + if (!listener) return; + } // events can be an array of events or a string or undefined + + + events = Array.isArray(events) ? events : (events || '').split(delimiter); + events.forEach(function (event) { + var ev = event && event.split('.')[0]; + var ns = event && event.split('.')[1]; + var namespace, l; + + if (listener) { + // remove listener reference + if (bag[ev] && bag[ev][ns || '*']) { + // removeListener + n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false); + delete bag[ev][ns || '*'][listener]; + } + } else if (ev && ns) { + // remove all listeners for a namespaced event + if (bag[ev] && bag[ev][ns]) { + for (l in bag[ev][ns]) { + off(n, [ev, ns].join('.'), l); + } - return this; - } // Send given element all the way to the back + delete bag[ev][ns]; + } + } else if (ns) { + // remove all listeners for a specific namespace + for (event in bag) { + for (namespace in bag[event]) { + if (ns === namespace) { + off(n, [event, ns].join('.')); + } + } + } + } else if (ev) { + // remove all listeners for the event + if (bag[ev]) { + for (namespace in bag[ev]) { + off(n, [ev, namespace].join('.')); + } + + delete bag[ev]; + } + } else { + // remove all listeners on a given node + for (event in bag) { + off(n, event); + } - function back() { - if (this.position() > 0) { - this.parent().removeElement(this).add(this, 0); + clearEvents(node); } + }); +} +function dispatch(node, event, data) { + var n = getEventTarget(node); // Dispatch event + + if (event instanceof globals.window.Event) { + n.dispatchEvent(event); + } else { + event = new globals.window.CustomEvent(event, { + detail: data, + cancelable: true + }); + n.dispatchEvent(event); + } - return this; - } // Inserts a given element before the targeted element + return event; +} + +// 21.2.5.3 get RegExp.prototype.flags + +var _flags = function () { + var that = _anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + +// 21.2.5.3 get RegExp.prototype.flags() +if (_descriptors && /./g.flags != 'g') _objectDp.f(RegExp.prototype, 'flags', { + configurable: true, + get: _flags +}); + +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + _redefine(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (_fails(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = _anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !_descriptors && R instanceof RegExp ? _flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} - function before(element) { - element = makeInstance(element); - element.remove(); - var i = this.position(); - this.parent().add(element, i); - return this; - } // Inserts a given element after the targeted element +function fullHex(hex$$1) { + return hex$$1.length === 4 ? ['#', hex$$1.substring(1, 2), hex$$1.substring(1, 2), hex$$1.substring(2, 3), hex$$1.substring(2, 3), hex$$1.substring(3, 4), hex$$1.substring(3, 4)].join('') : hex$$1; +} // Component to hex value - function after(element) { - element = makeInstance(element); - element.remove(); - var i = this.position(); - this.parent().add(element, i + 1); - return this; + +function compToHex(comp) { + var hex$$1 = comp.toString(16); + return hex$$1.length === 1 ? '0' + hex$$1 : hex$$1; +} + +class Color { + constructor(...args) { + this.init(...args); } - registerMethods('Dom', { - siblings: siblings, - position: position, - next: next, - prev: prev, - forward: forward, - backward: backward, - front: front, - back: back, - before: before, - after: after - }); - // Parse unit value - var numberAndUnit = /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i; // Parse hex value + init(color, g, b) { + let match; // initialize defaults + + this.r = 0; + this.g = 0; + this.b = 0; + if (!color) return; // parse color + + if (typeof color === 'string') { + if (isRgb.test(color)) { + // get rgb values + match = rgb.exec(color.replace(whitespace, '')); // parse numeric values + + this.r = parseInt(match[1]); + this.g = parseInt(match[2]); + this.b = parseInt(match[3]); + } else if (isHex.test(color)) { + // get hex values + match = hex.exec(fullHex(color)); // parse numeric values + + this.r = parseInt(match[1], 16); + this.g = parseInt(match[2], 16); + this.b = parseInt(match[3], 16); + } + } else if (Array.isArray(color)) { + this.r = color[0]; + this.g = color[1]; + this.b = color[2]; + } else if (typeof color === 'object') { + this.r = color.r; + this.g = color.g; + this.b = color.b; + } else if (arguments.length === 3) { + this.r = color; + this.g = g; + this.b = b; + } + + return this; + } // Default to hex conversion - var hex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i; // Parse rgb value - var rgb = /rgb\((\d+),(\d+),(\d+)\)/; // Parse reference id + toString() { + return this.toHex(); + } - var reference = /(#[a-z0-9\-_]+)/i; // splits a transformation chain + toArray() { + return [this.r, this.g, this.b]; + } // Build hex value - var transforms = /\)\s*,?\s*/; // Whitespace - var whitespace = /\s/g; // Test hex value + toHex() { + return '#' + compToHex(Math.round(this.r)) + compToHex(Math.round(this.g)) + compToHex(Math.round(this.b)); + } // Build rgb value - var isHex = /^#[a-f0-9]{3,6}$/i; // Test rgb value - var isRgb = /^rgb\(/; // Test css declaration + toRgb() { + return 'rgb(' + [this.r, this.g, this.b].join() + ')'; + } // Calculate true brightness - var isCss = /[^:]+:[^;]+;?/; // Test for blank string - var isBlank = /^(\s+)?$/; // Test for numeric string + brightness() { + return this.r / 255 * 0.30 + this.g / 255 * 0.59 + this.b / 255 * 0.11; + } // Testers + // Test if given value is a color string - var isNumber = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; // Test for percent value - var isPercent = /^-?[\d.]+%$/; // Test for image url + static test(color) { + color += ''; + return isHex.test(color) || isRgb.test(color); + } // Test if given value is a rgb object - var isImage = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i; // split at whitespace and comma - var delimiter = /[\s,]+/; // The following regex are used to parse the d attribute of a path - // Matches all hyphens which are not after an exponent + static isRgb(color) { + return color && typeof color.r === 'number' && typeof color.g === 'number' && typeof color.b === 'number'; + } // Test if given value is a color - var hyphen = /([^e])-/gi; // Replaces and tests for all path letters - var pathLetters = /[MLHVCSQTAZ]/gi; // yes we need this one, too + static isColor(color) { + return this.isRgb(color) || this.test(color); + } - var isPathLetter = /[MLHVCSQTAZ]/i; // matches 0.154.23.45 +} + +// @@match logic +_fixReWks('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); + +class Point { + // Initialize + constructor(...args) { + this.init(...args); + } - var numbersWithDots = /((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi; // matches . + init(x, y) { + let source; + let base = { + x: 0, + y: 0 // ensure source as object - var dots = /\./g; + }; + source = Array.isArray(x) ? { + x: x[0], + y: x[1] + } : typeof x === 'object' ? { + x: x.x, + y: x.y + } : { + x: x, + y: y // merge source - var regex = /*#__PURE__*/Object.freeze({ - numberAndUnit: numberAndUnit, - hex: hex, - rgb: rgb, - reference: reference, - transforms: transforms, - whitespace: whitespace, - isHex: isHex, - isRgb: isRgb, - isCss: isCss, - isBlank: isBlank, - isNumber: isNumber, - isPercent: isPercent, - isImage: isImage, - delimiter: delimiter, - hyphen: hyphen, - pathLetters: pathLetters, - isPathLetter: isPathLetter, - numbersWithDots: numbersWithDots, - dots: dots - }); + }; + this.x = source.x == null ? base.x : source.x; + this.y = source.y == null ? base.y : source.y; + return this; + } // Clone point - function classes() { - var attr = this.attr('class'); - return attr == null ? [] : attr.trim().split(delimiter); - } // Return true if class exists on the node, false otherwise - function hasClass(name) { - return this.classes().indexOf(name) !== -1; - } // Add class to the node + clone() { + return new Point(this); + } // transform point with matrix - function addClass(name) { - if (!this.hasClass(name)) { - var array = this.classes(); - array.push(name); - this.attr('class', array.join(' ')); - } - return this; - } // Remove class from the node + transform(m) { + // Perform the matrix multiplication + var x = m.a * this.x + m.c * this.y + m.e; + var y = m.b * this.x + m.d * this.y + m.f; // Return the required point - function removeClass(name) { - if (this.hasClass(name)) { - this.attr('class', this.classes().filter(function (c) { - return c !== name; - }).join(' ')); - } + return new Point(x, y); + } - return this; - } // Toggle the presence of a class on the node + toArray() { + return [this.x, this.y]; + } - function toggleClass(name) { - return this.hasClass(name) ? this.removeClass(name) : this.addClass(name); +} +function point(x, y) { + return new Point(x, y).transform(this.screenCTM().inverse()); +} + +function parser() { + // Reuse cached element if possible + if (!parser.nodes) { + let svg = makeInstance().size(2, 0); + svg.node.cssText = ['opacity: 0', 'position: absolute', 'left: -100%', 'top: -100%', 'overflow: hidden'].join(';'); + let path = svg.path().node; + parser.nodes = { + svg, + path + }; } - registerMethods('Dom', { - classes: classes, - hasClass: hasClass, - addClass: addClass, - removeClass: removeClass, - toggleClass: toggleClass - }); - function css(style, val) { - var ret = {}; + if (!parser.nodes.svg.node.parentNode) { + let b = globals.document.body || globals.document.documentElement; + parser.nodes.svg.addTo(b); + } - if (arguments.length === 0) { - // get full style as object - this.node.style.cssText.split(/\s*;\s*/).filter(function (el) { - return !!el.length; - }).forEach(function (el) { - var t = el.split(/\s*:\s*/); - ret[t[0]] = t[1]; - }); - return ret; - } + return parser.nodes; +} - if (arguments.length < 2) { - // get style properties in the array - if (Array.isArray(style)) { - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - 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]; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } +function isNulledBox(box) { + return !box.w && !box.h && !box.x && !box.y; +} - return ret; - } // get style for property +function domContains(node) { + return (globals.document.documentElement.contains || function (node) { + // This is IE - it does not support contains() for top-level SVGs + while (node.parentNode) { + node = node.parentNode; + } + return node === document; + }).call(globals.document.documentElement, node); +} - if (typeof style === 'string') { - return this.node.style[camelCase(style)]; - } // set styles in object +class Box { + constructor(...args) { + this.init(...args); + } + init(source) { + var base = [0, 0, 0, 0]; + source = typeof source === 'string' ? source.split(delimiter).map(parseFloat) : Array.isArray(source) ? source : typeof source === 'object' ? [source.left != null ? source.left : source.x, source.top != null ? source.top : source.y, source.width, source.height] : arguments.length === 4 ? [].slice.call(arguments) : base; + this.x = source[0] || 0; + this.y = source[1] || 0; + this.width = this.w = source[2] || 0; + this.height = this.h = source[3] || 0; // Add more bounding box properties + + this.x2 = this.x + this.w; + this.y2 = this.y + this.h; + this.cx = this.x + this.w / 2; + this.cy = this.y + this.h / 2; + return this; + } // Merge rect box with another, return a new instance - if (_typeof(style) === 'object') { - for (var _name in style) { - // set empty string if null/undefined/'' was given - this.node.style[camelCase(_name)] = style[_name] == null || isBlank.test(style[_name]) ? '' : style[_name]; - } - } - } // set style for property + merge(box) { + let x = Math.min(this.x, box.x); + let y = Math.min(this.y, box.y); + let width = Math.max(this.x + this.width, box.x + box.width) - x; + let height = Math.max(this.y + this.height, box.y + box.height) - y; + return new Box(x, y, width, height); + } - if (arguments.length === 2) { - this.node.style[camelCase(style)] = val == null || isBlank.test(val) ? '' : val; - } + transform(m) { + let xMin = Infinity; + let xMax = -Infinity; + let yMin = Infinity; + let yMax = -Infinity; + let 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); + xMax = Math.max(xMax, p.x); + yMin = Math.min(yMin, p.y); + yMax = Math.max(yMax, p.y); + }); + return new Box(xMin, yMin, xMax - xMin, yMax - yMin); + } + addOffset() { + // offset by window scroll position, because getBoundingClientRect changes when window is scrolled + this.x += globals.window.pageXOffset; + this.y += globals.window.pageYOffset; return this; - } // Show element + } - function show() { - return this.css('display', ''); - } // Hide element + toString() { + return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height; + } - function hide() { - return this.css('display', 'none'); - } // Is element visible? + toArray() { + return [this.x, this.y, this.width, this.height]; + } - function visible() { - return this.css('display') !== 'none'; + isNulled() { + return isNulledBox(this); } - registerMethods('Dom', { - css: css, - show: show, - hide: hide, - visible: visible - }); - 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('Dom', { - data: data - }); +function getBox(cb, retry) { + let box; - function remember(k, v) { - // remember every item in an object individually - if (_typeof(arguments[0]) === 'object') { - for (var key in k) { - this.remember(key, k[key]); - } - } else if (arguments.length === 1) { - // retrieve memory - return this.memory()[k]; - } else { - // store memory - this.memory()[k] = v; + try { + box = cb(this.node); + + if (isNulledBox(box) && !domContains(this.node)) { + throw new Error('Element not in the dom'); } + } catch (e) { + box = retry(this); + } - return this; - } // Erase a given memory + return box; +} - function forget() { - if (arguments.length === 0) { - this._memory = {}; - } else { - for (var i = arguments.length - 1; i >= 0; i--) { - delete this.memory()[arguments[i]]; - } +function bbox() { + return new Box(getBox.call(this, node => node.getBBox(), el => { + try { + let clone = el.clone().addTo(parser().svg).show(); + let box = clone.node.getBBox(); + clone.remove(); + return box; + } catch (e) { + throw new Error('Getting bbox of element "' + el.node.nodeName + '" is not possible'); + } + })); +} +function rbox(el) { + let box = new Box(getBox.call(this, node => node.getBoundingClientRect(), el => { + throw new Error('Getting rbox of element "' + el.node.nodeName + '" is not possible'); + })); + if (el) return box.transform(el.screenCTM().inverse()); + return box.addOffset(); +} +registerMethods({ + viewbox: { + viewbox(x, y, width, height) { + // act as getter + if (x == null) return new Box(this.attr('viewBox')); // act as setter + + return this.attr('viewBox', new Box(x, y, width, height)); } - return this; - } // This triggers creation of a new hidden class which is not performant - // However, this function is not rarely used so it will not happen frequently - // Return local memory object - - function memory() { - return this._memory = this._memory || {}; } - registerMethods('Dom', { - remember: remember, - forget: forget, - memory: memory - }); +}); - var listenerId = 0; +function closeEnough(a, b, threshold) { + return Math.abs(b - a) < (threshold || 1e-6); +} - function getEvents(node) { - var n = makeInstance(node).getEventHolder(); - if (!n.events) n.events = {}; - return n.events; - } +class Matrix { + constructor(...args) { + this.init(...args); + } // Initialize - function getEventTarget(node) { - return makeInstance(node).getEventTarget(); - } - function clearEvents(node) { - var n = makeInstance(node).getEventHolder(); - if (n.events) n.events = {}; - } // Add event binder in the SVG namespace + init(source) { + var base = Matrix.fromArray([1, 0, 0, 1, 0, 0]); // ensure source as object + source = source instanceof Element ? source.matrixify() : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat)) : Array.isArray(source) ? Matrix.fromArray(source) : typeof source === 'object' && Matrix.isMatrixLike(source) ? source : typeof source === 'object' ? new Matrix().transform(source) : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments)) : base; // Merge the source matrix with the base matrix - function on(node, events, listener, binding, options) { - var l = listener.bind(binding || node); - var bag = getEvents(node); - var n = getEventTarget(node); // events can be an array of events or a string of events + this.a = source.a != null ? source.a : base.a; + this.b = source.b != null ? source.b : base.b; + this.c = source.c != null ? source.c : base.c; + this.d = source.d != null ? source.d : base.d; + this.e = source.e != null ? source.e : base.e; + this.f = source.f != null ? source.f : base.f; + return this; + } // Clones this matrix - events = Array.isArray(events) ? events : events.split(delimiter); // add id to listener - if (!listener._svgjsListenerId) { - listener._svgjsListenerId = ++listenerId; - } + clone() { + return new Matrix(this); + } // Transform a matrix into another matrix by manipulating the space - events.forEach(function (event) { - var ev = event.split('.')[0]; - var ns = event.split('.')[1] || '*'; // ensure valid object - bag[ev] = bag[ev] || {}; - bag[ev][ns] = bag[ev][ns] || {}; // reference listener + transform(o) { + // Check if o is a matrix and then left multiply it directly + if (Matrix.isMatrixLike(o)) { + var matrix = new Matrix(o); + return matrix.multiplyO(this); + } // Get the proposed transformations and the current transformations - bag[ev][ns][listener._svgjsListenerId] = l; // add listener - n.addEventListener(ev, l, options || false); - }); - } // Add event unbinder in the SVG namespace - - function off(node, events, listener, options) { - var bag = getEvents(node); - var n = getEventTarget(node); // listener can be a function or a number - - if (typeof listener === 'function') { - listener = listener._svgjsListenerId; - if (!listener) return; - } // events can be an array of events or a string or undefined - - - events = Array.isArray(events) ? events : (events || '').split(delimiter); - events.forEach(function (event) { - var ev = event && event.split('.')[0]; - var ns = event && event.split('.')[1]; - var namespace, l; - - if (listener) { - // remove listener reference - if (bag[ev] && bag[ev][ns || '*']) { - // removeListener - n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false); - delete bag[ev][ns || '*'][listener]; - } - } else if (ev && ns) { - // remove all listeners for a namespaced event - if (bag[ev] && bag[ev][ns]) { - for (l in bag[ev][ns]) { - off(n, [ev, ns].join('.'), l); - } + var t = Matrix.formatTransforms(o); + var current = this; - delete bag[ev][ns]; - } - } else if (ns) { - // remove all listeners for a specific namespace - for (event in bag) { - for (namespace in bag[event]) { - if (ns === namespace) { - off(n, [event, ns].join('.')); - } - } - } - } else if (ev) { - // remove all listeners for the event - if (bag[ev]) { - for (namespace in bag[ev]) { - off(n, [ev, namespace].join('.')); - } + let _transform = new Point(t.ox, t.oy).transform(current), + ox = _transform.x, + oy = _transform.y; // Construct the resulting matrix - delete bag[ev]; - } - } else { - // remove all listeners on a given node - for (event in bag) { - off(n, event); - } - clearEvents(node); - } - }); - } - function dispatch(node, event, data) { - var n = getEventTarget(node); // Dispatch event + 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 (event instanceof globals.window.Event) { - n.dispatchEvent(event); - } else { - event = new globals.window.CustomEvent(event, { - detail: data, - cancelable: true - }); - n.dispatchEvent(event); - } + if (isFinite(t.px) || isFinite(t.py)) { + const origin = new Point(ox, oy).transform(transformer); // TODO: Replace t.px with isFinite(t.px) - return event; - } + const dx = t.px ? t.px - origin.x : 0; + const dy = t.py ? t.py - origin.y : 0; + transformer.translateO(dx, dy); + } // Translate now after positioning - function fullHex(hex$$1) { - return hex$$1.length === 4 ? ['#', hex$$1.substring(1, 2), hex$$1.substring(1, 2), hex$$1.substring(2, 3), hex$$1.substring(2, 3), hex$$1.substring(3, 4), hex$$1.substring(3, 4)].join('') : hex$$1; - } // Component to hex value + transformer.translateO(t.tx, t.ty); + return transformer; + } // Applies a matrix defined by its affine parameters - function compToHex(comp) { - var hex$$1 = comp.toString(16); - return hex$$1.length === 1 ? '0' + hex$$1 : hex$$1; - } - var Color = - /*#__PURE__*/ - function () { - function Color() { - _classCallCheck(this, Color); + compose(o) { + if (o.origin) { + o.originX = o.origin[0]; + o.originY = o.origin[1]; + } // Get the parameters - this.init.apply(this, arguments); - } - _createClass(Color, [{ - key: "init", - value: function init(color, g, b) { - var match; // initialize defaults - - this.r = 0; - this.g = 0; - this.b = 0; - if (!color) return; // parse color - - if (typeof color === 'string') { - if (isRgb.test(color)) { - // get rgb values - match = rgb.exec(color.replace(whitespace, '')); // parse numeric values - - this.r = parseInt(match[1]); - this.g = parseInt(match[2]); - this.b = parseInt(match[3]); - } else if (isHex.test(color)) { - // get hex values - match = hex.exec(fullHex(color)); // parse numeric values - - this.r = parseInt(match[1], 16); - this.g = parseInt(match[2], 16); - this.b = parseInt(match[3], 16); - } - } else if (Array.isArray(color)) { - this.r = color[0]; - this.g = color[1]; - this.b = color[2]; - } else if (_typeof(color) === 'object') { - this.r = color.r; - this.g = color.g; - this.b = color.b; - } else if (arguments.length === 3) { - this.r = color; - this.g = g; - this.b = b; - } + var ox = o.originX || 0; + var oy = o.originY || 0; + var sx = o.scaleX || 1; + var sy = o.scaleY || 1; + var lam = o.shear || 0; + var theta = o.rotate || 0; + var tx = o.translateX || 0; + var ty = o.translateY || 0; // Apply the standard matrix - return this; - } // Default to hex conversion + var result = new Matrix().translateO(-ox, -oy).scaleO(sx, sy).shearO(lam).rotateO(theta).translateO(tx, ty).lmultiplyO(this).translateO(ox, oy); + return result; + } // Decomposes this matrix into its affine parameters - }, { - key: "toString", - value: function toString() { - return this.toHex(); - } - }, { - key: "toArray", - value: function toArray() { - return [this.r, this.g, this.b]; - } // Build hex value - - }, { - key: "toHex", - value: function toHex() { - return '#' + compToHex(Math.round(this.r)) + compToHex(Math.round(this.g)) + compToHex(Math.round(this.b)); - } // Build rgb value - - }, { - key: "toRgb", - value: function toRgb() { - return 'rgb(' + [this.r, this.g, this.b].join() + ')'; - } // Calculate true brightness - - }, { - key: "brightness", - value: function brightness() { - return this.r / 255 * 0.30 + this.g / 255 * 0.59 + this.b / 255 * 0.11; - } // Testers - // Test if given value is a color string - - }], [{ - key: "test", - value: function test(color) { - color += ''; - return isHex.test(color) || isRgb.test(color); - } // Test if given value is a rgb object - - }, { - key: "isRgb", - value: function isRgb$$1(color) { - return color && typeof color.r === 'number' && typeof color.g === 'number' && typeof color.b === 'number'; - } // Test if given value is a color - - }, { - key: "isColor", - value: function isColor(color) { - return this.isRgb(color) || this.test(color); - } - }]); - return Color; - }(); + decompose(cx = 0, cy = 0) { + // Get the parameters from the matrix + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var e = this.e; + var f = this.f; // Figure out if the winding direction is clockwise or counterclockwise - var Point = - /*#__PURE__*/ - function () { - // Initialize - function Point() { - _classCallCheck(this, Point); + var determinant = a * d - b * c; + var ccw = determinant > 0 ? 1 : -1; // Since we only shear in x, we can use the x basis to get the x scale + // and the rotation of the resulting matrix - this.init.apply(this, arguments); - } + var sx = ccw * Math.sqrt(a * a + b * b); + var thetaRad = Math.atan2(ccw * b, ccw * a); + var theta = 180 / Math.PI * thetaRad; + var ct = Math.cos(thetaRad); + var st = Math.sin(thetaRad); // We can then solve the y basis vector simultaneously to get the other + // two affine parameters directly from these parameters - _createClass(Point, [{ - key: "init", - value: function init(x, y) { - var source; - var base = { - x: 0, - y: 0 // ensure source as object - - }; - source = Array.isArray(x) ? { - x: x[0], - y: x[1] - } : _typeof(x) === 'object' ? { - x: x.x, - y: x.y - } : { - x: x, - y: y // merge source - - }; - this.x = source.x == null ? base.x : source.x; - this.y = source.y == null ? base.y : source.y; - return this; - } // Clone point - - }, { - key: "clone", - value: function clone() { - return new Point(this); - } // transform point with matrix - - }, { - key: "transform", - value: function transform(m) { - // Perform the matrix multiplication - var x = m.a * this.x + m.c * this.y + m.e; - var y = m.b * this.x + m.d * this.y + m.f; // Return the required point - - return new Point(x, y); - } - }, { - key: "toArray", - value: function toArray() { - return [this.x, this.y]; - } - }]); - - return Point; - }(); - function point(x, y) { - return new Point(x, y).transform(this.screenCTM().inverse()); - } - - function parser() { - // Reuse cached element if possible - if (!parser.nodes) { - var svg = makeInstance().size(2, 0); - svg.node.cssText = ['opacity: 0', 'position: absolute', 'left: -100%', 'top: -100%', 'overflow: hidden'].join(';'); - var path = svg.path().node; - parser.nodes = { - svg: svg, - path: path - }; - } + var lam = (a * c + b * d) / determinant; + var sy = c * sx / (lam * a - b) || d * sx / (lam * b + a); // Use the translations + + let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy); + let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy); // Construct the decomposition and return it + + return { + // Return the affine parameters + scaleX: sx, + scaleY: sy, + shear: lam, + rotate: theta, + translateX: tx, + translateY: ty, + originX: cx, + originY: cy, + // Return the matrix parameters + a: this.a, + b: this.b, + c: this.c, + d: this.d, + e: this.e, + f: this.f + }; + } // Left multiplies by the given matrix - if (!parser.nodes.svg.node.parentNode) { - var b = globals.document.body || globals.document.documentElement; - parser.nodes.svg.addTo(b); - } - return parser.nodes; + multiply(matrix) { + return this.clone().multiplyO(matrix); } - function isNulledBox(box) { - return !box.w && !box.h && !box.x && !box.y; + multiplyO(matrix) { + // Get the matrices + var l = this; + var r = matrix instanceof Matrix ? matrix : new Matrix(matrix); + return Matrix.matrixMultiply(l, r, this); } - function domContains(node) { - return (globals.document.documentElement.contains || function (node) { - // This is IE - it does not support contains() for top-level SVGs - while (node.parentNode) { - node = node.parentNode; - } + lmultiply(matrix) { + return this.clone().lmultiplyO(matrix); + } - return node === document; - }).call(globals.document.documentElement, node); + lmultiplyO(matrix) { + var r = this; + var l = matrix instanceof Matrix ? matrix : new Matrix(matrix); + return Matrix.matrixMultiply(l, r, this); + } // Inverses matrix + + + inverseO() { + // Get the current parameters out of the matrix + var a = this.a; + var b = this.b; + var c = this.c; + var d = this.d; + var e = this.e; + var f = this.f; // Invert the 2x2 matrix in the top left + + var det = a * d - b * c; + if (!det) throw new Error('Cannot invert ' + this); // Calculate the top 2x2 matrix + + var na = d / det; + var nb = -b / det; + var nc = -c / det; + var nd = a / det; // Apply the inverted matrix to the top right + + var ne = -(na * e + nc * f); + var nf = -(nb * e + nd * f); // Construct the inverted matrix + + this.a = na; + this.b = nb; + this.c = nc; + this.d = nd; + this.e = ne; + this.f = nf; + return this; } - var Box = - /*#__PURE__*/ - function () { - function Box() { - _classCallCheck(this, Box); + inverse() { + return this.clone().inverseO(); + } // Translate matrix - this.init.apply(this, arguments); - } - _createClass(Box, [{ - key: "init", - value: function init(source) { - var base = [0, 0, 0, 0]; - source = typeof source === 'string' ? source.split(delimiter).map(parseFloat) : Array.isArray(source) ? source : _typeof(source) === 'object' ? [source.left != null ? source.left : source.x, source.top != null ? source.top : source.y, source.width, source.height] : arguments.length === 4 ? [].slice.call(arguments) : base; - this.x = source[0] || 0; - this.y = source[1] || 0; - this.width = this.w = source[2] || 0; - this.height = this.h = source[3] || 0; // Add more bounding box properties - - this.x2 = this.x + this.w; - this.y2 = this.y + this.h; - this.cx = this.x + this.w / 2; - this.cy = this.y + this.h / 2; - return this; - } // Merge rect box with another, return a new instance - - }, { - key: "merge", - value: function merge(box) { - var x = Math.min(this.x, box.x); - var y = Math.min(this.y, box.y); - var width = Math.max(this.x + this.width, box.x + box.width) - x; - var height = Math.max(this.y + this.height, box.y + box.height) - y; - return new Box(x, y, width, height); - } - }, { - key: "transform", - value: function transform(m) { - var xMin = Infinity; - var xMax = -Infinity; - var yMin = Infinity; - var yMax = -Infinity; - 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); - xMax = Math.max(xMax, p.x); - yMin = Math.min(yMin, p.y); - yMax = Math.max(yMax, p.y); - }); - return new Box(xMin, yMin, xMax - xMin, yMax - yMin); - } - }, { - key: "addOffset", - value: function addOffset() { - // offset by window scroll position, because getBoundingClientRect changes when window is scrolled - this.x += globals.window.pageXOffset; - this.y += globals.window.pageYOffset; - return this; - } - }, { - key: "toString", - value: function toString() { - return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height; - } - }, { - key: "toArray", - value: function toArray() { - return [this.x, this.y, this.width, this.height]; - } - }, { - key: "isNulled", - value: function isNulled() { - return isNulledBox(this); - } - }]); + translate(x, y) { + return this.clone().translateO(x, y); + } - return Box; - }(); + translateO(x, y) { + this.e += x || 0; + this.f += y || 0; + return this; + } // Scale matrix - function getBox(cb, retry) { - var box; - try { - box = cb(this.node); + scale(x, y, cx, cy) { + return this.clone().scaleO(...arguments); + } - if (isNulledBox(box) && !domContains(this.node)) { - throw new Error('Element not in the dom'); - } - } catch (e) { - box = retry(this); + scaleO(x, y = x, cx = 0, cy = 0) { + // Support uniform scaling + if (arguments.length === 3) { + cy = cx; + cx = y; + y = x; } - return box; + let a = this.a, + b = this.b, + c = this.c, + d = this.d, + e = this.e, + f = this.f; + this.a = a * x; + this.b = b * y; + this.c = c * x; + this.d = d * y; + this.e = e * x - cx * x + cx; + this.f = f * y - cy * y + cy; + return this; + } // Rotate matrix + + + rotate(r, cx, cy) { + return this.clone().rotateO(r, cx, cy); } - function bbox() { - return new Box(getBox.call(this, function (node) { - return node.getBBox(); - }, function (el) { - try { - var clone = el.clone().addTo(parser().svg).show(); - var box = clone.node.getBBox(); - clone.remove(); - return box; - } catch (e) { - throw new Error('Getting bbox of element "' + el.node.nodeName + '" is not possible'); - } - })); + rotateO(r, cx = 0, cy = 0) { + // Convert degrees to radians + r = radians(r); + let cos = Math.cos(r); + let sin = Math.sin(r); + let a = this.a, + b = this.b, + c = this.c, + d = this.d, + e = this.e, + f = this.f; + this.a = a * cos - b * sin; + this.b = b * cos + a * sin; + this.c = c * cos - d * sin; + this.d = d * cos + c * sin; + this.e = e * cos - f * sin + cy * sin - cx * cos + cx; + this.f = f * cos + e * sin - cx * sin - cy * cos + cy; + return this; + } // Flip matrix on x or y, at a given offset + + + flip(axis, around) { + return this.clone().flipO(axis, around); } - function rbox(el) { - var box = new Box(getBox.call(this, function (node) { - return node.getBoundingClientRect(); - }, function (el) { - throw new Error('Getting rbox of element "' + el.node.nodeName + '" is not possible'); - })); - if (el) return box.transform(el.screenCTM().inverse()); - return box.addOffset(); + + flipO(axis, around) { + return axis === 'x' ? this.scaleO(-1, 1, around, 0) : axis === 'y' ? this.scaleO(1, -1, 0, around) : this.scaleO(-1, -1, axis, around || axis); // Define an x, y flip point + } // Shear matrix + + + shear(a, cx, cy) { + return this.clone().shearO(a, cx, cy); } - registerMethods({ - viewbox: { - viewbox: function viewbox(x, y, width, height) { - // act as getter - if (x == null) return new Box(this.attr('viewBox')); // act as setter - return this.attr('viewBox', new Box(x, y, width, height)); - } - } - }); + shearO(lx, cx = 0, cy = 0) { + let a = this.a, + b = this.b, + c = this.c, + d = this.d, + e = this.e, + f = this.f; + this.a = a + b * lx; + this.c = c + d * lx; + this.e = e + f * lx - cy * lx; + return this; + } // Skew Matrix - function closeEnough(a, b, threshold) { - return Math.abs(b - a) < (threshold || 1e-6); - } - - var Matrix = - /*#__PURE__*/ - function () { - function Matrix() { - _classCallCheck(this, Matrix); - - this.init.apply(this, arguments); - } // Initialize - - - _createClass(Matrix, [{ - key: "init", - value: function init(source) { - var base = Matrix.fromArray([1, 0, 0, 1, 0, 0]); // ensure source as object - - source = source instanceof Element ? source.matrixify() : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat)) : Array.isArray(source) ? Matrix.fromArray(source) : _typeof(source) === 'object' && Matrix.isMatrixLike(source) ? source : _typeof(source) === 'object' ? new Matrix().transform(source) : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments)) : base; // Merge the source matrix with the base matrix - - this.a = source.a != null ? source.a : base.a; - this.b = source.b != null ? source.b : base.b; - this.c = source.c != null ? source.c : base.c; - this.d = source.d != null ? source.d : base.d; - this.e = source.e != null ? source.e : base.e; - this.f = source.f != null ? source.f : base.f; - return this; - } // Clones this matrix - - }, { - key: "clone", - value: function clone() { - return new Matrix(this); - } // Transform a matrix into another matrix by manipulating the space - - }, { - key: "transform", - value: function transform(o) { - // Check if o is a matrix and then left multiply it directly - if (Matrix.isMatrixLike(o)) { - var matrix = new Matrix(o); - return matrix.multiplyO(this); - } // Get the proposed transformations and the current transformations - - - var t = Matrix.formatTransforms(o); - var current = this; - - var _transform = new Point(t.ox, t.oy).transform(current), - ox = _transform.x, - oy = _transform.y; // Construct the resulting matrix - - - 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(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; - transformer.translateO(dx, dy); - } // Translate now after positioning - - - transformer.translateO(t.tx, t.ty); - return transformer; - } // Applies a matrix defined by its affine parameters - - }, { - key: "compose", - value: function compose(o) { - if (o.origin) { - o.originX = o.origin[0]; - o.originY = o.origin[1]; - } // Get the parameters - - - var ox = o.originX || 0; - var oy = o.originY || 0; - var sx = o.scaleX || 1; - var sy = o.scaleY || 1; - var lam = o.shear || 0; - var theta = o.rotate || 0; - var tx = o.translateX || 0; - var ty = o.translateY || 0; // Apply the standard matrix - - var result = new Matrix().translateO(-ox, -oy).scaleO(sx, sy).shearO(lam).rotateO(theta).translateO(tx, ty).lmultiplyO(this).translateO(ox, oy); - return result; - } // Decomposes this matrix into its affine parameters - - }, { - key: "decompose", - value: function decompose() { - var cx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var cy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - // Get the parameters from the matrix - var a = this.a; - var b = this.b; - var c = this.c; - var d = this.d; - var e = this.e; - var f = this.f; // Figure out if the winding direction is clockwise or counterclockwise - - var determinant = a * d - b * c; - var ccw = determinant > 0 ? 1 : -1; // Since we only shear in x, we can use the x basis to get the x scale - // and the rotation of the resulting matrix - - var sx = ccw * Math.sqrt(a * a + b * b); - var thetaRad = Math.atan2(ccw * b, ccw * a); - var theta = 180 / Math.PI * thetaRad; - var ct = Math.cos(thetaRad); - var st = Math.sin(thetaRad); // We can then solve the y basis vector simultaneously to get the other - // two affine parameters directly from these parameters - - var lam = (a * c + b * d) / determinant; - var sy = c * sx / (lam * a - b) || d * sx / (lam * b + a); // Use the translations - - var tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy); - var ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy); // Construct the decomposition and return it - - return { - // Return the affine parameters - scaleX: sx, - scaleY: sy, - shear: lam, - rotate: theta, - translateX: tx, - translateY: ty, - originX: cx, - originY: cy, - // Return the matrix parameters - a: this.a, - b: this.b, - c: this.c, - d: this.d, - e: this.e, - f: this.f - }; - } // Left multiplies by the given matrix - - }, { - key: "multiply", - value: function multiply(matrix) { - return this.clone().multiplyO(matrix); - } - }, { - key: "multiplyO", - value: function multiplyO(matrix) { - // Get the matrices - var l = this; - var r = matrix instanceof Matrix ? matrix : new Matrix(matrix); - return Matrix.matrixMultiply(l, r, this); - } - }, { - key: "lmultiply", - value: function lmultiply(matrix) { - return this.clone().lmultiplyO(matrix); - } - }, { - key: "lmultiplyO", - value: function lmultiplyO(matrix) { - var r = this; - var l = matrix instanceof Matrix ? matrix : new Matrix(matrix); - return Matrix.matrixMultiply(l, r, this); - } // Inverses matrix - - }, { - key: "inverseO", - value: function inverseO() { - // Get the current parameters out of the matrix - var a = this.a; - var b = this.b; - var c = this.c; - var d = this.d; - var e = this.e; - var f = this.f; // Invert the 2x2 matrix in the top left - - var det = a * d - b * c; - if (!det) throw new Error('Cannot invert ' + this); // Calculate the top 2x2 matrix - - var na = d / det; - var nb = -b / det; - var nc = -c / det; - var nd = a / det; // Apply the inverted matrix to the top right - - var ne = -(na * e + nc * f); - var nf = -(nb * e + nd * f); // Construct the inverted matrix - - this.a = na; - this.b = nb; - this.c = nc; - this.d = nd; - this.e = ne; - this.f = nf; - return this; - } - }, { - key: "inverse", - value: function inverse() { - return this.clone().inverseO(); - } // Translate matrix - - }, { - key: "translate", - value: function translate(x, y) { - return this.clone().translateO(x, y); - } - }, { - key: "translateO", - value: function translateO(x, y) { - this.e += x || 0; - this.f += y || 0; - return this; - } // Scale matrix - - }, { - key: "scale", - value: function scale(x, y, cx, cy) { - var _this$clone; - - return (_this$clone = this.clone()).scaleO.apply(_this$clone, arguments); - } - }, { - key: "scaleO", - value: function scaleO(x) { - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; - var cx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var cy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - // Support uniform scaling - if (arguments.length === 3) { - cy = cx; - cx = y; - y = x; - } - var a = this.a, - b = this.b, - c = this.c, - d = this.d, - e = this.e, - f = this.f; - this.a = a * x; - this.b = b * y; - this.c = c * x; - this.d = d * y; - this.e = e * x - cx * x + cx; - this.f = f * y - cy * y + cy; - return this; - } // Rotate matrix - - }, { - key: "rotate", - value: function rotate(r, cx, cy) { - return this.clone().rotateO(r, cx, cy); - } - }, { - key: "rotateO", - value: function rotateO(r) { - var cx = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var cy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - // Convert degrees to radians - r = radians(r); - var cos = Math.cos(r); - var sin = Math.sin(r); - var a = this.a, - b = this.b, - c = this.c, - d = this.d, - e = this.e, - f = this.f; - this.a = a * cos - b * sin; - this.b = b * cos + a * sin; - this.c = c * cos - d * sin; - this.d = d * cos + c * sin; - this.e = e * cos - f * sin + cy * sin - cx * cos + cx; - this.f = f * cos + e * sin - cx * sin - cy * cos + cy; - return this; - } // Flip matrix on x or y, at a given offset - - }, { - key: "flip", - value: function flip(axis, around) { - return this.clone().flipO(axis, around); - } - }, { - key: "flipO", - value: function flipO(axis, around) { - return axis === 'x' ? this.scaleO(-1, 1, around, 0) : axis === 'y' ? this.scaleO(1, -1, 0, around) : this.scaleO(-1, -1, axis, around || axis); // Define an x, y flip point - } // Shear matrix - - }, { - key: "shear", - value: function shear(a, cx, cy) { - return this.clone().shearO(a, cx, cy); - } - }, { - key: "shearO", - value: function shearO(lx) { - var cy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var a = this.a, - b = this.b, - c = this.c, - d = this.d, - e = this.e, - f = this.f; - this.a = a + b * lx; - this.c = c + d * lx; - this.e = e + f * lx - cy * lx; - return this; - } // Skew Matrix - - }, { - key: "skew", - value: function skew(x, y, cx, cy) { - var _this$clone2; - - return (_this$clone2 = this.clone()).skewO.apply(_this$clone2, arguments); - } - }, { - key: "skewO", - value: function skewO(x) { - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : x; - var cx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; - var cy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - - // support uniformal skew - if (arguments.length === 3) { - cy = cx; - cx = y; - y = x; - } // Convert degrees to radians - - - x = radians(x); - y = radians(y); - var lx = Math.tan(x); - var ly = Math.tan(y); - var a = this.a, - b = this.b, - c = this.c, - d = this.d, - e = this.e, - f = this.f; - this.a = a + b * lx; - this.b = b + a * ly; - this.c = c + d * lx; - this.d = d + c * ly; - this.e = e + f * lx - cy * lx; - this.f = f + e * ly - cx * ly; - return this; - } // SkewX - - }, { - key: "skewX", - value: function skewX(x, cx, cy) { - return this.skew(x, 0, cx, cy); - } - }, { - key: "skewXO", - value: function skewXO(x, cx, cy) { - return this.skewO(x, 0, cx, cy); - } // SkewY - - }, { - key: "skewY", - value: function skewY(y, cx, cy) { - return this.skew(0, y, cx, cy); - } - }, { - key: "skewYO", - value: function skewYO(y, cx, cy) { - return this.skewO(0, y, cx, cy); - } // Transform around a center point - - }, { - key: "aroundO", - value: function aroundO(cx, cy, matrix) { - var dx = cx || 0; - var dy = cy || 0; - return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy); - } - }, { - key: "around", - value: function around(cx, cy, matrix) { - return this.clone().aroundO(cx, cy, matrix); - } // Check if two matrices are equal - - }, { - key: "equals", - value: function equals(other) { - var comp = new Matrix(other); - return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) && closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) && closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f); - } // Convert matrix to string - - }, { - key: "toString", - value: function toString() { - return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'; - } - }, { - key: "toArray", - value: function toArray() { - return [this.a, this.b, this.c, this.d, this.e, this.f]; - } - }, { - key: "valueOf", - value: function valueOf() { - return { - a: this.a, - b: this.b, - c: this.c, - d: this.d, - e: this.e, - f: this.f - }; - } - }], [{ - key: "fromArray", - value: function fromArray(a) { - return { - a: a[0], - b: a[1], - c: a[2], - d: a[3], - e: a[4], - f: a[5] - }; - } - }, { - key: "isMatrixLike", - value: function isMatrixLike(o) { - return o.a != null || o.b != null || o.c != null || o.d != null || o.e != null || o.f != null; - } - }, { - key: "formatTransforms", - value: function formatTransforms(o) { - // Get all of the parameters required to form the matrix - var flipBoth = o.flip === 'both' || o.flip === true; - var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1; - var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1; - var skewX = o.skew && o.skew.length ? o.skew[0] : isFinite(o.skew) ? o.skew : isFinite(o.skewX) ? o.skewX : 0; - var skewY = o.skew && o.skew.length ? o.skew[1] : isFinite(o.skew) ? o.skew : isFinite(o.skewY) ? o.skewY : 0; - var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX : isFinite(o.scale) ? o.scale * flipX : isFinite(o.scaleX) ? o.scaleX * flipX : flipX; - 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(o.origin || o.around || o.ox || o.originX, o.oy || o.originY); - var ox = origin.x; - var oy = origin.y; - 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(o.translate || o.tx || o.translateX, o.ty || o.translateY); - var tx = translate.x; - var ty = translate.y; - 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 - - return { - scaleX: scaleX, - scaleY: scaleY, - skewX: skewX, - skewY: skewY, - shear: shear, - theta: theta, - rx: rx, - ry: ry, - tx: tx, - ty: ty, - ox: ox, - oy: oy, - px: px, - py: py - }; - } // left matrix, right matrix, target matrix which is overwritten - - }, { - key: "matrixMultiply", - value: function matrixMultiply(l, r, o) { - // Work out the product directly - var a = l.a * r.a + l.c * r.b; - var b = l.b * r.a + l.d * r.b; - var c = l.a * r.c + l.c * r.d; - var d = l.b * r.c + l.d * r.d; - var e = l.e + l.a * r.e + l.c * r.f; - var f = l.f + l.b * r.e + l.d * r.f; // make sure to use local variables because l/r and o could be the same - - o.a = a; - o.b = b; - o.c = c; - o.d = d; - o.e = e; - o.f = f; - return o; - } - }]); - - return Matrix; - }(); - function ctm() { - return new Matrix(this.node.getCTM()); - } - function screenCTM() { - /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537 - This is needed because FF does not return the transformation matrix - for the inner coordinate system when getScreenCTM() is called on nested svgs. - However all other Browsers do that */ - if (typeof this.isRoot === 'function' && !this.isRoot()) { - var rect = this.rect(1, 1); - var m = rect.node.getScreenCTM(); - rect.remove(); - return new Matrix(m); - } + skew(x, y, cx, cy) { + return this.clone().skewO(...arguments); + } + + skewO(x, y = x, cx = 0, cy = 0) { + // support uniformal skew + if (arguments.length === 3) { + cy = cx; + cx = y; + y = x; + } // Convert degrees to radians + + + x = radians(x); + y = radians(y); + let lx = Math.tan(x); + let ly = Math.tan(y); + let a = this.a, + b = this.b, + c = this.c, + d = this.d, + e = this.e, + f = this.f; + this.a = a + b * lx; + this.b = b + a * ly; + this.c = c + d * lx; + this.d = d + c * ly; + this.e = e + f * lx - cy * lx; + this.f = f + e * ly - cx * ly; + return this; + } // SkewX + - return new Matrix(this.node.getScreenCTM()); + skewX(x, cx, cy) { + return this.skew(x, 0, cx, cy); } - /* eslint no-new-func: "off" */ - var subClassArray = function () { - try { - // try es6 subclassing - 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 (e) { - // Use es5 approach - return function (name) { - var baseClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Array; + skewXO(x, cx, cy) { + return this.skewO(x, 0, cx, cy); + } // SkewY - var _constructor = arguments.length > 2 ? arguments[2] : undefined; - var Arr = function Arr() { - baseClass.apply(this, arguments); - _constructor && _constructor.apply(this, arguments); - }; + skewY(y, cx, cy) { + return this.skew(0, y, cx, cy); + } - Arr.prototype = Object.create(baseClass.prototype); - Arr.prototype.constructor = Arr; + skewYO(y, cx, cy) { + return this.skewO(0, y, cx, cy); + } // Transform around a center point - Arr.prototype.map = function (fn) { - var arr = new Arr(); - arr.push.apply(arr, Array.prototype.map.call(this, fn)); - return arr; - }; - return Arr; - }; - } - }(); + aroundO(cx, cy, matrix) { + var dx = cx || 0; + var dy = cy || 0; + return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy); + } - var List = subClassArray('List', Array, function () { - var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - // This catches the case, that native map tries to create an array with new Array(1) - if (typeof arr === 'number') return this; - this.length = 0; - this.push.apply(this, _toConsumableArray(arr)); - }); - extend(List, { - each: function each(fnOrMethodName) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } + around(cx, cy, matrix) { + return this.clone().aroundO(cx, cy, matrix); + } // Check if two matrices are equal - if (typeof fnOrMethodName === 'function') { - this.forEach(function (el) { - fnOrMethodName.call(el, el); - }); - } else { - return this.map(function (el) { - return el[fnOrMethodName].apply(el, args); - }); - } - return this; - }, - toArray: function toArray() { - return Array.prototype.concat.apply([], this); - } - }); + equals(other) { + var comp = new Matrix(other); + return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) && closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) && closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f); + } // Convert matrix to string - List.extend = function (methods) { - methods = methods.reduce(function (obj, name) { - obj[name] = function () { - for (var _len2 = arguments.length, attrs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - attrs[_key2] = arguments[_key2]; - } - return this.each.apply(this, [name].concat(attrs)); - }; + toString() { + return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'; + } - return obj; - }, {}); - extend(List, methods); - }; + toArray() { + return [this.a, this.b, this.c, this.d, this.e, this.f]; + } - function baseFind(query, parent) { - return new List(map((parent || globals.document).querySelectorAll(query), function (node) { - return adopt(node); - })); - } // Scoped find method + valueOf() { + return { + a: this.a, + b: this.b, + c: this.c, + d: this.d, + e: this.e, + f: this.f + }; + } - function find(query) { - return baseFind(query, this.node); + static fromArray(a) { + return { + a: a[0], + b: a[1], + c: a[2], + d: a[3], + e: a[4], + f: a[5] + }; + } + + static isMatrixLike(o) { + return o.a != null || o.b != null || o.c != null || o.d != null || o.e != null || o.f != null; + } + + static formatTransforms(o) { + // Get all of the parameters required to form the matrix + var flipBoth = o.flip === 'both' || o.flip === true; + var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1; + var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1; + var skewX = o.skew && o.skew.length ? o.skew[0] : isFinite(o.skew) ? o.skew : isFinite(o.skewX) ? o.skewX : 0; + var skewY = o.skew && o.skew.length ? o.skew[1] : isFinite(o.skew) ? o.skew : isFinite(o.skewY) ? o.skewY : 0; + var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX : isFinite(o.scale) ? o.scale * flipX : isFinite(o.scaleX) ? o.scaleX * flipX : flipX; + 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(o.origin || o.around || o.ox || o.originX, o.oy || o.originY); + var ox = origin.x; + var oy = origin.y; + 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(o.translate || o.tx || o.translateX, o.ty || o.translateY); + var tx = translate.x; + var ty = translate.y; + 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 + + return { + scaleX, + scaleY, + skewX, + skewY, + shear, + theta, + rx, + ry, + tx, + ty, + ox, + oy, + px, + py + }; + } // left matrix, right matrix, target matrix which is overwritten + + + static matrixMultiply(l, r, o) { + // Work out the product directly + var a = l.a * r.a + l.c * r.b; + var b = l.b * r.a + l.d * r.b; + var c = l.a * r.c + l.c * r.d; + var d = l.b * r.c + l.d * r.d; + var e = l.e + l.a * r.e + l.c * r.f; + var f = l.f + l.b * r.e + l.d * r.f; // make sure to use local variables because l/r and o could be the same + + o.a = a; + o.b = b; + o.c = c; + o.d = d; + o.e = e; + o.f = f; + return o; } - var EventTarget = - /*#__PURE__*/ - function (_Base) { - _inherits(EventTarget, _Base); +} +function ctm() { + return new Matrix(this.node.getCTM()); +} +function screenCTM() { + /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537 + This is needed because FF does not return the transformation matrix + for the inner coordinate system when getScreenCTM() is called on nested svgs. + However all other Browsers do that */ + if (typeof this.isRoot === 'function' && !this.isRoot()) { + var rect = this.rect(1, 1); + var m = rect.node.getScreenCTM(); + rect.remove(); + return new Matrix(m); + } - function EventTarget() { - var _this; + return new Matrix(this.node.getScreenCTM()); +} + +/* eslint no-new-func: "off" */ +const subClassArray = function () { + try { + // try es6 subclassing + 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 (e) { + // Use es5 approach + return (name, baseClass = Array, _constructor) => { + const Arr = function Arr() { + baseClass.apply(this, arguments); + _constructor && _constructor.apply(this, arguments); + }; - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - _ref$events = _ref.events, - events = _ref$events === void 0 ? {} : _ref$events; + Arr.prototype = Object.create(baseClass.prototype); + Arr.prototype.constructor = Arr; - _classCallCheck(this, EventTarget); + Arr.prototype.map = function (fn) { + const arr = new Arr(); + arr.push.apply(arr, Array.prototype.map.call(this, fn)); + return arr; + }; - _this = _possibleConstructorReturn(this, _getPrototypeOf(EventTarget).call(this)); - _this.events = events; - return _this; + return Arr; + }; + } +}(); + +const List = subClassArray('List', Array, function (arr = []) { + // This catches the case, that native map tries to create an array with new Array(1) + if (typeof arr === 'number') return this; + this.length = 0; + this.push(...arr); +}); +extend(List, { + each(fnOrMethodName, ...args) { + if (typeof fnOrMethodName === 'function') { + this.forEach(el => { + fnOrMethodName.call(el, el); + }); + } else { + return this.map(el => { + return el[fnOrMethodName](...args); + }); } - _createClass(EventTarget, [{ - key: "addEventListener", - value: function addEventListener() {} - }, { - key: "dispatch", - value: function dispatch$$1(event, data) { - return dispatch(this, event, data); - } - }, { - key: "dispatchEvent", - value: function dispatchEvent(event) { - var bag = this.getEventHolder().events; - if (!bag) return true; - var events = bag[event.type]; - - for (var i in events) { - for (var j in events[i]) { - events[i][j](event); - } - } + return this; + }, - return !event.defaultPrevented; - } // Fire given event + toArray() { + return Array.prototype.concat.apply([], this); + } - }, { - key: "fire", - value: function fire(event, data) { - this.dispatch(event, data); - return this; - } - }, { - key: "getEventHolder", - value: function getEventHolder() { - return this; - } - }, { - key: "getEventTarget", - value: function getEventTarget() { - return this; - } // Unbind event from listener - - }, { - key: "off", - value: function off$$1(event, listener) { - off(this, event, listener); - - return this; - } // Bind given event to listener - - }, { - key: "on", - value: function on$$1(event, listener, binding, options) { - on(this, event, listener, binding, options); - - return this; - } - }, { - key: "removeEventListener", - value: function removeEventListener() {} - }]); +}); - return EventTarget; - }(Base); +List.extend = function (methods) { + methods = methods.reduce((obj, name) => { + obj[name] = function (...attrs) { + return this.each(name, ...attrs); + }; - function noop() {} // Default animation values + return obj; + }, {}); + extend(List, methods); +}; - var timeline = { - duration: 400, - ease: '>', - delay: 0 // Default attribute values +function baseFind(query, parent) { + return new List(map((parent || globals.document).querySelectorAll(query), function (node) { + return adopt(node); + })); +} // Scoped find method + +function find(query) { + return baseFind(query, this.node); +} + +class EventTarget extends Base { + constructor({ + events = {} + } = {}) { + super(); + this.events = events; + } - }; - var attrs = { - // fill and stroke - 'fill-opacity': 1, - 'stroke-opacity': 1, - 'stroke-width': 0, - 'stroke-linejoin': 'miter', - 'stroke-linecap': 'butt', - fill: '#000000', - stroke: '#000000', - opacity: 1, - // position - x: 0, - y: 0, - cx: 0, - cy: 0, - // size - width: 0, - height: 0, - // radius - r: 0, - rx: 0, - ry: 0, - // gradient - offset: 0, - 'stop-opacity': 1, - 'stop-color': '#000000', - // text - 'font-size': 16, - 'font-family': 'Helvetica, Arial, sans-serif', - 'text-anchor': 'start' - }; + addEventListener() {} - var defaults = /*#__PURE__*/Object.freeze({ - noop: noop, - timeline: timeline, - attrs: attrs - }); + dispatch(event, data) { + return dispatch(this, event, data); + } - var SVGArray = subClassArray('SVGArray', Array, function (arr) { - this.init(arr); - }); - extend(SVGArray, { - init: function init(arr) { - // This catches the case, that native map tries to create an array with new Array(1) - if (typeof arr === 'number') return this; - this.length = 0; - this.push.apply(this, _toConsumableArray(this.parse(arr))); - return this; - }, - toArray: function toArray() { - return Array.prototype.concat.apply([], this); - }, - toString: function toString() { - return this.join(' '); - }, - // Flattens the array if needed - valueOf: function valueOf() { - var ret = []; - ret.push.apply(ret, _toConsumableArray(this)); - return ret; - }, - // Parse whitespace separated string - parse: function parse() { - var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - // If already is an array, no need to parse it - if (array instanceof Array) return array; - return array.trim().split(delimiter).map(parseFloat); - }, - clone: function clone() { - return new this.constructor(this); - }, - toSet: function toSet() { - return new Set(this); + dispatchEvent(event) { + const bag = this.getEventHolder().events; + if (!bag) return true; + const events = bag[event.type]; + + for (let i in events) { + for (let j in events[i]) { + events[i][j](event); + } } - }); - var SVGNumber = - /*#__PURE__*/ - function () { - // Initialize - function SVGNumber() { - _classCallCheck(this, SVGNumber); + return !event.defaultPrevented; + } // Fire given event - this.init.apply(this, arguments); - } - _createClass(SVGNumber, [{ - key: "init", - value: function init(value, unit) { - unit = Array.isArray(value) ? value[1] : unit; - value = Array.isArray(value) ? value[0] : value; // initialize defaults + fire(event, data) { + this.dispatch(event, data); + return this; + } + + getEventHolder() { + return this; + } - this.value = 0; - this.unit = unit || ''; // parse value + getEventTarget() { + return this; + } // Unbind event from listener - if (typeof value === 'number') { - // ensure a valid numeric value - this.value = isNaN(value) ? 0 : !isFinite(value) ? value < 0 ? -3.4e+38 : +3.4e+38 : value; - } else if (typeof value === 'string') { - unit = value.match(numberAndUnit); - if (unit) { - // make value numeric - this.value = parseFloat(unit[1]); // normalize + off(event, listener) { + off(this, event, listener); + return this; + } // Bind given event to listener - if (unit[5] === '%') { - this.value /= 100; - } else if (unit[5] === 's') { - this.value *= 1000; - } // store unit + on(event, listener, binding, options) { + on(this, event, listener, binding, options); + return this; + } - this.unit = unit[5]; - } - } else { - if (value instanceof SVGNumber) { - this.value = value.valueOf(); - this.unit = value.unit; - } - } + removeEventListener() {} + +} + +function noop() {} // Default animation values + +let timeline = { + duration: 400, + ease: '>', + delay: 0 // Default attribute values + +}; +let attrs = { + // fill and stroke + 'fill-opacity': 1, + 'stroke-opacity': 1, + 'stroke-width': 0, + 'stroke-linejoin': 'miter', + 'stroke-linecap': 'butt', + fill: '#000000', + stroke: '#000000', + opacity: 1, + // position + x: 0, + y: 0, + cx: 0, + cy: 0, + // size + width: 0, + height: 0, + // radius + r: 0, + rx: 0, + ry: 0, + // gradient + offset: 0, + 'stop-opacity': 1, + 'stop-color': '#000000', + // text + 'font-size': 16, + 'font-family': 'Helvetica, Arial, sans-serif', + 'text-anchor': 'start' +}; + +var defaults = /*#__PURE__*/Object.freeze({ + noop: noop, + timeline: timeline, + attrs: attrs +}); + +const SVGArray = subClassArray('SVGArray', Array, function (arr) { + this.init(arr); +}); +extend(SVGArray, { + init(arr) { + // This catches the case, that native map tries to create an array with new Array(1) + if (typeof arr === 'number') return this; + this.length = 0; + this.push(...this.parse(arr)); + return this; + }, - return this; - } - }, { - key: "toString", - value: function toString() { - return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6 : this.unit === 's' ? this.value / 1e3 : this.value) + this.unit; - } - }, { - key: "toJSON", - value: function toJSON() { - return this.toString(); - } - }, { - key: "toArray", - value: function toArray() { - return [this.value, this.unit]; - } - }, { - key: "valueOf", - value: function valueOf() { - return this.value; - } // Add number - - }, { - key: "plus", - value: function plus(number) { - number = new SVGNumber(number); - return new SVGNumber(this + number, this.unit || number.unit); - } // Subtract number - - }, { - key: "minus", - value: function minus(number) { - number = new SVGNumber(number); - return new SVGNumber(this - number, this.unit || number.unit); - } // Multiply number - - }, { - key: "times", - value: function times(number) { - number = new SVGNumber(number); - return new SVGNumber(this * number, this.unit || number.unit); - } // Divide number - - }, { - key: "divide", - value: function divide(number) { - number = new SVGNumber(number); - return new SVGNumber(this / number, this.unit || number.unit); - } - }]); + toArray() { + return Array.prototype.concat.apply([], this); + }, - return SVGNumber; - }(); + toString() { + return this.join(' '); + }, - var hooks = []; - function registerAttrHook(fn) { - hooks.push(fn); - } // Set svg element attribute + // Flattens the array if needed + valueOf() { + const ret = []; + ret.push(...this); + return ret; + }, - function attr(attr, val, ns) { - var _this = this; + // Parse whitespace separated string + parse(array = []) { + // If already is an array, no need to parse it + if (array instanceof Array) return array; + return array.trim().split(delimiter).map(parseFloat); + }, - // act as full getter - if (attr == null) { - // get an object of attributes - attr = {}; - val = this.node.attributes; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = val[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var node = _step.value; - attr[node.nodeName] = isNumber.test(node.nodeValue) ? parseFloat(node.nodeValue) : node.nodeValue; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } + clone() { + return new this.constructor(this); + }, - return attr; - } else if (attr instanceof Array) { - // loop through array and get all values - return attr.reduce(function (last, curr) { - last[curr] = _this.attr(curr); - return last; - }, {}); - } else if (_typeof(attr) === 'object') { - // apply every attribute individually if an object is passed - for (val in attr) { - this.attr(val, attr[val]); - } - } else if (val === null) { - // remove value - this.node.removeAttribute(attr); - } else if (val == null) { - // act as a getter if the first and only argument is not an object - val = this.node.getAttribute(attr); - return val == null ? attrs[attr] : isNumber.test(val) ? parseFloat(val) : val; - } else { - // Loop through hooks and execute them to convert value - val = hooks.reduce(function (_val, hook) { - return hook(attr, _val, _this); - }, val); // ensure correct numeric values (also accepts NaN and Infinity) - - if (typeof val === 'number') { - val = new SVGNumber(val); - } else if (Color.isColor(val)) { - // ensure full hex color - val = new Color(val); - } else if (val.constructor === Array) { - // Check for plain arrays and parse array values - val = new SVGArray(val); - } // if the passed attribute is leading... - - - if (attr === 'leading') { - // ... call the leading method instead - if (this.leading) { - this.leading(val); - } - } else { - // set given attribute on node - typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString()) : this.node.setAttribute(attr, val.toString()); - } // rebuild if required + toSet() { + return new Set(this); + } + +}); + +class SVGNumber { + // Initialize + constructor(...args) { + this.init(...args); + } + + init(value, unit) { + unit = Array.isArray(value) ? value[1] : unit; + value = Array.isArray(value) ? value[0] : value; // initialize defaults + + this.value = 0; + this.unit = unit || ''; // parse value + + if (typeof value === 'number') { + // ensure a valid numeric value + this.value = isNaN(value) ? 0 : !isFinite(value) ? value < 0 ? -3.4e+38 : +3.4e+38 : value; + } else if (typeof value === 'string') { + unit = value.match(numberAndUnit); + + if (unit) { + // make value numeric + this.value = parseFloat(unit[1]); // normalize + if (unit[5] === '%') { + this.value /= 100; + } else if (unit[5] === 's') { + this.value *= 1000; + } // store unit - if (this.rebuild && (attr === 'font-size' || attr === 'x')) { - this.rebuild(); + + this.unit = unit[5]; + } + } else { + if (value instanceof SVGNumber) { + this.value = value.valueOf(); + this.unit = value.unit; } } return this; } - var Dom = - /*#__PURE__*/ - function (_EventTarget) { - _inherits(Dom, _EventTarget); + toString() { + return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6 : this.unit === 's' ? this.value / 1e3 : this.value) + this.unit; + } - function Dom(node, attrs) { - var _this2; + toJSON() { + return this.toString(); + } - _classCallCheck(this, Dom); + toArray() { + return [this.value, this.unit]; + } - _this2 = _possibleConstructorReturn(this, _getPrototypeOf(Dom).call(this, node)); - _this2.node = node; - _this2.type = node.nodeName; + valueOf() { + return this.value; + } // Add number - if (attrs && node !== attrs) { - _this2.attr(attrs); - } - return _this2; - } // Add given element at a position + plus(number) { + number = new SVGNumber(number); + return new SVGNumber(this + number, this.unit || number.unit); + } // Subtract number - _createClass(Dom, [{ - key: "add", - value: function add(element, i) { - element = makeInstance(element); + minus(number) { + number = new SVGNumber(number); + return new SVGNumber(this - number, this.unit || number.unit); + } // Multiply number - if (i == null) { - this.node.appendChild(element.node); - } else if (element.node !== this.node.childNodes[i]) { - this.node.insertBefore(element.node, this.node.childNodes[i]); - } - return this; - } // Add element to given container and return self - - }, { - key: "addTo", - value: function addTo(parent) { - return makeInstance(parent).put(this); - } // Returns all child elements - - }, { - key: "children", - value: function children() { - return new List(map(this.node.children, function (node) { - return adopt(node); - })); - } // Remove all elements in this container - - }, { - key: "clear", - value: function clear() { - // remove children - while (this.node.hasChildNodes()) { - this.node.removeChild(this.node.lastChild); - } // remove defs reference - - - delete this._defs; - return this; - } // Clone element - - }, { - key: "clone", - value: function clone() { - // write dom data to the dom so the clone can pickup the data - this.writeDataToDom(); // clone element and assign new id - - return assignNewId(this.node.cloneNode(true)); - } // Iterates over all children and invokes a given block - - }, { - key: "each", - value: function each(block, deep) { - var children = this.children(); - var i, il; - - for (i = 0, il = children.length; i < il; i++) { - block.apply(children[i], [i, children]); - - if (deep) { - children[i].each(block, deep); - } - } + times(number) { + number = new SVGNumber(number); + return new SVGNumber(this * number, this.unit || number.unit); + } // Divide number - return this; - } // Get first child - }, { - key: "first", - value: function first() { - return adopt(this.node.firstChild); - } // Get a element at the given index + divide(number) { + number = new SVGNumber(number); + return new SVGNumber(this / number, this.unit || number.unit); + } - }, { - key: "get", - value: function get(i) { - return adopt(this.node.childNodes[i]); - } - }, { - key: "getEventHolder", - value: function getEventHolder() { - return this.node; - } - }, { - key: "getEventTarget", - value: function getEventTarget() { - return this.node; - } // Checks if the given element is a child - - }, { - key: "has", - value: function has(element) { - return this.index(element) >= 0; - } // Get / set id - - }, { - key: "id", - value: function id(_id) { - // generate new id if no id set - if (typeof _id === 'undefined' && !this.node.id) { - this.node.id = eid(this.type); - } // dont't set directly width this.node.id to make `null` work correctly - - - return this.attr('id', _id); - } // Gets index of given element - - }, { - key: "index", - value: function index(element) { - return [].slice.call(this.node.childNodes).indexOf(element.node); - } // Get the last child - - }, { - key: "last", - value: function last() { - return adopt(this.node.lastChild); - } // matches the element vs a css selector - - }, { - key: "matches", - value: function matches(selector) { - var el = this.node; - return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); - } // Returns the parent element instance - - }, { - key: "parent", - value: function parent(type) { - var parent = this; // check for parent - - if (!parent.node.parentNode) return null; // get parent element - - parent = adopt(parent.node.parentNode); - if (!type) return parent; // loop trough ancestors if type is given - - while (parent && parent.node instanceof globals.window.SVGElement) { - // FIXME: That shouldnt be neccessary - if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent; - parent = adopt(parent.node.parentNode); - } - } // Basically does the same as `add()` but returns the added element instead - - }, { - key: "put", - value: function put(element, i) { - this.add(element, i); - return element; - } // Add element to given container and return container - - }, { - key: "putIn", - value: function putIn(parent) { - return makeInstance(parent).add(this); - } // Remove element - - }, { - key: "remove", - value: function remove() { - if (this.parent()) { - this.parent().removeElement(this); - } +} - return this; - } // Remove a given child - - }, { - key: "removeElement", - value: function removeElement(element) { - this.node.removeChild(element.node); - return this; - } // Replace this with element - - }, { - key: "replace", - value: function replace(element) { - element = makeInstance(element); - this.node.parentNode.replaceChild(element.node, this.node); - return element; - } - }, { - key: "round", - value: function round() { - var precision = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2; - var map$$1 = arguments.length > 1 ? arguments[1] : undefined; - var factor = Math.pow(10, precision); - var attrs = this.attr(); // If we have no map, build one from attrs +const hooks = []; +function registerAttrHook(fn) { + hooks.push(fn); +} // Set svg element attribute - if (!map$$1) { - map$$1 = Object.keys(attrs); - } // Holds rounded attributes +function attr(attr, val, ns) { + // act as full getter + if (attr == null) { + // get an object of attributes + attr = {}; + val = this.node.attributes; + for (let node of val) { + attr[node.nodeName] = isNumber.test(node.nodeValue) ? parseFloat(node.nodeValue) : node.nodeValue; + } - var newAttrs = {}; - map$$1.forEach(function (key) { - newAttrs[key] = Math.round(attrs[key] * factor) / factor; - }); - this.attr(newAttrs); - return this; - } // Return id on string conversion + return attr; + } else if (attr instanceof Array) { + // loop through array and get all values + return attr.reduce((last, curr) => { + last[curr] = this.attr(curr); + return last; + }, {}); + } else if (typeof attr === 'object') { + // apply every attribute individually if an object is passed + for (val in attr) this.attr(val, attr[val]); + } else if (val === null) { + // remove value + this.node.removeAttribute(attr); + } else if (val == null) { + // act as a getter if the first and only argument is not an object + val = this.node.getAttribute(attr); + return val == null ? attrs[attr] : isNumber.test(val) ? parseFloat(val) : val; + } else { + // Loop through hooks and execute them to convert value + val = hooks.reduce((_val, hook) => { + return hook(attr, _val, this); + }, val); // ensure correct numeric values (also accepts NaN and Infinity) + + if (typeof val === 'number') { + val = new SVGNumber(val); + } else if (Color.isColor(val)) { + // ensure full hex color + val = new Color(val); + } else if (val.constructor === Array) { + // Check for plain arrays and parse array values + val = new SVGArray(val); + } // if the passed attribute is leading... + + + if (attr === 'leading') { + // ... call the leading method instead + if (this.leading) { + this.leading(val); + } + } else { + // set given attribute on node + typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString()) : this.node.setAttribute(attr, val.toString()); + } // rebuild if required - }, { - key: "toString", - value: function toString() { - return this.id(); - } // Import raw svg - }, { - key: "svg", - value: function svg(svgOrFn, outerHTML) { - var well, len, fragment; + if (this.rebuild && (attr === 'font-size' || attr === 'x')) { + this.rebuild(); + } + } - if (svgOrFn === false) { - outerHTML = false; - svgOrFn = null; - } // act as getter if no svg string is given + return this; +} +class Dom extends EventTarget { + constructor(node, attrs) { + super(node); + this.node = node; + this.type = node.nodeName; - if (svgOrFn == null || typeof svgOrFn === 'function') { - // The default for exports is, that the outerNode is included - outerHTML = outerHTML == null ? true : outerHTML; // write svgjs data to the dom + if (attrs && node !== attrs) { + this.attr(attrs); + } + } // Add given element at a position - this.writeDataToDom(); - var current = this; // An export modifier was passed - if (svgOrFn != null) { - current = adopt(current.node.cloneNode(true)); // If the user wants outerHTML we need to process this node, too + add(element, i) { + element = makeInstance(element); - if (outerHTML) { - var result = svgOrFn(current); - current = result || current; // The user does not want this node? Well, then he gets nothing + if (i == null) { + this.node.appendChild(element.node); + } else if (element.node !== this.node.childNodes[i]) { + this.node.insertBefore(element.node, this.node.childNodes[i]); + } - if (result === false) return ''; - } // Deep loop through all children and apply modifier + return this; + } // Add element to given container and return self - current.each(function () { - var result = svgOrFn(this); + addTo(parent) { + return makeInstance(parent).put(this); + } // Returns all child elements - var _this = result || this; // If modifier returns false, discard node + children() { + return new List(map(this.node.children, function (node) { + return adopt(node); + })); + } // Remove all elements in this container - if (result === false) { - this.remove(); // If modifier returns new node, use it - } else if (result && this !== _this) { - this.replace(_this); - } - }, true); - } // Return outer or inner content + clear() { + // remove children + while (this.node.hasChildNodes()) { + this.node.removeChild(this.node.lastChild); + } // remove defs reference - return outerHTML ? current.node.outerHTML : current.node.innerHTML; - } // Act as setter if we got a string - // The default for import is, that the current node is not replaced + delete this._defs; + return this; + } // Clone element - outerHTML = outerHTML == null ? false : outerHTML; // Create temporary holder - well = globals.document.createElementNS(ns, 'svg'); - fragment = globals.document.createDocumentFragment(); // Dump raw svg + clone() { + // write dom data to the dom so the clone can pickup the data + this.writeDataToDom(); // clone element and assign new id - well.innerHTML = svgOrFn; // Transplant nodes into the fragment + return assignNewId(this.node.cloneNode(true)); + } // Iterates over all children and invokes a given block - for (len = well.children.length; len--;) { - fragment.appendChild(well.firstElementChild); - } // Add the whole fragment at once + each(block, deep) { + var children = this.children(); + var i, il; - return outerHTML ? this.replace(fragment) : this.add(fragment); - } // write svgjs data to the dom + for (i = 0, il = children.length; i < il; i++) { + block.apply(children[i], [i, children]); - }, { - key: "writeDataToDom", - value: function writeDataToDom() { - // dump variables recursively - this.each(function () { - this.writeDataToDom(); - }); - return this; + if (deep) { + children[i].each(block, deep); } - }]); + } - return Dom; - }(EventTarget); - extend(Dom, { - attr: attr, - find: find - }); - register(Dom); + return this; + } - var Svg = getClass(root); + element(nodeName) { + return this.put(new Dom(makeNode(nodeName))); + } // Get first child - var Element = - /*#__PURE__*/ - function (_Dom) { - _inherits(Element, _Dom); - function Element(node, attrs) { - var _this; + first() { + return adopt(this.node.firstChild); + } // Get a element at the given index - _classCallCheck(this, Element); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Element).call(this, node, attrs)); // initialize data object + get(i) { + return adopt(this.node.childNodes[i]); + } - _this.dom = {}; // create circular reference + getEventHolder() { + return this.node; + } - _this.node.instance = _assertThisInitialized(_assertThisInitialized(_this)); + getEventTarget() { + return this.node; + } // Checks if the given element is a child - if (node.hasAttribute('svgjs:data')) { - // pull svgjs data from the dom (getAttributeNS doesn't work in html5) - _this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {}); - } - return _this; - } // Move element by its center - - - _createClass(Element, [{ - key: "center", - value: function center(x, y) { - return this.cx(x).cy(y); - } // Move by center over x-axis - - }, { - key: "cx", - value: function cx(x) { - return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2); - } // Move by center over y-axis - - }, { - key: "cy", - value: function cy(y) { - return y == null ? this.y() + this.height() / 2 : this.y(y - this.height() / 2); - } // Get defs - - }, { - key: "defs", - value: function defs() { - return this.root().defs(); - } // Get parent document - - }, { - key: "root", - value: function root$$1() { - var p = this.parent(Svg); - return p && p.root(); - } - }, { - key: "getEventHolder", - value: function getEventHolder() { - return this; - } // Set height of element - - }, { - key: "height", - value: function height(_height) { - return this.attr('height', _height); - } // Checks whether the given point inside the bounding box of the element - - }, { - key: "inside", - value: function inside(x, y) { - var box = this.bbox(); - return x > box.x && y > box.y && x < box.x + box.width && y < box.y + box.height; - } // Move element to given x and y values - - }, { - key: "move", - value: function move(x, y) { - return this.x(x).y(y); - } // return array of all ancestors of given type up to the root svg - - }, { - key: "parents", - value: function parents() { - var until = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : globals.document; - until = makeInstance(until); - var parents = new List(); - var parent = this; - - while ((parent = parent.parent()) && parent.node !== until.node && parent.node !== globals.document) { - parents.push(parent); - } + has(element) { + return this.index(element) >= 0; + } // Get / set id - return parents; - } // Get referenced element form attribute value - - }, { - key: "reference", - value: function reference$$1(attr) { - attr = this.attr(attr); - if (!attr) return null; - var m = attr.match(reference); - return m ? makeInstance(m[1]) : null; - } // set given data to the elements data property - - }, { - key: "setData", - value: function setData(o) { - this.dom = o; - return this; - } // Set element size to given width and height - - }, { - key: "size", - value: function size(width, height) { - var p = proportionalSize(this, width, height); - return this.width(new SVGNumber(p.width)).height(new SVGNumber(p.height)); - } // Set width of element - - }, { - key: "width", - value: function width(_width) { - return this.attr('width', _width); - } // write svgjs data to the dom - - }, { - key: "writeDataToDom", - value: function writeDataToDom() { - // remove previously set data - this.node.removeAttribute('svgjs:data'); - - if (Object.keys(this.dom).length) { - this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)); // see #428 - } - return _get(_getPrototypeOf(Element.prototype), "writeDataToDom", this).call(this); - } // Move over x-axis + id(id) { + // generate new id if no id set + if (typeof id === 'undefined' && !this.node.id) { + this.node.id = eid(this.type); + } // dont't set directly width this.node.id to make `null` work correctly - }, { - key: "x", - value: function x(_x) { - return this.attr('x', _x); - } // Move over y-axis - }, { - key: "y", - value: function y(_y) { - return this.attr('y', _y); - } - }]); - - return Element; - }(Dom); - extend(Element, { - bbox: bbox, - rbox: rbox, - point: point, - ctm: ctm, - screenCTM: screenCTM - }); - register(Element); + return this.attr('id', id); + } // Gets index of given element - var sugar = { - stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'], - fill: ['color', 'opacity', 'rule'], - prefix: function prefix(t, a) { - return a === 'color' ? t : t + '-' + a; - } // Add sugar for fill and stroke - }; - ['fill', 'stroke'].forEach(function (m) { - var extension = {}; - var i; + index(element) { + return [].slice.call(this.node.childNodes).indexOf(element.node); + } // Get the last child - extension[m] = function (o) { - if (typeof o === 'undefined') { - return this.attr(m); - } - if (typeof o === 'string' || Color.isRgb(o) || o instanceof Element) { - this.attr(m, o); - } else { - // set all attributes from sugar.fill and sugar.stroke list - for (i = sugar[m].length - 1; i >= 0; i--) { - if (o[sugar[m][i]] != null) { - this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]]); - } - } - } + last() { + return adopt(this.node.lastChild); + } // matches the element vs a css selector - return this; - }; - registerMethods(['Shape', 'Runner'], extension); - }); - registerMethods(['Element', 'Runner'], { - // Let the user set the matrix directly - matrix: function matrix(mat, b, c, d, e, f) { - // Act as a getter - if (mat == null) { - return new Matrix(this); - } // Act as a setter, the user can pass a matrix or a set of numbers + matches(selector) { + const el = this.node; + return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector); + } // Returns the parent element instance - return this.attr('transform', new Matrix(mat, b, c, d, e, f)); - }, - // Map rotation to transform - rotate: function rotate(angle, cx, cy) { - return this.transform({ - rotate: angle, - ox: cx, - oy: cy - }, true); - }, - // Map skew to transform - skew: function skew(x, y, cx, cy) { - return arguments.length === 1 || arguments.length === 3 ? this.transform({ - skew: x, - ox: y, - oy: cx - }, true) : this.transform({ - skew: [x, y], - ox: cx, - oy: cy - }, true); - }, - shear: function shear(lam, cx, cy) { - return this.transform({ - shear: lam, - ox: cx, - oy: cy - }, true); - }, - // Map scale to transform - scale: function scale(x, y, cx, cy) { - return arguments.length === 1 || arguments.length === 3 ? this.transform({ - scale: x, - ox: y, - oy: cx - }, true) : this.transform({ - scale: [x, y], - ox: cx, - oy: cy - }, true); - }, - // Map translate to transform - translate: function translate(x, y) { - return this.transform({ - translate: [x, y] - }, true); - }, - // Map relative translations to transform - relative: function relative(x, y) { - return this.transform({ - relative: [x, y] - }, true); - }, - // Map flip to transform - flip: function flip(direction, around) { - var directionString = typeof direction === 'string' ? direction : isFinite(direction) ? 'both' : 'both'; - var origin = direction === 'both' && isFinite(around) ? [around, around] : direction === 'x' ? [around, 0] : direction === 'y' ? [0, around] : isFinite(direction) ? [direction, direction] : [0, 0]; - this.transform({ - flip: directionString, - origin: origin - }, true); - }, - // Opacity - opacity: function opacity(value) { - return this.attr('opacity', value); - }, - // Relative move over x and y axes - dmove: function dmove(x, y) { - return this.dx(x).dy(y); - } - }); - registerMethods('Element', { - // Relative move over x axis - dx: function dx(x) { - return this.x(new SVGNumber(x).plus(this.x())); - }, - // Relative move over y axis - dy: function dy(y) { - return this.y(new SVGNumber(y).plus(this.y())); - } - }); - registerMethods('radius', { - // Add x and y radius - radius: function radius(x, y) { - var type = (this._element || this).type; - return type === 'radialGradient' || type === 'radialGradient' ? this.attr('r', new SVGNumber(x)) : this.rx(x).ry(y == null ? x : y); - } - }); - registerMethods('Path', { - // Get path length - length: function length() { - return this.node.getTotalLength(); - }, - // Get point at length - pointAt: function pointAt(length) { - return new Point(this.node.getPointAtLength(length)); - } - }); - registerMethods(['Element', 'Runner'], { - // Set font - font: function font(a, v) { - if (_typeof(a) === 'object') { - for (v in a) { - this.font(v, a[v]); - } - } + parent(type) { + var parent = this; // check for parent - return a === 'leading' ? this.leading(v) : a === 'anchor' ? this.attr('text-anchor', v) : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style' ? this.attr('font-' + a, v) : this.attr(a, v); - } - }); - registerMethods('Text', { - ax: function ax(x) { - return this.attr('x', x); - }, - ay: function ay(y) { - return this.attr('y', y); - }, - amove: function amove(x, y) { - return this.ax(x).ay(y); - } - }); // Add events to elements + if (!parent.node.parentNode) return null; // get parent element - 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); - } + parent = adopt(parent.node.parentNode); + if (!type) return parent; // loop trough ancestors if type is given - return this; - }; + while (parent && parent.node instanceof globals.window.SVGElement) { + // FIXME: That shouldnt be neccessary + if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent; + parent = adopt(parent.node.parentNode); + } + } // Basically does the same as `add()` but returns the added element instead - last[event] = fn; - return last; - }, {}); - registerMethods('Element', methods$1); - - function untransform() { - return this.attr('transform', null); - } // merge the whole transformation chain into one matrix and returns it - - function matrixify() { - var matrix = (this.attr('transform') || ''). // split transformations - split(transforms).slice(0, -1).map(function (str) { - // generate key => value pairs - var kv = str.trim().split('('); - return [kv[0], kv[1].split(delimiter).map(function (str) { - return parseFloat(str); - })]; - }).reverse() // merge every transformation into one matrix - .reduce(function (matrix, transform) { - if (transform[0] === 'matrix') { - return matrix.lmultiply(Matrix.fromArray(transform[1])); - } - return matrix[transform[0]].apply(matrix, transform[1]); - }, new Matrix()); - return matrix; - } // add an element to another parent without changing the visual representation on the screen + put(element, i) { + this.add(element, i); + return element; + } // Add element to given container and return container - function toParent(parent) { - if (this === parent) return this; - var ctm$$1 = this.screenCTM(); - var pCtm = parent.screenCTM().inverse(); - this.addTo(parent).untransform().transform(pCtm.multiply(ctm$$1)); - return this; - } // same as above with parent equals root-svg - function toRoot() { - return this.toParent(this.root()); - } // Add transformations + putIn(parent) { + return makeInstance(parent).add(this); + } // Remove element - function transform(o, relative) { - // Act as a getter if no object was passed - if (o == null || typeof o === 'string') { - var decomposed = new Matrix(this).decompose(); - return decomposed[o] || decomposed; + + remove() { + if (this.parent()) { + this.parent().removeElement(this); } - if (!Matrix.isMatrixLike(o)) { - // Set the origin according to the defined transform - o = _objectSpread({}, o, { - origin: getOrigin(o, this) - }); - } // The user can pass a boolean, an Element or an Matrix or nothing + return this; + } // Remove a given child + + + removeElement(element) { + this.node.removeChild(element.node); + return this; + } // Replace this with element - var cleanRelative = relative === true ? this : relative || false; - var result = new Matrix(cleanRelative).transform(o); - return this.attr('transform', result); + replace(element) { + element = makeInstance(element); + this.node.parentNode.replaceChild(element.node, this.node); + return element; } - registerMethods('Element', { - untransform: untransform, - matrixify: matrixify, - toParent: toParent, - toRoot: toRoot, - transform: transform - }); - function rx(rx) { - return this.attr('rx', rx); - } // Radius y value + round(precision = 2, map$$1) { + const factor = 10 ** precision; + const attrs = this.attr(); // If we have no map, build one from attrs - function ry(ry) { - return this.attr('ry', ry); - } // Move over x-axis + if (!map$$1) { + map$$1 = Object.keys(attrs); + } // Holds rounded attributes - function x(x) { - return x == null ? this.cx() - this.rx() : this.cx(x + this.rx()); - } // Move over y-axis - function y(y) { - return y == null ? this.cy() - this.ry() : this.cy(y + this.ry()); - } // Move by center over x-axis + const newAttrs = {}; + map$$1.forEach(key => { + newAttrs[key] = Math.round(attrs[key] * factor) / factor; + }); + this.attr(newAttrs); + return this; + } // Return id on string conversion - function cx(x) { - return x == null ? this.attr('cx') : this.attr('cx', x); - } // Move by center over y-axis - function cy(y) { - return y == null ? this.attr('cy') : this.attr('cy', y); - } // Set width of element + toString() { + return this.id(); + } // Import raw svg - function width(width) { - return width == null ? this.rx() * 2 : this.rx(new SVGNumber(width).divide(2)); - } // Set height of element - function height(height) { - return height == null ? this.ry() * 2 : this.ry(new SVGNumber(height).divide(2)); - } + svg(svgOrFn, outerHTML) { + var well, len, fragment; - var circled = /*#__PURE__*/Object.freeze({ - rx: rx, - ry: ry, - x: x, - y: y, - cx: cx, - cy: cy, - width: width, - height: height - }); + if (svgOrFn === false) { + outerHTML = false; + svgOrFn = null; + } // act as getter if no svg string is given - var Shape = - /*#__PURE__*/ - function (_Element) { - _inherits(Shape, _Element); - function Shape() { - _classCallCheck(this, Shape); + if (svgOrFn == null || typeof svgOrFn === 'function') { + // The default for exports is, that the outerNode is included + outerHTML = outerHTML == null ? true : outerHTML; // write svgjs data to the dom - return _possibleConstructorReturn(this, _getPrototypeOf(Shape).apply(this, arguments)); - } + this.writeDataToDom(); + let current = this; // An export modifier was passed - return Shape; - }(Element); - register(Shape); + if (svgOrFn != null) { + current = adopt(current.node.cloneNode(true)); // If the user wants outerHTML we need to process this node, too - var Circle = - /*#__PURE__*/ - function (_Shape) { - _inherits(Circle, _Shape); + if (outerHTML) { + let result = svgOrFn(current); + current = result || current; // The user does not want this node? Well, then he gets nothing - function Circle(node) { - _classCallCheck(this, Circle); + if (result === false) return ''; + } // Deep loop through all children and apply modifier - return _possibleConstructorReturn(this, _getPrototypeOf(Circle).call(this, nodeOrNew('circle', node), node)); - } - _createClass(Circle, [{ - key: "radius", - value: function radius(r) { - return this.attr('r', r); - } // Radius x value - - }, { - key: "rx", - value: function rx$$1(_rx) { - return this.attr('r', _rx); - } // Alias radius x value - - }, { - key: "ry", - value: function ry$$1(_ry) { - return this.rx(_ry); - } - }, { - key: "size", - value: function size(_size) { - return this.radius(new SVGNumber(_size).divide(2)); - } - }]); - - return Circle; - }(Shape); - extend(Circle, { - x: x, - y: y, - cx: cx, - cy: cy, - width: width, - height: height - }); - registerMethods({ - Element: { - // Create circle element - circle: wrapWithAttrCheck(function (size) { - return this.put(new Circle()).size(size).move(0, 0); - }) - } - }); - register(Circle); + current.each(function () { + let result = svgOrFn(this); - var Container = - /*#__PURE__*/ - function (_Element) { - _inherits(Container, _Element); + let _this = result || this; // If modifier returns false, discard node - function Container() { - _classCallCheck(this, Container); - return _possibleConstructorReturn(this, _getPrototypeOf(Container).apply(this, arguments)); - } + if (result === false) { + this.remove(); // If modifier returns new node, use it + } else if (result && this !== _this) { + this.replace(_this); + } + }, true); + } // Return outer or inner content - _createClass(Container, [{ - key: "flatten", - value: function flatten(parent) { - this.each(function () { - if (this instanceof Container) return this.flatten(parent).ungroup(parent); - return this.toParent(parent); - }); // we need this so that the root does not get removed - this.node.firstElementChild || this.remove(); - return this; - } - }, { - key: "ungroup", - value: function ungroup(parent) { - parent = parent || this.parent(); - this.each(function () { - return this.toParent(parent); - }); - this.remove(); - return this; - } - }]); + return outerHTML ? current.node.outerHTML : current.node.innerHTML; + } // Act as setter if we got a string + // The default for import is, that the current node is not replaced + - return Container; - }(Element); - register(Container); + outerHTML = outerHTML == null ? false : outerHTML; // Create temporary holder - var Defs = - /*#__PURE__*/ - function (_Container) { - _inherits(Defs, _Container); + well = globals.document.createElementNS(ns, 'svg'); + fragment = globals.document.createDocumentFragment(); // Dump raw svg - function Defs(node) { - _classCallCheck(this, Defs); + well.innerHTML = svgOrFn; // Transplant nodes into the fragment - return _possibleConstructorReturn(this, _getPrototypeOf(Defs).call(this, nodeOrNew('defs', node), node)); + for (len = well.children.length; len--;) { + fragment.appendChild(well.firstElementChild); } - _createClass(Defs, [{ - key: "flatten", - value: function flatten() { - return this; - } - }, { - key: "ungroup", - value: function ungroup() { - return this; - } - }]); + let parent = this.parent(); // Add the whole fragment at once + + return outerHTML ? this.replace(fragment) && parent : this.add(fragment); + } + + words(text) { + // This is faster than removing all children and adding a new one + this.node.textContent = text; + return this; + } // write svgjs data to the dom - return Defs; - }(Container); - register(Defs); - var Ellipse = - /*#__PURE__*/ - function (_Shape) { - _inherits(Ellipse, _Shape); + writeDataToDom() { + // dump variables recursively + this.each(function () { + this.writeDataToDom(); + }); + return this; + } + +} +extend(Dom, { + attr, + find +}); +register(Dom); - function Ellipse(node) { - _classCallCheck(this, Ellipse); +const Svg = getClass(root); +class Element extends Dom { + constructor(node, attrs) { + super(node, attrs); // initialize data object - return _possibleConstructorReturn(this, _getPrototypeOf(Ellipse).call(this, nodeOrNew('ellipse', node), node)); + this.dom = {}; // create circular reference + + this.node.instance = this; + + if (node.hasAttribute('svgjs:data')) { + // pull svgjs data from the dom (getAttributeNS doesn't work in html5) + this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {}); } + } // Move element by its center - _createClass(Ellipse, [{ - key: "size", - value: function size(width$$1, height$$1) { - var p = proportionalSize(this, width$$1, height$$1); - return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2)); - } - }]); - - return Ellipse; - }(Shape); - extend(Ellipse, circled); - registerMethods('Container', { - // Create an ellipse - ellipse: wrapWithAttrCheck(function (width$$1, height$$1) { - return this.put(new Ellipse()).size(width$$1, height$$1).move(0, 0); - }) - }); - register(Ellipse); - var Stop = - /*#__PURE__*/ - function (_Element) { - _inherits(Stop, _Element); + center(x, y) { + return this.cx(x).cy(y); + } // Move by center over x-axis - function Stop(node) { - _classCallCheck(this, Stop); - return _possibleConstructorReturn(this, _getPrototypeOf(Stop).call(this, nodeOrNew('stop', node), node)); - } // add color stops + cx(x) { + return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2); + } // Move by center over y-axis - _createClass(Stop, [{ - key: "update", - value: function update(o) { - if (typeof o === 'number' || o instanceof SVGNumber) { - o = { - offset: arguments[0], - color: arguments[1], - opacity: arguments[2] - }; - } // set attributes + cy(y) { + return y == null ? this.y() + this.height() / 2 : this.y(y - this.height() / 2); + } // Get defs - if (o.opacity != null) this.attr('stop-opacity', o.opacity); - if (o.color != null) this.attr('stop-color', o.color); - if (o.offset != null) this.attr('offset', new SVGNumber(o.offset)); - return this; - } - }]); - - return Stop; - }(Element); - register(Stop); - - function from(x, y) { - return (this._element || this).type === 'radialGradient' ? this.attr({ - fx: new SVGNumber(x), - fy: new SVGNumber(y) - }) : this.attr({ - x1: new SVGNumber(x), - y1: new SVGNumber(y) - }); - } - function to(x, y) { - return (this._element || this).type === 'radialGradient' ? this.attr({ - cx: new SVGNumber(x), - cy: new SVGNumber(y) - }) : this.attr({ - x2: new SVGNumber(x), - y2: new SVGNumber(y) - }); + defs() { + return this.root().defs(); + } // Get parent document + + + root() { + let p = this.parent(Svg); + return p && p.root(); } - var gradiented = /*#__PURE__*/Object.freeze({ - from: from, - to: to - }); + getEventHolder() { + return this; + } // Set height of element - var Gradient = - /*#__PURE__*/ - function (_Container) { - _inherits(Gradient, _Container); - function Gradient(type, attrs) { - _classCallCheck(this, Gradient); + height(height) { + return this.attr('height', height); + } // Checks whether the given point inside the bounding box of the element - return _possibleConstructorReturn(this, _getPrototypeOf(Gradient).call(this, nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type), attrs)); - } // Add a color stop + inside(x, y) { + let box = this.bbox(); + return x > box.x && y > box.y && x < box.x + box.width && y < box.y + box.height; + } // Move element to given x and y values - _createClass(Gradient, [{ - key: "stop", - value: function stop(offset, color, opacity) { - return this.put(new Stop()).update(offset, color, opacity); - } // Update gradient - }, { - key: "update", - value: function update(block) { - // remove all stops - this.clear(); // invoke passed block + move(x, y) { + return this.x(x).y(y); + } // return array of all ancestors of given type up to the root svg - if (typeof block === 'function') { - block.call(this, this); - } - return this; - } // Return the fill id - - }, { - key: "url", - value: function url() { - return 'url(#' + this.id() + ')'; - } // Alias string convertion to fill - - }, { - key: "toString", - value: function toString() { - return this.url(); - } // custom attr to handle transform - - }, { - key: "attr", - value: function attr(a, b, c) { - if (a === 'transform') a = 'gradientTransform'; - return _get(_getPrototypeOf(Gradient.prototype), "attr", this).call(this, a, b, c); - } - }, { - key: "targets", - value: function targets() { - return baseFind('svg [fill*="' + this.id() + '"]'); - } - }, { - key: "bbox", - value: function bbox$$1() { - return new Box(); - } - }]); - - return Gradient; - }(Container); - extend(Gradient, gradiented); - registerMethods({ - Container: { - // Create gradient element in defs - gradient: wrapWithAttrCheck(function (type, block) { - return this.defs().gradient(type, block); - }) - }, - // define gradient - Defs: { - gradient: wrapWithAttrCheck(function (type, block) { - return this.put(new Gradient(type)).update(block); - }) + parents(until = globals.document) { + until = makeInstance(until); + let parents = new List(); + let parent = this; + + while ((parent = parent.parent()) && parent.node !== until.node && parent.node !== globals.document) { + parents.push(parent); } - }); - register(Gradient); - var Pattern = - /*#__PURE__*/ - function (_Container) { - _inherits(Pattern, _Container); + return parents; + } // Get referenced element form attribute value - // Initialize node - function Pattern(node) { - _classCallCheck(this, Pattern); - return _possibleConstructorReturn(this, _getPrototypeOf(Pattern).call(this, nodeOrNew('pattern', node), node)); - } // Return the fill id + reference(attr) { + attr = this.attr(attr); + if (!attr) return null; + const m = attr.match(reference); + return m ? makeInstance(m[1]) : null; + } // set given data to the elements data property - _createClass(Pattern, [{ - key: "url", - value: function url() { - return 'url(#' + this.id() + ')'; - } // Update pattern by rebuilding + setData(o) { + this.dom = o; + return this; + } // Set element size to given width and height - }, { - key: "update", - value: function update(block) { - // remove content - this.clear(); // invoke passed block - if (typeof block === 'function') { - block.call(this, this); - } + size(width, height) { + let p = proportionalSize(this, width, height); + return this.width(new SVGNumber(p.width)).height(new SVGNumber(p.height)); + } // Set width of element - return this; - } // Alias string convertion to fill - }, { - key: "toString", - value: function toString() { - return this.url(); - } // custom attr to handle transform + width(width) { + return this.attr('width', width); + } // write svgjs data to the dom - }, { - key: "attr", - value: function attr(a, b, c) { - if (a === 'transform') a = 'patternTransform'; - return _get(_getPrototypeOf(Pattern.prototype), "attr", this).call(this, a, b, c); - } - }, { - key: "targets", - value: function targets() { - return baseFind('svg [fill*="' + this.id() + '"]'); - } - }, { - key: "bbox", - value: function bbox$$1() { - return new Box(); - } - }]); - return Pattern; - }(Container); - registerMethods({ - Container: { - // Create pattern element in defs - pattern: function pattern() { - var _this$defs; + writeDataToDom() { + // remove previously set data + this.node.removeAttribute('svgjs:data'); - return (_this$defs = this.defs()).pattern.apply(_this$defs, arguments); - } - }, - Defs: { - pattern: wrapWithAttrCheck(function (width, height, block) { - return this.put(new Pattern()).update(block).attr({ - x: 0, - y: 0, - width: width, - height: height, - patternUnits: 'userSpaceOnUse' - }); - }) + if (Object.keys(this.dom).length) { + this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)); // see #428 } - }); - register(Pattern); - - var Image = - /*#__PURE__*/ - function (_Shape) { - _inherits(Image, _Shape); - function Image(node) { - _classCallCheck(this, Image); + return super.writeDataToDom(); + } // Move over x-axis - return _possibleConstructorReturn(this, _getPrototypeOf(Image).call(this, nodeOrNew('image', node), node)); - } // (re)load image + x(x) { + return this.attr('x', x); + } // Move over y-axis - _createClass(Image, [{ - key: "load", - value: function load(url, callback) { - if (!url) return this; - var img = new globals.window.Image(); - on(img, 'load', function (e) { - var p = this.parent(Pattern); // ensure image size - if (this.width() === 0 && this.height() === 0) { - this.size(img.width, img.height); - } + y(y) { + return this.attr('y', y); + } - if (p instanceof Pattern) { - // ensure pattern size if not set - if (p.width() === 0 && p.height() === 0) { - p.size(this.width(), this.height()); - } - } +} +extend(Element, { + bbox, + rbox, + point, + ctm, + screenCTM +}); +register(Element); + +var sugar = { + stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'], + fill: ['color', 'opacity', 'rule'], + prefix: function prefix(t, a) { + return a === 'color' ? t : t + '-' + a; + } // Add sugar for fill and stroke + +}; +['fill', 'stroke'].forEach(function (m) { + var extension = {}; + var i; + + extension[m] = function (o) { + if (typeof o === 'undefined') { + return this.attr(m); + } - if (typeof callback === 'function') { - callback.call(this, e); - } - }, this); - on(img, 'load error', function () { - // dont forget to unbind memory leaking events - off(img); - }); - return this.attr('href', img.src = url, xlink); - } - }]); - - return Image; - }(Shape); - registerAttrHook(function (attr$$1, val, _this) { - // convert image fill and stroke to patterns - if (attr$$1 === 'fill' || attr$$1 === 'stroke') { - if (isImage.test(val)) { - val = _this.root().defs().image(val); + if (typeof o === 'string' || Color.isRgb(o) || o instanceof Element) { + this.attr(m, o); + } else { + // set all attributes from sugar.fill and sugar.stroke list + for (i = sugar[m].length - 1; i >= 0; i--) { + if (o[sugar[m][i]] != null) { + this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]]); + } } } - if (val instanceof Image) { - val = _this.root().defs().pattern(0, 0, function (pattern) { - pattern.add(val); - }); - } + return this; + }; - return val; - }); - registerMethods({ - Container: { - // create image element, load image and set its size - image: wrapWithAttrCheck(function (source, callback) { - return this.put(new Image()).size(0, 0).load(source, callback); - }) + registerMethods(['Shape', 'Runner'], extension); +}); +registerMethods(['Element', 'Runner'], { + // Let the user set the matrix directly + matrix: function matrix(mat, b, c, d, e, f) { + // Act as a getter + if (mat == null) { + return new Matrix(this); + } // Act as a setter, the user can pass a matrix or a set of numbers + + + return this.attr('transform', new Matrix(mat, b, c, d, e, f)); + }, + // Map rotation to transform + rotate: function rotate(angle, cx, cy) { + return this.transform({ + rotate: angle, + ox: cx, + oy: cy + }, true); + }, + // Map skew to transform + skew: function skew(x, y, cx, cy) { + return arguments.length === 1 || arguments.length === 3 ? this.transform({ + skew: x, + ox: y, + oy: cx + }, true) : this.transform({ + skew: [x, y], + ox: cx, + oy: cy + }, true); + }, + shear: function shear(lam, cx, cy) { + return this.transform({ + shear: lam, + ox: cx, + oy: cy + }, true); + }, + // Map scale to transform + scale: function scale(x, y, cx, cy) { + return arguments.length === 1 || arguments.length === 3 ? this.transform({ + scale: x, + ox: y, + oy: cx + }, true) : this.transform({ + scale: [x, y], + ox: cx, + oy: cy + }, true); + }, + // Map translate to transform + translate: function translate(x, y) { + return this.transform({ + translate: [x, y] + }, true); + }, + // Map relative translations to transform + relative: function relative(x, y) { + return this.transform({ + relative: [x, y] + }, true); + }, + // Map flip to transform + flip: function flip(direction, around) { + var directionString = typeof direction === 'string' ? direction : isFinite(direction) ? 'both' : 'both'; + var origin = direction === 'both' && isFinite(around) ? [around, around] : direction === 'x' ? [around, 0] : direction === 'y' ? [0, around] : isFinite(direction) ? [direction, direction] : [0, 0]; + this.transform({ + flip: directionString, + origin: origin + }, true); + }, + // Opacity + opacity: function opacity(value) { + return this.attr('opacity', value); + }, + // Relative move over x and y axes + dmove: function dmove(x, y) { + return this.dx(x).dy(y); + } +}); +registerMethods('Element', { + // Relative move over x axis + dx: function dx(x) { + return this.x(new SVGNumber(x).plus(this.x())); + }, + // Relative move over y axis + dy: function dy(y) { + return this.y(new SVGNumber(y).plus(this.y())); + } +}); +registerMethods('radius', { + // Add x and y radius + radius: function radius(x, y) { + var type = (this._element || this).type; + return type === 'radialGradient' || type === 'radialGradient' ? this.attr('r', new SVGNumber(x)) : this.rx(x).ry(y == null ? x : y); + } +}); +registerMethods('Path', { + // Get path length + length: function length() { + return this.node.getTotalLength(); + }, + // Get point at length + pointAt: function pointAt(length) { + return new Point(this.node.getPointAtLength(length)); + } +}); +registerMethods(['Element', 'Runner'], { + // Set font + font: function font(a, v) { + if (typeof a === 'object') { + for (v in a) this.font(v, a[v]); } - }); - register(Image); - - var PointArray = subClassArray('PointArray', SVGArray); - extend(PointArray, { - // Convert array to string - toString: function toString() { - // convert to a poly point string - for (var i = 0, il = this.length, array = []; i < il; i++) { - array.push(this[i].join(',')); - } - - return array.join(' '); - }, - // Convert array to line object - toLine: function toLine() { - return { - x1: this[0][0], - y1: this[0][1], - x2: this[1][0], - y2: this[1][1] - }; - }, - // Get morphed array at given position - at: function at(pos) { - // make sure a destination is defined - if (!this.destination) return this; // generate morphed point string - for (var i = 0, il = this.length, array = []; i < il; i++) { - array.push([this[i][0] + (this.destination[i][0] - this[i][0]) * pos, this[i][1] + (this.destination[i][1] - this[i][1]) * pos]); - } + return a === 'leading' ? this.leading(v) : a === 'anchor' ? this.attr('text-anchor', v) : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style' ? this.attr('font-' + a, v) : this.attr(a, v); + } +}); +registerMethods('Text', { + ax(x) { + return this.attr('x', x); + }, + + ay(y) { + return this.attr('y', y); + }, + + amove(x, y) { + return this.ax(x).ay(y); + } - return new PointArray(array); - }, - // Parse point string and flat array - parse: function parse() { - var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [[0, 0]]; - var points = []; // if it is an array - - if (array instanceof Array) { - // and it is not flat, there is no need to parse it - if (array[0] instanceof Array) { - return array; - } - } else { - // Else, it is considered as a string - // parse points - array = array.trim().split(delimiter).map(parseFloat); - } // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints - // Odd number of coordinates is an error. In such cases, drop the last odd coordinate. +}); // Add events to elements +const methods$1 = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove', 'mouseenter', 'mouseleave', 'touchstart', 'touchmove', 'touchleave', 'touchend', 'touchcancel'].reduce(function (last, event) { + // add event to Element + const fn = function fn(f) { + if (f === null) { + off(this, event); + } else { + on(this, event, f); + } - if (array.length % 2 !== 0) array.pop(); // wrap points in two-tuples and parse points as floats + return this; + }; - for (var i = 0, len = array.length; i < len; i = i + 2) { - points.push([array[i], array[i + 1]]); - } + last[event] = fn; + return last; +}, {}); +registerMethods('Element', methods$1); + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } - return points; - }, - // Move point string - move: function move(x, y) { - var box = this.bbox(); // get relative offset + return obj; +} - x -= box.x; - y -= box.y; // move every point +function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + var ownKeys = Object.keys(source); - if (!isNaN(x) && !isNaN(y)) { - for (var i = this.length - 1; i >= 0; i--) { - this[i] = [this[i][0] + x, this[i][1] + y]; - } - } + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } - return this; - }, - // Resize poly string - size: function size(width, height) { - var i; - var box = this.bbox(); // recalculate position of all points according to new size - - for (i = this.length - 1; i >= 0; i--) { - if (box.width) this[i][0] = (this[i][0] - box.x) * width / box.width + box.x; - if (box.height) this[i][1] = (this[i][1] - box.y) * height / box.height + box.y; - } + ownKeys.forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } - return this; - }, - // Get bounding box of points - bbox: function bbox() { - var maxX = -Infinity; - var maxY = -Infinity; - var minX = Infinity; - var minY = Infinity; - this.forEach(function (el) { - maxX = Math.max(el[0], maxX); - maxY = Math.max(el[1], maxY); - minX = Math.min(el[0], minX); - minY = Math.min(el[1], minY); - }); - return { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; + return target; +} + +function untransform() { + return this.attr('transform', null); +} // merge the whole transformation chain into one matrix and returns it + +function matrixify() { + var matrix = (this.attr('transform') || ''). // split transformations + split(transforms).slice(0, -1).map(function (str) { + // generate key => value pairs + var kv = str.trim().split('('); + return [kv[0], kv[1].split(delimiter).map(function (str) { + return parseFloat(str); + })]; + }).reverse() // merge every transformation into one matrix + .reduce(function (matrix, transform) { + if (transform[0] === 'matrix') { + return matrix.lmultiply(Matrix.fromArray(transform[1])); } - }); - var MorphArray = PointArray; // Move by left top corner over x-axis + return matrix[transform[0]].apply(matrix, transform[1]); + }, new Matrix()); + return matrix; +} // add an element to another parent without changing the visual representation on the screen + +function toParent(parent) { + if (this === parent) return this; + var ctm$$1 = this.screenCTM(); + var pCtm = parent.screenCTM().inverse(); + this.addTo(parent).untransform().transform(pCtm.multiply(ctm$$1)); + return this; +} // same as above with parent equals root-svg + +function toRoot() { + return this.toParent(this.root()); +} // Add transformations + +function transform(o, relative) { + // Act as a getter if no object was passed + if (o == null || typeof o === 'string') { + var decomposed = new Matrix(this).decompose(); + return decomposed[o] || decomposed; + } - function x$1(x) { - return x == null ? this.bbox().x : this.move(x, this.bbox().y); - } // Move by left top corner over y-axis + if (!Matrix.isMatrixLike(o)) { + // Set the origin according to the defined transform + o = _objectSpread({}, o, { + origin: getOrigin(o, this) + }); + } // The user can pass a boolean, an Element or an Matrix or nothing + + + var cleanRelative = relative === true ? this : relative || false; + var result = new Matrix(cleanRelative).transform(o); + return this.attr('transform', result); +} +registerMethods('Element', { + untransform, + matrixify, + toParent, + toRoot, + transform +}); + +function rx(rx) { + return this.attr('rx', rx); +} // Radius y value + +function ry(ry) { + return this.attr('ry', ry); +} // Move over x-axis + +function x(x) { + return x == null ? this.cx() - this.rx() : this.cx(x + this.rx()); +} // Move over y-axis + +function y(y) { + return y == null ? this.cy() - this.ry() : this.cy(y + this.ry()); +} // Move by center over x-axis + +function cx(x) { + return x == null ? this.attr('cx') : this.attr('cx', x); +} // Move by center over y-axis + +function cy(y) { + return y == null ? this.attr('cy') : this.attr('cy', y); +} // Set width of element + +function width(width) { + return width == null ? this.rx() * 2 : this.rx(new SVGNumber(width).divide(2)); +} // Set height of element + +function height(height) { + return height == null ? this.ry() * 2 : this.ry(new SVGNumber(height).divide(2)); +} + +var circled = /*#__PURE__*/Object.freeze({ + rx: rx, + ry: ry, + x: x, + y: y, + cx: cx, + cy: cy, + width: width, + height: height +}); + +class Shape extends Element {} +register(Shape); + +class Circle extends Shape { + constructor(node) { + super(nodeOrNew('circle', node), node); + } - function y$1(y) { - return y == null ? this.bbox().y : this.move(this.bbox().x, y); - } // Set width of element + radius(r) { + return this.attr('r', r); + } // Radius x value - function width$1(width) { - var b = this.bbox(); - return width == null ? b.width : this.size(width, b.height); - } // Set height of element - function height$1(height) { - var b = this.bbox(); - return height == null ? b.height : this.size(b.width, height); + rx(rx$$1) { + return this.attr('r', rx$$1); + } // Alias radius x value + + + ry(ry$$1) { + return this.rx(ry$$1); } - var pointed = /*#__PURE__*/Object.freeze({ - MorphArray: MorphArray, - x: x$1, - y: y$1, - width: width$1, - height: height$1 - }); + size(size) { + return this.radius(new SVGNumber(size).divide(2)); + } - var Line = - /*#__PURE__*/ - function (_Shape) { - _inherits(Line, _Shape); - - // Initialize node - function Line(node) { - _classCallCheck(this, Line); - - return _possibleConstructorReturn(this, _getPrototypeOf(Line).call(this, nodeOrNew('line', node), node)); - } // Get array - - - _createClass(Line, [{ - key: "array", - value: function array() { - return new PointArray([[this.attr('x1'), this.attr('y1')], [this.attr('x2'), this.attr('y2')]]); - } // Overwrite native plot() method - - }, { - key: "plot", - value: function plot(x1, y1, x2, y2) { - if (x1 == null) { - return this.array(); - } else if (typeof y1 !== 'undefined') { - x1 = { - x1: x1, - y1: y1, - x2: x2, - y2: y2 - }; - } else { - x1 = new PointArray(x1).toLine(); - } +} +extend(Circle, { + x, + y, + cx, + cy, + width, + height +}); +registerMethods({ + Element: { + // Create circle element + circle: wrapWithAttrCheck(function (size) { + return this.put(new Circle()).size(size).move(0, 0); + }) + } +}); +register(Circle); - return this.attr(x1); - } // Move by left top corner +class Container extends Element { + flatten(parent) { + this.each(function () { + if (this instanceof Container) return this.flatten(parent).ungroup(parent); + return this.toParent(parent); + }); // we need this so that the root does not get removed - }, { - key: "move", - value: function move(x, y) { - return this.attr(this.array().move(x, y).toLine()); - } // Set element size to given width and height + this.node.firstElementChild || this.remove(); + return this; + } - }, { - key: "size", - value: function size(width, height) { - var p = proportionalSize(this, width, height); - return this.attr(this.array().size(p.width, p.height).toLine()); - } - }]); - - return Line; - }(Shape); - extend(Line, pointed); - registerMethods({ - Container: { - // Create a line element - line: wrapWithAttrCheck(function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + ungroup(parent) { + parent = parent || this.parent(); + this.each(function () { + return this.toParent(parent); + }); + this.remove(); + return this; + } - // make sure plot is called as a setter - // x1 is not necessarily a number, it can also be an array, a string and a PointArray - return Line.prototype.plot.apply(this.put(new Line()), args[0] != null ? args : [0, 0, 0, 0]); - }) - } - }); - register(Line); - - var Marker = - /*#__PURE__*/ - function (_Container) { - _inherits(Marker, _Container); - - // Initialize node - function Marker(node) { - _classCallCheck(this, Marker); - - return _possibleConstructorReturn(this, _getPrototypeOf(Marker).call(this, nodeOrNew('marker', node), node)); - } // Set width of element - - - _createClass(Marker, [{ - key: "width", - value: function width(_width) { - return this.attr('markerWidth', _width); - } // Set height of element - - }, { - key: "height", - value: function height(_height) { - return this.attr('markerHeight', _height); - } // Set marker refX and refY - - }, { - key: "ref", - value: function ref(x, y) { - return this.attr('refX', x).attr('refY', y); - } // Update marker - - }, { - key: "update", - value: function update(block) { - // remove all content - this.clear(); // invoke passed block - - if (typeof block === 'function') { - block.call(this, this); - } +} +register(Container); - return this; - } // Return the fill id +class Defs extends Container { + constructor(node) { + super(nodeOrNew('defs', node), node); + } - }, { - key: "toString", - value: function toString() { - return 'url(#' + this.id() + ')'; - } - }]); + flatten() { + return this; + } - return Marker; - }(Container); - registerMethods({ - Container: { - marker: function marker() { - var _this$defs; + ungroup() { + return this; + } - // Create marker element in defs - return (_this$defs = this.defs()).marker.apply(_this$defs, arguments); - } - }, - Defs: { - // Create marker - marker: wrapWithAttrCheck(function (width, height, block) { - // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto - return this.put(new Marker()).size(width, height).ref(width / 2, height / 2).viewbox(0, 0, width, height).attr('orient', 'auto').update(block); - }) - }, - marker: { - // Create and attach markers - marker: function marker(_marker, width, height, block) { - var attr = ['marker']; // Build attribute name +} +register(Defs); - if (_marker !== 'all') attr.push(_marker); - attr = attr.join('-'); // Set marker attribute +class Ellipse extends Shape { + constructor(node) { + super(nodeOrNew('ellipse', node), node); + } - _marker = arguments[1] instanceof Marker ? arguments[1] : this.defs().marker(width, height, block); - return this.attr(attr, _marker); - } - } - }); - register(Marker); - - /*** - Base Class - ========== - The base stepper class that will be - ***/ - - function makeSetterGetter(k, f) { - return function (v) { - if (v == null) return this[v]; - this[k] = v; - if (f) f.call(this); - return this; - }; + size(width$$1, height$$1) { + var p = proportionalSize(this, width$$1, height$$1); + return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2)); } - var easing = { - '-': function _(pos) { - return pos; - }, - '<>': function _(pos) { - return -Math.cos(pos * Math.PI) / 2 + 0.5; - }, - '>': function _(pos) { - return Math.sin(pos * Math.PI / 2); - }, - '<': function _(pos) { - return -Math.cos(pos * Math.PI / 2) + 1; - }, - bezier: function bezier(x1, y1, x2, y2) { - // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo - return function (t) { - if (t < 0) { - if (x1 > 0) { - return y1 / x1 * t; - } else if (x2 > 0) { - return y2 / x2 * t; - } else { - return 0; - } - } else if (t > 1) { - if (x2 < 1) { - return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2); - } else if (x1 < 1) { - return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1); - } else { - return 1; - } - } else { - return 3 * t * Math.pow(1 - t, 2) * y1 + 3 * Math.pow(t, 2) * (1 - t) * y2 + Math.pow(t, 3); - } +} +extend(Ellipse, circled); +registerMethods('Container', { + // Create an ellipse + ellipse: wrapWithAttrCheck(function (width$$1, height$$1) { + return this.put(new Ellipse()).size(width$$1, height$$1).move(0, 0); + }) +}); +register(Ellipse); + +class Stop extends Element { + constructor(node) { + super(nodeOrNew('stop', node), node); + } // add color stops + + + update(o) { + if (typeof o === 'number' || o instanceof SVGNumber) { + o = { + offset: arguments[0], + color: arguments[1], + opacity: arguments[2] }; - }, - // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo - steps: function steps(_steps) { - var stepPosition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'end'; - // deal with "jump-" prefix - stepPosition = stepPosition.split('-').reverse()[0]; - var jumps = _steps; - - if (stepPosition === 'none') { - --jumps; - } else if (stepPosition === 'both') { - ++jumps; - } // The beforeFlag is essentially useless - - - return function (t) { - var beforeFlag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - // Step is called currentStep in referenced url - var step = Math.floor(t * _steps); - var jumping = t * step % 1 === 0; - - if (stepPosition === 'start' || stepPosition === 'both') { - ++step; - } + } // set attributes - if (beforeFlag && jumping) { - --step; - } - - if (t >= 0 && step < 0) { - step = 0; - } - if (t <= 1 && step > jumps) { - step = jumps; - } + if (o.opacity != null) this.attr('stop-opacity', o.opacity); + if (o.color != null) this.attr('stop-color', o.color); + if (o.offset != null) this.attr('offset', new SVGNumber(o.offset)); + return this; + } - return step / jumps; - }; - } - }; - var Stepper = - /*#__PURE__*/ - function () { - function Stepper() { - _classCallCheck(this, Stepper); - } +} +register(Stop); - _createClass(Stepper, [{ - key: "done", - value: function done() { - return false; - } - }]); +function from(x, y) { + return (this._element || this).type === 'radialGradient' ? this.attr({ + fx: new SVGNumber(x), + fy: new SVGNumber(y) + }) : this.attr({ + x1: new SVGNumber(x), + y1: new SVGNumber(y) + }); +} +function to(x, y) { + return (this._element || this).type === 'radialGradient' ? this.attr({ + cx: new SVGNumber(x), + cy: new SVGNumber(y) + }) : this.attr({ + x2: new SVGNumber(x), + y2: new SVGNumber(y) + }); +} - return Stepper; - }(); - /*** - Easing Functions - ================ - ***/ +var gradiented = /*#__PURE__*/Object.freeze({ + from: from, + to: to +}); - var Ease = - /*#__PURE__*/ - function (_Stepper) { - _inherits(Ease, _Stepper); +class Gradient extends Container { + constructor(type, attrs) { + super(nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type), attrs); + } // Add a color stop - function Ease(fn) { - var _this; - _classCallCheck(this, Ease); + stop(offset, color, opacity) { + return this.put(new Stop()).update(offset, color, opacity); + } // Update gradient - _this = _possibleConstructorReturn(this, _getPrototypeOf(Ease).call(this)); - _this.ease = easing[fn || timeline.ease] || fn; - return _this; - } - _createClass(Ease, [{ - key: "step", - value: function step(from, to, pos) { - if (typeof from !== 'number') { - return pos < 1 ? from : to; - } + update(block) { + // remove all stops + this.clear(); // invoke passed block - return from + (to - from) * this.ease(pos); - } - }]); + if (typeof block === 'function') { + block.call(this, this); + } - return Ease; - }(Stepper); - /*** - Controller Types - ================ - ***/ + return this; + } // Return the fill id - var Controller = - /*#__PURE__*/ - function (_Stepper2) { - _inherits(Controller, _Stepper2); - function Controller(fn) { - var _this2; + url() { + return 'url(#' + this.id() + ')'; + } // Alias string convertion to fill - _classCallCheck(this, Controller); - _this2 = _possibleConstructorReturn(this, _getPrototypeOf(Controller).call(this)); - _this2.stepper = fn; - return _this2; - } + toString() { + return this.url(); + } // custom attr to handle transform - _createClass(Controller, [{ - key: "step", - value: function step(current, target, dt, c) { - return this.stepper(current, target, dt, c); - } - }, { - key: "done", - value: function done(c) { - return c.done; - } - }]); - return Controller; - }(Stepper); + attr(a, b, c) { + if (a === 'transform') a = 'gradientTransform'; + return super.attr(a, b, c); + } - function recalculate() { - // Apply the default parameters - var duration = (this._duration || 500) / 1000; - var overshoot = this._overshoot || 0; // Calculate the PID natural response + targets() { + return baseFind('svg [fill*="' + this.id() + '"]'); + } - var eps = 1e-10; - var pi = Math.PI; - var os = Math.log(overshoot / 100 + eps); - var zeta = -os / Math.sqrt(pi * pi + os * os); - var wn = 3.9 / (zeta * duration); // Calculate the Spring values + bbox() { + return new Box(); + } - this.d = 2 * zeta * wn; - this.k = wn * wn; +} +extend(Gradient, gradiented); +registerMethods({ + Container: { + // Create gradient element in defs + gradient: wrapWithAttrCheck(function (type, block) { + return this.defs().gradient(type, block); + }) + }, + // define gradient + Defs: { + gradient: wrapWithAttrCheck(function (type, block) { + return this.put(new Gradient(type)).update(block); + }) } +}); +register(Gradient); - var Spring = - /*#__PURE__*/ - function (_Controller) { - _inherits(Spring, _Controller); +class Pattern extends Container { + // Initialize node + constructor(node) { + super(nodeOrNew('pattern', node), node); + } // Return the fill id - function Spring(duration, overshoot) { - var _this3; - _classCallCheck(this, Spring); + url() { + return 'url(#' + this.id() + ')'; + } // Update pattern by rebuilding - _this3 = _possibleConstructorReturn(this, _getPrototypeOf(Spring).call(this)); - _this3.duration(duration || 500).overshoot(overshoot || 0); + update(block) { + // remove content + this.clear(); // invoke passed block - return _this3; + if (typeof block === 'function') { + block.call(this, this); } - _createClass(Spring, [{ - key: "step", - value: function step(current, target, dt, c) { - if (typeof current === 'string') return current; - c.done = dt === Infinity; - if (dt === Infinity) return target; - if (dt === 0) return current; - if (dt > 100) dt = 16; - dt /= 1000; // Get the previous velocity + return this; + } // Alias string convertion to fill - var velocity = c.velocity || 0; // Apply the control to get the new position and store it - var acceleration = -this.d * velocity - this.k * (current - target); - var newPosition = current + velocity * dt + acceleration * dt * dt / 2; // Store the velocity + toString() { + return this.url(); + } // custom attr to handle transform - c.velocity = velocity + acceleration * dt; // Figure out if we have converged, and if so, pass the value - c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002; - return c.done ? target : newPosition; - } - }]); + attr(a, b, c) { + if (a === 'transform') a = 'patternTransform'; + return super.attr(a, b, c); + } - return Spring; - }(Controller); - extend(Spring, { - duration: makeSetterGetter('_duration', recalculate), - overshoot: makeSetterGetter('_overshoot', recalculate) - }); - var PID = - /*#__PURE__*/ - function (_Controller2) { - _inherits(PID, _Controller2); + targets() { + return baseFind('svg [fill*="' + this.id() + '"]'); + } - function PID(p, i, d, windup) { - var _this4; + bbox() { + return new Box(); + } - _classCallCheck(this, PID); +} +registerMethods({ + Container: { + // Create pattern element in defs + pattern(...args) { + return this.defs().pattern(...args); + } - _this4 = _possibleConstructorReturn(this, _getPrototypeOf(PID).call(this)); - p = p == null ? 0.1 : p; - i = i == null ? 0.01 : i; - d = d == null ? 0 : d; - windup = windup == null ? 1000 : windup; + }, + Defs: { + pattern: wrapWithAttrCheck(function (width, height, block) { + return this.put(new Pattern()).update(block).attr({ + x: 0, + y: 0, + width: width, + height: height, + patternUnits: 'userSpaceOnUse' + }); + }) + } +}); +register(Pattern); - _this4.p(p).i(i).d(d).windup(windup); +class Image extends Shape { + constructor(node) { + super(nodeOrNew('image', node), node); + } // (re)load image - return _this4; - } - _createClass(PID, [{ - key: "step", - value: function step(current, target, dt, c) { - if (typeof current === 'string') return current; - c.done = dt === Infinity; - if (dt === Infinity) return target; - if (dt === 0) return current; - var p = target - current; - var i = (c.integral || 0) + p * dt; - var d = (p - (c.error || 0)) / dt; - var windup = this.windup; // antiwindup - - if (windup !== false) { - i = Math.max(-windup, Math.min(i, windup)); - } + load(url, callback) { + if (!url) return this; + var img = new globals.window.Image(); + on(img, 'load', function (e) { + var p = this.parent(Pattern); // ensure image size - c.error = p; - c.integral = i; - c.done = Math.abs(p) < 0.001; - return c.done ? target : current + (this.P * p + this.I * i + this.D * d); + if (this.width() === 0 && this.height() === 0) { + this.size(img.width, img.height); } - }]); - - return PID; - }(Controller); - extend(PID, { - windup: makeSetterGetter('windup'), - p: makeSetterGetter('P'), - i: makeSetterGetter('I'), - d: makeSetterGetter('D') - }); - var PathArray = subClassArray('PathArray', SVGArray); - function pathRegReplace(a, b, c, d) { - return c + d.replace(dots, ' .'); + if (p instanceof Pattern) { + // ensure pattern size if not set + if (p.width() === 0 && p.height() === 0) { + p.size(this.width(), this.height()); + } + } + + if (typeof callback === 'function') { + callback.call(this, e); + } + }, this); + on(img, 'load error', function () { + // dont forget to unbind memory leaking events + off(img); + }); + return this.attr('href', img.src = url, xlink); + } + +} +registerAttrHook(function (attr$$1, val, _this) { + // convert image fill and stroke to patterns + if (attr$$1 === 'fill' || attr$$1 === 'stroke') { + if (isImage.test(val)) { + val = _this.root().defs().image(val); + } + } + + if (val instanceof Image) { + val = _this.root().defs().pattern(0, 0, pattern => { + pattern.add(val); + }); + } + + return val; +}); +registerMethods({ + Container: { + // create image element, load image and set its size + image: wrapWithAttrCheck(function (source, callback) { + return this.put(new Image()).size(0, 0).load(source, callback); + }) + } +}); +register(Image); + +const PointArray = subClassArray('PointArray', SVGArray); +extend(PointArray, { + // Convert array to string + toString() { + // convert to a poly point string + for (var i = 0, il = this.length, array = []; i < il; i++) { + array.push(this[i].join(',')); + } + + return array.join(' '); + }, + + // Convert array to line object + toLine() { + return { + x1: this[0][0], + y1: this[0][1], + x2: this[1][0], + y2: this[1][1] + }; + }, + + // Get morphed array at given position + at(pos) { + // make sure a destination is defined + if (!this.destination) return this; // generate morphed point string + + for (var i = 0, il = this.length, array = []; i < il; i++) { + array.push([this[i][0] + (this.destination[i][0] - this[i][0]) * pos, this[i][1] + (this.destination[i][1] - this[i][1]) * pos]); + } + + return new PointArray(array); + }, + + // Parse point string and flat array + parse(array = [[0, 0]]) { + var points = []; // if it is an array + + if (array instanceof Array) { + // and it is not flat, there is no need to parse it + if (array[0] instanceof Array) { + return array; + } + } else { + // Else, it is considered as a string + // parse points + array = array.trim().split(delimiter).map(parseFloat); + } // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints + // Odd number of coordinates is an error. In such cases, drop the last odd coordinate. + + + if (array.length % 2 !== 0) array.pop(); // wrap points in two-tuples and parse points as floats + + for (var i = 0, len = array.length; i < len; i = i + 2) { + points.push([array[i], array[i + 1]]); + } + + return points; + }, + + // Move point string + move(x, y) { + var box = this.bbox(); // get relative offset + + x -= box.x; + y -= box.y; // move every point + + if (!isNaN(x) && !isNaN(y)) { + for (var i = this.length - 1; i >= 0; i--) { + this[i] = [this[i][0] + x, this[i][1] + y]; + } + } + + return this; + }, + + // Resize poly string + size(width, height) { + var i; + var box = this.bbox(); // recalculate position of all points according to new size + + for (i = this.length - 1; i >= 0; i--) { + if (box.width) this[i][0] = (this[i][0] - box.x) * width / box.width + box.x; + if (box.height) this[i][1] = (this[i][1] - box.y) * height / box.height + box.y; + } + + return this; + }, + + // Get bounding box of points + bbox() { + var maxX = -Infinity; + var maxY = -Infinity; + var minX = Infinity; + var minY = Infinity; + this.forEach(function (el) { + maxX = Math.max(el[0], maxX); + maxY = Math.max(el[1], maxY); + minX = Math.min(el[0], minX); + minY = Math.min(el[1], minY); + }); + return { + x: minX, + y: minY, + width: maxX - minX, + height: maxY - minY + }; + } + +}); + +let MorphArray = PointArray; // Move by left top corner over x-axis + +function x$1(x) { + return x == null ? this.bbox().x : this.move(x, this.bbox().y); +} // Move by left top corner over y-axis + +function y$1(y) { + return y == null ? this.bbox().y : this.move(this.bbox().x, y); +} // Set width of element + +function width$1(width) { + let b = this.bbox(); + return width == null ? b.width : this.size(width, b.height); +} // Set height of element + +function height$1(height) { + let b = this.bbox(); + return height == null ? b.height : this.size(b.width, height); +} + +var pointed = /*#__PURE__*/Object.freeze({ + MorphArray: MorphArray, + x: x$1, + y: y$1, + width: width$1, + height: height$1 +}); + +class Line extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('line', node), node); + } // Get array + + + array() { + return new PointArray([[this.attr('x1'), this.attr('y1')], [this.attr('x2'), this.attr('y2')]]); + } // Overwrite native plot() method + + + plot(x1, y1, x2, y2) { + if (x1 == null) { + return this.array(); + } else if (typeof y1 !== 'undefined') { + x1 = { + x1: x1, + y1: y1, + x2: x2, + y2: y2 + }; + } else { + x1 = new PointArray(x1).toLine(); + } + + return this.attr(x1); + } // Move by left top corner + + + move(x, y) { + return this.attr(this.array().move(x, y).toLine()); + } // Set element size to given width and height + + + size(width, height) { + var p = proportionalSize(this, width, height); + return this.attr(this.array().size(p.width, p.height).toLine()); + } + +} +extend(Line, pointed); +registerMethods({ + Container: { + // Create a line element + line: wrapWithAttrCheck(function (...args) { + // make sure plot is called as a setter + // x1 is not necessarily a number, it can also be an array, a string and a PointArray + return Line.prototype.plot.apply(this.put(new Line()), args[0] != null ? args : [0, 0, 0, 0]); + }) + } +}); +register(Line); + +class Marker extends Container { + // Initialize node + constructor(node) { + super(nodeOrNew('marker', node), node); + } // Set width of element + + + width(width) { + return this.attr('markerWidth', width); + } // Set height of element + + + height(height) { + return this.attr('markerHeight', height); + } // Set marker refX and refY + + + ref(x, y) { + return this.attr('refX', x).attr('refY', y); + } // Update marker + + + update(block) { + // remove all content + this.clear(); // invoke passed block + + if (typeof block === 'function') { + block.call(this, this); + } + + return this; + } // Return the fill id + + + toString() { + return 'url(#' + this.id() + ')'; + } + +} +registerMethods({ + Container: { + marker(...args) { + // Create marker element in defs + return this.defs().marker(...args); + } + + }, + Defs: { + // Create marker + marker: wrapWithAttrCheck(function (width, height, block) { + // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto + return this.put(new Marker()).size(width, height).ref(width / 2, height / 2).viewbox(0, 0, width, height).attr('orient', 'auto').update(block); + }) + }, + marker: { + // Create and attach markers + marker(marker, width, height, block) { + var attr = ['marker']; // Build attribute name + + if (marker !== 'all') attr.push(marker); + attr = attr.join('-'); // Set marker attribute + + marker = arguments[1] instanceof Marker ? arguments[1] : this.defs().marker(width, height, block); + return this.attr(attr, marker); + } + + } +}); +register(Marker); + +var _strictMethod = function (method, arg) { + return !!method && _fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + +var $sort = [].sort; +var test = [1, 2, 3]; + +_export(_export.P + _export.F * (_fails(function () { + // IE8- + test.sort(undefined); +}) || !_fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !_strictMethod($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(_toObject(this)) + : $sort.call(_toObject(this), _aFunction(comparefn)); + } +}); + +/*** +Base Class +========== +The base stepper class that will be +***/ + +function makeSetterGetter(k, f) { + return function (v) { + if (v == null) return this[v]; + this[k] = v; + if (f) f.call(this); + return this; + }; +} + +let easing = { + '-': function _(pos) { + return pos; + }, + '<>': function _(pos) { + return -Math.cos(pos * Math.PI) / 2 + 0.5; + }, + '>': function _(pos) { + return Math.sin(pos * Math.PI / 2); + }, + '<': function _(pos) { + return -Math.cos(pos * Math.PI / 2) + 1; + }, + bezier: function bezier(x1, y1, x2, y2) { + // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo + return function (t) { + if (t < 0) { + if (x1 > 0) { + return y1 / x1 * t; + } else if (x2 > 0) { + return y2 / x2 * t; + } else { + return 0; + } + } else if (t > 1) { + if (x2 < 1) { + return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2); + } else if (x1 < 1) { + return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1); + } else { + return 1; + } + } else { + return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3; + } + }; + }, + // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo + steps: function steps(_steps, stepPosition = 'end') { + // deal with "jump-" prefix + stepPosition = stepPosition.split('-').reverse()[0]; + let jumps = _steps; + + if (stepPosition === 'none') { + --jumps; + } else if (stepPosition === 'both') { + ++jumps; + } // The beforeFlag is essentially useless + + + return (t, beforeFlag = false) => { + // Step is called currentStep in referenced url + let step = Math.floor(t * _steps); + const jumping = t * step % 1 === 0; + + if (stepPosition === 'start' || stepPosition === 'both') { + ++step; + } + + if (beforeFlag && jumping) { + --step; + } + + if (t >= 0 && step < 0) { + step = 0; + } + + if (t <= 1 && step > jumps) { + step = jumps; + } + + return step / jumps; + }; } +}; +class Stepper { + done() { + return false; + } + +} +/*** +Easing Functions +================ +***/ + +class Ease extends Stepper { + constructor(fn) { + super(); + this.ease = easing[fn || timeline.ease] || fn; + } + + step(from, to, pos) { + if (typeof from !== 'number') { + return pos < 1 ? from : to; + } + + return from + (to - from) * this.ease(pos); + } + +} +/*** +Controller Types +================ +***/ + +class Controller extends Stepper { + constructor(fn) { + super(); + this.stepper = fn; + } + + step(current, target, dt, c) { + return this.stepper(current, target, dt, c); + } + + done(c) { + return c.done; + } + +} + +function recalculate() { + // Apply the default parameters + var duration = (this._duration || 500) / 1000; + var overshoot = this._overshoot || 0; // Calculate the PID natural response + + var eps = 1e-10; + var pi = Math.PI; + var os = Math.log(overshoot / 100 + eps); + var zeta = -os / Math.sqrt(pi * pi + os * os); + var wn = 3.9 / (zeta * duration); // Calculate the Spring values + + this.d = 2 * zeta * wn; + this.k = wn * wn; +} + +class Spring extends Controller { + constructor(duration, overshoot) { + super(); + this.duration(duration || 500).overshoot(overshoot || 0); + } + + step(current, target, dt, c) { + if (typeof current === 'string') return current; + c.done = dt === Infinity; + if (dt === Infinity) return target; + if (dt === 0) return current; + if (dt > 100) dt = 16; + dt /= 1000; // Get the previous velocity + + var velocity = c.velocity || 0; // Apply the control to get the new position and store it + + var acceleration = -this.d * velocity - this.k * (current - target); + var newPosition = current + velocity * dt + acceleration * dt * dt / 2; // Store the velocity + + c.velocity = velocity + acceleration * dt; // Figure out if we have converged, and if so, pass the value + + c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002; + return c.done ? target : newPosition; + } + +} +extend(Spring, { + duration: makeSetterGetter('_duration', recalculate), + overshoot: makeSetterGetter('_overshoot', recalculate) +}); +class PID extends Controller { + constructor(p, i, d, windup) { + super(); + p = p == null ? 0.1 : p; + i = i == null ? 0.01 : i; + d = d == null ? 0 : d; + windup = windup == null ? 1000 : windup; + this.p(p).i(i).d(d).windup(windup); + } + + step(current, target, dt, c) { + if (typeof current === 'string') return current; + c.done = dt === Infinity; + if (dt === Infinity) return target; + if (dt === 0) return current; + var p = target - current; + var i = (c.integral || 0) + p * dt; + var d = (p - (c.error || 0)) / dt; + var windup = this.windup; // antiwindup + + if (windup !== false) { + i = Math.max(-windup, Math.min(i, windup)); + } + + c.error = p; + c.integral = i; + c.done = Math.abs(p) < 0.001; + return c.done ? target : current + (this.P * p + this.I * i + this.D * d); + } + +} +extend(PID, { + windup: makeSetterGetter('windup'), + p: makeSetterGetter('P'), + i: makeSetterGetter('I'), + d: makeSetterGetter('D') +}); - function arrayToString(a) { - for (var i = 0, il = a.length, s = ''; i < il; i++) { - s += a[i][0]; +const PathArray = subClassArray('PathArray', SVGArray); +function pathRegReplace(a, b, c, d) { + return c + d.replace(dots, ' .'); +} - if (a[i][1] != null) { - s += a[i][1]; +function arrayToString(a) { + for (var i = 0, il = a.length, s = ''; i < il; i++) { + s += a[i][0]; - if (a[i][2] != null) { + if (a[i][1] != null) { + s += a[i][1]; + + if (a[i][2] != null) { + s += ' '; + s += a[i][2]; + + if (a[i][3] != null) { s += ' '; - s += a[i][2]; + s += a[i][3]; + s += ' '; + s += a[i][4]; - if (a[i][3] != null) { + if (a[i][5] != null) { s += ' '; - s += a[i][3]; + s += a[i][5]; s += ' '; - s += a[i][4]; + s += a[i][6]; - if (a[i][5] != null) { - s += ' '; - s += a[i][5]; + if (a[i][7] != null) { s += ' '; - s += a[i][6]; - - if (a[i][7] != null) { - s += ' '; - s += a[i][7]; - } + s += a[i][7]; } } } } } + } - return s + ' '; + return s + ' '; +} + +const pathHandlers = { + M: function M(c, p, p0) { + p.x = p0.x = c[0]; + p.y = p0.y = c[1]; + return ['M', p.x, p.y]; + }, + L: function L(c, p) { + p.x = c[0]; + p.y = c[1]; + return ['L', c[0], c[1]]; + }, + H: function H(c, p) { + p.x = c[0]; + return ['H', c[0]]; + }, + V: function V(c, p) { + p.y = c[0]; + return ['V', c[0]]; + }, + C: function C(c, p) { + p.x = c[4]; + p.y = c[5]; + return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]; + }, + S: function S(c, p) { + p.x = c[2]; + p.y = c[3]; + return ['S', c[0], c[1], c[2], c[3]]; + }, + Q: function Q(c, p) { + p.x = c[2]; + p.y = c[3]; + return ['Q', c[0], c[1], c[2], c[3]]; + }, + T: function T(c, p) { + p.x = c[0]; + p.y = c[1]; + return ['T', c[0], c[1]]; + }, + Z: function Z(c, p, p0) { + p.x = p0.x; + p.y = p0.y; + return ['Z']; + }, + A: function A(c, p) { + p.x = c[5]; + p.y = c[6]; + return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]; } +}; +let mlhvqtcsaz = 'mlhvqtcsaz'.split(''); + +for (var i$1 = 0, il = mlhvqtcsaz.length; i$1 < il; ++i$1) { + pathHandlers[mlhvqtcsaz[i$1]] = function (i) { + return function (c, p, p0) { + if (i === 'H') c[0] = c[0] + p.x;else if (i === 'V') c[0] = c[0] + p.y;else if (i === 'A') { + c[5] = c[5] + p.x; + c[6] = c[6] + p.y; + } else { + for (var j = 0, jl = c.length; j < jl; ++j) { + c[j] = c[j] + (j % 2 ? p.y : p.x); + } + } + return pathHandlers[i](c, p, p0); + }; + }(mlhvqtcsaz[i$1].toUpperCase()); +} + +extend(PathArray, { + // Convert array to string + toString() { + return arrayToString(this); + }, + + // Move path string + move(x, y) { + // get bounding box of current situation + var box = this.bbox(); // get relative offset + + x -= box.x; + y -= box.y; + + if (!isNaN(x) && !isNaN(y)) { + // move every point + for (var l, i = this.length - 1; i >= 0; i--) { + l = this[i][0]; - var pathHandlers = { - M: function M(c, p, p0) { - p.x = p0.x = c[0]; - p.y = p0.y = c[1]; - return ['M', p.x, p.y]; - }, - L: function L(c, p) { - p.x = c[0]; - p.y = c[1]; - return ['L', c[0], c[1]]; - }, - H: function H(c, p) { - p.x = c[0]; - return ['H', c[0]]; - }, - V: function V(c, p) { - p.y = c[0]; - return ['V', c[0]]; - }, - C: function C(c, p) { - p.x = c[4]; - p.y = c[5]; - return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]; - }, - S: function S(c, p) { - p.x = c[2]; - p.y = c[3]; - return ['S', c[0], c[1], c[2], c[3]]; - }, - Q: function Q(c, p) { - p.x = c[2]; - p.y = c[3]; - return ['Q', c[0], c[1], c[2], c[3]]; - }, - T: function T(c, p) { - p.x = c[0]; - p.y = c[1]; - return ['T', c[0], c[1]]; - }, - Z: function Z(c, p, p0) { - p.x = p0.x; - p.y = p0.y; - return ['Z']; - }, - A: function A(c, p) { - p.x = c[5]; - p.y = c[6]; - return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]; + if (l === 'M' || l === 'L' || l === 'T') { + this[i][1] += x; + this[i][2] += y; + } else if (l === 'H') { + this[i][1] += x; + } else if (l === 'V') { + this[i][1] += y; + } else if (l === 'C' || l === 'S' || l === 'Q') { + this[i][1] += x; + this[i][2] += y; + this[i][3] += x; + this[i][4] += y; + + if (l === 'C') { + this[i][5] += x; + this[i][6] += y; + } + } else if (l === 'A') { + this[i][6] += x; + this[i][7] += y; + } + } } - }; - var mlhvqtcsaz = 'mlhvqtcsaz'.split(''); - - for (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) { - pathHandlers[mlhvqtcsaz[i]] = function (i) { - return function (c, p, p0) { - if (i === 'H') c[0] = c[0] + p.x;else if (i === 'V') c[0] = c[0] + p.y;else if (i === 'A') { - c[5] = c[5] + p.x; - c[6] = c[6] + p.y; + + return this; + }, + + // Resize path string + size(width, height) { + // get bounding box of current situation + var box = this.bbox(); + var i, l; // recalculate position of all points according to new size + + for (i = this.length - 1; i >= 0; i--) { + l = this[i][0]; + + if (l === 'M' || l === 'L' || l === 'T') { + this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; + this[i][2] = (this[i][2] - box.y) * height / box.height + box.y; + } else if (l === 'H') { + this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; + } else if (l === 'V') { + this[i][1] = (this[i][1] - box.y) * height / box.height + box.y; + } else if (l === 'C' || l === 'S' || l === 'Q') { + this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; + this[i][2] = (this[i][2] - box.y) * height / box.height + box.y; + this[i][3] = (this[i][3] - box.x) * width / box.width + box.x; + this[i][4] = (this[i][4] - box.y) * height / box.height + box.y; + + if (l === 'C') { + this[i][5] = (this[i][5] - box.x) * width / box.width + box.x; + this[i][6] = (this[i][6] - box.y) * height / box.height + box.y; + } + } else if (l === 'A') { + // resize radii + this[i][1] = this[i][1] * width / box.width; + this[i][2] = this[i][2] * height / box.height; // move position values + + this[i][6] = (this[i][6] - box.x) * width / box.width + box.x; + this[i][7] = (this[i][7] - box.y) * height / box.height + box.y; + } + } + + return this; + }, + + // Test if the passed path array use the same path data commands as this path array + equalCommands(pathArray) { + var i, il, equalCommands; + pathArray = new PathArray(pathArray); + equalCommands = this.length === pathArray.length; + + for (i = 0, il = this.length; equalCommands && i < il; i++) { + equalCommands = this[i][0] === pathArray[i][0]; + } + + return equalCommands; + }, + + // Make path array morphable + morph(pathArray) { + pathArray = new PathArray(pathArray); + + if (this.equalCommands(pathArray)) { + this.destination = pathArray; + } else { + this.destination = null; + } + + return this; + }, + + // Get morphed path array at given position + at(pos) { + // make sure a destination is defined + if (!this.destination) return this; + var sourceArray = this; + var destinationArray = this.destination.value; + var array = []; + var pathArray = new PathArray(); + var i, il, j, jl; // Animate has specified in the SVG spec + // See: https://www.w3.org/TR/SVG11/paths.html#PathElement + + for (i = 0, il = sourceArray.length; i < il; i++) { + array[i] = [sourceArray[i][0]]; + + for (j = 1, jl = sourceArray[i].length; j < jl; j++) { + array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos; + } // For the two flags of the elliptical arc command, the SVG spec say: + // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true + // Elliptical arc command as an array followed by corresponding indexes: + // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y] + // 0 1 2 3 4 5 6 7 + + + if (array[i][0] === 'A') { + array[i][4] = +(array[i][4] !== 0); + array[i][5] = +(array[i][5] !== 0); + } + } // Directly modify the value of a path array, this is done this way for performance + + + pathArray.value = array; + return pathArray; + }, + + // Absolutize and parse path to array + parse(array = [['M', 0, 0]]) { + // if it's already a patharray, no need to parse it + if (array instanceof PathArray) return array; // prepare for parsing + + var s; + var paramCnt = { + 'M': 2, + 'L': 2, + 'H': 1, + 'V': 1, + 'C': 6, + 'S': 4, + 'Q': 4, + 'T': 2, + 'A': 7, + 'Z': 0 + }; + + if (typeof array === 'string') { + array = array.replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123 + .replace(pathLetters, ' $& ') // put some room between letters and numbers + .replace(hyphen, '$1 -') // add space before hyphen + .trim() // trim + .split(delimiter); // split into array + } else { + array = array.reduce(function (prev, curr) { + return [].concat.call(prev, curr); + }, []); + } // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...] + + + var result = []; + var p = new Point(); + var p0 = new Point(); + var index = 0; + var len = array.length; + + do { + // Test if we have a path letter + if (isPathLetter.test(array[index])) { + s = array[index]; + ++index; // If last letter was a move command and we got no new, it defaults to [L]ine + } else if (s === 'M') { + s = 'L'; + } else if (s === 'm') { + s = 'l'; + } + + result.push(pathHandlers[s].call(null, array.slice(index, index = index + paramCnt[s.toUpperCase()]).map(parseFloat), p, p0)); + } while (len > index); + + return result; + }, + + // Get bounding box of path + bbox() { + parser().path.setAttribute('d', this.toString()); + return parser.nodes.path.getBBox(); + } + +}); + +class Morphable { + constructor(stepper) { + this._stepper = stepper || new Ease('-'); + this._from = null; + this._to = null; + this._type = null; + this._context = null; + this._morphObj = null; + } + + from(val) { + if (val == null) { + return this._from; + } + + this._from = this._set(val); + return this; + } + + to(val) { + if (val == null) { + return this._to; + } + + this._to = this._set(val); + return this; + } + + type(type) { + // getter + if (type == null) { + return this._type; + } // setter + + + this._type = type; + return this; + } + + _set(value) { + if (!this._type) { + var type = typeof value; + + if (type === 'number') { + this.type(SVGNumber); + } else if (type === 'string') { + if (Color.isColor(value)) { + this.type(Color); + } else if (delimiter.test(value)) { + this.type(pathLetters.test(value) ? PathArray : SVGArray); + } else if (numberAndUnit.test(value)) { + this.type(SVGNumber); } else { - for (var j = 0, jl = c.length; j < jl; ++j) { - c[j] = c[j] + (j % 2 ? p.y : p.x); - } + this.type(NonMorphable); } - return pathHandlers[i](c, p, p0); + } else if (morphableTypes.indexOf(value.constructor) > -1) { + this.type(value.constructor); + } else if (Array.isArray(value)) { + this.type(SVGArray); + } else if (type === 'object') { + this.type(ObjectBag); + } else { + this.type(NonMorphable); + } + } + + var result = new this._type(value).toArray(); + this._morphObj = this._morphObj || new this._type(); + this._context = this._context || Array.apply(null, Array(result.length)).map(Object); + return result; + } + + stepper(stepper) { + if (stepper == null) return this._stepper; + this._stepper = stepper; + return this; + } + + done() { + var complete = this._context.map(this._stepper.done).reduce(function (last, curr) { + return last && curr; + }, true); + + return complete; + } + + at(pos) { + var _this = this; + + return this._morphObj.fromArray(this._from.map(function (i, index) { + return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context); + })); + } + +} +class NonMorphable { + constructor(...args) { + this.init(...args); + } + + init(val) { + val = Array.isArray(val) ? val[0] : val; + this.value = val; + return this; + } + + valueOf() { + return this.value; + } + + toArray() { + return [this.value]; + } + +} +class TransformBag { + constructor(...args) { + this.init(...args); + } + + init(obj) { + if (Array.isArray(obj)) { + obj = { + scaleX: obj[0], + scaleY: obj[1], + shear: obj[2], + rotate: obj[3], + translateX: obj[4], + translateY: obj[5], + originX: obj[6], + originY: obj[7] }; - }(mlhvqtcsaz[i].toUpperCase()); + } + + Object.assign(this, TransformBag.defaults, obj); + return this; + } + + toArray() { + var v = this; + return [v.scaleX, v.scaleY, v.shear, v.rotate, v.translateX, v.translateY, v.originX, v.originY]; + } + +} +TransformBag.defaults = { + scaleX: 1, + scaleY: 1, + shear: 0, + rotate: 0, + translateX: 0, + translateY: 0, + originX: 0, + originY: 0 +}; +class ObjectBag { + constructor(...args) { + this.init(...args); + } + + init(objOrArr) { + this.values = []; + + if (Array.isArray(objOrArr)) { + this.values = objOrArr; + return; + } + + objOrArr = objOrArr || {}; + var entries = []; + + for (let i in objOrArr) { + entries.push([i, objOrArr[i]]); + } + + entries.sort((a, b) => { + return a[0] - b[0]; + }); + this.values = entries.reduce((last, curr) => last.concat(curr), []); + return this; } - extend(PathArray, { - // Convert array to string - toString: function toString() { - return arrayToString(this); + valueOf() { + var obj = {}; + var arr = this.values; + + for (var i = 0, len = arr.length; i < len; i += 2) { + obj[arr[i]] = arr[i + 1]; + } + + return obj; + } + + toArray() { + return this.values; + } + +} +const morphableTypes = [NonMorphable, TransformBag, ObjectBag]; +function registerMorphableType(type = []) { + morphableTypes.push(...[].concat(type)); +} +function makeMorphable() { + extend(morphableTypes, { + to(val) { + return new Morphable().type(this.constructor).from(this.valueOf()).to(val); }, - // Move path string - move: function move(x, y) { - // get bounding box of current situation - var box = this.bbox(); // get relative offset - - x -= box.x; - y -= box.y; - - if (!isNaN(x) && !isNaN(y)) { - // move every point - for (var l, i = this.length - 1; i >= 0; i--) { - l = this[i][0]; - - if (l === 'M' || l === 'L' || l === 'T') { - this[i][1] += x; - this[i][2] += y; - } else if (l === 'H') { - this[i][1] += x; - } else if (l === 'V') { - this[i][1] += y; - } else if (l === 'C' || l === 'S' || l === 'Q') { - this[i][1] += x; - this[i][2] += y; - this[i][3] += x; - this[i][4] += y; - - if (l === 'C') { - this[i][5] += x; - this[i][6] += y; - } - } else if (l === 'A') { - this[i][6] += x; - this[i][7] += y; - } - } + + fromArray(arr) { + this.init(arr); + return this; + } + + }); +} + +class Path extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('path', node), node); + } // Get array + + + array() { + return this._array || (this._array = new PathArray(this.attr('d'))); + } // Plot new path + + + plot(d) { + return d == null ? this.array() : this.clear().attr('d', typeof d === 'string' ? d : this._array = new PathArray(d)); + } // Clear array cache + + + clear() { + delete this._array; + return this; + } // Move by left top corner + + + move(x, y) { + return this.attr('d', this.array().move(x, y)); + } // Move by left top corner over x-axis + + + x(x) { + return x == null ? this.bbox().x : this.move(x, this.bbox().y); + } // Move by left top corner over y-axis + + + y(y) { + return y == null ? this.bbox().y : this.move(this.bbox().x, y); + } // Set element size to given width and height + + + size(width, height) { + var p = proportionalSize(this, width, height); + return this.attr('d', this.array().size(p.width, p.height)); + } // Set width of element + + + width(width) { + return width == null ? this.bbox().width : this.size(width, this.bbox().height); + } // Set height of element + + + height(height) { + return height == null ? this.bbox().height : this.size(this.bbox().width, height); + } + + targets() { + return baseFind('svg textpath [href*="' + this.id() + '"]'); + } + +} // Define morphable array + +Path.prototype.MorphArray = PathArray; // Add parent method + +registerMethods({ + Container: { + // Create a wrapped path element + path: wrapWithAttrCheck(function (d) { + // make sure plot is called as a setter + return this.put(new Path()).plot(d || new PathArray()); + }) + } +}); +register(Path); + +function array() { + return this._array || (this._array = new PointArray(this.attr('points'))); +} // Plot new path + +function plot(p) { + return p == null ? this.array() : this.clear().attr('points', typeof p === 'string' ? p : this._array = new PointArray(p)); +} // Clear array cache + +function clear() { + delete this._array; + return this; +} // Move by left top corner + +function move(x, y) { + return this.attr('points', this.array().move(x, y)); +} // Set element size to given width and height + +function size(width, height) { + let p = proportionalSize(this, width, height); + return this.attr('points', this.array().size(p.width, p.height)); +} + +var poly = /*#__PURE__*/Object.freeze({ + array: array, + plot: plot, + clear: clear, + move: move, + size: size +}); + +class Polygon extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('polygon', node), node); + } + +} +registerMethods({ + Container: { + // Create a wrapped polygon element + polygon: wrapWithAttrCheck(function (p) { + // make sure plot is called as a setter + return this.put(new Polygon()).plot(p || new PointArray()); + }) + } +}); +extend(Polygon, pointed); +extend(Polygon, poly); +register(Polygon); + +class Polyline extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('polyline', node), node); + } + +} +registerMethods({ + Container: { + // Create a wrapped polygon element + polyline: wrapWithAttrCheck(function (p) { + // make sure plot is called as a setter + return this.put(new Polyline()).plot(p || new PointArray()); + }) + } +}); +extend(Polyline, pointed); +extend(Polyline, poly); +register(Polyline); + +class Rect extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('rect', node), node); + } + +} +extend(Rect, { + rx, + ry +}); +registerMethods({ + Container: { + // Create a rect element + rect: wrapWithAttrCheck(function (width$$1, height$$1) { + return this.put(new Rect()).size(width$$1, height$$1); + }) + } +}); +register(Rect); + +class Queue { + constructor() { + this._first = null; + this._last = null; + } + + push(value) { + // An item stores an id and the provided value + var item = value.next ? value : { + value: value, + next: null, + prev: null // Deal with the queue being empty or populated + + }; + + if (this._last) { + item.prev = this._last; + this._last.next = item; + this._last = item; + } else { + this._last = item; + this._first = item; + } // Update the length and return the current item + + + return item; + } + + shift() { + // Check if we have a value + var remove = this._first; + if (!remove) return null; // If we do, remove it and relink things + + this._first = remove.next; + if (this._first) this._first.prev = null; + this._last = this._first ? this._last : null; + return remove.value; + } // Shows us the first item in the list + + + first() { + return this._first && this._first.value; + } // Shows us the last item in the list + + + last() { + return this._last && this._last.value; + } // Removes the item that was returned from the push + + + remove(item) { + // Relink the previous item + if (item.prev) item.prev.next = item.next; + if (item.next) item.next.prev = item.prev; + if (item === this._last) this._last = item.prev; + if (item === this._first) this._first = item.next; // Invalidate item + + item.prev = null; + item.next = null; + } + +} + +const Animator = { + nextDraw: null, + frames: new Queue(), + timeouts: new Queue(), + timer: () => globals.window.performance || globals.window.Date, + transforms: [], + + frame(fn) { + // Store the node + var node = Animator.frames.push({ + run: fn + }); // Request an animation frame if we don't have one + + if (Animator.nextDraw === null) { + Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw); + } // Return the node so we can remove it easily + + + return node; + }, + + transform_frame(fn, id) { + Animator.transforms[id] = fn; + }, + + timeout(fn, delay) { + delay = delay || 0; // Work out when the event should fire + + var time = Animator.timer().now() + delay; // Add the timeout to the end of the queue + + var node = Animator.timeouts.push({ + run: fn, + time: time + }); // Request another animation frame if we need one + + if (Animator.nextDraw === null) { + Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw); + } + + return node; + }, + + cancelFrame(node) { + node != null && Animator.frames.remove(node); + }, + + clearTimeout(node) { + node != null && Animator.timeouts.remove(node); + }, + + _draw(now) { + // Run all the timeouts we can run, if they are not ready yet, add them + // to the end of the queue immediately! (bad timeouts!!! [sarcasm]) + var nextTimeout = null; + var lastTimeout = Animator.timeouts.last(); + + while (nextTimeout = Animator.timeouts.shift()) { + // Run the timeout if its time, or push it to the end + if (now >= nextTimeout.time) { + nextTimeout.run(); + } else { + Animator.timeouts.push(nextTimeout); + } // If we hit the last item, we should stop shifting out more items + + + if (nextTimeout === lastTimeout) break; + } // Run all of the animation frames + + + var nextFrame = null; + var lastFrame = Animator.frames.last(); + + while (nextFrame !== lastFrame && (nextFrame = Animator.frames.shift())) { + nextFrame.run(); + } + + Animator.transforms.forEach(function (el) { + el(); + }); // If we have remaining timeouts or frames, draw until we don't anymore + + Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first() ? globals.window.requestAnimationFrame(Animator._draw) : null; + } + +}; + +var makeSchedule = function makeSchedule(runnerInfo) { + var start = runnerInfo.start; + var duration = runnerInfo.runner.duration(); + var end = start + duration; + return { + start: start, + duration: duration, + end: end, + runner: runnerInfo.runner + }; +}; + +const defaultSource = function defaultSource() { + let w = globals.window; + return (w.performance || w.Date).now(); +}; + +class Timeline extends EventTarget { + // Construct a new timeline on the given element + constructor(timeSource = defaultSource) { + super(); + this._timeSource = timeSource; // Store the timing variables + + this._startTime = 0; + this._speed = 1.0; // Determines how long a runner is hold in memory. Can be a dt or true/false + + this._persist = 0; // Keep track of the running animations and their starting parameters + + this._nextFrame = null; + this._paused = true; + this._runners = []; + this._order = []; + this._time = 0; + this._lastSourceTime = 0; + this._lastStepTime = 0; // Make sure that step is always called in class context + + this._step = this._step.bind(this); + } // schedules a runner on the timeline + + + schedule(runner, delay, when) { + if (runner == null) { + return this._runners.map(makeSchedule).sort(function (a, b) { + return a.runner.id - b.runner.id; + }); + } // The start time for the next animation can either be given explicitly, + // derived from the current timeline time or it can be relative to the + // last start time to chain animations direclty + + + var absoluteStartTime = 0; + var endTime = this.getEndTime(); + delay = delay || 0; // Work out when to start the animation + + if (when == null || when === 'last' || when === 'after') { + // Take the last time and increment + absoluteStartTime = endTime; + } else if (when === 'absolute' || when === 'start') { + absoluteStartTime = delay; + delay = 0; + } else if (when === 'now') { + absoluteStartTime = this._time; + } else if (when === 'relative') { + let runnerInfo = this._runners[runner.id]; + + if (runnerInfo) { + absoluteStartTime = runnerInfo.start + delay; + delay = 0; } + } else { + throw new Error('Invalid value for the "when" parameter'); + } // Manage runner - return this; - }, - // Resize path string - size: function size(width, height) { - // get bounding box of current situation - var box = this.bbox(); - var i, l; // recalculate position of all points according to new size - for (i = this.length - 1; i >= 0; i--) { - l = this[i][0]; + runner.unschedule(); + runner.timeline(this); // runner.time(-delay) + // Save runnerInfo - if (l === 'M' || l === 'L' || l === 'T') { - this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; - this[i][2] = (this[i][2] - box.y) * height / box.height + box.y; - } else if (l === 'H') { - this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; - } else if (l === 'V') { - this[i][1] = (this[i][1] - box.y) * height / box.height + box.y; - } else if (l === 'C' || l === 'S' || l === 'Q') { - this[i][1] = (this[i][1] - box.x) * width / box.width + box.x; - this[i][2] = (this[i][2] - box.y) * height / box.height + box.y; - this[i][3] = (this[i][3] - box.x) * width / box.width + box.x; - this[i][4] = (this[i][4] - box.y) * height / box.height + box.y; + this._runners[runner.id] = { + persist: this.persist(), + runner: runner, + start: absoluteStartTime + delay // Save order, update Time if needed and continue - if (l === 'C') { - this[i][5] = (this[i][5] - box.x) * width / box.width + box.x; - this[i][6] = (this[i][6] - box.y) * height / box.height + box.y; - } - } else if (l === 'A') { - // resize radii - this[i][1] = this[i][1] * width / box.width; - this[i][2] = this[i][2] * height / box.height; // move position values + }; - this[i][6] = (this[i][6] - box.x) * width / box.width + box.x; - this[i][7] = (this[i][7] - box.y) * height / box.height + box.y; - } - } + this._order.push(runner.id); - return this; - }, - // Test if the passed path array use the same path data commands as this path array - equalCommands: function equalCommands(pathArray) { - var i, il, equalCommands; - pathArray = new PathArray(pathArray); - equalCommands = this.length === pathArray.length; - - for (i = 0, il = this.length; equalCommands && i < il; i++) { - equalCommands = this[i][0] === pathArray[i][0]; - } + this.updateTime()._continue(); - return equalCommands; - }, - // Make path array morphable - morph: function morph(pathArray) { - pathArray = new PathArray(pathArray); + return this; + } // Remove the runner from this timeline - if (this.equalCommands(pathArray)) { - this.destination = pathArray; - } else { - this.destination = null; - } - return this; - }, - // Get morphed path array at given position - at: function at(pos) { - // make sure a destination is defined - if (!this.destination) return this; - var sourceArray = this; - var destinationArray = this.destination.value; - var array = []; - var pathArray = new PathArray(); - var i, il, j, jl; // Animate has specified in the SVG spec - // See: https://www.w3.org/TR/SVG11/paths.html#PathElement - - for (i = 0, il = sourceArray.length; i < il; i++) { - array[i] = [sourceArray[i][0]]; - - for (j = 1, jl = sourceArray[i].length; j < jl; j++) { - array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos; - } // For the two flags of the elliptical arc command, the SVG spec say: - // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true - // Elliptical arc command as an array followed by corresponding indexes: - // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y] - // 0 1 2 3 4 5 6 7 - - - if (array[i][0] === 'A') { - array[i][4] = +(array[i][4] !== 0); - array[i][5] = +(array[i][5] !== 0); - } - } // Directly modify the value of a path array, this is done this way for performance + unschedule(runner) { + var index = this._order.indexOf(runner.id); + if (index < 0) return this; + delete this._runners[runner.id]; - pathArray.value = array; - return pathArray; - }, - // Absolutize and parse path to array - parse: function parse() { - var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [['M', 0, 0]]; - // if it's already a patharray, no need to parse it - if (array instanceof PathArray) return array; // prepare for parsing - - var s; - var paramCnt = { - 'M': 2, - 'L': 2, - 'H': 1, - 'V': 1, - 'C': 6, - 'S': 4, - 'Q': 4, - 'T': 2, - 'A': 7, - 'Z': 0 - }; + this._order.splice(index, 1); - if (typeof array === 'string') { - array = array.replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123 - .replace(pathLetters, ' $& ') // put some room between letters and numbers - .replace(hyphen, '$1 -') // add space before hyphen - .trim() // trim - .split(delimiter); // split into array - } else { - array = array.reduce(function (prev, curr) { - return [].concat.call(prev, curr); - }, []); - } // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...] - - - var result = []; - var p = new Point(); - var p0 = new Point(); - var index = 0; - var len = array.length; - - do { - // Test if we have a path letter - if (isPathLetter.test(array[index])) { - s = array[index]; - ++index; // If last letter was a move command and we got no new, it defaults to [L]ine - } else if (s === 'M') { - s = 'L'; - } else if (s === 'm') { - s = 'l'; - } + runner.timeline(null); + return this; + } // Calculates the end of the timeline - result.push(pathHandlers[s].call(null, array.slice(index, index = index + paramCnt[s.toUpperCase()]).map(parseFloat), p, p0)); - } while (len > index); - return result; - }, - // Get bounding box of path - bbox: function bbox() { - parser().path.setAttribute('d', this.toString()); - return parser.nodes.path.getBBox(); - } - }); + getEndTime() { + var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]; + var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0; + var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0; + return lastStartTime + lastDuration; + } // Makes sure, that after pausing the time doesn't jump - var Morphable = - /*#__PURE__*/ - function () { - function Morphable(stepper) { - _classCallCheck(this, Morphable); - - this._stepper = stepper || new Ease('-'); - this._from = null; - this._to = null; - this._type = null; - this._context = null; - this._morphObj = null; + + updateTime() { + if (!this.active()) { + this._lastSourceTime = this._timeSource(); } - _createClass(Morphable, [{ - key: "from", - value: function from(val) { - if (val == null) { - return this._from; - } + return this; + } - this._from = this._set(val); - return this; - } - }, { - key: "to", - value: function to(val) { - if (val == null) { - return this._to; - } + play() { + // Now make sure we are not paused and continue the animation + this._paused = false; + return this.updateTime()._continue(); + } - this._to = this._set(val); - return this; - } - }, { - key: "type", - value: function type(_type) { - // getter - if (_type == null) { - return this._type; - } // setter + pause() { + this._paused = true; + return this._continue(); + } + stop() { + // Go to start and pause + this.time(0); + return this.pause(); + } - this._type = _type; - return this; - } - }, { - key: "_set", - value: function _set$$1(value) { - if (!this._type) { - var type = _typeof(value); - - if (type === 'number') { - this.type(SVGNumber); - } else if (type === 'string') { - if (Color.isColor(value)) { - this.type(Color); - } else if (delimiter.test(value)) { - this.type(pathLetters.test(value) ? PathArray : SVGArray); - } else if (numberAndUnit.test(value)) { - this.type(SVGNumber); - } else { - this.type(NonMorphable); - } - } else if (morphableTypes.indexOf(value.constructor) > -1) { - this.type(value.constructor); - } else if (Array.isArray(value)) { - this.type(SVGArray); - } else if (type === 'object') { - this.type(ObjectBag); - } else { - this.type(NonMorphable); - } - } + finish() { + // Go to end and pause + this.time(this.getEndTime() + 1); + return this.pause(); + } - var result = new this._type(value).toArray(); - this._morphObj = this._morphObj || new this._type(); - this._context = this._context || Array.apply(null, Array(result.length)).map(Object); - return result; - } - }, { - key: "stepper", - value: function stepper(_stepper) { - if (_stepper == null) return this._stepper; - this._stepper = _stepper; - return this; - } - }, { - key: "done", - value: function done() { - var complete = this._context.map(this._stepper.done).reduce(function (last, curr) { - return last && curr; - }, true); + speed(speed) { + if (speed == null) return this._speed; + this._speed = speed; + return this; + } - return complete; - } - }, { - key: "at", - value: function at(pos) { - var _this = this; - - return this._morphObj.fromArray(this._from.map(function (i, index) { - return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context); - })); - } - }]); + reverse(yes) { + var currentSpeed = this.speed(); + if (yes == null) return this.speed(-currentSpeed); + var positive = Math.abs(currentSpeed); + return this.speed(yes ? positive : -positive); + } - return Morphable; - }(); - var NonMorphable = - /*#__PURE__*/ - function () { - function NonMorphable() { - _classCallCheck(this, NonMorphable); + seek(dt) { + return this.time(this._time + dt); + } - this.init.apply(this, arguments); - } + time(time) { + if (time == null) return this._time; + this._time = time; + return this._continue(true); + } - _createClass(NonMorphable, [{ - key: "init", - value: function init(val) { - val = Array.isArray(val) ? val[0] : val; - this.value = val; - return this; - } - }, { - key: "valueOf", - value: function valueOf() { - return this.value; - } - }, { - key: "toArray", - value: function toArray() { - return [this.value]; - } - }]); + persist(dtOrForever) { + if (dtOrForever == null) return this._persist; + this._persist = dtOrForever; + return this; + } + + source(fn) { + if (fn == null) return this._timeSource; + this._timeSource = fn; + return this; + } + + _step(immediateStep = false) { + // Get the time delta from the last time and update the time + var time = this._timeSource(); - return NonMorphable; - }(); - var TransformBag = - /*#__PURE__*/ - function () { - function TransformBag() { - _classCallCheck(this, TransformBag); + var dtSource = time - this._lastSourceTime; + if (immediateStep) dtSource = 0; + var dtTime = this._speed * dtSource + (this._time - this._lastStepTime); + this._lastSourceTime = time; // Only update the time if we use the timeSource. + // Otherwise use the current time - this.init.apply(this, arguments); + if (!immediateStep) { + // Update the time + this._time += dtTime; + this._time = this._time < 0 ? 0 : this._time; } - _createClass(TransformBag, [{ - key: "init", - value: function init(obj) { - if (Array.isArray(obj)) { - obj = { - scaleX: obj[0], - scaleY: obj[1], - shear: obj[2], - rotate: obj[3], - translateX: obj[4], - translateY: obj[5], - originX: obj[6], - originY: obj[7] - }; - } + this._lastStepTime = this._time; + this.fire('time', this._time); // Run all of the runners directly - Object.assign(this, TransformBag.defaults, obj); - return this; - } - }, { - key: "toArray", - value: function toArray() { - var v = this; - return [v.scaleX, v.scaleY, v.shear, v.rotate, v.translateX, v.translateY, v.originX, v.originY]; - } - }]); - - return TransformBag; - }(); - TransformBag.defaults = { - scaleX: 1, - scaleY: 1, - shear: 0, - rotate: 0, - translateX: 0, - translateY: 0, - originX: 0, - originY: 0 - }; - var ObjectBag = - /*#__PURE__*/ - function () { - function ObjectBag() { - _classCallCheck(this, ObjectBag); + var runnersLeft = false; - this.init.apply(this, arguments); - } + for (var i = 0, len = this._order.length; i < len; i++) { + // Get and run the current runner and ignore it if its inactive + var runnerInfo = this._runners[this._order[i]]; + var runner = runnerInfo.runner; + let dt = dtTime; // Make sure that we give the actual difference + // between runner start time and now - _createClass(ObjectBag, [{ - key: "init", - value: function init(objOrArr) { - this.values = []; + let dtToStart = this._time - runnerInfo.start; // Dont run runner if not started yet - if (Array.isArray(objOrArr)) { - this.values = objOrArr; - return; - } + if (dtToStart <= 0) { + runnersLeft = true; // This is for the case that teh timeline was seeked so that the time + // is now before the startTime of the runner. Thats why we need to set + // the runner to position 0 - var entries = Object.entries(objOrArr || {}).sort(function (a, b) { - return a[0] - b[0]; - }); - this.values = entries.reduce(function (last, curr) { - return last.concat(curr); - }, []); - return this; + runner.reset(); + continue; + } else if (dtToStart < dt) { + // Adjust dt to make sure that animation is on point + dt = dtToStart; } - }, { - key: "valueOf", - value: function valueOf() { - var obj = {}; - var arr = this.values; - - for (var i = 0, len = arr.length; i < len; i += 2) { - obj[arr[i]] = arr[i + 1]; - } - return obj; - } - }, { - key: "toArray", - value: function toArray() { - return this.values; - } - }]); - - return ObjectBag; - }(); - var morphableTypes = [NonMorphable, TransformBag, ObjectBag]; - function registerMorphableType() { - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - morphableTypes.push.apply(morphableTypes, _toConsumableArray([].concat(type))); - } - function makeMorphable() { - extend(morphableTypes, { - to: function to(val) { - return new Morphable().type(this.constructor).from(this.valueOf()).to(val); - }, - fromArray: function fromArray(arr) { - this.init(arr); - return this; - } - }); - } + if (!runner.active()) continue; // If this runner is still going, signal that we need another animation + // frame, otherwise, remove the completed runner - var Path = - /*#__PURE__*/ - function (_Shape) { - _inherits(Path, _Shape); - - // Initialize node - function Path(node) { - _classCallCheck(this, Path); - - return _possibleConstructorReturn(this, _getPrototypeOf(Path).call(this, nodeOrNew('path', node), node)); - } // Get array - - - _createClass(Path, [{ - key: "array", - value: function array() { - return this._array || (this._array = new PathArray(this.attr('d'))); - } // Plot new path - - }, { - key: "plot", - value: function plot(d) { - return d == null ? this.array() : this.clear().attr('d', typeof d === 'string' ? d : this._array = new PathArray(d)); - } // Clear array cache - - }, { - key: "clear", - value: function clear() { - delete this._array; - return this; - } // Move by left top corner - - }, { - key: "move", - value: function move(x, y) { - return this.attr('d', this.array().move(x, y)); - } // Move by left top corner over x-axis - - }, { - key: "x", - value: function x(_x) { - return _x == null ? this.bbox().x : this.move(_x, this.bbox().y); - } // Move by left top corner over y-axis - - }, { - key: "y", - value: function y(_y) { - return _y == null ? this.bbox().y : this.move(this.bbox().x, _y); - } // Set element size to given width and height - - }, { - key: "size", - value: function size(width, height) { - var p = proportionalSize(this, width, height); - return this.attr('d', this.array().size(p.width, p.height)); - } // Set width of element - - }, { - key: "width", - value: function width(_width) { - return _width == null ? this.bbox().width : this.size(_width, this.bbox().height); - } // Set height of element - - }, { - key: "height", - value: function height(_height) { - return _height == null ? this.bbox().height : this.size(this.bbox().width, _height); - } - }, { - key: "targets", - value: function targets() { - return baseFind('svg textpath [href*="' + this.id() + '"]'); + var finished = runner.step(dt).done; + + if (!finished) { + runnersLeft = true; // continue + } else if (runnerInfo.persist !== true) { + // runner is finished. And runner might get removed + var endTime = runner.duration() - runner.time() + this._time; + + if (endTime + this._persist < this._time) { + // Delete runner and correct index + delete this._runners[this._order[i]]; + this._order.splice(i--, 1) && --len; + runner.timeline(null); + } } - }]); - - return Path; - }(Shape); // Define morphable array - Path.prototype.MorphArray = PathArray; // Add parent method - - registerMethods({ - Container: { - // Create a wrapped path element - path: wrapWithAttrCheck(function (d) { - // make sure plot is called as a setter - return this.put(new Path()).plot(d || new PathArray()); - }) - } - }); - register(Path); + } // Basically: we continue when there are runners right from us in time + // when -->, and when runners are left from us when <-- - function array() { - return this._array || (this._array = new PointArray(this.attr('points'))); - } // Plot new path - function plot(p) { - return p == null ? this.array() : this.clear().attr('points', typeof p === 'string' ? p : this._array = new PointArray(p)); - } // Clear array cache + if (runnersLeft && !(this._speed < 0 && this._time === 0) || this._order.length && this._speed < 0 && this._time > 0) { + this._continue(); + } else { + this.fire('finished'); + this.pause(); + } - function clear() { - delete this._array; return this; - } // Move by left top corner + } // Checks if we are running and continues the animation - function move(x, y) { - return this.attr('points', this.array().move(x, y)); - } // Set element size to given width and height - function size(width, height) { - var p = proportionalSize(this, width, height); - return this.attr('points', this.array().size(p.width, p.height)); + _continue(immediateStep = false) { + Animator.cancelFrame(this._nextFrame); + this._nextFrame = null; + if (immediateStep) return this._step(true); + if (this._paused) return this; + this._nextFrame = Animator.frame(this._step); + return this; } - var poly = /*#__PURE__*/Object.freeze({ - array: array, - plot: plot, - clear: clear, - move: move, - size: size - }); + active() { + return !!this._nextFrame; + } - var Polygon = - /*#__PURE__*/ - function (_Shape) { - _inherits(Polygon, _Shape); +} +registerMethods({ + Element: { + timeline: function timeline() { + this._timeline = this._timeline || new Timeline(); + return this._timeline; + } + } +}); - // Initialize node - function Polygon(node) { - _classCallCheck(this, Polygon); +class Runner extends EventTarget { + constructor(options) { + super(); // Store a unique id on the runner, so that we can identify it later - return _possibleConstructorReturn(this, _getPrototypeOf(Polygon).call(this, nodeOrNew('polygon', node), node)); - } + this.id = Runner.id++; // Ensure a default value - return Polygon; - }(Shape); - registerMethods({ - Container: { - // Create a wrapped polygon element - polygon: wrapWithAttrCheck(function (p) { - // make sure plot is called as a setter - return this.put(new Polygon()).plot(p || new PointArray()); - }) - } - }); - extend(Polygon, pointed); - extend(Polygon, poly); - register(Polygon); + options = options == null ? timeline.duration : options; // Ensure that we get a controller - var Polyline = - /*#__PURE__*/ - function (_Shape) { - _inherits(Polyline, _Shape); + options = typeof options === 'function' ? new Controller(options) : options; // Declare all of the variables - // Initialize node - function Polyline(node) { - _classCallCheck(this, Polyline); + this._element = null; + this._timeline = null; + this.done = false; + this._queue = []; // Work out the stepper and the duration - return _possibleConstructorReturn(this, _getPrototypeOf(Polyline).call(this, nodeOrNew('polyline', node), node)); - } + this._duration = typeof options === 'number' && options; + this._isDeclarative = options instanceof Controller; + this._stepper = this._isDeclarative ? options : new Ease(); // We copy the current values from the timeline because they can change - return Polyline; - }(Shape); - registerMethods({ - Container: { - // Create a wrapped polygon element - polyline: wrapWithAttrCheck(function (p) { - // make sure plot is called as a setter - return this.put(new Polyline()).plot(p || new PointArray()); - }) - } - }); - extend(Polyline, pointed); - extend(Polyline, poly); - register(Polyline); + this._history = {}; // Store the state of the runner - var Rect = - /*#__PURE__*/ - function (_Shape) { - _inherits(Rect, _Shape); + this.enabled = true; + this._time = 0; + this._lastTime = 0; // At creation, the runner is in reseted state - // Initialize node - function Rect(node) { - _classCallCheck(this, Rect); + this._reseted = true; // Save transforms applied to this runner - return _possibleConstructorReturn(this, _getPrototypeOf(Rect).call(this, nodeOrNew('rect', node), node)); - } + this.transforms = new Matrix(); + this.transformId = 1; // Looping variables - return Rect; - }(Shape); - extend(Rect, { - rx: rx, - ry: ry - }); - registerMethods({ - Container: { - // Create a rect element - rect: wrapWithAttrCheck(function (width$$1, height$$1) { - return this.put(new Rect()).size(width$$1, height$$1); - }) - } - }); - register(Rect); + this._haveReversed = false; + this._reverse = false; + this._loopsDone = 0; + this._swing = false; + this._wait = 0; + this._times = 1; + } + /* + Runner Definitions + ================== + These methods help us define the runtime behaviour of the Runner or they + help us make new runners from the current runner + */ - var Queue = - /*#__PURE__*/ - function () { - function Queue() { - _classCallCheck(this, Queue); - this._first = null; - this._last = null; - } + element(element) { + if (element == null) return this._element; + this._element = element; - _createClass(Queue, [{ - key: "push", - value: function push(value) { - // An item stores an id and the provided value - var item = value.next ? value : { - value: value, - next: null, - prev: null // Deal with the queue being empty or populated - - }; - - if (this._last) { - item.prev = this._last; - this._last.next = item; - this._last = item; - } else { - this._last = item; - this._first = item; - } // Update the length and return the current item + element._prepareRunner(); + return this; + } - return item; - } - }, { - key: "shift", - value: function shift() { - // Check if we have a value - var remove = this._first; - if (!remove) return null; // If we do, remove it and relink things - - this._first = remove.next; - if (this._first) this._first.prev = null; - this._last = this._first ? this._last : null; - return remove.value; - } // Shows us the first item in the list - - }, { - key: "first", - value: function first() { - return this._first && this._first.value; - } // Shows us the last item in the list - - }, { - key: "last", - value: function last() { - return this._last && this._last.value; - } // Removes the item that was returned from the push - - }, { - key: "remove", - value: function remove(item) { - // Relink the previous item - if (item.prev) item.prev.next = item.next; - if (item.next) item.next.prev = item.prev; - if (item === this._last) this._last = item.prev; - if (item === this._first) this._first = item.next; // Invalidate item - - item.prev = null; - item.next = null; - } - }]); + timeline(timeline$$1) { + // check explicitly for undefined so we can set the timeline to null + if (typeof timeline$$1 === 'undefined') return this._timeline; + this._timeline = timeline$$1; + return this; + } - return Queue; - }(); + animate(duration, delay, when) { + var o = Runner.sanitise(duration, delay, when); + var runner = new Runner(o.duration); + if (this._timeline) runner.timeline(this._timeline); + if (this._element) runner.element(this._element); + return runner.loop(o).schedule(delay, when); + } - var Animator = { - nextDraw: null, - frames: new Queue(), - timeouts: new Queue(), - timer: function timer() { - return globals.window.performance || globals.window.Date; - }, - transforms: [], - frame: function frame(fn) { - // Store the node - var node = Animator.frames.push({ - run: fn - }); // Request an animation frame if we don't have one + schedule(timeline$$1, delay, when) { + // The user doesn't need to pass a timeline if we already have one + if (!(timeline$$1 instanceof Timeline)) { + when = delay; + delay = timeline$$1; + timeline$$1 = this.timeline(); + } // If there is no timeline, yell at the user... - if (Animator.nextDraw === null) { - Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw); - } // Return the node so we can remove it easily + if (!timeline$$1) { + throw Error('Runner cannot be scheduled without timeline'); + } // Schedule the runner on the timeline provided - return node; - }, - transform_frame: function transform_frame(fn, id) { - Animator.transforms[id] = fn; - }, - timeout: function timeout(fn, delay) { - delay = delay || 0; // Work out when the event should fire - var time = Animator.timer().now() + delay; // Add the timeout to the end of the queue + timeline$$1.schedule(this, delay, when); + return this; + } - var node = Animator.timeouts.push({ - run: fn, - time: time - }); // Request another animation frame if we need one + unschedule() { + var timeline$$1 = this.timeline(); + timeline$$1 && timeline$$1.unschedule(this); + return this; + } - if (Animator.nextDraw === null) { - Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw); - } + loop(times, swing, wait) { + // Deal with the user passing in an object + if (typeof times === 'object') { + swing = times.swing; + wait = times.wait; + times = times.times; + } // Sanitise the values and store them - return node; - }, - cancelFrame: function cancelFrame(node) { - Animator.frames.remove(node); - }, - clearTimeout: function clearTimeout(node) { - Animator.timeouts.remove(node); - }, - _draw: function _draw(now) { - // Run all the timeouts we can run, if they are not ready yet, add them - // to the end of the queue immediately! (bad timeouts!!! [sarcasm]) - var nextTimeout = null; - var lastTimeout = Animator.timeouts.last(); - - while (nextTimeout = Animator.timeouts.shift()) { - // Run the timeout if its time, or push it to the end - if (now >= nextTimeout.time) { - nextTimeout.run(); - } else { - Animator.timeouts.push(nextTimeout); - } // If we hit the last item, we should stop shifting out more items + this._times = times || Infinity; + this._swing = swing || false; + this._wait = wait || 0; + return this; + } - if (nextTimeout === lastTimeout) break; - } // Run all of the animation frames + delay(delay) { + return this.animate(0, delay); + } + /* + Basic Functionality + =================== + These methods allow us to attach basic functions to the runner directly + */ + + + queue(initFn, runFn, retargetFn, isTransform) { + this._queue.push({ + initialiser: initFn || noop, + runner: runFn || noop, + retarget: retargetFn, + isTransform: isTransform, + initialised: false, + finished: false + }); + var timeline$$1 = this.timeline(); + timeline$$1 && this.timeline()._continue(); + return this; + } - var nextFrame = null; - var lastFrame = Animator.frames.last(); + during(fn) { + return this.queue(null, fn); + } - while (nextFrame !== lastFrame && (nextFrame = Animator.frames.shift())) { - nextFrame.run(); - } + after(fn) { + return this.on('finish', fn); + } + /* + Runner animation methods + ======================== + Control how the animation plays + */ - Animator.transforms.forEach(function (el) { - el(); - }); // If we have remaining timeouts or frames, draw until we don't anymore - Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first() ? globals.window.requestAnimationFrame(Animator._draw) : null; + time(time) { + if (time == null) { + return this._time; } - }; - var makeSchedule = function makeSchedule(runnerInfo) { - var start = runnerInfo.start; - var duration = runnerInfo.runner.duration(); - var end = start + duration; - return { - start: start, - duration: duration, - end: end, - runner: runnerInfo.runner - }; - }; + let dt = time - this._time; + this.step(dt); + return this; + } - var Timeline = - /*#__PURE__*/ - function (_EventTarget) { - _inherits(Timeline, _EventTarget); + duration() { + return this._times * (this._wait + this._duration) - this._wait; + } - // Construct a new timeline on the given element - function Timeline() { - var _this; + loops(p) { + var loopDuration = this._duration + this._wait; - _classCallCheck(this, Timeline); + if (p == null) { + var loopsDone = Math.floor(this._time / loopDuration); + var relativeTime = this._time - loopsDone * loopDuration; + var position = relativeTime / this._duration; + return Math.min(loopsDone + position, this._times); + } - _this = _possibleConstructorReturn(this, _getPrototypeOf(Timeline).call(this)); + var whole = Math.floor(p); + var partial = p % 1; + var time = loopDuration * whole + this._duration * partial; + return this.time(time); + } - _this._timeSource = function () { - var w = globals.window; - return (w.performance || w.Date).now(); - }; // Store the timing variables + position(p) { + // Get all of the variables we need + var x$$1 = this._time; + var d = this._duration; + var w = this._wait; + var t = this._times; + var s = this._swing; + var r = this._reverse; + var position; + + if (p == null) { + /* + This function converts a time to a position in the range [0, 1] + The full explanation can be found in this desmos demonstration + https://www.desmos.com/calculator/u4fbavgche + The logic is slightly simplified here because we can use booleans + */ + // Figure out the value without thinking about the start or end time + const f = function f(x$$1) { + var swinging = s * Math.floor(x$$1 % (2 * (w + d)) / (w + d)); + var backwards = swinging && !r || !swinging && r; + var uncliped = Math.pow(-1, backwards) * (x$$1 % (w + d)) / d + backwards; + var clipped = Math.max(Math.min(uncliped, 1), 0); + return clipped; + }; // Figure out the value by incorporating the start time + + + var endTime = t * (w + d) - w; + position = x$$1 <= 0 ? Math.round(f(1e-5)) : x$$1 < endTime ? f(x$$1) : Math.round(f(endTime - 1e-5)); + return position; + } // Work out the loops done and add the position to the loops done + + + var loopsDone = Math.floor(this.loops()); + var swingForward = s && loopsDone % 2 === 0; + var forwards = swingForward && !r || r && swingForward; + position = loopsDone + (forwards ? p : 1 - p); + return this.loops(position); + } + progress(p) { + if (p == null) { + return Math.min(1, this._time / this.duration()); + } - _this._startTime = 0; - _this._speed = 1.0; // Play control variables control how the animation proceeds + return this.time(p * this.duration()); + } - _this._reverse = false; - _this._persist = 0; // Keep track of the running animations and their starting parameters + step(dt) { + // If we are inactive, this stepper just gets skipped + if (!this.enabled) return this; // Update the time and get the new position - _this._nextFrame = null; - _this._paused = false; - _this._runners = []; - _this._order = []; - _this._time = 0; - _this._lastSourceTime = 0; - _this._lastStepTime = 0; - return _this; - } - /** - * - */ - // schedules a runner on the timeline - - - _createClass(Timeline, [{ - key: "schedule", - value: function schedule(runner, delay, when) { - // FIXME: how to sort? maybe by runner id? - if (runner == null) { - return this._runners.map(makeSchedule).sort(function (a, b) { - return a.start - b.start || a.duration - b.duration; - }); - } + dt = dt == null ? 16 : dt; + this._time += dt; + var position = this.position(); // Figure out if we need to run the stepper in this frame - if (!this.active()) { - this._step(); + var running = this._lastPosition !== position && this._time >= 0; + this._lastPosition = position; // Figure out if we just started - if (when == null) { - when = 'now'; - } - } // The start time for the next animation can either be given explicitly, - // derived from the current timeline time or it can be relative to the - // last start time to chain animations direclty - - - var absoluteStartTime = 0; - delay = delay || 0; // Work out when to start the animation - - if (when == null || when === 'last' || when === 'after') { - // Take the last time and increment - absoluteStartTime = this._startTime; - } else if (when === 'absolute' || when === 'start') { - absoluteStartTime = delay; - delay = 0; - } else if (when === 'now') { - absoluteStartTime = this._time; - } else if (when === 'relative') { - var runnerInfo = this._runners[runner.id]; - - if (runnerInfo) { - absoluteStartTime = runnerInfo.start + delay; - delay = 0; - } - } else { - throw new Error('Invalid value for the "when" parameter'); - } // Manage runner + var duration = this.duration(); + var justStarted = this._lastTime <= 0 && this._time > 0; + var justFinished = this._lastTime < this._time && this.time > duration; + this._lastTime = this._time; + if (justStarted) { + this.fire('start', this); + } // Work out if the runner is finished set the done flag here so animations + // know, that they are running in the last step (this is good for + // transformations which can be merged) - runner.unschedule(); - runner.timeline(this); - runner.time(-delay); // Save startTime for next runner - this._startTime = absoluteStartTime + runner.duration() + delay; // Save runnerInfo + var declarative = this._isDeclarative; + this.done = !declarative && !justFinished && this._time >= duration; // Runner is running. So its not in reseted state anymore - this._runners[runner.id] = { - persist: this.persist(), - runner: runner, - start: absoluteStartTime // Save order and continue + this._reseted = false; // Call initialise and the run function - }; + if (running || declarative) { + this._initialise(running); // clear the transforms on this runner so they dont get added again and again - this._order.push(runner.id); - this._continue(); + this.transforms = new Matrix(); - return this; - } // Remove the runner from this timeline + var converged = this._run(declarative ? dt : position); - }, { - key: "unschedule", - value: function unschedule(runner) { - var index = this._order.indexOf(runner.id); + this.fire('step', this); + } // correct the done flag here + // declaritive animations itself know when they converged - if (index < 0) return this; - delete this._runners[runner.id]; - this._order.splice(index, 1); + this.done = this.done || converged && declarative; - runner.timeline(null); - return this; - } - }, { - key: "play", - value: function play() { - // Now make sure we are not paused and continue the animation - this._paused = false; - return this._continue(); - } - }, { - key: "pause", - value: function pause() { - // Cancel the next animation frame and pause - this._nextFrame = null; - this._paused = true; - return this; - } - }, { - key: "stop", - value: function stop() { - // Cancel the next animation frame and go to start - this.seek(-this._time); - return this.pause(); - } - }, { - key: "finish", - value: function finish() { - this.seek(Infinity); - return this.pause(); - } - }, { - key: "speed", - value: function speed(_speed) { - if (_speed == null) return this._speed; - this._speed = _speed; - return this; - } - }, { - key: "reverse", - value: function reverse(yes) { - var currentSpeed = this.speed(); - if (yes == null) return this.speed(-currentSpeed); - var positive = Math.abs(currentSpeed); - return this.speed(yes ? positive : -positive); - } - }, { - key: "seek", - value: function seek(dt) { - this._time += dt; - return this._continue(); - } - }, { - key: "time", - value: function time(_time) { - if (_time == null) return this._time; - this._time = _time; - return this; - } - }, { - key: "persist", - value: function persist(dtOrForever) { - if (dtOrForever == null) return this._persist; - this._persist = dtOrForever; - return this; - } - }, { - key: "source", - value: function source(fn) { - if (fn == null) return this._timeSource; - this._timeSource = fn; - return this; - } - }, { - key: "_step", - value: function _step() { - // If the timeline is paused, just do nothing - if (this._paused) return; // Get the time delta from the last time and update the time - - var time = this._timeSource(); - - var dtSource = time - this._lastSourceTime; - var dtTime = this._speed * dtSource + (this._time - this._lastStepTime); - this._lastSourceTime = time; // Update the time - - this._time += dtTime; - this._lastStepTime = this._time; // this.fire('time', this._time) - // Run all of the runners directly - - var runnersLeft = false; - - for (var i = 0, len = this._order.length; i < len; i++) { - // Get and run the current runner and ignore it if its inactive - var runnerInfo = this._runners[this._order[i]]; - var runner = runnerInfo.runner; - var dt = dtTime; // Make sure that we give the actual difference - // between runner start time and now - - var dtToStart = this._time - runnerInfo.start; // Dont run runner if not started yet - - if (dtToStart < 0) { - runnersLeft = true; - continue; - } else if (dtToStart < dt) { - // Adjust dt to make sure that animation is on point - dt = dtToStart; - } + if (this.done) { + this.fire('finish', this); + } - if (!runner.active()) continue; // If this runner is still going, signal that we need another animation - // frame, otherwise, remove the completed runner + return this; + } - var finished = runner.step(dt).done; + reset() { + if (this._reseted) return this; + this.loops(0); + this._reseted = true; + return this; + } - if (!finished) { - runnersLeft = true; // continue - } else if (runnerInfo.persist !== true) { - // runner is finished. And runner might get removed - var endTime = runner.duration() - runner.time() + this._time; + finish() { + return this.step(Infinity); + } - if (endTime + this._persist < this._time) { - // Delete runner and correct index - delete this._runners[this._order[i]]; - this._order.splice(i--, 1) && --len; - runner.timeline(null); - } - } - } // Get the next animation frame to keep the simulation going + reverse(reverse) { + this._reverse = reverse == null ? !this._reverse : reverse; + return this; + } + ease(fn) { + this._stepper = new Ease(fn); + return this; + } - if (runnersLeft) { - this._nextFrame = Animator.frame(this._step.bind(this)); - } else { - this._nextFrame = null; - } + active(enabled) { + if (enabled == null) return this.enabled; + this.enabled = enabled; + return this; + } + /* + Private Methods + =============== + Methods that shouldn't be used externally + */ + // Save a morpher to the morpher list so that we can retarget it later + + + _rememberMorpher(method, morpher) { + this._history[method] = { + morpher: morpher, + caller: this._queue[this._queue.length - 1] + }; + } // Try to set the target for a morpher if the morpher exists, otherwise + // do nothing and return false - return this; - } // Checks if we are running and continues the animation - }, { - key: "_continue", - value: function _continue() { - if (this._paused) return this; + _tryRetarget(method, target) { + if (this._history[method]) { + // if the last method wasnt even initialised, throw it away + if (!this._history[method].caller.initialised) { + let index = this._queue.indexOf(this._history[method].caller); - if (!this._nextFrame) { - this._nextFrame = Animator.frame(this._step.bind(this)); - } + this._queue.splice(index, 1); - return this; - } - }, { - key: "active", - value: function active() { - return !!this._nextFrame; - } - }]); - - return Timeline; - }(EventTarget); - registerMethods({ - Element: { - timeline: function timeline() { - this._timeline = this._timeline || new Timeline(); - return this._timeline; + return false; + } // for the case of transformations, we use the special retarget function + // which has access to the outer scope + + + if (this._history[method].caller.retarget) { + this._history[method].caller.retarget(target); // for everything else a simple morpher change is sufficient + + } else { + this._history[method].morpher.to(target); } + + this._history[method].caller.finished = false; + var timeline$$1 = this.timeline(); + timeline$$1 && timeline$$1._continue(); + return true; } - }); - var Runner = - /*#__PURE__*/ - function (_EventTarget) { - _inherits(Runner, _EventTarget); + return false; + } // Run each initialise function in the runner if required - function Runner(options) { - var _this; - _classCallCheck(this, Runner); + _initialise(running) { + // If we aren't running, we shouldn't initialise when not declarative + if (!running && !this._isDeclarative) return; // Loop through all of the initialisers - _this = _possibleConstructorReturn(this, _getPrototypeOf(Runner).call(this)); // Store a unique id on the runner, so that we can identify it later + for (var i = 0, len = this._queue.length; i < len; ++i) { + // Get the current initialiser + var current = this._queue[i]; // Determine whether we need to initialise - _this.id = Runner.id++; // Ensure a default value + var needsIt = this._isDeclarative || !current.initialised && running; + running = !current.finished; // Call the initialiser if we need to - options = options == null ? timeline.duration : options; // Ensure that we get a controller + if (needsIt && running) { + current.initialiser.call(this); + current.initialised = true; + } + } + } // Run each run function for the position or dt given - options = typeof options === 'function' ? new Controller(options) : options; // Declare all of the variables - _this._element = null; - _this._timeline = null; - _this.done = false; - _this._queue = []; // Work out the stepper and the duration + _run(positionOrDt) { + // Run all of the _queue directly + var allfinished = true; - _this._duration = typeof options === 'number' && options; - _this._isDeclarative = options instanceof Controller; - _this._stepper = _this._isDeclarative ? options : new Ease(); // We copy the current values from the timeline because they can change + for (var i = 0, len = this._queue.length; i < len; ++i) { + // Get the current function to run + var current = this._queue[i]; // Run the function if its not finished, we keep track of the finished + // flag for the sake of declarative _queue - _this._history = {}; // Store the state of the runner + var converged = current.runner.call(this, positionOrDt); + current.finished = current.finished || converged === true; + allfinished = allfinished && current.finished; + } // We report when all of the constructors are finished - _this.enabled = true; - _this._time = 0; - _this._last = 0; // Save transforms applied to this runner - _this.transforms = new Matrix(); - _this.transformId = 1; // Looping variables + return allfinished; + } - _this._haveReversed = false; - _this._reverse = false; - _this._loopsDone = 0; - _this._swing = false; - _this._wait = 0; - _this._times = 1; - return _this; - } - /* - Runner Definitions - ================== - These methods help us define the runtime behaviour of the Runner or they - help us make new runners from the current runner - */ + addTransform(transform, index) { + this.transforms.lmultiplyO(transform); + return this; + } + clearTransform() { + this.transforms = new Matrix(); + return this; + } // TODO: Keep track of all transformations so that deletion is faster - _createClass(Runner, [{ - key: "element", - value: function element(_element) { - if (_element == null) return this._element; - this._element = _element; - _element._prepareRunner(); + clearTransformsFromQueue() { + if (!this.done) { + this._queue = this._queue.filter(item => { + return !item.isTransform; + }); + } + } - return this; - } - }, { - key: "timeline", - value: function timeline$$1(_timeline) { - // check explicitly for undefined so we can set the timeline to null - if (typeof _timeline === 'undefined') return this._timeline; - this._timeline = _timeline; - return this; - } - }, { - key: "animate", - value: function animate(duration, delay, when) { - var o = Runner.sanitise(duration, delay, when); - var runner = new Runner(o.duration); - if (this._timeline) runner.timeline(this._timeline); - if (this._element) runner.element(this._element); - return runner.loop(o).schedule(delay, when); - } - }, { - key: "schedule", - value: function schedule(timeline$$1, delay, when) { - // The user doesn't need to pass a timeline if we already have one - if (!(timeline$$1 instanceof Timeline)) { - when = delay; - delay = timeline$$1; - timeline$$1 = this.timeline(); - } // If there is no timeline, yell at the user... + static sanitise(duration, delay, when) { + // Initialise the default parameters + var times = 1; + var swing = false; + var wait = 0; + duration = duration || timeline.duration; + delay = delay || timeline.delay; + when = when || 'last'; // If we have an object, unpack the values + + if (typeof duration === 'object' && !(duration instanceof Stepper)) { + delay = duration.delay || delay; + when = duration.when || when; + swing = duration.swing || swing; + times = duration.times || times; + wait = duration.wait || wait; + duration = duration.duration || timeline.duration; + } + return { + duration: duration, + delay: delay, + swing: swing, + times: times, + wait: wait, + when: when + }; + } - if (!timeline$$1) { - throw Error('Runner cannot be scheduled without timeline'); - } // Schedule the runner on the timeline provided +} +Runner.id = 0; +class FakeRunner { + constructor(transforms = new Matrix(), id = -1, done = true) { + this.transforms = transforms; + this.id = id; + this.done = done; + } - timeline$$1.schedule(this, delay, when); - return this; - } - }, { - key: "unschedule", - value: function unschedule() { - var timeline$$1 = this.timeline(); - timeline$$1 && timeline$$1.unschedule(this); - return this; - } - }, { - key: "loop", - value: function loop(times, swing, wait) { - // Deal with the user passing in an object - if (_typeof(times) === 'object') { - swing = times.swing; - wait = times.wait; - times = times.times; - } // Sanitise the values and store them - - - this._times = times || Infinity; - this._swing = swing || false; - this._wait = wait || 0; - return this; - } - }, { - key: "delay", - value: function delay(_delay) { - return this.animate(0, _delay); - } - /* - Basic Functionality - =================== - These methods allow us to attach basic functions to the runner directly - */ + clearTransformsFromQueue() {} - }, { - key: "queue", - value: function queue(initFn, runFn, retargetFn, isTransform) { - this._queue.push({ - initialiser: initFn || noop, - runner: runFn || noop, - retarget: retargetFn, - isTransform: isTransform, - initialised: false, - finished: false - }); - - var timeline$$1 = this.timeline(); - timeline$$1 && this.timeline()._continue(); - return this; - } - }, { - key: "during", - value: function during(fn) { - return this.queue(null, fn); - } - }, { - key: "after", - value: function after(fn) { - return this.on('finish', fn); - } - /* - Runner animation methods - ======================== - Control how the animation plays - */ +} - }, { - key: "time", - value: function time(_time) { - if (_time == null) { - return this._time; - } +extend([Runner, FakeRunner], { + mergeWith(runner) { + return new FakeRunner(runner.transforms.lmultiply(this.transforms), runner.id); + } - var dt = _time - this._time; - this.step(dt); - return this; - } - }, { - key: "duration", - value: function duration() { - return this._times * (this._wait + this._duration) - this._wait; - } - }, { - key: "loops", - value: function loops(p) { - var loopDuration = this._duration + this._wait; - - if (p == null) { - var loopsDone = Math.floor(this._time / loopDuration); - var relativeTime = this._time - loopsDone * loopDuration; - var position = relativeTime / this._duration; - return Math.min(loopsDone + position, this._times); - } +}); // FakeRunner.emptyRunner = new FakeRunner() - var whole = Math.floor(p); - var partial = p % 1; - var time = loopDuration * whole + this._duration * partial; - return this.time(time); - } - }, { - key: "position", - value: function position(p) { - // Get all of the variables we need - var x$$1 = this._time; - var d = this._duration; - var w = this._wait; - var t = this._times; - var s = this._swing; - var r = this._reverse; - var position; - - if (p == null) { - /* - This function converts a time to a position in the range [0, 1] - The full explanation can be found in this desmos demonstration - https://www.desmos.com/calculator/u4fbavgche - The logic is slightly simplified here because we can use booleans - */ - // Figure out the value without thinking about the start or end time - var f = function f(x$$1) { - var swinging = s * Math.floor(x$$1 % (2 * (w + d)) / (w + d)); - var backwards = swinging && !r || !swinging && r; - var uncliped = Math.pow(-1, backwards) * (x$$1 % (w + d)) / d + backwards; - var clipped = Math.max(Math.min(uncliped, 1), 0); - return clipped; - }; // Figure out the value by incorporating the start time - - - var endTime = t * (w + d) - w; - position = x$$1 <= 0 ? Math.round(f(1e-5)) : x$$1 < endTime ? f(x$$1) : Math.round(f(endTime - 1e-5)); - return position; - } // Work out the loops done and add the position to the loops done - - - var loopsDone = Math.floor(this.loops()); - var swingForward = s && loopsDone % 2 === 0; - var forwards = swingForward && !r || r && swingForward; - position = loopsDone + (forwards ? p : 1 - p); - return this.loops(position); - } - }, { - key: "progress", - value: function progress(p) { - if (p == null) { - return Math.min(1, this._time / this.duration()); - } +const lmultiply = (last, curr) => last.lmultiplyO(curr); - return this.time(p * this.duration()); - } - }, { - key: "step", - value: function step(dt) { - // If we are inactive, this stepper just gets skipped - if (!this.enabled) return this; // Update the time and get the new position +const getRunnerTransform = runner => runner.transforms; + +function mergeTransforms() { + // Find the matrix to apply to the element and apply it + let runners = this._transformationRunners.runners; + let netTransform = runners.map(getRunnerTransform).reduce(lmultiply, new Matrix()); + this.transform(netTransform); - dt = dt == null ? 16 : dt; - this._time += dt; - var position = this.position(); // Figure out if we need to run the stepper in this frame + this._transformationRunners.merge(); - var running = this._lastPosition !== position && this._time >= 0; - this._lastPosition = position; // Figure out if we just started + if (this._transformationRunners.length() === 1) { + this._frameId = null; + } +} - var duration = this.duration(); - var justStarted = this._lastTime < 0 && this._time > 0; - var justFinished = this._lastTime < this._time && this.time > duration; - this._lastTime = this._time; +class RunnerArray { + constructor() { + this.runners = []; + this.ids = []; + } - if (justStarted) { - this.fire('start', this); - } // Work out if the runner is finished set the done flag here so animations - // know, that they are running in the last step (this is good for - // transformations which can be merged) + add(runner) { + if (this.runners.includes(runner)) return; + let id = runner.id + 1; + let leftSibling = this.ids.reduce((last, curr) => { + if (curr > last && curr < id) return curr; + return last; + }, 0); + let index = this.ids.indexOf(leftSibling) + 1; + this.ids.splice(index, 0, id); + this.runners.splice(index, 0, runner); + return this; + } + getByID(id) { + return this.runners[this.ids.indexOf(id + 1)]; + } - var declarative = this._isDeclarative; - this.done = !declarative && !justFinished && this._time >= duration; // Call initialise and the run function + remove(id) { + let index = this.ids.indexOf(id + 1); + this.ids.splice(index, 1); + this.runners.splice(index, 1); + return this; + } - if (running || declarative) { - this._initialise(running); // clear the transforms on this runner so they dont get added again and again + merge() { + let lastRunner = null; + this.runners.forEach((runner, i) => { + if (lastRunner && runner.done && lastRunner.done) { + this.remove(runner.id); + this.edit(lastRunner.id, runner.mergeWith(lastRunner)); + } + lastRunner = runner; + }); + return this; + } - this.transforms = new Matrix(); + edit(id, newRunner) { + let index = this.ids.indexOf(id + 1); + this.ids.splice(index, 1, id); + this.runners.splice(index, 1, newRunner); + return this; + } - var converged = this._run(declarative ? dt : position); + length() { + return this.ids.length; + } - this.fire('step', this); - } // correct the done flag here - // declaritive animations itself know when they converged + clearBefore(id) { + let deleteCnt = this.ids.indexOf(id + 1) || 1; + this.ids.splice(0, deleteCnt, 0); + this.runners.splice(0, deleteCnt, new FakeRunner()).forEach(r => r.clearTransformsFromQueue()); + return this; + } +} - this.done = this.done || converged && declarative; +let frameId = 0; +registerMethods({ + Element: { + animate(duration, delay, when) { + var o = Runner.sanitise(duration, delay, when); + var timeline$$1 = this.timeline(); + return new Runner(o.duration).loop(o).element(this).timeline(timeline$$1.play()).schedule(delay, when); + }, - if (this.done) { - this.fire('finish', this); - } + delay(by, when) { + return this.animate(0, by, when); + }, - return this; - } - }, { - key: "finish", - value: function finish() { - return this.step(Infinity); - } - }, { - key: "reverse", - value: function reverse(_reverse) { - this._reverse = _reverse == null ? !this._reverse : _reverse; - return this; - } - }, { - key: "ease", - value: function ease(fn) { - this._stepper = new Ease(fn); - return this; - } - }, { - key: "active", - value: function active(enabled) { - if (enabled == null) return this.enabled; - this.enabled = enabled; - return this; - } - /* - Private Methods - =============== - Methods that shouldn't be used externally - */ - // Save a morpher to the morpher list so that we can retarget it later + // this function searches for all runners on the element and deletes the ones + // which run before the current one. This is because absolute transformations + // overwfrite anything anyway so there is no need to waste time computing + // other runners + _clearTransformRunnersBefore(currentRunner) { + this._transformationRunners.clearBefore(currentRunner.id); + }, - }, { - key: "_rememberMorpher", - value: function _rememberMorpher(method, morpher) { - this._history[method] = { - morpher: morpher, - caller: this._queue[this._queue.length - 1] - }; - } // Try to set the target for a morpher if the morpher exists, otherwise - // do nothing and return false + _currentTransform(current) { + return this._transformationRunners.runners // we need the equal sign here to make sure, that also transformations + // on the same runner which execute before the current transformation are + // taken into account + .filter(runner => runner.id <= current.id).map(getRunnerTransform).reduce(lmultiply, new Matrix()); + }, - }, { - key: "_tryRetarget", - value: function _tryRetarget(method, target) { - if (this._history[method]) { - // if the last method wasnt even initialised, throw it away - if (!this._history[method].caller.initialised) { - var index = this._queue.indexOf(this._history[method].caller); + addRunner(runner) { + this._transformationRunners.add(runner); - this._queue.splice(index, 1); + Animator.transform_frame(mergeTransforms.bind(this), this._frameId); + }, - return false; - } // for the case of transformations, we use the special retarget function - // which has access to the outer scope + _prepareRunner() { + if (this._frameId == null) { + this._transformationRunners = new RunnerArray().add(new FakeRunner(new Matrix(this))); + this._frameId = frameId++; + } + } + } +}); +extend(Runner, { + attr(a, v) { + return this.styleAttr('attr', a, v); + }, + + // Add animatable styles + css(s, v) { + return this.styleAttr('css', s, v); + }, + + styleAttr(type, name, val) { + // apply attributes individually + if (typeof name === 'object') { + for (var key in val) { + this.styleAttr(type, key, val[key]); + } + } - if (this._history[method].caller.retarget) { - this._history[method].caller.retarget(target); // for everything else a simple morpher change is sufficient + var morpher = new Morphable(this._stepper).to(val); + this.queue(function () { + morpher = morpher.from(this.element()[type](name)); + }, function (pos) { + this.element()[type](name, morpher.at(pos)); + return morpher.done(); + }); + return this; + }, + + zoom(level, point$$1) { + var morpher = new Morphable(this._stepper).to(new SVGNumber(level)); + this.queue(function () { + morpher = morpher.from(this.zoom()); + }, function (pos) { + this.element().zoom(morpher.at(pos), point$$1); + return morpher.done(); + }); + return this; + }, + + /** + ** absolute transformations + **/ + // + // M v -----|-----(D M v = F v)------|-----> T v + // + // 1. define the final state (T) and decompose it (once) + // t = [tx, ty, the, lam, sy, sx] + // 2. on every frame: pull the current state of all previous transforms + // (M - m can change) + // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0] + // 3. Find the interpolated matrix F(pos) = m + pos * (t - m) + // - Note F(0) = M + // - Note F(1) = T + // 4. Now you get the delta matrix as a result: D = F * inv(M) + transform(transforms, relative, affine) { + // If we have a declarative function, we should retarget it if possible + relative = transforms.relative || relative; + + if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) { + return this; + } // Parse the parameters - } else { - this._history[method].morpher.to(target); - } - this._history[method].caller.finished = false; - var timeline$$1 = this.timeline(); - timeline$$1 && timeline$$1._continue(); - return true; - } + var isMatrix = Matrix.isMatrixLike(transforms); + affine = transforms.affine != null ? transforms.affine : affine != null ? affine : !isMatrix; // Create a morepher and set its type - return false; - } // Run each initialise function in the runner if required + const morpher = new Morphable(this._stepper).type(affine ? TransformBag : Matrix); + let origin; + let element; + let current; + let currentAngle; + let startTransform; - }, { - key: "_initialise", - value: function _initialise(running) { - // If we aren't running, we shouldn't initialise when not declarative - if (!running && !this._isDeclarative) return; // Loop through all of the initialisers + function setup() { + // make sure element and origin is defined + element = element || this.element(); + origin = origin || getOrigin(transforms, element); + startTransform = new Matrix(relative ? undefined : element); // add the runner to the element so it can merge transformations - for (var i = 0, len = this._queue.length; i < len; ++i) { - // Get the current initialiser - var current = this._queue[i]; // Determine whether we need to initialise + element.addRunner(this); // Deactivate all transforms that have run so far if we are absolute - var needsIt = this._isDeclarative || !current.initialised && running; - running = !current.finished; // Call the initialiser if we need to + if (!relative) { + element._clearTransformRunnersBefore(this); + } + } - if (needsIt && running) { - current.initialiser.call(this); - current.initialised = true; - } - } - } // Run each run function for the position or dt given + function run(pos) { + // clear all other transforms before this in case something is saved + // on this runner. We are absolute. We dont need these! + if (!relative) this.clearTransform(); - }, { - key: "_run", - value: function _run(positionOrDt) { - // Run all of the _queue directly - var allfinished = true; + let _transform = new Point(origin).transform(element._currentTransform(this)), + x$$1 = _transform.x, + y$$1 = _transform.y; - for (var i = 0, len = this._queue.length; i < len; ++i) { - // Get the current function to run - var current = this._queue[i]; // Run the function if its not finished, we keep track of the finished - // flag for the sake of declarative _queue + let target = new Matrix(_objectSpread({}, transforms, { + origin: [x$$1, y$$1] + })); + let start = this._isDeclarative && current ? current : startTransform; - var converged = current.runner.call(this, positionOrDt); - current.finished = current.finished || converged === true; - allfinished = allfinished && current.finished; - } // We report when all of the constructors are finished + if (affine) { + target = target.decompose(x$$1, y$$1); + start = start.decompose(x$$1, y$$1); // Get the current and target angle as it was set + const rTarget = target.rotate; + const rCurrent = start.rotate; // Figure out the shortest path to rotate directly - return allfinished; - } - }, { - key: "addTransform", - value: function addTransform(transform, index) { - this.transforms.lmultiplyO(transform); - return this; - } - }, { - key: "clearTransform", - value: function clearTransform() { - this.transforms = new Matrix(); - return this; - } // TODO: Keep track of all transformations so that deletion is faster - - }, { - key: "clearTransformsFromQueue", - value: function clearTransformsFromQueue() { - if (!this.done) { - this._queue = this._queue.filter(function (item) { - return !item.isTransform; - }); - } + const possibilities = [rTarget - 360, rTarget, rTarget + 360]; + const distances = possibilities.map(a => Math.abs(a - rCurrent)); + const shortest = Math.min(...distances); + const index = distances.indexOf(shortest); + target.rotate = possibilities[index]; } - }], [{ - key: "sanitise", - value: function sanitise(duration, delay, when) { - // Initialise the default parameters - var times = 1; - var swing = false; - var wait = 0; - duration = duration || timeline.duration; - delay = delay || timeline.delay; - when = when || 'last'; // If we have an object, unpack the values - - if (_typeof(duration) === 'object' && !(duration instanceof Stepper)) { - delay = duration.delay || delay; - when = duration.when || when; - swing = duration.swing || swing; - times = duration.times || times; - wait = duration.wait || wait; - duration = duration.duration || timeline.duration; + + if (relative) { + // we have to be careful here not to overwrite the rotation + // with the rotate method of Matrix + if (!isMatrix) { + target.rotate = transforms.rotate || 0; } - return { - duration: duration, - delay: delay, - swing: swing, - times: times, - wait: wait, - when: when - }; + if (this._isDeclarative && currentAngle) { + start.rotate = currentAngle; + } } - }]); - return Runner; - }(EventTarget); - Runner.id = 0; + morpher.from(start); + morpher.to(target); + let affineParameters = morpher.at(pos); + currentAngle = affineParameters.rotate; + current = new Matrix(affineParameters); + this.addTransform(current); + return morpher.done(); + } - var FakeRunner = - /*#__PURE__*/ - function () { - function FakeRunner() { - 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; + function retarget(newTransforms) { + // only get a new origin if it changed since the last call + if ((newTransforms.origin || 'center').toString() !== (transforms.origin || 'center').toString()) { + origin = getOrigin(transforms, element); + } // overwrite the old transformations with the new ones - _classCallCheck(this, FakeRunner); - this.transforms = transforms; - this.id = id; - this.done = done; + transforms = _objectSpread({}, newTransforms, { + origin + }); } - _createClass(FakeRunner, [{ - key: "clearTransformsFromQueue", - value: function clearTransformsFromQueue() {} - }]); - - return FakeRunner; - }(); + this.queue(setup, run, retarget, true); + this._isDeclarative && this._rememberMorpher('transform', morpher); + return this; + }, + + // Animatable x-axis + x(x$$1, relative) { + return this._queueNumber('x', x$$1); + }, + + // Animatable y-axis + y(y$$1) { + return this._queueNumber('y', y$$1); + }, + + dx(x$$1) { + return this._queueNumberDelta('x', x$$1); + }, + + dy(y$$1) { + return this._queueNumberDelta('y', y$$1); + }, + + _queueNumberDelta(method, to$$1) { + to$$1 = new SVGNumber(to$$1); // Try to change the target if we have this method already registerd + + if (this._tryRetarget(method, to$$1)) return this; // Make a morpher and queue the animation + + var morpher = new Morphable(this._stepper).to(to$$1); + var from$$1 = null; + this.queue(function () { + from$$1 = this.element()[method](); + morpher.from(from$$1); + morpher.to(from$$1 + to$$1); + }, function (pos) { + this.element()[method](morpher.at(pos)); + return morpher.done(); + }, function (newTo) { + morpher.to(from$$1 + new SVGNumber(newTo)); + }); // Register the morpher so that if it is changed again, we can retarget it + + this._rememberMorpher(method, morpher); - extend([Runner, FakeRunner], { - mergeWith: function mergeWith(runner) { - return new FakeRunner(runner.transforms.lmultiply(this.transforms), runner.id); - } - }); // FakeRunner.emptyRunner = new FakeRunner() + return this; + }, - var lmultiply = function lmultiply(last, curr) { - return last.lmultiplyO(curr); - }; + _queueObject(method, to$$1) { + // Try to change the target if we have this method already registerd + if (this._tryRetarget(method, to$$1)) return this; // Make a morpher and queue the animation - var getRunnerTransform = function getRunnerTransform(runner) { - return runner.transforms; - }; + var morpher = new Morphable(this._stepper).to(to$$1); + this.queue(function () { + morpher.from(this.element()[method]()); + }, function (pos) { + this.element()[method](morpher.at(pos)); + return morpher.done(); + }); // Register the morpher so that if it is changed again, we can retarget it - 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()); - this.transform(netTransform); + this._rememberMorpher(method, morpher); - this._transformationRunners.merge(); + return this; + }, + + _queueNumber(method, value) { + return this._queueObject(method, new SVGNumber(value)); + }, + + // Animatable center x-axis + cx(x$$1) { + return this._queueNumber('cx', x$$1); + }, + + // Animatable center y-axis + cy(y$$1) { + return this._queueNumber('cy', y$$1); + }, + + // Add animatable move + move(x$$1, y$$1) { + return this.x(x$$1).y(y$$1); + }, + + // Add animatable center + center(x$$1, y$$1) { + return this.cx(x$$1).cy(y$$1); + }, + + // Add animatable size + size(width$$1, height$$1) { + // animate bbox based size for all other elements + var box; - if (this._transformationRunners.length() === 1) { - this._frameId = null; + if (!width$$1 || !height$$1) { + box = this._element.bbox(); } - } - var RunnerArray = - /*#__PURE__*/ - function () { - function RunnerArray() { - _classCallCheck(this, RunnerArray); + if (!width$$1) { + width$$1 = box.width / box.height * height$$1; + } - this.runners = []; - this.ids = []; + if (!height$$1) { + height$$1 = box.height / box.width * width$$1; } - _createClass(RunnerArray, [{ - key: "add", - value: function add(runner) { - if (this.runners.includes(runner)) return; - var id = runner.id + 1; - var leftSibling = this.ids.reduce(function (last, curr) { - if (curr > last && curr < id) return curr; - return last; - }, 0); - var index = this.ids.indexOf(leftSibling) + 1; - this.ids.splice(index, 0, id); - this.runners.splice(index, 0, runner); - return this; - } - }, { - key: "getByID", - value: function getByID(id) { - return this.runners[this.ids.indexOf(id + 1)]; - } - }, { - key: "remove", - value: function remove(id) { - var index = this.ids.indexOf(id + 1); - this.ids.splice(index, 1); - this.runners.splice(index, 1); - return this; - } - }, { - key: "merge", - value: function merge() { - var _this2 = this; + return this.width(width$$1).height(height$$1); + }, - var lastRunner = null; - this.runners.forEach(function (runner, i) { - if (lastRunner && runner.done && lastRunner.done) { - _this2.remove(runner.id); + // Add animatable width + width(width$$1) { + return this._queueNumber('width', width$$1); + }, - _this2.edit(lastRunner.id, runner.mergeWith(lastRunner)); - } + // Add animatable height + height(height$$1) { + return this._queueNumber('height', height$$1); + }, - lastRunner = runner; - }); - return this; - } - }, { - key: "edit", - value: function edit(id, newRunner) { - var index = this.ids.indexOf(id + 1); - this.ids.splice(index, 1, id); - this.runners.splice(index, 1, newRunner); - return this; - } - }, { - key: "length", - value: function length() { - return this.ids.length; - } - }, { - key: "clearBefore", - value: function clearBefore(id) { - var deleteCnt = this.ids.indexOf(id + 1) || 1; - this.ids.splice(0, deleteCnt, 0); - this.runners.splice(0, deleteCnt, new FakeRunner()).forEach(function (r) { - return r.clearTransformsFromQueue(); - }); - return this; - } - }]); - - return RunnerArray; - }(); - - var frameId = 0; - registerMethods({ - Element: { - animate: function animate(duration, delay, when) { - var o = Runner.sanitise(duration, delay, when); - var timeline$$1 = this.timeline(); - return new Runner(o.duration).loop(o).element(this).timeline(timeline$$1).schedule(delay, when); - }, - delay: function delay(by, when) { - return this.animate(0, by, when); - }, - // this function searches for all runners on the element and deletes the ones - // which run before the current one. This is because absolute transformations - // overwfrite anything anyway so there is no need to waste time computing - // other runners - _clearTransformRunnersBefore: function _clearTransformRunnersBefore(currentRunner) { - this._transformationRunners.clearBefore(currentRunner.id); - }, - _currentTransform: function _currentTransform(current) { - return this._transformationRunners.runners // we need the equal sign here to make sure, that also transformations - // on the same runner which execute before the current transformation are - // taken into account - .filter(function (runner) { - return runner.id <= current.id; - }).map(getRunnerTransform).reduce(lmultiply, new Matrix()); - }, - addRunner: function addRunner(runner) { - this._transformationRunners.add(runner); - - Animator.transform_frame(mergeTransforms.bind(this), this._frameId); - }, - _prepareRunner: function _prepareRunner() { - if (this._frameId == null) { - this._transformationRunners = new RunnerArray().add(new FakeRunner(new Matrix(this))); - this._frameId = frameId++; - } - } + // Add animatable plot + plot(a, b, c, d) { + // Lines can be plotted with 4 arguments + if (arguments.length === 4) { + return this.plot([a, b, c, d]); } - }); - extend(Runner, { - attr: function attr(a, v) { - return this.styleAttr('attr', a, v); - }, - // Add animatable styles - css: function css(s, v) { - return this.styleAttr('css', s, v); - }, - styleAttr: function styleAttr(type, name, val) { - // apply attributes individually - if (_typeof(name) === 'object') { - for (var key in val) { - this.styleAttr(type, key, val[key]); - } - } - var morpher = new Morphable(this._stepper).to(val); - this.queue(function () { - morpher = morpher.from(this.element()[type](name)); - }, function (pos) { - this.element()[type](name, morpher.at(pos)); - return morpher.done(); - }); - return this; - }, - zoom: function zoom(level, point$$1) { - var morpher = new Morphable(this._stepper).to(new SVGNumber(level)); - this.queue(function () { - morpher = morpher.from(this.zoom()); - }, function (pos) { - this.element().zoom(morpher.at(pos), point$$1); - return morpher.done(); + var morpher = this._element.MorphArray().to(a); + + this.queue(function () { + morpher.from(this._element.array()); + }, function (pos) { + this._element.plot(morpher.at(pos)); + }); + return this; + }, + + // Add leading method + leading(value) { + return this._queueNumber('leading', value); + }, + + // Add animatable viewbox + viewbox(x$$1, y$$1, width$$1, height$$1) { + return this._queueObject('viewbox', new Box(x$$1, y$$1, width$$1, height$$1)); + }, + + update(o) { + if (typeof o !== 'object') { + return this.update({ + offset: arguments[0], + color: arguments[1], + opacity: arguments[2] }); - return this; - }, + } - /** - ** absolute transformations - **/ - // - // M v -----|-----(D M v = F v)------|-----> T v - // - // 1. define the final state (T) and decompose it (once) - // t = [tx, ty, the, lam, sy, sx] - // 2. on every frame: pull the current state of all previous transforms - // (M - m can change) - // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0] - // 3. Find the interpolated matrix F(pos) = m + pos * (t - m) - // - Note F(0) = M - // - Note F(1) = T - // 4. Now you get the delta matrix as a result: D = F * inv(M) - transform: function transform(transforms, relative, affine) { - // If we have a declarative function, we should retarget it if possible - relative = transforms.relative || relative; - - if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) { - return this; - } // Parse the parameters - - - var isMatrix = Matrix.isMatrixLike(transforms); - affine = transforms.affine != null ? transforms.affine : affine != null ? affine : !isMatrix; // Create a morepher and set its type - - var morpher = new Morphable(this._stepper).type(affine ? TransformBag : Matrix); - var origin; - var element; - var current; - var currentAngle; - var startTransform; - - function setup() { - // make sure element and origin is defined - element = element || this.element(); - origin = origin || getOrigin(transforms, element); - 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 - - if (!relative) { - element._clearTransformRunnersBefore(this); - } - } + if (o.opacity != null) this.attr('stop-opacity', o.opacity); + if (o.color != null) this.attr('stop-color', o.color); + if (o.offset != null) this.attr('offset', o.offset); + return this; + } - function run(pos) { - // clear all other transforms before this in case something is saved - // on this runner. We are absolute. We dont need these! - if (!relative) this.clearTransform(); +}); +extend(Runner, { + rx, + ry, + from, + to +}); + +class Svg$1 extends Container { + constructor(node) { + super(nodeOrNew('svg', node), node); + this.namespace(); + } - var _transform = new Point(origin).transform(element._currentTransform(this)), - x$$1 = _transform.x, - y$$1 = _transform.y; + isRoot() { + return !this.node.parentNode || !(this.node.parentNode instanceof globals.window.SVGElement) || this.node.parentNode.nodeName === '#document'; + } // Check if this is a root svg + // If not, call docs from this element - var target = new Matrix(_objectSpread({}, transforms, { - origin: [x$$1, y$$1] - })); - var start = this._isDeclarative && current ? current : startTransform; - if (affine) { - target = target.decompose(x$$1, y$$1); - start = start.decompose(x$$1, y$$1); // Get the current and target angle as it was set + root() { + if (this.isRoot()) return this; + return super.root(); + } // Add namespaces - var rTarget = target.rotate; - var rCurrent = start.rotate; // Figure out the shortest path to rotate directly - var possibilities = [rTarget - 360, rTarget, rTarget + 360]; - var distances = possibilities.map(function (a) { - return Math.abs(a - rCurrent); - }); - var shortest = Math.min.apply(Math, _toConsumableArray(distances)); - var index = distances.indexOf(shortest); - target.rotate = possibilities[index]; - } + namespace() { + if (!this.isRoot()) return this.root().namespace(); + return this.attr({ + xmlns: ns, + version: '1.1' + }).attr('xmlns:xlink', xlink, xmlns).attr('xmlns:svgjs', svgjs, xmlns); + } // Creates and returns defs element - if (relative) { - // we have to be careful here not to overwrite the rotation - // with the rotate method of Matrix - if (!isMatrix) { - target.rotate = transforms.rotate || 0; - } - if (this._isDeclarative && currentAngle) { - start.rotate = currentAngle; - } - } + defs() { + if (!this.isRoot()) return this.root().defs(); + return adopt(this.node.getElementsByTagName('defs')[0]) || this.put(new Defs()); + } // custom parent method - morpher.from(start); - morpher.to(target); - var affineParameters = morpher.at(pos); - currentAngle = affineParameters.rotate; - current = new Matrix(affineParameters); - this.addTransform(current); - return morpher.done(); - } - function retarget(newTransforms) { - // only get a new origin if it changed since the last call - if ((newTransforms.origin || 'center').toString() !== (transforms.origin || 'center').toString()) { - origin = getOrigin(transforms, element); - } // overwrite the old transformations with the new ones + parent(type) { + if (this.isRoot()) { + return this.node.parentNode.nodeName === '#document' ? null : adopt(this.node.parentNode); + } + return super.parent(type); + } - transforms = _objectSpread({}, newTransforms, { - origin: origin - }); - } + clear() { + // remove children + while (this.node.hasChildNodes()) { + this.node.removeChild(this.node.lastChild); + } - this.queue(setup, run, retarget, true); - this._isDeclarative && this._rememberMorpher('transform', morpher); - return this; - }, - // Animatable x-axis - x: function x$$1(_x, relative) { - return this._queueNumber('x', _x); - }, - // Animatable y-axis - y: function y$$1(_y) { - return this._queueNumber('y', _y); - }, - dx: function dx(x$$1) { - return this._queueNumberDelta('x', x$$1); - }, - dy: function dy(y$$1) { - return this._queueNumberDelta('y', y$$1); - }, - _queueNumberDelta: function _queueNumberDelta(method, to$$1) { - to$$1 = new SVGNumber(to$$1); // Try to change the target if we have this method already registerd - - if (this._tryRetarget(method, to$$1)) return this; // Make a morpher and queue the animation - - var morpher = new Morphable(this._stepper).to(to$$1); - var from$$1 = null; - this.queue(function () { - from$$1 = this.element()[method](); - morpher.from(from$$1); - morpher.to(from$$1 + to$$1); - }, function (pos) { - this.element()[method](morpher.at(pos)); - return morpher.done(); - }, function (newTo) { - morpher.to(from$$1 + new SVGNumber(newTo)); - }); // Register the morpher so that if it is changed again, we can retarget it - - this._rememberMorpher(method, morpher); + return this; + } - return this; - }, - _queueObject: function _queueObject(method, to$$1) { - // Try to change the target if we have this method already registerd - if (this._tryRetarget(method, to$$1)) return this; // Make a morpher and queue the animation +} +registerMethods({ + Container: { + // Create nested svg document + nested: wrapWithAttrCheck(function () { + return this.put(new Svg$1()); + }) + } +}); +register(Svg$1, 'Svg', true); - var morpher = new Morphable(this._stepper).to(to$$1); - this.queue(function () { - morpher.from(this.element()[method]()); - }, function (pos) { - this.element()[method](morpher.at(pos)); - return morpher.done(); - }); // Register the morpher so that if it is changed again, we can retarget it +class Symbol extends Container { + // Initialize node + constructor(node) { + super(nodeOrNew('symbol', node), node); + } - this._rememberMorpher(method, morpher); +} +registerMethods({ + Container: { + symbol: wrapWithAttrCheck(function () { + return this.put(new Symbol()); + }) + } +}); +register(Symbol); - return this; - }, - _queueNumber: function _queueNumber(method, value) { - return this._queueObject(method, new SVGNumber(value)); - }, - // Animatable center x-axis - cx: function cx$$1(x$$1) { - return this._queueNumber('cx', x$$1); - }, - // Animatable center y-axis - cy: function cy$$1(y$$1) { - return this._queueNumber('cy', y$$1); - }, - // Add animatable move - move: function move(x$$1, y$$1) { - return this.x(x$$1).y(y$$1); - }, - // Add animatable center - center: function center(x$$1, y$$1) { - return this.cx(x$$1).cy(y$$1); - }, - // Add animatable size - size: function size(width$$1, height$$1) { - // animate bbox based size for all other elements - var box; +function plain(text) { + // clear if build mode is disabled + if (this._build === false) { + this.clear(); + } // create text node - if (!width$$1 || !height$$1) { - box = this._element.bbox(); - } - if (!width$$1) { - width$$1 = box.width / box.height * height$$1; - } + this.node.appendChild(globals.document.createTextNode(text)); + return this; +} // Get length of text element - if (!height$$1) { - height$$1 = box.height / box.width * width$$1; - } +function length() { + return this.node.getComputedTextLength(); +} - return this.width(width$$1).height(height$$1); - }, - // Add animatable width - width: function width$$1(_width) { - return this._queueNumber('width', _width); - }, - // Add animatable height - height: function height$$1(_height) { - return this._queueNumber('height', _height); - }, - // Add animatable plot - plot: function plot(a, b, c, d) { - // Lines can be plotted with 4 arguments - if (arguments.length === 4) { - return this.plot([a, b, c, d]); - } +var textable = /*#__PURE__*/Object.freeze({ + plain: plain, + length: length +}); - var morpher = this._element.MorphArray().to(a); +class Text extends Shape { + // Initialize node + constructor(node) { + super(nodeOrNew('text', node), node); + this.dom.leading = new SVGNumber(1.3); // store leading value for rebuilding - this.queue(function () { - morpher.from(this._element.array()); - }, function (pos) { - this._element.plot(morpher.at(pos)); - }); - return this; - }, - // Add leading method - leading: function leading(value) { - return this._queueNumber('leading', value); - }, - // Add animatable viewbox - viewbox: function viewbox(x$$1, y$$1, width$$1, height$$1) { - return this._queueObject('viewbox', new Box(x$$1, y$$1, width$$1, height$$1)); - }, - update: function update(o) { - if (_typeof(o) !== 'object') { - return this.update({ - offset: arguments[0], - color: arguments[1], - opacity: arguments[2] - }); - } + this._rebuild = true; // enable automatic updating of dy values - if (o.opacity != null) this.attr('stop-opacity', o.opacity); - if (o.color != null) this.attr('stop-color', o.color); - if (o.offset != null) this.attr('offset', o.offset); - return this; - } - }); - extend(Runner, { - rx: rx, - ry: ry, - from: from, - to: to - }); + this._build = false; // disable build mode for adding multiple lines + // set default font + + this.attr('font-family', attrs['font-family']); + } // Move over x-axis - var Svg$1 = - /*#__PURE__*/ - function (_Container) { - _inherits(Svg, _Container); - function Svg(node) { - var _this; + x(x) { + // act as getter + if (x == null) { + return this.attr('x'); + } - _classCallCheck(this, Svg); + return this.attr('x', x); + } // Move over y-axis - _this = _possibleConstructorReturn(this, _getPrototypeOf(Svg).call(this, nodeOrNew('svg', node), node)); - _this.namespace(); + y(y) { + var oy = this.attr('y'); + var o = typeof oy === 'number' ? oy - this.bbox().y : 0; // act as getter - return _this; + if (y == null) { + return typeof oy === 'number' ? oy - o : oy; } - _createClass(Svg, [{ - key: "isRoot", - value: function isRoot() { - return !this.node.parentNode || !(this.node.parentNode instanceof globals.window.SVGElement) || this.node.parentNode.nodeName === '#document'; - } // Check if this is a root svg - // If not, call docs from this element - - }, { - key: "root", - value: function root$$1() { - if (this.isRoot()) return this; - return _get(_getPrototypeOf(Svg.prototype), "root", this).call(this); - } // Add namespaces - - }, { - key: "namespace", - value: function namespace() { - if (!this.isRoot()) return this.root().namespace(); - return this.attr({ - xmlns: ns, - version: '1.1' - }).attr('xmlns:xlink', xlink, xmlns).attr('xmlns:svgjs', svgjs, xmlns); - } // Creates and returns defs element - - }, { - key: "defs", - value: function defs() { - if (!this.isRoot()) return this.root().defs(); - return adopt(this.node.getElementsByTagName('defs')[0]) || this.put(new Defs()); - } // custom parent method - - }, { - key: "parent", - value: function parent(type) { - if (this.isRoot()) { - return this.node.parentNode.nodeName === '#document' ? null : adopt(this.node.parentNode); - } - - return _get(_getPrototypeOf(Svg.prototype), "parent", this).call(this, type); - } - }, { - key: "clear", - value: function clear() { - // remove children - while (this.node.hasChildNodes()) { - this.node.removeChild(this.node.lastChild); - } + return this.attr('y', typeof y === 'number' ? y + o : y); + } // Move center over x-axis - return this; - } - }]); - - return Svg; - }(Container); - registerMethods({ - Container: { - // Create nested svg document - nested: wrapWithAttrCheck(function () { - return this.put(new Svg$1()); - }) - } - }); - register(Svg$1, 'Svg', true); - function plain(text) { - // clear if build mode is disabled - if (this._build === false) { - this.clear(); - } // create text node + cx(x) { + return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2); + } // Move center over y-axis - this.node.appendChild(globals.document.createTextNode(text)); - return this; - } // Get length of text element + cy(y) { + return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2); + } // Set the text content - function length() { - return this.node.getComputedTextLength(); - } - var textable = /*#__PURE__*/Object.freeze({ - plain: plain, - length: length - }); + text(text) { + // act as getter + if (text === undefined) { + var children = this.node.childNodes; + var firstLine = 0; + text = ''; - var Text = - /*#__PURE__*/ - function (_Shape) { - _inherits(Text, _Shape); + for (var i = 0, len = children.length; i < len; ++i) { + // skip textPaths - they are no lines + if (children[i].nodeName === 'textPath') { + if (i === 0) firstLine = 1; + continue; + } // add newline if its not the first child and newLined is set to true - // Initialize node - function Text(node) { - var _this; - _classCallCheck(this, Text); + if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) { + text += '\n'; + } // add content of this node - _this = _possibleConstructorReturn(this, _getPrototypeOf(Text).call(this, nodeOrNew('text', node), node)); - _this.dom.leading = new SVGNumber(1.3); // store leading value for rebuilding - _this._rebuild = true; // enable automatic updating of dy values + text += children[i].textContent; + } - _this._build = false; // disable build mode for adding multiple lines - // set default font + return text; + } // remove existing content - _this.attr('font-family', attrs['font-family']); - return _this; - } // Move over x-axis + this.clear().build(true); + if (typeof text === 'function') { + // call block + text.call(this, this); + } else { + // store text and make sure text is not blank + text = text.split('\n'); // build new lines - _createClass(Text, [{ - key: "x", - value: function x(_x) { - // act as getter - if (_x == null) { - return this.attr('x'); - } + for (var j = 0, jl = text.length; j < jl; j++) { + this.tspan(text[j]).newLine(); + } + } // disable build mode and rebuild lines - return this.attr('x', _x); - } // Move over y-axis - }, { - key: "y", - value: function y(_y) { - var oy = this.attr('y'); - var o = typeof oy === 'number' ? oy - this.bbox().y : 0; // act as getter + return this.build(false).rebuild(); + } // Set / get leading - if (_y == null) { - return typeof oy === 'number' ? oy - o : oy; - } - return this.attr('y', typeof _y === 'number' ? _y + o : _y); - } // Move center over x-axis + leading(value) { + // act as getter + if (value == null) { + return this.dom.leading; + } // act as setter - }, { - key: "cx", - value: function cx(x) { - return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2); - } // Move center over y-axis - }, { - key: "cy", - value: function cy(y) { - return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2); - } // Set the text content + this.dom.leading = new SVGNumber(value); + return this.rebuild(); + } // Rebuild appearance type - }, { - key: "text", - value: function text(_text) { - // act as getter - if (_text === undefined) { - var children = this.node.childNodes; - var firstLine = 0; - _text = ''; - for (var i = 0, len = children.length; i < len; ++i) { - // skip textPaths - they are no lines - if (children[i].nodeName === 'textPath') { - if (i === 0) firstLine = 1; - continue; - } // add newline if its not the first child and newLined is set to true + rebuild(rebuild) { + // store new rebuild flag if given + if (typeof rebuild === 'boolean') { + this._rebuild = rebuild; + } // define position of all lines - if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) { - _text += '\n'; - } // add content of this node + if (this._rebuild) { + var self = this; + var blankLineOffset = 0; + var leading = this.dom.leading; + this.each(function () { + var fontSize = globals.window.getComputedStyle(this.node).getPropertyValue('font-size'); + var dy = leading * new SVGNumber(fontSize); + if (this.dom.newLined) { + this.attr('x', self.attr('x')); - _text += children[i].textContent; + if (this.text() === '\n') { + blankLineOffset += dy; + } else { + this.attr('dy', dy + blankLineOffset); + blankLineOffset = 0; } + } + }); + this.fire('rebuild'); + } - return _text; - } // remove existing content + return this; + } // Enable / disable build mode - this.clear().build(true); + build(build) { + this._build = !!build; + return this; + } // overwrite method from parent to set data properly - if (typeof _text === 'function') { - // call block - _text.call(this, this); - } else { - // store text and make sure text is not blank - _text = _text.split('\n'); // build new lines - for (var j = 0, jl = _text.length; j < jl; j++) { - this.tspan(_text[j]).newLine(); - } - } // disable build mode and rebuild lines - - - return this.build(false).rebuild(); - } // Set / get leading - - }, { - key: "leading", - value: function leading(value) { - // act as getter - if (value == null) { - return this.dom.leading; - } // act as setter - - - this.dom.leading = new SVGNumber(value); - return this.rebuild(); - } // Rebuild appearance type - - }, { - key: "rebuild", - value: function rebuild(_rebuild) { - // store new rebuild flag if given - if (typeof _rebuild === 'boolean') { - this._rebuild = _rebuild; - } // define position of all lines - - - if (this._rebuild) { - var self = this; - var blankLineOffset = 0; - var leading = this.dom.leading; - this.each(function () { - var fontSize = globals.window.getComputedStyle(this.node).getPropertyValue('font-size'); - var dy = leading * new SVGNumber(fontSize); - - if (this.dom.newLined) { - this.attr('x', self.attr('x')); - - if (this.text() === '\n') { - blankLineOffset += dy; - } else { - this.attr('dy', dy + blankLineOffset); - blankLineOffset = 0; - } - } - }); - this.fire('rebuild'); - } + setData(o) { + this.dom = o; + this.dom.leading = new SVGNumber(o.leading || 1.3); + return this; + } - return this; - } // Enable / disable build mode - - }, { - key: "build", - value: function build(_build) { - this._build = !!_build; - return this; - } // overwrite method from parent to set data properly - - }, { - key: "setData", - value: function setData(o) { - this.dom = o; - this.dom.leading = new SVGNumber(o.leading || 1.3); - return this; - } - }]); - - return Text; - }(Shape); - extend(Text, textable); - registerMethods({ - Container: { - // Create text element - text: wrapWithAttrCheck(function (text) { - return this.put(new Text()).text(text); - }), - // Create plain text element - plain: wrapWithAttrCheck(function (text) { - return this.put(new Text()).plain(text); - }) - } - }); - register(Text); - - var Tspan = - /*#__PURE__*/ - function (_Text) { - _inherits(Tspan, _Text); - - // Initialize node - function Tspan(node) { - _classCallCheck(this, Tspan); - - return _possibleConstructorReturn(this, _getPrototypeOf(Tspan).call(this, nodeOrNew('tspan', node), node)); - } // Set text content - - - _createClass(Tspan, [{ - key: "text", - value: function text(_text) { - if (_text == null) return this.node.textContent + (this.dom.newLined ? '\n' : ''); - typeof _text === 'function' ? _text.call(this, this) : this.plain(_text); - return this; - } // Shortcut dx - - }, { - key: "dx", - value: function dx(_dx) { - return this.attr('dx', _dx); - } // Shortcut dy - - }, { - key: "dy", - value: function dy(_dy) { - return this.attr('dy', _dy); - } // Create new line - - }, { - key: "newLine", - value: function newLine() { - // fetch text parent - var t = this.parent(Text); // mark new line - - this.dom.newLined = true; // apply new position - - return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x()); - } - }]); +} +extend(Text, textable); +registerMethods({ + Container: { + // Create text element + text: wrapWithAttrCheck(function (text) { + return this.put(new Text()).text(text); + }), + // Create plain text element + plain: wrapWithAttrCheck(function (text) { + return this.put(new Text()).plain(text); + }) + } +}); +register(Text); - return Tspan; - }(Text); - extend(Tspan, textable); - registerMethods({ - Tspan: { - tspan: wrapWithAttrCheck(function (text) { - var tspan = new Tspan(); // clear if build mode is disabled +class Tspan extends Text { + // Initialize node + constructor(node) { + super(nodeOrNew('tspan', node), node); + } // Set text content - if (!this._build) { - this.clear(); - } // add new tspan + text(text) { + if (text == null) return this.node.textContent + (this.dom.newLined ? '\n' : ''); + typeof text === 'function' ? text.call(this, this) : this.plain(text); + return this; + } // Shortcut dx - this.node.appendChild(tspan.node); - return tspan.text(text); - }) - } - }); - register(Tspan); - var Bare = - /*#__PURE__*/ - function (_Container) { - _inherits(Bare, _Container); + dx(dx) { + return this.attr('dx', dx); + } // Shortcut dy - function Bare(node, attrs) { - _classCallCheck(this, Bare); - return _possibleConstructorReturn(this, _getPrototypeOf(Bare).call(this, nodeOrNew(node, typeof node === 'string' ? null : node), attrs)); - } + dy(dy) { + return this.attr('dy', dy); + } // Create new line - _createClass(Bare, [{ - key: "words", - value: function words(text) { - // remove contents - while (this.node.hasChildNodes()) { - this.node.removeChild(this.node.lastChild); - } // create text node + newLine() { + // fetch text parent + var t = this.parent(Text); // mark new line - this.node.appendChild(globals.document.createTextNode(text)); - return this; - } - }]); - - return Bare; - }(Container); - register(Bare); - registerMethods('Container', { - // Create an element that is not described by SVG.js - element: wrapWithAttrCheck(function (node) { - return this.put(new Bare(node)); - }) - }); + this.dom.newLined = true; // apply new position - var ClipPath = - /*#__PURE__*/ - function (_Container) { - _inherits(ClipPath, _Container); + return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x()); + } - function ClipPath(node) { - _classCallCheck(this, ClipPath); +} +extend(Tspan, textable); +registerMethods({ + Tspan: { + tspan: wrapWithAttrCheck(function (text) { + var tspan = new Tspan(); // clear if build mode is disabled - return _possibleConstructorReturn(this, _getPrototypeOf(ClipPath).call(this, nodeOrNew('clipPath', node), node)); - } // Unclip all clipped elements and remove itself + if (!this._build) { + this.clear(); + } // add new tspan - _createClass(ClipPath, [{ - key: "remove", - value: function remove() { - // unclip all targets - this.targets().forEach(function (el) { - el.unclip(); - }); // remove clipPath from parent + this.node.appendChild(tspan.node); + return tspan.text(text); + }) + } +}); +register(Tspan); - return _get(_getPrototypeOf(ClipPath.prototype), "remove", this).call(this); - } - }, { - key: "targets", - value: function targets() { - return baseFind('svg [clip-path*="' + this.id() + '"]'); - } - }]); - - return ClipPath; - }(Container); - registerMethods({ - Container: { - // Create clipping element - clip: wrapWithAttrCheck(function () { - return this.defs().put(new ClipPath()); - }) - }, - Element: { - // Distribute clipPath to svg element - clipWith: function clipWith(element) { - // use given clip or create a new one - var clipper = element instanceof ClipPath ? element : this.parent().clip().add(element); // apply mask - - return this.attr('clip-path', 'url("#' + clipper.id() + '")'); - }, - // Unclip element - unclip: function unclip() { - return this.attr('clip-path', null); - }, - clipper: function clipper() { - return this.reference('clip-path'); - } - } - }); - register(ClipPath); +class ClipPath extends Container { + constructor(node) { + super(nodeOrNew('clipPath', node), node); + } // Unclip all clipped elements and remove itself - var G = - /*#__PURE__*/ - function (_Container) { - _inherits(G, _Container); - function G(node) { - _classCallCheck(this, G); + remove() { + // unclip all targets + this.targets().forEach(function (el) { + el.unclip(); + }); // remove clipPath from parent - return _possibleConstructorReturn(this, _getPrototypeOf(G).call(this, nodeOrNew('g', node), node)); - } + return super.remove(); + } - return G; - }(Container); - registerMethods({ - Element: { - // Create a group element - group: wrapWithAttrCheck(function () { - return this.put(new G()); - }) - } - }); - register(G); + targets() { + return baseFind('svg [clip-path*="' + this.id() + '"]'); + } - var HtmlNode = - /*#__PURE__*/ - function (_Dom) { - _inherits(HtmlNode, _Dom); +} +registerMethods({ + Container: { + // Create clipping element + clip: wrapWithAttrCheck(function () { + return this.defs().put(new ClipPath()); + }) + }, + Element: { + // Distribute clipPath to svg element + clipWith(element) { + // use given clip or create a new one + let clipper = element instanceof ClipPath ? element : this.parent().clip().add(element); // apply mask + + return this.attr('clip-path', 'url("#' + clipper.id() + '")'); + }, - function HtmlNode() { - _classCallCheck(this, HtmlNode); + // Unclip element + unclip() { + return this.attr('clip-path', null); + }, - return _possibleConstructorReturn(this, _getPrototypeOf(HtmlNode).apply(this, arguments)); + clipper() { + return this.reference('clip-path'); } - return HtmlNode; - }(Dom); - register(HtmlNode); + } +}); +register(ClipPath); - var A = - /*#__PURE__*/ - function (_Container) { - _inherits(A, _Container); +class G extends Container { + constructor(node) { + super(nodeOrNew('g', node), node); + } - function A(node) { - _classCallCheck(this, A); +} +registerMethods({ + Element: { + // Create a group element + group: wrapWithAttrCheck(function () { + return this.put(new G()); + }) + } +}); +register(G); - return _possibleConstructorReturn(this, _getPrototypeOf(A).call(this, nodeOrNew('a', node), node)); - } // Link url +class A extends Container { + constructor(node) { + super(nodeOrNew('a', node), node); + } // Link url - _createClass(A, [{ - key: "to", - value: function to(url) { - return this.attr('href', url, xlink); - } // Link target attribute + to(url) { + return this.attr('href', url, xlink); + } // Link target attribute - }, { - key: "target", - value: function target(_target) { - return this.attr('target', _target); - } - }]); - - return A; - }(Container); - registerMethods({ - Container: { - // Create a hyperlink element - link: wrapWithAttrCheck(function (url) { - return this.put(new A()).to(url); - }) - }, - Element: { - // Create a hyperlink element - linkTo: function linkTo(url) { - var link = new A(); - if (typeof url === 'function') { - url.call(link, link); - } else { - link.to(url); - } + target(target) { + return this.attr('target', target); + } - return this.parent().put(link).put(this); +} +registerMethods({ + Container: { + // Create a hyperlink element + link: wrapWithAttrCheck(function (url) { + return this.put(new A()).to(url); + }) + }, + Element: { + // Create a hyperlink element + linkTo: function linkTo(url) { + var link = new A(); + + if (typeof url === 'function') { + url.call(link, link); + } else { + link.to(url); } + + return this.parent().put(link).put(this); } - }); - register(A); + } +}); +register(A); - var Mask = - /*#__PURE__*/ - function (_Container) { - _inherits(Mask, _Container); +class Mask extends Container { + // Initialize node + constructor(node) { + super(nodeOrNew('mask', node), node); + } // Unmask all masked elements and remove itself - // Initialize node - function Mask(node) { - _classCallCheck(this, Mask); - return _possibleConstructorReturn(this, _getPrototypeOf(Mask).call(this, nodeOrNew('mask', node), node)); - } // Unmask all masked elements and remove itself + remove() { + // unmask all targets + this.targets().forEach(function (el) { + el.unmask(); + }); // remove mask from parent + return super.remove(); + } - _createClass(Mask, [{ - key: "remove", - value: function remove() { - // unmask all targets - this.targets().forEach(function (el) { - el.unmask(); - }); // remove mask from parent + targets() { + return baseFind('svg [mask*="' + this.id() + '"]'); + } - return _get(_getPrototypeOf(Mask.prototype), "remove", this).call(this); - } - }, { - key: "targets", - value: function targets() { - return baseFind('svg [mask*="' + this.id() + '"]'); - } - }]); - - return Mask; - }(Container); - registerMethods({ - Container: { - mask: wrapWithAttrCheck(function () { - return this.defs().put(new Mask()); - }) +} +registerMethods({ + Container: { + mask: wrapWithAttrCheck(function () { + return this.defs().put(new Mask()); + }) + }, + Element: { + // Distribute mask to svg element + maskWith(element) { + // use given mask or create a new one + var masker = element instanceof Mask ? element : this.parent().mask().add(element); // apply mask + + return this.attr('mask', 'url("#' + masker.id() + '")'); }, - Element: { - // Distribute mask to svg element - maskWith: function maskWith(element) { - // use given mask or create a new one - var masker = element instanceof Mask ? element : this.parent().mask().add(element); // apply mask - - return this.attr('mask', 'url("#' + masker.id() + '")'); - }, - // Unmask element - unmask: function unmask() { - return this.attr('mask', null); - }, - masker: function masker() { - return this.reference('mask'); - } - } - }); - register(Mask); - function cssRule(selector, rule) { - if (!selector) return ''; - if (!rule) return selector; - var ret = selector + '{'; + // Unmask element + unmask() { + return this.attr('mask', null); + }, - for (var i in rule) { - ret += unCamelCase(i) + ':' + rule[i] + ';'; + masker() { + return this.reference('mask'); } - ret += '}'; - return ret; } +}); +register(Mask); - var Style = - /*#__PURE__*/ - function (_Element) { - _inherits(Style, _Element); +function cssRule(selector, rule) { + if (!selector) return ''; + if (!rule) return selector; + var ret = selector + '{'; - function Style(node) { - _classCallCheck(this, Style); + for (var i in rule) { + ret += unCamelCase(i) + ':' + rule[i] + ';'; + } - return _possibleConstructorReturn(this, _getPrototypeOf(Style).call(this, nodeOrNew('style', node), node)); - } + ret += '}'; + return ret; +} - _createClass(Style, [{ - key: "words", - value: function words(w) { - this.node.textContent += w || ''; - return this; - } - }, { - key: "font", - value: function font(name, src) { - var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - return this.rule('@font-face', _objectSpread({ - fontFamily: name, - src: src - }, params)); - } - }, { - key: "rule", - value: function rule(selector, obj) { - return this.words(cssRule(selector, obj)); - } - }]); +class Style extends Element { + constructor(node) { + super(nodeOrNew('style', node), node); + } - return Style; - }(Element); - registerMethods('Dom', { - style: wrapWithAttrCheck(function (selector, obj) { - return this.put(new Style()).rule(selector, obj); - }), - fontface: wrapWithAttrCheck(function (name, src, params) { - return this.put(new Style()).font(name, src, params); - }) - }); - register(Style); + addText(w = '') { + this.node.textContent += w; + return this; + } - var _Symbol = - /*#__PURE__*/ - function (_Container) { - _inherits(_Symbol, _Container); + font(name, src, params = {}) { + return this.rule('@font-face', _objectSpread({ + fontFamily: name, + src: src + }, params)); + } - // Initialize node - function _Symbol(node) { - _classCallCheck(this, _Symbol); + rule(selector, obj) { + return this.addText(cssRule(selector, obj)); + } - return _possibleConstructorReturn(this, _getPrototypeOf(_Symbol).call(this, nodeOrNew('symbol', node), node)); - } +} +registerMethods('Dom', { + style: wrapWithAttrCheck(function (selector, obj) { + return this.put(new Style()).rule(selector, obj); + }), + fontface: wrapWithAttrCheck(function (name, src, params) { + return this.put(new Style()).font(name, src, params); + }) +}); +register(Style); - return _Symbol; - }(Container); - registerMethods({ - Container: { - symbol: wrapWithAttrCheck(function () { - return this.put(new _Symbol()); - }) - } - }); - register(_Symbol); +class TextPath extends Text { + // Initialize node + constructor(node) { + super(nodeOrNew('textPath', node), node); + } // return the array of the path track element - var TextPath = - /*#__PURE__*/ - function (_Text) { - _inherits(TextPath, _Text); - // Initialize node - function TextPath(node) { - _classCallCheck(this, TextPath); + array() { + var track = this.track(); + return track ? track.array() : null; + } // Plot path if any - return _possibleConstructorReturn(this, _getPrototypeOf(TextPath).call(this, nodeOrNew('textPath', node), node)); - } // return the array of the path track element + plot(d) { + var track = this.track(); + var pathArray = null; - _createClass(TextPath, [{ - key: "array", - value: function array() { - var track = this.track(); - return track ? track.array() : null; - } // Plot path if any + if (track) { + pathArray = track.plot(d); + } - }, { - key: "plot", - value: function plot(d) { - var track = this.track(); - var pathArray = null; + return d == null ? pathArray : this; + } // Get the path element - if (track) { - pathArray = track.plot(d); - } - return d == null ? pathArray : this; - } // Get the path element + track() { + return this.reference('href'); + } - }, { - key: "track", - value: function track() { - return this.reference('href'); - } - }]); - - return TextPath; - }(Text); - registerMethods({ - Container: { - textPath: wrapWithAttrCheck(function (text, path) { - return this.defs().path(path).text(text).addTo(this); - }) - }, - Text: { - // Create path for text to run on - path: wrapWithAttrCheck(function (track) { - var path = new TextPath(); // if track is a path, reuse it +} +registerMethods({ + Container: { + textPath: wrapWithAttrCheck(function (text, path) { + return this.defs().path(path).text(text).addTo(this); + }) + }, + Text: { + // Create path for text to run on + path: wrapWithAttrCheck(function (track) { + var path = new TextPath(); // if track is a path, reuse it - if (!(track instanceof Path)) { - // create path element - track = this.root().defs().path(track); - } // link textPath to path and add content + if (!(track instanceof Path)) { + // create path element + track = this.root().defs().path(track); + } // link textPath to path and add content - path.attr('href', '#' + track, xlink); // add textPath element as child node and return textPath + path.attr('href', '#' + track, xlink); // add textPath element as child node and return textPath - return this.put(path); - }), - // Get the textPath children - textPath: function textPath() { - return this.find('textPath')[0]; - } - }, - Path: { - // creates a textPath from this path - text: wrapWithAttrCheck(function (text) { - if (text instanceof Text) { - var txt = text.text(); - return text.clear().path(this).text(txt); - } + return this.put(path); + }), - return this.parent().put(new Text()).path(this).text(text); - }), - targets: function targets() { - return baseFind('svg [href*="' + this.id() + '"]'); - } + // Get the textPath children + textPath() { + return this.find('textPath')[0]; } - }); - TextPath.prototype.MorphArray = PathArray; - register(TextPath); - var Use = - /*#__PURE__*/ - function (_Shape) { - _inherits(Use, _Shape); - - function Use(node) { - _classCallCheck(this, Use); - - return _possibleConstructorReturn(this, _getPrototypeOf(Use).call(this, nodeOrNew('use', node), node)); - } // Use element as a reference + }, + Path: { + // creates a textPath from this path + text: wrapWithAttrCheck(function (text) { + if (text instanceof Text) { + var txt = text.text(); + return text.clear().path(this).text(txt); + } + return this.parent().put(new Text()).path(this).text(text); + }), - _createClass(Use, [{ - key: "element", - value: function element(_element, file) { - // Set lined element - return this.attr('href', (file || '') + '#' + _element, xlink); - } - }]); - - return Use; - }(Shape); - registerMethods({ - Container: { - // Create a use element - use: wrapWithAttrCheck(function (element, file) { - return this.put(new Use()).element(element, file); - }) + targets() { + return baseFind('svg [href*="' + this.id() + '"]'); } - }); - register(Use); - - /* Optional Modules */ - extend([Svg$1, Symbol, Image, Pattern, Marker], getMethodsFor('viewbox')); - extend([Line, Polyline, Polygon, Path], getMethodsFor('marker')); - extend(Text, getMethodsFor('Text')); - extend(Path, getMethodsFor('Path')); - extend(Defs, getMethodsFor('Defs')); - extend([Text, Tspan], getMethodsFor('Tspan')); - extend([Rect, Ellipse, Circle, Gradient], getMethodsFor('radius')); - extend(EventTarget, getMethodsFor('EventTarget')); - extend(Dom, getMethodsFor('Dom')); - extend(Element, getMethodsFor('Element')); - extend(Shape, getMethodsFor('Shape')); // extend(Element, getConstructor('Memory')) - - extend(Container, getMethodsFor('Container')); - extend(Runner, getMethodsFor('Runner')); - List.extend(getMethodNames()); - registerMorphableType([SVGNumber, Color, Box, Matrix, SVGArray, PointArray, PathArray]); - makeMorphable(); - - var svgMembers = /*#__PURE__*/Object.freeze({ - Morphable: Morphable, - registerMorphableType: registerMorphableType, - makeMorphable: makeMorphable, - TransformBag: TransformBag, - ObjectBag: ObjectBag, - NonMorphable: NonMorphable, - defaults: defaults, - parser: parser, - find: baseFind, - registerWindow: registerWindow, - Animator: Animator, - Controller: Controller, - Ease: Ease, - PID: PID, - Spring: Spring, - easing: easing, - Queue: Queue, - Runner: Runner, - Timeline: Timeline, - SVGArray: SVGArray, - Box: Box, - Color: Color, - EventTarget: EventTarget, - Matrix: Matrix, - SVGNumber: SVGNumber, - PathArray: PathArray, - Point: Point, - PointArray: PointArray, - List: List, - Bare: Bare, - Circle: Circle, - ClipPath: ClipPath, - Container: Container, - Defs: Defs, - Dom: Dom, - Element: Element, - Ellipse: Ellipse, - Gradient: Gradient, - G: G, - HtmlNode: HtmlNode, - A: A, - Image: Image, - Line: Line, - Marker: Marker, - Mask: Mask, - Path: Path, - Pattern: Pattern, - Polygon: Polygon, - Polyline: Polyline, - Rect: Rect, - Shape: Shape, - Stop: Stop, - Style: Style, - Svg: Svg$1, - Symbol: _Symbol, - Text: Text, - TextPath: TextPath, - Tspan: Tspan, - Use: Use, - map: map, - filter: filter, - radians: radians, - degrees: degrees, - camelCase: camelCase, - unCamelCase: unCamelCase, - capitalize: capitalize, - proportionalSize: proportionalSize, - getOrigin: getOrigin, - ns: ns, - xmlns: xmlns, - xlink: xlink, - svgjs: svgjs, - on: on, - off: off, - dispatch: dispatch, - root: root, - makeNode: makeNode, - makeInstance: makeInstance, - nodeOrNew: nodeOrNew, - adopt: adopt, - register: register, - getClass: getClass, - eid: eid, - assignNewId: assignNewId, - extend: extend, - extendWithAttrCheck: extendWithAttrCheck, - wrapWithAttrCheck: wrapWithAttrCheck - }); - function SVG(element) { - return makeInstance(element); } - Object.assign(SVG, svgMembers); - SVG.utils = SVG; - SVG.regex = regex; - SVG.get = SVG; +}); +TextPath.prototype.MorphArray = PathArray; +register(TextPath); + +class Use extends Shape { + constructor(node) { + super(nodeOrNew('use', node), node); + } // Use element as a reference - return SVG; -}()); + element(element, file) { + // Set lined element + return this.attr('href', (file || '') + '#' + element, xlink); + } + +} +registerMethods({ + Container: { + // Create a use element + use: wrapWithAttrCheck(function (element, file) { + return this.put(new Use()).element(element, file); + }) + } +}); +register(Use); + +/* Optional Modules */ +const SVG = makeInstance; +extend([Svg$1, Symbol, Image, Pattern, Marker], getMethodsFor('viewbox')); +extend([Line, Polyline, Polygon, Path], getMethodsFor('marker')); +extend(Text, getMethodsFor('Text')); +extend(Path, getMethodsFor('Path')); +extend(Defs, getMethodsFor('Defs')); +extend([Text, Tspan], getMethodsFor('Tspan')); +extend([Rect, Ellipse, Circle, Gradient], getMethodsFor('radius')); +extend(EventTarget, getMethodsFor('EventTarget')); +extend(Dom, getMethodsFor('Dom')); +extend(Element, getMethodsFor('Element')); +extend(Shape, getMethodsFor('Shape')); // extend(Element, getConstructor('Memory')) + +extend(Container, getMethodsFor('Container')); +extend(Runner, getMethodsFor('Runner')); +List.extend(getMethodNames()); +registerMorphableType([SVGNumber, Color, Box, Matrix, SVGArray, PointArray, PathArray]); +makeMorphable(); + +export { Morphable, registerMorphableType, makeMorphable, TransformBag, ObjectBag, NonMorphable, defaults, utils, namespaces, regex, SVG, parser, baseFind as find, registerWindow, Animator, Controller, Ease, PID, Spring, easing, Queue, Runner, Timeline, SVGArray as Array, Box, Color, EventTarget, Matrix, SVGNumber as Number, PathArray, Point, PointArray, List, Circle, ClipPath, Container, Defs, Dom, Element, Ellipse, Gradient, G, A, Image, Line, Marker, Mask, Path, Pattern, Polygon, Polyline, Rect, Shape, Stop, Style, Svg$1 as Svg, Symbol, Text, TextPath, Tspan, Use, on, off, dispatch, root, makeNode, makeInstance, nodeOrNew, adopt, mockAdopt, register, getClass, eid, assignNewId, extend, wrapWithAttrCheck }; +//# sourceMappingURL=svg.js.map diff --git a/dist/svg.js.map b/dist/svg.js.map index 45e0384..a67c588 100644 --- a/dist/svg.js.map +++ b/dist/svg.js.map @@ -1 +1 @@ -{"version":3,"file":"svg.js","sources":["../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_library.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/_iter-step.js","../node_modules/core-js/modules/_iterators.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_to-absolute-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-dps.js","../node_modules/core-js/modules/_html.js","../node_modules/core-js/modules/_object-create.js","../node_modules/core-js/modules/_set-to-string-tag.js","../node_modules/core-js/modules/_iter-create.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_object-gpo.js","../node_modules/core-js/modules/_iter-define.js","../node_modules/core-js/modules/es6.array.iterator.js","../node_modules/core-js/modules/web.dom.iterable.js","../src/utils/methods.js","../node_modules/core-js/modules/_fix-re-wks.js","../node_modules/core-js/modules/es6.regexp.replace.js","../src/utils/utils.js","../src/modules/core/namespaces.js","../src/utils/window.js","../src/types/Base.js","../src/utils/adopter.js","../src/modules/optional/arrange.js","../node_modules/core-js/modules/_is-regexp.js","../node_modules/core-js/modules/es6.regexp.split.js","../src/modules/core/regex.js","../src/modules/optional/class.js","../src/modules/optional/css.js","../src/modules/optional/data.js","../src/modules/optional/memory.js","../src/modules/core/event.js","../node_modules/core-js/modules/_flags.js","../node_modules/core-js/modules/es6.regexp.flags.js","../node_modules/core-js/modules/es6.regexp.to-string.js","../src/types/Color.js","../node_modules/core-js/modules/es6.regexp.match.js","../src/types/Point.js","../src/modules/core/parser.js","../src/types/Box.js","../src/types/Matrix.js","../src/types/ArrayPolyfill.js","../src/types/List.js","../src/modules/core/selector.js","../src/types/EventTarget.js","../src/modules/core/defaults.js","../src/types/SVGArray.js","../src/types/SVGNumber.js","../src/modules/core/attr.js","../src/elements/Dom.js","../src/elements/Element.js","../src/modules/optional/sugar.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../src/modules/optional/transform.js","../src/modules/core/circled.js","../src/elements/Shape.js","../src/elements/Circle.js","../src/elements/Container.js","../src/elements/Defs.js","../src/elements/Ellipse.js","../src/elements/Stop.js","../src/modules/core/gradiented.js","../src/elements/Gradient.js","../src/elements/Pattern.js","../src/elements/Image.js","../src/types/PointArray.js","../src/modules/core/pointed.js","../src/elements/Line.js","../src/elements/Marker.js","../node_modules/core-js/modules/_strict-method.js","../node_modules/core-js/modules/es6.array.sort.js","../src/animation/Controller.js","../src/types/PathArray.js","../src/animation/Morphable.js","../src/elements/Path.js","../src/modules/core/poly.js","../src/elements/Polygon.js","../src/elements/Polyline.js","../src/elements/Rect.js","../src/animation/Queue.js","../src/animation/Animator.js","../src/animation/Timeline.js","../src/animation/Runner.js","../src/elements/Svg.js","../src/elements/Symbol.js","../src/modules/core/textable.js","../src/elements/Text.js","../src/elements/Tspan.js","../src/elements/ClipPath.js","../src/elements/G.js","../src/elements/A.js","../src/elements/Mask.js","../src/elements/Style.js","../src/elements/TextPath.js","../src/elements/Use.js","../src/main.js"],"sourcesContent":["var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","module.exports = false;\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopt(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopt(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopt(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\nexport function extendWithAttrCheck (...args) {\r\n extend(...args, true)\r\n}\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n try {\r\n let clone = this.clone().addTo(parser().svg).show()\r\n box = cb(clone.node)\r\n clone.remove()\r\n } catch (e) {\r\n throw new Error('Getting a bounding box of element \"' + this.node.nodeName + '\" is not possible')\r\n }\r\n }\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox()))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect()))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer.now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n"],"names":["global","core","require$$0","require$$1","uid","isObject","document","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","cof","IObject","defined","has","hide","aFunction","ctx","redefine","toInteger","min","toIObject","toLength","toAbsoluteIndex","$keys","enumBugKeys","getKeys","IE_PROTO","PROTOTYPE","dPs","create","descriptor","setToStringTag","toObject","$iterCreate","getPrototypeOf","LIBRARY","Iterators","$export","step","addToUnscopables","ITERATOR","wks","$iterators","methods","names","registerMethods","name","m","Array","isArray","_name","addMethodNames","Object","keys","assign","getMethodsFor","getMethodNames","Set","_names","push","fails","map","array","block","i","il","length","result","filter","radians","d","Math","PI","degrees","r","camelCase","s","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","charAt","slice","proportionalSize","element","width","height","box","bbox","getOrigin","o","origin","ox","oy","string","trim","x","y","bx","includes","by","ns","xmlns","xlink","svgjs","globals","window","registerWindow","win","doc","Base","elements","root","makeNode","createElementNS","makeInstance","adopt","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","instance","className","nodeName","register","asRoot","prototype","getClass","did","eid","assignNewId","children","id","extend","modules","attrCheck","key","method","wrapWithAttrCheck","extendWithAttrCheck","args","fn","constructor","apply","attr","siblings","parent","position","index","next","prev","forward","p","removeElement","add","isRoot","appendChild","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isCss","isBlank","isNumber","isPercent","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","split","hasClass","indexOf","addClass","join","removeClass","c","toggleClass","css","style","val","ret","arguments","cssText","el","forEach","t","cased","test","show","visible","data","a","v","JSON","parse","e","stringify","remember","k","memory","forget","_memory","listenerId","getEvents","n","getEventHolder","events","getEventTarget","clearEvents","on","listener","binding","options","l","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","dispatchEvent","CustomEvent","detail","cancelable","DESCRIPTORS","$flags","fullHex","substring","compToHex","comp","toString","Color","init","color","b","match","exec","parseInt","toHex","toArray","round","toRgb","brightness","isColor","Point","source","base","clone","transform","f","point","screenCTM","inverse","parser","nodes","svg","size","path","parentNode","body","documentElement","addTo","isNulledBox","w","h","domContains","contains","call","Box","parseFloat","left","top","x2","y2","cx","cy","merge","max","xMin","Infinity","xMax","yMin","yMax","pts","addOffset","pageXOffset","pageYOffset","isNulled","getBox","cb","Error","getBBox","rbox","getBoundingClientRect","viewbox","closeEnough","threshold","abs","Matrix","fromArray","Element","matrixify","isMatrixLike","matrix","multiplyO","formatTransforms","current","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","px","py","dx","dy","tx","ty","compose","originX","originY","sx","sy","lam","rotate","translateX","translateY","decompose","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","multiply","matrixMultiply","lmultiply","inverseO","det","na","nb","nc","nd","ne","nf","translate","scale","flip","axis","around","flipO","lx","skew","tan","ly","skewXO","skewYO","aroundO","equals","other","valueOf","flipBoth","flipX","flipY","positionX","positionY","relative","relativeX","relativeY","ctm","getCTM","rect","getScreenCTM","subClassArray","Function","baseClass","_constructor","Arr","arr","List","each","fnOrMethodName","concat","reduce","obj","attrs","baseFind","query","querySelectorAll","find","EventTarget","type","j","defaultPrevented","fire","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","SVGNumber","value","unit","isNaN","toJSON","plus","number","minus","times","divide","hooks","registerAttrHook","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","leading","setAttributeNS","setAttribute","rebuild","Dom","childNodes","put","clear","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","first","get","matches","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","putIn","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","_this","createDocumentFragment","firstElementChild","words","text","textContent","Svg","dom","hasAttribute","setData","center","inside","move","parents","until","sugar","prefix","extension","mat","angle","direction","directionString","dmove","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","defineProperty","untransform","str","kv","reverse","toParent","pCtm","toRoot","decomposed","cleanRelative","Shape","Circle","circle","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","update","from","fx","fy","x1","y1","to","Gradient","stop","url","targets","gradiented","gradient","Pattern","pattern","patternUnits","Image","load","callback","img","src","image","PointArray","toLine","at","pos","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","plot","pointed","line","Marker","ref","marker","makeSetterGetter","easing","bezier","steps","stepPosition","jumps","beforeFlag","floor","jumping","Stepper","done","Ease","Controller","stepper","target","dt","recalculate","_duration","overshoot","_overshoot","eps","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","P","I","D","PathArray","pathRegReplace","arrayToString","pathHandlers","M","p0","L","H","V","C","S","Q","T","Z","A","mlhvqtcsaz","jl","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","complete","TransformBag","objOrArr","values","entries","sort","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","shift","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","nextFrame","lastFrame","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","schedule","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","lastStartTime","active","play","pause","finish","speed","yes","currentSpeed","positive","seek","dtOrForever","immediateStep","dtSource","dtTime","runnersLeft","dtToStart","reset","finished","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","animate","sanitise","loop","swing","wait","queue","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","during","loops","loopDuration","loopsDone","relativeTime","whole","partial","swinging","backwards","uncliped","pow","clipped","swingForward","forwards","progress","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","_rememberMorpher","morpher","caller","_tryRetarget","needsIt","positionOrDt","allfinished","addTransform","clearTransform","clearTransformsFromQueue","FakeRunner","mergeWith","getRunnerTransform","mergeTransforms","runners","_transformationRunners","netTransform","_frameId","RunnerArray","ids","leftSibling","getByID","lastRunner","edit","newRunner","clearBefore","deleteCnt","frameId","_clearTransformRunnersBefore","currentRunner","_currentTransform","addRunner","styleAttr","zoom","level","affine","isMatrix","currentAngle","startTransform","setup","undefined","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","newTransforms","_queueNumber","_queueNumberDelta","newTo","_queueObject","version","getElementsByTagName","nested","Symbol","symbol","plain","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","self","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","Tspan","ClipPath","unclip","clip","clipWith","clipper","G","group","link","linkTo","Mask","unmask","mask","maskWith","masker","cssRule","rule","Style","addText","params","fontFamily","fontface","TextPath","track","textPath","txt","Use","file","use","SVG"],"mappings":";;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AArB,CAAN;;AAEAkF,MAAM,CAAC0Z,SAAD,EAAY5e,aAAa,CAAC,WAAD,CAAzB,CAAN;AAEAkF,MAAM,CAAC+mB,MAAD,EAASjsB,aAAa,CAAC,QAAD,CAAtB,CAAN;AAEA4W,IAAI,CAAC1R,MAAL,CAAYjF,cAAc,EAA1B;AAEAymB,qBAAqB,CAAC,CACpBnO,SADoB,EAEpB7L,KAFoB,EAGpBqC,GAHoB,EAIpB8B,MAJoB,EAKpBwH,QALoB,EAMpBqI,UANoB,EAOpBwD,SAPoB,CAAD,CAArB;AAUAyC,aAAa;;;;"} \ No newline at end of file +{"version":3,"file":"svg.js","sources":["../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_library.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/_iter-step.js","../node_modules/core-js/modules/_iterators.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_to-absolute-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-dps.js","../node_modules/core-js/modules/_html.js","../node_modules/core-js/modules/_object-create.js","../node_modules/core-js/modules/_set-to-string-tag.js","../node_modules/core-js/modules/_iter-create.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_object-gpo.js","../node_modules/core-js/modules/_iter-define.js","../node_modules/core-js/modules/es6.array.iterator.js","../node_modules/core-js/modules/web.dom.iterable.js","../src/utils/methods.js","../node_modules/core-js/modules/_fix-re-wks.js","../node_modules/core-js/modules/es6.regexp.replace.js","../src/utils/utils.js","../src/modules/core/namespaces.js","../src/utils/window.js","../src/types/Base.js","../src/utils/adopter.js","../src/modules/optional/arrange.js","../node_modules/core-js/modules/_is-regexp.js","../node_modules/core-js/modules/es6.regexp.split.js","../src/modules/core/regex.js","../src/modules/optional/class.js","../src/modules/optional/css.js","../src/modules/optional/data.js","../src/modules/optional/memory.js","../src/modules/core/event.js","../node_modules/core-js/modules/_flags.js","../node_modules/core-js/modules/es6.regexp.flags.js","../node_modules/core-js/modules/es6.regexp.to-string.js","../src/types/Color.js","../node_modules/core-js/modules/es6.regexp.match.js","../src/types/Point.js","../src/modules/core/parser.js","../src/types/Box.js","../src/types/Matrix.js","../src/types/ArrayPolyfill.js","../src/types/List.js","../src/modules/core/selector.js","../src/types/EventTarget.js","../src/modules/core/defaults.js","../src/types/SVGArray.js","../src/types/SVGNumber.js","../src/modules/core/attr.js","../src/elements/Dom.js","../src/elements/Element.js","../src/modules/optional/sugar.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../src/modules/optional/transform.js","../src/modules/core/circled.js","../src/elements/Shape.js","../src/elements/Circle.js","../src/elements/Container.js","../src/elements/Defs.js","../src/elements/Ellipse.js","../src/elements/Stop.js","../src/modules/core/gradiented.js","../src/elements/Gradient.js","../src/elements/Pattern.js","../src/elements/Image.js","../src/types/PointArray.js","../src/modules/core/pointed.js","../src/elements/Line.js","../src/elements/Marker.js","../node_modules/core-js/modules/_strict-method.js","../node_modules/core-js/modules/es6.array.sort.js","../src/animation/Controller.js","../src/types/PathArray.js","../src/animation/Morphable.js","../src/elements/Path.js","../src/modules/core/poly.js","../src/elements/Polygon.js","../src/elements/Polyline.js","../src/elements/Rect.js","../src/animation/Queue.js","../src/animation/Animator.js","../src/animation/Timeline.js","../src/animation/Runner.js","../src/elements/Svg.js","../src/elements/Symbol.js","../src/modules/core/textable.js","../src/elements/Text.js","../src/elements/Tspan.js","../src/elements/ClipPath.js","../src/elements/G.js","../src/elements/A.js","../src/elements/Mask.js","../src/elements/Style.js","../src/elements/TextPath.js","../src/elements/Use.js","../src/main.js"],"sourcesContent":["var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","module.exports = false;\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n\r\nconst save = {}\r\n\r\nexport function saveWindow () {\r\n save.window = globals.window\r\n save.document = globals.document\r\n}\r\n\r\nexport function restoreWindow () {\r\n globals.window = save.window\r\n globals.document = save.document\r\n}\r\n\r\nexport function withWindow (win, fn) {\r\n saveWindow()\r\n registerWindow(win, win.document)\r\n fn(win, win.document)\r\n restoreWindow()\r\n}\r\n\r\nexport function getWindow () {\r\n return globals.window\r\n}\r\n","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopter(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopter(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopter(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nlet adopter = adopt\r\n\r\nexport function mockAdopt (mock = adopt) {\r\n adopter = mock\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\n// export function extendWithAttrCheck (...args) {\r\n// extend(...args, true)\r\n// }\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb, retry) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n box = retry(this)\r\n }\r\n\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox(), (el) => {\r\n try {\r\n let clone = el.clone().addTo(parser().svg).show()\r\n let box = clone.node.getBBox()\r\n clone.remove()\r\n return box\r\n } catch (e) {\r\n throw new Error('Getting bbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }\r\n }))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect(), (el) => {\r\n throw new Error('Getting rbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: () => globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer().now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\r\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n"],"names":["global","core","require$$0","require$$1","uid","isObject","document","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","cof","IObject","defined","has","hide","aFunction","ctx","redefine","toInteger","min","toIObject","toLength","toAbsoluteIndex","$keys","enumBugKeys","getKeys","IE_PROTO","PROTOTYPE","dPs","create","descriptor","setToStringTag","toObject","$iterCreate","getPrototypeOf","LIBRARY","Iterators","$export","step","addToUnscopables","ITERATOR","wks","$iterators","methods","names","registerMethods","name","m","Array","isArray","_name","addMethodNames","Object","keys","assign","getMethodsFor","getMethodNames","Set","_names","push","fails","map","array","block","i","il","length","result","filter","radians","d","Math","PI","degrees","r","camelCase","s","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","charAt","slice","proportionalSize","element","width","height","box","bbox","getOrigin","o","origin","ox","oy","string","trim","x","y","bx","includes","by","ns","xmlns","xlink","svgjs","globals","window","registerWindow","win","doc","Base","elements","root","makeNode","createElementNS","makeInstance","adopter","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","adopt","instance","className","nodeName","mockAdopt","mock","register","asRoot","prototype","getClass","did","eid","assignNewId","children","id","extend","modules","attrCheck","key","method","wrapWithAttrCheck","fn","args","constructor","apply","attr","siblings","parent","position","index","next","prev","forward","p","removeElement","add","isRoot","appendChild","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isCss","isBlank","isNumber","isPercent","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","split","hasClass","indexOf","addClass","join","removeClass","c","toggleClass","css","style","val","ret","arguments","cssText","el","forEach","t","cased","test","show","visible","data","a","v","JSON","parse","e","stringify","remember","k","memory","forget","_memory","listenerId","getEvents","n","getEventHolder","events","getEventTarget","clearEvents","on","listener","binding","options","l","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","dispatchEvent","CustomEvent","detail","cancelable","DESCRIPTORS","$flags","fullHex","substring","compToHex","comp","toString","Color","init","color","b","match","exec","parseInt","toHex","toArray","round","toRgb","brightness","isColor","Point","source","base","clone","transform","f","point","screenCTM","inverse","parser","nodes","svg","size","path","parentNode","body","documentElement","addTo","isNulledBox","w","h","domContains","contains","call","Box","parseFloat","left","top","x2","y2","cx","cy","merge","max","xMin","Infinity","xMax","yMin","yMax","pts","addOffset","pageXOffset","pageYOffset","isNulled","getBox","cb","retry","Error","getBBox","rbox","getBoundingClientRect","viewbox","closeEnough","threshold","abs","Matrix","fromArray","Element","matrixify","isMatrixLike","matrix","multiplyO","formatTransforms","current","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","px","py","dx","dy","tx","ty","compose","originX","originY","sx","sy","lam","rotate","translateX","translateY","decompose","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","multiply","matrixMultiply","lmultiply","inverseO","det","na","nb","nc","nd","ne","nf","translate","scale","flip","axis","around","flipO","lx","skew","tan","ly","skewXO","skewYO","aroundO","equals","other","valueOf","flipBoth","flipX","flipY","positionX","positionY","relative","relativeX","relativeY","ctm","getCTM","rect","getScreenCTM","subClassArray","Function","baseClass","_constructor","Arr","arr","List","each","fnOrMethodName","concat","reduce","obj","attrs","baseFind","query","querySelectorAll","find","EventTarget","type","j","defaultPrevented","fire","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","SVGNumber","value","unit","isNaN","toJSON","plus","number","minus","times","divide","hooks","registerAttrHook","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","leading","setAttributeNS","setAttribute","rebuild","Dom","childNodes","put","clear","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","first","get","matches","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","putIn","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","_this","createDocumentFragment","firstElementChild","words","text","textContent","Svg","dom","hasAttribute","setData","center","inside","move","parents","until","sugar","prefix","extension","mat","angle","direction","directionString","dmove","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","defineProperty","untransform","str","kv","reverse","toParent","pCtm","toRoot","decomposed","cleanRelative","Shape","Circle","circle","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","update","from","fx","fy","x1","y1","to","Gradient","stop","url","targets","gradiented","gradient","Pattern","pattern","patternUnits","Image","load","callback","img","src","image","PointArray","toLine","at","pos","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","plot","pointed","line","Marker","ref","marker","makeSetterGetter","easing","bezier","steps","stepPosition","jumps","beforeFlag","floor","jumping","Stepper","done","Ease","Controller","stepper","target","dt","recalculate","_duration","overshoot","_overshoot","eps","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","P","I","D","PathArray","pathRegReplace","arrayToString","pathHandlers","M","p0","L","H","V","C","S","Q","T","Z","A","mlhvqtcsaz","jl","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","complete","TransformBag","objOrArr","values","entries","sort","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","shift","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","nextFrame","lastFrame","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","schedule","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","lastStartTime","active","play","pause","finish","speed","yes","currentSpeed","positive","seek","dtOrForever","immediateStep","dtSource","dtTime","runnersLeft","dtToStart","reset","finished","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","animate","sanitise","loop","swing","wait","queue","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","during","loops","loopDuration","loopsDone","relativeTime","whole","partial","swinging","backwards","uncliped","pow","clipped","swingForward","forwards","progress","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","_rememberMorpher","morpher","caller","_tryRetarget","needsIt","positionOrDt","allfinished","addTransform","clearTransform","clearTransformsFromQueue","FakeRunner","mergeWith","getRunnerTransform","mergeTransforms","runners","_transformationRunners","netTransform","_frameId","RunnerArray","ids","leftSibling","getByID","lastRunner","edit","newRunner","clearBefore","deleteCnt","frameId","_clearTransformRunnersBefore","currentRunner","_currentTransform","addRunner","styleAttr","zoom","level","affine","isMatrix","currentAngle","startTransform","setup","undefined","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","newTransforms","_queueNumber","_queueNumberDelta","newTo","_queueObject","version","getElementsByTagName","nested","Symbol","symbol","plain","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","self","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","Tspan","ClipPath","unclip","clip","clipWith","clipper","G","group","link","linkTo","Mask","unmask","mask","maskWith","masker","cssRule","rule","Style","addText","params","fontFamily","fontface","TextPath","track","textPath","txt","Use","file","use","SVG"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAI,IAAI,GAAG,cAAc,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACjD,IAAI,OAAO,GAAG,IAAI,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;;;;;;ACAvC,IAAI,MAAM,GAAG,cAAc,GAAG,OAAO,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI;IAC7E,MAAM,GAAG,OAAO,IAAI,IAAI,WAAW,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG,IAAI;;IAE/D,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;AAC9B,IAAI,OAAO,GAAG,IAAI,QAAQ,EAAE,GAAG,GAAG,MAAM,CAAC;;;ACLzC,YAAc,GAAG,KAAK,CAAC;;;ACEvB,IAAI,MAAM,GAAG,oBAAoB,CAAC;AAClC,IAAI,KAAK,GAAGA,OAAM,CAAC,MAAM,CAAC,KAAKA,OAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;;AAEpD,CAAC,cAAc,GAAG,UAAU,GAAG,EAAE,KAAK,EAAE;EACtC,OAAO,KAAK,CAAC,GAA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oB,CAAD,CAArB;AAUAyC,aAAa;;;;"} \ No newline at end of file diff --git a/dist/svg.min.js b/dist/svg.min.js index 8e94ddb..04af364 100644 --- a/dist/svg.min.js +++ b/dist/svg.min.js @@ -1,3 +1,3 @@ /*! @svgdotjs/svg.js v3.0.0 MIT*/; -var SVG=function(){"use strict";function t(t,e){return t(e={exports:{}},e.exports),e.exports}var m=t(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),y=t(function(t){var e=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=e)}),g=(y.version,function(t){return"object"==typeof t?null!==t:"function"==typeof t}),p=function(t){if(!g(t))throw TypeError(t+" is not an object!");return t},w=function(t){try{return!!t()}catch(t){return!0}},u=!w(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),e=m.document,n=g(e)&&g(e.createElement),r=function(t){return n?e.createElement(t):{}},i=!u&&!w(function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}),s=function(t,e){if(!g(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!g(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!g(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},o=Object.defineProperty,a={f:u?Object.defineProperty:function(t,e,n){if(p(t),e=s(e,!0),p(n),i)try{return o(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},k=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},x=u?function(t,e,n){return a.f(t,e,k(1,n))}:function(t,e,n){return t[e]=n,t},h={}.hasOwnProperty,l=function(t,e){return h.call(t,e)},c=0,f=Math.random(),v=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++c+f).toString(36))},O=t(function(t){var s=v("src"),e="toString",n=Function[e],u=(""+n).split(e);y.inspectSource=function(t){return n.call(t)},(t.exports=function(t,e,n,r){var i="function"==typeof n;i&&(l(n,"name")||x(n,"name",e)),t[e]!==n&&(i&&(l(n,s)||x(n,s,t[e]?""+t[e]:u.join(String(e)))),t===m?t[e]=n:r?t[e]?t[e]=n:x(t,e,n):(delete t[e],x(t,e,n)))})(Function.prototype,e,function(){return"function"==typeof this&&this[s]||n.call(this)})}),d=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},b=function(r,i,t){if(d(r),void 0===i)return r;switch(t){case 1:return function(t){return r.call(i,t)};case 2:return function(t,e){return r.call(i,t,e)};case 3:return function(t,e,n){return r.call(i,t,e,n)}}return function(){return r.apply(i,arguments)}},_="prototype",S=function(t,e,n){var r,i,s,u,o=t&S.F,a=t&S.G,h=t&S.S,l=t&S.P,c=t&S.B,f=a?m:h?m[e]||(m[e]={}):(m[e]||{})[_],v=a?y:y[e]||(y[e]={}),d=v[_]||(v[_]={});for(r in a&&(n=e),n)s=((i=!o&&f&&void 0!==f[r])?f:n)[r],u=c&&i?b(s,m):l&&"function"==typeof s?b(Function.call,s):s,f&&O(f,r,s,t&S.U),v[r]!=s&&x(v,r,u),l&&d[r]!=s&&(d[r]=s)};m.core=y,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128;var j=S,M={}.toString,E=function(t){return M.call(t).slice(8,-1)},T=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==E(t)?t.split(""):Object(t)},C=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},P=function(t){return T(C(t))},N=Math.ceil,L=Math.floor,D=function(t){return isNaN(t=+t)?0:(0i;)l(r,n=e[i++])&&(~B(s,n)||s.push(n));return s},Q="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),U=Object.keys||function(t){return W(t,Q)},J={f:Object.getOwnPropertySymbols},$={f:{}.propertyIsEnumerable},K=function(t){return Object(C(t))},Z=Object.assign,tt=!Z||w(function(){var A={},e={},t=Symbol(),n="abcdefghijklmnopqrst";return A[t]=7,n.split("").forEach(function(t){e[t]=t}),7!=Z({},A)[t]||Object.keys(Z({},e)).join("")!=n})?function(t,e){for(var n=K(t),r=arguments.length,i=1,s=J.f,u=$.f;idocument.F=Object<\/script>"),t.close(),vt=t.F;n--;)delete vt[ft][Q[n]];return vt()},dt=Object.create||function(t,e){var n;return null!==t?(ct[ft]=p(t),n=new ct,ct[ft]=null,n[lt]=t):n=vt(),void 0===e?n:ot(n,e)},yt=a.f,pt=et("toStringTag"),mt=function(t,e,n){t&&!l(t=n?t:t.prototype,pt)&&yt(t,pt,{configurable:!0,value:e})},gt={};x(gt,et("iterator"),function(){return this});var wt=H("IE_PROTO"),bt=Object.prototype,_t=Object.getPrototypeOf||function(t){return t=K(t),l(t,wt)?t[wt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?bt:null},kt=et("iterator"),xt=!([].keys&&"next"in[].keys()),Ot="values",St=function(){return this},At=function(t,e,n,r,i,s,u){var o,a,h;a=e,h=r,(o=n).prototype=dt(gt,{next:k(1,h)}),mt(o,a+" Iterator");var l,c,f,v=function(t){if(!xt&&t in m)return m[t];switch(t){case"keys":case Ot:return function(){return new n(this,t)}}return function(){return new n(this,t)}},d=e+" Iterator",y=i==Ot,p=!1,m=t.prototype,g=m[kt]||m["@@iterator"]||i&&m[i],w=g||v(i),b=i?y?v("entries"):w:void 0,_="Array"==e&&m.entries||g;if(_&&(f=_t(_.call(new t)))!==Object.prototype&&f.next&&(mt(f,d,!0),"function"!=typeof f[kt]&&x(f,kt,St)),y&&g&&g.name!==Ot&&(p=!0,w=function(){return g.call(this)}),(xt||p||!m[kt])&&x(m,kt,w),ut[e]=w,ut[d]=St,i)if(l={values:y?w:v(Ot),keys:s?w:v("keys"),entries:b},u)for(c in l)c in m||O(m,c,l[c]);else j(j.P+j.F*(xt||p),e,l);return l},jt=At(Array,"Array",function(t,e){this._t=P(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,st(1)):st(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");ut.Arguments=ut.Array,it("keys"),it("values"),it("entries");for(var Mt=et("iterator"),Et=et("toStringTag"),Tt=ut.Array,Ct={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Pt=U(Ct),Nt=0;Nt=e.length?{value:void 0,done:!0}:(t=Ut(e,n),this._i+=t.length,{value:t,done:!1})});var Jt=function(t,e,n){for(var r in e)O(t,r,e[r],n);return t},$t=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},Kt=function(e,t,n,r){try{return r?t(p(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&p(i.call(e)),t}},Zt=et("iterator"),te=Array.prototype,ee=et("toStringTag"),ne="Arguments"==E(function(){return arguments}()),re=et("iterator"),ie=y.getIteratorMethod=function(t){if(null!=t)return t[re]||t["@@iterator"]||ut[(e=t,void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(n=Object(e),ee))?r:ne?E(n):"Object"==(i=E(n))&&"function"==typeof n.callee?"Arguments":i)];var e,n,r,i},se=t(function(t){var v={},d={},e=t.exports=function(t,e,n,r,i){var s,u,o,a,h,l=i?function(){return t}:ie(t),c=b(n,r,e?2:1),f=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(void 0===(h=l)||ut.Array!==h&&te[Zt]!==h){for(o=l.call(t);!(u=o.next()).done;)if((a=Kt(o,c,u.value,e))===v||a===d)return a}else for(s=R(t.length);fu;)s.call(t,r=i[u++])&&e.push(r);return e}(e=P(e)),i=0,s=r.length;ii;)l(He,e=n[i++])||e==Ie||e==Ce||r.push(e);return r},rn=function(t){for(var e,n=t===Be,r=Le(n?Ge:P(t)),i=[],s=0;r.length>s;)!l(He,e=r[s++])||n&&!l(Be,e)||i.push(He[e]);return i};Ve||(O((De=function(){if(this instanceof De)throw TypeError("Symbol is not a constructor!");var e=v(0un;)et(sn[un++]);for(var on=U(et.store),an=0;on.length>an;)xe(on[an++]);j(j.S+j.F*!Ve,"Symbol",{for:function(t){return l(Xe,t+="")?Xe[t]:Xe[t]=De(t)},keyFor:function(t){if(!$e(t))throw TypeError(t+" is not a symbol!");for(var e in Xe)if(Xe[e]===t)return e},useSetter:function(){Qe=!0},useSimple:function(){Qe=!1}}),j(j.S+j.F*!Ve,"Object",{create:function(t,e){return void 0===e?dt(t):Ze(dt(t),e)},defineProperty:Ke,defineProperties:Ze,getOwnPropertyDescriptor:en,getOwnPropertyNames:nn,getOwnPropertySymbols:rn}),Fe&&j(j.S+j.F*(!Ve||w(function(){var t=De();return"[null]"!=Re([t])||"{}"!=Re({a:t})||"{}"!=Re(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(g(e)||void 0!==t)&&!$e(t))return Oe(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!$e(e))return e}),r[1]=e,Re.apply(Fe,r)}}),De[ze][qe]||x(De[ze],qe,De[ze].valueOf),mt(De,"Symbol"),mt(Math,"Math",!0),mt(m.JSON,"JSON",!0);var hn={},ln=[];function cn(t,e){if(Array.isArray(t)){var n=!0,r=!1,i=void 0;try{for(var s,u=t[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){cn(s.value,e)}}catch(t){r=!0,i=t}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}}else if("object"!==Wt(t))vn(Object.keys(e)),hn[t]=Object.assign(hn[t]||{},e);else for(var o in t)cn(o,t[o])}function fn(t){return hn[t]||{}}function vn(t){ln.push.apply(ln,be(t))}var dn=q(!0);j(j.P,"Array",{includes:function(t){return dn(this,t,1>>0,f=new RegExp(t.source,h+"g");for(g||(r=new RegExp("^"+f.source+"$(?!\\s)",h));(i=f.exec(n))&&!(l<(s=i.index+i[0][p])&&(a.push(n.slice(l,i.index)),!g&&1=c));)f[m]===i.index&&f[m]++;return l===n[p]?!u&&f.test("")||a.push(""):a.push(n.slice(l)),a[p]>c?a.slice(0,c):a}}else"0"[t](void 0,0)[p]&&(u=function(t,e){return void 0===t&&0===e?[]:d.call(this,t,e)});return[function(t,e){var n=i(this),r=null==t?void 0:t[s];return void 0!==r?r.call(t,n,e):u.call(String(n),t,e)},u]});var Un=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,Jn=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,$n=/rgb\((\d+),(\d+),(\d+)\)/,Kn=/(#[a-z0-9\-_]+)/i,Zn=/\)\s*,?\s*/,tr=/\s/g,er=/^#[a-f0-9]{3,6}$/i,nr=/^rgb\(/,rr=/^(\s+)?$/,ir=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,sr=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,ur=/[\s,]+/,or=/([^e])-/gi,ar=/[MLHVCSQTAZ]/gi,hr=/[MLHVCSQTAZ]/i,lr=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,cr=/\./g,fr=Object.freeze({numberAndUnit:Un,hex:Jn,rgb:$n,reference:Kn,transforms:Zn,whitespace:tr,isHex:er,isRgb:nr,isCss:/[^:]+:[^;]+;?/,isBlank:rr,isNumber:ir,isPercent:/^-?[\d.]+%$/,isImage:sr,delimiter:ur,hyphen:or,pathLetters:ar,isPathLetter:hr,numbersWithDots:lr,dots:cr});cn("Dom",{classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(ur)},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)}}),cn("Dom",{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 r=!0,i=!1,s=void 0;try{for(var u,o=t[Symbol.iterator]();!(r=(u=o.next()).done);r=!0){var a=kn(u.value);n[a]=this.node.style[a]}}catch(t){i=!0,s=t}finally{try{r||null==o.return||o.return()}finally{if(i)throw s}}return n}if("string"==typeof t)return this.node.style[kn(t)];if("object"===Wt(t))for(var h in t)this.node.style[kn(h)]=null==t[h]||rr.test(t[h])?"":t[h]}return 2===arguments.length&&(this.node.style[kn(t)]=null==e||rr.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),cn("Dom",{data:function(e,t,n){if("object"===Wt(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}}),cn("Dom",{remember:function(t,e){if("object"===Wt(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=this._memory||{}}});var vr=0;function dr(t){var e=In(t).getEventHolder();return e.events||(e.events={}),e.events}function yr(t){return In(t).getEventTarget()}function pr(t,e,r,n,i){var s=r.bind(n||t),u=dr(t),o=yr(t);e=Array.isArray(e)?e:e.split(ur),r._svgjsListenerId||(r._svgjsListenerId=++vr),e.forEach(function(t){var e=t.split(".")[0],n=t.split(".")[1]||"*";u[e]=u[e]||{},u[e][n]=u[e][n]||{},u[e][n][r._svgjsListenerId]=s,o.addEventListener(e,s,i||!1)})}function mr(u,t,o,a){var h=dr(u),l=yr(u);("function"!=typeof o||(o=o._svgjsListenerId))&&(t=Array.isArray(t)?t:(t||"").split(ur)).forEach(function(t){var e,n,r,i=t&&t.split(".")[0],s=t&&t.split(".")[1];if(o)h[i]&&h[i][s||"*"]&&(l.removeEventListener(i,h[i][s||"*"][o],a||!1),delete h[i][s||"*"][o]);else if(i&&s){if(h[i]&&h[i][s]){for(n in h[i][s])mr(l,[i,s].join("."),n);delete h[i][s]}}else if(s)for(t in h)for(e in h[t])s===e&&mr(l,[t,s].join("."));else if(i){if(h[i]){for(e in h[i])mr(l,[i,e].join("."));delete h[i]}}else{for(t in h)mr(l,t);(r=In(u).getEventHolder()).events&&(r.events={})}})}function gr(t,e,n){var r=yr(t);return e instanceof Nn.window.Event||(e=new Nn.window.CustomEvent(e,{detail:n,cancelable:!0})),r.dispatchEvent(e),e}function wr(t,e){for(var n=0;n",delay:0},Vr={"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"},Wr=Object.freeze({noop:Gr,timeline:Br,attrs:Vr}),Qr=qr("SVGArray",Array,function(t){this.init(t)});Wn(Qr,{init:function(t){return"number"==typeof t||(this.length=0,this.push.apply(this,be(this.parse(t)))),this},toArray:function(){return Array.prototype.concat.apply([],this)},toString:function(){return this.join(" ")},valueOf:function(){var t=[];return t.push.apply(t,be(this)),t},parse:function(){var t=0n.x&&e>n.y&&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(e,n,r,i){return function(t){return t<0?0=e.time?e.run():Xi.timeouts.push(e),e!==n););for(var r=null,i=Xi.frames.last();r!==i&&(r=Xi.frames.shift());)r.run();Xi.transforms.forEach(function(t){t()}),Xi.nextDraw=Xi.timeouts.first()||Xi.frames.first()?Nn.window.requestAnimationFrame(Xi._draw):null}},Hi=function(t){var e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Gi=function(){var t=Nn.window;return(t.performance||t.Date).now()},Bi=function(t){function n(){var t,e=0r;this._lastTime=this._time,i&&this.fire("start",this);var u=this._isDeclarative;if(this.done=!u&&!s&&this._time>=r,this._reseted=!1,n||u){this._initialise(n),this.transforms=new Ir;var o=this._run(u?t:e);this.fire("step",this)}return this.done=this.done||o&&u,this.done&&this.fire("finish",this),this}},{key:"reset",value:function(){return this._reseted||(this.loops(0),this._reseted=!0),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 ki(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.retarget?this._history[t].caller.retarget(e):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var r=this.timeline();return r&&r._continue(),!0}return!1}},{key:"_initialise",value:function(t){if(t||this._isDeclarative)for(var e=0,n=this._queue.length;ei;)l(r,n=e[i++])&&(~B(s,n)||s.push(n));return s},Q="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),U=Object.keys||function(t){return W(t,Q)},J={f:Object.getOwnPropertySymbols},$={f:{}.propertyIsEnumerable},K=function(t){return Object(C(t))},Z=Object.assign,tt=!Z||w(function(){var A={},e={},t=Symbol(),n="abcdefghijklmnopqrst";return A[t]=7,n.split("").forEach(function(t){e[t]=t}),7!=Z({},A)[t]||Object.keys(Z({},e)).join("")!=n})?function(t,e){for(var n=K(t),r=arguments.length,i=1,s=J.f,o=$.f;idocument.F=Object<\/script>"),t.close(),vt=t.F;n--;)delete vt[ft][Q[n]];return vt()},dt=Object.create||function(t,e){var n;return null!==t?(ct[ft]=p(t),n=new ct,ct[ft]=null,n[lt]=t):n=vt(),void 0===e?n:ut(n,e)},yt=a.f,pt=et("toStringTag"),mt=function(t,e,n){t&&!l(t=n?t:t.prototype,pt)&&yt(t,pt,{configurable:!0,value:e})},gt={};x(gt,et("iterator"),function(){return this});var wt=H("IE_PROTO"),bt=Object.prototype,_t=Object.getPrototypeOf||function(t){return t=K(t),l(t,wt)?t[wt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?bt:null},kt=et("iterator"),xt=!([].keys&&"next"in[].keys()),Ot="values",St=function(){return this},At=function(t,e,n,r,i,s,o){var u,a,h;a=e,h=r,(u=n).prototype=dt(gt,{next:k(1,h)}),mt(u,a+" Iterator");var l,c,f,v=function(t){if(!xt&&t in m)return m[t];switch(t){case"keys":case Ot:return function(){return new n(this,t)}}return function(){return new n(this,t)}},d=e+" Iterator",y=i==Ot,p=!1,m=t.prototype,g=m[kt]||m["@@iterator"]||i&&m[i],w=g||v(i),b=i?y?v("entries"):w:void 0,_="Array"==e&&m.entries||g;if(_&&(f=_t(_.call(new t)))!==Object.prototype&&f.next&&(mt(f,d,!0),"function"!=typeof f[kt]&&x(f,kt,St)),y&&g&&g.name!==Ot&&(p=!0,w=function(){return g.call(this)}),(xt||p||!m[kt])&&x(m,kt,w),ot[e]=w,ot[d]=St,i)if(l={values:y?w:v(Ot),keys:s?w:v("keys"),entries:b},o)for(c in l)c in m||O(m,c,l[c]);else j(j.P+j.F*(xt||p),e,l);return l},jt=At(Array,"Array",function(t,e){this._t=P(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,st(1)):st(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");ot.Arguments=ot.Array,it("keys"),it("values"),it("entries");for(var Mt=et("iterator"),Et=et("toStringTag"),Tt=ot.Array,Ct={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Pt=U(Ct),Nt=0;Nt=e.length?{value:void 0,done:!0}:(t=Ut(e,n),this._i+=t.length,{value:t,done:!1})});var Jt=function(t,e,n){for(var r in e)O(t,r,e[r],n);return t},$t=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t},Kt=function(e,t,n,r){try{return r?t(p(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&p(i.call(e)),t}},Zt=et("iterator"),te=Array.prototype,ee=et("toStringTag"),ne="Arguments"==E(function(){return arguments}()),re=et("iterator"),ie=y.getIteratorMethod=function(t){if(null!=t)return t[re]||t["@@iterator"]||ot[(e=t,void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(n=Object(e),ee))?r:ne?E(n):"Object"==(i=E(n))&&"function"==typeof n.callee?"Arguments":i)];var e,n,r,i},se=t(function(t){var v={},d={},e=t.exports=function(t,e,n,r,i){var s,o,u,a,h,l=i?function(){return t}:ie(t),c=b(n,r,e?2:1),f=0;if("function"!=typeof l)throw TypeError(t+" is not iterable!");if(void 0===(h=l)||ot.Array!==h&&te[Zt]!==h){for(u=l.call(t);!(o=u.next()).done;)if((a=Kt(u,c,o.value,e))===v||a===d)return a}else for(s=R(t.length);fo;)s.call(t,r=i[o++])&&e.push(r);return e}(e=P(e)),i=0,s=r.length;ii;)l(Ge,e=n[i++])||e==Ie||e==Ce||r.push(e);return r},rn=function(t){for(var e,n=t===Be,r=Le(n?He:P(t)),i=[],s=0;r.length>s;)!l(Ge,e=r[s++])||n&&!l(Be,e)||i.push(Ge[e]);return i};Ve||(O((De=function(){if(this instanceof De)throw TypeError("Symbol is not a constructor!");var e=v(0on;)et(sn[on++]);for(var un=U(et.store),an=0;un.length>an;)xe(un[an++]);j(j.S+j.F*!Ve,"Symbol",{for:function(t){return l(Xe,t+="")?Xe[t]:Xe[t]=De(t)},keyFor:function(t){if(!$e(t))throw TypeError(t+" is not a symbol!");for(var e in Xe)if(Xe[e]===t)return e},useSetter:function(){Qe=!0},useSimple:function(){Qe=!1}}),j(j.S+j.F*!Ve,"Object",{create:function(t,e){return void 0===e?dt(t):Ze(dt(t),e)},defineProperty:Ke,defineProperties:Ze,getOwnPropertyDescriptor:en,getOwnPropertyNames:nn,getOwnPropertySymbols:rn}),Fe&&j(j.S+j.F*(!Ve||w(function(){var t=De();return"[null]"!=Re([t])||"{}"!=Re({a:t})||"{}"!=Re(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(g(e)||void 0!==t)&&!$e(t))return Oe(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!$e(e))return e}),r[1]=e,Re.apply(Fe,r)}}),De[ze][qe]||x(De[ze],qe,De[ze].valueOf),mt(De,"Symbol"),mt(Math,"Math",!0),mt(m.JSON,"JSON",!0);var hn={},ln=[];function cn(t,e){if(Array.isArray(t)){var n=!0,r=!1,i=void 0;try{for(var s,o=t[Symbol.iterator]();!(n=(s=o.next()).done);n=!0){cn(s.value,e)}}catch(t){r=!0,i=t}finally{try{n||null==o.return||o.return()}finally{if(r)throw i}}}else if("object"!==Wt(t))vn(Object.keys(e)),hn[t]=Object.assign(hn[t]||{},e);else for(var u in t)cn(u,t[u])}function fn(t){return hn[t]||{}}function vn(t){ln.push.apply(ln,be(t))}var dn=q(!0);j(j.P,"Array",{includes:function(t){return dn(this,t,1>>0,f=new RegExp(t.source,h+"g");for(g||(r=new RegExp("^"+f.source+"$(?!\\s)",h));(i=f.exec(n))&&!(l<(s=i.index+i[0][p])&&(a.push(n.slice(l,i.index)),!g&&1=c));)f[m]===i.index&&f[m]++;return l===n[p]?!o&&f.test("")||a.push(""):a.push(n.slice(l)),a[p]>c?a.slice(0,c):a}}else"0"[t](void 0,0)[p]&&(o=function(t,e){return void 0===t&&0===e?[]:d.call(this,t,e)});return[function(t,e){var n=i(this),r=null==t?void 0:t[s];return void 0!==r?r.call(t,n,e):o.call(String(n),t,e)},o]});var Jn=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,$n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Kn=/rgb\((\d+),(\d+),(\d+)\)/,Zn=/(#[a-z0-9\-_]+)/i,tr=/\)\s*,?\s*/,er=/\s/g,nr=/^#[a-f0-9]{3,6}$/i,rr=/^rgb\(/,ir=/^(\s+)?$/,sr=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,or=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,ur=/[\s,]+/,ar=/([^e])-/gi,hr=/[MLHVCSQTAZ]/gi,lr=/[MLHVCSQTAZ]/i,cr=/((\d?\.\d+(?:e[+-]?\d+)?)((?:\.\d+(?:e[+-]?\d+)?)+))+/gi,fr=/\./g,vr=Object.freeze({numberAndUnit:Jn,hex:$n,rgb:Kn,reference:Zn,transforms:tr,whitespace:er,isHex:nr,isRgb:rr,isCss:/[^:]+:[^;]+;?/,isBlank:ir,isNumber:sr,isPercent:/^-?[\d.]+%$/,isImage:or,delimiter:ur,hyphen:ar,pathLetters:hr,isPathLetter:lr,numbersWithDots:cr,dots:fr});cn("Dom",{classes:function(){var t=this.attr("class");return null==t?[]:t.trim().split(ur)},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)}}),cn("Dom",{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 r=!0,i=!1,s=void 0;try{for(var o,u=t[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){var a=kn(o.value);n[a]=this.node.style[a]}}catch(t){i=!0,s=t}finally{try{r||null==u.return||u.return()}finally{if(i)throw s}}return n}if("string"==typeof t)return this.node.style[kn(t)];if("object"===Wt(t))for(var h in t)this.node.style[kn(h)]=null==t[h]||ir.test(t[h])?"":t[h]}return 2===arguments.length&&(this.node.style[kn(t)]=null==e||ir.test(e)?"":e),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),cn("Dom",{data:function(e,t,n){if("object"===Wt(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}}),cn("Dom",{remember:function(t,e){if("object"===Wt(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=this._memory||{}}});var dr=0;function yr(t){var e=In(t).getEventHolder();return e.events||(e.events={}),e.events}function pr(t){return In(t).getEventTarget()}function mr(t,e,r,n,i){var s=r.bind(n||t),o=yr(t),u=pr(t);e=Array.isArray(e)?e:e.split(ur),r._svgjsListenerId||(r._svgjsListenerId=++dr),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][r._svgjsListenerId]=s,u.addEventListener(e,s,i||!1)})}function gr(o,t,u,a){var h=yr(o),l=pr(o);("function"!=typeof u||(u=u._svgjsListenerId))&&(t=Array.isArray(t)?t:(t||"").split(ur)).forEach(function(t){var e,n,r,i=t&&t.split(".")[0],s=t&&t.split(".")[1];if(u)h[i]&&h[i][s||"*"]&&(l.removeEventListener(i,h[i][s||"*"][u],a||!1),delete h[i][s||"*"][u]);else if(i&&s){if(h[i]&&h[i][s]){for(n in h[i][s])gr(l,[i,s].join("."),n);delete h[i][s]}}else if(s)for(t in h)for(e in h[t])s===e&&gr(l,[t,s].join("."));else if(i){if(h[i]){for(e in h[i])gr(l,[i,e].join("."));delete h[i]}}else{for(t in h)gr(l,t);(r=In(o).getEventHolder()).events&&(r.events={})}})}function wr(t,e,n){var r=pr(t);return e instanceof Nn.window.Event||(e=new Nn.window.CustomEvent(e,{detail:n,cancelable:!0})),r.dispatchEvent(e),e}function br(t,e){for(var n=0;n",delay:0},Wr={"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"},Qr=Object.freeze({noop:Br,timeline:Vr,attrs:Wr}),Ur=Yr("SVGArray",Array,function(t){this.init(t)});Qn(Ur,{init:function(t){return"number"==typeof t||(this.length=0,this.push.apply(this,be(this.parse(t)))),this},toArray:function(){return Array.prototype.concat.apply([],this)},toString:function(){return this.join(" ")},valueOf:function(){var t=[];return t.push.apply(t,be(this)),t},parse:function(){var t=0n.x&&e>n.y&&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(e,n,r,i){return function(t){return t<0?0=e.time?e.run():Gi.timeouts.push(e),e!==n););for(var r=null,i=Gi.frames.last();r!==i&&(r=Gi.frames.shift());)r.run();Gi.transforms.forEach(function(t){t()}),Gi.nextDraw=Gi.timeouts.first()||Gi.frames.first()?Nn.window.requestAnimationFrame(Gi._draw):null}},Hi=function(t){var e=t.start,n=t.runner.duration();return{start:e,duration:n,end:e+n,runner:t.runner}},Bi=function(){var t=Nn.window;return(t.performance||t.Date).now()},Vi=function(t){function n(){var t,e=0r;this._lastTime=this._time,i&&this.fire("start",this);var o=this._isDeclarative;if(this.done=!o&&!s&&this._time>=r,this._reseted=!1,n||o){this._initialise(n),this.transforms=new qr;var u=this._run(o?t:e);this.fire("step",this)}return this.done=this.done||u&&o,this.done&&this.fire("finish",this),this}},{key:"reset",value:function(){return this._reseted||(this.loops(0),this._reseted=!0),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 xi(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.retarget?this._history[t].caller.retarget(e):this._history[t].morpher.to(e),this._history[t].caller.finished=!1;var r=this.timeline();return r&&r._continue(),!0}return!1}},{key:"_initialise",value:function(t){if(t||this._isDeclarative)for(var e=0,n=this._queue.length;e 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","exports.f = require('./_wks');\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","require('./_wks-define')('asyncIterator');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopt(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopt(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopt(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\nexport function extendWithAttrCheck (...args) {\r\n extend(...args, true)\r\n}\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import getPrototypeOf from \"./getPrototypeOf\";\nimport superPropBase from \"./superPropBase\";\nexport default function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}","import getPrototypeOf from \"./getPrototypeOf\";\nexport default function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n try {\r\n let clone = this.clone().addTo(parser().svg).show()\r\n box = cb(clone.node)\r\n clone.remove()\r\n } catch (e) {\r\n throw new Error('Getting a bounding box of element \"' + this.node.nodeName + '\" is not possible')\r\n }\r\n }\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox()))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect()))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer.now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n","import * as svgMembers from './main.js'\r\nimport { makeInstance } from './utils/adopter.js'\r\n\r\n// The main wrapping element\r\nexport default function SVG (element) {\r\n return makeInstance(element)\r\n}\r\n\r\nObject.assign(SVG, svgMembers)\r\n"],"names":["global","module","window","Math","self","Function","__g","core","version","__e","it","isObject","TypeError","exec","e","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","value","bitmap","enumerable","configurable","writable","object","key","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","TO_STRING","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","String","prototype","this","that","length","aFunction","b","c","apply","arguments","PROTOTYPE","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","IObject","defined","ceil","floor","isNaN","min","toInteger","max","IS_INCLUDES","$this","el","fromIndex","index","toIObject","toLength","SHARED","store","push","mode","copyright","shared","uid","arrayIndexOf","IE_PROTO","names","i","result","keys","$keys","enumBugKeys","getOwnPropertySymbols","$assign","assign","A","Symbol","K","forEach","k","T","toObject","aLen","getSymbols","gOPS","isEnum","pIE","getKeys","j","USE_SYMBOL","UNSCOPABLES","ArrayProto","Array","done","defineProperties","Properties","documentElement","Empty","createDict","iframeDocument","iframe","style","display","appendChild","src","contentWindow","open","write","lt","close","create","dPs","def","TAG","tag","stat","IteratorPrototype","ObjectProto","getPrototypeOf","constructor","ITERATOR","BUGGY","VALUES","returnThis","Base","NAME","Constructor","next","DEFAULT","IS_SET","FORCED","descriptor","setToStringTag","methods","getMethod","kind","proto","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","Iterators","values","iterated","_t","_i","_k","step","Arguments","wks","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","$iterators","KEY","fails","FProto","nameRE","_typeof2","obj","iterator","_typeof","match","$at","pos","s","l","charCodeAt","charAt","point","forbiddenField","ret","ARG","getIteratorMethod","tryGet","callee","BREAK","RETURN","iterable","iterFn","getIterFn","SPECIES","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","TYPE","SIZE","DESCRIPTORS","getEntry","entry","_f","n","getConstructor","wrapper","IS_MAP","ADDER","C","anInstance","_l","forOf","redefineAll","clear","validate","data","r","p","delete","prev","callbackfn","v","setStrong","$iterDefine","SAFE_CLOSING","gOPD","getOwnPropertyDescriptor","check","setPrototypeOf","set","test","buggy","__proto__","common","IS_WEAK","fixMethod","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","skipClosing","arr","iter","$iterDetect","BUGGY_ZERO","$instance","add","strong","_toConsumableArray","isArray","arr2","arrayWithoutHoles","from","iterableToArray","nonIterableSpread","$Symbol","wksExt","arg","hiddenKeys","getOwnPropertyNames","gOPN","windowNames","getWindowNames","$GOPD","$DP","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","$fails","_create","D","protoDesc","wrap","sym","isSymbol","$defineProperty","$defineProperties","symbols","enumKeys","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","$set","require$$3","es6Symbols","wellKnownSymbols","wksDefine","for","keyFor","useSetter","useSimple","replacer","$replacer","args","require$$5","registerMethods","m","addMethodNames","_name","getMethodsFor","_names","$includes","includes","MATCH","isRegExp","INCLUDES","re","searchString","context","indexOf","SYMBOL","fns","strfn","rxfn","RegExp","string","map","array","block","il","radians","d","PI","camelCase","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","proportionalSize","element","width","height","box","bbox","getOrigin","o","ox","oy","origin","trim","x","y","bx","by","REPLACE","$replace","searchValue","replaceValue","ns","xmlns","xlink","svgjs","globals","_classCallCheck","elements","root","makeNode","createElementNS","makeInstance","adopt","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","className","nodeName","register","asRoot","getClass","did","eid","assignNewId","children","extend","modules","attrCheck","method","wrapWithAttrCheck","attr","siblings","parent","position","forward","removeElement","isRoot","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","separator","limit","separator2","lastIndex","lastLength","output","flags","ignoreCase","multiline","unicode","sticky","lastLastIndex","splitLimit","separatorCopy","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isBlank","isNumber","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","hasClass","addClass","removeClass","filter","toggleClass","css","cssText","t","cased","show","visible","parse","remember","memory","forget","_memory","listenerId","getEvents","getEventHolder","events","getEventTarget","on","listener","binding","options","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","CustomEvent","detail","cancelable","dispatchEvent","_defineProperties","props","_createClass","protoProps","staticProps","define","compToHex","comp","$flags","Color","init","color","parseInt","substring","toHex","round","_assertThisInitialized","ReferenceError","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","_get","property","receiver","Reflect","base","superPropBase","desc","_setPrototypeOf","_inherits","subClass","superClass","$match","regexp","Point","parser","nodes","svg","size","path","parentNode","body","addTo","isNulledBox","h","Box","parseFloat","left","top","x2","y2","cx","cy","xMin","Infinity","xMax","yMin","yMax","transform","pageXOffset","pageYOffset","getBox","cb","contains","Error","clone","closeEnough","threshold","abs","viewbox","Matrix","fromArray","Element","matrixify","isMatrixLike","multiplyO","formatTransforms","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","py","dx","dy","tx","ty","originX","originY","sx","sy","lam","rotate","translateX","translateY","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","matrix","matrixMultiply","det","na","nb","nc","nd","ne","nf","inverseO","axis","around","flipO","lx","tan","ly","skew","aroundO","other","flipBoth","flip","flipX","flipY","scale","positionX","positionY","translate","relative","relativeX","relativeY","subClassArray","baseClass","_constructor","Arr","List","baseFind","query","querySelectorAll","each","fnOrMethodName","toArray","reduce","attrs","EventTarget","defaultPrevented","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","Set","SVGNumber","unit","number","hooks","Dom","childNodes","put","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","current","_this","createDocumentFragment","firstElementChild","text","textContent","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","isColor","leading","setAttributeNS","setAttribute","rebuild","find","Svg","dom","hasAttribute","setData","until","parents","getBBox","rbox","getBoundingClientRect","screenCTM","inverse","addOffset","ctm","getCTM","getScreenCTM","rect","sugar","prefix","_objectSpread","ownKeys","divide","extension","mat","angle","direction","directionString","dmove","plus","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","untransform","str","kv","reverse","lmultiply","toParent","pCtm","multiply","toRoot","decomposed","decompose","Shape","Circle","circle","move","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","fx","fy","x1","y1","to","Gradient","update","url","gradiented","gradient","Pattern","pattern","patternUnits","Image","callback","img","image","load","PointArray","toLine","at","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","pointed","line","plot","Marker","marker","ref","$sort","sort","makeSetterGetter","comparefn","easing","bezier","steps","stepPosition","jumps","beforeFlag","jumping","Stepper","Ease","Controller","stepper","dt","recalculate","_duration","overshoot","_overshoot","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","I","PathArray","pathRegReplace","pathHandlers","M","p0","L","H","V","Q","Z","mlhvqtcsaz","jl","arrayToString","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","TransformBag","objOrArr","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","shift","nextFrame","lastFrame","first","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","active","pause","speed","yes","currentSpeed","positive","dtOrForever","immediateStep","dtSource","dtTime","fire","runnersLeft","dtToStart","reset","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","sanitise","loop","schedule","times","swing","wait","animate","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","finished","queue","loopDuration","loopsDone","partial","swinging","backwards","uncliped","pow","loops","swingForward","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","morpher","caller","needsIt","positionOrDt","allfinished","FakeRunner","mergeWith","getRunnerTransform","RunnerArray","runners","ids","leftSibling","lastRunner","_this2","edit","newRunner","deleteCnt","clearTransformsFromQueue","frameId","play","_clearTransformRunnersBefore","currentRunner","_transformationRunners","clearBefore","_currentTransform","addRunner","netTransform","merge","_frameId","styleAttr","zoom","level","affine","_tryRetarget","isMatrix","currentAngle","startTransform","clearTransform","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","addTransform","newTransforms","_rememberMorpher","_queueNumber","_queueNumberDelta","newTo","_queueObject","center","getElementsByTagName","nested","symbol","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","plain","Tspan","ClipPath","targets","unclip","clip","clipWith","clipper","group","link","linkTo","Mask","unmask","mask","maskWith","masker","Style","params","rule","fontFamily","addText","cssRule","fontface","$create","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","$find","original","res","forced","TextPath","track","textPath","txt","Use","file","use","SVG","win","doc","svgMembers"],"mappings":";iHACA,IAAIA,EAASC,UAAkC,oBAAVC,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DC,SAAS,cAATA,GACc,iBAAPC,MAAiBA,IAAMN,qBCLlC,IAAIO,EAAON,UAAiB,CAAEO,QAAS,SACrB,iBAAPC,MAAiBA,IAAMF,kBCDjB,SAAUG,GACzB,MAAqB,iBAAPA,EAAyB,OAAPA,EAA4B,mBAAPA,MCAtC,SAAUA,GACzB,IAAKC,EAASD,GAAK,MAAME,UAAUF,EAAK,sBACxC,OAAOA,KCHQ,SAAUG,GACzB,IACE,QAASA,IACT,MAAOC,GACP,OAAO,OCHOC,EAAoB,WACpC,OAA+E,GAAxEC,OAAOC,eAAe,GAAI,IAAK,CAAEC,IAAK,WAAc,OAAO,KAAQC,ICDxEC,EAAWL,EAAqBK,SAEhCC,EAAKV,EAASS,IAAaT,EAASS,EAASE,iBAChC,SAAUZ,GACzB,OAAOW,EAAKD,EAASE,cAAcZ,GAAM,OCLzBK,IAA8BQ,EAAoB,WAClE,OAA4G,GAArGP,OAAOC,eAAeO,EAAyB,OAAQ,IAAK,CAAEN,IAAK,WAAc,OAAO,KAAQC,MCGxF,SAAUT,EAAIe,GAC7B,IAAKd,EAASD,GAAK,OAAOA,EAC1B,IAAIgB,EAAIC,EACR,GAAIF,GAAkC,mBAArBC,EAAKhB,EAAGkB,YAA4BjB,EAASgB,EAAMD,EAAGG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G,GAAM1uB,GAwDnBiB,GAAO,CACLqU,GACAnqB,GACA4uB,MACAH,QACAuB,QACChf,GAAc,YAEjB8E,GAAO,CACL8Z,KACAgF,SACAH,QACAF,MACCvjB,GAAc,WAEjB8E,GAAOoqB,KAAMlvB,GAAc,SAC3B8E,GAAOye,KAAMvjB,GAAc,SAE3B8E,GAAO4X,KAAM1c,GAAc,SAE3B8E,GAAO,CACLoqB,KACAc,OACChwB,GAAc,UAEjB8E,GAAO,CACLgf,KACAnH,QACAP,OACAgB,UACCpd,GAAc,WAEjB8E,GAAOmQ,GAAajV,GAAc,gBAClC8E,GAAOqR,IAAKnW,GAAc,QAC1B8E,GAAO6K,QAAS3P,GAAc,YAC9B8E,GAAOqX,MAAOnc,GAAc,UAE5B8E,GAAOyX,UAAWvc,GAAc,cAEhC8E,GAAO0jB,GAAQxoB,GAAc,WAE7BwU,GAAK1P,UlGrIQ,IAAIgR,IAAIxnB,MkGuIrB+0B,GAAsB,CACpBtN,GACAnK,GACAoC,GACAyB,GACAmG,GACAqI,GACAoD,KAGFiC,mNxFvKO,eAAyBkP,yDAAM,KAAMC,yDAAM,KAChDlvB,GAAQ5c,OAAS6rC,EACjBjvB,GAAQ1b,SAAW4qC,6rBGgHd,sCAAiC/yB,2BAAAA,kBACtCoF,gBAAUpF,WAAM,6BsFpHH,SAAS6yB,GAAKvwB,UACpB6B,GAAa7B,UAGtBva,OAAOqH,OAAOyjC,GAAKG"} \ No newline at end of file +{"version":3,"file":"svg.min.js","sources":["../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_cof.js","../node_modules/core-js/modules/_iobject.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-iobject.js","../node_modules/core-js/modules/_to-integer.js","../node_modules/core-js/modules/_to-length.js","../node_modules/core-js/modules/_to-absolute-index.js","../node_modules/core-js/modules/_array-includes.js","../node_modules/core-js/modules/_shared.js","../node_modules/core-js/modules/_shared-key.js","../node_modules/core-js/modules/_object-keys-internal.js","../node_modules/core-js/modules/_enum-bug-keys.js","../node_modules/core-js/modules/_object-keys.js","../node_modules/core-js/modules/_object-gops.js","../node_modules/core-js/modules/_object-pie.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_object-assign.js","../node_modules/core-js/modules/es6.object.assign.js","../node_modules/core-js/modules/_wks.js","../node_modules/core-js/modules/_add-to-unscopables.js","../node_modules/core-js/modules/_iter-step.js","../node_modules/core-js/modules/_iterators.js","../node_modules/core-js/modules/_object-dps.js","../node_modules/core-js/modules/_html.js","../node_modules/core-js/modules/_object-create.js","../node_modules/core-js/modules/_set-to-string-tag.js","../node_modules/core-js/modules/_iter-create.js","../node_modules/core-js/modules/_object-gpo.js","../node_modules/core-js/modules/_iter-define.js","../node_modules/core-js/modules/es6.array.iterator.js","../node_modules/core-js/modules/web.dom.iterable.js","../node_modules/core-js/modules/_object-sap.js","../node_modules/core-js/modules/es6.object.keys.js","../node_modules/core-js/modules/es6.function.name.js","../node_modules/@babel/runtime/helpers/esm/typeof.js","../node_modules/core-js/modules/_string-at.js","../node_modules/core-js/modules/es6.string.iterator.js","../node_modules/core-js/modules/_redefine-all.js","../node_modules/core-js/modules/_an-instance.js","../node_modules/core-js/modules/_iter-call.js","../node_modules/core-js/modules/_is-array-iter.js","../node_modules/core-js/modules/_classof.js","../node_modules/core-js/modules/core.get-iterator-method.js","../node_modules/core-js/modules/_for-of.js","../node_modules/core-js/modules/_set-species.js","../node_modules/core-js/modules/_meta.js","../node_modules/core-js/modules/_validate-collection.js","../node_modules/core-js/modules/_collection-strong.js","../node_modules/core-js/modules/_iter-detect.js","../node_modules/core-js/modules/_object-gopd.js","../node_modules/core-js/modules/_set-proto.js","../node_modules/core-js/modules/_inherit-if-required.js","../node_modules/core-js/modules/_collection.js","../node_modules/core-js/modules/es6.set.js","../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../node_modules/core-js/modules/_wks-ext.js","../node_modules/core-js/modules/_wks-define.js","../node_modules/core-js/modules/es7.symbol.async-iterator.js","../node_modules/core-js/modules/_enum-keys.js","../node_modules/core-js/modules/_is-array.js","../node_modules/core-js/modules/_object-gopn.js","../node_modules/core-js/modules/_object-gopn-ext.js","../node_modules/core-js/modules/es6.symbol.js","../src/utils/methods.js","../node_modules/core-js/modules/es7.array.includes.js","../node_modules/core-js/modules/_is-regexp.js","../node_modules/core-js/modules/_fails-is-regexp.js","../node_modules/core-js/modules/es6.string.includes.js","../node_modules/core-js/modules/_string-context.js","../node_modules/core-js/modules/_fix-re-wks.js","../src/utils/utils.js","../node_modules/core-js/modules/es6.regexp.replace.js","../src/modules/core/namespaces.js","../src/utils/window.js","../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../src/types/Base.js","../src/utils/adopter.js","../src/modules/optional/arrange.js","../node_modules/core-js/modules/es6.regexp.split.js","../src/modules/core/regex.js","../src/modules/optional/class.js","../src/modules/optional/css.js","../src/modules/optional/data.js","../src/modules/optional/memory.js","../src/modules/core/event.js","../node_modules/@babel/runtime/helpers/esm/createClass.js","../node_modules/core-js/modules/_flags.js","../node_modules/core-js/modules/es6.regexp.flags.js","../node_modules/core-js/modules/es6.regexp.to-string.js","../src/types/Color.js","../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/get.js","../node_modules/@babel/runtime/helpers/esm/superPropBase.js","../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/esm/inherits.js","../node_modules/core-js/modules/es6.regexp.match.js","../src/types/Point.js","../src/modules/core/parser.js","../src/types/Box.js","../src/types/Matrix.js","../src/types/ArrayPolyfill.js","../src/types/List.js","../src/modules/core/selector.js","../src/types/EventTarget.js","../src/modules/core/defaults.js","../src/types/SVGArray.js","../src/types/SVGNumber.js","../src/modules/core/attr.js","../src/elements/Dom.js","../src/elements/Element.js","../src/modules/optional/sugar.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../src/modules/core/circled.js","../src/modules/optional/transform.js","../src/elements/Shape.js","../src/elements/Circle.js","../src/elements/Container.js","../src/elements/Defs.js","../src/elements/Ellipse.js","../src/elements/Stop.js","../src/modules/core/gradiented.js","../src/elements/Gradient.js","../src/elements/Pattern.js","../src/elements/Image.js","../src/types/PointArray.js","../src/modules/core/pointed.js","../src/elements/Line.js","../src/elements/Marker.js","../node_modules/core-js/modules/_strict-method.js","../node_modules/core-js/modules/es6.array.sort.js","../src/animation/Controller.js","../src/types/PathArray.js","../src/animation/Morphable.js","../src/elements/Path.js","../src/modules/core/poly.js","../src/elements/Polygon.js","../src/elements/Polyline.js","../src/elements/Rect.js","../src/animation/Queue.js","../src/animation/Animator.js","../src/animation/Timeline.js","../src/animation/Runner.js","../src/elements/Svg.js","../src/elements/Symbol.js","../src/modules/core/textable.js","../src/elements/Text.js","../src/elements/Tspan.js","../src/elements/ClipPath.js","../src/elements/G.js","../src/elements/A.js","../src/elements/Mask.js","../src/elements/Style.js","../node_modules/core-js/modules/_array-species-constructor.js","../node_modules/core-js/modules/_array-methods.js","../node_modules/core-js/modules/es6.array.find.js","../node_modules/core-js/modules/_array-species-create.js","../src/elements/TextPath.js","../src/elements/Use.js","../src/main.js","../src/svg.js"],"sourcesContent":["// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","exports.f = {}.propertyIsEnumerable;\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nexport default function _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","import arrayWithoutHoles from \"./arrayWithoutHoles\";\nimport iterableToArray from \"./iterableToArray\";\nimport nonIterableSpread from \"./nonIterableSpread\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread();\n}","export default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n }\n}","export default function _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}","exports.f = require('./_wks');\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","require('./_wks-define')('asyncIterator');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n\r\nconst save = {}\r\n\r\nexport function saveWindow () {\r\n save.window = globals.window\r\n save.document = globals.document\r\n}\r\n\r\nexport function restoreWindow () {\r\n globals.window = save.window\r\n globals.document = save.document\r\n}\r\n\r\nexport function withWindow (win, fn) {\r\n saveWindow()\r\n registerWindow(win, win.document)\r\n fn(win, win.document)\r\n restoreWindow()\r\n}\r\n\r\nexport function getWindow () {\r\n return globals.window\r\n}\r\n","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopter(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopter(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopter(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nlet adopter = adopt\r\n\r\nexport function mockAdopt (mock = adopt) {\r\n adopter = mock\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\n// export function extendWithAttrCheck (...args) {\r\n// extend(...args, true)\r\n// }\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _typeof from \"../../helpers/esm/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import getPrototypeOf from \"./getPrototypeOf\";\nimport superPropBase from \"./superPropBase\";\nexport default function _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}","import getPrototypeOf from \"./getPrototypeOf\";\nexport default function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb, retry) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n box = retry(this)\r\n }\r\n\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox(), (el) => {\r\n try {\r\n let clone = el.clone().addTo(parser().svg).show()\r\n let box = clone.node.getBBox()\r\n clone.remove()\r\n return box\r\n } catch (e) {\r\n throw new Error('Getting bbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }\r\n }))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect(), (el) => {\r\n throw new Error('Getting rbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: () => globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer().now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\r\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n","import * as svgMembers from './main.js'\r\nimport { makeInstance } from './utils/adopter.js'\r\n\r\n// The main wrapping element\r\nexport default function SVG (element) {\r\n return makeInstance(element)\r\n}\r\n\r\nObject.assign(SVG, svgMembers)\r\n"],"names":["global","module","window","Math","self","Function","__g","core","version","__e","it","isObject","TypeError","exec","e","require$$0","Object","defineProperty","get","a","document","is","createElement","require$$1","require$$2","S","fn","val","toString","call","valueOf","dP","O","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","value","bitmap","enumerable","configurable","writable","object","key","f","createDesc","hasOwnProperty","id","px","random","concat","undefined","SRC","TO_STRING","$toString","TPL","split","inspectSource","safe","isFunction","has","hide","join","String","prototype","this","that","length","aFunction","b","c","apply","arguments","PROTOTYPE","$export","type","name","source","own","out","exp","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","target","exports","expProto","ctx","redefine","U","W","R","slice","propertyIsEnumerable","cof","IObject","defined","ceil","floor","isNaN","min","toInteger","max","IS_INCLUDES","$this","el","fromIndex","index","toIObject","toLength","SHARED","store","push","mode","copyright","shared","uid","arrayIndexOf","IE_PROTO","names","i","result","keys","$keys","enumBugKeys","getOwnPropertySymbols","$assign","assign","A","Symbol","K","forEach","k","T","toObject","aLen","getSymbols","gOPS","isEnum","pIE","getKeys","j","USE_SYMBOL","UNSCOPABLES","ArrayProto","Array","done","defineProperties","Properties","documentElement","Empty","createDict","iframeDocument","iframe","style","display","appendChild","src","contentWindow","open","write","lt","close","create","dPs","def","TAG","tag","stat","IteratorPrototype","ObjectProto","getPrototypeOf","constructor","ITERATOR","BUGGY","VALUES","returnThis","Base","NAME","Constructor","next","DEFAULT","IS_SET","FORCED","descriptor","setToStringTag","methods","getMethod","kind","proto","DEF_VALUES","VALUES_BUG","$native","$default","$entries","$anyNative","entries","Iterators","values","iterated","_t","_i","_k","step","Arguments","wks","TO_STRING_TAG","ArrayValues","DOMIterables","CSSRuleList","CSSStyleDeclaration","CSSValueList","ClientRectList","DOMRectList","DOMStringList","DOMTokenList","DataTransferItemList","FileList","HTMLAllCollection","HTMLCollection","HTMLFormElement","HTMLSelectElement","MediaList","MimeTypeArray","NamedNodeMap","NodeList","PaintRequestList","Plugin","PluginArray","SVGLengthList","SVGNumberList","SVGPathSegList","SVGPointList","SVGStringList","SVGTransformList","SourceBufferList","StyleSheetList","TextTrackCueList","TextTrackList","TouchList","collections","explicit","Collection","$iterators","KEY","fails","FProto","nameRE","_typeof2","obj","iterator","_typeof","match","$at","pos","s","l","charCodeAt","charAt","point","forbiddenField","ret","ARG","getIteratorMethod","tryGet","callee","BREAK","RETURN","iterable","iterFn","getIterFn","SPECIES","META","setDesc","isExtensible","FREEZE","preventExtensions","setMeta","w","meta","NEED","fastKey","getWeak","onFreeze","TYPE","SIZE","DESCRIPTORS","getEntry","entry","_f","n","getConstructor","wrapper","IS_MAP","ADDER","C","anInstance","_l","forOf","redefineAll","clear","validate","data","r","p","delete","prev","callbackfn","v","setStrong","$iterDefine","SAFE_CLOSING","gOPD","getOwnPropertyDescriptor","check","setPrototypeOf","set","test","buggy","__proto__","common","IS_WEAK","fixMethod","instance","HASNT_CHAINING","THROWS_ON_PRIMITIVES","ACCEPT_ITERABLES","skipClosing","arr","iter","$iterDetect","BUGGY_ZERO","$instance","add","strong","_toConsumableArray","isArray","arr2","arrayWithoutHoles","from","iterableToArray","nonIterableSpread","$Symbol","wksExt","arg","hiddenKeys","getOwnPropertyNames","gOPN","windowNames","getWindowNames","$GOPD","$DP","gOPNExt","$JSON","JSON","_stringify","stringify","HIDDEN","TO_PRIMITIVE","SymbolRegistry","AllSymbols","OPSymbols","USE_NATIVE","QObject","setter","findChild","setSymbolDesc","$fails","_create","D","protoDesc","wrap","sym","isSymbol","$defineProperty","$defineProperties","symbols","enumKeys","$propertyIsEnumerable","E","$getOwnPropertyDescriptor","$getOwnPropertyNames","$getOwnPropertySymbols","IS_OP","$set","require$$3","es6Symbols","wellKnownSymbols","wksDefine","for","keyFor","useSetter","useSimple","replacer","$replacer","args","require$$5","registerMethods","m","addMethodNames","_name","getMethodsFor","_names","$includes","includes","MATCH","isRegExp","INCLUDES","re","searchString","context","indexOf","SYMBOL","fns","strfn","rxfn","RegExp","string","map","array","block","il","radians","d","PI","camelCase","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","proportionalSize","element","width","height","box","bbox","getOrigin","o","ox","oy","origin","trim","x","y","bx","by","REPLACE","$replace","searchValue","replaceValue","ns","xmlns","xlink","svgjs","globals","_classCallCheck","elements","root","makeNode","createElementNS","makeInstance","adopter","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","adopt","className","nodeName","register","asRoot","getClass","did","eid","assignNewId","children","extend","modules","attrCheck","method","wrapWithAttrCheck","attr","siblings","parent","position","forward","removeElement","isRoot","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","SPLIT","$split","_split","$push","$SPLIT","LENGTH","LAST_INDEX","NPCG","separator","limit","separator2","lastIndex","lastLength","output","flags","ignoreCase","multiline","unicode","sticky","lastLastIndex","splitLimit","separatorCopy","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isBlank","isNumber","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","hasClass","addClass","removeClass","filter","toggleClass","css","cssText","t","cased","show","visible","parse","remember","memory","forget","_memory","listenerId","getEvents","getEventHolder","events","getEventTarget","on","listener","binding","options","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","CustomEvent","detail","cancelable","dispatchEvent","_defineProperties","props","_createClass","protoProps","staticProps","define","compToHex","comp","$flags","Color","init","color","parseInt","substring","toHex","round","_assertThisInitialized","ReferenceError","_possibleConstructorReturn","assertThisInitialized","_getPrototypeOf","_get","property","receiver","Reflect","base","superPropBase","desc","_setPrototypeOf","_inherits","subClass","superClass","$match","regexp","Point","parser","nodes","svg","size","path","parentNode","body","addTo","isNulledBox","h","Box","parseFloat","left","top","x2","y2","cx","cy","xMin","Infinity","xMax","yMin","yMax","transform","pageXOffset","pageYOffset","getBox","cb","retry","contains","Error","closeEnough","threshold","abs","viewbox","Matrix","fromArray","Element","matrixify","isMatrixLike","multiplyO","formatTransforms","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","py","dx","dy","tx","ty","originX","originY","sx","sy","lam","rotate","translateX","translateY","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","matrix","clone","matrixMultiply","det","na","nb","nc","nd","ne","nf","inverseO","axis","around","flipO","lx","tan","ly","skew","aroundO","other","flipBoth","flip","flipX","flipY","scale","positionX","positionY","translate","relative","relativeX","relativeY","subClassArray","baseClass","_constructor","Arr","List","baseFind","query","querySelectorAll","each","fnOrMethodName","toArray","reduce","attrs","EventTarget","defaultPrevented","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","Set","SVGNumber","unit","number","hooks","Dom","childNodes","put","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","selector","matches","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","current","_this","createDocumentFragment","firstElementChild","text","textContent","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","isColor","leading","setAttributeNS","setAttribute","rebuild","find","Svg","dom","hasAttribute","setData","until","parents","getBBox","rbox","getBoundingClientRect","screenCTM","inverse","addOffset","ctm","getCTM","getScreenCTM","rect","sugar","prefix","_objectSpread","ownKeys","divide","extension","mat","angle","direction","directionString","dmove","plus","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","untransform","str","kv","reverse","lmultiply","toParent","pCtm","multiply","toRoot","decomposed","decompose","Shape","Circle","circle","move","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","fx","fy","x1","y1","to","Gradient","update","url","gradiented","gradient","Pattern","pattern","patternUnits","Image","callback","img","image","load","PointArray","toLine","at","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","pointed","line","plot","Marker","marker","ref","$sort","sort","makeSetterGetter","comparefn","easing","bezier","steps","stepPosition","jumps","beforeFlag","jumping","Stepper","Ease","Controller","stepper","dt","recalculate","_duration","overshoot","_overshoot","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","I","PathArray","pathRegReplace","pathHandlers","M","p0","L","H","V","Q","Z","mlhvqtcsaz","jl","arrayToString","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","TransformBag","objOrArr","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","shift","nextFrame","lastFrame","first","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","active","pause","speed","yes","currentSpeed","positive","dtOrForever","immediateStep","dtSource","dtTime","fire","runnersLeft","dtToStart","reset","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","sanitise","loop","schedule","times","swing","wait","animate","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","finished","queue","loopDuration","loopsDone","partial","swinging","backwards","uncliped","pow","loops","swingForward","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","morpher","caller","needsIt","positionOrDt","allfinished","FakeRunner","mergeWith","getRunnerTransform","RunnerArray","runners","ids","leftSibling","lastRunner","_this2","edit","newRunner","deleteCnt","clearTransformsFromQueue","frameId","play","_clearTransformRunnersBefore","currentRunner","_transformationRunners","clearBefore","_currentTransform","addRunner","netTransform","merge","_frameId","styleAttr","zoom","level","affine","_tryRetarget","isMatrix","currentAngle","startTransform","clearTransform","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","addTransform","newTransforms","_rememberMorpher","_queueNumber","_queueNumberDelta","newTo","_queueObject","center","getElementsByTagName","nested","symbol","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","plain","Tspan","ClipPath","targets","unclip","clip","clipWith","clipper","group","link","linkTo","Mask","unmask","mask","maskWith","masker","Style","params","rule","fontFamily","addText","cssRule","fontface","$create","IS_FILTER","IS_SOME","IS_EVERY","IS_FIND_INDEX","NO_HOLES","$find","original","res","forced","TextPath","track","textPath","txt","Use","file","use","SVG","win","doc","mock","svgMembers"],"mappings":";iHACA,IAAIA,EAASC,UAAkC,oBAAVC,QAAyBA,OAAOC,MAAQA,KACzED,OAAwB,oBAARE,MAAuBA,KAAKD,MAAQA,KAAOC,KAE3DC,SAAS,cAATA,GACc,iBAAPC,MAAiBA,IAAMN,qBCLlC,IAAIO,EAAON,UAAiB,CAAEO,QAAS,SACrB,iBAAPC,MAAiBA,IAAMF,kBCDjB,SAAUG,GACzB,MAAqB,i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AWzc,GAAc,cAEhC+E,GAAO2jB,GAAQ1oB,GAAc,WAE7B0U,GAAK3P,UlGrIQ,IAAIiR,IAAI1nB,MkGuIrBi1B,GAAsB,CACpBtN,GACApK,GACAoC,GACAyB,GACAoG,GACAqI,GACAoD,KAGFiC,mNxFvKO,eAAyBkP,yDAAM,KAAMC,yDAAM,KAChDpvB,GAAQ5c,OAAS+rC,EACjBnvB,GAAQ1b,SAAW8qC,2nBG8Dd,eAAoBC,yDAAOvuB,GAChCP,GAAU8uB,kFsFlEG,SAASH,GAAKzwB,UACpB6B,GAAa7B,UAGtBva,OAAOqH,OAAO2jC,GAAKI"} \ No newline at end of file diff --git a/dist/svg.node.js b/dist/svg.node.js index 4c22676..da72a27 100644 --- a/dist/svg.node.js +++ b/dist/svg.node.js @@ -6,7 +6,7 @@ * @copyright Wout Fierens * @license MIT * -* BUILT: Wed Nov 28 2018 12:47:10 GMT+0100 (GMT+01:00) +* BUILT: Wed Nov 28 2018 13:48:04 GMT+0100 (GMT+01:00) */; 'use strict'; @@ -196,7 +196,7 @@ function makeInstance(element) { if (element instanceof Base) return element; if (typeof element === 'object') { - return adopt(element); + return adopter(element); } if (element == null) { @@ -204,14 +204,14 @@ function makeInstance(element) { } if (typeof element === 'string' && element.charAt(0) !== '<') { - return adopt(globals.document.querySelector(element)); + return adopter(globals.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(node.firstChild); + element = adopter(node.firstChild); return element; } function nodeOrNew(name, node) { @@ -234,6 +234,10 @@ function adopt(node) { return new elements[className](node); } +let adopter = adopt; +function mockAdopt(mock = adopt) { + adopter = mock; +} function register(element, name = element.name, asRoot = false) { elements[name] = element; if (asRoot) elements[root] = element; @@ -278,10 +282,10 @@ function extend(modules, methods, attrCheck) { modules[i].prototype[key] = method; } } -} -function extendWithAttrCheck(...args) { - extend(...args, true); -} +} // export function extendWithAttrCheck (...args) { +// extend(...args, true) +// } + function wrapWithAttrCheck(fn) { return function (...args) { let o = args[args.length - 1]; @@ -1018,7 +1022,7 @@ class Box { } -function getBox(cb) { +function getBox(cb, retry) { let box; try { @@ -1028,23 +1032,28 @@ function getBox(cb) { throw new Error('Element not in the dom'); } } catch (e) { - try { - let clone = this.clone().addTo(parser().svg).show(); - box = cb(clone.node); - clone.remove(); - } catch (e) { - throw new Error('Getting a bounding box of element "' + this.node.nodeName + '" is not possible'); - } + box = retry(this); } return box; } function bbox() { - return new Box(getBox.call(this, node => node.getBBox())); + return new Box(getBox.call(this, node => node.getBBox(), el => { + try { + let clone = el.clone().addTo(parser().svg).show(); + let box = clone.node.getBBox(); + clone.remove(); + return box; + } catch (e) { + throw new Error('Getting bbox of element "' + el.node.nodeName + '" is not possible'); + } + })); } function rbox(el) { - let box = new Box(getBox.call(this, node => node.getBoundingClientRect())); + let box = new Box(getBox.call(this, node => node.getBoundingClientRect(), el => { + throw new Error('Getting rbox of element "' + el.node.nodeName + '" is not possible'); + })); if (el) return box.transform(el.screenCTM().inverse()); return box.addOffset(); } @@ -4469,7 +4478,7 @@ const Animator = { nextDraw: null, frames: new Queue(), timeouts: new Queue(), - timer: globals.window.performance || globals.window.Date, + timer: () => globals.window.performance || globals.window.Date, transforms: [], frame(fn) { @@ -4493,7 +4502,7 @@ const Animator = { timeout(fn, delay) { delay = delay || 0; // Work out when the event should fire - var time = Animator.timer.now() + delay; // Add the timeout to the end of the queue + var time = Animator.timer().now() + delay; // Add the timeout to the end of the queue var node = Animator.timeouts.push({ run: fn, @@ -6420,11 +6429,11 @@ exports.makeNode = makeNode; exports.makeInstance = makeInstance; exports.nodeOrNew = nodeOrNew; exports.adopt = adopt; +exports.mockAdopt = mockAdopt; exports.register = register; exports.getClass = getClass; exports.eid = eid; exports.assignNewId = assignNewId; exports.extend = extend; -exports.extendWithAttrCheck = extendWithAttrCheck; exports.wrapWithAttrCheck = wrapWithAttrCheck; //# sourceMappingURL=svg.node.js.map diff --git a/dist/svg.node.js.map b/dist/svg.node.js.map index ad81645..b5a7e7f 100644 --- a/dist/svg.node.js.map +++ b/dist/svg.node.js.map @@ -1 +1 @@ -{"version":3,"file":"svg.node.js","sources":["../src/utils/methods.js","../src/utils/utils.js","../src/modules/core/namespaces.js","../src/utils/window.js","../src/types/Base.js","../src/utils/adopter.js","../src/modules/optional/arrange.js","../src/modules/core/regex.js","../src/modules/optional/class.js","../src/modules/optional/css.js","../src/modules/optional/data.js","../src/modules/optional/memory.js","../src/modules/core/event.js","../src/types/Color.js","../src/types/Point.js","../src/modules/core/parser.js","../src/types/Box.js","../src/types/Matrix.js","../src/types/ArrayPolyfill.js","../src/types/List.js","../src/modules/core/selector.js","../src/types/EventTarget.js","../src/modules/core/defaults.js","../src/types/SVGArray.js","../src/types/SVGNumber.js","../src/modules/core/attr.js","../src/elements/Dom.js","../src/elements/Element.js","../src/modules/optional/sugar.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../src/modules/optional/transform.js","../src/modules/core/circled.js","../src/elements/Shape.js","../src/elements/Circle.js","../src/elements/Container.js","../src/elements/Defs.js","../src/elements/Ellipse.js","../src/elements/Stop.js","../src/modules/core/gradiented.js","../src/elements/Gradient.js","../src/elements/Pattern.js","../src/elements/Image.js","../src/types/PointArray.js","../src/modules/core/pointed.js","../src/elements/Line.js","../src/elements/Marker.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_strict-method.js","../node_modules/core-js/modules/es6.array.sort.js","../src/animation/Controller.js","../src/types/PathArray.js","../src/animation/Morphable.js","../src/elements/Path.js","../src/modules/core/poly.js","../src/elements/Polygon.js","../src/elements/Polyline.js","../src/elements/Rect.js","../src/animation/Queue.js","../src/animation/Animator.js","../src/animation/Timeline.js","../src/animation/Runner.js","../src/elements/Svg.js","../src/elements/Symbol.js","../src/modules/core/textable.js","../src/elements/Text.js","../src/elements/Tspan.js","../src/elements/ClipPath.js","../src/elements/G.js","../src/elements/A.js","../src/elements/Mask.js","../src/elements/Style.js","../src/elements/TextPath.js","../src/elements/Use.js","../src/main.js"],"sourcesContent":["const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopt(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopt(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopt(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\nexport function extendWithAttrCheck (...args) {\r\n extend(...args, true)\r\n}\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n try {\r\n let clone = this.clone().addTo(parser().svg).show()\r\n box = cb(clone.node)\r\n clone.remove()\r\n } catch (e) {\r\n throw new Error('Getting a bounding box of element \"' + this.node.nodeName + '\" is not possible')\r\n }\r\n }\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox()))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect()))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer.now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n"],"names":["methods","names","registerMethods","name","m","Array","isArray","_name","addMethodNames","Object","keys","assign","getMethodsFor","getMethodNames","Set","_names","push","map","array","block","i","il","length","result","filter","radians","d","Math","PI","degrees","r","camelCase","s","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","charAt","slice","proportionalSize","element","width","height","box","bbox","getOrigin","o","origin","ox","oy","string","trim","x","y","bx","includes","by","ns","xmlns","xlink","svgjs","globals","window","document","registerWindow","win","doc","Base","elements","root","makeNode","createElementNS","makeInstance","adopt","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","instance","className","nodeName","register","asRoot","prototype","getClass","did","eid","assignNewId","children","id","extend","modules","attrCheck","key","method","wrapWithAttrCheck","extendWithAttrCheck","args","fn","constructor","apply","attr","siblings","parent","position","index","next","prev","forward","p","removeElement","add","isRoot","appendChild","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isCss","isBlank","isNumber","isPercent","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","split","hasClass","indexOf","addClass","join","removeClass","c","toggleClass","css","style","val","ret","arguments","cssText","el","forEach","t","cased","test","show","hide","visible","data","a","v","JSON","parse","e","stringify","remember","k","memory","forget","_memory","listenerId","getEvents","n","getEventHolder","events","getEventTarget","clearEvents","on","listener","binding","options","l","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","dispatchEvent","CustomEvent","detail","cancelable","fullHex","substring","compToHex","comp","toString","Color","init","color","b","match","exec","parseInt","toHex","toArray","round","toRgb","brightness","isColor","Point","source","base","clone","transform","f","point","screenCTM","inverse","parser","nodes","svg","size","path","parentNode","body","documentElement","addTo","isNulledBox","w","h","domContains","contains","call","Box","parseFloat","left","top","x2","y2","cx","cy","merge","min","max","xMin","Infinity","xMax","yMin","yMax","pts","addOffset","pageXOffset","pageYOffset","isNulled","getBox","cb","Error","getBBox","rbox","getBoundingClientRect","viewbox","closeEnough","threshold","abs","Matrix","fromArray","Element","matrixify","isMatrixLike","matrix","multiplyO","formatTransforms","current","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","px","py","dx","dy","tx","ty","compose","originX","originY","sx","sy","lam","rotate","translateX","translateY","decompose","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","multiply","matrixMultiply","lmultiply","inverseO","det","na","nb","nc","nd","ne","nf","translate","scale","flip","axis","around","flipO","lx","skew","tan","ly","skewXO","skewYO","aroundO","equals","other","valueOf","flipBoth","flipX","flipY","positionX","positionY","relative","relativeX","relativeY","ctm","getCTM","rect","getScreenCTM","subClassArray","Function","baseClass","_constructor","Arr","create","arr","List","each","fnOrMethodName","concat","reduce","obj","attrs","baseFind","query","querySelectorAll","find","EventTarget","type","j","defaultPrevented","fire","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","SVGNumber","value","unit","isNaN","toJSON","plus","number","minus","times","divide","hooks","registerAttrHook","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","leading","setAttributeNS","setAttribute","rebuild","Dom","childNodes","put","clear","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","first","get","has","matches","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","putIn","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","_this","createDocumentFragment","firstElementChild","words","text","textContent","Svg","dom","hasAttribute","setData","center","inside","move","parents","until","sugar","prefix","extension","mat","angle","direction","directionString","dmove","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","defineProperty","untransform","str","kv","reverse","toParent","pCtm","toRoot","decomposed","cleanRelative","Shape","Circle","circle","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","update","from","fx","fy","x1","y1","to","Gradient","stop","url","targets","gradiented","gradient","Pattern","pattern","patternUnits","Image","load","callback","img","src","image","PointArray","toLine","at","pos","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","plot","pointed","line","Marker","ref","marker","isObject","require$$0","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","global","aFunction","core","ctx","redefine","defined","fails","$export","toObject","makeSetterGetter","easing","bezier","steps","stepPosition","jumps","beforeFlag","step","floor","jumping","Stepper","done","Ease","Controller","stepper","target","dt","recalculate","_duration","overshoot","_overshoot","eps","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","P","I","D","PathArray","pathRegReplace","arrayToString","pathHandlers","M","p0","L","H","V","C","S","Q","T","Z","A","mlhvqtcsaz","jl","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","complete","TransformBag","objOrArr","values","entries","sort","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","shift","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","nextFrame","lastFrame","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","schedule","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","lastStartTime","active","play","pause","finish","speed","yes","currentSpeed","positive","seek","dtOrForever","immediateStep","dtSource","dtTime","runnersLeft","dtToStart","reset","finished","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","animate","sanitise","loop","swing","wait","queue","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","during","loops","loopDuration","loopsDone","relativeTime","whole","partial","swinging","backwards","uncliped","pow","clipped","swingForward","forwards","progress","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","_rememberMorpher","morpher","caller","_tryRetarget","needsIt","positionOrDt","allfinished","addTransform","clearTransform","clearTransformsFromQueue","FakeRunner","mergeWith","getRunnerTransform","mergeTransforms","runners","_transformationRunners","netTransform","_frameId","RunnerArray","ids","leftSibling","getByID","lastRunner","edit","newRunner","clearBefore","deleteCnt","frameId","_clearTransformRunnersBefore","currentRunner","_currentTransform","addRunner","styleAttr","zoom","level","affine","isMatrix","currentAngle","startTransform","setup","undefined","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","newTransforms","_queueNumber","_queueNumberDelta","newTo","_queueObject","version","getElementsByTagName","nested","Symbol","symbol","plain","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","self","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","Tspan","ClipPath","unclip","clip","clipWith","clipper","G","group","link","linkTo","Mask","unmask","mask","maskWith","masker","cssRule","rule","Style","addText","params","fontFamily","fontface","TextPath","track","textPath","txt","Use","file","use","SVG"],"mappings":";;;;;;;;;;;;;;AAAA,MAAMA,OAAO,GAAG,EAAhB;AACA,MAAMC,KAAK,GAAG,EAAd;AAEA,AAAO,SAASC,eAAT,CAA0BC,IAA1B,EAAgCC,CAAhC,EAAmC;MACpCC,KAAK,CAACC,OAAN,CAAcH,IAAd,CAAJ,EAAyB;SAClB,IAAII,KAAT,IAAkBJ,IAAlB,EAAwB;MACtBD,eAAe,CAACK,KAAD,EAAQH,CAAR,CAAf;;;;;;MAKA,OAAOD,IAAP,KAAgB,QAApB,EAA8B;SACvB,IAAII,KAAT,IAAkBJ,IAAlB,EA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,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"svg.node.js","sources":["../src/utils/methods.js","../src/utils/utils.js","../src/modules/core/namespaces.js","../src/utils/window.js","../src/types/Base.js","../src/utils/adopter.js","../src/modules/optional/arrange.js","../src/modules/core/regex.js","../src/modules/optional/class.js","../src/modules/optional/css.js","../src/modules/optional/data.js","../src/modules/optional/memory.js","../src/modules/core/event.js","../src/types/Color.js","../src/types/Point.js","../src/modules/core/parser.js","../src/types/Box.js","../src/types/Matrix.js","../src/types/ArrayPolyfill.js","../src/types/List.js","../src/modules/core/selector.js","../src/types/EventTarget.js","../src/modules/core/defaults.js","../src/types/SVGArray.js","../src/types/SVGNumber.js","../src/modules/core/attr.js","../src/elements/Dom.js","../src/elements/Element.js","../src/modules/optional/sugar.js","../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../node_modules/@babel/runtime/helpers/esm/objectSpread.js","../src/modules/optional/transform.js","../src/modules/core/circled.js","../src/elements/Shape.js","../src/elements/Circle.js","../src/elements/Container.js","../src/elements/Defs.js","../src/elements/Ellipse.js","../src/elements/Stop.js","../src/modules/core/gradiented.js","../src/elements/Gradient.js","../src/elements/Pattern.js","../src/elements/Image.js","../src/types/PointArray.js","../src/modules/core/pointed.js","../src/elements/Line.js","../src/elements/Marker.js","../node_modules/core-js/modules/_global.js","../node_modules/core-js/modules/_core.js","../node_modules/core-js/modules/_is-object.js","../node_modules/core-js/modules/_an-object.js","../node_modules/core-js/modules/_fails.js","../node_modules/core-js/modules/_descriptors.js","../node_modules/core-js/modules/_dom-create.js","../node_modules/core-js/modules/_ie8-dom-define.js","../node_modules/core-js/modules/_to-primitive.js","../node_modules/core-js/modules/_object-dp.js","../node_modules/core-js/modules/_property-desc.js","../node_modules/core-js/modules/_hide.js","../node_modules/core-js/modules/_has.js","../node_modules/core-js/modules/_uid.js","../node_modules/core-js/modules/_redefine.js","../node_modules/core-js/modules/_a-function.js","../node_modules/core-js/modules/_ctx.js","../node_modules/core-js/modules/_export.js","../node_modules/core-js/modules/_defined.js","../node_modules/core-js/modules/_to-object.js","../node_modules/core-js/modules/_strict-method.js","../node_modules/core-js/modules/es6.array.sort.js","../src/animation/Controller.js","../src/types/PathArray.js","../src/animation/Morphable.js","../src/elements/Path.js","../src/modules/core/poly.js","../src/elements/Polygon.js","../src/elements/Polyline.js","../src/elements/Rect.js","../src/animation/Queue.js","../src/animation/Animator.js","../src/animation/Timeline.js","../src/animation/Runner.js","../src/elements/Svg.js","../src/elements/Symbol.js","../src/modules/core/textable.js","../src/elements/Text.js","../src/elements/Tspan.js","../src/elements/ClipPath.js","../src/elements/G.js","../src/elements/A.js","../src/elements/Mask.js","../src/elements/Style.js","../src/elements/TextPath.js","../src/elements/Use.js","../src/main.js"],"sourcesContent":["const methods = {}\r\nconst names = []\r\n\r\nexport function registerMethods (name, m) {\r\n if (Array.isArray(name)) {\r\n for (let _name of name) {\r\n registerMethods(_name, m)\r\n }\r\n return\r\n }\r\n\r\n if (typeof name === 'object') {\r\n for (let _name in name) {\r\n registerMethods(_name, name[_name])\r\n }\r\n return\r\n }\r\n\r\n addMethodNames(Object.keys(m))\r\n methods[name] = Object.assign(methods[name] || {}, m)\r\n}\r\n\r\nexport function getMethodsFor (name) {\r\n return methods[name] || {}\r\n}\r\n\r\nexport function getMethodNames () {\r\n return [...new Set(names)]\r\n}\r\n\r\nexport function addMethodNames (_names) {\r\n names.push(..._names)\r\n}\r\n","// Map function\r\nexport function map (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n result.push(block(array[i]))\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Filter function\r\nexport function filter (array, block) {\r\n var i\r\n var il = array.length\r\n var result = []\r\n\r\n for (i = 0; i < il; i++) {\r\n if (block(array[i])) { result.push(array[i]) }\r\n }\r\n\r\n return result\r\n}\r\n\r\n// Degrees to radians\r\nexport function radians (d) {\r\n return d % 360 * Math.PI / 180\r\n}\r\n\r\n// Radians to degrees\r\nexport function degrees (r) {\r\n return r * 180 / Math.PI % 360\r\n}\r\n\r\n// Convert dash-separated-string to camelCase\r\nexport function camelCase (s) {\r\n return s.toLowerCase().replace(/-(.)/g, function (m, g) {\r\n return g.toUpperCase()\r\n })\r\n}\r\n\r\n// Convert camel cased string to string seperated\r\nexport function unCamelCase (s) {\r\n return s.replace(/([A-Z])/g, function (m, g) {\r\n return '-' + g.toLowerCase()\r\n })\r\n}\r\n\r\n// Capitalize first letter of a string\r\nexport function capitalize (s) {\r\n return s.charAt(0).toUpperCase() + s.slice(1)\r\n}\r\n\r\n// Calculate proportional width and height values when necessary\r\nexport function proportionalSize (element, width, height) {\r\n if (width == null || height == null) {\r\n var box = element.bbox()\r\n\r\n if (width == null) {\r\n width = box.width / box.height * height\r\n } else if (height == null) {\r\n height = box.height / box.width * width\r\n }\r\n }\r\n\r\n return {\r\n width: width,\r\n height: height\r\n }\r\n}\r\n\r\nexport function getOrigin (o, element) {\r\n // Allow origin or around as the names\r\n let origin = o.origin // o.around == null ? o.origin : o.around\r\n let ox, oy\r\n\r\n // Allow the user to pass a string to rotate around a given point\r\n if (typeof origin === 'string' || origin == null) {\r\n // Get the bounding box of the element with no transformations applied\r\n const string = (origin || 'center').toLowerCase().trim()\r\n const { height, width, x, y } = element.bbox()\r\n\r\n // Calculate the transformed x and y coordinates\r\n let bx = string.includes('left') ? x\r\n : string.includes('right') ? x + width\r\n : x + width / 2\r\n let by = string.includes('top') ? y\r\n : string.includes('bottom') ? y + height\r\n : y + height / 2\r\n\r\n // Set the bounds eg : \"bottom-left\", \"Top right\", \"middle\" etc...\r\n ox = o.ox != null ? o.ox : bx\r\n oy = o.oy != null ? o.oy : by\r\n } else {\r\n ox = origin[0]\r\n oy = origin[1]\r\n }\r\n\r\n // Return the origin as it is if it wasn't a string\r\n return [ ox, oy ]\r\n}\r\n","// Default namespaces\r\nexport let ns = 'http://www.w3.org/2000/svg'\r\nexport let xmlns = 'http://www.w3.org/2000/xmlns/'\r\nexport let xlink = 'http://www.w3.org/1999/xlink'\r\nexport let svgjs = 'http://svgjs.com/svgjs'\r\n","export const globals = {\r\n window: typeof window === 'undefined' ? null : window,\r\n document: typeof document === 'undefined' ? null : document\r\n}\r\n\r\nexport function registerWindow (win = null, doc = null) {\r\n globals.window = win\r\n globals.document = doc\r\n}\r\n\r\nconst save = {}\r\n\r\nexport function saveWindow () {\r\n save.window = globals.window\r\n save.document = globals.document\r\n}\r\n\r\nexport function restoreWindow () {\r\n globals.window = save.window\r\n globals.document = save.document\r\n}\r\n\r\nexport function withWindow (win, fn) {\r\n saveWindow()\r\n registerWindow(win, win.document)\r\n fn(win, win.document)\r\n restoreWindow()\r\n}\r\n\r\nexport function getWindow () {\r\n return globals.window\r\n}\r\n","export default class Base {\r\n // constructor (node/*, {extensions = []} */) {\r\n // // this.tags = []\r\n // //\r\n // // for (let extension of extensions) {\r\n // // extension.setup.call(this, node)\r\n // // this.tags.push(extension.name)\r\n // // }\r\n // }\r\n}\r\n","import { addMethodNames } from './methods.js'\r\nimport { capitalize } from './utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Base from '../types/Base.js'\r\n\r\nconst elements = {}\r\nexport const root = '___SYMBOL___ROOT___'\r\n\r\n// Method for element creation\r\nexport function makeNode (name) {\r\n // create element\r\n return globals.document.createElementNS(ns, name)\r\n}\r\n\r\nexport function makeInstance (element) {\r\n if (element instanceof Base) return element\r\n\r\n if (typeof element === 'object') {\r\n return adopter(element)\r\n }\r\n\r\n if (element == null) {\r\n return new elements[root]()\r\n }\r\n\r\n if (typeof element === 'string' && element.charAt(0) !== '<') {\r\n return adopter(globals.document.querySelector(element))\r\n }\r\n\r\n var node = makeNode('svg')\r\n node.innerHTML = element\r\n\r\n // We can use firstChild here because we know,\r\n // that the first char is < and thus an element\r\n element = adopter(node.firstChild)\r\n\r\n return element\r\n}\r\n\r\nexport function nodeOrNew (name, node) {\r\n return node instanceof globals.window.Node ? node : makeNode(name)\r\n}\r\n\r\n// Adopt existing svg elements\r\nexport function adopt (node) {\r\n // check for presence of node\r\n if (!node) return null\r\n\r\n // make sure a node isn't already adopted\r\n if (node.instance instanceof Base) return node.instance\r\n\r\n // initialize variables\r\n var className = capitalize(node.nodeName)\r\n\r\n // Make sure that gradients are adopted correctly\r\n if (className === 'LinearGradient' || className === 'RadialGradient') {\r\n className = 'Gradient'\r\n\r\n // Fallback to Dom if element is not known\r\n } else if (!elements[className]) {\r\n className = 'Dom'\r\n }\r\n\r\n return new elements[className](node)\r\n}\r\n\r\nlet adopter = adopt\r\n\r\nexport function mockAdopt (mock = adopt) {\r\n adopter = mock\r\n}\r\n\r\nexport function register (element, name = element.name, asRoot = false) {\r\n elements[name] = element\r\n if (asRoot) elements[root] = element\r\n\r\n addMethodNames(Object.keys(element.prototype))\r\n\r\n return element\r\n}\r\n\r\nexport function getClass (name) {\r\n return elements[name]\r\n}\r\n\r\n// Element id sequence\r\nlet did = 1000\r\n\r\n// Get next named element id\r\nexport function eid (name) {\r\n return 'Svgjs' + capitalize(name) + (did++)\r\n}\r\n\r\n// Deep new id assignment\r\nexport function assignNewId (node) {\r\n // do the same for SVG child nodes as well\r\n for (var i = node.children.length - 1; i >= 0; i--) {\r\n assignNewId(node.children[i])\r\n }\r\n\r\n if (node.id) {\r\n return adopt(node).id(eid(node.nodeName))\r\n }\r\n\r\n return adopt(node)\r\n}\r\n\r\n// Method for extending objects\r\nexport function extend (modules, methods, attrCheck) {\r\n var key, i\r\n\r\n modules = Array.isArray(modules) ? modules : [modules]\r\n\r\n for (i = modules.length - 1; i >= 0; i--) {\r\n for (key in methods) {\r\n let method = methods[key]\r\n if (attrCheck) {\r\n method = wrapWithAttrCheck(methods[key])\r\n }\r\n modules[i].prototype[key] = method\r\n }\r\n }\r\n}\r\n\r\n// export function extendWithAttrCheck (...args) {\r\n// extend(...args, true)\r\n// }\r\n\r\nexport function wrapWithAttrCheck (fn) {\r\n return function (...args) {\r\n let o = args[args.length - 1]\r\n\r\n if (o && o.constructor === Object && !(o instanceof Array)) {\r\n return fn.apply(this, args.slice(0, -1)).attr(o)\r\n } else {\r\n return fn.apply(this, args)\r\n }\r\n }\r\n}\r\n","import { makeInstance } from '../../utils/adopter.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Get all siblings, including myself\r\nexport function siblings () {\r\n return this.parent().children()\r\n}\r\n\r\n// Get the curent position siblings\r\nexport function position () {\r\n return this.parent().index(this)\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function next () {\r\n return this.siblings()[this.position() + 1]\r\n}\r\n\r\n// Get the next element (will return null if there is none)\r\nexport function prev () {\r\n return this.siblings()[this.position() - 1]\r\n}\r\n\r\n// Send given element one step forward\r\nexport function forward () {\r\n var i = this.position() + 1\r\n var p = this.parent()\r\n\r\n // move node one step forward\r\n p.removeElement(this).add(this, i)\r\n\r\n // make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element one step backward\r\nexport function backward () {\r\n var i = this.position()\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the front\r\nexport function front () {\r\n var p = this.parent()\r\n\r\n // Move node forward\r\n p.node.appendChild(this.node)\r\n\r\n // Make sure defs node is always at the top\r\n if (typeof p.isRoot === 'function' && p.isRoot()) {\r\n p.node.appendChild(p.defs().node)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Send given element all the way to the back\r\nexport function back () {\r\n if (this.position() > 0) {\r\n this.parent().removeElement(this).add(this, 0)\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element before the targeted element\r\nexport function before (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i)\r\n\r\n return this\r\n}\r\n\r\n// Inserts a given element after the targeted element\r\nexport function after (element) {\r\n element = makeInstance(element)\r\n element.remove()\r\n\r\n var i = this.position()\r\n\r\n this.parent().add(element, i + 1)\r\n\r\n return this\r\n}\r\n\r\nexport function insertBefore (element) {\r\n element = makeInstance(element)\r\n element.before(this)\r\n}\r\n\r\nexport function insertAfter (element) {\r\n element = makeInstance(element)\r\n element.after(this)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n siblings,\r\n position,\r\n next,\r\n prev,\r\n forward,\r\n backward,\r\n front,\r\n back,\r\n before,\r\n after,\r\n insertBefore,\r\n insertAfter\r\n})\r\n","// Parse unit value\r\nexport let numberAndUnit = /^([+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?)([a-z%]*)$/i\r\n\r\n// Parse hex value\r\nexport let hex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i\r\n\r\n// Parse rgb value\r\nexport let rgb = /rgb\\((\\d+),(\\d+),(\\d+)\\)/\r\n\r\n// Parse reference id\r\nexport let reference = /(#[a-z0-9\\-_]+)/i\r\n\r\n// splits a transformation chain\r\nexport let transforms = /\\)\\s*,?\\s*/\r\n\r\n// Whitespace\r\nexport let whitespace = /\\s/g\r\n\r\n// Test hex value\r\nexport let isHex = /^#[a-f0-9]{3,6}$/i\r\n\r\n// Test rgb value\r\nexport let isRgb = /^rgb\\(/\r\n\r\n// Test css declaration\r\nexport let isCss = /[^:]+:[^;]+;?/\r\n\r\n// Test for blank string\r\nexport let isBlank = /^(\\s+)?$/\r\n\r\n// Test for numeric string\r\nexport let isNumber = /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i\r\n\r\n// Test for percent value\r\nexport let isPercent = /^-?[\\d.]+%$/\r\n\r\n// Test for image url\r\nexport let isImage = /\\.(jpg|jpeg|png|gif|svg)(\\?[^=]+.*)?/i\r\n\r\n// split at whitespace and comma\r\nexport let delimiter = /[\\s,]+/\r\n\r\n// The following regex are used to parse the d attribute of a path\r\n\r\n// Matches all hyphens which are not after an exponent\r\nexport let hyphen = /([^e])-/gi\r\n\r\n// Replaces and tests for all path letters\r\nexport let pathLetters = /[MLHVCSQTAZ]/gi\r\n\r\n// yes we need this one, too\r\nexport let isPathLetter = /[MLHVCSQTAZ]/i\r\n\r\n// matches 0.154.23.45\r\nexport let numbersWithDots = /((\\d?\\.\\d+(?:e[+-]?\\d+)?)((?:\\.\\d+(?:e[+-]?\\d+)?)+))+/gi\r\n\r\n// matches .\r\nexport let dots = /\\./g\r\n","import { delimiter } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Return array of classes on the node\r\nexport function classes () {\r\n var attr = this.attr('class')\r\n return attr == null ? [] : attr.trim().split(delimiter)\r\n}\r\n\r\n// Return true if class exists on the node, false otherwise\r\nexport function hasClass (name) {\r\n return this.classes().indexOf(name) !== -1\r\n}\r\n\r\n// Add class to the node\r\nexport function addClass (name) {\r\n if (!this.hasClass(name)) {\r\n var array = this.classes()\r\n array.push(name)\r\n this.attr('class', array.join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Remove class from the node\r\nexport function removeClass (name) {\r\n if (this.hasClass(name)) {\r\n this.attr('class', this.classes().filter(function (c) {\r\n return c !== name\r\n }).join(' '))\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Toggle the presence of a class on the node\r\nexport function toggleClass (name) {\r\n return this.hasClass(name) ? this.removeClass(name) : this.addClass(name)\r\n}\r\n\r\nregisterMethods('Dom', {\r\n classes, hasClass, addClass, removeClass, toggleClass\r\n})\r\n","import { camelCase } from '../../utils/utils.js'\r\nimport { isBlank } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\n\r\n// Dynamic style generator\r\nexport function css (style, val) {\r\n let ret = {}\r\n if (arguments.length === 0) {\r\n // get full style as object\r\n this.node.style.cssText.split(/\\s*;\\s*/)\r\n .filter(function (el) { return !!el.length })\r\n .forEach(function (el) {\r\n let t = el.split(/\\s*:\\s*/)\r\n ret[t[0]] = t[1]\r\n })\r\n return ret\r\n }\r\n\r\n if (arguments.length < 2) {\r\n // get style properties in the array\r\n if (Array.isArray(style)) {\r\n for (let name of style) {\r\n let cased = camelCase(name)\r\n ret[cased] = this.node.style[cased]\r\n }\r\n return ret\r\n }\r\n\r\n // get style for property\r\n if (typeof style === 'string') {\r\n return this.node.style[camelCase(style)]\r\n }\r\n\r\n // set styles in object\r\n if (typeof style === 'object') {\r\n for (let name in style) {\r\n // set empty string if null/undefined/'' was given\r\n this.node.style[camelCase(name)] =\r\n (style[name] == null || isBlank.test(style[name])) ? '' : style[name]\r\n }\r\n }\r\n }\r\n\r\n // set style for property\r\n if (arguments.length === 2) {\r\n this.node.style[camelCase(style)] =\r\n (val == null || isBlank.test(val)) ? '' : val\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Show element\r\nexport function show () {\r\n return this.css('display', '')\r\n}\r\n\r\n// Hide element\r\nexport function hide () {\r\n return this.css('display', 'none')\r\n}\r\n\r\n// Is element visible?\r\nexport function visible () {\r\n return this.css('display') !== 'none'\r\n}\r\n\r\nregisterMethods('Dom', {\r\n css, show, hide, visible\r\n})\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Store data values on svg nodes\r\nexport function data (a, v, r) {\r\n if (typeof a === 'object') {\r\n for (v in a) {\r\n this.data(v, a[v])\r\n }\r\n } else if (arguments.length < 2) {\r\n try {\r\n return JSON.parse(this.attr('data-' + a))\r\n } catch (e) {\r\n return this.attr('data-' + a)\r\n }\r\n } else {\r\n this.attr('data-' + a,\r\n v === null ? null\r\n : r === true || typeof v === 'string' || typeof v === 'number' ? v\r\n : JSON.stringify(v)\r\n )\r\n }\r\n\r\n return this\r\n}\r\n\r\nregisterMethods('Dom', { data })\r\n","import { registerMethods } from '../../utils/methods.js'\r\n\r\n// Remember arbitrary data\r\nexport function remember (k, v) {\r\n // remember every item in an object individually\r\n if (typeof arguments[0] === 'object') {\r\n for (var key in k) {\r\n this.remember(key, k[key])\r\n }\r\n } else if (arguments.length === 1) {\r\n // retrieve memory\r\n return this.memory()[k]\r\n } else {\r\n // store memory\r\n this.memory()[k] = v\r\n }\r\n\r\n return this\r\n}\r\n\r\n// Erase a given memory\r\nexport function forget () {\r\n if (arguments.length === 0) {\r\n this._memory = {}\r\n } else {\r\n for (var i = arguments.length - 1; i >= 0; i--) {\r\n delete this.memory()[arguments[i]]\r\n }\r\n }\r\n return this\r\n}\r\n\r\n// This triggers creation of a new hidden class which is not performant\r\n// However, this function is not rarely used so it will not happen frequently\r\n// Return local memory object\r\nexport function memory () {\r\n return (this._memory = this._memory || {})\r\n}\r\n\r\nregisterMethods('Dom', { remember, forget, memory })\r\n","import { delimiter } from './regex.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\n\r\nlet listenerId = 0\r\n\r\nfunction getEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (!n.events) n.events = {}\r\n return n.events\r\n}\r\n\r\nfunction getEventTarget (node) {\r\n return makeInstance(node).getEventTarget()\r\n}\r\n\r\nfunction clearEvents (node) {\r\n const n = makeInstance(node).getEventHolder()\r\n if (n.events) n.events = {}\r\n}\r\n\r\n// Add event binder in the SVG namespace\r\nexport function on (node, events, listener, binding, options) {\r\n var l = listener.bind(binding || node)\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // events can be an array of events or a string of events\r\n events = Array.isArray(events) ? events : events.split(delimiter)\r\n\r\n // add id to listener\r\n if (!listener._svgjsListenerId) {\r\n listener._svgjsListenerId = ++listenerId\r\n }\r\n\r\n events.forEach(function (event) {\r\n var ev = event.split('.')[0]\r\n var ns = event.split('.')[1] || '*'\r\n\r\n // ensure valid object\r\n bag[ev] = bag[ev] || {}\r\n bag[ev][ns] = bag[ev][ns] || {}\r\n\r\n // reference listener\r\n bag[ev][ns][listener._svgjsListenerId] = l\r\n\r\n // add listener\r\n n.addEventListener(ev, l, options || false)\r\n })\r\n}\r\n\r\n// Add event unbinder in the SVG namespace\r\nexport function off (node, events, listener, options) {\r\n var bag = getEvents(node)\r\n var n = getEventTarget(node)\r\n\r\n // listener can be a function or a number\r\n if (typeof listener === 'function') {\r\n listener = listener._svgjsListenerId\r\n if (!listener) return\r\n }\r\n\r\n // events can be an array of events or a string or undefined\r\n events = Array.isArray(events) ? events : (events || '').split(delimiter)\r\n\r\n events.forEach(function (event) {\r\n var ev = event && event.split('.')[0]\r\n var ns = event && event.split('.')[1]\r\n var namespace, l\r\n\r\n if (listener) {\r\n // remove listener reference\r\n if (bag[ev] && bag[ev][ns || '*']) {\r\n // removeListener\r\n n.removeEventListener(ev, bag[ev][ns || '*'][listener], options || false)\r\n\r\n delete bag[ev][ns || '*'][listener]\r\n }\r\n } else if (ev && ns) {\r\n // remove all listeners for a namespaced event\r\n if (bag[ev] && bag[ev][ns]) {\r\n for (l in bag[ev][ns]) { off(n, [ev, ns].join('.'), l) }\r\n\r\n delete bag[ev][ns]\r\n }\r\n } else if (ns) {\r\n // remove all listeners for a specific namespace\r\n for (event in bag) {\r\n for (namespace in bag[event]) {\r\n if (ns === namespace) { off(n, [event, ns].join('.')) }\r\n }\r\n }\r\n } else if (ev) {\r\n // remove all listeners for the event\r\n if (bag[ev]) {\r\n for (namespace in bag[ev]) { off(n, [ev, namespace].join('.')) }\r\n\r\n delete bag[ev]\r\n }\r\n } else {\r\n // remove all listeners on a given node\r\n for (event in bag) { off(n, event) }\r\n\r\n clearEvents(node)\r\n }\r\n })\r\n}\r\n\r\nexport function dispatch (node, event, data) {\r\n var n = getEventTarget(node)\r\n\r\n // Dispatch event\r\n if (event instanceof globals.window.Event) {\r\n n.dispatchEvent(event)\r\n } else {\r\n event = new globals.window.CustomEvent(event, { detail: data, cancelable: true })\r\n n.dispatchEvent(event)\r\n }\r\n return event\r\n}\r\n","/*\r\n\r\nColor {\r\n constructor (a, b, c, space) {\r\n space: 'hsl'\r\n a: 30\r\n b: 20\r\n c: 10\r\n },\r\n\r\n toRgb () { return new Color in rgb space }\r\n toHsl () { return new Color in hsl space }\r\n toLab () { return new Color in lab space }\r\n\r\n toArray () { [space, a, b, c] }\r\n fromArray () { convert it back }\r\n}\r\n\r\n// Conversions aren't always exact because of monitor profiles etc...\r\nnew Color(h, s, l, 'hsl') !== new Color(r, g, b).hsl()\r\nnew Color(100, 100, 100, [space])\r\nnew Color('hsl(30, 20, 10)')\r\n\r\n// Sugar\r\nSVG.rgb(30, 20, 50).lab()\r\nSVG.hsl()\r\nSVG.lab('rgb(100, 100, 100)')\r\n*/\r\n\r\nimport { hex, isHex, isRgb, rgb, whitespace } from '../modules/core/regex.js'\r\n\r\n// Ensure to six-based hex\r\nfunction fullHex (hex) {\r\n return hex.length === 4\r\n ? [ '#',\r\n hex.substring(1, 2), hex.substring(1, 2),\r\n hex.substring(2, 3), hex.substring(2, 3),\r\n hex.substring(3, 4), hex.substring(3, 4)\r\n ].join('')\r\n : hex\r\n}\r\n\r\n// Component to hex value\r\nfunction compToHex (comp) {\r\n var hex = comp.toString(16)\r\n return hex.length === 1 ? '0' + hex : hex\r\n}\r\n\r\nexport default class Color {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (color, g, b) {\r\n let match\r\n\r\n // initialize defaults\r\n this.r = 0\r\n this.g = 0\r\n this.b = 0\r\n\r\n if (!color) return\r\n\r\n // parse color\r\n if (typeof color === 'string') {\r\n if (isRgb.test(color)) {\r\n // get rgb values\r\n match = rgb.exec(color.replace(whitespace, ''))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1])\r\n this.g = parseInt(match[2])\r\n this.b = parseInt(match[3])\r\n } else if (isHex.test(color)) {\r\n // get hex values\r\n match = hex.exec(fullHex(color))\r\n\r\n // parse numeric values\r\n this.r = parseInt(match[1], 16)\r\n this.g = parseInt(match[2], 16)\r\n this.b = parseInt(match[3], 16)\r\n }\r\n } else if (Array.isArray(color)) {\r\n this.r = color[0]\r\n this.g = color[1]\r\n this.b = color[2]\r\n } else if (typeof color === 'object') {\r\n this.r = color.r\r\n this.g = color.g\r\n this.b = color.b\r\n } else if (arguments.length === 3) {\r\n this.r = color\r\n this.g = g\r\n this.b = b\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Default to hex conversion\r\n toString () {\r\n return this.toHex()\r\n }\r\n\r\n toArray () {\r\n return [this.r, this.g, this.b]\r\n }\r\n\r\n // Build hex value\r\n toHex () {\r\n return '#' +\r\n compToHex(Math.round(this.r)) +\r\n compToHex(Math.round(this.g)) +\r\n compToHex(Math.round(this.b))\r\n }\r\n\r\n // Build rgb value\r\n toRgb () {\r\n return 'rgb(' + [this.r, this.g, this.b].join() + ')'\r\n }\r\n\r\n // Calculate true brightness\r\n brightness () {\r\n return (this.r / 255 * 0.30) +\r\n (this.g / 255 * 0.59) +\r\n (this.b / 255 * 0.11)\r\n }\r\n\r\n // Testers\r\n\r\n // Test if given value is a color string\r\n static test (color) {\r\n color += ''\r\n return isHex.test(color) || isRgb.test(color)\r\n }\r\n\r\n // Test if given value is a rgb object\r\n static isRgb (color) {\r\n return color && typeof color.r === 'number' &&\r\n typeof color.g === 'number' &&\r\n typeof color.b === 'number'\r\n }\r\n\r\n // Test if given value is a color\r\n static isColor (color) {\r\n return this.isRgb(color) || this.test(color)\r\n }\r\n}\r\n","export default class Point {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (x, y) {\r\n let source\r\n let base = { x: 0, y: 0 }\r\n\r\n // ensure source as object\r\n source = Array.isArray(x) ? { x: x[0], y: x[1] }\r\n : typeof x === 'object' ? { x: x.x, y: x.y }\r\n : { x: x, y: y }\r\n\r\n // merge source\r\n this.x = source.x == null ? base.x : source.x\r\n this.y = source.y == null ? base.y : source.y\r\n\r\n return this\r\n }\r\n\r\n // Clone point\r\n clone () {\r\n return new Point(this)\r\n }\r\n\r\n // transform point with matrix\r\n transform (m) {\r\n // Perform the matrix multiplication\r\n var x = m.a * this.x + m.c * this.y + m.e\r\n var y = m.b * this.x + m.d * this.y + m.f\r\n\r\n // Return the required point\r\n return new Point(x, y)\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y]\r\n }\r\n}\r\n\r\nexport function point (x, y) {\r\n return new Point(x, y).transform(this.screenCTM().inverse())\r\n}\r\n","import { globals } from '../../utils/window.js'\r\nimport { makeInstance } from '../../utils/adopter.js'\r\n\r\nexport default function parser () {\r\n // Reuse cached element if possible\r\n if (!parser.nodes) {\r\n let svg = makeInstance().size(2, 0)\r\n svg.node.cssText = [\r\n 'opacity: 0',\r\n 'position: absolute',\r\n 'left: -100%',\r\n 'top: -100%',\r\n 'overflow: hidden'\r\n ].join(';')\r\n\r\n let path = svg.path().node\r\n\r\n parser.nodes = { svg, path }\r\n }\r\n\r\n if (!parser.nodes.svg.node.parentNode) {\r\n let b = globals.document.body || globals.document.documentElement\r\n parser.nodes.svg.addTo(b)\r\n }\r\n\r\n return parser.nodes\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { globals } from '../utils/window.js'\r\nimport Point from './Point.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nfunction isNulledBox (box) {\r\n return !box.w && !box.h && !box.x && !box.y\r\n}\r\n\r\nfunction domContains (node) {\r\n return (globals.document.documentElement.contains || function (node) {\r\n // This is IE - it does not support contains() for top-level SVGs\r\n while (node.parentNode) {\r\n node = node.parentNode\r\n }\r\n return node === document\r\n }).call(globals.document.documentElement, node)\r\n}\r\n\r\nexport default class Box {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (source) {\r\n var base = [0, 0, 0, 0]\r\n source = typeof source === 'string' ? source.split(delimiter).map(parseFloat)\r\n : Array.isArray(source) ? source\r\n : typeof source === 'object' ? [source.left != null ? source.left\r\n : source.x, source.top != null ? source.top : source.y, source.width, source.height]\r\n : arguments.length === 4 ? [].slice.call(arguments)\r\n : base\r\n\r\n this.x = source[0] || 0\r\n this.y = source[1] || 0\r\n this.width = this.w = source[2] || 0\r\n this.height = this.h = source[3] || 0\r\n\r\n // Add more bounding box properties\r\n this.x2 = this.x + this.w\r\n this.y2 = this.y + this.h\r\n this.cx = this.x + this.w / 2\r\n this.cy = this.y + this.h / 2\r\n\r\n return this\r\n }\r\n\r\n // Merge rect box with another, return a new instance\r\n merge (box) {\r\n let x = Math.min(this.x, box.x)\r\n let y = Math.min(this.y, box.y)\r\n let width = Math.max(this.x + this.width, box.x + box.width) - x\r\n let height = Math.max(this.y + this.height, box.y + box.height) - y\r\n\r\n return new Box(x, y, width, height)\r\n }\r\n\r\n transform (m) {\r\n let xMin = Infinity\r\n let xMax = -Infinity\r\n let yMin = Infinity\r\n let yMax = -Infinity\r\n\r\n let pts = [\r\n new Point(this.x, this.y),\r\n new Point(this.x2, this.y),\r\n new Point(this.x, this.y2),\r\n new Point(this.x2, this.y2)\r\n ]\r\n\r\n pts.forEach(function (p) {\r\n p = p.transform(m)\r\n xMin = Math.min(xMin, p.x)\r\n xMax = Math.max(xMax, p.x)\r\n yMin = Math.min(yMin, p.y)\r\n yMax = Math.max(yMax, p.y)\r\n })\r\n\r\n return new Box(\r\n xMin, yMin,\r\n xMax - xMin,\r\n yMax - yMin\r\n )\r\n }\r\n\r\n addOffset () {\r\n // offset by window scroll position, because getBoundingClientRect changes when window is scrolled\r\n this.x += globals.window.pageXOffset\r\n this.y += globals.window.pageYOffset\r\n return this\r\n }\r\n\r\n toString () {\r\n return this.x + ' ' + this.y + ' ' + this.width + ' ' + this.height\r\n }\r\n\r\n toArray () {\r\n return [this.x, this.y, this.width, this.height]\r\n }\r\n\r\n isNulled () {\r\n return isNulledBox(this)\r\n }\r\n}\r\n\r\nfunction getBox (cb, retry) {\r\n let box\r\n\r\n try {\r\n box = cb(this.node)\r\n\r\n if (isNulledBox(box) && !domContains(this.node)) {\r\n throw new Error('Element not in the dom')\r\n }\r\n } catch (e) {\r\n box = retry(this)\r\n }\r\n\r\n return box\r\n}\r\n\r\nexport function bbox () {\r\n return new Box(getBox.call(this, (node) => node.getBBox(), (el) => {\r\n try {\r\n let clone = el.clone().addTo(parser().svg).show()\r\n let box = clone.node.getBBox()\r\n clone.remove()\r\n return box\r\n } catch (e) {\r\n throw new Error('Getting bbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }\r\n }))\r\n}\r\n\r\nexport function rbox (el) {\r\n let box = new Box(getBox.call(this, (node) => node.getBoundingClientRect(), (el) => {\r\n throw new Error('Getting rbox of element \"' + el.node.nodeName + '\" is not possible')\r\n }))\r\n if (el) return box.transform(el.screenCTM().inverse())\r\n return box.addOffset()\r\n}\r\n\r\nregisterMethods({\r\n viewbox: {\r\n viewbox (x, y, width, height) {\r\n // act as getter\r\n if (x == null) return new Box(this.attr('viewBox'))\r\n\r\n // act as setter\r\n return this.attr('viewBox', new Box(x, y, width, height))\r\n }\r\n }\r\n})\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { radians } from '../utils/utils.js'\r\nimport Element from '../elements/Element.js'\r\nimport Point from './Point.js'\r\n\r\nfunction closeEnough (a, b, threshold) {\r\n return Math.abs(b - a) < (threshold || 1e-6)\r\n}\r\n\r\nexport default class Matrix {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n // Initialize\r\n init (source) {\r\n var base = Matrix.fromArray([1, 0, 0, 1, 0, 0])\r\n\r\n // ensure source as object\r\n source = source instanceof Element ? source.matrixify()\r\n : typeof source === 'string' ? Matrix.fromArray(source.split(delimiter).map(parseFloat))\r\n : Array.isArray(source) ? Matrix.fromArray(source)\r\n : (typeof source === 'object' && Matrix.isMatrixLike(source)) ? source\r\n : (typeof source === 'object') ? new Matrix().transform(source)\r\n : arguments.length === 6 ? Matrix.fromArray([].slice.call(arguments))\r\n : base\r\n\r\n // Merge the source matrix with the base matrix\r\n this.a = source.a != null ? source.a : base.a\r\n this.b = source.b != null ? source.b : base.b\r\n this.c = source.c != null ? source.c : base.c\r\n this.d = source.d != null ? source.d : base.d\r\n this.e = source.e != null ? source.e : base.e\r\n this.f = source.f != null ? source.f : base.f\r\n\r\n return this\r\n }\r\n\r\n // Clones this matrix\r\n clone () {\r\n return new Matrix(this)\r\n }\r\n\r\n // Transform a matrix into another matrix by manipulating the space\r\n transform (o) {\r\n // Check if o is a matrix and then left multiply it directly\r\n if (Matrix.isMatrixLike(o)) {\r\n var matrix = new Matrix(o)\r\n return matrix.multiplyO(this)\r\n }\r\n\r\n // Get the proposed transformations and the current transformations\r\n var t = Matrix.formatTransforms(o)\r\n var current = this\r\n let { x: ox, y: oy } = new Point(t.ox, t.oy).transform(current)\r\n\r\n // Construct the resulting matrix\r\n var transformer = new Matrix()\r\n .translateO(t.rx, t.ry)\r\n .lmultiplyO(current)\r\n .translateO(-ox, -oy)\r\n .scaleO(t.scaleX, t.scaleY)\r\n .skewO(t.skewX, t.skewY)\r\n .shearO(t.shear)\r\n .rotateO(t.theta)\r\n .translateO(ox, oy)\r\n\r\n // If we want the origin at a particular place, we force it there\r\n if (isFinite(t.px) || isFinite(t.py)) {\r\n const origin = new Point(ox, oy).transform(transformer)\r\n // TODO: Replace t.px with isFinite(t.px)\r\n const dx = t.px ? t.px - origin.x : 0\r\n const dy = t.py ? t.py - origin.y : 0\r\n transformer.translateO(dx, dy)\r\n }\r\n\r\n // Translate now after positioning\r\n transformer.translateO(t.tx, t.ty)\r\n return transformer\r\n }\r\n\r\n // Applies a matrix defined by its affine parameters\r\n compose (o) {\r\n if (o.origin) {\r\n o.originX = o.origin[0]\r\n o.originY = o.origin[1]\r\n }\r\n // Get the parameters\r\n var ox = o.originX || 0\r\n var oy = o.originY || 0\r\n var sx = o.scaleX || 1\r\n var sy = o.scaleY || 1\r\n var lam = o.shear || 0\r\n var theta = o.rotate || 0\r\n var tx = o.translateX || 0\r\n var ty = o.translateY || 0\r\n\r\n // Apply the standard matrix\r\n var result = new Matrix()\r\n .translateO(-ox, -oy)\r\n .scaleO(sx, sy)\r\n .shearO(lam)\r\n .rotateO(theta)\r\n .translateO(tx, ty)\r\n .lmultiplyO(this)\r\n .translateO(ox, oy)\r\n return result\r\n }\r\n\r\n // Decomposes this matrix into its affine parameters\r\n decompose (cx = 0, cy = 0) {\r\n // Get the parameters from the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Figure out if the winding direction is clockwise or counterclockwise\r\n var determinant = a * d - b * c\r\n var ccw = determinant > 0 ? 1 : -1\r\n\r\n // Since we only shear in x, we can use the x basis to get the x scale\r\n // and the rotation of the resulting matrix\r\n var sx = ccw * Math.sqrt(a * a + b * b)\r\n var thetaRad = Math.atan2(ccw * b, ccw * a)\r\n var theta = 180 / Math.PI * thetaRad\r\n var ct = Math.cos(thetaRad)\r\n var st = Math.sin(thetaRad)\r\n\r\n // We can then solve the y basis vector simultaneously to get the other\r\n // two affine parameters directly from these parameters\r\n var lam = (a * c + b * d) / determinant\r\n var sy = ((c * sx) / (lam * a - b)) || ((d * sx) / (lam * b + a))\r\n\r\n // Use the translations\r\n let tx = e - cx + cx * ct * sx + cy * (lam * ct * sx - st * sy)\r\n let ty = f - cy + cx * st * sx + cy * (lam * st * sx + ct * sy)\r\n\r\n // Construct the decomposition and return it\r\n return {\r\n // Return the affine parameters\r\n scaleX: sx,\r\n scaleY: sy,\r\n shear: lam,\r\n rotate: theta,\r\n translateX: tx,\r\n translateY: ty,\r\n originX: cx,\r\n originY: cy,\r\n\r\n // Return the matrix parameters\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n // Left multiplies by the given matrix\r\n multiply (matrix) {\r\n return this.clone().multiplyO(matrix)\r\n }\r\n\r\n multiplyO (matrix) {\r\n // Get the matrices\r\n var l = this\r\n var r = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n lmultiply (matrix) {\r\n return this.clone().lmultiplyO(matrix)\r\n }\r\n\r\n lmultiplyO (matrix) {\r\n var r = this\r\n var l = matrix instanceof Matrix\r\n ? matrix\r\n : new Matrix(matrix)\r\n\r\n return Matrix.matrixMultiply(l, r, this)\r\n }\r\n\r\n // Inverses matrix\r\n inverseO () {\r\n // Get the current parameters out of the matrix\r\n var a = this.a\r\n var b = this.b\r\n var c = this.c\r\n var d = this.d\r\n var e = this.e\r\n var f = this.f\r\n\r\n // Invert the 2x2 matrix in the top left\r\n var det = a * d - b * c\r\n if (!det) throw new Error('Cannot invert ' + this)\r\n\r\n // Calculate the top 2x2 matrix\r\n var na = d / det\r\n var nb = -b / det\r\n var nc = -c / det\r\n var nd = a / det\r\n\r\n // Apply the inverted matrix to the top right\r\n var ne = -(na * e + nc * f)\r\n var nf = -(nb * e + nd * f)\r\n\r\n // Construct the inverted matrix\r\n this.a = na\r\n this.b = nb\r\n this.c = nc\r\n this.d = nd\r\n this.e = ne\r\n this.f = nf\r\n\r\n return this\r\n }\r\n\r\n inverse () {\r\n return this.clone().inverseO()\r\n }\r\n\r\n // Translate matrix\r\n translate (x, y) {\r\n return this.clone().translateO(x, y)\r\n }\r\n\r\n translateO (x, y) {\r\n this.e += x || 0\r\n this.f += y || 0\r\n return this\r\n }\r\n\r\n // Scale matrix\r\n scale (x, y, cx, cy) {\r\n return this.clone().scaleO(...arguments)\r\n }\r\n\r\n scaleO (x, y = x, cx = 0, cy = 0) {\r\n // Support uniform scaling\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * x\r\n this.b = b * y\r\n this.c = c * x\r\n this.d = d * y\r\n this.e = e * x - cx * x + cx\r\n this.f = f * y - cy * y + cy\r\n\r\n return this\r\n }\r\n\r\n // Rotate matrix\r\n rotate (r, cx, cy) {\r\n return this.clone().rotateO(r, cx, cy)\r\n }\r\n\r\n rotateO (r, cx = 0, cy = 0) {\r\n // Convert degrees to radians\r\n r = radians(r)\r\n\r\n let cos = Math.cos(r)\r\n let sin = Math.sin(r)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a * cos - b * sin\r\n this.b = b * cos + a * sin\r\n this.c = c * cos - d * sin\r\n this.d = d * cos + c * sin\r\n this.e = e * cos - f * sin + cy * sin - cx * cos + cx\r\n this.f = f * cos + e * sin - cx * sin - cy * cos + cy\r\n\r\n return this\r\n }\r\n\r\n // Flip matrix on x or y, at a given offset\r\n flip (axis, around) {\r\n return this.clone().flipO(axis, around)\r\n }\r\n\r\n flipO (axis, around) {\r\n return axis === 'x' ? this.scaleO(-1, 1, around, 0)\r\n : axis === 'y' ? this.scaleO(1, -1, 0, around)\r\n : this.scaleO(-1, -1, axis, around || axis) // Define an x, y flip point\r\n }\r\n\r\n // Shear matrix\r\n shear (a, cx, cy) {\r\n return this.clone().shearO(a, cx, cy)\r\n }\r\n\r\n shearO (lx, cx = 0, cy = 0) {\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.c = c + d * lx\r\n this.e = e + f * lx - cy * lx\r\n\r\n return this\r\n }\r\n\r\n // Skew Matrix\r\n skew (x, y, cx, cy) {\r\n return this.clone().skewO(...arguments)\r\n }\r\n\r\n skewO (x, y = x, cx = 0, cy = 0) {\r\n // support uniformal skew\r\n if (arguments.length === 3) {\r\n cy = cx\r\n cx = y\r\n y = x\r\n }\r\n\r\n // Convert degrees to radians\r\n x = radians(x)\r\n y = radians(y)\r\n\r\n let lx = Math.tan(x)\r\n let ly = Math.tan(y)\r\n\r\n let { a, b, c, d, e, f } = this\r\n\r\n this.a = a + b * lx\r\n this.b = b + a * ly\r\n this.c = c + d * lx\r\n this.d = d + c * ly\r\n this.e = e + f * lx - cy * lx\r\n this.f = f + e * ly - cx * ly\r\n\r\n return this\r\n }\r\n\r\n // SkewX\r\n skewX (x, cx, cy) {\r\n return this.skew(x, 0, cx, cy)\r\n }\r\n\r\n skewXO (x, cx, cy) {\r\n return this.skewO(x, 0, cx, cy)\r\n }\r\n\r\n // SkewY\r\n skewY (y, cx, cy) {\r\n return this.skew(0, y, cx, cy)\r\n }\r\n\r\n skewYO (y, cx, cy) {\r\n return this.skewO(0, y, cx, cy)\r\n }\r\n\r\n // Transform around a center point\r\n aroundO (cx, cy, matrix) {\r\n var dx = cx || 0\r\n var dy = cy || 0\r\n return this.translateO(-dx, -dy).lmultiplyO(matrix).translateO(dx, dy)\r\n }\r\n\r\n around (cx, cy, matrix) {\r\n return this.clone().aroundO(cx, cy, matrix)\r\n }\r\n\r\n // Check if two matrices are equal\r\n equals (other) {\r\n var comp = new Matrix(other)\r\n return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) &&\r\n closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) &&\r\n closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f)\r\n }\r\n\r\n // Convert matrix to string\r\n toString () {\r\n return 'matrix(' + this.a + ',' + this.b + ',' + this.c + ',' + this.d + ',' + this.e + ',' + this.f + ')'\r\n }\r\n\r\n toArray () {\r\n return [this.a, this.b, this.c, this.d, this.e, this.f]\r\n }\r\n\r\n valueOf () {\r\n return {\r\n a: this.a,\r\n b: this.b,\r\n c: this.c,\r\n d: this.d,\r\n e: this.e,\r\n f: this.f\r\n }\r\n }\r\n\r\n static fromArray (a) {\r\n return { a: a[0], b: a[1], c: a[2], d: a[3], e: a[4], f: a[5] }\r\n }\r\n\r\n static isMatrixLike (o) {\r\n return (\r\n o.a != null ||\r\n o.b != null ||\r\n o.c != null ||\r\n o.d != null ||\r\n o.e != null ||\r\n o.f != null\r\n )\r\n }\r\n\r\n static formatTransforms (o) {\r\n // Get all of the parameters required to form the matrix\r\n var flipBoth = o.flip === 'both' || o.flip === true\r\n var flipX = o.flip && (flipBoth || o.flip === 'x') ? -1 : 1\r\n var flipY = o.flip && (flipBoth || o.flip === 'y') ? -1 : 1\r\n var skewX = o.skew && o.skew.length ? o.skew[0]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewX) ? o.skewX\r\n : 0\r\n var skewY = o.skew && o.skew.length ? o.skew[1]\r\n : isFinite(o.skew) ? o.skew\r\n : isFinite(o.skewY) ? o.skewY\r\n : 0\r\n var scaleX = o.scale && o.scale.length ? o.scale[0] * flipX\r\n : isFinite(o.scale) ? o.scale * flipX\r\n : isFinite(o.scaleX) ? o.scaleX * flipX\r\n : flipX\r\n var scaleY = o.scale && o.scale.length ? o.scale[1] * flipY\r\n : isFinite(o.scale) ? o.scale * flipY\r\n : isFinite(o.scaleY) ? o.scaleY * flipY\r\n : flipY\r\n var shear = o.shear || 0\r\n var theta = o.rotate || o.theta || 0\r\n var origin = new Point(o.origin || o.around || o.ox || o.originX, o.oy || o.originY)\r\n var ox = origin.x\r\n var oy = origin.y\r\n var position = new Point(o.position || o.px || o.positionX, o.py || o.positionY)\r\n var px = position.x\r\n var py = position.y\r\n var translate = new Point(o.translate || o.tx || o.translateX, o.ty || o.translateY)\r\n var tx = translate.x\r\n var ty = translate.y\r\n var relative = new Point(o.relative || o.rx || o.relativeX, o.ry || o.relativeY)\r\n var rx = relative.x\r\n var ry = relative.y\r\n\r\n // Populate all of the values\r\n return {\r\n scaleX, scaleY, skewX, skewY, shear, theta, rx, ry, tx, ty, ox, oy, px, py\r\n }\r\n }\r\n\r\n // left matrix, right matrix, target matrix which is overwritten\r\n static matrixMultiply (l, r, o) {\r\n // Work out the product directly\r\n var a = l.a * r.a + l.c * r.b\r\n var b = l.b * r.a + l.d * r.b\r\n var c = l.a * r.c + l.c * r.d\r\n var d = l.b * r.c + l.d * r.d\r\n var e = l.e + l.a * r.e + l.c * r.f\r\n var f = l.f + l.b * r.e + l.d * r.f\r\n\r\n // make sure to use local variables because l/r and o could be the same\r\n o.a = a\r\n o.b = b\r\n o.c = c\r\n o.d = d\r\n o.e = e\r\n o.f = f\r\n\r\n return o\r\n }\r\n}\r\n\r\nexport function ctm () {\r\n return new Matrix(this.node.getCTM())\r\n}\r\n\r\nexport function screenCTM () {\r\n /* https://bugzilla.mozilla.org/show_bug.cgi?id=1344537\r\n This is needed because FF does not return the transformation matrix\r\n for the inner coordinate system when getScreenCTM() is called on nested svgs.\r\n However all other Browsers do that */\r\n if (typeof this.isRoot === 'function' && !this.isRoot()) {\r\n var rect = this.rect(1, 1)\r\n var m = rect.node.getScreenCTM()\r\n rect.remove()\r\n return new Matrix(m)\r\n }\r\n return new Matrix(this.node.getScreenCTM())\r\n}\r\n","/* eslint no-new-func: \"off\" */\r\nexport const subClassArray = (function () {\r\n try {\r\n // try es6 subclassing\r\n return Function('name', 'baseClass', '_constructor', [\r\n 'baseClass = baseClass || Array',\r\n 'return {',\r\n ' [name]: class extends baseClass {',\r\n ' constructor (...args) {',\r\n ' super(...args)',\r\n ' _constructor && _constructor.apply(this, args)',\r\n ' }',\r\n ' }',\r\n '}[name]'\r\n ].join('\\n'))\r\n } catch (e) {\r\n // Use es5 approach\r\n return (name, baseClass = Array, _constructor) => {\r\n const Arr = function () {\r\n baseClass.apply(this, arguments)\r\n _constructor && _constructor.apply(this, arguments)\r\n }\r\n\r\n Arr.prototype = Object.create(baseClass.prototype)\r\n Arr.prototype.constructor = Arr\r\n\r\n Arr.prototype.map = function (fn) {\r\n const arr = new Arr()\r\n arr.push.apply(arr, Array.prototype.map.call(this, fn))\r\n return arr\r\n }\r\n\r\n return Arr\r\n }\r\n }\r\n})()\r\n","import { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst List = subClassArray('List', Array, function (arr = []) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...arr)\r\n})\r\n\r\nexport default List\r\n\r\nextend(List, {\r\n each (fnOrMethodName, ...args) {\r\n if (typeof fnOrMethodName === 'function') {\r\n this.forEach((el) => { fnOrMethodName.call(el, el) })\r\n } else {\r\n return this.map(el => { return el[fnOrMethodName](...args) })\r\n }\r\n\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n }\r\n})\r\n\r\nList.extend = function (methods) {\r\n methods = methods.reduce((obj, name) => {\r\n obj[name] = function (...attrs) {\r\n return this.each(name, ...attrs)\r\n }\r\n return obj\r\n }, {})\r\n\r\n extend(List, methods)\r\n}\r\n","import { adopt } from '../../utils/adopter.js'\r\nimport { globals } from '../../utils/window.js'\r\nimport { map } from '../../utils/utils.js'\r\nimport List from '../../types/List.js'\r\n\r\nexport default function baseFind (query, parent) {\r\n return new List(map((parent || globals.document).querySelectorAll(query), function (node) {\r\n return adopt(node)\r\n }))\r\n}\r\n\r\n// Scoped find method\r\nexport function find (query) {\r\n return baseFind(query, this.node)\r\n}\r\n","import { dispatch, off, on } from '../modules/core/event.js'\r\nimport Base from './Base.js'\r\n\r\nexport default class EventTarget extends Base {\r\n constructor ({ events = {} } = {}) {\r\n super()\r\n this.events = events\r\n }\r\n\r\n addEventListener () {}\r\n\r\n dispatch (event, data) {\r\n return dispatch(this, event, data)\r\n }\r\n\r\n dispatchEvent (event) {\r\n const bag = this.getEventHolder().events\r\n if (!bag) return true\r\n\r\n const events = bag[event.type]\r\n\r\n for (let i in events) {\r\n for (let j in events[i]) {\r\n events[i][j](event)\r\n }\r\n }\r\n\r\n return !event.defaultPrevented\r\n }\r\n\r\n // Fire given event\r\n fire (event, data) {\r\n this.dispatch(event, data)\r\n return this\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n getEventTarget () {\r\n return this\r\n }\r\n\r\n // Unbind event from listener\r\n off (event, listener) {\r\n off(this, event, listener)\r\n return this\r\n }\r\n\r\n // Bind given event to listener\r\n on (event, listener, binding, options) {\r\n on(this, event, listener, binding, options)\r\n return this\r\n }\r\n\r\n removeEventListener () {}\r\n}\r\n","\r\nexport function noop () {}\r\n\r\n// Default animation values\r\nexport let timeline = {\r\n duration: 400,\r\n ease: '>',\r\n delay: 0\r\n}\r\n\r\n// Default attribute values\r\nexport let attrs = {\r\n\r\n // fill and stroke\r\n 'fill-opacity': 1,\r\n 'stroke-opacity': 1,\r\n 'stroke-width': 0,\r\n 'stroke-linejoin': 'miter',\r\n 'stroke-linecap': 'butt',\r\n fill: '#000000',\r\n stroke: '#000000',\r\n opacity: 1,\r\n\r\n // position\r\n x: 0,\r\n y: 0,\r\n cx: 0,\r\n cy: 0,\r\n\r\n // size\r\n width: 0,\r\n height: 0,\r\n\r\n // radius\r\n r: 0,\r\n rx: 0,\r\n ry: 0,\r\n\r\n // gradient\r\n offset: 0,\r\n 'stop-opacity': 1,\r\n 'stop-color': '#000000',\r\n\r\n // text\r\n 'font-size': 16,\r\n 'font-family': 'Helvetica, Arial, sans-serif',\r\n 'text-anchor': 'start'\r\n}\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\n\r\nconst SVGArray = subClassArray('SVGArray', Array, function (arr) {\r\n this.init(arr)\r\n})\r\n\r\nexport default SVGArray\r\n\r\nextend(SVGArray, {\r\n init (arr) {\r\n // This catches the case, that native map tries to create an array with new Array(1)\r\n if (typeof arr === 'number') return this\r\n this.length = 0\r\n this.push(...this.parse(arr))\r\n return this\r\n },\r\n\r\n toArray () {\r\n return Array.prototype.concat.apply([], this)\r\n },\r\n\r\n toString () {\r\n return this.join(' ')\r\n },\r\n\r\n // Flattens the array if needed\r\n valueOf () {\r\n const ret = []\r\n ret.push(...this)\r\n return ret\r\n },\r\n\r\n // Parse whitespace separated string\r\n parse (array = []) {\r\n // If already is an array, no need to parse it\r\n if (array instanceof Array) return array\r\n\r\n return array.trim().split(delimiter).map(parseFloat)\r\n },\r\n\r\n clone () {\r\n return new this.constructor(this)\r\n },\r\n\r\n toSet () {\r\n return new Set(this)\r\n }\r\n})\r\n","import { numberAndUnit } from '../modules/core/regex.js'\r\n\r\n// Module for unit convertions\r\nexport default class SVGNumber {\r\n // Initialize\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (value, unit) {\r\n unit = Array.isArray(value) ? value[1] : unit\r\n value = Array.isArray(value) ? value[0] : value\r\n\r\n // initialize defaults\r\n this.value = 0\r\n this.unit = unit || ''\r\n\r\n // parse value\r\n if (typeof value === 'number') {\r\n // ensure a valid numeric value\r\n this.value = isNaN(value) ? 0 : !isFinite(value) ? (value < 0 ? -3.4e+38 : +3.4e+38) : value\r\n } else if (typeof value === 'string') {\r\n unit = value.match(numberAndUnit)\r\n\r\n if (unit) {\r\n // make value numeric\r\n this.value = parseFloat(unit[1])\r\n\r\n // normalize\r\n if (unit[5] === '%') { this.value /= 100 } else if (unit[5] === 's') {\r\n this.value *= 1000\r\n }\r\n\r\n // store unit\r\n this.unit = unit[5]\r\n }\r\n } else {\r\n if (value instanceof SVGNumber) {\r\n this.value = value.valueOf()\r\n this.unit = value.unit\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n toString () {\r\n return (this.unit === '%' ? ~~(this.value * 1e8) / 1e6\r\n : this.unit === 's' ? this.value / 1e3\r\n : this.value\r\n ) + this.unit\r\n }\r\n\r\n toJSON () {\r\n return this.toString()\r\n }\r\n\r\n toArray () {\r\n return [this.value, this.unit]\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n // Add number\r\n plus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this + number, this.unit || number.unit)\r\n }\r\n\r\n // Subtract number\r\n minus (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this - number, this.unit || number.unit)\r\n }\r\n\r\n // Multiply number\r\n times (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this * number, this.unit || number.unit)\r\n }\r\n\r\n // Divide number\r\n divide (number) {\r\n number = new SVGNumber(number)\r\n return new SVGNumber(this / number, this.unit || number.unit)\r\n }\r\n}\r\n","import { attrs as defaults } from './defaults.js'\r\nimport { isNumber } from './regex.js'\r\nimport Color from '../../types/Color.js'\r\nimport SVGArray from '../../types/SVGArray.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\nconst hooks = []\r\nexport function registerAttrHook (fn) {\r\n hooks.push(fn)\r\n}\r\n\r\n// Set svg element attribute\r\nexport default function attr (attr, val, ns) {\r\n // act as full getter\r\n if (attr == null) {\r\n // get an object of attributes\r\n attr = {}\r\n val = this.node.attributes\r\n\r\n for (let node of val) {\r\n attr[node.nodeName] = isNumber.test(node.nodeValue)\r\n ? parseFloat(node.nodeValue)\r\n : node.nodeValue\r\n }\r\n\r\n return attr\r\n } else if (attr instanceof Array) {\r\n // loop through array and get all values\r\n return attr.reduce((last, curr) => {\r\n last[curr] = this.attr(curr)\r\n return last\r\n }, {})\r\n } else if (typeof attr === 'object') {\r\n // apply every attribute individually if an object is passed\r\n for (val in attr) this.attr(val, attr[val])\r\n } else if (val === null) {\r\n // remove value\r\n this.node.removeAttribute(attr)\r\n } else if (val == null) {\r\n // act as a getter if the first and only argument is not an object\r\n val = this.node.getAttribute(attr)\r\n return val == null ? defaults[attr]\r\n : isNumber.test(val) ? parseFloat(val)\r\n : val\r\n } else {\r\n // Loop through hooks and execute them to convert value\r\n val = hooks.reduce((_val, hook) => {\r\n return hook(attr, _val, this)\r\n }, val)\r\n\r\n // ensure correct numeric values (also accepts NaN and Infinity)\r\n if (typeof val === 'number') {\r\n val = new SVGNumber(val)\r\n } else if (Color.isColor(val)) {\r\n // ensure full hex color\r\n val = new Color(val)\r\n } else if (val.constructor === Array) {\r\n // Check for plain arrays and parse array values\r\n val = new SVGArray(val)\r\n }\r\n\r\n // if the passed attribute is leading...\r\n if (attr === 'leading') {\r\n // ... call the leading method instead\r\n if (this.leading) {\r\n this.leading(val)\r\n }\r\n } else {\r\n // set given attribute on node\r\n typeof ns === 'string' ? this.node.setAttributeNS(ns, attr, val.toString())\r\n : this.node.setAttribute(attr, val.toString())\r\n }\r\n\r\n // rebuild if required\r\n if (this.rebuild && (attr === 'font-size' || attr === 'x')) {\r\n this.rebuild()\r\n }\r\n }\r\n\r\n return this\r\n}\r\n","import {\r\n adopt,\r\n assignNewId,\r\n eid,\r\n extend,\r\n makeInstance,\r\n makeNode,\r\n register\r\n} from '../utils/adopter.js'\r\nimport { find } from '../modules/core/selector.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { map } from '../utils/utils.js'\r\nimport { ns } from '../modules/core/namespaces.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport List from '../types/List.js'\r\nimport attr from '../modules/core/attr.js'\r\n\r\nexport default class Dom extends EventTarget {\r\n constructor (node, attrs) {\r\n super(node)\r\n this.node = node\r\n this.type = node.nodeName\r\n\r\n if (attrs && node !== attrs) {\r\n this.attr(attrs)\r\n }\r\n }\r\n\r\n // Add given element at a position\r\n add (element, i) {\r\n element = makeInstance(element)\r\n\r\n if (i == null) {\r\n this.node.appendChild(element.node)\r\n } else if (element.node !== this.node.childNodes[i]) {\r\n this.node.insertBefore(element.node, this.node.childNodes[i])\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Add element to given container and return self\r\n addTo (parent) {\r\n return makeInstance(parent).put(this)\r\n }\r\n\r\n // Returns all child elements\r\n children () {\r\n return new List(map(this.node.children, function (node) {\r\n return adopt(node)\r\n }))\r\n }\r\n\r\n // Remove all elements in this container\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n\r\n // remove defs reference\r\n delete this._defs\r\n\r\n return this\r\n }\r\n\r\n // Clone element\r\n clone () {\r\n // write dom data to the dom so the clone can pickup the data\r\n this.writeDataToDom()\r\n\r\n // clone element and assign new id\r\n return assignNewId(this.node.cloneNode(true))\r\n }\r\n\r\n // Iterates over all children and invokes a given block\r\n each (block, deep) {\r\n var children = this.children()\r\n var i, il\r\n\r\n for (i = 0, il = children.length; i < il; i++) {\r\n block.apply(children[i], [i, children])\r\n\r\n if (deep) {\r\n children[i].each(block, deep)\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n element (nodeName) {\r\n return this.put(new Dom(makeNode(nodeName)))\r\n }\r\n\r\n // Get first child\r\n first () {\r\n return adopt(this.node.firstChild)\r\n }\r\n\r\n // Get a element at the given index\r\n get (i) {\r\n return adopt(this.node.childNodes[i])\r\n }\r\n\r\n getEventHolder () {\r\n return this.node\r\n }\r\n\r\n getEventTarget () {\r\n return this.node\r\n }\r\n\r\n // Checks if the given element is a child\r\n has (element) {\r\n return this.index(element) >= 0\r\n }\r\n\r\n // Get / set id\r\n id (id) {\r\n // generate new id if no id set\r\n if (typeof id === 'undefined' && !this.node.id) {\r\n this.node.id = eid(this.type)\r\n }\r\n\r\n // dont't set directly width this.node.id to make `null` work correctly\r\n return this.attr('id', id)\r\n }\r\n\r\n // Gets index of given element\r\n index (element) {\r\n return [].slice.call(this.node.childNodes).indexOf(element.node)\r\n }\r\n\r\n // Get the last child\r\n last () {\r\n return adopt(this.node.lastChild)\r\n }\r\n\r\n // matches the element vs a css selector\r\n matches (selector) {\r\n const el = this.node\r\n return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector)\r\n }\r\n\r\n // Returns the parent element instance\r\n parent (type) {\r\n var parent = this\r\n\r\n // check for parent\r\n if (!parent.node.parentNode) return null\r\n\r\n // get parent element\r\n parent = adopt(parent.node.parentNode)\r\n\r\n if (!type) return parent\r\n\r\n // loop trough ancestors if type is given\r\n while (parent && parent.node instanceof globals.window.SVGElement) { // FIXME: That shouldnt be neccessary\r\n if (typeof type === 'string' ? parent.matches(type) : parent instanceof type) return parent\r\n parent = adopt(parent.node.parentNode)\r\n }\r\n }\r\n\r\n // Basically does the same as `add()` but returns the added element instead\r\n put (element, i) {\r\n this.add(element, i)\r\n return element\r\n }\r\n\r\n // Add element to given container and return container\r\n putIn (parent) {\r\n return makeInstance(parent).add(this)\r\n }\r\n\r\n // Remove element\r\n remove () {\r\n if (this.parent()) {\r\n this.parent().removeElement(this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Remove a given child\r\n removeElement (element) {\r\n this.node.removeChild(element.node)\r\n\r\n return this\r\n }\r\n\r\n // Replace this with element\r\n replace (element) {\r\n element = makeInstance(element)\r\n this.node.parentNode.replaceChild(element.node, this.node)\r\n return element\r\n }\r\n\r\n round (precision = 2, map) {\r\n const factor = 10 ** precision\r\n const attrs = this.attr()\r\n\r\n // If we have no map, build one from attrs\r\n if (!map) {\r\n map = Object.keys(attrs)\r\n }\r\n\r\n // Holds rounded attributes\r\n const newAttrs = {}\r\n map.forEach((key) => {\r\n newAttrs[key] = Math.round(attrs[key] * factor) / factor\r\n })\r\n\r\n this.attr(newAttrs)\r\n return this\r\n }\r\n\r\n // Return id on string conversion\r\n toString () {\r\n return this.id()\r\n }\r\n\r\n // Import raw svg\r\n svg (svgOrFn, outerHTML) {\r\n var well, len, fragment\r\n\r\n if (svgOrFn === false) {\r\n outerHTML = false\r\n svgOrFn = null\r\n }\r\n\r\n // act as getter if no svg string is given\r\n if (svgOrFn == null || typeof svgOrFn === 'function') {\r\n // The default for exports is, that the outerNode is included\r\n outerHTML = outerHTML == null ? true : outerHTML\r\n\r\n // write svgjs data to the dom\r\n this.writeDataToDom()\r\n let current = this\r\n\r\n // An export modifier was passed\r\n if (svgOrFn != null) {\r\n current = adopt(current.node.cloneNode(true))\r\n\r\n // If the user wants outerHTML we need to process this node, too\r\n if (outerHTML) {\r\n let result = svgOrFn(current)\r\n current = result || current\r\n\r\n // The user does not want this node? Well, then he gets nothing\r\n if (result === false) return ''\r\n }\r\n\r\n // Deep loop through all children and apply modifier\r\n current.each(function () {\r\n let result = svgOrFn(this)\r\n let _this = result || this\r\n\r\n // If modifier returns false, discard node\r\n if (result === false) {\r\n this.remove()\r\n\r\n // If modifier returns new node, use it\r\n } else if (result && this !== _this) {\r\n this.replace(_this)\r\n }\r\n }, true)\r\n }\r\n\r\n // Return outer or inner content\r\n return outerHTML\r\n ? current.node.outerHTML\r\n : current.node.innerHTML\r\n }\r\n\r\n // Act as setter if we got a string\r\n\r\n // The default for import is, that the current node is not replaced\r\n outerHTML = outerHTML == null ? false : outerHTML\r\n\r\n // Create temporary holder\r\n well = globals.document.createElementNS(ns, 'svg')\r\n fragment = globals.document.createDocumentFragment()\r\n\r\n // Dump raw svg\r\n well.innerHTML = svgOrFn\r\n\r\n // Transplant nodes into the fragment\r\n for (len = well.children.length; len--;) {\r\n fragment.appendChild(well.firstElementChild)\r\n }\r\n\r\n let parent = this.parent()\r\n\r\n // Add the whole fragment at once\r\n return outerHTML\r\n ? this.replace(fragment) && parent\r\n : this.add(fragment)\r\n }\r\n\r\n words (text) {\r\n // This is faster than removing all children and adding a new one\r\n this.node.textContent = text\r\n return this\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // dump variables recursively\r\n this.each(function () {\r\n this.writeDataToDom()\r\n })\r\n\r\n return this\r\n }\r\n}\r\n\r\nextend(Dom, { attr, find })\r\nregister(Dom)\r\n","import { bbox, rbox } from '../types/Box.js'\r\nimport { ctm, screenCTM } from '../types/Matrix.js'\r\nimport {\r\n extend,\r\n getClass,\r\n makeInstance,\r\n register,\r\n root\r\n} from '../utils/adopter.js'\r\nimport { globals } from '../utils/window.js'\r\nimport { point } from '../types/Point.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { reference } from '../modules/core/regex.js'\r\nimport Dom from './Dom.js'\r\nimport List from '../types/List.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nconst Svg = getClass(root)\r\n\r\nexport default class Element extends Dom {\r\n constructor (node, attrs) {\r\n super(node, attrs)\r\n\r\n // initialize data object\r\n this.dom = {}\r\n\r\n // create circular reference\r\n this.node.instance = this\r\n\r\n if (node.hasAttribute('svgjs:data')) {\r\n // pull svgjs data from the dom (getAttributeNS doesn't work in html5)\r\n this.setData(JSON.parse(node.getAttribute('svgjs:data')) || {})\r\n }\r\n }\r\n\r\n // Move element by its center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n }\r\n\r\n // Move by center over x-axis\r\n cx (x) {\r\n return x == null ? this.x() + this.width() / 2 : this.x(x - this.width() / 2)\r\n }\r\n\r\n // Move by center over y-axis\r\n cy (y) {\r\n return y == null\r\n ? this.y() + this.height() / 2\r\n : this.y(y - this.height() / 2)\r\n }\r\n\r\n // Get defs\r\n defs () {\r\n return this.root().defs()\r\n }\r\n\r\n // Get parent document\r\n root () {\r\n let p = this.parent(Svg)\r\n return p && p.root()\r\n }\r\n\r\n getEventHolder () {\r\n return this\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('height', height)\r\n }\r\n\r\n // Checks whether the given point inside the bounding box of the element\r\n inside (x, y) {\r\n let box = this.bbox()\r\n\r\n return x > box.x &&\r\n y > box.y &&\r\n x < box.x + box.width &&\r\n y < box.y + box.height\r\n }\r\n\r\n // Move element to given x and y values\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n }\r\n\r\n // return array of all ancestors of given type up to the root svg\r\n parents (until = globals.document) {\r\n until = makeInstance(until)\r\n let parents = new List()\r\n let parent = this\r\n\r\n while (\r\n (parent = parent.parent()) &&\r\n parent.node !== until.node &&\r\n parent.node !== globals.document\r\n ) {\r\n parents.push(parent)\r\n }\r\n\r\n return parents\r\n }\r\n\r\n // Get referenced element form attribute value\r\n reference (attr) {\r\n attr = this.attr(attr)\r\n if (!attr) return null\r\n\r\n const m = attr.match(reference)\r\n return m ? makeInstance(m[1]) : null\r\n }\r\n\r\n // set given data to the elements data property\r\n setData (o) {\r\n this.dom = o\r\n return this\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .width(new SVGNumber(p.width))\r\n .height(new SVGNumber(p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('width', width)\r\n }\r\n\r\n // write svgjs data to the dom\r\n writeDataToDom () {\r\n // remove previously set data\r\n this.node.removeAttribute('svgjs:data')\r\n\r\n if (Object.keys(this.dom).length) {\r\n this.node.setAttribute('svgjs:data', JSON.stringify(this.dom)) // see #428\r\n }\r\n\r\n return super.writeDataToDom()\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n return this.attr('y', y)\r\n }\r\n}\r\n\r\nextend(Element, {\r\n bbox, rbox, point, ctm, screenCTM\r\n})\r\n\r\nregister(Element)\r\n","import { on, off } from '../core/event.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Color from '../../types/Color.js'\r\nimport Element from '../../elements/Element.js'\r\nimport Matrix from '../../types/Matrix.js'\r\nimport Point from '../../types/Point.js'\r\nimport SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Define list of available attributes for stroke and fill\r\nvar sugar = {\r\n stroke: ['color', 'width', 'opacity', 'linecap', 'linejoin', 'miterlimit', 'dasharray', 'dashoffset'],\r\n fill: ['color', 'opacity', 'rule'],\r\n prefix: function (t, a) {\r\n return a === 'color' ? t : t + '-' + a\r\n }\r\n}\r\n\r\n// Add sugar for fill and stroke\r\n;['fill', 'stroke'].forEach(function (m) {\r\n var extension = {}\r\n var i\r\n\r\n extension[m] = function (o) {\r\n if (typeof o === 'undefined') {\r\n return this.attr(m)\r\n }\r\n if (typeof o === 'string' || Color.isRgb(o) || (o instanceof Element)) {\r\n this.attr(m, o)\r\n } else {\r\n // set all attributes from sugar.fill and sugar.stroke list\r\n for (i = sugar[m].length - 1; i >= 0; i--) {\r\n if (o[sugar[m][i]] != null) {\r\n this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]])\r\n }\r\n }\r\n }\r\n\r\n return this\r\n }\r\n\r\n registerMethods(['Shape', 'Runner'], extension)\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Let the user set the matrix directly\r\n matrix: function (mat, b, c, d, e, f) {\r\n // Act as a getter\r\n if (mat == null) {\r\n return new Matrix(this)\r\n }\r\n\r\n // Act as a setter, the user can pass a matrix or a set of numbers\r\n return this.attr('transform', new Matrix(mat, b, c, d, e, f))\r\n },\r\n\r\n // Map rotation to transform\r\n rotate: function (angle, cx, cy) {\r\n return this.transform({ rotate: angle, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map skew to transform\r\n skew: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ skew: x, ox: y, oy: cx }, true)\r\n : this.transform({ skew: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n shear: function (lam, cx, cy) {\r\n return this.transform({ shear: lam, ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map scale to transform\r\n scale: function (x, y, cx, cy) {\r\n return arguments.length === 1 || arguments.length === 3\r\n ? this.transform({ scale: x, ox: y, oy: cx }, true)\r\n : this.transform({ scale: [x, y], ox: cx, oy: cy }, true)\r\n },\r\n\r\n // Map translate to transform\r\n translate: function (x, y) {\r\n return this.transform({ translate: [x, y] }, true)\r\n },\r\n\r\n // Map relative translations to transform\r\n relative: function (x, y) {\r\n return this.transform({ relative: [x, y] }, true)\r\n },\r\n\r\n // Map flip to transform\r\n flip: function (direction, around) {\r\n var directionString = typeof direction === 'string' ? direction\r\n : isFinite(direction) ? 'both'\r\n : 'both'\r\n var origin = (direction === 'both' && isFinite(around)) ? [around, around]\r\n : (direction === 'x') ? [around, 0]\r\n : (direction === 'y') ? [0, around]\r\n : isFinite(direction) ? [direction, direction]\r\n : [0, 0]\r\n this.transform({ flip: directionString, origin: origin }, true)\r\n },\r\n\r\n // Opacity\r\n opacity: function (value) {\r\n return this.attr('opacity', value)\r\n },\r\n\r\n // Relative move over x and y axes\r\n dmove: function (x, y) {\r\n return this.dx(x).dy(y)\r\n }\r\n})\r\n\r\nregisterMethods('Element', {\r\n // Relative move over x axis\r\n dx: function (x) {\r\n return this.x(new SVGNumber(x).plus(this.x()))\r\n },\r\n\r\n // Relative move over y axis\r\n dy: function (y) {\r\n return this.y(new SVGNumber(y).plus(this.y()))\r\n }\r\n})\r\n\r\nregisterMethods('radius', {\r\n // Add x and y radius\r\n radius: function (x, y) {\r\n var type = (this._element || this).type\r\n return type === 'radialGradient' || type === 'radialGradient'\r\n ? this.attr('r', new SVGNumber(x))\r\n : this.rx(x).ry(y == null ? x : y)\r\n }\r\n})\r\n\r\nregisterMethods('Path', {\r\n // Get path length\r\n length: function () {\r\n return this.node.getTotalLength()\r\n },\r\n // Get point at length\r\n pointAt: function (length) {\r\n return new Point(this.node.getPointAtLength(length))\r\n }\r\n})\r\n\r\nregisterMethods(['Element', 'Runner'], {\r\n // Set font\r\n font: function (a, v) {\r\n if (typeof a === 'object') {\r\n for (v in a) this.font(v, a[v])\r\n }\r\n\r\n return a === 'leading'\r\n ? this.leading(v)\r\n : a === 'anchor'\r\n ? this.attr('text-anchor', v)\r\n : a === 'size' || a === 'family' || a === 'weight' || a === 'stretch' || a === 'variant' || a === 'style'\r\n ? this.attr('font-' + a, v)\r\n : this.attr(a, v)\r\n }\r\n})\r\n\r\nregisterMethods('Text', {\r\n ax (x) {\r\n return this.attr('x', x)\r\n },\r\n ay (y) {\r\n return this.attr('y', y)\r\n },\r\n amove (x, y) {\r\n return this.ax(x).ay(y)\r\n }\r\n})\r\n\r\n// Add events to elements\r\nconst methods = [ 'click',\r\n 'dblclick',\r\n 'mousedown',\r\n 'mouseup',\r\n 'mouseover',\r\n 'mouseout',\r\n 'mousemove',\r\n 'mouseenter',\r\n 'mouseleave',\r\n 'touchstart',\r\n 'touchmove',\r\n 'touchleave',\r\n 'touchend',\r\n 'touchcancel' ].reduce(function (last, event) {\r\n // add event to Element\r\n const fn = function (f) {\r\n if (f === null) {\r\n off(this, event)\r\n } else {\r\n on(this, event, f)\r\n }\r\n return this\r\n }\r\n\r\n last[event] = fn\r\n return last\r\n}, {})\r\n\r\nregisterMethods('Element', methods)\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import { getOrigin } from '../../utils/utils.js'\r\nimport { delimiter, transforms } from '../core/regex.js'\r\nimport { registerMethods } from '../../utils/methods.js'\r\nimport Matrix from '../../types/Matrix.js'\r\n\r\n// Reset all transformations\r\nexport function untransform () {\r\n return this.attr('transform', null)\r\n}\r\n\r\n// merge the whole transformation chain into one matrix and returns it\r\nexport function matrixify () {\r\n var matrix = (this.attr('transform') || '')\r\n // split transformations\r\n .split(transforms).slice(0, -1).map(function (str) {\r\n // generate key => value pairs\r\n var kv = str.trim().split('(')\r\n return [kv[0],\r\n kv[1].split(delimiter)\r\n .map(function (str) { return parseFloat(str) })\r\n ]\r\n })\r\n .reverse()\r\n // merge every transformation into one matrix\r\n .reduce(function (matrix, transform) {\r\n if (transform[0] === 'matrix') {\r\n return matrix.lmultiply(Matrix.fromArray(transform[1]))\r\n }\r\n return matrix[transform[0]].apply(matrix, transform[1])\r\n }, new Matrix())\r\n\r\n return matrix\r\n}\r\n\r\n// add an element to another parent without changing the visual representation on the screen\r\nexport function toParent (parent) {\r\n if (this === parent) return this\r\n var ctm = this.screenCTM()\r\n var pCtm = parent.screenCTM().inverse()\r\n\r\n this.addTo(parent).untransform().transform(pCtm.multiply(ctm))\r\n\r\n return this\r\n}\r\n\r\n// same as above with parent equals root-svg\r\nexport function toRoot () {\r\n return this.toParent(this.root())\r\n}\r\n\r\n// Add transformations\r\nexport function transform (o, relative) {\r\n // Act as a getter if no object was passed\r\n if (o == null || typeof o === 'string') {\r\n var decomposed = new Matrix(this).decompose()\r\n return decomposed[o] || decomposed\r\n }\r\n\r\n if (!Matrix.isMatrixLike(o)) {\r\n // Set the origin according to the defined transform\r\n o = { ...o, origin: getOrigin(o, this) }\r\n }\r\n\r\n // The user can pass a boolean, an Element or an Matrix or nothing\r\n var cleanRelative = relative === true ? this : (relative || false)\r\n var result = new Matrix(cleanRelative).transform(o)\r\n return this.attr('transform', result)\r\n}\r\n\r\nregisterMethods('Element', {\r\n untransform, matrixify, toParent, toRoot, transform\r\n})\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\n// Radius x value\r\nexport function rx (rx) {\r\n return this.attr('rx', rx)\r\n}\r\n\r\n// Radius y value\r\nexport function ry (ry) {\r\n return this.attr('ry', ry)\r\n}\r\n\r\n// Move over x-axis\r\nexport function x (x) {\r\n return x == null\r\n ? this.cx() - this.rx()\r\n : this.cx(x + this.rx())\r\n}\r\n\r\n// Move over y-axis\r\nexport function y (y) {\r\n return y == null\r\n ? this.cy() - this.ry()\r\n : this.cy(y + this.ry())\r\n}\r\n\r\n// Move by center over x-axis\r\nexport function cx (x) {\r\n return x == null\r\n ? this.attr('cx')\r\n : this.attr('cx', x)\r\n}\r\n\r\n// Move by center over y-axis\r\nexport function cy (y) {\r\n return y == null\r\n ? this.attr('cy')\r\n : this.attr('cy', y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n return width == null\r\n ? this.rx() * 2\r\n : this.rx(new SVGNumber(width).divide(2))\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n return height == null\r\n ? this.ry() * 2\r\n : this.ry(new SVGNumber(height).divide(2))\r\n}\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Shape extends Element {}\r\n\r\nregister(Shape)\r\n","import { cx, cy, height, width, x, y } from '../modules/core/circled.js'\r\nimport {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Circle extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('circle', node), node)\r\n }\r\n\r\n radius (r) {\r\n return this.attr('r', r)\r\n }\r\n\r\n // Radius x value\r\n rx (rx) {\r\n return this.attr('r', rx)\r\n }\r\n\r\n // Alias radius x value\r\n ry (ry) {\r\n return this.rx(ry)\r\n }\r\n\r\n size (size) {\r\n return this.radius(new SVGNumber(size).divide(2))\r\n }\r\n}\r\n\r\nextend(Circle, { x, y, cx, cy, width, height })\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create circle element\r\n circle: wrapWithAttrCheck(function (size) {\r\n return this.put(new Circle())\r\n .size(size)\r\n .move(0, 0)\r\n })\r\n }\r\n})\r\n\r\nregister(Circle)\r\n","import { register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\n\r\nexport default class Container extends Element {\r\n flatten (parent) {\r\n this.each(function () {\r\n if (this instanceof Container) return this.flatten(parent).ungroup(parent)\r\n return this.toParent(parent)\r\n })\r\n\r\n // we need this so that the root does not get removed\r\n this.node.firstElementChild || this.remove()\r\n\r\n return this\r\n }\r\n\r\n ungroup (parent) {\r\n parent = parent || this.parent()\r\n\r\n this.each(function () {\r\n return this.toParent(parent)\r\n })\r\n\r\n this.remove()\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Container)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Defs extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('defs', node), node)\r\n }\r\n\r\n flatten () { return this }\r\n ungroup () { return this }\r\n}\r\n\r\nregister(Defs)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport * as circled from '../modules/core/circled.js'\r\n\r\nexport default class Ellipse extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('ellipse', node), node)\r\n }\r\n\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n\r\n return this\r\n .rx(new SVGNumber(p.width).divide(2))\r\n .ry(new SVGNumber(p.height).divide(2))\r\n }\r\n}\r\n\r\nextend(Ellipse, circled)\r\n\r\nregisterMethods('Container', {\r\n // Create an ellipse\r\n ellipse: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Ellipse()).size(width, height).move(0, 0)\r\n })\r\n})\r\n\r\nregister(Ellipse)\r\n","import { nodeOrNew, register } from '../utils/adopter.js'\r\nimport Element from './Element.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Stop extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('stop', node), node)\r\n }\r\n\r\n // add color stops\r\n update (o) {\r\n if (typeof o === 'number' || o instanceof SVGNumber) {\r\n o = {\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n }\r\n }\r\n\r\n // set attributes\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', new SVGNumber(o.offset))\r\n\r\n return this\r\n }\r\n}\r\n\r\nregister(Stop)\r\n","import SVGNumber from '../../types/SVGNumber.js'\r\n\r\nexport function from (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ fx: new SVGNumber(x), fy: new SVGNumber(y) })\r\n : this.attr({ x1: new SVGNumber(x), y1: new SVGNumber(y) })\r\n}\r\n\r\nexport function to (x, y) {\r\n return (this._element || this).type === 'radialGradient'\r\n ? this.attr({ cx: new SVGNumber(x), cy: new SVGNumber(y) })\r\n : this.attr({ x2: new SVGNumber(x), y2: new SVGNumber(y) })\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport Stop from './Stop.js'\r\nimport baseFind from '../modules/core/selector.js'\r\nimport * as gradiented from '../modules/core/gradiented.js'\r\n\r\nexport default class Gradient extends Container {\r\n constructor (type, attrs) {\r\n super(\r\n nodeOrNew(type + 'Gradient', typeof type === 'string' ? null : type),\r\n attrs\r\n )\r\n }\r\n\r\n // Add a color stop\r\n stop (offset, color, opacity) {\r\n return this.put(new Stop()).update(offset, color, opacity)\r\n }\r\n\r\n // Update gradient\r\n update (block) {\r\n // remove all stops\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'gradientTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nextend(Gradient, gradiented)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create gradient element in defs\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.defs().gradient(type, block)\r\n })\r\n },\r\n // define gradient\r\n Defs: {\r\n gradient: wrapWithAttrCheck(function (type, block) {\r\n return this.put(new Gradient(type)).update(block)\r\n })\r\n }\r\n})\r\n\r\nregister(Gradient)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Box from '../types/Box.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Pattern extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('pattern', node), node)\r\n }\r\n\r\n // Return the fill id\r\n url () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n\r\n // Update pattern by rebuilding\r\n update (block) {\r\n // remove content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') {\r\n block.call(this, this)\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Alias string convertion to fill\r\n toString () {\r\n return this.url()\r\n }\r\n\r\n // custom attr to handle transform\r\n attr (a, b, c) {\r\n if (a === 'transform') a = 'patternTransform'\r\n return super.attr(a, b, c)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [fill*=\"' + this.id() + '\"]')\r\n }\r\n\r\n bbox () {\r\n return new Box()\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create pattern element in defs\r\n pattern (...args) {\r\n return this.defs().pattern(...args)\r\n }\r\n },\r\n Defs: {\r\n pattern: wrapWithAttrCheck(function (width, height, block) {\r\n return this.put(new Pattern()).update(block).attr({\r\n x: 0,\r\n y: 0,\r\n width: width,\r\n height: height,\r\n patternUnits: 'userSpaceOnUse'\r\n })\r\n })\r\n }\r\n})\r\n\r\nregister(Pattern)\r\n","import { isImage } from '../modules/core/regex.js'\r\nimport { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { off, on } from '../modules/core/event.js'\r\nimport { registerAttrHook } from '../modules/core/attr.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Pattern from './Pattern.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Image extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('image', node), node)\r\n }\r\n\r\n // (re)load image\r\n load (url, callback) {\r\n if (!url) return this\r\n\r\n var img = new globals.window.Image()\r\n\r\n on(img, 'load', function (e) {\r\n var p = this.parent(Pattern)\r\n\r\n // ensure image size\r\n if (this.width() === 0 && this.height() === 0) {\r\n this.size(img.width, img.height)\r\n }\r\n\r\n if (p instanceof Pattern) {\r\n // ensure pattern size if not set\r\n if (p.width() === 0 && p.height() === 0) {\r\n p.size(this.width(), this.height())\r\n }\r\n }\r\n\r\n if (typeof callback === 'function') {\r\n callback.call(this, e)\r\n }\r\n }, this)\r\n\r\n on(img, 'load error', function () {\r\n // dont forget to unbind memory leaking events\r\n off(img)\r\n })\r\n\r\n return this.attr('href', (img.src = url), xlink)\r\n }\r\n}\r\n\r\nregisterAttrHook(function (attr, val, _this) {\r\n // convert image fill and stroke to patterns\r\n if (attr === 'fill' || attr === 'stroke') {\r\n if (isImage.test(val)) {\r\n val = _this.root().defs().image(val)\r\n }\r\n }\r\n\r\n if (val instanceof Image) {\r\n val = _this.root().defs().pattern(0, 0, (pattern) => {\r\n pattern.add(val)\r\n })\r\n }\r\n\r\n return val\r\n})\r\n\r\nregisterMethods({\r\n Container: {\r\n // create image element, load image and set its size\r\n image: wrapWithAttrCheck(function (source, callback) {\r\n return this.put(new Image()).size(0, 0).load(source, callback)\r\n })\r\n }\r\n})\r\n\r\nregister(Image)\r\n","import { delimiter } from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport SVGArray from './SVGArray.js'\r\n\r\nconst PointArray = subClassArray('PointArray', SVGArray)\r\n\r\nexport default PointArray\r\n\r\nextend(PointArray, {\r\n // Convert array to string\r\n toString () {\r\n // convert to a poly point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push(this[i].join(','))\r\n }\r\n\r\n return array.join(' ')\r\n },\r\n\r\n // Convert array to line object\r\n toLine () {\r\n return {\r\n x1: this[0][0],\r\n y1: this[0][1],\r\n x2: this[1][0],\r\n y2: this[1][1]\r\n }\r\n },\r\n\r\n // Get morphed array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n // generate morphed point string\r\n for (var i = 0, il = this.length, array = []; i < il; i++) {\r\n array.push([\r\n this[i][0] + (this.destination[i][0] - this[i][0]) * pos,\r\n this[i][1] + (this.destination[i][1] - this[i][1]) * pos\r\n ])\r\n }\r\n\r\n return new PointArray(array)\r\n },\r\n\r\n // Parse point string and flat array\r\n parse (array = [[0, 0]]) {\r\n var points = []\r\n\r\n // if it is an array\r\n if (array instanceof Array) {\r\n // and it is not flat, there is no need to parse it\r\n if (array[0] instanceof Array) {\r\n return array\r\n }\r\n } else { // Else, it is considered as a string\r\n // parse points\r\n array = array.trim().split(delimiter).map(parseFloat)\r\n }\r\n\r\n // validate points - https://svgwg.org/svg2-draft/shapes.html#DataTypePoints\r\n // Odd number of coordinates is an error. In such cases, drop the last odd coordinate.\r\n if (array.length % 2 !== 0) array.pop()\r\n\r\n // wrap points in two-tuples and parse points as floats\r\n for (var i = 0, len = array.length; i < len; i = i + 2) {\r\n points.push([ array[i], array[i + 1] ])\r\n }\r\n\r\n return points\r\n },\r\n\r\n // Move point string\r\n move (x, y) {\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n // move every point\r\n if (!isNaN(x) && !isNaN(y)) {\r\n for (var i = this.length - 1; i >= 0; i--) {\r\n this[i] = [this[i][0] + x, this[i][1] + y]\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize poly string\r\n size (width, height) {\r\n var i\r\n var box = this.bbox()\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n if (box.width) this[i][0] = ((this[i][0] - box.x) * width) / box.width + box.x\r\n if (box.height) this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get bounding box of points\r\n bbox () {\r\n var maxX = -Infinity\r\n var maxY = -Infinity\r\n var minX = Infinity\r\n var minY = Infinity\r\n this.forEach(function (el) {\r\n maxX = Math.max(el[0], maxX)\r\n maxY = Math.max(el[1], maxY)\r\n minX = Math.min(el[0], minX)\r\n minY = Math.min(el[1], minY)\r\n })\r\n return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }\r\n }\r\n})\r\n","import PointArray from '../../types/PointArray.js'\r\n\r\nexport let MorphArray = PointArray\r\n\r\n// Move by left top corner over x-axis\r\nexport function x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n}\r\n\r\n// Move by left top corner over y-axis\r\nexport function y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n}\r\n\r\n// Set width of element\r\nexport function width (width) {\r\n let b = this.bbox()\r\n return width == null ? b.width : this.size(width, b.height)\r\n}\r\n\r\n// Set height of element\r\nexport function height (height) {\r\n let b = this.bbox()\r\n return height == null ? b.height : this.size(b.width, height)\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\n\r\nexport default class Line extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('line', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return new PointArray([\r\n [ this.attr('x1'), this.attr('y1') ],\r\n [ this.attr('x2'), this.attr('y2') ]\r\n ])\r\n }\r\n\r\n // Overwrite native plot() method\r\n plot (x1, y1, x2, y2) {\r\n if (x1 == null) {\r\n return this.array()\r\n } else if (typeof y1 !== 'undefined') {\r\n x1 = { x1: x1, y1: y1, x2: x2, y2: y2 }\r\n } else {\r\n x1 = new PointArray(x1).toLine()\r\n }\r\n\r\n return this.attr(x1)\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr(this.array().move(x, y).toLine())\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr(this.array().size(p.width, p.height).toLine())\r\n }\r\n}\r\n\r\nextend(Line, pointed)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a line element\r\n line: wrapWithAttrCheck(function (...args) {\r\n // make sure plot is called as a setter\r\n // x1 is not necessarily a number, it can also be an array, a string and a PointArray\r\n return Line.prototype.plot.apply(\r\n this.put(new Line())\r\n , args[0] != null ? args : [0, 0, 0, 0]\r\n )\r\n })\r\n }\r\n})\r\n\r\nregister(Line)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Marker extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('marker', node), node)\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return this.attr('markerWidth', width)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return this.attr('markerHeight', height)\r\n }\r\n\r\n // Set marker refX and refY\r\n ref (x, y) {\r\n return this.attr('refX', x).attr('refY', y)\r\n }\r\n\r\n // Update marker\r\n update (block) {\r\n // remove all content\r\n this.clear()\r\n\r\n // invoke passed block\r\n if (typeof block === 'function') { block.call(this, this) }\r\n\r\n return this\r\n }\r\n\r\n // Return the fill id\r\n toString () {\r\n return 'url(#' + this.id() + ')'\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n marker (...args) {\r\n // Create marker element in defs\r\n return this.defs().marker(...args)\r\n }\r\n },\r\n Defs: {\r\n // Create marker\r\n marker: wrapWithAttrCheck(function (width, height, block) {\r\n // Set default viewbox to match the width and height, set ref to cx and cy and set orient to auto\r\n return this.put(new Marker())\r\n .size(width, height)\r\n .ref(width / 2, height / 2)\r\n .viewbox(0, 0, width, height)\r\n .attr('orient', 'auto')\r\n .update(block)\r\n })\r\n },\r\n marker: {\r\n // Create and attach markers\r\n marker (marker, width, height, block) {\r\n var attr = ['marker']\r\n\r\n // Build attribute name\r\n if (marker !== 'all') attr.push(marker)\r\n attr = attr.join('-')\r\n\r\n // Set marker attribute\r\n marker = arguments[1] instanceof Marker\r\n ? arguments[1]\r\n : this.defs().marker(width, height, block)\r\n\r\n return this.attr(attr, marker)\r\n }\r\n }\r\n})\r\n\r\nregister(Marker)\r\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","import { timeline } from '../modules/core/defaults.js'\r\nimport { extend } from '../utils/adopter.js'\r\n\r\n/***\r\nBase Class\r\n==========\r\nThe base stepper class that will be\r\n***/\r\n\r\nfunction makeSetterGetter (k, f) {\r\n return function (v) {\r\n if (v == null) return this[v]\r\n this[k] = v\r\n if (f) f.call(this)\r\n return this\r\n }\r\n}\r\n\r\nexport let easing = {\r\n '-': function (pos) { return pos },\r\n '<>': function (pos) { return -Math.cos(pos * Math.PI) / 2 + 0.5 },\r\n '>': function (pos) { return Math.sin(pos * Math.PI / 2) },\r\n '<': function (pos) { return -Math.cos(pos * Math.PI / 2) + 1 },\r\n bezier: function (x1, y1, x2, y2) {\r\n // see https://www.w3.org/TR/css-easing-1/#cubic-bezier-algo\r\n return function (t) {\r\n if (t < 0) {\r\n if (x1 > 0) {\r\n return y1 / x1 * t\r\n } else if (x2 > 0) {\r\n return y2 / x2 * t\r\n } else {\r\n return 0\r\n }\r\n } else if (t > 1) {\r\n if (x2 < 1) {\r\n return (1 - y2) / (1 - x2) * t + (y2 - x2) / (1 - x2)\r\n } else if (x1 < 1) {\r\n return (1 - y1) / (1 - x1) * t + (y1 - x1) / (1 - x1)\r\n } else {\r\n return 1\r\n }\r\n } else {\r\n return 3 * t * (1 - t) ** 2 * y1 + 3 * t ** 2 * (1 - t) * y2 + t ** 3\r\n }\r\n }\r\n },\r\n // see https://www.w3.org/TR/css-easing-1/#step-timing-function-algo\r\n steps: function (steps, stepPosition = 'end') {\r\n // deal with \"jump-\" prefix\r\n stepPosition = stepPosition.split('-').reverse()[0]\r\n\r\n let jumps = steps\r\n if (stepPosition === 'none') {\r\n --jumps\r\n } else if (stepPosition === 'both') {\r\n ++jumps\r\n }\r\n\r\n // The beforeFlag is essentially useless\r\n return (t, beforeFlag = false) => {\r\n // Step is called currentStep in referenced url\r\n let step = Math.floor(t * steps)\r\n const jumping = (t * step) % 1 === 0\r\n\r\n if (stepPosition === 'start' || stepPosition === 'both') {\r\n ++step\r\n }\r\n\r\n if (beforeFlag && jumping) {\r\n --step\r\n }\r\n\r\n if (t >= 0 && step < 0) {\r\n step = 0\r\n }\r\n\r\n if (t <= 1 && step > jumps) {\r\n step = jumps\r\n }\r\n\r\n return step / jumps\r\n }\r\n }\r\n}\r\n\r\nexport class Stepper {\r\n done () { return false }\r\n}\r\n\r\n/***\r\nEasing Functions\r\n================\r\n***/\r\n\r\nexport class Ease extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.ease = easing[fn || timeline.ease] || fn\r\n }\r\n\r\n step (from, to, pos) {\r\n if (typeof from !== 'number') {\r\n return pos < 1 ? from : to\r\n }\r\n return from + (to - from) * this.ease(pos)\r\n }\r\n}\r\n\r\n/***\r\nController Types\r\n================\r\n***/\r\n\r\nexport class Controller extends Stepper {\r\n constructor (fn) {\r\n super()\r\n this.stepper = fn\r\n }\r\n\r\n step (current, target, dt, c) {\r\n return this.stepper(current, target, dt, c)\r\n }\r\n\r\n done (c) {\r\n return c.done\r\n }\r\n}\r\n\r\nfunction recalculate () {\r\n // Apply the default parameters\r\n var duration = (this._duration || 500) / 1000\r\n var overshoot = this._overshoot || 0\r\n\r\n // Calculate the PID natural response\r\n var eps = 1e-10\r\n var pi = Math.PI\r\n var os = Math.log(overshoot / 100 + eps)\r\n var zeta = -os / Math.sqrt(pi * pi + os * os)\r\n var wn = 3.9 / (zeta * duration)\r\n\r\n // Calculate the Spring values\r\n this.d = 2 * zeta * wn\r\n this.k = wn * wn\r\n}\r\n\r\nexport class Spring extends Controller {\r\n constructor (duration, overshoot) {\r\n super()\r\n this.duration(duration || 500)\r\n .overshoot(overshoot || 0)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n if (dt > 100) dt = 16\r\n\r\n dt /= 1000\r\n\r\n // Get the previous velocity\r\n var velocity = c.velocity || 0\r\n\r\n // Apply the control to get the new position and store it\r\n var acceleration = -this.d * velocity - this.k * (current - target)\r\n var newPosition = current +\r\n velocity * dt +\r\n acceleration * dt * dt / 2\r\n\r\n // Store the velocity\r\n c.velocity = velocity + acceleration * dt\r\n\r\n // Figure out if we have converged, and if so, pass the value\r\n c.done = Math.abs(target - newPosition) + Math.abs(velocity) < 0.002\r\n return c.done ? target : newPosition\r\n }\r\n}\r\n\r\nextend(Spring, {\r\n duration: makeSetterGetter('_duration', recalculate),\r\n overshoot: makeSetterGetter('_overshoot', recalculate)\r\n})\r\n\r\nexport class PID extends Controller {\r\n constructor (p, i, d, windup) {\r\n super()\r\n\r\n p = p == null ? 0.1 : p\r\n i = i == null ? 0.01 : i\r\n d = d == null ? 0 : d\r\n windup = windup == null ? 1000 : windup\r\n this.p(p).i(i).d(d).windup(windup)\r\n }\r\n\r\n step (current, target, dt, c) {\r\n if (typeof current === 'string') return current\r\n c.done = dt === Infinity\r\n\r\n if (dt === Infinity) return target\r\n if (dt === 0) return current\r\n\r\n var p = target - current\r\n var i = (c.integral || 0) + p * dt\r\n var d = (p - (c.error || 0)) / dt\r\n var windup = this.windup\r\n\r\n // antiwindup\r\n if (windup !== false) {\r\n i = Math.max(-windup, Math.min(i, windup))\r\n }\r\n\r\n c.error = p\r\n c.integral = i\r\n\r\n c.done = Math.abs(p) < 0.001\r\n\r\n return c.done ? target : current + (this.P * p + this.I * i + this.D * d)\r\n }\r\n}\r\n\r\nextend(PID, {\r\n windup: makeSetterGetter('windup'),\r\n p: makeSetterGetter('P'),\r\n i: makeSetterGetter('I'),\r\n d: makeSetterGetter('D')\r\n})\r\n","import {\r\n delimiter,\r\n dots,\r\n hyphen,\r\n isPathLetter,\r\n numbersWithDots,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { subClassArray } from './ArrayPolyfill.js'\r\nimport Point from './Point.js'\r\nimport SVGArray from './SVGArray.js'\r\nimport parser from '../modules/core/parser.js'\r\n\r\nconst PathArray = subClassArray('PathArray', SVGArray)\r\n\r\nexport default PathArray\r\n\r\nexport function pathRegReplace (a, b, c, d) {\r\n return c + d.replace(dots, ' .')\r\n}\r\n\r\nfunction arrayToString (a) {\r\n for (var i = 0, il = a.length, s = ''; i < il; i++) {\r\n s += a[i][0]\r\n\r\n if (a[i][1] != null) {\r\n s += a[i][1]\r\n\r\n if (a[i][2] != null) {\r\n s += ' '\r\n s += a[i][2]\r\n\r\n if (a[i][3] != null) {\r\n s += ' '\r\n s += a[i][3]\r\n s += ' '\r\n s += a[i][4]\r\n\r\n if (a[i][5] != null) {\r\n s += ' '\r\n s += a[i][5]\r\n s += ' '\r\n s += a[i][6]\r\n\r\n if (a[i][7] != null) {\r\n s += ' '\r\n s += a[i][7]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return s + ' '\r\n}\r\n\r\nconst pathHandlers = {\r\n M: function (c, p, p0) {\r\n p.x = p0.x = c[0]\r\n p.y = p0.y = c[1]\r\n\r\n return ['M', p.x, p.y]\r\n },\r\n L: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['L', c[0], c[1]]\r\n },\r\n H: function (c, p) {\r\n p.x = c[0]\r\n return ['H', c[0]]\r\n },\r\n V: function (c, p) {\r\n p.y = c[0]\r\n return ['V', c[0]]\r\n },\r\n C: function (c, p) {\r\n p.x = c[4]\r\n p.y = c[5]\r\n return ['C', c[0], c[1], c[2], c[3], c[4], c[5]]\r\n },\r\n S: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['S', c[0], c[1], c[2], c[3]]\r\n },\r\n Q: function (c, p) {\r\n p.x = c[2]\r\n p.y = c[3]\r\n return ['Q', c[0], c[1], c[2], c[3]]\r\n },\r\n T: function (c, p) {\r\n p.x = c[0]\r\n p.y = c[1]\r\n return ['T', c[0], c[1]]\r\n },\r\n Z: function (c, p, p0) {\r\n p.x = p0.x\r\n p.y = p0.y\r\n return ['Z']\r\n },\r\n A: function (c, p) {\r\n p.x = c[5]\r\n p.y = c[6]\r\n return ['A', c[0], c[1], c[2], c[3], c[4], c[5], c[6]]\r\n }\r\n}\r\n\r\nlet mlhvqtcsaz = 'mlhvqtcsaz'.split('')\r\n\r\nfor (var i = 0, il = mlhvqtcsaz.length; i < il; ++i) {\r\n pathHandlers[mlhvqtcsaz[i]] = (function (i) {\r\n return function (c, p, p0) {\r\n if (i === 'H') c[0] = c[0] + p.x\r\n else if (i === 'V') c[0] = c[0] + p.y\r\n else if (i === 'A') {\r\n c[5] = c[5] + p.x\r\n c[6] = c[6] + p.y\r\n } else {\r\n for (var j = 0, jl = c.length; j < jl; ++j) {\r\n c[j] = c[j] + (j % 2 ? p.y : p.x)\r\n }\r\n }\r\n\r\n return pathHandlers[i](c, p, p0)\r\n }\r\n })(mlhvqtcsaz[i].toUpperCase())\r\n}\r\n\r\nextend(PathArray, {\r\n // Convert array to string\r\n toString () {\r\n return arrayToString(this)\r\n },\r\n\r\n // Move path string\r\n move (x, y) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n\r\n // get relative offset\r\n x -= box.x\r\n y -= box.y\r\n\r\n if (!isNaN(x) && !isNaN(y)) {\r\n // move every point\r\n for (var l, i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n } else if (l === 'H') {\r\n this[i][1] += x\r\n } else if (l === 'V') {\r\n this[i][1] += y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] += x\r\n this[i][2] += y\r\n this[i][3] += x\r\n this[i][4] += y\r\n\r\n if (l === 'C') {\r\n this[i][5] += x\r\n this[i][6] += y\r\n }\r\n } else if (l === 'A') {\r\n this[i][6] += x\r\n this[i][7] += y\r\n }\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Resize path string\r\n size (width, height) {\r\n // get bounding box of current situation\r\n var box = this.bbox()\r\n var i, l\r\n\r\n // recalculate position of all points according to new size\r\n for (i = this.length - 1; i >= 0; i--) {\r\n l = this[i][0]\r\n\r\n if (l === 'M' || l === 'L' || l === 'T') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n } else if (l === 'H') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n } else if (l === 'V') {\r\n this[i][1] = ((this[i][1] - box.y) * height) / box.height + box.y\r\n } else if (l === 'C' || l === 'S' || l === 'Q') {\r\n this[i][1] = ((this[i][1] - box.x) * width) / box.width + box.x\r\n this[i][2] = ((this[i][2] - box.y) * height) / box.height + box.y\r\n this[i][3] = ((this[i][3] - box.x) * width) / box.width + box.x\r\n this[i][4] = ((this[i][4] - box.y) * height) / box.height + box.y\r\n\r\n if (l === 'C') {\r\n this[i][5] = ((this[i][5] - box.x) * width) / box.width + box.x\r\n this[i][6] = ((this[i][6] - box.y) * height) / box.height + box.y\r\n }\r\n } else if (l === 'A') {\r\n // resize radii\r\n this[i][1] = (this[i][1] * width) / box.width\r\n this[i][2] = (this[i][2] * height) / box.height\r\n\r\n // move position values\r\n this[i][6] = ((this[i][6] - box.x) * width) / box.width + box.x\r\n this[i][7] = ((this[i][7] - box.y) * height) / box.height + box.y\r\n }\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Test if the passed path array use the same path data commands as this path array\r\n equalCommands (pathArray) {\r\n var i, il, equalCommands\r\n\r\n pathArray = new PathArray(pathArray)\r\n\r\n equalCommands = this.length === pathArray.length\r\n for (i = 0, il = this.length; equalCommands && i < il; i++) {\r\n equalCommands = this[i][0] === pathArray[i][0]\r\n }\r\n\r\n return equalCommands\r\n },\r\n\r\n // Make path array morphable\r\n morph (pathArray) {\r\n pathArray = new PathArray(pathArray)\r\n\r\n if (this.equalCommands(pathArray)) {\r\n this.destination = pathArray\r\n } else {\r\n this.destination = null\r\n }\r\n\r\n return this\r\n },\r\n\r\n // Get morphed path array at given position\r\n at (pos) {\r\n // make sure a destination is defined\r\n if (!this.destination) return this\r\n\r\n var sourceArray = this\r\n var destinationArray = this.destination.value\r\n var array = []\r\n var pathArray = new PathArray()\r\n var i, il, j, jl\r\n\r\n // Animate has specified in the SVG spec\r\n // See: https://www.w3.org/TR/SVG11/paths.html#PathElement\r\n for (i = 0, il = sourceArray.length; i < il; i++) {\r\n array[i] = [sourceArray[i][0]]\r\n for (j = 1, jl = sourceArray[i].length; j < jl; j++) {\r\n array[i][j] = sourceArray[i][j] + (destinationArray[i][j] - sourceArray[i][j]) * pos\r\n }\r\n // For the two flags of the elliptical arc command, the SVG spec say:\r\n // Flags and booleans are interpolated as fractions between zero and one, with any non-zero value considered to be a value of one/true\r\n // Elliptical arc command as an array followed by corresponding indexes:\r\n // ['A', rx, ry, x-axis-rotation, large-arc-flag, sweep-flag, x, y]\r\n // 0 1 2 3 4 5 6 7\r\n if (array[i][0] === 'A') {\r\n array[i][4] = +(array[i][4] !== 0)\r\n array[i][5] = +(array[i][5] !== 0)\r\n }\r\n }\r\n\r\n // Directly modify the value of a path array, this is done this way for performance\r\n pathArray.value = array\r\n return pathArray\r\n },\r\n\r\n // Absolutize and parse path to array\r\n parse (array = [['M', 0, 0]]) {\r\n // if it's already a patharray, no need to parse it\r\n if (array instanceof PathArray) return array\r\n\r\n // prepare for parsing\r\n var s\r\n var paramCnt = { 'M': 2, 'L': 2, 'H': 1, 'V': 1, 'C': 6, 'S': 4, 'Q': 4, 'T': 2, 'A': 7, 'Z': 0 }\r\n\r\n if (typeof array === 'string') {\r\n array = array\r\n .replace(numbersWithDots, pathRegReplace) // convert 45.123.123 to 45.123 .123\r\n .replace(pathLetters, ' $& ') // put some room between letters and numbers\r\n .replace(hyphen, '$1 -') // add space before hyphen\r\n .trim() // trim\r\n .split(delimiter) // split into array\r\n } else {\r\n array = array.reduce(function (prev, curr) {\r\n return [].concat.call(prev, curr)\r\n }, [])\r\n }\r\n\r\n // array now is an array containing all parts of a path e.g. ['M', '0', '0', 'L', '30', '30' ...]\r\n var result = []\r\n var p = new Point()\r\n var p0 = new Point()\r\n var index = 0\r\n var len = array.length\r\n\r\n do {\r\n // Test if we have a path letter\r\n if (isPathLetter.test(array[index])) {\r\n s = array[index]\r\n ++index\r\n // If last letter was a move command and we got no new, it defaults to [L]ine\r\n } else if (s === 'M') {\r\n s = 'L'\r\n } else if (s === 'm') {\r\n s = 'l'\r\n }\r\n\r\n result.push(pathHandlers[s].call(null,\r\n array.slice(index, (index = index + paramCnt[s.toUpperCase()])).map(parseFloat),\r\n p, p0\r\n )\r\n )\r\n } while (len > index)\r\n\r\n return result\r\n },\r\n\r\n // Get bounding box of path\r\n bbox () {\r\n parser().path.setAttribute('d', this.toString())\r\n return parser.nodes.path.getBBox()\r\n }\r\n})\r\n","import { Ease } from './Controller.js'\r\nimport {\r\n delimiter,\r\n numberAndUnit,\r\n pathLetters\r\n} from '../modules/core/regex.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport Color from '../types/Color.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport SVGArray from '../types/SVGArray.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\n\r\nexport default class Morphable {\r\n constructor (stepper) {\r\n this._stepper = stepper || new Ease('-')\r\n\r\n this._from = null\r\n this._to = null\r\n this._type = null\r\n this._context = null\r\n this._morphObj = null\r\n }\r\n\r\n from (val) {\r\n if (val == null) {\r\n return this._from\r\n }\r\n\r\n this._from = this._set(val)\r\n return this\r\n }\r\n\r\n to (val) {\r\n if (val == null) {\r\n return this._to\r\n }\r\n\r\n this._to = this._set(val)\r\n return this\r\n }\r\n\r\n type (type) {\r\n // getter\r\n if (type == null) {\r\n return this._type\r\n }\r\n\r\n // setter\r\n this._type = type\r\n return this\r\n }\r\n\r\n _set (value) {\r\n if (!this._type) {\r\n var type = typeof value\r\n\r\n if (type === 'number') {\r\n this.type(SVGNumber)\r\n } else if (type === 'string') {\r\n if (Color.isColor(value)) {\r\n this.type(Color)\r\n } else if (delimiter.test(value)) {\r\n this.type(pathLetters.test(value)\r\n ? PathArray\r\n : SVGArray\r\n )\r\n } else if (numberAndUnit.test(value)) {\r\n this.type(SVGNumber)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n } else if (morphableTypes.indexOf(value.constructor) > -1) {\r\n this.type(value.constructor)\r\n } else if (Array.isArray(value)) {\r\n this.type(SVGArray)\r\n } else if (type === 'object') {\r\n this.type(ObjectBag)\r\n } else {\r\n this.type(NonMorphable)\r\n }\r\n }\r\n\r\n var result = (new this._type(value)).toArray()\r\n this._morphObj = this._morphObj || new this._type()\r\n this._context = this._context ||\r\n Array.apply(null, Array(result.length)).map(Object)\r\n return result\r\n }\r\n\r\n stepper (stepper) {\r\n if (stepper == null) return this._stepper\r\n this._stepper = stepper\r\n return this\r\n }\r\n\r\n done () {\r\n var complete = this._context\r\n .map(this._stepper.done)\r\n .reduce(function (last, curr) {\r\n return last && curr\r\n }, true)\r\n return complete\r\n }\r\n\r\n at (pos) {\r\n var _this = this\r\n\r\n return this._morphObj.fromArray(\r\n this._from.map(function (i, index) {\r\n return _this._stepper.step(i, _this._to[index], pos, _this._context[index], _this._context)\r\n })\r\n )\r\n }\r\n}\r\n\r\nexport class NonMorphable {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (val) {\r\n val = Array.isArray(val) ? val[0] : val\r\n this.value = val\r\n return this\r\n }\r\n\r\n valueOf () {\r\n return this.value\r\n }\r\n\r\n toArray () {\r\n return [this.value]\r\n }\r\n}\r\n\r\nexport class TransformBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (obj) {\r\n if (Array.isArray(obj)) {\r\n obj = {\r\n scaleX: obj[0],\r\n scaleY: obj[1],\r\n shear: obj[2],\r\n rotate: obj[3],\r\n translateX: obj[4],\r\n translateY: obj[5],\r\n originX: obj[6],\r\n originY: obj[7]\r\n }\r\n }\r\n\r\n Object.assign(this, TransformBag.defaults, obj)\r\n return this\r\n }\r\n\r\n toArray () {\r\n var v = this\r\n\r\n return [\r\n v.scaleX,\r\n v.scaleY,\r\n v.shear,\r\n v.rotate,\r\n v.translateX,\r\n v.translateY,\r\n v.originX,\r\n v.originY\r\n ]\r\n }\r\n}\r\n\r\nTransformBag.defaults = {\r\n scaleX: 1,\r\n scaleY: 1,\r\n shear: 0,\r\n rotate: 0,\r\n translateX: 0,\r\n translateY: 0,\r\n originX: 0,\r\n originY: 0\r\n}\r\n\r\nexport class ObjectBag {\r\n constructor (...args) {\r\n this.init(...args)\r\n }\r\n\r\n init (objOrArr) {\r\n this.values = []\r\n\r\n if (Array.isArray(objOrArr)) {\r\n this.values = objOrArr\r\n return\r\n }\r\n\r\n objOrArr = objOrArr || {}\r\n var entries = []\r\n\r\n for (let i in objOrArr) {\r\n entries.push([i, objOrArr[i]])\r\n }\r\n\r\n entries.sort((a, b) => {\r\n return a[0] - b[0]\r\n })\r\n\r\n this.values = entries.reduce((last, curr) => last.concat(curr), [])\r\n return this\r\n }\r\n\r\n valueOf () {\r\n var obj = {}\r\n var arr = this.values\r\n\r\n for (var i = 0, len = arr.length; i < len; i += 2) {\r\n obj[arr[i]] = arr[i + 1]\r\n }\r\n\r\n return obj\r\n }\r\n\r\n toArray () {\r\n return this.values\r\n }\r\n}\r\n\r\nconst morphableTypes = [\r\n NonMorphable,\r\n TransformBag,\r\n ObjectBag\r\n]\r\n\r\nexport function registerMorphableType (type = []) {\r\n morphableTypes.push(...[].concat(type))\r\n}\r\n\r\nexport function makeMorphable () {\r\n extend(morphableTypes, {\r\n to (val) {\r\n return new Morphable()\r\n .type(this.constructor)\r\n .from(this.valueOf())\r\n .to(val)\r\n },\r\n fromArray (arr) {\r\n this.init(arr)\r\n return this\r\n }\r\n })\r\n}\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { proportionalSize } from '../utils/utils.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Shape from './Shape.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Path extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('path', node), node)\r\n }\r\n\r\n // Get array\r\n array () {\r\n return this._array || (this._array = new PathArray(this.attr('d')))\r\n }\r\n\r\n // Plot new path\r\n plot (d) {\r\n return (d == null) ? this.array()\r\n : this.clear().attr('d', typeof d === 'string' ? d : (this._array = new PathArray(d)))\r\n }\r\n\r\n // Clear array cache\r\n clear () {\r\n delete this._array\r\n return this\r\n }\r\n\r\n // Move by left top corner\r\n move (x, y) {\r\n return this.attr('d', this.array().move(x, y))\r\n }\r\n\r\n // Move by left top corner over x-axis\r\n x (x) {\r\n return x == null ? this.bbox().x : this.move(x, this.bbox().y)\r\n }\r\n\r\n // Move by left top corner over y-axis\r\n y (y) {\r\n return y == null ? this.bbox().y : this.move(this.bbox().x, y)\r\n }\r\n\r\n // Set element size to given width and height\r\n size (width, height) {\r\n var p = proportionalSize(this, width, height)\r\n return this.attr('d', this.array().size(p.width, p.height))\r\n }\r\n\r\n // Set width of element\r\n width (width) {\r\n return width == null ? this.bbox().width : this.size(width, this.bbox().height)\r\n }\r\n\r\n // Set height of element\r\n height (height) {\r\n return height == null ? this.bbox().height : this.size(this.bbox().width, height)\r\n }\r\n\r\n targets () {\r\n return baseFind('svg textpath [href*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\n// Define morphable array\r\nPath.prototype.MorphArray = PathArray\r\n\r\n// Add parent method\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped path element\r\n path: wrapWithAttrCheck(function (d) {\r\n // make sure plot is called as a setter\r\n return this.put(new Path()).plot(d || new PathArray())\r\n })\r\n }\r\n})\r\n\r\nregister(Path)\r\n","import { proportionalSize } from '../../utils/utils.js'\r\nimport PointArray from '../../types/PointArray.js'\r\n\r\n// Get array\r\nexport function array () {\r\n return this._array || (this._array = new PointArray(this.attr('points')))\r\n}\r\n\r\n// Plot new path\r\nexport function plot (p) {\r\n return (p == null) ? this.array()\r\n : this.clear().attr('points', typeof p === 'string' ? p\r\n : (this._array = new PointArray(p)))\r\n}\r\n\r\n// Clear array cache\r\nexport function clear () {\r\n delete this._array\r\n return this\r\n}\r\n\r\n// Move by left top corner\r\nexport function move (x, y) {\r\n return this.attr('points', this.array().move(x, y))\r\n}\r\n\r\n// Set element size to given width and height\r\nexport function size (width, height) {\r\n let p = proportionalSize(this, width, height)\r\n return this.attr('points', this.array().size(p.width, p.height))\r\n}\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polygon extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polygon', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polygon: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polygon()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polygon, pointed)\r\nextend(Polygon, poly)\r\nregister(Polygon)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport PointArray from '../types/PointArray.js'\r\nimport Shape from './Shape.js'\r\nimport * as pointed from '../modules/core/pointed.js'\r\nimport * as poly from '../modules/core/poly.js'\r\n\r\nexport default class Polyline extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('polyline', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a wrapped polygon element\r\n polyline: wrapWithAttrCheck(function (p) {\r\n // make sure plot is called as a setter\r\n return this.put(new Polyline()).plot(p || new PointArray())\r\n })\r\n }\r\n})\r\n\r\nextend(Polyline, pointed)\r\nextend(Polyline, poly)\r\nregister(Polyline)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Rect extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('rect', node), node)\r\n }\r\n}\r\n\r\nextend(Rect, { rx, ry })\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a rect element\r\n rect: wrapWithAttrCheck(function (width, height) {\r\n return this.put(new Rect()).size(width, height)\r\n })\r\n }\r\n})\r\n\r\nregister(Rect)\r\n","export default class Queue {\r\n constructor () {\r\n this._first = null\r\n this._last = null\r\n }\r\n\r\n push (value) {\r\n // An item stores an id and the provided value\r\n var item = value.next ? value : { value: value, next: null, prev: null }\r\n\r\n // Deal with the queue being empty or populated\r\n if (this._last) {\r\n item.prev = this._last\r\n this._last.next = item\r\n this._last = item\r\n } else {\r\n this._last = item\r\n this._first = item\r\n }\r\n\r\n // Update the length and return the current item\r\n return item\r\n }\r\n\r\n shift () {\r\n // Check if we have a value\r\n var remove = this._first\r\n if (!remove) return null\r\n\r\n // If we do, remove it and relink things\r\n this._first = remove.next\r\n if (this._first) this._first.prev = null\r\n this._last = this._first ? this._last : null\r\n return remove.value\r\n }\r\n\r\n // Shows us the first item in the list\r\n first () {\r\n return this._first && this._first.value\r\n }\r\n\r\n // Shows us the last item in the list\r\n last () {\r\n return this._last && this._last.value\r\n }\r\n\r\n // Removes the item that was returned from the push\r\n remove (item) {\r\n // Relink the previous item\r\n if (item.prev) item.prev.next = item.next\r\n if (item.next) item.next.prev = item.prev\r\n if (item === this._last) this._last = item.prev\r\n if (item === this._first) this._first = item.next\r\n\r\n // Invalidate item\r\n item.prev = null\r\n item.next = null\r\n }\r\n}\r\n","import { globals } from '../utils/window.js'\r\nimport Queue from './Queue.js'\r\n\r\nconst Animator = {\r\n nextDraw: null,\r\n frames: new Queue(),\r\n timeouts: new Queue(),\r\n timer: () => globals.window.performance || globals.window.Date,\r\n transforms: [],\r\n\r\n frame (fn) {\r\n // Store the node\r\n var node = Animator.frames.push({ run: fn })\r\n\r\n // Request an animation frame if we don't have one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n // Return the node so we can remove it easily\r\n return node\r\n },\r\n\r\n transform_frame (fn, id) {\r\n Animator.transforms[id] = fn\r\n },\r\n\r\n timeout (fn, delay) {\r\n delay = delay || 0\r\n\r\n // Work out when the event should fire\r\n var time = Animator.timer().now() + delay\r\n\r\n // Add the timeout to the end of the queue\r\n var node = Animator.timeouts.push({ run: fn, time: time })\r\n\r\n // Request another animation frame if we need one\r\n if (Animator.nextDraw === null) {\r\n Animator.nextDraw = globals.window.requestAnimationFrame(Animator._draw)\r\n }\r\n\r\n return node\r\n },\r\n\r\n cancelFrame (node) {\r\n node != null && Animator.frames.remove(node)\r\n },\r\n\r\n clearTimeout (node) {\r\n node != null && Animator.timeouts.remove(node)\r\n },\r\n\r\n _draw (now) {\r\n // Run all the timeouts we can run, if they are not ready yet, add them\r\n // to the end of the queue immediately! (bad timeouts!!! [sarcasm])\r\n var nextTimeout = null\r\n var lastTimeout = Animator.timeouts.last()\r\n while ((nextTimeout = Animator.timeouts.shift())) {\r\n // Run the timeout if its time, or push it to the end\r\n if (now >= nextTimeout.time) {\r\n nextTimeout.run()\r\n } else {\r\n Animator.timeouts.push(nextTimeout)\r\n }\r\n\r\n // If we hit the last item, we should stop shifting out more items\r\n if (nextTimeout === lastTimeout) break\r\n }\r\n\r\n // Run all of the animation frames\r\n var nextFrame = null\r\n var lastFrame = Animator.frames.last()\r\n while ((nextFrame !== lastFrame) && (nextFrame = Animator.frames.shift())) {\r\n nextFrame.run()\r\n }\r\n\r\n Animator.transforms.forEach(function (el) { el() })\r\n\r\n // If we have remaining timeouts or frames, draw until we don't anymore\r\n Animator.nextDraw = Animator.timeouts.first() || Animator.frames.first()\r\n ? globals.window.requestAnimationFrame(Animator._draw)\r\n : null\r\n }\r\n}\r\n\r\nexport default Animator\r\n","import { globals } from '../utils/window.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Animator from './Animator.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\n\r\nvar makeSchedule = function (runnerInfo) {\r\n var start = runnerInfo.start\r\n var duration = runnerInfo.runner.duration()\r\n var end = start + duration\r\n return { start: start, duration: duration, end: end, runner: runnerInfo.runner }\r\n}\r\n\r\nconst defaultSource = function () {\r\n let w = globals.window\r\n return (w.performance || w.Date).now()\r\n}\r\n\r\nexport default class Timeline extends EventTarget {\r\n // Construct a new timeline on the given element\r\n constructor (timeSource = defaultSource) {\r\n super()\r\n\r\n this._timeSource = timeSource\r\n\r\n // Store the timing variables\r\n this._startTime = 0\r\n this._speed = 1.0\r\n\r\n // Determines how long a runner is hold in memory. Can be a dt or true/false\r\n this._persist = 0\r\n\r\n // Keep track of the running animations and their starting parameters\r\n this._nextFrame = null\r\n this._paused = true\r\n this._runners = []\r\n this._order = []\r\n this._time = 0\r\n this._lastSourceTime = 0\r\n this._lastStepTime = 0\r\n\r\n // Make sure that step is always called in class context\r\n this._step = this._step.bind(this)\r\n }\r\n\r\n // schedules a runner on the timeline\r\n schedule (runner, delay, when) {\r\n if (runner == null) {\r\n return this._runners.map(makeSchedule).sort(function (a, b) {\r\n return a.runner.id - b.runner.id\r\n })\r\n }\r\n\r\n // The start time for the next animation can either be given explicitly,\r\n // derived from the current timeline time or it can be relative to the\r\n // last start time to chain animations direclty\r\n\r\n var absoluteStartTime = 0\r\n var endTime = this.getEndTime()\r\n delay = delay || 0\r\n\r\n // Work out when to start the animation\r\n if (when == null || when === 'last' || when === 'after') {\r\n // Take the last time and increment\r\n absoluteStartTime = endTime\r\n } else if (when === 'absolute' || when === 'start') {\r\n absoluteStartTime = delay\r\n delay = 0\r\n } else if (when === 'now') {\r\n absoluteStartTime = this._time\r\n } else if (when === 'relative') {\r\n let runnerInfo = this._runners[runner.id]\r\n if (runnerInfo) {\r\n absoluteStartTime = runnerInfo.start + delay\r\n delay = 0\r\n }\r\n } else {\r\n throw new Error('Invalid value for the \"when\" parameter')\r\n }\r\n\r\n // Manage runner\r\n runner.unschedule()\r\n runner.timeline(this)\r\n // runner.time(-delay)\r\n\r\n // Save runnerInfo\r\n this._runners[runner.id] = {\r\n persist: this.persist(),\r\n runner: runner,\r\n start: absoluteStartTime + delay\r\n }\r\n\r\n // Save order, update Time if needed and continue\r\n this._order.push(runner.id)\r\n this.updateTime()._continue()\r\n return this\r\n }\r\n\r\n // Remove the runner from this timeline\r\n unschedule (runner) {\r\n var index = this._order.indexOf(runner.id)\r\n if (index < 0) return this\r\n\r\n delete this._runners[runner.id]\r\n this._order.splice(index, 1)\r\n runner.timeline(null)\r\n return this\r\n }\r\n\r\n // Calculates the end of the timeline\r\n getEndTime () {\r\n var lastRunnerInfo = this._runners[this._order[this._order.length - 1]]\r\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0\r\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0\r\n return lastStartTime + lastDuration\r\n }\r\n\r\n // Makes sure, that after pausing the time doesn't jump\r\n updateTime () {\r\n if (!this.active()) {\r\n this._lastSourceTime = this._timeSource()\r\n }\r\n return this\r\n }\r\n\r\n play () {\r\n // Now make sure we are not paused and continue the animation\r\n this._paused = false\r\n return this.updateTime()._continue()\r\n }\r\n\r\n pause () {\r\n this._paused = true\r\n return this._continue()\r\n }\r\n\r\n stop () {\r\n // Go to start and pause\r\n this.time(0)\r\n return this.pause()\r\n }\r\n\r\n finish () {\r\n // Go to end and pause\r\n this.time(this.getEndTime() + 1)\r\n return this.pause()\r\n }\r\n\r\n speed (speed) {\r\n if (speed == null) return this._speed\r\n this._speed = speed\r\n return this\r\n }\r\n\r\n reverse (yes) {\r\n var currentSpeed = this.speed()\r\n if (yes == null) return this.speed(-currentSpeed)\r\n\r\n var positive = Math.abs(currentSpeed)\r\n return this.speed(yes ? positive : -positive)\r\n }\r\n\r\n seek (dt) {\r\n return this.time(this._time + dt)\r\n }\r\n\r\n time (time) {\r\n if (time == null) return this._time\r\n this._time = time\r\n return this._continue(true)\r\n }\r\n\r\n persist (dtOrForever) {\r\n if (dtOrForever == null) return this._persist\r\n this._persist = dtOrForever\r\n return this\r\n }\r\n\r\n source (fn) {\r\n if (fn == null) return this._timeSource\r\n this._timeSource = fn\r\n return this\r\n }\r\n\r\n _step (immediateStep = false) {\r\n // Get the time delta from the last time and update the time\r\n var time = this._timeSource()\r\n var dtSource = time - this._lastSourceTime\r\n\r\n if (immediateStep) dtSource = 0\r\n\r\n var dtTime = this._speed * dtSource + (this._time - this._lastStepTime)\r\n this._lastSourceTime = time\r\n\r\n // Only update the time if we use the timeSource.\r\n // Otherwise use the current time\r\n if (!immediateStep) {\r\n // Update the time\r\n this._time += dtTime\r\n this._time = this._time < 0 ? 0 : this._time\r\n }\r\n this._lastStepTime = this._time\r\n this.fire('time', this._time)\r\n\r\n // Run all of the runners directly\r\n var runnersLeft = false\r\n for (var i = 0, len = this._order.length; i < len; i++) {\r\n // Get and run the current runner and ignore it if its inactive\r\n var runnerInfo = this._runners[this._order[i]]\r\n var runner = runnerInfo.runner\r\n let dt = dtTime\r\n\r\n // Make sure that we give the actual difference\r\n // between runner start time and now\r\n let dtToStart = this._time - runnerInfo.start\r\n\r\n // Dont run runner if not started yet\r\n if (dtToStart <= 0) {\r\n runnersLeft = true\r\n\r\n // This is for the case that teh timeline was seeked so that the time\r\n // is now before the startTime of the runner. Thats why we need to set\r\n // the runner to position 0\r\n runner.reset()\r\n continue\r\n } else if (dtToStart < dt) {\r\n // Adjust dt to make sure that animation is on point\r\n dt = dtToStart\r\n }\r\n\r\n if (!runner.active()) continue\r\n\r\n // If this runner is still going, signal that we need another animation\r\n // frame, otherwise, remove the completed runner\r\n var finished = runner.step(dt).done\r\n if (!finished) {\r\n runnersLeft = true\r\n // continue\r\n } else if (runnerInfo.persist !== true) {\r\n // runner is finished. And runner might get removed\r\n\r\n var endTime = runner.duration() - runner.time() + this._time\r\n\r\n if (endTime + this._persist < this._time) {\r\n // Delete runner and correct index\r\n delete this._runners[this._order[i]]\r\n this._order.splice(i--, 1) && --len\r\n runner.timeline(null)\r\n }\r\n }\r\n }\r\n\r\n // Basically: we continue when there are runners right from us in time\r\n // when -->, and when runners are left from us when <--\r\n if ((runnersLeft && !(this._speed < 0 && this._time === 0)) || (this._order.length && this._speed < 0 && this._time > 0)) {\r\n this._continue()\r\n } else {\r\n this.fire('finished')\r\n this.pause()\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Checks if we are running and continues the animation\r\n _continue (immediateStep = false) {\r\n Animator.cancelFrame(this._nextFrame)\r\n this._nextFrame = null\r\n\r\n if (immediateStep) return this._step(true)\r\n if (this._paused) return this\r\n\r\n this._nextFrame = Animator.frame(this._step)\r\n return this\r\n }\r\n\r\n active () {\r\n return !!this._nextFrame\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n timeline: function () {\r\n this._timeline = (this._timeline || new Timeline())\r\n return this._timeline\r\n }\r\n }\r\n})\r\n","import { Controller, Ease, Stepper } from './Controller.js'\r\nimport { extend } from '../utils/adopter.js'\r\nimport { from, to } from '../modules/core/gradiented.js'\r\nimport { getOrigin } from '../utils/utils.js'\r\nimport { noop, timeline } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { rx, ry } from '../modules/core/circled.js'\r\nimport Animator from './Animator.js'\r\nimport Box from '../types/Box.js'\r\nimport EventTarget from '../types/EventTarget.js'\r\nimport Matrix from '../types/Matrix.js'\r\nimport Morphable, { TransformBag } from './Morphable.js'\r\nimport Point from '../types/Point.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Timeline from './Timeline.js'\r\n\r\nexport default class Runner extends EventTarget {\r\n constructor (options) {\r\n super()\r\n\r\n // Store a unique id on the runner, so that we can identify it later\r\n this.id = Runner.id++\r\n\r\n // Ensure a default value\r\n options = options == null\r\n ? timeline.duration\r\n : options\r\n\r\n // Ensure that we get a controller\r\n options = typeof options === 'function'\r\n ? new Controller(options)\r\n : options\r\n\r\n // Declare all of the variables\r\n this._element = null\r\n this._timeline = null\r\n this.done = false\r\n this._queue = []\r\n\r\n // Work out the stepper and the duration\r\n this._duration = typeof options === 'number' && options\r\n this._isDeclarative = options instanceof Controller\r\n this._stepper = this._isDeclarative ? options : new Ease()\r\n\r\n // We copy the current values from the timeline because they can change\r\n this._history = {}\r\n\r\n // Store the state of the runner\r\n this.enabled = true\r\n this._time = 0\r\n this._lastTime = 0\r\n\r\n // At creation, the runner is in reseted state\r\n this._reseted = true\r\n\r\n // Save transforms applied to this runner\r\n this.transforms = new Matrix()\r\n this.transformId = 1\r\n\r\n // Looping variables\r\n this._haveReversed = false\r\n this._reverse = false\r\n this._loopsDone = 0\r\n this._swing = false\r\n this._wait = 0\r\n this._times = 1\r\n }\r\n\r\n /*\r\n Runner Definitions\r\n ==================\r\n These methods help us define the runtime behaviour of the Runner or they\r\n help us make new runners from the current runner\r\n */\r\n\r\n element (element) {\r\n if (element == null) return this._element\r\n this._element = element\r\n element._prepareRunner()\r\n return this\r\n }\r\n\r\n timeline (timeline) {\r\n // check explicitly for undefined so we can set the timeline to null\r\n if (typeof timeline === 'undefined') return this._timeline\r\n this._timeline = timeline\r\n return this\r\n }\r\n\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var runner = new Runner(o.duration)\r\n if (this._timeline) runner.timeline(this._timeline)\r\n if (this._element) runner.element(this._element)\r\n return runner.loop(o).schedule(delay, when)\r\n }\r\n\r\n schedule (timeline, delay, when) {\r\n // The user doesn't need to pass a timeline if we already have one\r\n if (!(timeline instanceof Timeline)) {\r\n when = delay\r\n delay = timeline\r\n timeline = this.timeline()\r\n }\r\n\r\n // If there is no timeline, yell at the user...\r\n if (!timeline) {\r\n throw Error('Runner cannot be scheduled without timeline')\r\n }\r\n\r\n // Schedule the runner on the timeline provided\r\n timeline.schedule(this, delay, when)\r\n return this\r\n }\r\n\r\n unschedule () {\r\n var timeline = this.timeline()\r\n timeline && timeline.unschedule(this)\r\n return this\r\n }\r\n\r\n loop (times, swing, wait) {\r\n // Deal with the user passing in an object\r\n if (typeof times === 'object') {\r\n swing = times.swing\r\n wait = times.wait\r\n times = times.times\r\n }\r\n\r\n // Sanitise the values and store them\r\n this._times = times || Infinity\r\n this._swing = swing || false\r\n this._wait = wait || 0\r\n return this\r\n }\r\n\r\n delay (delay) {\r\n return this.animate(0, delay)\r\n }\r\n\r\n /*\r\n Basic Functionality\r\n ===================\r\n These methods allow us to attach basic functions to the runner directly\r\n */\r\n\r\n queue (initFn, runFn, retargetFn, isTransform) {\r\n this._queue.push({\r\n initialiser: initFn || noop,\r\n runner: runFn || noop,\r\n retarget: retargetFn,\r\n isTransform: isTransform,\r\n initialised: false,\r\n finished: false\r\n })\r\n var timeline = this.timeline()\r\n timeline && this.timeline()._continue()\r\n return this\r\n }\r\n\r\n during (fn) {\r\n return this.queue(null, fn)\r\n }\r\n\r\n after (fn) {\r\n return this.on('finish', fn)\r\n }\r\n\r\n /*\r\n Runner animation methods\r\n ========================\r\n Control how the animation plays\r\n */\r\n\r\n time (time) {\r\n if (time == null) {\r\n return this._time\r\n }\r\n let dt = time - this._time\r\n this.step(dt)\r\n return this\r\n }\r\n\r\n duration () {\r\n return this._times * (this._wait + this._duration) - this._wait\r\n }\r\n\r\n loops (p) {\r\n var loopDuration = this._duration + this._wait\r\n if (p == null) {\r\n var loopsDone = Math.floor(this._time / loopDuration)\r\n var relativeTime = (this._time - loopsDone * loopDuration)\r\n var position = relativeTime / this._duration\r\n return Math.min(loopsDone + position, this._times)\r\n }\r\n var whole = Math.floor(p)\r\n var partial = p % 1\r\n var time = loopDuration * whole + this._duration * partial\r\n return this.time(time)\r\n }\r\n\r\n position (p) {\r\n // Get all of the variables we need\r\n var x = this._time\r\n var d = this._duration\r\n var w = this._wait\r\n var t = this._times\r\n var s = this._swing\r\n var r = this._reverse\r\n var position\r\n\r\n if (p == null) {\r\n /*\r\n This function converts a time to a position in the range [0, 1]\r\n The full explanation can be found in this desmos demonstration\r\n https://www.desmos.com/calculator/u4fbavgche\r\n The logic is slightly simplified here because we can use booleans\r\n */\r\n\r\n // Figure out the value without thinking about the start or end time\r\n const f = function (x) {\r\n var swinging = s * Math.floor(x % (2 * (w + d)) / (w + d))\r\n var backwards = (swinging && !r) || (!swinging && r)\r\n var uncliped = Math.pow(-1, backwards) * (x % (w + d)) / d + backwards\r\n var clipped = Math.max(Math.min(uncliped, 1), 0)\r\n return clipped\r\n }\r\n\r\n // Figure out the value by incorporating the start time\r\n var endTime = t * (w + d) - w\r\n position = x <= 0 ? Math.round(f(1e-5))\r\n : x < endTime ? f(x)\r\n : Math.round(f(endTime - 1e-5))\r\n return position\r\n }\r\n\r\n // Work out the loops done and add the position to the loops done\r\n var loopsDone = Math.floor(this.loops())\r\n var swingForward = s && (loopsDone % 2 === 0)\r\n var forwards = (swingForward && !r) || (r && swingForward)\r\n position = loopsDone + (forwards ? p : 1 - p)\r\n return this.loops(position)\r\n }\r\n\r\n progress (p) {\r\n if (p == null) {\r\n return Math.min(1, this._time / this.duration())\r\n }\r\n return this.time(p * this.duration())\r\n }\r\n\r\n step (dt) {\r\n // If we are inactive, this stepper just gets skipped\r\n if (!this.enabled) return this\r\n\r\n // Update the time and get the new position\r\n dt = dt == null ? 16 : dt\r\n this._time += dt\r\n var position = this.position()\r\n\r\n // Figure out if we need to run the stepper in this frame\r\n var running = this._lastPosition !== position && this._time >= 0\r\n this._lastPosition = position\r\n\r\n // Figure out if we just started\r\n var duration = this.duration()\r\n var justStarted = this._lastTime <= 0 && this._time > 0\r\n var justFinished = this._lastTime < this._time && this.time > duration\r\n this._lastTime = this._time\r\n if (justStarted) {\r\n this.fire('start', this)\r\n }\r\n\r\n // Work out if the runner is finished set the done flag here so animations\r\n // know, that they are running in the last step (this is good for\r\n // transformations which can be merged)\r\n var declarative = this._isDeclarative\r\n this.done = !declarative && !justFinished && this._time >= duration\r\n\r\n // Runner is running. So its not in reseted state anymore\r\n this._reseted = false\r\n\r\n // Call initialise and the run function\r\n if (running || declarative) {\r\n this._initialise(running)\r\n\r\n // clear the transforms on this runner so they dont get added again and again\r\n this.transforms = new Matrix()\r\n var converged = this._run(declarative ? dt : position)\r\n\r\n this.fire('step', this)\r\n }\r\n // correct the done flag here\r\n // declaritive animations itself know when they converged\r\n this.done = this.done || (converged && declarative)\r\n if (this.done) {\r\n this.fire('finish', this)\r\n }\r\n return this\r\n }\r\n\r\n reset () {\r\n if (this._reseted) return this\r\n this.loops(0)\r\n this._reseted = true\r\n return this\r\n }\r\n\r\n finish () {\r\n return this.step(Infinity)\r\n }\r\n\r\n reverse (reverse) {\r\n this._reverse = reverse == null ? !this._reverse : reverse\r\n return this\r\n }\r\n\r\n ease (fn) {\r\n this._stepper = new Ease(fn)\r\n return this\r\n }\r\n\r\n active (enabled) {\r\n if (enabled == null) return this.enabled\r\n this.enabled = enabled\r\n return this\r\n }\r\n\r\n /*\r\n Private Methods\r\n ===============\r\n Methods that shouldn't be used externally\r\n */\r\n\r\n // Save a morpher to the morpher list so that we can retarget it later\r\n _rememberMorpher (method, morpher) {\r\n this._history[method] = {\r\n morpher: morpher,\r\n caller: this._queue[this._queue.length - 1]\r\n }\r\n }\r\n\r\n // Try to set the target for a morpher if the morpher exists, otherwise\r\n // do nothing and return false\r\n _tryRetarget (method, target) {\r\n if (this._history[method]) {\r\n // if the last method wasnt even initialised, throw it away\r\n if (!this._history[method].caller.initialised) {\r\n let index = this._queue.indexOf(this._history[method].caller)\r\n this._queue.splice(index, 1)\r\n return false\r\n }\r\n\r\n // for the case of transformations, we use the special retarget function\r\n // which has access to the outer scope\r\n if (this._history[method].caller.retarget) {\r\n this._history[method].caller.retarget(target)\r\n // for everything else a simple morpher change is sufficient\r\n } else {\r\n this._history[method].morpher.to(target)\r\n }\r\n\r\n this._history[method].caller.finished = false\r\n var timeline = this.timeline()\r\n timeline && timeline._continue()\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n // Run each initialise function in the runner if required\r\n _initialise (running) {\r\n // If we aren't running, we shouldn't initialise when not declarative\r\n if (!running && !this._isDeclarative) return\r\n\r\n // Loop through all of the initialisers\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current initialiser\r\n var current = this._queue[i]\r\n\r\n // Determine whether we need to initialise\r\n var needsIt = this._isDeclarative || (!current.initialised && running)\r\n running = !current.finished\r\n\r\n // Call the initialiser if we need to\r\n if (needsIt && running) {\r\n current.initialiser.call(this)\r\n current.initialised = true\r\n }\r\n }\r\n }\r\n\r\n // Run each run function for the position or dt given\r\n _run (positionOrDt) {\r\n // Run all of the _queue directly\r\n var allfinished = true\r\n for (var i = 0, len = this._queue.length; i < len; ++i) {\r\n // Get the current function to run\r\n var current = this._queue[i]\r\n\r\n // Run the function if its not finished, we keep track of the finished\r\n // flag for the sake of declarative _queue\r\n var converged = current.runner.call(this, positionOrDt)\r\n current.finished = current.finished || (converged === true)\r\n allfinished = allfinished && current.finished\r\n }\r\n\r\n // We report when all of the constructors are finished\r\n return allfinished\r\n }\r\n\r\n addTransform (transform, index) {\r\n this.transforms.lmultiplyO(transform)\r\n return this\r\n }\r\n\r\n clearTransform () {\r\n this.transforms = new Matrix()\r\n return this\r\n }\r\n\r\n // TODO: Keep track of all transformations so that deletion is faster\r\n clearTransformsFromQueue () {\r\n if (!this.done) {\r\n this._queue = this._queue.filter((item) => {\r\n return !item.isTransform\r\n })\r\n }\r\n }\r\n\r\n static sanitise (duration, delay, when) {\r\n // Initialise the default parameters\r\n var times = 1\r\n var swing = false\r\n var wait = 0\r\n duration = duration || timeline.duration\r\n delay = delay || timeline.delay\r\n when = when || 'last'\r\n\r\n // If we have an object, unpack the values\r\n if (typeof duration === 'object' && !(duration instanceof Stepper)) {\r\n delay = duration.delay || delay\r\n when = duration.when || when\r\n swing = duration.swing || swing\r\n times = duration.times || times\r\n wait = duration.wait || wait\r\n duration = duration.duration || timeline.duration\r\n }\r\n\r\n return {\r\n duration: duration,\r\n delay: delay,\r\n swing: swing,\r\n times: times,\r\n wait: wait,\r\n when: when\r\n }\r\n }\r\n}\r\n\r\nRunner.id = 0\r\n\r\nclass FakeRunner {\r\n constructor (transforms = new Matrix(), id = -1, done = true) {\r\n this.transforms = transforms\r\n this.id = id\r\n this.done = done\r\n }\r\n\r\n clearTransformsFromQueue () { }\r\n}\r\n\r\nextend([Runner, FakeRunner], {\r\n mergeWith (runner) {\r\n return new FakeRunner(\r\n runner.transforms.lmultiply(this.transforms),\r\n runner.id\r\n )\r\n }\r\n})\r\n\r\n// FakeRunner.emptyRunner = new FakeRunner()\r\n\r\nconst lmultiply = (last, curr) => last.lmultiplyO(curr)\r\nconst getRunnerTransform = (runner) => runner.transforms\r\n\r\nfunction mergeTransforms () {\r\n // Find the matrix to apply to the element and apply it\r\n let runners = this._transformationRunners.runners\r\n let netTransform = runners\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n\r\n this.transform(netTransform)\r\n\r\n this._transformationRunners.merge()\r\n\r\n if (this._transformationRunners.length() === 1) {\r\n this._frameId = null\r\n }\r\n}\r\n\r\nclass RunnerArray {\r\n constructor () {\r\n this.runners = []\r\n this.ids = []\r\n }\r\n\r\n add (runner) {\r\n if (this.runners.includes(runner)) return\r\n\r\n let id = runner.id + 1\r\n\r\n let leftSibling = this.ids.reduce((last, curr) => {\r\n if (curr > last && curr < id) return curr\r\n return last\r\n }, 0)\r\n\r\n let index = this.ids.indexOf(leftSibling) + 1\r\n\r\n this.ids.splice(index, 0, id)\r\n this.runners.splice(index, 0, runner)\r\n\r\n return this\r\n }\r\n\r\n getByID (id) {\r\n return this.runners[this.ids.indexOf(id + 1)]\r\n }\r\n\r\n remove (id) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1)\r\n this.runners.splice(index, 1)\r\n return this\r\n }\r\n\r\n merge () {\r\n let lastRunner = null\r\n this.runners.forEach((runner, i) => {\r\n if (lastRunner && runner.done && lastRunner.done) {\r\n this.remove(runner.id)\r\n this.edit(lastRunner.id, runner.mergeWith(lastRunner))\r\n }\r\n\r\n lastRunner = runner\r\n })\r\n\r\n return this\r\n }\r\n\r\n edit (id, newRunner) {\r\n let index = this.ids.indexOf(id + 1)\r\n this.ids.splice(index, 1, id)\r\n this.runners.splice(index, 1, newRunner)\r\n return this\r\n }\r\n\r\n length () {\r\n return this.ids.length\r\n }\r\n\r\n clearBefore (id) {\r\n let deleteCnt = this.ids.indexOf(id + 1) || 1\r\n this.ids.splice(0, deleteCnt, 0)\r\n this.runners.splice(0, deleteCnt, new FakeRunner())\r\n .forEach((r) => r.clearTransformsFromQueue())\r\n return this\r\n }\r\n}\r\n\r\nlet frameId = 0\r\nregisterMethods({\r\n Element: {\r\n animate (duration, delay, when) {\r\n var o = Runner.sanitise(duration, delay, when)\r\n var timeline = this.timeline()\r\n return new Runner(o.duration)\r\n .loop(o)\r\n .element(this)\r\n .timeline(timeline.play())\r\n .schedule(delay, when)\r\n },\r\n\r\n delay (by, when) {\r\n return this.animate(0, by, when)\r\n },\r\n\r\n // this function searches for all runners on the element and deletes the ones\r\n // which run before the current one. This is because absolute transformations\r\n // overwfrite anything anyway so there is no need to waste time computing\r\n // other runners\r\n _clearTransformRunnersBefore (currentRunner) {\r\n this._transformationRunners.clearBefore(currentRunner.id)\r\n },\r\n\r\n _currentTransform (current) {\r\n return this._transformationRunners.runners\r\n // we need the equal sign here to make sure, that also transformations\r\n // on the same runner which execute before the current transformation are\r\n // taken into account\r\n .filter((runner) => runner.id <= current.id)\r\n .map(getRunnerTransform)\r\n .reduce(lmultiply, new Matrix())\r\n },\r\n\r\n addRunner (runner) {\r\n this._transformationRunners.add(runner)\r\n\r\n Animator.transform_frame(\r\n mergeTransforms.bind(this), this._frameId\r\n )\r\n },\r\n\r\n _prepareRunner () {\r\n if (this._frameId == null) {\r\n this._transformationRunners = new RunnerArray()\r\n .add(new FakeRunner(new Matrix(this)))\r\n\r\n this._frameId = frameId++\r\n }\r\n }\r\n }\r\n})\r\n\r\nextend(Runner, {\r\n attr (a, v) {\r\n return this.styleAttr('attr', a, v)\r\n },\r\n\r\n // Add animatable styles\r\n css (s, v) {\r\n return this.styleAttr('css', s, v)\r\n },\r\n\r\n styleAttr (type, name, val) {\r\n // apply attributes individually\r\n if (typeof name === 'object') {\r\n for (var key in val) {\r\n this.styleAttr(type, key, val[key])\r\n }\r\n }\r\n\r\n var morpher = new Morphable(this._stepper).to(val)\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.element()[type](name))\r\n }, function (pos) {\r\n this.element()[type](name, morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n zoom (level, point) {\r\n var morpher = new Morphable(this._stepper).to(new SVGNumber(level))\r\n\r\n this.queue(function () {\r\n morpher = morpher.from(this.zoom())\r\n }, function (pos) {\r\n this.element().zoom(morpher.at(pos), point)\r\n return morpher.done()\r\n })\r\n\r\n return this\r\n },\r\n\r\n /**\r\n ** absolute transformations\r\n **/\r\n\r\n //\r\n // M v -----|-----(D M v = F v)------|-----> T v\r\n //\r\n // 1. define the final state (T) and decompose it (once)\r\n // t = [tx, ty, the, lam, sy, sx]\r\n // 2. on every frame: pull the current state of all previous transforms\r\n // (M - m can change)\r\n // and then write this as m = [tx0, ty0, the0, lam0, sy0, sx0]\r\n // 3. Find the interpolated matrix F(pos) = m + pos * (t - m)\r\n // - Note F(0) = M\r\n // - Note F(1) = T\r\n // 4. Now you get the delta matrix as a result: D = F * inv(M)\r\n\r\n transform (transforms, relative, affine) {\r\n // If we have a declarative function, we should retarget it if possible\r\n relative = transforms.relative || relative\r\n if (this._isDeclarative && !relative && this._tryRetarget('transform', transforms)) {\r\n return this\r\n }\r\n\r\n // Parse the parameters\r\n var isMatrix = Matrix.isMatrixLike(transforms)\r\n affine = transforms.affine != null\r\n ? transforms.affine\r\n : (affine != null ? affine : !isMatrix)\r\n\r\n // Create a morepher and set its type\r\n const morpher = new Morphable(this._stepper)\r\n .type(affine ? TransformBag : Matrix)\r\n\r\n let origin\r\n let element\r\n let current\r\n let currentAngle\r\n let startTransform\r\n\r\n function setup () {\r\n // make sure element and origin is defined\r\n element = element || this.element()\r\n origin = origin || getOrigin(transforms, element)\r\n\r\n startTransform = new Matrix(relative ? undefined : element)\r\n\r\n // add the runner to the element so it can merge transformations\r\n element.addRunner(this)\r\n\r\n // Deactivate all transforms that have run so far if we are absolute\r\n if (!relative) {\r\n element._clearTransformRunnersBefore(this)\r\n }\r\n }\r\n\r\n function run (pos) {\r\n // clear all other transforms before this in case something is saved\r\n // on this runner. We are absolute. We dont need these!\r\n if (!relative) this.clearTransform()\r\n\r\n let { x, y } = new Point(origin).transform(element._currentTransform(this))\r\n\r\n let target = new Matrix({ ...transforms, origin: [x, y] })\r\n let start = this._isDeclarative && current\r\n ? current\r\n : startTransform\r\n\r\n if (affine) {\r\n target = target.decompose(x, y)\r\n start = start.decompose(x, y)\r\n\r\n // Get the current and target angle as it was set\r\n const rTarget = target.rotate\r\n const rCurrent = start.rotate\r\n\r\n // Figure out the shortest path to rotate directly\r\n const possibilities = [rTarget - 360, rTarget, rTarget + 360]\r\n const distances = possibilities.map(a => Math.abs(a - rCurrent))\r\n const shortest = Math.min(...distances)\r\n const index = distances.indexOf(shortest)\r\n target.rotate = possibilities[index]\r\n }\r\n\r\n if (relative) {\r\n // we have to be careful here not to overwrite the rotation\r\n // with the rotate method of Matrix\r\n if (!isMatrix) {\r\n target.rotate = transforms.rotate || 0\r\n }\r\n if (this._isDeclarative && currentAngle) {\r\n start.rotate = currentAngle\r\n }\r\n }\r\n\r\n morpher.from(start)\r\n morpher.to(target)\r\n\r\n let affineParameters = morpher.at(pos)\r\n currentAngle = affineParameters.rotate\r\n current = new Matrix(affineParameters)\r\n\r\n this.addTransform(current)\r\n return morpher.done()\r\n }\r\n\r\n function retarget (newTransforms) {\r\n // only get a new origin if it changed since the last call\r\n if (\r\n (newTransforms.origin || 'center').toString() !==\r\n (transforms.origin || 'center').toString()\r\n ) {\r\n origin = getOrigin(transforms, element)\r\n }\r\n\r\n // overwrite the old transformations with the new ones\r\n transforms = { ...newTransforms, origin }\r\n }\r\n\r\n this.queue(setup, run, retarget, true)\r\n this._isDeclarative && this._rememberMorpher('transform', morpher)\r\n return this\r\n },\r\n\r\n // Animatable x-axis\r\n x (x, relative) {\r\n return this._queueNumber('x', x)\r\n },\r\n\r\n // Animatable y-axis\r\n y (y) {\r\n return this._queueNumber('y', y)\r\n },\r\n\r\n dx (x) {\r\n return this._queueNumberDelta('x', x)\r\n },\r\n\r\n dy (y) {\r\n return this._queueNumberDelta('y', y)\r\n },\r\n\r\n _queueNumberDelta (method, to) {\r\n to = new SVGNumber(to)\r\n\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n var from = null\r\n this.queue(function () {\r\n from = this.element()[method]()\r\n morpher.from(from)\r\n morpher.to(from + to)\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n }, function (newTo) {\r\n morpher.to(from + new SVGNumber(newTo))\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueObject (method, to) {\r\n // Try to change the target if we have this method already registerd\r\n if (this._tryRetarget(method, to)) return this\r\n\r\n // Make a morpher and queue the animation\r\n var morpher = new Morphable(this._stepper).to(to)\r\n this.queue(function () {\r\n morpher.from(this.element()[method]())\r\n }, function (pos) {\r\n this.element()[method](morpher.at(pos))\r\n return morpher.done()\r\n })\r\n\r\n // Register the morpher so that if it is changed again, we can retarget it\r\n this._rememberMorpher(method, morpher)\r\n return this\r\n },\r\n\r\n _queueNumber (method, value) {\r\n return this._queueObject(method, new SVGNumber(value))\r\n },\r\n\r\n // Animatable center x-axis\r\n cx (x) {\r\n return this._queueNumber('cx', x)\r\n },\r\n\r\n // Animatable center y-axis\r\n cy (y) {\r\n return this._queueNumber('cy', y)\r\n },\r\n\r\n // Add animatable move\r\n move (x, y) {\r\n return this.x(x).y(y)\r\n },\r\n\r\n // Add animatable center\r\n center (x, y) {\r\n return this.cx(x).cy(y)\r\n },\r\n\r\n // Add animatable size\r\n size (width, height) {\r\n // animate bbox based size for all other elements\r\n var box\r\n\r\n if (!width || !height) {\r\n box = this._element.bbox()\r\n }\r\n\r\n if (!width) {\r\n width = box.width / box.height * height\r\n }\r\n\r\n if (!height) {\r\n height = box.height / box.width * width\r\n }\r\n\r\n return this\r\n .width(width)\r\n .height(height)\r\n },\r\n\r\n // Add animatable width\r\n width (width) {\r\n return this._queueNumber('width', width)\r\n },\r\n\r\n // Add animatable height\r\n height (height) {\r\n return this._queueNumber('height', height)\r\n },\r\n\r\n // Add animatable plot\r\n plot (a, b, c, d) {\r\n // Lines can be plotted with 4 arguments\r\n if (arguments.length === 4) {\r\n return this.plot([a, b, c, d])\r\n }\r\n\r\n var morpher = this._element.MorphArray().to(a)\r\n\r\n this.queue(function () {\r\n morpher.from(this._element.array())\r\n }, function (pos) {\r\n this._element.plot(morpher.at(pos))\r\n })\r\n\r\n return this\r\n },\r\n\r\n // Add leading method\r\n leading (value) {\r\n return this._queueNumber('leading', value)\r\n },\r\n\r\n // Add animatable viewbox\r\n viewbox (x, y, width, height) {\r\n return this._queueObject('viewbox', new Box(x, y, width, height))\r\n },\r\n\r\n update (o) {\r\n if (typeof o !== 'object') {\r\n return this.update({\r\n offset: arguments[0],\r\n color: arguments[1],\r\n opacity: arguments[2]\r\n })\r\n }\r\n\r\n if (o.opacity != null) this.attr('stop-opacity', o.opacity)\r\n if (o.color != null) this.attr('stop-color', o.color)\r\n if (o.offset != null) this.attr('offset', o.offset)\r\n\r\n return this\r\n }\r\n})\r\n\r\nextend(Runner, { rx, ry, from, to })\r\n","import {\r\n adopt,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { ns, svgjs, xlink, xmlns } from '../modules/core/namespaces.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport Defs from './Defs.js'\r\nimport { globals } from '../utils/window.js'\r\n\r\nexport default class Svg extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('svg', node), node)\r\n this.namespace()\r\n }\r\n\r\n isRoot () {\r\n return !this.node.parentNode ||\r\n !(this.node.parentNode instanceof globals.window.SVGElement) ||\r\n this.node.parentNode.nodeName === '#document'\r\n }\r\n\r\n // Check if this is a root svg\r\n // If not, call docs from this element\r\n root () {\r\n if (this.isRoot()) return this\r\n return super.root()\r\n }\r\n\r\n // Add namespaces\r\n namespace () {\r\n if (!this.isRoot()) return this.root().namespace()\r\n return this\r\n .attr({ xmlns: ns, version: '1.1' })\r\n .attr('xmlns:xlink', xlink, xmlns)\r\n .attr('xmlns:svgjs', svgjs, xmlns)\r\n }\r\n\r\n // Creates and returns defs element\r\n defs () {\r\n if (!this.isRoot()) return this.root().defs()\r\n\r\n return adopt(this.node.getElementsByTagName('defs')[0]) ||\r\n this.put(new Defs())\r\n }\r\n\r\n // custom parent method\r\n parent (type) {\r\n if (this.isRoot()) {\r\n return this.node.parentNode.nodeName === '#document'\r\n ? null\r\n : adopt(this.node.parentNode)\r\n }\r\n\r\n return super.parent(type)\r\n }\r\n\r\n clear () {\r\n // remove children\r\n while (this.node.hasChildNodes()) {\r\n this.node.removeChild(this.node.lastChild)\r\n }\r\n return this\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create nested svg document\r\n nested: wrapWithAttrCheck(function () {\r\n return this.put(new Svg())\r\n })\r\n }\r\n})\r\n\r\nregister(Svg, 'Svg', true)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class Symbol extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('symbol', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n symbol: wrapWithAttrCheck(function () {\r\n return this.put(new Symbol())\r\n })\r\n }\r\n})\r\n\r\nregister(Symbol)\r\n","import { globals } from '../../utils/window.js'\r\n\r\n// Create plain text node\r\nexport function plain (text) {\r\n // clear if build mode is disabled\r\n if (this._build === false) {\r\n this.clear()\r\n }\r\n\r\n // create text node\r\n this.node.appendChild(globals.document.createTextNode(text))\r\n\r\n return this\r\n}\r\n\r\n// Get length of text element\r\nexport function length () {\r\n return this.node.getComputedTextLength()\r\n}\r\n","import {\r\n adopt,\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { attrs } from '../modules/core/defaults.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport SVGNumber from '../types/SVGNumber.js'\r\nimport Shape from './Shape.js'\r\nimport { globals } from '../utils/window.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Text extends Shape {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('text', node), node)\r\n\r\n this.dom.leading = new SVGNumber(1.3) // store leading value for rebuilding\r\n this._rebuild = true // enable automatic updating of dy values\r\n this._build = false // disable build mode for adding multiple lines\r\n\r\n // set default font\r\n this.attr('font-family', attrs['font-family'])\r\n }\r\n\r\n // Move over x-axis\r\n x (x) {\r\n // act as getter\r\n if (x == null) {\r\n return this.attr('x')\r\n }\r\n\r\n return this.attr('x', x)\r\n }\r\n\r\n // Move over y-axis\r\n y (y) {\r\n var oy = this.attr('y')\r\n var o = typeof oy === 'number' ? oy - this.bbox().y : 0\r\n\r\n // act as getter\r\n if (y == null) {\r\n return typeof oy === 'number' ? oy - o : oy\r\n }\r\n\r\n return this.attr('y', typeof y === 'number' ? y + o : y)\r\n }\r\n\r\n // Move center over x-axis\r\n cx (x) {\r\n return x == null ? this.bbox().cx : this.x(x - this.bbox().width / 2)\r\n }\r\n\r\n // Move center over y-axis\r\n cy (y) {\r\n return y == null ? this.bbox().cy : this.y(y - this.bbox().height / 2)\r\n }\r\n\r\n // Set the text content\r\n text (text) {\r\n // act as getter\r\n if (text === undefined) {\r\n var children = this.node.childNodes\r\n var firstLine = 0\r\n text = ''\r\n\r\n for (var i = 0, len = children.length; i < len; ++i) {\r\n // skip textPaths - they are no lines\r\n if (children[i].nodeName === 'textPath') {\r\n if (i === 0) firstLine = 1\r\n continue\r\n }\r\n\r\n // add newline if its not the first child and newLined is set to true\r\n if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {\r\n text += '\\n'\r\n }\r\n\r\n // add content of this node\r\n text += children[i].textContent\r\n }\r\n\r\n return text\r\n }\r\n\r\n // remove existing content\r\n this.clear().build(true)\r\n\r\n if (typeof text === 'function') {\r\n // call block\r\n text.call(this, this)\r\n } else {\r\n // store text and make sure text is not blank\r\n text = text.split('\\n')\r\n\r\n // build new lines\r\n for (var j = 0, jl = text.length; j < jl; j++) {\r\n this.tspan(text[j]).newLine()\r\n }\r\n }\r\n\r\n // disable build mode and rebuild lines\r\n return this.build(false).rebuild()\r\n }\r\n\r\n // Set / get leading\r\n leading (value) {\r\n // act as getter\r\n if (value == null) {\r\n return this.dom.leading\r\n }\r\n\r\n // act as setter\r\n this.dom.leading = new SVGNumber(value)\r\n\r\n return this.rebuild()\r\n }\r\n\r\n // Rebuild appearance type\r\n rebuild (rebuild) {\r\n // store new rebuild flag if given\r\n if (typeof rebuild === 'boolean') {\r\n this._rebuild = rebuild\r\n }\r\n\r\n // define position of all lines\r\n if (this._rebuild) {\r\n var self = this\r\n var blankLineOffset = 0\r\n var leading = this.dom.leading\r\n\r\n this.each(function () {\r\n var fontSize = globals.window.getComputedStyle(this.node)\r\n .getPropertyValue('font-size')\r\n var dy = leading * new SVGNumber(fontSize)\r\n\r\n if (this.dom.newLined) {\r\n this.attr('x', self.attr('x'))\r\n\r\n if (this.text() === '\\n') {\r\n blankLineOffset += dy\r\n } else {\r\n this.attr('dy', dy + blankLineOffset)\r\n blankLineOffset = 0\r\n }\r\n }\r\n })\r\n\r\n this.fire('rebuild')\r\n }\r\n\r\n return this\r\n }\r\n\r\n // Enable / disable build mode\r\n build (build) {\r\n this._build = !!build\r\n return this\r\n }\r\n\r\n // overwrite method from parent to set data properly\r\n setData (o) {\r\n this.dom = o\r\n this.dom.leading = new SVGNumber(o.leading || 1.3)\r\n return this\r\n }\r\n}\r\n\r\nextend(Text, textable)\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create text element\r\n text: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).text(text)\r\n }),\r\n\r\n // Create plain text element\r\n plain: wrapWithAttrCheck(function (text) {\r\n return this.put(new Text()).plain(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Text)\r\n","import {\r\n extend,\r\n nodeOrNew,\r\n register,\r\n wrapWithAttrCheck\r\n} from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Text from './Text.js'\r\nimport * as textable from '../modules/core/textable.js'\r\n\r\nexport default class Tspan extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('tspan', node), node)\r\n }\r\n\r\n // Set text content\r\n text (text) {\r\n if (text == null) return this.node.textContent + (this.dom.newLined ? '\\n' : '')\r\n\r\n typeof text === 'function' ? text.call(this, this) : this.plain(text)\r\n\r\n return this\r\n }\r\n\r\n // Shortcut dx\r\n dx (dx) {\r\n return this.attr('dx', dx)\r\n }\r\n\r\n // Shortcut dy\r\n dy (dy) {\r\n return this.attr('dy', dy)\r\n }\r\n\r\n // Create new line\r\n newLine () {\r\n // fetch text parent\r\n var t = this.parent(Text)\r\n\r\n // mark new line\r\n this.dom.newLined = true\r\n\r\n // apply new position\r\n return this.dy(t.dom.leading * t.attr('font-size')).attr('x', t.x())\r\n }\r\n}\r\n\r\nextend(Tspan, textable)\r\n\r\nregisterMethods({\r\n Tspan: {\r\n tspan: wrapWithAttrCheck(function (text) {\r\n var tspan = new Tspan()\r\n\r\n // clear if build mode is disabled\r\n if (!this._build) {\r\n this.clear()\r\n }\r\n\r\n // add new tspan\r\n this.node.appendChild(tspan.node)\r\n\r\n return tspan.text(text)\r\n })\r\n }\r\n})\r\n\r\nregister(Tspan)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class ClipPath extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('clipPath', node), node)\r\n }\r\n\r\n // Unclip all clipped elements and remove itself\r\n remove () {\r\n // unclip all targets\r\n this.targets().forEach(function (el) {\r\n el.unclip()\r\n })\r\n\r\n // remove clipPath from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [clip-path*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create clipping element\r\n clip: wrapWithAttrCheck(function () {\r\n return this.defs().put(new ClipPath())\r\n })\r\n },\r\n Element: {\r\n // Distribute clipPath to svg element\r\n clipWith (element) {\r\n // use given clip or create a new one\r\n let clipper = element instanceof ClipPath\r\n ? element\r\n : this.parent().clip().add(element)\r\n\r\n // apply mask\r\n return this.attr('clip-path', 'url(\"#' + clipper.id() + '\")')\r\n },\r\n\r\n // Unclip element\r\n unclip () {\r\n return this.attr('clip-path', null)\r\n },\r\n\r\n clipper () {\r\n return this.reference('clip-path')\r\n }\r\n }\r\n})\r\n\r\nregister(ClipPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class G extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('g', node), node)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Element: {\r\n // Create a group element\r\n group: wrapWithAttrCheck(function () {\r\n return this.put(new G())\r\n })\r\n }\r\n})\r\n\r\nregister(G)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Container from './Container.js'\r\n\r\nexport default class A extends Container {\r\n constructor (node) {\r\n super(nodeOrNew('a', node), node)\r\n }\r\n\r\n // Link url\r\n to (url) {\r\n return this.attr('href', url, xlink)\r\n }\r\n\r\n // Link target attribute\r\n target (target) {\r\n return this.attr('target', target)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a hyperlink element\r\n link: wrapWithAttrCheck(function (url) {\r\n return this.put(new A()).to(url)\r\n })\r\n },\r\n Element: {\r\n // Create a hyperlink element\r\n linkTo: function (url) {\r\n var link = new A()\r\n\r\n if (typeof url === 'function') { url.call(link, link) } else {\r\n link.to(url)\r\n }\r\n\r\n return this.parent().put(link).put(this)\r\n }\r\n }\r\n})\r\n\r\nregister(A)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport Container from './Container.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class Mask extends Container {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('mask', node), node)\r\n }\r\n\r\n // Unmask all masked elements and remove itself\r\n remove () {\r\n // unmask all targets\r\n this.targets().forEach(function (el) {\r\n el.unmask()\r\n })\r\n\r\n // remove mask from parent\r\n return super.remove()\r\n }\r\n\r\n targets () {\r\n return baseFind('svg [mask*=\"' + this.id() + '\"]')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n mask: wrapWithAttrCheck(function () {\r\n return this.defs().put(new Mask())\r\n })\r\n },\r\n Element: {\r\n // Distribute mask to svg element\r\n maskWith (element) {\r\n // use given mask or create a new one\r\n var masker = element instanceof Mask\r\n ? element\r\n : this.parent().mask().add(element)\r\n\r\n // apply mask\r\n return this.attr('mask', 'url(\"#' + masker.id() + '\")')\r\n },\r\n\r\n // Unmask element\r\n unmask () {\r\n return this.attr('mask', null)\r\n },\r\n\r\n masker () {\r\n return this.reference('mask')\r\n }\r\n }\r\n})\r\n\r\nregister(Mask)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { unCamelCase } from '../utils/utils.js'\r\nimport Element from './Element.js'\r\n\r\nfunction cssRule (selector, rule) {\r\n if (!selector) return ''\r\n if (!rule) return selector\r\n\r\n var ret = selector + '{'\r\n\r\n for (var i in rule) {\r\n ret += unCamelCase(i) + ':' + rule[i] + ';'\r\n }\r\n\r\n ret += '}'\r\n\r\n return ret\r\n}\r\n\r\nexport default class Style extends Element {\r\n constructor (node) {\r\n super(nodeOrNew('style', node), node)\r\n }\r\n\r\n addText (w = '') {\r\n this.node.textContent += w\r\n return this\r\n }\r\n\r\n font (name, src, params = {}) {\r\n return this.rule('@font-face', {\r\n fontFamily: name,\r\n src: src,\r\n ...params\r\n })\r\n }\r\n\r\n rule (selector, obj) {\r\n return this.addText(cssRule(selector, obj))\r\n }\r\n}\r\n\r\nregisterMethods('Dom', {\r\n style: wrapWithAttrCheck(function (selector, obj) {\r\n return this.put(new Style()).rule(selector, obj)\r\n }),\r\n fontface: wrapWithAttrCheck(function (name, src, params) {\r\n return this.put(new Style()).font(name, src, params)\r\n })\r\n})\r\n\r\nregister(Style)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Path from './Path.js'\r\nimport PathArray from '../types/PathArray.js'\r\nimport Text from './Text.js'\r\nimport baseFind from '../modules/core/selector.js'\r\n\r\nexport default class TextPath extends Text {\r\n // Initialize node\r\n constructor (node) {\r\n super(nodeOrNew('textPath', node), node)\r\n }\r\n\r\n // return the array of the path track element\r\n array () {\r\n var track = this.track()\r\n\r\n return track ? track.array() : null\r\n }\r\n\r\n // Plot path if any\r\n plot (d) {\r\n var track = this.track()\r\n var pathArray = null\r\n\r\n if (track) {\r\n pathArray = track.plot(d)\r\n }\r\n\r\n return (d == null) ? pathArray : this\r\n }\r\n\r\n // Get the path element\r\n track () {\r\n return this.reference('href')\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n textPath: wrapWithAttrCheck(function (text, path) {\r\n return this.defs().path(path).text(text).addTo(this)\r\n })\r\n },\r\n Text: {\r\n // Create path for text to run on\r\n path: wrapWithAttrCheck(function (track) {\r\n var path = new TextPath()\r\n\r\n // if track is a path, reuse it\r\n if (!(track instanceof Path)) {\r\n // create path element\r\n track = this.root().defs().path(track)\r\n }\r\n\r\n // link textPath to path and add content\r\n path.attr('href', '#' + track, xlink)\r\n\r\n // add textPath element as child node and return textPath\r\n return this.put(path)\r\n }),\r\n\r\n // Get the textPath children\r\n textPath () {\r\n return this.find('textPath')[0]\r\n }\r\n },\r\n Path: {\r\n // creates a textPath from this path\r\n text: wrapWithAttrCheck(function (text) {\r\n if (text instanceof Text) {\r\n var txt = text.text()\r\n return text.clear().path(this).text(txt)\r\n }\r\n return this.parent().put(new Text()).path(this).text(text)\r\n }),\r\n\r\n targets () {\r\n return baseFind('svg [href*=\"' + this.id() + '\"]')\r\n }\r\n }\r\n})\r\n\r\nTextPath.prototype.MorphArray = PathArray\r\nregister(TextPath)\r\n","import { nodeOrNew, register, wrapWithAttrCheck } from '../utils/adopter.js'\r\nimport { registerMethods } from '../utils/methods.js'\r\nimport { xlink } from '../modules/core/namespaces.js'\r\nimport Shape from './Shape.js'\r\n\r\nexport default class Use extends Shape {\r\n constructor (node) {\r\n super(nodeOrNew('use', node), node)\r\n }\r\n\r\n // Use element as a reference\r\n element (element, file) {\r\n // Set lined element\r\n return this.attr('href', (file || '') + '#' + element, xlink)\r\n }\r\n}\r\n\r\nregisterMethods({\r\n Container: {\r\n // Create a use element\r\n use: wrapWithAttrCheck(function (element, file) {\r\n return this.put(new Use()).element(element, file)\r\n })\r\n }\r\n})\r\n\r\nregister(Use)\r\n","/* Optional Modules */\r\nimport './modules/optional/arrange.js'\r\nimport './modules/optional/class.js'\r\nimport './modules/optional/css.js'\r\nimport './modules/optional/data.js'\r\nimport './modules/optional/memory.js'\r\nimport './modules/optional/sugar.js'\r\nimport './modules/optional/transform.js'\r\n\r\nimport { extend, makeInstance } from './utils/adopter.js'\r\nimport { getMethodNames, getMethodsFor } from './utils/methods.js'\r\nimport Box from './types/Box.js'\r\nimport Circle from './elements/Circle.js'\r\nimport Color from './types/Color.js'\r\nimport Container from './elements/Container.js'\r\nimport Defs from './elements/Defs.js'\r\nimport Dom from './elements/Dom.js'\r\nimport Element from './elements/Element.js'\r\nimport Ellipse from './elements/Ellipse.js'\r\nimport EventTarget from './types/EventTarget.js'\r\nimport Gradient from './elements/Gradient.js'\r\nimport Image from './elements/Image.js'\r\nimport Line from './elements/Line.js'\r\nimport List from './types/List.js'\r\nimport Marker from './elements/Marker.js'\r\nimport Matrix from './types/Matrix.js'\r\nimport Morphable, {\r\n NonMorphable,\r\n ObjectBag,\r\n TransformBag,\r\n makeMorphable,\r\n registerMorphableType\r\n} from './animation/Morphable.js'\r\nimport Path from './elements/Path.js'\r\nimport PathArray from './types/PathArray.js'\r\nimport Pattern from './elements/Pattern.js'\r\nimport PointArray from './types/PointArray.js'\r\nimport Polygon from './elements/Polygon.js'\r\nimport Polyline from './elements/Polyline.js'\r\nimport Rect from './elements/Rect.js'\r\nimport Runner from './animation/Runner.js'\r\nimport SVGArray from './types/SVGArray.js'\r\nimport SVGNumber from './types/SVGNumber.js'\r\nimport Shape from './elements/Shape.js'\r\nimport Svg from './elements/Svg.js'\r\nimport Symbol from './elements/Symbol.js'\r\nimport Text from './elements/Text.js'\r\nimport Tspan from './elements/Tspan.js'\r\nimport * as defaults from './modules/core/defaults.js'\r\nimport * as utils from './utils/utils.js'\r\nimport * as namespaces from './modules/core/namespaces.js'\r\nimport * as regex from './modules/core/regex.js'\r\n\r\nexport {\r\n Morphable,\r\n registerMorphableType,\r\n makeMorphable,\r\n TransformBag,\r\n ObjectBag,\r\n NonMorphable\r\n}\r\n\r\nexport { defaults, utils, namespaces, regex }\r\nexport const SVG = makeInstance\r\nexport { default as parser } from './modules/core/parser.js'\r\nexport { default as find } from './modules/core/selector.js'\r\nexport * from './modules/core/event.js'\r\nexport * from './utils/adopter.js'\r\nexport { registerWindow } from './utils/window.js'\r\n\r\n/* Animation Modules */\r\nexport { default as Animator } from './animation/Animator.js'\r\nexport { Controller, Ease, PID, Spring, easing } from './animation/Controller.js'\r\nexport { default as Queue } from './animation/Queue.js'\r\nexport { default as Runner } from './animation/Runner.js'\r\nexport { default as Timeline } from './animation/Timeline.js'\r\n\r\n/* Types */\r\nexport { default as Array } from './types/SVGArray.js'\r\nexport { default as Box } from './types/Box.js'\r\nexport { default as Color } from './types/Color.js'\r\nexport { default as EventTarget } from './types/EventTarget.js'\r\nexport { default as Matrix } from './types/Matrix.js'\r\nexport { default as Number } from './types/SVGNumber.js'\r\nexport { default as PathArray } from './types/PathArray.js'\r\nexport { default as Point } from './types/Point.js'\r\nexport { default as PointArray } from './types/PointArray.js'\r\nexport { default as List } from './types/List.js'\r\n\r\n/* Elements */\r\nexport { default as Circle } from './elements/Circle.js'\r\nexport { default as ClipPath } from './elements/ClipPath.js'\r\nexport { default as Container } from './elements/Container.js'\r\nexport { default as Defs } from './elements/Defs.js'\r\nexport { default as Dom } from './elements/Dom.js'\r\nexport { default as Element } from './elements/Element.js'\r\nexport { default as Ellipse } from './elements/Ellipse.js'\r\nexport { default as Gradient } from './elements/Gradient.js'\r\nexport { default as G } from './elements/G.js'\r\nexport { default as A } from './elements/A.js'\r\nexport { default as Image } from './elements/Image.js'\r\nexport { default as Line } from './elements/Line.js'\r\nexport { default as Marker } from './elements/Marker.js'\r\nexport { default as Mask } from './elements/Mask.js'\r\nexport { default as Path } from './elements/Path.js'\r\nexport { default as Pattern } from './elements/Pattern.js'\r\nexport { default as Polygon } from './elements/Polygon.js'\r\nexport { default as Polyline } from './elements/Polyline.js'\r\nexport { default as Rect } from './elements/Rect.js'\r\nexport { default as Shape } from './elements/Shape.js'\r\nexport { default as Stop } from './elements/Stop.js'\r\nexport { default as Style } from './elements/Style.js'\r\nexport { default as Svg } from './elements/Svg.js'\r\nexport { default as Symbol } from './elements/Symbol.js'\r\nexport { default as Text } from './elements/Text.js'\r\nexport { default as TextPath } from './elements/TextPath.js'\r\nexport { default as Tspan } from './elements/Tspan.js'\r\nexport { default as Use } from './elements/Use.js'\r\n\r\nextend([\r\n Svg,\r\n Symbol,\r\n Image,\r\n Pattern,\r\n Marker\r\n], getMethodsFor('viewbox'))\r\n\r\nextend([\r\n Line,\r\n Polyline,\r\n Polygon,\r\n Path\r\n], getMethodsFor('marker'))\r\n\r\nextend(Text, getMethodsFor('Text'))\r\nextend(Path, getMethodsFor('Path'))\r\n\r\nextend(Defs, getMethodsFor('Defs'))\r\n\r\nextend([\r\n Text,\r\n Tspan\r\n], getMethodsFor('Tspan'))\r\n\r\nextend([\r\n Rect,\r\n Ellipse,\r\n Circle,\r\n Gradient\r\n], getMethodsFor('radius'))\r\n\r\nextend(EventTarget, getMethodsFor('EventTarget'))\r\nextend(Dom, getMethodsFor('Dom'))\r\nextend(Element, getMethodsFor('Element'))\r\nextend(Shape, getMethodsFor('Shape'))\r\n// extend(Element, getConstructor('Memory'))\r\nextend(Container, getMethodsFor('Container'))\r\n\r\nextend(Runner, getMethodsFor('Runner'))\r\n\r\nList.extend(getMethodNames())\r\n\r\nregisterMorphableType([\r\n SVGNumber,\r\n Color,\r\n Box,\r\n Matrix,\r\n SVGArray,\r\n PointArray,\r\n PathArray\r\n])\r\n\r\nmakeMorphable()\r\n"],"names":["methods","names","registerMethods","name","m","Array","isArray","_name","addMethodNames","Object","keys","assign","getMethodsFor","getMethodNames","Set","_names","push","map","array","block","i","il","length","result","filter","radians","d","Math","PI","degrees","r","camelCase","s","toLowerCase","replace","g","toUpperCase","unCamelCase","capitalize","charAt","slice","proportionalSize","element","width","height","box","bbox","getOrigin","o","origin","ox","oy","string","trim","x","y","bx","includes","by","ns","xmlns","xlink","svgjs","globals","window","document","registerWindow","win","doc","Base","elements","root","makeNode","createElementNS","makeInstance","adopter","querySelector","node","innerHTML","firstChild","nodeOrNew","Node","adopt","instance","className","nodeName","mockAdopt","mock","register","asRoot","prototype","getClass","did","eid","assignNewId","children","id","extend","modules","attrCheck","key","method","wrapWithAttrCheck","fn","args","constructor","apply","attr","siblings","parent","position","index","next","prev","forward","p","removeElement","add","isRoot","appendChild","defs","backward","front","back","before","remove","after","insertBefore","insertAfter","numberAndUnit","hex","rgb","reference","transforms","whitespace","isHex","isRgb","isCss","isBlank","isNumber","isPercent","isImage","delimiter","hyphen","pathLetters","isPathLetter","numbersWithDots","dots","classes","split","hasClass","indexOf","addClass","join","removeClass","c","toggleClass","css","style","val","ret","arguments","cssText","el","forEach","t","cased","test","show","hide","visible","data","a","v","JSON","parse","e","stringify","remember","k","memory","forget","_memory","listenerId","getEvents","n","getEventHolder","events","getEventTarget","clearEvents","on","listener","binding","options","l","bind","bag","_svgjsListenerId","event","ev","addEventListener","off","namespace","removeEventListener","dispatch","Event","dispatchEvent","CustomEvent","detail","cancelable","fullHex","substring","compToHex","comp","toString","Color","init","color","b","match","exec","parseInt","toHex","toArray","round","toRgb","brightness","isColor","Point","source","base","clone","transform","f","point","screenCTM","inverse","parser","nodes","svg","size","path","parentNode","body","documentElement","addTo","isNulledBox","w","h","domContains","contains","call","Box","parseFloat","left","top","x2","y2","cx","cy","merge","min","max","xMin","Infinity","xMax","yMin","yMax","pts","addOffset","pageXOffset","pageYOffset","isNulled","getBox","cb","retry","Error","getBBox","rbox","getBoundingClientRect","viewbox","closeEnough","threshold","abs","Matrix","fromArray","Element","matrixify","isMatrixLike","matrix","multiplyO","formatTransforms","current","transformer","translateO","rx","ry","lmultiplyO","scaleO","scaleX","scaleY","skewO","skewX","skewY","shearO","shear","rotateO","theta","isFinite","px","py","dx","dy","tx","ty","compose","originX","originY","sx","sy","lam","rotate","translateX","translateY","decompose","determinant","ccw","sqrt","thetaRad","atan2","ct","cos","st","sin","multiply","matrixMultiply","lmultiply","inverseO","det","na","nb","nc","nd","ne","nf","translate","scale","flip","axis","around","flipO","lx","skew","tan","ly","skewXO","skewYO","aroundO","equals","other","valueOf","flipBoth","flipX","flipY","positionX","positionY","relative","relativeX","relativeY","ctm","getCTM","rect","getScreenCTM","subClassArray","Function","baseClass","_constructor","Arr","create","arr","List","each","fnOrMethodName","concat","reduce","obj","attrs","baseFind","query","querySelectorAll","find","EventTarget","type","j","defaultPrevented","fire","noop","timeline","duration","ease","delay","fill","stroke","opacity","offset","SVGArray","toSet","SVGNumber","value","unit","isNaN","toJSON","plus","number","minus","times","divide","hooks","registerAttrHook","attributes","nodeValue","last","curr","removeAttribute","getAttribute","defaults","_val","hook","leading","setAttributeNS","setAttribute","rebuild","Dom","childNodes","put","clear","hasChildNodes","removeChild","lastChild","_defs","writeDataToDom","cloneNode","deep","first","get","has","matches","selector","matchesSelector","msMatchesSelector","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","SVGElement","putIn","replaceChild","precision","factor","newAttrs","svgOrFn","outerHTML","well","len","fragment","_this","createDocumentFragment","firstElementChild","words","text","textContent","Svg","dom","hasAttribute","setData","center","inside","move","parents","until","sugar","prefix","extension","mat","angle","direction","directionString","dmove","radius","_element","getTotalLength","pointAt","getPointAtLength","font","ax","ay","amove","defineProperty","untransform","str","kv","reverse","toParent","pCtm","toRoot","decomposed","cleanRelative","Shape","Circle","circle","Container","flatten","ungroup","Defs","Ellipse","circled","ellipse","Stop","update","from","fx","fy","x1","y1","to","Gradient","stop","url","targets","gradiented","gradient","Pattern","pattern","patternUnits","Image","load","callback","img","src","image","PointArray","toLine","at","pos","destination","points","pop","maxX","maxY","minX","minY","MorphArray","Line","plot","pointed","line","Marker","ref","marker","isObject","require$$0","require$$1","require$$2","anObject","toPrimitive","IE8_DOM_DEFINE","dP","createDesc","global","aFunction","core","ctx","redefine","defined","fails","$export","toObject","makeSetterGetter","easing","bezier","steps","stepPosition","jumps","beforeFlag","step","floor","jumping","Stepper","done","Ease","Controller","stepper","target","dt","recalculate","_duration","overshoot","_overshoot","eps","pi","os","log","zeta","wn","Spring","velocity","acceleration","newPosition","PID","windup","integral","error","P","I","D","PathArray","pathRegReplace","arrayToString","pathHandlers","M","p0","L","H","V","C","S","Q","T","Z","A","mlhvqtcsaz","jl","equalCommands","pathArray","morph","sourceArray","destinationArray","paramCnt","Morphable","_stepper","_from","_to","_type","_context","_morphObj","_set","NonMorphable","morphableTypes","ObjectBag","complete","TransformBag","objOrArr","values","entries","sort","registerMorphableType","makeMorphable","Path","_array","Polygon","polygon","poly","Polyline","polyline","Rect","Queue","_first","_last","item","shift","Animator","nextDraw","frames","timeouts","timer","performance","Date","frame","run","requestAnimationFrame","_draw","transform_frame","timeout","time","now","cancelFrame","clearTimeout","nextTimeout","lastTimeout","nextFrame","lastFrame","makeSchedule","runnerInfo","start","runner","end","defaultSource","Timeline","timeSource","_timeSource","_startTime","_speed","_persist","_nextFrame","_paused","_runners","_order","_time","_lastSourceTime","_lastStepTime","_step","schedule","when","absoluteStartTime","endTime","getEndTime","unschedule","persist","updateTime","_continue","splice","lastRunnerInfo","lastDuration","lastStartTime","active","play","pause","finish","speed","yes","currentSpeed","positive","seek","dtOrForever","immediateStep","dtSource","dtTime","runnersLeft","dtToStart","reset","finished","_timeline","Runner","_queue","_isDeclarative","_history","enabled","_lastTime","_reseted","transformId","_haveReversed","_reverse","_loopsDone","_swing","_wait","_times","_prepareRunner","animate","sanitise","loop","swing","wait","queue","initFn","runFn","retargetFn","isTransform","initialiser","retarget","initialised","during","loops","loopDuration","loopsDone","relativeTime","whole","partial","swinging","backwards","uncliped","pow","clipped","swingForward","forwards","progress","running","_lastPosition","justStarted","justFinished","declarative","_initialise","converged","_run","_rememberMorpher","morpher","caller","_tryRetarget","needsIt","positionOrDt","allfinished","addTransform","clearTransform","clearTransformsFromQueue","FakeRunner","mergeWith","getRunnerTransform","mergeTransforms","runners","_transformationRunners","netTransform","_frameId","RunnerArray","ids","leftSibling","getByID","lastRunner","edit","newRunner","clearBefore","deleteCnt","frameId","_clearTransformRunnersBefore","currentRunner","_currentTransform","addRunner","styleAttr","zoom","level","affine","isMatrix","currentAngle","startTransform","setup","undefined","rTarget","rCurrent","possibilities","distances","shortest","affineParameters","newTransforms","_queueNumber","_queueNumberDelta","newTo","_queueObject","version","getElementsByTagName","nested","Symbol","symbol","plain","_build","createTextNode","getComputedTextLength","Text","_rebuild","firstLine","nodeType","newLined","build","tspan","newLine","self","blankLineOffset","fontSize","getComputedStyle","getPropertyValue","textable","Tspan","ClipPath","unclip","clip","clipWith","clipper","G","group","link","linkTo","Mask","unmask","mask","maskWith","masker","cssRule","rule","Style","addText","params","fontFamily","fontface","TextPath","track","textPath","txt","Use","file","use","SVG"],"mappings":";;;;;;;;;;;;;;AAAA,MAAMA,OAAO,GAAG,EAAhB;AACA,MAAMC,KAAK,GAAG,EAAd;AAEA,AAAO,SAASC,eAAT,CAA0BC,IAA1B,EAAgCC,CAAhC,EAAmC;MACpCC,KAAK,CAACC,OAAN,CAAcH,IAAd,CAAJ,EAAyB;SAClB,IAAII,KAAT,IAAkBJ,IAAlB,EAAwB;MACtBD,eAAe,CAACK,KAAD,EAAQH,CAAR,CAAf;;;;;;MAKA,OAAOD,IAAP,KAAgB,QAApB,EAA8B;SACvB,IAAII,KAAT,IAAkBJ,IAAlB,EAAwB;MACtBD,eAAe,CAACK,KAAD,EAAQJ,IAAI,CAACI,KAAD,CAAZ,CAAf;;;;;;EAKJC,cAAc,CAACC,MAAM,CAACC,IAAP,CAAYN,CAAZ,CAAD,CAAd;EACAJ,OAAO,CAACG,IAAD,CAAP,GAAgBM,MAAM,CAACE,MAAP,CAAcX,OAAO,CAACG,IAAD,CAAP,IAAiB,EAA/B,EAAmCC,CAAnC,CAAhB;;AAGF,AAAO,SAASQ,aAAT,CAAwBT,IAAxB,EAA8B;SAC5BH,OAAO,CAACG,IAAD,CAAP,IAAiB,EAAxB;;AAGF,AAAO,SAASU,cAAT,GAA2B;SACzB,CAAC,GAAG,IAAIC,GAAJ,CAAQb,KAAR,CAAJ,CAAP;;AAGF,AAAO,SAASO,cAAT,CAAyBO,MAAzB,EAAiC;EACtCd,KAAK,CAACe,IAAN,CAAW,GAAGD,MAAd;;;AC/BF;AACA,AAAO,SAASE,GAAT,CAAcC,KAAd,EAAqBC,KAArB,EAA4B;MAC7BC,CAAJ;MACIC,EAAE,GAAGH,KAAK,CAACI,MAAf;MACIC,MAAM,GAAG,EAAb;;OAEKH,CAAC,GAAG,CAAT,EAAYA,CAAC,GAAGC,EAAhB,EAA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F,MAAM,CAAC+Z,IAAD,EAAOpf,aAAa,CAAC,MAAD,CAApB,CAAN;AAEAqF,MAAM,CAAC,CACLovB,IADK,EAELc,KAFK,CAAD,EAGHv1B,aAAa,CAAC,OAAD,CAHV,CAAN;AAKAqF,MAAM,CAAC,CACLsjB,IADK,EAELtJ,OAFK,EAGLN,MAHK,EAILiB,QAJK,CAAD,EAKHhgB,aAAa,CAAC,QAAD,CALV,CAAN;AAOAqF,MAAM,CAACsS,WAAD,EAAc3X,aAAa,CAAC,aAAD,CAA3B,CAAN;AACAqF,MAAM,CAAC+U,GAAD,EAAMpa,aAAa,CAAC,KAAD,CAAnB,CAAN;AACAqF,MAAM,CAAC6L,OAAD,EAAUlR,aAAa,CAAC,SAAD,CAAvB,CAAN;AACAqF,MAAM,CAACyZ,KAAD,EAAQ9e,aAAa,CAAC,OAAD,CAArB,CAAN;;AAEAqF,MAAM,CAAC4Z,SAAD,EAAYjf,aAAa,CAAC,WAAD,CAAzB,CAAN;AAEAqF,MAAM,CAACooB,MAAD,EAASztB,aAAa,CAAC,QAAD,CAAtB,CAAN;AAEAgX,IAAI,CAAC3R,MAAL,CAAYpF,cAAc,EAA1B;AAEAioB,qBAAqB,CAAC,CACpBvP,SADoB,EAEpBhM,KAFoB,EAGpBqC,GAHoB,EAIpBgC,MAJoB,EAKpByH,QALoB,EAMpBsI,UANoB,EAOpB2E,SAPoB,CAAD,CAArB;AAUAyC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/src/utils/adopter.js b/src/utils/adopter.js index 5c1b0b6..a826607 100644 --- a/src/utils/adopter.js +++ b/src/utils/adopter.js @@ -67,7 +67,7 @@ export function adopt (node) { let adopter = adopt -export function mockAdopt(mock = adopt) { +export function mockAdopt (mock = adopt) { adopter = mock } -- cgit v1.2.3