From 865dbde1cae42adb7f0fa0bd2af1ffece69414b2 Mon Sep 17 00:00:00 2001 From: Durand D'souza Date: Sat, 12 May 2018 10:48:44 +0100 Subject: [PATCH] Added data for women candidates --- d3.imports.js | 3 +- d3.js | 721 +++++++++++++ d3.min.js | 12 +- mps_over_time.es5.js | 1015 +++++++++++++++---- mps_over_time.html | 14 +- mps_over_time.js | 14 +- mps_over_time.min.js | 2 +- number_women_house_candidates_over_time.csv | 15 + package.json | 1 + style.min.css | 2 +- style.scss | 4 +- 11 files changed, 1608 insertions(+), 195 deletions(-) create mode 100644 number_women_house_candidates_over_time.csv diff --git a/d3.imports.js b/d3.imports.js index a50e4a9..12b3739 100644 --- a/d3.imports.js +++ b/d3.imports.js @@ -1,7 +1,7 @@ export { queue } from "d3-queue" export { csv, json } from "d3-request" export { select, selectAll, selection, event, mouse } from "d3-selection" -export { scaleTime, scaleUtc, scaleLinear, scaleOrdinal, scalePoint, schemeCategory20 } from "d3-scale" +export { scaleTime, scaleUtc, scaleLinear, scaleOrdinal, scalePoint, scaleBand, schemeCategory20 } from "d3-scale" export { area, line, curveBasis, curveCardinal, curveBundle, curveLinear, stack } from "d3-shape" export { interpolate } from "d3-interpolate" export { axisTop, axisRight, axisBottom, axisLeft } from "d3-axis" @@ -16,3 +16,4 @@ export { quadtree } from "d3-quadtree" export { dispatch } from "d3-dispatch" export { timer, timeout } from "d3-timer" export * from "d3-svg-annotation" +export * from "intersection-observer" diff --git a/d3.js b/d3.js index 9dce763..58211cf 100644 --- a/d3.js +++ b/d3.js @@ -11904,6 +11904,726 @@ function annotation() { return annotation; } +/** + * Copyright 2016 Google Inc. All Rights Reserved. + * + * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE. + * + * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * + */ + +(function(window, document) { +if ('IntersectionObserver' in window && + 'IntersectionObserverEntry' in window && + 'intersectionRatio' in window.IntersectionObserverEntry.prototype) { + + // Minimal polyfill for Edge 15's lack of `isIntersecting` + // See: https://github.com/w3c/IntersectionObserver/issues/211 + if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) { + Object.defineProperty(window.IntersectionObserverEntry.prototype, + 'isIntersecting', { + get: function () { + return this.intersectionRatio > 0; + } + }); + } + return; +} + + +/** + * An IntersectionObserver registry. This registry exists to hold a strong + * reference to IntersectionObserver instances currently observering a target + * element. Without this registry, instances without another reference may be + * garbage collected. + */ +var registry = []; + + +/** + * Creates the global IntersectionObserverEntry constructor. + * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry + * @param {Object} entry A dictionary of instance properties. + * @constructor + */ +function IntersectionObserverEntry(entry) { + this.time = entry.time; + this.target = entry.target; + this.rootBounds = entry.rootBounds; + this.boundingClientRect = entry.boundingClientRect; + this.intersectionRect = entry.intersectionRect || getEmptyRect(); + this.isIntersecting = !!entry.intersectionRect; + + // Calculates the intersection ratio. + var targetRect = this.boundingClientRect; + var targetArea = targetRect.width * targetRect.height; + var intersectionRect = this.intersectionRect; + var intersectionArea = intersectionRect.width * intersectionRect.height; + + // Sets intersection ratio. + if (targetArea) { + this.intersectionRatio = intersectionArea / targetArea; + } else { + // If area is zero and is intersecting, sets to 1, otherwise to 0 + this.intersectionRatio = this.isIntersecting ? 1 : 0; + } +} + + +/** + * Creates the global IntersectionObserver constructor. + * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface + * @param {Function} callback The function to be invoked after intersection + * changes have queued. The function is not invoked if the queue has + * been emptied by calling the `takeRecords` method. + * @param {Object=} opt_options Optional configuration options. + * @constructor + */ +function IntersectionObserver(callback, opt_options) { + + var options = opt_options || {}; + + if (typeof callback != 'function') { + throw new Error('callback must be a function'); + } + + if (options.root && options.root.nodeType != 1) { + throw new Error('root must be an Element'); + } + + // Binds and throttles `this._checkForIntersections`. + this._checkForIntersections = throttle( + this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT); + + // Private properties. + this._callback = callback; + this._observationTargets = []; + this._queuedEntries = []; + this._rootMarginValues = this._parseRootMargin(options.rootMargin); + + // Public properties. + this.thresholds = this._initThresholds(options.threshold); + this.root = options.root || null; + this.rootMargin = this._rootMarginValues.map(function(margin) { + return margin.value + margin.unit; + }).join(' '); +} + + +/** + * The minimum interval within which the document will be checked for + * intersection changes. + */ +IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100; + + +/** + * The frequency in which the polyfill polls for intersection changes. + * this can be updated on a per instance basis and must be set prior to + * calling `observe` on the first target. + */ +IntersectionObserver.prototype.POLL_INTERVAL = null; + +/** + * Use a mutation observer on the root element + * to detect intersection changes. + */ +IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true; + + +/** + * Starts observing a target element for intersection changes based on + * the thresholds values. + * @param {Element} target The DOM element to observe. + */ +IntersectionObserver.prototype.observe = function(target) { + var isTargetAlreadyObserved = this._observationTargets.some(function(item) { + return item.element == target; + }); + + if (isTargetAlreadyObserved) { + return; + } + + if (!(target && target.nodeType == 1)) { + throw new Error('target must be an Element'); + } + + this._registerInstance(); + this._observationTargets.push({element: target, entry: null}); + this._monitorIntersections(); + this._checkForIntersections(); +}; + + +/** + * Stops observing a target element for intersection changes. + * @param {Element} target The DOM element to observe. + */ +IntersectionObserver.prototype.unobserve = function(target) { + this._observationTargets = + this._observationTargets.filter(function(item) { + + return item.element != target; + }); + if (!this._observationTargets.length) { + this._unmonitorIntersections(); + this._unregisterInstance(); + } +}; + + +/** + * Stops observing all target elements for intersection changes. + */ +IntersectionObserver.prototype.disconnect = function() { + this._observationTargets = []; + this._unmonitorIntersections(); + this._unregisterInstance(); +}; + + +/** + * Returns any queue entries that have not yet been reported to the + * callback and clears the queue. This can be used in conjunction with the + * callback to obtain the absolute most up-to-date intersection information. + * @return {Array} The currently queued entries. + */ +IntersectionObserver.prototype.takeRecords = function() { + var records = this._queuedEntries.slice(); + this._queuedEntries = []; + return records; +}; + + +/** + * Accepts the threshold value from the user configuration object and + * returns a sorted array of unique threshold values. If a value is not + * between 0 and 1 and error is thrown. + * @private + * @param {Array|number=} opt_threshold An optional threshold value or + * a list of threshold values, defaulting to [0]. + * @return {Array} A sorted list of unique and valid threshold values. + */ +IntersectionObserver.prototype._initThresholds = function(opt_threshold) { + var threshold = opt_threshold || [0]; + if (!Array.isArray(threshold)) threshold = [threshold]; + + return threshold.sort().filter(function(t, i, a) { + if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) { + throw new Error('threshold must be a number between 0 and 1 inclusively'); + } + return t !== a[i - 1]; + }); +}; + + +/** + * Accepts the rootMargin value from the user configuration object + * and returns an array of the four margin values as an object containing + * the value and unit properties. If any of the values are not properly + * formatted or use a unit other than px or %, and error is thrown. + * @private + * @param {string=} opt_rootMargin An optional rootMargin value, + * defaulting to '0px'. + * @return {Array} An array of margin objects with the keys + * value and unit. + */ +IntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) { + var marginString = opt_rootMargin || '0px'; + var margins = marginString.split(/\s+/).map(function(margin) { + var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin); + if (!parts) { + throw new Error('rootMargin must be specified in pixels or percent'); + } + return {value: parseFloat(parts[1]), unit: parts[2]}; + }); + + // Handles shorthand. + margins[1] = margins[1] || margins[0]; + margins[2] = margins[2] || margins[0]; + margins[3] = margins[3] || margins[1]; + + return margins; +}; + + +/** + * Starts polling for intersection changes if the polling is not already + * happening, and if the page's visibilty state is visible. + * @private + */ +IntersectionObserver.prototype._monitorIntersections = function() { + if (!this._monitoringIntersections) { + this._monitoringIntersections = true; + + // If a poll interval is set, use polling instead of listening to + // resize and scroll events or DOM mutations. + if (this.POLL_INTERVAL) { + this._monitoringInterval = setInterval( + this._checkForIntersections, this.POLL_INTERVAL); + } + else { + addEvent(window, 'resize', this._checkForIntersections, true); + addEvent(document, 'scroll', this._checkForIntersections, true); + + if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) { + this._domObserver = new MutationObserver(this._checkForIntersections); + this._domObserver.observe(document, { + attributes: true, + childList: true, + characterData: true, + subtree: true + }); + } + } + } +}; + + +/** + * Stops polling for intersection changes. + * @private + */ +IntersectionObserver.prototype._unmonitorIntersections = function() { + if (this._monitoringIntersections) { + this._monitoringIntersections = false; + + clearInterval(this._monitoringInterval); + this._monitoringInterval = null; + + removeEvent(window, 'resize', this._checkForIntersections, true); + removeEvent(document, 'scroll', this._checkForIntersections, true); + + if (this._domObserver) { + this._domObserver.disconnect(); + this._domObserver = null; + } + } +}; + + +/** + * Scans each observation target for intersection changes and adds them + * to the internal entries queue. If new entries are found, it + * schedules the callback to be invoked. + * @private + */ +IntersectionObserver.prototype._checkForIntersections = function() { + var rootIsInDom = this._rootIsInDom(); + var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect(); + + this._observationTargets.forEach(function(item) { + var target = item.element; + var targetRect = getBoundingClientRect(target); + var rootContainsTarget = this._rootContainsTarget(target); + var oldEntry = item.entry; + var intersectionRect = rootIsInDom && rootContainsTarget && + this._computeTargetAndRootIntersection(target, rootRect); + + var newEntry = item.entry = new IntersectionObserverEntry({ + time: now(), + target: target, + boundingClientRect: targetRect, + rootBounds: rootRect, + intersectionRect: intersectionRect + }); + + if (!oldEntry) { + this._queuedEntries.push(newEntry); + } else if (rootIsInDom && rootContainsTarget) { + // If the new entry intersection ratio has crossed any of the + // thresholds, add a new entry. + if (this._hasCrossedThreshold(oldEntry, newEntry)) { + this._queuedEntries.push(newEntry); + } + } else { + // If the root is not in the DOM or target is not contained within + // root but the previous entry for this target had an intersection, + // add a new record indicating removal. + if (oldEntry && oldEntry.isIntersecting) { + this._queuedEntries.push(newEntry); + } + } + }, this); + + if (this._queuedEntries.length) { + this._callback(this.takeRecords(), this); + } +}; + + +/** + * Accepts a target and root rect computes the intersection between then + * following the algorithm in the spec. + * TODO(philipwalton): at this time clip-path is not considered. + * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo + * @param {Element} target The target DOM element + * @param {Object} rootRect The bounding rect of the root after being + * expanded by the rootMargin value. + * @return {?Object} The final intersection rect object or undefined if no + * intersection is found. + * @private + */ +IntersectionObserver.prototype._computeTargetAndRootIntersection = + function(target, rootRect) { + + // If the element isn't displayed, an intersection can't happen. + if (window.getComputedStyle(target).display == 'none') return; + + var targetRect = getBoundingClientRect(target); + var intersectionRect = targetRect; + var parent = getParentNode(target); + var atRoot = false; + + while (!atRoot) { + var parentRect = null; + var parentComputedStyle = parent.nodeType == 1 ? + window.getComputedStyle(parent) : {}; + + // If the parent isn't displayed, an intersection can't happen. + if (parentComputedStyle.display == 'none') return; + + if (parent == this.root || parent == document) { + atRoot = true; + parentRect = rootRect; + } else { + // If the element has a non-visible overflow, and it's not the + // or element, update the intersection rect. + // Note: and cannot be clipped to a rect that's not also + // the document rect, so no need to compute a new intersection. + if (parent != document.body && + parent != document.documentElement && + parentComputedStyle.overflow != 'visible') { + parentRect = getBoundingClientRect(parent); + } + } + + // If either of the above conditionals set a new parentRect, + // calculate new intersection data. + if (parentRect) { + intersectionRect = computeRectIntersection(parentRect, intersectionRect); + + if (!intersectionRect) break; + } + parent = getParentNode(parent); + } + return intersectionRect; +}; + + +/** + * Returns the root rect after being expanded by the rootMargin value. + * @return {Object} The expanded root rect. + * @private + */ +IntersectionObserver.prototype._getRootRect = function() { + var rootRect; + if (this.root) { + rootRect = getBoundingClientRect(this.root); + } else { + // Use / instead of window since scroll bars affect size. + var html = document.documentElement; + var body = document.body; + rootRect = { + top: 0, + left: 0, + right: html.clientWidth || body.clientWidth, + width: html.clientWidth || body.clientWidth, + bottom: html.clientHeight || body.clientHeight, + height: html.clientHeight || body.clientHeight + }; + } + return this._expandRectByRootMargin(rootRect); +}; + + +/** + * Accepts a rect and expands it by the rootMargin value. + * @param {Object} rect The rect object to expand. + * @return {Object} The expanded rect. + * @private + */ +IntersectionObserver.prototype._expandRectByRootMargin = function(rect) { + var margins = this._rootMarginValues.map(function(margin, i) { + return margin.unit == 'px' ? margin.value : + margin.value * (i % 2 ? rect.width : rect.height) / 100; + }); + var newRect = { + top: rect.top - margins[0], + right: rect.right + margins[1], + bottom: rect.bottom + margins[2], + left: rect.left - margins[3] + }; + newRect.width = newRect.right - newRect.left; + newRect.height = newRect.bottom - newRect.top; + + return newRect; +}; + + +/** + * Accepts an old and new entry and returns true if at least one of the + * threshold values has been crossed. + * @param {?IntersectionObserverEntry} oldEntry The previous entry for a + * particular target element or null if no previous entry exists. + * @param {IntersectionObserverEntry} newEntry The current entry for a + * particular target element. + * @return {boolean} Returns true if a any threshold has been crossed. + * @private + */ +IntersectionObserver.prototype._hasCrossedThreshold = + function(oldEntry, newEntry) { + + // To make comparing easier, an entry that has a ratio of 0 + // but does not actually intersect is given a value of -1 + var oldRatio = oldEntry && oldEntry.isIntersecting ? + oldEntry.intersectionRatio || 0 : -1; + var newRatio = newEntry.isIntersecting ? + newEntry.intersectionRatio || 0 : -1; + + // Ignore unchanged ratios + if (oldRatio === newRatio) return; + + for (var i = 0; i < this.thresholds.length; i++) { + var threshold = this.thresholds[i]; + + // Return true if an entry matches a threshold or if the new ratio + // and the old ratio are on the opposite sides of a threshold. + if (threshold == oldRatio || threshold == newRatio || + threshold < oldRatio !== threshold < newRatio) { + return true; + } + } +}; + + +/** + * Returns whether or not the root element is an element and is in the DOM. + * @return {boolean} True if the root element is an element and is in the DOM. + * @private + */ +IntersectionObserver.prototype._rootIsInDom = function() { + return !this.root || containsDeep(document, this.root); +}; + + +/** + * Returns whether or not the target element is a child of root. + * @param {Element} target The target element to check. + * @return {boolean} True if the target element is a child of root. + * @private + */ +IntersectionObserver.prototype._rootContainsTarget = function(target) { + return containsDeep(this.root || document, target); +}; + + +/** + * Adds the instance to the global IntersectionObserver registry if it isn't + * already present. + * @private + */ +IntersectionObserver.prototype._registerInstance = function() { + if (registry.indexOf(this) < 0) { + registry.push(this); + } +}; + + +/** + * Removes the instance from the global IntersectionObserver registry. + * @private + */ +IntersectionObserver.prototype._unregisterInstance = function() { + var index = registry.indexOf(this); + if (index != -1) registry.splice(index, 1); +}; + + +/** + * Returns the result of the performance.now() method or null in browsers + * that don't support the API. + * @return {number} The elapsed time since the page was requested. + */ +function now() { + return window.performance && performance.now && performance.now(); +} + + +/** + * Throttles a function and delays its executiong, so it's only called at most + * once within a given time period. + * @param {Function} fn The function to throttle. + * @param {number} timeout The amount of time that must pass before the + * function can be called again. + * @return {Function} The throttled function. + */ +function throttle(fn, timeout) { + var timer = null; + return function () { + if (!timer) { + timer = setTimeout(function() { + fn(); + timer = null; + }, timeout); + } + }; +} + + +/** + * Adds an event handler to a DOM node ensuring cross-browser compatibility. + * @param {Node} node The DOM node to add the event handler to. + * @param {string} event The event name. + * @param {Function} fn The event handler to add. + * @param {boolean} opt_useCapture Optionally adds the even to the capture + * phase. Note: this only works in modern browsers. + */ +function addEvent(node, event, fn, opt_useCapture) { + if (typeof node.addEventListener == 'function') { + node.addEventListener(event, fn, opt_useCapture || false); + } + else if (typeof node.attachEvent == 'function') { + node.attachEvent('on' + event, fn); + } +} + + +/** + * Removes a previously added event handler from a DOM node. + * @param {Node} node The DOM node to remove the event handler from. + * @param {string} event The event name. + * @param {Function} fn The event handler to remove. + * @param {boolean} opt_useCapture If the event handler was added with this + * flag set to true, it should be set to true here in order to remove it. + */ +function removeEvent(node, event, fn, opt_useCapture) { + if (typeof node.removeEventListener == 'function') { + node.removeEventListener(event, fn, opt_useCapture || false); + } + else if (typeof node.detatchEvent == 'function') { + node.detatchEvent('on' + event, fn); + } +} + + +/** + * Returns the intersection between two rect objects. + * @param {Object} rect1 The first rect. + * @param {Object} rect2 The second rect. + * @return {?Object} The intersection rect or undefined if no intersection + * is found. + */ +function computeRectIntersection(rect1, rect2) { + var top = Math.max(rect1.top, rect2.top); + var bottom = Math.min(rect1.bottom, rect2.bottom); + var left = Math.max(rect1.left, rect2.left); + var right = Math.min(rect1.right, rect2.right); + var width = right - left; + var height = bottom - top; + + return (width >= 0 && height >= 0) && { + top: top, + bottom: bottom, + left: left, + right: right, + width: width, + height: height + }; +} + + +/** + * Shims the native getBoundingClientRect for compatibility with older IE. + * @param {Element} el The element whose bounding rect to get. + * @return {Object} The (possibly shimmed) rect of the element. + */ +function getBoundingClientRect(el) { + var rect; + + try { + rect = el.getBoundingClientRect(); + } catch (err) { + // Ignore Windows 7 IE11 "Unspecified error" + // https://github.com/w3c/IntersectionObserver/pull/205 + } + + if (!rect) return getEmptyRect(); + + // Older IE + if (!(rect.width && rect.height)) { + rect = { + top: rect.top, + right: rect.right, + bottom: rect.bottom, + left: rect.left, + width: rect.right - rect.left, + height: rect.bottom - rect.top + }; + } + return rect; +} + + +/** + * Returns an empty rect object. An empty rect is returned when an element + * is not in the DOM. + * @return {Object} The empty rect. + */ +function getEmptyRect() { + return { + top: 0, + bottom: 0, + left: 0, + right: 0, + width: 0, + height: 0 + }; +} + +/** + * Checks to see if a parent element contains a child elemnt (including inside + * shadow DOM). + * @param {Node} parent The parent element. + * @param {Node} child The child element. + * @return {boolean} True if the parent node contains the child node. + */ +function containsDeep(parent, child) { + var node = child; + while (node) { + if (node == parent) return true; + + node = getParentNode(node); + } + return false; +} + + +/** + * Gets the parent node of an element or its host element if the parent node + * is a shadow root. + * @param {Node} node The node whose parent to get. + * @return {Node|null} The parent node or null if no parent exists. + */ +function getParentNode(node) { + var parent = node.parentNode; + + if (parent && parent.nodeType == 11 && parent.host) { + // If the parent is a shadow root, return the host element. + return parent.host; + } + return parent; +} + + +// Exposes the constructors globally. +window.IntersectionObserver = IntersectionObserver; +window.IntersectionObserverEntry = IntersectionObserverEntry; + +}(window, document)); + exports.queue = queue; exports.csv = csv; exports.json = json; @@ -11916,6 +12636,7 @@ exports.scaleUtc = utcTime; exports.scaleLinear = linear; exports.scaleOrdinal = ordinal; exports.scalePoint = point$1; +exports.scaleBand = band; exports.schemeCategory20 = category20; exports.area = area; exports.line = line; diff --git a/d3.min.js b/d3.min.js index 0da280a..1390201 100644 --- a/d3.min.js +++ b/d3.min.js @@ -1,6 +1,6 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3={})}(this,function(t){"use strict";function n(t){this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function e(t){if(!t._start)try{r(t)}catch(n){if(t._tasks[t._ended+t._active-1])o(t,n);else if(!t._data)throw n}}function r(t){for(;t._start=t._waiting&&t._active=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,a(t)}function a(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function u(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new n(t)}function s(){}function c(t,n){var e=new s;if(t instanceof s)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function v(t,n){for(var e,r=0,i=t.length;r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function j(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function q(t){return function(){this.removeAttribute(t)}}function Y(t){return function(){this.removeAttributeNS(t.space,t.local)}}function I(t,n){return function(){this.setAttribute(t,n)}}function F(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function X(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function B(t){return function(){this.style.removeProperty(t)}}function V(t,n,e){return function(){this.style.setProperty(t,n,e)}}function $(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function W(t,n){return t.style.getPropertyValue(n)||mu(t).getComputedStyle(t,null).getPropertyValue(n)}function Z(t){return function(){delete this[t]}}function J(t,n){return function(){this[t]=n}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Q(t){return t.trim().split(/^|\s+/)}function K(t){return t.classList||new tt(t)}function tt(t){this._node=t,this._names=Q(t.getAttribute("class")||"")}function nt(t,n){for(var e=K(t),r=-1,i=n.length;++r=0?(o>=Vu?10:o>=$u?5:o>=Wu?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Vu?10:o>=$u?5:o>=Wu?2:1)}function Mt(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Vu?i*=10:o>=$u?i*=5:o>=Wu&&(i*=2),n>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=ss.exec(t))?Et(parseInt(n[1],16)):(n=cs.exec(t))?new Ut(n[1],n[2],n[3],1):(n=fs.exec(t))?new Ut(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=ls.exec(t))?Pt(n[1],n[2],n[3],n[4]):(n=hs.exec(t))?Pt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=ds.exec(t))?Lt(n[1],n[2]/100,n[3]/100,1):(n=ps.exec(t))?Lt(n[1],n[2]/100,n[3]/100,n[4]):ys.hasOwnProperty(t)?Et(ys[t]):"transparent"===t?new Ut(NaN,NaN,NaN,0):null}function Et(t){return new Ut(t>>16&255,t>>8&255,255&t,1)}function Pt(t,n,e,r){return r<=0&&(t=n=e=NaN),new Ut(t,n,e,r)}function Ot(t){return t instanceof St||(t=jt(t)),t?(t=t.rgb(),new Ut(t.r,t.g,t.b,t.opacity)):new Ut}function Dt(t,n,e,r){return 1===arguments.length?Ot(t):new Ut(t,n,e,null==r?1:r)}function Ut(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Lt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new qt(t,n,e,r)}function zt(t){if(t instanceof qt)return new qt(t.h,t.s,t.l,t.opacity);if(t instanceof St||(t=jt(t)),!t)return new qt;if(t instanceof qt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&s<1?0:a,new qt(a,u,s,t.opacity)}function Rt(t,n,e,r){return 1===arguments.length?zt(t):new qt(t,n,e,null==r?1:r)}function qt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Yt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function It(t){if(t instanceof Ht)return new Ht(t.l,t.a,t.b,t.opacity);if(t instanceof Jt){var n=t.h*_s;return new Ht(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof Ut||(t=Ot(t));var e=$t(t.r),r=$t(t.g),i=$t(t.b),o=Xt((.4124564*e+.3575761*r+.1804375*i)/gs),a=Xt((.2126729*e+.7151522*r+.072175*i)/ms);return new Ht(116*a-16,500*(o-a),200*(a-Xt((.0193339*e+.119192*r+.9503041*i)/bs)),t.opacity)}function Ft(t,n,e,r){return 1===arguments.length?It(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Xt(t){return t>ks?Math.pow(t,1/3):t/Ms+xs}function Bt(t){return t>ws?t*t*t:Ms*(t-xs)}function Vt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $t(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Wt(t){if(t instanceof Jt)return new Jt(t.h,t.c,t.l,t.opacity);t instanceof Ht||(t=It(t));var n=Math.atan2(t.b,t.a)*vs;return new Jt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Zt(t,n,e,r){return 1===arguments.length?Wt(t):new Jt(t,n,e,null==r?1:r)}function Jt(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Gt(t){if(t instanceof Kt)return new Kt(t.h,t.s,t.l,t.opacity);t instanceof Ut||(t=Ot(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Ps*r+js*n-Es*e)/(Ps+js-Es),o=r-i,a=(Ss*(e-i)-Cs*o)/As,u=Math.sqrt(a*a+o*o)/(Ss*i*(1-i)),s=u?Math.atan2(a,o)*vs-120:NaN;return new Kt(s<0?s+360:s,u,i,t.opacity)}function Qt(t,n,e,r){return 1===arguments.length?Gt(t):new Kt(t,n,e,null==r?1:r)}function Kt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function tn(t,n){return function(e){return t+e*n}}function nn(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function en(t,n){var e=n-t;return e?tn(t,e>180||e<-180?e-360*Math.round(e/360):e):zs(isNaN(t)?n:t)}function rn(t){return 1==(t=+t)?on:function(n,e){return e-n?nn(n,e,t):zs(isNaN(n)?e:n)}}function on(t,n){var e=n-t;return e?tn(t,e):zs(isNaN(t)?n:t)}function an(t){return function(){return t}}function un(t){return function(n){return t(n)+""}}function sn(t){return"none"===t?Zs:(Os||(Os=document.createElement("DIV"),Ds=document.documentElement,Us=document.defaultView),Os.style.transform=t,t=Us.getComputedStyle(Ds.appendChild(Os),null).getPropertyValue("transform"),Ds.removeChild(Os),t=t.slice(7,-1).split(","),Js(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function cn(t){return null==t?Zs:(Ls||(Ls=document.createElementNS("http://www.w3.org/2000/svg","g")),Ls.setAttribute("transform",t),(t=Ls.transform.baseVal.consolidate())?(t=t.matrix,Js(t.a,t.b,t.c,t.d,t.e,t.f)):Zs)}function fn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,n,null,e);u.push({i:s-4,x:Is(t,i)},{i:s-2,x:Is(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}function a(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Is(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function u(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Is(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function s(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Is(t,e)},{i:u-2,x:Is(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),a(n.rotate,e.rotate,r,i),u(n.skewX,e.skewX,r,i),s(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e=e?1:r(t)}}}function vn(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function gn(t,n,e,r){var i=t[0],o=t[1],a=n[0],u=n[1];return o2?mn:gn,o=a=null,r}function r(n){return(o||(o=i(u,s,f?_n(t):t,c)))(+n)}var i,o,a,u=oc,s=oc,c=Vs,f=!1;return r.invert=function(t){return(a||(a=i(s,u,yn,f?vn(n):n)))(+t)},r.domain=function(t){return arguments.length?(u=ts.call(t,ic),e()):u.slice()},r.range=function(t){return arguments.length?(s=ns.call(t),e()):s.slice()},r.rangeRound=function(t){return s=ns.call(t),c=$s,e()},r.clamp=function(t){return arguments.length?(f=!!t,e()):f},r.interpolate=function(t){return arguments.length?(c=t,e()):c},e()}function wn(t){if(!(n=dc.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],u=n[6]&&+n[6],s=!!n[7],c=n[8]&&+n[8].slice(1),f=n[9]||"";"n"===f?(s=!0,f="g"):hc[f]||(f=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=u,this.comma=s,this.precision=c,this.type=f}function Mn(t){return t}function kn(t){var n=t.domain;return t.ticks=function(t){var e=n();return Zu(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Mc(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],s=i[a];return s0?(u=Math.floor(u/r)*r,s=Math.ceil(s/r)*r,r=wt(u,s,e)):r<0&&(u=Math.ceil(u*r)/r,s=Math.floor(s*r)/r,r=wt(u,s,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(s/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(s*r)/r,n(i)),t},t}function Nn(){var t=xn(yn,Is);return t.copy=function(){return bn(t,Nn())},kn(t)}function Tn(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(new Date(+e))}while(n(e,o),t(e),e=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return Nc.setTime(+n),Tc.setTime(+r),t(Nc),t(Tc),Math.floor(e(Nc,Tc))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}function Cn(t){return Tn(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ac)/Sc})}function An(t){return Tn(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Sc})}function Sn(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function jn(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function En(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function Pn(t){function n(t,n){return function(e){var r,i,o,a=[],u=-1,s=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in a||(a.w=1),"Z"in a?(i=jn(En(a.y)),o=i.getUTCDay(),i=o>4||0===o?Hc.ceil(i):Hc(i),i=Ic.offset(i,7*(a.V-1)),a.y=i.getUTCFullYear(),a.m=i.getUTCMonth(),a.d=i.getUTCDate()+(a.w+6)%7):(i=n(En(a.y)),o=i.getDay(),i=o>4||0===o?Uc.ceil(i):Uc(i),i=Oc.offset(i,7*(a.V-1)),a.y=i.getFullYear(),a.m=i.getMonth(),a.d=i.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?jn(En(a.y)).getUTCDay():n(En(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,jn(a)):n(a)}}function r(t,n,e,r){for(var i,o,a=0,u=n.length,s=e.length;a=s)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=F[i in Jc?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=j.exec(n.slice(e));return r?(t.p=E[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=D.exec(n.slice(e));return r?(t.w=U[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=P.exec(n.slice(e));return r?(t.w=O[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=R.exec(n.slice(e));return r?(t.m=q[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=L.exec(n.slice(e));return r?(t.m=z[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){return r(t,w,n,e)}function f(t,n,e){return r(t,M,n,e)}function l(t,n,e){return r(t,k,n,e)}function h(t){return C[t.getDay()]}function d(t){return T[t.getDay()]}function p(t){return S[t.getMonth()]}function y(t){return A[t.getMonth()]}function _(t){return N[+(t.getHours()>=12)]}function v(t){return C[t.getUTCDay()]}function g(t){return T[t.getUTCDay()]}function m(t){return S[t.getUTCMonth()]}function b(t){return A[t.getUTCMonth()]}function x(t){return N[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,k=t.time,N=t.periods,T=t.days,C=t.shortDays,A=t.months,S=t.shortMonths,j=Un(N),E=Ln(N),P=Un(T),O=Ln(T),D=Un(C),U=Ln(C),L=Un(A),z=Ln(A),R=Un(S),q=Ln(S),Y={a:h,A:d,b:p,B:y,c:null,d:ee,e:ee,f:ue,H:re,I:ie,j:oe,L:ae,m:se,M:ce,p:_,Q:ze,s:Re,S:fe,u:le,U:he,V:de,w:pe,W:ye,x:null,X:null,y:_e,Y:ve,Z:ge,"%":Le},I={a:v,A:g,b:m,B:b,c:null,d:me,e:me,f:ke,H:be,I:xe,j:we,L:Me,m:Ne,M:Te,p:x,Q:ze,s:Re,S:Ce,u:Ae,U:Se,V:je,w:Ee,W:Pe,x:null,X:null,y:Oe,Y:De,Z:Ue,"%":Le},F={a:o,A:a,b:u,B:s,c:c,d:Vn,e:Vn,f:Qn,H:Wn,I:Wn,j:$n,L:Gn,m:Bn,M:Zn,p:i,Q:te,s:ne,S:Jn,u:Rn,U:qn,V:Yn,w:zn,W:In,x:f,X:l,y:Hn,Y:Fn,Z:Xn,"%":Kn};return Y.x=n(M,Y),Y.X=n(k,Y),Y.c=n(w,Y),I.x=n(M,I),I.X=n(k,I),I.c=n(w,I),{format:function(t){var e=n(t+="",Y);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",Sn);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",I);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,jn);return n.toString=function(){return t},n}}}function On(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Xn(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Bn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Vn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function $n(t,n,e){var r=Gc.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Wn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Zn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Jn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Gn(t,n,e){var r=Gc.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Qn(t,n,e){var r=Gc.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Kn(t,n,e){var r=Qc.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function te(t,n,e){var r=Gc.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function ne(t,n,e){var r=Gc.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function ee(t,n){return On(t.getDate(),n,2)}function re(t,n){return On(t.getHours(),n,2)}function ie(t,n){return On(t.getHours()%12||12,n,2)}function oe(t,n){return On(1+Oc.count(Rc(t),t),n,3)}function ae(t,n){return On(t.getMilliseconds(),n,3)}function ue(t,n){return ae(t,n)+"000"}function se(t,n){return On(t.getMonth()+1,n,2)}function ce(t,n){return On(t.getMinutes(),n,2)}function fe(t,n){return On(t.getSeconds(),n,2)}function le(t){var n=t.getDay();return 0===n?7:n}function he(t,n){return On(Dc.count(Rc(t),t),n,2)}function de(t,n){var e=t.getDay();return t=e>=4||0===e?Lc(t):Lc.ceil(t),On(Lc.count(Rc(t),t)+(4===Rc(t).getDay()),n,2)}function pe(t){return t.getDay()}function ye(t,n){return On(Uc.count(Rc(t),t),n,2)}function _e(t,n){return On(t.getFullYear()%100,n,2)}function ve(t,n){return On(t.getFullYear()%1e4,n,4)}function ge(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+On(n/60|0,"0",2)+On(n%60,"0",2)}function me(t,n){return On(t.getUTCDate(),n,2)}function be(t,n){return On(t.getUTCHours(),n,2)}function xe(t,n){return On(t.getUTCHours()%12||12,n,2)}function we(t,n){return On(1+Ic.count(Vc(t),t),n,3)}function Me(t,n){return On(t.getUTCMilliseconds(),n,3)}function ke(t,n){return Me(t,n)+"000"}function Ne(t,n){return On(t.getUTCMonth()+1,n,2)}function Te(t,n){return On(t.getUTCMinutes(),n,2)}function Ce(t,n){return On(t.getUTCSeconds(),n,2)}function Ae(t){var n=t.getUTCDay();return 0===n?7:n}function Se(t,n){return On(Fc.count(Vc(t),t),n,2)}function je(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Xc(t):Xc.ceil(t),On(Xc.count(Vc(t),t)+(4===Vc(t).getUTCDay()),n,2)}function Ee(t){return t.getUTCDay()}function Pe(t,n){return On(Hc.count(Vc(t),t),n,2)}function Oe(t,n){return On(t.getUTCFullYear()%100,n,2)}function De(t,n){return On(t.getUTCFullYear()%1e4,n,4)}function Ue(){return"+0000"}function Le(){return"%"}function ze(t){return+t}function Re(t){return Math.floor(+t/1e3)}function qe(t){return t.toISOString()}function Ye(t){var n=new Date(t);return isNaN(n)?null:n}function Ie(t){return new Date(t)}function Fe(t){return t instanceof Date?+t:+new Date(+t)}function He(t,n,e,r,i,o,a,u,s){function c(u){return(a(u)=0&&n._call.call(null,t),n=n._next;--qf}function jr(){Xf=(Hf=Vf.now())+Bf,qf=Yf=0;try{Sr()}finally{qf=0,Pr(),Xf=0}}function Er(){var t=Vf.now(),n=t-Hf;n>Ff&&(Bf-=n,Hf=t)}function Pr(){for(var t,n,e=Lf,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Lf=n);zf=t,Or(r)}function Or(t){if(!qf){Yf&&(Yf=clearTimeout(Yf));var n=t-Xf;n>24?(t<1/0&&(Yf=setTimeout(jr,n)),If&&(If=clearInterval(If))):(If||(If=setInterval(Er,Ff)),qf=1,$f(jr))}}function Dr(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Gf)throw new Error("too late");return e}function Ur(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Kf)throw new Error("too late");return e}function Lr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function zr(t,n,e){function r(t){e.state=Qf,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var c,f,l,h;if(e.state!==Qf)return a();for(c in s)if(h=s[c],h.name===e.name){if(h.state===tl)return Wf(i);h.state===nl?(h.state=rl,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete s[c]):+c=0&&(t=t.slice(0,n)),!t||"start"===t})}function ni(t,n,e){var r,i,o=ti(n)?Dr:Ur;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}function ei(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function ri(t,n){var e,r,i;return function(){var o=W(this,t),a=(this.style.removeProperty(t),W(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}function ii(t){return function(){this.style.removeProperty(t)}}function oi(t,n,e){var r,i;return function(){var o=W(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}function ai(t,n,e){var r,i,o;return function(){var a=W(this,t),u=e(this);return null==u&&(this.style.removeProperty(t),u=W(this,t)),a===u?null:a===r&&u===i?o:o=n(r=a,i=u)}}function ui(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function si(t){return function(){this.textContent=t}}function ci(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function fi(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function li(t){return bt().transition(t)}function hi(){return++Tl}function di(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function pi(t){return(t=+t)r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Ni(t){return t[0]}function Ti(t){return t[1]}function Ci(){this._=null}function Ai(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Si(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ji(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function Ei(t){for(;t.L;)t=t.L;return t}function Pi(t,n,e,r){var i=[null,null],o=Zl.push(i)-1;return i.left=t,i.right=n,e&&Di(i,t,n,e),r&&Di(i,n,t,r),$l[t.index].halfedges.push(o),$l[n.index].halfedges.push(o),i}function Oi(t,n,e){var r=[n,e];return r.left=t,r}function Di(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Ui(t,n,e,r,i){var o,a=t[0],u=t[1],s=a[0],c=a[1],f=u[0],l=u[1],h=0,d=1,p=f-s,y=l-c;if(o=n-s,p||!(o>0)){if(o/=p,p<0){if(o0){if(o>d)return;o>h&&(h=o)}if(o=r-s,p||!(o<0)){if(o/=p,p<0){if(o>d)return;o>h&&(h=o)}else if(p>0){if(o0)){if(o/=y,y<0){if(o0){if(o>d)return;o>h&&(h=o)}if(o=i-c,y||!(o<0)){if(o/=y,y<0){if(o>d)return;o>h&&(h=o)}else if(y>0){if(o0||d<1)||(h>0&&(t[0]=[s+h*p,c+h*y]),d<1&&(t[1]=[s+d*p,c+d*y]),!0)}}}}}function Li(t,n,e,r,i){var o=t[1];if(o)return!0;var a,u,s=t[0],c=t.left,f=t.right,l=c[0],h=c[1],d=f[0],p=f[1],y=(l+d)/2,_=(h+p)/2;if(p===h){if(y=r)return;if(l>d){if(s){if(s[1]>=i)return}else s=[y,e];o=[y,i]}else{if(s){if(s[1]1)if(l>d){if(s){if(s[1]>=i)return}else s=[(e-u)/a,e];o=[(i-u)/a,i]}else{if(s){if(s[1]=r)return}else s=[n,a*n+u];o=[r,a*r+u]}else{if(s){if(s[0]Ql||Math.abs(i[0][1]-i[1][1])>Ql)||delete Zl[o]}function Ri(t){return $l[t.index]={site:t,halfedges:[]}}function qi(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function Yi(t,n){return n[+(n.left!==t.site)]}function Ii(t,n){return n[+(n.left===t.site)]}function Fi(){for(var t,n,e,r,i=0,o=$l.length;iQl||Math.abs(y-h)>Ql)&&(s.splice(u,0,Zl.push(Oi(a,d,Math.abs(p-t)Ql?[t,Math.abs(l-t)Ql?[Math.abs(h-r)Ql?[e,Math.abs(l-e)Ql?[Math.abs(h-n)=-Kl)){var d=s*s+c*c,p=f*f+l*l,y=(l*d-c*p)/h,_=(s*p-f*d)/h,v=Jl.pop()||new Xi;v.arc=t,v.site=i,v.x=y+a,v.y=(v.cy=_+u)+Math.sqrt(y*y+_*_),t.circle=v;for(var g=null,m=Wl._;m;)if(v.yQl)u=u.L;else{if(!((i=o-Ki(u,a))>Ql)){r>-Ql?(n=u.P,e=u):i>-Ql?(n=u,e=u.N):n=e=u;break}if(!u.R){n=u;break}u=u.R}Ri(t);var s=Wi(t);if(Vl.insert(n,s),n||e){if(n===e)return Vi(n),e=Wi(n.site),Vl.insert(s,e),s.edge=e.edge=Pi(n.site,s.site),Bi(n),void Bi(e);if(!e)return void(s.edge=Pi(n.site,s.site));Vi(n),Vi(e);var c=n.site,f=c[0],l=c[1],h=t[0]-f,d=t[1]-l,p=e.site,y=p[0]-f,_=p[1]-l,v=2*(h*_-d*y),g=h*h+d*d,m=y*y+_*_,b=[(_*g-d*m)/v+f,(h*m-y*g)/v+l];Di(e.edge,c,p,b),s.edge=Pi(c,t,null,b),e.edge=Pi(t,p,null,b),Bi(n),Bi(e)}}function Qi(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-1/0;e=a.site;var u=e[0],s=e[1],c=s-n;if(!c)return u;var f=u-r,l=1/o-1/c,h=f/c;return l?(-h+Math.sqrt(h*h-2*l*(f*f/(-2*c)-s+c/2+i-o/2)))/l+r:(r+u)/2}function Ki(t,n){var e=t.N;if(e)return Qi(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function to(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function no(t,n){return n[1]-t[1]||n[0]-t[0]}function eo(t,n){var e,r,i,o=t.sort(no).pop();for(Zl=[],$l=new Array(t.length),Vl=new Ci,Wl=new Ci;;)if(i=Bl,o&&(!i||o[1]=(o=(y+v)/2))?y=o:v=o,(f=e>=(a=(_+g)/2))?_=a:g=a,i=d,!(d=d[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),n===u&&e===s)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=n>=(o=(y+v)/2))?y=o:v=o,(f=e>=(a=(_+g)/2))?_=a:g=a}while((l=f<<1|c)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function io(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(e=0;ef&&(f=r),il&&(l=i));for(f=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function vo(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function No(t){return function(){this.removeAttribute(t)}}function To(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Co(t,n){return function(){this.setAttribute(t,n)}}function Ao(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function So(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function jo(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function Eo(t){return function(){this.style.removeProperty(t)}}function Po(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Oo(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Do(t){return function(){delete this[t]}}function Uo(t,n){return function(){this[t]=n}}function Lo(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function zo(t){return t.trim().split(/^|\s+/)}function Ro(t){return t.classList||new qo(t)}function qo(t){this._node=t,this._names=zo(t.getAttribute("class")||"")}function Yo(t,n){for(var e=Ro(t),r=-1,i=n.length;++r=1?ld:t<=-1?-ld:Math.asin(t)}function ha(t,n,e,r,i,o,a,u){var s=e-t,c=r-n,f=a-i,l=u-o,h=(f*(n-o)-l*(t-i))/(l*s-f*c);return[t+h*s,n+h*c]}function da(t,n,e,r,i,o,a){var u=t-e,s=n-r,c=(a?o:-o)/Math.sqrt(u*u+s*s),f=c*s,l=-c*u,h=t+f,d=n+l,p=e+f,y=r+l,_=(h+p)/2,v=(d+y)/2,g=p-h,m=y-d,b=g*g+m*m,x=i-o,w=h*y-p*d,M=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-w*w)),k=(w*m-g*M)/b,N=(-w*g-m*M)/b,T=(w*m+g*M)/b,C=(-w*g+m*M)/b,A=k-_,S=N-v,j=T-_,E=C-v;return A*A+S*S>j*j+E*E&&(k=T,N=C),{cx:k,cy:N,x01:-f,y01:-l,x11:k*(i/x-1),y11:N*(i/x-1)}}function pa(t){this._context=t}function ya(t){return t[0]}function _a(t){return t[1]}function va(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function ga(t,n){this._context=t,this._k=(1-n)/6}function ma(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>cd){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>cd){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/f,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/f}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function ba(t,n){this._context=t,this._alpha=n}function xa(t){return t<0?-1:1}function wa(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(xa(o)+xa(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Ma(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function ka(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function Na(t){this._context=t}function Ta(t){this._context=new Ca(t)}function Ca(t){this._context=t}function Aa(){var t=[],n=void 0,e=void 0,r=[],i={},o={},a=!1,u=void 0,s=Kd,c=void 0,f=void 0,l=p("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),h=void 0,d=function(e){h=e,a||e.selectAll("circle.handle").remove();var d=t.map(function(t){return t.type||(t.type=s),t.disable||(t.disable=r),new kd(t)});n=n||new Nd({annotations:d,accessors:i,accessorsInverse:o,ids:u}),e.selectAll("g").data([n]).enter().append("g").attr("class","annotations");var p=e.select("g.annotations");up(p,n.annotations,"g","annotation"),p.selectAll("g.annotation").each(function(t){var n=ud(this);n.attr("class","annotation"),up(n,[t],"g","annotation-connector"),up(n,[t],"g","annotation-subject"),up(n,[t],"g","annotation-note"),up(n.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:n,annotation:t,textWrap:c,notePadding:f,editMode:a,dispatcher:l,accessors:i}),t.type.draw(),t.type.drawText&&t.type.drawText()})};return d.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",n.json),window.copy(JSON.stringify(n.json.map(function(t){return delete t.type,t}))),d},d.update=function(){return t&&n&&(t=n.annotations.map(function(t){return t.type.draw(),t})),d},d.updateText=function(){return n&&(n.updateText(c),t=n.annotations),d},d.updatedAccessors=function(){return n.setPositionWithAccessors(),t=n.annotations,d},d.disable=function(e){return arguments.length?(r=e,n&&(n.updateDisable(r),t=n.annotations),d):r},d.textWrap=function(e){return arguments.length?(c=e,n&&(n.updateTextWrap(c),t=n.annotations),d):c},d.notePadding=function(e){return arguments.length?(f=e,n&&(n.updateNotePadding(f),t=n.annotations),d):f},d.type=function(e,r){return arguments.length?(s=e,n&&(n.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=s,t.subject=r&&r.subject||t.subject,t.connector=r&&r.connector||t.connector,t.note=r&&r.note||t.note}),t=n.annotations),d):s},d.annotations=function(e){if(!arguments.length)return n&&n.annotations||t;if(t=e,n&&n.annotations){t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(n=null,d(h)):n.annotations=t}return d},d.context=function(t){return arguments.length?(e=t,d):e},d.accessors=function(t){return arguments.length?(i=t,d):i},d.accessorsInverse=function(t){return arguments.length?(o=t,d):o},d.ids=function(t){return arguments.length?(u=t,d):u},d.editMode=function(e){return arguments.length?(a=e,h&&h.selectAll("g.annotation").classed("editable",a),n&&(n.editMode(a),t=n.annotations),d):a},d.collection=function(t){return arguments.length?(n=t,d):n},d.on=function(){var t=l.on.apply(l,arguments);return t===l?d:t},d}var Sa=[].slice,ja={};n.prototype=u.prototype={constructor:n,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=Sa.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),e(this),this},abort:function(){return null==this._error&&o(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},a(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,a(this),this}};s.prototype=c.prototype={constructor:s,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var Ea=function(){function t(n,i,a,u){if(i>=o.length)return null!=e&&n.sort(e),null!=r?r(n):n;for(var s,f,l,h=-1,d=n.length,p=o[i++],y=c(),_=a();++ho.length)return t;var i,u=a[e-1];return null!=r&&e>=o.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=u?i.sort(function(t,n){return u(t.key,n.key)}):i}var e,r,i,o=[],a=[];return i={object:function(n){return t(n,0,f,l)},map:function(n){return t(n,0,h,d)},entries:function(e){return n(t(e,0,h,d),0)},key:function(t){return o.push(t),i},sortKeys:function(t){return a[o.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}},Pa={value:function(){}};y.prototype=p.prototype={constructor:y,on:function(t,n){var e,r=this._,i=_(t+"",r),o=-1,a=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),o=0;o=200&&e<300||304===e){if(o)try{n=o.call(r,f)}catch(t){return void u.call("error",r,t)}else n=f;u.call("load",r,n)}else u.call("error",r,t)}var r,i,o,a,u=p("beforesend","progress","load","error"),s=c(),f=new XMLHttpRequest,l=null,h=null,d=0;if("undefined"==typeof XDomainRequest||"withCredentials"in f||!/^(http(s)?:)?\/\//.test(t)||(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=f.ontimeout=e:f.onreadystatechange=function(t){f.readyState>3&&e(t)},f.onprogress=function(t){u.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?s.get(t):(null==n?s.remove(t):s.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(a=t,r):a},timeout:function(t){return arguments.length?(d=+t,r):d},user:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},password:function(t){return arguments.length<1?h:(h=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return f.open(n,t,!0,l,h),null==i||s.has("accept")||s.set("accept",i+",*/*"),f.setRequestHeader&&s.each(function(t,n){f.setRequestHeader(n,t)}),null!=i&&f.overrideMimeType&&f.overrideMimeType(i),null!=a&&(f.responseType=a),d>0&&(f.timeout=d),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=m(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),u.call("beforesend",r,f),f.send(null==e?null:e),r},abort:function(){return f.abort(),r},on:function(){var t=u.on.apply(u,arguments);return t===u?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},Da=function(t,n){return function(e,r){var i=Oa(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}}("application/json",function(t){return JSON.parse(t.responseText)}),Ua=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?w(t,n):x(t)});return o.columns=i,o}function e(t,n){function e(){if(f>=c)return a;if(i)return i=!1,o;var n,e=f;if(34===t.charCodeAt(e)){for(var r=e;r++=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Ya.hasOwnProperty(n)?{space:Ya[n],local:t}:t},Fa=function(t){var n=Ia(t);return(n.local?T:N)(n)},Ha=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Xa=document.documentElement;if(!Xa.matches){var Ba=Xa.webkitMatchesSelector||Xa.msMatchesSelector||Xa.mozMatchesSelector||Xa.oMatchesSelector;Ha=function(t){return function(){return Ba.call(this,t)}}}}var Va=Ha,$a={};if(t.event=null,"undefined"!=typeof document){"onmouseenter"in document.documentElement||($a={mouseenter:"mouseover",mouseleave:"mouseout"})}var Wa=function(t,n,e){var r,i,o=S(t+""),a=o.length;{if(!(arguments.length<2)){for(u=n?E:j,null==e&&(e=!1),r=0;r=b&&(b=m+1);!(g=_[b])&&++b=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},lu=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=R);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?B:"function"==typeof n?$:V)(t,n,null==e?"":e)):W(this.node(),t)},xu=function(t,n){return arguments.length>1?this.each((null==n?Z:"function"==typeof n?G:J)(t,n)):this.node()[t]};tt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var wu=function(t,n){var e=Q(t+"");if(arguments.length<2){for(var r=K(this.node()),i=-1,o=e.length;++in?1:t>=n?0:NaN},zu=function(t){return 1===t.length&&(t=xt(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}},Ru=zu(Lu),qu=Ru.right,Yu=function(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++uf;)l.pop(),--h;var d,p=new Array(h+1);for(i=0;i<=h;++i)d=p[i]=[],d.x0=i>0?l[i-1]:c,d.x1=i=0;)for(r=t[i],n=r.length;--n>=0;)e[--a]=r[n];return e},Ku=Array.prototype,ts=Ku.map,ns=Ku.slice,es={name:"implicit"},rs=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t},is="\\s*([+-]?\\d+)\\s*",os="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",as="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",us=/^#([0-9a-f]{3})$/,ss=/^#([0-9a-f]{6})$/,cs=new RegExp("^rgb\\("+[is,is,is]+"\\)$"),fs=new RegExp("^rgb\\("+[as,as,as]+"\\)$"),ls=new RegExp("^rgba\\("+[is,is,is,os]+"\\)$"),hs=new RegExp("^rgba\\("+[as,as,as,os]+"\\)$"),ds=new RegExp("^hsl\\("+[os,as,as]+"\\)$"),ps=new RegExp("^hsla\\("+[os,as,as,os]+"\\)$"),ys={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};rs(St,jt,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),rs(Ut,Dt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ut(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),rs(qt,Rt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new qt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new qt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Ut(Yt(t>=240?t-240:t+120,i,r),Yt(t,i,r),Yt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var _s=Math.PI/180,vs=180/Math.PI,gs=.95047,ms=1,bs=1.08883,xs=4/29,ws=6/29,Ms=3*ws*ws,ks=ws*ws*ws;rs(Ht,Ft,At(St,{brighter:function(t){return new Ht(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Ht(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=ms*Bt(t),n=gs*Bt(n),e=bs*Bt(e),new Ut(Vt(3.2404542*n-1.5371385*t-.4985314*e),Vt(-.969266*n+1.8760108*t+.041556*e),Vt(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),rs(Jt,Zt,At(St,{brighter:function(t){return new Jt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Jt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return It(this).rgb()}}));var Ns=-.14861,Ts=1.78277,Cs=-.29227,As=-.90649,Ss=1.97294,js=Ss*As,Es=Ss*Ts,Ps=Ts*Cs-As*Ns;rs(Kt,Qt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*_s,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new Ut(255*(n+e*(Ns*r+Ts*i)),255*(n+e*(Cs*r+As*i)),255*(n+e*(Ss*r)),this.opacity)}}));var Os,Ds,Us,Ls,zs=function(t){return function(){return t}},Rs=function t(n){function e(t,n){var e=r((t=Dt(t)).r,(n=Dt(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),a=on(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}var r=rn(n);return e.gamma=t,e}(1),qs=function(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),a=new Array(r);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:Is(e,r)})),o=Xs.lastIndex;return o1?r[0]+r.slice(2):r,+t.slice(e+1)]},uc=function(t){return t=ac(Math.abs(t)),t?t[1]:NaN},sc=function(t,n){return function(e,r){for(var i=e.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(e.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(n)}},cc=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},fc=function(t,n){var e=ac(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(nc=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ac(t,Math.max(0,n+o-1))[0]},lc=function(t,n){var e=ac(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},hc={"":cc,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return lc(100*t,n)},r:lc,s:fc,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},dc=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i,pc=function(t){return new wn(t)};wn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var yc,_c,vc,gc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],mc=function(t){function n(t){function n(t){var n,i,s,g=p,m=y;if("c"===d)m=_(t)+m,t="";else{t=+t;var b=(t<0||1/t<0)&&(t*=-1,!0);if(t=_(t,h),b)for(n=-1,i=t.length,b=!1;++n(s=t.charCodeAt(n))||s>57){m=(46===s?o+t.slice(n+1):t.slice(n))+m,t=t.slice(0,n);break}}l&&!c&&(t=r(t,1/0));var x=g.length+t.length+m.length,w=x>1)+g+t+m+w.slice(x)}return w+g+t+m}t=pc(t);var e=t.fill,a=t.align,u=t.sign,s=t.symbol,c=t.zero,f=t.width,l=t.comma,h=t.precision,d=t.type,p="$"===s?i[0]:"#"===s&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",y="$"===s?i[1]:/[%p]/.test(d)?"%":"",_=hc[d],v=!d||/[defgprs%]/.test(d);return h=null==h?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=pc(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(uc(e)/3))),o=Math.pow(10,-i),a=gc[8+i/3];return function(t){return r(o*t)+a}}var r=t.grouping&&t.thousands?sc(t.grouping,t.thousands):Mn,i=t.currency,o=t.decimal;return{format:n,formatPrefix:e}};!function(t){yc=mc(t),_c=yc.format,vc=yc.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var bc=function(t){return Math.max(0,-uc(Math.abs(t)))},xc=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(uc(n)/3)))-uc(Math.abs(t)))},wc=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,uc(n)-uc(t))+1},Mc=function(t,n,e){var r,i=t[0],o=t[t.length-1],a=Mt(i,o,null==n?10:n);switch(e=pc(null==e?",f":e),e.type){case"s":var u=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=xc(a,u))||(e.precision=r),vc(e,u);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=wc(a,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=bc(a))||(e.precision=r-2*("%"===e.type))}return _c(e)},kc=function(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],a=t[i];return a0?t>1?Tn(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Cc:null};var Ac=6e4,Sc=6048e5,jc=Tn(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),Ec=Tn(function(t){t.setTime(Math.floor(t/Ac)*Ac)},function(t,n){t.setTime(+t+n*Ac)},function(t,n){return(n-t)/Ac},function(t){return t.getMinutes()}),Pc=Tn(function(t){var n=t.getTimezoneOffset()*Ac%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),Oc=Tn(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ac)/864e5},function(t){return t.getDate()-1}),Dc=Cn(0),Uc=Cn(1),Lc=(Cn(2),Cn(3),Cn(4)),zc=(Cn(5),Cn(6),Tn(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),Rc=Tn(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Rc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Tn(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var qc=Tn(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Ac)},function(t,n){return(n-t)/Ac},function(t){return t.getUTCMinutes()}),Yc=Tn(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),Ic=Tn(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Fc=An(0),Hc=An(1),Xc=(An(2),An(3),An(4)),Bc=(An(5),An(6),Tn(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),Vc=Tn(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Vc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Tn(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var $c,Wc,Zc,Jc={"-":"",_:" ",0:"0"},Gc=/^\s*\d+/,Qc=/^%/,Kc=/[\\^$*+?|[\]().{}]/g;!function(n){$c=Pn(n),t.timeFormat=$c.format,t.timeParse=$c.parse,Wc=$c.utcFormat,Zc=$c.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var tf=(Date.prototype.toISOString||Wc("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||Zc("%Y-%m-%dT%H:%M:%S.%LZ"),1e3),nf=60*tf,ef=60*nf,rf=24*ef,of=7*rf,af=30*rf,uf=365*rf,sf=function(){return He(Rc,zc,Dc,Oc,Pc,Ec,jc,Cc,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},cf=function(){return He(Vc,Bc,Fc,Ic,Yc,qc,jc,Cc,Wc).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},ff=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})};ff("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ff("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ff("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9");var lf=ff("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");ec(Qt(300,.5,0),Qt(-240,.5,1));ec(Qt(-100,.75,.35),Qt(80,1.5,.8)),ec(Qt(260,.75,.35),Qt(80,1.5,.8)),Qt();Xe(ff("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var hf=(Xe(ff("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Xe(ff("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Xe(ff("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Math.PI),df=2*hf,pf=df-1e-6;Be.prototype=Ve.prototype={ -constructor:Be,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,a=this._y1,u=e-t,s=r-n,c=o-t,f=a-n,l=c*c+f*f;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(l>1e-6)if(Math.abs(f*u-s*c)>1e-6&&i){var h=e-o,d=r-a,p=u*u+s*s,y=h*h+d*d,_=Math.sqrt(p),v=Math.sqrt(l),g=i*Math.tan((hf-Math.acos((p+l-y)/(2*_*v)))/2),m=g/v,b=g/_;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*c)+","+(n+m*f)),this._+="A"+i+","+i+",0,0,"+ +(f*h>c*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*s)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var a=e*Math.cos(r),u=e*Math.sin(r),s=t+a,c=n+u,f=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+s+","+c),e&&(l>pf?this._+="A"+e+","+e+",0,1,"+f+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+f+","+(this._x1=s)+","+(this._y1=c):(l<0&&(l=l%df+df),this._+="A"+e+","+e+",0,"+ +(l>=hf)+","+f+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var yf=function(t){return function(){return t}};Math.PI;$e.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var _f=function(t){return new $e(t)},vf=function(){function t(t){var u,s,c,f=t.length,l=!1;for(null==i&&(a=o(c=Ve())),u=0;u<=f;++u)!(u=f;--l)c.point(_[l],v[l]);c.lineEnd(),c.areaEnd()}y&&(_[n]=+e(h,n,t),v[n]=+i(h,n,t),c.point(r?+r(h,n,t):_[n],o?+o(h,n,t):v[n]))}if(d)return c=null,d+""||null}function n(){return vf().defined(a).curve(s).context(u)}var e=We,r=null,i=yf(0),o=Ze,a=yf(!0),u=null,s=_f,c=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:yf(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:yf(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:yf(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:yf(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:yf(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:yf(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(a="function"==typeof n?n:yf(!!n),t):a},t.curve=function(n){return arguments.length?(s=n,null!=u&&(c=s(u)),t):s},t.context=function(n){return arguments.length?(null==n?u=c=null:c=s(u=n),t):u},t},mf=Array.prototype.slice;Ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Je(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Je(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var bf=function(t){return new Ge(t)};Qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,s=-1;++s<=e;)r=s/e,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*n[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var xf=function t(n){function e(t){return 1===n?new Ge(t):new Qe(t,n)}return e.beta=function(n){return t(+n)},e}(.85);tr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ke(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Ke(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var wf=function t(n){function e(t){return new tr(t,n)}return e.tension=function(n){return t(+n)},e}(0);or.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ir(this,this._t0,rr(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,ir(this,rr(this,e=er(this,t,n)),e);break;default:ir(this,this._t0,e=er(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(ar.prototype=Object.create(or.prototype)).point=function(t,n){or.prototype.point.call(this,n,t)},ur.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}};var Mf=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e},Nf=function(){function t(t){var o,a,u=n.apply(this,arguments),s=t.length,c=u.length,f=new Array(c);for(o=0;oKf&&e.statej}i.zoom("mouse",m(r(i.that.__zoom,i.mouse[0]=Ga(i.that),i.mouse[1]),i.extent,M))}function e(){o.on("mousemove.zoom mouseup.zoom",null),br(t.event.view,i.moved),Fl(),i.end()}if(!_&&v.apply(this,arguments)){var i=a(this,arguments),o=Ou(t.event.view).on("mousemove.zoom",n,!0).on("mouseup.zoom",e,!0),u=Ga(this),s=t.event.clientX,c=t.event.clientY;Df(t.event.view),gi(),i.mouse=[u,this.__zoom.invert(u)],ol(this),i.start()}}function f(){if(v.apply(this,arguments)){var i=this.__zoom,a=Ga(this),u=i.invert(a),s=i.k*(t.event.shiftKey?.5:2),c=m(r(e(i,s),a,u),g.apply(this,arguments),M);Fl(),k>0?Ou(this).transition().duration(k).call(o,c,a):Ou(this).call(n.transform,c)}}function l(){if(v.apply(this,arguments)){var n,e,r,i,o=a(this,arguments),u=t.event.changedTouches,s=u.length;for(gi(),e=0;e=u)return null;var s=t-i.site[0],c=n-i.site[1],f=s*s+c*c;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(e){var r=o.edges[e],u=r.left;if(u!==i.site&&u||(u=r.right)){var s=t-u[0],c=n-u[1],l=s*s+c*c;lt||t>i||r>n||n>o))return this;var a,u,s=i-e,c=this._root;switch(u=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{a=new Array(4),a[u]=c,c=a}while(s*=2,i=e+s,o=r+s,t>i||n>o);break;case 1:do{a=new Array(4),a[u]=c,c=a}while(s*=2,e=i-s,o=r+s,e>t||n>o);break;case 2:do{a=new Array(4),a[u]=c,c=a}while(s*=2,i=e+s,r=o-s,t>i||r>n);break;case 3:do{a=new Array(4),a[u]=c,c=a}while(s*=2,e=i-s,r=o-s,e>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},rh=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},ih=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},oh=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},ah=function(t,n,e){var r,i,o,a,u,s,c,f=this._x0,l=this._y0,h=this._x1,d=this._y1,p=[],y=this._root;for(y&&p.push(new oh(y,f,l,h,d)),null==e?e=1/0:(f=t-e,l=n-e,h=t+e,d=n+e,e*=e);s=p.pop();)if(!(!(y=s.node)||(i=s.x0)>h||(o=s.y0)>d||(a=s.x1)=v)<<1|t>=_)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var g=t-+this._x.call(null,y.data),m=n-+this._y.call(null,y.data),b=g*g+m*m;if(b=(u=(p+_)/2))?p=u:_=u,(f=a>=(s=(y+v)/2))?y=s:v=s,n=d,!(d=d[l=f<<1|c]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},sh=function(){return this._root},ch=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},fh=function(t){var n,e,r,i,o,a,u=[],s=this._root;for(s&&u.push(new oh(s,this._x0,this._y0,this._x1,this._y1));n=u.pop();)if(!t(s=n.node,r=n.x0,i=n.y0,o=n.x1,a=n.y1)&&s.length){var c=(r+o)/2,f=(i+a)/2;(e=s[3])&&u.push(new oh(e,c,f,o,a)),(e=s[2])&&u.push(new oh(e,r,f,c,a)),(e=s[1])&&u.push(new oh(e,c,i,o,f)),(e=s[0])&&u.push(new oh(e,r,i,c,f))}return this},lh=function(t){var n,e=[],r=[];for(this._root&&e.push(new oh(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,a=n.x0,u=n.y0,s=n.x1,c=n.y1,f=(a+s)/2,l=(u+c)/2;(o=i[0])&&e.push(new oh(o,a,u,f,l)),(o=i[1])&&e.push(new oh(o,f,u,s,l)),(o=i[2])&&e.push(new oh(o,a,l,f,c)),(o=i[3])&&e.push(new oh(o,f,l,s,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},hh=function(t){return arguments.length?(this._x=t,this):this._x},dh=function(t){return arguments.length?(this._y=t,this):this._y},ph=so.prototype=co.prototype;ph.copy=function(){var t,n,e=new co(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=fo(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=fo(n));return e},ph.add=nh,ph.addAll=io,ph.cover=eh,ph.data=rh,ph.extent=ih,ph.find=ah,ph.remove=uh,ph.removeAll=oo,ph.root=sh,ph.size=ch,ph.visit=fh,ph.visitAfter=lh,ph.x=hh,ph.y=dh;var yh="http://www.w3.org/1999/xhtml",_h={svg:"http://www.w3.org/2000/svg",xhtml:yh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},vh=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),_h.hasOwnProperty(n)?{space:_h[n],local:t}:t},gh=function(t){var n=vh(t);return(n.local?ho:lo)(n)},mh=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var bh=document.documentElement;if(!bh.matches){var xh=bh.webkitMatchesSelector||bh.msMatchesSelector||bh.mozMatchesSelector||bh.oMatchesSelector;mh=function(t){return function(){return xh.call(this,t)}}}}var wh=mh,Mh={},kh=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(Mh={mouseenter:"mouseover",mouseleave:"mouseout"})}var Nh=function(t,n,e){var r,i,o=_o(t+""),a=o.length;{if(!(arguments.length<2)){for(u=n?go:vo,null==e&&(e=!1),r=0;r=b&&(b=m+1);!(g=_[b])&&++b=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},qh=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=ko);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?Eo:"function"==typeof n?Oo:Po)(t,n,null==e?"":e)):$h(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},Zh=function(t,n){return arguments.length>1?this.each((null==n?Do:"function"==typeof n?Lo:Uo)(t,n)):this.node()[t]};qo.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Jh=function(t,n){var e=zo(t+"");if(arguments.length<2){for(var r=Ro(this.node()),i=-1,o=e.length;++ih;if(s||(s=t=Ve()),lcd)if(p>hd-cd)s.moveTo(l*Math.cos(h),l*Math.sin(h)),s.arc(0,0,l,h,d,!y),f>cd&&(s.moveTo(f*Math.cos(d),f*Math.sin(d)),s.arc(0,0,f,d,h,y));else{var _,v,g=h,m=d,b=h,x=d,w=p,M=p,k=u.apply(this,arguments)/2,N=k>cd&&(i?+i.apply(this,arguments):Math.sqrt(f*f+l*l)),T=Math.min(Math.abs(l-f)/2,+r.apply(this,arguments)),C=T,A=T;if(N>cd){var S=la(N/f*Math.sin(k)),j=la(N/l*Math.sin(k));(w-=2*S)>cd?(S*=y?1:-1,b+=S,x-=S):(w=0,b=x=(h+d)/2),(M-=2*j)>cd?(j*=y?1:-1,g+=j,m-=j):(M=0,g=m=(h+d)/2)}var E=l*Math.cos(g),P=l*Math.sin(g),O=f*Math.cos(x),D=f*Math.sin(x);if(T>cd){var U=l*Math.cos(m),L=l*Math.sin(m),z=f*Math.cos(b),R=f*Math.sin(b);if(pcd?ha(E,P,z,R,U,L,O,D):[O,D],Y=E-q[0],I=P-q[1],F=U-q[0],H=L-q[1],X=1/Math.sin(Math.acos((Y*F+I*H)/(Math.sqrt(Y*Y+I*I)*Math.sqrt(F*F+H*H)))/2),B=Math.sqrt(q[0]*q[0]+q[1]*q[1]);C=Math.min(T,(f-B)/(X-1)),A=Math.min(T,(l-B)/(X+1))}}M>cd?A>cd?(_=da(z,R,E,P,l,A,y),v=da(U,L,O,D,l,A,y),s.moveTo(_.cx+_.x01,_.cy+_.y01),Acd&&w>cd?C>cd?(_=da(O,D,U,L,f,-C,y),v=da(E,P,z,R,f,-C,y),s.lineTo(_.cx+_.x01,_.cy+_.y01),C0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t}}]),t}(),Nd=function(){function t(n){var e=n.annotations,r=n.accessors,i=n.accessorsInverse;vd(this,t),this.accessors=r,this.accessorsInverse=i,this.annotations=e}return gd(t,[{key:"clearTypes",value:function(t){this.annotations.forEach(function(n){n.type=void 0,n.subject=t&&t.subject||n.subject,n.connector=t&&t.connector||n.connector,n.note=t&&t.note||n.note})}},{key:"setPositionWithAccessors",value:function(){var t=this;this.annotations.forEach(function(n){n.type.setPositionWithAccessors(t.accessors)})}},{key:"editMode",value:function(t){this.annotations.forEach(function(n){n.type&&(n.type.editMode=t,n.type.updateEditMode())})}},{key:"updateDisable",value:function(t){this.annotations.forEach(function(n){n.disable=t,n.type&&t.forEach(function(t){n.type[t]&&(n.type[t].remove&&n.type[t].remove(),n.type[t]=void 0)})})}},{key:"updateTextWrap",value:function(t){this.annotations.forEach(function(n){n.type&&n.type.updateTextWrap&&n.type.updateTextWrap(t)})}},{key:"updateText",value:function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})}},{key:"updateNotePadding",value:function(t){this.annotations.forEach(function(n){n.type&&(n.type.notePadding=t)})}},{key:"json",get:function(){var t=this;return this.annotations.map(function(n){var e=n.json;return t.accessorsInverse&&n.data&&(e.data={},Object.keys(t.accessorsInverse).forEach(function(r){e.data[r]=t.accessorsInverse[r]({x:n.x,y:n.y})})),e})}},{key:"noteNodes",get:function(){return this.annotations.map(function(t){return md({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})}}]),t}(),Td=function(t){var n=t.cx,e=void 0===n?0:n,r=t.cy;return{move:{x:e,y:void 0===r?0:r}}},Cd=function(t){var n=t.cx,e=void 0===n?0:n,r=t.cy,i=void 0===r?0:r,o=t.r1,a=t.r2,u=t.padding,s={move:{x:e,y:i}};return void 0!==o&&(s.r1={x:e+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),void 0!==a&&(s.r2={x:e+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),void 0!==u&&(s.padding={x:e+o+u,y:i}),s},Ad=function(t){var n=t.group,e=t.handles,r=t.r,i=void 0===r?10:r,o=n.selectAll("circle.handle").data(e);o.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(Rf().container(ud("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),n.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||i}).attr("class",function(t){return"handle "+(t.className||"")}),o.exit().remove()},Sd=function(t,n){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=n<0?"top":"bottom"),t},jd=function(t,n){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=n<0?"right":"left"),t},Ed=["topBottom","top","bottom"],Pd=["leftRight","left","right"],Od=function(t){var n=t.padding,e=void 0===n?0:n,r=t.bbox,i=void 0===r?{x:0,y:0,width:0,height:0}:r,o=t.align,a=t.orientation,u=t.offset,s=void 0===u?{x:0,y:0}:u,c=-i.x,f=0;return-1!==Ed.indexOf(a)?(o=jd(o,s.x),s.y<0&&"topBottom"===a||"top"===a?f-=i.height+e:f+=e,"middle"===o?c-=i.width/2:"right"===o&&(c-=i.width)):-1!==Pd.indexOf(a)&&(o=Sd(o,s.y),s.x<0&&"leftRight"===a||"left"===a?c-=i.width+e:c+=e,"middle"===o?f-=i.height/2:"top"===o&&(f-=i.height)),{x:c,y:f}},Dd=function(t){var n=t.data,e=t.curve,r=void 0===e?pd:e,i=t.canvasContext,o=t.className,a=t.classID,u=yd().curve(r),s={type:"path",className:o,classID:a,data:n};return i?(u.context(i),s.pathMethods=u):s.attrs={d:u(n)},s},Ud=function(t){var n=t.data,e=t.canvasContext,r=t.className,i=t.classID,o={type:"path",className:r,classID:i,data:n},a=dd().innerRadius(n.innerRadius||0).outerRadius(n.outerRadius||n.radius||2).startAngle(n.startAngle||0).endAngle(n.endAngle||2*Math.PI);return e?(a.context(e),o.pathMethods=lineGen):o.attrs={d:a()},o},Ld=function(t){var n=t.align,e=t.x,r=void 0===e?0:e,i=t.y,o=void 0===i?0:i,a=t.bbox,u=t.offset;n=Sd(n,u.y),"top"===n?o-=a.height:"middle"===n&&(o-=a.height/2);var s=[[r,o],[r,o+a.height]];return{components:[Dd({data:s,className:"note-line"})]}},zd=function(t){var n=t.align,e=t.x,r=void 0===e?0:e,i=t.y,o=void 0===i?0:i,a=t.offset,u=t.bbox;n=jd(n,a.x),"right"===n?r-=u.width:"middle"===n&&(r-=u.width/2);var s=[[r,o],[r+u.width,o]];return{components:[Dd({data:s,className:"note-line"})]}},Rd=function(t){var n=t.type,e=t.subjectType,r=n.annotation,i=r.position,o=r.x-i.x,a=o+r.dx,u=r.y-i.y,s=u+r.dy,c=r.subject;if("circle"===e&&(c.outerRadius||c.radius)){var f=Math.sqrt((o-a)*(o-a)+(u-s)*(u-s)),l=Math.asin(-s/f),h=c.outerRadius||c.radius+(c.radiusPadding||0);o=Math.abs(Math.cos(l)*h)*(a<0?-1:1),u=Math.abs(Math.sin(l)*h)*(s<0?-1:1)}if("rect"===e){var d=c.width,p=c.height;(d>0&&r.dx>0||d<0&&r.dx<0)&&(o=Math.abs(d)>Math.abs(r.dx)?d/2:d),(p>0&&r.dy>0||p<0&&r.dy<0)&&(u=Math.abs(p)>Math.abs(r.dy)?p/2:p),o===d/2&&u===p/2&&(o=a,u=s)}return[[o,u],[a,s]]},qd=function(t){var n=Rd(t);return{components:[Dd({data:n,className:"connector"})]}},Yd=function(t){var n=t.type,e=t.subjectType,r=n.annotation,i=r.position,o=r.x-i.x,a=o+r.dx,u=r.y-i.y,s=u+r.dy,c=r.subject;if("rect"===e){var f=c.width,l=c.height;(f>0&&r.dx>0||f<0&&r.dx<0)&&(o=Math.abs(f)>Math.abs(r.dx)?f/2:f),(l>0&&r.dy>0||l<0&&r.dy<0)&&(u=Math.abs(l)>Math.abs(r.dy)?l/2:l),o===f/2&&u===l/2&&(o=a,u=s)}var h=[[o,u],[a,s]],d=s-u,p=a-o,y=a,_=s,v=so||au?-1:1;if(Math.abs(p)m&&Math.abs(d)>m)o=m*(a<0?-1:1),u=m*(s<0?-1:1),h=[[o,u],[y,_],[a,s]];else if(Math.abs(p)>Math.abs(d)){var b=Math.asin(-s/g);o=Math.abs(Math.cos(b)*g)*(a<0?-1:1),h=[[o,s],[a,s]]}else{var x=Math.acos(a/g);u=Math.abs(Math.sin(x)*g)*(s<0?-1:1),h=[[a,u],[a,s]]}}else h=[[o,u],[y,_],[a,s]];return{components:[Dd({data:h,className:"connector"})]}},Id=function(t){var n=t.type,e=t.connectorData,r=t.subjectType;e||(e={}),e.points&&"number"!=typeof e.points||(e.points=Fd(n.annotation.offset,e.points)),e.curve||(e.curve=_d);var i=[];if(n.editMode){var o=e.points.map(function(t,n){return md({},Td({cx:t[0],cy:t[1]}),{index:n})}),a=function(t){e.points[t][0]+=kh.dx,e.points[t][1]+=kh.dy,n.redrawConnector()};i=n.mapHandles(o.map(function(t){return md({},t.move,{drag:a.bind(n,t.index)})}))}var u=Rd({type:n,subjectType:r});return u=[u[0]].concat(Md(e.points),[u[1]]),{components:[Dd({data:u,curve:e.curve,className:"connector"})],handles:i}},Fd=function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e={x:t.x/(n+1),y:t.y/(n+1)},r=[],i=1;i<=n;i++)r.push([e.x*i+i%2*20,e.y*i-i%2*20]);return r},Hd=function(t){var n=t.annotation,e=t.start,r=t.end,i=t.scale,o=void 0===i?1:i,a=n.position;e=e?[-r[0]+e[0],-r[1]+e[1]]:[n.dx,n.dy],r||(r=[n.x-a.x,n.y-a.y]);var u=r[0],s=r[1],c=e[0],f=e[1],l=10*o,h=16/180*Math.PI,d=Math.atan(f/c);c<0&&(d+=Math.PI);var p=[[u,s],[Math.cos(d+h)*l+u,Math.sin(d+h)*l+s],[Math.cos(d-h)*l+u,Math.sin(d-h)*l+s],[u,s]];return{components:[Dd({data:p,className:"connector-end connector-arrow",classID:"connector-end"})]}},Xd=function(t){var n=t.line,e=t.scale,r=void 0===e?1:e,i=Ud({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(r)}});return i.attrs.transform="translate("+n.data[0][0]+", "+n.data[0][1]+")",{components:[i]}},Bd=function(t){var n=t.subjectData,e=t.type;n.radius||n.outerRadius||(n.radius=20);var r=[],i=Ud({data:n,className:"subject"});if(e.editMode){var o=Cd({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:n.radiusPadding}),a=function(t){var r=n[t]+kh.dx*Math.sqrt(2);n[t]=r,e.redrawSubject(),e.redrawConnector()},u=[md({},o.r1,{drag:a.bind(e,void 0!==n.outerRadius?"outerRadius":"radius")})];n.innerRadius&&u.push(md({},o.r2,{drag:a.bind(e,"innerRadius")})),r=e.mapHandles(u)}return i.attrs["fill-opacity"]=0,{components:[i],handles:r}},Vd=function(t){var n=t.subjectData,e=t.type;n.width||(n.width=100),n.height||(n.height=100);var r=[],i=n.width,o=n.height,a=[[0,0],[i,0],[i,o],[0,o],[0,0]],u=Dd({data:a,className:"subject"});if(e.editMode){var s=function(){n.width=kh.x,e.redrawSubject(),e.redrawConnector()},c=function(){n.height=kh.y,e.redrawSubject(),e.redrawConnector()},f=[{x:i,y:o/2,drag:s.bind(e)},{x:i/2,y:o,drag:c.bind(e)}];r=e.mapHandles(f)}return u.attrs["fill-opacity"]=.1,{components:[u],handles:r}},$d=function(t){var n=t.subjectData,e=t.type,r=e.annotation.position,i=(void 0!==n.x1?n.x1:r.x)-r.x,o=(void 0!==n.x2?n.x2:r.x)-r.x,a=(void 0!==n.y1?n.y1:r.y)-r.y,u=(void 0!==n.y2?n.y2:r.y)-r.y;return{components:[Dd({data:[[i,a],[o,u]],className:"subject"})]}},Wd=function(t){var n=t.subjectData,e=void 0===n?{}:n,r=t.type,i=void 0===r?{}:r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.typeSettings&&i.typeSettings.subject;e.radius||(a&&a.radius?e.radius=a.radius:e.radius=14),e.x||a&&a.x&&(e.x=a.x),e.y||a&&a.y&&(e.y=a.y);var u=[],s=[],c=e.radius,f=.7*c,l=0,h=0,d=Math.sqrt(2)*c,p={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-d,xright:d,ytop:-d,ybottom:d};e.x&&!e.y?l=p["x"+e.x]:e.y&&!e.x?h=p["y"+e.y]:e.x&&e.y&&(l=p["x"+e.x+"corner"],h=p["y"+e.y+"corner"]);var y="translate("+l+", "+h+")",_=Ud({className:"subject",data:{radius:c}});_.attrs.transform=y,_.attrs.fill=o.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var v=Ud({className:"subject-ring",data:{outerRadius:c,innerRadius:f}});v.attrs.transform=y,v.attrs["stroke-width"]="3px",v.attrs.fill="white";var g=void 0;if(l&&h||!l&&!h)g=Dd({className:"subject-pointer",data:[[0,0],[l||0,0],[0,h||0],[0,0]]});else if(l||h){var m=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||n*c/Math.sqrt(2)};g=Dd({className:"subject-pointer",data:[[0,0],[m(l),m(h)],[m(l,-1),m(h,-1)],[0,0]]})}if(g&&(g.attrs.fill=o.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",s.push(g)),i.editMode){var b=function(){e.x=kh.x<2*-c?"left":kh.x>2*c?"right":void 0,e.y=kh.y<2*-c?"top":kh.y>2*c?"bottom":void 0,i.redrawSubject()},x={x:2*l,y:2*h,drag:b.bind(i)};x.x||x.y||(x.y=-c),u=i.mapHandles([x])}var w=void 0;return e.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:e.text,"text-anchor":"middle",dy:".25em",x:l,y:h}}),s.push(_),s.push(v),s.push(w),{components:s,handles:u}},Zd=function(){function t(n){var e=n.a,r=n.annotation,i=n.editMode,o=n.dispatcher,a=n.notePadding,u=n.accessors;if(vd(this,t),this.a=e,this.note=-1===r.disable.indexOf("note")&&e.select("g.annotation-note"),this.noteContent=this.note&&e.select("g.annotation-note-content"),this.connector=-1===r.disable.indexOf("connector")&&e.select("g.annotation-connector"),this.subject=-1===r.disable.indexOf("subject")&&e.select("g.annotation-subject"),this.dispatcher=o,o){var s=sp.bind(null,o,r);s({component:this.note,name:"note"}),s({component:this.connector,name:"connector"}),s({component:this.subject,name:"subject"})}this.annotation=r,this.editMode=r.editMode||i,this.notePadding=void 0!==a?a:3,this.offsetCornerX=0,this.offsetCornerY=0,u&&r.data&&this.init(u)}return gd(t,[{key:"init",value:function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)}},{key:"mapY",value:function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))}},{key:"mapX",value:function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))}},{key:"updateEditMode",value:function(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function(t,n){var e=this;Array.isArray(n)||(n=[n]),n.filter(function(t){return t}).forEach(function(n){var r=n.type,i=n.className,o=n.attrs,a=n.handles,u=n.classID;if("handle"===r)Ad({group:t,r:o&&o.r,handles:a});else{up(t,[e.annotation],r,i,u);for(var s=t.select(r+"."+(u||i)),c=Object.keys(o),f=[],l=s.node().attributes,h=l.length-1;h>=0;h--){var d=l[h].name;-1===c.indexOf(d)&&"class"!==d&&f.push(d)}c.forEach(function(t){"text"===t?s.text(o[t]):s.attr(t,o[t])}),f.forEach(function(t){return s.attr(t,null)})}})}},{key:"getNoteBBox",value:function(){return fp(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function(){var t=fp(this.note,".annotation-note-content"),n=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(n[1])+this.annotation.dx,t.offsetCornerY=parseFloat(n[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t}},{key:"drawSubject",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.subject,r=n.type,i={type:this,subjectData:e},o={};"circle"===r?o=Bd(i):"rect"===r?o=Vd(i):"threshold"===r?o=$d(i):"badge"===r&&(o=Wd(i,this.annotation));var a=o,u=a.components,s=void 0===u?[]:u,c=a.handles,f=void 0===c?[]:c;return s.forEach(function(n){n&&n.attrs&&!n.attrs.stroke&&(n.attrs.stroke=t.annotation.color)}),this.editMode&&(f=f.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),s.push({type:"handle",handles:f})),s}},{key:"drawConnector",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.connector,r=e.type||n.type,i={type:this,connectorData:e};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var o={};o="curve"===r?Id(i):"elbow"===r?Yd(i):qd(i);var a=o,u=a.components,s=void 0===u?[]:u,c=a.handles,f=void 0===c?[]:c,l=s[0];l&&(l.attrs.stroke=this.annotation.color,l.attrs.fill="none");var h=e.end||n.end,d={};if("arrow"===h){var p=l.data[1],y=l.data[0];Math.sqrt(Math.pow(p[0]-y[0],2)+Math.pow(p[1]-y[1],2))<5&&l.data[2]&&(p=l.data[2]),d=Hd({annotation:this.annotation,start:p,end:y,scale:e.endScale})}else"dot"===h?d=Xd({line:l,scale:e.endScale}):h&&"none"!==h||this.connector&&this.connector.select(".connector-end").remove();return d.components&&(d.components.forEach(function(n){n.attrs.fill=t.annotation.color,n.attrs.stroke=t.annotation.color}),s=s.concat(d.components)),this.editMode&&0!==f.length&&s.push({type:"handle",handles:f}),s}},{key:"drawNote",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.note,r=e.align||n.align||"dynamic",i={bbox:n.bbox,align:r,offset:this.annotation.offset},o=e.lineType||n.lineType,a={};"vertical"===o?a=Ld(i):"horizontal"===o&&(a=zd(i));var u=a,s=u.components,c=void 0===s?[]:s,f=u.handles,l=void 0===f?[]:f;if(c.forEach(function(n){n.attrs.stroke=t.annotation.color}),this.editMode){l=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:l});var h=this.dragNote.bind(this),d=this.dragstarted.bind(this),p=this.dragended.bind(this);this.note.call(Rf().container(ud("g.annotations").node()).on("start",function(t){return d(t)}).on("drag",function(t){return h(t)}).on("end",function(t){return p(t)}))}else this.note.on("mousedown.drag",null);return c}},{key:"drawNoteContent",value:function(t){var n=this.annotation.note,e=void 0!==n.padding?n.padding:this.notePadding,r=n.orientation||t.orientation||"topBottom",i=n.lineType||t.lineType,o=n.align||t.align||"dynamic";"vertical"===i?r="leftRight":"horizontal"===i&&(r="topBottom");var a={padding:e,bbox:t.bbox,offset:this.annotation.offset,orientation:r,align:o},u=Od(a),s=u.x,c=u.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+s+", "+c+")"),[]}},{key:"drawOnScreen",value:function(t,n){ -return this.drawOnSVG(t,n)}},{key:"redrawSubject",value:function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))}},{key:"setPosition",value:function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")}},{key:"setOffset",value:function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}}},{key:"setPositionWithAccessors",value:function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()}},{key:"setClassName",value:function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function(){kh.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function(){var t=this.annotation.position;t.x+=kh.dx,t.y+=kh.dy,this.annotation.position=t}},{key:"dragNote",value:function(){var t=this.annotation.offset;t.x+=kh.dx,t.y+=kh.dy,this.annotation.offset=t}},{key:"mapHandles",value:function(t){var n=this;return t.map(function(t){return md({},t,{start:n.dragstarted.bind(n),end:n.dragended.bind(n)})})}}]),t}(),Jd=function(t,n,e){return function(t){function r(t){vd(this,r);var e=wd(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return e.typeSettings=n,n.disable&&n.disable.forEach(function(t){e[t]&&e[t].remove(),e[t]=void 0,"note"===t&&(e.noteContent=void 0)}),e}return xd(r,t),gd(r,[{key:"className",value:function(){return""+(n.className||bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this)&&bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function(t){return this.typeSettings.subject=md({},n.subject,this.typeSettings.subject),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawSubject",this).call(this,md({},t,this.typeSettings.subject))}},{key:"drawConnector",value:function(t){return this.typeSettings.connector=md({},n.connector,this.typeSettings.connector),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawConnector",this).call(this,md({},t,n.connector,this.typeSettings.connector))}},{key:"drawNote",value:function(t){return this.typeSettings.note=md({},n.note,this.typeSettings.note),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNote",this).call(this,md({},t,n.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function(t){return bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNoteContent",this).call(this,md({},t,n.note,this.typeSettings.note))}}],[{key:"init",value:function(t,n){return bd(r.__proto__||Object.getPrototypeOf(r),"init",this).call(this,t,n),e&&(t=e(t,n)),t}}]),r}(t)},Gd=function(t){function n(t){vd(this,n);var e=wd(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return e.textWrap=t.textWrap||120,e.drawText(),e}return xd(n,t),gd(n,[{key:"updateTextWrap",value:function(t){this.textWrap=t,this.drawText()}},{key:"drawText",value:function(){if(this.note){up(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");up(t,[this.annotation],"rect","annotation-note-bg"),up(t,[this.annotation],"text","annotation-note-label"),up(t,[this.annotation],"text","annotation-note-title");var n={height:0},e=this.a.select("text.annotation-note-label"),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter;if(this.annotation.note.title){var o=this.a.select("text.annotation-note-title");o.text(this.annotation.note.title),o.attr("fill",this.annotation.color),o.attr("font-weight","bold"),o.call(cp,r,i),n=o.node().getBBox()}e.text(this.annotation.note.label).attr("dx","0"),e.call(cp,r,i),e.attr("y",1.1*n.height||0),e.attr("fill",this.annotation.color);var a=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",a.width).attr("height",a.height).attr("x",a.x).attr("fill","white").attr("fill-opacity",0)}}}]),n}(Zd),Qd=Jd(Gd,{className:"label",note:{align:"middle"},disable:["subject"]}),Kd=Jd(Gd,{className:"callout",note:{lineType:"horizontal"},disable:["subject"]}),tp=Jd(Kd,{className:"callout elbow",connector:{type:"elbow"},disable:["subject"]}),np=Jd(Kd,{className:"callout curve",connector:{type:"curve"},disable:["subject"]}),ep=Jd(Zd,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),rp=Jd(Gd,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ip=Jd(Gd,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),op=function(t){function n(){return vd(this,n),wd(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return xd(n,t),gd(n,[{key:"mapY",value:function(t){bd(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"mapY",this).call(this,t);var e=this.annotation;(e.subject.x1||e.subject.x2)&&e.data&&t.y&&(e.y=t.y(e.data)),!e.subject.x1&&!e.subject.x2||e.x||(e.x=e.subject.x1||e.subject.x2)}},{key:"mapX",value:function(t){bd(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"mapX",this).call(this,t);var e=this.annotation;(e.subject.y1||e.subject.y2)&&e.data&&t.x&&(e.x=t.x(e.data)),!e.subject.y1&&!e.subject.y2||e.y||(e.y=e.subject.y1||e.subject.y2)}}]),n}(Kd),ap=Jd(op,{className:"callout xythreshold",subject:{type:"threshold"}}),up=function(t,n,e,r,i){var o=t.selectAll(e+"."+(i||r)).data(n);return o.enter().append(e).merge(o).attr("class",r),o.exit().remove(),t},sp=function(t,n,e){var r=e.component,i=e.name;r&&r.on("mouseover.annotations",function(){t.call(i+"over",r,n)}).on("mouseout.annotations",function(){return t.call(i+"out",r,n)}).on("click.annotations",function(){return t.call(i+"click",r,n)})},cp=function(t,n,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=ud(this),i=t.text().split(e||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),o=void 0,a=[],u=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");o=i.pop();)a.push(o),u.text(a.join(" ")),u.node().getComputedTextLength()>n&&a.length>1&&(a.pop(),u.text(a.join(" ")),a=[o],u=t.append("tspan").attr("x",0).attr("dy",r+"em").text(o))})},fp=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(n).nodes().reduce(function(t,n){var e=n.getBBox();t.x=Math.min(t.x,e.x),t.y=Math.min(t.y,e.y),t.width=Math.max(t.width,e.width);var r=n&&n.attributes&&n.attributes.y;return t.height=Math.max(t.height,(r&&parseFloat(r.value)||0)+e.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};t.queue=u,t.csv=Ra,t.json=Da,t.select=Ou,t.selectAll=Du,t.selection=bt,t.mouse=Ga,t.scaleTime=sf,t.scaleUtc=cf,t.scaleLinear=Nn,t.scaleOrdinal=kt,t.scalePoint=Ct,t.schemeCategory20=lf,t.area=gf,t.line=vf,t.curveBasis=bf,t.curveCardinal=wf,t.curveBundle=xf,t.curveLinear=_f,t.stack=Nf,t.interpolate=Vs,t.axisTop=yr,t.axisRight=_r,t.axisBottom=vr,t.axisLeft=gr,t.zoom=Hl,t.zoomIdentity=Il,t.bisector=zu,t.merge=Qu,t.histogram=Gu,t.easeCubic=di,t.easeBounce=pi,t.voronoi=th,t.nest=Ea,t.transition=li,t.quadtree=so,t.dispatch=p,t.timer=Ar,t.timeout=Wf,t.annotation=Aa,t.annotationTypeBase=Zd,t.annotationLabel=Qd,t.annotationCallout=Kd,t.annotationCalloutCurve=np,t.annotationCalloutElbow=tp,t.annotationCalloutCircle=rp,t.annotationCalloutRect=ip,t.annotationXYThreshold=ap,t.annotationBadge=ep,t.annotationCustomType=Jd,Object.defineProperty(t,"__esModule",{value:!0})}); \ No newline at end of file +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3={})}(this,function(t){"use strict";function n(t){this._size=t,this._call=this._error=null,this._tasks=[],this._data=[],this._waiting=this._active=this._ended=this._start=0}function e(t){if(!t._start)try{r(t)}catch(n){if(t._tasks[t._ended+t._active-1])o(t,n);else if(!t._data)throw n}}function r(t){for(;t._start=t._waiting&&t._active=0;)if((e=t._tasks[r])&&(t._tasks[r]=null,e.abort))try{e.abort()}catch(n){}t._active=NaN,a(t)}function a(t){if(!t._active&&t._call){var n=t._data;t._data=void 0,t._call(t._error,n)}}function s(t){if(null==t)t=1/0;else if(!((t=+t)>=1))throw new Error("invalid concurrency");return new n(t)}function u(){}function c(t,n){var e=new u;if(t instanceof u)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++i=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})}function v(t,n){for(var e,r=0,i=t.length;r=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function E(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function z(t){return function(){this.removeAttribute(t)}}function q(t){return function(){this.removeAttributeNS(t.space,t.local)}}function F(t,n){return function(){this.setAttribute(t,n)}}function Y(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function B(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function X(t){return function(){this.style.removeProperty(t)}}function V(t,n,e){return function(){this.style.setProperty(t,n,e)}}function W(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function $(t,n){return t.style.getPropertyValue(n)||ms(t).getComputedStyle(t,null).getPropertyValue(n)}function Z(t){return function(){delete this[t]}}function J(t,n){return function(){this[t]=n}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Q(t){return t.trim().split(/^|\s+/)}function K(t){return t.classList||new tt(t)}function tt(t){this._node=t,this._names=Q(t.getAttribute("class")||"")}function nt(t,n){for(var e=K(t),r=-1,i=n.length;++r=0?(o>=Vs?10:o>=Ws?5:o>=$s?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Vs?10:o>=Ws?5:o>=$s?2:1)}function Mt(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=Vs?i*=10:o>=Ws?i*=5:o>=$s&&(i*=2),n>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1)):(n=uu.exec(t))?jt(parseInt(n[1],16)):(n=cu.exec(t))?new It(n[1],n[2],n[3],1):(n=hu.exec(t))?new It(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=fu.exec(t))?Ot(n[1],n[2],n[3],n[4]):(n=lu.exec(t))?Ot(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=du.exec(t))?Lt(n[1],n[2]/100,n[3]/100,1):(n=pu.exec(t))?Lt(n[1],n[2]/100,n[3]/100,n[4]):yu.hasOwnProperty(t)?jt(yu[t]):"transparent"===t?new It(NaN,NaN,NaN,0):null}function jt(t){return new It(t>>16&255,t>>8&255,255&t,1)}function Ot(t,n,e,r){return r<=0&&(t=n=e=NaN),new It(t,n,e,r)}function Pt(t){return t instanceof St||(t=Et(t)),t?(t=t.rgb(),new It(t.r,t.g,t.b,t.opacity)):new It}function Rt(t,n,e,r){return 1===arguments.length?Pt(t):new It(t,n,e,null==r?1:r)}function It(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Lt(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new zt(t,n,e,r)}function Ut(t){if(t instanceof zt)return new zt(t.h,t.s,t.l,t.opacity);if(t instanceof St||(t=Et(t)),!t)return new zt;if(t instanceof zt)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=n===o?(e-r)/s+6*(e0&&u<1?0:a,new zt(a,s,u,t.opacity)}function Dt(t,n,e,r){return 1===arguments.length?Ut(t):new zt(t,n,e,null==r?1:r)}function zt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function qt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Ft(t){if(t instanceof Ht)return new Ht(t.l,t.a,t.b,t.opacity);if(t instanceof Jt){var n=t.h*_u;return new Ht(t.l,Math.cos(n)*t.c,Math.sin(n)*t.c,t.opacity)}t instanceof It||(t=Pt(t));var e=Wt(t.r),r=Wt(t.g),i=Wt(t.b),o=Bt((.4124564*e+.3575761*r+.1804375*i)/gu),a=Bt((.2126729*e+.7151522*r+.072175*i)/mu);return new Ht(116*a-16,500*(o-a),200*(a-Bt((.0193339*e+.119192*r+.9503041*i)/bu)),t.opacity)}function Yt(t,n,e,r){return 1===arguments.length?Ft(t):new Ht(t,n,e,null==r?1:r)}function Ht(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function Bt(t){return t>ku?Math.pow(t,1/3):t/Mu+xu}function Xt(t){return t>wu?t*t*t:Mu*(t-xu)}function Vt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Wt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $t(t){if(t instanceof Jt)return new Jt(t.h,t.c,t.l,t.opacity);t instanceof Ht||(t=Ft(t));var n=Math.atan2(t.b,t.a)*vu;return new Jt(n<0?n+360:n,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function Zt(t,n,e,r){return 1===arguments.length?$t(t):new Jt(t,n,e,null==r?1:r)}function Jt(t,n,e,r){this.h=+t,this.c=+n,this.l=+e,this.opacity=+r}function Gt(t){if(t instanceof Kt)return new Kt(t.h,t.s,t.l,t.opacity);t instanceof It||(t=Pt(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Ou*r+Eu*n-ju*e)/(Ou+Eu-ju),o=r-i,a=(Su*(e-i)-Cu*o)/Au,s=Math.sqrt(a*a+o*o)/(Su*i*(1-i)),u=s?Math.atan2(a,o)*vu-120:NaN;return new Kt(u<0?u+360:u,s,i,t.opacity)}function Qt(t,n,e,r){return 1===arguments.length?Gt(t):new Kt(t,n,e,null==r?1:r)}function Kt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function tn(t,n){return function(e){return t+e*n}}function nn(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function en(t,n){var e=n-t;return e?tn(t,e>180||e<-180?e-360*Math.round(e/360):e):Uu(isNaN(t)?n:t)}function rn(t){return 1==(t=+t)?on:function(n,e){return e-n?nn(n,e,t):Uu(isNaN(n)?e:n)}}function on(t,n){var e=n-t;return e?tn(t,e):Uu(isNaN(t)?n:t)}function an(t){return function(){return t}}function sn(t){return function(n){return t(n)+""}}function un(t){return"none"===t?Zu:(Pu||(Pu=document.createElement("DIV"),Ru=document.documentElement,Iu=document.defaultView),Pu.style.transform=t,t=Iu.getComputedStyle(Ru.appendChild(Pu),null).getPropertyValue("transform"),Ru.removeChild(Pu),t=t.slice(7,-1).split(","),Ju(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}function cn(t){return null==t?Zu:(Lu||(Lu=document.createElementNS("http://www.w3.org/2000/svg","g")),Lu.setAttribute("transform",t),(t=Lu.transform.baseVal.consolidate())?(t=t.matrix,Ju(t.a,t.b,t.c,t.d,t.e,t.f)):Zu)}function hn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}function o(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,n,null,e);s.push({i:u-4,x:Fu(t,i)},{i:u-2,x:Fu(r,o)})}else(i||o)&&a.push("translate("+i+n+o+e)}function a(t,n,e,o){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Fu(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}function s(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Fu(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}function u(t,n,e,r,o,a){if(t!==e||n!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:Fu(t,e)},{i:s-2,x:Fu(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}return function(n,e){var r=[],i=[];return n=t(n),e=t(e),o(n.translateX,n.translateY,e.translateX,e.translateY,r,i),a(n.rotate,e.rotate,r,i),s(n.skewX,e.skewX,r,i),u(n.scaleX,n.scaleY,e.scaleX,e.scaleY,r,i),n=e=null,function(t){for(var n,e=-1,o=i.length;++e=e?1:r(t)}}}function vn(t){return function(n,e){var r=t(n=+n,e=+e);return function(t){return t<=0?n:t>=1?e:r(t)}}}function gn(t,n,e,r){var i=t[0],o=t[1],a=n[0],s=n[1];return o2?mn:gn,o=a=null,r}function r(n){return(o||(o=i(s,u,h?_n(t):t,c)))(+n)}var i,o,a,s=oc,u=oc,c=Vu,h=!1;return r.invert=function(t){return(a||(a=i(u,s,yn,h?vn(n):n)))(+t)},r.domain=function(t){return arguments.length?(s=tu.call(t,ic),e()):s.slice()},r.range=function(t){return arguments.length?(u=nu.call(t),e()):u.slice()},r.rangeRound=function(t){return u=nu.call(t),c=Wu,e()},r.clamp=function(t){return arguments.length?(h=!!t,e()):h},r.interpolate=function(t){return arguments.length?(c=t,e()):c},e()}function wn(t){if(!(n=dc.exec(t)))throw new Error("invalid format: "+t);var n,e=n[1]||" ",r=n[2]||">",i=n[3]||"-",o=n[4]||"",a=!!n[5],s=n[6]&&+n[6],u=!!n[7],c=n[8]&&+n[8].slice(1),h=n[9]||"";"n"===h?(u=!0,h="g"):lc[h]||(h=""),(a||"0"===e&&"="===r)&&(a=!0,e="0",r="="),this.fill=e,this.align=r,this.sign=i,this.symbol=o,this.zero=a,this.width=s,this.comma=u,this.precision=c,this.type=h}function Mn(t){return t}function kn(t){var n=t.domain;return t.ticks=function(t){var e=n();return Zs(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){return Mc(n(),t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,s=i[o],u=i[a];return u0?(s=Math.floor(s/r)*r,u=Math.ceil(u/r)*r,r=wt(s,u,e)):r<0&&(s=Math.ceil(s*r)/r,u=Math.floor(u*r)/r,r=wt(s,u,e)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(u/r)*r,n(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(u*r)/r,n(i)),t},t}function Tn(){var t=xn(yn,Fu);return t.copy=function(){return bn(t,Tn())},kn(t)}function Nn(t,n,e,r){function i(n){return t(n=new Date(+n)),n}return i.floor=i,i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return a;do{a.push(new Date(+e))}while(n(e,o),t(e),e=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return Tc.setTime(+n),Nc.setTime(+r),t(Tc),t(Nc),Math.floor(e(Tc,Nc))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}function Cn(t){return Nn(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ac)/Sc})}function An(t){return Nn(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/Sc})}function Sn(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function En(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function jn(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function On(t){function n(t,n){return function(e){var r,i,o,a=[],s=-1,u=0,c=t.length;for(e instanceof Date||(e=new Date(+e));++s53)return null;"w"in a||(a.w=1),"Z"in a?(i=En(jn(a.y)),o=i.getUTCDay(),i=o>4||0===o?Hc.ceil(i):Hc(i),i=Fc.offset(i,7*(a.V-1)),a.y=i.getUTCFullYear(),a.m=i.getUTCMonth(),a.d=i.getUTCDate()+(a.w+6)%7):(i=n(jn(a.y)),o=i.getDay(),i=o>4||0===o?Ic.ceil(i):Ic(i),i=Pc.offset(i,7*(a.V-1)),a.y=i.getFullYear(),a.m=i.getMonth(),a.d=i.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),o="Z"in a?En(jn(a.y)).getUTCDay():n(jn(a.y)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(o+5)%7:a.w+7*a.U-(o+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,En(a)):n(a)}}function r(t,n,e,r){for(var i,o,a=0,s=n.length,u=e.length;a=u)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=Y[i in Jc?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function i(t,n,e){var r=E.exec(n.slice(e));return r?(t.p=j[r[0].toLowerCase()],e+r[0].length):-1}function o(t,n,e){var r=R.exec(n.slice(e));return r?(t.w=I[r[0].toLowerCase()],e+r[0].length):-1}function a(t,n,e){var r=O.exec(n.slice(e));return r?(t.w=P[r[0].toLowerCase()],e+r[0].length):-1}function s(t,n,e){var r=D.exec(n.slice(e));return r?(t.m=z[r[0].toLowerCase()],e+r[0].length):-1}function u(t,n,e){var r=L.exec(n.slice(e));return r?(t.m=U[r[0].toLowerCase()],e+r[0].length):-1}function c(t,n,e){return r(t,w,n,e)}function h(t,n,e){return r(t,M,n,e)}function f(t,n,e){return r(t,k,n,e)}function l(t){return C[t.getDay()]}function d(t){return N[t.getDay()]}function p(t){return S[t.getMonth()]}function y(t){return A[t.getMonth()]}function _(t){return T[+(t.getHours()>=12)]}function v(t){return C[t.getUTCDay()]}function g(t){return N[t.getUTCDay()]}function m(t){return S[t.getUTCMonth()]}function b(t){return A[t.getUTCMonth()]}function x(t){return T[+(t.getUTCHours()>=12)]}var w=t.dateTime,M=t.date,k=t.time,T=t.periods,N=t.days,C=t.shortDays,A=t.months,S=t.shortMonths,E=In(T),j=Ln(T),O=In(N),P=Ln(N),R=In(C),I=Ln(C),L=In(A),U=Ln(A),D=In(S),z=Ln(S),q={a:l,A:d,b:p,B:y,c:null,d:ee,e:ee,f:se,H:re,I:ie,j:oe,L:ae,m:ue,M:ce,p:_,Q:Ue,s:De,S:he,u:fe,U:le,V:de,w:pe,W:ye,x:null,X:null,y:_e,Y:ve,Z:ge,"%":Le},F={a:v,A:g,b:m,B:b,c:null,d:me,e:me,f:ke,H:be,I:xe,j:we,L:Me,m:Te,M:Ne,p:x,Q:Ue,s:De,S:Ce,u:Ae,U:Se,V:Ee,w:je,W:Oe,x:null,X:null,y:Pe,Y:Re,Z:Ie,"%":Le},Y={a:o,A:a,b:s,B:u,c:c,d:Vn,e:Vn,f:Qn,H:$n,I:$n,j:Wn,L:Gn,m:Xn,M:Zn,p:i,Q:te,s:ne,S:Jn,u:Dn,U:zn,V:qn,w:Un,W:Fn,x:h,X:f,y:Hn,Y:Yn,Z:Bn,"%":Kn};return q.x=n(M,q),q.X=n(k,q),q.c=n(w,q),F.x=n(M,F),F.X=n(k,F),F.c=n(w,F),{format:function(t){var e=n(t+="",q);return e.toString=function(){return t},e},parse:function(t){var n=e(t+="",Sn);return n.toString=function(){return t},n},utcFormat:function(t){var e=n(t+="",F);return e.toString=function(){return t},e},utcParse:function(t){var n=e(t,En);return n.toString=function(){return t},n}}}function Pn(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function Bn(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Xn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Vn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Wn(t,n,e){var r=Gc.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function $n(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Zn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Jn(t,n,e){var r=Gc.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Gn(t,n,e){var r=Gc.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Qn(t,n,e){var r=Gc.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Kn(t,n,e){var r=Qc.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function te(t,n,e){var r=Gc.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function ne(t,n,e){var r=Gc.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function ee(t,n){return Pn(t.getDate(),n,2)}function re(t,n){return Pn(t.getHours(),n,2)}function ie(t,n){return Pn(t.getHours()%12||12,n,2)}function oe(t,n){return Pn(1+Pc.count(Dc(t),t),n,3)}function ae(t,n){return Pn(t.getMilliseconds(),n,3)}function se(t,n){return ae(t,n)+"000"}function ue(t,n){return Pn(t.getMonth()+1,n,2)}function ce(t,n){return Pn(t.getMinutes(),n,2)}function he(t,n){return Pn(t.getSeconds(),n,2)}function fe(t){var n=t.getDay();return 0===n?7:n}function le(t,n){return Pn(Rc.count(Dc(t),t),n,2)}function de(t,n){var e=t.getDay();return t=e>=4||0===e?Lc(t):Lc.ceil(t),Pn(Lc.count(Dc(t),t)+(4===Dc(t).getDay()),n,2)}function pe(t){return t.getDay()}function ye(t,n){return Pn(Ic.count(Dc(t),t),n,2)}function _e(t,n){return Pn(t.getFullYear()%100,n,2)}function ve(t,n){return Pn(t.getFullYear()%1e4,n,4)}function ge(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Pn(n/60|0,"0",2)+Pn(n%60,"0",2)}function me(t,n){return Pn(t.getUTCDate(),n,2)}function be(t,n){return Pn(t.getUTCHours(),n,2)}function xe(t,n){return Pn(t.getUTCHours()%12||12,n,2)}function we(t,n){return Pn(1+Fc.count(Vc(t),t),n,3)}function Me(t,n){return Pn(t.getUTCMilliseconds(),n,3)}function ke(t,n){return Me(t,n)+"000"}function Te(t,n){return Pn(t.getUTCMonth()+1,n,2)}function Ne(t,n){return Pn(t.getUTCMinutes(),n,2)}function Ce(t,n){return Pn(t.getUTCSeconds(),n,2)}function Ae(t){var n=t.getUTCDay();return 0===n?7:n}function Se(t,n){return Pn(Yc.count(Vc(t),t),n,2)}function Ee(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Bc(t):Bc.ceil(t),Pn(Bc.count(Vc(t),t)+(4===Vc(t).getUTCDay()),n,2)}function je(t){return t.getUTCDay()}function Oe(t,n){return Pn(Hc.count(Vc(t),t),n,2)}function Pe(t,n){return Pn(t.getUTCFullYear()%100,n,2)}function Re(t,n){return Pn(t.getUTCFullYear()%1e4,n,4)}function Ie(){return"+0000"}function Le(){return"%"}function Ue(t){return+t}function De(t){return Math.floor(+t/1e3)}function ze(t){return t.toISOString()}function qe(t){var n=new Date(t);return isNaN(n)?null:n}function Fe(t){return new Date(t)}function Ye(t){return t instanceof Date?+t:+new Date(+t)}function He(t,n,e,r,i,o,a,s,u){function c(s){return(a(s)=0&&n._call.call(null,t),n=n._next;--Dh}function Er(){Hh=(Yh=Xh.now())+Bh,Dh=zh=0;try{Sr()}finally{Dh=0,Or(),Hh=0}}function jr(){var t=Xh.now(),n=t-Yh;n>Fh&&(Bh-=n,Yh=t)}function Or(){for(var t,n,e=Ih,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ih=n);Lh=t,Pr(r)}function Pr(t){if(!Dh){zh&&(zh=clearTimeout(zh));var n=t-Hh;n>24?(t<1/0&&(zh=setTimeout(Er,n)),qh&&(qh=clearInterval(qh))):(qh||(qh=setInterval(jr,Fh)),Dh=1,Vh(Er))}}function Rr(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Jh)throw new Error("too late");return e}function Ir(t,n){var e=t.__transition;if(!e||!(e=e[n])||e.state>Qh)throw new Error("too late");return e}function Lr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("too late");return e}function Ur(t,n,e){function r(t){e.state=Gh,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}function i(r){var c,h,f,l;if(e.state!==Gh)return a();for(c in u)if(l=u[c],l.name===e.name){if(l.state===Kh)return Wh(i);l.state===tf?(l.state=ef,l.timer.stop(),l.on.call("interrupt",t,t.__data__,l.index,l.group),delete u[c]):+c=0&&(t=t.slice(0,n)),!t||"start"===t})}function ni(t,n,e){var r,i,o=ti(n)?Rr:Ir;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(n,e),a.on=i}}function ei(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function ri(t,n){var e,r,i;return function(){var o=$(this,t),a=(this.style.removeProperty(t),$(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}function ii(t){return function(){this.style.removeProperty(t)}}function oi(t,n,e){var r,i;return function(){var o=$(this,t);return o===e?null:o===r?i:i=n(r=o,e)}}function ai(t,n,e){var r,i,o;return function(){var a=$(this,t),s=e(this);return null==s&&(this.style.removeProperty(t),s=$(this,t)),a===s?null:a===r&&s===i?o:o=n(r=a,i=s)}}function si(t,n,e){function r(){var r=this,i=n.apply(r,arguments);return i&&function(n){r.style.setProperty(t,i(n),e)}}return r._value=n,r}function ui(t){return function(){this.textContent=t}}function ci(t){return function(){var n=t(this);this.textContent=null==n?"":n}}function hi(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function fi(t){return bt().transition(t)}function li(){return++Nf}function di(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}function pi(t){return(t=+t)r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function Ti(t){return t[0]}function Ni(t){return t[1]}function Ci(){this._=null}function Ai(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Si(t,n){var e=n,r=n.R,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Ei(t,n){var e=n,r=n.L,i=e.U;i?i.L===e?i.L=r:i.R=r:t._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function ji(t){for(;t.L;)t=t.L;return t}function Oi(t,n,e,r){var i=[null,null],o=Zf.push(i)-1;return i.left=t,i.right=n,e&&Ri(i,t,n,e),r&&Ri(i,n,t,r),Wf[t.index].halfedges.push(o),Wf[n.index].halfedges.push(o),i}function Pi(t,n,e){var r=[n,e];return r.left=t,r}function Ri(t,n,e,r){t[0]||t[1]?t.left===e?t[1]=r:t[0]=r:(t[0]=r,t.left=n,t.right=e)}function Ii(t,n,e,r,i){var o,a=t[0],s=t[1],u=a[0],c=a[1],h=s[0],f=s[1],l=0,d=1,p=h-u,y=f-c;if(o=n-u,p||!(o>0)){if(o/=p,p<0){if(o0){if(o>d)return;o>l&&(l=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>d)return;o>l&&(l=o)}else if(p>0){if(o0)){if(o/=y,y<0){if(o0){if(o>d)return;o>l&&(l=o)}if(o=i-c,y||!(o<0)){if(o/=y,y<0){if(o>d)return;o>l&&(l=o)}else if(y>0){if(o0||d<1)||(l>0&&(t[0]=[u+l*p,c+l*y]),d<1&&(t[1]=[u+d*p,c+d*y]),!0)}}}}}function Li(t,n,e,r,i){var o=t[1];if(o)return!0;var a,s,u=t[0],c=t.left,h=t.right,f=c[0],l=c[1],d=h[0],p=h[1],y=(f+d)/2,_=(l+p)/2;if(p===l){if(y=r)return;if(f>d){if(u){if(u[1]>=i)return}else u=[y,e];o=[y,i]}else{if(u){if(u[1]1)if(f>d){if(u){if(u[1]>=i)return}else u=[(e-s)/a,e];o=[(i-s)/a,i]}else{if(u){if(u[1]=r)return}else u=[n,a*n+s];o=[r,a*r+s]}else{if(u){if(u[0]Qf||Math.abs(i[0][1]-i[1][1])>Qf)||delete Zf[o]}function Di(t){return Wf[t.index]={site:t,halfedges:[]}}function zi(t,n){var e=t.site,r=n.left,i=n.right;return e===i&&(i=r,r=e),i?Math.atan2(i[1]-r[1],i[0]-r[0]):(e===r?(r=n[1],i=n[0]):(r=n[0],i=n[1]),Math.atan2(r[0]-i[0],i[1]-r[1]))}function qi(t,n){return n[+(n.left!==t.site)]}function Fi(t,n){return n[+(n.left===t.site)]}function Yi(){for(var t,n,e,r,i=0,o=Wf.length;iQf||Math.abs(y-l)>Qf)&&(u.splice(s,0,Zf.push(Pi(a,d,Math.abs(p-t)Qf?[t,Math.abs(f-t)Qf?[Math.abs(l-r)Qf?[e,Math.abs(f-e)Qf?[Math.abs(l-n)=-Kf)){var d=u*u+c*c,p=h*h+f*f,y=(f*d-c*p)/l,_=(u*p-h*d)/l,v=Jf.pop()||new Bi;v.arc=t,v.site=i,v.x=y+a,v.y=(v.cy=_+s)+Math.sqrt(y*y+_*_),t.circle=v;for(var g=null,m=$f._;m;)if(v.yQf)s=s.L;else{if(!((i=o-Ki(s,a))>Qf)){r>-Qf?(n=s.P,e=s):i>-Qf?(n=s,e=s.N):n=e=s;break}if(!s.R){n=s;break}s=s.R}Di(t);var u=$i(t);if(Vf.insert(n,u),n||e){if(n===e)return Vi(n),e=$i(n.site),Vf.insert(u,e),u.edge=e.edge=Oi(n.site,u.site),Xi(n),void Xi(e);if(!e)return void(u.edge=Oi(n.site,u.site));Vi(n),Vi(e);var c=n.site,h=c[0],f=c[1],l=t[0]-h,d=t[1]-f,p=e.site,y=p[0]-h,_=p[1]-f,v=2*(l*_-d*y),g=l*l+d*d,m=y*y+_*_,b=[(_*g-d*m)/v+h,(l*m-y*g)/v+f];Ri(e.edge,c,p,b),u.edge=Oi(c,t,null,b),e.edge=Oi(t,p,null,b),Xi(n),Xi(e)}}function Qi(t,n){var e=t.site,r=e[0],i=e[1],o=i-n;if(!o)return r;var a=t.P;if(!a)return-1/0;e=a.site;var s=e[0],u=e[1],c=u-n;if(!c)return s;var h=s-r,f=1/o-1/c,l=h/c;return f?(-l+Math.sqrt(l*l-2*f*(h*h/(-2*c)-u+c/2+i-o/2)))/f+r:(r+s)/2}function Ki(t,n){var e=t.N;if(e)return Qi(e,n);var r=t.site;return r[1]===n?r[0]:1/0}function to(t,n,e){return(t[0]-e[0])*(n[1]-t[1])-(t[0]-n[0])*(e[1]-t[1])}function no(t,n){return n[1]-t[1]||n[0]-t[0]}function eo(t,n){var e,r,i,o=t.sort(no).pop();for(Zf=[],Wf=new Array(t.length),Vf=new Ci,$f=new Ci;;)if(i=Xf,o&&(!i||o[1]=(o=(y+v)/2))?y=o:v=o,(h=e>=(a=(_+g)/2))?_=a:g=a,i=d,!(d=d[f=h<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),u=+t._y.call(null,d.data),n===s&&e===u)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=n>=(o=(y+v)/2))?y=o:v=o,(h=e>=(a=(_+g)/2))?_=a:g=a}while((f=h<<1|c)==(l=(u>=a)<<1|s>=o));return i[l]=d,i[f]=p,t}function io(t){var n,e,r,i,o=t.length,a=new Array(o),s=new Array(o),u=1/0,c=1/0,h=-1/0,f=-1/0;for(e=0;eh&&(h=r),if&&(f=i));for(h=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function vo(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;rn?1:t>=n?0:NaN}function To(t){return function(){this.removeAttribute(t)}}function No(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Co(t,n){return function(){this.setAttribute(t,n)}}function Ao(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function So(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Eo(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function jo(t){return function(){this.style.removeProperty(t)}}function Oo(t,n,e){return function(){this.style.setProperty(t,n,e)}}function Po(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Ro(t){return function(){delete this[t]}}function Io(t,n){return function(){this[t]=n}}function Lo(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Uo(t){return t.trim().split(/^|\s+/)}function Do(t){return t.classList||new zo(t)}function zo(t){this._node=t,this._names=Uo(t.getAttribute("class")||"")}function qo(t,n){for(var e=Do(t),r=-1,i=n.length;++r=1?fd:t<=-1?-fd:Math.asin(t)}function la(t,n,e,r,i,o,a,s){var u=e-t,c=r-n,h=a-i,f=s-o,l=(h*(n-o)-f*(t-i))/(f*u-h*c);return[t+l*u,n+l*c]}function da(t,n,e,r,i,o,a){var s=t-e,u=n-r,c=(a?o:-o)/Math.sqrt(s*s+u*u),h=c*u,f=-c*s,l=t+h,d=n+f,p=e+h,y=r+f,_=(l+p)/2,v=(d+y)/2,g=p-l,m=y-d,b=g*g+m*m,x=i-o,w=l*y-p*d,M=(m<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-w*w)),k=(w*m-g*M)/b,T=(-w*g-m*M)/b,N=(w*m+g*M)/b,C=(-w*g+m*M)/b,A=k-_,S=T-v,E=N-_,j=C-v;return A*A+S*S>E*E+j*j&&(k=N,T=C),{cx:k,cy:T,x01:-h,y01:-f,x11:k*(i/x-1),y11:T*(i/x-1)}}function pa(t){this._context=t}function ya(t){return t[0]}function _a(t){return t[1]}function va(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function ga(t,n){this._context=t,this._k=(1-n)/6}function ma(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>cd){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,u=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/u,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/u}if(t._l23_a>cd){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,h=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-n*t._l12_2a)/h,a=(a*c+t._y1*t._l23_2a-e*t._l12_2a)/h}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function ba(t,n){this._context=t,this._alpha=n}function xa(t){return t<0?-1:1}function wa(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(xa(o)+xa(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Ma(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function ka(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*n,o-s,a-s*e,o,a)}function Ta(t){this._context=t}function Na(t){this._context=new Ca(t)}function Ca(t){this._context=t}function Aa(){var t=[],n=void 0,e=void 0,r=[],i={},o={},a=!1,s=void 0,u=Kd,c=void 0,h=void 0,f=p("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),l=void 0,d=function(e){l=e,a||e.selectAll("circle.handle").remove();var d=t.map(function(t){return t.type||(t.type=u),t.disable||(t.disable=r),new kd(t)});n=n||new Td({annotations:d,accessors:i,accessorsInverse:o,ids:s}),e.selectAll("g").data([n]).enter().append("g").attr("class","annotations");var p=e.select("g.annotations");sp(p,n.annotations,"g","annotation"),p.selectAll("g.annotation").each(function(t){var n=sd(this);n.attr("class","annotation"),sp(n,[t],"g","annotation-connector"),sp(n,[t],"g","annotation-subject"),sp(n,[t],"g","annotation-note"),sp(n.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:n,annotation:t,textWrap:c,notePadding:h,editMode:a,dispatcher:f,accessors:i}),t.type.draw(),t.type.drawText&&t.type.drawText()})};return d.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",n.json),window.copy(JSON.stringify(n.json.map(function(t){return delete t.type,t}))),d},d.update=function(){return t&&n&&(t=n.annotations.map(function(t){return t.type.draw(),t})),d},d.updateText=function(){return n&&(n.updateText(c),t=n.annotations),d},d.updatedAccessors=function(){return n.setPositionWithAccessors(),t=n.annotations,d},d.disable=function(e){return arguments.length?(r=e,n&&(n.updateDisable(r),t=n.annotations),d):r},d.textWrap=function(e){return arguments.length?(c=e,n&&(n.updateTextWrap(c),t=n.annotations),d):c},d.notePadding=function(e){return arguments.length?(h=e,n&&(n.updateNotePadding(h),t=n.annotations),d):h},d.type=function(e,r){return arguments.length?(u=e,n&&(n.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=u,t.subject=r&&r.subject||t.subject,t.connector=r&&r.connector||t.connector,t.note=r&&r.note||t.note}),t=n.annotations),d):u},d.annotations=function(e){if(!arguments.length)return n&&n.annotations||t;if(t=e,n&&n.annotations){t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(n=null,d(l)):n.annotations=t}return d},d.context=function(t){return arguments.length?(e=t,d):e},d.accessors=function(t){return arguments.length?(i=t,d):i},d.accessorsInverse=function(t){return arguments.length?(o=t,d):o},d.ids=function(t){return arguments.length?(s=t,d):s},d.editMode=function(e){return arguments.length?(a=e,l&&l.selectAll("g.annotation").classed("editable",a),n&&(n.editMode(a),t=n.annotations),d):a},d.collection=function(t){return arguments.length?(n=t,d):n},d.on=function(){var t=f.on.apply(f,arguments);return t===f?d:t},d}var Sa=[].slice,Ea={};n.prototype=s.prototype={constructor:n,defer:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("defer after await");if(null!=this._error)return this;var n=Sa.call(arguments,1);return n.push(t),++this._waiting,this._tasks.push(n),e(this),this},abort:function(){return null==this._error&&o(this,new Error("abort")),this},await:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=function(n,e){t.apply(null,[n].concat(e))},a(this),this},awaitAll:function(t){if("function"!=typeof t)throw new Error("invalid callback");if(this._call)throw new Error("multiple await");return this._call=t,a(this),this}};u.prototype=c.prototype={constructor:u,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,n){return this["$"+t]=n,this},remove:function(t){var n="$"+t;return n in this&&delete this[n]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(n.slice(1));return t},values:function(){var t=[];for(var n in this)"$"===n[0]&&t.push(this[n]);return t},entries:function(){var t=[];for(var n in this)"$"===n[0]&&t.push({key:n.slice(1),value:this[n]});return t},size:function(){var t=0;for(var n in this)"$"===n[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var n in this)"$"===n[0]&&t(this[n],n.slice(1),this)}};var ja=function(){function t(n,i,a,s){if(i>=o.length)return null!=e&&n.sort(e),null!=r?r(n):n;for(var u,h,f,l=-1,d=n.length,p=o[i++],y=c(),_=a();++lo.length)return t;var i,s=a[e-1];return null!=r&&e>=o.length?i=t.entries():(i=[],t.each(function(t,r){i.push({key:r,values:n(t,e)})})),null!=s?i.sort(function(t,n){return s(t.key,n.key)}):i}var e,r,i,o=[],a=[];return i={object:function(n){return t(n,0,h,f)},map:function(n){return t(n,0,l,d)},entries:function(e){return n(t(e,0,l,d),0)},key:function(t){return o.push(t),i},sortKeys:function(t){return a[o.length-1]=t,i},sortValues:function(t){return e=t,i},rollup:function(t){return r=t,i}}},Oa={value:function(){}};y.prototype=p.prototype={constructor:y,on:function(t,n){var e,r=this._,i=_(t+"",r),o=-1,a=i.length;{if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),o=0;o=200&&e<300||304===e){if(o)try{n=o.call(r,h)}catch(t){return void s.call("error",r,t)}else n=h;s.call("load",r,n)}else s.call("error",r,t)}var r,i,o,a,s=p("beforesend","progress","load","error"),u=c(),h=new XMLHttpRequest,f=null,l=null,d=0;if("undefined"==typeof XDomainRequest||"withCredentials"in h||!/^(http(s)?:)?\/\//.test(t)||(h=new XDomainRequest),"onload"in h?h.onload=h.onerror=h.ontimeout=e:h.onreadystatechange=function(t){h.readyState>3&&e(t)},h.onprogress=function(t){s.call("progress",r,t)},r={header:function(t,n){return t=(t+"").toLowerCase(),arguments.length<2?u.get(t):(null==n?u.remove(t):u.set(t,n+""),r)},mimeType:function(t){return arguments.length?(i=null==t?null:t+"",r):i},responseType:function(t){return arguments.length?(a=t,r):a},timeout:function(t){return arguments.length?(d=+t,r):d},user:function(t){return arguments.length<1?f:(f=null==t?null:t+"",r)},password:function(t){return arguments.length<1?l:(l=null==t?null:t+"",r)},response:function(t){return o=t,r},get:function(t,n){return r.send("GET",t,n)},post:function(t,n){return r.send("POST",t,n)},send:function(n,e,o){return h.open(n,t,!0,f,l),null==i||u.has("accept")||u.set("accept",i+",*/*"),h.setRequestHeader&&u.each(function(t,n){h.setRequestHeader(n,t)}),null!=i&&h.overrideMimeType&&h.overrideMimeType(i),null!=a&&(h.responseType=a),d>0&&(h.timeout=d),null==o&&"function"==typeof e&&(o=e,e=null),null!=o&&1===o.length&&(o=m(o)),null!=o&&r.on("error",o).on("load",function(t){o(null,t)}),s.call("beforesend",r,h),h.send(null==e?null:e),r},abort:function(){return h.abort(),r},on:function(){var t=s.on.apply(s,arguments);return t===s?r:t}},null!=n){if("function"!=typeof n)throw new Error("invalid callback: "+n);return r.get(n)}return r},Ra=function(t,n){return function(e,r){var i=Pa(e).mimeType(t).response(n);if(null!=r){if("function"!=typeof r)throw new Error("invalid callback: "+r);return i.get(r)}return i}}("application/json",function(t){return JSON.parse(t.responseText)}),Ia=function(t){function n(t,n){var r,i,o=e(t,function(t,e){if(r)return r(t,e-1);i=t,r=n?w(t,n):x(t)});return o.columns=i,o}function e(t,n){function e(){if(h>=c)return a;if(i)return i=!1,o;var n,e=h;if(34===t.charCodeAt(e)){for(var r=e;r++=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),qa.hasOwnProperty(n)?{space:qa[n],local:t}:t},Ya=function(t){var n=Fa(t);return(n.local?N:T)(n)},Ha=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Ba=document.documentElement;if(!Ba.matches){var Xa=Ba.webkitMatchesSelector||Ba.msMatchesSelector||Ba.mozMatchesSelector||Ba.oMatchesSelector;Ha=function(t){return function(){return Xa.call(this,t)}}}}var Va=Ha,Wa={};if(t.event=null,"undefined"!=typeof document){"onmouseenter"in document.documentElement||(Wa={mouseenter:"mouseover",mouseleave:"mouseout"})}var $a=function(t,n,e){var r,i,o=S(t+""),a=o.length;{if(!(arguments.length<2)){for(s=n?j:E,null==e&&(e=!1),r=0;r=b&&(b=m+1);!(g=_[b])&&++b=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},fs=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=D);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?X:"function"==typeof n?W:V)(t,n,null==e?"":e)):$(this.node(),t)},xs=function(t,n){return arguments.length>1?this.each((null==n?Z:"function"==typeof n?G:J)(t,n)):this.node()[t]};tt.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ws=function(t,n){var e=Q(t+"");if(arguments.length<2){for(var r=K(this.node()),i=-1,o=e.length;++in?1:t>=n?0:NaN},Us=function(t){return 1===t.length&&(t=xt(t)),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}},Ds=Us(Ls),zs=Ds.right,qs=function(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++sh;)f.pop(),--l;var d,p=new Array(l+1);for(i=0;i<=l;++i)d=p[i]=[],d.x0=i>0?f[i-1]:c,d.x1=i=0;)for(r=t[i],n=r.length;--n>=0;)e[--a]=r[n];return e},Ks=Array.prototype,tu=Ks.map,nu=Ks.slice,eu={name:"implicit"},ru=function(t,n,e){t.prototype=n.prototype=e,e.constructor=t},iu="\\s*([+-]?\\d+)\\s*",ou="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",au="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",su=/^#([0-9a-f]{3})$/,uu=/^#([0-9a-f]{6})$/,cu=new RegExp("^rgb\\("+[iu,iu,iu]+"\\)$"),hu=new RegExp("^rgb\\("+[au,au,au]+"\\)$"),fu=new RegExp("^rgba\\("+[iu,iu,iu,ou]+"\\)$"),lu=new RegExp("^rgba\\("+[au,au,au,ou]+"\\)$"),du=new RegExp("^hsl\\("+[ou,au,au]+"\\)$"),pu=new RegExp("^hsla\\("+[ou,au,au,ou]+"\\)$"),yu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ru(St,Et,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),ru(It,Rt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new It(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new It(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),ru(zt,Dt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new zt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new zt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new It(qt(t>=240?t-240:t+120,i,r),qt(t,i,r),qt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var _u=Math.PI/180,vu=180/Math.PI,gu=.95047,mu=1,bu=1.08883,xu=4/29,wu=6/29,Mu=3*wu*wu,ku=wu*wu*wu;ru(Ht,Yt,At(St,{brighter:function(t){return new Ht(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new Ht(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;return t=mu*Xt(t),n=gu*Xt(n),e=bu*Xt(e),new It(Vt(3.2404542*n-1.5371385*t-.4985314*e),Vt(-.969266*n+1.8760108*t+.041556*e),Vt(.0556434*n-.2040259*t+1.0572252*e),this.opacity)}})),ru(Jt,Zt,At(St,{brighter:function(t){return new Jt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new Jt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return Ft(this).rgb()}}));var Tu=-.14861,Nu=1.78277,Cu=-.29227,Au=-.90649,Su=1.97294,Eu=Su*Au,ju=Su*Nu,Ou=Nu*Cu-Au*Tu;ru(Kt,Qt,At(St,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*_u,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new It(255*(n+e*(Tu*r+Nu*i)),255*(n+e*(Cu*r+Au*i)),255*(n+e*(Su*r)),this.opacity)}}));var Pu,Ru,Iu,Lu,Uu=function(t){return function(){return t}},Du=function t(n){function e(t,n){var e=r((t=Rt(t)).r,(n=Rt(n)).r),i=r(t.g,n.g),o=r(t.b,n.b),a=on(t.opacity,n.opacity);return function(n){return t.r=e(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}var r=rn(n);return e.gamma=t,e}(1),zu=function(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(r),a=new Array(r);for(e=0;eo&&(i=n.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Fu(e,r)})),o=Bu.lastIndex;return o1?r[0]+r.slice(2):r,+t.slice(e+1)]},sc=function(t){return t=ac(Math.abs(t)),t?t[1]:NaN},uc=function(t,n){return function(e,r){for(var i=e.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(e.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}},cc=function(t,n){t=t.toPrecision(n);t:for(var e,r=t.length,i=1,o=-1;i0&&(o=0)}return o>0?t.slice(0,o)+t.slice(e+1):t},hc=function(t,n){var e=ac(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(nc=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ac(t,Math.max(0,n+o-1))[0]},fc=function(t,n){var e=ac(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},lc={"":cc,"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return fc(100*t,n)},r:fc,s:hc,X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},dc=/^(?:(.)?([<>=^]))?([+\-\( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?([a-z%])?$/i,pc=function(t){return new wn(t)};wn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+this.type};var yc,_c,vc,gc=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"],mc=function(t){function n(t){function n(t){var n,i,u,g=p,m=y;if("c"===d)m=_(t)+m,t="";else{t=+t;var b=(t<0||1/t<0)&&(t*=-1,!0);if(t=_(t,l),b)for(n=-1,i=t.length,b=!1;++n(u=t.charCodeAt(n))||u>57){m=(46===u?o+t.slice(n+1):t.slice(n))+m,t=t.slice(0,n);break}}f&&!c&&(t=r(t,1/0));var x=g.length+t.length+m.length,w=x>1)+g+t+m+w.slice(x)}return w+g+t+m}t=pc(t);var e=t.fill,a=t.align,s=t.sign,u=t.symbol,c=t.zero,h=t.width,f=t.comma,l=t.precision,d=t.type,p="$"===u?i[0]:"#"===u&&/[boxX]/.test(d)?"0"+d.toLowerCase():"",y="$"===u?i[1]:/[%p]/.test(d)?"%":"",_=lc[d],v=!d||/[defgprs%]/.test(d);return l=null==l?d?6:12:/[gprs]/.test(d)?Math.max(1,Math.min(21,l)):Math.max(0,Math.min(20,l)),n.toString=function(){return t+""},n}function e(t,e){var r=n((t=pc(t),t.type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(sc(e)/3))),o=Math.pow(10,-i),a=gc[8+i/3];return function(t){return r(o*t)+a}}var r=t.grouping&&t.thousands?uc(t.grouping,t.thousands):Mn,i=t.currency,o=t.decimal;return{format:n,formatPrefix:e}};!function(t){yc=mc(t),_c=yc.format,vc=yc.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var bc=function(t){return Math.max(0,-sc(Math.abs(t)))},xc=function(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(sc(n)/3)))-sc(Math.abs(t)))},wc=function(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,sc(n)-sc(t))+1},Mc=function(t,n,e){var r,i=t[0],o=t[t.length-1],a=Mt(i,o,null==n?10:n);switch(e=pc(null==e?",f":e),e.type){case"s":var s=Math.max(Math.abs(i),Math.abs(o));return null!=e.precision||isNaN(r=xc(a,s))||(e.precision=r),vc(e,s);case"":case"e":case"g":case"p":case"r":null!=e.precision||isNaN(r=wc(a,Math.max(Math.abs(i),Math.abs(o))))||(e.precision=r-("e"===e.type));break;case"f":case"%":null!=e.precision||isNaN(r=bc(a))||(e.precision=r-2*("%"===e.type))}return _c(e)},kc=function(t,n){t=t.slice();var e,r=0,i=t.length-1,o=t[r],a=t[i];return a0?t>1?Nn(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Cc:null};var Ac=6e4,Sc=6048e5,Ec=Nn(function(t){t.setTime(1e3*Math.floor(t/1e3))},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),jc=Nn(function(t){t.setTime(Math.floor(t/Ac)*Ac)},function(t,n){t.setTime(+t+n*Ac)},function(t,n){return(n-t)/Ac},function(t){return t.getMinutes()}),Oc=Nn(function(t){var n=t.getTimezoneOffset()*Ac%36e5;n<0&&(n+=36e5),t.setTime(36e5*Math.floor((+t-n)/36e5)+n)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),Pc=Nn(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ac)/864e5},function(t){return t.getDate()-1}),Rc=Cn(0),Ic=Cn(1),Lc=(Cn(2),Cn(3),Cn(4)),Uc=(Cn(5),Cn(6),Nn(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()})),Dc=Nn(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Dc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Nn(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var zc=Nn(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Ac)},function(t,n){return(n-t)/Ac},function(t){return t.getUTCMinutes()}),qc=Nn(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),Fc=Nn(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Yc=An(0),Hc=An(1),Bc=(An(2),An(3),An(4)),Xc=(An(5),An(6),Nn(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()})),Vc=Nn(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Vc.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Nn(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Wc,$c,Zc,Jc={"-":"",_:" ",0:"0"},Gc=/^\s*\d+/,Qc=/^%/,Kc=/[\\^$*+?|[\]().{}]/g;!function(n){Wc=On(n),t.timeFormat=Wc.format,t.timeParse=Wc.parse,$c=Wc.utcFormat,Zc=Wc.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var th=(Date.prototype.toISOString||$c("%Y-%m-%dT%H:%M:%S.%LZ"),+new Date("2000-01-01T00:00:00.000Z")||Zc("%Y-%m-%dT%H:%M:%S.%LZ"),1e3),nh=60*th,eh=60*nh,rh=24*eh,ih=7*rh,oh=30*rh,ah=365*rh,sh=function(){return He(Dc,Uc,Rc,Pc,Oc,jc,Ec,Cc,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)])},uh=function(){return He(Vc,Xc,Yc,Fc,qc,zc,Ec,Cc,$c).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)])},ch=function(t){return t.match(/.{6}/g).map(function(t){return"#"+t})};ch("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ch("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),ch("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9");var hh=ch("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5");ec(Qt(300,.5,0),Qt(-240,.5,1));ec(Qt(-100,.75,.35),Qt(80,1.5,.8)),ec(Qt(260,.75,.35),Qt(80,1.5,.8)),Qt();Be(ch("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var fh=(Be(ch("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Be(ch("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Be(ch("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),Math.PI),lh=2*fh,dh=lh-1e-6;Xe.prototype=Ve.prototype={ +constructor:Xe,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,r){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+r)},bezierCurveTo:function(t,n,e,r,i,o){this._+="C"+ +t+","+ +n+","+ +e+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,n,e,r,i){t=+t,n=+n,e=+e,r=+r,i=+i;var o=this._x1,a=this._y1,s=e-t,u=r-n,c=o-t,h=a-n,f=c*c+h*h;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(f>1e-6)if(Math.abs(h*s-u*c)>1e-6&&i){var l=e-o,d=r-a,p=s*s+u*u,y=l*l+d*d,_=Math.sqrt(p),v=Math.sqrt(f),g=i*Math.tan((fh-Math.acos((p+f-y)/(2*_*v)))/2),m=g/v,b=g/_;Math.abs(m-1)>1e-6&&(this._+="L"+(t+m*c)+","+(n+m*h)),this._+="A"+i+","+i+",0,0,"+ +(h*l>c*d)+","+(this._x1=t+b*s)+","+(this._y1=n+b*u)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n,e=+e;var a=e*Math.cos(r),s=e*Math.sin(r),u=t+a,c=n+s,h=1^o,f=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+u+","+c:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-c)>1e-6)&&(this._+="L"+u+","+c),e&&(f>dh?this._+="A"+e+","+e+",0,1,"+h+","+(t-a)+","+(n-s)+"A"+e+","+e+",0,1,"+h+","+(this._x1=u)+","+(this._y1=c):(f<0&&(f=f%lh+lh),this._+="A"+e+","+e+",0,"+ +(f>=fh)+","+h+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var ph=function(t){return function(){return t}};Math.PI;We.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var yh=function(t){return new We(t)},_h=function(){function t(t){var s,u,c,h=t.length,f=!1;for(null==i&&(a=o(c=Ve())),s=0;s<=h;++s)!(s=h;--f)c.point(_[f],v[f]);c.lineEnd(),c.areaEnd()}y&&(_[n]=+e(l,n,t),v[n]=+i(l,n,t),c.point(r?+r(l,n,t):_[n],o?+o(l,n,t):v[n]))}if(d)return c=null,d+""||null}function n(){return _h().defined(a).curve(u).context(s)}var e=$e,r=null,i=ph(0),o=Ze,a=ph(!0),s=null,u=yh,c=null;return t.x=function(n){return arguments.length?(e="function"==typeof n?n:ph(+n),r=null,t):e},t.x0=function(n){return arguments.length?(e="function"==typeof n?n:ph(+n),t):e},t.x1=function(n){return arguments.length?(r=null==n?null:"function"==typeof n?n:ph(+n),t):r},t.y=function(n){return arguments.length?(i="function"==typeof n?n:ph(+n),o=null,t):i},t.y0=function(n){return arguments.length?(i="function"==typeof n?n:ph(+n),t):i},t.y1=function(n){return arguments.length?(o=null==n?null:"function"==typeof n?n:ph(+n),t):o},t.lineX0=t.lineY0=function(){return n().x(e).y(i)},t.lineY1=function(){return n().x(e).y(o)},t.lineX1=function(){return n().x(r).y(i)},t.defined=function(n){return arguments.length?(a="function"==typeof n?n:ph(!!n),t):a},t.curve=function(n){return arguments.length?(u=n,null!=s&&(c=u(s)),t):u},t.context=function(n){return arguments.length?(null==n?s=c=null:c=u(s=n),t):s},t},gh=Array.prototype.slice;Ge.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Je(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Je(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};var mh=function(t){return new Ge(t)};Qe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,s=n[e]-o,u=-1;++u<=e;)r=u/e,this._basis.point(this._beta*t[u]+(1-this._beta)*(i+r*a),this._beta*n[u]+(1-this._beta)*(o+r*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var bh=function t(n){function e(t){return 1===n?new Ge(t):new Qe(t,n)}return e.beta=function(n){return t(+n)},e}(.85);tr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ke(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Ke(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var xh=function t(n){function e(t){return new tr(t,n)}return e.tension=function(n){return t(+n)},e}(0);or.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ir(this,this._t0,rr(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var e=NaN;if(t=+t,n=+n,t!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,ir(this,rr(this,e=er(this,t,n)),e);break;default:ir(this,this._t0,e=er(this,t,n))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=e}}},(ar.prototype=Object.create(or.prototype)).point=function(t,n){or.prototype.point.call(this,n,t)},sr.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,r,i,o){this._context.bezierCurveTo(n,t,r,e,o,i)}};var wh=function(t,n){if((i=t.length)>1)for(var e,r,i,o=1,a=t[n[0]],s=a.length;o=0;)e[n]=n;return e},kh=function(){function t(t){var o,a,s=n.apply(this,arguments),u=t.length,c=s.length,h=new Array(c);for(o=0;oQh&&e.stateE}i.zoom("mouse",m(r(i.that.__zoom,i.mouse[0]=Ga(i.that),i.mouse[1]),i.extent,M))}function e(){o.on("mousemove.zoom mouseup.zoom",null),br(t.event.view,i.moved),Yf(),i.end()}if(!_&&v.apply(this,arguments)){var i=a(this,arguments),o=Ps(t.event.view).on("mousemove.zoom",n,!0).on("mouseup.zoom",e,!0),s=Ga(this),u=t.event.clientX,c=t.event.clientY;Ph(t.event.view),gi(),i.mouse=[s,this.__zoom.invert(s)],of(this),i.start()}}function h(){if(v.apply(this,arguments)){var i=this.__zoom,a=Ga(this),s=i.invert(a),u=i.k*(t.event.shiftKey?.5:2),c=m(r(e(i,u),a,s),g.apply(this,arguments),M);Yf(),k>0?Ps(this).transition().duration(k).call(o,c,a):Ps(this).call(n.transform,c)}}function f(){if(v.apply(this,arguments)){var n,e,r,i,o=a(this,arguments),s=t.event.changedTouches,u=s.length;for(gi(),e=0;e=s)return null;var u=t-i.site[0],c=n-i.site[1],h=u*u+c*c;do{i=o.cells[r=a],a=null,i.halfedges.forEach(function(e){var r=o.edges[e],s=r.left;if(s!==i.site&&s||(s=r.right)){var u=t-s[0],c=n-s[1],f=u*u+c*c;ft||t>i||r>n||n>o))return this;var a,s,u=i-e,c=this._root;switch(s=(n<(r+o)/2)<<1|t<(e+i)/2){case 0:do{a=new Array(4),a[s]=c,c=a}while(u*=2,i=e+u,o=r+u,t>i||n>o);break;case 1:do{a=new Array(4),a[s]=c,c=a}while(u*=2,e=i-u,o=r+u,e>t||n>o);break;case 2:do{a=new Array(4),a[s]=c,c=a}while(u*=2,i=e+u,r=o-u,t>i||r>n);break;case 3:do{a=new Array(4),a[s]=c,c=a}while(u*=2,e=i-u,r=o-u,e>t||r>n)}this._root&&this._root.length&&(this._root=c)}return this._x0=e,this._y0=r,this._x1=i,this._y1=o,this},rl=function(){var t=[];return this.visit(function(n){if(!n.length)do{t.push(n.data)}while(n=n.next)}),t},il=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ol=function(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i},al=function(t,n,e){var r,i,o,a,s,u,c,h=this._x0,f=this._y0,l=this._x1,d=this._y1,p=[],y=this._root;for(y&&p.push(new ol(y,h,f,l,d)),null==e?e=1/0:(h=t-e,f=n-e,l=t+e,d=n+e,e*=e);u=p.pop();)if(!(!(y=u.node)||(i=u.x0)>l||(o=u.y0)>d||(a=u.x1)=v)<<1|t>=_)&&(u=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=u)}else{var g=t-+this._x.call(null,y.data),m=n-+this._y.call(null,y.data),b=g*g+m*m;if(b=(s=(p+_)/2))?p=s:_=s,(h=a>=(u=(y+v)/2))?y=u:v=u,n=d,!(d=d[f=h<<1|c]))return this;if(!d.length)break;(n[f+1&3]||n[f+2&3]||n[f+3&3])&&(e=n,l=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[f]=i:delete n[f],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[l]=d:this._root=d),this):(this._root=i,this)},ul=function(){return this._root},cl=function(){var t=0;return this.visit(function(n){if(!n.length)do{++t}while(n=n.next)}),t},hl=function(t){var n,e,r,i,o,a,s=[],u=this._root;for(u&&s.push(new ol(u,this._x0,this._y0,this._x1,this._y1));n=s.pop();)if(!t(u=n.node,r=n.x0,i=n.y0,o=n.x1,a=n.y1)&&u.length){var c=(r+o)/2,h=(i+a)/2;(e=u[3])&&s.push(new ol(e,c,h,o,a)),(e=u[2])&&s.push(new ol(e,r,h,c,a)),(e=u[1])&&s.push(new ol(e,c,i,o,h)),(e=u[0])&&s.push(new ol(e,r,i,c,h))}return this},fl=function(t){var n,e=[],r=[];for(this._root&&e.push(new ol(this._root,this._x0,this._y0,this._x1,this._y1));n=e.pop();){var i=n.node;if(i.length){var o,a=n.x0,s=n.y0,u=n.x1,c=n.y1,h=(a+u)/2,f=(s+c)/2;(o=i[0])&&e.push(new ol(o,a,s,h,f)),(o=i[1])&&e.push(new ol(o,h,s,u,f)),(o=i[2])&&e.push(new ol(o,a,f,h,c)),(o=i[3])&&e.push(new ol(o,h,f,u,c))}r.push(n)}for(;n=r.pop();)t(n.node,n.x0,n.y0,n.x1,n.y1);return this},ll=function(t){return arguments.length?(this._x=t,this):this._x},dl=function(t){return arguments.length?(this._y=t,this):this._y},pl=uo.prototype=co.prototype;pl.copy=function(){var t,n,e=new co(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=ho(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=ho(n));return e},pl.add=nl,pl.addAll=io,pl.cover=el,pl.data=rl,pl.extent=il,pl.find=al,pl.remove=sl,pl.removeAll=oo,pl.root=ul,pl.size=cl,pl.visit=hl,pl.visitAfter=fl,pl.x=ll,pl.y=dl;var yl="http://www.w3.org/1999/xhtml",_l={svg:"http://www.w3.org/2000/svg",xhtml:yl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},vl=function(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),_l.hasOwnProperty(n)?{space:_l[n],local:t}:t},gl=function(t){var n=vl(t);return(n.local?lo:fo)(n)},ml=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var bl=document.documentElement;if(!bl.matches){var xl=bl.webkitMatchesSelector||bl.msMatchesSelector||bl.mozMatchesSelector||bl.oMatchesSelector;ml=function(t){return function(){return xl.call(this,t)}}}}var wl=ml,Ml={},kl=null;if("undefined"!=typeof document){"onmouseenter"in document.documentElement||(Ml={mouseenter:"mouseover",mouseleave:"mouseout"})}var Tl=function(t,n,e){var r,i,o=_o(t+""),a=o.length;{if(!(arguments.length<2)){for(s=n?go:vo,null==e&&(e=!1),r=0;r=b&&(b=m+1);!(g=_[b])&&++b=0;)(r=i[o])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},zl=function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=ko);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?jo:"function"==typeof n?Po:Oo)(t,n,null==e?"":e)):Wl(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)},Zl=function(t,n){return arguments.length>1?this.each((null==n?Ro:"function"==typeof n?Lo:Io)(t,n)):this.node()[t]};zo.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Jl=function(t,n){var e=Uo(t+"");if(arguments.length<2){for(var r=Do(this.node()),i=-1,o=e.length;++il;if(u||(u=t=Ve()),fcd)if(p>ld-cd)u.moveTo(f*Math.cos(l),f*Math.sin(l)),u.arc(0,0,f,l,d,!y),h>cd&&(u.moveTo(h*Math.cos(d),h*Math.sin(d)),u.arc(0,0,h,d,l,y));else{var _,v,g=l,m=d,b=l,x=d,w=p,M=p,k=s.apply(this,arguments)/2,T=k>cd&&(i?+i.apply(this,arguments):Math.sqrt(h*h+f*f)),N=Math.min(Math.abs(f-h)/2,+r.apply(this,arguments)),C=N,A=N;if(T>cd){var S=fa(T/h*Math.sin(k)),E=fa(T/f*Math.sin(k));(w-=2*S)>cd?(S*=y?1:-1,b+=S,x-=S):(w=0,b=x=(l+d)/2),(M-=2*E)>cd?(E*=y?1:-1,g+=E,m-=E):(M=0,g=m=(l+d)/2)}var j=f*Math.cos(g),O=f*Math.sin(g),P=h*Math.cos(x),R=h*Math.sin(x);if(N>cd){var I=f*Math.cos(m),L=f*Math.sin(m),U=h*Math.cos(b),D=h*Math.sin(b);if(pcd?la(j,O,U,D,I,L,P,R):[P,R],q=j-z[0],F=O-z[1],Y=I-z[0],H=L-z[1],B=1/Math.sin(Math.acos((q*Y+F*H)/(Math.sqrt(q*q+F*F)*Math.sqrt(Y*Y+H*H)))/2),X=Math.sqrt(z[0]*z[0]+z[1]*z[1]);C=Math.min(N,(h-X)/(B-1)),A=Math.min(N,(f-X)/(B+1))}}M>cd?A>cd?(_=da(U,D,j,O,f,A,y),v=da(I,L,P,R,f,A,y),u.moveTo(_.cx+_.x01,_.cy+_.y01),Acd&&w>cd?C>cd?(_=da(P,R,I,L,h,-C,y),v=da(j,O,U,D,h,-C,y),u.lineTo(_.cx+_.x01,_.cy+_.y01),C0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t}}]),t}(),Td=function(){function t(n){var e=n.annotations,r=n.accessors,i=n.accessorsInverse;vd(this,t),this.accessors=r,this.accessorsInverse=i,this.annotations=e}return gd(t,[{key:"clearTypes",value:function(t){this.annotations.forEach(function(n){n.type=void 0,n.subject=t&&t.subject||n.subject,n.connector=t&&t.connector||n.connector,n.note=t&&t.note||n.note})}},{key:"setPositionWithAccessors",value:function(){var t=this;this.annotations.forEach(function(n){n.type.setPositionWithAccessors(t.accessors)})}},{key:"editMode",value:function(t){this.annotations.forEach(function(n){n.type&&(n.type.editMode=t,n.type.updateEditMode())})}},{key:"updateDisable",value:function(t){this.annotations.forEach(function(n){n.disable=t,n.type&&t.forEach(function(t){n.type[t]&&(n.type[t].remove&&n.type[t].remove(),n.type[t]=void 0)})})}},{key:"updateTextWrap",value:function(t){this.annotations.forEach(function(n){n.type&&n.type.updateTextWrap&&n.type.updateTextWrap(t)})}},{key:"updateText",value:function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})}},{key:"updateNotePadding",value:function(t){this.annotations.forEach(function(n){n.type&&(n.type.notePadding=t)})}},{key:"json",get:function(){var t=this;return this.annotations.map(function(n){var e=n.json;return t.accessorsInverse&&n.data&&(e.data={},Object.keys(t.accessorsInverse).forEach(function(r){e.data[r]=t.accessorsInverse[r]({x:n.x,y:n.y})})),e})}},{key:"noteNodes",get:function(){return this.annotations.map(function(t){return md({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})}}]),t}(),Nd=function(t){var n=t.cx,e=void 0===n?0:n,r=t.cy;return{move:{x:e,y:void 0===r?0:r}}},Cd=function(t){var n=t.cx,e=void 0===n?0:n,r=t.cy,i=void 0===r?0:r,o=t.r1,a=t.r2,s=t.padding,u={move:{x:e,y:i}};return void 0!==o&&(u.r1={x:e+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),void 0!==a&&(u.r2={x:e+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),void 0!==s&&(u.padding={x:e+o+s,y:i}),u},Ad=function(t){var n=t.group,e=t.handles,r=t.r,i=void 0===r?10:r,o=n.selectAll("circle.handle").data(e);o.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(Uh().container(sd("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),n.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||i}).attr("class",function(t){return"handle "+(t.className||"")}),o.exit().remove()},Sd=function(t,n){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=n<0?"top":"bottom"),t},Ed=function(t,n){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=n<0?"right":"left"),t},jd=["topBottom","top","bottom"],Od=["leftRight","left","right"],Pd=function(t){var n=t.padding,e=void 0===n?0:n,r=t.bbox,i=void 0===r?{x:0,y:0,width:0,height:0}:r,o=t.align,a=t.orientation,s=t.offset,u=void 0===s?{x:0,y:0}:s,c=-i.x,h=0;return-1!==jd.indexOf(a)?(o=Ed(o,u.x),u.y<0&&"topBottom"===a||"top"===a?h-=i.height+e:h+=e,"middle"===o?c-=i.width/2:"right"===o&&(c-=i.width)):-1!==Od.indexOf(a)&&(o=Sd(o,u.y),u.x<0&&"leftRight"===a||"left"===a?c-=i.width+e:c+=e,"middle"===o?h-=i.height/2:"top"===o&&(h-=i.height)),{x:c,y:h}},Rd=function(t){var n=t.data,e=t.curve,r=void 0===e?pd:e,i=t.canvasContext,o=t.className,a=t.classID,s=yd().curve(r),u={type:"path",className:o,classID:a,data:n};return i?(s.context(i),u.pathMethods=s):u.attrs={d:s(n)},u},Id=function(t){var n=t.data,e=t.canvasContext,r=t.className,i=t.classID,o={type:"path",className:r,classID:i,data:n},a=dd().innerRadius(n.innerRadius||0).outerRadius(n.outerRadius||n.radius||2).startAngle(n.startAngle||0).endAngle(n.endAngle||2*Math.PI);return e?(a.context(e),o.pathMethods=lineGen):o.attrs={d:a()},o},Ld=function(t){var n=t.align,e=t.x,r=void 0===e?0:e,i=t.y,o=void 0===i?0:i,a=t.bbox,s=t.offset;n=Sd(n,s.y),"top"===n?o-=a.height:"middle"===n&&(o-=a.height/2);var u=[[r,o],[r,o+a.height]];return{components:[Rd({data:u,className:"note-line"})]}},Ud=function(t){var n=t.align,e=t.x,r=void 0===e?0:e,i=t.y,o=void 0===i?0:i,a=t.offset,s=t.bbox;n=Ed(n,a.x),"right"===n?r-=s.width:"middle"===n&&(r-=s.width/2);var u=[[r,o],[r+s.width,o]];return{components:[Rd({data:u,className:"note-line"})]}},Dd=function(t){var n=t.type,e=t.subjectType,r=n.annotation,i=r.position,o=r.x-i.x,a=o+r.dx,s=r.y-i.y,u=s+r.dy,c=r.subject;if("circle"===e&&(c.outerRadius||c.radius)){var h=Math.sqrt((o-a)*(o-a)+(s-u)*(s-u)),f=Math.asin(-u/h),l=c.outerRadius||c.radius+(c.radiusPadding||0);o=Math.abs(Math.cos(f)*l)*(a<0?-1:1),s=Math.abs(Math.sin(f)*l)*(u<0?-1:1)}if("rect"===e){var d=c.width,p=c.height;(d>0&&r.dx>0||d<0&&r.dx<0)&&(o=Math.abs(d)>Math.abs(r.dx)?d/2:d),(p>0&&r.dy>0||p<0&&r.dy<0)&&(s=Math.abs(p)>Math.abs(r.dy)?p/2:p),o===d/2&&s===p/2&&(o=a,s=u)}return[[o,s],[a,u]]},zd=function(t){var n=Dd(t);return{components:[Rd({data:n,className:"connector"})]}},qd=function(t){var n=t.type,e=t.subjectType,r=n.annotation,i=r.position,o=r.x-i.x,a=o+r.dx,s=r.y-i.y,u=s+r.dy,c=r.subject;if("rect"===e){var h=c.width,f=c.height;(h>0&&r.dx>0||h<0&&r.dx<0)&&(o=Math.abs(h)>Math.abs(r.dx)?h/2:h),(f>0&&r.dy>0||f<0&&r.dy<0)&&(s=Math.abs(f)>Math.abs(r.dy)?f/2:f),o===h/2&&s===f/2&&(o=a,s=u)}var l=[[o,s],[a,u]],d=u-s,p=a-o,y=a,_=u,v=uo||as?-1:1;if(Math.abs(p)m&&Math.abs(d)>m)o=m*(a<0?-1:1),s=m*(u<0?-1:1),l=[[o,s],[y,_],[a,u]];else if(Math.abs(p)>Math.abs(d)){var b=Math.asin(-u/g);o=Math.abs(Math.cos(b)*g)*(a<0?-1:1),l=[[o,u],[a,u]]}else{var x=Math.acos(a/g);s=Math.abs(Math.sin(x)*g)*(u<0?-1:1),l=[[a,s],[a,u]]}}else l=[[o,s],[y,_],[a,u]];return{components:[Rd({data:l,className:"connector"})]}},Fd=function(t){var n=t.type,e=t.connectorData,r=t.subjectType;e||(e={}),e.points&&"number"!=typeof e.points||(e.points=Yd(n.annotation.offset,e.points)),e.curve||(e.curve=_d);var i=[];if(n.editMode){var o=e.points.map(function(t,n){return md({},Nd({cx:t[0],cy:t[1]}),{index:n})}),a=function(t){e.points[t][0]+=kl.dx,e.points[t][1]+=kl.dy,n.redrawConnector()};i=n.mapHandles(o.map(function(t){return md({},t.move,{drag:a.bind(n,t.index)})}))}var s=Dd({type:n,subjectType:r});return s=[s[0]].concat(Md(e.points),[s[1]]),{components:[Rd({data:s,curve:e.curve,className:"connector"})],handles:i}},Yd=function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e={x:t.x/(n+1),y:t.y/(n+1)},r=[],i=1;i<=n;i++)r.push([e.x*i+i%2*20,e.y*i-i%2*20]);return r},Hd=function(t){var n=t.annotation,e=t.start,r=t.end,i=t.scale,o=void 0===i?1:i,a=n.position;e=e?[-r[0]+e[0],-r[1]+e[1]]:[n.dx,n.dy],r||(r=[n.x-a.x,n.y-a.y]);var s=r[0],u=r[1],c=e[0],h=e[1],f=10*o,l=16/180*Math.PI,d=Math.atan(h/c);c<0&&(d+=Math.PI);var p=[[s,u],[Math.cos(d+l)*f+s,Math.sin(d+l)*f+u],[Math.cos(d-l)*f+s,Math.sin(d-l)*f+u],[s,u]];return{components:[Rd({data:p,className:"connector-end connector-arrow",classID:"connector-end"})]}},Bd=function(t){var n=t.line,e=t.scale,r=void 0===e?1:e,i=Id({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(r)}});return i.attrs.transform="translate("+n.data[0][0]+", "+n.data[0][1]+")",{components:[i]}},Xd=function(t){var n=t.subjectData,e=t.type;n.radius||n.outerRadius||(n.radius=20);var r=[],i=Id({data:n,className:"subject"});if(e.editMode){var o=Cd({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:n.radiusPadding}),a=function(t){var r=n[t]+kl.dx*Math.sqrt(2);n[t]=r,e.redrawSubject(),e.redrawConnector()},s=[md({},o.r1,{drag:a.bind(e,void 0!==n.outerRadius?"outerRadius":"radius")})];n.innerRadius&&s.push(md({},o.r2,{drag:a.bind(e,"innerRadius")})),r=e.mapHandles(s)}return i.attrs["fill-opacity"]=0,{components:[i],handles:r}},Vd=function(t){var n=t.subjectData,e=t.type;n.width||(n.width=100),n.height||(n.height=100);var r=[],i=n.width,o=n.height,a=[[0,0],[i,0],[i,o],[0,o],[0,0]],s=Rd({data:a,className:"subject"});if(e.editMode){var u=function(){n.width=kl.x,e.redrawSubject(),e.redrawConnector()},c=function(){n.height=kl.y,e.redrawSubject(),e.redrawConnector()},h=[{x:i,y:o/2,drag:u.bind(e)},{x:i/2,y:o,drag:c.bind(e)}];r=e.mapHandles(h)}return s.attrs["fill-opacity"]=.1,{components:[s],handles:r}},Wd=function(t){var n=t.subjectData,e=t.type,r=e.annotation.position,i=(void 0!==n.x1?n.x1:r.x)-r.x,o=(void 0!==n.x2?n.x2:r.x)-r.x,a=(void 0!==n.y1?n.y1:r.y)-r.y,s=(void 0!==n.y2?n.y2:r.y)-r.y;return{components:[Rd({data:[[i,a],[o,s]],className:"subject"})]}},$d=function(t){var n=t.subjectData,e=void 0===n?{}:n,r=t.type,i=void 0===r?{}:r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.typeSettings&&i.typeSettings.subject;e.radius||(a&&a.radius?e.radius=a.radius:e.radius=14),e.x||a&&a.x&&(e.x=a.x),e.y||a&&a.y&&(e.y=a.y);var s=[],u=[],c=e.radius,h=.7*c,f=0,l=0,d=Math.sqrt(2)*c,p={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-d,xright:d,ytop:-d,ybottom:d};e.x&&!e.y?f=p["x"+e.x]:e.y&&!e.x?l=p["y"+e.y]:e.x&&e.y&&(f=p["x"+e.x+"corner"],l=p["y"+e.y+"corner"]);var y="translate("+f+", "+l+")",_=Id({className:"subject",data:{radius:c}});_.attrs.transform=y,_.attrs.fill=o.color,_.attrs["stroke-linecap"]="round",_.attrs["stroke-width"]="3px";var v=Id({className:"subject-ring",data:{outerRadius:c,innerRadius:h}});v.attrs.transform=y,v.attrs["stroke-width"]="3px",v.attrs.fill="white";var g=void 0;if(f&&l||!f&&!l)g=Rd({className:"subject-pointer",data:[[0,0],[f||0,0],[0,l||0],[0,0]]});else if(f||l){var m=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||n*c/Math.sqrt(2)};g=Rd({className:"subject-pointer",data:[[0,0],[m(f),m(l)],[m(f,-1),m(l,-1)],[0,0]]})}if(g&&(g.attrs.fill=o.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",u.push(g)),i.editMode){var b=function(){e.x=kl.x<2*-c?"left":kl.x>2*c?"right":void 0,e.y=kl.y<2*-c?"top":kl.y>2*c?"bottom":void 0,i.redrawSubject()},x={x:2*f,y:2*l,drag:b.bind(i)};x.x||x.y||(x.y=-c),s=i.mapHandles([x])}var w=void 0;return e.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:e.text,"text-anchor":"middle",dy:".25em",x:f,y:l}}),u.push(_),u.push(v),u.push(w),{components:u,handles:s}},Zd=function(){function t(n){var e=n.a,r=n.annotation,i=n.editMode,o=n.dispatcher,a=n.notePadding,s=n.accessors;if(vd(this,t),this.a=e,this.note=-1===r.disable.indexOf("note")&&e.select("g.annotation-note"),this.noteContent=this.note&&e.select("g.annotation-note-content"),this.connector=-1===r.disable.indexOf("connector")&&e.select("g.annotation-connector"),this.subject=-1===r.disable.indexOf("subject")&&e.select("g.annotation-subject"),this.dispatcher=o,o){var u=up.bind(null,o,r);u({component:this.note,name:"note"}),u({component:this.connector,name:"connector"}),u({component:this.subject,name:"subject"})}this.annotation=r,this.editMode=r.editMode||i,this.notePadding=void 0!==a?a:3,this.offsetCornerX=0,this.offsetCornerY=0,s&&r.data&&this.init(s)}return gd(t,[{key:"init",value:function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)}},{key:"mapY",value:function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))}},{key:"mapX",value:function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))}},{key:"updateEditMode",value:function(){this.a.selectAll("circle.handle").remove()}},{key:"drawOnSVG",value:function(t,n){var e=this;Array.isArray(n)||(n=[n]),n.filter(function(t){return t}).forEach(function(n){var r=n.type,i=n.className,o=n.attrs,a=n.handles,s=n.classID;if("handle"===r)Ad({group:t,r:o&&o.r,handles:a});else{sp(t,[e.annotation],r,i,s);for(var u=t.select(r+"."+(s||i)),c=Object.keys(o),h=[],f=u.node().attributes,l=f.length-1;l>=0;l--){var d=f[l].name;-1===c.indexOf(d)&&"class"!==d&&h.push(d)}c.forEach(function(t){"text"===t?u.text(o[t]):u.attr(t,o[t])}),h.forEach(function(t){return u.attr(t,null)})}})}},{key:"getNoteBBox",value:function(){return hp(this.note,".annotation-note-content text")}},{key:"getNoteBBoxOffset",value:function(){var t=hp(this.note,".annotation-note-content"),n=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(n[1])+this.annotation.dx,t.offsetCornerY=parseFloat(n[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t}},{key:"drawSubject",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.subject,r=n.type,i={type:this,subjectData:e},o={};"circle"===r?o=Xd(i):"rect"===r?o=Vd(i):"threshold"===r?o=Wd(i):"badge"===r&&(o=$d(i,this.annotation));var a=o,s=a.components,u=void 0===s?[]:s,c=a.handles,h=void 0===c?[]:c;return u.forEach(function(n){n&&n.attrs&&!n.attrs.stroke&&(n.attrs.stroke=t.annotation.color)}),this.editMode&&(h=h.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),u.push({type:"handle",handles:h})),u}},{key:"drawConnector",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.connector,r=e.type||n.type,i={type:this,connectorData:e};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var o={};o="curve"===r?Fd(i):"elbow"===r?qd(i):zd(i);var a=o,s=a.components,u=void 0===s?[]:s,c=a.handles,h=void 0===c?[]:c,f=u[0];f&&(f.attrs.stroke=this.annotation.color,f.attrs.fill="none");var l=e.end||n.end,d={};if("arrow"===l){var p=f.data[1],y=f.data[0];Math.sqrt(Math.pow(p[0]-y[0],2)+Math.pow(p[1]-y[1],2))<5&&f.data[2]&&(p=f.data[2]),d=Hd({annotation:this.annotation,start:p,end:y,scale:e.endScale})}else"dot"===l?d=Bd({line:f,scale:e.endScale}):l&&"none"!==l||this.connector&&this.connector.select(".connector-end").remove();return d.components&&(d.components.forEach(function(n){n.attrs.fill=t.annotation.color,n.attrs.stroke=t.annotation.color}),u=u.concat(d.components)),this.editMode&&0!==h.length&&u.push({type:"handle",handles:h}),u}},{key:"drawNote",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.annotation.note,r=e.align||n.align||"dynamic",i={bbox:n.bbox,align:r,offset:this.annotation.offset},o=e.lineType||n.lineType,a={};"vertical"===o?a=Ld(i):"horizontal"===o&&(a=Ud(i));var s=a,u=s.components,c=void 0===u?[]:u,h=s.handles,f=void 0===h?[]:h;if(c.forEach(function(n){n.attrs.stroke=t.annotation.color}),this.editMode){f=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:f});var l=this.dragNote.bind(this),d=this.dragstarted.bind(this),p=this.dragended.bind(this);this.note.call(Uh().container(sd("g.annotations").node()).on("start",function(t){return d(t)}).on("drag",function(t){return l(t)}).on("end",function(t){return p(t)}))}else this.note.on("mousedown.drag",null);return c}},{key:"drawNoteContent",value:function(t){var n=this.annotation.note,e=void 0!==n.padding?n.padding:this.notePadding,r=n.orientation||t.orientation||"topBottom",i=n.lineType||t.lineType,o=n.align||t.align||"dynamic";"vertical"===i?r="leftRight":"horizontal"===i&&(r="topBottom");var a={padding:e,bbox:t.bbox,offset:this.annotation.offset,orientation:r,align:o},s=Pd(a),u=s.x,c=s.y;return this.offsetCornerX=u+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+u+", "+c+")"),[]}},{key:"drawOnScreen",value:function(t,n){ +return this.drawOnSVG(t,n)}},{key:"redrawSubject",value:function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:"redrawConnector",value:function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:"redrawNote",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))}},{key:"setPosition",value:function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")}},{key:"setOffset",value:function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}}},{key:"setPositionWithAccessors",value:function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()}},{key:"setClassName",value:function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))}},{key:"draw",value:function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:"dragstarted",value:function(){kl.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")}},{key:"dragended",value:function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")}},{key:"dragSubject",value:function(){var t=this.annotation.position;t.x+=kl.dx,t.y+=kl.dy,this.annotation.position=t}},{key:"dragNote",value:function(){var t=this.annotation.offset;t.x+=kl.dx,t.y+=kl.dy,this.annotation.offset=t}},{key:"mapHandles",value:function(t){var n=this;return t.map(function(t){return md({},t,{start:n.dragstarted.bind(n),end:n.dragended.bind(n)})})}}]),t}(),Jd=function(t,n,e){return function(t){function r(t){vd(this,r);var e=wd(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t));return e.typeSettings=n,n.disable&&n.disable.forEach(function(t){e[t]&&e[t].remove(),e[t]=void 0,"note"===t&&(e.noteContent=void 0)}),e}return xd(r,t),gd(r,[{key:"className",value:function(){return""+(n.className||bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this)&&bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"className",this).call(this)||"")}},{key:"drawSubject",value:function(t){return this.typeSettings.subject=md({},n.subject,this.typeSettings.subject),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawSubject",this).call(this,md({},t,this.typeSettings.subject))}},{key:"drawConnector",value:function(t){return this.typeSettings.connector=md({},n.connector,this.typeSettings.connector),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawConnector",this).call(this,md({},t,n.connector,this.typeSettings.connector))}},{key:"drawNote",value:function(t){return this.typeSettings.note=md({},n.note,this.typeSettings.note),bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNote",this).call(this,md({},t,n.note,this.typeSettings.note))}},{key:"drawNoteContent",value:function(t){return bd(r.prototype.__proto__||Object.getPrototypeOf(r.prototype),"drawNoteContent",this).call(this,md({},t,n.note,this.typeSettings.note))}}],[{key:"init",value:function(t,n){return bd(r.__proto__||Object.getPrototypeOf(r),"init",this).call(this,t,n),e&&(t=e(t,n)),t}}]),r}(t)},Gd=function(t){function n(t){vd(this,n);var e=wd(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return e.textWrap=t.textWrap||120,e.drawText(),e}return xd(n,t),gd(n,[{key:"updateTextWrap",value:function(t){this.textWrap=t,this.drawText()}},{key:"drawText",value:function(){if(this.note){sp(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");sp(t,[this.annotation],"rect","annotation-note-bg"),sp(t,[this.annotation],"text","annotation-note-label"),sp(t,[this.annotation],"text","annotation-note-title");var n={height:0},e=this.a.select("text.annotation-note-label"),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter;if(this.annotation.note.title){var o=this.a.select("text.annotation-note-title");o.text(this.annotation.note.title),o.attr("fill",this.annotation.color),o.attr("font-weight","bold"),o.call(cp,r,i),n=o.node().getBBox()}e.text(this.annotation.note.label).attr("dx","0"),e.call(cp,r,i),e.attr("y",1.1*n.height||0),e.attr("fill",this.annotation.color);var a=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",a.width).attr("height",a.height).attr("x",a.x).attr("fill","white").attr("fill-opacity",0)}}}]),n}(Zd),Qd=Jd(Gd,{className:"label",note:{align:"middle"},disable:["subject"]}),Kd=Jd(Gd,{className:"callout",note:{lineType:"horizontal"},disable:["subject"]}),tp=Jd(Kd,{className:"callout elbow",connector:{type:"elbow"},disable:["subject"]}),np=Jd(Kd,{className:"callout curve",connector:{type:"curve"},disable:["subject"]}),ep=Jd(Zd,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),rp=Jd(Gd,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ip=Jd(Gd,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),op=function(t){function n(){return vd(this,n),wd(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return xd(n,t),gd(n,[{key:"mapY",value:function(t){bd(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"mapY",this).call(this,t);var e=this.annotation;(e.subject.x1||e.subject.x2)&&e.data&&t.y&&(e.y=t.y(e.data)),!e.subject.x1&&!e.subject.x2||e.x||(e.x=e.subject.x1||e.subject.x2)}},{key:"mapX",value:function(t){bd(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"mapX",this).call(this,t);var e=this.annotation;(e.subject.y1||e.subject.y2)&&e.data&&t.x&&(e.x=t.x(e.data)),!e.subject.y1&&!e.subject.y2||e.y||(e.y=e.subject.y1||e.subject.y2)}}]),n}(Kd),ap=Jd(op,{className:"callout xythreshold",subject:{type:"threshold"}}),sp=function(t,n,e,r,i){var o=t.selectAll(e+"."+(i||r)).data(n);return o.enter().append(e).merge(o).attr("class",r),o.exit().remove(),t},up=function(t,n,e){var r=e.component,i=e.name;r&&r.on("mouseover.annotations",function(){t.call(i+"over",r,n)}).on("mouseout.annotations",function(){return t.call(i+"out",r,n)}).on("click.annotations",function(){return t.call(i+"click",r,n)})},cp=function(t,n,e){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=sd(this),i=t.text().split(e||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),o=void 0,a=[],s=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");o=i.pop();)a.push(o),s.text(a.join(" ")),s.node().getComputedTextLength()>n&&a.length>1&&(a.pop(),s.text(a.join(" ")),a=[o],s=t.append("tspan").attr("x",0).attr("dy",r+"em").text(o))})},hp=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(n).nodes().reduce(function(t,n){var e=n.getBBox();t.x=Math.min(t.x,e.x),t.y=Math.min(t.y,e.y),t.width=Math.max(t.width,e.width);var r=n&&n.attributes&&n.attributes.y;return t.height=Math.max(t.height,(r&&parseFloat(r.value)||0)+e.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};!function(t,n){function e(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||h(),this.isIntersecting=!!t.intersectionRect;var n=this.boundingClientRect,e=n.width*n.height,r=this.intersectionRect,i=r.width*r.height;this.intersectionRatio=e?i/e:this.isIntersecting?1:0}function r(t,n){var e=n||{};if("function"!=typeof t)throw new Error("callback must be a function");if(e.root&&1!=e.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=o(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(e.rootMargin),this.thresholds=this._initThresholds(e.threshold),this.root=e.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function i(){return t.performance&&performance.now&&performance.now()}function o(t,n){var e=null;return function(){e||(e=setTimeout(function(){t(),e=null},n))}}function a(t,n,e,r){"function"==typeof t.addEventListener?t.addEventListener(n,e,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+n,e)}function s(t,n,e,r){"function"==typeof t.removeEventListener?t.removeEventListener(n,e,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+n,e)}function u(t,n){var e=Math.max(t.top,n.top),r=Math.min(t.bottom,n.bottom),i=Math.max(t.left,n.left),o=Math.min(t.right,n.right),a=o-i,s=r-e;return a>=0&&s>=0&&{top:e,bottom:r,left:i,right:o,width:a,height:s}}function c(t){var n;try{n=t.getBoundingClientRect()}catch(t){}return n?(n.width&&n.height||(n={top:n.top,right:n.right,bottom:n.bottom,left:n.left,width:n.right-n.left,height:n.bottom-n.top}),n):h()}function h(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function f(t,n){for(var e=n;e;){if(e==t)return!0;e=l(e)}return!1}function l(t){var n=t.parentNode;return n&&11==n.nodeType&&n.host?n.host:n}if("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)return void("isIntersecting"in t.IntersectionObserverEntry.prototype||Object.defineProperty(t.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}));var d=[];r.prototype.THROTTLE_TIMEOUT=100,r.prototype.POLL_INTERVAL=null,r.prototype.USE_MUTATION_OBSERVER=!0,r.prototype.observe=function(t){if(!this._observationTargets.some(function(n){return n.element==t})){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},r.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(n){return n.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},r.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},r.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},r.prototype._initThresholds=function(t){var n=t||[0];return Array.isArray(n)||(n=[n]),n.sort().filter(function(t,n,e){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==e[n-1]})},r.prototype._parseRootMargin=function(t){var n=t||"0px",e=n.split(/\s+/).map(function(t){var n=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!n)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(n[1]),unit:n[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},r.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(a(t,"resize",this._checkForIntersections,!0),a(n,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in t&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(n,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},r.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(t,"resize",this._checkForIntersections,!0),s(n,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},r.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),n=t?this._getRootRect():h();this._observationTargets.forEach(function(r){var o=r.element,a=c(o),s=this._rootContainsTarget(o),u=r.entry,h=t&&s&&this._computeTargetAndRootIntersection(o,n),f=r.entry=new e({time:i(),target:o,boundingClientRect:a,rootBounds:n,intersectionRect:h});u?t&&s?this._hasCrossedThreshold(u,f)&&this._queuedEntries.push(f):u&&u.isIntersecting&&this._queuedEntries.push(f):this._queuedEntries.push(f)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},r.prototype._computeTargetAndRootIntersection=function(e,r){if("none"!=t.getComputedStyle(e).display){for(var i=c(e),o=i,a=l(e),s=!1;!s;){var h=null,f=1==a.nodeType?t.getComputedStyle(a):{};if("none"==f.display)return;if(a==this.root||a==n?(s=!0,h=r):a!=n.body&&a!=n.documentElement&&"visible"!=f.overflow&&(h=c(a)),h&&!(o=u(h,o)))break;a=l(a)}return o}},r.prototype._getRootRect=function(){var t;if(this.root)t=c(this.root);else{var e=n.documentElement,r=n.body;t={top:0,left:0,right:e.clientWidth||r.clientWidth,width:e.clientWidth||r.clientWidth,bottom:e.clientHeight||r.clientHeight,height:e.clientHeight||r.clientHeight}}return this._expandRectByRootMargin(t)},r.prototype._expandRectByRootMargin=function(t){var n=this._rootMarginValues.map(function(n,e){return"px"==n.unit?n.value:n.value*(e%2?t.width:t.height)/100}),e={top:t.top-n[0],right:t.right+n[1],bottom:t.bottom+n[2],left:t.left-n[3]};return e.width=e.right-e.left,e.height=e.bottom-e.top,e},r.prototype._hasCrossedThreshold=function(t,n){var e=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=n.isIntersecting?n.intersectionRatio||0:-1;if(e!==r)for(var i=0;i