@explorables/spinwheels
Version:
This explorable is a spatial implementation of the Kuramoto Model for phase coupled oscillators. It illustrates spatial synchronization and the dynamics of phase singularities.
2 lines • 176 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('/*! tailwindcss v4.1.4 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-font-weight:initial}}}@layer theme{:root,:host{--tw-font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-text-2xl:1.5rem;--tw-text-2xl--line-height:calc(2/1.5);--tw-text-3xl:1.875rem;--tw-text-3xl--line-height: 1.2 ;--tw-text-5xl:3rem;--tw-text-5xl--line-height:1;--tw-font-weight-light:300}}@layer base,components;@layer utilities{.tw\\:m-8{margin:calc(var(--tw-spacing)*8)}.tw\\:grid{display:grid}.tw\\:max-w-5xl{max-width:var(--tw-container-5xl)}.tw\\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.tw\\:bg-white{background-color:var(--tw-color-white)}.tw\\:p-0{padding:calc(var(--tw-spacing)*0)}.tw\\:px-1{padding-inline:calc(var(--tw-spacing)*1)}.tw\\:px-10{padding-inline:calc(var(--tw-spacing)*10)}.tw\\:font-sans{font-family:var(--tw-font-sans)}.tw\\:text-2xl{font-size:var(--tw-text-2xl);line-height:var(--tw-leading,var(--tw-text-2xl--line-height))}.tw\\:text-3xl{font-size:var(--tw-text-3xl);line-height:var(--tw-leading,var(--tw-text-3xl--line-height))}.tw\\:text-5xl{font-size:var(--tw-text-5xl);line-height:var(--tw-leading,var(--tw-text-5xl--line-height))}.tw\\:font-light{--tw-font-weight:var(--tw-font-weight-light);font-weight:var(--tw-font-weight-light)}.tw\\:text-black{color:var(--tw-color-black)}@media (min-width:40rem){.tw\\:sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.tw\\:sm\\:gap-8{gap:calc(var(--tw-spacing)*8)}.tw\\:sm\\:p-0{padding:calc(var(--tw-spacing)*0)}}@media (prefers-color-scheme:dark){.tw\\:dark\\:bg-black{background-color:var(--tw-color-black)}.tw\\:dark\\:text-white{color:var(--tw-color-white)}}.debug-grid-16{background-image:linear-gradient(90deg,#0000ff1a 1px,#0000 1px),linear-gradient(#0000ff1a 1px,#0000 1px);background-repeat:repeat;background-size:6.25% 6.25%,6.25% 6.25%}}.explorable *,.explorable :before,.explorable :after{box-sizing:border-box}@property --tw-font-weight{syntax:"*";inherits:false}._displayPanel_pb0r4_1,._controlPanel_pb0r4_8{display:block;line-height:0;box-sizing:border-box}._displayPanel_pb0r4_1>canvas,._displayPanel_pb0r4_1>svg,._controlPanel_pb0r4_8>svg,._controlPanel_pb0r4_8>canvas{display:block;box-sizing:border-box}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
(function($,Ut){typeof exports=="object"&&typeof module<"u"?Ut(exports):typeof define=="function"&&define.amd?define(["exports"],Ut):($=typeof globalThis<"u"?globalThis:$||self,Ut($.spinwheels={}))})(this,function($){"use strict";const Ut={id:"spinwheels",display_type:"canvas",debug:!1,debug_lattice:"debug-grid-16",controls_grid:{nx:12,ny:12},display_size:{width:505,height:505},controls_size:{width:480,height:480},display_class:" tw:p-0",controls_class:"d3-widgets tw:p-0",container_class:"tw:font-sans tw:font-light tw:grid tw:grid-cols-1 tw:sm:grid-cols-2 tw:sm:gap-8 tw:px-1 tw:sm:p-0 tw:m-8"};function Le(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function qs(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Bi(t){let e,n,r;t.length!==2?(e=Le,n=(u,c)=>Le(t(u),c),r=(u,c)=>t(u)-c):(e=t===Le||t===qs?t:Bs,n=t,r=t);function i(u,c,s=0,l=u.length){if(s<l){if(e(c,c)!==0)return l;do{const h=s+l>>>1;n(u[h],c)<0?s=h+1:l=h}while(s<l)}return s}function a(u,c,s=0,l=u.length){if(s<l){if(e(c,c)!==0)return l;do{const h=s+l>>>1;n(u[h],c)<=0?s=h+1:l=h}while(s<l)}return s}function o(u,c,s=0,l=u.length){const h=i(u,c,s,l-1);return h>s&&r(u[h-1],c)>-r(u[h],c)?h-1:h}return{left:i,center:o,right:a}}function Bs(){return 0}function Xs(t){return t===null?NaN:+t}const Hs=Bi(Le).right;Bi(Xs).center;const Us=Math.sqrt(50),Ys=Math.sqrt(10),Gs=Math.sqrt(2);function qe(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Us?10:a>=Ys?5:a>=Gs?2:1;let u,c,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),c=Math.round(e*s),u/s<t&&++u,c/s>e&&--c,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),c=Math.round(e/s),u*s<t&&++u,c*s>e&&--c),c<u&&.5<=n&&n<2?qe(t,e,n*2):[u,c,s]}function Vs(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?qe(e,t,n):qe(t,e,n);if(!(a>=i))return[];const u=a-i+1,c=new Array(u);if(r)if(o<0)for(let s=0;s<u;++s)c[s]=(a-s)/-o;else for(let s=0;s<u;++s)c[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)c[s]=(i+s)/-o;else for(let s=0;s<u;++s)c[s]=(i+s)*o;return c}function cr(t,e,n){return e=+e,t=+t,n=+n,qe(t,e,n)[2]}function Ks(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?cr(e,t,n):cr(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}var Ws={value:()=>{}};function Xi(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Be(n)}function Be(t){this._=t}function Zs(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Be.prototype=Xi.prototype={constructor:Be,on:function(t,e){var n=this._,r=Zs(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Js(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Hi(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Hi(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Be(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Js(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Hi(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ws,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var lr="http://www.w3.org/1999/xhtml";const Ui={svg:"http://www.w3.org/2000/svg",xhtml:lr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xe(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Ui.hasOwnProperty(e)?{space:Ui[e],local:t}:t}function Qs(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===lr&&e.documentElement.namespaceURI===lr?e.createElement(t):e.createElementNS(n,t)}}function tc(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yi(t){var e=Xe(t);return(e.local?tc:Qs)(e)}function ec(){}function fr(t){return t==null?ec:function(){return this.querySelector(t)}}function nc(t){typeof t!="function"&&(t=fr(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),c,s,l=0;l<o;++l)(c=a[l])&&(s=t.call(c,c.__data__,l,a))&&("__data__"in c&&(s.__data__=c.__data__),u[l]=s);return new D(r,this._parents)}function rc(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function ic(){return[]}function Gi(t){return t==null?ic:function(){return this.querySelectorAll(t)}}function ac(t){return function(){return rc(t.apply(this,arguments))}}function oc(t){typeof t=="function"?t=ac(t):t=Gi(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,c,s=0;s<u;++s)(c=o[s])&&(r.push(t.call(c,c.__data__,s,o)),i.push(c));return new D(r,i)}function Vi(t){return function(){return this.matches(t)}}function Ki(t){return function(e){return e.matches(t)}}var uc=Array.prototype.find;function sc(t){return function(){return uc.call(this.children,t)}}function cc(){return this.firstElementChild}function lc(t){return this.select(t==null?cc:sc(typeof t=="function"?t:Ki(t)))}var fc=Array.prototype.filter;function hc(){return Array.from(this.children)}function dc(t){return function(){return fc.call(this.children,t)}}function pc(t){return this.selectAll(t==null?hc:dc(typeof t=="function"?t:Ki(t)))}function gc(t){typeof t!="function"&&(t=Vi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],c,s=0;s<o;++s)(c=a[s])&&t.call(c,c.__data__,s,a)&&u.push(c);return new D(r,this._parents)}function Wi(t){return new Array(t.length)}function yc(){return new D(this._enter||this._groups.map(Wi),this._parents)}function He(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}He.prototype={constructor:He,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function bc(t){return function(){return t}}function _c(t,e,n,r,i,a){for(var o=0,u,c=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new He(t,a[o]);for(;o<c;++o)(u=e[o])&&(i[o]=u)}function vc(t,e,n,r,i,a,o){var u,c,s=new Map,l=e.length,h=a.length,f=new Array(l),d;for(u=0;u<l;++u)(c=e[u])&&(f[u]=d=o.call(c,c.__data__,u,e)+"",s.has(d)?i[u]=c:s.set(d,c));for(u=0;u<h;++u)d=o.call(t,a[u],u,a)+"",(c=s.get(d))?(r[u]=c,c.__data__=a[u],s.delete(d)):n[u]=new He(t,a[u]);for(u=0;u<l;++u)(c=e[u])&&s.get(f[u])===c&&(i[u]=c)}function mc(t){return t.__data__}function wc(t,e){if(!arguments.length)return Array.from(this,mc);var n=e?vc:_c,r=this._parents,i=this._groups;typeof t!="function"&&(t=bc(t));for(var a=i.length,o=new Array(a),u=new Array(a),c=new Array(a),s=0;s<a;++s){var l=r[s],h=i[s],f=h.length,d=xc(t.call(l,l&&l.__data__,s,r)),g=d.length,b=u[s]=new Array(g),m=o[s]=new Array(g),w=c[s]=new Array(f);n(l,h,b,m,w,d,e);for(var p=0,M=0,y,v;p<g;++p)if(y=b[p]){for(p>=M&&(M=p+1);!(v=m[M])&&++M<g;);y._next=v||null}}return o=new D(o,r),o._enter=u,o._exit=c,o}function xc(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Mc(){return new D(this._exit||this._groups.map(Wi),this._parents)}function Ac(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function $c(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),c=0;c<o;++c)for(var s=n[c],l=r[c],h=s.length,f=u[c]=new Array(h),d,g=0;g<h;++g)(d=s[g]||l[g])&&(f[g]=d);for(;c<i;++c)u[c]=n[c];return new D(u,this._parents)}function Tc(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Nc(t){t||(t=Sc);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,c=i[a]=new Array(u),s,l=0;l<u;++l)(s=o[l])&&(c[l]=s);c.sort(e)}return new D(i,this._parents).order()}function Sc(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Pc(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ec(){return Array.from(this)}function kc(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Oc(){let t=0;for(const e of this)++t;return t}function zc(){return!this.node()}function Cc(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function Ic(t){return function(){this.removeAttribute(t)}}function Rc(t){return function(){this.removeAttributeNS(t.space,t.local)}}function jc(t,e){return function(){this.setAttribute(t,e)}}function Fc(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Dc(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Lc(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function qc(t,e){var n=Xe(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Rc:Ic:typeof e=="function"?n.local?Lc:Dc:n.local?Fc:jc)(n,e))}function Zi(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Bc(t){return function(){this.style.removeProperty(t)}}function Xc(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Hc(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Uc(t,e,n){return arguments.length>1?this.each((e==null?Bc:typeof e=="function"?Hc:Xc)(t,e,n??"")):Yt(this.node(),t)}function Yt(t,e){return t.style.getPropertyValue(e)||Zi(t).getComputedStyle(t,null).getPropertyValue(e)}function Yc(t){return function(){delete this[t]}}function Gc(t,e){return function(){this[t]=e}}function Vc(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Kc(t,e){return arguments.length>1?this.each((e==null?Yc:typeof e=="function"?Vc:Gc)(t,e)):this.node()[t]}function Ji(t){return t.trim().split(/^|\s+/)}function hr(t){return t.classList||new Qi(t)}function Qi(t){this._node=t,this._names=Ji(t.getAttribute("class")||"")}Qi.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function ta(t,e){for(var n=hr(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ea(t,e){for(var n=hr(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Wc(t){return function(){ta(this,t)}}function Zc(t){return function(){ea(this,t)}}function Jc(t,e){return function(){(e.apply(this,arguments)?ta:ea)(this,t)}}function Qc(t,e){var n=Ji(t+"");if(arguments.length<2){for(var r=hr(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Jc:e?Wc:Zc)(n,e))}function tl(){this.textContent=""}function el(t){return function(){this.textContent=t}}function nl(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function rl(t){return arguments.length?this.each(t==null?tl:(typeof t=="function"?nl:el)(t)):this.node().textContent}function il(){this.innerHTML=""}function al(t){return function(){this.innerHTML=t}}function ol(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ul(t){return arguments.length?this.each(t==null?il:(typeof t=="function"?ol:al)(t)):this.node().innerHTML}function sl(){this.nextSibling&&this.parentNode.appendChild(this)}function cl(){return this.each(sl)}function ll(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function fl(){return this.each(ll)}function hl(t){var e=typeof t=="function"?t:Yi(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function dl(){return null}function pl(t,e){var n=typeof t=="function"?t:Yi(t),r=e==null?dl:typeof e=="function"?e:fr(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function gl(){var t=this.parentNode;t&&t.removeChild(this)}function yl(){return this.each(gl)}function bl(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _l(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function vl(t){return this.select(t?_l:bl)}function ml(t){return arguments.length?this.property("__data__",t):this.node().__data__}function wl(t){return function(e){t.call(this,e,this.__data__)}}function xl(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Ml(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Al(t,e,n){return function(){var r=this.__on,i,a=wl(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function $l(t,e,n){var r=xl(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var c=0,s=u.length,l;c<s;++c)for(i=0,l=u[c];i<a;++i)if((o=r[i]).type===l.type&&o.name===l.name)return l.value}return}for(u=e?Al:Ml,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function na(t,e,n){var r=Zi(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Tl(t,e){return function(){return na(this,t,e)}}function Nl(t,e){return function(){return na(this,t,e.apply(this,arguments))}}function Sl(t,e){return this.each((typeof e=="function"?Nl:Tl)(t,e))}function*Pl(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var ra=[null];function D(t,e){this._groups=t,this._parents=e}function ce(){return new D([[document.documentElement]],ra)}function El(){return this}D.prototype=ce.prototype={constructor:D,select:nc,selectAll:oc,selectChild:lc,selectChildren:pc,filter:gc,data:wc,enter:yc,exit:Mc,join:Ac,merge:$c,selection:El,order:Tc,sort:Nc,call:Pc,nodes:Ec,node:kc,size:Oc,empty:zc,each:Cc,attr:qc,style:Uc,property:Kc,classed:Qc,text:rl,html:ul,raise:cl,lower:fl,append:hl,insert:pl,remove:yl,clone:vl,datum:ml,on:$l,dispatch:Sl,[Symbol.iterator]:Pl};function kl(t){return typeof t=="string"?new D([[document.querySelector(t)]],[document.documentElement]):new D([[t]],ra)}function dr(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ia(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function le(){}var fe=.7,Ue=1/fe,Gt="\\s*([+-]?\\d+)\\s*",he="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ol=/^#([0-9a-f]{3,8})$/,zl=new RegExp(`^rgb\\(${Gt},${Gt},${Gt}\\)$`),Cl=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),Il=new RegExp(`^rgba\\(${Gt},${Gt},${Gt},${he}\\)$`),Rl=new RegExp(`^rgba\\(${nt},${nt},${nt},${he}\\)$`),jl=new RegExp(`^hsl\\(${he},${nt},${nt}\\)$`),Fl=new RegExp(`^hsla\\(${he},${nt},${nt},${he}\\)$`),aa={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};dr(le,St,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oa,formatHex:oa,formatHex8:Dl,formatHsl:Ll,formatRgb:ua,toString:ua});function oa(){return this.rgb().formatHex()}function Dl(){return this.rgb().formatHex8()}function Ll(){return ha(this).formatHsl()}function ua(){return this.rgb().formatRgb()}function St(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ol.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?sa(e):n===3?new j(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Ye(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Ye(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=zl.exec(t))?new j(e[1],e[2],e[3],1):(e=Cl.exec(t))?new j(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Il.exec(t))?Ye(e[1],e[2],e[3],e[4]):(e=Rl.exec(t))?Ye(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=jl.exec(t))?fa(e[1],e[2]/100,e[3]/100,1):(e=Fl.exec(t))?fa(e[1],e[2]/100,e[3]/100,e[4]):aa.hasOwnProperty(t)?sa(aa[t]):t==="transparent"?new j(NaN,NaN,NaN,0):null}function sa(t){return new j(t>>16&255,t>>8&255,t&255,1)}function Ye(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function ql(t){return t instanceof le||(t=St(t)),t?(t=t.rgb(),new j(t.r,t.g,t.b,t.opacity)):new j}function Ge(t,e,n,r){return arguments.length===1?ql(t):new j(t,e,n,r??1)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}dr(j,Ge,ia(le,{brighter(t){return t=t==null?Ue:Math.pow(Ue,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?fe:Math.pow(fe,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new j(Pt(this.r),Pt(this.g),Pt(this.b),Ve(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:ca,formatHex:ca,formatHex8:Bl,formatRgb:la,toString:la}));function ca(){return`#${Et(this.r)}${Et(this.g)}${Et(this.b)}`}function Bl(){return`#${Et(this.r)}${Et(this.g)}${Et(this.b)}${Et((isNaN(this.opacity)?1:this.opacity)*255)}`}function la(){const t=Ve(this.opacity);return`${t===1?"rgb(":"rgba("}${Pt(this.r)}, ${Pt(this.g)}, ${Pt(this.b)}${t===1?")":`, ${t})`}`}function Ve(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Pt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Et(t){return t=Pt(t),(t<16?"0":"")+t.toString(16)}function fa(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new G(t,e,n,r)}function ha(t){if(t instanceof G)return new G(t.h,t.s,t.l,t.opacity);if(t instanceof le||(t=St(t)),!t)return new G;if(t instanceof G)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,c=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=c<.5?a+i:2-a-i,o*=60):u=c>0&&c<1?0:o,new G(o,u,c,t.opacity)}function Xl(t,e,n,r){return arguments.length===1?ha(t):new G(t,e,n,r??1)}function G(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}dr(G,Xl,ia(le,{brighter(t){return t=t==null?Ue:Math.pow(Ue,t),new G(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?fe:Math.pow(fe,t),new G(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(pr(t>=240?t-240:t+120,i,r),pr(t,i,r),pr(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new G(da(this.h),Ke(this.s),Ke(this.l),Ve(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=Ve(this.opacity);return`${t===1?"hsl(":"hsla("}${da(this.h)}, ${Ke(this.s)*100}%, ${Ke(this.l)*100}%${t===1?")":`, ${t})`}`}}));function da(t){return t=(t||0)%360,t<0?t+360:t}function Ke(t){return Math.max(0,Math.min(1,t||0))}function pr(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const gr=t=>()=>t;function Hl(t,e){return function(n){return t+n*e}}function Ul(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function Yl(t){return(t=+t)==1?pa:function(e,n){return n-e?Ul(e,n,t):gr(isNaN(e)?n:e)}}function pa(t,e){var n=e-t;return n?Hl(t,n):gr(isNaN(t)?e:t)}const wt=function t(e){var n=Yl(e);function r(i,a){var o=n((i=Ge(i)).r,(a=Ge(a)).r),u=n(i.g,a.g),c=n(i.b,a.b),s=pa(i.opacity,a.opacity);return function(l){return i.r=o(l),i.g=u(l),i.b=c(l),i.opacity=s(l),i+""}}return r.gamma=t,r}(1);function Gl(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function Vl(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kl(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=We(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Wl(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function V(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Zl(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=We(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,br=new RegExp(yr.source,"g");function Jl(t){return function(){return t}}function Ql(t){return function(e){return t(e)+""}}function ga(t,e){var n=yr.lastIndex=br.lastIndex=0,r,i,a,o=-1,u=[],c=[];for(t=t+"",e=e+"";(r=yr.exec(t))&&(i=br.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,c.push({i:o,x:V(r,i)})),n=br.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?c[0]?Ql(c[0].x):Jl(e):(e=c.length,function(s){for(var l=0,h;l<e;++l)u[(h=c[l]).i]=h.x(s);return u.join("")})}function We(t,e){var n=typeof e,r;return e==null||n==="boolean"?gr(e):(n==="number"?V:n==="string"?(r=St(e))?(e=r,wt):ga:e instanceof St?wt:e instanceof Date?Wl:Vl(e)?Gl:Array.isArray(e)?Kl:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Zl:V)(t,e)}function tf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var ya=180/Math.PI,_r={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ba(t,e,n,r,i,a){var o,u,c;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(c=t*n+e*r)&&(n-=t*c,r-=e*c),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,c/=u),t*r<e*n&&(t=-t,e=-e,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*ya,skewX:Math.atan(c)*ya,scaleX:o,scaleY:u}}var Ze;function ef(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?_r:ba(e.a,e.b,e.c,e.d,e.e,e.f)}function nf(t){return t==null||(Ze||(Ze=document.createElementNS("http://www.w3.org/2000/svg","g")),Ze.setAttribute("transform",t),!(t=Ze.transform.baseVal.consolidate()))?_r:(t=t.matrix,ba(t.a,t.b,t.c,t.d,t.e,t.f))}function _a(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,l,h,f,d,g){if(s!==h||l!==f){var b=d.push("translate(",null,e,null,n);g.push({i:b-4,x:V(s,h)},{i:b-2,x:V(l,f)})}else(h||f)&&d.push("translate("+h+e+f+n)}function o(s,l,h,f){s!==l?(s-l>180?l+=360:l-s>180&&(s+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:V(s,l)})):l&&h.push(i(h)+"rotate("+l+r)}function u(s,l,h,f){s!==l?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:V(s,l)}):l&&h.push(i(h)+"skewX("+l+r)}function c(s,l,h,f,d,g){if(s!==h||l!==f){var b=d.push(i(d)+"scale(",null,",",null,")");g.push({i:b-4,x:V(s,h)},{i:b-2,x:V(l,f)})}else(h!==1||f!==1)&&d.push(i(d)+"scale("+h+","+f+")")}return function(s,l){var h=[],f=[];return s=t(s),l=t(l),a(s.translateX,s.translateY,l.translateX,l.translateY,h,f),o(s.rotate,l.rotate,h,f),u(s.skewX,l.skewX,h,f),c(s.scaleX,s.scaleY,l.scaleX,l.scaleY,h,f),s=l=null,function(d){for(var g=-1,b=f.length,m;++g<b;)h[(m=f[g]).i]=m.x(d);return h.join("")}}}var rf=_a(ef,"px, ","px)","deg)"),af=_a(nf,", ",")",")");function Je(t,e){e===void 0&&(e=t,t=We);for(var n=0,r=e.length-1,i=e[0],a=new Array(r<0?0:r);n<r;)a[n]=t(i,i=e[++n]);return function(o){var u=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[u](o-u)}}var Vt=0,de=0,pe=0,va=1e3,Qe,ge,tn=0,kt=0,en=0,ye=typeof performance=="object"&&performance.now?performance:Date,ma=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function nn(){return kt||(ma(of),kt=ye.now()+en)}function of(){kt=0}function be(){this._call=this._time=this._next=null}be.prototype=wa.prototype={constructor:be,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?nn():+n)+(e==null?0:+e),!this._next&&ge!==this&&(ge?ge._next=this:Qe=this,ge=this),this._call=t,this._time=n,vr()},stop:function(){this._call&&(this._call=null,this._time=1/0,vr())}};function wa(t,e,n){var r=new be;return r.restart(t,e,n),r}function uf(){nn(),++Vt;for(var t=Qe,e;t;)(e=kt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Vt}function xa(){kt=(tn=ye.now())+en,Vt=de=0;try{uf()}finally{Vt=0,cf(),kt=0}}function sf(){var t=ye.now(),e=t-tn;e>va&&(en-=e,tn=t)}function cf(){for(var t,e=Qe,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Qe=n);ge=t,vr(r)}function vr(t){if(!Vt){de&&(de=clearTimeout(de));var e=t-kt;e>24?(t<1/0&&(de=setTimeout(xa,t-ye.now()-en)),pe&&(pe=clearInterval(pe))):(pe||(tn=ye.now(),pe=setInterval(sf,va)),Vt=1,ma(xa))}}function Ma(t,e,n){var r=new be;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}function lf(t,e,n){var r=new be,i=e;return r._restart=r.restart,r.restart=function(a,o,u){o=+o,u=u==null?nn():+u,r._restart(function c(s){s+=i,r._restart(c,i+=o,u),a(s)},o,u)},r.restart(t,e,n),r}var ff=Xi("start","end","cancel","interrupt"),hf=[],Aa=0,$a=1,mr=2,rn=3,Ta=4,wr=5,an=6;function on(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;df(t,n,{name:e,index:r,group:i,on:ff,tween:hf,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Aa})}function xr(t,e){var n=K(t,e);if(n.state>Aa)throw new Error("too late; already scheduled");return n}function rt(t,e){var n=K(t,e);if(n.state>rn)throw new Error("too late; already running");return n}function K(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function df(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=wa(a,0,n.time);function a(s){n.state=$a,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var l,h,f,d;if(n.state!==$a)return c();for(l in r)if(d=r[l],d.name===n.name){if(d.state===rn)return Ma(o);d.state===Ta?(d.state=an,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[l]):+l<e&&(d.state=an,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[l])}if(Ma(function(){n.state===rn&&(n.state=Ta,n.timer.restart(u,n.delay,n.time),u(s))}),n.state=mr,n.on.call("start",t,t.__data__,n.index,n.group),n.state===mr){for(n.state=rn,i=new Array(f=n.tween.length),l=0,h=-1;l<f;++l)(d=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=d);i.length=h+1}}function u(s){for(var l=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(c),n.state=wr,1),h=-1,f=i.length;++h<f;)i[h].call(t,l);n.state===wr&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=an,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function pf(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>mr&&r.state<wr,r.state=an,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function gf(t){return this.each(function(){pf(this,t)})}function yf(t,e){var n,r;return function(){var i=rt(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function bf(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=rt(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},c=0,s=i.length;c<s;++c)if(i[c].name===e){i[c]=u;break}c===s&&i.push(u)}a.tween=i}}function _f(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=K(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?yf:bf)(n,t,e))}function Mr(t,e,n){var r=t._id;return t.each(function(){var i=rt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return K(i,r).value[e]}}function Na(t,e){var n;return(typeof e=="number"?V:e instanceof St?wt:(n=St(e))?(e=n,wt):ga)(t,e)}function vf(t){return function(){this.removeAttribute(t)}}function mf(t){return function(){this.removeAttributeNS(t.space,t.local)}}function wf(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function xf(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function Mf(t,e,n){var r,i,a;return function(){var o,u=n(this),c;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),c=u+"",o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,u)))}}function Af(t,e,n){var r,i,a;return function(){var o,u=n(this),c;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),c=u+"",o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,u)))}}function $f(t,e){var n=Xe(t),r=n==="transform"?af:Na;return this.attrTween(t,typeof e=="function"?(n.local?Af:Mf)(n,r,Mr(this,"attr."+t,e)):e==null?(n.local?mf:vf)(n):(n.local?xf:wf)(n,r,e))}function Tf(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Nf(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Sf(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Nf(t,a)),n}return i._value=e,i}function Pf(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Tf(t,a)),n}return i._value=e,i}function Ef(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Xe(t);return this.tween(n,(r.local?Sf:Pf)(r,e))}function kf(t,e){return function(){xr(this,t).delay=+e.apply(this,arguments)}}function Of(t,e){return e=+e,function(){xr(this,t).delay=e}}function zf(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?kf:Of)(e,t)):K(this.node(),e).delay}function Cf(t,e){return function(){rt(this,t).duration=+e.apply(this,arguments)}}function If(t,e){return e=+e,function(){rt(this,t).duration=e}}function Rf(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Cf:If)(e,t)):K(this.node(),e).duration}function jf(t,e){if(typeof e!="function")throw new Error;return function(){rt(this,t).ease=e}}function Ff(t){var e=this._id;return arguments.length?this.each(jf(e,t)):K(this.node(),e).ease}function Df(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;rt(this,t).ease=n}}function Lf(t){if(typeof t!="function")throw new Error;return this.each(Df(this._id,t))}function qf(t){typeof t!="function"&&(t=Vi(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],c,s=0;s<o;++s)(c=a[s])&&t.call(c,c.__data__,s,a)&&u.push(c);return new ut(r,this._parents,this._name,this._id)}function Bf(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var c=e[u],s=n[u],l=c.length,h=o[u]=new Array(l),f,d=0;d<l;++d)(f=c[d]||s[d])&&(h[d]=f);for(;u<r;++u)o[u]=e[u];return new ut(o,this._parents,this._name,this._id)}function Xf(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function Hf(t,e,n){var r,i,a=Xf(e)?xr:rt;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Uf(t,e){var n=this._id;return arguments.length<2?K(this.node(),n).on.on(t):this.each(Hf(n,t,e))}function Yf(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Gf(){return this.on("end.remove",Yf(this._id))}function Vf(t){var e=this._name,n=this._id;typeof t!="function"&&(t=fr(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],c=u.length,s=a[o]=new Array(c),l,h,f=0;f<c;++f)(l=u[f])&&(h=t.call(l,l.__data__,f,u))&&("__data__"in l&&(h.__data__=l.__data__),s[f]=h,on(s[f],e,n,f,s,K(l,n)));return new ut(a,this._parents,e,n)}function Kf(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Gi(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var c=r[u],s=c.length,l,h=0;h<s;++h)if(l=c[h]){for(var f=t.call(l,l.__data__,h,c),d,g=K(l,n),b=0,m=f.length;b<m;++b)(d=f[b])&&on(d,e,n,b,f,g);a.push(f),o.push(l)}return new ut(a,o,e,n)}var Wf=ce.prototype.constructor;function Zf(){return new Wf(this._groups,this._parents)}function Jf(t,e){var n,r,i;return function(){var a=Yt(this,t),o=(this.style.removeProperty(t),Yt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Sa(t){return function(){this.style.removeProperty(t)}}function Qf(t,e,n){var r,i=n+"",a;return function(){var o=Yt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function th(t,e,n){var r,i,a;return function(){var o=Yt(this,t),u=n(this),c=u+"";return u==null&&(c=u=(this.style.removeProperty(t),Yt(this,t))),o===c?null:o===r&&c===i?a:(i=c,a=e(r=o,u))}}function eh(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var c=rt(this,t),s=c.on,l=c.value[a]==null?u||(u=Sa(e)):void 0;(s!==n||i!==l)&&(r=(n=s).copy()).on(o,i=l),c.on=r}}function nh(t,e,n){var r=(t+="")=="transform"?rf:Na;return e==null?this.styleTween(t,Jf(t,r)).on("end.style."+t,Sa(t)):typeof e=="function"?this.styleTween(t,th(t,r,Mr(this,"style."+t,e))).each(eh(this._id,t)):this.styleTween(t,Qf(t,r,e),n).on("end.style."+t,null)}function rh(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ih(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&rh(t,o,n)),r}return a._value=e,a}function ah(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,ih(t,e,n??""))}function oh(t){return function(){this.textContent=t}}function uh(t){return function(){var e=t(this);this.textContent=e??""}}function sh(t){return this.tween("text",typeof t=="function"?uh(Mr(this,"text",t)):oh(t==null?"":t+""))}function ch(t){return function(e){this.textContent=t.call(this,e)}}function lh(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&ch(i)),e}return r._value=t,r}function fh(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,lh(t))}function hh(){for(var t=this._name,e=this._id,n=Pa(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,c,s=0;s<u;++s)if(c=o[s]){var l=K(c,e);on(c,t,n,s,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new ut(r,this._parents,t,n)}function dh(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var s=rt(this,r),l=s.on;l!==t&&(e=(t=l).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(c)),s.on=e}),i===0&&a()})}var ph=0;function ut(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Pa(){return++ph}var st=ce.prototype;ut.prototype={constructor:ut,select:Vf,selectAll:Kf,selectChild:st.selectChild,selectChildren:st.selectChildren,filter:qf,merge:Bf,selection:Zf,transition:hh,call:st.call,nodes:st.nodes,node:st.node,size:st.size,empty:st.empty,each:st.each,on:Uf,attr:$f,attrTween:Ef,style:nh,styleTween:ah,text:sh,textTween:fh,remove:Gf,tween:_f,delay:zf,duration:Rf,ease:Ff,easeVarying:Lf,end:dh,[Symbol.iterator]:st[Symbol.iterator]};function gh(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var yh={time:null,delay:0,duration:250,ease:gh};function bh(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function _h(t){var e,n;t instanceof ut?(e=t._id,t=t._name):(e=Pa(),(n=yh).time=nn(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,c,s=0;s<u;++s)(c=o[s])&&on(c,t,e,s,o,n||bh(c,e));return new ut(r,this._parents,t,e)}ce.prototype.interrupt=gf,ce.prototype.transition=_h;function vh(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function un(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function Kt(t){return t=un(Math.abs(t)),t?t[1]:NaN}function mh(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),a.push(n.substring(i-=u,i+u)),!((c+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function wh(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var xh=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sn(t){if(!(e=xh.exec(t)))throw new Error("invalid format: "+t);var e;return new Ar({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}sn.prototype=Ar.prototype;function Ar(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Ar.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Mh(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Ea;function Ah(t,e){var n=un(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Ea=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+un(t,Math.max(0,e+a-1))[0]}function ka(t,e){var n=un(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Oa={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:vh,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>ka(t*100,e),r:ka,s:Ah,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function za(t){return t}var Ca=Array.prototype.map,Ia=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $h(t){var e=t.grouping===void 0||t.thousands===void 0?za:mh(Ca.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?za:wh(Ca.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function s(h){h=sn(h);var f=h.fill,d=h.align,g=h.sign,b=h.symbol,m=h.zero,w=h.width,p=h.comma,M=h.precision,y=h.trim,v=h.type;v==="n"?(p=!0,v="g"):Oa[v]||(M===void 0&&(M=12),y=!0,v="g"),(m||f==="0"&&d==="=")&&(m=!0,f="0",d="=");var S=b==="$"?n:b==="#"&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",P=b==="$"?r:/[%p]/.test(v)?o:"",z=Oa[v],H=/[defgprs%]/.test(v);M=M===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,M)):Math.max(0,Math.min(20,M));function U(_){var C=S,A=P,I,Ht,B;if(v==="c")A=z(_)+A,_="";else{_=+_;var Y=_<0||1/_<0;if(_=isNaN(_)?c:z(Math.abs(_),M),y&&(_=Mh(_)),Y&&+_==0&&g!=="+"&&(Y=!1),C=(Y?g==="("?g:u:g==="-"||g==="("?"":g)+C,A=(v==="s"?Ia[8+Ea/3]:"")+A+(Y&&g==="("?")":""),H){for(I=-1,Ht=_.length;++I<Ht;)if(B=_.charCodeAt(I),48>B||B>57){A=(B===46?i+_.slice(I+1):_.slice(I))+A,_=_.slice(0,I);break}}}p&&!m&&(_=e(_,1/0));var et=C.length+_.length+A.length,E=et<w?new Array(w-et+1).join(f):"";switch(p&&m&&(_=e(E+_,E.length?w-A.length:1/0),E=""),d){case"<":_=C+_+A+E;break;case"=":_=C+E+_+A;break;case"^":_=E.slice(0,et=E.length>>1)+C+_+A+E.slice(et);break;default:_=E+C+_+A;break}return a(_)}return U.toString=function(){return h+""},U}function l(h,f){var d=s((h=sn(h),h.type="f",h)),g=Math.max(-8,Math.min(8,Math.floor(Kt(f)/3)))*3,b=Math.pow(10,-g),m=Ia[8+g/3];return function(w){return d(b*w)+m}}return{format:s,formatPrefix:l}}var cn,Ra,ja;Th({thousands:",",grouping:[3],currency:["$",""]});function Th(t){return cn=$h(t),Ra=cn.format,ja=cn.formatPrefix,cn}function Nh(t){return Math.max(0,-Kt(Math.abs(t)))}function Sh(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Kt(e)/3)))*3-Kt(Math.abs(t)))}function Ph(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Kt(e)-Kt(t))+1}function Eh(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function kh(t){return function(){return t}}function Oh(t){return+t}var Fa=[0,1];function Wt(t){return t}function $r(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:kh(isNaN(e)?NaN:.5)}function zh(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Ch(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=$r(i,r),a=n(o,a)):(r=$r(r,i),a=n(a,o)),function(u){return a(r(u))}}function Ih(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=$r(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var c=Hs(t,u,1,r)-1;return a[c](i[c](u))}}function Rh(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function jh(){var t=Fa,e=Fa,n=We,r,i,a,o=Wt,u,c,s;function l(){var f=Math.min(t.length,e.length);return o!==Wt&&(o=zh(t[0],t[f-1])),u=f>2?Ih:Ch,c=s=null,h}function h(f){return f==null||isNaN(f=+f)?a:(c||(c=u(t.map(r),e,n)))(r(o(f)))}return h.invert=function(f){return o(i((s||(s=u(e,t.map(r),V)))(f)))},h.domain=function(f){return arguments.length?(t=Array.from(f,Oh),l()):t.slice()},h.range=function(f){return arguments.length?(e=Array.from(f),l()):e.slice()},h.rangeRound=function(f){return e=Array.from(f),n=tf,l()},h.clamp=function(f){return arguments.length?(o=f?!0:Wt,l()):o!==Wt},h.interpolate=function(f){return arguments.length?(n=f,l()):n},h.unknown=function(f){return arguments.length?(a=f,h):a},function(f,d){return r=f,i=d,l()}}function Fh(){return jh()(Wt,Wt)}function Dh(t,e,n,r){var i=Ks(t,e,n),a;switch(r=sn(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Sh(i,o))&&(r.precision=a),ja(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Ph(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Nh(i))&&(r.precision=a-(r.type==="%")*2);break}}return Ra(r)}function Lh(t){var e=t.domain;return t.ticks=function(n){var r=e();return Vs(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Dh(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],c,s,l=10;for(u<o&&(s