@explorables/flockn_roll
Version:
This is a model for collective behavior in animals, e.g. flocks of birds or schools of fish based on simple rules of interaction.
2 lines • 172 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-border-style:solid;--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-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--tw-color-red-300:oklch(80.8% .114 19.571);--tw-color-yellow-300:oklch(90.5% .182 98.111);--tw-color-blue-300:oklch(80.9% .105 251.813);--tw-color-black:#000;--tw-color-white:#fff;--tw-spacing:.25rem;--tw-container-5xl:64rem;--tw-container-6xl:72rem;--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;--tw-default-font-family:var(--tw-font-sans);--tw-default-mono-font-family:var(--tw-font-mono)}}@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\\:border-1{border-style:var(--tw-border-style);border-width:1px}.tw\\:border-black{border-color:var(--tw-color-black)}.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\\:border-white{border-color:var(--tw-color-white)}.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-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}._displayPanel_bnmb5_2,._controlPanel_bnmb5_9{display:block;line-height:0;box-sizing:border-box}._displayPanel_bnmb5_2>canvas,._displayPanel_bnmb5_2>svg,._controlPanel_bnmb5_9>svg,._controlPanel_bnmb5_9>canvas{display:block;box-sizing:border-box}._attract_scope_bnmb5_27{fill:#dcdcdc;stroke:#000;stroke-width:.5px}._orient_scope_bnmb5_33{fill:#b4b4b4;stroke:#000;stroke-width:.5px}._repell_scope_bnmb5_39,._speed_bnmb5_45{fill:#fff;stroke:#000;stroke-width:.5px}._drop_bnmb5_51{fill-opacity:1;fill:#000;stroke:#000}._agent_bnmb5_57{stroke-width:0px;stroke:#000;fill:#000}@media (prefers-color-scheme: dark){._agent_bnmb5_57{stroke:#fff;fill:#fff}._drop_bnmb5_51{fill:#fff;stroke:gray;stroke-width:.5px}._speed_bnmb5_45{fill:#fff;stroke:#fff}._repell_scope_bnmb5_39{fill:#000;stroke:gray;stroke-width:.5px}._orient_scope_bnmb5_33{fill:#b4b4b4;stroke:gray;stroke-width:.5px}._attract_scope_bnmb5_27{fill:#dcdcdc;stroke:gray;stroke-width:.5px}}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
(function(T,Vt){typeof exports=="object"&&typeof module<"u"?Vt(exports):typeof define=="function"&&define.amd?define(["exports"],Vt):(T=typeof globalThis<"u"?globalThis:T||self,Vt(T.flockn_roll={}))})(this,function(T){"use strict";const Vt={display_type:"svg",debug:!1,controls_border:"",display_border:"",debug_lattice:"debug-grid-16",controls_grid:{nx:12,ny:12},display_size:{width:500,height:500},controls_size:{width:480,height:480},display_class:" tw:p-0 tw:border-1 tw:border-black tw:dark:border-white",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 Wn(t,n){return t==null||n==null?NaN:t<n?-1:t>n?1:t>=n?0:NaN}function il(t,n){return t==null||n==null?NaN:n<t?-1:n>t?1:n>=t?0:NaN}function Qi(t){let n,e,r;t.length!==2?(n=Wn,e=(s,l)=>Wn(t(s),l),r=(s,l)=>t(s)-l):(n=t===Wn||t===il?t:ol,e=t,r=t);function i(s,l,u=0,c=s.length){if(u<c){if(n(l,l)!==0)return c;do{const h=u+c>>>1;e(s[h],l)<0?u=h+1:c=h}while(u<c)}return u}function o(s,l,u=0,c=s.length){if(u<c){if(n(l,l)!==0)return c;do{const h=u+c>>>1;e(s[h],l)<=0?u=h+1:c=h}while(u<c)}return u}function a(s,l,u=0,c=s.length){const h=i(s,l,u,c-1);return h>u&&r(s[h-1],l)>-r(s[h],l)?h-1:h}return{left:i,center:a,right:o}}function ol(){return 0}function al(t){return t===null?NaN:+t}const sl=Qi(Wn).right;Qi(al).center;const ul=Math.sqrt(50),ll=Math.sqrt(10),cl=Math.sqrt(2);function Jn(t,n,e){const r=(n-t)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=ul?10:o>=ll?5:o>=cl?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(t*u),l=Math.round(n*u),s/u<t&&++s,l/u>n&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(t/u),l=Math.round(n/u),s*u<t&&++s,l*u>n&&--l),l<s&&.5<=e&&e<2?Jn(t,n,e*2):[s,l,u]}function fl(t,n,e){if(n=+n,t=+t,e=+e,!(e>0))return[];if(t===n)return[t];const r=n<t,[i,o,a]=r?Jn(n,t,e):Jn(t,n,e);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let u=0;u<s;++u)l[u]=(o-u)/-a;else for(let u=0;u<s;++u)l[u]=(o-u)*a;else if(a<0)for(let u=0;u<s;++u)l[u]=(i+u)/-a;else for(let u=0;u<s;++u)l[u]=(i+u)*a;return l}function yr(t,n,e){return n=+n,t=+t,e=+e,Jn(t,n,e)[2]}function hl(t,n,e){n=+n,t=+t,e=+e;const r=n<t,i=r?yr(n,t,e):yr(t,n,e);return(r?-1:1)*(i<0?1/-i:i)}var pl={value:()=>{}};function to(){for(var t=0,n=arguments.length,e={},r;t<n;++t){if(!(r=arguments[t]+"")||r in e||/[\s.]/.test(r))throw new Error("illegal type: "+r);e[r]=[]}return new Qn(e)}function Qn(t){this._=t}function dl(t,n){return t.trim().split(/^|\s+/).map(function(e){var r="",i=e.indexOf(".");if(i>=0&&(r=e.slice(i+1),e=e.slice(0,i)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:r}})}Qn.prototype=to.prototype={constructor:Qn,on:function(t,n){var e=this._,r=dl(t+"",e),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=gl(e[i],t.name)))return i;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<a;)if(i=(t=r[o]).type)e[i]=no(e[i],t.name,n);else if(n==null)for(i in e)e[i]=no(e[i],t.name,null);return this},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new Qn(t)},call:function(t,n){if((i=arguments.length-2)>0)for(var e=new Array(i),r=0,i,o;r<i;++r)e[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(n,e)},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)}};function gl(t,n){for(var e=0,r=t.length,i;e<r;++e)if((i=t[e]).name===n)return i.value}function no(t,n,e){for(var r=0,i=t.length;r<i;++r)if(t[r].name===n){t[r]=pl,t=t.slice(0,r).concat(t.slice(r+1));break}return e!=null&&t.push({name:n,value:e}),t}var vr="http://www.w3.org/1999/xhtml";const eo={svg:"http://www.w3.org/2000/svg",xhtml:vr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function te(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),eo.hasOwnProperty(n)?{space:eo[n],local:t}:t}function _l(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===vr&&n.documentElement.namespaceURI===vr?n.createElement(t):n.createElementNS(e,t)}}function yl(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function ro(t){var n=te(t);return(n.local?yl:_l)(n)}function vl(){}function mr(t){return t==null?vl:function(){return this.querySelector(t)}}function ml(t){typeof t!="function"&&(t=mr(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=t.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new D(r,this._parents)}function wl(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function bl(){return[]}function io(t){return t==null?bl:function(){return this.querySelectorAll(t)}}function xl(t){return function(){return wl(t.apply(this,arguments))}}function Ml(t){typeof t=="function"?t=xl(t):t=io(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var a=n[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(t.call(l,l.__data__,u,a)),i.push(l));return new D(r,i)}function oo(t){return function(){return this.matches(t)}}function ao(t){return function(n){return n.matches(t)}}var $l=Array.prototype.find;function Al(t){return function(){return $l.call(this.children,t)}}function Nl(){return this.firstElementChild}function Tl(t){return this.select(t==null?Nl:Al(typeof t=="function"?t:ao(t)))}var Sl=Array.prototype.filter;function Pl(){return Array.from(this.children)}function El(t){return function(){return Sl.call(this.children,t)}}function kl(t){return this.selectAll(t==null?Pl:El(typeof t=="function"?t:ao(t)))}function Ol(t){typeof t!="function"&&(t=oo(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new D(r,this._parents)}function so(t){return new Array(t.length)}function zl(){return new D(this._enter||this._groups.map(so),this._parents)}function ne(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}ne.prototype={constructor:ne,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)}};function Cl(t){return function(){return t}}function Il(t,n,e,r,i,o){for(var a=0,s,l=n.length,u=o.length;a<u;++a)(s=n[a])?(s.__data__=o[a],r[a]=s):e[a]=new ne(t,o[a]);for(;a<l;++a)(s=n[a])&&(i[a]=s)}function Rl(t,n,e,r,i,o,a){var s,l,u=new Map,c=n.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(l=n[s])&&(f[s]=p=a.call(l,l.__data__,s,n)+"",u.has(p)?i[s]=l:u.set(p,l));for(s=0;s<h;++s)p=a.call(t,o[s],s,o)+"",(l=u.get(p))?(r[s]=l,l.__data__=o[s],u.delete(p)):e[s]=new ne(t,o[s]);for(s=0;s<c;++s)(l=n[s])&&u.get(f[s])===l&&(i[s]=l)}function jl(t){return t.__data__}function Ll(t,n){if(!arguments.length)return Array.from(this,jl);var e=n?Rl:Il,r=this._parents,i=this._groups;typeof t!="function"&&(t=Cl(t));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],h=i[u],f=h.length,p=Fl(t.call(c,c&&c.__data__,u,r)),g=p.length,_=s[u]=new Array(g),w=a[u]=new Array(g),b=l[u]=new Array(f);e(c,h,_,w,b,p,n);for(var d=0,M=0,y,m;d<g;++d)if(y=_[d]){for(d>=M&&(M=d+1);!(m=w[M])&&++M<g;);y._next=m||null}}return a=new D(a,r),a._enter=s,a._exit=l,a}function Fl(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Dl(){return new D(this._exit||this._groups.map(so),this._parents)}function ql(t,n,e){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),n!=null&&(i=n(i),i&&(i=i.selection())),e==null?o.remove():e(o),r&&i?r.merge(i).order():i}function Bl(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=e[l],c=r[l],h=u.length,f=s[l]=new Array(h),p,g=0;g<h;++g)(p=u[g]||c[g])&&(f[g]=p);for(;l<i;++l)s[l]=e[l];return new D(s,this._parents)}function Xl(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r=t[n],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function Hl(t){t||(t=Ul);function n(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var a=e[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(n)}return new D(i,this._parents).order()}function Ul(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Gl(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yl(){return Array.from(this)}function Vl(){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 a=r[i];if(a)return a}return null}function Kl(){let t=0;for(const n of this)++t;return t}function Zl(){return!this.node()}function Wl(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i=n[e],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function Jl(t){return function(){this.removeAttribute(t)}}function Ql(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tc(t,n){return function(){this.setAttribute(t,n)}}function nc(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function ec(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function rc(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function ic(t,n){var e=te(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?Ql:Jl:typeof n=="function"?e.local?rc:ec:e.local?nc:tc)(e,n))}function uo(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function oc(t){return function(){this.style.removeProperty(t)}}function ac(t,n,e){return function(){this.style.setProperty(t,n,e)}}function sc(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function uc(t,n,e){return arguments.length>1?this.each((n==null?oc:typeof n=="function"?sc:ac)(t,n,e??"")):Kt(this.node(),t)}function Kt(t,n){return t.style.getPropertyValue(n)||uo(t).getComputedStyle(t,null).getPropertyValue(n)}function lc(t){return function(){delete this[t]}}function cc(t,n){return function(){this[t]=n}}function fc(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function hc(t,n){return arguments.length>1?this.each((n==null?lc:typeof n=="function"?fc:cc)(t,n)):this.node()[t]}function lo(t){return t.trim().split(/^|\s+/)}function wr(t){return t.classList||new co(t)}function co(t){this._node=t,this._names=lo(t.getAttribute("class")||"")}co.prototype={add:function(t){var n=this._names.indexOf(t);n<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}};function fo(t,n){for(var e=wr(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ho(t,n){for(var e=wr(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function pc(t){return function(){fo(this,t)}}function dc(t){return function(){ho(this,t)}}function gc(t,n){return function(){(n.apply(this,arguments)?fo:ho)(this,t)}}function _c(t,n){var e=lo(t+"");if(arguments.length<2){for(var r=wr(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?gc:n?pc:dc)(e,n))}function yc(){this.textContent=""}function vc(t){return function(){this.textContent=t}}function mc(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function wc(t){return arguments.length?this.each(t==null?yc:(typeof t=="function"?mc:vc)(t)):this.node().textContent}function bc(){this.innerHTML=""}function xc(t){return function(){this.innerHTML=t}}function Mc(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function $c(t){return arguments.length?this.each(t==null?bc:(typeof t=="function"?Mc:xc)(t)):this.node().innerHTML}function Ac(){this.nextSibling&&this.parentNode.appendChild(this)}function Nc(){return this.each(Ac)}function Tc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Sc(){return this.each(Tc)}function Pc(t){var n=typeof t=="function"?t:ro(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function Ec(){return null}function kc(t,n){var e=typeof t=="function"?t:ro(t),r=n==null?Ec:typeof n=="function"?n:mr(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Oc(){var t=this.parentNode;t&&t.removeChild(this)}function zc(){return this.each(Oc)}function Cc(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Ic(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Rc(t){return this.select(t?Ic:Cc)}function jc(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Lc(t){return function(n){t.call(this,n,this.__data__)}}function Fc(t){return t.trim().split(/^|\s+/).map(function(n){var e="",r=n.indexOf(".");return r>=0&&(e=n.slice(r+1),n=n.slice(0,r)),{type:n,name:e}})}function Dc(t){return function(){var n=this.__on;if(n){for(var e=0,r=-1,i=n.length,o;e<i;++e)o=n[e],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):n[++r]=o;++r?n.length=r:delete this.__on}}}function qc(t,n,e){return function(){var r=this.__on,i,o=Lc(n);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=e),i.value=n;return}}this.addEventListener(t.type,o,e),i={type:t.type,name:t.name,value:n,listener:o,options:e},r?r.push(i):this.__on=[i]}}function Bc(t,n,e){var r=Fc(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=n?qc:Dc,i=0;i<o;++i)this.each(s(r[i],n,e));return this}function po(t,n,e){var r=uo(t),i=r.CustomEvent;typeof i=="function"?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 Xc(t,n){return function(){return po(this,t,n)}}function Hc(t,n){return function(){return po(this,t,n.apply(this,arguments))}}function Uc(t,n){return this.each((typeof n=="function"?Hc:Xc)(t,n))}function*Gc(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var go=[null];function D(t,n){this._groups=t,this._parents=n}function mn(){return new D([[document.documentElement]],go)}function Yc(){return this}D.prototype=mn.prototype={constructor:D,select:ml,selectAll:Ml,selectChild:Tl,selectChildren:kl,filter:Ol,data:Ll,enter:zl,exit:Dl,join:ql,merge:Bl,selection:Yc,order:Xl,sort:Hl,call:Gl,nodes:Yl,node:Vl,size:Kl,empty:Zl,each:Wl,attr:ic,style:uc,property:hc,classed:_c,text:wc,html:$c,raise:Nc,lower:Sc,append:Pc,insert:kc,remove:zc,clone:Rc,datum:jc,on:Bc,dispatch:Uc,[Symbol.iterator]:Gc};function Vc(t){return typeof t=="string"?new D([[document.querySelector(t)]],[document.documentElement]):new D([[t]],go)}function ee(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function br(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function Zt(){}var Nt=.7,Wt=1/Nt,Jt="\\s*([+-]?\\d+)\\s*",wn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Kc=/^#([0-9a-f]{3,8})$/,Zc=new RegExp(`^rgb\\(${Jt},${Jt},${Jt}\\)$`),Wc=new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`),Jc=new RegExp(`^rgba\\(${Jt},${Jt},${Jt},${wn}\\)$`),Qc=new RegExp(`^rgba\\(${rt},${rt},${rt},${wn}\\)$`),tf=new RegExp(`^hsl\\(${wn},${rt},${rt}\\)$`),nf=new RegExp(`^hsla\\(${wn},${rt},${rt},${wn}\\)$`),_o={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};ee(Zt,Tt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yo,formatHex:yo,formatHex8:ef,formatHsl:rf,formatRgb:vo,toString:vo});function yo(){return this.rgb().formatHex()}function ef(){return this.rgb().formatHex8()}function rf(){return $o(this).formatHsl()}function vo(){return this.rgb().formatRgb()}function Tt(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=Kc.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?mo(n):e===3?new j(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?re(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?re(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Zc.exec(t))?new j(n[1],n[2],n[3],1):(n=Wc.exec(t))?new j(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Jc.exec(t))?re(n[1],n[2],n[3],n[4]):(n=Qc.exec(t))?re(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=tf.exec(t))?Mo(n[1],n[2]/100,n[3]/100,1):(n=nf.exec(t))?Mo(n[1],n[2]/100,n[3]/100,n[4]):_o.hasOwnProperty(t)?mo(_o[t]):t==="transparent"?new j(NaN,NaN,NaN,0):null}function mo(t){return new j(t>>16&255,t>>8&255,t&255,1)}function re(t,n,e,r){return r<=0&&(t=n=e=NaN),new j(t,n,e,r)}function wo(t){return t instanceof Zt||(t=Tt(t)),t?(t=t.rgb(),new j(t.r,t.g,t.b,t.opacity)):new j}function xr(t,n,e,r){return arguments.length===1?wo(t):new j(t,n,e,r??1)}function j(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}ee(j,xr,br(Zt,{brighter(t){return t=t==null?Wt:Math.pow(Wt,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Nt:Math.pow(Nt,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new j(St(this.r),St(this.g),St(this.b),ie(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:bo,formatHex:bo,formatHex8:of,formatRgb:xo,toString:xo}));function bo(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}`}function of(){return`#${Pt(this.r)}${Pt(this.g)}${Pt(this.b)}${Pt((isNaN(this.opacity)?1:this.opacity)*255)}`}function xo(){const t=ie(this.opacity);return`${t===1?"rgb(":"rgba("}${St(this.r)}, ${St(this.g)}, ${St(this.b)}${t===1?")":`, ${t})`}`}function ie(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function St(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Pt(t){return t=St(t),(t<16?"0":"")+t.toString(16)}function Mo(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Y(t,n,e,r)}function $o(t){if(t instanceof Y)return new Y(t.h,t.s,t.l,t.opacity);if(t instanceof Zt||(t=Tt(t)),!t)return new Y;if(t instanceof Y)return t;t=t.rgb();var n=t.r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,s=o-i,l=(o+i)/2;return s?(n===o?a=(e-r)/s+(e<r)*6:e===o?a=(r-n)/s+2:a=(n-e)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Y(a,s,l,t.opacity)}function af(t,n,e,r){return arguments.length===1?$o(t):new Y(t,n,e,r??1)}function Y(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}ee(Y,af,br(Zt,{brighter(t){return t=t==null?Wt:Math.pow(Wt,t),new Y(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Nt:Math.pow(Nt,t),new Y(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,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 j(Mr(t>=240?t-240:t+120,i,r),Mr(t,i,r),Mr(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Y(Ao(this.h),oe(this.s),oe(this.l),ie(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=ie(this.opacity);return`${t===1?"hsl(":"hsla("}${Ao(this.h)}, ${oe(this.s)*100}%, ${oe(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ao(t){return t=(t||0)%360,t<0?t+360:t}function oe(t){return Math.max(0,Math.min(1,t||0))}function Mr(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}const sf=Math.PI/180,uf=180/Math.PI;var No=-.14861,$r=1.78277,Ar=-.29227,ae=-.90649,bn=1.97294,To=bn*ae,So=bn*$r,Po=$r*Ar-ae*No;function lf(t){if(t instanceof Et)return new Et(t.h,t.s,t.l,t.opacity);t instanceof j||(t=wo(t));var n=t.r/255,e=t.g/255,r=t.b/255,i=(Po*r+To*n-So*e)/(Po+To-So),o=r-i,a=(bn*(e-i)-Ar*o)/ae,s=Math.sqrt(a*a+o*o)/(bn*i*(1-i)),l=s?Math.atan2(a,o)*uf-120:NaN;return new Et(l<0?l+360:l,s,i,t.opacity)}function xt(t,n,e,r){return arguments.length===1?lf(t):new Et(t,n,e,r??1)}function Et(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}ee(Et,xt,br(Zt,{brighter(t){return t=t==null?Wt:Math.pow(Wt,t),new Et(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Nt:Math.pow(Nt,t),new Et(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*sf,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new j(255*(n+e*(No*r+$r*i)),255*(n+e*(Ar*r+ae*i)),255*(n+e*(bn*r)),this.opacity)}}));const se=t=>()=>t;function Eo(t,n){return function(e){return t+e*n}}function cf(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}function ff(t,n){var e=n-t;return e?Eo(t,e>180||e<-180?e-360*Math.round(e/360):e):se(isNaN(t)?n:t)}function hf(t){return(t=+t)==1?Qt:function(n,e){return e-n?cf(n,e,t):se(isNaN(n)?e:n)}}function Qt(t,n){var e=n-t;return e?Eo(t,e):se(isNaN(t)?n:t)}const ue=function t(n){var e=hf(n);function r(i,o){var a=e((i=xr(i)).r,(o=xr(o)).r),s=e(i.g,o.g),l=e(i.b,o.b),u=Qt(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=t,r}(1);function pf(t,n){n||(n=[]);var e=t?Math.min(n.length,t.length):0,r=n.slice(),i;return function(o){for(i=0;i<e;++i)r[i]=t[i]*(1-o)+n[i]*o;return r}}function df(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function gf(t,n){var e=n?n.length:0,r=t?Math.min(e,t.length):0,i=new Array(r),o=new Array(e),a;for(a=0;a<r;++a)i[a]=Sr(t[a],n[a]);for(;a<e;++a)o[a]=n[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function _f(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function V(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function yf(t,n){var e={},r={},i;(t===null||typeof t!="object")&&(t={}),(n===null||typeof n!="object")&&(n={});for(i in n)i in t?e[i]=Sr(t[i],n[i]):r[i]=n[i];return function(o){for(i in e)r[i]=e[i](o);return r}}var Nr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tr=new RegExp(Nr.source,"g");function vf(t){return function(){return t}}function mf(t){return function(n){return t(n)+""}}function ko(t,n){var e=Nr.lastIndex=Tr.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(t=t+"",n=n+"";(r=Nr.exec(t))&&(i=Tr.exec(n));)(o=i.index)>e&&(o=n.slice(e,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:V(r,i)})),e=Tr.lastIndex;return e<n.length&&(o=n.slice(e),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?mf(l[0].x):vf(n):(n=l.length,function(u){for(var c=0,h;c<n;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function Sr(t,n){var e=typeof n,r;return n==null||e==="boolean"?se(n):(e==="number"?V:e==="string"?(r=Tt(n))?(n=r,ue):ko:n instanceof Tt?ue:n instanceof Date?_f:df(n)?pf:Array.isArray(n)?gf:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?yf:V)(t,n)}function wf(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var Oo=180/Math.PI,Pr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zo(t,n,e,r,i,o){var a,s,l;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(l=t*e+n*r)&&(e-=t*l,r-=n*l),(s=Math.sqrt(e*e+r*r))&&(e/=s,r/=s,l/=s),t*r<n*e&&(t=-t,n=-n,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(n,t)*Oo,skewX:Math.atan(l)*Oo,scaleX:a,scaleY:s}}var le;function bf(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Pr:zo(n.a,n.b,n.c,n.d,n.e,n.f)}function xf(t){return t==null||(le||(le=document.createElementNS("http://www.w3.org/2000/svg","g")),le.setAttribute("transform",t),!(t=le.transform.baseVal.consolidate()))?Pr:(t=t.matrix,zo(t.a,t.b,t.c,t.d,t.e,t.f))}function Co(t,n,e,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,h,f,p,g){if(u!==h||c!==f){var _=p.push("translate(",null,n,null,e);g.push({i:_-4,x:V(u,h)},{i:_-2,x:V(c,f)})}else(h||f)&&p.push("translate("+h+n+f+e)}function a(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:V(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:V(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,p,g){if(u!==h||c!==f){var _=p.push(i(p)+"scale(",null,",",null,")");g.push({i:_-4,x:V(u,h)},{i:_-2,x:V(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=t(u),c=t(c),o(u.translateX,u.translateY,c.translateX,c.translateY,h,f),a(u.rotate,c.rotate,h,f),s(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(p){for(var g=-1,_=f.length,w;++g<_;)h[(w=f[g]).i]=w.x(p);return h.join("")}}}var Mf=Co(bf,"px, ","px)","deg)"),$f=Co(xf,", ",")",")");function Io(t){return function n(e){e=+e;function r(i,o){var a=t((i=xt(i)).h,(o=xt(o)).h),s=Qt(i.s,o.s),l=Qt(i.l,o.l),u=Qt(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=l(Math.pow(c,e)),i.opacity=u(c),i+""}}return r.gamma=n,r}(1)}Io(ff);var Ro=Io(Qt),tn=0,xn=0,Mn=0,jo=1e3,ce,$n,fe=0,kt=0,he=0,An=typeof performance=="object"&&performance.now?performance:Date,Lo=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function pe(){return kt||(Lo(Af),kt=An.now()+he)}function Af(){kt=0}function Nn(){this._call=this._time=this._next=null}Nn.prototype=Fo.prototype={constructor:Nn,restart:function(t,n,e){if(typeof t!="function")throw new TypeError("callback is not a function");e=(e==null?pe():+e)+(n==null?0:+n),!this._next&&$n!==this&&($n?$n._next=this:ce=this,$n=this),this._call=t,this._time=e,Er()},stop:function(){this._call&&(this._call=null,this._time=1/0,Er())}};function Fo(t,n,e){var r=new Nn;return r.restart(t,n,e),r}function Nf(){pe(),++tn;for(var t=ce,n;t;)(n=kt-t._time)>=0&&t._call.call(void 0,n),t=t._next;--tn}function Do(){kt=(fe=An.now())+he,tn=xn=0;try{Nf()}finally{tn=0,Sf(),kt=0}}function Tf(){var t=An.now(),n=t-fe;n>jo&&(he-=n,fe=t)}function Sf(){for(var t,n=ce,e,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:ce=e);$n=t,Er(r)}function Er(t){if(!tn){xn&&(xn=clearTimeout(xn));var n=t-kt;n>24?(t<1/0&&(xn=setTimeout(Do,t-An.now()-he)),Mn&&(Mn=clearInterval(Mn))):(Mn||(fe=An.now(),Mn=setInterval(Tf,jo)),tn=1,Lo(Do))}}function qo(t,n,e){var r=new Nn;return n=n==null?0:+n,r.restart(i=>{r.stop(),t(i+n)},n,e),r}function Pf(t,n,e){var r=new Nn,i=n;return r._restart=r.restart,r.restart=function(o,a,s){a=+a,s=s==null?pe():+s,r._restart(function l(u){u+=i,r._restart(l,i+=a,s),o(u)},a,s)},r.restart(t,n,e),r}var Ef=to("start","end","cancel","interrupt"),kf=[],Bo=0,Xo=1,kr=2,de=3,Ho=4,Or=5,ge=6;function _e(t,n,e,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(e in a)return;Of(t,e,{name:n,index:r,group:i,on:Ef,tween:kf,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Bo})}function zr(t,n){var e=K(t,n);if(e.state>Bo)throw new Error("too late; already scheduled");return e}function it(t,n){var e=K(t,n);if(e.state>de)throw new Error("too late; already running");return e}function K(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Of(t,n,e){var r=t.__transition,i;r[n]=e,e.timer=Fo(o,0,e.time);function o(u){e.state=Xo,e.timer.restart(a,e.delay,e.time),e.delay<=u&&a(u-e.delay)}function a(u){var c,h,f,p;if(e.state!==Xo)return l();for(c in r)if(p=r[c],p.name===e.name){if(p.state===de)return qo(a);p.state===Ho?(p.state=ge,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[c]):+c<n&&(p.state=ge,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[c])}if(qo(function(){e.state===de&&(e.state=Ho,e.timer.restart(s,e.delay,e.time),s(u))}),e.state=kr,e.on.call("start",t,t.__data__,e.index,e.group),e.state===kr){for(e.state=de,i=new Array(f=e.tween.length),c=0,h=-1;c<f;++c)(p=e.tween[c].value.call(t,t.__data__,e.index,e.group))&&(i[++h]=p);i.length=h+1}}function s(u){for(var c=u<e.duration?e.ease.call(null,u/e.duration):(e.timer.restart(l),e.state=Or,1),h=-1,f=i.length;++h<f;)i[h].call(t,c);e.state===Or&&(e.on.call("end",t,t.__data__,e.index,e.group),l())}function l(){e.state=ge,e.timer.stop(),delete r[n];for(var u in r)return;delete t.__transition}}function zf(t,n){var e=t.__transition,r,i,o=!0,a;if(e){n=n==null?null:n+"";for(a in e){if((r=e[a]).name!==n){o=!1;continue}i=r.state>kr&&r.state<Or,r.state=ge,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete e[a]}o&&delete t.__transition}}function Cf(t){return this.each(function(){zf(this,t)})}function If(t,n){var e,r;return function(){var i=it(this,t),o=i.tween;if(o!==e){r=e=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===n){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Rf(t,n,e){var r,i;if(typeof e!="function")throw new Error;return function(){var o=it(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:n,value:e},l=0,u=i.length;l<u;++l)if(i[l].name===n){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function jf(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r=K(this.node(),e).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((n==null?If:Rf)(e,t,n))}function Cr(t,n,e){var r=t._id;return t.each(function(){var i=it(this,r);(i.value||(i.value={}))[n]=e.apply(this,arguments)}),function(i){return K(i,r).value[n]}}function Uo(t,n){var e;return(typeof n=="number"?V:n instanceof Tt?ue:(e=Tt(n))?(n=e,ue):ko)(t,n)}function Lf(t){return function(){this.removeAttribute(t)}}function Ff(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Df(t,n,e){var r,i=e+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=n(r=a,e)}}function qf(t,n,e){var r,i=e+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=n(r=a,e)}}function Bf(t,n,e){var r,i,o;return function(){var a,s=e(this),l;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,s)))}}function Xf(t,n,e){var r,i,o;return function(){var a,s=e(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,s)))}}function Hf(t,n){var e=te(t),r=e==="transform"?$f:Uo;return this.attrTween(t,typeof n=="function"?(e.local?Xf:Bf)(e,r,Cr(this,"attr."+t,n)):n==null?(e.local?Ff:Lf)(e):(e.local?qf:Df)(e,r,n))}function Uf(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function Gf(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function Yf(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Gf(t,o)),e}return i._value=n,i}function Vf(t,n){var e,r;function i(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Uf(t,o)),e}return i._value=n,i}function Kf(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=te(t);return this.tween(e,(r.local?Yf:Vf)(r,n))}function Zf(t,n){return function(){zr(this,t).delay=+n.apply(this,arguments)}}function Wf(t,n){return n=+n,function(){zr(this,t).delay=n}}function Jf(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Zf:Wf)(n,t)):K(this.node(),n).delay}function Qf(t,n){return function(){it(this,t).duration=+n.apply(this,arguments)}}function th(t,n){return n=+n,function(){it(this,t).duration=n}}function nh(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?Qf:th)(n,t)):K(this.node(),n).duration}function eh(t,n){if(typeof n!="function")throw new Error;return function(){it(this,t).ease=n}}function rh(t){var n=this._id;return arguments.length?this.each(eh(n,t)):K(this.node(),n).ease}function ih(t,n){return function(){var e=n.apply(this,arguments);if(typeof e!="function")throw new Error;it(this,t).ease=e}}function oh(t){if(typeof t!="function")throw new Error;return this.each(ih(this._id,t))}function ah(t){typeof t!="function"&&(t=oo(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o=n[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&t.call(l,l.__data__,u,o)&&s.push(l);return new ut(r,this._parents,this._name,this._id)}function sh(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),a=new Array(r),s=0;s<o;++s)for(var l=n[s],u=e[s],c=l.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(h[p]=f);for(;s<r;++s)a[s]=n[s];return new ut(a,this._parents,this._name,this._id)}function uh(t){return(t+"").trim().split(/^|\s+/).every(function(n){var e=n.indexOf(".");return e>=0&&(n=n.slice(0,e)),!n||n==="start"})}function lh(t,n,e){var r,i,o=uh(n)?zr:it;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(n,e),a.on=i}}function ch(t,n){var e=this._id;return arguments.length<2?K(this.node(),e).on.on(t):this.each(lh(e,t,n))}function fh(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}function hh(){return this.on("end.remove",fh(this._id))}function ph(t){var n=this._name,e=this._id;typeof t!="function"&&(t=mr(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,h,f=0;f<l;++f)(c=s[f])&&(h=t.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,_e(u[f],n,e,f,u,K(c,e)));return new ut(o,this._parents,n,e)}function dh(t){var n=this._name,e=this._id;typeof t!="function"&&(t=io(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=t.call(c,c.__data__,h,l),p,g=K(c,e),_=0,w=f.length;_<w;++_)(p=f[_])&&_e(p,n,e,_,f,g);o.push(f),a.push(c)}return new ut(o,a,n,e)}var gh=mn.prototype.constructor;function _h(){return new gh(this._groups,this._parents)}function yh(t,n){var e,r,i;return function(){var o=Kt(this,t),a=(this.style.removeProperty(t),Kt(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}function Go(t){return function(){this.style.removeProperty(t)}}function vh(t,n,e){var r,i=e+"",o;return function(){var a=Kt(this,t);return a===i?null:a===r?o:o=n(r=a,e)}}function mh(t,n,e){var r,i,o;return function(){var a=Kt(this,t),s=e(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),Kt(this,t))),a===l?null:a===r&&l===i?o:(i=l,o=n(r=a,s))}}function wh(t,n){var e,r,i,o="style."+n,a="end."+o,s;return function(){var l=it(this,t),u=l.on,c=l.value[o]==null?s||(s=Go(n)):void 0;(u!==e||i!==c)&&(r=(e=u).copy()).on(a,i=c),l.on=r}}function bh(t,n,e){var r=(t+="")=="transform"?Mf:Uo;return n==null?this.styleTween(t,yh(t,r)).on("end.style."+t,Go(t)):typeof n=="function"?this.styleTween(t,mh(t,r,Cr(this,"style."+t,n))).each(wh(this._id,t)):this.styleTween(t,vh(t,r,n),e).on("end.style."+t,null)}function xh(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function Mh(t,n,e){var r,i;function o(){var a=n.apply(this,arguments);return a!==i&&(r=(i=a)&&xh(t,a,e)),r}return o._value=n,o}function $h(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,Mh(t,n,e??""))}function Ah(t){return function(){this.textContent=t}}function Nh(t){return function(){var n=t(this);this.textContent=n??""}}function Th(t){return this.tween("text",typeof t=="function"?Nh(Cr(this,"text",t)):Ah(t==null?"":t+""))}function Sh(t){return function(n){this.textContent=t.call(this,n)}}function Ph(t){var n,e;function r(){var i=t.apply(this,arguments);return i!==e&&(n=(e=i)&&Sh(i)),n}return r._value=t,r}function Eh(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Ph(t))}function kh(){for(var t=this._name,n=this._id,e=Yo(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=K(l,n);_e(l,t,e,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new ut(r,this._parents,t,e)}function Oh(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};e.each(function(){var u=it(this,r),c=u.on;c!==t&&(n=(t=c).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(l)),u.on=n}),i===0&&o()})}var zh=0;function ut(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Yo(){return++zh}var lt=mn.prototype;ut.prototype={constructor:ut,select:ph,selectAll:dh,selectChild:lt.selectChild,selectChildren:lt.selectChildren,filter:ah,merge:sh,selection:_h,transition:kh,call:lt.call,nodes:lt.nodes,node:lt.node,size:lt.size,empty:lt.empty,each:lt.each,on:ch,attr:Hf,attrTween:Kf,style:bh,styleTween:$h,text:Th,textTween:Eh,remove:hh,tween:jf,delay:Jf,duration:nh,ease:rh,easeVarying:oh,end:Oh,[Symbol.iterator]:lt[Symbol.iterator]};function Ch(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ih={time:null,delay:0,duration:250,ease:Ch};function Rh(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function jh(t){var n,e;t instanceof ut?(n=t._id,t=t._name):(n=Yo(),(e=Ih).time=pe(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&_e(l,t,n,u,a,e||Rh(l,n));return new ut(r,this._parents,t,n)}mn.prototype.interrupt=Cf,mn.prototype.transition=jh;const Ir=Math.PI,Rr=2*Ir,Ot=1e-6,Lh=Rr-Ot;function Vo(t){this._+=t[0];for(let n=1,e=t.length;n<e;++n)this._+=arguments[n]+t[n]}function Fh(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return Vo;const e=10**n;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*e)/e+r[i]}}class Dh{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?Vo:Fh(n)}moveTo(n,e){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,e){this._append`L${this._x1=+n},${this._y1=+e}`}quadraticCurveTo(n,e,r,i){this._append`Q${+n},${+e},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(n,e,r,i,o,a){this._append`C${+n},${+e},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(n,e,r,i,o){if(n=+n,e=+e,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-n,u=i-e,c=a-n,h=s-e,f=c*c+h*h;if(this._x1===null)this._append`M${this._x1=n},${this._y1=e}`;else if(f>Ot)if(!(Math.abs(h*l-u*c)>Ot)||!o)this._append`L${this._x1=n},${this._y1=e}`;else{let p=r-a,g=i-s,_=l*l+u*u,w=p*p+g*g,b=Math.sqrt(_),d=Math.sqrt(f),M=o*Math.tan((Ir-Math.acos((_+f-w)/(2*b*d)))/2),y=M/d,m=M/b;Math.abs(y-1)>Ot&&this._append`L${n+y*c},${e+y*h}`,this._append`A${o},${o},0,0,${+(h*p>c*g)},${this._x1=n+m*l},${this._y1=e+m*u}`}}arc(n,e,r,i,o,a){if(n=+n,e=+e,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),u=n+s,c=e+l,h=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Ot||Math.abs(this._y1-c)>Ot)&&this._append`L${u},${c}`,r&&(f<0&&(f=f%Rr+Rr),f>Lh?this._append`A${r},${r},0,1,${h},${n-s},${e-l}A${r},${r},0,1,${h},${this._x1=u},${this._y1=c}`:f>Ot&&this._append`A${r},${r},0,${+(f>=Ir)},${h},${this._x1=n+r*Math.cos(o)},${this._y1=e+r*Math.sin(o)}`)}rect(n,e,r,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+e}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function qh(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ye(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function nn(t){return t=ye(Math.abs(t)),t?t[1]:NaN}function Bh(t,n){return function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}}function Xh(t){return function(n){return n.replace(/[0-9]/g,function(e){return t[+e]})}}var Hh=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ve(t){if(!(n=Hh.exec(t)))throw new Error("invalid format: "+t);var n;return new jr({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}ve.prototype=jr.prototype;function jr(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+""}jr.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 Uh(t){t:for(var n=t.length,e=1,r=-1,i;e<n;++e)switch(t[e]){case".":r=i=e;break;case"0":r===0&&(r=e),i=e;break;default:if(!+t[e])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Ko;function Gh(t,n){var e=ye(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Ko=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ye(t,Math.max(0,n+o-1))[0]}function Zo(t,n){var e=ye(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Wo={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:qh,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>Zo(t*100,n),r:Zo,s:Gh,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Jo(t){return t}var Qo=Array.prototype.map,ta=["y","z","a","