@orbcharts/core 3.0.0-alpha.44 → 3.0.0-alpha.46
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/orbcharts-core.es.js +1359 -1334
- package/dist/orbcharts-core.umd.js +2 -2
- package/package.json +1 -1
- package/src/base/createBaseChart.ts +1 -0
- package/src/base/createBasePlugin.ts +20 -14
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(w,Mt){typeof exports=="object"&&typeof module<"u"?Mt(exports):typeof define=="function"&&define.amd?define(["exports"],Mt):(w=typeof globalThis<"u"?globalThis:w||self,Mt(w["orbcharts-core"]={}))})(this,function(w){"use strict";const Mt={preset:{}},dn={top:60,right:60,bottom:60,left:60},pn={padding:dn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",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:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},yi=800,vi=500,K={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},bi={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},De={gap:120,rowAmount:1,columnAmount:1},wi={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...De},separateSeries:!1,sumSeries:!1},mn={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...K},groupAxis:{...bi},separateSeries:!1},xi={type:"grid",visibleFilter:(t,e)=>!0,grid:{...mn},container:{...De}},qt={...mn},_i={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...qt}],separateGrid:!1,container:{...De}},$i={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],multiValue:[],xAxis:{...K},yAxis:{...K}},Di={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]},Ai={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};function Yt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Si(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gn(t){let e,n,r;t.length!==2?(e=Yt,n=(u,l)=>Yt(t(u),l),r=(u,l)=>t(u)-l):(e=t===Yt||t===Si?t:Mi,n=t,r=t);function i(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<0?s=c+1:f=c}while(s<f)}return s}function a(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<=0?s=c+1:f=c}while(s<f)}return s}function o(u,l,s=0,f=u.length){const c=i(u,l,s,f-1);return c>s&&r(u[c-1],l)>-r(u[c],l)?c-1:c}return{left:i,center:o,right:a}}function Mi(){return 0}function Ci(t){return t===null?NaN:+t}const yn=gn(Yt).right;gn(Ci).center;class vn extends Map{constructor(e,n=Ei){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(bn(this,e))}has(e){return super.has(bn(this,e))}set(e,n){return super.set(Pi(this,e),n)}delete(e){return super.delete(Fi(this,e))}}function bn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Pi({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Fi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ei(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Li=Math.sqrt(50),Ti=Math.sqrt(10),Oi=Math.sqrt(2);function Wt(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>=Li?10:a>=Ti?5:a>=Oi?2:1;let u,l,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),l=Math.round(e*s),u/s<t&&++u,l/s>e&&--l,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),l=Math.round(e/s),u*s<t&&++u,l*s>e&&--l),l<u&&.5<=n&&n<2?Wt(t,e,n*2):[u,l,s]}function Ni(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?Wt(e,t,n):Wt(t,e,n);if(!(a>=i))return[];const u=a-i+1,l=new Array(u);if(r)if(o<0)for(let s=0;s<u;++s)l[s]=(a-s)/-o;else for(let s=0;s<u;++s)l[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)l[s]=(i+s)/-o;else for(let s=0;s<u;++s)l[s]=(i+s)*o;return l}function Ae(t,e,n){return e=+e,t=+t,n=+n,Wt(t,e,n)[2]}function ki(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ae(e,t,n):Ae(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Ii(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 Ri={value:()=>{}};function wn(){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 Bt(n)}function Bt(t){this._=t}function Gi(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}})}Bt.prototype=wn.prototype={constructor:Bt,on:function(t,e){var n=this._,r=Gi(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Vi(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]=xn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=xn(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 Bt(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 Vi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function xn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ri,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Se="http://www.w3.org/1999/xhtml";const _n={svg:"http://www.w3.org/2000/svg",xhtml:Se,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function jt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),_n.hasOwnProperty(e)?{space:_n[e],local:t}:t}function zi(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Se&&e.documentElement.namespaceURI===Se?e.createElement(t):e.createElementNS(n,t)}}function Ui(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $n(t){var e=jt(t);return(e.local?Ui:zi)(e)}function Hi(){}function Me(t){return t==null?Hi:function(){return this.querySelector(t)}}function Xi(t){typeof t!="function"&&(t=Me(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),l,s,f=0;f<o;++f)(l=a[f])&&(s=t.call(l,l.__data__,f,a))&&("__data__"in l&&(s.__data__=l.__data__),u[f]=s);return new z(r,this._parents)}function qi(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Yi(){return[]}function Dn(t){return t==null?Yi:function(){return this.querySelectorAll(t)}}function Wi(t){return function(){return qi(t.apply(this,arguments))}}function Bi(t){typeof t=="function"?t=Wi(t):t=Dn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&(r.push(t.call(l,l.__data__,s,o)),i.push(l));return new z(r,i)}function An(t){return function(){return this.matches(t)}}function Sn(t){return function(e){return e.matches(t)}}var ji=Array.prototype.find;function Ji(t){return function(){return ji.call(this.children,t)}}function Ki(){return this.firstElementChild}function Zi(t){return this.select(t==null?Ki:Ji(typeof t=="function"?t:Sn(t)))}var Qi=Array.prototype.filter;function ta(){return Array.from(this.children)}function ea(t){return function(){return Qi.call(this.children,t)}}function na(t){return this.selectAll(t==null?ta:ea(typeof t=="function"?t:Sn(t)))}function ra(t){typeof t!="function"&&(t=An(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]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new z(r,this._parents)}function Mn(t){return new Array(t.length)}function ia(){return new z(this._enter||this._groups.map(Mn),this._parents)}function Jt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Jt.prototype={constructor:Jt,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 aa(t){return function(){return t}}function oa(t,e,n,r,i,a){for(var o=0,u,l=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Jt(t,a[o]);for(;o<l;++o)(u=e[o])&&(i[o]=u)}function ua(t,e,n,r,i,a,o){var u,l,s=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(l=e[u])&&(h[u]=d=o.call(l,l.__data__,u,e)+"",s.has(d)?i[u]=l:s.set(d,l));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(l=s.get(d))?(r[u]=l,l.__data__=a[u],s.delete(d)):n[u]=new Jt(t,a[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(h[u])===l&&(i[u]=l)}function sa(t){return t.__data__}function la(t,e){if(!arguments.length)return Array.from(this,sa);var n=e?ua:oa,r=this._parents,i=this._groups;typeof t!="function"&&(t=aa(t));for(var a=i.length,o=new Array(a),u=new Array(a),l=new Array(a),s=0;s<a;++s){var f=r[s],c=i[s],h=c.length,d=ca(t.call(f,f&&f.__data__,s,r)),p=d.length,m=u[s]=new Array(p),b=o[s]=new Array(p),x=l[s]=new Array(h);n(f,c,m,b,x,d,e);for(var D=0,A=0,_,S;D<p;++D)if(_=m[D]){for(D>=A&&(A=D+1);!(S=b[A])&&++A<p;);_._next=S||null}}return o=new z(o,r),o._enter=u,o._exit=l,o}function ca(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function fa(){return new z(this._exit||this._groups.map(Mn),this._parents)}function ha(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 da(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),l=0;l<o;++l)for(var s=n[l],f=r[l],c=s.length,h=u[l]=new Array(c),d,p=0;p<c;++p)(d=s[p]||f[p])&&(h[p]=d);for(;l<i;++l)u[l]=n[l];return new z(u,this._parents)}function pa(){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 ma(t){t||(t=ga);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,l=i[a]=new Array(u),s,f=0;f<u;++f)(s=o[f])&&(l[f]=s);l.sort(e)}return new z(i,this._parents).order()}function ga(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ya(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function va(){return Array.from(this)}function ba(){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 wa(){let t=0;for(const e of this)++t;return t}function xa(){return!this.node()}function _a(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 $a(t){return function(){this.removeAttribute(t)}}function Da(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Aa(t,e){return function(){this.setAttribute(t,e)}}function Sa(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ma(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Ca(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 Pa(t,e){var n=jt(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?Da:$a:typeof e=="function"?n.local?Ca:Ma:n.local?Sa:Aa)(n,e))}function Cn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fa(t){return function(){this.style.removeProperty(t)}}function Ea(t,e,n){return function(){this.style.setProperty(t,e,n)}}function La(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ta(t,e,n){return arguments.length>1?this.each((e==null?Fa:typeof e=="function"?La:Ea)(t,e,n??"")):mt(this.node(),t)}function mt(t,e){return t.style.getPropertyValue(e)||Cn(t).getComputedStyle(t,null).getPropertyValue(e)}function Oa(t){return function(){delete this[t]}}function Na(t,e){return function(){this[t]=e}}function ka(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ia(t,e){return arguments.length>1?this.each((e==null?Oa:typeof e=="function"?ka:Na)(t,e)):this.node()[t]}function Pn(t){return t.trim().split(/^|\s+/)}function Ce(t){return t.classList||new Fn(t)}function Fn(t){this._node=t,this._names=Pn(t.getAttribute("class")||"")}Fn.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 En(t,e){for(var n=Ce(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Ln(t,e){for(var n=Ce(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ra(t){return function(){En(this,t)}}function Ga(t){return function(){Ln(this,t)}}function Va(t,e){return function(){(e.apply(this,arguments)?En:Ln)(this,t)}}function za(t,e){var n=Pn(t+"");if(arguments.length<2){for(var r=Ce(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Va:e?Ra:Ga)(n,e))}function Ua(){this.textContent=""}function Ha(t){return function(){this.textContent=t}}function Xa(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function qa(t){return arguments.length?this.each(t==null?Ua:(typeof t=="function"?Xa:Ha)(t)):this.node().textContent}function Ya(){this.innerHTML=""}function Wa(t){return function(){this.innerHTML=t}}function Ba(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function ja(t){return arguments.length?this.each(t==null?Ya:(typeof t=="function"?Ba:Wa)(t)):this.node().innerHTML}function Ja(){this.nextSibling&&this.parentNode.appendChild(this)}function Ka(){return this.each(Ja)}function Za(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Qa(){return this.each(Za)}function to(t){var e=typeof t=="function"?t:$n(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function eo(){return null}function no(t,e){var n=typeof t=="function"?t:$n(t),r=e==null?eo:typeof e=="function"?e:Me(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ro(){var t=this.parentNode;t&&t.removeChild(this)}function io(){return this.each(ro)}function ao(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function oo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function uo(t){return this.select(t?oo:ao)}function so(t){return arguments.length?this.property("__data__",t):this.node().__data__}function lo(t){return function(e){t.call(this,e,this.__data__)}}function co(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 fo(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 ho(t,e,n){return function(){var r=this.__on,i,a=lo(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 po(t,e,n){var r=co(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,s=u.length,f;l<s;++l)for(i=0,f=u[l];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?ho:fo,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Tn(t,e,n){var r=Cn(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 mo(t,e){return function(){return Tn(this,t,e)}}function go(t,e){return function(){return Tn(this,t,e.apply(this,arguments))}}function yo(t,e){return this.each((typeof e=="function"?go:mo)(t,e))}function*vo(){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 On=[null];function z(t,e){this._groups=t,this._parents=e}function Ct(){return new z([[document.documentElement]],On)}function bo(){return this}z.prototype=Ct.prototype={constructor:z,select:Xi,selectAll:Bi,selectChild:Zi,selectChildren:na,filter:ra,data:la,enter:ia,exit:fa,join:ha,merge:da,selection:bo,order:pa,sort:ma,call:ya,nodes:va,node:ba,size:wa,empty:xa,each:_a,attr:Pa,style:Ta,property:Ia,classed:za,text:qa,html:ja,raise:Ka,lower:Qa,append:to,insert:no,remove:io,clone:uo,datum:so,on:po,dispatch:yo,[Symbol.iterator]:vo};function Kt(t){return typeof t=="string"?new z([[document.querySelector(t)]],[document.documentElement]):new z([[t]],On)}function Pe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Nn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var Ft=.7,Zt=1/Ft,gt="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wo=/^#([0-9a-f]{3,8})$/,xo=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),_o=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),$o=new RegExp(`^rgba\\(${gt},${gt},${gt},${Et}\\)$`),Do=new RegExp(`^rgba\\(${W},${W},${W},${Et}\\)$`),Ao=new RegExp(`^hsl\\(${Et},${W},${W}\\)$`),So=new RegExp(`^hsla\\(${Et},${W},${W},${Et}\\)$`),kn={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};Pe(Pt,st,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:In,formatHex:In,formatHex8:Mo,formatHsl:Co,formatRgb:Rn,toString:Rn});function In(){return this.rgb().formatHex()}function Mo(){return this.rgb().formatHex8()}function Co(){return Hn(this).formatHsl()}function Rn(){return this.rgb().formatRgb()}function st(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Gn(e):n===3?new G(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=xo.exec(t))?new G(e[1],e[2],e[3],1):(e=_o.exec(t))?new G(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=$o.exec(t))?Qt(e[1],e[2],e[3],e[4]):(e=Do.exec(t))?Qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ao.exec(t))?Un(e[1],e[2]/100,e[3]/100,1):(e=So.exec(t))?Un(e[1],e[2]/100,e[3]/100,e[4]):kn.hasOwnProperty(t)?Gn(kn[t]):t==="transparent"?new G(NaN,NaN,NaN,0):null}function Gn(t){return new G(t>>16&255,t>>8&255,t&255,1)}function Qt(t,e,n,r){return r<=0&&(t=e=n=NaN),new G(t,e,n,r)}function Po(t){return t instanceof Pt||(t=st(t)),t?(t=t.rgb(),new G(t.r,t.g,t.b,t.opacity)):new G}function Fe(t,e,n,r){return arguments.length===1?Po(t):new G(t,e,n,r??1)}function G(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Pe(G,Fe,Nn(Pt,{brighter(t){return t=t==null?Zt:Math.pow(Zt,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Ft:Math.pow(Ft,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new G(lt(this.r),lt(this.g),lt(this.b),te(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:Vn,formatHex:Vn,formatHex8:Fo,formatRgb:zn,toString:zn}));function Vn(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}`}function Fo(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}${ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function zn(){const t=te(this.opacity);return`${t===1?"rgb(":"rgba("}${lt(this.r)}, ${lt(this.g)}, ${lt(this.b)}${t===1?")":`, ${t})`}`}function te(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function lt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ct(t){return t=lt(t),(t<16?"0":"")+t.toString(16)}function Un(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 Hn(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=st(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),a=Math.max(e,n,r),o=NaN,u=a-i,l=(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/=l<.5?a+i:2-a-i,o*=60):u=l>0&&l<1?0:o,new H(o,u,l,t.opacity)}function Eo(t,e,n,r){return arguments.length===1?Hn(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}Pe(H,Eo,Nn(Pt,{brighter(t){return t=t==null?Zt:Math.pow(Zt,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 G(Ee(t>=240?t-240:t+120,i,r),Ee(t,i,r),Ee(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(Xn(this.h),ee(this.s),ee(this.l),te(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=te(this.opacity);return`${t===1?"hsl(":"hsla("}${Xn(this.h)}, ${ee(this.s)*100}%, ${ee(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Xn(t){return t=(t||0)%360,t<0?t+360:t}function ee(t){return Math.max(0,Math.min(1,t||0))}function Ee(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 Le=t=>()=>t;function Lo(t,e){return function(n){return t+n*e}}function To(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 Oo(t){return(t=+t)==1?qn:function(e,n){return n-e?To(e,n,t):Le(isNaN(e)?n:e)}}function qn(t,e){var n=e-t;return n?Lo(t,n):Le(isNaN(t)?e:t)}const ne=function t(e){var n=Oo(e);function r(i,a){var o=n((i=Fe(i)).r,(a=Fe(a)).r),u=n(i.g,a.g),l=n(i.b,a.b),s=qn(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=l(f),i.opacity=s(f),i+""}}return r.gamma=t,r}(1);function No(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 ko(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Io(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]=Ne(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 Ro(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 Go(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]=Ne(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Te=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Oe=new RegExp(Te.source,"g");function Vo(t){return function(){return t}}function zo(t){return function(e){return t(e)+""}}function Yn(t,e){var n=Te.lastIndex=Oe.lastIndex=0,r,i,a,o=-1,u=[],l=[];for(t=t+"",e=e+"";(r=Te.exec(t))&&(i=Oe.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,l.push({i:o,x:X(r,i)})),n=Oe.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?l[0]?zo(l[0].x):Vo(e):(e=l.length,function(s){for(var f=0,c;f<e;++f)u[(c=l[f]).i]=c.x(s);return u.join("")})}function Ne(t,e){var n=typeof e,r;return e==null||n==="boolean"?Le(e):(n==="number"?X:n==="string"?(r=st(e))?(e=r,ne):Yn:e instanceof st?ne:e instanceof Date?Ro:ko(e)?No:Array.isArray(e)?Io:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Go:X)(t,e)}function Uo(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Wn=180/Math.PI,ke={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bn(t,e,n,r,i,a){var o,u,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Wn,skewX:Math.atan(l)*Wn,scaleX:o,scaleY:u}}var re;function Ho(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?ke:Bn(e.a,e.b,e.c,e.d,e.e,e.f)}function Xo(t){return t==null||(re||(re=document.createElementNS("http://www.w3.org/2000/svg","g")),re.setAttribute("transform",t),!(t=re.transform.baseVal.consolidate()))?ke:(t=t.matrix,Bn(t.a,t.b,t.c,t.d,t.e,t.f))}function jn(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push("translate(",null,e,null,n);p.push({i:m-4,x:X(s,c)},{i:m-2,x:X(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(s,f,c,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:X(s,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(s,f,c,h){s!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:X(s,f)}):f&&c.push(i(c)+"skewX("+f+r)}function l(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:X(s,c)},{i:m-2,x:X(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(s,f){var c=[],h=[];return s=t(s),f=t(f),a(s.translateX,s.translateY,f.translateX,f.translateY,c,h),o(s.rotate,f.rotate,c,h),u(s.skewX,f.skewX,c,h),l(s.scaleX,s.scaleY,f.scaleX,f.scaleY,c,h),s=f=null,function(d){for(var p=-1,m=h.length,b;++p<m;)c[(b=h[p]).i]=b.x(d);return c.join("")}}}var qo=jn(Ho,"px, ","px)","deg)"),Yo=jn(Xo,", ",")",")"),yt=0,Lt=0,Tt=0,Jn=1e3,ie,Ot,ae=0,ft=0,oe=0,Nt=typeof performance=="object"&&performance.now?performance:Date,Kn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ie(){return ft||(Kn(Wo),ft=Nt.now()+oe)}function Wo(){ft=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Zn.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ie():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:ie=this,Ot=this),this._call=t,this._time=n,Re()},stop:function(){this._call&&(this._call=null,this._time=1/0,Re())}};function Zn(t,e,n){var r=new ue;return r.restart(t,e,n),r}function Bo(){Ie(),++yt;for(var t=ie,e;t;)(e=ft-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yt}function Qn(){ft=(ae=Nt.now())+oe,yt=Lt=0;try{Bo()}finally{yt=0,Jo(),ft=0}}function jo(){var t=Nt.now(),e=t-ae;e>Jn&&(oe-=e,ae=t)}function Jo(){for(var t,e=ie,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:ie=n);Ot=t,Re(r)}function Re(t){if(!yt){Lt&&(Lt=clearTimeout(Lt));var e=t-ft;e>24?(t<1/0&&(Lt=setTimeout(Qn,t-Nt.now()-oe)),Tt&&(Tt=clearInterval(Tt))):(Tt||(ae=Nt.now(),Tt=setInterval(jo,Jn)),yt=1,Kn(Qn))}}function tr(t,e,n){var r=new ue;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Ko=wn("start","end","cancel","interrupt"),Zo=[],er=0,nr=1,Ge=2,se=3,rr=4,Ve=5,le=6;function ce(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Qo(t,n,{name:e,index:r,group:i,on:Ko,tween:Zo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:er})}function ze(t,e){var n=q(t,e);if(n.state>er)throw new Error("too late; already scheduled");return n}function B(t,e){var n=q(t,e);if(n.state>se)throw new Error("too late; already running");return n}function q(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Qo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Zn(a,0,n.time);function a(s){n.state=nr,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var f,c,h,d;if(n.state!==nr)return l();for(f in r)if(d=r[f],d.name===n.name){if(d.state===se)return tr(o);d.state===rr?(d.state=le,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=le,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(tr(function(){n.state===se&&(n.state=rr,n.timer.restart(u,n.delay,n.time),u(s))}),n.state=Ge,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ge){for(n.state=se,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(s){for(var f=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(l),n.state=Ve,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Ve&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=le,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function tu(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>Ge&&r.state<Ve,r.state=le,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function eu(t){return this.each(function(){tu(this,t)})}function nu(t,e){var n,r;return function(){var i=B(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 ru(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=B(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}a.tween=i}}function iu(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=q(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?nu:ru)(n,t,e))}function Ue(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 q(i,r).value[e]}}function ir(t,e){var n;return(typeof e=="number"?X:e instanceof st?ne:(n=st(e))?(e=n,ne):Yn)(t,e)}function au(t){return function(){this.removeAttribute(t)}}function ou(t){return function(){this.removeAttributeNS(t.space,t.local)}}function uu(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 su(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 lu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function cu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function fu(t,e){var n=jt(t),r=n==="transform"?Yo:ir;return this.attrTween(t,typeof e=="function"?(n.local?cu:lu)(n,r,Ue(this,"attr."+t,e)):e==null?(n.local?ou:au)(n):(n.local?su:uu)(n,r,e))}function hu(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function du(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function pu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&du(t,a)),n}return i._value=e,i}function mu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&hu(t,a)),n}return i._value=e,i}function gu(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=jt(t);return this.tween(n,(r.local?pu:mu)(r,e))}function yu(t,e){return function(){ze(this,t).delay=+e.apply(this,arguments)}}function vu(t,e){return e=+e,function(){ze(this,t).delay=e}}function bu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?yu:vu)(e,t)):q(this.node(),e).delay}function wu(t,e){return function(){B(this,t).duration=+e.apply(this,arguments)}}function xu(t,e){return e=+e,function(){B(this,t).duration=e}}function _u(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?wu:xu)(e,t)):q(this.node(),e).duration}function $u(t,e){if(typeof e!="function")throw new Error;return function(){B(this,t).ease=e}}function Du(t){var e=this._id;return arguments.length?this.each($u(e,t)):q(this.node(),e).ease}function Au(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;B(this,t).ease=n}}function Su(t){if(typeof t!="function")throw new Error;return this.each(Au(this._id,t))}function Mu(t){typeof t!="function"&&(t=An(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]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new Z(r,this._parents,this._name,this._id)}function Cu(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 l=e[u],s=n[u],f=l.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=l[d]||s[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new Z(o,this._parents,this._name,this._id)}function Pu(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 Fu(t,e,n){var r,i,a=Pu(e)?ze:B;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Eu(t,e){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(t):this.each(Fu(n,t,e))}function Lu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Tu(){return this.on("end.remove",Lu(this._id))}function Ou(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Me(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],l=u.length,s=a[o]=new Array(l),f,c,h=0;h<l;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),s[h]=c,ce(s[h],e,n,h,s,q(f,n)));return new Z(a,this._parents,e,n)}function Nu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Dn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var l=r[u],s=l.length,f,c=0;c<s;++c)if(f=l[c]){for(var h=t.call(f,f.__data__,c,l),d,p=q(f,n),m=0,b=h.length;m<b;++m)(d=h[m])&&ce(d,e,n,m,h,p);a.push(h),o.push(f)}return new Z(a,o,e,n)}var ku=Ct.prototype.constructor;function Iu(){return new ku(this._groups,this._parents)}function Ru(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 ar(t){return function(){this.style.removeProperty(t)}}function Gu(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 Vu(t,e,n){var r,i,a;return function(){var o=mt(this,t),u=n(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(t),mt(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u))}}function zu(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var l=B(this,t),s=l.on,f=l.value[a]==null?u||(u=ar(e)):void 0;(s!==n||i!==f)&&(r=(n=s).copy()).on(o,i=f),l.on=r}}function Uu(t,e,n){var r=(t+="")=="transform"?qo:ir;return e==null?this.styleTween(t,Ru(t,r)).on("end.style."+t,ar(t)):typeof e=="function"?this.styleTween(t,Vu(t,r,Ue(this,"style."+t,e))).each(zu(this._id,t)):this.styleTween(t,Gu(t,r,e),n).on("end.style."+t,null)}function Hu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Xu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Hu(t,o,n)),r}return a._value=e,a}function qu(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,Xu(t,e,n??""))}function Yu(t){return function(){this.textContent=t}}function Wu(t){return function(){var e=t(this);this.textContent=e??""}}function Bu(t){return this.tween("text",typeof t=="function"?Wu(Ue(this,"text",t)):Yu(t==null?"":t+""))}function ju(t){return function(e){this.textContent=t.call(this,e)}}function Ju(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&ju(i)),e}return r._value=t,r}function Ku(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,Ju(t))}function Zu(){for(var t=this._name,e=this._id,n=or(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)if(l=o[s]){var f=q(l,e);ce(l,t,n,s,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Z(r,this._parents,t,n)}function Qu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var s=B(this,r),f=s.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),s.on=e}),i===0&&a()})}var ts=0;function Z(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function or(){return++ts}var Q=Ct.prototype;Z.prototype={constructor:Z,select:Ou,selectAll:Nu,selectChild:Q.selectChild,selectChildren:Q.selectChildren,filter:Mu,merge:Cu,selection:Iu,transition:Zu,call:Q.call,nodes:Q.nodes,node:Q.node,size:Q.size,empty:Q.empty,each:Q.each,on:Eu,attr:fu,attrTween:gu,style:Uu,styleTween:qu,text:Bu,textTween:Ku,remove:Tu,tween:iu,delay:bu,duration:_u,ease:Du,easeVarying:Su,end:Qu,[Symbol.iterator]:Q[Symbol.iterator]};function es(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ns={time:null,delay:0,duration:250,ease:es};function rs(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 is(t){var e,n;t instanceof Z?(e=t._id,t=t._name):(e=or(),(n=ns).time=Ie(),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,l,s=0;s<u;++s)(l=o[s])&&ce(l,t,e,s,o,n||rs(l,e));return new Z(r,this._parents,t,e)}Ct.prototype.interrupt=eu,Ct.prototype.transition=is;function as(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fe(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 vt(t){return t=fe(Math.abs(t)),t?t[1]:NaN}function os(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(n.substring(i-=u,i+u)),!((l+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function us(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var ss=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function he(t){if(!(e=ss.exec(t)))throw new Error("invalid format: "+t);var e;return new He({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]})}he.prototype=He.prototype;function He(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+""}He.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 ls(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 ur;function cs(t,e){var n=fe(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(ur=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")+fe(t,Math.max(0,e+a-1))[0]}function sr(t,e){var n=fe(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 lr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:as,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)=>sr(t*100,e),r:sr,s:cs,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function cr(t){return t}var fr=Array.prototype.map,hr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fs(t){var e=t.grouping===void 0||t.thousands===void 0?cr:os(fr.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?cr:us(fr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function s(c){c=he(c);var h=c.fill,d=c.align,p=c.sign,m=c.symbol,b=c.zero,x=c.width,D=c.comma,A=c.precision,_=c.trim,S=c.type;S==="n"?(D=!0,S="g"):lr[S]||(A===void 0&&(A=12),_=!0,S="g"),(b||h==="0"&&d==="=")&&(b=!0,h="0",d="=");var T=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",g=m==="$"?r:/[%p]/.test(S)?o:"",M=lr[S],P=/[defgprs%]/.test(S);A=A===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function ut(y){var V=T,O=g,Y,Xt,pt;if(S==="c")O=M(y)+O,y="";else{y=+y;var J=y<0||1/y<0;if(y=isNaN(y)?l:M(Math.abs(y),A),_&&(y=ls(y)),J&&+y==0&&p!=="+"&&(J=!1),V=(J?p==="("?p:u:p==="-"||p==="("?"":p)+V,O=(S==="s"?hr[8+ur/3]:"")+O+(J&&p==="("?")":""),P){for(Y=-1,Xt=y.length;++Y<Xt;)if(pt=y.charCodeAt(Y),48>pt||pt>57){O=(pt===46?i+y.slice(Y+1):y.slice(Y))+O,y=y.slice(0,Y);break}}}D&&!b&&(y=e(y,1/0));var $e=V.length+y.length+O.length,et=$e<x?new Array(x-$e+1).join(h):"";switch(D&&b&&(y=e(et+y,et.length?x-O.length:1/0),et=""),d){case"<":y=V+y+O+et;break;case"=":y=V+et+y+O;break;case"^":y=et.slice(0,$e=et.length>>1)+V+y+O+et.slice($e);break;default:y=et+V+y+O;break}return a(y)}return ut.toString=function(){return c+""},ut}function f(c,h){var d=s((c=he(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(vt(h)/3)))*3,m=Math.pow(10,-p),b=hr[8+p/3];return function(x){return d(m*x)+b}}return{format:s,formatPrefix:f}}var de,Xe,dr;hs({thousands:",",grouping:[3],currency:["$",""]});function hs(t){return de=fs(t),Xe=de.format,dr=de.formatPrefix,de}function ds(t){return Math.max(0,-vt(Math.abs(t)))}function ps(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(e)/3)))*3-vt(Math.abs(t)))}function ms(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vt(e)-vt(t))+1}function pe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const pr=Symbol("implicit");function mr(){var t=new vn,e=[],n=[],r=pr;function i(a){let o=t.get(a);if(o===void 0){if(r!==pr)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 vn;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 mr(e,n).unknown(r)},pe.apply(i,arguments),i}function gr(){var t=mr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,l=0,s=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,m=d?r:i;a=(m-p)/Math.max(1,h-l+s*2),u&&(a=Math.floor(a)),p+=(m-p-a*(h-l))*f,o=a*(1-l),u&&(p=Math.round(p),o=Math.round(o));var b=Ii(h).map(function(x){return p+a*x});return n(d?b.reverse():b)}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?(l=Math.min(1,s=+h),c()):l},t.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),c()):l},t.paddingOuter=function(h){return arguments.length?(s=+h,c()):s},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return gr(e(),[r,i]).round(u).paddingInner(l).paddingOuter(s).align(f)},pe.apply(c(),arguments)}function yr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return yr(e())},t}function gs(){return yr(gr.apply(null,arguments).paddingInner(1))}function ys(t){return function(){return t}}function vs(t){return+t}var vr=[0,1];function bt(t){return t}function qe(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:ys(isNaN(e)?NaN:.5)}function bs(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function ws(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=qe(i,r),a=n(o,a)):(r=qe(r,i),a=n(a,o)),function(u){return a(r(u))}}function xs(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]=qe(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var l=yn(t,u,1,r)-1;return a[l](i[l](u))}}function _s(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function $s(){var t=vr,e=vr,n=Ne,r,i,a,o=bt,u,l,s;function f(){var h=Math.min(t.length,e.length);return o!==bt&&(o=bs(t[0],t[h-1])),u=h>2?xs:ws,l=s=null,c}function c(h){return h==null||isNaN(h=+h)?a:(l||(l=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((s||(s=u(e,t.map(r),X)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,vs),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=Uo,f()},c.clamp=function(h){return arguments.length?(o=h?!0:bt,f()):o!==bt},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 Ds(){return $s()(bt,bt)}function As(t,e,n,r){var i=ki(t,e,n),a;switch(r=he(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=ps(i,o))&&(r.precision=a),dr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=ms(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ds(i))&&(r.precision=a-(r.type==="%")*2);break}}return Xe(r)}function br(t){var e=t.domain;return t.ticks=function(n){var r=e();return Ni(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return As(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],l,s,f=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);f-- >0;){if(s=Ae(o,u,n),s===l)return r[i]=o,r[a]=u,e(r);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;l=s}return t},t}function wr(){var t=Ds();return t.copy=function(){return _s(t,wr())},pe.apply(t,arguments),br(t)}function xr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[yn(r,l,0,n)]:a}function u(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,u()):[t,e]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,u()):i.slice()},o.invertExtent=function(l){var s=i.indexOf(l);return s<0?[NaN,NaN]:s<1?[t,r[0]]:s>=n?[r[n-1],e]:[r[s-1],r[s]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return xr().domain([t,e]).range(i).unknown(a)},pe.apply(br(o),arguments)}function kt(t,e,n){this.k=t,this.x=e,this.y=n}kt.prototype={constructor:kt,scale:function(t){return t===1?this:new kt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new kt(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+")"}},kt.prototype;function j(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ss(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function nt(t,e){if(j(t)===!1||j(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;j(r[o])&&j(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Ms(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 Cs(t,e){return e instanceof Function?e(t):Xe(e)(t)}function It(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function me(t,e){return`${t}_series${e}`}function Ye(t,e){return`${t}_group${e}`}function We({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){const r=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((i,a)=>r[a]!=null?r[a]:me(n,a))}function _r({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:me(`${n}_grid${r}`,o))}function $r({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){if(t[0]==null)return[];const r=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((i,a)=>r[a]!=null?r[a]:Ye(n,a))}function Dr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:Ye(`${n}_grid${r}`,o))}function wt(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 ge(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return wt(e)}function Ps(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Be(t){const n=t.flat().filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Fs(t){const n=t.flat().flat().filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Es(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||j(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return wt(r)}function Ar(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 Rt(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 Sr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function je(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Sr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=s*c+s*r;return{slotIndex:u,rowIndex:s,columnIndex:l,startX:h,startY:d,centerX:h+f/2,centerY:d+c/2,width:f,height:c}})}function ye(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Sr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=s*c+s*r,p=[h,d],m=[f/t.width,c/t.height];return{slotIndex:u,rowIndex:s,columnIndex:l,translate:p,scale:m}})}const Ls=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,u,l,s)=>{const f=It(n.type,u,l),c=n.seriesLabels[u]||me("series",u),h=Rt(u,r);return typeof o=="number"?{id:f,index:s,seq:0,label:f,description:"",data:{},value:o,seriesIndex:u,seriesLabel:c,color:h,visible:!0}:{id:o.id?o.id:f,index:s,seq:0,label:o.label?o.label:f,description:o.description,data:o.data??{},value:o.value,seriesIndex:u,seriesLabel:c,color:h,visible:!0}};i=e.map((o,u)=>Array.isArray(o)?o.map((l,s)=>a(l,u,s,i.length+s)):a(o,u,0,i.length)).flat().sort(n.sort??void 0).map((o,u)=>(o.seq=u,o)).map(o=>(o.visible=n.visibleFilter(o,t),o)).sort((o,u)=>o.index-u.index).reduce((o,u)=>(o[u.seriesIndex]||(o[u.seriesIndex]=[]),o[u.seriesIndex].push(u),o),[])}catch(a){throw Error(a)}return i};var Je=function(t,e){return Je=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])},Je(t,e)};function tt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Je(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Ts(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{s(r.next(f))}catch(c){o(c)}}function l(f){try{s(r.throw(f))}catch(c){o(c)}}function s(f){f.done?a(f.value):i(f.value).then(u,l)}s((r=r.apply(t,e||[])).next())})}function Mr(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(f){return l([s,f])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(t,n)}catch(f){s=[6,f],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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 rt(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 it(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 Os(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,c)}}function u(d,p){r[d]&&(i[d]=function(m){return new Promise(function(b,x){a.push([d,m,b,x])>1||l(d,m)})},p&&(i[d]=p(i[d])))}function l(d,p){try{s(r[d](p))}catch(m){h(a[0][3],m)}}function s(d){d.value instanceof _t?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){l("next",d)}function c(d){l("throw",d)}function h(d,p){d(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Ns(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,l){o=t[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(s){a({value:s,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function E(t){return typeof t=="function"}function Ke(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 Ze=Ke(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
1
|
+
(function(w,Mt){typeof exports=="object"&&typeof module<"u"?Mt(exports):typeof define=="function"&&define.amd?define(["exports"],Mt):(w=typeof globalThis<"u"?globalThis:w||self,Mt(w["orbcharts-core"]={}))})(this,function(w){"use strict";const Mt={preset:{}},dn={top:60,right:60,bottom:60,left:60},pn={padding:dn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",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:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},vi=800,bi=500,Z={position:"left",scaleDomain:[0,"auto"],scaleRange:[0,.9],label:""},wi={position:"bottom",scaleDomain:[0,"auto"],scalePadding:.5,label:""},$e={gap:120,rowAmount:1,columnAmount:1},xi={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...$e},separateSeries:!1,sumSeries:!1},mn={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...Z},groupAxis:{...wi},separateSeries:!1},_i={type:"grid",visibleFilter:(t,e)=>!0,grid:{...mn},container:{...$e}},qt={...mn},$i={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...qt}],separateGrid:!1,container:{...$e}},Di={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],multiValue:[],xAxis:{...Z},yAxis:{...Z}},Ai={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]},Si={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};function Yt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Mi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gn(t){let e,n,r;t.length!==2?(e=Yt,n=(u,l)=>Yt(t(u),l),r=(u,l)=>t(u)-l):(e=t===Yt||t===Mi?t:Ci,n=t,r=t);function i(u,l,s=0,h=u.length){if(s<h){if(e(l,l)!==0)return h;do{const c=s+h>>>1;n(u[c],l)<0?s=c+1:h=c}while(s<h)}return s}function a(u,l,s=0,h=u.length){if(s<h){if(e(l,l)!==0)return h;do{const c=s+h>>>1;n(u[c],l)<=0?s=c+1:h=c}while(s<h)}return s}function o(u,l,s=0,h=u.length){const c=i(u,l,s,h-1);return c>s&&r(u[c-1],l)>-r(u[c],l)?c-1:c}return{left:i,center:o,right:a}}function Ci(){return 0}function Pi(t){return t===null?NaN:+t}const yn=gn(Yt).right;gn(Pi).center;class vn extends Map{constructor(e,n=Li){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(bn(this,e))}has(e){return super.has(bn(this,e))}set(e,n){return super.set(Ei(this,e),n)}delete(e){return super.delete(Fi(this,e))}}function bn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ei({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Fi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Li(t){return t!==null&&typeof t=="object"?t.valueOf():t}const Ti=Math.sqrt(50),Oi=Math.sqrt(10),Ni=Math.sqrt(2);function Bt(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>=Ti?10:a>=Oi?5:a>=Ni?2:1;let u,l,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),l=Math.round(e*s),u/s<t&&++u,l/s>e&&--l,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),l=Math.round(e/s),u*s<t&&++u,l*s>e&&--l),l<u&&.5<=n&&n<2?Bt(t,e,n*2):[u,l,s]}function ki(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?Bt(e,t,n):Bt(t,e,n);if(!(a>=i))return[];const u=a-i+1,l=new Array(u);if(r)if(o<0)for(let s=0;s<u;++s)l[s]=(a-s)/-o;else for(let s=0;s<u;++s)l[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)l[s]=(i+s)/-o;else for(let s=0;s<u;++s)l[s]=(i+s)*o;return l}function De(t,e,n){return e=+e,t=+t,n=+n,Bt(t,e,n)[2]}function Ii(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?De(e,t,n):De(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function Ri(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 Gi={value:()=>{}};function wn(){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 Wt(n)}function Wt(t){this._=t}function Vi(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}})}Wt.prototype=wn.prototype={constructor:Wt,on:function(t,e){var n=this._,r=Vi(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=zi(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]=xn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=xn(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 Wt(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 zi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function xn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Gi,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ae="http://www.w3.org/1999/xhtml";const _n={svg:"http://www.w3.org/2000/svg",xhtml:Ae,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function jt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),_n.hasOwnProperty(e)?{space:_n[e],local:t}:t}function Ui(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ae&&e.documentElement.namespaceURI===Ae?e.createElement(t):e.createElementNS(n,t)}}function Hi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function $n(t){var e=jt(t);return(e.local?Hi:Ui)(e)}function Xi(){}function Se(t){return t==null?Xi:function(){return this.querySelector(t)}}function qi(t){typeof t!="function"&&(t=Se(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),l,s,h=0;h<o;++h)(l=a[h])&&(s=t.call(l,l.__data__,h,a))&&("__data__"in l&&(s.__data__=l.__data__),u[h]=s);return new z(r,this._parents)}function Yi(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Bi(){return[]}function Dn(t){return t==null?Bi:function(){return this.querySelectorAll(t)}}function Wi(t){return function(){return Yi(t.apply(this,arguments))}}function ji(t){typeof t=="function"?t=Wi(t):t=Dn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&(r.push(t.call(l,l.__data__,s,o)),i.push(l));return new z(r,i)}function An(t){return function(){return this.matches(t)}}function Sn(t){return function(e){return e.matches(t)}}var Ji=Array.prototype.find;function Ki(t){return function(){return Ji.call(this.children,t)}}function Zi(){return this.firstElementChild}function Qi(t){return this.select(t==null?Zi:Ki(typeof t=="function"?t:Sn(t)))}var ta=Array.prototype.filter;function ea(){return Array.from(this.children)}function na(t){return function(){return ta.call(this.children,t)}}function ra(t){return this.selectAll(t==null?ea:na(typeof t=="function"?t:Sn(t)))}function ia(t){typeof t!="function"&&(t=An(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]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new z(r,this._parents)}function Mn(t){return new Array(t.length)}function aa(){return new z(this._enter||this._groups.map(Mn),this._parents)}function Jt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Jt.prototype={constructor:Jt,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 oa(t){return function(){return t}}function ua(t,e,n,r,i,a){for(var o=0,u,l=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Jt(t,a[o]);for(;o<l;++o)(u=e[o])&&(i[o]=u)}function sa(t,e,n,r,i,a,o){var u,l,s=new Map,h=e.length,c=a.length,f=new Array(h),d;for(u=0;u<h;++u)(l=e[u])&&(f[u]=d=o.call(l,l.__data__,u,e)+"",s.has(d)?i[u]=l:s.set(d,l));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(l=s.get(d))?(r[u]=l,l.__data__=a[u],s.delete(d)):n[u]=new Jt(t,a[u]);for(u=0;u<h;++u)(l=e[u])&&s.get(f[u])===l&&(i[u]=l)}function la(t){return t.__data__}function ca(t,e){if(!arguments.length)return Array.from(this,la);var n=e?sa:ua,r=this._parents,i=this._groups;typeof t!="function"&&(t=oa(t));for(var a=i.length,o=new Array(a),u=new Array(a),l=new Array(a),s=0;s<a;++s){var h=r[s],c=i[s],f=c.length,d=fa(t.call(h,h&&h.__data__,s,r)),p=d.length,m=u[s]=new Array(p),b=o[s]=new Array(p),x=l[s]=new Array(f);n(h,c,m,b,x,d,e);for(var D=0,A=0,_,S;D<p;++D)if(_=m[D]){for(D>=A&&(A=D+1);!(S=b[A])&&++A<p;);_._next=S||null}}return o=new z(o,r),o._enter=u,o._exit=l,o}function fa(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ha(){return new z(this._exit||this._groups.map(Mn),this._parents)}function da(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 pa(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),l=0;l<o;++l)for(var s=n[l],h=r[l],c=s.length,f=u[l]=new Array(c),d,p=0;p<c;++p)(d=s[p]||h[p])&&(f[p]=d);for(;l<i;++l)u[l]=n[l];return new z(u,this._parents)}function ma(){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 ga(t){t||(t=ya);function e(c,f){return c&&f?t(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,l=i[a]=new Array(u),s,h=0;h<u;++h)(s=o[h])&&(l[h]=s);l.sort(e)}return new z(i,this._parents).order()}function ya(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function va(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ba(){return Array.from(this)}function wa(){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 xa(){let t=0;for(const e of this)++t;return t}function _a(){return!this.node()}function $a(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 Da(t){return function(){this.removeAttribute(t)}}function Aa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Sa(t,e){return function(){this.setAttribute(t,e)}}function Ma(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ca(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function Pa(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 Ea(t,e){var n=jt(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?Aa:Da:typeof e=="function"?n.local?Pa:Ca:n.local?Ma:Sa)(n,e))}function Cn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fa(t){return function(){this.style.removeProperty(t)}}function La(t,e,n){return function(){this.style.setProperty(t,e,n)}}function Ta(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Oa(t,e,n){return arguments.length>1?this.each((e==null?Fa:typeof e=="function"?Ta:La)(t,e,n??"")):mt(this.node(),t)}function mt(t,e){return t.style.getPropertyValue(e)||Cn(t).getComputedStyle(t,null).getPropertyValue(e)}function Na(t){return function(){delete this[t]}}function ka(t,e){return function(){this[t]=e}}function Ia(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Ra(t,e){return arguments.length>1?this.each((e==null?Na:typeof e=="function"?Ia:ka)(t,e)):this.node()[t]}function Pn(t){return t.trim().split(/^|\s+/)}function Me(t){return t.classList||new En(t)}function En(t){this._node=t,this._names=Pn(t.getAttribute("class")||"")}En.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 Fn(t,e){for(var n=Me(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Ln(t,e){for(var n=Me(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ga(t){return function(){Fn(this,t)}}function Va(t){return function(){Ln(this,t)}}function za(t,e){return function(){(e.apply(this,arguments)?Fn:Ln)(this,t)}}function Ua(t,e){var n=Pn(t+"");if(arguments.length<2){for(var r=Me(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?za:e?Ga:Va)(n,e))}function Ha(){this.textContent=""}function Xa(t){return function(){this.textContent=t}}function qa(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ya(t){return arguments.length?this.each(t==null?Ha:(typeof t=="function"?qa:Xa)(t)):this.node().textContent}function Ba(){this.innerHTML=""}function Wa(t){return function(){this.innerHTML=t}}function ja(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ja(t){return arguments.length?this.each(t==null?Ba:(typeof t=="function"?ja:Wa)(t)):this.node().innerHTML}function Ka(){this.nextSibling&&this.parentNode.appendChild(this)}function Za(){return this.each(Ka)}function Qa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function to(){return this.each(Qa)}function eo(t){var e=typeof t=="function"?t:$n(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function no(){return null}function ro(t,e){var n=typeof t=="function"?t:$n(t),r=e==null?no:typeof e=="function"?e:Se(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function io(){var t=this.parentNode;t&&t.removeChild(this)}function ao(){return this.each(io)}function oo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function uo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function so(t){return this.select(t?uo:oo)}function lo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function co(t){return function(e){t.call(this,e,this.__data__)}}function fo(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 ho(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 po(t,e,n){return function(){var r=this.__on,i,a=co(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 mo(t,e,n){var r=fo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,s=u.length,h;l<s;++l)for(i=0,h=u[l];i<a;++i)if((o=r[i]).type===h.type&&o.name===h.name)return h.value}return}for(u=e?po:ho,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Tn(t,e,n){var r=Cn(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 go(t,e){return function(){return Tn(this,t,e)}}function yo(t,e){return function(){return Tn(this,t,e.apply(this,arguments))}}function vo(t,e){return this.each((typeof e=="function"?yo:go)(t,e))}function*bo(){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 On=[null];function z(t,e){this._groups=t,this._parents=e}function Ct(){return new z([[document.documentElement]],On)}function wo(){return this}z.prototype=Ct.prototype={constructor:z,select:qi,selectAll:ji,selectChild:Qi,selectChildren:ra,filter:ia,data:ca,enter:aa,exit:ha,join:da,merge:pa,selection:wo,order:ma,sort:ga,call:va,nodes:ba,node:wa,size:xa,empty:_a,each:$a,attr:Ea,style:Oa,property:Ra,classed:Ua,text:Ya,html:Ja,raise:Za,lower:to,append:eo,insert:ro,remove:ao,clone:so,datum:lo,on:mo,dispatch:vo,[Symbol.iterator]:bo};function Kt(t){return typeof t=="string"?new z([[document.querySelector(t)]],[document.documentElement]):new z([[t]],On)}function Ce(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Nn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pt(){}var Et=.7,Zt=1/Et,gt="\\s*([+-]?\\d+)\\s*",Ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",B="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xo=/^#([0-9a-f]{3,8})$/,_o=new RegExp(`^rgb\\(${gt},${gt},${gt}\\)$`),$o=new RegExp(`^rgb\\(${B},${B},${B}\\)$`),Do=new RegExp(`^rgba\\(${gt},${gt},${gt},${Ft}\\)$`),Ao=new RegExp(`^rgba\\(${B},${B},${B},${Ft}\\)$`),So=new RegExp(`^hsl\\(${Ft},${B},${B}\\)$`),Mo=new RegExp(`^hsla\\(${Ft},${B},${B},${Ft}\\)$`),kn={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};Ce(Pt,st,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:In,formatHex:In,formatHex8:Co,formatHsl:Po,formatRgb:Rn,toString:Rn});function In(){return this.rgb().formatHex()}function Co(){return this.rgb().formatHex8()}function Po(){return Hn(this).formatHsl()}function Rn(){return this.rgb().formatRgb()}function st(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Gn(e):n===3?new G(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=_o.exec(t))?new G(e[1],e[2],e[3],1):(e=$o.exec(t))?new G(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Do.exec(t))?Qt(e[1],e[2],e[3],e[4]):(e=Ao.exec(t))?Qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=So.exec(t))?Un(e[1],e[2]/100,e[3]/100,1):(e=Mo.exec(t))?Un(e[1],e[2]/100,e[3]/100,e[4]):kn.hasOwnProperty(t)?Gn(kn[t]):t==="transparent"?new G(NaN,NaN,NaN,0):null}function Gn(t){return new G(t>>16&255,t>>8&255,t&255,1)}function Qt(t,e,n,r){return r<=0&&(t=e=n=NaN),new G(t,e,n,r)}function Eo(t){return t instanceof Pt||(t=st(t)),t?(t=t.rgb(),new G(t.r,t.g,t.b,t.opacity)):new G}function Pe(t,e,n,r){return arguments.length===1?Eo(t):new G(t,e,n,r??1)}function G(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Ce(G,Pe,Nn(Pt,{brighter(t){return t=t==null?Zt:Math.pow(Zt,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Et:Math.pow(Et,t),new G(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new G(lt(this.r),lt(this.g),lt(this.b),te(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:Vn,formatHex:Vn,formatHex8:Fo,formatRgb:zn,toString:zn}));function Vn(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}`}function Fo(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}${ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function zn(){const t=te(this.opacity);return`${t===1?"rgb(":"rgba("}${lt(this.r)}, ${lt(this.g)}, ${lt(this.b)}${t===1?")":`, ${t})`}`}function te(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function lt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ct(t){return t=lt(t),(t<16?"0":"")+t.toString(16)}function Un(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 Hn(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(t instanceof Pt||(t=st(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),a=Math.max(e,n,r),o=NaN,u=a-i,l=(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/=l<.5?a+i:2-a-i,o*=60):u=l>0&&l<1?0:o,new H(o,u,l,t.opacity)}function Lo(t,e,n,r){return arguments.length===1?Hn(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}Ce(H,Lo,Nn(Pt,{brighter(t){return t=t==null?Zt:Math.pow(Zt,t),new H(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Et:Math.pow(Et,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 G(Ee(t>=240?t-240:t+120,i,r),Ee(t,i,r),Ee(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new H(Xn(this.h),ee(this.s),ee(this.l),te(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=te(this.opacity);return`${t===1?"hsl(":"hsla("}${Xn(this.h)}, ${ee(this.s)*100}%, ${ee(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Xn(t){return t=(t||0)%360,t<0?t+360:t}function ee(t){return Math.max(0,Math.min(1,t||0))}function Ee(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 Fe=t=>()=>t;function To(t,e){return function(n){return t+n*e}}function Oo(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 No(t){return(t=+t)==1?qn:function(e,n){return n-e?Oo(e,n,t):Fe(isNaN(e)?n:e)}}function qn(t,e){var n=e-t;return n?To(t,n):Fe(isNaN(t)?e:t)}const ne=function t(e){var n=No(e);function r(i,a){var o=n((i=Pe(i)).r,(a=Pe(a)).r),u=n(i.g,a.g),l=n(i.b,a.b),s=qn(i.opacity,a.opacity);return function(h){return i.r=o(h),i.g=u(h),i.b=l(h),i.opacity=s(h),i+""}}return r.gamma=t,r}(1);function ko(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 Io(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Ro(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]=Oe(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 Go(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 Vo(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]=Oe(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Le=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Te=new RegExp(Le.source,"g");function zo(t){return function(){return t}}function Uo(t){return function(e){return t(e)+""}}function Yn(t,e){var n=Le.lastIndex=Te.lastIndex=0,r,i,a,o=-1,u=[],l=[];for(t=t+"",e=e+"";(r=Le.exec(t))&&(i=Te.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,l.push({i:o,x:X(r,i)})),n=Te.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?l[0]?Uo(l[0].x):zo(e):(e=l.length,function(s){for(var h=0,c;h<e;++h)u[(c=l[h]).i]=c.x(s);return u.join("")})}function Oe(t,e){var n=typeof e,r;return e==null||n==="boolean"?Fe(e):(n==="number"?X:n==="string"?(r=st(e))?(e=r,ne):Yn:e instanceof st?ne:e instanceof Date?Go:Io(e)?ko:Array.isArray(e)?Ro:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Vo:X)(t,e)}function Ho(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Bn=180/Math.PI,Ne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Wn(t,e,n,r,i,a){var o,u,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Bn,skewX:Math.atan(l)*Bn,scaleX:o,scaleY:u}}var re;function Xo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ne:Wn(e.a,e.b,e.c,e.d,e.e,e.f)}function qo(t){return t==null||(re||(re=document.createElementNS("http://www.w3.org/2000/svg","g")),re.setAttribute("transform",t),!(t=re.transform.baseVal.consolidate()))?Ne:(t=t.matrix,Wn(t.a,t.b,t.c,t.d,t.e,t.f))}function jn(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,h,c,f,d,p){if(s!==c||h!==f){var m=d.push("translate(",null,e,null,n);p.push({i:m-4,x:X(s,c)},{i:m-2,x:X(h,f)})}else(c||f)&&d.push("translate("+c+e+f+n)}function o(s,h,c,f){s!==h?(s-h>180?h+=360:h-s>180&&(s+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:X(s,h)})):h&&c.push(i(c)+"rotate("+h+r)}function u(s,h,c,f){s!==h?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:X(s,h)}):h&&c.push(i(c)+"skewX("+h+r)}function l(s,h,c,f,d,p){if(s!==c||h!==f){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:X(s,c)},{i:m-2,x:X(h,f)})}else(c!==1||f!==1)&&d.push(i(d)+"scale("+c+","+f+")")}return function(s,h){var c=[],f=[];return s=t(s),h=t(h),a(s.translateX,s.translateY,h.translateX,h.translateY,c,f),o(s.rotate,h.rotate,c,f),u(s.skewX,h.skewX,c,f),l(s.scaleX,s.scaleY,h.scaleX,h.scaleY,c,f),s=h=null,function(d){for(var p=-1,m=f.length,b;++p<m;)c[(b=f[p]).i]=b.x(d);return c.join("")}}}var Yo=jn(Xo,"px, ","px)","deg)"),Bo=jn(qo,", ",")",")"),yt=0,Lt=0,Tt=0,Jn=1e3,ie,Ot,ae=0,ft=0,oe=0,Nt=typeof performance=="object"&&performance.now?performance:Date,Kn=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ke(){return ft||(Kn(Wo),ft=Nt.now()+oe)}function Wo(){ft=0}function ue(){this._call=this._time=this._next=null}ue.prototype=Zn.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ke():+n)+(e==null?0:+e),!this._next&&Ot!==this&&(Ot?Ot._next=this:ie=this,Ot=this),this._call=t,this._time=n,Ie()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ie())}};function Zn(t,e,n){var r=new ue;return r.restart(t,e,n),r}function jo(){ke(),++yt;for(var t=ie,e;t;)(e=ft-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yt}function Qn(){ft=(ae=Nt.now())+oe,yt=Lt=0;try{jo()}finally{yt=0,Ko(),ft=0}}function Jo(){var t=Nt.now(),e=t-ae;e>Jn&&(oe-=e,ae=t)}function Ko(){for(var t,e=ie,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:ie=n);Ot=t,Ie(r)}function Ie(t){if(!yt){Lt&&(Lt=clearTimeout(Lt));var e=t-ft;e>24?(t<1/0&&(Lt=setTimeout(Qn,t-Nt.now()-oe)),Tt&&(Tt=clearInterval(Tt))):(Tt||(ae=Nt.now(),Tt=setInterval(Jo,Jn)),yt=1,Kn(Qn))}}function tr(t,e,n){var r=new ue;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Zo=wn("start","end","cancel","interrupt"),Qo=[],er=0,nr=1,Re=2,se=3,rr=4,Ge=5,le=6;function ce(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;tu(t,n,{name:e,index:r,group:i,on:Zo,tween:Qo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:er})}function Ve(t,e){var n=q(t,e);if(n.state>er)throw new Error("too late; already scheduled");return n}function W(t,e){var n=q(t,e);if(n.state>se)throw new Error("too late; already running");return n}function q(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function tu(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Zn(a,0,n.time);function a(s){n.state=nr,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var h,c,f,d;if(n.state!==nr)return l();for(h in r)if(d=r[h],d.name===n.name){if(d.state===se)return tr(o);d.state===rr?(d.state=le,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[h]):+h<e&&(d.state=le,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[h])}if(tr(function(){n.state===se&&(n.state=rr,n.timer.restart(u,n.delay,n.time),u(s))}),n.state=Re,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Re){for(n.state=se,i=new Array(f=n.tween.length),h=0,c=-1;h<f;++h)(d=n.tween[h].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(s){for(var h=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(l),n.state=Ge,1),c=-1,f=i.length;++c<f;)i[c].call(t,h);n.state===Ge&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=le,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function eu(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>Re&&r.state<Ge,r.state=le,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function nu(t){return this.each(function(){eu(this,t)})}function ru(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 iu(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},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}a.tween=i}}function au(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=q(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?ru:iu)(n,t,e))}function ze(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 q(i,r).value[e]}}function ir(t,e){var n;return(typeof e=="number"?X:e instanceof st?ne:(n=st(e))?(e=n,ne):Yn)(t,e)}function ou(t){return function(){this.removeAttribute(t)}}function uu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function su(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 lu(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 cu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function fu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function hu(t,e){var n=jt(t),r=n==="transform"?Bo:ir;return this.attrTween(t,typeof e=="function"?(n.local?fu:cu)(n,r,ze(this,"attr."+t,e)):e==null?(n.local?uu:ou)(n):(n.local?lu:su)(n,r,e))}function du(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function pu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function mu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&pu(t,a)),n}return i._value=e,i}function gu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&du(t,a)),n}return i._value=e,i}function yu(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=jt(t);return this.tween(n,(r.local?mu:gu)(r,e))}function vu(t,e){return function(){Ve(this,t).delay=+e.apply(this,arguments)}}function bu(t,e){return e=+e,function(){Ve(this,t).delay=e}}function wu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?vu:bu)(e,t)):q(this.node(),e).delay}function xu(t,e){return function(){W(this,t).duration=+e.apply(this,arguments)}}function _u(t,e){return e=+e,function(){W(this,t).duration=e}}function $u(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xu:_u)(e,t)):q(this.node(),e).duration}function Du(t,e){if(typeof e!="function")throw new Error;return function(){W(this,t).ease=e}}function Au(t){var e=this._id;return arguments.length?this.each(Du(e,t)):q(this.node(),e).ease}function Su(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;W(this,t).ease=n}}function Mu(t){if(typeof t!="function")throw new Error;return this.each(Su(this._id,t))}function Cu(t){typeof t!="function"&&(t=An(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]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new Q(r,this._parents,this._name,this._id)}function Pu(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 l=e[u],s=n[u],h=l.length,c=o[u]=new Array(h),f,d=0;d<h;++d)(f=l[d]||s[d])&&(c[d]=f);for(;u<r;++u)o[u]=e[u];return new Q(o,this._parents,this._name,this._id)}function Eu(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 Fu(t,e,n){var r,i,a=Eu(e)?Ve:W;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Lu(t,e){var n=this._id;return arguments.length<2?q(this.node(),n).on.on(t):this.each(Fu(n,t,e))}function Tu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Ou(){return this.on("end.remove",Tu(this._id))}function Nu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Se(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],l=u.length,s=a[o]=new Array(l),h,c,f=0;f<l;++f)(h=u[f])&&(c=t.call(h,h.__data__,f,u))&&("__data__"in h&&(c.__data__=h.__data__),s[f]=c,ce(s[f],e,n,f,s,q(h,n)));return new Q(a,this._parents,e,n)}function ku(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Dn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var l=r[u],s=l.length,h,c=0;c<s;++c)if(h=l[c]){for(var f=t.call(h,h.__data__,c,l),d,p=q(h,n),m=0,b=f.length;m<b;++m)(d=f[m])&&ce(d,e,n,m,f,p);a.push(f),o.push(h)}return new Q(a,o,e,n)}var Iu=Ct.prototype.constructor;function Ru(){return new Iu(this._groups,this._parents)}function Gu(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 ar(t){return function(){this.style.removeProperty(t)}}function Vu(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 zu(t,e,n){var r,i,a;return function(){var o=mt(this,t),u=n(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(t),mt(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u))}}function Uu(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var l=W(this,t),s=l.on,h=l.value[a]==null?u||(u=ar(e)):void 0;(s!==n||i!==h)&&(r=(n=s).copy()).on(o,i=h),l.on=r}}function Hu(t,e,n){var r=(t+="")=="transform"?Yo:ir;return e==null?this.styleTween(t,Gu(t,r)).on("end.style."+t,ar(t)):typeof e=="function"?this.styleTween(t,zu(t,r,ze(this,"style."+t,e))).each(Uu(this._id,t)):this.styleTween(t,Vu(t,r,e),n).on("end.style."+t,null)}function Xu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function qu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Xu(t,o,n)),r}return a._value=e,a}function Yu(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,qu(t,e,n??""))}function Bu(t){return function(){this.textContent=t}}function Wu(t){return function(){var e=t(this);this.textContent=e??""}}function ju(t){return this.tween("text",typeof t=="function"?Wu(ze(this,"text",t)):Bu(t==null?"":t+""))}function Ju(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)&&Ju(i)),e}return r._value=t,r}function Zu(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 Qu(){for(var t=this._name,e=this._id,n=or(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)if(l=o[s]){var h=q(l,e);ce(l,t,n,s,o,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new Q(r,this._parents,t,n)}function ts(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var s=W(this,r),h=s.on;h!==t&&(e=(t=h).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),s.on=e}),i===0&&a()})}var es=0;function Q(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function or(){return++es}var tt=Ct.prototype;Q.prototype={constructor:Q,select:Nu,selectAll:ku,selectChild:tt.selectChild,selectChildren:tt.selectChildren,filter:Cu,merge:Pu,selection:Ru,transition:Qu,call:tt.call,nodes:tt.nodes,node:tt.node,size:tt.size,empty:tt.empty,each:tt.each,on:Lu,attr:hu,attrTween:yu,style:Hu,styleTween:Yu,text:ju,textTween:Zu,remove:Ou,tween:au,delay:wu,duration:$u,ease:Au,easeVarying:Mu,end:ts,[Symbol.iterator]:tt[Symbol.iterator]};function ns(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var rs={time:null,delay:0,duration:250,ease:ns};function is(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 as(t){var e,n;t instanceof Q?(e=t._id,t=t._name):(e=or(),(n=rs).time=ke(),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,l,s=0;s<u;++s)(l=o[s])&&ce(l,t,e,s,o,n||is(l,e));return new Q(r,this._parents,t,e)}Ct.prototype.interrupt=nu,Ct.prototype.transition=as;function os(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fe(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 vt(t){return t=fe(Math.abs(t)),t?t[1]:NaN}function us(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(n.substring(i-=u,i+u)),!((l+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function ss(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var ls=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function he(t){if(!(e=ls.exec(t)))throw new Error("invalid format: "+t);var e;return new Ue({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]})}he.prototype=Ue.prototype;function Ue(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+""}Ue.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 cs(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 ur;function fs(t,e){var n=fe(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(ur=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")+fe(t,Math.max(0,e+a-1))[0]}function sr(t,e){var n=fe(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 lr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:os,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)=>sr(t*100,e),r:sr,s:fs,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function cr(t){return t}var fr=Array.prototype.map,hr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hs(t){var e=t.grouping===void 0||t.thousands===void 0?cr:us(fr.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?cr:ss(fr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function s(c){c=he(c);var f=c.fill,d=c.align,p=c.sign,m=c.symbol,b=c.zero,x=c.width,D=c.comma,A=c.precision,_=c.trim,S=c.type;S==="n"?(D=!0,S="g"):lr[S]||(A===void 0&&(A=12),_=!0,S="g"),(b||f==="0"&&d==="=")&&(b=!0,f="0",d="=");var F=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",y=m==="$"?r:/[%p]/.test(S)?o:"",M=lr[S],P=/[defgprs%]/.test(S);A=A===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function ut(g){var V=F,N=y,Y,Xt,pt;if(S==="c")N=M(g)+N,g="";else{g=+g;var K=g<0||1/g<0;if(g=isNaN(g)?l:M(Math.abs(g),A),_&&(g=cs(g)),K&&+g==0&&p!=="+"&&(K=!1),V=(K?p==="("?p:u:p==="-"||p==="("?"":p)+V,N=(S==="s"?hr[8+ur/3]:"")+N+(K&&p==="("?")":""),P){for(Y=-1,Xt=g.length;++Y<Xt;)if(pt=g.charCodeAt(Y),48>pt||pt>57){N=(pt===46?i+g.slice(Y+1):g.slice(Y))+N,g=g.slice(0,Y);break}}}D&&!b&&(g=e(g,1/0));var _e=V.length+g.length+N.length,et=_e<x?new Array(x-_e+1).join(f):"";switch(D&&b&&(g=e(et+g,et.length?x-N.length:1/0),et=""),d){case"<":g=V+g+N+et;break;case"=":g=V+et+g+N;break;case"^":g=et.slice(0,_e=et.length>>1)+V+g+N+et.slice(_e);break;default:g=et+V+g+N;break}return a(g)}return ut.toString=function(){return c+""},ut}function h(c,f){var d=s((c=he(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(vt(f)/3)))*3,m=Math.pow(10,-p),b=hr[8+p/3];return function(x){return d(m*x)+b}}return{format:s,formatPrefix:h}}var de,He,dr;ds({thousands:",",grouping:[3],currency:["$",""]});function ds(t){return de=hs(t),He=de.format,dr=de.formatPrefix,de}function ps(t){return Math.max(0,-vt(Math.abs(t)))}function ms(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vt(e)/3)))*3-vt(Math.abs(t)))}function gs(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,vt(e)-vt(t))+1}function pe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const pr=Symbol("implicit");function mr(){var t=new vn,e=[],n=[],r=pr;function i(a){let o=t.get(a);if(o===void 0){if(r!==pr)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 vn;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 mr(e,n).unknown(r)},pe.apply(i,arguments),i}function gr(){var t=mr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,l=0,s=0,h=.5;delete t.unknown;function c(){var f=e().length,d=i<r,p=d?i:r,m=d?r:i;a=(m-p)/Math.max(1,f-l+s*2),u&&(a=Math.floor(a)),p+=(m-p-a*(f-l))*h,o=a*(1-l),u&&(p=Math.round(p),o=Math.round(o));var b=Ri(f).map(function(x){return p+a*x});return n(d?b.reverse():b)}return t.domain=function(f){return arguments.length?(e(f),c()):e()},t.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(f){return arguments.length?(u=!!f,c()):u},t.padding=function(f){return arguments.length?(l=Math.min(1,s=+f),c()):l},t.paddingInner=function(f){return arguments.length?(l=Math.min(1,f),c()):l},t.paddingOuter=function(f){return arguments.length?(s=+f,c()):s},t.align=function(f){return arguments.length?(h=Math.max(0,Math.min(1,f)),c()):h},t.copy=function(){return gr(e(),[r,i]).round(u).paddingInner(l).paddingOuter(s).align(h)},pe.apply(c(),arguments)}function yr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return yr(e())},t}function ys(){return yr(gr.apply(null,arguments).paddingInner(1))}function vs(t){return function(){return t}}function bs(t){return+t}var vr=[0,1];function bt(t){return t}function Xe(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:vs(isNaN(e)?NaN:.5)}function ws(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function xs(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Xe(i,r),a=n(o,a)):(r=Xe(r,i),a=n(a,o)),function(u){return a(r(u))}}function _s(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]=Xe(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var l=yn(t,u,1,r)-1;return a[l](i[l](u))}}function $s(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ds(){var t=vr,e=vr,n=Oe,r,i,a,o=bt,u,l,s;function h(){var f=Math.min(t.length,e.length);return o!==bt&&(o=ws(t[0],t[f-1])),u=f>2?_s:xs,l=s=null,c}function c(f){return f==null||isNaN(f=+f)?a:(l||(l=u(t.map(r),e,n)))(r(o(f)))}return c.invert=function(f){return o(i((s||(s=u(e,t.map(r),X)))(f)))},c.domain=function(f){return arguments.length?(t=Array.from(f,bs),h()):t.slice()},c.range=function(f){return arguments.length?(e=Array.from(f),h()):e.slice()},c.rangeRound=function(f){return e=Array.from(f),n=Ho,h()},c.clamp=function(f){return arguments.length?(o=f?!0:bt,h()):o!==bt},c.interpolate=function(f){return arguments.length?(n=f,h()):n},c.unknown=function(f){return arguments.length?(a=f,c):a},function(f,d){return r=f,i=d,h()}}function As(){return Ds()(bt,bt)}function Ss(t,e,n,r){var i=Ii(t,e,n),a;switch(r=he(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=ms(i,o))&&(r.precision=a),dr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=gs(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ps(i))&&(r.precision=a-(r.type==="%")*2);break}}return He(r)}function br(t){var e=t.domain;return t.ticks=function(n){var r=e();return ki(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Ss(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],l,s,h=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);h-- >0;){if(s=De(o,u,n),s===l)return r[i]=o,r[a]=u,e(r);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;l=s}return t},t}function wr(){var t=As();return t.copy=function(){return $s(t,wr())},pe.apply(t,arguments),br(t)}function xr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[yn(r,l,0,n)]:a}function u(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,u()):[t,e]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,u()):i.slice()},o.invertExtent=function(l){var s=i.indexOf(l);return s<0?[NaN,NaN]:s<1?[t,r[0]]:s>=n?[r[n-1],e]:[r[s-1],r[s]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return xr().domain([t,e]).range(i).unknown(a)},pe.apply(br(o),arguments)}function kt(t,e,n){this.k=t,this.x=e,this.y=n}kt.prototype={constructor:kt,scale:function(t){return t===1?this:new kt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new kt(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+")"}},kt.prototype;function j(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ms(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function nt(t,e){if(j(t)===!1||j(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;j(r[o])&&j(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Cs(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 Ps(t,e){return e instanceof Function?e(t):He(e)(t)}function It(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function me(t,e){return`${t}_series${e}`}function qe(t,e){return`${t}_group${e}`}function Ye({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){const r=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((i,a)=>r[a]!=null?r[a]:me(n,a))}function _r({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:me(`${n}_grid${r}`,o))}function $r({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){if(t[0]==null)return[];const r=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((i,a)=>r[a]!=null?r[a]:qe(n,a))}function Dr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:qe(`${n}_grid${r}`,o))}function wt(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 ge(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return wt(e)}function Es(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Be(t){const n=t.flat().filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Fs(t){const n=t.flat().flat().filter(r=>(r==null||j(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return wt(n)}function Ls(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||j(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return wt(r)}function Ar(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 Rt(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 Sr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function We(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Sr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),h=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,f=l*h+l*r,d=s*c+s*r;return{slotIndex:u,rowIndex:s,columnIndex:l,startX:f,startY:d,centerX:f+h/2,centerY:d+c/2,width:h,height:c}})}function ye(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Sr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),h=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,f=l*h+l*r,d=s*c+s*r,p=[f,d],m=[h/t.width,c/t.height];return{slotIndex:u,rowIndex:s,columnIndex:l,translate:p,scale:m}})}const Ts=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,u,l,s)=>{const h=It(n.type,u,l),c=n.seriesLabels[u]||me("series",u),f=Rt(u,r);return typeof o=="number"?{id:h,index:s,seq:0,label:h,description:"",data:{},value:o,seriesIndex:u,seriesLabel:c,color:f,visible:!0}:{id:o.id?o.id:h,index:s,seq:0,label:o.label?o.label:h,description:o.description,data:o.data??{},value:o.value,seriesIndex:u,seriesLabel:c,color:f,visible:!0}};i=e.map((o,u)=>Array.isArray(o)?o.map((l,s)=>a(l,u,s,i.length+s)):a(o,u,0,i.length)).flat().sort(n.sort??void 0).map((o,u)=>(o.seq=u,o)).map(o=>(o.visible=n.visibleFilter(o,t),o)).sort((o,u)=>o.index-u.index).reduce((o,u)=>(o[u.seriesIndex]||(o[u.seriesIndex]=[]),o[u.seriesIndex].push(u),o),[])}catch(a){throw Error(a)}return i};var je=function(t,e){return je=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])},je(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");je(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Os(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(h){try{s(r.next(h))}catch(c){o(c)}}function l(h){try{s(r.throw(h))}catch(c){o(c)}}function s(h){h.done?a(h.value):i(h.value).then(u,l)}s((r=r.apply(t,e||[])).next())})}function Mr(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(h){return l([s,h])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(t,n)}catch(h){s=[6,h],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[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 rt(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 it(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 Ns(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,c)}}function u(d,p){r[d]&&(i[d]=function(m){return new Promise(function(b,x){a.push([d,m,b,x])>1||l(d,m)})},p&&(i[d]=p(i[d])))}function l(d,p){try{s(r[d](p))}catch(m){f(a[0][3],m)}}function s(d){d.value instanceof _t?Promise.resolve(d.value.v).then(h,c):f(a[0][2],d)}function h(d){l("next",d)}function c(d){l("throw",d)}function f(d,p){d(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function ks(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,l){o=t[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(s){a({value:s,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function L(t){return typeof t=="function"}function Je(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 Ke=Je(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 ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gt=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),l=u.next();!l.done;l=u.next()){var s=l.value;s.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(E(f))try{f()}catch(m){a=m instanceof Ze?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=xt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{Fr(p)}catch(m){a=a??[],m instanceof Ze?a=it(it([],rt(a)),rt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new Ze(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Fr(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)&&ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Cr=Gt.EMPTY;function Pr(t){return t instanceof Gt||t&&"closed"in t&&E(t.remove)&&E(t.add)&&E(t.unsubscribe)}function Fr(t){E(t)?t():t.unsubscribe()}var Er={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Lr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,it([t,e],rt(n)))},clearTimeout:function(t){var e=Lr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Tr(t){Lr.setTimeout(function(){throw t})}function Qe(){}function be(t){t()}var tn=function(t){tt(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Pr(n)&&n.add(r)):r.destination=Gs,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}(Gt),ks=Function.prototype.bind;function en(t,e){return ks.call(t,e)}var Is=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){we(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){we(r)}else we(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){we(n)}},t}(),Vt=function(t){tt(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(E(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Er.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&en(n.next,u),error:n.error&&en(n.error,u),complete:n.complete&&en(n.complete,u)}):o=n}return a.destination=new Is(o),a}return e}(tn);function we(t){Tr(t)}function Rs(t){throw t}var Gs={closed:!0,next:Qe,error:Rs,complete:Qe},nn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $t(t){return t}function Vs(t){return t.length===0?$t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var L=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=Us(e)?e:new Vt(e,n,r);return be(function(){var o=i,u=o.operator,l=o.source;a.add(u?u.call(a,l):l?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=Or(n),new n(function(i,a){var o=new Vt({next:function(u){try{e(u)}catch(l){a(l),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[nn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Vs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Or(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 Or(t){var e;return(e=t??Er.Promise)!==null&&e!==void 0?e:Promise}function zs(t){return t&&E(t.next)&&E(t.error)&&E(t.complete)}function Us(t){return t&&t instanceof tn||zs(t)&&Pr(t)}function Hs(t){return E(t==null?void 0:t.lift)}function N(t){return function(e){if(Hs(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 k(t,e,n,r,i){return new Xs(t,e,n,r,i)}var Xs=function(t){tt(e,t);function e(n,r,i,a,o,u){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=u,l._next=r?function(s){try{r(s)}catch(f){n.error(f)}}:t.prototype._next,l._error=a?function(s){try{a(s)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,l}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}(tn),qs=Ke(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),F=function(t){tt(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 Nr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new qs},e.prototype.next=function(n){var r=this;be(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 l=u.value;l.next(n)}}catch(s){i={error:s}}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;be(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;be(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?Cr:(this.currentObservers=null,u.push(n),new Gt(function(){r.currentObservers=null,ve(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 L;return n.source=this,n},e.create=function(n,r){return new Nr(n,r)},e}(L),Nr=function(t){tt(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:Cr},e}(F),rn={now:function(){return(rn.delegate||Date).now()},delegate:void 0},Ys=function(t){tt(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=rn);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,l=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+l)),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(),l=0;l<u.length&&!n.closed;l+=a?1:2)n.next(u[l]);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 l=i.now(),s=0,f=1;f<a.length&&a[f]<=l;f+=2)s=f;s&&a.splice(0,s+1)}},e}(F),Ws=function(t){tt(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Gt),an={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,it([t,e],rt(n)))},clearInterval:function(t){var e=an.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Bs=function(t){tt(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),an.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&&an.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,ve(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ws),kr=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=rn.now,t}(),js=function(t){tt(e,t);function e(n,r){r===void 0&&(r=kr.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}(kr),on=new js(Bs),Js=on,un=new L(function(t){return t.complete()});function Ir(t){return t&&E(t.schedule)}function sn(t){return t[t.length-1]}function Ks(t){return E(sn(t))?t.pop():void 0}function Dt(t){return Ir(sn(t))?t.pop():void 0}function Rr(t,e){return typeof sn(t)=="number"?t.pop():e}var Gr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Vr(t){return E(t==null?void 0:t.then)}function zr(t){return E(t[nn])}function Ur(t){return Symbol.asyncIterator&&E(t==null?void 0:t[Symbol.asyncIterator])}function Hr(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 Zs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Xr=Zs();function qr(t){return E(t==null?void 0:t[Xr])}function Yr(t){return Os(this,arguments,function(){var n,r,i,a;return Mr(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 Wr(t){return E(t==null?void 0:t.getReader)}function U(t){if(t instanceof L)return t;if(t!=null){if(zr(t))return Qs(t);if(Gr(t))return tl(t);if(Vr(t))return el(t);if(Ur(t))return Br(t);if(qr(t))return nl(t);if(Wr(t))return rl(t)}throw Hr(t)}function Qs(t){return new L(function(e){var n=t[nn]();if(E(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function tl(t){return new L(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function el(t){return new L(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Tr)})}function nl(t){return new L(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 Br(t){return new L(function(e){il(t,e).catch(function(n){return e.error(n)})})}function rl(t){return Br(Yr(t))}function il(t,e){var n,r,i,a;return Ts(this,void 0,void 0,function(){var o,u;return Mr(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=Ns(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),i={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.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 at(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 jr(t,e){return e===void 0&&(e=0),N(function(n,r){n.subscribe(k(r,function(i){return at(r,t,function(){return r.next(i)},e)},function(){return at(r,t,function(){return r.complete()},e)},function(i){return at(r,t,function(){return r.error(i)},e)}))})}function Jr(t,e){return e===void 0&&(e=0),N(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function al(t,e){return U(t).pipe(Jr(e),jr(e))}function ol(t,e){return U(t).pipe(Jr(e),jr(e))}function ul(t,e){return new L(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function sl(t,e){return new L(function(n){var r;return at(n,e,function(){r=t[Xr](),at(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 E(r==null?void 0:r.return)&&r.return()}})}function Kr(t,e){if(!t)throw new Error("Iterable cannot be null");return new L(function(n){at(n,e,function(){var r=t[Symbol.asyncIterator]();at(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function ll(t,e){return Kr(Yr(t),e)}function cl(t,e){if(t!=null){if(zr(t))return al(t,e);if(Gr(t))return ul(t,e);if(Vr(t))return ol(t,e);if(Ur(t))return Kr(t,e);if(qr(t))return sl(t,e);if(Wr(t))return ll(t,e)}throw Hr(t)}function At(t,e){return e?cl(t,e):U(t)}function zt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t);return At(t,n)}var Zr=Ke(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function fl(t){return t instanceof Date&&!isNaN(t)}function $(t,e){return N(function(n,r){var i=0;n.subscribe(k(r,function(a){r.next(t.call(e,a,i++))}))})}var hl=Array.isArray;function dl(t,e){return hl(e)?t.apply(void 0,it([],rt(e))):t(e)}function pl(t){return $(function(e){return dl(t,e)})}var ml=Array.isArray,gl=Object.getPrototypeOf,yl=Object.prototype,vl=Object.keys;function bl(t){if(t.length===1){var e=t[0];if(ml(e))return{args:e,keys:null};if(wl(e)){var n=vl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function wl(t){return t&&typeof t=="object"&&gl(t)===yl}function xl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function R(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Ks(t),i=bl(t),a=i.args,o=i.keys;if(a.length===0)return At([],n);var u=new L(_l(a,n,o?function(l){return xl(o,l)}:$t));return r?u.pipe(pl(r)):u}function _l(t,e,n){return n===void 0&&(n=$t),function(r){Qr(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,l=function(f){Qr(e,function(){var c=At(t[f],e),h=!1;c.subscribe(k(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},s=0;s<i;s++)l(s)},r)}}function Qr(t,e,n){t?at(n,t,e):e()}function $l(t,e,n,r,i,a,o,u){var l=[],s=0,f=0,c=!1,h=function(){c&&!l.length&&!s&&e.complete()},d=function(m){return s<r?p(m):l.push(m)},p=function(m){s++;var b=!1;U(n(m,f++)).subscribe(k(e,function(x){e.next(x)},function(){b=!0},void 0,function(){if(b)try{s--;for(var x=function(){var D=l.shift();o||p(D)};l.length&&s<r;)x();h()}catch(D){e.error(D)}}))};return t.subscribe(k(e,d,function(){c=!0,h()})),function(){}}function ti(t,e,n){return n===void 0&&(n=1/0),E(e)?ti(function(r,i){return $(function(a,o){return e(r,a,i,o)})(U(t(r,i)))},n):(typeof e=="number"&&(n=e),N(function(r,i){return $l(r,i,t,n)}))}function ln(t){return t===void 0&&(t=1/0),ti($t,t)}function Dl(){return ln(1)}function ei(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Dl()(At(t,Dt(t)))}function Al(t,e,n){n===void 0&&(n=Js);var r=-1;return e!=null&&(Ir(e)?n=e:r=e),new L(function(i){var a=fl(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 Sl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Rr(t,1/0),i=t;return i.length?i.length===1?U(i[0]):ln(r)(At(i,n)):un}var Ml=Array.isArray;function Cl(t){return t.length===1&&Ml(t[0])?t[0]:t}function ni(t,e){return N(function(n,r){var i=0;n.subscribe(k(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function ri(t){return N(function(e,n){var r=null,i=!1,a;r=e.subscribe(k(n,void 0,void 0,function(o){a=U(t(o,ri(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Pl(t,e){return e===void 0&&(e=on),N(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var s=a;a=null,r.next(s)}};function l(){var s=o+t,f=e.now();if(f<s){i=this.schedule(void 0,s-f),r.add(i);return}u()}n.subscribe(k(r,function(s){a=s,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function Fl(t){return N(function(e,n){var r=!1;e.subscribe(k(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function El(t){return t<=0?function(){return un}:N(function(e,n){var r=0;e.subscribe(k(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function ot(t,e){return e===void 0&&(e=$t),t=t??Ll,N(function(n,r){var i,a=!0;n.subscribe(k(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Ll(t,e){return t===e}function Tl(t){return t===void 0&&(t=Ol),N(function(e,n){var r=!1;e.subscribe(k(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Ol(){return new Zr}function Nl(t,e){var n=arguments.length>=2;return function(r){return r.pipe($t,El(1),n?Fl(e):Tl(function(){return new Zr}))}}function kl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Rr(t,1/0);return t=Cl(t),N(function(i,a){ln(r)(At(it([i],rt(t)),n)).subscribe(a)})}function Il(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return kl.apply(void 0,it([],rt(t)))}function cn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new F}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,l=u===void 0?!0:u;return function(s){var f,c,h,d=0,p=!1,m=!1,b=function(){c==null||c.unsubscribe(),c=void 0},x=function(){b(),f=h=void 0,p=m=!1},D=function(){var A=f;x(),A==null||A.unsubscribe()};return N(function(A,_){d++,!m&&!p&&b();var S=h=h??n();_.add(function(){d--,d===0&&!m&&!p&&(c=fn(D,l))}),S.subscribe(_),!f&&d>0&&(f=new Vt({next:function(T){return S.next(T)},error:function(T){m=!0,b(),c=fn(x,i,T),S.error(T)},complete:function(){p=!0,b(),c=fn(x,o),S.complete()}}),U(A).subscribe(f))})(s)}}function fn(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 U(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function v(t,e,n){var r,i=!1;return r=t,cn({connector:function(){return new Ys(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function xe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t);return N(function(r,i){(n?ei(t,r,n):ei(t,r)).subscribe(i)})}function I(t,e){return N(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(k(r,function(l){i==null||i.unsubscribe();var s=0,f=a++;U(t(l,f)).subscribe(i=k(r,function(c){return r.next(e?e(l,c,f,s++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function C(t){return N(function(e,n){U(t).subscribe(k(n,function(){return n.complete()},Qe)),!n.closed&&e.subscribe(n)})}function Rl(t,e){return N(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,l=u===void 0?!1:u,s=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(b(),h&&r.complete())},p=function(){c=null,h&&r.complete()},m=function(x){return c=U(t(x)).subscribe(k(r,d,p))},b=function(){if(s){s=!1;var x=f;f=null,r.next(x),!h&&m(x)}};n.subscribe(k(r,function(x){s=!0,f=x,!(c&&!c.closed)&&(o?b():m(x))},function(){h=!0,!(l&&s&&c&&!c.closed)&&r.complete()}))})}function Gl(t,e,n){e===void 0&&(e=on);var r=Al(t,e);return Rl(function(){return r},n)}const Ut=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new F,i=e.pipe(C(r),$(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),ot()),a=n.pipe(C(r),ni(c=>c.eventName==="mouseover"||c.eventName==="mousemove"),$(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),o=n.pipe(C(r),ni(c=>c.eventName==="mouseout"),I(c=>i));function u(c,h){const d=c.find(p=>p.id===h);return d?[d]:[]}function l(c,h){return h==null?[]:c.filter(d=>d.seriesLabel===h)}function s(c,h){return h==null?[]:c.filter(d=>d.groupLabel===h)}function f(c,h){return h==null?[]:c.filter(d=>d.categoryLabel===h)}return new L(c=>(R({target:Sl(a,o,i),datumList:t,fullChartParams:e}).pipe(C(r),I(async h=>h)).subscribe(h=>{let d=[];h.fullChartParams.highlightTarget==="datum"?d=u(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=l(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=s(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},_e=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),hn=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),ii=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.filter(r=>r.categoryLabel!=null).forEach(r=>{const i=n.get(r.categoryLabel)??[];i.push(r),n.set(r.categoryLabel,i)}),n})),Ht=t=>t.pipe($(e=>e.styles.textSize),ot(),$(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),Vl=({fullDataFormatter$:t})=>t.pipe($(e=>e.separateSeries),ot()),zl=({computedData$:t})=>t.pipe($(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),ot((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),ai=({computedData$:t})=>t.pipe($(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Ul=({computedData$:t,fullDataFormatter$:e})=>R({computedData:t,fullDataFormatter:e}).pipe(I(async n=>n),$(n=>{const r=n.fullDataFormatter.sumSeries==!0?n.computedData.map(i=>[i.reduce((a,o)=>a==null?o:(a.value=a.value+o.value,a),null)]):n.computedData;return n.fullDataFormatter.separateSeries==!0?r.map(i=>i.sort((a,o)=>a.seq-o.seq)):[r.flat().sort((i,a)=>i.seq-a.seq)]})),Hl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(I(async i=>i),$(i=>i.fullDataFormatter.separateSeries?je(i.layout,i.fullDataFormatter.container,i.computedData.length):je(i.layout,i.fullDataFormatter.container,1))),Xl=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>R({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(I(async r=>r),$(r=>r.separateSeries?new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[a]??r.seriesContainerPosition[0]])):new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[0]])))),ql=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=Vl({fullDataFormatter$:e.fullDataFormatter$}),i=ai({computedData$:e.computedData$}),a=Ul({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),o=ai({computedData$:a}),u=e.computedData$.pipe($(d=>d.flat())).pipe(v(1)),l=Ut({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),s=zl({computedData$:e.computedData$}),f=_e({datumList$:u}).pipe(v(1)),c=Hl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),h=Xl({seriesContainerPosition$:c,seriesLabels$:s,separateSeries$:r}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedLayoutData$:o,separateSeries$:r,computedLayoutData$:a,seriesHighlight$:l,seriesLabels$:s,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:h}},ht=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=K.scaleDomain,scaleRange:i=K.scaleRange})=>{const a=r[0]??K.scaleDomain[0],o=r[1]??K.scaleDomain[1],u=i[0]??K.scaleRange[0],l=i[1]??K.scaleRange[1],s=a==="auto"?e:a,f=o==="auto"?t:o,c=t-(t-s)/(1-u),h=f/l;return wr().domain([c,h]).range([0,n])},Yl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return gs().domain(t).range(r).padding(n)},Wl=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),xr().domain([-0,e+0]).range(a)};function Bl(t){return new L(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)}})}function oi(t,e,n){const r=nt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return nt(i,o)})),r}const jl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new F,i=t.type;return function(o,u){Kt(o).selectAll("svg").remove();const l=Kt(o).append("svg");l.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 s=l.append("g");s.classed("orbcharts__layout",!0);const f=s.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new F,dataFormatter$:new F,plugins$:new F,chartParams$:new F,event$:new F},h=(g=>{const M=g||Mt,P=M.preset?M.preset:{};return{chartParams:P.chartParams?nt(P.chartParams,pn):pn,dataFormatter:P.dataFormatter?oi(P.dataFormatter,t,i):t,allPluginParams:P.allPluginParams?P.allPluginParams:{},description:P.description??""}})(u),d=c.data$.pipe(v(1)),p=c.dataFormatter$.pipe(C(r),xe({}),$(g=>oi(g,h.dataFormatter,i)),v(1)),m=c.chartParams$.pipe(C(r),xe({}),$(g=>nt(g,h.chartParams)),v(1)),b=m.pipe(C(r),xe({}),$(g=>nt(g.padding??{},dn)));b.pipe(C(r),Nl()).subscribe(g=>{s.attr("transform",`translate(${g.left}, ${g.top})`)}),b.subscribe(g=>{s.transition().attr("transform",`translate(${g.left}, ${g.top})`)});const x=Bl(o).pipe(C(r),cn()),D=zt().pipe(Il(x.pipe(Pl(250)),x.pipe(Gl(250))),ot((g,M)=>JSON.stringify(g)===JSON.stringify(M)),cn()),A=D.subscribe(),_=R({rootSize:D,mergedPadding:b}).pipe(C(r),I(async g=>{const M=g.rootSize.width>0?g.rootSize.width:yi,P=g.rootSize.height>0?g.rootSize.height:vi;return{width:M-g.mergedPadding.left-g.mergedPadding.right,height:P-g.mergedPadding.top-g.mergedPadding.bottom,top:g.mergedPadding.top,right:g.mergedPadding.right,bottom:g.mergedPadding.bottom,left:g.mergedPadding.left,rootWidth:M,rootHeight:P}}),v(1));_.subscribe(g=>{l.attr("width",g.rootWidth).attr("height",g.rootHeight)});const S=R({data:d,dataFormatter:p,chartParams:m}).pipe(C(r),I(async g=>g),I(g=>zt(g).pipe($(M=>{try{return e({data:M.data,dataFormatter:M.dataFormatter,chartParams:M.chartParams})}catch(P){throw console.error(P),new Error(P)}}),ri(()=>un))),v(1));S.subscribe();const T={};return c.plugins$.subscribe(g=>{if(!g)return;const M=f.selectAll("g.orbcharts__plugin").data(g,y=>y.name),P=M.enter().append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`);M.exit().remove().each((y,V,O)=>{T[y.name]&&T[y.name].destroy()}),P.each((y,V,O)=>{const Y={fullParams$:new L,fullChartParams$:m,fullDataFormatter$:p,computedData$:S,layout$:_},Xt=n({observer:Y,subject:c}),J={selection:Kt(O[V]),rootSelection:l,name:y.name,chartType:i,subject:c,observer:Xt};y.setPresetParams(h.allPluginParams[y.name]??{}),y.setContext(J),T[J.name]=y,y.init()})}),{...c,selection:l,destroy(){Kt(o).selectAll("svg").remove(),r.next(void 0),A.unsubscribe()}}}};class St{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new F,this.dataFormatter$=new F,this.plugins$=new F,this.chartParams$=new F,this.event$=new F;const u=jl({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 Jl extends St{constructor(e,n){super({defaultDataFormatter:wi,computedDataFn:Ls,contextObserverFn:ql},e,n)}}function ui(t,e){if(!t.length)return[];try{const n=t.reduce((o,u)=>u.length>o?u.length:o,0),i=t.map((o,u)=>{if(o.length===n)return o;const l=Object.assign([],o);for(let s=l.length;s<n;s++)l[s]=null;return l}).map((o,u)=>o.map((l,s)=>l==null?{id:"",label:"",data:{},value:null}:typeof l=="number"?{id:"",label:"",data:{},value:l}:{id:l.id??"",label:l.label??"",data:l.data??{},value:l.value}));return Ar(e.seriesDirection,i)}catch{return[]}}const Kl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=ui(e,n.grid),o=We({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"}),u=$r({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"});let l=0;i=a.map((s,f)=>s.map((c,h)=>{const d=It("grid",0,f,h),p=u[h],m={id:c.id?c.id:d,index:l,label:c.label?c.label:d,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:h,groupLabel:p,color:Rt(f,r),visible:!0};return m.visible=n.visibleFilter(m,t),l++,m}))}catch(a){throw Error(a)}return i},si=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,u){const l=o.grid.groupAxis.position==="top"||o.grid.groupAxis.position==="bottom"?u.width:u.height,s=a[0]?a[0].length-1:0;return ht({maxValue:s,minValue:0,axisWidth:l,scaleDomain:[0,s],scaleRange:[0,1]})}function i(a,o,u){const l=o.grid.valueAxis.position==="left"||o.grid.valueAxis.position==="right"?u.height:u.width,s=a.flat(),[f,c]=ge(s);return ht({maxValue:c,minValue:f,axisWidth:l,scaleDomain:[f,c],scaleRange:[0,1]})}return R({computedData:t,fullDataFormatter:e,layout:n}).pipe(I(async a=>a),$(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),u=i(a.computedData,a.fullDataFormatter,a.layout),l=u(0);return a.computedData.map((s,f)=>s.map((c,h)=>{const d=o(h),p=u(c.value??0);return{...c,axisX:d,axisY:p,axisYFromZero:p-l}}))}))},li=({fullDataFormatter$:t,layout$:e})=>{const n=new F;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,s=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,s=u):a.position==="right"?(c=180,h=180,l=o,s=u):(c=180,s=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,l=o):(c=180,s=u)):i.position==="left"?a.position==="bottom"?(f=-90,s=u):a.position==="top"?(f=-90,h=180):(c=180,s=u):i.position==="right"&&(a.position==="bottom"?(f=-90,c=180,s=u,l=o):a.position==="top"?(f=-90,c=180,h=180,l=o):(c=180,s=u)),{translate:[l,s],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${l}px, ${s}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new L(i=>(R({fullDataFormatter:t,layout:e}).pipe(C(n),I(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},ci=({gridAxesTransform$:t})=>t.pipe($(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[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)`}})),fi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new F;function i({data:a,groupAxis:o,valueAxis:u,width:l,height:s}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:s,m=0,b=a[0]?a[0].length-1:0,x=o.scaleDomain[0]==="auto"?m-o.scalePadding:o.scaleDomain[0]-o.scalePadding,D=o.scaleDomain[1]==="auto"?b+o.scalePadding:o.scaleDomain[1]+o.scalePadding,A=ht({maxValue:b,minValue:m,axisWidth:p,scaleDomain:[x,D],scaleRange:[0,1]}),_=A(m),S=A(b);m==b?(f=0,h=1):(f=_,h=(S-_)/p);const T=a.map((Y,Xt)=>Y.filter((pt,J)=>J>=x&&J<=D&&pt.visible==!0)),g=Be(T),M=u.position==="left"||u.position==="right"?s:l,P=ht({maxValue:g[1],minValue:g[0],axisWidth:M,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),ut=Be(a),y=P(ut[0]),V=P(ut[1]);return c=y,d=(V-y)/M,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new L(a=>(R({computedData:t,fullDataFormatter:e,layout:n}).pipe(C(r),I(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},hi=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>R({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(I(async r=>r),$(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[1]]):r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[0]]))),di=({fullDataFormatter$:t,layout$:e})=>{const n=new F;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 L(i=>{R({fullDataFormatter:t,layout:e}).pipe(C(n),I(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},pi=({computedData$:t})=>t.pipe($(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),ot((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),mi=({computedData$:t})=>t.pipe($(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),gi=({computedLayoutData$:t})=>t.pipe($(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Zl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(I(async i=>i),$(i=>i.fullDataFormatter.grid.separateSeries?ye(i.layout,i.fullDataFormatter.container,i.computedData.length):ye(i.layout,i.fullDataFormatter.container,1))),Ql=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=Zl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),i=li({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),a=ci({gridAxesTransform$:i}).pipe(v(1)),o=fi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),u=hi({gridContainerPosition$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),l=di({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),s=e.computedData$.pipe($(x=>x.flat())).pipe(v(1)),f=Ut({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),c=pi({computedData$:e.computedData$}),h=_e({datumList$:s}).pipe(v(1)),d=hn({datumList$:s}).pipe(v(1)),p=si({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),m=mi({computedData$:e.computedData$}).pipe(v(1)),b=gi({computedLayoutData$:p}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,gridContainerPosition$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:l,gridHighlight$:f,seriesLabels$:c,SeriesDataMap$:h,GroupDataMap$:d,computedLayoutData$:p,visibleComputedData$:m,visibleComputedLayoutData$:b}};class tc extends St{constructor(e,n){super({defaultDataFormatter:xi,computedDataFn:Kl,contextObserverFn:Ql},e,n)}}const ec=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||qt,o=e.map((c,h)=>n.gridList[h]||a),u=e.map((c,h)=>ui(c,o[h])),l=n.separateGrid?u.map((c,h)=>We({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid"})):u.map((c,h)=>_r({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h})),s=new Map;let f=0;l.flat().forEach((c,h)=>{if(!s.has(c)){const d=Rt(f,r);s.set(c,d),f++}}),i=u.map((c,h)=>{const d=l[h],p=Dr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h});let m=0;return c.map((x,D)=>x.map((A,_)=>{const S=It("multiGrid",h,D,_),T=p[_],g=d[D],M={id:A.id?A.id:S,index:m,label:A.label?A.label:S,description:A.description??"",data:A.data,value:A.value,gridIndex:h,seriesIndex:D,seriesLabel:g,groupIndex:_,groupLabel:T,color:s.get(g),visible:!0};return M.visible=n.visibleFilter(M,t),m++,M}))})}catch(a){throw Error(a)}return i},nc=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new F,o=Ut({datumList$:e.pipe($(l=>l.flat().flat()),v(1)),fullChartParams$:r,event$:i}).pipe(v(1)),u=rc({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(v(1));return R({fullDataFormatter:t,computedData:e,multiGridContainer:u}).pipe(I(async l=>l),$(l=>{a.next(void 0);const s=l.fullDataFormatter.gridList[0]??qt;return l.computedData.map((f,c)=>{const h=l.fullDataFormatter.gridList[c]??s,d={type:"grid",visibleFilter:l.fullDataFormatter.visibleFilter,grid:{...h},container:{...l.fullDataFormatter.container}},p=zt(d).pipe(C(a),v(1)),m=zt(f).pipe(C(a),v(1)),b=zt(l.multiGridContainer[c]).pipe(C(a),v(1)),x=li({fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),D=ci({gridAxesTransform$:x}).pipe(C(a),v(1)),A=fi({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),_=hi({gridContainerPosition$:b,gridAxesTransform$:x,gridGraphicTransform$:A}),S=di({fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),T=m.pipe($(O=>O.flat())).pipe(C(a),v(1)),g=pi({computedData$:m}).pipe(C(a),v(1)),M=_e({datumList$:T}).pipe(C(a),v(1)),P=hn({datumList$:T}).pipe(C(a),v(1)),ut=mi({computedData$:m}).pipe(C(a),v(1)),y=si({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),V=gi({computedLayoutData$:y}).pipe(C(a),v(1));return{gridContainerPosition$:b,gridAxesTransform$:x,gridAxesReverseTransform$:D,gridGraphicTransform$:A,gridGraphicReverseScale$:_,gridAxesSize$:S,gridHighlight$:o,seriesLabels$:g,SeriesDataMap$:M,GroupDataMap$:P,dataFormatter$:p,computedData$:m,computedLayoutData$:y,visibleComputedData$:ut,visibleComputedLayoutData$:V}})}))},rc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(I(async r=>r),$(r=>{const i=r.fullDataFormatter.gridList[0]??qt,a=r.computedData.reduce((s,f,c)=>{const d=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return s+d},0)||1,o=ye(r.layout,r.fullDataFormatter.container,a);let u=0;return r.computedData.map((s,f)=>{const c=r.fullDataFormatter.gridList[f]??i,h=s.map((d,p)=>{const m=o[u];return c.separateSeries&&(u+=1),m});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(u+=1),h})})),ic=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=nc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,multiGridEachDetail$:r}};class ac extends St{constructor(e,n){super({defaultDataFormatter:_i,computedDataFn:ec,contextObserverFn:ic},e,n)}}const oc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i={width:1e3,height:1e3};let a=[];try{const o=e.map((D,A)=>D.map((_,S)=>typeof _=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:_}:{id:_.id??"",label:_.label??"",description:_.description??"",data:_.data??{},categoryLabel:_.categoryLabel??"",value:_.value})),[u,l]=ge(o.map(D=>D[0])),[s,f]=ge(o.map(D=>D[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:l,minValue:u,axisWidth:c,scaleDomain:[u,l],scaleRange:[0,1]}),p=ht({maxValue:f,minValue:s,axisWidth:h,scaleDomain:[s,f],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?l:n.xAxis.scaleDomain[1]],b=[n.yAxis.scaleDomain[0]==="auto"?s:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?f:n.yAxis.scaleDomain[1]];let x=0;a=o.map((D,A)=>D.map((_,S)=>{const T=x;x++;const g=It(n.type,A,S),M={id:_.id?_.id:g,index:T,label:_.label?_.label:g,description:_.description??"",data:_.data,value:_.value,categoryIndex:0,categoryLabel:"",axis:S==0?d(_.value):p(_.value),visible:!0,color:""};return M.visible=n.visibleFilter(M,t),M}))}catch(o){throw Error(o)}return a},uc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class sc extends St{constructor(e,n){super({defaultDataFormatter:$i,computedDataFn:oc,contextObserverFn:uc},e,n)}}const lc=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,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:!0}));const l=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:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:!0}));const s=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(l).forEach(([c,h])=>{h.startNodes=s.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id),h.visible=n.visibleFilter(h,t)}),a=a.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(o){throw Error(o)}return{nodes:i,edges:a}},cc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class fc extends St{constructor(e,n){super({defaultDataFormatter:Ai,computedDataFn:lc,contextObserverFn:cc},e,n)}}const hc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,u)=>[o,u]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(j(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const f=new Map;e.forEach(h=>{if(!h.parent)s=h;else{const d=f.get(h.parent)??[];d.push(h),f.set(h.parent,d)}});const c=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel,children:(f.get(h.id)??[]).map(d=>c(d))});return s?c(s):{id:""}}();let u=0;const l=(s,f,c)=>{const h=f+1,d=s.categoryLabel??null;let p=0;d!=null&&(i.has(d)||i.set(d,i.size),p=i.get(d)??0);const m=u;u++;const b={id:s.id,index:m,level:f,seq:c,label:s.label??"",description:s.description??"",categoryIndex:p,categoryLabel:d,color:Rt(p,r),data:s.data??{},value:s.value,visible:!0,children:(s.children??[]).map((x,D)=>l(x,h,D))};return b.visible=n.visibleFilter(b,t),b};a=l(o,0,0)}catch(o){throw Error(o)}return a},dc=({computedData$:t})=>t.pipe($(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),pc=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe($(r=>r.categoryLabels),ot((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return R({nodeList:t,categoryLabels:n}).pipe(I(async r=>r),$(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),ot((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},mc=({computedData$:t})=>t.pipe($(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),gc=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=dc({computedData$:e.computedData$}).pipe(v(1)),i=Ut({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),a=pc({nodeList$:r,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),o=ii({datumList$:r}).pipe(v(1)),u=mc({computedData$:e.computedData$}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,existCategoryLabels$:a,CategoryDataMap$:o,visibleComputedData$:u}};class yc extends St{constructor(e,n){super({defaultDataFormatter:Di,computedDataFn:hc,contextObserverFn:gc},e,n)}}function vc({name:t,defaultParams:e,initFn:n}){const r=new F,i=new F,a=new WeakMap;let o=()=>{},u,l=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:s=>{l=nt(s,e)},setContext:s=>{u=s,u.observer.fullParams$=i.pipe(C(r),xe({}),$(f=>nt(f,l)),v(1))}}}const dt=()=>function(e,n){return function(i){return class{constructor(){const o=vc({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}}}},bc=dt(),wc=dt(),xc=dt(),_c=dt(),$c=dt(),Dc=dt(),Ac=dt();w.GridChart=tc,w.MultiGridChart=ac,w.MultiValueChart=sc,w.RelationshipChart=fc,w.SeriesChart=Jl,w.TreeChart=yc,w.calcGridContainerLayout=ye,w.calcSeriesContainerLayout=je,w.categoryDataMapObservable=ii,w.createAxisLinearScale=ht,w.createAxisPointScale=Yl,w.createAxisQuantizeScale=Wl,w.createDefaultDatumId=It,w.createDefaultGroupLabel=Ye,w.createDefaultSeriesLabel=me,w.createGridGroupLabels=$r,w.createGridSeriesLabels=We,w.createMultiGridGroupLabels=Dr,w.createMultiGridSeriesLabels=_r,w.defineGridPlugin=wc,w.defineMultiGridPlugin=xc,w.defineMultiValuePlugin=_c,w.defineNoneDataPlugin=$c,w.defineRelationshipPlugin=Dc,w.defineSeriesPlugin=bc,w.defineTreePlugin=Ac,w.formatCommaNumber=Ms,w.formatValueToLabel=Cs,w.getMinAndMax=wt,w.getMinAndMaxGrid=Be,w.getMinAndMaxMultiGrid=Fs,w.getMinAndMaxMultiValue=Es,w.getMinAndMaxSeries=Ps,w.getMinAndMaxValue=ge,w.groupDataMapObservable=hn,w.highlightObservable=Ut,w.isFunction=Ss,w.isPlainObject=j,w.mergeOptionsWithDefault=nt,w.seriesColorPredicate=Rt,w.seriesDataMapObservable=_e,w.textSizePxObservable=Ht,w.transposeData=Ar,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Gt=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),l=u.next();!l.done;l=u.next()){var s=l.value;s.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var h=this.initialTeardown;if(L(h))try{h()}catch(m){a=m instanceof Ke?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=xt(c),d=f.next();!d.done;d=f.next()){var p=d.value;try{Er(p)}catch(m){a=a??[],m instanceof Ke?a=it(it([],rt(a)),rt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(a)throw new Ke(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Er(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)&&ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Cr=Gt.EMPTY;function Pr(t){return t instanceof Gt||t&&"closed"in t&&L(t.remove)&&L(t.add)&&L(t.unsubscribe)}function Er(t){L(t)?t():t.unsubscribe()}var Fr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Lr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,it([t,e],rt(n)))},clearTimeout:function(t){var e=Lr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Tr(t){Lr.setTimeout(function(){throw t})}function Ze(){}function be(t){t()}var Qe=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Pr(n)&&n.add(r)):r.destination=Vs,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}(Gt),Is=Function.prototype.bind;function tn(t,e){return Is.call(t,e)}var Rs=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){we(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){we(r)}else we(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){we(n)}},t}(),Vt=function(t){J(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(L(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Fr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&tn(n.next,u),error:n.error&&tn(n.error,u),complete:n.complete&&tn(n.complete,u)}):o=n}return a.destination=new Rs(o),a}return e}(Qe);function we(t){Tr(t)}function Gs(t){throw t}var Vs={closed:!0,next:Ze,error:Gs,complete:Ze},en=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $t(t){return t}function zs(t){return t.length===0?$t:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var T=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=Hs(e)?e:new Vt(e,n,r);return be(function(){var o=i,u=o.operator,l=o.source;a.add(u?u.call(a,l):l?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=Or(n),new n(function(i,a){var o=new Vt({next:function(u){try{e(u)}catch(l){a(l),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[en]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return zs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Or(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 Or(t){var e;return(e=t??Fr.Promise)!==null&&e!==void 0?e:Promise}function Us(t){return t&&L(t.next)&&L(t.error)&&L(t.complete)}function Hs(t){return t&&t instanceof Qe||Us(t)&&Pr(t)}function Xs(t){return L(t==null?void 0:t.lift)}function k(t){return function(e){if(Xs(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 qs(t,e,n,r,i)}var qs=function(t){J(e,t);function e(n,r,i,a,o,u){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=u,l._next=r?function(s){try{r(s)}catch(h){n.error(h)}}:t.prototype._next,l._error=a?function(s){try{a(s)}catch(h){n.error(h)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,l}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}(Qe),Ys=Je(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),E=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 Nr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new Ys},e.prototype.next=function(n){var r=this;be(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 l=u.value;l.next(n)}}catch(s){i={error:s}}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;be(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;be(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?Cr:(this.currentObservers=null,u.push(n),new Gt(function(){r.currentObservers=null,ve(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 T;return n.source=this,n},e.create=function(n,r){return new Nr(n,r)},e}(T),Nr=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:Cr},e}(E),kr=function(t){J(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,a=n._value;if(r)throw i;return this._throwIfClosed(),a},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(E),nn={now:function(){return(nn.delegate||Date).now()},delegate:void 0},Bs=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=nn);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,l=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+l)),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(),l=0;l<u.length&&!n.closed;l+=a?1:2)n.next(u[l]);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 l=i.now(),s=0,h=1;h<a.length&&a[h]<=l;h+=2)s=h;s&&a.splice(0,s+1)}},e}(E),Ws=function(t){J(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Gt),rn={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,it([t,e],rt(n)))},clearInterval:function(t){var e=rn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},js=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 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),rn.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&&rn.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,ve(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ws),Ir=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=nn.now,t}(),Js=function(t){J(e,t);function e(n,r){r===void 0&&(r=Ir.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}(Ir),an=new Js(js),Ks=an,on=new T(function(t){return t.complete()});function Rr(t){return t&&L(t.schedule)}function un(t){return t[t.length-1]}function Zs(t){return L(un(t))?t.pop():void 0}function Dt(t){return Rr(un(t))?t.pop():void 0}function Gr(t,e){return typeof un(t)=="number"?t.pop():e}var Vr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function zr(t){return L(t==null?void 0:t.then)}function Ur(t){return L(t[en])}function Hr(t){return Symbol.asyncIterator&&L(t==null?void 0:t[Symbol.asyncIterator])}function Xr(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 Qs(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var qr=Qs();function Yr(t){return L(t==null?void 0:t[qr])}function Br(t){return Ns(this,arguments,function(){var n,r,i,a;return Mr(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 Wr(t){return L(t==null?void 0:t.getReader)}function U(t){if(t instanceof T)return t;if(t!=null){if(Ur(t))return tl(t);if(Vr(t))return el(t);if(zr(t))return nl(t);if(Hr(t))return jr(t);if(Yr(t))return rl(t);if(Wr(t))return il(t)}throw Xr(t)}function tl(t){return new T(function(e){var n=t[en]();if(L(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function el(t){return new T(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function nl(t){return new T(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Tr)})}function rl(t){return new T(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 jr(t){return new T(function(e){al(t,e).catch(function(n){return e.error(n)})})}function il(t){return jr(Br(t))}function al(t,e){var n,r,i,a;return Os(this,void 0,void 0,function(){var o,u;return Mr(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=ks(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),i={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.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 at(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 Jr(t,e){return e===void 0&&(e=0),k(function(n,r){n.subscribe(I(r,function(i){return at(r,t,function(){return r.next(i)},e)},function(){return at(r,t,function(){return r.complete()},e)},function(i){return at(r,t,function(){return r.error(i)},e)}))})}function Kr(t,e){return e===void 0&&(e=0),k(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function ol(t,e){return U(t).pipe(Kr(e),Jr(e))}function ul(t,e){return U(t).pipe(Kr(e),Jr(e))}function sl(t,e){return new T(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function ll(t,e){return new T(function(n){var r;return at(n,e,function(){r=t[qr](),at(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 L(r==null?void 0:r.return)&&r.return()}})}function Zr(t,e){if(!t)throw new Error("Iterable cannot be null");return new T(function(n){at(n,e,function(){var r=t[Symbol.asyncIterator]();at(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function cl(t,e){return Zr(Br(t),e)}function fl(t,e){if(t!=null){if(Ur(t))return ol(t,e);if(Vr(t))return sl(t,e);if(zr(t))return ul(t,e);if(Hr(t))return Zr(t,e);if(Yr(t))return ll(t,e);if(Wr(t))return cl(t,e)}throw Xr(t)}function At(t,e){return e?fl(t,e):U(t)}function zt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t);return At(t,n)}var Qr=Je(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function hl(t){return t instanceof Date&&!isNaN(t)}function $(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(a){r.next(t.call(e,a,i++))}))})}var dl=Array.isArray;function pl(t,e){return dl(e)?t.apply(void 0,it([],rt(e))):t(e)}function ml(t){return $(function(e){return pl(t,e)})}var gl=Array.isArray,yl=Object.getPrototypeOf,vl=Object.prototype,bl=Object.keys;function wl(t){if(t.length===1){var e=t[0];if(gl(e))return{args:e,keys:null};if(xl(e)){var n=bl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function xl(t){return t&&typeof t=="object"&&yl(t)===vl}function _l(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function R(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Zs(t),i=wl(t),a=i.args,o=i.keys;if(a.length===0)return At([],n);var u=new T($l(a,n,o?function(l){return _l(o,l)}:$t));return r?u.pipe(ml(r)):u}function $l(t,e,n){return n===void 0&&(n=$t),function(r){ti(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,l=function(h){ti(e,function(){var c=At(t[h],e),f=!1;c.subscribe(I(r,function(d){a[h]=d,f||(f=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},s=0;s<i;s++)l(s)},r)}}function ti(t,e,n){t?at(n,t,e):e()}function Dl(t,e,n,r,i,a,o,u){var l=[],s=0,h=0,c=!1,f=function(){c&&!l.length&&!s&&e.complete()},d=function(m){return s<r?p(m):l.push(m)},p=function(m){s++;var b=!1;U(n(m,h++)).subscribe(I(e,function(x){e.next(x)},function(){b=!0},void 0,function(){if(b)try{s--;for(var x=function(){var D=l.shift();o||p(D)};l.length&&s<r;)x();f()}catch(D){e.error(D)}}))};return t.subscribe(I(e,d,function(){c=!0,f()})),function(){}}function ei(t,e,n){return n===void 0&&(n=1/0),L(e)?ei(function(r,i){return $(function(a,o){return e(r,a,i,o)})(U(t(r,i)))},n):(typeof e=="number"&&(n=e),k(function(r,i){return Dl(r,i,t,n)}))}function sn(t){return t===void 0&&(t=1/0),ei($t,t)}function Al(){return sn(1)}function ni(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Al()(At(t,Dt(t)))}function Sl(t,e,n){n===void 0&&(n=Ks);var r=-1;return e!=null&&(Rr(e)?n=e:r=e),new T(function(i){var a=hl(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 Ml(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Gr(t,1/0),i=t;return i.length?i.length===1?U(i[0]):sn(r)(At(i,n)):on}var Cl=Array.isArray;function Pl(t){return t.length===1&&Cl(t[0])?t[0]:t}function ri(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function ii(t){return k(function(e,n){var r=null,i=!1,a;r=e.subscribe(I(n,void 0,void 0,function(o){a=U(t(o,ii(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function El(t,e){return e===void 0&&(e=an),k(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var s=a;a=null,r.next(s)}};function l(){var s=o+t,h=e.now();if(h<s){i=this.schedule(void 0,s-h),r.add(i);return}u()}n.subscribe(I(r,function(s){a=s,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function Fl(t){return k(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 Ll(t){return t<=0?function(){return on}:k(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function ot(t,e){return e===void 0&&(e=$t),t=t??Tl,k(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 Tl(t,e){return t===e}function Ol(t){return t===void 0&&(t=Nl),k(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 Nl(){return new Qr}function kl(t,e){var n=arguments.length>=2;return function(r){return r.pipe($t,Ll(1),n?Fl(e):Ol(function(){return new Qr}))}}function Il(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t),r=Gr(t,1/0);return t=Pl(t),k(function(i,a){sn(r)(At(it([i],rt(t)),n)).subscribe(a)})}function Rl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Il.apply(void 0,it([],rt(t)))}function ln(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new E}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,l=u===void 0?!0:u;return function(s){var h,c,f,d=0,p=!1,m=!1,b=function(){c==null||c.unsubscribe(),c=void 0},x=function(){b(),h=f=void 0,p=m=!1},D=function(){var A=h;x(),A==null||A.unsubscribe()};return k(function(A,_){d++,!m&&!p&&b();var S=f=f??n();_.add(function(){d--,d===0&&!m&&!p&&(c=cn(D,l))}),S.subscribe(_),!h&&d>0&&(h=new Vt({next:function(F){return S.next(F)},error:function(F){m=!0,b(),c=cn(x,i,F),S.error(F)},complete:function(){p=!0,b(),c=cn(x,o),S.complete()}}),U(A).subscribe(h))})(s)}}function cn(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 U(e.apply(void 0,it([],rt(n)))).subscribe(i)}}function v(t,e,n){var r,i=!1;return r=t,ln({connector:function(){return new Bs(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Dt(t);return k(function(r,i){(n?ni(t,r,n):ni(t,r)).subscribe(i)})}function O(t,e){return k(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(I(r,function(l){i==null||i.unsubscribe();var s=0,h=a++;U(t(l,h)).subscribe(i=I(r,function(c){return r.next(e?e(l,c,h,s++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function C(t){return k(function(e,n){U(t).subscribe(I(n,function(){return n.complete()},Ze)),!n.closed&&e.subscribe(n)})}function Gl(t,e){return k(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,l=u===void 0?!1:u,s=!1,h=null,c=null,f=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(b(),f&&r.complete())},p=function(){c=null,f&&r.complete()},m=function(x){return c=U(t(x)).subscribe(I(r,d,p))},b=function(){if(s){s=!1;var x=h;h=null,r.next(x),!f&&m(x)}};n.subscribe(I(r,function(x){s=!0,h=x,!(c&&!c.closed)&&(o?b():m(x))},function(){f=!0,!(l&&s&&c&&!c.closed)&&r.complete()}))})}function Vl(t,e,n){e===void 0&&(e=an);var r=Sl(t,e);return Gl(function(){return r},n)}const Ut=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new E,i=e.pipe(C(r),$(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),ot()),a=n.pipe(C(r),ri(c=>c.eventName==="mouseover"||c.eventName==="mousemove"),$(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),o=n.pipe(C(r),ri(c=>c.eventName==="mouseout"),O(c=>i));function u(c,f){const d=c.find(p=>p.id===f);return d?[d]:[]}function l(c,f){return f==null?[]:c.filter(d=>d.seriesLabel===f)}function s(c,f){return f==null?[]:c.filter(d=>d.groupLabel===f)}function h(c,f){return f==null?[]:c.filter(d=>d.categoryLabel===f)}return new T(c=>(R({target:Ml(a,o,i),datumList:t,fullChartParams:e}).pipe(C(r),O(async f=>f)).subscribe(f=>{let d=[];f.fullChartParams.highlightTarget==="datum"?d=u(f.datumList,f.target.id):f.fullChartParams.highlightTarget==="series"?d=l(f.datumList,f.target.seriesLabel):f.fullChartParams.highlightTarget==="group"?d=s(f.datumList,f.target.groupLabel):f.fullChartParams.highlightTarget==="category"&&(d=h(f.datumList,f.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},xe=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),hn=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),ai=({datumList$:t})=>t.pipe($(e=>{const n=new Map;return e.filter(r=>r.categoryLabel!=null).forEach(r=>{const i=n.get(r.categoryLabel)??[];i.push(r),n.set(r.categoryLabel,i)}),n})),Ht=t=>t.pipe($(e=>e.styles.textSize),ot(),$(e=>{let n=NaN;if(typeof e=="string")if(e.includes("rem")){const r=parseFloat(getComputedStyle(document.documentElement).fontSize);n=parseFloat(e)*r}else e.includes("px")&&(n=parseFloat(e));else if(typeof e=="number")return e;return n||14})),zl=({fullDataFormatter$:t})=>t.pipe($(e=>e.separateSeries),ot()),Ul=({computedData$:t})=>t.pipe($(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),ot((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),oi=({computedData$:t})=>t.pipe($(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Hl=({computedData$:t,fullDataFormatter$:e})=>R({computedData:t,fullDataFormatter:e}).pipe(O(async n=>n),$(n=>{const r=n.fullDataFormatter.sumSeries==!0?n.computedData.map(i=>[i.reduce((a,o)=>a==null?o:(a.value=a.value+o.value,a),null)]):n.computedData;return n.fullDataFormatter.separateSeries==!0?r.map(i=>i.sort((a,o)=>a.seq-o.seq)):[r.flat().sort((i,a)=>i.seq-a.seq)]})),Xl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(async i=>i),$(i=>i.fullDataFormatter.separateSeries?We(i.layout,i.fullDataFormatter.container,i.computedData.length):We(i.layout,i.fullDataFormatter.container,1))),ql=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>R({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(O(async r=>r),$(r=>r.separateSeries?new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[a]??r.seriesContainerPosition[0]])):new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[0]])))),Yl=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=zl({fullDataFormatter$:e.fullDataFormatter$}),i=oi({computedData$:e.computedData$}),a=Hl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),o=oi({computedData$:a}),u=e.computedData$.pipe($(d=>d.flat())).pipe(v(1)),l=Ut({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),s=Ul({computedData$:e.computedData$}),h=xe({datumList$:u}).pipe(v(1)),c=Xl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),f=ql({seriesContainerPosition$:c,seriesLabels$:s,separateSeries$:r}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedLayoutData$:o,separateSeries$:r,computedLayoutData$:a,seriesHighlight$:l,seriesLabels$:s,SeriesDataMap$:h,seriesContainerPosition$:c,SeriesContainerPositionMap$:f}},ht=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=Z.scaleDomain,scaleRange:i=Z.scaleRange})=>{const a=r[0]??Z.scaleDomain[0],o=r[1]??Z.scaleDomain[1],u=i[0]??Z.scaleRange[0],l=i[1]??Z.scaleRange[1],s=a==="auto"?e:a,h=o==="auto"?t:o,c=t-(t-s)/(1-u),f=h/l;return wr().domain([c,f]).range([0,n])},Bl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ys().domain(t).range(r).padding(n)},Wl=({axisLabels:t,axisWidth:e,padding:n=.5,reverse:r=!1})=>{let a=t.map((o,u)=>u);return r&&a.reverse(),xr().domain([-0,e+0]).range(a)};function jl(t){return new T(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)}})}function ui(t,e,n){const r=nt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return nt(i,o)})),r}const Jl=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new E,i=t.type;return function(o,u){Kt(o).selectAll("svg").remove();const l=Kt(o).append("svg");l.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 s=l.append("g");s.classed("orbcharts__layout",!0);const h=s.append("g");h.classed("orbcharts__plugins",!0);const c={data$:new E,dataFormatter$:new E,plugins$:new E,chartParams$:new E,event$:new E},f=(y=>{const M=y||Mt,P=M.preset?M.preset:{};return{chartParams:P.chartParams?nt(P.chartParams,pn):pn,dataFormatter:P.dataFormatter?ui(P.dataFormatter,t,i):t,allPluginParams:P.allPluginParams?P.allPluginParams:{},description:P.description??""}})(u),d=c.data$.pipe(v(1)),p=c.dataFormatter$.pipe(C(r),fn({}),$(y=>ui(y,f.dataFormatter,i)),v(1)),m=c.chartParams$.pipe(C(r),fn({}),$(y=>nt(y,f.chartParams)),v(1)),b=m.pipe(C(r),fn({}),$(y=>nt(y.padding??{},dn)));b.pipe(C(r),kl()).subscribe(y=>{s.attr("transform",`translate(${y.left}, ${y.top})`)}),b.subscribe(y=>{s.transition().attr("transform",`translate(${y.left}, ${y.top})`)});const x=jl(o).pipe(C(r),ln()),D=zt().pipe(Rl(x.pipe(El(250)),x.pipe(Vl(250))),ot((y,M)=>JSON.stringify(y)===JSON.stringify(M)),ln()),A=D.subscribe(),_=R({rootSize:D,mergedPadding:b}).pipe(C(r),O(async y=>{const M=y.rootSize.width>0?y.rootSize.width:vi,P=y.rootSize.height>0?y.rootSize.height:bi;return{width:M-y.mergedPadding.left-y.mergedPadding.right,height:P-y.mergedPadding.top-y.mergedPadding.bottom,top:y.mergedPadding.top,right:y.mergedPadding.right,bottom:y.mergedPadding.bottom,left:y.mergedPadding.left,rootWidth:M,rootHeight:P}}),v(1));_.subscribe(y=>{l.attr("width",y.rootWidth).attr("height",y.rootHeight)});const S=R({data:d,dataFormatter:p,chartParams:m}).pipe(C(r),O(async y=>y),O(y=>zt(y).pipe($(M=>{try{return e({data:M.data,dataFormatter:M.dataFormatter,chartParams:M.chartParams})}catch(P){throw console.error(P),new Error(P)}}),ii(()=>on))),v(1));S.subscribe();const F={};return c.plugins$.subscribe(y=>{if(!y)return;const M=h.selectAll("g.orbcharts__plugin").data(y,g=>g.name),P=M.enter().append("g").attr("class",g=>`orbcharts__plugin orbcharts__${g.name}`);M.exit().remove().each((g,V,N)=>{F[g.name]&&(F[g.name].destroy(),F[g.name]=void 0)}),P.each((g,V,N)=>{const Y={fullParams$:new T,fullChartParams$:m,fullDataFormatter$:p,computedData$:S,layout$:_},Xt=n({observer:Y,subject:c}),K={selection:Kt(N[V]),rootSelection:l,name:g.name,chartType:i,subject:c,observer:Xt};g.setPresetParams(f.allPluginParams[g.name]??{}),g.setContext(K),F[K.name]=g,g.init()})}),{...c,selection:l,destroy(){Kt(o).selectAll("svg").remove(),r.next(void 0),A.unsubscribe()}}}};class St{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new E,this.dataFormatter$=new E,this.plugins$=new E,this.chartParams$=new E,this.event$=new E;const u=Jl({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 Kl extends St{constructor(e,n){super({defaultDataFormatter:xi,computedDataFn:Ts,contextObserverFn:Yl},e,n)}}function si(t,e){if(!t.length)return[];try{const n=t.reduce((o,u)=>u.length>o?u.length:o,0),i=t.map((o,u)=>{if(o.length===n)return o;const l=Object.assign([],o);for(let s=l.length;s<n;s++)l[s]=null;return l}).map((o,u)=>o.map((l,s)=>l==null?{id:"",label:"",data:{},value:null}:typeof l=="number"?{id:"",label:"",data:{},value:l}:{id:l.id??"",label:l.label??"",data:l.data??{},value:l.value}));return Ar(e.seriesDirection,i)}catch{return[]}}const Zl=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=si(e,n.grid),o=Ye({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"}),u=$r({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"});let l=0;i=a.map((s,h)=>s.map((c,f)=>{const d=It("grid",0,h,f),p=u[f],m={id:c.id?c.id:d,index:l,label:c.label?c.label:d,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:h,seriesLabel:o[h],groupIndex:f,groupLabel:p,color:Rt(h,r),visible:!0};return m.visible=n.visibleFilter(m,t),l++,m}))}catch(a){throw Error(a)}return i},li=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,u){const l=o.grid.groupAxis.position==="top"||o.grid.groupAxis.position==="bottom"?u.width:u.height,s=a[0]?a[0].length-1:0;return ht({maxValue:s,minValue:0,axisWidth:l,scaleDomain:[0,s],scaleRange:[0,1]})}function i(a,o,u){const l=o.grid.valueAxis.position==="left"||o.grid.valueAxis.position==="right"?u.height:u.width,s=a.flat(),[h,c]=ge(s);return ht({maxValue:c,minValue:h,axisWidth:l,scaleDomain:[h,c],scaleRange:[0,1]})}return R({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(async a=>a),$(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),u=i(a.computedData,a.fullDataFormatter,a.layout),l=u(0);return a.computedData.map((s,h)=>s.map((c,f)=>{const d=o(f),p=u(c.value??0);return{...c,axisX:d,axisY:p,axisYFromZero:p-l}}))}))},ci=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,s=0,h=0,c=0,f=0;return i.position==="bottom"?a.position==="left"?(c=180,s=u):a.position==="right"?(c=180,f=180,l=o,s=u):(c=180,s=u):i.position==="top"?a.position==="left"||(a.position==="right"?(f=180,l=o):(c=180,s=u)):i.position==="left"?a.position==="bottom"?(h=-90,s=u):a.position==="top"?(h=-90,f=180):(c=180,s=u):i.position==="right"&&(a.position==="bottom"?(h=-90,c=180,s=u,l=o):a.position==="top"?(h=-90,c=180,f=180,l=o):(c=180,s=u)),{translate:[l,s],scale:[1,1],rotate:h,rotateX:c,rotateY:f,value:`translate(${l}px, ${s}px) rotate(${h}deg) rotateX(${c}deg) rotateY(${f}deg)`}}return new T(i=>(R({fullDataFormatter:t,layout:e}).pipe(C(n),O(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},fi=({gridAxesTransform$:t})=>t.pipe($(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[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)`}})),hi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new E;function i({data:a,groupAxis:o,valueAxis:u,width:l,height:s}){let h=0,c=0,f=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:s,m=0,b=a[0]?a[0].length-1:0,x=o.scaleDomain[0]==="auto"?m-o.scalePadding:o.scaleDomain[0]-o.scalePadding,D=o.scaleDomain[1]==="auto"?b+o.scalePadding:o.scaleDomain[1]+o.scalePadding,A=ht({maxValue:b,minValue:m,axisWidth:p,scaleDomain:[x,D],scaleRange:[0,1]}),_=A(m),S=A(b);m==b?(h=0,f=1):(h=_,f=(S-_)/p);const F=a.map((Y,Xt)=>Y.filter((pt,K)=>K>=x&&K<=D&&pt.visible==!0)),y=Be(F),M=u.position==="left"||u.position==="right"?s:l,P=ht({maxValue:y[1],minValue:y[0],axisWidth:M,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),ut=Be(a),g=P(ut[0]),V=P(ut[1]);return c=g,d=(V-g)/M,{translate:[h,c],scale:[f,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${h}px, ${c}px) scale(${f}, ${d})`}}return new T(a=>(R({computedData:t,fullDataFormatter:e,layout:n}).pipe(C(r),O(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},di=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>R({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(O(async r=>r),$(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[1]]):r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[0]]))),pi=({fullDataFormatter$:t,layout$:e})=>{const n=new E;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 T(i=>{R({fullDataFormatter:t,layout:e}).pipe(C(n),O(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},mi=({computedData$:t})=>t.pipe($(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),ot((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),gi=({computedData$:t})=>t.pipe($(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),yi=({computedLayoutData$:t})=>t.pipe($(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Ql=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(async i=>i),$(i=>i.fullDataFormatter.grid.separateSeries?ye(i.layout,i.fullDataFormatter.container,i.computedData.length):ye(i.layout,i.fullDataFormatter.container,1))),tc=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=Ql({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),i=ci({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),a=fi({gridAxesTransform$:i}).pipe(v(1)),o=hi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),u=di({gridContainerPosition$:r,gridAxesTransform$:i,gridGraphicTransform$:o}),l=pi({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),s=e.computedData$.pipe($(x=>x.flat())).pipe(v(1)),h=Ut({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),c=mi({computedData$:e.computedData$}),f=xe({datumList$:s}).pipe(v(1)),d=hn({datumList$:s}).pipe(v(1)),p=li({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),m=gi({computedData$:e.computedData$}).pipe(v(1)),b=yi({computedLayoutData$:p}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,gridContainerPosition$:r,gridAxesTransform$:i,gridAxesReverseTransform$:a,gridGraphicTransform$:o,gridGraphicReverseScale$:u,gridAxesSize$:l,gridHighlight$:h,seriesLabels$:c,SeriesDataMap$:f,GroupDataMap$:d,computedLayoutData$:p,visibleComputedData$:m,visibleComputedLayoutData$:b}};class ec extends St{constructor(e,n){super({defaultDataFormatter:_i,computedDataFn:Zl,contextObserverFn:tc},e,n)}}const nc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||qt,o=e.map((c,f)=>n.gridList[f]||a),u=e.map((c,f)=>si(c,o[f])),l=n.separateGrid?u.map((c,f)=>Ye({transposedDataGrid:c,dataFormatterGrid:o[f],chartType:"multiGrid"})):u.map((c,f)=>_r({transposedDataGrid:c,dataFormatterGrid:o[f],chartType:"multiGrid",gridIndex:f})),s=new Map;let h=0;l.flat().forEach((c,f)=>{if(!s.has(c)){const d=Rt(h,r);s.set(c,d),h++}}),i=u.map((c,f)=>{const d=l[f],p=Dr({transposedDataGrid:c,dataFormatterGrid:o[f],chartType:"multiGrid",gridIndex:f});let m=0;return c.map((x,D)=>x.map((A,_)=>{const S=It("multiGrid",f,D,_),F=p[_],y=d[D],M={id:A.id?A.id:S,index:m,label:A.label?A.label:S,description:A.description??"",data:A.data,value:A.value,gridIndex:f,seriesIndex:D,seriesLabel:y,groupIndex:_,groupLabel:F,color:s.get(y),visible:!0};return M.visible=n.visibleFilter(M,t),m++,M}))})}catch(a){throw Error(a)}return i},rc=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new E,o=Ut({datumList$:e.pipe($(l=>l.flat().flat()),v(1)),fullChartParams$:r,event$:i}).pipe(v(1)),u=ic({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(v(1));return R({fullDataFormatter:t,computedData:e,multiGridContainer:u}).pipe(O(async l=>l),$(l=>{a.next(void 0);const s=l.fullDataFormatter.gridList[0]??qt;return l.computedData.map((h,c)=>{const f=l.fullDataFormatter.gridList[c]??s,d={type:"grid",visibleFilter:l.fullDataFormatter.visibleFilter,grid:{...f},container:{...l.fullDataFormatter.container}},p=zt(d).pipe(C(a),v(1)),m=zt(h).pipe(C(a),v(1)),b=zt(l.multiGridContainer[c]).pipe(C(a),v(1)),x=ci({fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),D=fi({gridAxesTransform$:x}).pipe(C(a),v(1)),A=hi({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),_=di({gridContainerPosition$:b,gridAxesTransform$:x,gridGraphicTransform$:A}),S=pi({fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),F=m.pipe($(N=>N.flat())).pipe(C(a),v(1)),y=mi({computedData$:m}).pipe(C(a),v(1)),M=xe({datumList$:F}).pipe(C(a),v(1)),P=hn({datumList$:F}).pipe(C(a),v(1)),ut=gi({computedData$:m}).pipe(C(a),v(1)),g=li({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),v(1)),V=yi({computedLayoutData$:g}).pipe(C(a),v(1));return{gridContainerPosition$:b,gridAxesTransform$:x,gridAxesReverseTransform$:D,gridGraphicTransform$:A,gridGraphicReverseScale$:_,gridAxesSize$:S,gridHighlight$:o,seriesLabels$:y,SeriesDataMap$:M,GroupDataMap$:P,dataFormatter$:p,computedData$:m,computedLayoutData$:g,visibleComputedData$:ut,visibleComputedLayoutData$:V}})}))},ic=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(O(async r=>r),$(r=>{const i=r.fullDataFormatter.gridList[0]??qt,a=r.computedData.reduce((s,h,c)=>{const d=(r.fullDataFormatter.gridList[c]??i).separateSeries?h.length:r.fullDataFormatter.separateGrid?1:0;return s+d},0)||1,o=ye(r.layout,r.fullDataFormatter.container,a);let u=0;return r.computedData.map((s,h)=>{const c=r.fullDataFormatter.gridList[h]??i,f=s.map((d,p)=>{const m=o[u];return c.separateSeries&&(u+=1),m});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(u+=1),f})})),ac=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=rc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,multiGridEachDetail$:r}};class oc extends St{constructor(e,n){super({defaultDataFormatter:$i,computedDataFn:nc,contextObserverFn:ac},e,n)}}const uc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i={width:1e3,height:1e3};let a=[];try{const o=e.map((D,A)=>D.map((_,S)=>typeof _=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:_}:{id:_.id??"",label:_.label??"",description:_.description??"",data:_.data??{},categoryLabel:_.categoryLabel??"",value:_.value})),[u,l]=ge(o.map(D=>D[0])),[s,h]=ge(o.map(D=>D[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,f=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=ht({maxValue:l,minValue:u,axisWidth:c,scaleDomain:[u,l],scaleRange:[0,1]}),p=ht({maxValue:h,minValue:s,axisWidth:f,scaleDomain:[s,h],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?l:n.xAxis.scaleDomain[1]],b=[n.yAxis.scaleDomain[0]==="auto"?s:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?h:n.yAxis.scaleDomain[1]];let x=0;a=o.map((D,A)=>D.map((_,S)=>{const F=x;x++;const y=It(n.type,A,S),M={id:_.id?_.id:y,index:F,label:_.label?_.label:y,description:_.description??"",data:_.data,value:_.value,categoryIndex:0,categoryLabel:"",axis:S==0?d(_.value):p(_.value),visible:!0,color:""};return M.visible=n.visibleFilter(M,t),M}))}catch(o){throw Error(o)}return a},sc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class lc extends St{constructor(e,n){super({defaultDataFormatter:Di,computedDataFn:uc,contextObserverFn:sc},e,n)}}const cc=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,f)=>({id:c.id,index:f,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:!0}));const l=new Map(i.map(c=>[c.id,c]));a=u.map((c,f)=>({id:c.id,index:f,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:!0}));const s=function(){const c=new Map;return a.forEach(f=>{const d=c.get(f.endNodeId)??[];d.push(f.startNode),c.set(f.endNodeId,d)}),c}(),h=function(){const c=new Map;return a.forEach(f=>{const d=c.get(f.startNodeId)??[];d.push(f.endNode),c.set(f.startNodeId,d)}),c}();Array.from(l).forEach(([c,f])=>{f.startNodes=s.get(c),f.startNodeIds=f.startNodes.map(d=>d.id),f.endNodes=h.get(c),f.endNodeIds=f.endNodes.map(d=>d.id),f.visible=n.visibleFilter(f,t)}),a=a.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(o){throw Error(o)}return{nodes:i,edges:a}},fc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class hc extends St{constructor(e,n){super({defaultDataFormatter:Si,computedDataFn:cc,contextObserverFn:fc},e,n)}}const dc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,u)=>[o,u]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(j(e)===!0)return structuredClone(e);if(Array.isArray(e)===!1)return{id:""};let s;const h=new Map;e.forEach(f=>{if(!f.parent)s=f;else{const d=h.get(f.parent)??[];d.push(f),h.set(f.parent,d)}});const c=f=>({id:f.id,label:f.label,data:f.data,value:f.value,categoryLabel:f.categoryLabel,children:(h.get(f.id)??[]).map(d=>c(d))});return s?c(s):{id:""}}();let u=0;const l=(s,h,c)=>{const f=h+1,d=s.categoryLabel??null;let p=0;d!=null&&(i.has(d)||i.set(d,i.size),p=i.get(d)??0);const m=u;u++;const b={id:s.id,index:m,level:h,seq:c,label:s.label??"",description:s.description??"",categoryIndex:p,categoryLabel:d,color:Rt(p,r),data:s.data??{},value:s.value,visible:!0,children:(s.children??[]).map((x,D)=>l(x,f,D))};return b.visible=n.visibleFilter(b,t),b};a=l(o,0,0)}catch(o){throw Error(o)}return a},pc=({computedData$:t})=>t.pipe($(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),mc=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe($(r=>r.categoryLabels),ot((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return R({nodeList:t,categoryLabels:n}).pipe(O(async r=>r),$(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),ot((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},gc=({computedData$:t})=>t.pipe($(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),yc=({subject:t,observer:e})=>{const n=Ht(e.fullChartParams$).pipe(v(1)),r=pc({computedData$:e.computedData$}).pipe(v(1)),i=Ut({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),a=mc({nodeList$:r,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),o=ai({datumList$:r}).pipe(v(1)),u=gc({computedData$:e.computedData$}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,existCategoryLabels$:a,CategoryDataMap$:o,visibleComputedData$:u}};class vc extends St{constructor(e,n){super({defaultDataFormatter:Ai,computedDataFn:dc,contextObserverFn:yc},e,n)}}function bc({name:t,defaultParams:e,initFn:n}){const r=new E,i=new WeakMap;let a=()=>{},o;const u=new kr(e),l=new kr({}),s=u.pipe(O(c=>l.pipe(C(r),$(f=>nt(f,c)))),v(1));return{params$:l,name:t,defaultParams:e,init(){o&&(a=n(o)??(()=>{}),i.set(o.selection,o))},destroy(){a(),o&&(o.selection.remove(),o=void 0),r.next(void 0)},setPresetParams:c=>{u.next(nt(c,e))},setContext:c=>{o=c,o.observer.fullParams$=s}}}const dt=()=>function(e,n){return function(i){return class{constructor(){const o=bc({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}}}},wc=dt(),xc=dt(),_c=dt(),$c=dt(),Dc=dt(),Ac=dt(),Sc=dt();w.GridChart=ec,w.MultiGridChart=oc,w.MultiValueChart=lc,w.RelationshipChart=hc,w.SeriesChart=Kl,w.TreeChart=vc,w.calcGridContainerLayout=ye,w.calcSeriesContainerLayout=We,w.categoryDataMapObservable=ai,w.createAxisLinearScale=ht,w.createAxisPointScale=Bl,w.createAxisQuantizeScale=Wl,w.createDefaultDatumId=It,w.createDefaultGroupLabel=qe,w.createDefaultSeriesLabel=me,w.createGridGroupLabels=$r,w.createGridSeriesLabels=Ye,w.createMultiGridGroupLabels=Dr,w.createMultiGridSeriesLabels=_r,w.defineGridPlugin=xc,w.defineMultiGridPlugin=_c,w.defineMultiValuePlugin=$c,w.defineNoneDataPlugin=Dc,w.defineRelationshipPlugin=Ac,w.defineSeriesPlugin=wc,w.defineTreePlugin=Sc,w.formatCommaNumber=Cs,w.formatValueToLabel=Ps,w.getMinAndMax=wt,w.getMinAndMaxGrid=Be,w.getMinAndMaxMultiGrid=Fs,w.getMinAndMaxMultiValue=Ls,w.getMinAndMaxSeries=Es,w.getMinAndMaxValue=ge,w.groupDataMapObservable=hn,w.highlightObservable=Ut,w.isFunction=Ms,w.isPlainObject=j,w.mergeOptionsWithDefault=nt,w.seriesColorPredicate=Rt,w.seriesDataMapObservable=xe,w.textSizePxObservable=Ht,w.transposeData=Ar,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
@@ -313,6 +313,7 @@ export const createBaseChart: CreateBaseChart = <T extends ChartType>({ defaultD
|
|
313
313
|
exit.each((plugin: PluginEntity<T, unknown, unknown>, i, n) => {
|
314
314
|
if (pluginEntityMap[plugin.name as string]) {
|
315
315
|
pluginEntityMap[plugin.name as string].destroy()
|
316
|
+
pluginEntityMap[plugin.name as string] = undefined
|
316
317
|
}
|
317
318
|
})
|
318
319
|
|