UNPKG

cartogram-chart

Version:

Cartogram web component for visualizing geographical data by distorting a TopoJson topology

2 lines 94.8 kB
// Version 1.4.4 cartogram-chart - https://github.com/vasturiano/cartogram-chart !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).Cartogram=n()}(this,(function(){"use strict";var t="http://www.w3.org/1999/xhtml",n={svg:"http://www.w3.org/2000/svg",xhtml:t,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function e(t){var e=t+="",r=e.indexOf(":");return r>=0&&"xmlns"!==(e=t.slice(0,r))&&(t=t.slice(r+1)),n.hasOwnProperty(e)?{space:n[e],local:t}:t}function r(n){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===t&&e.documentElement.namespaceURI===t?e.createElement(n):e.createElementNS(r,n)}}function i(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function o(t){var n=e(t);return(n.local?i:r)(n)}function u(){}function a(t){return null==t?u:function(){return this.querySelector(t)}}function l(){return[]}function c(t){return null==t?l:function(){return this.querySelectorAll(t)}}function s(t){return function(){return null==(n=t.apply(this,arguments))?[]:Array.isArray(n)?n:Array.from(n);var n}}function f(t){return function(){return this.matches(t)}}function h(t){return function(n){return n.matches(t)}}var p=Array.prototype.find;function d(){return this.firstElementChild}var g=Array.prototype.filter;function v(){return Array.from(this.children)}function y(t){return new Array(t.length)}function m(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function w(t,n,e,r,i,o){for(var u,a=0,l=n.length,c=o.length;a<c;++a)(u=n[a])?(u.__data__=o[a],r[a]=u):e[a]=new m(t,o[a]);for(;a<l;++a)(u=n[a])&&(i[a]=u)}function _(t,n,e,r,i,o,u){var a,l,c,s=new Map,f=n.length,h=o.length,p=new Array(f);for(a=0;a<f;++a)(l=n[a])&&(p[a]=c=u.call(l,l.__data__,a,n)+"",s.has(c)?i[a]=l:s.set(c,l));for(a=0;a<h;++a)c=u.call(t,o[a],a,o)+"",(l=s.get(c))?(r[a]=l,l.__data__=o[a],s.delete(c)):e[a]=new m(t,o[a]);for(a=0;a<f;++a)(l=n[a])&&s.get(p[a])===l&&(i[a]=l)}function b(t){return t.__data__}function x(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function E(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function S(t){return function(){this.removeAttribute(t)}}function N(t){return function(){this.removeAttributeNS(t.space,t.local)}}function M(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function $(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function A(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 j(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function C(t){return function(){this.style.removeProperty(t)}}function O(t,n,e){return function(){this.style.setProperty(t,n,e)}}function P(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function T(t,n){return t.style.getPropertyValue(n)||j(t).getComputedStyle(t,null).getPropertyValue(n)}function q(t){return function(){delete this[t]}}function I(t,n){return function(){this[t]=n}}function R(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function H(t){return t.trim().split(/^|\s+/)}function L(t){return t.classList||new X(t)}function X(t){this._node=t,this._names=H(t.getAttribute("class")||"")}function z(t,n){for(var e=L(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function F(t,n){for(var e=L(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function U(t){return function(){z(this,t)}}function B(t){return function(){F(this,t)}}function V(t,n){return function(){(n.apply(this,arguments)?z:F)(this,t)}}function Y(){this.textContent=""}function D(t){return function(){this.textContent=t}}function G(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function W(){this.innerHTML=""}function J(t){return function(){this.innerHTML=t}}function K(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function Z(){this.nextSibling&&this.parentNode.appendChild(this)}function Q(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function tt(){return null}function nt(){var t=this.parentNode;t&&t.removeChild(this)}function et(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function rt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function it(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 ot(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 ut(t,n,e){var r=j(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 at(t,n){return function(){return ut(this,t,n)}}function lt(t,n){return function(){return ut(this,t,n.apply(this,arguments))}}m.prototype={constructor:m,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)}},X.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 ct=[null];function st(t,n){this._groups=t,this._parents=n}function ft(){return new st([[document.documentElement]],ct)}function ht(t){return"string"==typeof t?new st([[document.querySelector(t)]],[document.documentElement]):new st([[t]],ct)}st.prototype=ft.prototype={constructor:st,select:function(t){"function"!=typeof t&&(t=a(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,l=n[i],c=l.length,s=r[i]=new Array(c),f=0;f<c;++f)(o=l[f])&&(u=t.call(o,o.__data__,f,l))&&("__data__"in o&&(u.__data__=o.__data__),s[f]=u);return new st(r,this._parents)},selectAll:function(t){t="function"==typeof t?s(t):c(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,a=n[o],l=a.length,f=0;f<l;++f)(u=a[f])&&(r.push(t.call(u,u.__data__,f,a)),i.push(u));return new st(r,i)},selectChild:function(t){return this.select(null==t?d:function(t){return function(){return p.call(this.children,t)}}("function"==typeof t?t:h(t)))},selectChildren:function(t){return this.selectAll(null==t?v:function(t){return function(){return g.call(this.children,t)}}("function"==typeof t?t:h(t)))},filter: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=n[i],a=u.length,l=r[i]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&l.push(o);return new st(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,b);var e,r=n?_:w,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,a=new Array(u),l=new Array(u),c=new Array(u),s=0;s<u;++s){var f=i[s],h=o[s],p=h.length,d=x(t.call(f,f&&f.__data__,s,i)),g=d.length,v=l[s]=new Array(g),y=a[s]=new Array(g);r(f,h,v,y,c[s]=new Array(p),d,n);for(var m,E,S=0,N=0;S<g;++S)if(m=v[S]){for(S>=N&&(N=S+1);!(E=y[N])&&++N<g;);m._next=E||null}}return(a=new st(a,i))._enter=l,a._exit=c,a},enter:function(){return new st(this._enter||this._groups.map(y),this._parents)},exit:function(){return new st(this._exit||this._groups.map(y),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),l=0;l<u;++l)for(var c,s=e[l],f=r[l],h=s.length,p=a[l]=new Array(h),d=0;d<h;++d)(c=s[d]||f[d])&&(p[d]=c);for(;l<i;++l)a[l]=e[l];return new st(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=E);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,a=e[o],l=a.length,c=i[o]=new Array(l),s=0;s<l;++s)(u=a[s])&&(c[s]=u);c.sort(n)}return new st(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 r=e(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==n?r.local?N:S:"function"==typeof n?r.local?A:$:r.local?k:M)(r,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?C:"function"==typeof n?P:O)(t,n,null==e?"":e)):T(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?q:"function"==typeof n?R:I)(t,n)):this.node()[t]},classed:function(t,n){var e=H(t+"");if(arguments.length<2){for(var r=L(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?V:n?U:B)(e,n))},text:function(t){return arguments.length?this.each(null==t?Y:("function"==typeof t?G:D)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?W:("function"==typeof t?K:J)(t)):this.node().innerHTML},raise:function(){return this.each(Z)},lower:function(){return this.each(Q)},append:function(t){var n="function"==typeof t?t:o(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:o(t),r=null==n?tt:"function"==typeof n?n:a(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(nt)},clone:function(t){return this.select(t?rt:et)},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?ot:it,r=0;r<u;++r)this.each(a(o[r],n,e));return this}var a=this.node().__on;if(a)for(var l,c=0,s=a.length;c<s;++c)for(r=0,l=a[c];r<u;++r)if((i=o[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(t,n){return this.each(("function"==typeof n?lt:at)(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 pt={value:()=>{}};function dt(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new gt(r)}function gt(t){this._=t}function vt(t,n){for(var e,r=0,i=t.length;r<i;++r)if((e=t[r]).name===n)return e.value}function yt(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=pt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}gt.prototype=dt.prototype={constructor:gt,on:function(t,n){var e,r,i=this._,o=(r=i,(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&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),u=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++u<a;)if(e=(t=o[u]).type)i[e]=yt(i[e],t.name,n);else if(null==n)for(e in i)i[e]=yt(i[e],t.name,null);return this}for(;++u<a;)if((e=(t=o[u]).type)&&(e=vt(i[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new gt(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 mt,wt,_t=0,bt=0,xt=0,Et=0,St=0,Nt=0,Mt="object"==typeof performance&&performance.now?performance:Date,kt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function $t(){return St||(kt(At),St=Mt.now()+Nt)}function At(){St=0}function jt(){this._call=this._time=this._next=null}function Ct(t,n,e){var r=new jt;return r.restart(t,n,e),r}function Ot(){St=(Et=Mt.now())+Nt,_t=bt=0;try{!function(){$t(),++_t;for(var t,n=mt;n;)(t=St-n._time)>=0&&n._call.call(void 0,t),n=n._next;--_t}()}finally{_t=0,function(){var t,n,e=mt,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:mt=n);wt=t,Tt(r)}(),St=0}}function Pt(){var t=Mt.now(),n=t-Et;n>1e3&&(Nt-=n,Et=t)}function Tt(t){_t||(bt&&(bt=clearTimeout(bt)),t-St>24?(t<1/0&&(bt=setTimeout(Ot,t-Mt.now()-Nt)),xt&&(xt=clearInterval(xt))):(xt||(Et=Mt.now(),xt=setInterval(Pt,1e3)),_t=1,kt(Ot)))}function qt(t,n,e){var r=new jt;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}jt.prototype=Ct.prototype={constructor:jt,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?$t():+e)+(null==n?0:+n),this._next||wt===this||(wt?wt._next=this:mt=this,wt=this),this._call=t,this._time=e,Tt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tt())}};var It=dt("start","end","cancel","interrupt"),Rt=[];function Ht(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=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var c,s,f,h;if(1!==e.state)return l();for(c in i)if((h=i[c]).name===e.name){if(3===h.state)return qt(u);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[c]):+c<n&&(h.state=6,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete i[c])}if(qt((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(o))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(f=e.tween.length),c=0,s=-1;c<f;++c)(h=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(r[++s]=h);r.length=s+1}}function a(n){for(var i=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(l),e.state=5,1),o=-1,u=r.length;++o<u;)r[o].call(t,i);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){for(var r in e.state=6,e.timer.stop(),delete i[n],i)return;delete t.__transition}i[n]=e,e.timer=Ct(o,0,e.time)}(t,e,{name:n,index:r,group:i,on:It,tween:Rt,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function Lt(t,n){var e=zt(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Xt(t,n){var e=zt(t,n);if(e.state>3)throw new Error("too late; already running");return e}function zt(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ft(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Ut(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Bt(){}var Vt=.7,Yt=1/Vt,Dt="\\s*([+-]?\\d+)\\s*",Gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Jt=/^#([0-9a-f]{3,8})$/,Kt=new RegExp(`^rgb\\(${Dt},${Dt},${Dt}\\)$`),Zt=new RegExp(`^rgb\\(${Wt},${Wt},${Wt}\\)$`),Qt=new RegExp(`^rgba\\(${Dt},${Dt},${Dt},${Gt}\\)$`),tn=new RegExp(`^rgba\\(${Wt},${Wt},${Wt},${Gt}\\)$`),nn=new RegExp(`^hsl\\(${Gt},${Wt},${Wt}\\)$`),en=new RegExp(`^hsla\\(${Gt},${Wt},${Wt},${Gt}\\)$`),rn={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 on(){return this.rgb().formatHex()}function un(){return this.rgb().formatRgb()}function an(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Jt.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?ln(n):3===e?new fn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?cn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?cn(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=Kt.exec(t))?new fn(n[1],n[2],n[3],1):(n=Zt.exec(t))?new fn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Qt.exec(t))?cn(n[1],n[2],n[3],n[4]):(n=tn.exec(t))?cn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=nn.exec(t))?yn(n[1],n[2]/100,n[3]/100,1):(n=en.exec(t))?yn(n[1],n[2]/100,n[3]/100,n[4]):rn.hasOwnProperty(t)?ln(rn[t]):"transparent"===t?new fn(NaN,NaN,NaN,0):null}function ln(t){return new fn(t>>16&255,t>>8&255,255&t,1)}function cn(t,n,e,r){return r<=0&&(t=n=e=NaN),new fn(t,n,e,r)}function sn(t,n,e,r){return 1===arguments.length?((i=t)instanceof Bt||(i=an(i)),i?new fn((i=i.rgb()).r,i.g,i.b,i.opacity):new fn):new fn(t,n,e,null==r?1:r);var i}function fn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function hn(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}`}function pn(){const t=dn(this.opacity);return`${1===t?"rgb(":"rgba("}${gn(this.r)}, ${gn(this.g)}, ${gn(this.b)}${1===t?")":`, ${t})`}`}function dn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function gn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vn(t){return((t=gn(t))<16?"0":"")+t.toString(16)}function yn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new wn(t,n,e,r)}function mn(t){if(t instanceof wn)return new wn(t.h,t.s,t.l,t.opacity);if(t instanceof Bt||(t=an(t)),!t)return new wn;if(t instanceof wn)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,l=(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/=l<.5?o+i:2-o-i,u*=60):a=l>0&&l<1?0:u,new wn(u,a,l,t.opacity)}function wn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function _n(t){return(t=(t||0)%360)<0?t+360:t}function bn(t){return Math.max(0,Math.min(1,t||0))}function xn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Ft(Bt,an,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:on,formatHex:on,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return mn(this).formatHsl()},formatRgb:un,toString:un}),Ft(fn,sn,Ut(Bt,{brighter(t){return t=null==t?Yt:Math.pow(Yt,t),new fn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new fn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fn(gn(this.r),gn(this.g),gn(this.b),dn(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:hn,formatHex:hn,formatHex8:function(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}${vn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:pn,toString:pn})),Ft(wn,(function(t,n,e,r){return 1===arguments.length?mn(t):new wn(t,n,e,null==r?1:r)}),Ut(Bt,{brighter(t){return t=null==t?Yt:Math.pow(Yt,t),new wn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Vt:Math.pow(Vt,t),new wn(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 fn(xn(t>=240?t-240:t+120,i,r),xn(t,i,r),xn(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new wn(_n(this.h),bn(this.s),bn(this.l),dn(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=dn(this.opacity);return`${1===t?"hsl(":"hsla("}${_n(this.h)}, ${100*bn(this.s)}%, ${100*bn(this.l)}%${1===t?")":`, ${t})`}`}}));var En=t=>()=>t;function Sn(t){return 1==(t=+t)?Nn: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):En(isNaN(n)?e:n)}}function Nn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):En(isNaN(t)?n:t)}var Mn=function t(n){var e=Sn(n);function r(t,n){var r=e((t=sn(t)).r,(n=sn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),u=Nn(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 kn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}var $n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,An=new RegExp($n.source,"g");function jn(t,n){var e,r,i,o=$n.lastIndex=An.lastIndex=0,u=-1,a=[],l=[];for(t+="",n+="";(e=$n.exec(t))&&(r=An.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,l.push({i:u,x:kn(e,r)})),o=An.lastIndex;return o<n.length&&(i=n.slice(o),a[u]?a[u]+=i:a[++u]=i),a.length<2?l[0]?function(t){return function(n){return t(n)+""}}(l[0].x):function(t){return function(){return t}}(n):(n=l.length,function(t){for(var e,r=0;r<n;++r)a[(e=l[r]).i]=e.x(t);return a.join("")})}var Cn,On=180/Math.PI,Pn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,e,r,i,o){var u,a,l;return(u=Math.sqrt(t*t+n*n))&&(t/=u,n/=u),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(a=Math.sqrt(e*e+r*r))&&(e/=a,r/=a,l/=a),t*r<n*e&&(t=-t,n=-n,l=-l,u=-u),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*On,skewX:Math.atan(l)*On,scaleX:u,scaleY:a}}function qn(t,n,e,r){function i(t){return t.length?t.pop()+" ":""}return function(o,u){var a=[],l=[];return o=t(o),u=t(u),function(t,r,i,o,u,a){if(t!==i||r!==o){var l=u.push("translate(",null,n,null,e);a.push({i:l-4,x:kn(t,i)},{i:l-2,x:kn(r,o)})}else(i||o)&&u.push("translate("+i+n+o+e)}(o.translateX,o.translateY,u.translateX,u.translateY,a,l),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:kn(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,u.rotate,a,l),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:kn(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,u.skewX,a,l),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:kn(t,e)},{i:a-2,x:kn(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,u.scaleX,u.scaleY,a,l),o=u=null,function(t){for(var n,e=-1,r=l.length;++e<r;)a[(n=l[e]).i]=n.x(t);return a.join("")}}}var In=qn((function(t){const n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Pn:Tn(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Rn=qn((function(t){return null==t?Pn:(Cn||(Cn=document.createElementNS("http://www.w3.org/2000/svg","g")),Cn.setAttribute("transform",t),(t=Cn.transform.baseVal.consolidate())?Tn((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Pn)}),", ",")",")");function Hn(t,n){var e,r;return function(){var i=Xt(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 Ln(t,n,e){var r,i;if("function"!=typeof e)throw new Error;return function(){var o=Xt(this,t),u=o.tween;if(u!==r){i=(r=u).slice();for(var a={name:n,value:e},l=0,c=i.length;l<c;++l)if(i[l].name===n){i[l]=a;break}l===c&&i.push(a)}o.tween=i}}function Xn(t,n,e){var r=t._id;return t.each((function(){var t=Xt(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return zt(t,r).value[n]}}function zn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function Fn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Un(){}var Bn=.7,Vn=1/Bn,Yn="\\s*([+-]?\\d+)\\s*",Dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wn=/^#([0-9a-f]{3,8})$/,Jn=new RegExp(`^rgb\\(${Yn},${Yn},${Yn}\\)$`),Kn=new RegExp(`^rgb\\(${Gn},${Gn},${Gn}\\)$`),Zn=new RegExp(`^rgba\\(${Yn},${Yn},${Yn},${Dn}\\)$`),Qn=new RegExp(`^rgba\\(${Gn},${Gn},${Gn},${Dn}\\)$`),te=new RegExp(`^hsl\\(${Dn},${Gn},${Gn}\\)$`),ne=new RegExp(`^hsla\\(${Dn},${Gn},${Gn},${Dn}\\)$`),ee={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 re(){return this.rgb().formatHex()}function ie(){return this.rgb().formatRgb()}function oe(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Wn.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?ue(n):3===e?new le(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?ae(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?ae(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=Jn.exec(t))?new le(n[1],n[2],n[3],1):(n=Kn.exec(t))?new le(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Zn.exec(t))?ae(n[1],n[2],n[3],n[4]):(n=Qn.exec(t))?ae(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=te.exec(t))?de(n[1],n[2]/100,n[3]/100,1):(n=ne.exec(t))?de(n[1],n[2]/100,n[3]/100,n[4]):ee.hasOwnProperty(t)?ue(ee[t]):"transparent"===t?new le(NaN,NaN,NaN,0):null}function ue(t){return new le(t>>16&255,t>>8&255,255&t,1)}function ae(t,n,e,r){return r<=0&&(t=n=e=NaN),new le(t,n,e,r)}function le(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function ce(){return`#${pe(this.r)}${pe(this.g)}${pe(this.b)}`}function se(){const t=fe(this.opacity);return`${1===t?"rgb(":"rgba("}${he(this.r)}, ${he(this.g)}, ${he(this.b)}${1===t?")":`, ${t})`}`}function fe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function he(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function pe(t){return((t=he(t))<16?"0":"")+t.toString(16)}function de(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new ve(t,n,e,r)}function ge(t){if(t instanceof ve)return new ve(t.h,t.s,t.l,t.opacity);if(t instanceof Un||(t=oe(t)),!t)return new ve;if(t instanceof ve)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,l=(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/=l<.5?o+i:2-o-i,u*=60):a=l>0&&l<1?0:u,new ve(u,a,l,t.opacity)}function ve(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function ye(t){return(t=(t||0)%360)<0?t+360:t}function me(t){return Math.max(0,Math.min(1,t||0))}function we(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function _e(t,n){var e;return("number"==typeof n?kn:n instanceof oe?Mn:(e=oe(n))?(n=e,Mn):jn)(t,n)}function be(t){return function(){this.removeAttribute(t)}}function xe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ee(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 Se(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 Ne(t,n,e){var r,i,o;return function(){var u,a,l=e(this);if(null!=l)return(u=this.getAttribute(t))===(a=l+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,l));this.removeAttribute(t)}}function Me(t,n,e){var r,i,o;return function(){var u,a,l=e(this);if(null!=l)return(u=this.getAttributeNS(t.space,t.local))===(a=l+"")?null:u===r&&a===i?o:(i=a,o=n(r=u,l));this.removeAttributeNS(t.space,t.local)}}function ke(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 $e(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 Ae(t,n){return function(){Lt(this,t).delay=+n.apply(this,arguments)}}function je(t,n){return n=+n,function(){Lt(this,t).delay=n}}function Ce(t,n){return function(){Xt(this,t).duration=+n.apply(this,arguments)}}function Oe(t,n){return n=+n,function(){Xt(this,t).duration=n}}zn(Un,oe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:re,formatHex:re,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ge(this).formatHsl()},formatRgb:ie,toString:ie}),zn(le,(function(t,n,e,r){return 1===arguments.length?((i=t)instanceof Un||(i=oe(i)),i?new le((i=i.rgb()).r,i.g,i.b,i.opacity):new le):new le(t,n,e,null==r?1:r);var i}),Fn(Un,{brighter(t){return t=null==t?Vn:Math.pow(Vn,t),new le(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Bn:Math.pow(Bn,t),new le(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new le(he(this.r),he(this.g),he(this.b),fe(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:ce,formatHex:ce,formatHex8:function(){return`#${pe(this.r)}${pe(this.g)}${pe(this.b)}${pe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:se,toString:se})),zn(ve,(function(t,n,e,r){return 1===arguments.length?ge(t):new ve(t,n,e,null==r?1:r)}),Fn(Un,{brighter(t){return t=null==t?Vn:Math.pow(Vn,t),new ve(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Bn:Math.pow(Bn,t),new ve(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 le(we(t>=240?t-240:t+120,i,r),we(t,i,r),we(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ve(ye(this.h),me(this.s),me(this.l),fe(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=fe(this.opacity);return`${1===t?"hsl(":"hsla("}${ye(this.h)}, ${100*me(this.s)}%, ${100*me(this.l)}%${1===t?")":`, ${t})`}`}}));var Pe=ft.prototype.constructor;function Te(t){return function(){this.style.removeProperty(t)}}var qe=0;function Ie(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Re(){return++qe}var He=ft.prototype;Ie.prototype={constructor:Ie,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,i=r.length,o=new Array(i),u=0;u<i;++u)for(var l,c,s=r[u],f=s.length,h=o[u]=new Array(f),p=0;p<f;++p)(l=s[p])&&(c=t.call(l,l.__data__,p,s))&&("__data__"in l&&(c.__data__=l.__data__),h[p]=c,Ht(h[p],n,e,p,h,zt(l,e)));return new Ie(o,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=c(t));for(var r=this._groups,i=r.length,o=[],u=[],a=0;a<i;++a)for(var l,s=r[a],f=s.length,h=0;h<f;++h)if(l=s[h]){for(var p,d=t.call(l,l.__data__,h,s),g=zt(l,e),v=0,y=d.length;v<y;++v)(p=d[v])&&Ht(p,n,e,v,d,g);o.push(d),u.push(l)}return new Ie(o,u,n,e)},selectChild:He.selectChild,selectChildren:He.selectChildren,filter: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=n[i],a=u.length,l=r[i]=[],c=0;c<a;++c)(o=u[c])&&t.call(o,o.__data__,c,u)&&l.push(o);return new Ie(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 l,c=n[a],s=e[a],f=c.length,h=u[a]=new Array(f),p=0;p<f;++p)(l=c[p]||s[p])&&(h[p]=l);for(;a<r;++a)u[a]=n[a];return new Ie(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=Re(),r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],l=a.length,c=0;c<l;++c)if(u=a[c]){var s=zt(u,n);Ht(u,t,e,c,a,{time:s.time+s.delay+s.duration,delay:0,duration:s.duration,ease:s.ease})}return new Ie(r,this._parents,t,e)},call:He.call,nodes:He.nodes,node:He.node,size:He.size,empty:He.empty,each:He.each,on:function(t,n){var e=this._id;return arguments.length<2?zt(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)?Lt:Xt;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 r=e(t),i="transform"===r?Rn:_e;return this.attrTween(t,"function"==typeof n?(r.local?Me:Ne)(r,i,Xn(this,"attr."+t,n)):null==n?(r.local?xe:be)(r):(r.local?Se:Ee)(r,i,n))},attrTween:function(t,n){var r="attr."+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;var i=e(t);return this.tween(r,(i.local?ke:$e)(i,n))},style:function(t,n,e){var r="transform"==(t+="")?In:_e;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=T(this,t),u=(this.style.removeProperty(t),T(this,t));return o===u?null:o===e&&u===r?i:i=n(e=o,r=u)}}(t,r)).on("end.style."+t,Te(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var u=T(this,t),a=e(this),l=a+"";return null==a&&(this.style.removeProperty(t),l=a=T(this,t)),u===l?null:u===r&&l===i?o:(i=l,o=n(r=u,a))}}(t,r,Xn(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var l=Xt(this,t),c=l.on,s=null==l.value[u]?o||(o=Te(n)):void 0;c===e&&i===s||(r=(e=c).copy()).on(a,i=s),l.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var u=T(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}}(Xn(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=zt(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?Hn:Ln)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Ae:je)(n,t)):zt(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Ce:Oe)(n,t)):zt(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(){Xt(this,t).ease=n}}(n,t)):zt(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;Xt(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},l={value:function(){0==--i&&o()}};e.each((function(){var e=Xt(this,r),i=e.on;i!==t&&((n=(t=i).copy())._.cancel.push(a),n._.interrupt.push(a),n._.end.push(l)),e.on=n})),0===i&&o()}))},[Symbol.iterator]:He[Symbol.iterator]};var Le={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Xe(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}ft.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>2&&e.state<5,e.state=6,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)}))},ft.prototype.transition=function(t){var n,e;t instanceof Ie?(n=t._id,t=t._name):(n=Re(),(e=Le).time=$t(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var u,a=r[o],l=a.length,c=0;c<l;++c)(u=a[c])&&Ht(u,t,n,c,a,e||Xe(u,n));return new Ie(r,this._parents,t,n)};class ze{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let e=0;for(let r=0;r<this._n&&r<32;r++){const i=n[r],o=t+i,u=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);u&&(n[e++]=u),t=o}return n[e]=t,this._n=e+1,this}valueOf(){const t=this._partials;let n,e,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}function Fe(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}var Ue=1e-6,Be=Math.PI,Ve=Be/2,Ye=Be/4,De=2*Be,Ge=180/Be,We=Be/180,Je=Math.abs,Ke=Math.atan,Ze=Math.atan2,Qe=Math.cos,tr=Math.exp,nr=Math.log,er=Math.sin,rr=Math.sign||function(t){return t>0?1:t<0?-1:0},ir=Math.sqrt,or=Math.tan;function ur(t){return t>1?Ve:t<-1?-Ve:Math.asin(t)}function ar(){}function lr(t,n){t&&sr.hasOwnProperty(t.type)&&sr[t.type](t,n)}var cr={Feature:function(t,n){lr(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)lr(e[r].geometry,n)}},sr={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){fr(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)fr(e[r],n,0)},Polygon:function(t,n){hr(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)hr(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)lr(e[r],n)}};function fr(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function hr(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)fr(t[e],n,1);n.polygonEnd()}function pr(t){return[Ze(t[1],t[0]),ur(t[2])]}function dr(t){var n=t[0],e=t[1],r=Qe(e);return[r*Qe(n),r*er(n),er(e)]}function gr(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function vr(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function yr(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function mr(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function wr(t){var n=ir(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}function _r(t,n){function e(e,r){return e=t(e,r),n(e[0],e[1])}return t.invert&&n.invert&&(e.invert=function(e,r){return(e=n.invert(e,r))&&t.invert(e[0],e[1])}),e}function br(t,n){return Je(t)>Be&&(t-=Math.round(t/De)*De),[t,n]}function xr(t,n,e){return(t%=De)?n||e?_r(Sr(t),Nr(n,e)):Sr(t):n||e?Nr(n,e):br}function Er(t){return function(n,e){return Je(n+=t)>Be&&(n-=Math.round(n/De)*De),[n,e]}}function Sr(t){var n=Er(t);return n.invert=Er(-t),n}function Nr(t,n){var e=Qe(t),r=er(t),i=Qe(n),o=er(n);function u(t,n){var u=Qe(n),a=Qe(t)*u,l=er(t)*u,c=er(n),s=c*e+a*r;return[Ze(l*i-s*o,a*e-c*r),ur(s*i+l*o)]}return u.invert=function(t,n){var u=Qe(n),a=Qe(t)*u,l=er(t)*u,c=er(n),s=c*i-l*o;return[Ze(l*i+c*o,a*e+s*r),ur(s*e-a*r)]},u}function Mr(t,n){(n=dr(n))[0]-=t,wr(n);var e,r=(e=-n[1])>1?0:e<-1?Be:Math.acos(e);return((-n[2]<0?-r:r)+De-Ue)%De}function kr(){var t,n=[];return{point:function(n,e,r){t.push([n,e,r])},lineStart:function(){n.push(t=[])},lineEnd:ar,rejoin:function(){n.length>1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function $r(t,n){return Je(t[0]-n[0])<Ue&&Je(t[1]-n[1])<Ue}function Ar(t,n,e,r){this.x=t,this.z=n,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function jr(t,n,e,r,i){var o,u,a=[],l=[];if(t.forEach((function(t){if(!((n=t.length-1)<=0)){var n,e,r=t[0],u=t[n];if($r(r,u)){if(!r[2]&&!u[2]){for(i.lineStart(),o=0;o<n;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}u[0]+=2e-6}a.push(e=new Ar(r,t,null,!0)),l.push(e.o=new Ar(r,null,e,!1)),a.push(e=new Ar(u,t,null,!1)),l.push(e.o=new Ar(u,null,e,!0))}})),a.length){for(l.sort(n),Cr(a),Cr(l),o=0,u=l.length;o<u;++o)l[o].e=e=!e;for(var c,s,f=a[0];;){for(var h=f,p=!0;h.v;)if((h=h.n)===f)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(o=0,u=c.length;o<u;++o)i.point((s=c[o])[0],s[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(p)for(c=h.p.z,o=c.length-1;o>=0;--o)i.point((s=c[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}c=(h=h.o).z,p=!p}while(!h.v);i.lineEnd()}}}function Cr(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r<n;)i.n=e=t[r],e.p=i,i=e;i.n=e=t[0],e.p=i}}function Or(t){return Je(t[0])<=Be?t[0]:rr(t[0])*((Je(t[0])+Be)%De-Be)}function Pr(t,n,e,r){return function(i){var o,u,a,l=n(i),c=kr(),s=n(c),f=!1,h={point:p,lineStart:g,lineEnd:v,polygonStart:function(){h.point=y,h.lineStart=m,h.lineEnd=w,u=[],o=[]},polygonEnd:function(){h.point=p,h.lineStart=g,h.lineEnd=v,u=Fe(u);var t=function(t,n){var e=Or(n),r=n[1],i=er(r),o=[er(e),-Qe(e),0],u=0,a=0,l=new ze;1===i?r=Ve+Ue:-1===i&&(r=-Ve-Ue);for(var c=0,s=t.length;c<s;++c)if(h=(f=t[c]).length)for(var f,h,p=f[h-1],d=Or(p),g=p[1]/2+Ye,v=er(g),y=Qe(g),m=0;m<h;++m,d=_,v=x,y=E,p=w){var w=f[m],_=Or(w),b=w[1]/2+Ye,x=er(b),E=Qe(b),S=_-d,N=S>=0?1:-1,M=N*S,k=M>Be,$=v*x;if(l.add(Ze($*N*er(M),y*E+$*Qe(M))),u+=k?S+N*De:S,k^d>=e^_>=e){var A=vr(dr(p),dr(w));wr(A);var j=vr(o,A);wr(j);var C=(k^S>=0?-1:1)*ur(j[2]);(r>C||r===C&&(A[0]||A[1]))&&(a+=k^S>=0?1:-1)}}return(u<-1e-6||u<Ue&&l<-1e-12)^1&a}(o,r);u.length?(f||(i.polygonStart(),f=!0),jr(u,qr,t,e,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),u=o=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(n,e){t(n,e)&&i.point(n,e)}function d(t,n){l.point(t,n)}function g(){h.point=d,l.lineStart()}function v(){h.point=p,l.lineEnd()}function y(t,n){a.push([t,n]),s.point(t,n)}function m(){s.lineStart(),a=[]}function w(){y(a[0][0],a[0][1]),s.lineEnd();var t,n,e,r,l=s.clean(),h=c.result(),p=h.length;if(a.pop(),o.push(a),a=null,p)if(1&l){if((n=(e=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<n;++t)i.point((r=e[t])[0],r[1]);i.lineEnd()}}else p>1&&2&l&&h.push(h.pop().concat(h.shift())),u.push(h.filter(Tr))}return h}}function Tr(t){return t.length>1}function qr(t,n){return((t=t.x)[0]<0?t[1]-Ve-Ue:Ve-t[1])-((n=n.x)[0]<0?n[1]-Ve-Ue:Ve-n[1])}br.invert=br;var Ir=Pr((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,u){var a=o>0?Be:-Be,l=Je(o-e);Je(l-Be)<Ue?(t.point(e,r=(r+u)/2>0?Ve:-Ve),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),t.point(o,r),n=0):i!==a&&l>=Be&&(Je(e-i)<Ue&&(e-=i*Ue),Je(o-a)<Ue&&(o-=a*Ue),r=function(t,n,e,r){var i,o,u=er(t-e);return Je(u)>Ue?Ke((er(n)*(o=Qe(r))*er(e)-er(r)*(i=Qe(n))*er(t))/(i*o*u)):(n+r)/2}(e,r,o,u),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(a,r),n=0),t.point(e=o,r=u),i=a},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*Ve,r.point(-Be,i),r.point(0,i),r.point(