UNPKG

@signalk/calibration

Version:

Signal K Node Server plugin to alter incoming data based a set of calibration values

2 lines 284 kB
/*! For license information please see 150.js.LICENSE.txt */ (self.webpackChunk_signalk_calibration=self.webpackChunk_signalk_calibration||[]).push([[150],{735:(e,t,n)=>{"use strict";function r(e,t){let n,r;if(void 0===t)for(const t of e)null!=t&&(void 0===n?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let o=-1;for(let i of e)null!=(i=t(i,++o,e))&&(void 0===n?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)))}return[n,r]}n.d(t,{l78:()=>v,V4s:()=>y,Xxv:()=>r,n8j:()=>_r,m4Y:()=>fr,Ltv:()=>dr});var o=Array.prototype.slice;function i(e){return e}var a=1,l=2,s=3,u=4,c=1e-6;function f(e){return"translate("+e+",0)"}function d(e){return"translate(0,"+e+")"}function p(e){return t=>+e(t)}function h(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function m(){return!this.__axis}function g(e,t){var n=[],r=null,g=null,v=6,y=6,b=3,w="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,x=e===a||e===u?-1:1,k=e===u||e===l?"x":"y",E=e===a||e===s?f:d;function T(o){var f=null==r?t.ticks?t.ticks.apply(t,n):t.domain():r,d=null==g?t.tickFormat?t.tickFormat.apply(t,n):i:g,T=Math.max(v,0)+b,_=t.range(),N=+_[0]+w,O=+_[_.length-1]+w,M=(t.bandwidth?h:p)(t.copy(),w),C=o.selection?o.selection():o,S=C.selectAll(".domain").data([null]),P=C.selectAll(".tick").data(f,t).order(),j=P.exit(),I=P.enter().append("g").attr("class","tick"),R=P.select("line"),A=P.select("text");S=S.merge(S.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),P=P.merge(I),R=R.merge(I.append("line").attr("stroke","currentColor").attr(k+"2",x*v)),A=A.merge(I.append("text").attr("fill","currentColor").attr(k,x*T).attr("dy",e===a?"0em":e===s?"0.71em":"0.32em")),o!==C&&(S=S.transition(o),P=P.transition(o),R=R.transition(o),A=A.transition(o),j=j.transition(o).attr("opacity",c).attr("transform",(function(e){return isFinite(e=M(e))?E(e+w):this.getAttribute("transform")})),I.attr("opacity",c).attr("transform",(function(e){var t=this.parentNode.__axis;return E((t&&isFinite(t=t(e))?t:M(e))+w)}))),j.remove(),S.attr("d",e===u||e===l?y?"M"+x*y+","+N+"H"+w+"V"+O+"H"+x*y:"M"+w+","+N+"V"+O:y?"M"+N+","+x*y+"V"+w+"H"+O+"V"+x*y:"M"+N+","+w+"H"+O),P.attr("opacity",1).attr("transform",(function(e){return E(M(e)+w)})),R.attr(k+"2",x*v),A.attr(k,x*T).text(d),C.filter(m).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===l?"start":e===u?"end":"middle"),C.each((function(){this.__axis=M}))}return T.scale=function(e){return arguments.length?(t=e,T):t},T.ticks=function(){return n=o.call(arguments),T},T.tickArguments=function(e){return arguments.length?(n=null==e?[]:o.call(e),T):n.slice()},T.tickValues=function(e){return arguments.length?(r=null==e?null:o.call(e),T):r&&r.slice()},T.tickFormat=function(e){return arguments.length?(g=e,T):g},T.tickSize=function(e){return arguments.length?(v=y=+e,T):v},T.tickSizeInner=function(e){return arguments.length?(v=+e,T):v},T.tickSizeOuter=function(e){return arguments.length?(y=+e,T):y},T.tickPadding=function(e){return arguments.length?(b=+e,T):b},T.offset=function(e){return arguments.length?(w=+e,T):w},T}function v(e){return g(s,e)}function y(e){return g(u,e)}function b(){}function w(e){return null==e?b:function(){return this.querySelector(e)}}function x(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function k(){return[]}function E(e){return null==e?k:function(){return this.querySelectorAll(e)}}function T(e){return function(){return this.matches(e)}}function _(e){return function(t){return t.matches(e)}}var N=Array.prototype.find;function O(){return this.firstElementChild}var M=Array.prototype.filter;function C(){return this.children}function S(e){return new Array(e.length)}function P(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function j(e,t,n,r,o,i){for(var a,l=0,s=t.length,u=i.length;l<u;++l)(a=t[l])?(a.__data__=i[l],r[l]=a):n[l]=new P(e,i[l]);for(;l<s;++l)(a=t[l])&&(o[l]=a)}function I(e,t,n,r,o,i,a){var l,s,u,c=new Map,f=t.length,d=i.length,p=new Array(f);for(l=0;l<f;++l)(s=t[l])&&(p[l]=u=a.call(s,s.__data__,l,t)+"",c.has(u)?o[l]=s:c.set(u,s));for(l=0;l<d;++l)u=a.call(e,i[l],l,i)+"",(s=c.get(u))?(r[l]=s,s.__data__=i[l],c.delete(u)):n[l]=new P(e,i[l]);for(l=0;l<f;++l)(s=t[l])&&c.get(p[l])===s&&(o[l]=s)}function R(e){return e.__data__}function A(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}P.prototype={constructor:P,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var D="http://www.w3.org/1999/xhtml";const z={svg:"http://www.w3.org/2000/svg",xhtml:D,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function L(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),z.hasOwnProperty(t)?{space:z[t],local:e}:e}function F(e){return function(){this.removeAttribute(e)}}function U(e){return function(){this.removeAttributeNS(e.space,e.local)}}function H(e,t){return function(){this.setAttribute(e,t)}}function W(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function q(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function B(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function V(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Q(e){return function(){this.style.removeProperty(e)}}function X(e,t,n){return function(){this.style.setProperty(e,t,n)}}function K(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function $(e,t){return e.style.getPropertyValue(t)||V(e).getComputedStyle(e,null).getPropertyValue(t)}function Y(e){return function(){delete this[e]}}function G(e,t){return function(){this[e]=t}}function Z(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function J(e){return e.trim().split(/^|\s+/)}function ee(e){return e.classList||new te(e)}function te(e){this._node=e,this._names=J(e.getAttribute("class")||"")}function ne(e,t){for(var n=ee(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function re(e,t){for(var n=ee(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function oe(e){return function(){ne(this,e)}}function ie(e){return function(){re(this,e)}}function ae(e,t){return function(){(t.apply(this,arguments)?ne:re)(this,e)}}function le(){this.textContent=""}function se(e){return function(){this.textContent=e}}function ue(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function ce(){this.innerHTML=""}function fe(e){return function(){this.innerHTML=e}}function de(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function pe(){this.nextSibling&&this.parentNode.appendChild(this)}function he(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function me(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===D&&t.documentElement.namespaceURI===D?t.createElement(e):t.createElementNS(n,e)}}function ge(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ve(e){var t=L(e);return(t.local?ge:me)(t)}function ye(){return null}function be(){var e=this.parentNode;e&&e.removeChild(this)}function we(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function xe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ke(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Ee(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,l=o.length;a<l;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function Te(e,t,n){var r=V(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function _e(e,t){return function(){return Te(this,e,t)}}function Ne(e,t){return function(){return Te(this,e,t.apply(this,arguments))}}te.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var Oe=[null];function Me(e,t){this._groups=e,this._parents=t}function Ce(){return new Me([[document.documentElement]],Oe)}Me.prototype=Ce.prototype={constructor:Me,select:function(e){"function"!=typeof e&&(e=w(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,l=t[o],s=l.length,u=r[o]=new Array(s),c=0;c<s;++c)(i=l[c])&&(a=e.call(i,i.__data__,c,l))&&("__data__"in i&&(a.__data__=i.__data__),u[c]=a);return new Me(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);return null==t?[]:x(t)}}(e):E(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,l=t[i],s=l.length,u=0;u<s;++u)(a=l[u])&&(r.push(e.call(a,a.__data__,u,l)),o.push(a));return new Me(r,o)},selectChild:function(e){return this.select(null==e?O:function(e){return function(){return N.call(this.children,e)}}("function"==typeof e?e:_(e)))},selectChildren:function(e){return this.selectAll(null==e?C:function(e){return function(){return M.call(this.children,e)}}("function"==typeof e?e:_(e)))},filter:function(e){"function"!=typeof e&&(e=T(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new Me(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,R);var n,r=t?I:j,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,l=new Array(a),s=new Array(a),u=new Array(a),c=0;c<a;++c){var f=o[c],d=i[c],p=d.length,h=x(e.call(f,f&&f.__data__,c,o)),m=h.length,g=s[c]=new Array(m),v=l[c]=new Array(m);r(f,d,g,v,u[c]=new Array(p),h,t);for(var y,b,w=0,k=0;w<m;++w)if(y=g[w]){for(w>=k&&(k=w+1);!(b=v[k])&&++k<m;);y._next=b||null}}return(l=new Me(l,o))._enter=s,l._exit=u,l},enter:function(){return new Me(this._enter||this._groups.map(S),this._parents)},exit:function(){return new Me(this._exit||this._groups.map(S),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof e?e(r):r.append(e+""),null!=t&&(o=t(o)),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){if(!(e instanceof Me))throw new Error("invalid merge");for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),l=0;l<i;++l)for(var s,u=t[l],c=n[l],f=u.length,d=a[l]=new Array(f),p=0;p<f;++p)(s=u[p]||c[p])&&(d[p]=s);for(;l<r;++l)a[l]=t[l];return new Me(a,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=A);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,l=n[i],s=l.length,u=o[i]=new Array(s),c=0;c<s;++c)(a=l[c])&&(u[c]=a);u.sort(t)}return new Me(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,l=i.length;a<l;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=L(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?U:F:"function"==typeof t?n.local?B:q:n.local?W:H)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Q:"function"==typeof t?K:X)(e,t,null==n?"":n)):$(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?Y:"function"==typeof t?Z:G)(e,t)):this.node()[e]},classed:function(e,t){var n=J(e+"");if(arguments.length<2){for(var r=ee(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?ae:t?oe:ie)(n,t))},text:function(e){return arguments.length?this.each(null==e?le:("function"==typeof e?ue:se)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ce:("function"==typeof e?de:fe)(e)):this.node().innerHTML},raise:function(){return this.each(pe)},lower:function(){return this.each(he)},append:function(e){var t="function"==typeof e?e:ve(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:ve(e),r=null==t?ye:"function"==typeof t?t:w(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(be)},clone:function(e){return this.select(e?xe:we)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),a=i.length;if(!(arguments.length<2)){for(l=t?Ee:ke,r=0;r<a;++r)this.each(l(i[r],t,n));return this}var l=this.node().__on;if(l)for(var s,u=0,c=l.length;u<c;++u)for(r=0,s=l[u];r<a;++r)if((o=i[r]).type===s.type&&o.name===s.name)return s.value},dispatch:function(e,t){return this.each(("function"==typeof t?Ne:_e)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const Se=Ce;var Pe={value:()=>{}};function je(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new Ie(r)}function Ie(e){this._=e}function Re(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Ae(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Pe,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}Ie.prototype=je.prototype={constructor:Ie,on:function(e,t){var n,r,o=this._,i=(r=o,(e+"").trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),a=-1,l=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<l;)if(n=(e=i[a]).type)o[n]=Ae(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Ae(o[n],e.name,null);return this}for(;++a<l;)if((n=(e=i[a]).type)&&(n=Re(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ie(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};const De=je;var ze,Le,Fe=0,Ue=0,He=0,We=0,qe=0,Be=0,Ve="object"==typeof performance&&performance.now?performance:Date,Qe="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xe(){return qe||(Qe(Ke),qe=Ve.now()+Be)}function Ke(){qe=0}function $e(){this._call=this._time=this._next=null}function Ye(e,t,n){var r=new $e;return r.restart(e,t,n),r}function Ge(){qe=(We=Ve.now())+Be,Fe=Ue=0;try{!function(){Xe(),++Fe;for(var e,t=ze;t;)(e=qe-t._time)>=0&&t._call.call(null,e),t=t._next;--Fe}()}finally{Fe=0,function(){for(var e,t,n=ze,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ze=t);Le=e,Je(r)}(),qe=0}}function Ze(){var e=Ve.now(),t=e-We;t>1e3&&(Be-=t,We=e)}function Je(e){Fe||(Ue&&(Ue=clearTimeout(Ue)),e-qe>24?(e<1/0&&(Ue=setTimeout(Ge,e-Ve.now()-Be)),He&&(He=clearInterval(He))):(He||(We=Ve.now(),He=setInterval(Ze,1e3)),Fe=1,Qe(Ge)))}function et(e,t,n){var r=new $e;return t=null==t?0:+t,r.restart((n=>{r.stop(),e(n+t)}),t,n),r}$e.prototype=Ye.prototype={constructor:$e,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Xe():+n)+(null==t?0:+t),this._next||Le===this||(Le?Le._next=this:ze=this,Le=this),this._call=e,this._time=n,Je()},stop:function(){this._call&&(this._call=null,this._time=1/0,Je())}};var tt=De("start","end","cancel","interrupt"),nt=[];function rt(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(s){var u,c,f,d;if(1!==n.state)return l();for(u in o)if((d=o[u]).name===n.name){if(3===d.state)return et(i);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",e,e.__data__,d.index,d.group),delete o[u]):+u<t&&(d.state=6,d.timer.stop(),d.on.call("cancel",e,e.__data__,d.index,d.group),delete o[u])}if(et((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(f=n.tween.length),u=0,c=-1;u<f;++u)(d=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=d);r.length=c+1}}function a(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Ye((function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}),0,n.time)}(e,n,{name:t,index:r,group:o,on:tt,tween:nt,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function ot(e,t){var n=at(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function it(e,t){var n=at(e,t);if(n.state>3)throw new Error("too late; already running");return n}function at(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var st,ut=180/Math.PI,ct={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ft(e,t,n,r,o,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*r)&&(n-=e*s,r-=t*s),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,s/=l),e*r<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*ut,skewX:Math.atan(s)*ut,scaleX:a,scaleY:l}}function dt(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var l=[],s=[];return i=e(i),a=e(a),function(e,r,o,i,a,l){if(e!==o||r!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:lt(e,o)},{i:s-2,x:lt(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,l,s),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:lt(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,l,s),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:lt(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,l,s),function(e,t,n,r,i,a){if(e!==n||t!==r){var l=i.push(o(i)+"scale(",null,",",null,")");a.push({i:l-4,x:lt(e,n)},{i:l-2,x:lt(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,l,s),i=a=null,function(e){for(var t,n=-1,r=s.length;++n<r;)l[(t=s[n]).i]=t.x(e);return l.join("")}}}var pt=dt((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ct:ft(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),ht=dt((function(e){return null==e?ct:(st||(st=document.createElementNS("http://www.w3.org/2000/svg","g")),st.setAttribute("transform",e),(e=st.transform.baseVal.consolidate())?ft((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ct)}),", ",")",")");function mt(e,t){var n,r;return function(){var o=it(this,e),i=o.tween;if(i!==n)for(var a=0,l=(r=n=i).length;a<l;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function gt(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=it(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var l={name:t,value:n},s=0,u=o.length;s<u;++s)if(o[s].name===t){o[s]=l;break}s===u&&o.push(l)}i.tween=o}}function vt(e,t,n){var r=e._id;return e.each((function(){var e=it(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return at(e,r).value[t]}}function yt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wt(){}var xt=.7,kt=1/xt,Et="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nt=/^#([0-9a-f]{3,8})$/,Ot=new RegExp("^rgb\\("+[Et,Et,Et]+"\\)$"),Mt=new RegExp("^rgb\\("+[_t,_t,_t]+"\\)$"),Ct=new RegExp("^rgba\\("+[Et,Et,Et,Tt]+"\\)$"),St=new RegExp("^rgba\\("+[_t,_t,_t,Tt]+"\\)$"),Pt=new RegExp("^hsl\\("+[Tt,_t,_t]+"\\)$"),jt=new RegExp("^hsla\\("+[Tt,_t,_t,Tt]+"\\)$"),It={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Rt(){return this.rgb().formatHex()}function At(){return this.rgb().formatRgb()}function Dt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Nt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?zt(t):3===n?new Ut(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Lt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Ot.exec(e))?new Ut(t[1],t[2],t[3],1):(t=Mt.exec(e))?new Ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ct.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=St.exec(e))?Lt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Pt.exec(e))?Bt(t[1],t[2]/100,t[3]/100,1):(t=jt.exec(e))?Bt(t[1],t[2]/100,t[3]/100,t[4]):It.hasOwnProperty(e)?zt(It[e]):"transparent"===e?new Ut(NaN,NaN,NaN,0):null}function zt(e){return new Ut(e>>16&255,e>>8&255,255&e,1)}function Lt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ut(e,t,n,r)}function Ft(e,t,n,r){return 1===arguments.length?((o=e)instanceof wt||(o=Dt(o)),o?new Ut((o=o.rgb()).r,o.g,o.b,o.opacity):new Ut):new Ut(e,t,n,null==r?1:r);var o}function Ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ht(){return"#"+qt(this.r)+qt(this.g)+qt(this.b)}function Wt(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function qt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Bt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qt(e,t,n,r)}function Vt(e){if(e instanceof Qt)return new Qt(e.h,e.s,e.l,e.opacity);if(e instanceof wt||(e=Dt(e)),!e)return new Qt;if(e instanceof Qt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(n-r)/l+6*(n<r):n===i?(r-t)/l+2:(t-n)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new Qt(a,l,s,e.opacity)}function Qt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Xt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Kt(e,t,n,r,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*r+a*o)/6}yt(wt,Dt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Rt,formatHex:Rt,formatHsl:function(){return Vt(this).formatHsl()},formatRgb:At,toString:At}),yt(Ut,Ft,bt(wt,{brighter:function(e){return e=null==e?kt:Math.pow(kt,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?xt:Math.pow(xt,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Ht,formatHex:Ht,formatRgb:Wt,toString:Wt})),yt(Qt,(function(e,t,n,r){return 1===arguments.length?Vt(e):new Qt(e,t,n,null==r?1:r)}),bt(wt,{brighter:function(e){return e=null==e?kt:Math.pow(kt,e),new Qt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?xt:Math.pow(xt,e),new Qt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Ut(Xt(e>=240?e-240:e+120,o,r),Xt(e,o,r),Xt(e<120?e+240:e-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));const $t=e=>()=>e;function Yt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):$t(isNaN(e)?t:e)}const Gt=function e(t){var n=function(e){return 1==(e=+e)?Yt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):$t(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ft(e)).r,(t=Ft(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=Yt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Zt(e){return function(t){var n,r,o=t.length,i=new Array(o),a=new Array(o),l=new Array(o);for(n=0;n<o;++n)r=Ft(t[n]),i[n]=r.r||0,a[n]=r.g||0,l[n]=r.b||0;return i=e(i),a=e(a),l=e(l),r.opacity=1,function(e){return r.r=i(e),r.g=a(e),r.b=l(e),r+""}}}Zt((function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],a=r>0?e[r-1]:2*o-i,l=r<t-1?e[r+2]:2*i-o;return Kt((n-r/t)*t,a,o,i,l)}})),Zt((function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),o=e[(r+t-1)%t],i=e[r%t],a=e[(r+1)%t],l=e[(r+2)%t];return Kt((n-r/t)*t,o,i,a,l)}}));var Jt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,en=new RegExp(Jt.source,"g");function tn(e,t){var n,r,o,i=Jt.lastIndex=en.lastIndex=0,a=-1,l=[],s=[];for(e+="",t+="";(n=Jt.exec(e))&&(r=en.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),l[a]?l[a]+=o:l[++a]=o),(n=n[0])===(r=r[0])?l[a]?l[a]+=r:l[++a]=r:(l[++a]=null,s.push({i:a,x:lt(n,r)})),i=en.lastIndex;return i<t.length&&(o=t.slice(i),l[a]?l[a]+=o:l[++a]=o),l.length<2?s[0]?function(e){return function(t){return e(t)+""}}(s[0].x):function(e){return function(){return e}}(t):(t=s.length,function(e){for(var n,r=0;r<t;++r)l[(n=s[r]).i]=n.x(e);return l.join("")})}function nn(e,t){var n;return("number"==typeof t?lt:t instanceof Dt?Gt:(n=Dt(t))?(t=n,Gt):tn)(e,t)}function rn(e){return function(){this.removeAttribute(e)}}function on(e){return function(){this.removeAttributeNS(e.space,e.local)}}function an(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function ln(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function sn(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttribute(e))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttribute(e)}}function un(e,t,n){var r,o,i;return function(){var a,l,s=n(this);if(null!=s)return(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===r&&l===o?i:(o=l,i=t(r=a,s));this.removeAttributeNS(e.space,e.local)}}function cn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function fn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function dn(e,t){return function(){ot(this,e).delay=+t.apply(this,arguments)}}function pn(e,t){return t=+t,function(){ot(this,e).delay=t}}function hn(e,t){return function(){it(this,e).duration=+t.apply(this,arguments)}}function mn(e,t){return t=+t,function(){it(this,e).duration=t}}var gn=Se.prototype.constructor;function vn(e){return function(){this.style.removeProperty(e)}}var yn=0;function bn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function wn(){return++yn}var xn=Se.prototype;bn.prototype=function(e){return Se().transition(e)}.prototype={constructor:bn,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=w(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var l,s,u=r[a],c=u.length,f=i[a]=new Array(c),d=0;d<c;++d)(l=u[d])&&(s=e.call(l,l.__data__,d,u))&&("__data__"in l&&(s.__data__=l.__data__),f[d]=s,rt(f[d],t,n,d,f,at(l,n)));return new bn(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=E(e));for(var r=this._groups,o=r.length,i=[],a=[],l=0;l<o;++l)for(var s,u=r[l],c=u.length,f=0;f<c;++f)if(s=u[f]){for(var d,p=e.call(s,s.__data__,f,u),h=at(s,n),m=0,g=p.length;m<g;++m)(d=p[m])&&rt(d,t,n,m,p,h);i.push(p),a.push(s)}return new bn(i,a,t,n)},filter:function(e){"function"!=typeof e&&(e=T(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],l=a.length,s=r[o]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new bn(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),l=0;l<i;++l)for(var s,u=t[l],c=n[l],f=u.length,d=a[l]=new Array(f),p=0;p<f;++p)(s=u[p]||c[p])&&(d[p]=s);for(;l<r;++l)a[l]=t[l];return new bn(a,this._parents,this._name,this._id)},selection:function(){return new gn(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=wn(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)if(a=l[u]){var c=at(a,t);rt(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new bn(r,this._parents,e,n)},call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:function(e,t){var n=this._id;return arguments.length<2?at(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?ot:it;return function(){var a=i(this,e),l=a.on;l!==r&&(o=(r=l).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=L(e),r="transform"===n?ht:nn;return this.attrTween(e,"function"==typeof t?(n.local?un:sn)(n,r,vt(this,"attr."+e,t)):null==t?(n.local?on:rn)(n):(n.local?ln:an)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=L(e);return this.tween(n,(r.local?cn:fn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?pt:nn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=$(this,e),a=(this.style.removeProperty(e),$(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,vn(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=$(this,e),l=n(this),s=l+"";return null==l&&(this.style.removeProperty(e),s=l=$(this,e)),a===s?null:a===r&&s===o?i:(o=s,i=t(r=a,l))}}(e,r,vt(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,l="end."+a;return function(){var s=it(this,e),u=s.on,c=null==s.value[a]?i||(i=vn(t)):void 0;u===n&&o===c||(r=(n=u).copy()).on(l,o=c),s.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=$(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(vt(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=at(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?mt:gt)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?dn:pn)(t,e)):at(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?hn:mn)(t,e)):at(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){it(this,e).ease=t}}(t,e)):at(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;it(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise((function(i,a){var l={value:a},s={value:function(){0==--o&&i()}};n.each((function(){var n=it(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t})),0===o&&i()}))},[Symbol.iterator]:xn[Symbol.iterator]};var kn={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function En(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}Se.prototype.interrupt=function(e){return this.each((function(){!function(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}(this,e)}))},Se.prototype.transition=function(e){var t,n;e instanceof bn?(t=e._id,e=e._name):(t=wn(),(n=kn).time=Xe(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,l=r[i],s=l.length,u=0;u<s;++u)(a=l[u])&&rt(a,e,t,u,l,n||En(a,t));return new bn(r,this._parents,e,t)};const{abs:Tn,max:_n,min:Nn}=Math;function On(e){return{type:e}}["w","e"].map(On),["n","s"].map(On),["n","w","e","s","nw","ne","sw","se"].map(On);var Mn=Math.sqrt(50),Cn=Math.sqrt(10),Sn=Math.sqrt(2);function Pn(e,t,n){var r=(t-e)/Math.max(0,n),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=Mn?10:i>=Cn?5:i>=Sn?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=Mn?10:i>=Cn?5:i>=Sn?2:1)}function jn(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function In(e){let t=e,n=e;function r(e,t,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){const i=r+o>>>1;n(e[i],t)<0?r=i+1:o=i}return r}return 1===e.length&&(t=(t,n)=>e(t)-n,n=function(e){return(t,n)=>jn(e(t),n)}(e)),{left:r,center:function(e,n,o,i){null==o&&(o=0),null==i&&(i=e.length);const a=r(e,n,o,i-1);return a>o&&t(e[a-1],n)>-t(e[a],n)?a-1:a},right:function(e,t,r,o){for(null==r&&(r=0),null==o&&(o=e.length);r<o;){const i=r+o>>>1;n(e[i],t)>0?o=i:r=i+1}return r}}}const Rn=In(jn),An=Rn.right,Dn=(Rn.left,In((function(e){return null===e?NaN:+e})).center,An);function zn(e,t){var n,r=t?t.length:0,o=e?Math.min(r,e.length):0,i=new Array(o),a=new Array(r);for(n=0;n<o;++n)i[n]=Hn(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=i[n](e);return a}}function Ln(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Fn(e,t){var n,r={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Hn(e[n],t[n]):o[n]=t[n];return function(e){for(n in r)o[n]=r[n](e);return o}}function Un(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(n=0;n<r;++n)o[n]=e[n]*(1-i)+t[n]*i;return o}}function Hn(e,t){var n,r,o=typeof t;return null==t||"boolean"===o?$t(t):("number"===o?lt:"string"===o?(n=Dt(t))?(t=n,Gt):tn:t instanceof Dt?Gt:t instanceof Date?Ln:(r=t,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(t)?zn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Fn:lt:Un))(e,t)}function Wn(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function qn(e){return+e}var Bn=[0,1];function Vn(e){return e}function Qn(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function Xn(e,t,n){var r=e[0],o=e[1],i=t[0],a=t[1];return o<r?(r=Qn(o,r),i=n(a,i)):(r=Qn(r,o),i=n(i,a)),function(e){return i(r(e))}}function Kn(e,t,n){var r=Math.min(e.length,t.length)-1,o=new Array(r),i=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)o[a]=Qn(e[a],e[a+1]),i[a]=n(t[a],t[a+1]);return function(t){var n=Dn(e,t,1,r)-1;return i[n](o[n](t))}}function $n(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Yn,Gn=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zn(e){if(!(t=Gn.exec(e)))throw new Error("invalid format: "+e);var t;return new Jn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function Jn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function er(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function tr(e){return(e=er(Math.abs(e)))?e[1]:NaN}function nr(e,t){var n=er(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Zn.prototype=Jn.prototype,Jn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const rr={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>nr(100*e,t),r:nr,s:function(e,t){var n=er(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(Yn=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+er(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function or(e){return e}var ir,ar,lr,sr=Array.prototype.map,ur=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cr(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,o,i,a,l=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(o=e,e=t,t=o),0===(a=Pn(e,t,n))||!isFinite(a))return[];if(a>0){let n=Math.round(e/a),r=Math.round(t/a);for(n*a<e&&++n,r*a>t&&--r,i=new Array(o=r-n+1);++l<o;)i[l]=(n+l)*a}else{a=-a;let n=Math.round(e*a),r=Math.round(t*a);for(n/a<e&&++n,r/a>t&&--r,i=new Array(o=r-n+1);++l<o;)i[l]=(n+l)/a}return r&&i.reverse(),i}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var o,i=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=Mn?o*=10:i>=Cn?o*=5:i>=Sn&&(o*=2),t<e?-o:o}(e,t,n);switch((r=Zn(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(tr(t)/3)))-tr(Math.abs(e)))}(i,a))||(r.precision=o),lr(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,tr(t)-tr(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=function(e){return Math.max(0,-tr(Math.abs(e)))}(i))||(r.precision=o-2*("%"===r.type))}return ar(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,o,i=t(),a=0,l=i.length-1,s=i[a],u=i[l],c=10;for(u<s&&(o=s,s=u,u=o,o=a,a=l,l=o);c-- >0;){if((o=Pn(s,u,n))===r)return i[a]=s,i[l]=u,t(i);if(o>0)s=Math.floor(s/o)*o,u=Math.ceil(u/o)*o;else{if(!(o<0))break;s=Math.ceil(s*o)/o,u=Math.floor(u*o)/o}r=o}return e},e}function fr(){var e=function(){var e,t,n,r,o,i,a=Bn,l=Bn,s=Hn,u=Vn;function c(){var e,t,n,s=Math.min(a.length,l.length);return u!==Vn&&(e=a[0],t=a[s-1],e>t&&(n=e,e=t,t=n),u=function(n){return Math.max(e,Math.min(t,n))}),r=s>2?Kn:Xn,o=i=null,f}function f(t){return null==t||isNaN(t=+t)?n:(o||(o=r(a.map(e),l,s)))(e(u(t)))}return f.invert=function(n){return u(t((i||(i=r(l,a.map(e),lt)))(n)))},f.domain=function(e){return arguments.length?(a=Array.from(e,qn),c()):a.slice()},f.range=function(e){return arguments.length?(l=Array.from(e),c()):l.slice()},f.rangeRound=function(e){return l=Array.from(e),s=Wn,c()},f.clamp=function(e){return arguments.length?(u=!!e||Vn,c()):u!==Vn},f.interpolate=function(e){return arguments.length?(s=e,c()):s},f.unknown=function(e){return arguments.length?(n=e,f):n},function(n,r){return e=n,t=r,c()}}()(Vn,Vn);return e.copy=function(){return t=e,fr().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},$n.apply(e,arguments),cr(e)}function dr(e){return"string"==typeof e?new Me([[document.querySelector(e)]],[document.documentElement]):new Me([[e]],Oe)}ir=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?or:(t=sr.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var o=e.length,i=[],a=0,l=t[0],s=0;o>0&&l>0&&(s+l+1>r&&(l=Math.max(1,r-s)),i.push(e.substring(o-=l,o+l)),!((s+=l+1)>r));)l=t[a=(a+1)%t.length];return i.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",l=void 0===e.numerals?or:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(sr.call(e.numerals,String)),s=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=Zn(e)).fill,n=e.align,f=e.sign,d=e.symbol,p=e.zero,h=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):rr[y]||(void 0===g&&(g=12),v=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===d?o:"#"===d&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===d?i:/[%p]/.test(y)?s:"",x=rr[y],k=/[defgprs%]/.test(y);function E(e){var o,i,s,d=b,E=w;if("c"===y)E=x(e)+E,e="";else{var T=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),g),v&&(e=function(e){e:for(var t,n=e.length,r=1,o=-1;r<n;++r)switch(e[r]){case".":o=t=r;break;case"0":0===o&&(o=r),t=r;break;default:if(!+e[r])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==f&&(T=!1),d=(T?"("===f?f:u:"-"===f||"("===f?"":f)+d,E=("s"===y?ur[8+Yn/3]:"")+E+(T&&"("===f?")":""),k)for(o=-1,i=e.length;++o<i;)if(48>(s=e.charCodeAt(o))||s>57){E=(46===s?a+e.slice(o+1):e.slice(o))+E,e=e.slice(0,o);break}}m&&!p&&(e=r(e,1/0));var _=d.length+e.length+E.length,N=_<h?new Array(h-_+1).join(t):"";switch(m&&p&&(e=r(N+e,N.length?h-E.length:1/0),N=""),n){case"<":e=d+e+E+N;break;case"=":e=d+N+e+E;break;case"^":e=N.slice(0,_=N.length>>1)+d+e+E+N.slice(_);break;default:e=N+d+e+E}return l(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),E.toString=function(){return e+""},E}return{format:f,formatPrefix:function(e,t){var n=f(((e=Zn(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(tr(t)/3))),o=Math.pow(10,-r),i=ur[8+r/3];return function(e){return n(o*e)+i}}}}({thousands:",",grouping:[3],currency:["$",""]}),ar=ir.format,lr=ir.formatPrefix;const pr=Math.PI,hr=2*pr,mr=1e-6,gr=hr-mr;function vr(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function yr(){return new vr}vr.prototype=yr.prototype={constructor:vr,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,o,i){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,n,r,o){e=+e,t=+t,n=+n,r=+r,o=+o;var i=this._x1,a=this._y1,l=n-e,s=r-t,u=i-e,c=a-t,f=u*u+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);els