@orbcharts/core 3.0.0-alpha.28 → 3.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orbcharts-core.es.js +1050 -1044
- package/dist/orbcharts-core.umd.js +2 -2
- package/dist/src/defaults.d.ts +2 -3
- package/dist/src/grid/computeGridData.d.ts +3 -0
- package/dist/src/types/ComputedData.d.ts +1 -1
- package/dist/src/types/ComputedDataGrid.d.ts +2 -0
- package/dist/src/types/Data.d.ts +1 -1
- package/dist/src/types/DataFormatter.d.ts +0 -2
- package/dist/src/types/DataFormatterGrid.d.ts +2 -4
- package/dist/src/types/DataFormatterMultiGrid.d.ts +2 -1
- package/dist/src/types/DataFormatterMultiValue.d.ts +2 -1
- package/dist/src/types/DataFormatterRelationship.d.ts +2 -1
- package/dist/src/types/DataFormatterSeries.d.ts +2 -3
- package/dist/src/types/DataFormatterTree.d.ts +2 -1
- package/dist/src/utils/orbchartsUtils.d.ts +18 -5
- package/package.json +1 -1
- package/src/base/createBaseChart.ts +12 -2
- package/src/defaults.ts +30 -44
- package/src/grid/computeGridData.ts +31 -23
- package/src/multiGrid/computeMultiGridData.ts +37 -27
- package/src/multiValue/computeMultiValueData.ts +6 -3
- package/src/relationship/computeRelationshipData.ts +4 -2
- package/src/series/computeSeriesData.ts +7 -8
- package/src/tree/computeTreeData.ts +5 -3
- package/src/types/ComputedData.ts +1 -1
- package/src/types/ComputedDataGrid.ts +2 -0
- package/src/types/Data.ts +1 -1
- package/src/types/DataFormatter.ts +0 -4
- package/src/types/DataFormatterGrid.ts +4 -3
- package/src/types/DataFormatterMultiGrid.ts +6 -5
- package/src/types/DataFormatterMultiValue.ts +2 -1
- package/src/types/DataFormatterRelationship.ts +2 -1
- package/src/types/DataFormatterSeries.ts +4 -3
- package/src/types/DataFormatterTree.ts +2 -1
- package/src/utils/orbchartsUtils.ts +64 -11
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(_,Et){typeof exports=="object"&&typeof module<"u"?Et(exports):typeof define=="function"&&define.amd?define(["exports"],Et):(_=typeof globalThis<"u"?globalThis:_||self,Et(_["orbcharts-core"]={}))})(this,function(_){"use strict";const Et={preset:{}},un={top:60,right:60,bottom:60,left:60},sn={padding:un,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#454545",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},ni=800,ri=500,pt={type:"",visibleFilter:(t,e,n,r)=>!0,tooltipContentFormat:(t,e,n,r)=>{if(typeof t=="object"){if(t.tooltipContent)return t.tooltipContent;if(t.value)return String(t.value)}else return typeof t=="number"?String(t):""}},j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},ii={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},oi={...pt,type:"series",unitLabel:"",seriesLabels:[],colorsPredicate:(t,e,n,{chartParams:r})=>e<r.colors[r.colorScheme].series.length?r.colors[r.colorScheme].series[e]:r.colors[r.colorScheme].series[e%r.colors[r.colorScheme].series.length],sort:null},we={...pt,type:"grid",grid:{rowLabels:[],columnLabels:[],seriesType:"row"},valueAxis:{...j},groupAxis:{...ii},colorsPredicate:(t,e,n,{chartParams:r,dataFormatter:i})=>{const o=i.grid.seriesType==="row"?e:n;return r.colors[r.colorScheme].series[o]}},ai={...pt,type:"multiGrid",multiGrid:[{...we},{...we,colorsPredicate:(t,e,n,{chartParams:r,dataFormatter:i})=>{const o=i.grid.seriesType==="row"?e:n,a=r.colors[r.colorScheme].series.length-1-o;return r.colors[r.colorScheme].series[a]}}]},ui={...pt,type:"multiValue",multiValue:[],xAxis:{...j},yAxis:{...j}},si={...pt,type:"tree"},li={...pt,type:"relationship"};function Ht(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ci(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function ln(t){let e,n,r;t.length!==2?(e=Ht,n=(u,s)=>Ht(t(u),s),r=(u,s)=>t(u)-s):(e=t===Ht||t===ci?t:fi,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:a,right:o}}function fi(){return 0}function hi(t){return t===null?NaN:+t}const cn=ln(Ht).right;ln(hi).center;class fn extends Map{constructor(e,n=mi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(hn(this,e))}has(e){return super.has(hn(this,e))}set(e,n){return super.set(di(this,e),n)}delete(e){return super.delete(pi(this,e))}}function hn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function di({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function pi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function mi(t){return t!==null&&typeof t=="object"?t.valueOf():t}const gi=Math.sqrt(50),vi=Math.sqrt(10),yi=Math.sqrt(2);function Ut(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=gi?10:o>=vi?5:o>=yi?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/a,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*a,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Ut(t,e,n*2):[u,s,l]}function wi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Ut(e,t,n):Ut(t,e,n);if(!(o>=i))return[];const u=o-i+1,s=new Array(u);if(r)if(a<0)for(let l=0;l<u;++l)s[l]=(o-l)/-a;else for(let l=0;l<u;++l)s[l]=(o-l)*a;else if(a<0)for(let l=0;l<u;++l)s[l]=(i+l)/-a;else for(let l=0;l<u;++l)s[l]=(i+l)*a;return s}function be(t,e,n){return e=+e,t=+t,n=+n,Ut(t,e,n)[2]}function bi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?be(e,t,n):be(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function xi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}var _i={value:()=>{}};function dn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Xt(n)}function Xt(t){this._=t}function $i(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Xt.prototype=dn.prototype={constructor:Xt,on:function(t,e){var n=this._,r=$i(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=Ai(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=pn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=pn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Xt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[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(e,n)},apply:function(t,e,n){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(e,n)}};function Ai(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function pn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=_i,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var xe="http://www.w3.org/1999/xhtml";const mn={svg:"http://www.w3.org/2000/svg",xhtml:xe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),mn.hasOwnProperty(e)?{space:mn[e],local:t}:t}function Si(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===xe&&e.documentElement.namespaceURI===xe?e.createElement(t):e.createElementNS(n,t)}}function Di(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function gn(t){var e=Yt(t);return(e.local?Di:Si)(e)}function Mi(){}function _e(t){return t==null?Mi:function(){return this.querySelector(t)}}function Ci(t){typeof t!="function"&&(t=_e(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=new Array(a),s,l,f=0;f<a;++f)(s=o[f])&&(l=t.call(s,s.__data__,f,o))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new G(r,this._parents)}function Ei(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Pi(){return[]}function vn(t){return t==null?Pi:function(){return this.querySelectorAll(t)}}function Ti(t){return function(){return Ei(t.apply(this,arguments))}}function Fi(t){typeof t=="function"?t=Ti(t):t=vn(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&(r.push(t.call(s,s.__data__,l,a)),i.push(s));return new G(r,i)}function yn(t){return function(){return this.matches(t)}}function wn(t){return function(e){return e.matches(t)}}var Ni=Array.prototype.find;function ki(t){return function(){return Ni.call(this.children,t)}}function Oi(){return this.firstElementChild}function Ii(t){return this.select(t==null?Oi:ki(typeof t=="function"?t:wn(t)))}var Ri=Array.prototype.filter;function Li(){return Array.from(this.children)}function Vi(t){return function(){return Ri.call(this.children,t)}}function Gi(t){return this.selectAll(t==null?Li:Vi(typeof t=="function"?t:wn(t)))}function zi(t){typeof t!="function"&&(t=yn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new G(r,this._parents)}function bn(t){return new Array(t.length)}function Hi(){return new G(this._enter||this._groups.map(bn),this._parents)}function Wt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Wt.prototype={constructor:Wt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ui(t){return function(){return t}}function Xi(t,e,n,r,i,o){for(var a=0,u,s=e.length,l=o.length;a<l;++a)(u=e[a])?(u.__data__=o[a],r[a]=u):n[a]=new Wt(t,o[a]);for(;a<s;++a)(u=e[a])&&(i[a]=u)}function Yi(t,e,n,r,i,o,a){var u,s,l=new Map,f=e.length,c=o.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=a.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=a.call(t,o[u],u,o)+"",(s=l.get(d))?(r[u]=s,s.__data__=o[u],l.delete(d)):n[u]=new Wt(t,o[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function Wi(t){return t.__data__}function Bi(t,e){if(!arguments.length)return Array.from(this,Wi);var n=e?Yi:Xi,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ui(t));for(var o=i.length,a=new Array(o),u=new Array(o),s=new Array(o),l=0;l<o;++l){var f=r[l],c=i[l],h=c.length,d=qi(t.call(f,f&&f.__data__,l,r)),m=d.length,p=u[l]=new Array(m),g=a[l]=new Array(m),$=s[l]=new Array(h);n(f,c,p,g,$,d,e);for(var D=0,x=0,M,w;D<m;++D)if(M=p[D]){for(D>=x&&(x=D+1);!(w=g[x])&&++x<m;);M._next=w||null}}return a=new G(a,r),a._enter=u,a._exit=s,a}function qi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ji(){return new G(this._exit||this._groups.map(bn),this._parents)}function Ki(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function Zi(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=new Array(i),s=0;s<a;++s)for(var l=n[s],f=r[s],c=l.length,h=u[s]=new Array(c),d,m=0;m<c;++m)(d=l[m]||f[m])&&(h[m]=d);for(;s<i;++s)u[s]=n[s];return new G(u,this._parents)}function Ji(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],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 Qi(t){t||(t=to);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],u=a.length,s=i[o]=new Array(u),l,f=0;f<u;++f)(l=a[f])&&(s[f]=l);s.sort(e)}return new G(i,this._parents).order()}function to(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function eo(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function no(){return Array.from(this)}function ro(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function io(){let t=0;for(const e of this)++t;return t}function oo(){return!this.node()}function ao(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,u;o<a;++o)(u=i[o])&&t.call(u,u.__data__,o,i);return this}function uo(t){return function(){this.removeAttribute(t)}}function so(t){return function(){this.removeAttributeNS(t.space,t.local)}}function lo(t,e){return function(){this.setAttribute(t,e)}}function co(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function fo(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ho(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function po(t,e){var n=Yt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?so:uo:typeof e=="function"?n.local?ho:fo:n.local?co:lo)(n,e))}function xn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function mo(t){return function(){this.style.removeProperty(t)}}function go(t,e,n){return function(){this.style.setProperty(t,e,n)}}function vo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function yo(t,e,n){return arguments.length>1?this.each((e==null?mo:typeof e=="function"?vo:go)(t,e,n??"")):mt(this.node(),t)}function mt(t,e){return t.style.getPropertyValue(e)||xn(t).getComputedStyle(t,null).getPropertyValue(e)}function wo(t){return function(){delete this[t]}}function bo(t,e){return function(){this[t]=e}}function xo(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function _o(t,e){return arguments.length>1?this.each((e==null?wo:typeof e=="function"?xo:bo)(t,e)):this.node()[t]}function _n(t){return t.trim().split(/^|\s+/)}function $e(t){return t.classList||new $n(t)}function $n(t){this._node=t,this._names=_n(t.getAttribute("class")||"")}$n.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function An(t,e){for(var n=$e(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Sn(t,e){for(var n=$e(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function $o(t){return function(){An(this,t)}}function Ao(t){return function(){Sn(this,t)}}function So(t,e){return function(){(e.apply(this,arguments)?An:Sn)(this,t)}}function Do(t,e){var n=_n(t+"");if(arguments.length<2){for(var r=$e(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?So:e?$o:Ao)(n,e))}function Mo(){this.textContent=""}function Co(t){return function(){this.textContent=t}}function Eo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Po(t){return arguments.length?this.each(t==null?Mo:(typeof t=="function"?Eo:Co)(t)):this.node().textContent}function To(){this.innerHTML=""}function Fo(t){return function(){this.innerHTML=t}}function No(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ko(t){return arguments.length?this.each(t==null?To:(typeof t=="function"?No:Fo)(t)):this.node().innerHTML}function Oo(){this.nextSibling&&this.parentNode.appendChild(this)}function Io(){return this.each(Oo)}function Ro(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Lo(){return this.each(Ro)}function Vo(t){var e=typeof t=="function"?t:gn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Go(){return null}function zo(t,e){var n=typeof t=="function"?t:gn(t),r=e==null?Go:typeof e=="function"?e:_e(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Ho(){var t=this.parentNode;t&&t.removeChild(this)}function Uo(){return this.each(Ho)}function Xo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Yo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Wo(t){return this.select(t?Yo:Xo)}function Bo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function qo(t){return function(e){t.call(this,e,this.__data__)}}function jo(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Ko(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Zo(t,e,n){return function(){var r=this.__on,i,o=qo(e);if(r){for(var a=0,u=r.length;a<u;++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=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Jo(t,e,n){var r=jo(t+""),i,o=r.length,a;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<o;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(u=e?Zo:Ko,i=0;i<o;++i)this.each(u(r[i],e,n));return this}function Dn(t,e,n){var r=xn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Qo(t,e){return function(){return Dn(this,t,e)}}function ta(t,e){return function(){return Dn(this,t,e.apply(this,arguments))}}function ea(t,e){return this.each((typeof e=="function"?ta:Qo)(t,e))}function*na(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var Mn=[null];function G(t,e){this._groups=t,this._parents=e}function Pt(){return new G([[document.documentElement]],Mn)}function ra(){return this}G.prototype=Pt.prototype={constructor:G,select:Ci,selectAll:Fi,selectChild:Ii,selectChildren:Gi,filter:zi,data:Bi,enter:Hi,exit:ji,join:Ki,merge:Zi,selection:ra,order:Ji,sort:Qi,call:eo,nodes:no,node:ro,size:io,empty:oo,each:ao,attr:po,style:yo,property:_o,classed:Do,text:Po,html:ko,raise:Io,lower:Lo,append:Vo,insert:zo,remove:Uo,clone:Wo,datum:Bo,on:Jo,dispatch:ea,[Symbol.iterator]:na};function Bt(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],Mn)}function Ae(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Cn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Tt(){}var Ft=.7,qt=1/Ft,gt="\\s*([+-]?\\d+)\\s*",Nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ia=/^#([0-9a-f]{3,8})$/,oa=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),aa=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),ua=new RegExp(`^rgba\\(${gt},${gt},${gt},${Nt}\\)$`),sa=new RegExp(`^rgba\\(${W},${W},${W},${Nt}\\)$`),la=new RegExp(`^hsl\\(${Nt},${W},${W}\\)$`),ca=new RegExp(`^hsla\\(${Nt},${W},${W},${Nt}\\)$`),En={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};Ae(Tt,at,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Pn,formatHex:Pn,formatHex8:fa,formatHsl:ha,formatRgb:Tn,toString:Tn});function Pn(){return this.rgb().formatHex()}function fa(){return this.rgb().formatHex8()}function ha(){return In(this).formatHsl()}function Tn(){return this.rgb().formatRgb()}function at(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ia.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Fn(e):n===3?new V(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?jt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?jt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=oa.exec(t))?new V(e[1],e[2],e[3],1):(e=aa.exec(t))?new V(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ua.exec(t))?jt(e[1],e[2],e[3],e[4]):(e=sa.exec(t))?jt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=la.exec(t))?On(e[1],e[2]/100,e[3]/100,1):(e=ca.exec(t))?On(e[1],e[2]/100,e[3]/100,e[4]):En.hasOwnProperty(t)?Fn(En[t]):t==="transparent"?new V(NaN,NaN,NaN,0):null}function Fn(t){return new V(t>>16&255,t>>8&255,t&255,1)}function jt(t,e,n,r){return r<=0&&(t=e=n=NaN),new V(t,e,n,r)}function da(t){return t instanceof Tt||(t=at(t)),t?(t=t.rgb(),new V(t.r,t.g,t.b,t.opacity)):new V}function Se(t,e,n,r){return arguments.length===1?da(t):new V(t,e,n,r??1)}function V(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Ae(V,Se,Cn(Tt,{brighter(t){return t=t==null?qt:Math.pow(qt,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new V(ut(this.r),ut(this.g),ut(this.b),Kt(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:Nn,formatHex:Nn,formatHex8:pa,formatRgb:kn,toString:kn}));function Nn(){return`#${st(this.r)}${st(this.g)}${st(this.b)}`}function pa(){return`#${st(this.r)}${st(this.g)}${st(this.b)}${st((isNaN(this.opacity)?1:this.opacity)*255)}`}function kn(){const t=Kt(this.opacity);return`${t===1?"rgb(":"rgba("}${ut(this.r)}, ${ut(this.g)}, ${ut(this.b)}${t===1?")":`, ${t})`}`}function Kt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ut(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function st(t){return t=ut(t),(t<16?"0":"")+t.toString(16)}function On(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new H(t,e,n,r)}function In(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof Tt||(t=at(t)),!t)return new H;if(t instanceof H)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(e===o?a=(n-r)/u+(n<r)*6:n===o?a=(r-e)/u+2:a=(e-n)/u+4,u/=s<.5?o+i:2-o-i,a*=60):u=s>0&&s<1?0:a,new H(a,u,s,t.opacity)}function ma(t,e,n,r){return arguments.length===1?In(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Ae(H,ma,Cn(Tt,{brighter(t){return t=t==null?qt:Math.pow(qt,t),new H(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new H(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new V(De(t>=240?t-240:t+120,i,r),De(t,i,r),De(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(Rn(this.h),Zt(this.s),Zt(this.l),Kt(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=Kt(this.opacity);return`${t===1?"hsl(":"hsla("}${Rn(this.h)}, ${Zt(this.s)*100}%, ${Zt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Rn(t){return t=(t||0)%360,t<0?t+360:t}function Zt(t){return Math.max(0,Math.min(1,t||0))}function De(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Me=t=>()=>t;function ga(t,e){return function(n){return t+n*e}}function va(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function ya(t){return(t=+t)==1?Ln:function(e,n){return n-e?va(e,n,t):Me(isNaN(e)?n:e)}}function Ln(t,e){var n=e-t;return n?ga(t,n):Me(isNaN(t)?e:t)}const Jt=function t(e){var n=ya(e);function r(i,o){var a=n((i=Se(i)).r,(o=Se(o)).r),u=n(i.g,o.g),s=n(i.b,o.b),l=Ln(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function wa(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function ba(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function xa(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=Pe(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(u){for(a=0;a<r;++a)o[a]=i[a](u);return o}}function _a(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function U(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function $a(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Pe(t[i],e[i]):r[i]=e[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var Ce=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ee=new RegExp(Ce.source,"g");function Aa(t){return function(){return t}}function Sa(t){return function(e){return t(e)+""}}function Vn(t,e){var n=Ce.lastIndex=Ee.lastIndex=0,r,i,o,a=-1,u=[],s=[];for(t=t+"",e=e+"";(r=Ce.exec(t))&&(i=Ee.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),u[a]?u[a]+=o:u[++a]=o),(r=r[0])===(i=i[0])?u[a]?u[a]+=i:u[++a]=i:(u[++a]=null,s.push({i:a,x:U(r,i)})),n=Ee.lastIndex;return n<e.length&&(o=e.slice(n),u[a]?u[a]+=o:u[++a]=o),u.length<2?s[0]?Sa(s[0].x):Aa(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Pe(t,e){var n=typeof e,r;return e==null||n==="boolean"?Me(e):(n==="number"?U:n==="string"?(r=at(e))?(e=r,Jt):Vn:e instanceof at?Jt:e instanceof Date?_a:ba(e)?wa:Array.isArray(e)?xa:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?$a:U)(t,e)}function Da(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Gn=180/Math.PI,Te={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zn(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*Gn,skewX:Math.atan(s)*Gn,scaleX:a,scaleY:u}}var Qt;function Ma(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Te:zn(e.a,e.b,e.c,e.d,e.e,e.f)}function Ca(t){return t==null||(Qt||(Qt=document.createElementNS("http://www.w3.org/2000/svg","g")),Qt.setAttribute("transform",t),!(t=Qt.transform.baseVal.consolidate()))?Te:(t=t.matrix,zn(t.a,t.b,t.c,t.d,t.e,t.f))}function Hn(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push("translate(",null,e,null,n);m.push({i:p-4,x:U(l,c)},{i:p-2,x:U(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function a(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:U(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:U(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push(i(d)+"scale(",null,",",null,")");m.push({i:p-4,x:U(l,c)},{i:p-2,x:U(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),o(l.translateX,l.translateY,f.translateX,f.translateY,c,h),a(l.rotate,f.rotate,c,h),u(l.skewX,f.skewX,c,h),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var m=-1,p=h.length,g;++m<p;)c[(g=h[m]).i]=g.x(d);return c.join("")}}}var Ea=Hn(Ma,"px, ","px)","deg)"),Pa=Hn(Ca,", ",")",")"),vt=0,kt=0,Ot=0,Un=1e3,te,It,ee=0,lt=0,ne=0,Rt=typeof performance=="object"&&performance.now?performance:Date,Xn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Fe(){return lt||(Xn(Ta),lt=Rt.now()+ne)}function Ta(){lt=0}function re(){this._call=this._time=this._next=null}re.prototype=Yn.prototype={constructor:re,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Fe():+n)+(e==null?0:+e),!this._next&&It!==this&&(It?It._next=this:te=this,It=this),this._call=t,this._time=n,Ne()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ne())}};function Yn(t,e,n){var r=new re;return r.restart(t,e,n),r}function Fa(){Fe(),++vt;for(var t=te,e;t;)(e=lt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--vt}function Wn(){lt=(ee=Rt.now())+ne,vt=kt=0;try{Fa()}finally{vt=0,ka(),lt=0}}function Na(){var t=Rt.now(),e=t-ee;e>Un&&(ne-=e,ee=t)}function ka(){for(var t,e=te,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:te=n);It=t,Ne(r)}function Ne(t){if(!vt){kt&&(kt=clearTimeout(kt));var e=t-lt;e>24?(t<1/0&&(kt=setTimeout(Wn,t-Rt.now()-ne)),Ot&&(Ot=clearInterval(Ot))):(Ot||(ee=Rt.now(),Ot=setInterval(Na,Un)),vt=1,Xn(Wn))}}function Bn(t,e,n){var r=new re;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Oa=dn("start","end","cancel","interrupt"),Ia=[],qn=0,jn=1,ke=2,ie=3,Kn=4,Oe=5,oe=6;function ae(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Ra(t,n,{name:e,index:r,group:i,on:Oa,tween:Ia,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:qn})}function Ie(t,e){var n=X(t,e);if(n.state>qn)throw new Error("too late; already scheduled");return n}function B(t,e){var n=X(t,e);if(n.state>ie)throw new Error("too late; already running");return n}function X(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ra(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Yn(o,0,n.time);function o(l){n.state=jn,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var f,c,h,d;if(n.state!==jn)return s();for(f in r)if(d=r[f],d.name===n.name){if(d.state===ie)return Bn(a);d.state===Kn?(d.state=oe,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=oe,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Bn(function(){n.state===ie&&(n.state=Kn,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=ke,n.on.call("start",t,t.__data__,n.index,n.group),n.state===ke){for(n.state=ie,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=Oe,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Oe&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=oe,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function La(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>ke&&r.state<Oe,r.state=oe,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function Va(t){return this.each(function(){La(this,t)})}function Ga(t,e){var n,r;return function(){var i=B(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function za(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=B(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}o.tween=i}}function Ha(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?Ga:za)(n,t,e))}function Re(t,e,n){var r=t._id;return t.each(function(){var i=B(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return X(i,r).value[e]}}function Zn(t,e){var n;return(typeof e=="number"?U:e instanceof at?Jt:(n=at(e))?(e=n,Jt):Vn)(t,e)}function Ua(t){return function(){this.removeAttribute(t)}}function Xa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ya(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function Wa(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function Ba(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttribute(t):(a=this.getAttribute(t),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function qa(t,e,n){var r,i,o;return function(){var a,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),s=u+"",a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u)))}}function ja(t,e){var n=Yt(t),r=n==="transform"?Pa:Zn;return this.attrTween(t,typeof e=="function"?(n.local?qa:Ba)(n,r,Re(this,"attr."+t,e)):e==null?(n.local?Xa:Ua)(n):(n.local?Wa:Ya)(n,r,e))}function Ka(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Za(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ja(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Za(t,o)),n}return i._value=e,i}function Qa(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Ka(t,o)),n}return i._value=e,i}function tu(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Yt(t);return this.tween(n,(r.local?Ja:Qa)(r,e))}function eu(t,e){return function(){Ie(this,t).delay=+e.apply(this,arguments)}}function nu(t,e){return e=+e,function(){Ie(this,t).delay=e}}function ru(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?eu:nu)(e,t)):X(this.node(),e).delay}function iu(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function ou(t,e){return e=+e,function(){B(this,t).duration=e}}function au(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?iu:ou)(e,t)):X(this.node(),e).duration}function uu(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function su(t){var e=this._id;return arguments.length?this.each(uu(e,t)):X(this.node(),e).ease}function lu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function cu(t){if(typeof t!="function")throw new Error;return this.each(lu(this._id,t))}function fu(t){typeof t!="function"&&(t=yn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,u=r[i]=[],s,l=0;l<a;++l)(s=o[l])&&t.call(s,s.__data__,l,o)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function hu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),u=0;u<o;++u)for(var s=e[u],l=n[u],f=s.length,c=a[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)a[u]=e[u];return new K(a,this._parents,this._name,this._id)}function du(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function pu(t,e,n){var r,i,o=du(e)?Ie:B;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}function mu(t,e){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(t):this.each(pu(n,t,e))}function gu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function vu(){return this.on("end.remove",gu(this._id))}function yu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_e(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var u=r[a],s=u.length,l=o[a]=new Array(s),f,c,h=0;h<s;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,ae(l[h],e,n,h,l,X(f,n)));return new K(o,this._parents,e,n)}function wu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=vn(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var h=t.call(f,f.__data__,c,s),d,m=X(f,n),p=0,g=h.length;p<g;++p)(d=h[p])&&ae(d,e,n,p,h,m);o.push(h),a.push(f)}return new K(o,a,e,n)}var bu=Pt.prototype.constructor;function xu(){return new bu(this._groups,this._parents)}function _u(t,e){var n,r,i;return function(){var o=mt(this,t),a=(this.style.removeProperty(t),mt(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Jn(t){return function(){this.style.removeProperty(t)}}function $u(t,e,n){var r,i=n+"",o;return function(){var a=mt(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function Au(t,e,n){var r,i,o;return function(){var a=mt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),mt(this,t))),a===s?null:a===r&&s===i?o:(i=s,o=e(r=a,u))}}function Su(t,e){var n,r,i,o="style."+e,a="end."+o,u;return function(){var s=B(this,t),l=s.on,f=s.value[o]==null?u||(u=Jn(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(a,i=f),s.on=r}}function Du(t,e,n){var r=(t+="")=="transform"?Ea:Zn;return e==null?this.styleTween(t,_u(t,r)).on("end.style."+t,Jn(t)):typeof e=="function"?this.styleTween(t,Au(t,r,Re(this,"style."+t,e))).each(Su(this._id,t)):this.styleTween(t,$u(t,r,e),n).on("end.style."+t,null)}function Mu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Cu(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&Mu(t,a,n)),r}return o._value=e,o}function Eu(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Cu(t,e,n??""))}function Pu(t){return function(){this.textContent=t}}function Tu(t){return function(){var e=t(this);this.textContent=e??""}}function Fu(t){return this.tween("text",typeof t=="function"?Tu(Re(this,"text",t)):Pu(t==null?"":t+""))}function Nu(t){return function(e){this.textContent=t.call(this,e)}}function ku(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Nu(i)),e}return r._value=t,r}function Ou(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,ku(t))}function Iu(){for(var t=this._name,e=this._id,n=Qn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)if(s=a[l]){var f=X(s,e);ae(s,t,n,l,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function Ru(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},s={value:function(){--i===0&&o()}};n.each(function(){var l=B(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&o()})}var Lu=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Qn(){return++Lu}var Z=Pt.prototype;K.prototype={constructor:K,select:yu,selectAll:wu,selectChild:Z.selectChild,selectChildren:Z.selectChildren,filter:fu,merge:hu,selection:xu,transition:Iu,call:Z.call,nodes:Z.nodes,node:Z.node,size:Z.size,empty:Z.empty,each:Z.each,on:mu,attr:ja,attrTween:tu,style:Du,styleTween:Eu,text:Fu,textTween:Ou,remove:vu,tween:Ha,delay:ru,duration:au,ease:su,easeVarying:cu,end:Ru,[Symbol.iterator]:Z[Symbol.iterator]};function Vu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Gu={time:null,delay:0,duration:250,ease:Vu};function zu(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Hu(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=Qn(),(n=Gu).time=Fe(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],u=a.length,s,l=0;l<u;++l)(s=a[l])&&ae(s,t,e,l,a,n||zu(s,e));return new K(r,this._parents,t,e)}Pt.prototype.interrupt=Va,Pt.prototype.transition=Hu;function Uu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ue(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function yt(t){return t=ue(Math.abs(t)),t?t[1]:NaN}function Xu(t,e){return function(n,r){for(var i=n.length,o=[],a=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Yu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Wu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function se(t){if(!(e=Wu.exec(t)))throw new Error("invalid format: "+t);var e;return new Le({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}se.prototype=Le.prototype;function Le(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+""}Le.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 Bu(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var tr;function qu(t,e){var n=ue(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(tr=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")+ue(t,Math.max(0,e+o-1))[0]}function er(t,e){var n=ue(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const nr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Uu,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>er(t*100,e),r:er,s:qu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function rr(t){return t}var ir=Array.prototype.map,or=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ju(t){var e=t.grouping===void 0||t.thousands===void 0?rr:Xu(ir.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?rr:Yu(ir.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=se(c);var h=c.fill,d=c.align,m=c.sign,p=c.symbol,g=c.zero,$=c.width,D=c.comma,x=c.precision,M=c.trim,w=c.type;w==="n"?(D=!0,w="g"):nr[w]||(x===void 0&&(x=12),M=!0,w="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var C=p==="$"?n:p==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",v=p==="$"?r:/[%p]/.test(w)?a:"",A=nr[w],b=/[defgprs%]/.test(w);x=x===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function N(y){var k=C,T=v,Y,Mt,Ct;if(w==="c")T=A(y)+T,y="";else{y=+y;var Q=y<0||1/y<0;if(y=isNaN(y)?s:A(Math.abs(y),x),M&&(y=Bu(y)),Q&&+y==0&&m!=="+"&&(Q=!1),k=(Q?m==="("?m:u:m==="-"||m==="("?"":m)+k,T=(w==="s"?or[8+tr/3]:"")+T+(Q&&m==="("?")":""),b){for(Y=-1,Mt=y.length;++Y<Mt;)if(Ct=y.charCodeAt(Y),48>Ct||Ct>57){T=(Ct===46?i+y.slice(Y+1):y.slice(Y))+T,y=y.slice(0,Y);break}}}D&&!g&&(y=e(y,1/0));var dt=k.length+y.length+T.length,tt=dt<$?new Array($-dt+1).join(h):"";switch(D&&g&&(y=e(tt+y,tt.length?$-T.length:1/0),tt=""),d){case"<":y=k+y+T+tt;break;case"=":y=k+tt+y+T;break;case"^":y=tt.slice(0,dt=tt.length>>1)+k+y+T+tt.slice(dt);break;default:y=tt+k+y+T;break}return o(y)}return N.toString=function(){return c+""},N}function f(c,h){var d=l((c=se(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(yt(h)/3)))*3,p=Math.pow(10,-m),g=or[8+m/3];return function($){return d(p*$)+g}}return{format:l,formatPrefix:f}}var le,Ve,ar;Ku({thousands:",",grouping:[3],currency:["$",""]});function Ku(t){return le=ju(t),Ve=le.format,ar=le.formatPrefix,le}function Zu(t){return Math.max(0,-yt(Math.abs(t)))}function Ju(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yt(e)/3)))*3-yt(Math.abs(t)))}function Qu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yt(e)-yt(t))+1}function ce(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const ur=Symbol("implicit");function sr(){var t=new fn,e=[],n=[],r=ur;function i(o){let a=t.get(o);if(a===void 0){if(r!==ur)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new fn;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return sr(e,n).unknown(r)},ce.apply(i,arguments),i}function lr(){var t=sr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,m=d?i:r,p=d?r:i;o=(p-m)/Math.max(1,h-s+l*2),u&&(o=Math.floor(o)),m+=(p-m-o*(h-s))*f,a=o*(1-s),u&&(m=Math.round(m),a=Math.round(a));var g=xi(h).map(function($){return m+o*$});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(s=Math.min(1,l=+h),c()):s},t.paddingInner=function(h){return arguments.length?(s=Math.min(1,h),c()):s},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return lr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},ce.apply(c(),arguments)}function cr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return cr(e())},t}function ts(){return cr(lr.apply(null,arguments).paddingInner(1))}function es(t){return function(){return t}}function ns(t){return+t}var fr=[0,1];function wt(t){return t}function Ge(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:es(isNaN(e)?NaN:.5)}function rs(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function is(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=Ge(i,r),o=n(a,o)):(r=Ge(r,i),o=n(o,a)),function(u){return o(r(u))}}function os(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=Ge(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(u){var s=cn(t,u,1,r)-1;return o[s](i[s](u))}}function as(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function us(){var t=fr,e=fr,n=Pe,r,i,o,a=wt,u,s,l;function f(){var h=Math.min(t.length,e.length);return a!==wt&&(a=rs(t[0],t[h-1])),u=h>2?os:is,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?o:(s||(s=u(t.map(r),e,n)))(r(a(h)))}return c.invert=function(h){return a(i((l||(l=u(e,t.map(r),U)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ns),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Da,f()},c.clamp=function(h){return arguments.length?(a=h?!0:wt,f()):a!==wt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return r=h,i=d,f()}}function ss(){return us()(wt,wt)}function ls(t,e,n,r){var i=bi(t,e,n),o;switch(r=se(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=Ju(i,a))&&(r.precision=o),ar(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Qu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Zu(i))&&(r.precision=o-(r.type==="%")*2);break}}return Ve(r)}function hr(t){var e=t.domain;return t.ticks=function(n){var r=e();return wi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return ls(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,o=r.length-1,a=r[i],u=r[o],s,l,f=10;for(u<a&&(l=a,a=u,u=l,l=i,i=o,o=l);f-- >0;){if(l=be(a,u,n),l===s)return r[i]=a,r[o]=u,e(r);if(l>0)a=Math.floor(a/l)*l,u=Math.ceil(u/l)*l;else if(l<0)a=Math.ceil(a*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function dr(){var t=ss();return t.copy=function(){return as(t,dr())},ce.apply(t,arguments),hr(t)}function pr(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(s){return s!=null&&s<=s?i[cn(r,s,0,n)]:o}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return a}return a.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},a.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},a.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(s){return arguments.length&&(o=s),a},a.thresholds=function(){return r.slice()},a.copy=function(){return pr().domain([t,e]).range(i).unknown(o)},ce.apply(hr(a),arguments)}function Lt(t,e,n){this.k=t,this.x=e,this.y=n}Lt.prototype={constructor:Lt,scale:function(t){return t===1?this:new Lt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Lt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Lt.prototype;function q(t){return Object.prototype.toString.call(t)==="[object Object]"}function cs(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function et(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let u;q(r[a])&&q(i[a])?(u=n(r[a],i[a]),o[a]=u):o[a]=r[a]}return o};return n(t,e)}function fs(t=0){try{let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}catch(e){console.error(e)}}function hs(t,e){return e instanceof Function?e(t):Ve(e)(t)}function fe(t,e,n){return`${t}_${e}_${n}`}function ze(t,e){return`${t}_series${e}`}function mr(t,e){return`${t}_group${e}`}function gr(t,e){const n=e.grid.seriesType==="row"?e.grid.rowLabels:e.grid.columnLabels;return t.map((r,i)=>n[i]!=null?n[i]:ze("grid",i))}function vr(t,e){if(t[0]==null)return[];const n=e.grid.seriesType==="row"?e.grid.columnLabels:e.grid.rowLabels;return t[0].map((r,i)=>n[i]!=null?n[i]:mr("grid",i))}function bt(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function he(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return bt(e)}function ds(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function He(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function ps(t){const n=t.flat().flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function ms(t,e=2){const r=t.flat().filter((i,o)=>o==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return bt(r)}function yr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((o,a)=>Math.max(o,a.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let o=0;o<n;o++)for(let a=0;a<r;a++)i[a][o]=e[o][a];return i}function gs(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((o,a)=>{Array.isArray(o)?o.forEach((u,s)=>{i.push({rowIndex:a,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:a,columnIndex:0,index:-1,datum:o})}),i.sort((o,a)=>e(o.datum,a.datum)),i=i.map((o,a)=>({...o,index:a})),i.forEach(o=>{n.set(String([o.rowIndex,o.columnIndex]),o.index)}),n}const vs=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const o=(u=>{if(u){const s=gs(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),a=(u,s,l,f,c)=>{const h=fe(n.type,s,l),d=n.seriesLabels[s]||ze("series",s),m=n.colorsPredicate(u,s,l,t),p=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,tooltipContent:n.tooltipContentFormat(u,s,l,t),data:{},value:u,seriesIndex:s,seriesLabel:d,color:m,visible:p}:{id:u.id?u.id:h,index:f,sortedIndex:c,label:u.label?u.label:h,tooltipContent:u.tooltipContent?u.tooltipContent:n.tooltipContentFormat(u,s,l,t),data:u.data??{},value:u.value,seriesIndex:s,seriesLabel:d,color:m,visible:p}};e.forEach((u,s)=>{if(Array.isArray(u))u.forEach((l,f)=>{const c=o(i,s,f),h=a(l,s,f,i.length,c);i.push(h)});else{const l=o(i,s,0),f=a(u,s,0,i.length,l);i.push(f)}})}catch(o){throw Error(o)}return i};var Ue=function(t,e){return Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Ue(t,e)};function J(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ue(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function ys(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function u(f){try{l(r.next(f))}catch(c){a(c)}}function s(f){try{l(r.throw(f))}catch(c){a(c)}}function l(f){f.done?o(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function wr(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function xt(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function nt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(u){a={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function rt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function _t(t){return this instanceof _t?(this.v=t,this):new _t(t)}function ws(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i={},u("next"),u("throw"),u("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(d){return function(m){return Promise.resolve(m).then(d,c)}}function u(d,m){r[d]&&(i[d]=function(p){return new Promise(function(g,$){o.push([d,p,g,$])>1||s(d,p)})},m&&(i[d]=m(i[d])))}function s(d,m){try{l(r[d](m))}catch(p){h(o[0][3],p)}}function l(d){d.value instanceof _t?Promise.resolve(d.value.v).then(f,c):h(o[0][2],d)}function f(d){s("next",d)}function c(d){s("throw",d)}function h(d,m){d(m),o.shift(),o.length&&s(o[0][0],o[0][1])}}function bs(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof xt=="function"?xt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(u,s){a=t[o](a),i(u,s,a.done,a.value)})}}function i(o,a,u,s){Promise.resolve(s).then(function(l){o({value:l,done:u})},a)}}typeof SuppressedError=="function"&&SuppressedError;function F(t){return typeof t=="function"}function Xe(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ye=Xe(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
1
|
+
(function(x,Et){typeof exports=="object"&&typeof module<"u"?Et(exports):typeof define=="function"&&define.amd?define(["exports"],Et):(x=typeof globalThis<"u"?globalThis:x||self,Et(x["orbcharts-core"]={}))})(this,function(x){"use strict";const Et={preset:{}},on={top:60,right:60,bottom:60,left:60},un={padding:on,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#454545",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:14,unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},ri=800,ii=500,j={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},ai={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},oi={type:"series",visibleFilter:(t,e,n,r)=>!0,unitLabel:"",seriesLabels:[],sort:null},sn={type:"grid",visibleFilter:(t,e,n,r)=>!0,grid:{rowLabels:[],columnLabels:[],seriesType:"row"},valueAxis:{...j},groupAxis:{...ai}},ln={type:"multiGrid",visibleFilter:(t,e,n,r)=>!0,multiGrid:[{...sn}]},ui={type:"multiValue",visibleFilter:(t,e,n,r)=>!0,multiValue:[],xAxis:{...j},yAxis:{...j}},si={type:"tree",visibleFilter:(t,e,n,r)=>!0},li={type:"relationship",visibleFilter:(t,e,n,r)=>!0};function zt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ci(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function cn(t){let e,n,r;t.length!==2?(e=zt,n=(u,s)=>zt(t(u),s),r=(u,s)=>t(u)-s):(e=t===zt||t===ci?t:fi,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:o,right:a}}function fi(){return 0}function hi(t){return t===null?NaN:+t}const fn=cn(zt).right;cn(hi).center;class hn extends Map{constructor(e,n=mi){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(dn(this,e))}has(e){return super.has(dn(this,e))}set(e,n){return super.set(di(this,e),n)}delete(e){return super.delete(pi(this,e))}}function dn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function di({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function pi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function mi(t){return t!==null&&typeof t=="object"?t.valueOf():t}const gi=Math.sqrt(50),vi=Math.sqrt(10),yi=Math.sqrt(2);function Ht(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=gi?10:a>=vi?5:a>=yi?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/o,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*o,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?Ht(t,e,n*2):[u,s,l]}function wi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?Ht(e,t,n):Ht(t,e,n);if(!(a>=i))return[];const u=a-i+1,s=new Array(u);if(r)if(o<0)for(let l=0;l<u;++l)s[l]=(a-l)/-o;else for(let l=0;l<u;++l)s[l]=(a-l)*o;else if(o<0)for(let l=0;l<u;++l)s[l]=(i+l)/-o;else for(let l=0;l<u;++l)s[l]=(i+l)*o;return s}function we(t,e,n){return e=+e,t=+t,n=+n,Ht(t,e,n)[2]}function bi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?we(e,t,n):we(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function xi(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r<i;)a[r]=t+r*n;return a}var _i={value:()=>{}};function pn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ut(n)}function Ut(t){this._=t}function $i(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ut.prototype=pn.prototype={constructor:Ut,on:function(t,e){var n=this._,r=$i(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Ai(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=mn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=mn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Ut(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Ai(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function mn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=_i,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var be="http://www.w3.org/1999/xhtml";const gn={svg:"http://www.w3.org/2000/svg",xhtml:be,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Xt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),gn.hasOwnProperty(e)?{space:gn[e],local:t}:t}function Si(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===be&&e.documentElement.namespaceURI===be?e.createElement(t):e.createElementNS(n,t)}}function Di(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function vn(t){var e=Xt(t);return(e.local?Di:Si)(e)}function Mi(){}function xe(t){return t==null?Mi:function(){return this.querySelector(t)}}function Ei(t){typeof t!="function"&&(t=xe(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),s,l,f=0;f<o;++f)(s=a[f])&&(l=t.call(s,s.__data__,f,a))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new G(r,this._parents)}function Ci(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Pi(){return[]}function yn(t){return t==null?Pi:function(){return this.querySelectorAll(t)}}function Ti(t){return function(){return Ci(t.apply(this,arguments))}}function Fi(t){typeof t=="function"?t=Ti(t):t=yn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new G(r,i)}function wn(t){return function(){return this.matches(t)}}function bn(t){return function(e){return e.matches(t)}}var Ni=Array.prototype.find;function ki(t){return function(){return Ni.call(this.children,t)}}function Oi(){return this.firstElementChild}function Ii(t){return this.select(t==null?Oi:ki(typeof t=="function"?t:bn(t)))}var Ri=Array.prototype.filter;function Li(){return Array.from(this.children)}function Vi(t){return function(){return Ri.call(this.children,t)}}function Gi(t){return this.selectAll(t==null?Li:Vi(typeof t=="function"?t:bn(t)))}function zi(t){typeof t!="function"&&(t=wn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new G(r,this._parents)}function xn(t){return new Array(t.length)}function Hi(){return new G(this._enter||this._groups.map(xn),this._parents)}function Yt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Yt.prototype={constructor:Yt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Ui(t){return function(){return t}}function Xi(t,e,n,r,i,a){for(var o=0,u,s=e.length,l=a.length;o<l;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Yt(t,a[o]);for(;o<s;++o)(u=e[o])&&(i[o]=u)}function Yi(t,e,n,r,i,a,o){var u,s,l=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(s=e[u])&&(h[u]=d=o.call(s,s.__data__,u,e)+"",l.has(d)?i[u]=s:l.set(d,s));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(s=l.get(d))?(r[u]=s,s.__data__=a[u],l.delete(d)):n[u]=new Yt(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(h[u])===s&&(i[u]=s)}function Bi(t){return t.__data__}function Wi(t,e){if(!arguments.length)return Array.from(this,Bi);var n=e?Yi:Xi,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ui(t));for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,d=qi(t.call(f,f&&f.__data__,l,r)),m=d.length,p=u[l]=new Array(m),g=o[l]=new Array(m),_=s[l]=new Array(h);n(f,c,p,g,_,d,e);for(var M=0,b=0,E,y;M<m;++M)if(E=p[M]){for(M>=b&&(b=M+1);!(y=g[b])&&++b<m;);E._next=y||null}}return o=new G(o,r),o._enter=u,o._exit=s,o}function qi(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ji(){return new G(this._exit||this._groups.map(xn),this._parents)}function Ki(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Zi(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),s=0;s<o;++s)for(var l=n[s],f=r[s],c=l.length,h=u[s]=new Array(c),d,m=0;m<c;++m)(d=l[m]||f[m])&&(h[m]=d);for(;s<i;++s)u[s]=n[s];return new G(u,this._parents)}function Ji(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Qi(t){t||(t=ta);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f)(l=o[f])&&(s[f]=l);s.sort(e)}return new G(i,this._parents).order()}function ta(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ea(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function na(){return Array.from(this)}function ra(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function ia(){let t=0;for(const e of this)++t;return t}function aa(){return!this.node()}function oa(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function ua(t){return function(){this.removeAttribute(t)}}function sa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function la(t,e){return function(){this.setAttribute(t,e)}}function ca(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function fa(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ha(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function da(t,e){var n=Xt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?sa:ua:typeof e=="function"?n.local?ha:fa:n.local?ca:la)(n,e))}function _n(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function pa(t){return function(){this.style.removeProperty(t)}}function ma(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ga(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function va(t,e,n){return arguments.length>1?this.each((e==null?pa:typeof e=="function"?ga:ma)(t,e,n??"")):mt(this.node(),t)}function mt(t,e){return t.style.getPropertyValue(e)||_n(t).getComputedStyle(t,null).getPropertyValue(e)}function ya(t){return function(){delete this[t]}}function wa(t,e){return function(){this[t]=e}}function ba(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function xa(t,e){return arguments.length>1?this.each((e==null?ya:typeof e=="function"?ba:wa)(t,e)):this.node()[t]}function $n(t){return t.trim().split(/^|\s+/)}function _e(t){return t.classList||new An(t)}function An(t){this._node=t,this._names=$n(t.getAttribute("class")||"")}An.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Sn(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Dn(t,e){for(var n=_e(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function _a(t){return function(){Sn(this,t)}}function $a(t){return function(){Dn(this,t)}}function Aa(t,e){return function(){(e.apply(this,arguments)?Sn:Dn)(this,t)}}function Sa(t,e){var n=$n(t+"");if(arguments.length<2){for(var r=_e(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Aa:e?_a:$a)(n,e))}function Da(){this.textContent=""}function Ma(t){return function(){this.textContent=t}}function Ea(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ca(t){return arguments.length?this.each(t==null?Da:(typeof t=="function"?Ea:Ma)(t)):this.node().textContent}function Pa(){this.innerHTML=""}function Ta(t){return function(){this.innerHTML=t}}function Fa(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Na(t){return arguments.length?this.each(t==null?Pa:(typeof t=="function"?Fa:Ta)(t)):this.node().innerHTML}function ka(){this.nextSibling&&this.parentNode.appendChild(this)}function Oa(){return this.each(ka)}function Ia(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ra(){return this.each(Ia)}function La(t){var e=typeof t=="function"?t:vn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Va(){return null}function Ga(t,e){var n=typeof t=="function"?t:vn(t),r=e==null?Va:typeof e=="function"?e:xe(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function za(){var t=this.parentNode;t&&t.removeChild(this)}function Ha(){return this.each(za)}function Ua(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Xa(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ya(t){return this.select(t?Xa:Ua)}function Ba(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Wa(t){return function(e){t.call(this,e,this.__data__)}}function qa(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function ja(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Ka(t,e,n){return function(){var r=this.__on,i,a=Wa(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Za(t,e,n){var r=qa(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?Ka:ja,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Mn(t,e,n){var r=_n(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ja(t,e){return function(){return Mn(this,t,e)}}function Qa(t,e){return function(){return Mn(this,t,e.apply(this,arguments))}}function to(t,e){return this.each((typeof e=="function"?Qa:Ja)(t,e))}function*eo(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var En=[null];function G(t,e){this._groups=t,this._parents=e}function Ct(){return new G([[document.documentElement]],En)}function no(){return this}G.prototype=Ct.prototype={constructor:G,select:Ei,selectAll:Fi,selectChild:Ii,selectChildren:Gi,filter:zi,data:Wi,enter:Hi,exit:ji,join:Ki,merge:Zi,selection:no,order:Ji,sort:Qi,call:ea,nodes:na,node:ra,size:ia,empty:aa,each:oa,attr:da,style:va,property:xa,classed:Sa,text:Ca,html:Na,raise:Oa,lower:Ra,append:La,insert:Ga,remove:Ha,clone:Ya,datum:Ba,on:Za,dispatch:to,[Symbol.iterator]:eo};function Bt(t){return typeof t=="string"?new G([[document.querySelector(t)]],[document.documentElement]):new G([[t]],En)}function $e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Cn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var Tt=.7,Wt=1/Tt,gt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ro=/^#([0-9a-f]{3,8})$/,io=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),ao=new RegExp(`^rgb\\(${B},${B},${B}\\)$`),oo=new RegExp(`^rgba\\(${gt},${gt},${gt},${Ft}\\)$`),uo=new RegExp(`^rgba\\(${B},${B},${B},${Ft}\\)$`),so=new RegExp(`^hsl\\(${Ft},${B},${B}\\)$`),lo=new RegExp(`^hsla\\(${Ft},${B},${B},${Ft}\\)$`),Pn={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};$e(Pt,ut,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Tn,formatHex:Tn,formatHex8:co,formatHsl:fo,formatRgb:Fn,toString:Fn});function Tn(){return this.rgb().formatHex()}function co(){return this.rgb().formatHex8()}function fo(){return Rn(this).formatHsl()}function Fn(){return this.rgb().formatRgb()}function ut(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ro.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Nn(e):n===3?new V(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?qt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?qt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=io.exec(t))?new V(e[1],e[2],e[3],1):(e=ao.exec(t))?new V(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=oo.exec(t))?qt(e[1],e[2],e[3],e[4]):(e=uo.exec(t))?qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=so.exec(t))?In(e[1],e[2]/100,e[3]/100,1):(e=lo.exec(t))?In(e[1],e[2]/100,e[3]/100,e[4]):Pn.hasOwnProperty(t)?Nn(Pn[t]):t==="transparent"?new V(NaN,NaN,NaN,0):null}function Nn(t){return new V(t>>16&255,t>>8&255,t&255,1)}function qt(t,e,n,r){return r<=0&&(t=e=n=NaN),new V(t,e,n,r)}function ho(t){return t instanceof Pt||(t=ut(t)),t?(t=t.rgb(),new V(t.r,t.g,t.b,t.opacity)):new V}function Ae(t,e,n,r){return arguments.length===1?ho(t):new V(t,e,n,r??1)}function V(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}$e(V,Ae,Cn(Pt,{brighter(t){return t=t==null?Wt:Math.pow(Wt,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new V(st(this.r),st(this.g),st(this.b),jt(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:kn,formatHex:kn,formatHex8:po,formatRgb:On,toString:On}));function kn(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}`}function po(){return`#${lt(this.r)}${lt(this.g)}${lt(this.b)}${lt((isNaN(this.opacity)?1:this.opacity)*255)}`}function On(){const t=jt(this.opacity);return`${t===1?"rgb(":"rgba("}${st(this.r)}, ${st(this.g)}, ${st(this.b)}${t===1?")":`, ${t})`}`}function jt(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 lt(t){return t=st(t),(t<16?"0":"")+t.toString(16)}function In(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new U(t,e,n,r)}function Rn(t){if(t instanceof U)return new U(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=ut(t)),!t)return new U;if(t instanceof U)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new U(o,u,s,t.opacity)}function mo(t,e,n,r){return arguments.length===1?Rn(t):new U(t,e,n,r??1)}function U(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$e(U,mo,Cn(Pt,{brighter(t){return t=t==null?Wt:Math.pow(Wt,t),new U(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tt:Math.pow(Tt,t),new U(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new V(Se(t>=240?t-240:t+120,i,r),Se(t,i,r),Se(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new U(Ln(this.h),Kt(this.s),Kt(this.l),jt(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=jt(this.opacity);return`${t===1?"hsl(":"hsla("}${Ln(this.h)}, ${Kt(this.s)*100}%, ${Kt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Ln(t){return t=(t||0)%360,t<0?t+360:t}function Kt(t){return Math.max(0,Math.min(1,t||0))}function Se(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const De=t=>()=>t;function go(t,e){return function(n){return t+n*e}}function vo(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function yo(t){return(t=+t)==1?Vn:function(e,n){return n-e?vo(e,n,t):De(isNaN(e)?n:e)}}function Vn(t,e){var n=e-t;return n?go(t,n):De(isNaN(t)?e:t)}const Zt=function t(e){var n=yo(e);function r(i,a){var o=n((i=Ae(i)).r,(a=Ae(a)).r),u=n(i.g,a.g),s=n(i.b,a.b),l=Vn(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function wo(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=t[i]*(1-a)+e[i]*a;return r}}function bo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function xo(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Ce(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function _o(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function X(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function $o(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ce(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Me=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ee=new RegExp(Me.source,"g");function Ao(t){return function(){return t}}function So(t){return function(e){return t(e)+""}}function Gn(t,e){var n=Me.lastIndex=Ee.lastIndex=0,r,i,a,o=-1,u=[],s=[];for(t=t+"",e=e+"";(r=Me.exec(t))&&(i=Ee.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:X(r,i)})),n=Ee.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?So(s[0].x):Ao(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Ce(t,e){var n=typeof e,r;return e==null||n==="boolean"?De(e):(n==="number"?X:n==="string"?(r=ut(e))?(e=r,Zt):Gn:e instanceof ut?Zt:e instanceof Date?_o:bo(e)?wo:Array.isArray(e)?xo:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?$o:X)(t,e)}function Do(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var zn=180/Math.PI,Pe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hn(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*zn,skewX:Math.atan(s)*zn,scaleX:o,scaleY:u}}var Jt;function Mo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Pe:Hn(e.a,e.b,e.c,e.d,e.e,e.f)}function Eo(t){return t==null||(Jt||(Jt=document.createElementNS("http://www.w3.org/2000/svg","g")),Jt.setAttribute("transform",t),!(t=Jt.transform.baseVal.consolidate()))?Pe:(t=t.matrix,Hn(t.a,t.b,t.c,t.d,t.e,t.f))}function Un(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push("translate(",null,e,null,n);m.push({i:p-4,x:X(l,c)},{i:p-2,x:X(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:X(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:X(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,h,d,m){if(l!==c||f!==h){var p=d.push(i(d)+"scale(",null,",",null,")");m.push({i:p-4,x:X(l,c)},{i:p-2,x:X(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,h),o(l.rotate,f.rotate,c,h),u(l.skewX,f.skewX,c,h),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var m=-1,p=h.length,g;++m<p;)c[(g=h[m]).i]=g.x(d);return c.join("")}}}var Co=Un(Mo,"px, ","px)","deg)"),Po=Un(Eo,", ",")",")"),vt=0,Nt=0,kt=0,Xn=1e3,Qt,Ot,te=0,ct=0,ee=0,It=typeof performance=="object"&&performance.now?performance:Date,Yn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Te(){return ct||(Yn(To),ct=It.now()+ee)}function To(){ct=0}function ne(){this._call=this._time=this._next=null}ne.prototype=Bn.prototype={constructor:ne,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Te():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:Qt=this,Ot=this),this._call=t,this._time=n,Fe()},stop:function(){this._call&&(this._call=null,this._time=1/0,Fe())}};function Bn(t,e,n){var r=new ne;return r.restart(t,e,n),r}function Fo(){Te(),++vt;for(var t=Qt,e;t;)(e=ct-t._time)>=0&&t._call.call(void 0,e),t=t._next;--vt}function Wn(){ct=(te=It.now())+ee,vt=Nt=0;try{Fo()}finally{vt=0,ko(),ct=0}}function No(){var t=It.now(),e=t-te;e>Xn&&(ee-=e,te=t)}function ko(){for(var t,e=Qt,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Qt=n);Ot=t,Fe(r)}function Fe(t){if(!vt){Nt&&(Nt=clearTimeout(Nt));var e=t-ct;e>24?(t<1/0&&(Nt=setTimeout(Wn,t-It.now()-ee)),kt&&(kt=clearInterval(kt))):(kt||(te=It.now(),kt=setInterval(No,Xn)),vt=1,Yn(Wn))}}function qn(t,e,n){var r=new ne;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Oo=pn("start","end","cancel","interrupt"),Io=[],jn=0,Kn=1,Ne=2,re=3,Zn=4,ke=5,ie=6;function ae(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Ro(t,n,{name:e,index:r,group:i,on:Oo,tween:Io,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:jn})}function Oe(t,e){var n=Y(t,e);if(n.state>jn)throw new Error("too late; already scheduled");return n}function W(t,e){var n=Y(t,e);if(n.state>re)throw new Error("too late; already running");return n}function Y(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Ro(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Bn(a,0,n.time);function a(l){n.state=Kn,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,h,d;if(n.state!==Kn)return s();for(f in r)if(d=r[f],d.name===n.name){if(d.state===re)return qn(o);d.state===Zn?(d.state=ie,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ie,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(qn(function(){n.state===re&&(n.state=Zn,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=Ne,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ne){for(n.state=re,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=ke,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===ke&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=ie,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Lo(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Ne&&r.state<ke,r.state=ie,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Vo(t){return this.each(function(){Lo(this,t)})}function Go(t,e){var n,r;return function(){var i=W(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function zo(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=W(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}}function Ho(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Y(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Go:zo)(n,t,e))}function Ie(t,e,n){var r=t._id;return t.each(function(){var i=W(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Y(i,r).value[e]}}function Jn(t,e){var n;return(typeof e=="number"?X:e instanceof ut?Zt:(n=ut(e))?(e=n,Zt):Gn)(t,e)}function Uo(t){return function(){this.removeAttribute(t)}}function Xo(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Yo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Bo(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function Wo(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function qo(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function jo(t,e){var n=Xt(t),r=n==="transform"?Po:Jn;return this.attrTween(t,typeof e=="function"?(n.local?qo:Wo)(n,r,Ie(this,"attr."+t,e)):e==null?(n.local?Xo:Uo)(n):(n.local?Bo:Yo)(n,r,e))}function Ko(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Zo(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Jo(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Zo(t,a)),n}return i._value=e,i}function Qo(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ko(t,a)),n}return i._value=e,i}function tu(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Xt(t);return this.tween(n,(r.local?Jo:Qo)(r,e))}function eu(t,e){return function(){Oe(this,t).delay=+e.apply(this,arguments)}}function nu(t,e){return e=+e,function(){Oe(this,t).delay=e}}function ru(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?eu:nu)(e,t)):Y(this.node(),e).delay}function iu(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function au(t,e){return e=+e,function(){W(this,t).duration=e}}function ou(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?iu:au)(e,t)):Y(this.node(),e).duration}function uu(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function su(t){var e=this._id;return arguments.length?this.each(uu(e,t)):Y(this.node(),e).ease}function lu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function cu(t){if(typeof t!="function")throw new Error;return this.each(lu(this._id,t))}function fu(t){typeof t!="function"&&(t=wn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new K(r,this._parents,this._name,this._id)}function hu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=s[d]||l[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new K(o,this._parents,this._name,this._id)}function du(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function pu(t,e,n){var r,i,a=du(e)?Oe:W;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function mu(t,e){var n=this._id;return arguments.length<2?Y(this.node(),n).on.on(t):this.each(pu(n,t,e))}function gu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function vu(){return this.on("end.remove",gu(this._id))}function yu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=xe(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],s=u.length,l=a[o]=new Array(s),f,c,h=0;h<s;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,ae(l[h],e,n,h,l,Y(f,n)));return new K(a,this._parents,e,n)}function wu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=yn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var h=t.call(f,f.__data__,c,s),d,m=Y(f,n),p=0,g=h.length;p<g;++p)(d=h[p])&&ae(d,e,n,p,h,m);a.push(h),o.push(f)}return new K(a,o,e,n)}var bu=Ct.prototype.constructor;function xu(){return new bu(this._groups,this._parents)}function _u(t,e){var n,r,i;return function(){var a=mt(this,t),o=(this.style.removeProperty(t),mt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Qn(t){return function(){this.style.removeProperty(t)}}function $u(t,e,n){var r,i=n+"",a;return function(){var o=mt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Au(t,e,n){var r,i,a;return function(){var o=mt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),mt(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function Su(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=W(this,t),l=s.on,f=s.value[a]==null?u||(u=Qn(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),s.on=r}}function Du(t,e,n){var r=(t+="")=="transform"?Co:Jn;return e==null?this.styleTween(t,_u(t,r)).on("end.style."+t,Qn(t)):typeof e=="function"?this.styleTween(t,Au(t,r,Ie(this,"style."+t,e))).each(Su(this._id,t)):this.styleTween(t,$u(t,r,e),n).on("end.style."+t,null)}function Mu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Eu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Mu(t,o,n)),r}return a._value=e,a}function Cu(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Eu(t,e,n??""))}function Pu(t){return function(){this.textContent=t}}function Tu(t){return function(){var e=t(this);this.textContent=e??""}}function Fu(t){return this.tween("text",typeof t=="function"?Tu(Ie(this,"text",t)):Pu(t==null?"":t+""))}function Nu(t){return function(e){this.textContent=t.call(this,e)}}function ku(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Nu(i)),e}return r._value=t,r}function Ou(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,ku(t))}function Iu(){for(var t=this._name,e=this._id,n=tr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)if(s=o[l]){var f=Y(s,e);ae(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new K(r,this._parents,t,n)}function Ru(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},s={value:function(){--i===0&&a()}};n.each(function(){var l=W(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&a()})}var Lu=0;function K(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function tr(){return++Lu}var Z=Ct.prototype;K.prototype={constructor:K,select:yu,selectAll:wu,selectChild:Z.selectChild,selectChildren:Z.selectChildren,filter:fu,merge:hu,selection:xu,transition:Iu,call:Z.call,nodes:Z.nodes,node:Z.node,size:Z.size,empty:Z.empty,each:Z.each,on:mu,attr:jo,attrTween:tu,style:Du,styleTween:Cu,text:Fu,textTween:Ou,remove:vu,tween:Ho,delay:ru,duration:ou,ease:su,easeVarying:cu,end:Ru,[Symbol.iterator]:Z[Symbol.iterator]};function Vu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Gu={time:null,delay:0,duration:250,ease:Vu};function zu(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Hu(t){var e,n;t instanceof K?(e=t._id,t=t._name):(e=tr(),(n=Gu).time=Te(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&ae(s,t,e,l,o,n||zu(s,e));return new K(r,this._parents,t,e)}Ct.prototype.interrupt=Vo,Ct.prototype.transition=Hu;function Uu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function oe(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function yt(t){return t=oe(Math.abs(t)),t?t[1]:NaN}function Xu(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Yu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Bu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ue(t){if(!(e=Bu.exec(t)))throw new Error("invalid format: "+t);var e;return new Re({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ue.prototype=Re.prototype;function Re(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+""}Re.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 Wu(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var er;function qu(t,e){var n=oe(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(er=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+oe(t,Math.max(0,e+a-1))[0]}function nr(t,e){var n=oe(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const rr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Uu,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>nr(t*100,e),r:nr,s:qu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ir(t){return t}var ar=Array.prototype.map,or=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ju(t){var e=t.grouping===void 0||t.thousands===void 0?ir:Xu(ar.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",a=t.numerals===void 0?ir:Yu(ar.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=ue(c);var h=c.fill,d=c.align,m=c.sign,p=c.symbol,g=c.zero,_=c.width,M=c.comma,b=c.precision,E=c.trim,y=c.type;y==="n"?(M=!0,y="g"):rr[y]||(b===void 0&&(b=12),E=!0,y="g"),(g||h==="0"&&d==="=")&&(g=!0,h="0",d="=");var F=p==="$"?n:p==="#"&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w=p==="$"?r:/[%p]/.test(y)?o:"",$=rr[y],A=/[defgprs%]/.test(y);b=b===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function S(v){var N=F,k=w,H,ot,Mt;if(y==="c")k=$(v)+k,v="";else{v=+v;var tt=v<0||1/v<0;if(v=isNaN(v)?s:$(Math.abs(v),b),E&&(v=Wu(v)),tt&&+v==0&&m!=="+"&&(tt=!1),N=(tt?m==="("?m:u:m==="-"||m==="("?"":m)+N,k=(y==="s"?or[8+er/3]:"")+k+(tt&&m==="("?")":""),A){for(H=-1,ot=v.length;++H<ot;)if(Mt=v.charCodeAt(H),48>Mt||Mt>57){k=(Mt===46?i+v.slice(H+1):v.slice(H))+k,v=v.slice(0,H);break}}}M&&!g&&(v=e(v,1/0));var pt=N.length+v.length+k.length,et=pt<_?new Array(_-pt+1).join(h):"";switch(M&&g&&(v=e(et+v,et.length?_-k.length:1/0),et=""),d){case"<":v=N+v+k+et;break;case"=":v=N+et+v+k;break;case"^":v=et.slice(0,pt=et.length>>1)+N+v+k+et.slice(pt);break;default:v=et+N+v+k;break}return a(v)}return S.toString=function(){return c+""},S}function f(c,h){var d=l((c=ue(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(yt(h)/3)))*3,p=Math.pow(10,-m),g=or[8+m/3];return function(_){return d(p*_)+g}}return{format:l,formatPrefix:f}}var se,Le,ur;Ku({thousands:",",grouping:[3],currency:["$",""]});function Ku(t){return se=ju(t),Le=se.format,ur=se.formatPrefix,se}function Zu(t){return Math.max(0,-yt(Math.abs(t)))}function Ju(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(yt(e)/3)))*3-yt(Math.abs(t)))}function Qu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,yt(e)-yt(t))+1}function le(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const sr=Symbol("implicit");function lr(){var t=new hn,e=[],n=[],r=sr;function i(a){let o=t.get(a);if(o===void 0){if(r!==sr)return r;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new hn;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return lr(e,n).unknown(r)},le.apply(i,arguments),i}function cr(){var t=lr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,m=d?i:r,p=d?r:i;a=(p-m)/Math.max(1,h-s+l*2),u&&(a=Math.floor(a)),m+=(p-m-a*(h-s))*f,o=a*(1-s),u&&(m=Math.round(m),o=Math.round(o));var g=xi(h).map(function(_){return m+a*_});return n(d?g.reverse():g)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(s=Math.min(1,l=+h),c()):s},t.paddingInner=function(h){return arguments.length?(s=Math.min(1,h),c()):s},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return cr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},le.apply(c(),arguments)}function fr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return fr(e())},t}function ts(){return fr(cr.apply(null,arguments).paddingInner(1))}function es(t){return function(){return t}}function ns(t){return+t}var hr=[0,1];function wt(t){return t}function Ve(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:es(isNaN(e)?NaN:.5)}function rs(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function is(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Ve(i,r),a=n(o,a)):(r=Ve(r,i),a=n(a,o)),function(u){return a(r(u))}}function as(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Ve(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var s=fn(t,u,1,r)-1;return a[s](i[s](u))}}function os(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function us(){var t=hr,e=hr,n=Ce,r,i,a,o=wt,u,s,l;function f(){var h=Math.min(t.length,e.length);return o!==wt&&(o=rs(t[0],t[h-1])),u=h>2?as:is,s=l=null,c}function c(h){return h==null||isNaN(h=+h)?a:(s||(s=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((l||(l=u(e,t.map(r),X)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,ns),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=Do,f()},c.clamp=function(h){return arguments.length?(o=h?!0:wt,f()):o!==wt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function ss(){return us()(wt,wt)}function ls(t,e,n,r){var i=bi(t,e,n),a;switch(r=ue(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Ju(i,o))&&(r.precision=a),ur(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Qu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Zu(i))&&(r.precision=a-(r.type==="%")*2);break}}return Le(r)}function dr(t){var e=t.domain;return t.ticks=function(n){var r=e();return wi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return ls(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],s,l,f=10;for(u<o&&(l=o,o=u,u=l,l=i,i=a,a=l);f-- >0;){if(l=we(o,u,n),l===s)return r[i]=o,r[a]=u,e(r);if(l>0)o=Math.floor(o/l)*l,u=Math.ceil(u/l)*l;else if(l<0)o=Math.ceil(o*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function pr(){var t=ss();return t.copy=function(){return os(t,pr())},le.apply(t,arguments),dr(t)}function mr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(s){return s!=null&&s<=s?i[fn(r,s,0,n)]:a}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return o}return o.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},o.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},o.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return r.slice()},o.copy=function(){return mr().domain([t,e]).range(i).unknown(a)},le.apply(dr(o),arguments)}function Rt(t,e,n){this.k=t,this.x=e,this.y=n}Rt.prototype={constructor:Rt,scale:function(t){return t===1?this:new Rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Rt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Rt.prototype;function q(t){return Object.prototype.toString.call(t)==="[object Object]"}function cs(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function J(t,e){if(q(t)===!1||q(e)===!1)return Object.assign({},e);const n=(r,i)=>{const a=Object.assign({},i);for(let o of Object.keys(r)){if(!(o in i))continue;let u;q(r[o])&&q(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function fs(t=0){try{let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}catch(e){console.error(e)}}function hs(t,e){return e instanceof Function?e(t):Le(e)(t)}function ce(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function Ge(t,e){return`${t}_series${e}`}function gr(t,e){return`${t}_group${e}`}function vr({transposedDataGrid:t,dataFormatter:e,chartType:n="grid",gridIndex:r=0}){const i=e.grid.seriesType==="row"?e.grid.rowLabels:e.grid.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:Ge(`${n}_grid${r}`,o))}function yr({transposedDataGrid:t,dataFormatter:e,chartType:n="grid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.grid.seriesType==="row"?e.grid.columnLabels:e.grid.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:gr(`${n}_grid${r}`,o))}function bt(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function fe(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return bt(e)}function ds(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function ze(t){const n=t.flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function ps(t){const n=t.flat().flat().filter(r=>(r==null||q(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return bt(n)}function ms(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||q(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return bt(r)}function wr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((a,o)=>Math.max(a,o.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let a=0;a<n;a++)for(let o=0;o<r;o++)i[o][a]=e[a][o];return i}function he(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function gs(t,e){const n=new Map;let r=Object.assign([],t),i=[];return r.forEach((a,o)=>{Array.isArray(a)?a.forEach((u,s)=>{i.push({rowIndex:o,columnIndex:s,index:-1,datum:u})}):i.push({rowIndex:o,columnIndex:0,index:-1,datum:a})}),i.sort((a,o)=>e(a.datum,o.datum)),i=i.map((a,o)=>({...a,index:o})),i.forEach(a=>{n.set(String([a.rowIndex,a.columnIndex]),a.index)}),n}const vs=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=[];try{const a=(u=>{if(u){const s=gs(e,n.sort);return(l,f,c)=>s.get(String([f,c]))}else return(s,l,f)=>s.length})(n.sort!=null),o=(u,s,l,f,c)=>{const h=ce(n.type,s,l),d=n.seriesLabels[s]||Ge("series",s),m=he(s,r),p=n.visibleFilter(u,s,l,t);return typeof u=="number"?{id:h,index:f,sortedIndex:c,label:h,description:"",data:{},value:u,seriesIndex:s,seriesLabel:d,color:m,visible:p}:{id:u.id?u.id:h,index:f,sortedIndex:c,label:u.label?u.label:h,description:u.description,data:u.data??{},value:u.value,seriesIndex:s,seriesLabel:d,color:m,visible:p}};e.forEach((u,s)=>{if(Array.isArray(u))u.forEach((l,f)=>{const c=a(i,s,f),h=o(l,s,f,i.length,c);i.push(h)});else{const l=a(i,s,0),f=o(u,s,0,i.length,l);i.push(f)}})}catch(a){throw Error(a)}return i};var He=function(t,e){return He=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},He(t,e)};function Q(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");He(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function ys(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{l(r.next(f))}catch(c){o(c)}}function s(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function br(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function xt(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function nt(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function rt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}function _t(t){return this instanceof _t?(this.v=t,this):new _t(t)}function ws(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i={},u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(m){return Promise.resolve(m).then(d,c)}}function u(d,m){r[d]&&(i[d]=function(p){return new Promise(function(g,_){a.push([d,p,g,_])>1||s(d,p)})},m&&(i[d]=m(i[d])))}function s(d,m){try{l(r[d](m))}catch(p){h(a[0][3],p)}}function l(d){d.value instanceof _t?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){s("next",d)}function c(d){s("throw",d)}function h(d,m){d(m),a.shift(),a.length&&s(a[0][0],a[0][1])}}function bs(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof xt=="function"?xt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,s){o=t[a](o),i(u,s,o.done,o.value)})}}function i(a,o,u,s){Promise.resolve(s).then(function(l){a({value:l,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function T(t){return typeof t=="function"}function Ue(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Xe=Ue(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
2
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function de(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Vt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var u=xt(a),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(p){e={error:p}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else a.remove(this);var f=this.initialTeardown;if(F(f))try{f()}catch(p){o=p instanceof Ye?p.errors:[p]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=xt(c),d=h.next();!d.done;d=h.next()){var m=d.value;try{_r(m)}catch(p){o=o??[],p instanceof Ye?o=rt(rt([],nt(o)),nt(p.errors)):o.push(p)}}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new Ye(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)_r(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&de(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&de(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),br=Vt.EMPTY;function xr(t){return t instanceof Vt||t&&"closed"in t&&F(t.remove)&&F(t.add)&&F(t.unsubscribe)}function _r(t){F(t)?t():t.unsubscribe()}var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ar={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,rt([t,e],nt(n)))},clearTimeout:function(t){var e=Ar.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Sr(t){Ar.setTimeout(function(){throw t})}function We(){}function pe(t){t()}var Be=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,xr(n)&&n.add(r)):r.destination=As,r}return e.create=function(n,r,i){return new Gt(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Vt),xs=Function.prototype.bind;function qe(t,e){return xs.call(t,e)}var _s=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){me(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){me(r)}else me(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){me(n)}},t}(),Gt=function(t){J(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(F(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;o&&$r.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&qe(n.next,u),error:n.error&&qe(n.error,u),complete:n.complete&&qe(n.complete,u)}):a=n}return o.destination=new _s(a),o}return e}(Be);function me(t){Sr(t)}function $s(t){throw t}var As={closed:!0,next:We,error:$s,complete:We},je=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $t(t){return t}function Ss(t){return t.length===0?$t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var E=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=Ms(e)?e:new Gt(e,n,r);return pe(function(){var a=i,u=a.operator,s=a.source;o.add(u?u.call(o,s):s?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Dr(n),new n(function(i,o){var a=new Gt({next:function(u){try{e(u)}catch(s){o(s),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[je]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ss(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Dr(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function Dr(t){var e;return(e=t??$r.Promise)!==null&&e!==void 0?e:Promise}function Ds(t){return t&&F(t.next)&&F(t.error)&&F(t.complete)}function Ms(t){return t&&t instanceof Be||Ds(t)&&xr(t)}function Cs(t){return F(t==null?void 0:t.lift)}function O(t){return function(e){if(Cs(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function I(t,e,n,r,i){return new Es(t,e,n,r,i)}var Es=function(t){J(e,t);function e(n,r,i,o,a,u){var s=t.call(this,n)||this;return s.onFinalize=a,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=o?function(l){try{o(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Be),Ps=Xe(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=function(t){J(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Mr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ps},e.prototype.next=function(n){var r=this;pe(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=xt(r.currentObservers),u=a.next();!u.done;u=a.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;pe(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;pe(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,u=i.observers;return o||a?br:(this.currentObservers=null,u.push(n),new Vt(function(){r.currentObservers=null,de(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new E;return n.source=this,n},e.create=function(n,r){return new Mr(n,r)},e}(E),Mr=function(t){J(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:br},e}(P),Ke={now:function(){return(Ke.delegate||Date).now()},delegate:void 0},Ts=function(t){J(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=Ke);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(o.push(n),!a&&o.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,u=a.slice(),s=0;s<u.length&&!n.closed;s+=o?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,u=(a?1:2)*r;if(r<1/0&&u<o.length&&o.splice(0,o.length-u),!a){for(var s=i.now(),l=0,f=1;f<o.length&&o[f]<=s;f+=2)l=f;l&&o.splice(0,l+1)}},e}(P),Fs=function(t){J(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Vt),Ze={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,rt([t,e],nt(n)))},clearInterval:function(t){var e=Ze.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Ns=function(t){J(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Ze.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Ze.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,de(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Fs),Cr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=Ke.now,t}(),ks=function(t){J(e,t);function e(n,r){r===void 0&&(r=Cr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Cr),Je=new ks(Ns),Os=Je,Qe=new E(function(t){return t.complete()});function Er(t){return t&&F(t.schedule)}function tn(t){return t[t.length-1]}function Is(t){return F(tn(t))?t.pop():void 0}function At(t){return Er(tn(t))?t.pop():void 0}function Pr(t,e){return typeof tn(t)=="number"?t.pop():e}var Tr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Fr(t){return F(t==null?void 0:t.then)}function Nr(t){return F(t[je])}function kr(t){return Symbol.asyncIterator&&F(t==null?void 0:t[Symbol.asyncIterator])}function Or(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Rs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ir=Rs();function Rr(t){return F(t==null?void 0:t[Ir])}function Lr(t){return ws(this,arguments,function(){var n,r,i,o;return wr(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,_t(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,_t(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,_t(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Vr(t){return F(t==null?void 0:t.getReader)}function z(t){if(t instanceof E)return t;if(t!=null){if(Nr(t))return Ls(t);if(Tr(t))return Vs(t);if(Fr(t))return Gs(t);if(kr(t))return Gr(t);if(Rr(t))return zs(t);if(Vr(t))return Hs(t)}throw Or(t)}function Ls(t){return new E(function(e){var n=t[je]();if(F(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Vs(t){return new E(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Gs(t){return new E(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Sr)})}function zs(t){return new E(function(e){var n,r;try{for(var i=xt(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Gr(t){return new E(function(e){Us(t,e).catch(function(n){return e.error(n)})})}function Hs(t){return Gr(Lr(t))}function Us(t,e){var n,r,i,o;return ys(this,void 0,void 0,function(){var a,u;return wr(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=bs(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function it(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function zr(t,e){return e===void 0&&(e=0),O(function(n,r){n.subscribe(I(r,function(i){return it(r,t,function(){return r.next(i)},e)},function(){return it(r,t,function(){return r.complete()},e)},function(i){return it(r,t,function(){return r.error(i)},e)}))})}function Hr(t,e){return e===void 0&&(e=0),O(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Xs(t,e){return z(t).pipe(Hr(e),zr(e))}function Ys(t,e){return z(t).pipe(Hr(e),zr(e))}function Ws(t,e){return new E(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Bs(t,e){return new E(function(n){var r;return it(n,e,function(){r=t[Ir](),it(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(u){n.error(u);return}a?n.complete():n.next(o)},0,!0)}),function(){return F(r==null?void 0:r.return)&&r.return()}})}function Ur(t,e){if(!t)throw new Error("Iterable cannot be null");return new E(function(n){it(n,e,function(){var r=t[Symbol.asyncIterator]();it(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function qs(t,e){return Ur(Lr(t),e)}function js(t,e){if(t!=null){if(Nr(t))return Xs(t,e);if(Tr(t))return Ws(t,e);if(Fr(t))return Ys(t,e);if(kr(t))return Ur(t,e);if(Rr(t))return Bs(t,e);if(Vr(t))return qs(t,e)}throw Or(t)}function St(t,e){return e?js(t,e):z(t)}function zt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t);return St(t,n)}var Xr=Xe(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Ks(t){return t instanceof Date&&!isNaN(t)}function L(t,e){return O(function(n,r){var i=0;n.subscribe(I(r,function(o){r.next(t.call(e,o,i++))}))})}var Zs=Array.isArray;function Js(t,e){return Zs(e)?t.apply(void 0,rt([],nt(e))):t(e)}function Qs(t){return L(function(e){return Js(t,e)})}var tl=Array.isArray,el=Object.getPrototypeOf,nl=Object.prototype,rl=Object.keys;function il(t){if(t.length===1){var e=t[0];if(tl(e))return{args:e,keys:null};if(ol(e)){var n=rl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function ol(t){return t&&typeof t=="object"&&el(t)===nl}function al(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function ct(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Is(t),i=il(t),o=i.args,a=i.keys;if(o.length===0)return St([],n);var u=new E(ul(o,n,a?function(s){return al(a,s)}:$t));return r?u.pipe(Qs(r)):u}function ul(t,e,n){return n===void 0&&(n=$t),function(r){Yr(e,function(){for(var i=t.length,o=new Array(i),a=i,u=i,s=function(f){Yr(e,function(){var c=St(t[f],e),h=!1;c.subscribe(I(r,function(d){o[f]=d,h||(h=!0,u--),u||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function Yr(t,e,n){t?it(n,t,e):e()}function sl(t,e,n,r,i,o,a,u){var s=[],l=0,f=0,c=!1,h=function(){c&&!s.length&&!l&&e.complete()},d=function(p){return l<r?m(p):s.push(p)},m=function(p){l++;var g=!1;z(n(p,f++)).subscribe(I(e,function($){e.next($)},function(){g=!0},void 0,function(){if(g)try{l--;for(var $=function(){var D=s.shift();a||m(D)};s.length&&l<r;)$();h()}catch(D){e.error(D)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){}}function Wr(t,e,n){return n===void 0&&(n=1/0),F(e)?Wr(function(r,i){return L(function(o,a){return e(r,o,i,a)})(z(t(r,i)))},n):(typeof e=="number"&&(n=e),O(function(r,i){return sl(r,i,t,n)}))}function en(t){return t===void 0&&(t=1/0),Wr($t,t)}function ll(){return en(1)}function Br(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ll()(St(t,At(t)))}function cl(t){return new E(function(e){z(t()).subscribe(e)})}function fl(t,e,n){return cl(function(){return t()?e:n})}function hl(t,e,n){n===void 0&&(n=Os);var r=-1;return e!=null&&(Er(e)?n=e:r=e),new E(function(i){var o=Ks(t)?+t-n.now():t;o<0&&(o=0);var a=0;return n.schedule(function(){i.closed||(i.next(a++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function dl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Pr(t,1/0),i=t;return i.length?i.length===1?z(i[0]):en(r)(St(i,n)):Qe}var pl=Array.isArray;function ml(t){return t.length===1&&pl(t[0])?t[0]:t}function qr(t,e){return O(function(n,r){var i=0;n.subscribe(I(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function jr(t){return O(function(e,n){var r=null,i=!1,o;r=e.subscribe(I(n,void 0,void 0,function(a){o=z(t(a,jr(t)(e))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function gl(t,e){return e===void 0&&(e=Je),O(function(n,r){var i=null,o=null,a=null,u=function(){if(i){i.unsubscribe(),i=null;var l=o;o=null,r.next(l)}};function s(){var l=a+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(I(r,function(l){o=l,a=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){o=i=null}))})}function vl(t){return O(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function yl(t){return t<=0?function(){return Qe}:O(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function nn(t,e){return e===void 0&&(e=$t),t=t??wl,O(function(n,r){var i,o=!0;n.subscribe(I(r,function(a){var u=e(a);(o||!t(i,u))&&(o=!1,i=u,r.next(a))}))})}function wl(t,e){return t===e}function bl(t){return t===void 0&&(t=xl),O(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function xl(){return new Xr}function _l(t,e){var n=arguments.length>=2;return function(r){return r.pipe($t,yl(1),n?vl(e):bl(function(){return new Xr}))}}function $l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Pr(t,1/0);return t=ml(t),O(function(i,o){en(r)(St(rt([i],nt(t)),n)).subscribe(o)})}function Al(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $l.apply(void 0,rt([],nt(t)))}function rn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new P}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,h,d=0,m=!1,p=!1,g=function(){c==null||c.unsubscribe(),c=void 0},$=function(){g(),f=h=void 0,m=p=!1},D=function(){var x=f;$(),x==null||x.unsubscribe()};return O(function(x,M){d++,!p&&!m&&g();var w=h=h??n();M.add(function(){d--,d===0&&!p&&!m&&(c=on(D,s))}),w.subscribe(M),!f&&d>0&&(f=new Gt({next:function(C){return w.next(C)},error:function(C){p=!0,g(),c=on($,i,C),w.error(C)},complete:function(){m=!0,g(),c=on($,a),w.complete()}}),z(x).subscribe(f))})(l)}}function on(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Gt({next:function(){i.unsubscribe(),t()}});return z(e.apply(void 0,rt([],nt(n)))).subscribe(i)}}function S(t,e,n){var r,i=!1;return r=t,rn({connector:function(){return new Ts(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t);return O(function(r,i){(n?Br(t,r,n):Br(t,r)).subscribe(i)})}function ot(t,e){return O(function(n,r){var i=null,o=0,a=!1,u=function(){return a&&!i&&r.complete()};n.subscribe(I(r,function(s){i==null||i.unsubscribe();var l=0,f=o++;z(t(s,f)).subscribe(i=I(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){a=!0,u()}))})}function R(t){return O(function(e,n){z(t).subscribe(I(n,function(){return n.complete()},We)),!n.closed&&e.subscribe(n)})}function Sl(t,e){return O(function(n,r){var i=e??{},o=i.leading,a=o===void 0?!0:o,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,s&&(g(),h&&r.complete())},m=function(){c=null,h&&r.complete()},p=function($){return c=z(t($)).subscribe(I(r,d,m))},g=function(){if(l){l=!1;var $=f;f=null,r.next($),!h&&p($)}};n.subscribe(I(r,function($){l=!0,f=$,!(c&&!c.closed)&&(a?g():p($))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function Dl(t,e,n){e===void 0&&(e=Je);var r=hl(t,e);return Sl(function(){return r},n)}const ve=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new P,i=e.pipe(R(r),L(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),nn()),o=n.pipe(R(r),qr(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),L(s=>s.datum?{id:s.datum.id,seriesLabel:s.datum.seriesLabel,groupLabel:s.datum.groupLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,highlightDefault:null})),a=n.pipe(R(r),qr(s=>s.eventName==="mouseout"),ot(s=>i)),u=({data:s,id:l,seriesLabel:f,groupLabel:c,highlightDefault:h,target:d})=>{let m=[];if(h!=null&&h!=""){if(d==="datum")l=h;else if(d==="series"){const p=s.flat().find(g=>g.id===h||g.seriesLabel===h);f=p&&p.seriesLabel?p.seriesLabel:null}else if(d==="group"){const p=s.flat().find(g=>g.id===h||g.groupLabel===h);c=p&&p.groupLabel?p.groupLabel:null}}if(d==="datum"&&l!=null&&l!="")m.push(l);else if(d==="series"&&f!=null&&f!=""){const p=s.flat().filter(g=>g.seriesLabel===f).map(g=>g.id);m=m.concat(p)}else if(d==="group"&&c!=null&&c!=""){const p=s.flat().filter(g=>g.groupLabel===c).map(g=>g.id);m=m.concat(p)}return m};return new E(s=>(ct({target:dl(o,a,i),datumList:t,fullChartParams:e}).pipe(R(r)).subscribe(l=>{const f=u({data:l.datumList,id:l.target.id,seriesLabel:l.target.seriesLabel,groupLabel:l.target.groupLabel,highlightDefault:l.target.highlightDefault,target:l.fullChartParams.highlightTarget});s.next(f)}),function(){r.next(void 0)}))},ye=({datumList$:t})=>t.pipe(L(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),an=({datumList$:t})=>t.pipe(L(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Ml=({subject:t,observer:e})=>{const n=ve({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(S(1)),r=ye({datumList$:e.computedData$}).pipe(S(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ft=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const o=r[0]??j.scaleDomain[0],a=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=o==="auto"?e:o,f=a==="auto"?t:a;let c=n*u,h=n*s;return dr().domain([l,f]).range([c,h])},Cl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ts().domain(t).range(r).padding(n)},El=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let o=t.map((a,u)=>u);return r&&o.reverse(),pr().domain([-0,e+0]).range(o)},Pl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Tl(t){return new E(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const Fl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new P,i=t.type;return function(a,u){Bt(a).selectAll("svg").remove();const s=Bt(a).append("svg");s.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const l=s.append("g");l.classed("orbcharts__layout",!0);const f=l.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new P,dataFormatter$:new P,plugins$:new P,chartParams$:new P,event$:new P},h=(v=>{const A=v||Et,b=A.preset?A.preset:{};return{chartParams:b.chartParams?et(b.chartParams,sn):sn,dataFormatter:b.dataFormatter?et(b.dataFormatter,t):t,allPluginParams:b.allPluginParams?b.allPluginParams:{},description:b.description??""}})(u),d=c.data$.pipe(S(1)),m=c.dataFormatter$.pipe(R(r),ge({}),L(v=>et(v,h.dataFormatter)),S(1)),p=c.chartParams$.pipe(R(r),ge({}),L(v=>et(v,h.chartParams)),S(1)),g=p.pipe(R(r),ge({}),L(v=>et(v.padding??{},un)));g.pipe(R(r),_l()).subscribe(v=>{l.attr("transform",`translate(${v.left}, ${v.top})`)}),g.subscribe(v=>{l.transition().attr("transform",`translate(${v.left}, ${v.top})`)});const $=Tl(a).pipe(R(r),rn()),D=zt().pipe(Al($.pipe(gl(250)),$.pipe(Dl(250))),nn((v,A)=>JSON.stringify(v)===JSON.stringify(A)),rn()),x=D.subscribe(),M=ct({rootSize:D,mergedPadding:g}).pipe(R(r),ot(async v=>{const A=v.rootSize.width>0?v.rootSize.width:ni,b=v.rootSize.height>0?v.rootSize.height:ri;return{width:A-v.mergedPadding.left-v.mergedPadding.right,height:b-v.mergedPadding.top-v.mergedPadding.bottom,top:v.mergedPadding.top,right:v.mergedPadding.right,bottom:v.mergedPadding.bottom,left:v.mergedPadding.left,rootWidth:A,rootHeight:b}}),S(1));M.subscribe(v=>{s.attr("width",v.rootWidth).attr("height",v.rootHeight)});const w=ct({data:d,dataFormatter:m,chartParams:p,layout:fl(()=>Pl[i]===!0,M,zt(void 0))}).pipe(R(r),ot(async v=>v),ot(v=>zt(v).pipe(L(A=>{try{return e({data:A.data,dataFormatter:A.dataFormatter,chartParams:A.chartParams,layout:A.layout})}catch(b){throw console.error(b),new Error(b)}}),jr(()=>Qe))),S(1)),C={};return c.plugins$.subscribe(v=>{if(!v)return;const A=f.selectAll("g.orbcharts__plugin").data(v,y=>y.name),b=A.enter().append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`);A.exit().remove().each((y,k,T)=>{C[y.name]&&C[y.name].destroy()}),b.each((y,k,T)=>{const Y={fullParams$:new E,fullChartParams$:p,fullDataFormatter$:m,computedData$:w,layout$:M},Mt=n({observer:Y,subject:c}),Q={selection:Bt(T[k]),rootSelection:s,name:y.name,chartType:i,subject:c,observer:Mt};y.setPresetParams(h.allPluginParams[y.name]??{}),y.setContext(Q),C[Q.name]=y,y.init()})}),{...c,selection:s,destroy(){Bt(a).selectAll("svg").remove(),r.next(void 0),x.unsubscribe()}}}};class Dt{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,o){this.data$=new P,this.dataFormatter$=new P,this.plugins$=new P,this.chartParams$=new P,this.event$=new P;const u=Fl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,o);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Nl extends Dt{constructor(e,n){super({defaultDataFormatter:oi,computedDataFn:vs,contextObserverFn:Ml},e,n)}}const Kr=t=>{const{data:e=[],dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o;try{const a=e.reduce((v,A)=>A.length>v?A.length:v,0),s=e.map((v,A)=>{if(v.length===a)return v;const b=Object.assign([],v);for(let N=b.length;N<a;N++)b[N]=null;return b}).map((v,A)=>v.map((b,N)=>{const y=n.colorsPredicate(b,A,N,t),k=n.visibleFilter(b,A,N,t);return b==null?{id:"",label:"",tooltipContent:"",data:{},value:null,_color:y,_visible:k}:typeof b=="number"?{id:"",label:"",tooltipContent:"",data:{},value:b,_color:y,_visible:k}:{id:b.id??"",label:b.label??"",tooltipContent:b.tooltipContent??"",data:b.data??{},value:b.value,_color:y,_visible:k}})),l=yr(n.grid.seriesType,s),f=n.groupAxis.position==="top"||n.groupAxis.position==="bottom"?i.width:i.height,c=l[0]?l[0].length-1:0,h=ft({maxValue:c,minValue:0,axisWidth:f,scaleDomain:[0,c],scaleRange:[0,1]}),d=[n.groupAxis.scaleDomain[0]==="auto"?0:n.groupAxis.scaleDomain[0],n.groupAxis.scaleDomain[1]==="auto"?c:n.groupAxis.scaleDomain[1]],m=l.flat().filter(v=>v._visible!=!1),[p,g]=he(m),$=n.valueAxis.position==="left"||n.valueAxis.position==="right"?i.height:i.width,D=gr(l,n),x=vr(l,n),M=ft({maxValue:g,minValue:p,axisWidth:$,scaleDomain:[p,g],scaleRange:[0,1]}),w=M(0);let C=0;o=l.map((v,A)=>v.map((b,N)=>{const y=fe(n.type,A,N),k=x[N],T=M(b.value??0),Y={id:b.id?b.id:y,index:C,label:b.label?b.label:y,tooltipContent:b.tooltipContent?b.tooltipContent:n.tooltipContentFormat(b,A,N,t),data:b.data,value:b.value,seriesIndex:A,seriesLabel:D[A],groupIndex:N,groupLabel:k,color:b._color,axisX:h(N),axisY:T,axisYFromZero:T-w,visible:b._visible};return C++,Y}))}catch(a){throw Error(a)}return o},Zr=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxis:i,yAxis:o,width:a,height:u}){if(!i||!o)return{translate:[0,0],scale:[0,0],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?o.position==="left"?(c=180,l=u):o.position==="right"?(c=180,h=180,s=a,l=u):(c=180,l=u):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,s=a):(c=180,l=u)):i.position==="left"?o.position==="bottom"?(f=-90,l=u):o.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(o.position==="bottom"?(f=-90,c=180,l=u,s=a):o.position==="top"?(f=-90,s=a):(c=180,l=u)),{translate:[s,l],scale:[0,0],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new E(i=>(ct({fullDataFormatter:t,layout:e}).pipe(R(n),ot(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.groupAxis,yAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Jr=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new P;function i({data:o,groupAxis:a,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const m=a.position==="top"||a.position==="bottom"?s:l,p=0,g=o[0]?o[0].length-1:0,$=a.scaleDomain[0]==="auto"?p-a.scalePadding:a.scaleDomain[0]-a.scalePadding,D=a.scaleDomain[1]==="auto"?g+a.scalePadding:a.scaleDomain[1]+a.scalePadding,x=ft({maxValue:g,minValue:p,axisWidth:m,scaleDomain:[$,D],scaleRange:[0,1]}),M=x(p),w=x(g);f=M,h=(w-M)/m;const v=o.map((Mt,Ct)=>Mt.filter((Q,dt)=>dt>=$&&dt<=D&&Q.visible==!0)),A=He(v),b=u.position==="left"||u.position==="right"?l:s,N=ft({maxValue:A[1],minValue:A[0],axisWidth:b,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),y=He(o),k=N(y[0]),T=N(y[1]);return c=k,d=(T-k)/b,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new E(o=>(ct({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(r),ot(async a=>a)).subscribe(a=>{const u=i({data:a.computedData,groupAxis:a.fullDataFormatter.groupAxis,valueAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});o.next(u)}),function(){r.next(void 0)}))},Qr=({gridAxesTransform$:t})=>t.pipe(L(e=>{const n=[0,0],r=[e.scale[0]*-1,e.scale[1]*-1],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${o}deg) rotateY(${a}deg)`}})),ti=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxisPosition:i,yAxisPosition:o,width:a,height:u}){if((i==="bottom"||i==="top")&&(o==="left"||o==="right"))return{width:a,height:u};if((i==="left"||i==="right")&&(o==="bottom"||o==="top"))return{width:u,height:a}}return new E(i=>{ct({fullDataFormatter:t,layout:e}).pipe(R(n),ot(async o=>o)).subscribe(o=>{const a=r({xAxisPosition:o.fullDataFormatter.groupAxis.position,yAxisPosition:o.fullDataFormatter.valueAxis.position,width:o.layout.width,height:o.layout.height});return i.next(a),function(){n.next(void 0)}})})},ei=({computedData$:t})=>t.pipe(L(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),kl=({subject:t,observer:e})=>{const n=Zr({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(S(1)),r=Jr({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(S(1)),i=Qr({gridAxesTransform$:n}).pipe(S(1)),o=ti({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(S(1)),a=e.computedData$.pipe(L(c=>c.flat())).pipe(S(1)),u=ve({datumList$:a,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(S(1)),s=ye({datumList$:a}).pipe(S(1)),l=an({datumList$:a}).pipe(S(1)),f=ei({computedData$:e.computedData$}).pipe(S(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,gridAxesTransform$:n,gridGraphicTransform$:r,gridAxesOppositeTransform$:i,gridAxesSize$:o,gridHighlight$:u,SeriesDataMap$:s,GroupDataMap$:l,visibleComputedData$:f}};class Ol extends Dt{constructor(e,n){super({defaultDataFormatter:we,computedDataFn:Kr,contextObserverFn:kl},e,n)}}const Il=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{i=t.map((o,a)=>{const u={...e.multiGrid[a],type:`multiGrid_${a}`,colorsPredicate:e.multiGrid[a].colorsPredicate,visibleFilter:e.visibleFilter,tooltipContentFormat:e.tooltipContentFormat};return Kr({data:o,dataFormatter:u,chartParams:n,layout:r})})}catch(o){throw Error(o)}return i},Rl=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const o=new P;return ct({fullDataFormatter:t,computedData:e}).pipe(ot(async a=>a),nn((a,u)=>a.computedData.length===u.computedData.length),L(a=>(o.next(void 0),a.computedData.map((u,s)=>{const l=a.fullDataFormatter.multiGrid[s]??a.fullDataFormatter.multiGrid[0],f=zt(l).pipe(R(o),S(1)),c=zt(u).pipe(R(o),S(1)),h=Zr({fullDataFormatter$:f,layout$:n}).pipe(S(1)),d=Jr({computedData$:c,fullDataFormatter$:f,layout$:n}).pipe(S(1)),m=Qr({gridAxesTransform$:h}).pipe(S(1)),p=ti({fullDataFormatter$:f,layout$:n}).pipe(S(1)),g=c.pipe(L(w=>w.flat())).pipe(S(1)),$=ve({datumList$:g,fullChartParams$:r,event$:i}).pipe(S(1)),D=ye({datumList$:g}).pipe(S(1)),x=an({datumList$:g}).pipe(S(1)),M=ei({computedData$:c}).pipe(S(1));return{gridAxesTransform$:h,gridGraphicTransform$:d,gridAxesOppositeTransform$:m,gridAxesSize$:p,gridHighlight$:$,SeriesDataMap$:D,GroupDataMap$:x,visibleComputedData$:M}}))))},Ll=({subject:t,observer:e})=>{const n=Rl({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(S(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGrid$:n}};class Vl extends Dt{constructor(e,n){super({defaultDataFormatter:ai,computedDataFn:Il,contextObserverFn:Ll},e,n)}}const Gl=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let o=[];try{const a=e.map((x,M)=>x.map((w,C)=>typeof w=="number"?{id:"",label:"",tooltipContent:"",data:{},value:w}:{id:w.id??"",label:w.label??"",tooltipContent:w.tooltipContent??"",data:w.data??{},value:w.value})),[u,s]=he(a.map(x=>x[0])),[l,f]=he(a.map(x=>x[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ft({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),m=ft({maxValue:f,minValue:l,axisWidth:h,scaleDomain:[l,f],scaleRange:[0,1]}),p=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?s:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?l:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],$=(x,M,w,C)=>w===0&&x.value!=null&&(x.value<p[0]||x.value>p[1])||w===1&&x.value!=null&&(x.value<g[0]||x.value>g[1])?!1:n.visibleFilter(x,M,w,C);let D=0;o=a.map((x,M)=>x.map((w,C)=>{const v=D;D++;const A=fe(n.type,M,C),b=$(w,M,C,t);return{id:w.id?w.id:A,index:v,label:w.label?w.label:A,tooltipContent:w.tooltipContent?w.tooltipContent:n.tooltipContentFormat(w,M,C,t),data:w.data,value:w.value,axis:C==0?d(w.value):m(w.value),visible:b}}))}catch(a){throw Error(a)}return o},zl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Hl extends Dt{constructor(e,n){super({defaultDataFormatter:ui,computedDataFn:Gl,contextObserverFn:zl},e,n)}}const Ul=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],o=[];try{let a=[],u=[];if(e.nodes)a=e.nodes,u=e.edges;else if(e[0])a=e[0],u=e[1];else return{nodes:[],edges:[]};i=a.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,0,h,t),data:c.data??{},value:c.value??0,startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const s=new Map(i.map(c=>[c.id,c]));o=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",tooltipContent:c.tooltipContent?c.tooltipContent:n.tooltipContentFormat(c,1,h,t),data:c.data??{},value:c.value??0,startNode:s.get(c.start),startNodeId:c.start,endNode:s.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const l=function(){const c=new Map;return o.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return o.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(s).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(a){throw Error(a)}return{nodes:i,edges:o}},Xl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Yl extends Dt{constructor(e,n){super({defaultDataFormatter:li,computedDataFn:Ul,contextObserverFn:Xl},e,n)}}const Wl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",visible:!0,tooltipContent:"",data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const l=new Map;e.forEach(c=>{if(!c.parent)s=c;else{const h=l.get(c.parent)??[];h.push(c),l.set(c.parent,h)}});const f=c=>({id:c.id,label:c.label,data:c.data,tooltipContent:c.tooltipContent,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let a=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=a;return a++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",data:s.data??{},tooltipContent:s.tooltipContent?s.tooltipContent:n.tooltipContentFormat(s,l,f,t),value:s.value,visible:h,children:(s.children??[]).map((m,p)=>u(m,c,p))}};i=u(o,0,0)}catch(o){throw Error(o)}return i},Bl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class ql extends Dt{constructor(e,n){super({defaultDataFormatter:si,computedDataFn:Wl,contextObserverFn:Bl},e,n)}}function jl({name:t,defaultParams:e,initFn:n}){const r=new P,i=new P,o=new WeakMap;let a=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(a=n(u)??(()=>{}),o.set(u.selection,u))},destroy(){a(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:l=>{s=et(l,e)},setContext:l=>{u=l,u.observer.fullParams$=i.pipe(R(r),ge({}),L(f=>et(f,s)),S(1))}}}const ht=()=>function(e,n){return function(i){return class{constructor(){const a=jl({name:e,defaultParams:n,initFn:i});this.params$=a.params$,this.name=a.name,this.defaultParams=a.defaultParams,this.init=a.init,this.destroy=a.destroy,this.setPresetParams=a.setPresetParams,this.setContext=a.setContext}}}},Kl=ht(),Zl=ht(),Jl=ht(),Ql=ht(),tc=ht(),ec=ht(),nc=ht();_.GridChart=Ol,_.MultiGridChart=Vl,_.MultiValueChart=Hl,_.RelationshipChart=Yl,_.SeriesChart=Nl,_.TreeChart=ql,_.createAxisLinearScale=ft,_.createAxisPointScale=Cl,_.createAxisQuantizeScale=El,_.createDefaultDatumId=fe,_.createDefaultGroupLabel=mr,_.createDefaultSeriesLabel=ze,_.createGridGroupLabels=vr,_.createGridSeriesLabels=gr,_.defineGridPlugin=Zl,_.defineMultiGridPlugin=Jl,_.defineMultiValuePlugin=Ql,_.defineNoneDataPlugin=tc,_.defineRelationshipPlugin=ec,_.defineSeriesPlugin=Kl,_.defineTreePlugin=nc,_.formatCommaNumber=fs,_.formatValueToLabel=hs,_.getMinAndMax=bt,_.getMinAndMaxGrid=He,_.getMinAndMaxMultiGrid=ps,_.getMinAndMaxMultiValue=ms,_.getMinAndMaxSeries=ds,_.getMinAndMaxValue=he,_.groupDataMapObservable=an,_.highlightObservable=ve,_.isFunction=cs,_.isObject=q,_.mergeOptionsWithDefault=et,_.seriesDataMapObservable=ye,_.transposeData=yr,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function de(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Lt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=xt(o),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(p){e={error:p}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(T(f))try{f()}catch(p){a=p instanceof Xe?p.errors:[p]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=xt(c),d=h.next();!d.done;d=h.next()){var m=d.value;try{$r(m)}catch(p){a=a??[],p instanceof Xe?a=rt(rt([],nt(a)),nt(p.errors)):a.push(p)}}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new Xe(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)$r(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&de(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&de(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),xr=Lt.EMPTY;function _r(t){return t instanceof Lt||t&&"closed"in t&&T(t.remove)&&T(t.add)&&T(t.unsubscribe)}function $r(t){T(t)?t():t.unsubscribe()}var Ar={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Sr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,rt([t,e],nt(n)))},clearTimeout:function(t){var e=Sr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Dr(t){Sr.setTimeout(function(){throw t})}function Ye(){}function pe(t){t()}var Be=function(t){Q(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,_r(n)&&n.add(r)):r.destination=As,r}return e.create=function(n,r,i){return new Vt(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Lt),xs=Function.prototype.bind;function We(t,e){return xs.call(t,e)}var _s=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){me(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){me(r)}else me(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){me(n)}},t}(),Vt=function(t){Q(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(T(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Ar.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&We(n.next,u),error:n.error&&We(n.error,u),complete:n.complete&&We(n.complete,u)}):o=n}return a.destination=new _s(o),a}return e}(Be);function me(t){Dr(t)}function $s(t){throw t}var As={closed:!0,next:Ye,error:$s,complete:Ye},qe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $t(t){return t}function Ss(t){return t.length===0?$t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var C=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=Ms(e)?e:new Vt(e,n,r);return pe(function(){var o=i,u=o.operator,s=o.source;a.add(u?u.call(a,s):s?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Mr(n),new n(function(i,a){var o=new Vt({next:function(u){try{e(u)}catch(s){a(s),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[qe]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ss(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Mr(e),new e(function(r,i){var a;n.subscribe(function(o){return a=o},function(o){return i(o)},function(){return r(a)})})},t.create=function(e){return new t(e)},t}();function Mr(t){var e;return(e=t??Ar.Promise)!==null&&e!==void 0?e:Promise}function Ds(t){return t&&T(t.next)&&T(t.error)&&T(t.complete)}function Ms(t){return t&&t instanceof Be||Ds(t)&&_r(t)}function Es(t){return T(t==null?void 0:t.lift)}function O(t){return function(e){if(Es(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function I(t,e,n,r,i){return new Cs(t,e,n,r,i)}var Cs=function(t){Q(e,t);function e(n,r,i,a,o,u){var s=t.call(this,n)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Be),Ps=Ue(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=function(t){Q(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Er(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ps},e.prototype.next=function(n){var r=this;pe(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=xt(r.currentObservers),u=o.next();!u.done;u=o.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;pe(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;pe(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?xr:(this.currentObservers=null,u.push(n),new Lt(function(){r.currentObservers=null,de(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new C;return n.source=this,n},e.create=function(n,r){return new Er(n,r)},e}(C),Er=function(t){Q(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:xr},e}(P),je={now:function(){return(je.delegate||Date).now()},delegate:void 0},Ts=function(t){Q(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=je);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),s=0;s<u.length&&!n.closed;s+=a?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var s=i.now(),l=0,f=1;f<a.length&&a[f]<=s;f+=2)l=f;l&&a.splice(0,l+1)}},e}(P),Fs=function(t){Q(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Lt),Ke={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,rt([t,e],nt(n)))},clearInterval:function(t){var e=Ke.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Ns=function(t){Q(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),Ke.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&Ke.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,de(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Fs),Cr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=je.now,t}(),ks=function(t){Q(e,t);function e(n,r){r===void 0&&(r=Cr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(Cr),Ze=new ks(Ns),Os=Ze,Je=new C(function(t){return t.complete()});function Pr(t){return t&&T(t.schedule)}function Qe(t){return t[t.length-1]}function Is(t){return T(Qe(t))?t.pop():void 0}function At(t){return Pr(Qe(t))?t.pop():void 0}function Tr(t,e){return typeof Qe(t)=="number"?t.pop():e}var Fr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Nr(t){return T(t==null?void 0:t.then)}function kr(t){return T(t[qe])}function Or(t){return Symbol.asyncIterator&&T(t==null?void 0:t[Symbol.asyncIterator])}function Ir(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Rs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Rr=Rs();function Lr(t){return T(t==null?void 0:t[Rr])}function Vr(t){return ws(this,arguments,function(){var n,r,i,a;return br(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,_t(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,_t(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,_t(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Gr(t){return T(t==null?void 0:t.getReader)}function z(t){if(t instanceof C)return t;if(t!=null){if(kr(t))return Ls(t);if(Fr(t))return Vs(t);if(Nr(t))return Gs(t);if(Or(t))return zr(t);if(Lr(t))return zs(t);if(Gr(t))return Hs(t)}throw Ir(t)}function Ls(t){return new C(function(e){var n=t[qe]();if(T(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Vs(t){return new C(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Gs(t){return new C(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Dr)})}function zs(t){return new C(function(e){var n,r;try{for(var i=xt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function zr(t){return new C(function(e){Us(t,e).catch(function(n){return e.error(n)})})}function Hs(t){return zr(Vr(t))}function Us(t,e){var n,r,i,a;return ys(this,void 0,void 0,function(){var o,u;return br(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=bs(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function it(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(a),!i)return a}function Hr(t,e){return e===void 0&&(e=0),O(function(n,r){n.subscribe(I(r,function(i){return it(r,t,function(){return r.next(i)},e)},function(){return it(r,t,function(){return r.complete()},e)},function(i){return it(r,t,function(){return r.error(i)},e)}))})}function Ur(t,e){return e===void 0&&(e=0),O(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Xs(t,e){return z(t).pipe(Ur(e),Hr(e))}function Ys(t,e){return z(t).pipe(Ur(e),Hr(e))}function Bs(t,e){return new C(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Ws(t,e){return new C(function(n){var r;return it(n,e,function(){r=t[Rr](),it(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return T(r==null?void 0:r.return)&&r.return()}})}function Xr(t,e){if(!t)throw new Error("Iterable cannot be null");return new C(function(n){it(n,e,function(){var r=t[Symbol.asyncIterator]();it(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function qs(t,e){return Xr(Vr(t),e)}function js(t,e){if(t!=null){if(kr(t))return Xs(t,e);if(Fr(t))return Bs(t,e);if(Nr(t))return Ys(t,e);if(Or(t))return Xr(t,e);if(Lr(t))return Ws(t,e);if(Gr(t))return qs(t,e)}throw Ir(t)}function St(t,e){return e?js(t,e):z(t)}function Gt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t);return St(t,n)}var Yr=Ue(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Ks(t){return t instanceof Date&&!isNaN(t)}function L(t,e){return O(function(n,r){var i=0;n.subscribe(I(r,function(a){r.next(t.call(e,a,i++))}))})}var Zs=Array.isArray;function Js(t,e){return Zs(e)?t.apply(void 0,rt([],nt(e))):t(e)}function Qs(t){return L(function(e){return Js(t,e)})}var tl=Array.isArray,el=Object.getPrototypeOf,nl=Object.prototype,rl=Object.keys;function il(t){if(t.length===1){var e=t[0];if(tl(e))return{args:e,keys:null};if(al(e)){var n=rl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function al(t){return t&&typeof t=="object"&&el(t)===nl}function ol(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function ft(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Is(t),i=il(t),a=i.args,o=i.keys;if(a.length===0)return St([],n);var u=new C(ul(a,n,o?function(s){return ol(o,s)}:$t));return r?u.pipe(Qs(r)):u}function ul(t,e,n){return n===void 0&&(n=$t),function(r){Br(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,s=function(f){Br(e,function(){var c=St(t[f],e),h=!1;c.subscribe(I(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function Br(t,e,n){t?it(n,t,e):e()}function sl(t,e,n,r,i,a,o,u){var s=[],l=0,f=0,c=!1,h=function(){c&&!s.length&&!l&&e.complete()},d=function(p){return l<r?m(p):s.push(p)},m=function(p){l++;var g=!1;z(n(p,f++)).subscribe(I(e,function(_){e.next(_)},function(){g=!0},void 0,function(){if(g)try{l--;for(var _=function(){var M=s.shift();o||m(M)};s.length&&l<r;)_();h()}catch(M){e.error(M)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){}}function Wr(t,e,n){return n===void 0&&(n=1/0),T(e)?Wr(function(r,i){return L(function(a,o){return e(r,a,i,o)})(z(t(r,i)))},n):(typeof e=="number"&&(n=e),O(function(r,i){return sl(r,i,t,n)}))}function tn(t){return t===void 0&&(t=1/0),Wr($t,t)}function ll(){return tn(1)}function qr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ll()(St(t,At(t)))}function cl(t){return new C(function(e){z(t()).subscribe(e)})}function fl(t,e,n){return cl(function(){return t()?e:n})}function hl(t,e,n){n===void 0&&(n=Os);var r=-1;return e!=null&&(Pr(e)?n=e:r=e),new C(function(i){var a=Ks(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function dl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Tr(t,1/0),i=t;return i.length?i.length===1?z(i[0]):tn(r)(St(i,n)):Je}var pl=Array.isArray;function ml(t){return t.length===1&&pl(t[0])?t[0]:t}function jr(t,e){return O(function(n,r){var i=0;n.subscribe(I(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Kr(t){return O(function(e,n){var r=null,i=!1,a;r=e.subscribe(I(n,void 0,void 0,function(o){a=z(t(o,Kr(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function gl(t,e){return e===void 0&&(e=Ze),O(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function s(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(I(r,function(l){a=l,o=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function vl(t){return O(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function yl(t){return t<=0?function(){return Je}:O(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function en(t,e){return e===void 0&&(e=$t),t=t??wl,O(function(n,r){var i,a=!0;n.subscribe(I(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function wl(t,e){return t===e}function bl(t){return t===void 0&&(t=xl),O(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function xl(){return new Yr}function _l(t,e){var n=arguments.length>=2;return function(r){return r.pipe($t,yl(1),n?vl(e):bl(function(){return new Yr}))}}function $l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t),r=Tr(t,1/0);return t=ml(t),O(function(i,a){tn(r)(St(rt([i],nt(t)),n)).subscribe(a)})}function Al(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return $l.apply(void 0,rt([],nt(t)))}function nn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new P}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,h,d=0,m=!1,p=!1,g=function(){c==null||c.unsubscribe(),c=void 0},_=function(){g(),f=h=void 0,m=p=!1},M=function(){var b=f;_(),b==null||b.unsubscribe()};return O(function(b,E){d++,!p&&!m&&g();var y=h=h??n();E.add(function(){d--,d===0&&!p&&!m&&(c=rn(M,s))}),y.subscribe(E),!f&&d>0&&(f=new Vt({next:function(F){return y.next(F)},error:function(F){p=!0,g(),c=rn(_,i,F),y.error(F)},complete:function(){m=!0,g(),c=rn(_,o),y.complete()}}),z(b).subscribe(f))})(l)}}function rn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Vt({next:function(){i.unsubscribe(),t()}});return z(e.apply(void 0,rt([],nt(n)))).subscribe(i)}}function D(t,e,n){var r,i=!1;return r=t,nn({connector:function(){return new Ts(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function ge(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=At(t);return O(function(r,i){(n?qr(t,r,n):qr(t,r)).subscribe(i)})}function at(t,e){return O(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(I(r,function(s){i==null||i.unsubscribe();var l=0,f=a++;z(t(s,f)).subscribe(i=I(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function R(t){return O(function(e,n){z(t).subscribe(I(n,function(){return n.complete()},Ye)),!n.closed&&e.subscribe(n)})}function Sl(t,e){return O(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,s&&(g(),h&&r.complete())},m=function(){c=null,h&&r.complete()},p=function(_){return c=z(t(_)).subscribe(I(r,d,m))},g=function(){if(l){l=!1;var _=f;f=null,r.next(_),!h&&p(_)}};n.subscribe(I(r,function(_){l=!0,f=_,!(c&&!c.closed)&&(o?g():p(_))},function(){h=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function Dl(t,e,n){e===void 0&&(e=Ze);var r=hl(t,e);return Sl(function(){return r},n)}const ve=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new P,i=e.pipe(R(r),L(s=>({id:null,seriesLabel:null,groupLabel:null,highlightDefault:s.highlightDefault})),en()),a=n.pipe(R(r),jr(s=>s.eventName==="mouseover"||s.eventName==="mousemove"),L(s=>s.datum?{id:s.datum.id,seriesLabel:s.datum.seriesLabel,groupLabel:s.datum.groupLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,highlightDefault:null})),o=n.pipe(R(r),jr(s=>s.eventName==="mouseout"),at(s=>i)),u=({data:s,id:l,seriesLabel:f,groupLabel:c,highlightDefault:h,target:d})=>{let m=[];if(h!=null&&h!=""){if(d==="datum")l=h;else if(d==="series"){const p=s.flat().find(g=>g.id===h||g.seriesLabel===h);f=p&&p.seriesLabel?p.seriesLabel:null}else if(d==="group"){const p=s.flat().find(g=>g.id===h||g.groupLabel===h);c=p&&p.groupLabel?p.groupLabel:null}}if(d==="datum"&&l!=null&&l!="")m.push(l);else if(d==="series"&&f!=null&&f!=""){const p=s.flat().filter(g=>g.seriesLabel===f).map(g=>g.id);m=m.concat(p)}else if(d==="group"&&c!=null&&c!=""){const p=s.flat().filter(g=>g.groupLabel===c).map(g=>g.id);m=m.concat(p)}return m};return new C(s=>(ft({target:dl(a,o,i),datumList:t,fullChartParams:e}).pipe(R(r)).subscribe(l=>{const f=u({data:l.datumList,id:l.target.id,seriesLabel:l.target.seriesLabel,groupLabel:l.target.groupLabel,highlightDefault:l.target.highlightDefault,target:l.fullChartParams.highlightTarget});s.next(f)}),function(){r.next(void 0)}))},ye=({datumList$:t})=>t.pipe(L(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),an=({datumList$:t})=>t.pipe(L(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Ml=({subject:t,observer:e})=>{const n=ve({datumList$:e.computedData$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),r=ye({datumList$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,seriesHighlight$:n,SeriesDataMap$:r}},ht=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],u=i[0]??j.scaleRange[0],s=i[1]??j.scaleRange[1],l=a==="auto"?e:a,f=o==="auto"?t:o;let c=n*u,h=n*s;return pr().domain([l,f]).range([c,h])},El=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ts().domain(t).range(r).padding(n)},Cl=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),mr().domain([-0,e+0]).range(a)},Pl={series:!1,grid:!0,multiGrid:!0,multiValue:!0,tree:!1,relationship:!1};function Tl(t){return new C(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const Fl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new P,i=t.type;return function(o,u){Bt(o).selectAll("svg").remove();const s=Bt(o).append("svg");s.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const l=s.append("g");l.classed("orbcharts__layout",!0);const f=l.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new P,dataFormatter$:new P,plugins$:new P,chartParams$:new P,event$:new P},h=(w=>{const $=w||Et,A=$.preset?$.preset:{};return{chartParams:A.chartParams?J(A.chartParams,un):un,dataFormatter:A.dataFormatter?J(A.dataFormatter,t):t,allPluginParams:A.allPluginParams?A.allPluginParams:{},description:A.description??""}})(u),d=c.data$.pipe(D(1)),m=c.dataFormatter$.pipe(R(r),ge({}),L(w=>{const $=J(w,h.dataFormatter);return i==="multiGrid"&&w.multiGrid!=null&&($.multiGrid=w.multiGrid.map(A=>J(A,h.dataFormatter.multiGrid[0]))),$}),D(1)),p=c.chartParams$.pipe(R(r),ge({}),L(w=>J(w,h.chartParams)),D(1)),g=p.pipe(R(r),ge({}),L(w=>J(w.padding??{},on)));g.pipe(R(r),_l()).subscribe(w=>{l.attr("transform",`translate(${w.left}, ${w.top})`)}),g.subscribe(w=>{l.transition().attr("transform",`translate(${w.left}, ${w.top})`)});const _=Tl(o).pipe(R(r),nn()),M=Gt().pipe(Al(_.pipe(gl(250)),_.pipe(Dl(250))),en((w,$)=>JSON.stringify(w)===JSON.stringify($)),nn()),b=M.subscribe(),E=ft({rootSize:M,mergedPadding:g}).pipe(R(r),at(async w=>{const $=w.rootSize.width>0?w.rootSize.width:ri,A=w.rootSize.height>0?w.rootSize.height:ii;return{width:$-w.mergedPadding.left-w.mergedPadding.right,height:A-w.mergedPadding.top-w.mergedPadding.bottom,top:w.mergedPadding.top,right:w.mergedPadding.right,bottom:w.mergedPadding.bottom,left:w.mergedPadding.left,rootWidth:$,rootHeight:A}}),D(1));E.subscribe(w=>{s.attr("width",w.rootWidth).attr("height",w.rootHeight)});const y=ft({data:d,dataFormatter:m,chartParams:p,layout:fl(()=>Pl[i]===!0,E,Gt(void 0))}).pipe(R(r),at(async w=>w),at(w=>Gt(w).pipe(L($=>{try{return e({data:$.data,dataFormatter:$.dataFormatter,chartParams:$.chartParams,layout:$.layout})}catch(A){throw console.error(A),new Error(A)}}),Kr(()=>Je))),D(1)),F={};return c.plugins$.subscribe(w=>{if(!w)return;const $=f.selectAll("g.orbcharts__plugin").data(w,v=>v.name),A=$.enter().append("g").attr("class",v=>`orbcharts__plugin orbcharts__${v.name}`);$.exit().remove().each((v,N,k)=>{F[v.name]&&F[v.name].destroy()}),A.each((v,N,k)=>{const H={fullParams$:new C,fullChartParams$:p,fullDataFormatter$:m,computedData$:y,layout$:E},ot=n({observer:H,subject:c}),tt={selection:Bt(k[N]),rootSelection:s,name:v.name,chartType:i,subject:c,observer:ot};v.setPresetParams(h.allPluginParams[v.name]??{}),v.setContext(tt),F[tt.name]=v,v.init()})}),{...c,selection:s,destroy(){Bt(o).selectAll("svg").remove(),r.next(void 0),b.unsubscribe()}}}};class Dt{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new P,this.dataFormatter$=new P,this.plugins$=new P,this.chartParams$=new P,this.event$=new P;const u=Fl({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class Nl extends Dt{constructor(e,n){super({defaultDataFormatter:oi,computedDataFn:vs,contextObserverFn:Ml},e,n)}}const kl=t=>Zr(t,"grid",0),Zr=(t,e,n=0)=>{const{data:r=[],dataFormatter:i,chartParams:a,layout:o}=t;if(!r.length)return[];let u;try{const s=r.reduce(($,A)=>A.length>$?A.length:$,0),f=r.map(($,A)=>{if($.length===s)return $;const S=Object.assign([],$);for(let v=S.length;v<s;v++)S[v]=null;return S}).map(($,A)=>$.map((S,v)=>{const N=i.visibleFilter(S,A,v,t);return S==null?{id:"",label:"",data:{},value:null,_visible:N}:typeof S=="number"?{id:"",label:"",data:{},value:S,_visible:N}:{id:S.id??"",label:S.label??"",data:S.data??{},value:S.value,_visible:N}})),c=wr(i.grid.seriesType,f),h=i.groupAxis.position==="top"||i.groupAxis.position==="bottom"?o.width:o.height,d=c[0]?c[0].length-1:0,m=ht({maxValue:d,minValue:0,axisWidth:h,scaleDomain:[0,d],scaleRange:[0,1]}),p=c.flat().filter($=>$._visible!=!1),[g,_]=fe(p),M=i.valueAxis.position==="left"||i.valueAxis.position==="right"?o.height:o.width,b=vr({transposedDataGrid:c,dataFormatter:i,chartType:e,gridIndex:n}),E=yr({transposedDataGrid:c,dataFormatter:i,chartType:e,gridIndex:n}),y=ht({maxValue:_,minValue:g,axisWidth:M,scaleDomain:[g,_],scaleRange:[0,1]}),F=y(0);let w=0;u=c.map(($,A)=>$.map((S,v)=>{const N=ce(e,n,A,v),k=E[v],H=y(S.value??0),ot={id:S.id?S.id:N,index:w,label:S.label?S.label:N,description:S.description??"",data:S.data,value:S.value,gridIndex:n,accSeriesIndex:A,seriesIndex:A,seriesLabel:b[A],groupIndex:v,groupLabel:k,color:he(A,a),axisX:m(v),axisY:H,axisYFromZero:H-F,visible:S._visible};return w++,ot}))}catch(s){throw Error(s)}return u},Jr=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[0,0],rotate:0,rotateX:0,rotateY:0,value:""};let s=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,l=u):a.position==="right"?(c=180,h=180,s=o,l=u):(c=180,l=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,s=o):(c=180,l=u)):i.position==="left"?a.position==="bottom"?(f=-90,l=u):a.position==="top"?(f=-90,h=180):(c=180,l=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,l=u,s=o):a.position==="top"?(f=-90,s=o):(c=180,l=u)),{translate:[s,l],scale:[0,0],rotate:f,rotateX:c,rotateY:h,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new C(i=>(ft({fullDataFormatter:t,layout:e}).pipe(R(n),at(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.groupAxis,yAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},Qr=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new P;function i({data:a,groupAxis:o,valueAxis:u,width:s,height:l}){let f=0,c=0,h=0,d=0;const m=o.position==="top"||o.position==="bottom"?s:l,p=0,g=a[0]?a[0].length-1:0,_=o.scaleDomain[0]==="auto"?p-o.scalePadding:o.scaleDomain[0]-o.scalePadding,M=o.scaleDomain[1]==="auto"?g+o.scalePadding:o.scaleDomain[1]+o.scalePadding,b=ht({maxValue:g,minValue:p,axisWidth:m,scaleDomain:[_,M],scaleRange:[0,1]}),E=b(p),y=b(g);f=E,h=(y-E)/m;const w=a.map((ot,Mt)=>ot.filter((tt,pt)=>pt>=_&&pt<=M&&tt.visible==!0)),$=ze(w),A=u.position==="left"||u.position==="right"?l:s,S=ht({maxValue:$[1],minValue:$[0],axisWidth:A,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),v=ze(a),N=S(v[0]),k=S(v[1]);return c=N,d=(k-N)/A,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new C(a=>(ft({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(r),at(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.groupAxis,valueAxis:o.fullDataFormatter.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},ti=({gridAxesTransform$:t})=>t.pipe(L(e=>{const n=[0,0],r=[e.scale[0]*-1,e.scale[1]*-1],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotate(${i}deg) rotateX(${a}deg) rotateY(${o}deg)`}})),ei=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){if((i==="bottom"||i==="top")&&(a==="left"||a==="right"))return{width:o,height:u};if((i==="left"||i==="right")&&(a==="bottom"||a==="top"))return{width:u,height:o}}return new C(i=>{ft({fullDataFormatter:t,layout:e}).pipe(R(n),at(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.groupAxis.position,yAxisPosition:a.fullDataFormatter.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},ni=({computedData$:t})=>t.pipe(L(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Ol=({subject:t,observer:e})=>{const n=Jr({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),r=Qr({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),i=ti({gridAxesTransform$:n}).pipe(D(1)),a=ei({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(D(1)),o=e.computedData$.pipe(L(c=>c.flat())).pipe(D(1)),u=ve({datumList$:o,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1)),s=ye({datumList$:o}).pipe(D(1)),l=an({datumList$:o}).pipe(D(1)),f=ni({computedData$:e.computedData$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,gridAxesTransform$:n,gridGraphicTransform$:r,gridAxesOppositeTransform$:i,gridAxesSize$:a,gridHighlight$:u,SeriesDataMap$:s,GroupDataMap$:l,visibleComputedData$:f}};class Il extends Dt{constructor(e,n){super({defaultDataFormatter:sn,computedDataFn:kl,contextObserverFn:Ol},e,n)}}const Rl=({data:t=[],dataFormatter:e,chartParams:n,layout:r})=>{if(!t.length)return[];let i=[];try{const a=Object.assign({},ln.multiGrid[0]);i=t.map((u,s)=>{const l=e.multiGrid[s]||a;return Zr({data:u,dataFormatter:l,chartParams:n,layout:r},"multiGrid",s)});let o=-1;i=i.map((u,s)=>u.map((l,f)=>(o++,l.map(c=>(c.accSeriesIndex=o,c.color=he(o,n),c)))))}catch(a){throw Error(a)}return i},Ll=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new P;return ft({fullDataFormatter:t,computedData:e}).pipe(at(async o=>o),en((o,u)=>o.computedData.length===u.computedData.length),L(o=>(a.next(void 0),o.computedData.map((u,s)=>{const l=o.fullDataFormatter.multiGrid[s]??o.fullDataFormatter.multiGrid[0],f=Gt(l).pipe(R(a),D(1)),c=Gt(u).pipe(R(a),D(1)),h=Jr({fullDataFormatter$:f,layout$:n}).pipe(D(1)),d=Qr({computedData$:c,fullDataFormatter$:f,layout$:n}).pipe(D(1)),m=ti({gridAxesTransform$:h}).pipe(D(1)),p=ei({fullDataFormatter$:f,layout$:n}).pipe(D(1)),g=c.pipe(L(y=>y.flat())).pipe(D(1)),_=ve({datumList$:g,fullChartParams$:r,event$:i}).pipe(D(1)),M=ye({datumList$:g}).pipe(D(1)),b=an({datumList$:g}).pipe(D(1)),E=ni({computedData$:c}).pipe(D(1));return{gridAxesTransform$:h,gridGraphicTransform$:d,gridAxesOppositeTransform$:m,gridAxesSize$:p,gridHighlight$:_,SeriesDataMap$:M,GroupDataMap$:b,visibleComputedData$:E}}))))},Vl=({subject:t,observer:e})=>{const n=Ll({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(D(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,multiGrid$:n}};class Gl extends Dt{constructor(e,n){super({defaultDataFormatter:ln,computedDataFn:Rl,contextObserverFn:Vl},e,n)}}const zl=t=>{const{data:e,dataFormatter:n,chartParams:r,layout:i}=t;if(!e.length)return[];let a=[];try{const o=e.map((b,E)=>b.map((y,F)=>typeof y=="number"?{id:"",label:"",description:"",data:{},value:y}:{id:y.id??"",label:y.label??"",description:y.description??"",data:y.data??{},value:y.value})),[u,s]=fe(o.map(b=>b[0])),[l,f]=fe(o.map(b=>b[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ht({maxValue:s,minValue:u,axisWidth:c,scaleDomain:[u,s],scaleRange:[0,1]}),m=ht({maxValue:f,minValue:l,axisWidth:h,scaleDomain:[l,f],scaleRange:[0,1]}),p=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?s:n.xAxis.scaleDomain[1]],g=[n.yAxis.scaleDomain[0]==="auto"?l:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]],_=(b,E,y,F)=>y===0&&b.value!=null&&(b.value<p[0]||b.value>p[1])||y===1&&b.value!=null&&(b.value<g[0]||b.value>g[1])?!1:n.visibleFilter(b,E,y,F);let M=0;a=o.map((b,E)=>b.map((y,F)=>{const w=M;M++;const $=ce(n.type,E,F),A=_(y,E,F,t);return{id:y.id?y.id:$,index:w,label:y.label?y.label:$,description:y.description??"",data:y.data,value:y.value,axis:F==0?d(y.value):m(y.value),visible:A}}))}catch(o){throw Error(o)}return a},Hl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Ul extends Dt{constructor(e,n){super({defaultDataFormatter:ui,computedDataFn:zl,contextObserverFn:Hl},e,n)}}const Xl=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:n.visibleFilter(c,0,h,t)}));const s=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:s.get(c.start),startNodeId:c.start,endNode:s.get(c.end),endNodeId:c.end,visible:n.visibleFilter(c,1,h,t)}));const l=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(s).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id)})}catch(o){throw Error(o)}return{nodes:i,edges:a}},Yl=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Bl extends Dt{constructor(e,n){super({defaultDataFormatter:li,computedDataFn:Xl,contextObserverFn:Yl},e,n)}}const Wl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;let i={id:"",index:0,label:"",description:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const a=function(){if(q(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const l=new Map;e.forEach(c=>{if(!c.parent)s=c;else{const h=l.get(c.parent)??[];h.push(c),l.set(c.parent,h)}});const f=c=>({id:c.id,label:c.label,data:c.data,value:c.value,children:(l.get(c.id)??[]).map(h=>f(h))});return s?f(s):{id:""}}();let o=0;const u=(s,l,f)=>{const c=l+1,h=n.visibleFilter(s,l,f,t),d=o;return o++,{id:s.id,index:d,level:l,seq:f,label:s.label??"",description:s.description??"",data:s.data??{},value:s.value,visible:h,children:(s.children??[]).map((m,p)=>u(m,c,p))}};i=u(a,0,0)}catch(a){throw Error(a)}return i},ql=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class jl extends Dt{constructor(e,n){super({defaultDataFormatter:si,computedDataFn:Wl,contextObserverFn:ql},e,n)}}function Kl({name:t,defaultParams:e,initFn:n}){const r=new P,i=new P,a=new WeakMap;let o=()=>{},u,s=e;return{params$:i,name:t,defaultParams:e,init(){u&&(o=n(u)??(()=>{}),a.set(u.selection,u))},destroy(){o(),u&&(u.selection.remove(),u=void 0),r.next(void 0)},setPresetParams:l=>{s=J(l,e)},setContext:l=>{u=l,u.observer.fullParams$=i.pipe(R(r),ge({}),L(f=>J(f,s)),D(1))}}}const dt=()=>function(e,n){return function(i){return class{constructor(){const o=Kl({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},Zl=dt(),Jl=dt(),Ql=dt(),tc=dt(),ec=dt(),nc=dt(),rc=dt();x.GridChart=Il,x.MultiGridChart=Gl,x.MultiValueChart=Ul,x.RelationshipChart=Bl,x.SeriesChart=Nl,x.TreeChart=jl,x.createAxisLinearScale=ht,x.createAxisPointScale=El,x.createAxisQuantizeScale=Cl,x.createDefaultDatumId=ce,x.createDefaultGroupLabel=gr,x.createDefaultSeriesLabel=Ge,x.createGridGroupLabels=yr,x.createGridSeriesLabels=vr,x.defineGridPlugin=Jl,x.defineMultiGridPlugin=Ql,x.defineMultiValuePlugin=tc,x.defineNoneDataPlugin=ec,x.defineRelationshipPlugin=nc,x.defineSeriesPlugin=Zl,x.defineTreePlugin=rc,x.formatCommaNumber=fs,x.formatValueToLabel=hs,x.getMinAndMax=bt,x.getMinAndMaxGrid=ze,x.getMinAndMaxMultiGrid=ps,x.getMinAndMaxMultiValue=ms,x.getMinAndMaxSeries=ds,x.getMinAndMaxValue=fe,x.groupDataMapObservable=an,x.highlightObservable=ve,x.isFunction=cs,x.isObject=q,x.mergeOptionsWithDefault=J,x.seriesColorPredicate=he,x.seriesDataMapObservable=ye,x.transposeData=wr,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/dist/src/defaults.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ChartOptionsPartial } from './types/Chart';
|
|
2
2
|
import { DataSeries } from './types/DataSeries';
|
|
3
3
|
import { DataGrid } from './types/DataGrid';
|
|
4
4
|
import { DataMultiGrid } from './types/DataMultiGrid';
|
|
5
5
|
import { DataMultiValue } from './types/DataMultiValue';
|
|
6
6
|
import { DataTree } from './types/DataTree';
|
|
7
7
|
import { DataRelationship } from './types/DataRelationship';
|
|
8
|
-
import {
|
|
8
|
+
import { DataFormatterValueAxis, DataFormatterGroupAxis } from './types/DataFormatter';
|
|
9
9
|
import { DataFormatterSeries } from './types/DataFormatterSeries';
|
|
10
10
|
import { DataFormatterGrid } from './types/DataFormatterGrid';
|
|
11
11
|
import { DataFormatterMultiGrid } from './types/DataFormatterMultiGrid';
|
|
@@ -26,7 +26,6 @@ export declare const DATA_MULTI_GRID_DEFAULT: DataMultiGrid;
|
|
|
26
26
|
export declare const DATA_MULTI_VALUE_DEFAULT: DataMultiValue;
|
|
27
27
|
export declare const DATA_TREE_DEFAULT: DataTree;
|
|
28
28
|
export declare const DATA_RELATIONA_DEFAULTL: DataRelationship;
|
|
29
|
-
export declare const DATA_FORMATTER: DataFormatterBase<ChartType>;
|
|
30
29
|
export declare const DATA_FORMATTER_VALUE_AXIS: DataFormatterValueAxis;
|
|
31
30
|
export declare const DATA_FORMATTER_GROUP_AXIS: DataFormatterGroupAxis;
|
|
32
31
|
export declare const DATA_FORMATTER_SERIES_DEFAULT: DataFormatterSeries;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { ComputedDataFn } from '../types/ComputedData';
|
|
2
|
+
import { DataFormatterContext } from '../types/DataFormatter';
|
|
3
|
+
import { ComputedDatumGrid } from '../types/ComputedDataGrid';
|
|
2
4
|
|
|
3
5
|
export declare const computeGridData: ComputedDataFn<'grid'>;
|
|
6
|
+
export declare const computeBaseGridData: (context: DataFormatterContext<"grid">, chartType: "grid" | "multiGrid", gridIndex?: number) => ComputedDatumGrid[][];
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComputedDatumBase, ComputedDatumSeriesValue } from './ComputedData';
|
|
2
2
|
|
|
3
3
|
export interface ComputedDatumGrid extends ComputedDatumBase, ComputedDatumSeriesValue {
|
|
4
|
+
accSeriesIndex: number;
|
|
5
|
+
gridIndex: number;
|
|
4
6
|
groupIndex: number;
|
|
5
7
|
groupLabel: string;
|
|
6
8
|
axisX: number;
|
package/dist/src/types/Data.d.ts
CHANGED