@mozaic-ds/web-components 0.4.1-beta.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/package.json +1 -1
  2. package/public/ClickOutside-63071e7a.js +15 -1
  3. package/public/ClickOutside-63071e7a.js.map +1 -1
  4. package/public/DataTableDefaultAction.nested-4da4dc44.js +759 -1
  5. package/public/DataTableDefaultAction.nested-4da4dc44.js.map +1 -1
  6. package/public/DataTableUtilities-60220c78.js +370 -1
  7. package/public/DataTableUtilities-60220c78.js.map +1 -1
  8. package/public/EventForward-8492ff62.js +109 -1
  9. package/public/EventForward-8492ff62.js.map +1 -1
  10. package/public/EventHandler-02058705.js +15 -1
  11. package/public/EventHandler-02058705.js.map +1 -1
  12. package/public/array-5b770a93.js +13 -1
  13. package/public/array-5b770a93.js.map +1 -1
  14. package/public/axis-fbc0f7b5.js +174 -1
  15. package/public/axis-fbc0f7b5.js.map +1 -1
  16. package/public/band-d7a07d2c.js +186 -1
  17. package/public/band-d7a07d2c.js.map +1 -1
  18. package/public/components/accordion/Accordion.js +365 -1
  19. package/public/components/accordion/Accordion.js.map +1 -1
  20. package/public/components/autocomplete/Autocomplete.js +1515 -1
  21. package/public/components/autocomplete/Autocomplete.js.map +1 -1
  22. package/public/components/badge/Badge.js +155 -1
  23. package/public/components/badge/Badge.js.map +1 -1
  24. package/public/components/badge/Badge.nested.js +101 -1
  25. package/public/components/badge/Badge.nested.js.map +1 -1
  26. package/public/components/breadcrumb/Breadcrumb.js +372 -1
  27. package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
  28. package/public/components/breadcrumb/Breadcrumb.nested.js +319 -1
  29. package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
  30. package/public/components/button/Button.js +1138 -1
  31. package/public/components/button/Button.js.map +1 -1
  32. package/public/components/card/Card.js +369 -1
  33. package/public/components/card/Card.js.map +1 -1
  34. package/public/components/chart/BarChart.js +582 -1
  35. package/public/components/chart/BarChart.js.map +1 -1
  36. package/public/components/chart/Donut.js +1189 -1
  37. package/public/components/chart/Donut.js.map +1 -1
  38. package/public/components/chart/GroupedBarChart.js +750 -1
  39. package/public/components/chart/GroupedBarChart.js.map +1 -1
  40. package/public/components/chart/LineChart.js +1731 -1
  41. package/public/components/chart/LineChart.js.map +1 -1
  42. package/public/components/chart/Radar.js +729 -1
  43. package/public/components/chart/Radar.js.map +1 -1
  44. package/public/components/chart/StackedBarChart.js +745 -1
  45. package/public/components/chart/StackedBarChart.js.map +1 -1
  46. package/public/components/checkbox/Checkbox.js +307 -1
  47. package/public/components/checkbox/Checkbox.js.map +1 -1
  48. package/public/components/checkboxgroup/checkboxGroup.js +404 -1
  49. package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
  50. package/public/components/datatable/DataTable.js +3064 -1
  51. package/public/components/datatable/DataTable.js.map +1 -1
  52. package/public/components/datatable/DataTableDefaultAction.nested.js +4 -1
  53. package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  54. package/public/components/datatable/DataTableDefaultEdtion.nested.js +164 -1
  55. package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  56. package/public/components/datatable/DataTableDefaultFilterTags.nested.js +380 -1
  57. package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  58. package/public/components/datatable/DataTableDefaultSelection.nested.js +424 -1
  59. package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  60. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +263 -1
  61. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
  62. package/public/components/datatable/DataTableFooter.nested.js +637 -1
  63. package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
  64. package/public/components/dropdown/Dropdown.js +1426 -1
  65. package/public/components/dropdown/Dropdown.js.map +1 -1
  66. package/public/components/field/Field.js +375 -1
  67. package/public/components/field/Field.js.map +1 -1
  68. package/public/components/fileuploader/FileUploader.js +555 -1
  69. package/public/components/fileuploader/FileUploader.js.map +1 -1
  70. package/public/components/fileuploader/ResultFile.nested.js +265 -1
  71. package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
  72. package/public/components/flag/Flag.js +174 -1
  73. package/public/components/flag/Flag.js.map +1 -1
  74. package/public/components/header/Header.js +903 -1
  75. package/public/components/header/Header.js.map +1 -1
  76. package/public/components/hero/Hero.js +271 -1
  77. package/public/components/hero/Hero.js.map +1 -1
  78. package/public/components/layer/Layer.js +453 -1
  79. package/public/components/layer/Layer.js.map +1 -1
  80. package/public/components/link/Link.js +380 -1
  81. package/public/components/link/Link.js.map +1 -1
  82. package/public/components/listbox/Listbox.js +595 -1
  83. package/public/components/listbox/Listbox.js.map +1 -1
  84. package/public/components/listbox/Listbox.nested.js +629 -1
  85. package/public/components/listbox/Listbox.nested.js.map +1 -1
  86. package/public/components/loader/Loader.js +246 -1
  87. package/public/components/loader/Loader.js.map +1 -1
  88. package/public/components/loader/Loader.nested.js +176 -1
  89. package/public/components/loader/Loader.nested.js.map +1 -1
  90. package/public/components/modal/Modal.js +395 -1
  91. package/public/components/modal/Modal.js.map +1 -1
  92. package/public/components/notification/Notification.js +458 -1
  93. package/public/components/notification/Notification.js.map +1 -1
  94. package/public/components/optionbutton/OptionButton.js +316 -1
  95. package/public/components/optionbutton/OptionButton.js.map +1 -1
  96. package/public/components/overlay/Overlay.js +104 -1
  97. package/public/components/overlay/Overlay.js.map +1 -1
  98. package/public/components/overlay/OverlayLoader.js +151 -1
  99. package/public/components/overlay/OverlayLoader.js.map +1 -1
  100. package/public/components/pagination/Pagination.js +613 -1
  101. package/public/components/pagination/Pagination.js.map +1 -1
  102. package/public/components/passwordinput/PasswordInput.js +291 -1
  103. package/public/components/passwordinput/PasswordInput.js.map +1 -1
  104. package/public/components/phonenumber/PhoneNumber.js +6894 -1
  105. package/public/components/phonenumber/PhoneNumber.js.map +1 -1
  106. package/public/components/phonenumber/PhoneNumber.svelte +72 -9
  107. package/public/components/price/Price.js +768 -1
  108. package/public/components/price/Price.js.map +1 -1
  109. package/public/components/progressbar/ProgressBar.js +278 -1
  110. package/public/components/progressbar/ProgressBar.js.map +1 -1
  111. package/public/components/quantityselector/QuantitySelector.js +333 -1
  112. package/public/components/quantityselector/QuantitySelector.js.map +1 -1
  113. package/public/components/radio/Radio.js +273 -1
  114. package/public/components/radio/Radio.js.map +1 -1
  115. package/public/components/radiogroup/RadioGroup.js +414 -1
  116. package/public/components/radiogroup/RadioGroup.js.map +1 -1
  117. package/public/components/ratings/StarsInput.js +292 -1
  118. package/public/components/ratings/StarsInput.js.map +1 -1
  119. package/public/components/ratings/StarsResult.js +246 -1
  120. package/public/components/ratings/StarsResult.js.map +1 -1
  121. package/public/components/select/Select.js +451 -1
  122. package/public/components/select/Select.js.map +1 -1
  123. package/public/components/sidebar/Sidebar.js +784 -1
  124. package/public/components/sidebar/Sidebar.js.map +1 -1
  125. package/public/components/sidebar/sidebar-feature-group.nested.js +594 -1
  126. package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  127. package/public/components/sidebar/sidebar-feature.nested.js +402 -1
  128. package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
  129. package/public/components/sidebar/sidebar-section.nested.js +394 -1
  130. package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
  131. package/public/components/sidebar/sidebar-segment.nested.js +200 -1
  132. package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
  133. package/public/components/sidebar/sidebar-separator.nested.js +49 -1
  134. package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
  135. package/public/components/sidebar/sidebar-sub-features.nested.js +312 -1
  136. package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
  137. package/public/components/sidebar/sidebar-user.nested.js +733 -1
  138. package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
  139. package/public/components/stepper/Stepper.js +371 -1
  140. package/public/components/stepper/Stepper.js.map +1 -1
  141. package/public/components/tabs/Tabs.js +615 -1
  142. package/public/components/tabs/Tabs.js.map +1 -1
  143. package/public/components/tabs/Tabs.nested.js +472 -1
  144. package/public/components/tabs/Tabs.nested.js.map +1 -1
  145. package/public/components/tag/Tag.js +665 -1
  146. package/public/components/tag/Tag.js.map +1 -1
  147. package/public/components/tag/Tag.nested.js +554 -1
  148. package/public/components/tag/Tag.nested.js.map +1 -1
  149. package/public/components/taglist/TagList.js +475 -1
  150. package/public/components/taglist/TagList.js.map +1 -1
  151. package/public/components/textarea/Textarea.js +303 -1
  152. package/public/components/textarea/Textarea.js.map +1 -1
  153. package/public/components/textinput/Textinput.js +497 -1
  154. package/public/components/textinput/Textinput.js.map +1 -1
  155. package/public/components/textinput/Textinput.nested.js +320 -1
  156. package/public/components/textinput/Textinput.nested.js.map +1 -1
  157. package/public/components/toggle/Toggle.js +278 -1
  158. package/public/components/toggle/Toggle.js.map +1 -1
  159. package/public/components/tooltip/Tooltip.js +173 -1
  160. package/public/components/tooltip/Tooltip.js.map +1 -1
  161. package/public/index-c33b3772.js +873 -1
  162. package/public/index-c33b3772.js.map +1 -1
  163. package/public/linear-f46d7e9e.js +700 -1
  164. package/public/linear-f46d7e9e.js.map +1 -1
  165. package/public/path-1b5da959.js +186 -1
  166. package/public/path-1b5da959.js.map +1 -1
  167. package/public/sidebar-service-275bf9ef.js +129 -1
  168. package/public/sidebar-service-275bf9ef.js.map +1 -1
  169. package/public/symbol-b05a6e2b.js +169 -1
  170. package/public/symbol-b05a6e2b.js.map +1 -1
  171. package/public/transform-15d69d5d.js +2743 -1
  172. package/public/transform-15d69d5d.js.map +1 -1
  173. package/public/utilities/stories/phonenumber/PhoneNumber.stories.d.ts.map +1 -1
@@ -1,2 +1,2744 @@
1
- var t={value:()=>{}};function n(){for(var t,n=0,r=arguments.length,i={};n<r;++n){if(!(t=arguments[n]+"")||t in i||/[\s.]/.test(t))throw new Error("illegal type: "+t);i[t]=[]}return new e(i)}function e(t){this._=t}function r(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function i(n,e,r){for(var i=0,o=n.length;i<o;++i)if(n[i].name===e){n[i]=t,n=n.slice(0,i).concat(n.slice(i+1));break}return null!=r&&n.push({name:e,value:r}),n}e.prototype=n.prototype={constructor:e,on:function(t,n){var e,o,u=this._,a=(o=u,(t+"").trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");if(e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!o.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),s=-1,l=a.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++s<l;)if(e=(t=a[s]).type)u[e]=i(u[e],t.name,n);else if(null==n)for(e in u)u[e]=i(u[e],t.name,null);return this}for(;++s<l;)if((e=(t=a[s]).type)&&(e=r(u[e],t.name)))return e},copy:function(){var t={},n=this._;for(var r in n)t[r]=n[r].slice();return new e(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,i=new Array(e),o=0;o<e;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,e=(r=this._[t]).length;o<e;++o)r[o].value.apply(n,i)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(n,e)}};var o="http://www.w3.org/1999/xhtml",u={svg:"http://www.w3.org/2000/svg",xhtml:o,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function a(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),u.hasOwnProperty(n)?{space:u[n],local:t}:t}function s(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===o&&n.documentElement.namespaceURI===o?n.createElement(t):n.createElementNS(e,t)}}function l(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function c(t){var n=a(t);return(n.local?l:s)(n)}function h(){}function f(t){return null==t?h:function(){return this.querySelector(t)}}function p(){return[]}function d(t){return null==t?p:function(){return this.querySelectorAll(t)}}function y(t){return function(){return null==(n=t.apply(this,arguments))?[]:Array.isArray(n)?n:Array.from(n);var n}}function v(t){return function(){return this.matches(t)}}function g(t){return function(n){return n.matches(t)}}var _=Array.prototype.find;function m(){return this.firstElementChild}var w=Array.prototype.filter;function b(){return Array.from(this.children)}function x(t){return new Array(t.length)}function A(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function k(t,n,e,r,i,o){for(var u,a=0,s=n.length,l=o.length;a<l;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new A(t,o[a]);for(;a<s;++a)(u=n[a])&&(i[a]=u)}function N(t,n,e,r,i,o,u){var a,s,l,c=new Map,h=n.length,f=o.length,p=new Array(h);for(a=0;a<h;++a)(s=n[a])&&(p[a]=l=u.call(s,s.__data__,a,n)+"",c.has(l)?i[a]=s:c.set(l,s));for(a=0;a<f;++a)l=u.call(t,o[a],a,o)+"",(s=c.get(l))?(r[a]=s,s.__data__=o[a],c.delete(l)):e[a]=new A(t,o[a]);for(a=0;a<h;++a)(s=n[a])&&c.get(p[a])===s&&(i[a]=s)}function $(t){return t.__data__}function E(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function M(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function S(t){return function(){this.removeAttribute(t)}}function C(t){return function(){this.removeAttributeNS(t.space,t.local)}}function q(t,n){return function(){this.setAttribute(t,n)}}function X(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function P(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function O(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 T(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function R(t){return function(){this.style.removeProperty(t)}}function j(t,n,e){return function(){this.style.setProperty(t,n,e)}}function D(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function H(t,n){return t.style.getPropertyValue(n)||T(t).getComputedStyle(t,null).getPropertyValue(n)}function I(t){return function(){delete this[t]}}function Y(t,n){return function(){this[t]=n}}function L(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function B(t){return t.trim().split(/^|\s+/)}function V(t){return t.classList||new z(t)}function z(t){this._node=t,this._names=B(t.getAttribute("class")||"")}function U(t,n){for(var e=V(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function F(t,n){for(var e=V(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function K(t){return function(){U(this,t)}}function W(t){return function(){F(this,t)}}function G(t,n){return function(){(n.apply(this,arguments)?U:F)(this,t)}}function J(){this.textContent=""}function Q(t){return function(){this.textContent=t}}function Z(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function tt(){this.innerHTML=""}function nt(t){return function(){this.innerHTML=t}}function et(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function rt(){this.nextSibling&&this.parentNode.appendChild(this)}function it(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ot(){return null}function ut(){var t=this.parentNode;t&&t.removeChild(this)}function at(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function st(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function lt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function ct(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var u=0,a=i.length;u<a;++u)if((r=i[u]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function ht(t,n,e){var r=T(t),i=r.CustomEvent;"function"==typeof i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function ft(t,n){return function(){return ht(this,t,n)}}function pt(t,n){return function(){return ht(this,t,n.apply(this,arguments))}}A.prototype={constructor:A,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},z.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 dt=[null];function yt(t,n){this._groups=t,this._parents=n}function vt(){return new yt([[document.documentElement]],dt)}function gt(t){return"string"==typeof t?new yt([[document.querySelector(t)]],[document.documentElement]):new yt([[t]],dt)}function _t(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function mt(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function wt(){}yt.prototype=vt.prototype={constructor:yt,select:function(t){"function"!=typeof t&&(t=f(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,a=n[i],s=a.length,l=r[i]=new Array(s),c=0;c<s;++c)(o=a[c])&&(u=t.call(o,o.__data__,c,a))&&("__data__"in o&&(u.__data__=o.__data__),l[c]=u);return new yt(r,this._parents)},selectAll:function(t){t="function"==typeof t?y(t):d(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],s=a.length,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new yt(r,i)},selectChild:function(t){return this.select(null==t?m:function(t){return function(){return _.call(this.children,t)}}("function"==typeof t?t:g(t)))},selectChildren:function(t){return this.selectAll(null==t?b:function(t){return function(){return w.call(this.children,t)}}("function"==typeof t?t:g(t)))},filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new yt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,$);var e,r=n?N:k,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),s=new Array(u),l=new Array(u),c=0;c<u;++c){var h=i[c],f=o[c],p=f.length,d=E(t.call(h,h&&h.__data__,c,i)),y=d.length,v=s[c]=new Array(y),g=a[c]=new Array(y);r(h,f,v,g,l[c]=new Array(p),d,n);for(var _,m,w=0,b=0;w<y;++w)if(_=v[w]){for(w>=b&&(b=w+1);!(m=g[b])&&++b<y;);_._next=m||null}}return(a=new yt(a,i))._enter=s,a._exit=l,a},enter:function(){return new yt(this._enter||this._groups.map(x),this._parents)},exit:function(){return new yt(this._exit||this._groups.map(x),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=n&&(i=n(i))&&(i=i.selection()),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,u=Math.min(i,o),a=new Array(i),s=0;s<u;++s)for(var l,c=e[s],h=r[s],f=c.length,p=a[s]=new Array(f),d=0;d<f;++d)(l=c[d]||h[d])&&(p[d]=l);for(;s<i;++s)a[s]=e[s];return new yt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=M);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],s=a.length,l=i[o]=new Array(s),c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new yt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,a=o.length;u<a;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=a(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?C:S:"function"==typeof n?e.local?O:P:e.local?X:q)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?R:"function"==typeof n?D:j)(t,n,null==e?"":e)):H(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?I:"function"==typeof n?L:Y)(t,n)):this.node()[t]},classed:function(t,n){var e=B(t+"");if(arguments.length<2){for(var r=V(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?G:n?K:W)(e,n))},text:function(t){return arguments.length?this.each(null==t?J:("function"==typeof t?Z:Q)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?tt:("function"==typeof t?et:nt)(t)):this.node().innerHTML},raise:function(){return this.each(rt)},lower:function(){return this.each(it)},append:function(t){var n="function"==typeof t?t:c(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:c(t),r=null==n?ot:"function"==typeof n?n:f(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(ut)},clone:function(t){return this.select(t?st:at)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),u=o.length;if(!(arguments.length<2)){for(a=n?ct:lt,r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var s,l=0,c=a.length;l<c;++l)for(r=0,s=a[l];r<u;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value},dispatch:function(t,n){return this.each(("function"==typeof n?pt:ft)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,u=i.length;o<u;++o)(r=i[o])&&(yield r)}};var bt=.7,xt=1/bt,At="\\s*([+-]?\\d+)\\s*",kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$t=/^#([0-9a-f]{3,8})$/,Et=new RegExp(`^rgb\\(${At},${At},${At}\\)$`),Mt=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),St=new RegExp(`^rgba\\(${At},${At},${At},${kt}\\)$`),Ct=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${kt}\\)$`),qt=new RegExp(`^hsl\\(${kt},${Nt},${Nt}\\)$`),Xt=new RegExp(`^hsla\\(${kt},${Nt},${Nt},${kt}\\)$`),Pt={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};function Ot(){return this.rgb().formatHex()}function Tt(){return this.rgb().formatRgb()}function Rt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=$t.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?jt(n):3===e?new It(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Dt(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Dt(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Et.exec(t))?new It(n[1],n[2],n[3],1):(n=Mt.exec(t))?new It(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=St.exec(t))?Dt(n[1],n[2],n[3],n[4]):(n=Ct.exec(t))?Dt(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=qt.exec(t))?Ut(n[1],n[2]/100,n[3]/100,1):(n=Xt.exec(t))?Ut(n[1],n[2]/100,n[3]/100,n[4]):Pt.hasOwnProperty(t)?jt(Pt[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 Dt(t,n,e,r){return r<=0&&(t=n=e=NaN),new It(t,n,e,r)}function Ht(t,n,e,r){return 1===arguments.length?((i=t)instanceof wt||(i=Rt(i)),i?new It((i=i.rgb()).r,i.g,i.b,i.opacity):new It):new It(t,n,e,null==r?1:r);var i}function It(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Yt(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}`}function Lt(){const t=Bt(this.opacity);return`${1===t?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${1===t?")":`, ${t})`}`}function Bt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Vt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function zt(t){return((t=Vt(t))<16?"0":"")+t.toString(16)}function Ut(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Kt(t,n,e,r)}function Ft(t){if(t instanceof Kt)return new Kt(t.h,t.s,t.l,t.opacity);if(t instanceof wt||(t=Rt(t)),!t)return new Kt;if(t instanceof Kt)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),u=NaN,a=o-i,s=(o+i)/2;return a?(u=n===o?(e-r)/a+6*(e<r):e===o?(r-n)/a+2:(n-e)/a+4,a/=s<.5?o+i:2-o-i,u*=60):a=s>0&&s<1?0:u,new Kt(u,a,s,t.opacity)}function Kt(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Wt(t){return(t=(t||0)%360)<0?t+360:t}function Gt(t){return Math.max(0,Math.min(1,t||0))}function Jt(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}_t(wt,Rt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ot,formatHex:Ot,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ft(this).formatHsl()},formatRgb:Tt,toString:Tt}),_t(It,Ht,mt(wt,{brighter(t){return t=null==t?xt:Math.pow(xt,t),new It(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?bt:Math.pow(bt,t),new It(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new It(Vt(this.r),Vt(this.g),Vt(this.b),Bt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yt,formatHex:Yt,formatHex8:function(){return`#${zt(this.r)}${zt(this.g)}${zt(this.b)}${zt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lt,toString:Lt})),_t(Kt,(function(t,n,e,r){return 1===arguments.length?Ft(t):new Kt(t,n,e,null==r?1:r)}),mt(wt,{brighter(t){return t=null==t?xt:Math.pow(xt,t),new Kt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?bt:Math.pow(bt,t),new Kt(this.h,this.s,this.l*t,this.opacity)},rgb(){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(Jt(t>=240?t-240:t+120,i,r),Jt(t,i,r),Jt(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Kt(Wt(this.h),Gt(this.s),Gt(this.l),Bt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Bt(this.opacity);return`${1===t?"hsl(":"hsla("}${Wt(this.h)}, ${100*Gt(this.s)}%, ${100*Gt(this.l)}%${1===t?")":`, ${t})`}`}}));var Qt=t=>()=>t;function Zt(t){return 1==(t=+t)?tn:function(n,e){return e-n?function(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)}}(n,e,t):Qt(isNaN(n)?e:n)}}function tn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Qt(isNaN(t)?n:t)}var nn=function t(n){var e=Zt(n);function r(t,n){var r=e((t=Ht(t)).r,(n=Ht(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=tn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=u(n),t+""}}return r.gamma=t,r}(1);function en(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,i=n.slice();return function(o){for(e=0;e<r;++e)i[e]=t[e]*(1-o)+n[e]*o;return i}}function rn(t,n){var e,r=n?n.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),u=new Array(r);for(e=0;e<i;++e)o[e]=hn(t[e],n[e]);for(;e<r;++e)u[e]=n[e];return function(t){for(e=0;e<i;++e)u[e]=o[e](t);return u}}function on(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function un(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function an(t,n){var e,r={},i={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=hn(t[e],n[e]):i[e]=n[e];return function(t){for(e in r)i[e]=r[e](t);return i}}var sn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ln=new RegExp(sn.source,"g");function cn(t,n){var e,r,i,o=sn.lastIndex=ln.lastIndex=0,u=-1,a=[],s=[];for(t+="",n+="";(e=sn.exec(t))&&(r=ln.exec(n));)(i=r.index)>o&&(i=n.slice(o,i),a[u]?a[u]+=i:a[++u]=i),(e=e[0])===(r=r[0])?a[u]?a[u]+=r:a[++u]=r:(a[++u]=null,s.push({i:u,x:un(e,r)})),o=ln.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?s[0]?function(t){return function(n){return t(n)+""}}(s[0].x):function(t){return function(){return t}}(n):(n=s.length,function(t){for(var e,r=0;r<n;++r)a[(e=s[r]).i]=e.x(t);return a.join("")})}function hn(t,n){var e,r,i=typeof n;return null==n||"boolean"===i?Qt(n):("number"===i?un:"string"===i?(e=Rt(n))?(n=e,nn):cn:n instanceof Rt?nn:n instanceof Date?on:(r=n,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(n)?rn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?an:un:en))(t,n)}var fn,pn=180/Math.PI,dn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function yn(t,n,e,r,i,o){var u,a,s;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(s=t*e+n*r)&&(e-=t*s,r-=n*s),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,s/=a),t*r<n*e&&(t=-t,n=-n,s=-s,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*pn,skewX:Math.atan(s)*pn,scaleX:u,scaleY:a}}function vn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],s=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var s=u.push("translate(",null,n,null,e);a.push({i:s-4,x:un(t,i)},{i:s-2,x:un(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,s),function(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:un(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,s),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:un(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,s),function(t,n,e,r,o,u){if(t!==e||n!==r){var a=o.push(i(o)+"scale(",null,",",null,")");u.push({i:a-4,x:un(t,e)},{i:a-2,x:un(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,s),o=u=null,function(t){for(var n,e=-1,r=s.length;++e<r;)a[(n=s[e]).i]=n.x(t);return a.join("")}}}var gn,_n,mn=vn((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?dn:yn(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),wn=vn((function(t){return null==t?dn:(fn||(fn=document.createElementNS("http://www.w3.org/2000/svg","g")),fn.setAttribute("transform",t),(t=fn.transform.baseVal.consolidate())?yn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):dn)}),", ",")",")"),bn=0,xn=0,An=0,kn=1e3,Nn=0,$n=0,En=0,Mn="object"==typeof performance&&performance.now?performance:Date,Sn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Cn(){return $n||(Sn(qn),$n=Mn.now()+En)}function qn(){$n=0}function Xn(){this._call=this._time=this._next=null}function Pn(t,n,e){var r=new Xn;return r.restart(t,n,e),r}function On(){$n=(Nn=Mn.now())+En,bn=xn=0;try{!function(){Cn(),++bn;for(var t,n=gn;n;)(t=$n-n._time)>=0&&n._call.call(void 0,t),n=n._next;--bn}()}finally{bn=0,function(){var t,n,e=gn,r=1/0;for(;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:gn=n);_n=t,Rn(r)}(),$n=0}}function Tn(){var t=Mn.now(),n=t-Nn;n>kn&&(En-=n,Nn=t)}function Rn(t){bn||(xn&&(xn=clearTimeout(xn)),t-$n>24?(t<1/0&&(xn=setTimeout(On,t-Mn.now()-En)),An&&(An=clearInterval(An))):(An||(Nn=Mn.now(),An=setInterval(Tn,kn)),bn=1,Sn(On)))}function jn(t,n,e){var r=new Xn;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}Xn.prototype=Pn.prototype={constructor:Xn,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Cn():+e)+(null==n?0:+n),this._next||_n===this||(_n?_n._next=this:gn=this,_n=this),this._call=t,this._time=e,Rn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rn())}};var Dn=n("start","end","cancel","interrupt"),Hn=[],In=0,Yn=1,Ln=2,Bn=3,Vn=4,zn=5,Un=6;function Fn(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=Yn,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var l,c,h,f;if(e.state!==Yn)return s();for(l in i)if((f=i[l]).name===e.name){if(f.state===Bn)return jn(u);f.state===Vn?(f.state=Un,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<n&&(f.state=Un,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(jn((function(){e.state===Bn&&(e.state=Vn,e.timer.restart(a,e.delay,e.time),a(o))})),e.state=Ln,e.on.call("start",t,t.__data__,e.index,e.group),e.state===Ln){for(e.state=Bn,r=new Array(h=e.tween.length),l=0,c=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++c]=f);r.length=c+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=zn,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);e.state===zn&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=Un,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Pn(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:Dn,tween:Hn,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:In})}function Kn(t,n){var e=Gn(t,n);if(e.state>In)throw new Error("too late; already scheduled");return e}function Wn(t,n){var e=Gn(t,n);if(e.state>Bn)throw new Error("too late; already running");return e}function Gn(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Jn(t,n){var e,r;return function(){var i=Wn(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u<a;++u)if(r[u].name===n){(r=r.slice()).splice(u,1);break}i.tween=r}}function Qn(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Wn(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},s=0,l=i.length;s<l;++s)if(i[s].name===n){i[s]=a;break}s===l&&i.push(a)}o.tween=i}}function Zn(t,n,e){var r=t._id;return t.each((function(){var t=Wn(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Gn(t,r).value[n]}}function te(t,n){var e;return("number"==typeof n?un:n instanceof Rt?nn:(e=Rt(n))?(n=e,nn):cn)(t,n)}function ne(t){return function(){this.removeAttribute(t)}}function ee(t){return function(){this.removeAttributeNS(t.space,t.local)}}function re(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttribute(t);return u===o?null:u===r?i:i=n(r=u,e)}}function ie(t,n,e){var r,i,o=e+"";return function(){var u=this.getAttributeNS(t.space,t.local);return u===o?null:u===r?i:i=n(r=u,e)}}function oe(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttribute(t))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttribute(t)}}function ue(t,n,e){var r,i,o;return function(){var u,a,s=e(this);if(null!=s)return(u=this.getAttributeNS(t.space,t.local))===(a=s+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,s));this.removeAttributeNS(t.space,t.local)}}function ae(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}(t,i)),e}return i._value=n,i}function se(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}(t,i)),e}return i._value=n,i}function le(t,n){return function(){Kn(this,t).delay=+n.apply(this,arguments)}}function ce(t,n){return n=+n,function(){Kn(this,t).delay=n}}function he(t,n){return function(){Wn(this,t).duration=+n.apply(this,arguments)}}function fe(t,n){return n=+n,function(){Wn(this,t).duration=n}}var pe=vt.prototype.constructor;function de(t){return function(){this.style.removeProperty(t)}}var ye=0;function ve(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function ge(){return++ye}var _e=vt.prototype;ve.prototype={constructor:ve,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=f(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var a,s,l=r[u],c=l.length,h=o[u]=new Array(c),p=0;p<c;++p)(a=l[p])&&(s=t.call(a,a.__data__,p,l))&&("__data__"in a&&(s.__data__=a.__data__),h[p]=s,Fn(h[p],n,e,p,h,Gn(a,e)));return new ve(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=d(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var s,l=r[a],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),y=Gn(s,e),v=0,g=p.length;v<g;++v)(f=p[v])&&Fn(f,n,e,v,p,y);o.push(p),u.push(s)}return new ve(o,u,n,e)},selectChild:_e.selectChild,selectChildren:_e.selectChildren,filter:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],a=u.length,s=r[i]=[],l=0;l<a;++l)(o=u[l])&&t.call(o,o.__data__,l,u)&&s.push(o);return new ve(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),a=0;a<o;++a)for(var s,l=n[a],c=e[a],h=l.length,f=u[a]=new Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;a<r;++a)u[a]=n[a];return new ve(u,this._parents,this._name,this._id)},selection:function(){return new pe(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=ge(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)if(u=a[l]){var c=Gn(u,n);Fn(u,t,e,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ve(r,this._parents,t,e)},call:_e.call,nodes:_e.nodes,node:_e.node,size:_e.size,empty:_e.empty,each:_e.each,on:function(t,n){var e=this._id;return arguments.length<2?Gn(this.node(),e).on.on(t):this.each(function(t,n,e){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Kn:Wn;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(t,n){var e=a(t),r="transform"===e?wn:te;return this.attrTween(t,"function"==typeof n?(e.local?ue:oe)(e,r,Zn(this,"attr."+t,n)):null==n?(e.local?ee:ne)(e):(e.local?ie:re)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=a(t);return this.tween(e,(r.local?ae:se)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?mn:te;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=H(this,t),u=(this.style.removeProperty(t),H(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,de(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=H(this,t),a=e(this),s=a+"";return null==a&&(this.style.removeProperty(t),s=a=H(this,t)),u===s?null:u===r&&s===i?o:(i=s,o=n(r=u,a))}}(t,r,Zn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=Wn(this,t),l=s.on,c=null==s.value[u]?o||(o=de(n)):void 0;l===e&&i===c||(r=(e=l).copy()).on(a,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=H(this,t);return u===o?null:u===r?i:i=n(r=u,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Zn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Gn(this.node(),e).tween,o=0,u=i.length;o<u;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==n?Jn:Qn)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?le:ce)(n,t)):Gn(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?he:fe)(n,t)):Gn(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(t,n){if("function"!=typeof n)throw new Error;return function(){Wn(this,t).ease=n}}(n,t)):Gn(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;Wn(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise((function(o,u){var a={value:u},s={value:function(){0==--i&&o()}};e.each((function(){var e=Wn(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(s)),e.on=n})),0===i&&o()}))},[Symbol.iterator]:_e[Symbol.iterator]};var me={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function we(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function be(t,n,e){this.k=t,this.x=n,this.y=e}vt.prototype.interrupt=function(t){return this.each((function(){!function(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>Ln&&e.state<zn,e.state=Un,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}(this,t)}))},vt.prototype.transition=function(t){var n,e;t instanceof ve?(n=t._id,t=t._name):(n=ge(),(e=me).time=Cn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],s=a.length,l=0;l<s;++l)(u=a[l])&&Fn(u,t,n,l,a,e||we(u,n));return new ve(r,this._parents,t,n)},be.prototype={constructor:be,scale:function(t){return 1===t?this:new be(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new be(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},new be(1,0,0),be.prototype;export{hn as a,un as i,gt as s};
1
+ var noop = {value: () => {}};
2
+
3
+ function dispatch() {
4
+ for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
5
+ if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
6
+ _[t] = [];
7
+ }
8
+ return new Dispatch(_);
9
+ }
10
+
11
+ function Dispatch(_) {
12
+ this._ = _;
13
+ }
14
+
15
+ function parseTypenames$1(typenames, types) {
16
+ return typenames.trim().split(/^|\s+/).map(function(t) {
17
+ var name = "", i = t.indexOf(".");
18
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
19
+ if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
20
+ return {type: t, name: name};
21
+ });
22
+ }
23
+
24
+ Dispatch.prototype = dispatch.prototype = {
25
+ constructor: Dispatch,
26
+ on: function(typename, callback) {
27
+ var _ = this._,
28
+ T = parseTypenames$1(typename + "", _),
29
+ t,
30
+ i = -1,
31
+ n = T.length;
32
+
33
+ // If no callback was specified, return the callback of the given type and name.
34
+ if (arguments.length < 2) {
35
+ while (++i < n) if ((t = (typename = T[i]).type) && (t = get$1(_[t], typename.name))) return t;
36
+ return;
37
+ }
38
+
39
+ // If a type was specified, set the callback for the given type and name.
40
+ // Otherwise, if a null callback was specified, remove callbacks of the given name.
41
+ if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
42
+ while (++i < n) {
43
+ if (t = (typename = T[i]).type) _[t] = set$1(_[t], typename.name, callback);
44
+ else if (callback == null) for (t in _) _[t] = set$1(_[t], typename.name, null);
45
+ }
46
+
47
+ return this;
48
+ },
49
+ copy: function() {
50
+ var copy = {}, _ = this._;
51
+ for (var t in _) copy[t] = _[t].slice();
52
+ return new Dispatch(copy);
53
+ },
54
+ call: function(type, that) {
55
+ if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
56
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
57
+ for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
58
+ },
59
+ apply: function(type, that, args) {
60
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
61
+ for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
62
+ }
63
+ };
64
+
65
+ function get$1(type, name) {
66
+ for (var i = 0, n = type.length, c; i < n; ++i) {
67
+ if ((c = type[i]).name === name) {
68
+ return c.value;
69
+ }
70
+ }
71
+ }
72
+
73
+ function set$1(type, name, callback) {
74
+ for (var i = 0, n = type.length; i < n; ++i) {
75
+ if (type[i].name === name) {
76
+ type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
77
+ break;
78
+ }
79
+ }
80
+ if (callback != null) type.push({name: name, value: callback});
81
+ return type;
82
+ }
83
+
84
+ var xhtml = "http://www.w3.org/1999/xhtml";
85
+
86
+ var namespaces = {
87
+ svg: "http://www.w3.org/2000/svg",
88
+ xhtml: xhtml,
89
+ xlink: "http://www.w3.org/1999/xlink",
90
+ xml: "http://www.w3.org/XML/1998/namespace",
91
+ xmlns: "http://www.w3.org/2000/xmlns/"
92
+ };
93
+
94
+ function namespace(name) {
95
+ var prefix = name += "", i = prefix.indexOf(":");
96
+ if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
97
+ return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins
98
+ }
99
+
100
+ function creatorInherit(name) {
101
+ return function() {
102
+ var document = this.ownerDocument,
103
+ uri = this.namespaceURI;
104
+ return uri === xhtml && document.documentElement.namespaceURI === xhtml
105
+ ? document.createElement(name)
106
+ : document.createElementNS(uri, name);
107
+ };
108
+ }
109
+
110
+ function creatorFixed(fullname) {
111
+ return function() {
112
+ return this.ownerDocument.createElementNS(fullname.space, fullname.local);
113
+ };
114
+ }
115
+
116
+ function creator(name) {
117
+ var fullname = namespace(name);
118
+ return (fullname.local
119
+ ? creatorFixed
120
+ : creatorInherit)(fullname);
121
+ }
122
+
123
+ function none() {}
124
+
125
+ function selector(selector) {
126
+ return selector == null ? none : function() {
127
+ return this.querySelector(selector);
128
+ };
129
+ }
130
+
131
+ function selection_select(select) {
132
+ if (typeof select !== "function") select = selector(select);
133
+
134
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
135
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
136
+ if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
137
+ if ("__data__" in node) subnode.__data__ = node.__data__;
138
+ subgroup[i] = subnode;
139
+ }
140
+ }
141
+ }
142
+
143
+ return new Selection$1(subgroups, this._parents);
144
+ }
145
+
146
+ // Given something array like (or null), returns something that is strictly an
147
+ // array. This is used to ensure that array-like objects passed to d3.selectAll
148
+ // or selection.selectAll are converted into proper arrays when creating a
149
+ // selection; we don’t ever want to create a selection backed by a live
150
+ // HTMLCollection or NodeList. However, note that selection.selectAll will use a
151
+ // static NodeList as a group, since it safely derived from querySelectorAll.
152
+ function array(x) {
153
+ return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
154
+ }
155
+
156
+ function empty() {
157
+ return [];
158
+ }
159
+
160
+ function selectorAll(selector) {
161
+ return selector == null ? empty : function() {
162
+ return this.querySelectorAll(selector);
163
+ };
164
+ }
165
+
166
+ function arrayAll(select) {
167
+ return function() {
168
+ return array(select.apply(this, arguments));
169
+ };
170
+ }
171
+
172
+ function selection_selectAll(select) {
173
+ if (typeof select === "function") select = arrayAll(select);
174
+ else select = selectorAll(select);
175
+
176
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
177
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
178
+ if (node = group[i]) {
179
+ subgroups.push(select.call(node, node.__data__, i, group));
180
+ parents.push(node);
181
+ }
182
+ }
183
+ }
184
+
185
+ return new Selection$1(subgroups, parents);
186
+ }
187
+
188
+ function matcher(selector) {
189
+ return function() {
190
+ return this.matches(selector);
191
+ };
192
+ }
193
+
194
+ function childMatcher(selector) {
195
+ return function(node) {
196
+ return node.matches(selector);
197
+ };
198
+ }
199
+
200
+ var find = Array.prototype.find;
201
+
202
+ function childFind(match) {
203
+ return function() {
204
+ return find.call(this.children, match);
205
+ };
206
+ }
207
+
208
+ function childFirst() {
209
+ return this.firstElementChild;
210
+ }
211
+
212
+ function selection_selectChild(match) {
213
+ return this.select(match == null ? childFirst
214
+ : childFind(typeof match === "function" ? match : childMatcher(match)));
215
+ }
216
+
217
+ var filter = Array.prototype.filter;
218
+
219
+ function children() {
220
+ return Array.from(this.children);
221
+ }
222
+
223
+ function childrenFilter(match) {
224
+ return function() {
225
+ return filter.call(this.children, match);
226
+ };
227
+ }
228
+
229
+ function selection_selectChildren(match) {
230
+ return this.selectAll(match == null ? children
231
+ : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
232
+ }
233
+
234
+ function selection_filter(match) {
235
+ if (typeof match !== "function") match = matcher(match);
236
+
237
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
238
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
239
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
240
+ subgroup.push(node);
241
+ }
242
+ }
243
+ }
244
+
245
+ return new Selection$1(subgroups, this._parents);
246
+ }
247
+
248
+ function sparse(update) {
249
+ return new Array(update.length);
250
+ }
251
+
252
+ function selection_enter() {
253
+ return new Selection$1(this._enter || this._groups.map(sparse), this._parents);
254
+ }
255
+
256
+ function EnterNode(parent, datum) {
257
+ this.ownerDocument = parent.ownerDocument;
258
+ this.namespaceURI = parent.namespaceURI;
259
+ this._next = null;
260
+ this._parent = parent;
261
+ this.__data__ = datum;
262
+ }
263
+
264
+ EnterNode.prototype = {
265
+ constructor: EnterNode,
266
+ appendChild: function(child) { return this._parent.insertBefore(child, this._next); },
267
+ insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },
268
+ querySelector: function(selector) { return this._parent.querySelector(selector); },
269
+ querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }
270
+ };
271
+
272
+ function constant$1(x) {
273
+ return function() {
274
+ return x;
275
+ };
276
+ }
277
+
278
+ function bindIndex(parent, group, enter, update, exit, data) {
279
+ var i = 0,
280
+ node,
281
+ groupLength = group.length,
282
+ dataLength = data.length;
283
+
284
+ // Put any non-null nodes that fit into update.
285
+ // Put any null nodes into enter.
286
+ // Put any remaining data into enter.
287
+ for (; i < dataLength; ++i) {
288
+ if (node = group[i]) {
289
+ node.__data__ = data[i];
290
+ update[i] = node;
291
+ } else {
292
+ enter[i] = new EnterNode(parent, data[i]);
293
+ }
294
+ }
295
+
296
+ // Put any non-null nodes that don’t fit into exit.
297
+ for (; i < groupLength; ++i) {
298
+ if (node = group[i]) {
299
+ exit[i] = node;
300
+ }
301
+ }
302
+ }
303
+
304
+ function bindKey(parent, group, enter, update, exit, data, key) {
305
+ var i,
306
+ node,
307
+ nodeByKeyValue = new Map,
308
+ groupLength = group.length,
309
+ dataLength = data.length,
310
+ keyValues = new Array(groupLength),
311
+ keyValue;
312
+
313
+ // Compute the key for each node.
314
+ // If multiple nodes have the same key, the duplicates are added to exit.
315
+ for (i = 0; i < groupLength; ++i) {
316
+ if (node = group[i]) {
317
+ keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
318
+ if (nodeByKeyValue.has(keyValue)) {
319
+ exit[i] = node;
320
+ } else {
321
+ nodeByKeyValue.set(keyValue, node);
322
+ }
323
+ }
324
+ }
325
+
326
+ // Compute the key for each datum.
327
+ // If there a node associated with this key, join and add it to update.
328
+ // If there is not (or the key is a duplicate), add it to enter.
329
+ for (i = 0; i < dataLength; ++i) {
330
+ keyValue = key.call(parent, data[i], i, data) + "";
331
+ if (node = nodeByKeyValue.get(keyValue)) {
332
+ update[i] = node;
333
+ node.__data__ = data[i];
334
+ nodeByKeyValue.delete(keyValue);
335
+ } else {
336
+ enter[i] = new EnterNode(parent, data[i]);
337
+ }
338
+ }
339
+
340
+ // Add any remaining nodes that were not bound to data to exit.
341
+ for (i = 0; i < groupLength; ++i) {
342
+ if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {
343
+ exit[i] = node;
344
+ }
345
+ }
346
+ }
347
+
348
+ function datum(node) {
349
+ return node.__data__;
350
+ }
351
+
352
+ function selection_data(value, key) {
353
+ if (!arguments.length) return Array.from(this, datum);
354
+
355
+ var bind = key ? bindKey : bindIndex,
356
+ parents = this._parents,
357
+ groups = this._groups;
358
+
359
+ if (typeof value !== "function") value = constant$1(value);
360
+
361
+ for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
362
+ var parent = parents[j],
363
+ group = groups[j],
364
+ groupLength = group.length,
365
+ data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),
366
+ dataLength = data.length,
367
+ enterGroup = enter[j] = new Array(dataLength),
368
+ updateGroup = update[j] = new Array(dataLength),
369
+ exitGroup = exit[j] = new Array(groupLength);
370
+
371
+ bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
372
+
373
+ // Now connect the enter nodes to their following update node, such that
374
+ // appendChild can insert the materialized enter node before this node,
375
+ // rather than at the end of the parent node.
376
+ for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
377
+ if (previous = enterGroup[i0]) {
378
+ if (i0 >= i1) i1 = i0 + 1;
379
+ while (!(next = updateGroup[i1]) && ++i1 < dataLength);
380
+ previous._next = next || null;
381
+ }
382
+ }
383
+ }
384
+
385
+ update = new Selection$1(update, parents);
386
+ update._enter = enter;
387
+ update._exit = exit;
388
+ return update;
389
+ }
390
+
391
+ // Given some data, this returns an array-like view of it: an object that
392
+ // exposes a length property and allows numeric indexing. Note that unlike
393
+ // selectAll, this isn’t worried about “live” collections because the resulting
394
+ // array will only be used briefly while data is being bound. (It is possible to
395
+ // cause the data to change while iterating by using a key function, but please
396
+ // don’t; we’d rather avoid a gratuitous copy.)
397
+ function arraylike(data) {
398
+ return typeof data === "object" && "length" in data
399
+ ? data // Array, TypedArray, NodeList, array-like
400
+ : Array.from(data); // Map, Set, iterable, string, or anything else
401
+ }
402
+
403
+ function selection_exit() {
404
+ return new Selection$1(this._exit || this._groups.map(sparse), this._parents);
405
+ }
406
+
407
+ function selection_join(onenter, onupdate, onexit) {
408
+ var enter = this.enter(), update = this, exit = this.exit();
409
+ if (typeof onenter === "function") {
410
+ enter = onenter(enter);
411
+ if (enter) enter = enter.selection();
412
+ } else {
413
+ enter = enter.append(onenter + "");
414
+ }
415
+ if (onupdate != null) {
416
+ update = onupdate(update);
417
+ if (update) update = update.selection();
418
+ }
419
+ if (onexit == null) exit.remove(); else onexit(exit);
420
+ return enter && update ? enter.merge(update).order() : update;
421
+ }
422
+
423
+ function selection_merge(context) {
424
+ var selection = context.selection ? context.selection() : context;
425
+
426
+ for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
427
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
428
+ if (node = group0[i] || group1[i]) {
429
+ merge[i] = node;
430
+ }
431
+ }
432
+ }
433
+
434
+ for (; j < m0; ++j) {
435
+ merges[j] = groups0[j];
436
+ }
437
+
438
+ return new Selection$1(merges, this._parents);
439
+ }
440
+
441
+ function selection_order() {
442
+
443
+ for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
444
+ for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
445
+ if (node = group[i]) {
446
+ if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
447
+ next = node;
448
+ }
449
+ }
450
+ }
451
+
452
+ return this;
453
+ }
454
+
455
+ function selection_sort(compare) {
456
+ if (!compare) compare = ascending;
457
+
458
+ function compareNode(a, b) {
459
+ return a && b ? compare(a.__data__, b.__data__) : !a - !b;
460
+ }
461
+
462
+ for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
463
+ for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
464
+ if (node = group[i]) {
465
+ sortgroup[i] = node;
466
+ }
467
+ }
468
+ sortgroup.sort(compareNode);
469
+ }
470
+
471
+ return new Selection$1(sortgroups, this._parents).order();
472
+ }
473
+
474
+ function ascending(a, b) {
475
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
476
+ }
477
+
478
+ function selection_call() {
479
+ var callback = arguments[0];
480
+ arguments[0] = this;
481
+ callback.apply(null, arguments);
482
+ return this;
483
+ }
484
+
485
+ function selection_nodes() {
486
+ return Array.from(this);
487
+ }
488
+
489
+ function selection_node() {
490
+
491
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
492
+ for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
493
+ var node = group[i];
494
+ if (node) return node;
495
+ }
496
+ }
497
+
498
+ return null;
499
+ }
500
+
501
+ function selection_size() {
502
+ let size = 0;
503
+ for (const node of this) ++size; // eslint-disable-line no-unused-vars
504
+ return size;
505
+ }
506
+
507
+ function selection_empty() {
508
+ return !this.node();
509
+ }
510
+
511
+ function selection_each(callback) {
512
+
513
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
514
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
515
+ if (node = group[i]) callback.call(node, node.__data__, i, group);
516
+ }
517
+ }
518
+
519
+ return this;
520
+ }
521
+
522
+ function attrRemove$1(name) {
523
+ return function() {
524
+ this.removeAttribute(name);
525
+ };
526
+ }
527
+
528
+ function attrRemoveNS$1(fullname) {
529
+ return function() {
530
+ this.removeAttributeNS(fullname.space, fullname.local);
531
+ };
532
+ }
533
+
534
+ function attrConstant$1(name, value) {
535
+ return function() {
536
+ this.setAttribute(name, value);
537
+ };
538
+ }
539
+
540
+ function attrConstantNS$1(fullname, value) {
541
+ return function() {
542
+ this.setAttributeNS(fullname.space, fullname.local, value);
543
+ };
544
+ }
545
+
546
+ function attrFunction$1(name, value) {
547
+ return function() {
548
+ var v = value.apply(this, arguments);
549
+ if (v == null) this.removeAttribute(name);
550
+ else this.setAttribute(name, v);
551
+ };
552
+ }
553
+
554
+ function attrFunctionNS$1(fullname, value) {
555
+ return function() {
556
+ var v = value.apply(this, arguments);
557
+ if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
558
+ else this.setAttributeNS(fullname.space, fullname.local, v);
559
+ };
560
+ }
561
+
562
+ function selection_attr(name, value) {
563
+ var fullname = namespace(name);
564
+
565
+ if (arguments.length < 2) {
566
+ var node = this.node();
567
+ return fullname.local
568
+ ? node.getAttributeNS(fullname.space, fullname.local)
569
+ : node.getAttribute(fullname);
570
+ }
571
+
572
+ return this.each((value == null
573
+ ? (fullname.local ? attrRemoveNS$1 : attrRemove$1) : (typeof value === "function"
574
+ ? (fullname.local ? attrFunctionNS$1 : attrFunction$1)
575
+ : (fullname.local ? attrConstantNS$1 : attrConstant$1)))(fullname, value));
576
+ }
577
+
578
+ function defaultView(node) {
579
+ return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
580
+ || (node.document && node) // node is a Window
581
+ || node.defaultView; // node is a Document
582
+ }
583
+
584
+ function styleRemove$1(name) {
585
+ return function() {
586
+ this.style.removeProperty(name);
587
+ };
588
+ }
589
+
590
+ function styleConstant$1(name, value, priority) {
591
+ return function() {
592
+ this.style.setProperty(name, value, priority);
593
+ };
594
+ }
595
+
596
+ function styleFunction$1(name, value, priority) {
597
+ return function() {
598
+ var v = value.apply(this, arguments);
599
+ if (v == null) this.style.removeProperty(name);
600
+ else this.style.setProperty(name, v, priority);
601
+ };
602
+ }
603
+
604
+ function selection_style(name, value, priority) {
605
+ return arguments.length > 1
606
+ ? this.each((value == null
607
+ ? styleRemove$1 : typeof value === "function"
608
+ ? styleFunction$1
609
+ : styleConstant$1)(name, value, priority == null ? "" : priority))
610
+ : styleValue(this.node(), name);
611
+ }
612
+
613
+ function styleValue(node, name) {
614
+ return node.style.getPropertyValue(name)
615
+ || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
616
+ }
617
+
618
+ function propertyRemove(name) {
619
+ return function() {
620
+ delete this[name];
621
+ };
622
+ }
623
+
624
+ function propertyConstant(name, value) {
625
+ return function() {
626
+ this[name] = value;
627
+ };
628
+ }
629
+
630
+ function propertyFunction(name, value) {
631
+ return function() {
632
+ var v = value.apply(this, arguments);
633
+ if (v == null) delete this[name];
634
+ else this[name] = v;
635
+ };
636
+ }
637
+
638
+ function selection_property(name, value) {
639
+ return arguments.length > 1
640
+ ? this.each((value == null
641
+ ? propertyRemove : typeof value === "function"
642
+ ? propertyFunction
643
+ : propertyConstant)(name, value))
644
+ : this.node()[name];
645
+ }
646
+
647
+ function classArray(string) {
648
+ return string.trim().split(/^|\s+/);
649
+ }
650
+
651
+ function classList(node) {
652
+ return node.classList || new ClassList(node);
653
+ }
654
+
655
+ function ClassList(node) {
656
+ this._node = node;
657
+ this._names = classArray(node.getAttribute("class") || "");
658
+ }
659
+
660
+ ClassList.prototype = {
661
+ add: function(name) {
662
+ var i = this._names.indexOf(name);
663
+ if (i < 0) {
664
+ this._names.push(name);
665
+ this._node.setAttribute("class", this._names.join(" "));
666
+ }
667
+ },
668
+ remove: function(name) {
669
+ var i = this._names.indexOf(name);
670
+ if (i >= 0) {
671
+ this._names.splice(i, 1);
672
+ this._node.setAttribute("class", this._names.join(" "));
673
+ }
674
+ },
675
+ contains: function(name) {
676
+ return this._names.indexOf(name) >= 0;
677
+ }
678
+ };
679
+
680
+ function classedAdd(node, names) {
681
+ var list = classList(node), i = -1, n = names.length;
682
+ while (++i < n) list.add(names[i]);
683
+ }
684
+
685
+ function classedRemove(node, names) {
686
+ var list = classList(node), i = -1, n = names.length;
687
+ while (++i < n) list.remove(names[i]);
688
+ }
689
+
690
+ function classedTrue(names) {
691
+ return function() {
692
+ classedAdd(this, names);
693
+ };
694
+ }
695
+
696
+ function classedFalse(names) {
697
+ return function() {
698
+ classedRemove(this, names);
699
+ };
700
+ }
701
+
702
+ function classedFunction(names, value) {
703
+ return function() {
704
+ (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
705
+ };
706
+ }
707
+
708
+ function selection_classed(name, value) {
709
+ var names = classArray(name + "");
710
+
711
+ if (arguments.length < 2) {
712
+ var list = classList(this.node()), i = -1, n = names.length;
713
+ while (++i < n) if (!list.contains(names[i])) return false;
714
+ return true;
715
+ }
716
+
717
+ return this.each((typeof value === "function"
718
+ ? classedFunction : value
719
+ ? classedTrue
720
+ : classedFalse)(names, value));
721
+ }
722
+
723
+ function textRemove() {
724
+ this.textContent = "";
725
+ }
726
+
727
+ function textConstant$1(value) {
728
+ return function() {
729
+ this.textContent = value;
730
+ };
731
+ }
732
+
733
+ function textFunction$1(value) {
734
+ return function() {
735
+ var v = value.apply(this, arguments);
736
+ this.textContent = v == null ? "" : v;
737
+ };
738
+ }
739
+
740
+ function selection_text(value) {
741
+ return arguments.length
742
+ ? this.each(value == null
743
+ ? textRemove : (typeof value === "function"
744
+ ? textFunction$1
745
+ : textConstant$1)(value))
746
+ : this.node().textContent;
747
+ }
748
+
749
+ function htmlRemove() {
750
+ this.innerHTML = "";
751
+ }
752
+
753
+ function htmlConstant(value) {
754
+ return function() {
755
+ this.innerHTML = value;
756
+ };
757
+ }
758
+
759
+ function htmlFunction(value) {
760
+ return function() {
761
+ var v = value.apply(this, arguments);
762
+ this.innerHTML = v == null ? "" : v;
763
+ };
764
+ }
765
+
766
+ function selection_html(value) {
767
+ return arguments.length
768
+ ? this.each(value == null
769
+ ? htmlRemove : (typeof value === "function"
770
+ ? htmlFunction
771
+ : htmlConstant)(value))
772
+ : this.node().innerHTML;
773
+ }
774
+
775
+ function raise() {
776
+ if (this.nextSibling) this.parentNode.appendChild(this);
777
+ }
778
+
779
+ function selection_raise() {
780
+ return this.each(raise);
781
+ }
782
+
783
+ function lower() {
784
+ if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
785
+ }
786
+
787
+ function selection_lower() {
788
+ return this.each(lower);
789
+ }
790
+
791
+ function selection_append(name) {
792
+ var create = typeof name === "function" ? name : creator(name);
793
+ return this.select(function() {
794
+ return this.appendChild(create.apply(this, arguments));
795
+ });
796
+ }
797
+
798
+ function constantNull() {
799
+ return null;
800
+ }
801
+
802
+ function selection_insert(name, before) {
803
+ var create = typeof name === "function" ? name : creator(name),
804
+ select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
805
+ return this.select(function() {
806
+ return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
807
+ });
808
+ }
809
+
810
+ function remove() {
811
+ var parent = this.parentNode;
812
+ if (parent) parent.removeChild(this);
813
+ }
814
+
815
+ function selection_remove() {
816
+ return this.each(remove);
817
+ }
818
+
819
+ function selection_cloneShallow() {
820
+ var clone = this.cloneNode(false), parent = this.parentNode;
821
+ return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
822
+ }
823
+
824
+ function selection_cloneDeep() {
825
+ var clone = this.cloneNode(true), parent = this.parentNode;
826
+ return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
827
+ }
828
+
829
+ function selection_clone(deep) {
830
+ return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
831
+ }
832
+
833
+ function selection_datum(value) {
834
+ return arguments.length
835
+ ? this.property("__data__", value)
836
+ : this.node().__data__;
837
+ }
838
+
839
+ function contextListener(listener) {
840
+ return function(event) {
841
+ listener.call(this, event, this.__data__);
842
+ };
843
+ }
844
+
845
+ function parseTypenames(typenames) {
846
+ return typenames.trim().split(/^|\s+/).map(function(t) {
847
+ var name = "", i = t.indexOf(".");
848
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
849
+ return {type: t, name: name};
850
+ });
851
+ }
852
+
853
+ function onRemove(typename) {
854
+ return function() {
855
+ var on = this.__on;
856
+ if (!on) return;
857
+ for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
858
+ if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
859
+ this.removeEventListener(o.type, o.listener, o.options);
860
+ } else {
861
+ on[++i] = o;
862
+ }
863
+ }
864
+ if (++i) on.length = i;
865
+ else delete this.__on;
866
+ };
867
+ }
868
+
869
+ function onAdd(typename, value, options) {
870
+ return function() {
871
+ var on = this.__on, o, listener = contextListener(value);
872
+ if (on) for (var j = 0, m = on.length; j < m; ++j) {
873
+ if ((o = on[j]).type === typename.type && o.name === typename.name) {
874
+ this.removeEventListener(o.type, o.listener, o.options);
875
+ this.addEventListener(o.type, o.listener = listener, o.options = options);
876
+ o.value = value;
877
+ return;
878
+ }
879
+ }
880
+ this.addEventListener(typename.type, listener, options);
881
+ o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};
882
+ if (!on) this.__on = [o];
883
+ else on.push(o);
884
+ };
885
+ }
886
+
887
+ function selection_on(typename, value, options) {
888
+ var typenames = parseTypenames(typename + ""), i, n = typenames.length, t;
889
+
890
+ if (arguments.length < 2) {
891
+ var on = this.node().__on;
892
+ if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
893
+ for (i = 0, o = on[j]; i < n; ++i) {
894
+ if ((t = typenames[i]).type === o.type && t.name === o.name) {
895
+ return o.value;
896
+ }
897
+ }
898
+ }
899
+ return;
900
+ }
901
+
902
+ on = value ? onAdd : onRemove;
903
+ for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
904
+ return this;
905
+ }
906
+
907
+ function dispatchEvent(node, type, params) {
908
+ var window = defaultView(node),
909
+ event = window.CustomEvent;
910
+
911
+ if (typeof event === "function") {
912
+ event = new event(type, params);
913
+ } else {
914
+ event = window.document.createEvent("Event");
915
+ if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
916
+ else event.initEvent(type, false, false);
917
+ }
918
+
919
+ node.dispatchEvent(event);
920
+ }
921
+
922
+ function dispatchConstant(type, params) {
923
+ return function() {
924
+ return dispatchEvent(this, type, params);
925
+ };
926
+ }
927
+
928
+ function dispatchFunction(type, params) {
929
+ return function() {
930
+ return dispatchEvent(this, type, params.apply(this, arguments));
931
+ };
932
+ }
933
+
934
+ function selection_dispatch(type, params) {
935
+ return this.each((typeof params === "function"
936
+ ? dispatchFunction
937
+ : dispatchConstant)(type, params));
938
+ }
939
+
940
+ function* selection_iterator() {
941
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
942
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
943
+ if (node = group[i]) yield node;
944
+ }
945
+ }
946
+ }
947
+
948
+ var root = [null];
949
+
950
+ function Selection$1(groups, parents) {
951
+ this._groups = groups;
952
+ this._parents = parents;
953
+ }
954
+
955
+ function selection() {
956
+ return new Selection$1([[document.documentElement]], root);
957
+ }
958
+
959
+ function selection_selection() {
960
+ return this;
961
+ }
962
+
963
+ Selection$1.prototype = selection.prototype = {
964
+ constructor: Selection$1,
965
+ select: selection_select,
966
+ selectAll: selection_selectAll,
967
+ selectChild: selection_selectChild,
968
+ selectChildren: selection_selectChildren,
969
+ filter: selection_filter,
970
+ data: selection_data,
971
+ enter: selection_enter,
972
+ exit: selection_exit,
973
+ join: selection_join,
974
+ merge: selection_merge,
975
+ selection: selection_selection,
976
+ order: selection_order,
977
+ sort: selection_sort,
978
+ call: selection_call,
979
+ nodes: selection_nodes,
980
+ node: selection_node,
981
+ size: selection_size,
982
+ empty: selection_empty,
983
+ each: selection_each,
984
+ attr: selection_attr,
985
+ style: selection_style,
986
+ property: selection_property,
987
+ classed: selection_classed,
988
+ text: selection_text,
989
+ html: selection_html,
990
+ raise: selection_raise,
991
+ lower: selection_lower,
992
+ append: selection_append,
993
+ insert: selection_insert,
994
+ remove: selection_remove,
995
+ clone: selection_clone,
996
+ datum: selection_datum,
997
+ on: selection_on,
998
+ dispatch: selection_dispatch,
999
+ [Symbol.iterator]: selection_iterator
1000
+ };
1001
+
1002
+ function select(selector) {
1003
+ return typeof selector === "string"
1004
+ ? new Selection$1([[document.querySelector(selector)]], [document.documentElement])
1005
+ : new Selection$1([[selector]], root);
1006
+ }
1007
+
1008
+ function define(constructor, factory, prototype) {
1009
+ constructor.prototype = factory.prototype = prototype;
1010
+ prototype.constructor = constructor;
1011
+ }
1012
+
1013
+ function extend(parent, definition) {
1014
+ var prototype = Object.create(parent.prototype);
1015
+ for (var key in definition) prototype[key] = definition[key];
1016
+ return prototype;
1017
+ }
1018
+
1019
+ function Color() {}
1020
+
1021
+ var darker = 0.7;
1022
+ var brighter = 1 / darker;
1023
+
1024
+ var reI = "\\s*([+-]?\\d+)\\s*",
1025
+ reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
1026
+ reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
1027
+ reHex = /^#([0-9a-f]{3,8})$/,
1028
+ reRgbInteger = new RegExp(`^rgb\\(${reI},${reI},${reI}\\)$`),
1029
+ reRgbPercent = new RegExp(`^rgb\\(${reP},${reP},${reP}\\)$`),
1030
+ reRgbaInteger = new RegExp(`^rgba\\(${reI},${reI},${reI},${reN}\\)$`),
1031
+ reRgbaPercent = new RegExp(`^rgba\\(${reP},${reP},${reP},${reN}\\)$`),
1032
+ reHslPercent = new RegExp(`^hsl\\(${reN},${reP},${reP}\\)$`),
1033
+ reHslaPercent = new RegExp(`^hsla\\(${reN},${reP},${reP},${reN}\\)$`);
1034
+
1035
+ var named = {
1036
+ aliceblue: 0xf0f8ff,
1037
+ antiquewhite: 0xfaebd7,
1038
+ aqua: 0x00ffff,
1039
+ aquamarine: 0x7fffd4,
1040
+ azure: 0xf0ffff,
1041
+ beige: 0xf5f5dc,
1042
+ bisque: 0xffe4c4,
1043
+ black: 0x000000,
1044
+ blanchedalmond: 0xffebcd,
1045
+ blue: 0x0000ff,
1046
+ blueviolet: 0x8a2be2,
1047
+ brown: 0xa52a2a,
1048
+ burlywood: 0xdeb887,
1049
+ cadetblue: 0x5f9ea0,
1050
+ chartreuse: 0x7fff00,
1051
+ chocolate: 0xd2691e,
1052
+ coral: 0xff7f50,
1053
+ cornflowerblue: 0x6495ed,
1054
+ cornsilk: 0xfff8dc,
1055
+ crimson: 0xdc143c,
1056
+ cyan: 0x00ffff,
1057
+ darkblue: 0x00008b,
1058
+ darkcyan: 0x008b8b,
1059
+ darkgoldenrod: 0xb8860b,
1060
+ darkgray: 0xa9a9a9,
1061
+ darkgreen: 0x006400,
1062
+ darkgrey: 0xa9a9a9,
1063
+ darkkhaki: 0xbdb76b,
1064
+ darkmagenta: 0x8b008b,
1065
+ darkolivegreen: 0x556b2f,
1066
+ darkorange: 0xff8c00,
1067
+ darkorchid: 0x9932cc,
1068
+ darkred: 0x8b0000,
1069
+ darksalmon: 0xe9967a,
1070
+ darkseagreen: 0x8fbc8f,
1071
+ darkslateblue: 0x483d8b,
1072
+ darkslategray: 0x2f4f4f,
1073
+ darkslategrey: 0x2f4f4f,
1074
+ darkturquoise: 0x00ced1,
1075
+ darkviolet: 0x9400d3,
1076
+ deeppink: 0xff1493,
1077
+ deepskyblue: 0x00bfff,
1078
+ dimgray: 0x696969,
1079
+ dimgrey: 0x696969,
1080
+ dodgerblue: 0x1e90ff,
1081
+ firebrick: 0xb22222,
1082
+ floralwhite: 0xfffaf0,
1083
+ forestgreen: 0x228b22,
1084
+ fuchsia: 0xff00ff,
1085
+ gainsboro: 0xdcdcdc,
1086
+ ghostwhite: 0xf8f8ff,
1087
+ gold: 0xffd700,
1088
+ goldenrod: 0xdaa520,
1089
+ gray: 0x808080,
1090
+ green: 0x008000,
1091
+ greenyellow: 0xadff2f,
1092
+ grey: 0x808080,
1093
+ honeydew: 0xf0fff0,
1094
+ hotpink: 0xff69b4,
1095
+ indianred: 0xcd5c5c,
1096
+ indigo: 0x4b0082,
1097
+ ivory: 0xfffff0,
1098
+ khaki: 0xf0e68c,
1099
+ lavender: 0xe6e6fa,
1100
+ lavenderblush: 0xfff0f5,
1101
+ lawngreen: 0x7cfc00,
1102
+ lemonchiffon: 0xfffacd,
1103
+ lightblue: 0xadd8e6,
1104
+ lightcoral: 0xf08080,
1105
+ lightcyan: 0xe0ffff,
1106
+ lightgoldenrodyellow: 0xfafad2,
1107
+ lightgray: 0xd3d3d3,
1108
+ lightgreen: 0x90ee90,
1109
+ lightgrey: 0xd3d3d3,
1110
+ lightpink: 0xffb6c1,
1111
+ lightsalmon: 0xffa07a,
1112
+ lightseagreen: 0x20b2aa,
1113
+ lightskyblue: 0x87cefa,
1114
+ lightslategray: 0x778899,
1115
+ lightslategrey: 0x778899,
1116
+ lightsteelblue: 0xb0c4de,
1117
+ lightyellow: 0xffffe0,
1118
+ lime: 0x00ff00,
1119
+ limegreen: 0x32cd32,
1120
+ linen: 0xfaf0e6,
1121
+ magenta: 0xff00ff,
1122
+ maroon: 0x800000,
1123
+ mediumaquamarine: 0x66cdaa,
1124
+ mediumblue: 0x0000cd,
1125
+ mediumorchid: 0xba55d3,
1126
+ mediumpurple: 0x9370db,
1127
+ mediumseagreen: 0x3cb371,
1128
+ mediumslateblue: 0x7b68ee,
1129
+ mediumspringgreen: 0x00fa9a,
1130
+ mediumturquoise: 0x48d1cc,
1131
+ mediumvioletred: 0xc71585,
1132
+ midnightblue: 0x191970,
1133
+ mintcream: 0xf5fffa,
1134
+ mistyrose: 0xffe4e1,
1135
+ moccasin: 0xffe4b5,
1136
+ navajowhite: 0xffdead,
1137
+ navy: 0x000080,
1138
+ oldlace: 0xfdf5e6,
1139
+ olive: 0x808000,
1140
+ olivedrab: 0x6b8e23,
1141
+ orange: 0xffa500,
1142
+ orangered: 0xff4500,
1143
+ orchid: 0xda70d6,
1144
+ palegoldenrod: 0xeee8aa,
1145
+ palegreen: 0x98fb98,
1146
+ paleturquoise: 0xafeeee,
1147
+ palevioletred: 0xdb7093,
1148
+ papayawhip: 0xffefd5,
1149
+ peachpuff: 0xffdab9,
1150
+ peru: 0xcd853f,
1151
+ pink: 0xffc0cb,
1152
+ plum: 0xdda0dd,
1153
+ powderblue: 0xb0e0e6,
1154
+ purple: 0x800080,
1155
+ rebeccapurple: 0x663399,
1156
+ red: 0xff0000,
1157
+ rosybrown: 0xbc8f8f,
1158
+ royalblue: 0x4169e1,
1159
+ saddlebrown: 0x8b4513,
1160
+ salmon: 0xfa8072,
1161
+ sandybrown: 0xf4a460,
1162
+ seagreen: 0x2e8b57,
1163
+ seashell: 0xfff5ee,
1164
+ sienna: 0xa0522d,
1165
+ silver: 0xc0c0c0,
1166
+ skyblue: 0x87ceeb,
1167
+ slateblue: 0x6a5acd,
1168
+ slategray: 0x708090,
1169
+ slategrey: 0x708090,
1170
+ snow: 0xfffafa,
1171
+ springgreen: 0x00ff7f,
1172
+ steelblue: 0x4682b4,
1173
+ tan: 0xd2b48c,
1174
+ teal: 0x008080,
1175
+ thistle: 0xd8bfd8,
1176
+ tomato: 0xff6347,
1177
+ turquoise: 0x40e0d0,
1178
+ violet: 0xee82ee,
1179
+ wheat: 0xf5deb3,
1180
+ white: 0xffffff,
1181
+ whitesmoke: 0xf5f5f5,
1182
+ yellow: 0xffff00,
1183
+ yellowgreen: 0x9acd32
1184
+ };
1185
+
1186
+ define(Color, color, {
1187
+ copy(channels) {
1188
+ return Object.assign(new this.constructor, this, channels);
1189
+ },
1190
+ displayable() {
1191
+ return this.rgb().displayable();
1192
+ },
1193
+ hex: color_formatHex, // Deprecated! Use color.formatHex.
1194
+ formatHex: color_formatHex,
1195
+ formatHex8: color_formatHex8,
1196
+ formatHsl: color_formatHsl,
1197
+ formatRgb: color_formatRgb,
1198
+ toString: color_formatRgb
1199
+ });
1200
+
1201
+ function color_formatHex() {
1202
+ return this.rgb().formatHex();
1203
+ }
1204
+
1205
+ function color_formatHex8() {
1206
+ return this.rgb().formatHex8();
1207
+ }
1208
+
1209
+ function color_formatHsl() {
1210
+ return hslConvert(this).formatHsl();
1211
+ }
1212
+
1213
+ function color_formatRgb() {
1214
+ return this.rgb().formatRgb();
1215
+ }
1216
+
1217
+ function color(format) {
1218
+ var m, l;
1219
+ format = (format + "").trim().toLowerCase();
1220
+ return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000
1221
+ : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00
1222
+ : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000
1223
+ : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000
1224
+ : null) // invalid hex
1225
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
1226
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
1227
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
1228
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
1229
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
1230
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
1231
+ : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins
1232
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
1233
+ : null;
1234
+ }
1235
+
1236
+ function rgbn(n) {
1237
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
1238
+ }
1239
+
1240
+ function rgba(r, g, b, a) {
1241
+ if (a <= 0) r = g = b = NaN;
1242
+ return new Rgb(r, g, b, a);
1243
+ }
1244
+
1245
+ function rgbConvert(o) {
1246
+ if (!(o instanceof Color)) o = color(o);
1247
+ if (!o) return new Rgb;
1248
+ o = o.rgb();
1249
+ return new Rgb(o.r, o.g, o.b, o.opacity);
1250
+ }
1251
+
1252
+ function rgb(r, g, b, opacity) {
1253
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
1254
+ }
1255
+
1256
+ function Rgb(r, g, b, opacity) {
1257
+ this.r = +r;
1258
+ this.g = +g;
1259
+ this.b = +b;
1260
+ this.opacity = +opacity;
1261
+ }
1262
+
1263
+ define(Rgb, rgb, extend(Color, {
1264
+ brighter(k) {
1265
+ k = k == null ? brighter : Math.pow(brighter, k);
1266
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
1267
+ },
1268
+ darker(k) {
1269
+ k = k == null ? darker : Math.pow(darker, k);
1270
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
1271
+ },
1272
+ rgb() {
1273
+ return this;
1274
+ },
1275
+ clamp() {
1276
+ return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
1277
+ },
1278
+ displayable() {
1279
+ return (-0.5 <= this.r && this.r < 255.5)
1280
+ && (-0.5 <= this.g && this.g < 255.5)
1281
+ && (-0.5 <= this.b && this.b < 255.5)
1282
+ && (0 <= this.opacity && this.opacity <= 1);
1283
+ },
1284
+ hex: rgb_formatHex, // Deprecated! Use color.formatHex.
1285
+ formatHex: rgb_formatHex,
1286
+ formatHex8: rgb_formatHex8,
1287
+ formatRgb: rgb_formatRgb,
1288
+ toString: rgb_formatRgb
1289
+ }));
1290
+
1291
+ function rgb_formatHex() {
1292
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;
1293
+ }
1294
+
1295
+ function rgb_formatHex8() {
1296
+ return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
1297
+ }
1298
+
1299
+ function rgb_formatRgb() {
1300
+ const a = clampa(this.opacity);
1301
+ return `${a === 1 ? "rgb(" : "rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? ")" : `, ${a})`}`;
1302
+ }
1303
+
1304
+ function clampa(opacity) {
1305
+ return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
1306
+ }
1307
+
1308
+ function clampi(value) {
1309
+ return Math.max(0, Math.min(255, Math.round(value) || 0));
1310
+ }
1311
+
1312
+ function hex(value) {
1313
+ value = clampi(value);
1314
+ return (value < 16 ? "0" : "") + value.toString(16);
1315
+ }
1316
+
1317
+ function hsla(h, s, l, a) {
1318
+ if (a <= 0) h = s = l = NaN;
1319
+ else if (l <= 0 || l >= 1) h = s = NaN;
1320
+ else if (s <= 0) h = NaN;
1321
+ return new Hsl(h, s, l, a);
1322
+ }
1323
+
1324
+ function hslConvert(o) {
1325
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
1326
+ if (!(o instanceof Color)) o = color(o);
1327
+ if (!o) return new Hsl;
1328
+ if (o instanceof Hsl) return o;
1329
+ o = o.rgb();
1330
+ var r = o.r / 255,
1331
+ g = o.g / 255,
1332
+ b = o.b / 255,
1333
+ min = Math.min(r, g, b),
1334
+ max = Math.max(r, g, b),
1335
+ h = NaN,
1336
+ s = max - min,
1337
+ l = (max + min) / 2;
1338
+ if (s) {
1339
+ if (r === max) h = (g - b) / s + (g < b) * 6;
1340
+ else if (g === max) h = (b - r) / s + 2;
1341
+ else h = (r - g) / s + 4;
1342
+ s /= l < 0.5 ? max + min : 2 - max - min;
1343
+ h *= 60;
1344
+ } else {
1345
+ s = l > 0 && l < 1 ? 0 : h;
1346
+ }
1347
+ return new Hsl(h, s, l, o.opacity);
1348
+ }
1349
+
1350
+ function hsl(h, s, l, opacity) {
1351
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
1352
+ }
1353
+
1354
+ function Hsl(h, s, l, opacity) {
1355
+ this.h = +h;
1356
+ this.s = +s;
1357
+ this.l = +l;
1358
+ this.opacity = +opacity;
1359
+ }
1360
+
1361
+ define(Hsl, hsl, extend(Color, {
1362
+ brighter(k) {
1363
+ k = k == null ? brighter : Math.pow(brighter, k);
1364
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
1365
+ },
1366
+ darker(k) {
1367
+ k = k == null ? darker : Math.pow(darker, k);
1368
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
1369
+ },
1370
+ rgb() {
1371
+ var h = this.h % 360 + (this.h < 0) * 360,
1372
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
1373
+ l = this.l,
1374
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
1375
+ m1 = 2 * l - m2;
1376
+ return new Rgb(
1377
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
1378
+ hsl2rgb(h, m1, m2),
1379
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
1380
+ this.opacity
1381
+ );
1382
+ },
1383
+ clamp() {
1384
+ return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
1385
+ },
1386
+ displayable() {
1387
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
1388
+ && (0 <= this.l && this.l <= 1)
1389
+ && (0 <= this.opacity && this.opacity <= 1);
1390
+ },
1391
+ formatHsl() {
1392
+ const a = clampa(this.opacity);
1393
+ return `${a === 1 ? "hsl(" : "hsla("}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? ")" : `, ${a})`}`;
1394
+ }
1395
+ }));
1396
+
1397
+ function clamph(value) {
1398
+ value = (value || 0) % 360;
1399
+ return value < 0 ? value + 360 : value;
1400
+ }
1401
+
1402
+ function clampt(value) {
1403
+ return Math.max(0, Math.min(1, value || 0));
1404
+ }
1405
+
1406
+ /* From FvD 13.37, CSS Color Module Level 3 */
1407
+ function hsl2rgb(h, m1, m2) {
1408
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
1409
+ : h < 180 ? m2
1410
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
1411
+ : m1) * 255;
1412
+ }
1413
+
1414
+ var constant = x => () => x;
1415
+
1416
+ function linear(a, d) {
1417
+ return function(t) {
1418
+ return a + t * d;
1419
+ };
1420
+ }
1421
+
1422
+ function exponential(a, b, y) {
1423
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
1424
+ return Math.pow(a + t * b, y);
1425
+ };
1426
+ }
1427
+
1428
+ function gamma(y) {
1429
+ return (y = +y) === 1 ? nogamma : function(a, b) {
1430
+ return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
1431
+ };
1432
+ }
1433
+
1434
+ function nogamma(a, b) {
1435
+ var d = b - a;
1436
+ return d ? linear(a, d) : constant(isNaN(a) ? b : a);
1437
+ }
1438
+
1439
+ var interpolateRgb = (function rgbGamma(y) {
1440
+ var color = gamma(y);
1441
+
1442
+ function rgb$1(start, end) {
1443
+ var r = color((start = rgb(start)).r, (end = rgb(end)).r),
1444
+ g = color(start.g, end.g),
1445
+ b = color(start.b, end.b),
1446
+ opacity = nogamma(start.opacity, end.opacity);
1447
+ return function(t) {
1448
+ start.r = r(t);
1449
+ start.g = g(t);
1450
+ start.b = b(t);
1451
+ start.opacity = opacity(t);
1452
+ return start + "";
1453
+ };
1454
+ }
1455
+
1456
+ rgb$1.gamma = rgbGamma;
1457
+
1458
+ return rgb$1;
1459
+ })(1);
1460
+
1461
+ function numberArray(a, b) {
1462
+ if (!b) b = [];
1463
+ var n = a ? Math.min(b.length, a.length) : 0,
1464
+ c = b.slice(),
1465
+ i;
1466
+ return function(t) {
1467
+ for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
1468
+ return c;
1469
+ };
1470
+ }
1471
+
1472
+ function isNumberArray(x) {
1473
+ return ArrayBuffer.isView(x) && !(x instanceof DataView);
1474
+ }
1475
+
1476
+ function genericArray(a, b) {
1477
+ var nb = b ? b.length : 0,
1478
+ na = a ? Math.min(nb, a.length) : 0,
1479
+ x = new Array(na),
1480
+ c = new Array(nb),
1481
+ i;
1482
+
1483
+ for (i = 0; i < na; ++i) x[i] = interpolate$1(a[i], b[i]);
1484
+ for (; i < nb; ++i) c[i] = b[i];
1485
+
1486
+ return function(t) {
1487
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
1488
+ return c;
1489
+ };
1490
+ }
1491
+
1492
+ function date(a, b) {
1493
+ var d = new Date;
1494
+ return a = +a, b = +b, function(t) {
1495
+ return d.setTime(a * (1 - t) + b * t), d;
1496
+ };
1497
+ }
1498
+
1499
+ function interpolateNumber(a, b) {
1500
+ return a = +a, b = +b, function(t) {
1501
+ return a * (1 - t) + b * t;
1502
+ };
1503
+ }
1504
+
1505
+ function object(a, b) {
1506
+ var i = {},
1507
+ c = {},
1508
+ k;
1509
+
1510
+ if (a === null || typeof a !== "object") a = {};
1511
+ if (b === null || typeof b !== "object") b = {};
1512
+
1513
+ for (k in b) {
1514
+ if (k in a) {
1515
+ i[k] = interpolate$1(a[k], b[k]);
1516
+ } else {
1517
+ c[k] = b[k];
1518
+ }
1519
+ }
1520
+
1521
+ return function(t) {
1522
+ for (k in i) c[k] = i[k](t);
1523
+ return c;
1524
+ };
1525
+ }
1526
+
1527
+ var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
1528
+ reB = new RegExp(reA.source, "g");
1529
+
1530
+ function zero(b) {
1531
+ return function() {
1532
+ return b;
1533
+ };
1534
+ }
1535
+
1536
+ function one(b) {
1537
+ return function(t) {
1538
+ return b(t) + "";
1539
+ };
1540
+ }
1541
+
1542
+ function interpolateString(a, b) {
1543
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
1544
+ am, // current match in a
1545
+ bm, // current match in b
1546
+ bs, // string preceding current number in b, if any
1547
+ i = -1, // index in s
1548
+ s = [], // string constants and placeholders
1549
+ q = []; // number interpolators
1550
+
1551
+ // Coerce inputs to strings.
1552
+ a = a + "", b = b + "";
1553
+
1554
+ // Interpolate pairs of numbers in a & b.
1555
+ while ((am = reA.exec(a))
1556
+ && (bm = reB.exec(b))) {
1557
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
1558
+ bs = b.slice(bi, bs);
1559
+ if (s[i]) s[i] += bs; // coalesce with previous string
1560
+ else s[++i] = bs;
1561
+ }
1562
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
1563
+ if (s[i]) s[i] += bm; // coalesce with previous string
1564
+ else s[++i] = bm;
1565
+ } else { // interpolate non-matching numbers
1566
+ s[++i] = null;
1567
+ q.push({i: i, x: interpolateNumber(am, bm)});
1568
+ }
1569
+ bi = reB.lastIndex;
1570
+ }
1571
+
1572
+ // Add remains of b.
1573
+ if (bi < b.length) {
1574
+ bs = b.slice(bi);
1575
+ if (s[i]) s[i] += bs; // coalesce with previous string
1576
+ else s[++i] = bs;
1577
+ }
1578
+
1579
+ // Special optimization for only a single match.
1580
+ // Otherwise, interpolate each of the numbers and rejoin the string.
1581
+ return s.length < 2 ? (q[0]
1582
+ ? one(q[0].x)
1583
+ : zero(b))
1584
+ : (b = q.length, function(t) {
1585
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
1586
+ return s.join("");
1587
+ });
1588
+ }
1589
+
1590
+ function interpolate$1(a, b) {
1591
+ var t = typeof b, c;
1592
+ return b == null || t === "boolean" ? constant(b)
1593
+ : (t === "number" ? interpolateNumber
1594
+ : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
1595
+ : b instanceof color ? interpolateRgb
1596
+ : b instanceof Date ? date
1597
+ : isNumberArray(b) ? numberArray
1598
+ : Array.isArray(b) ? genericArray
1599
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
1600
+ : interpolateNumber)(a, b);
1601
+ }
1602
+
1603
+ var degrees = 180 / Math.PI;
1604
+
1605
+ var identity = {
1606
+ translateX: 0,
1607
+ translateY: 0,
1608
+ rotate: 0,
1609
+ skewX: 0,
1610
+ scaleX: 1,
1611
+ scaleY: 1
1612
+ };
1613
+
1614
+ function decompose(a, b, c, d, e, f) {
1615
+ var scaleX, scaleY, skewX;
1616
+ if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
1617
+ if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
1618
+ if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
1619
+ if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
1620
+ return {
1621
+ translateX: e,
1622
+ translateY: f,
1623
+ rotate: Math.atan2(b, a) * degrees,
1624
+ skewX: Math.atan(skewX) * degrees,
1625
+ scaleX: scaleX,
1626
+ scaleY: scaleY
1627
+ };
1628
+ }
1629
+
1630
+ var svgNode;
1631
+
1632
+ /* eslint-disable no-undef */
1633
+ function parseCss(value) {
1634
+ const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
1635
+ return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
1636
+ }
1637
+
1638
+ function parseSvg(value) {
1639
+ if (value == null) return identity;
1640
+ if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
1641
+ svgNode.setAttribute("transform", value);
1642
+ if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
1643
+ value = value.matrix;
1644
+ return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
1645
+ }
1646
+
1647
+ function interpolateTransform(parse, pxComma, pxParen, degParen) {
1648
+
1649
+ function pop(s) {
1650
+ return s.length ? s.pop() + " " : "";
1651
+ }
1652
+
1653
+ function translate(xa, ya, xb, yb, s, q) {
1654
+ if (xa !== xb || ya !== yb) {
1655
+ var i = s.push("translate(", null, pxComma, null, pxParen);
1656
+ q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)});
1657
+ } else if (xb || yb) {
1658
+ s.push("translate(" + xb + pxComma + yb + pxParen);
1659
+ }
1660
+ }
1661
+
1662
+ function rotate(a, b, s, q) {
1663
+ if (a !== b) {
1664
+ if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
1665
+ q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b)});
1666
+ } else if (b) {
1667
+ s.push(pop(s) + "rotate(" + b + degParen);
1668
+ }
1669
+ }
1670
+
1671
+ function skewX(a, b, s, q) {
1672
+ if (a !== b) {
1673
+ q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b)});
1674
+ } else if (b) {
1675
+ s.push(pop(s) + "skewX(" + b + degParen);
1676
+ }
1677
+ }
1678
+
1679
+ function scale(xa, ya, xb, yb, s, q) {
1680
+ if (xa !== xb || ya !== yb) {
1681
+ var i = s.push(pop(s) + "scale(", null, ",", null, ")");
1682
+ q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)});
1683
+ } else if (xb !== 1 || yb !== 1) {
1684
+ s.push(pop(s) + "scale(" + xb + "," + yb + ")");
1685
+ }
1686
+ }
1687
+
1688
+ return function(a, b) {
1689
+ var s = [], // string constants and placeholders
1690
+ q = []; // number interpolators
1691
+ a = parse(a), b = parse(b);
1692
+ translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
1693
+ rotate(a.rotate, b.rotate, s, q);
1694
+ skewX(a.skewX, b.skewX, s, q);
1695
+ scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
1696
+ a = b = null; // gc
1697
+ return function(t) {
1698
+ var i = -1, n = q.length, o;
1699
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
1700
+ return s.join("");
1701
+ };
1702
+ };
1703
+ }
1704
+
1705
+ var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
1706
+ var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
1707
+
1708
+ var frame = 0, // is an animation frame pending?
1709
+ timeout$1 = 0, // is a timeout pending?
1710
+ interval = 0, // are any timers active?
1711
+ pokeDelay = 1000, // how frequently we check for clock skew
1712
+ taskHead,
1713
+ taskTail,
1714
+ clockLast = 0,
1715
+ clockNow = 0,
1716
+ clockSkew = 0,
1717
+ clock = typeof performance === "object" && performance.now ? performance : Date,
1718
+ setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };
1719
+
1720
+ function now() {
1721
+ return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
1722
+ }
1723
+
1724
+ function clearNow() {
1725
+ clockNow = 0;
1726
+ }
1727
+
1728
+ function Timer() {
1729
+ this._call =
1730
+ this._time =
1731
+ this._next = null;
1732
+ }
1733
+
1734
+ Timer.prototype = timer.prototype = {
1735
+ constructor: Timer,
1736
+ restart: function(callback, delay, time) {
1737
+ if (typeof callback !== "function") throw new TypeError("callback is not a function");
1738
+ time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
1739
+ if (!this._next && taskTail !== this) {
1740
+ if (taskTail) taskTail._next = this;
1741
+ else taskHead = this;
1742
+ taskTail = this;
1743
+ }
1744
+ this._call = callback;
1745
+ this._time = time;
1746
+ sleep();
1747
+ },
1748
+ stop: function() {
1749
+ if (this._call) {
1750
+ this._call = null;
1751
+ this._time = Infinity;
1752
+ sleep();
1753
+ }
1754
+ }
1755
+ };
1756
+
1757
+ function timer(callback, delay, time) {
1758
+ var t = new Timer;
1759
+ t.restart(callback, delay, time);
1760
+ return t;
1761
+ }
1762
+
1763
+ function timerFlush() {
1764
+ now(); // Get the current time, if not already set.
1765
+ ++frame; // Pretend we’ve set an alarm, if we haven’t already.
1766
+ var t = taskHead, e;
1767
+ while (t) {
1768
+ if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);
1769
+ t = t._next;
1770
+ }
1771
+ --frame;
1772
+ }
1773
+
1774
+ function wake() {
1775
+ clockNow = (clockLast = clock.now()) + clockSkew;
1776
+ frame = timeout$1 = 0;
1777
+ try {
1778
+ timerFlush();
1779
+ } finally {
1780
+ frame = 0;
1781
+ nap();
1782
+ clockNow = 0;
1783
+ }
1784
+ }
1785
+
1786
+ function poke() {
1787
+ var now = clock.now(), delay = now - clockLast;
1788
+ if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
1789
+ }
1790
+
1791
+ function nap() {
1792
+ var t0, t1 = taskHead, t2, time = Infinity;
1793
+ while (t1) {
1794
+ if (t1._call) {
1795
+ if (time > t1._time) time = t1._time;
1796
+ t0 = t1, t1 = t1._next;
1797
+ } else {
1798
+ t2 = t1._next, t1._next = null;
1799
+ t1 = t0 ? t0._next = t2 : taskHead = t2;
1800
+ }
1801
+ }
1802
+ taskTail = t0;
1803
+ sleep(time);
1804
+ }
1805
+
1806
+ function sleep(time) {
1807
+ if (frame) return; // Soonest alarm already set, or will be.
1808
+ if (timeout$1) timeout$1 = clearTimeout(timeout$1);
1809
+ var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
1810
+ if (delay > 24) {
1811
+ if (time < Infinity) timeout$1 = setTimeout(wake, time - clock.now() - clockSkew);
1812
+ if (interval) interval = clearInterval(interval);
1813
+ } else {
1814
+ if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
1815
+ frame = 1, setFrame(wake);
1816
+ }
1817
+ }
1818
+
1819
+ function timeout(callback, delay, time) {
1820
+ var t = new Timer;
1821
+ delay = delay == null ? 0 : +delay;
1822
+ t.restart(elapsed => {
1823
+ t.stop();
1824
+ callback(elapsed + delay);
1825
+ }, delay, time);
1826
+ return t;
1827
+ }
1828
+
1829
+ var emptyOn = dispatch("start", "end", "cancel", "interrupt");
1830
+ var emptyTween = [];
1831
+
1832
+ var CREATED = 0;
1833
+ var SCHEDULED = 1;
1834
+ var STARTING = 2;
1835
+ var STARTED = 3;
1836
+ var RUNNING = 4;
1837
+ var ENDING = 5;
1838
+ var ENDED = 6;
1839
+
1840
+ function schedule(node, name, id, index, group, timing) {
1841
+ var schedules = node.__transition;
1842
+ if (!schedules) node.__transition = {};
1843
+ else if (id in schedules) return;
1844
+ create(node, id, {
1845
+ name: name,
1846
+ index: index, // For context during callback.
1847
+ group: group, // For context during callback.
1848
+ on: emptyOn,
1849
+ tween: emptyTween,
1850
+ time: timing.time,
1851
+ delay: timing.delay,
1852
+ duration: timing.duration,
1853
+ ease: timing.ease,
1854
+ timer: null,
1855
+ state: CREATED
1856
+ });
1857
+ }
1858
+
1859
+ function init(node, id) {
1860
+ var schedule = get(node, id);
1861
+ if (schedule.state > CREATED) throw new Error("too late; already scheduled");
1862
+ return schedule;
1863
+ }
1864
+
1865
+ function set(node, id) {
1866
+ var schedule = get(node, id);
1867
+ if (schedule.state > STARTED) throw new Error("too late; already running");
1868
+ return schedule;
1869
+ }
1870
+
1871
+ function get(node, id) {
1872
+ var schedule = node.__transition;
1873
+ if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found");
1874
+ return schedule;
1875
+ }
1876
+
1877
+ function create(node, id, self) {
1878
+ var schedules = node.__transition,
1879
+ tween;
1880
+
1881
+ // Initialize the self timer when the transition is created.
1882
+ // Note the actual delay is not known until the first callback!
1883
+ schedules[id] = self;
1884
+ self.timer = timer(schedule, 0, self.time);
1885
+
1886
+ function schedule(elapsed) {
1887
+ self.state = SCHEDULED;
1888
+ self.timer.restart(start, self.delay, self.time);
1889
+
1890
+ // If the elapsed delay is less than our first sleep, start immediately.
1891
+ if (self.delay <= elapsed) start(elapsed - self.delay);
1892
+ }
1893
+
1894
+ function start(elapsed) {
1895
+ var i, j, n, o;
1896
+
1897
+ // If the state is not SCHEDULED, then we previously errored on start.
1898
+ if (self.state !== SCHEDULED) return stop();
1899
+
1900
+ for (i in schedules) {
1901
+ o = schedules[i];
1902
+ if (o.name !== self.name) continue;
1903
+
1904
+ // While this element already has a starting transition during this frame,
1905
+ // defer starting an interrupting transition until that transition has a
1906
+ // chance to tick (and possibly end); see d3/d3-transition#54!
1907
+ if (o.state === STARTED) return timeout(start);
1908
+
1909
+ // Interrupt the active transition, if any.
1910
+ if (o.state === RUNNING) {
1911
+ o.state = ENDED;
1912
+ o.timer.stop();
1913
+ o.on.call("interrupt", node, node.__data__, o.index, o.group);
1914
+ delete schedules[i];
1915
+ }
1916
+
1917
+ // Cancel any pre-empted transitions.
1918
+ else if (+i < id) {
1919
+ o.state = ENDED;
1920
+ o.timer.stop();
1921
+ o.on.call("cancel", node, node.__data__, o.index, o.group);
1922
+ delete schedules[i];
1923
+ }
1924
+ }
1925
+
1926
+ // Defer the first tick to end of the current frame; see d3/d3#1576.
1927
+ // Note the transition may be canceled after start and before the first tick!
1928
+ // Note this must be scheduled before the start event; see d3/d3-transition#16!
1929
+ // Assuming this is successful, subsequent callbacks go straight to tick.
1930
+ timeout(function() {
1931
+ if (self.state === STARTED) {
1932
+ self.state = RUNNING;
1933
+ self.timer.restart(tick, self.delay, self.time);
1934
+ tick(elapsed);
1935
+ }
1936
+ });
1937
+
1938
+ // Dispatch the start event.
1939
+ // Note this must be done before the tween are initialized.
1940
+ self.state = STARTING;
1941
+ self.on.call("start", node, node.__data__, self.index, self.group);
1942
+ if (self.state !== STARTING) return; // interrupted
1943
+ self.state = STARTED;
1944
+
1945
+ // Initialize the tween, deleting null tween.
1946
+ tween = new Array(n = self.tween.length);
1947
+ for (i = 0, j = -1; i < n; ++i) {
1948
+ if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
1949
+ tween[++j] = o;
1950
+ }
1951
+ }
1952
+ tween.length = j + 1;
1953
+ }
1954
+
1955
+ function tick(elapsed) {
1956
+ var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),
1957
+ i = -1,
1958
+ n = tween.length;
1959
+
1960
+ while (++i < n) {
1961
+ tween[i].call(node, t);
1962
+ }
1963
+
1964
+ // Dispatch the end event.
1965
+ if (self.state === ENDING) {
1966
+ self.on.call("end", node, node.__data__, self.index, self.group);
1967
+ stop();
1968
+ }
1969
+ }
1970
+
1971
+ function stop() {
1972
+ self.state = ENDED;
1973
+ self.timer.stop();
1974
+ delete schedules[id];
1975
+ for (var i in schedules) return; // eslint-disable-line no-unused-vars
1976
+ delete node.__transition;
1977
+ }
1978
+ }
1979
+
1980
+ function interrupt(node, name) {
1981
+ var schedules = node.__transition,
1982
+ schedule,
1983
+ active,
1984
+ empty = true,
1985
+ i;
1986
+
1987
+ if (!schedules) return;
1988
+
1989
+ name = name == null ? null : name + "";
1990
+
1991
+ for (i in schedules) {
1992
+ if ((schedule = schedules[i]).name !== name) { empty = false; continue; }
1993
+ active = schedule.state > STARTING && schedule.state < ENDING;
1994
+ schedule.state = ENDED;
1995
+ schedule.timer.stop();
1996
+ schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
1997
+ delete schedules[i];
1998
+ }
1999
+
2000
+ if (empty) delete node.__transition;
2001
+ }
2002
+
2003
+ function selection_interrupt(name) {
2004
+ return this.each(function() {
2005
+ interrupt(this, name);
2006
+ });
2007
+ }
2008
+
2009
+ function tweenRemove(id, name) {
2010
+ var tween0, tween1;
2011
+ return function() {
2012
+ var schedule = set(this, id),
2013
+ tween = schedule.tween;
2014
+
2015
+ // If this node shared tween with the previous node,
2016
+ // just assign the updated shared tween and we’re done!
2017
+ // Otherwise, copy-on-write.
2018
+ if (tween !== tween0) {
2019
+ tween1 = tween0 = tween;
2020
+ for (var i = 0, n = tween1.length; i < n; ++i) {
2021
+ if (tween1[i].name === name) {
2022
+ tween1 = tween1.slice();
2023
+ tween1.splice(i, 1);
2024
+ break;
2025
+ }
2026
+ }
2027
+ }
2028
+
2029
+ schedule.tween = tween1;
2030
+ };
2031
+ }
2032
+
2033
+ function tweenFunction(id, name, value) {
2034
+ var tween0, tween1;
2035
+ if (typeof value !== "function") throw new Error;
2036
+ return function() {
2037
+ var schedule = set(this, id),
2038
+ tween = schedule.tween;
2039
+
2040
+ // If this node shared tween with the previous node,
2041
+ // just assign the updated shared tween and we’re done!
2042
+ // Otherwise, copy-on-write.
2043
+ if (tween !== tween0) {
2044
+ tween1 = (tween0 = tween).slice();
2045
+ for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {
2046
+ if (tween1[i].name === name) {
2047
+ tween1[i] = t;
2048
+ break;
2049
+ }
2050
+ }
2051
+ if (i === n) tween1.push(t);
2052
+ }
2053
+
2054
+ schedule.tween = tween1;
2055
+ };
2056
+ }
2057
+
2058
+ function transition_tween(name, value) {
2059
+ var id = this._id;
2060
+
2061
+ name += "";
2062
+
2063
+ if (arguments.length < 2) {
2064
+ var tween = get(this.node(), id).tween;
2065
+ for (var i = 0, n = tween.length, t; i < n; ++i) {
2066
+ if ((t = tween[i]).name === name) {
2067
+ return t.value;
2068
+ }
2069
+ }
2070
+ return null;
2071
+ }
2072
+
2073
+ return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
2074
+ }
2075
+
2076
+ function tweenValue(transition, name, value) {
2077
+ var id = transition._id;
2078
+
2079
+ transition.each(function() {
2080
+ var schedule = set(this, id);
2081
+ (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
2082
+ });
2083
+
2084
+ return function(node) {
2085
+ return get(node, id).value[name];
2086
+ };
2087
+ }
2088
+
2089
+ function interpolate(a, b) {
2090
+ var c;
2091
+ return (typeof b === "number" ? interpolateNumber
2092
+ : b instanceof color ? interpolateRgb
2093
+ : (c = color(b)) ? (b = c, interpolateRgb)
2094
+ : interpolateString)(a, b);
2095
+ }
2096
+
2097
+ function attrRemove(name) {
2098
+ return function() {
2099
+ this.removeAttribute(name);
2100
+ };
2101
+ }
2102
+
2103
+ function attrRemoveNS(fullname) {
2104
+ return function() {
2105
+ this.removeAttributeNS(fullname.space, fullname.local);
2106
+ };
2107
+ }
2108
+
2109
+ function attrConstant(name, interpolate, value1) {
2110
+ var string00,
2111
+ string1 = value1 + "",
2112
+ interpolate0;
2113
+ return function() {
2114
+ var string0 = this.getAttribute(name);
2115
+ return string0 === string1 ? null
2116
+ : string0 === string00 ? interpolate0
2117
+ : interpolate0 = interpolate(string00 = string0, value1);
2118
+ };
2119
+ }
2120
+
2121
+ function attrConstantNS(fullname, interpolate, value1) {
2122
+ var string00,
2123
+ string1 = value1 + "",
2124
+ interpolate0;
2125
+ return function() {
2126
+ var string0 = this.getAttributeNS(fullname.space, fullname.local);
2127
+ return string0 === string1 ? null
2128
+ : string0 === string00 ? interpolate0
2129
+ : interpolate0 = interpolate(string00 = string0, value1);
2130
+ };
2131
+ }
2132
+
2133
+ function attrFunction(name, interpolate, value) {
2134
+ var string00,
2135
+ string10,
2136
+ interpolate0;
2137
+ return function() {
2138
+ var string0, value1 = value(this), string1;
2139
+ if (value1 == null) return void this.removeAttribute(name);
2140
+ string0 = this.getAttribute(name);
2141
+ string1 = value1 + "";
2142
+ return string0 === string1 ? null
2143
+ : string0 === string00 && string1 === string10 ? interpolate0
2144
+ : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
2145
+ };
2146
+ }
2147
+
2148
+ function attrFunctionNS(fullname, interpolate, value) {
2149
+ var string00,
2150
+ string10,
2151
+ interpolate0;
2152
+ return function() {
2153
+ var string0, value1 = value(this), string1;
2154
+ if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
2155
+ string0 = this.getAttributeNS(fullname.space, fullname.local);
2156
+ string1 = value1 + "";
2157
+ return string0 === string1 ? null
2158
+ : string0 === string00 && string1 === string10 ? interpolate0
2159
+ : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
2160
+ };
2161
+ }
2162
+
2163
+ function transition_attr(name, value) {
2164
+ var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
2165
+ return this.attrTween(name, typeof value === "function"
2166
+ ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, "attr." + name, value))
2167
+ : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)
2168
+ : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));
2169
+ }
2170
+
2171
+ function attrInterpolate(name, i) {
2172
+ return function(t) {
2173
+ this.setAttribute(name, i.call(this, t));
2174
+ };
2175
+ }
2176
+
2177
+ function attrInterpolateNS(fullname, i) {
2178
+ return function(t) {
2179
+ this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
2180
+ };
2181
+ }
2182
+
2183
+ function attrTweenNS(fullname, value) {
2184
+ var t0, i0;
2185
+ function tween() {
2186
+ var i = value.apply(this, arguments);
2187
+ if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
2188
+ return t0;
2189
+ }
2190
+ tween._value = value;
2191
+ return tween;
2192
+ }
2193
+
2194
+ function attrTween(name, value) {
2195
+ var t0, i0;
2196
+ function tween() {
2197
+ var i = value.apply(this, arguments);
2198
+ if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
2199
+ return t0;
2200
+ }
2201
+ tween._value = value;
2202
+ return tween;
2203
+ }
2204
+
2205
+ function transition_attrTween(name, value) {
2206
+ var key = "attr." + name;
2207
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
2208
+ if (value == null) return this.tween(key, null);
2209
+ if (typeof value !== "function") throw new Error;
2210
+ var fullname = namespace(name);
2211
+ return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
2212
+ }
2213
+
2214
+ function delayFunction(id, value) {
2215
+ return function() {
2216
+ init(this, id).delay = +value.apply(this, arguments);
2217
+ };
2218
+ }
2219
+
2220
+ function delayConstant(id, value) {
2221
+ return value = +value, function() {
2222
+ init(this, id).delay = value;
2223
+ };
2224
+ }
2225
+
2226
+ function transition_delay(value) {
2227
+ var id = this._id;
2228
+
2229
+ return arguments.length
2230
+ ? this.each((typeof value === "function"
2231
+ ? delayFunction
2232
+ : delayConstant)(id, value))
2233
+ : get(this.node(), id).delay;
2234
+ }
2235
+
2236
+ function durationFunction(id, value) {
2237
+ return function() {
2238
+ set(this, id).duration = +value.apply(this, arguments);
2239
+ };
2240
+ }
2241
+
2242
+ function durationConstant(id, value) {
2243
+ return value = +value, function() {
2244
+ set(this, id).duration = value;
2245
+ };
2246
+ }
2247
+
2248
+ function transition_duration(value) {
2249
+ var id = this._id;
2250
+
2251
+ return arguments.length
2252
+ ? this.each((typeof value === "function"
2253
+ ? durationFunction
2254
+ : durationConstant)(id, value))
2255
+ : get(this.node(), id).duration;
2256
+ }
2257
+
2258
+ function easeConstant(id, value) {
2259
+ if (typeof value !== "function") throw new Error;
2260
+ return function() {
2261
+ set(this, id).ease = value;
2262
+ };
2263
+ }
2264
+
2265
+ function transition_ease(value) {
2266
+ var id = this._id;
2267
+
2268
+ return arguments.length
2269
+ ? this.each(easeConstant(id, value))
2270
+ : get(this.node(), id).ease;
2271
+ }
2272
+
2273
+ function easeVarying(id, value) {
2274
+ return function() {
2275
+ var v = value.apply(this, arguments);
2276
+ if (typeof v !== "function") throw new Error;
2277
+ set(this, id).ease = v;
2278
+ };
2279
+ }
2280
+
2281
+ function transition_easeVarying(value) {
2282
+ if (typeof value !== "function") throw new Error;
2283
+ return this.each(easeVarying(this._id, value));
2284
+ }
2285
+
2286
+ function transition_filter(match) {
2287
+ if (typeof match !== "function") match = matcher(match);
2288
+
2289
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
2290
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
2291
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
2292
+ subgroup.push(node);
2293
+ }
2294
+ }
2295
+ }
2296
+
2297
+ return new Transition(subgroups, this._parents, this._name, this._id);
2298
+ }
2299
+
2300
+ function transition_merge(transition) {
2301
+ if (transition._id !== this._id) throw new Error;
2302
+
2303
+ for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
2304
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
2305
+ if (node = group0[i] || group1[i]) {
2306
+ merge[i] = node;
2307
+ }
2308
+ }
2309
+ }
2310
+
2311
+ for (; j < m0; ++j) {
2312
+ merges[j] = groups0[j];
2313
+ }
2314
+
2315
+ return new Transition(merges, this._parents, this._name, this._id);
2316
+ }
2317
+
2318
+ function start(name) {
2319
+ return (name + "").trim().split(/^|\s+/).every(function(t) {
2320
+ var i = t.indexOf(".");
2321
+ if (i >= 0) t = t.slice(0, i);
2322
+ return !t || t === "start";
2323
+ });
2324
+ }
2325
+
2326
+ function onFunction(id, name, listener) {
2327
+ var on0, on1, sit = start(name) ? init : set;
2328
+ return function() {
2329
+ var schedule = sit(this, id),
2330
+ on = schedule.on;
2331
+
2332
+ // If this node shared a dispatch with the previous node,
2333
+ // just assign the updated shared dispatch and we’re done!
2334
+ // Otherwise, copy-on-write.
2335
+ if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
2336
+
2337
+ schedule.on = on1;
2338
+ };
2339
+ }
2340
+
2341
+ function transition_on(name, listener) {
2342
+ var id = this._id;
2343
+
2344
+ return arguments.length < 2
2345
+ ? get(this.node(), id).on.on(name)
2346
+ : this.each(onFunction(id, name, listener));
2347
+ }
2348
+
2349
+ function removeFunction(id) {
2350
+ return function() {
2351
+ var parent = this.parentNode;
2352
+ for (var i in this.__transition) if (+i !== id) return;
2353
+ if (parent) parent.removeChild(this);
2354
+ };
2355
+ }
2356
+
2357
+ function transition_remove() {
2358
+ return this.on("end.remove", removeFunction(this._id));
2359
+ }
2360
+
2361
+ function transition_select(select) {
2362
+ var name = this._name,
2363
+ id = this._id;
2364
+
2365
+ if (typeof select !== "function") select = selector(select);
2366
+
2367
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
2368
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
2369
+ if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
2370
+ if ("__data__" in node) subnode.__data__ = node.__data__;
2371
+ subgroup[i] = subnode;
2372
+ schedule(subgroup[i], name, id, i, subgroup, get(node, id));
2373
+ }
2374
+ }
2375
+ }
2376
+
2377
+ return new Transition(subgroups, this._parents, name, id);
2378
+ }
2379
+
2380
+ function transition_selectAll(select) {
2381
+ var name = this._name,
2382
+ id = this._id;
2383
+
2384
+ if (typeof select !== "function") select = selectorAll(select);
2385
+
2386
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
2387
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
2388
+ if (node = group[i]) {
2389
+ for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {
2390
+ if (child = children[k]) {
2391
+ schedule(child, name, id, k, children, inherit);
2392
+ }
2393
+ }
2394
+ subgroups.push(children);
2395
+ parents.push(node);
2396
+ }
2397
+ }
2398
+ }
2399
+
2400
+ return new Transition(subgroups, parents, name, id);
2401
+ }
2402
+
2403
+ var Selection = selection.prototype.constructor;
2404
+
2405
+ function transition_selection() {
2406
+ return new Selection(this._groups, this._parents);
2407
+ }
2408
+
2409
+ function styleNull(name, interpolate) {
2410
+ var string00,
2411
+ string10,
2412
+ interpolate0;
2413
+ return function() {
2414
+ var string0 = styleValue(this, name),
2415
+ string1 = (this.style.removeProperty(name), styleValue(this, name));
2416
+ return string0 === string1 ? null
2417
+ : string0 === string00 && string1 === string10 ? interpolate0
2418
+ : interpolate0 = interpolate(string00 = string0, string10 = string1);
2419
+ };
2420
+ }
2421
+
2422
+ function styleRemove(name) {
2423
+ return function() {
2424
+ this.style.removeProperty(name);
2425
+ };
2426
+ }
2427
+
2428
+ function styleConstant(name, interpolate, value1) {
2429
+ var string00,
2430
+ string1 = value1 + "",
2431
+ interpolate0;
2432
+ return function() {
2433
+ var string0 = styleValue(this, name);
2434
+ return string0 === string1 ? null
2435
+ : string0 === string00 ? interpolate0
2436
+ : interpolate0 = interpolate(string00 = string0, value1);
2437
+ };
2438
+ }
2439
+
2440
+ function styleFunction(name, interpolate, value) {
2441
+ var string00,
2442
+ string10,
2443
+ interpolate0;
2444
+ return function() {
2445
+ var string0 = styleValue(this, name),
2446
+ value1 = value(this),
2447
+ string1 = value1 + "";
2448
+ if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
2449
+ return string0 === string1 ? null
2450
+ : string0 === string00 && string1 === string10 ? interpolate0
2451
+ : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
2452
+ };
2453
+ }
2454
+
2455
+ function styleMaybeRemove(id, name) {
2456
+ var on0, on1, listener0, key = "style." + name, event = "end." + key, remove;
2457
+ return function() {
2458
+ var schedule = set(this, id),
2459
+ on = schedule.on,
2460
+ listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;
2461
+
2462
+ // If this node shared a dispatch with the previous node,
2463
+ // just assign the updated shared dispatch and we’re done!
2464
+ // Otherwise, copy-on-write.
2465
+ if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
2466
+
2467
+ schedule.on = on1;
2468
+ };
2469
+ }
2470
+
2471
+ function transition_style(name, value, priority) {
2472
+ var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
2473
+ return value == null ? this
2474
+ .styleTween(name, styleNull(name, i))
2475
+ .on("end.style." + name, styleRemove(name))
2476
+ : typeof value === "function" ? this
2477
+ .styleTween(name, styleFunction(name, i, tweenValue(this, "style." + name, value)))
2478
+ .each(styleMaybeRemove(this._id, name))
2479
+ : this
2480
+ .styleTween(name, styleConstant(name, i, value), priority)
2481
+ .on("end.style." + name, null);
2482
+ }
2483
+
2484
+ function styleInterpolate(name, i, priority) {
2485
+ return function(t) {
2486
+ this.style.setProperty(name, i.call(this, t), priority);
2487
+ };
2488
+ }
2489
+
2490
+ function styleTween(name, value, priority) {
2491
+ var t, i0;
2492
+ function tween() {
2493
+ var i = value.apply(this, arguments);
2494
+ if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
2495
+ return t;
2496
+ }
2497
+ tween._value = value;
2498
+ return tween;
2499
+ }
2500
+
2501
+ function transition_styleTween(name, value, priority) {
2502
+ var key = "style." + (name += "");
2503
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
2504
+ if (value == null) return this.tween(key, null);
2505
+ if (typeof value !== "function") throw new Error;
2506
+ return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
2507
+ }
2508
+
2509
+ function textConstant(value) {
2510
+ return function() {
2511
+ this.textContent = value;
2512
+ };
2513
+ }
2514
+
2515
+ function textFunction(value) {
2516
+ return function() {
2517
+ var value1 = value(this);
2518
+ this.textContent = value1 == null ? "" : value1;
2519
+ };
2520
+ }
2521
+
2522
+ function transition_text(value) {
2523
+ return this.tween("text", typeof value === "function"
2524
+ ? textFunction(tweenValue(this, "text", value))
2525
+ : textConstant(value == null ? "" : value + ""));
2526
+ }
2527
+
2528
+ function textInterpolate(i) {
2529
+ return function(t) {
2530
+ this.textContent = i.call(this, t);
2531
+ };
2532
+ }
2533
+
2534
+ function textTween(value) {
2535
+ var t0, i0;
2536
+ function tween() {
2537
+ var i = value.apply(this, arguments);
2538
+ if (i !== i0) t0 = (i0 = i) && textInterpolate(i);
2539
+ return t0;
2540
+ }
2541
+ tween._value = value;
2542
+ return tween;
2543
+ }
2544
+
2545
+ function transition_textTween(value) {
2546
+ var key = "text";
2547
+ if (arguments.length < 1) return (key = this.tween(key)) && key._value;
2548
+ if (value == null) return this.tween(key, null);
2549
+ if (typeof value !== "function") throw new Error;
2550
+ return this.tween(key, textTween(value));
2551
+ }
2552
+
2553
+ function transition_transition() {
2554
+ var name = this._name,
2555
+ id0 = this._id,
2556
+ id1 = newId();
2557
+
2558
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
2559
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
2560
+ if (node = group[i]) {
2561
+ var inherit = get(node, id0);
2562
+ schedule(node, name, id1, i, group, {
2563
+ time: inherit.time + inherit.delay + inherit.duration,
2564
+ delay: 0,
2565
+ duration: inherit.duration,
2566
+ ease: inherit.ease
2567
+ });
2568
+ }
2569
+ }
2570
+ }
2571
+
2572
+ return new Transition(groups, this._parents, name, id1);
2573
+ }
2574
+
2575
+ function transition_end() {
2576
+ var on0, on1, that = this, id = that._id, size = that.size();
2577
+ return new Promise(function(resolve, reject) {
2578
+ var cancel = {value: reject},
2579
+ end = {value: function() { if (--size === 0) resolve(); }};
2580
+
2581
+ that.each(function() {
2582
+ var schedule = set(this, id),
2583
+ on = schedule.on;
2584
+
2585
+ // If this node shared a dispatch with the previous node,
2586
+ // just assign the updated shared dispatch and we’re done!
2587
+ // Otherwise, copy-on-write.
2588
+ if (on !== on0) {
2589
+ on1 = (on0 = on).copy();
2590
+ on1._.cancel.push(cancel);
2591
+ on1._.interrupt.push(cancel);
2592
+ on1._.end.push(end);
2593
+ }
2594
+
2595
+ schedule.on = on1;
2596
+ });
2597
+
2598
+ // The selection was empty, resolve end immediately
2599
+ if (size === 0) resolve();
2600
+ });
2601
+ }
2602
+
2603
+ var id = 0;
2604
+
2605
+ function Transition(groups, parents, name, id) {
2606
+ this._groups = groups;
2607
+ this._parents = parents;
2608
+ this._name = name;
2609
+ this._id = id;
2610
+ }
2611
+
2612
+ function newId() {
2613
+ return ++id;
2614
+ }
2615
+
2616
+ var selection_prototype = selection.prototype;
2617
+
2618
+ Transition.prototype = {
2619
+ constructor: Transition,
2620
+ select: transition_select,
2621
+ selectAll: transition_selectAll,
2622
+ selectChild: selection_prototype.selectChild,
2623
+ selectChildren: selection_prototype.selectChildren,
2624
+ filter: transition_filter,
2625
+ merge: transition_merge,
2626
+ selection: transition_selection,
2627
+ transition: transition_transition,
2628
+ call: selection_prototype.call,
2629
+ nodes: selection_prototype.nodes,
2630
+ node: selection_prototype.node,
2631
+ size: selection_prototype.size,
2632
+ empty: selection_prototype.empty,
2633
+ each: selection_prototype.each,
2634
+ on: transition_on,
2635
+ attr: transition_attr,
2636
+ attrTween: transition_attrTween,
2637
+ style: transition_style,
2638
+ styleTween: transition_styleTween,
2639
+ text: transition_text,
2640
+ textTween: transition_textTween,
2641
+ remove: transition_remove,
2642
+ tween: transition_tween,
2643
+ delay: transition_delay,
2644
+ duration: transition_duration,
2645
+ ease: transition_ease,
2646
+ easeVarying: transition_easeVarying,
2647
+ end: transition_end,
2648
+ [Symbol.iterator]: selection_prototype[Symbol.iterator]
2649
+ };
2650
+
2651
+ function cubicInOut(t) {
2652
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
2653
+ }
2654
+
2655
+ var defaultTiming = {
2656
+ time: null, // Set on use.
2657
+ delay: 0,
2658
+ duration: 250,
2659
+ ease: cubicInOut
2660
+ };
2661
+
2662
+ function inherit(node, id) {
2663
+ var timing;
2664
+ while (!(timing = node.__transition) || !(timing = timing[id])) {
2665
+ if (!(node = node.parentNode)) {
2666
+ throw new Error(`transition ${id} not found`);
2667
+ }
2668
+ }
2669
+ return timing;
2670
+ }
2671
+
2672
+ function selection_transition(name) {
2673
+ var id,
2674
+ timing;
2675
+
2676
+ if (name instanceof Transition) {
2677
+ id = name._id, name = name._name;
2678
+ } else {
2679
+ id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
2680
+ }
2681
+
2682
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
2683
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
2684
+ if (node = group[i]) {
2685
+ schedule(node, name, id, i, group, timing || inherit(node, id));
2686
+ }
2687
+ }
2688
+ }
2689
+
2690
+ return new Transition(groups, this._parents, name, id);
2691
+ }
2692
+
2693
+ selection.prototype.interrupt = selection_interrupt;
2694
+ selection.prototype.transition = selection_transition;
2695
+
2696
+ function Transform(k, x, y) {
2697
+ this.k = k;
2698
+ this.x = x;
2699
+ this.y = y;
2700
+ }
2701
+
2702
+ Transform.prototype = {
2703
+ constructor: Transform,
2704
+ scale: function(k) {
2705
+ return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
2706
+ },
2707
+ translate: function(x, y) {
2708
+ return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
2709
+ },
2710
+ apply: function(point) {
2711
+ return [point[0] * this.k + this.x, point[1] * this.k + this.y];
2712
+ },
2713
+ applyX: function(x) {
2714
+ return x * this.k + this.x;
2715
+ },
2716
+ applyY: function(y) {
2717
+ return y * this.k + this.y;
2718
+ },
2719
+ invert: function(location) {
2720
+ return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
2721
+ },
2722
+ invertX: function(x) {
2723
+ return (x - this.x) / this.k;
2724
+ },
2725
+ invertY: function(y) {
2726
+ return (y - this.y) / this.k;
2727
+ },
2728
+ rescaleX: function(x) {
2729
+ return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
2730
+ },
2731
+ rescaleY: function(y) {
2732
+ return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
2733
+ },
2734
+ toString: function() {
2735
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2736
+ }
2737
+ };
2738
+
2739
+ new Transform(1, 0, 0);
2740
+
2741
+ Transform.prototype;
2742
+
2743
+ export { interpolate$1 as a, interpolateNumber as i, select as s };
2
2744
  //# sourceMappingURL=transform-15d69d5d.js.map