@orbcharts/core 3.0.3 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- (function(v,ut){typeof exports=="object"&&typeof module<"u"?ut(exports):typeof define=="function"&&define.amd?define(["exports"],ut):(v=typeof globalThis<"u"?globalThis:v||self,ut(v["orbcharts-core"]={}))})(this,function(v){"use strict";const ut={width:"auto",height:"auto"},Ee={top:60,right:60,bottom:60,left:60},Le={padding:Ee,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{label:["#0088FF","#FF3232","#38BEA8","#6F3BD5","#314285","#42C724","#D52580","#F4721B","#D117EA","#7E7D7D"],primary:"#000000",secondary:"#e0e0e0",labelContrast:["#ffffff","#000000"],background:"#ffffff"},dark:{label:["#4BABFF","#FF6C6C","#7DD3C4","#8E6BC9","#5366AC","#86DC72","#FF72BB","#F9B052","#EF76FF","#C4C4C4"],primary:"#ffffff",secondary:"#e0e0e0",labelContrast:["#ffffff","#000000"],background:"#000000"}},styles:{textSize:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},En=800,Ln=500,zi=[],Hi=[],ji=[],Wi=[],qi=[],Ji={nodes:[],edges:[]},z={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Pn={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},Pe={scaleDomain:["auto","auto"],scaleRange:[0,.9],label:"",valueIndex:0},kt={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},Oe={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...kt},separateSeries:!1,sumSeries:!1};Oe.visibleFilter.toString=()=>"(datum, context) => true";const Ie={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...z},groupAxis:{...Pn},separateSeries:!1},Re={type:"grid",visibleFilter:(t,e)=>!0,...Ie,container:{...kt}};Re.visibleFilter.toString=()=>"(datum, context) => true";const Nt={...Ie},Be={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...Nt}],separateGrid:!1,container:{...kt}};Be.visibleFilter.toString=()=>"(datum, context) => true";const ke={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],valueLabels:[],xAxis:{...Pe,valueIndex:0},yAxis:{...Pe,valueIndex:1},container:{...kt},separateCategory:!1};ke.visibleFilter.toString=()=>"(datum, context) => true";const Ne={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ne.visibleFilter.toString=()=>"(datum, context) => true";const Ve={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ve.visibleFilter.toString=()=>"(datum, context) => true";function U(t){return Object.prototype.toString.call(t)==="[object Object]"}function On(t){return Object.prototype.toString.call(t)==="[object Function]"}function In(t){return!!(t&&t.nodeType)}function st(t,e){if(U(t)===!1||U(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;U(r[o])&&U(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Zi(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 Ki(t,e){const n={string:a=>typeof a=="string",number:a=>typeof a=="number",boolean:a=>typeof a=="boolean",object:a=>U(a),"object[]":a=>Array.isArray(a)&&a.every(o=>U(o)),"string[]":a=>Array.isArray(a)&&a.every(o=>typeof o=="string"),"number[]":a=>Array.isArray(a)&&a.every(o=>typeof o=="number"),Function:a=>On(a),null:a=>a===null,undefined:a=>a===void 0},r={ColorType:a=>a==="none"||a==="label"||a==="primary"||a==="secondary"||a==="labelContrast"||a==="background"};return Object.keys(t).find(a=>{if(e[a]){const o=e[a],u=t[a];if(o.toBeTypes){if(o.toBeTypes.some(f=>n[f](u))===!1)return!0}else if(o.toBe){const{toBe:s,test:l}=o;if(l(u)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](u)===!1)return!0}}return!1})}function E(t,e){const n=Ki(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}const Qi=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},sort:{toBeTypes:["Function","null"]},seriesLabels:{toBeTypes:["string[]"]},container:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]},sumSeries:{toBeTypes:["boolean"]}});if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e};function ee(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ta(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Rn(t){let e,n,r;t.length!==2?(e=ee,n=(u,s)=>ee(t(u),s),r=(u,s)=>t(u)-s):(e=t===ee||t===ta?t:ea,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:o,right:a}}function ea(){return 0}function na(t){return t===null?NaN:+t}const Bn=Rn(ee).right;Rn(na).center;class kn extends Map{constructor(e,n=aa){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(Nn(this,e))}has(e){return super.has(Nn(this,e))}set(e,n){return super.set(ra(this,e),n)}delete(e){return super.delete(ia(this,e))}}function Nn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function ra({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function ia({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function aa(t){return t!==null&&typeof t=="object"?t.valueOf():t}const oa=Math.sqrt(50),ua=Math.sqrt(10),sa=Math.sqrt(2);function ne(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>=oa?10:a>=ua?5:a>=sa?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/o,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*o,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?ne(t,e,n*2):[u,s,l]}function la(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?ne(e,t,n):ne(t,e,n);if(!(a>=i))return[];const u=a-i+1,s=new Array(u);if(r)if(o<0)for(let l=0;l<u;++l)s[l]=(a-l)/-o;else for(let l=0;l<u;++l)s[l]=(a-l)*o;else if(o<0)for(let l=0;l<u;++l)s[l]=(i+l)/-o;else for(let l=0;l<u;++l)s[l]=(i+l)*o;return s}function Ge(t,e,n){return e=+e,t=+t,n=+n,ne(t,e,n)[2]}function ca(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ge(e,t,n):Ge(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function fa(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 pa={value:()=>{}};function Vn(){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 re(n)}function re(t){this._=t}function ha(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}})}re.prototype=Vn.prototype={constructor:re,on:function(t,e){var n=this._,r=ha(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=ma(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]=Gn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Gn(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 re(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 ma(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Gn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=pa,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Xe="http://www.w3.org/1999/xhtml";const Xn={svg:"http://www.w3.org/2000/svg",xhtml:Xe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ie(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Xn.hasOwnProperty(e)?{space:Xn[e],local:t}:t}function da(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Xe&&e.documentElement.namespaceURI===Xe?e.createElement(t):e.createElementNS(n,t)}}function ga(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yn(t){var e=ie(t);return(e.local?ga:da)(e)}function ya(){}function Ye(t){return t==null?ya:function(){return this.querySelector(t)}}function ba(t){typeof t!="function"&&(t=Ye(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),s,l,f=0;f<o;++f)(s=a[f])&&(l=t.call(s,s.__data__,f,a))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new j(r,this._parents)}function va(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function xa(){return[]}function Un(t){return t==null?xa:function(){return this.querySelectorAll(t)}}function Da(t){return function(){return va(t.apply(this,arguments))}}function wa(t){typeof t=="function"?t=Da(t):t=Un(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new j(r,i)}function zn(t){return function(){return this.matches(t)}}function Hn(t){return function(e){return e.matches(t)}}var $a=Array.prototype.find;function _a(t){return function(){return $a.call(this.children,t)}}function Aa(){return this.firstElementChild}function Sa(t){return this.select(t==null?Aa:_a(typeof t=="function"?t:Hn(t)))}var Ta=Array.prototype.filter;function Ma(){return Array.from(this.children)}function Fa(t){return function(){return Ta.call(this.children,t)}}function Ca(t){return this.selectAll(t==null?Ma:Fa(typeof t=="function"?t:Hn(t)))}function Ea(t){typeof t!="function"&&(t=zn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new j(r,this._parents)}function jn(t){return new Array(t.length)}function La(){return new j(this._enter||this._groups.map(jn),this._parents)}function ae(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ae.prototype={constructor:ae,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 Pa(t){return function(){return t}}function Oa(t,e,n,r,i,a){for(var o=0,u,s=e.length,l=a.length;o<l;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new ae(t,a[o]);for(;o<s;++o)(u=e[o])&&(i[o]=u)}function Ia(t,e,n,r,i,a,o){var u,s,l=new Map,f=e.length,c=a.length,p=new Array(f),h;for(u=0;u<f;++u)(s=e[u])&&(p[u]=h=o.call(s,s.__data__,u,e)+"",l.has(h)?i[u]=s:l.set(h,s));for(u=0;u<c;++u)h=o.call(t,a[u],u,a)+"",(s=l.get(h))?(r[u]=s,s.__data__=a[u],l.delete(h)):n[u]=new ae(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(p[u])===s&&(i[u]=s)}function Ra(t){return t.__data__}function Ba(t,e){if(!arguments.length)return Array.from(this,Ra);var n=e?Ia:Oa,r=this._parents,i=this._groups;typeof t!="function"&&(t=Pa(t));for(var a=i.length,o=new Array(a),u=new Array(a),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],p=c.length,h=ka(t.call(f,f&&f.__data__,l,r)),m=h.length,d=u[l]=new Array(m),x=o[l]=new Array(m),$=s[l]=new Array(p);n(f,c,d,x,$,h,e);for(var S=0,_=0,C,A;S<m;++S)if(C=d[S]){for(S>=_&&(_=S+1);!(A=x[_])&&++_<m;);C._next=A||null}}return o=new j(o,r),o._enter=u,o._exit=s,o}function ka(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Na(){return new j(this._exit||this._groups.map(jn),this._parents)}function Va(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 Ga(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),s=0;s<o;++s)for(var l=n[s],f=r[s],c=l.length,p=u[s]=new Array(c),h,m=0;m<c;++m)(h=l[m]||f[m])&&(p[m]=h);for(;s<i;++s)u[s]=n[s];return new j(u,this._parents)}function Xa(){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 Ya(t){t||(t=Ua);function e(c,p){return c&&p?t(c.__data__,p.__data__):!c-!p}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f)(l=o[f])&&(s[f]=l);s.sort(e)}return new j(i,this._parents).order()}function Ua(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function za(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ha(){return Array.from(this)}function ja(){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 qa(){return!this.node()}function Ja(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 Za(t){return function(){this.removeAttribute(t)}}function Ka(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qa(t,e){return function(){this.setAttribute(t,e)}}function to(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function eo(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function no(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 ro(t,e){var n=ie(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?Ka:Za:typeof e=="function"?n.local?no:eo:n.local?to:Qa)(n,e))}function Wn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function io(t){return function(){this.style.removeProperty(t)}}function ao(t,e,n){return function(){this.style.setProperty(t,e,n)}}function oo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function uo(t,e,n){return arguments.length>1?this.each((e==null?io:typeof e=="function"?oo:ao)(t,e,n??"")):St(this.node(),t)}function St(t,e){return t.style.getPropertyValue(e)||Wn(t).getComputedStyle(t,null).getPropertyValue(e)}function so(t){return function(){delete this[t]}}function lo(t,e){return function(){this[t]=e}}function co(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fo(t,e){return arguments.length>1?this.each((e==null?so:typeof e=="function"?co:lo)(t,e)):this.node()[t]}function qn(t){return t.trim().split(/^|\s+/)}function Ue(t){return t.classList||new Jn(t)}function Jn(t){this._node=t,this._names=qn(t.getAttribute("class")||"")}Jn.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 Zn(t,e){for(var n=Ue(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Kn(t,e){for(var n=Ue(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function po(t){return function(){Zn(this,t)}}function ho(t){return function(){Kn(this,t)}}function mo(t,e){return function(){(e.apply(this,arguments)?Zn:Kn)(this,t)}}function go(t,e){var n=qn(t+"");if(arguments.length<2){for(var r=Ue(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?mo:e?po:ho)(n,e))}function yo(){this.textContent=""}function bo(t){return function(){this.textContent=t}}function vo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function xo(t){return arguments.length?this.each(t==null?yo:(typeof t=="function"?vo:bo)(t)):this.node().textContent}function Do(){this.innerHTML=""}function wo(t){return function(){this.innerHTML=t}}function $o(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function _o(t){return arguments.length?this.each(t==null?Do:(typeof t=="function"?$o:wo)(t)):this.node().innerHTML}function Ao(){this.nextSibling&&this.parentNode.appendChild(this)}function So(){return this.each(Ao)}function To(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Mo(){return this.each(To)}function Fo(t){var e=typeof t=="function"?t:Yn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Co(){return null}function Eo(t,e){var n=typeof t=="function"?t:Yn(t),r=e==null?Co:typeof e=="function"?e:Ye(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Lo(){var t=this.parentNode;t&&t.removeChild(this)}function Po(){return this.each(Lo)}function Oo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Io(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ro(t){return this.select(t?Io:Oo)}function Bo(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ko(t){return function(e){t.call(this,e,this.__data__)}}function No(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 Vo(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 Go(t,e,n){return function(){var r=this.__on,i,a=ko(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 Xo(t,e,n){var r=No(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?Go:Vo,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Qn(t,e,n){var r=Wn(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 Yo(t,e){return function(){return Qn(this,t,e)}}function Uo(t,e){return function(){return Qn(this,t,e.apply(this,arguments))}}function zo(t,e){return this.each((typeof e=="function"?Uo:Yo)(t,e))}function*Ho(){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 tr=[null];function j(t,e){this._groups=t,this._parents=e}function Vt(){return new j([[document.documentElement]],tr)}function jo(){return this}j.prototype=Vt.prototype={constructor:j,select:ba,selectAll:wa,selectChild:Sa,selectChildren:Ca,filter:Ea,data:Ba,enter:La,exit:Na,join:Va,merge:Ga,selection:jo,order:Xa,sort:Ya,call:za,nodes:Ha,node:ja,size:Wa,empty:qa,each:Ja,attr:ro,style:uo,property:fo,classed:go,text:xo,html:_o,raise:So,lower:Mo,append:Fo,insert:Eo,remove:Po,clone:Ro,datum:Bo,on:Xo,dispatch:zo,[Symbol.iterator]:Ho};function oe(t){return typeof t=="string"?new j([[document.querySelector(t)]],[document.documentElement]):new j([[t]],tr)}function ze(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function er(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Gt(){}var Xt=.7,ue=1/Xt,Tt="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wo=/^#([0-9a-f]{3,8})$/,qo=new RegExp(`^rgb\\(${Tt},${Tt},${Tt}\\)$`),Jo=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),Zo=new RegExp(`^rgba\\(${Tt},${Tt},${Tt},${Yt}\\)$`),Ko=new RegExp(`^rgba\\(${tt},${tt},${tt},${Yt}\\)$`),Qo=new RegExp(`^hsl\\(${Yt},${tt},${tt}\\)$`),tu=new RegExp(`^hsla\\(${Yt},${tt},${tt},${Yt}\\)$`),nr={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};ze(Gt,yt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rr,formatHex:rr,formatHex8:eu,formatHsl:nu,formatRgb:ir,toString:ir});function rr(){return this.rgb().formatHex()}function eu(){return this.rgb().formatHex8()}function nu(){return lr(this).formatHsl()}function ir(){return this.rgb().formatRgb()}function yt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Wo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ar(e):n===3?new H(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?se(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?se(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=qo.exec(t))?new H(e[1],e[2],e[3],1):(e=Jo.exec(t))?new H(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Zo.exec(t))?se(e[1],e[2],e[3],e[4]):(e=Ko.exec(t))?se(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qo.exec(t))?sr(e[1],e[2]/100,e[3]/100,1):(e=tu.exec(t))?sr(e[1],e[2]/100,e[3]/100,e[4]):nr.hasOwnProperty(t)?ar(nr[t]):t==="transparent"?new H(NaN,NaN,NaN,0):null}function ar(t){return new H(t>>16&255,t>>8&255,t&255,1)}function se(t,e,n,r){return r<=0&&(t=e=n=NaN),new H(t,e,n,r)}function ru(t){return t instanceof Gt||(t=yt(t)),t?(t=t.rgb(),new H(t.r,t.g,t.b,t.opacity)):new H}function He(t,e,n,r){return arguments.length===1?ru(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ze(H,He,er(Gt,{brighter(t){return t=t==null?ue:Math.pow(ue,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Xt:Math.pow(Xt,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new H(bt(this.r),bt(this.g),bt(this.b),le(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:or,formatHex:or,formatHex8:iu,formatRgb:ur,toString:ur}));function or(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}`}function iu(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}${vt((isNaN(this.opacity)?1:this.opacity)*255)}`}function ur(){const t=le(this.opacity);return`${t===1?"rgb(":"rgba("}${bt(this.r)}, ${bt(this.g)}, ${bt(this.b)}${t===1?")":`, ${t})`}`}function le(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function bt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vt(t){return t=bt(t),(t<16?"0":"")+t.toString(16)}function sr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new J(t,e,n,r)}function lr(t){if(t instanceof J)return new J(t.h,t.s,t.l,t.opacity);if(t instanceof Gt||(t=yt(t)),!t)return new J;if(t instanceof J)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new J(o,u,s,t.opacity)}function au(t,e,n,r){return arguments.length===1?lr(t):new J(t,e,n,r??1)}function J(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ze(J,au,er(Gt,{brighter(t){return t=t==null?ue:Math.pow(ue,t),new J(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xt:Math.pow(Xt,t),new J(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 H(je(t>=240?t-240:t+120,i,r),je(t,i,r),je(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new J(cr(this.h),ce(this.s),ce(this.l),le(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=le(this.opacity);return`${t===1?"hsl(":"hsla("}${cr(this.h)}, ${ce(this.s)*100}%, ${ce(this.l)*100}%${t===1?")":`, ${t})`}`}}));function cr(t){return t=(t||0)%360,t<0?t+360:t}function ce(t){return Math.max(0,Math.min(1,t||0))}function je(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 We=t=>()=>t;function ou(t,e){return function(n){return t+n*e}}function uu(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 su(t){return(t=+t)==1?fr:function(e,n){return n-e?uu(e,n,t):We(isNaN(e)?n:e)}}function fr(t,e){var n=e-t;return n?ou(t,n):We(isNaN(t)?e:t)}const fe=function t(e){var n=su(e);function r(i,a){var o=n((i=He(i)).r,(a=He(a)).r),u=n(i.g,a.g),s=n(i.b,a.b),l=fr(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function lu(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 cu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fu(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]=Ze(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 pu(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Z(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function hu(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]=Ze(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var qe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Je=new RegExp(qe.source,"g");function mu(t){return function(){return t}}function du(t){return function(e){return t(e)+""}}function pr(t,e){var n=qe.lastIndex=Je.lastIndex=0,r,i,a,o=-1,u=[],s=[];for(t=t+"",e=e+"";(r=qe.exec(t))&&(i=Je.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:Z(r,i)})),n=Je.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?du(s[0].x):mu(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Ze(t,e){var n=typeof e,r;return e==null||n==="boolean"?We(e):(n==="number"?Z:n==="string"?(r=yt(e))?(e=r,fe):pr:e instanceof yt?fe:e instanceof Date?pu:cu(e)?lu:Array.isArray(e)?fu:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?hu:Z)(t,e)}function gu(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var hr=180/Math.PI,Ke={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mr(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*hr,skewX:Math.atan(s)*hr,scaleX:o,scaleY:u}}var pe;function yu(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ke:mr(e.a,e.b,e.c,e.d,e.e,e.f)}function bu(t){return t==null||(pe||(pe=document.createElementNS("http://www.w3.org/2000/svg","g")),pe.setAttribute("transform",t),!(t=pe.transform.baseVal.consolidate()))?Ke:(t=t.matrix,mr(t.a,t.b,t.c,t.d,t.e,t.f))}function dr(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,p,h,m){if(l!==c||f!==p){var d=h.push("translate(",null,e,null,n);m.push({i:d-4,x:Z(l,c)},{i:d-2,x:Z(f,p)})}else(c||p)&&h.push("translate("+c+e+p+n)}function o(l,f,c,p){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Z(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,p){l!==f?p.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Z(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,p,h,m){if(l!==c||f!==p){var d=h.push(i(h)+"scale(",null,",",null,")");m.push({i:d-4,x:Z(l,c)},{i:d-2,x:Z(f,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return function(l,f){var c=[],p=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,p),o(l.rotate,f.rotate,c,p),u(l.skewX,f.skewX,c,p),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,p),l=f=null,function(h){for(var m=-1,d=p.length,x;++m<d;)c[(x=p[m]).i]=x.x(h);return c.join("")}}}var vu=dr(yu,"px, ","px)","deg)"),xu=dr(bu,", ",")",")"),Mt=0,Ut=0,zt=0,gr=1e3,he,Ht,me=0,xt=0,de=0,jt=typeof performance=="object"&&performance.now?performance:Date,yr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Qe(){return xt||(yr(Du),xt=jt.now()+de)}function Du(){xt=0}function ge(){this._call=this._time=this._next=null}ge.prototype=br.prototype={constructor:ge,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Qe():+n)+(e==null?0:+e),!this._next&&Ht!==this&&(Ht?Ht._next=this:he=this,Ht=this),this._call=t,this._time=n,tn()},stop:function(){this._call&&(this._call=null,this._time=1/0,tn())}};function br(t,e,n){var r=new ge;return r.restart(t,e,n),r}function wu(){Qe(),++Mt;for(var t=he,e;t;)(e=xt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mt}function vr(){xt=(me=jt.now())+de,Mt=Ut=0;try{wu()}finally{Mt=0,_u(),xt=0}}function $u(){var t=jt.now(),e=t-me;e>gr&&(de-=e,me=t)}function _u(){for(var t,e=he,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:he=n);Ht=t,tn(r)}function tn(t){if(!Mt){Ut&&(Ut=clearTimeout(Ut));var e=t-xt;e>24?(t<1/0&&(Ut=setTimeout(vr,t-jt.now()-de)),zt&&(zt=clearInterval(zt))):(zt||(me=jt.now(),zt=setInterval($u,gr)),Mt=1,yr(vr))}}function xr(t,e,n){var r=new ge;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Au=Vn("start","end","cancel","interrupt"),Su=[],Dr=0,wr=1,en=2,ye=3,$r=4,nn=5,be=6;function ve(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:Au,tween:Su,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Dr})}function rn(t,e){var n=K(t,e);if(n.state>Dr)throw new Error("too late; already scheduled");return n}function et(t,e){var n=K(t,e);if(n.state>ye)throw new Error("too late; already running");return n}function K(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Tu(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=br(a,0,n.time);function a(l){n.state=wr,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,p,h;if(n.state!==wr)return s();for(f in r)if(h=r[f],h.name===n.name){if(h.state===ye)return xr(o);h.state===$r?(h.state=be,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[f]):+f<e&&(h.state=be,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[f])}if(xr(function(){n.state===ye&&(n.state=$r,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=en,n.on.call("start",t,t.__data__,n.index,n.group),n.state===en){for(n.state=ye,i=new Array(p=n.tween.length),f=0,c=-1;f<p;++f)(h=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=nn,1),c=-1,p=i.length;++c<p;)i[c].call(t,f);n.state===nn&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=be,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Mu(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>en&&r.state<nn,r.state=be,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Fu(t){return this.each(function(){Mu(this,t)})}function Cu(t,e){var n,r;return function(){var i=et(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 Eu(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=et(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}}function Lu(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=K(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Cu:Eu)(n,t,e))}function an(t,e,n){var r=t._id;return t.each(function(){var i=et(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return K(i,r).value[e]}}function _r(t,e){var n;return(typeof e=="number"?Z:e instanceof yt?fe:(n=yt(e))?(e=n,fe):pr)(t,e)}function Pu(t){return function(){this.removeAttribute(t)}}function Ou(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Iu(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 Ru(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 Bu(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function ku(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function Nu(t,e){var n=ie(t),r=n==="transform"?xu:_r;return this.attrTween(t,typeof e=="function"?(n.local?ku:Bu)(n,r,an(this,"attr."+t,e)):e==null?(n.local?Ou:Pu)(n):(n.local?Ru:Iu)(n,r,e))}function Vu(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Gu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Xu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Gu(t,a)),n}return i._value=e,i}function Yu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Vu(t,a)),n}return i._value=e,i}function Uu(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=ie(t);return this.tween(n,(r.local?Xu:Yu)(r,e))}function zu(t,e){return function(){rn(this,t).delay=+e.apply(this,arguments)}}function Hu(t,e){return e=+e,function(){rn(this,t).delay=e}}function ju(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?zu:Hu)(e,t)):K(this.node(),e).delay}function Wu(t,e){return function(){et(this,t).duration=+e.apply(this,arguments)}}function qu(t,e){return e=+e,function(){et(this,t).duration=e}}function Ju(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Wu:qu)(e,t)):K(this.node(),e).duration}function Zu(t,e){if(typeof e!="function")throw new Error;return function(){et(this,t).ease=e}}function Ku(t){var e=this._id;return arguments.length?this.each(Zu(e,t)):K(this.node(),e).ease}function Qu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,t).ease=n}}function ts(t){if(typeof t!="function")throw new Error;return this.each(Qu(this._id,t))}function es(t){typeof t!="function"&&(t=zn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new it(r,this._parents,this._name,this._id)}function ns(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),p,h=0;h<f;++h)(p=s[h]||l[h])&&(c[h]=p);for(;u<r;++u)o[u]=e[u];return new it(o,this._parents,this._name,this._id)}function rs(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 is(t,e,n){var r,i,a=rs(e)?rn:et;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function as(t,e){var n=this._id;return arguments.length<2?K(this.node(),n).on.on(t):this.each(is(n,t,e))}function os(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function us(){return this.on("end.remove",os(this._id))}function ss(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Ye(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],s=u.length,l=a[o]=new Array(s),f,c,p=0;p<s;++p)(f=u[p])&&(c=t.call(f,f.__data__,p,u))&&("__data__"in f&&(c.__data__=f.__data__),l[p]=c,ve(l[p],e,n,p,l,K(f,n)));return new it(a,this._parents,e,n)}function ls(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Un(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var p=t.call(f,f.__data__,c,s),h,m=K(f,n),d=0,x=p.length;d<x;++d)(h=p[d])&&ve(h,e,n,d,p,m);a.push(p),o.push(f)}return new it(a,o,e,n)}var cs=Vt.prototype.constructor;function fs(){return new cs(this._groups,this._parents)}function ps(t,e){var n,r,i;return function(){var a=St(this,t),o=(this.style.removeProperty(t),St(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 hs(t,e,n){var r,i=n+"",a;return function(){var o=St(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function ms(t,e,n){var r,i,a;return function(){var o=St(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),St(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function ds(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=et(this,t),l=s.on,f=s.value[a]==null?u||(u=Ar(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),s.on=r}}function gs(t,e,n){var r=(t+="")=="transform"?vu:_r;return e==null?this.styleTween(t,ps(t,r)).on("end.style."+t,Ar(t)):typeof e=="function"?this.styleTween(t,ms(t,r,an(this,"style."+t,e))).each(ds(this._id,t)):this.styleTween(t,hs(t,r,e),n).on("end.style."+t,null)}function ys(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function bs(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&ys(t,o,n)),r}return a._value=e,a}function vs(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,bs(t,e,n??""))}function xs(t){return function(){this.textContent=t}}function Ds(t){return function(){var e=t(this);this.textContent=e??""}}function ws(t){return this.tween("text",typeof t=="function"?Ds(an(this,"text",t)):xs(t==null?"":t+""))}function $s(t){return function(e){this.textContent=t.call(this,e)}}function _s(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&$s(i)),e}return r._value=t,r}function As(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,_s(t))}function Ss(){for(var t=this._name,e=this._id,n=Sr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)if(s=o[l]){var f=K(s,e);ve(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new it(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},s={value:function(){--i===0&&a()}};n.each(function(){var l=et(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&a()})}var Ms=0;function it(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Sr(){return++Ms}var at=Vt.prototype;it.prototype={constructor:it,select:ss,selectAll:ls,selectChild:at.selectChild,selectChildren:at.selectChildren,filter:es,merge:ns,selection:fs,transition:Ss,call:at.call,nodes:at.nodes,node:at.node,size:at.size,empty:at.empty,each:at.each,on:as,attr:Nu,attrTween:Uu,style:gs,styleTween:vs,text:ws,textTween:As,remove:us,tween:Lu,delay:ju,duration:Ju,ease:Ku,easeVarying:ts,end:Ts,[Symbol.iterator]:at[Symbol.iterator]};function Fs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Cs={time:null,delay:0,duration:250,ease:Fs};function Es(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 Ls(t){var e,n;t instanceof it?(e=t._id,t=t._name):(e=Sr(),(n=Cs).time=Qe(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&ve(s,t,e,l,o,n||Es(s,e));return new it(r,this._parents,t,e)}Vt.prototype.interrupt=Fu,Vt.prototype.transition=Ls;function Ps(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function xe(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 Ft(t){return t=xe(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],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Is(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Rs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function De(t){if(!(e=Rs.exec(t)))throw new Error("invalid format: "+t);var e;return new on({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]})}De.prototype=on.prototype;function on(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+""}on.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 Bs(t){t:for(var e=t.length,n=1,r=-1,i;n<e;++n)switch(t[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+t[n])break t;r>0&&(r=0);break}return r>0?t.slice(0,r)+t.slice(i+1):t}var Tr;function ks(t,e){var n=xe(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Tr=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")+xe(t,Math.max(0,e+a-1))[0]}function Mr(t,e){var n=xe(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 Fr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ps,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)=>Mr(t*100,e),r:Mr,s:ks,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Cr(t){return t}var Er=Array.prototype.map,Lr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ns(t){var e=t.grouping===void 0||t.thousands===void 0?Cr:Os(Er.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:Is(Er.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=De(c);var p=c.fill,h=c.align,m=c.sign,d=c.symbol,x=c.zero,$=c.width,S=c.comma,_=c.precision,C=c.trim,A=c.type;A==="n"?(S=!0,A="g"):Fr[A]||(_===void 0&&(_=12),C=!0,A="g"),(x||p==="0"&&h==="=")&&(x=!0,p="0",h="=");var I=d==="$"?n:d==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",O=d==="$"?r:/[%p]/.test(A)?o:"",k=Fr[A],D=/[defgprs%]/.test(A);_=_===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(y){var T=I,P=O,G,dt,Q;if(A==="c")P=k(y)+P,y="";else{y=+y;var rt=y<0||1/y<0;if(y=isNaN(y)?s:k(Math.abs(y),_),C&&(y=Bs(y)),rt&&+y==0&&m!=="+"&&(rt=!1),T=(rt?m==="("?m:u:m==="-"||m==="("?"":m)+T,P=(A==="s"?Lr[8+Tr/3]:"")+P+(rt&&m==="("?")":""),D){for(G=-1,dt=y.length;++G<dt;)if(Q=y.charCodeAt(G),48>Q||Q>57){P=(Q===46?i+y.slice(G+1):y.slice(G))+P,y=y.slice(0,G);break}}}S&&!x&&(y=e(y,1/0));var gt=T.length+y.length+P.length,ot=gt<$?new Array($-gt+1).join(p):"";switch(S&&x&&(y=e(ot+y,ot.length?$-P.length:1/0),ot=""),h){case"<":y=T+y+P+ot;break;case"=":y=T+ot+y+P;break;case"^":y=ot.slice(0,gt=ot.length>>1)+T+y+P+ot.slice(gt);break;default:y=ot+T+y+P;break}return a(y)}return w.toString=function(){return c+""},w}function f(c,p){var h=l((c=De(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(Ft(p)/3)))*3,d=Math.pow(10,-m),x=Lr[8+m/3];return function($){return h(d*$)+x}}return{format:l,formatPrefix:f}}var we,un,Pr;Vs({thousands:",",grouping:[3],currency:["$",""]});function Vs(t){return we=Ns(t),un=we.format,Pr=we.formatPrefix,we}function Gs(t){return Math.max(0,-Ft(Math.abs(t)))}function Xs(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ft(e)/3)))*3-Ft(Math.abs(t)))}function Ys(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ft(e)-Ft(t))+1}function $e(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Or=Symbol("implicit");function Ir(){var t=new kn,e=[],n=[],r=Or;function i(a){let o=t.get(a);if(o===void 0){if(r!==Or)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 kn;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 Ir(e,n).unknown(r)},$e.apply(i,arguments),i}function Rr(){var t=Ir().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var p=e().length,h=i<r,m=h?i:r,d=h?r:i;a=(d-m)/Math.max(1,p-s+l*2),u&&(a=Math.floor(a)),m+=(d-m-a*(p-s))*f,o=a*(1-s),u&&(m=Math.round(m),o=Math.round(o));var x=fa(p).map(function($){return m+a*$});return n(h?x.reverse():x)}return t.domain=function(p){return arguments.length?(e(p),c()):e()},t.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(p){return arguments.length?(u=!!p,c()):u},t.padding=function(p){return arguments.length?(s=Math.min(1,l=+p),c()):s},t.paddingInner=function(p){return arguments.length?(s=Math.min(1,p),c()):s},t.paddingOuter=function(p){return arguments.length?(l=+p,c()):l},t.align=function(p){return arguments.length?(f=Math.max(0,Math.min(1,p)),c()):f},t.copy=function(){return Rr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},$e.apply(c(),arguments)}function Br(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Br(e())},t}function Us(){return Br(Rr.apply(null,arguments).paddingInner(1))}function zs(t){return function(){return t}}function Hs(t){return+t}var kr=[0,1];function Ct(t){return t}function sn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:zs(isNaN(e)?NaN:.5)}function js(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=sn(i,r),a=n(o,a)):(r=sn(r,i),a=n(a,o)),function(u){return a(r(u))}}function qs(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]=sn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var s=Bn(t,u,1,r)-1;return a[s](i[s](u))}}function Js(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Zs(){var t=kr,e=kr,n=Ze,r,i,a,o=Ct,u,s,l;function f(){var p=Math.min(t.length,e.length);return o!==Ct&&(o=js(t[0],t[p-1])),u=p>2?qs:Ws,s=l=null,c}function c(p){return p==null||isNaN(p=+p)?a:(s||(s=u(t.map(r),e,n)))(r(o(p)))}return c.invert=function(p){return o(i((l||(l=u(e,t.map(r),Z)))(p)))},c.domain=function(p){return arguments.length?(t=Array.from(p,Hs),f()):t.slice()},c.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},c.rangeRound=function(p){return e=Array.from(p),n=gu,f()},c.clamp=function(p){return arguments.length?(o=p?!0:Ct,f()):o!==Ct},c.interpolate=function(p){return arguments.length?(n=p,f()):n},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return r=p,i=h,f()}}function Ks(){return Zs()(Ct,Ct)}function Qs(t,e,n,r){var i=ca(t,e,n),a;switch(r=De(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Xs(i,o))&&(r.precision=a),Pr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Ys(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Gs(i))&&(r.precision=a-(r.type==="%")*2);break}}return un(r)}function Nr(t){var e=t.domain;return t.ticks=function(n){var r=e();return la(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Qs(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],s,l,f=10;for(u<o&&(l=o,o=u,u=l,l=i,i=a,a=l);f-- >0;){if(l=Ge(o,u,n),l===s)return r[i]=o,r[a]=u,e(r);if(l>0)o=Math.floor(o/l)*l,u=Math.ceil(u/l)*l;else if(l<0)o=Math.ceil(o*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function Wt(){var t=Ks();return t.copy=function(){return Js(t,Wt())},$e.apply(t,arguments),Nr(t)}function Vr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(s){return s!=null&&s<=s?i[Bn(r,s,0,n)]:a}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return o}return o.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},o.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},o.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Vr().domain([t,e]).range(i).unknown(a)},$e.apply(Nr(o),arguments)}function qt(t,e,n){this.k=t,this.x=e,this.y=n}qt.prototype={constructor:qt,scale:function(t){return t===1?this:new qt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new qt(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+")"}},qt.prototype;function tl(t,e){return e instanceof Function?e(t):un(e)(t)}function Jt(t,e,n,r){let i=`${t}_${e}`;return n!=null&&(i+=`_${n}`),r!=null&&(i+=`_${r}`),i}function _e(t,e){return`series${e}`}function ln(t,e){return`group${e}`}function Ae(){return""}function Gr(t,e){return`value${e}`}function cn({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]:_e(n,a))}function Xr({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]:_e(`${n}_grid${r}`,o))}function Yr({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]:ln(n,a))}function Ur({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]:ln(`${n}_grid${r}`,o))}function lt(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 zr(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return lt(e)}function el(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return lt(n)}function fn(t){const n=t.flat().filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return lt(n)}function nl(t){const n=t.flat().flat().filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return lt(n)}function rl(t,e){const n=t.map(r=>Array.isArray(r)?r[e]??null:U(r)?r.value[e]??null:null).filter(r=>r!=null);return lt(n)}function il({data:t,minX:e,maxX:n,minY:r,maxY:i}){let a=[],o=null,u=null,s=null,l=null;for(let f of t)for(let c of f)c.axisX>=e&&c.axisX<=n&&c.axisY>=r&&c.axisY<=i&&(a.push(f),(o==null||c.axisX<o.axisX)&&(o=c),(u==null||c.axisX>u.axisX)&&(u=c),(s==null||c.axisY<s.axisY)&&(s=c),(l==null||c.axisY>l.axisY)&&(l=c));return{minXDatum:o,maxXDatum:u,minYDatum:s,maxYDatum:l,filteredData:a}}function Hr(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 ct(t,e){return t<e.colors[e.colorScheme].label.length?e.colors[e.colorScheme].label[t]:e.colors[e.colorScheme].label[t%e.colors[e.colorScheme].label.length]}function jr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function pn(t,e,n){const r=e.columnGap==="auto"?t.left+t.right:e.columnGap,i=e.rowGap==="auto"?t.top+t.bottom:e.rowGap,{rowAmount:a,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:jr(n);return new Array(n).fill(null).map((u,s)=>{const l=s%o,f=Math.floor(s/o),c=(t.width-r*(o-1))/o,p=(t.height-i*(a-1))/a,h=l*c+l*r,m=f*p+f*i;return{slotIndex:s,rowIndex:f,columnIndex:l,startX:h,startY:m,centerX:h+c/2,centerY:m+p/2,width:c,height:p}})}function Et(t,e,n){const r=e.columnGap==="auto"?t.left+t.right:e.columnGap,i=e.rowGap==="auto"?t.top+t.bottom:e.rowGap,{rowAmount:a,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:jr(n);return new Array(n).fill(null).map((u,s)=>{const l=s%o,f=Math.floor(s/o),c=(t.width-r*(o-1))/o,p=(t.height-i*(a-1))/a,h=l*c+l*r,m=f*p+f*i,d=[h,m],x=[c/t.width,p/t.height];return{slotIndex:s,rowIndex:f,columnIndex:l,translate:d,scale:x}})}const al=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,u,s,l)=>{const f=Jt(n.type,u,s),c=n.seriesLabels[u]||_e("series",u),p=ct(u,r);return typeof o=="number"?{id:f,index:l,seq:0,label:f,description:"",data:{},value:o,seriesIndex:u,seriesLabel:c,color:p,visible:!0}:{id:o.id?o.id:f,index:l,seq:0,label:o.label?o.label:f,description:o.description,data:o.data??{},value:o.value,seriesIndex:u,seriesLabel:c,color:p,visible:!0}};i=e.map((o,u)=>Array.isArray(o)?o.map((s,l)=>a(s,u,l,i.length+l)):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},ol=t=>E({data:t},{data:{toBe:"(DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]",test:n=>Array.isArray(n)}});var hn=function(t,e){return hn=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])},hn(t,e)};function nt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");hn(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function ul(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{l(r.next(f))}catch(c){o(c)}}function s(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function Wr(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(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Lt(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 ft(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 pt(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 Pt(t){return this instanceof Pt?(this.v=t,this):new Pt(t)}function sl(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(h){return function(m){return Promise.resolve(m).then(h,c)}}function u(h,m){r[h]&&(i[h]=function(d){return new Promise(function(x,$){a.push([h,d,x,$])>1||s(h,d)})},m&&(i[h]=m(i[h])))}function s(h,m){try{l(r[h](m))}catch(d){p(a[0][3],d)}}function l(h){h.value instanceof Pt?Promise.resolve(h.value.v).then(f,c):p(a[0][2],h)}function f(h){s("next",h)}function c(h){s("throw",h)}function p(h,m){h(m),a.shift(),a.length&&s(a[0][0],a[0][1])}}function ll(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 Lt=="function"?Lt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,s){o=t[a](o),i(u,s,o.done,o.value)})}}function i(a,o,u,s){Promise.resolve(s).then(function(l){a({value:l,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function N(t){return typeof t=="function"}function mn(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 dn=mn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
1
+ (function(v,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(v=typeof globalThis<"u"?globalThis:v||self,st(v["orbcharts-core"]={}))})(this,function(v){"use strict";const st={width:"auto",height:"auto"},Pe={top:60,right:60,bottom:60,left:60},Oe={padding:Pe,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{label:["#0088FF","#FF3232","#38BEA8","#6F3BD5","#314285","#42C724","#D52580","#F4721B","#D117EA","#7E7D7D"],primary:"#000000",secondary:"#e0e0e0",labelContrast:["#ffffff","#000000"],background:"#ffffff"},dark:{label:["#4BABFF","#FF6C6C","#7DD3C4","#8E6BC9","#5366AC","#86DC72","#FF72BB","#F9B052","#EF76FF","#C4C4C4"],primary:"#ffffff",secondary:"#e0e0e0",labelContrast:["#ffffff","#000000"],background:"#000000"}},styles:{textSize:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},Pn=800,On=500,Hi=[],ji=[],Wi=[],qi=[],Ji=[],Zi={nodes:[],edges:[]},z={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},In={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},Ie={scaleDomain:["auto","auto"],scaleRange:[0,.9],label:"",valueIndex:0},Nt={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},Re={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...Nt},separateSeries:!1,sumSeries:!1};Re.visibleFilter.toString=()=>"(datum, context) => true";const Be={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...z},groupAxis:{...In},separateSeries:!1},ke={type:"grid",visibleFilter:(t,e)=>!0,...Be,container:{...Nt}};ke.visibleFilter.toString=()=>"(datum, context) => true";const Vt={...Be},Ne={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...Vt}],separateGrid:!1,container:{...Nt}};Ne.visibleFilter.toString=()=>"(datum, context) => true";const Ve={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],valueLabels:[],xAxis:{...Ie,valueIndex:0},yAxis:{...Ie,valueIndex:1},container:{...Nt},separateCategory:!1};Ve.visibleFilter.toString=()=>"(datum, context) => true";const Ge={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ge.visibleFilter.toString=()=>"(datum, context) => true";const Xe={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};Xe.visibleFilter.toString=()=>"(datum, context) => true";function U(t){return Object.prototype.toString.call(t)==="[object Object]"}function Rn(t){return Object.prototype.toString.call(t)==="[object Function]"}function Bn(t){return!!(t&&t.nodeType)}function lt(t,e){if(U(t)===!1||U(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;U(r[o])&&U(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Ki(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 Qi(t,e){const n={string:a=>typeof a=="string",number:a=>typeof a=="number",boolean:a=>typeof a=="boolean",object:a=>U(a),"object[]":a=>Array.isArray(a)&&a.every(o=>U(o)),"string[]":a=>Array.isArray(a)&&a.every(o=>typeof o=="string"),"number[]":a=>Array.isArray(a)&&a.every(o=>typeof o=="number"),Function:a=>Rn(a),null:a=>a===null,undefined:a=>a===void 0},r={ColorType:a=>a==="none"||a==="label"||a==="primary"||a==="secondary"||a==="labelContrast"||a==="background"};return Object.keys(t).find(a=>{if(e[a]){const o=e[a],u=t[a];if(o.toBeTypes){if(o.toBeTypes.some(f=>n[f](u))===!1)return!0}else if(o.toBe){const{toBe:s,test:l}=o;if(l(u)===!1)return!0}else if(o.toBeOption){const s=o.toBeOption;if(r[s](u)===!1)return!0}}return!1})}function E(t,e){const n=Qi(t,e);if(n){const r=e[n],i=r.toBeTypes?r.toBeTypes.join(" | "):r.toBe?r.toBe:r.toBeOption?r.toBeOption:"";return{status:"error",columnName:n,expectToBe:i}}else return{status:"success",columnName:"",expectToBe:""}}const ta=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},sort:{toBeTypes:["Function","null"]},seriesLabels:{toBeTypes:["string[]"]},container:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]},sumSeries:{toBeTypes:["boolean"]}});if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e};function ne(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ea(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kn(t){let e,n,r;t.length!==2?(e=ne,n=(u,s)=>ne(t(u),s),r=(u,s)=>t(u)-s):(e=t===ne||t===ea?t:na,n=t,r=t);function i(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<0?l=c+1:f=c}while(l<f)}return l}function a(u,s,l=0,f=u.length){if(l<f){if(e(s,s)!==0)return f;do{const c=l+f>>>1;n(u[c],s)<=0?l=c+1:f=c}while(l<f)}return l}function o(u,s,l=0,f=u.length){const c=i(u,s,l,f-1);return c>l&&r(u[c-1],s)>-r(u[c],s)?c-1:c}return{left:i,center:o,right:a}}function na(){return 0}function ra(t){return t===null?NaN:+t}const Nn=kn(ne).right;kn(ra).center;class Vn extends Map{constructor(e,n=oa){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(Gn(this,e))}has(e){return super.has(Gn(this,e))}set(e,n){return super.set(ia(this,e),n)}delete(e){return super.delete(aa(this,e))}}function Gn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function ia({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function aa({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function oa(t){return t!==null&&typeof t=="object"?t.valueOf():t}const ua=Math.sqrt(50),sa=Math.sqrt(10),la=Math.sqrt(2);function re(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>=ua?10:a>=sa?5:a>=la?2:1;let u,s,l;return i<0?(l=Math.pow(10,-i)/o,u=Math.round(t*l),s=Math.round(e*l),u/l<t&&++u,s/l>e&&--s,l=-l):(l=Math.pow(10,i)*o,u=Math.round(t/l),s=Math.round(e/l),u*l<t&&++u,s*l>e&&--s),s<u&&.5<=n&&n<2?re(t,e,n*2):[u,s,l]}function ca(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?re(e,t,n):re(t,e,n);if(!(a>=i))return[];const u=a-i+1,s=new Array(u);if(r)if(o<0)for(let l=0;l<u;++l)s[l]=(a-l)/-o;else for(let l=0;l<u;++l)s[l]=(a-l)*o;else if(o<0)for(let l=0;l<u;++l)s[l]=(i+l)/-o;else for(let l=0;l<u;++l)s[l]=(i+l)*o;return s}function Ye(t,e,n){return e=+e,t=+t,n=+n,re(t,e,n)[2]}function fa(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ye(e,t,n):Ye(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function pa(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 ha={value:()=>{}};function Xn(){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 ie(n)}function ie(t){this._=t}function ma(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}})}ie.prototype=Xn.prototype={constructor:ie,on:function(t,e){var n=this._,r=ma(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=da(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]=Yn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Yn(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 ie(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 da(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Yn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ha,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ue="http://www.w3.org/1999/xhtml";const Un={svg:"http://www.w3.org/2000/svg",xhtml:Ue,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ae(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Un.hasOwnProperty(e)?{space:Un[e],local:t}:t}function ga(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ue&&e.documentElement.namespaceURI===Ue?e.createElement(t):e.createElementNS(n,t)}}function ya(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function zn(t){var e=ae(t);return(e.local?ya:ga)(e)}function ba(){}function ze(t){return t==null?ba:function(){return this.querySelector(t)}}function va(t){typeof t!="function"&&(t=ze(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),s,l,f=0;f<o;++f)(s=a[f])&&(l=t.call(s,s.__data__,f,a))&&("__data__"in s&&(l.__data__=s.__data__),u[f]=l);return new j(r,this._parents)}function xa(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Da(){return[]}function Hn(t){return t==null?Da:function(){return this.querySelectorAll(t)}}function wa(t){return function(){return xa(t.apply(this,arguments))}}function $a(t){typeof t=="function"?t=wa(t):t=Hn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new j(r,i)}function jn(t){return function(){return this.matches(t)}}function Wn(t){return function(e){return e.matches(t)}}var _a=Array.prototype.find;function Aa(t){return function(){return _a.call(this.children,t)}}function Sa(){return this.firstElementChild}function Ta(t){return this.select(t==null?Sa:Aa(typeof t=="function"?t:Wn(t)))}var Ma=Array.prototype.filter;function Fa(){return Array.from(this.children)}function Ca(t){return function(){return Ma.call(this.children,t)}}function Ea(t){return this.selectAll(t==null?Fa:Ca(typeof t=="function"?t:Wn(t)))}function La(t){typeof t!="function"&&(t=jn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new j(r,this._parents)}function qn(t){return new Array(t.length)}function Pa(){return new j(this._enter||this._groups.map(qn),this._parents)}function oe(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}oe.prototype={constructor:oe,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 Ia(t,e,n,r,i,a){for(var o=0,u,s=e.length,l=a.length;o<l;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new oe(t,a[o]);for(;o<s;++o)(u=e[o])&&(i[o]=u)}function Ra(t,e,n,r,i,a,o){var u,s,l=new Map,f=e.length,c=a.length,p=new Array(f),h;for(u=0;u<f;++u)(s=e[u])&&(p[u]=h=o.call(s,s.__data__,u,e)+"",l.has(h)?i[u]=s:l.set(h,s));for(u=0;u<c;++u)h=o.call(t,a[u],u,a)+"",(s=l.get(h))?(r[u]=s,s.__data__=a[u],l.delete(h)):n[u]=new oe(t,a[u]);for(u=0;u<f;++u)(s=e[u])&&l.get(p[u])===s&&(i[u]=s)}function Ba(t){return t.__data__}function ka(t,e){if(!arguments.length)return Array.from(this,Ba);var n=e?Ra:Ia,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),s=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],p=c.length,h=Na(t.call(f,f&&f.__data__,l,r)),m=h.length,d=u[l]=new Array(m),D=o[l]=new Array(m),$=s[l]=new Array(p);n(f,c,d,D,$,h,e);for(var S=0,_=0,C,A;S<m;++S)if(C=d[S]){for(S>=_&&(_=S+1);!(A=D[_])&&++_<m;);C._next=A||null}}return o=new j(o,r),o._enter=u,o._exit=s,o}function Na(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Va(){return new j(this._exit||this._groups.map(qn),this._parents)}function Ga(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 Xa(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),s=0;s<o;++s)for(var l=n[s],f=r[s],c=l.length,p=u[s]=new Array(c),h,m=0;m<c;++m)(h=l[m]||f[m])&&(p[m]=h);for(;s<i;++s)u[s]=n[s];return new j(u,this._parents)}function Ya(){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 Ua(t){t||(t=za);function e(c,p){return c&&p?t(c.__data__,p.__data__):!c-!p}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,s=i[a]=new Array(u),l,f=0;f<u;++f)(l=o[f])&&(s[f]=l);s.sort(e)}return new j(i,this._parents).order()}function za(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Ha(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ja(){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 qa(){let t=0;for(const e of this)++t;return t}function Ja(){return!this.node()}function Za(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 Ka(t){return function(){this.removeAttribute(t)}}function Qa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function to(t,e){return function(){this.setAttribute(t,e)}}function eo(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function no(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ro(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 io(t,e){var n=ae(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?Qa:Ka:typeof e=="function"?n.local?ro:no:n.local?eo:to)(n,e))}function Jn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ao(t){return function(){this.style.removeProperty(t)}}function oo(t,e,n){return function(){this.style.setProperty(t,e,n)}}function uo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function so(t,e,n){return arguments.length>1?this.each((e==null?ao:typeof e=="function"?uo:oo)(t,e,n??"")):Tt(this.node(),t)}function Tt(t,e){return t.style.getPropertyValue(e)||Jn(t).getComputedStyle(t,null).getPropertyValue(e)}function lo(t){return function(){delete this[t]}}function co(t,e){return function(){this[t]=e}}function fo(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function po(t,e){return arguments.length>1?this.each((e==null?lo:typeof e=="function"?fo:co)(t,e)):this.node()[t]}function Zn(t){return t.trim().split(/^|\s+/)}function He(t){return t.classList||new Kn(t)}function Kn(t){this._node=t,this._names=Zn(t.getAttribute("class")||"")}Kn.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 Qn(t,e){for(var n=He(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function tr(t,e){for(var n=He(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ho(t){return function(){Qn(this,t)}}function mo(t){return function(){tr(this,t)}}function go(t,e){return function(){(e.apply(this,arguments)?Qn:tr)(this,t)}}function yo(t,e){var n=Zn(t+"");if(arguments.length<2){for(var r=He(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?go:e?ho:mo)(n,e))}function bo(){this.textContent=""}function vo(t){return function(){this.textContent=t}}function xo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Do(t){return arguments.length?this.each(t==null?bo:(typeof t=="function"?xo:vo)(t)):this.node().textContent}function wo(){this.innerHTML=""}function $o(t){return function(){this.innerHTML=t}}function _o(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ao(t){return arguments.length?this.each(t==null?wo:(typeof t=="function"?_o:$o)(t)):this.node().innerHTML}function So(){this.nextSibling&&this.parentNode.appendChild(this)}function To(){return this.each(So)}function Mo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fo(){return this.each(Mo)}function Co(t){var e=typeof t=="function"?t:zn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Eo(){return null}function Lo(t,e){var n=typeof t=="function"?t:zn(t),r=e==null?Eo:typeof e=="function"?e:ze(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Po(){var t=this.parentNode;t&&t.removeChild(this)}function Oo(){return this.each(Po)}function Io(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ro(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Bo(t){return this.select(t?Ro:Io)}function ko(t){return arguments.length?this.property("__data__",t):this.node().__data__}function No(t){return function(e){t.call(this,e,this.__data__)}}function Vo(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 Go(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 Xo(t,e,n){return function(){var r=this.__on,i,a=No(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 Yo(t,e,n){var r=Vo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var s=0,l=u.length,f;s<l;++s)for(i=0,f=u[s];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?Xo:Go,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function er(t,e,n){var r=Jn(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 Uo(t,e){return function(){return er(this,t,e)}}function zo(t,e){return function(){return er(this,t,e.apply(this,arguments))}}function Ho(t,e){return this.each((typeof e=="function"?zo:Uo)(t,e))}function*jo(){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 nr=[null];function j(t,e){this._groups=t,this._parents=e}function Gt(){return new j([[document.documentElement]],nr)}function Wo(){return this}j.prototype=Gt.prototype={constructor:j,select:va,selectAll:$a,selectChild:Ta,selectChildren:Ea,filter:La,data:ka,enter:Pa,exit:Va,join:Ga,merge:Xa,selection:Wo,order:Ya,sort:Ua,call:Ha,nodes:ja,node:Wa,size:qa,empty:Ja,each:Za,attr:io,style:so,property:po,classed:yo,text:Do,html:Ao,raise:To,lower:Fo,append:Co,insert:Lo,remove:Oo,clone:Bo,datum:ko,on:Yo,dispatch:Ho,[Symbol.iterator]:jo};function ue(t){return typeof t=="string"?new j([[document.querySelector(t)]],[document.documentElement]):new j([[t]],nr)}function je(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function rr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Xt(){}var Yt=.7,se=1/Yt,Mt="\\s*([+-]?\\d+)\\s*",Ut="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qo=/^#([0-9a-f]{3,8})$/,Jo=new RegExp(`^rgb\\(${Mt},${Mt},${Mt}\\)$`),Zo=new RegExp(`^rgb\\(${tt},${tt},${tt}\\)$`),Ko=new RegExp(`^rgba\\(${Mt},${Mt},${Mt},${Ut}\\)$`),Qo=new RegExp(`^rgba\\(${tt},${tt},${tt},${Ut}\\)$`),tu=new RegExp(`^hsl\\(${Ut},${tt},${tt}\\)$`),eu=new RegExp(`^hsla\\(${Ut},${tt},${tt},${Ut}\\)$`),ir={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};je(Xt,bt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ar,formatHex:ar,formatHex8:nu,formatHsl:ru,formatRgb:or,toString:or});function ar(){return this.rgb().formatHex()}function nu(){return this.rgb().formatHex8()}function ru(){return fr(this).formatHsl()}function or(){return this.rgb().formatRgb()}function bt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ur(e):n===3?new H(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?le(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?le(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=Jo.exec(t))?new H(e[1],e[2],e[3],1):(e=Zo.exec(t))?new H(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ko.exec(t))?le(e[1],e[2],e[3],e[4]):(e=Qo.exec(t))?le(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=tu.exec(t))?cr(e[1],e[2]/100,e[3]/100,1):(e=eu.exec(t))?cr(e[1],e[2]/100,e[3]/100,e[4]):ir.hasOwnProperty(t)?ur(ir[t]):t==="transparent"?new H(NaN,NaN,NaN,0):null}function ur(t){return new H(t>>16&255,t>>8&255,t&255,1)}function le(t,e,n,r){return r<=0&&(t=e=n=NaN),new H(t,e,n,r)}function iu(t){return t instanceof Xt||(t=bt(t)),t?(t=t.rgb(),new H(t.r,t.g,t.b,t.opacity)):new H}function We(t,e,n,r){return arguments.length===1?iu(t):new H(t,e,n,r??1)}function H(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}je(H,We,rr(Xt,{brighter(t){return t=t==null?se:Math.pow(se,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Yt:Math.pow(Yt,t),new H(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new H(vt(this.r),vt(this.g),vt(this.b),ce(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:sr,formatHex:sr,formatHex8:au,formatRgb:lr,toString:lr}));function sr(){return`#${xt(this.r)}${xt(this.g)}${xt(this.b)}`}function au(){return`#${xt(this.r)}${xt(this.g)}${xt(this.b)}${xt((isNaN(this.opacity)?1:this.opacity)*255)}`}function lr(){const t=ce(this.opacity);return`${t===1?"rgb(":"rgba("}${vt(this.r)}, ${vt(this.g)}, ${vt(this.b)}${t===1?")":`, ${t})`}`}function ce(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function xt(t){return t=vt(t),(t<16?"0":"")+t.toString(16)}function cr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new J(t,e,n,r)}function fr(t){if(t instanceof J)return new J(t.h,t.s,t.l,t.opacity);if(t instanceof Xt||(t=bt(t)),!t)return new J;if(t instanceof J)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,u=a-i,s=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=s<.5?a+i:2-a-i,o*=60):u=s>0&&s<1?0:o,new J(o,u,s,t.opacity)}function ou(t,e,n,r){return arguments.length===1?fr(t):new J(t,e,n,r??1)}function J(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}je(J,ou,rr(Xt,{brighter(t){return t=t==null?se:Math.pow(se,t),new J(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Yt:Math.pow(Yt,t),new J(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 H(qe(t>=240?t-240:t+120,i,r),qe(t,i,r),qe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new J(pr(this.h),fe(this.s),fe(this.l),ce(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=ce(this.opacity);return`${t===1?"hsl(":"hsla("}${pr(this.h)}, ${fe(this.s)*100}%, ${fe(this.l)*100}%${t===1?")":`, ${t})`}`}}));function pr(t){return t=(t||0)%360,t<0?t+360:t}function fe(t){return Math.max(0,Math.min(1,t||0))}function qe(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 Je=t=>()=>t;function uu(t,e){return function(n){return t+n*e}}function su(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 lu(t){return(t=+t)==1?hr:function(e,n){return n-e?su(e,n,t):Je(isNaN(e)?n:e)}}function hr(t,e){var n=e-t;return n?uu(t,n):Je(isNaN(t)?e:t)}const pe=function t(e){var n=lu(e);function r(i,a){var o=n((i=We(i)).r,(a=We(a)).r),u=n(i.g,a.g),s=n(i.b,a.b),l=hr(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=s(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function cu(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 fu(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function pu(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]=Qe(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 hu(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Z(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function mu(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]=Qe(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Ze=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ke=new RegExp(Ze.source,"g");function du(t){return function(){return t}}function gu(t){return function(e){return t(e)+""}}function mr(t,e){var n=Ze.lastIndex=Ke.lastIndex=0,r,i,a,o=-1,u=[],s=[];for(t=t+"",e=e+"";(r=Ze.exec(t))&&(i=Ke.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,s.push({i:o,x:Z(r,i)})),n=Ke.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?s[0]?gu(s[0].x):du(e):(e=s.length,function(l){for(var f=0,c;f<e;++f)u[(c=s[f]).i]=c.x(l);return u.join("")})}function Qe(t,e){var n=typeof e,r;return e==null||n==="boolean"?Je(e):(n==="number"?Z:n==="string"?(r=bt(e))?(e=r,pe):mr:e instanceof bt?pe:e instanceof Date?hu:fu(e)?cu:Array.isArray(e)?pu:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?mu:Z)(t,e)}function yu(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var dr=180/Math.PI,tn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gr(t,e,n,r,i,a){var o,u,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*dr,skewX:Math.atan(s)*dr,scaleX:o,scaleY:u}}var he;function bu(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?tn:gr(e.a,e.b,e.c,e.d,e.e,e.f)}function vu(t){return t==null||(he||(he=document.createElementNS("http://www.w3.org/2000/svg","g")),he.setAttribute("transform",t),!(t=he.transform.baseVal.consolidate()))?tn:(t=t.matrix,gr(t.a,t.b,t.c,t.d,t.e,t.f))}function yr(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,p,h,m){if(l!==c||f!==p){var d=h.push("translate(",null,e,null,n);m.push({i:d-4,x:Z(l,c)},{i:d-2,x:Z(f,p)})}else(c||p)&&h.push("translate("+c+e+p+n)}function o(l,f,c,p){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),p.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Z(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(l,f,c,p){l!==f?p.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Z(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function s(l,f,c,p,h,m){if(l!==c||f!==p){var d=h.push(i(h)+"scale(",null,",",null,")");m.push({i:d-4,x:Z(l,c)},{i:d-2,x:Z(f,p)})}else(c!==1||p!==1)&&h.push(i(h)+"scale("+c+","+p+")")}return function(l,f){var c=[],p=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,p),o(l.rotate,f.rotate,c,p),u(l.skewX,f.skewX,c,p),s(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,p),l=f=null,function(h){for(var m=-1,d=p.length,D;++m<d;)c[(D=p[m]).i]=D.x(h);return c.join("")}}}var xu=yr(bu,"px, ","px)","deg)"),Du=yr(vu,", ",")",")"),Ft=0,zt=0,Ht=0,br=1e3,me,jt,de=0,Dt=0,ge=0,Wt=typeof performance=="object"&&performance.now?performance:Date,vr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function en(){return Dt||(vr(wu),Dt=Wt.now()+ge)}function wu(){Dt=0}function ye(){this._call=this._time=this._next=null}ye.prototype=xr.prototype={constructor:ye,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?en():+n)+(e==null?0:+e),!this._next&&jt!==this&&(jt?jt._next=this:me=this,jt=this),this._call=t,this._time=n,nn()},stop:function(){this._call&&(this._call=null,this._time=1/0,nn())}};function xr(t,e,n){var r=new ye;return r.restart(t,e,n),r}function $u(){en(),++Ft;for(var t=me,e;t;)(e=Dt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Ft}function Dr(){Dt=(de=Wt.now())+ge,Ft=zt=0;try{$u()}finally{Ft=0,Au(),Dt=0}}function _u(){var t=Wt.now(),e=t-de;e>br&&(ge-=e,de=t)}function Au(){for(var t,e=me,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:me=n);jt=t,nn(r)}function nn(t){if(!Ft){zt&&(zt=clearTimeout(zt));var e=t-Dt;e>24?(t<1/0&&(zt=setTimeout(Dr,t-Wt.now()-ge)),Ht&&(Ht=clearInterval(Ht))):(Ht||(de=Wt.now(),Ht=setInterval(_u,br)),Ft=1,vr(Dr))}}function wr(t,e,n){var r=new ye;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Su=Xn("start","end","cancel","interrupt"),Tu=[],$r=0,_r=1,rn=2,be=3,Ar=4,an=5,ve=6;function xe(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Mu(t,n,{name:e,index:r,group:i,on:Su,tween:Tu,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:$r})}function on(t,e){var n=K(t,e);if(n.state>$r)throw new Error("too late; already scheduled");return n}function et(t,e){var n=K(t,e);if(n.state>be)throw new Error("too late; already running");return n}function K(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Mu(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=xr(a,0,n.time);function a(l){n.state=_r,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,p,h;if(n.state!==_r)return s();for(f in r)if(h=r[f],h.name===n.name){if(h.state===be)return wr(o);h.state===Ar?(h.state=ve,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[f]):+f<e&&(h.state=ve,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[f])}if(wr(function(){n.state===be&&(n.state=Ar,n.timer.restart(u,n.delay,n.time),u(l))}),n.state=rn,n.on.call("start",t,t.__data__,n.index,n.group),n.state===rn){for(n.state=be,i=new Array(p=n.tween.length),f=0,c=-1;f<p;++f)(h=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function u(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=an,1),c=-1,p=i.length;++c<p;)i[c].call(t,f);n.state===an&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=ve,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Fu(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>rn&&r.state<an,r.state=ve,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Cu(t){return this.each(function(){Fu(this,t)})}function Eu(t,e){var n,r;return function(){var i=et(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 Lu(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=et(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}a.tween=i}}function Pu(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=K(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Eu:Lu)(n,t,e))}function un(t,e,n){var r=t._id;return t.each(function(){var i=et(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return K(i,r).value[e]}}function Sr(t,e){var n;return(typeof e=="number"?Z:e instanceof bt?pe:(n=bt(e))?(e=n,pe):mr)(t,e)}function Ou(t){return function(){this.removeAttribute(t)}}function Iu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ru(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 Bu(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 ku(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function Nu(t,e,n){var r,i,a;return function(){var o,u=n(this),s;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=u+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u)))}}function Vu(t,e){var n=ae(t),r=n==="transform"?Du:Sr;return this.attrTween(t,typeof e=="function"?(n.local?Nu:ku)(n,r,un(this,"attr."+t,e)):e==null?(n.local?Iu:Ou)(n):(n.local?Bu:Ru)(n,r,e))}function Gu(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Xu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Yu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Xu(t,a)),n}return i._value=e,i}function Uu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Gu(t,a)),n}return i._value=e,i}function zu(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=ae(t);return this.tween(n,(r.local?Yu:Uu)(r,e))}function Hu(t,e){return function(){on(this,t).delay=+e.apply(this,arguments)}}function ju(t,e){return e=+e,function(){on(this,t).delay=e}}function Wu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Hu:ju)(e,t)):K(this.node(),e).delay}function qu(t,e){return function(){et(this,t).duration=+e.apply(this,arguments)}}function Ju(t,e){return e=+e,function(){et(this,t).duration=e}}function Zu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?qu:Ju)(e,t)):K(this.node(),e).duration}function Ku(t,e){if(typeof e!="function")throw new Error;return function(){et(this,t).ease=e}}function Qu(t){var e=this._id;return arguments.length?this.each(Ku(e,t)):K(this.node(),e).ease}function ts(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;et(this,t).ease=n}}function es(t){if(typeof t!="function")throw new Error;return this.each(ts(this._id,t))}function ns(t){typeof t!="function"&&(t=jn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&u.push(s);return new it(r,this._parents,this._name,this._id)}function rs(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var s=e[u],l=n[u],f=s.length,c=o[u]=new Array(f),p,h=0;h<f;++h)(p=s[h]||l[h])&&(c[h]=p);for(;u<r;++u)o[u]=e[u];return new it(o,this._parents,this._name,this._id)}function is(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 as(t,e,n){var r,i,a=is(e)?on:et;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function os(t,e){var n=this._id;return arguments.length<2?K(this.node(),n).on.on(t):this.each(as(n,t,e))}function us(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ss(){return this.on("end.remove",us(this._id))}function ls(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ze(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],s=u.length,l=a[o]=new Array(s),f,c,p=0;p<s;++p)(f=u[p])&&(c=t.call(f,f.__data__,p,u))&&("__data__"in f&&(c.__data__=f.__data__),l[p]=c,xe(l[p],e,n,p,l,K(f,n)));return new it(a,this._parents,e,n)}function cs(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Hn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var s=r[u],l=s.length,f,c=0;c<l;++c)if(f=s[c]){for(var p=t.call(f,f.__data__,c,s),h,m=K(f,n),d=0,D=p.length;d<D;++d)(h=p[d])&&xe(h,e,n,d,p,m);a.push(p),o.push(f)}return new it(a,o,e,n)}var fs=Gt.prototype.constructor;function ps(){return new fs(this._groups,this._parents)}function hs(t,e){var n,r,i;return function(){var a=Tt(this,t),o=(this.style.removeProperty(t),Tt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Tr(t){return function(){this.style.removeProperty(t)}}function ms(t,e,n){var r,i=n+"",a;return function(){var o=Tt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function ds(t,e,n){var r,i,a;return function(){var o=Tt(this,t),u=n(this),s=u+"";return u==null&&(s=u=(this.style.removeProperty(t),Tt(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,u))}}function gs(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var s=et(this,t),l=s.on,f=s.value[a]==null?u||(u=Tr(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),s.on=r}}function ys(t,e,n){var r=(t+="")=="transform"?xu:Sr;return e==null?this.styleTween(t,hs(t,r)).on("end.style."+t,Tr(t)):typeof e=="function"?this.styleTween(t,ds(t,r,un(this,"style."+t,e))).each(gs(this._id,t)):this.styleTween(t,ms(t,r,e),n).on("end.style."+t,null)}function bs(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function vs(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&bs(t,o,n)),r}return a._value=e,a}function xs(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,vs(t,e,n??""))}function Ds(t){return function(){this.textContent=t}}function ws(t){return function(){var e=t(this);this.textContent=e??""}}function $s(t){return this.tween("text",typeof t=="function"?ws(un(this,"text",t)):Ds(t==null?"":t+""))}function _s(t){return function(e){this.textContent=t.call(this,e)}}function As(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&_s(i)),e}return r._value=t,r}function Ss(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,As(t))}function Ts(){for(var t=this._name,e=this._id,n=Mr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)if(s=o[l]){var f=K(s,e);xe(s,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new it(r,this._parents,t,n)}function Ms(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},s={value:function(){--i===0&&a()}};n.each(function(){var l=et(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),l.on=e}),i===0&&a()})}var Fs=0;function it(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Mr(){return++Fs}var at=Gt.prototype;it.prototype={constructor:it,select:ls,selectAll:cs,selectChild:at.selectChild,selectChildren:at.selectChildren,filter:ns,merge:rs,selection:ps,transition:Ts,call:at.call,nodes:at.nodes,node:at.node,size:at.size,empty:at.empty,each:at.each,on:os,attr:Vu,attrTween:zu,style:ys,styleTween:xs,text:$s,textTween:Ss,remove:ss,tween:Pu,delay:Wu,duration:Zu,ease:Qu,easeVarying:es,end:Ms,[Symbol.iterator]:at[Symbol.iterator]};function Cs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Es={time:null,delay:0,duration:250,ease:Cs};function Ls(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 Ps(t){var e,n;t instanceof it?(e=t._id,t=t._name):(e=Mr(),(n=Es).time=en(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,s,l=0;l<u;++l)(s=o[l])&&xe(s,t,e,l,o,n||Ls(s,e));return new it(r,this._parents,t,e)}Gt.prototype.interrupt=Cu,Gt.prototype.transition=Ps;function Os(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function De(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 Ct(t){return t=De(Math.abs(t)),t?t[1]:NaN}function Is(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),a.push(n.substring(i-=u,i+u)),!((s+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Rs(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Bs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function we(t){if(!(e=Bs.exec(t)))throw new Error("invalid format: "+t);var e;return new sn({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]})}we.prototype=sn.prototype;function sn(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+""}sn.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 ks(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 Fr;function Ns(t,e){var n=De(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Fr=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")+De(t,Math.max(0,e+a-1))[0]}function Cr(t,e){var n=De(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 Er={"%":(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)=>Cr(t*100,e),r:Cr,s:Ns,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Lr(t){return t}var Pr=Array.prototype.map,Or=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Vs(t){var e=t.grouping===void 0||t.thousands===void 0?Lr:Is(Pr.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?Lr:Rs(Pr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",s=t.nan===void 0?"NaN":t.nan+"";function l(c){c=we(c);var p=c.fill,h=c.align,m=c.sign,d=c.symbol,D=c.zero,$=c.width,S=c.comma,_=c.precision,C=c.trim,A=c.type;A==="n"?(S=!0,A="g"):Er[A]||(_===void 0&&(_=12),C=!0,A="g"),(D||p==="0"&&h==="=")&&(D=!0,p="0",h="=");var I=d==="$"?n:d==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",O=d==="$"?r:/[%p]/.test(A)?o:"",k=Er[A],x=/[defgprs%]/.test(A);_=_===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(y){var T=I,P=O,G,gt,Q;if(A==="c")P=k(y)+P,y="";else{y=+y;var rt=y<0||1/y<0;if(y=isNaN(y)?s:k(Math.abs(y),_),C&&(y=ks(y)),rt&&+y==0&&m!=="+"&&(rt=!1),T=(rt?m==="("?m:u:m==="-"||m==="("?"":m)+T,P=(A==="s"?Or[8+Fr/3]:"")+P+(rt&&m==="("?")":""),x){for(G=-1,gt=y.length;++G<gt;)if(Q=y.charCodeAt(G),48>Q||Q>57){P=(Q===46?i+y.slice(G+1):y.slice(G))+P,y=y.slice(0,G);break}}}S&&!D&&(y=e(y,1/0));var yt=T.length+y.length+P.length,ut=yt<$?new Array($-yt+1).join(p):"";switch(S&&D&&(y=e(ut+y,ut.length?$-P.length:1/0),ut=""),h){case"<":y=T+y+P+ut;break;case"=":y=T+ut+y+P;break;case"^":y=ut.slice(0,yt=ut.length>>1)+T+y+P+ut.slice(yt);break;default:y=ut+T+y+P;break}return a(y)}return w.toString=function(){return c+""},w}function f(c,p){var h=l((c=we(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(Ct(p)/3)))*3,d=Math.pow(10,-m),D=Or[8+m/3];return function($){return h(d*$)+D}}return{format:l,formatPrefix:f}}var $e,ln,Ir;Gs({thousands:",",grouping:[3],currency:["$",""]});function Gs(t){return $e=Vs(t),ln=$e.format,Ir=$e.formatPrefix,$e}function Xs(t){return Math.max(0,-Ct(Math.abs(t)))}function Ys(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ct(e)/3)))*3-Ct(Math.abs(t)))}function Us(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Ct(e)-Ct(t))+1}function _e(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Rr=Symbol("implicit");function Br(){var t=new Vn,e=[],n=[],r=Rr;function i(a){let o=t.get(a);if(o===void 0){if(r!==Rr)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 Br(e,n).unknown(r)},_e.apply(i,arguments),i}function kr(){var t=Br().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,s=0,l=0,f=.5;delete t.unknown;function c(){var p=e().length,h=i<r,m=h?i:r,d=h?r:i;a=(d-m)/Math.max(1,p-s+l*2),u&&(a=Math.floor(a)),m+=(d-m-a*(p-s))*f,o=a*(1-s),u&&(m=Math.round(m),o=Math.round(o));var D=pa(p).map(function($){return m+a*$});return n(h?D.reverse():D)}return t.domain=function(p){return arguments.length?(e(p),c()):e()},t.range=function(p){return arguments.length?([r,i]=p,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(p){return[r,i]=p,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(p){return arguments.length?(u=!!p,c()):u},t.padding=function(p){return arguments.length?(s=Math.min(1,l=+p),c()):s},t.paddingInner=function(p){return arguments.length?(s=Math.min(1,p),c()):s},t.paddingOuter=function(p){return arguments.length?(l=+p,c()):l},t.align=function(p){return arguments.length?(f=Math.max(0,Math.min(1,p)),c()):f},t.copy=function(){return kr(e(),[r,i]).round(u).paddingInner(s).paddingOuter(l).align(f)},_e.apply(c(),arguments)}function Nr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return Nr(e())},t}function zs(){return Nr(kr.apply(null,arguments).paddingInner(1))}function Hs(t){return function(){return t}}function js(t){return+t}var Vr=[0,1];function Et(t){return t}function cn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Hs(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 qs(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=cn(i,r),a=n(o,a)):(r=cn(r,i),a=n(a,o)),function(u){return a(r(u))}}function Js(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]=cn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var s=Nn(t,u,1,r)-1;return a[s](i[s](u))}}function Zs(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ks(){var t=Vr,e=Vr,n=Qe,r,i,a,o=Et,u,s,l;function f(){var p=Math.min(t.length,e.length);return o!==Et&&(o=Ws(t[0],t[p-1])),u=p>2?Js:qs,s=l=null,c}function c(p){return p==null||isNaN(p=+p)?a:(s||(s=u(t.map(r),e,n)))(r(o(p)))}return c.invert=function(p){return o(i((l||(l=u(e,t.map(r),Z)))(p)))},c.domain=function(p){return arguments.length?(t=Array.from(p,js),f()):t.slice()},c.range=function(p){return arguments.length?(e=Array.from(p),f()):e.slice()},c.rangeRound=function(p){return e=Array.from(p),n=yu,f()},c.clamp=function(p){return arguments.length?(o=p?!0:Et,f()):o!==Et},c.interpolate=function(p){return arguments.length?(n=p,f()):n},c.unknown=function(p){return arguments.length?(a=p,c):a},function(p,h){return r=p,i=h,f()}}function Qs(){return Ks()(Et,Et)}function tl(t,e,n,r){var i=fa(t,e,n),a;switch(r=we(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=Ys(i,o))&&(r.precision=a),Ir(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Us(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Xs(i))&&(r.precision=a-(r.type==="%")*2);break}}return ln(r)}function Gr(t){var e=t.domain;return t.ticks=function(n){var r=e();return ca(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return tl(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],s,l,f=10;for(u<o&&(l=o,o=u,u=l,l=i,i=a,a=l);f-- >0;){if(l=Ye(o,u,n),l===s)return r[i]=o,r[a]=u,e(r);if(l>0)o=Math.floor(o/l)*l,u=Math.ceil(u/l)*l;else if(l<0)o=Math.ceil(o*l)/l,u=Math.floor(u*l)/l;else break;s=l}return t},t}function qt(){var t=Qs();return t.copy=function(){return Zs(t,qt())},_e.apply(t,arguments),Gr(t)}function Xr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(s){return s!=null&&s<=s?i[Nn(r,s,0,n)]:a}function u(){var s=-1;for(r=new Array(n);++s<n;)r[s]=((s+1)*e-(s-n)*t)/(n+1);return o}return o.domain=function(s){return arguments.length?([t,e]=s,t=+t,e=+e,u()):[t,e]},o.range=function(s){return arguments.length?(n=(i=Array.from(s)).length-1,u()):i.slice()},o.invertExtent=function(s){var l=i.indexOf(s);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(s){return arguments.length&&(a=s),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Xr().domain([t,e]).range(i).unknown(a)},_e.apply(Gr(o),arguments)}function Jt(t,e,n){this.k=t,this.x=e,this.y=n}Jt.prototype={constructor:Jt,scale:function(t){return t===1?this:new Jt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Jt(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+")"}},Jt.prototype;function el(t,e){return e instanceof Function?e(t):ln(e)(t)}function Zt(t,e,n,r){let i=`${t}_${e}`;return n!=null&&(i+=`_${n}`),r!=null&&(i+=`_${r}`),i}function Ae(t,e){return`series${e}`}function fn(t,e){return`group${e}`}function Se(){return""}function Yr(t,e){return`value${e}`}function pn({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]:Ae(n,a))}function Ur({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]:Ae(`${n}_grid${r}`,o))}function zr({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]:fn(n,a))}function Hr({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]:fn(`${n}_grid${r}`,o))}function ct(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 jr(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return ct(e)}function nl(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return ct(n)}function hn(t){const n=t.flat().filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return ct(n)}function rl(t){const n=t.flat().flat().filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return ct(n)}function il(t,e){const n=t.map(r=>Array.isArray(r)?r[e]??null:U(r)?r.value[e]??null:null).filter(r=>r!=null);return ct(n)}function al({data:t,minX:e,maxX:n,minY:r,maxY:i}){let a=[],o=null,u=null,s=null,l=null;for(let f of t)for(let c of f)c.axisX>=e&&c.axisX<=n&&c.axisY>=r&&c.axisY<=i&&(a.push(f),(o==null||c.axisX<o.axisX)&&(o=c),(u==null||c.axisX>u.axisX)&&(u=c),(s==null||c.axisY<s.axisY)&&(s=c),(l==null||c.axisY>l.axisY)&&(l=c));return{minXDatum:o,maxXDatum:u,minYDatum:s,maxYDatum:l,filteredData:a}}function Wr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((a,o)=>Math.max(a,o.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let a=0;a<n;a++)for(let o=0;o<r;o++)i[o][a]=e[a][o];return i}function ft(t,e){return t<e.colors[e.colorScheme].label.length?e.colors[e.colorScheme].label[t]:e.colors[e.colorScheme].label[t%e.colors[e.colorScheme].label.length]}function qr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function mn(t,e,n){const r=e.columnGap==="auto"?t.left+t.right:e.columnGap,i=e.rowGap==="auto"?t.top+t.bottom:e.rowGap,{rowAmount:a,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:qr(n);return new Array(n).fill(null).map((u,s)=>{const l=s%o,f=Math.floor(s/o),c=(t.width-r*(o-1))/o,p=(t.height-i*(a-1))/a,h=l*c+l*r,m=f*p+f*i;return{slotIndex:s,rowIndex:f,columnIndex:l,startX:h,startY:m,centerX:h+c/2,centerY:m+p/2,width:c,height:p}})}function Lt(t,e,n){const r=e.columnGap==="auto"?t.left+t.right:e.columnGap,i=e.rowGap==="auto"?t.top+t.bottom:e.rowGap,{rowAmount:a,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:qr(n);return new Array(n).fill(null).map((u,s)=>{const l=s%o,f=Math.floor(s/o),c=(t.width-r*(o-1))/o,p=(t.height-i*(a-1))/a,h=l*c+l*r,m=f*p+f*i,d=[h,m],D=[c/t.width,p/t.height];return{slotIndex:s,rowIndex:f,columnIndex:l,translate:d,scale:D}})}const ol=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,u,s,l)=>{const f=Zt(n.type,u,s),c=n.seriesLabels[u]||Ae("series",u),p=ft(u,r);return typeof o=="number"?{id:f,index:l,seq:0,label:f,description:"",data:{},value:o,seriesIndex:u,seriesLabel:c,color:p,visible:!0}:{id:o.id?o.id:f,index:l,seq:0,label:o.label?o.label:f,description:o.description,data:o.data??{},value:o.value,seriesIndex:u,seriesLabel:c,color:p,visible:!0}};i=e.map((o,u)=>Array.isArray(o)?o.map((s,l)=>a(s,u,l,i.length+l)):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},ul=t=>E({data:t},{data:{toBe:"(DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]",test:n=>Array.isArray(n)}});var dn=function(t,e){return dn=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])},dn(t,e)};function nt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");dn(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function sl(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{l(r.next(f))}catch(c){o(c)}}function s(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(u,s)}l((r=r.apply(t,e||[])).next())})}function Jr(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(l){return function(f){return s([l,f])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(a=l[0]&2?i.return:l[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,l[1])).done)return a;switch(i=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){n.label=l[1];break}if(l[0]===6&&n.label<a[1]){n.label=a[1],a=l;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(l);break}a[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Pt(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 pt(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 ht(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 Ot(t){return this instanceof Ot?(this.v=t,this):new Ot(t)}function ll(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(h){return function(m){return Promise.resolve(m).then(h,c)}}function u(h,m){r[h]&&(i[h]=function(d){return new Promise(function(D,$){a.push([h,d,D,$])>1||s(h,d)})},m&&(i[h]=m(i[h])))}function s(h,m){try{l(r[h](m))}catch(d){p(a[0][3],d)}}function l(h){h.value instanceof Ot?Promise.resolve(h.value.v).then(f,c):p(a[0][2],h)}function f(h){s("next",h)}function c(h){s("throw",h)}function p(h,m){h(m),a.shift(),a.length&&s(a[0][0],a[0][1])}}function cl(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 Pt=="function"?Pt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,s){o=t[a](o),i(u,s,o.done,o.value)})}}function i(a,o,u,s){Promise.resolve(s).then(function(l){a({value:l,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function N(t){return typeof t=="function"}function gn(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 yn=gn(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 Se(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Zt=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=Lt(o),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(N(f))try{f()}catch(d){a=d instanceof dn?d.errors:[d]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var p=Lt(c),h=p.next();!h.done;h=p.next()){var m=h.value;try{Zr(m)}catch(d){a=a??[],d instanceof dn?a=pt(pt([],ft(a)),ft(d.errors)):a.push(d)}}}catch(d){r={error:d}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}if(a)throw new dn(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Zr(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)&&Se(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Se(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),qr=Zt.EMPTY;function Jr(t){return t instanceof Zt||t&&"closed"in t&&N(t.remove)&&N(t.add)&&N(t.unsubscribe)}function Zr(t){N(t)?t():t.unsubscribe()}var Kr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Qr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,pt([t,e],ft(n)))},clearTimeout:function(t){var e=Qr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ti(t){Qr.setTimeout(function(){throw t})}function gn(){}function Te(t){t()}var yn=function(t){nt(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Jr(n)&&n.add(r)):r.destination=hl,r}return e.create=function(n,r,i){return new Kt(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}(Zt),cl=Function.prototype.bind;function bn(t,e){return cl.call(t,e)}var fl=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Me(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Me(r)}else Me(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Me(n)}},t}(),Kt=function(t){nt(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(N(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Kr.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&bn(n.next,u),error:n.error&&bn(n.error,u),complete:n.complete&&bn(n.complete,u)}):o=n}return a.destination=new fl(o),a}return e}(yn);function Me(t){ti(t)}function pl(t){throw t}var hl={closed:!0,next:gn,error:pl,complete:gn},vn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ot(t){return t}function ml(t){return t.length===0?Ot:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var R=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=gl(e)?e:new Kt(e,n,r);return Te(function(){var o=i,u=o.operator,s=o.source;a.add(u?u.call(a,s):s?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ei(n),new n(function(i,a){var o=new Kt({next:function(u){try{e(u)}catch(s){a(s),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[vn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return ml(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ei(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 ei(t){var e;return(e=t??Kr.Promise)!==null&&e!==void 0?e:Promise}function dl(t){return t&&N(t.next)&&N(t.error)&&N(t.complete)}function gl(t){return t&&t instanceof yn||dl(t)&&Jr(t)}function yl(t){return N(t==null?void 0:t.lift)}function X(t){return function(e){if(yl(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 Y(t,e,n,r,i){return new bl(t,e,n,r,i)}var bl=function(t){nt(e,t);function e(n,r,i,a,o,u){var s=t.call(this,n)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(yn),vl=mn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),B=function(t){nt(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 ni(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new vl},e.prototype.next=function(n){var r=this;Te(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Lt(r.currentObservers),u=o.next();!u.done;u=o.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Te(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;Te(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?qr:(this.currentObservers=null,u.push(n),new Zt(function(){r.currentObservers=null,Se(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 R;return n.source=this,n},e.create=function(n,r){return new ni(n,r)},e}(R),ni=function(t){nt(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:qr},e}(B),ri=function(t){nt(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}(B),xn={now:function(){return(xn.delegate||Date).now()},delegate:void 0},xl=function(t){nt(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=xn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),s=0;s<u.length&&!n.closed;s+=a?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var s=i.now(),l=0,f=1;f<a.length&&a[f]<=s;f+=2)l=f;l&&a.splice(0,l+1)}},e}(B),Dl=function(t){nt(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Zt),Dn={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,pt([t,e],ft(n)))},clearInterval:function(t){var e=Dn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},wl=function(t){nt(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),Dn.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&&Dn.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,Se(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Dl),ii=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=xn.now,t}(),$l=function(t){nt(e,t);function e(n,r){r===void 0&&(r=ii.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}(ii),wn=new $l(wl),_l=wn,ai=new R(function(t){return t.complete()});function oi(t){return t&&N(t.schedule)}function $n(t){return t[t.length-1]}function Al(t){return N($n(t))?t.pop():void 0}function It(t){return oi($n(t))?t.pop():void 0}function ui(t,e){return typeof $n(t)=="number"?t.pop():e}var si=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function li(t){return N(t==null?void 0:t.then)}function ci(t){return N(t[vn])}function fi(t){return Symbol.asyncIterator&&N(t==null?void 0:t[Symbol.asyncIterator])}function pi(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 Sl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var hi=Sl();function mi(t){return N(t==null?void 0:t[hi])}function di(t){return sl(this,arguments,function(){var n,r,i,a;return Wr(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,Pt(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Pt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Pt(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 gi(t){return N(t==null?void 0:t.getReader)}function W(t){if(t instanceof R)return t;if(t!=null){if(ci(t))return Tl(t);if(si(t))return Ml(t);if(li(t))return Fl(t);if(fi(t))return yi(t);if(mi(t))return Cl(t);if(gi(t))return El(t)}throw pi(t)}function Tl(t){return new R(function(e){var n=t[vn]();if(N(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ml(t){return new R(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Fl(t){return new R(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ti)})}function Cl(t){return new R(function(e){var n,r;try{for(var i=Lt(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 yi(t){return new R(function(e){Ll(t,e).catch(function(n){return e.error(n)})})}function El(t){return yi(di(t))}function Ll(t,e){var n,r,i,a;return ul(this,void 0,void 0,function(){var o,u;return Wr(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=ll(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ht(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 bi(t,e){return e===void 0&&(e=0),X(function(n,r){n.subscribe(Y(r,function(i){return ht(r,t,function(){return r.next(i)},e)},function(){return ht(r,t,function(){return r.complete()},e)},function(i){return ht(r,t,function(){return r.error(i)},e)}))})}function vi(t,e){return e===void 0&&(e=0),X(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Pl(t,e){return W(t).pipe(vi(e),bi(e))}function Ol(t,e){return W(t).pipe(vi(e),bi(e))}function Il(t,e){return new R(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Rl(t,e){return new R(function(n){var r;return ht(n,e,function(){r=t[hi](),ht(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 N(r==null?void 0:r.return)&&r.return()}})}function xi(t,e){if(!t)throw new Error("Iterable cannot be null");return new R(function(n){ht(n,e,function(){var r=t[Symbol.asyncIterator]();ht(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Bl(t,e){return xi(di(t),e)}function kl(t,e){if(t!=null){if(ci(t))return Pl(t,e);if(si(t))return Il(t,e);if(li(t))return Ol(t,e);if(fi(t))return xi(t,e);if(mi(t))return Rl(t,e);if(gi(t))return Bl(t,e)}throw pi(t)}function Rt(t,e){return e?kl(t,e):W(t)}function Dt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It(t);return Rt(t,n)}var Di=mn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Nl(t){return t instanceof Date&&!isNaN(t)}function b(t,e){return X(function(n,r){var i=0;n.subscribe(Y(r,function(a){r.next(t.call(e,a,i++))}))})}var Vl=Array.isArray;function Gl(t,e){return Vl(e)?t.apply(void 0,pt([],ft(e))):t(e)}function Xl(t){return b(function(e){return Gl(t,e)})}var Yl=Array.isArray,Ul=Object.getPrototypeOf,zl=Object.prototype,Hl=Object.keys;function jl(t){if(t.length===1){var e=t[0];if(Yl(e))return{args:e,keys:null};if(Wl(e)){var n=Hl(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"&&Ul(t)===zl}function ql(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function M(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It(t),r=Al(t),i=jl(t),a=i.args,o=i.keys;if(a.length===0)return Rt([],n);var u=new R(Jl(a,n,o?function(s){return ql(o,s)}:Ot));return r?u.pipe(Xl(r)):u}function Jl(t,e,n){return n===void 0&&(n=Ot),function(r){wi(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,s=function(f){wi(e,function(){var c=Rt(t[f],e),p=!1;c.subscribe(Y(r,function(h){a[f]=h,p||(p=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function wi(t,e,n){t?ht(n,t,e):e()}function Zl(t,e,n,r,i,a,o,u){var s=[],l=0,f=0,c=!1,p=function(){c&&!s.length&&!l&&e.complete()},h=function(d){return l<r?m(d):s.push(d)},m=function(d){l++;var x=!1;W(n(d,f++)).subscribe(Y(e,function($){e.next($)},function(){x=!0},void 0,function(){if(x)try{l--;for(var $=function(){var S=s.shift();o||m(S)};s.length&&l<r;)$();p()}catch(S){e.error(S)}}))};return t.subscribe(Y(e,h,function(){c=!0,p()})),function(){}}function $i(t,e,n){return n===void 0&&(n=1/0),N(e)?$i(function(r,i){return b(function(a,o){return e(r,a,i,o)})(W(t(r,i)))},n):(typeof e=="number"&&(n=e),X(function(r,i){return Zl(r,i,t,n)}))}function _n(t){return t===void 0&&(t=1/0),$i(Ot,t)}function Kl(){return _n(1)}function _i(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Kl()(Rt(t,It(t)))}function Ql(t){return new R(function(e){W(t()).subscribe(e)})}function Ai(t,e,n){return Ql(function(){return t()?e:n})}function tc(t,e,n){n===void 0&&(n=_l);var r=-1;return e!=null&&(oi(e)?n=e:r=e),new R(function(i){var a=Nl(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 ec(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It(t),r=ui(t,1/0),i=t;return i.length?i.length===1?W(i[0]):_n(r)(Rt(i,n)):ai}var nc=Array.isArray;function rc(t){return t.length===1&&nc(t[0])?t[0]:t}function Si(t,e){return X(function(n,r){var i=0;n.subscribe(Y(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function ic(t,e){return e===void 0&&(e=wn),X(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function s(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(Y(r,function(l){a=l,o=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function ac(t){return X(function(e,n){var r=!1;e.subscribe(Y(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function oc(t){return t<=0?function(){return ai}:X(function(e,n){var r=0;e.subscribe(Y(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function V(t,e){return e===void 0&&(e=Ot),t=t??uc,X(function(n,r){var i,a=!0;n.subscribe(Y(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function uc(t,e){return t===e}function sc(t){return t===void 0&&(t=lc),X(function(e,n){var r=!1;e.subscribe(Y(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function lc(){return new Di}function cc(t,e){var n=arguments.length>=2;return function(r){return r.pipe(Ot,oc(1),n?ac(e):sc(function(){return new Di}))}}function fc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It(t),r=ui(t,1/0);return t=rc(t),X(function(i,a){_n(r)(Rt(pt([i],ft(t)),n)).subscribe(a)})}function pc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fc.apply(void 0,pt([],ft(t)))}function An(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new B}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,p,h=0,m=!1,d=!1,x=function(){c==null||c.unsubscribe(),c=void 0},$=function(){x(),f=p=void 0,m=d=!1},S=function(){var _=f;$(),_==null||_.unsubscribe()};return X(function(_,C){h++,!d&&!m&&x();var A=p=p??n();C.add(function(){h--,h===0&&!d&&!m&&(c=Sn(S,s))}),A.subscribe(C),!f&&h>0&&(f=new Kt({next:function(I){return A.next(I)},error:function(I){d=!0,x(),c=Sn($,i,I),A.error(I)},complete:function(){m=!0,x(),c=Sn($,o),A.complete()}}),W(_).subscribe(f))})(l)}}function Sn(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 Kt({next:function(){i.unsubscribe(),t()}});return W(e.apply(void 0,pt([],ft(n)))).subscribe(i)}}function g(t,e,n){var r,i=!1;return r=t,An({connector:function(){return new xl(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function Tn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=It(t);return X(function(r,i){(n?_i(t,r,n):_i(t,r)).subscribe(i)})}function F(t,e){return X(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(Y(r,function(s){i==null||i.unsubscribe();var l=0,f=a++;W(t(s,f)).subscribe(i=Y(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function L(t){return X(function(e,n){W(t).subscribe(Y(n,function(){return n.complete()},gn)),!n.closed&&e.subscribe(n)})}function hc(t,e){return X(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,p=!1,h=function(){c==null||c.unsubscribe(),c=null,s&&(x(),p&&r.complete())},m=function(){c=null,p&&r.complete()},d=function($){return c=W(t($)).subscribe(Y(r,h,m))},x=function(){if(l){l=!1;var $=f;f=null,r.next($),!p&&d($)}};n.subscribe(Y(r,function($){l=!0,f=$,!(c&&!c.closed)&&(o?x():d($))},function(){p=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function mc(t,e,n){e===void 0&&(e=wn);var r=tc(t,e);return hc(function(){return r},n)}function Ti(t){return new R(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const mt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new B,i=e.pipe(L(r),b(c=>({id:null,label:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),V()),a=n.pipe(L(r),Si(c=>c.eventName==="mouseover"),b(c=>{const p=c;return p.datum?{id:p.datum.id,label:p.datum.label,seriesLabel:p.datum.seriesLabel,groupLabel:p.datum.groupLabel,categoryLabel:p.datum.categoryLabel,highlightDefault:null}:{id:null,label:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null}})),o=n.pipe(L(r),Si(c=>c.eventName==="mouseout"),F(c=>i));function u(c,p,h){return p==null&&h==null?[]:c.filter(m=>m.id===p||m.label===h)}function s(c,p){return p==null?[]:c.filter(h=>h.seriesLabel===p)}function l(c,p){return p==null?[]:c.filter(h=>h.groupLabel===p)}function f(c,p){return p==null?[]:c.filter(h=>h.categoryLabel===p)}return new R(c=>(M({target:ec(a,o,i),datumList:t,fullChartParams:e}).pipe(L(r),F(async p=>p)).subscribe(p=>{let h=[];p.fullChartParams.highlightTarget==="datum"?h=u(p.datumList,p.target.id,p.target.label):p.fullChartParams.highlightTarget==="series"?h=s(p.datumList,p.target.seriesLabel):p.fullChartParams.highlightTarget==="group"?h=l(p.datumList,p.target.groupLabel):p.fullChartParams.highlightTarget==="category"&&(h=f(p.datumList,p.target.categoryLabel)),c.next(h)}),function(){r.next(void 0)}))},Fe=({datumList$:t})=>t.pipe(b(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),Mn=({datumList$:t})=>t.pipe(b(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Qt=({datumList$:t})=>t.pipe(b(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})),wt=t=>t.pipe(b(e=>e.styles.textSize),V(),b(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})),Ce=({layout$:t,containerPosition$:e,container$:n})=>{const r=e.pipe(b(a=>a.reduce((u,s)=>s.rowIndex>u?s.rowIndex:u,0)+1),V()),i=e.pipe(b(a=>a.reduce((u,s)=>s.columnIndex>u?s.columnIndex:u,0)+1),V());return M({layout:t,rowAmount:r,columnAmount:i,container:n}).pipe(F(async a=>a),b(a=>{const o=a.container.columnGap==="auto"?a.layout.left+a.layout.right:a.container.columnGap,u=a.container.rowGap==="auto"?a.layout.top+a.layout.bottom:a.container.rowGap,s=(a.layout.rootWidth-a.layout.left-a.layout.right-o*(a.columnAmount-1))/a.columnAmount,l=(a.layout.rootHeight-a.layout.top-a.layout.bottom-u*(a.rowAmount-1))/a.rowAmount;return{width:s,height:l}}),V((a,o)=>a.width===o.width&&a.height===o.height))},dc=({fullDataFormatter$:t})=>t.pipe(b(e=>e.separateSeries),V()),gc=({computedData$:t})=>t.pipe(b(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Mi=({computedData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),yc=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(F(async n=>n),b(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)]})),bc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>i.fullDataFormatter.separateSeries?pn(i.layout,i.fullDataFormatter.container,i.computedData.length):pn(i.layout,i.fullDataFormatter.container,1))),vc=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>M({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(F(async r=>r),b(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]])))),xc=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=dc({fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),i=Mi({computedData$:e.computedData$}).pipe(g(1)),a=yc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),o=Mi({computedData$:a}).pipe(g(1)),u=e.computedData$.pipe(b(h=>h.flat())).pipe(g(1)),s=mt({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),l=gc({computedData$:e.computedData$}).pipe(g(1)),f=Fe({datumList$:u}).pipe(g(1)),c=bc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),p=vc({seriesContainerPosition$:c,seriesLabels$:l,separateSeries$:r}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedSortedData$:o,separateSeries$:r,computedSortedData$:a,seriesHighlight$:s,seriesLabels$:l,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:p}},q=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=z.scaleDomain,scaleRange:i=z.scaleRange,reverse:a=!1})=>{const o=r[0]??z.scaleDomain[0],u=r[1]??z.scaleDomain[1],s=i[0]??z.scaleRange[0],l=i[1]??z.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=u==="auto"?t>=0?t:0:u==="max"?t:u;const p=t-(t-f)/(1-s),h=c/l;return a?Wt().domain([p,h]).range([n,0]):Wt().domain([p,h]).range([0,n])},Dc=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=z.scaleDomain,scaleRange:i=z.scaleRange,reverse:a=!1})=>{e===t&&(t+=1,e-=1);const o=r[0]??z.scaleDomain[0],u=r[1]??z.scaleDomain[1],s=i[0]??z.scaleRange[0],l=i[1]??z.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=u==="auto"?t>=0?t:0:u==="max"?t:u;const p=t-(t-f)/(1-s),h=c/l;return a?Wt().domain([n,0]).range([p,h]):Wt().domain([0,n]).range([p,h])},wc=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return Us().domain(t).range(r).padding(n)},$c=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((s,l)=>l);r&&i.reverse(),i.length||(i=[0]);const a=i.length-1+n*2,o=e/a,u=o*n-o*.5;return Vr().domain([u,e-u]).range(i)};function Fi(t){return`[OrbCharts ${t}]:`}function te(t){return`${Fi("error")} ${t.message}`}function Fn({from:t,systemMessage:e}){return`unexpected error from '${t}':
4
- ${e}`}function $t({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
3
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function Te(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Kt=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=Pt(o),s=u.next();!s.done;s=u.next()){var l=s.value;l.remove(this)}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(N(f))try{f()}catch(d){a=d instanceof yn?d.errors:[d]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var p=Pt(c),h=p.next();!h.done;h=p.next()){var m=h.value;try{Qr(m)}catch(d){a=a??[],d instanceof yn?a=ht(ht([],pt(a)),pt(d.errors)):a.push(d)}}}catch(d){r={error:d}}finally{try{h&&!h.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}if(a)throw new yn(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Qr(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)&&Te(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Te(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Zr=Kt.EMPTY;function Kr(t){return t instanceof Kt||t&&"closed"in t&&N(t.remove)&&N(t.add)&&N(t.unsubscribe)}function Qr(t){N(t)?t():t.unsubscribe()}var ti={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ei={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ht([t,e],pt(n)))},clearTimeout:function(t){var e=ei.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function ni(t){ei.setTimeout(function(){throw t})}function bn(){}function Me(t){t()}var vn=function(t){nt(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Kr(n)&&n.add(r)):r.destination=ml,r}return e.create=function(n,r,i){return new Qt(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}(Kt),fl=Function.prototype.bind;function xn(t,e){return fl.call(t,e)}var pl=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){Fe(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Fe(r)}else Fe(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Fe(n)}},t}(),Qt=function(t){nt(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(N(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&ti.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&xn(n.next,u),error:n.error&&xn(n.error,u),complete:n.complete&&xn(n.complete,u)}):o=n}return a.destination=new pl(o),a}return e}(vn);function Fe(t){ni(t)}function hl(t){throw t}var ml={closed:!0,next:bn,error:hl,complete:bn},Dn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function It(t){return t}function dl(t){return t.length===0?It:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var R=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=yl(e)?e:new Qt(e,n,r);return Me(function(){var o=i,u=o.operator,s=o.source;a.add(u?u.call(a,s):s?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ri(n),new n(function(i,a){var o=new Qt({next:function(u){try{e(u)}catch(s){a(s),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[Dn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return dl(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ri(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 ri(t){var e;return(e=t??ti.Promise)!==null&&e!==void 0?e:Promise}function gl(t){return t&&N(t.next)&&N(t.error)&&N(t.complete)}function yl(t){return t&&t instanceof vn||gl(t)&&Kr(t)}function bl(t){return N(t==null?void 0:t.lift)}function X(t){return function(e){if(bl(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 Y(t,e,n,r,i){return new vl(t,e,n,r,i)}var vl=function(t){nt(e,t);function e(n,r,i,a,o,u){var s=t.call(this,n)||this;return s.onFinalize=o,s.shouldUnsubscribe=u,s._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,s._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,s._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,s}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(vn),xl=gn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),B=function(t){nt(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 ii(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new xl},e.prototype.next=function(n){var r=this;Me(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Pt(r.currentObservers),u=o.next();!u.done;u=o.next()){var s=u.value;s.next(n)}}catch(l){i={error:l}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Me(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;Me(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?Zr:(this.currentObservers=null,u.push(n),new Kt(function(){r.currentObservers=null,Te(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 R;return n.source=this,n},e.create=function(n,r){return new ii(n,r)},e}(R),ii=function(t){nt(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:Zr},e}(B),ai=function(t){nt(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}(B),wn={now:function(){return(wn.delegate||Date).now()},delegate:void 0},Dl=function(t){nt(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=wn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,s=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+s)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),s=0;s<u.length&&!n.closed;s+=a?1:2)n.next(u[s]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var s=i.now(),l=0,f=1;f<a.length&&a[f]<=s;f+=2)l=f;l&&a.splice(0,l+1)}},e}(B),wl=function(t){nt(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Kt),$n={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ht([t,e],pt(n)))},clearInterval:function(t){var e=$n.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},$l=function(t){nt(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),$n.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&&$n.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,Te(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(wl),oi=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=wn.now,t}(),_l=function(t){nt(e,t);function e(n,r){r===void 0&&(r=oi.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}(oi),_n=new _l($l),Al=_n,te=new R(function(t){return t.complete()});function ui(t){return t&&N(t.schedule)}function An(t){return t[t.length-1]}function Sl(t){return N(An(t))?t.pop():void 0}function Rt(t){return ui(An(t))?t.pop():void 0}function si(t,e){return typeof An(t)=="number"?t.pop():e}var li=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function ci(t){return N(t==null?void 0:t.then)}function fi(t){return N(t[Dn])}function pi(t){return Symbol.asyncIterator&&N(t==null?void 0:t[Symbol.asyncIterator])}function hi(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 Tl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var mi=Tl();function di(t){return N(t==null?void 0:t[mi])}function gi(t){return ll(this,arguments,function(){var n,r,i,a;return Jr(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,Ot(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Ot(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ot(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 yi(t){return N(t==null?void 0:t.getReader)}function W(t){if(t instanceof R)return t;if(t!=null){if(fi(t))return Ml(t);if(li(t))return Fl(t);if(ci(t))return Cl(t);if(pi(t))return bi(t);if(di(t))return El(t);if(yi(t))return Ll(t)}throw hi(t)}function Ml(t){return new R(function(e){var n=t[Dn]();if(N(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Fl(t){return new R(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Cl(t){return new R(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ni)})}function El(t){return new R(function(e){var n,r;try{for(var i=Pt(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 bi(t){return new R(function(e){Pl(t,e).catch(function(n){return e.error(n)})})}function Ll(t){return bi(gi(t))}function Pl(t,e){var n,r,i,a;return sl(this,void 0,void 0,function(){var o,u;return Jr(this,function(s){switch(s.label){case 0:s.trys.push([0,5,6,11]),n=cl(t),s.label=1;case 1:return[4,n.next()];case 2:if(r=s.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];s.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=s.sent(),i={error:u},[3,11];case 6:return s.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:s.sent(),s.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function mt(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 vi(t,e){return e===void 0&&(e=0),X(function(n,r){n.subscribe(Y(r,function(i){return mt(r,t,function(){return r.next(i)},e)},function(){return mt(r,t,function(){return r.complete()},e)},function(i){return mt(r,t,function(){return r.error(i)},e)}))})}function xi(t,e){return e===void 0&&(e=0),X(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Ol(t,e){return W(t).pipe(xi(e),vi(e))}function Il(t,e){return W(t).pipe(xi(e),vi(e))}function Rl(t,e){return new R(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Bl(t,e){return new R(function(n){var r;return mt(n,e,function(){r=t[mi](),mt(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 N(r==null?void 0:r.return)&&r.return()}})}function Di(t,e){if(!t)throw new Error("Iterable cannot be null");return new R(function(n){mt(n,e,function(){var r=t[Symbol.asyncIterator]();mt(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function kl(t,e){return Di(gi(t),e)}function Nl(t,e){if(t!=null){if(fi(t))return Ol(t,e);if(li(t))return Rl(t,e);if(ci(t))return Il(t,e);if(pi(t))return Di(t,e);if(di(t))return Bl(t,e);if(yi(t))return kl(t,e)}throw hi(t)}function Bt(t,e){return e?Nl(t,e):W(t)}function wt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Rt(t);return Bt(t,n)}var wi=gn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Vl(t){return t instanceof Date&&!isNaN(t)}function b(t,e){return X(function(n,r){var i=0;n.subscribe(Y(r,function(a){r.next(t.call(e,a,i++))}))})}var Gl=Array.isArray;function Xl(t,e){return Gl(e)?t.apply(void 0,ht([],pt(e))):t(e)}function Yl(t){return b(function(e){return Xl(t,e)})}var Ul=Array.isArray,zl=Object.getPrototypeOf,Hl=Object.prototype,jl=Object.keys;function Wl(t){if(t.length===1){var e=t[0];if(Ul(e))return{args:e,keys:null};if(ql(e)){var n=jl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function ql(t){return t&&typeof t=="object"&&zl(t)===Hl}function Jl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function M(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Rt(t),r=Sl(t),i=Wl(t),a=i.args,o=i.keys;if(a.length===0)return Bt([],n);var u=new R(Zl(a,n,o?function(s){return Jl(o,s)}:It));return r?u.pipe(Yl(r)):u}function Zl(t,e,n){return n===void 0&&(n=It),function(r){$i(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,s=function(f){$i(e,function(){var c=Bt(t[f],e),p=!1;c.subscribe(Y(r,function(h){a[f]=h,p||(p=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)s(l)},r)}}function $i(t,e,n){t?mt(n,t,e):e()}function Kl(t,e,n,r,i,a,o,u){var s=[],l=0,f=0,c=!1,p=function(){c&&!s.length&&!l&&e.complete()},h=function(d){return l<r?m(d):s.push(d)},m=function(d){l++;var D=!1;W(n(d,f++)).subscribe(Y(e,function($){e.next($)},function(){D=!0},void 0,function(){if(D)try{l--;for(var $=function(){var S=s.shift();o||m(S)};s.length&&l<r;)$();p()}catch(S){e.error(S)}}))};return t.subscribe(Y(e,h,function(){c=!0,p()})),function(){}}function _i(t,e,n){return n===void 0&&(n=1/0),N(e)?_i(function(r,i){return b(function(a,o){return e(r,a,i,o)})(W(t(r,i)))},n):(typeof e=="number"&&(n=e),X(function(r,i){return Kl(r,i,t,n)}))}function Sn(t){return t===void 0&&(t=1/0),_i(It,t)}function Ql(){return Sn(1)}function Ai(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ql()(Bt(t,Rt(t)))}function tc(t){return new R(function(e){W(t()).subscribe(e)})}function Si(t,e,n){return tc(function(){return t()?e:n})}function ec(t,e,n){n===void 0&&(n=Al);var r=-1;return e!=null&&(ui(e)?n=e:r=e),new R(function(i){var a=Vl(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 nc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Rt(t),r=si(t,1/0),i=t;return i.length?i.length===1?W(i[0]):Sn(r)(Bt(i,n)):te}var rc=Array.isArray;function ic(t){return t.length===1&&rc(t[0])?t[0]:t}function Ti(t,e){return X(function(n,r){var i=0;n.subscribe(Y(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Ce(t){return X(function(e,n){var r=null,i=!1,a;r=e.subscribe(Y(n,void 0,void 0,function(o){a=W(t(o,Ce(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function ac(t,e){return e===void 0&&(e=_n),X(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function s(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}u()}n.subscribe(Y(r,function(l){a=l,o=e.now(),i||(i=e.schedule(s,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function oc(t){return X(function(e,n){var r=!1;e.subscribe(Y(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function uc(t){return t<=0?function(){return te}:X(function(e,n){var r=0;e.subscribe(Y(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function V(t,e){return e===void 0&&(e=It),t=t??sc,X(function(n,r){var i,a=!0;n.subscribe(Y(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function sc(t,e){return t===e}function lc(t){return t===void 0&&(t=cc),X(function(e,n){var r=!1;e.subscribe(Y(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function cc(){return new wi}function fc(t,e){var n=arguments.length>=2;return function(r){return r.pipe(It,uc(1),n?oc(e):lc(function(){return new wi}))}}function pc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Rt(t),r=si(t,1/0);return t=ic(t),X(function(i,a){Sn(r)(Bt(ht([i],pt(t)),n)).subscribe(a)})}function hc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return pc.apply(void 0,ht([],pt(t)))}function Tn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new B}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,s=u===void 0?!0:u;return function(l){var f,c,p,h=0,m=!1,d=!1,D=function(){c==null||c.unsubscribe(),c=void 0},$=function(){D(),f=p=void 0,m=d=!1},S=function(){var _=f;$(),_==null||_.unsubscribe()};return X(function(_,C){h++,!d&&!m&&D();var A=p=p??n();C.add(function(){h--,h===0&&!d&&!m&&(c=Mn(S,s))}),A.subscribe(C),!f&&h>0&&(f=new Qt({next:function(I){return A.next(I)},error:function(I){d=!0,D(),c=Mn($,i,I),A.error(I)},complete:function(){m=!0,D(),c=Mn($,o),A.complete()}}),W(_).subscribe(f))})(l)}}function Mn(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 Qt({next:function(){i.unsubscribe(),t()}});return W(e.apply(void 0,ht([],pt(n)))).subscribe(i)}}function g(t,e,n){var r,i=!1;return r=t,Tn({connector:function(){return new Dl(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=Rt(t);return X(function(r,i){(n?Ai(t,r,n):Ai(t,r)).subscribe(i)})}function F(t,e){return X(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(Y(r,function(s){i==null||i.unsubscribe();var l=0,f=a++;W(t(s,f)).subscribe(i=Y(r,function(c){return r.next(e?e(s,c,f,l++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function L(t){return X(function(e,n){W(t).subscribe(Y(n,function(){return n.complete()},bn)),!n.closed&&e.subscribe(n)})}function mc(t,e){return X(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,s=u===void 0?!1:u,l=!1,f=null,c=null,p=!1,h=function(){c==null||c.unsubscribe(),c=null,s&&(D(),p&&r.complete())},m=function(){c=null,p&&r.complete()},d=function($){return c=W(t($)).subscribe(Y(r,h,m))},D=function(){if(l){l=!1;var $=f;f=null,r.next($),!p&&d($)}};n.subscribe(Y(r,function($){l=!0,f=$,!(c&&!c.closed)&&(o?D():d($))},function(){p=!0,!(s&&l&&c&&!c.closed)&&r.complete()}))})}function dc(t,e,n){e===void 0&&(e=_n);var r=ec(t,e);return mc(function(){return r},n)}function Mi(t){return new R(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const dt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new B,i=e.pipe(L(r),b(c=>({id:null,label:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),V()),a=n.pipe(L(r),Ti(c=>c.eventName==="mouseover"),b(c=>{const p=c;return p.datum?{id:p.datum.id,label:p.datum.label,seriesLabel:p.datum.seriesLabel,groupLabel:p.datum.groupLabel,categoryLabel:p.datum.categoryLabel,highlightDefault:null}:{id:null,label:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null}})),o=n.pipe(L(r),Ti(c=>c.eventName==="mouseout"),F(c=>i));function u(c,p,h){return p==null&&h==null?[]:c.filter(m=>m.id===p||m.label===h)}function s(c,p){return p==null?[]:c.filter(h=>h.seriesLabel===p)}function l(c,p){return p==null?[]:c.filter(h=>h.groupLabel===p)}function f(c,p){return p==null?[]:c.filter(h=>h.categoryLabel===p)}return new R(c=>(M({target:nc(a,o,i),datumList:t,fullChartParams:e}).pipe(L(r),F(async p=>p)).subscribe(p=>{let h=[];p.fullChartParams.highlightTarget==="datum"?h=u(p.datumList,p.target.id,p.target.label):p.fullChartParams.highlightTarget==="series"?h=s(p.datumList,p.target.seriesLabel):p.fullChartParams.highlightTarget==="group"?h=l(p.datumList,p.target.groupLabel):p.fullChartParams.highlightTarget==="category"&&(h=f(p.datumList,p.target.categoryLabel)),c.next(h)}),function(){r.next(void 0)}))},Ee=({datumList$:t})=>t.pipe(b(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),Cn=({datumList$:t})=>t.pipe(b(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),ee=({datumList$:t})=>t.pipe(b(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})),$t=t=>t.pipe(b(e=>e.styles.textSize),V(),b(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})),Le=({layout$:t,containerPosition$:e,container$:n})=>{const r=e.pipe(b(a=>a.reduce((u,s)=>s.rowIndex>u?s.rowIndex:u,0)+1),V()),i=e.pipe(b(a=>a.reduce((u,s)=>s.columnIndex>u?s.columnIndex:u,0)+1),V());return M({layout:t,rowAmount:r,columnAmount:i,container:n}).pipe(F(async a=>a),b(a=>{const o=a.container.columnGap==="auto"?a.layout.left+a.layout.right:a.container.columnGap,u=a.container.rowGap==="auto"?a.layout.top+a.layout.bottom:a.container.rowGap,s=(a.layout.rootWidth-a.layout.left-a.layout.right-o*(a.columnAmount-1))/a.columnAmount,l=(a.layout.rootHeight-a.layout.top-a.layout.bottom-u*(a.rowAmount-1))/a.rowAmount;return{width:s,height:l}}),V((a,o)=>a.width===o.width&&a.height===o.height))},gc=({fullDataFormatter$:t})=>t.pipe(b(e=>e.separateSeries),V()),yc=({computedData$:t})=>t.pipe(b(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Fi=({computedData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),bc=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(F(async n=>n),b(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)]})),vc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>i.fullDataFormatter.separateSeries?mn(i.layout,i.fullDataFormatter.container,i.computedData.length):mn(i.layout,i.fullDataFormatter.container,1))),xc=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>M({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(F(async r=>r),b(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]])))),Dc=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=gc({fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),i=Fi({computedData$:e.computedData$}).pipe(g(1)),a=bc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),o=Fi({computedData$:a}).pipe(g(1)),u=e.computedData$.pipe(b(h=>h.flat())).pipe(g(1)),s=dt({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),l=yc({computedData$:e.computedData$}).pipe(g(1)),f=Ee({datumList$:u}).pipe(g(1)),c=vc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),p=xc({seriesContainerPosition$:c,seriesLabels$:l,separateSeries$:r}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedSortedData$:o,separateSeries$:r,computedSortedData$:a,seriesHighlight$:s,seriesLabels$:l,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:p}},q=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=z.scaleDomain,scaleRange:i=z.scaleRange,reverse:a=!1})=>{const o=r[0]??z.scaleDomain[0],u=r[1]??z.scaleDomain[1],s=i[0]??z.scaleRange[0],l=i[1]??z.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=u==="auto"?t>=0?t:0:u==="max"?t:u;const p=t-(t-f)/(1-s),h=c/l;return a?qt().domain([p,h]).range([n,0]):qt().domain([p,h]).range([0,n])},wc=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=z.scaleDomain,scaleRange:i=z.scaleRange,reverse:a=!1})=>{e===t&&(t+=1,e-=1);const o=r[0]??z.scaleDomain[0],u=r[1]??z.scaleDomain[1],s=i[0]??z.scaleRange[0],l=i[1]??z.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=u==="auto"?t>=0?t:0:u==="max"?t:u;const p=t-(t-f)/(1-s),h=c/l;return a?qt().domain([n,0]).range([p,h]):qt().domain([0,n]).range([p,h])},$c=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return zs().domain(t).range(r).padding(n)},_c=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((s,l)=>l);r&&i.reverse(),i.length||(i=[0]);const a=i.length-1+n*2,o=e/a,u=o*n-o*.5;return Xr().domain([u,e-u]).range(i)};function Ci(t){return`[OrbCharts ${t}]:`}function ot(t){return`${Ci("error")} ${t.message}`}function En({from:t,systemMessage:e}){return`unexpected error from '${t}':
4
+ ${e}`}function _t({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
5
5
 
6
- ----> find in '${n}'`}function _t({columnName:t,expectToBe:e,from:n}){return`${Fi("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
6
+ ----> find in '${n}'`}function At({columnName:t,expectToBe:e,from:n}){return`${Ci("warning")} Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
7
7
 
8
- ----> find in '${n}'`}function _c(t){return t?E(t,{width:{toBe:'"auto" | number',test:n=>n==="auto"||typeof n=="number"},height:{toBe:'"auto" | number',test:n=>n==="auto"||typeof n=="number"},preset:{toBeTypes:["object"]}}):{status:"success",columnName:"",expectToBe:""}}function Ac(t){return E({element:t},{element:{toBe:"Dom",test:n=>In(n)}})}function Sc(t,e){const n={series:["series","datum","none"],grid:["series","group","datum","none"],multiGrid:["series","group","datum","none"],multiValue:["category","datum","none"],relationship:["category","datum","none"],tree:["category","datum","none"],noneData:["none"]},r=E(e,{padding:{toBeTypes:["object"]},highlightTarget:{toBe:n[t].map(i=>`"${i}"`).join(" | "),test:i=>n[t].includes(i)},highlightDefault:{toBeTypes:["string","null"]},colorScheme:{toBe:'"dark" | "light"',test:i=>i==="dark"||i==="light"},colors:{toBeTypes:["object"],test:i=>i.light&&i.dark},styles:{toBeTypes:["object"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(e&&e.padding){const i=E(e.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(i.status==="error")return i}if(e&&e.colors){const i=E(e.colors,{light:{toBeTypes:["object"]},dark:{toBeTypes:["object"]}});if(i.status==="error")return i;if(e.colors.light){const a=E(e.colors.light,{label:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},labelContrast:{toBeTypes:["string[]"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}if(e.colors.dark){const a=E(e.colors.dark,{label:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},labelContrast:{toBeTypes:["string[]"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}}return r}function Tc(t,e){return E({pluginEntities:e},{pluginEntities:{toBe:`PluginEntity<'${t}'>[]`,test:r=>Array.isArray(r)&&r.every(i=>i.chartType===t||i.chartType==="noneData")}})}function Ci(t,e,n){const r=st(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return st(i,o)})),r}const Mc=({defaultDataFormatter:t,dataFormatterValidator:e,computedDataFn:n,dataValidator:r,contextObserverCallback:i})=>{const a=new B,o=t.type;return function(s,l){try{const{status:D,columnName:w,expectToBe:y}=_c(l);if(D==="error")throw new Error($t({columnName:w,expectToBe:y,from:"Chart.constructor"}));if(D==="warning")console.warn(_t({columnName:w,expectToBe:y,from:"Chart.constructor"}));else{const{status:T,columnName:P,expectToBe:G}=Ac(s);if(T==="error")throw new Error($t({columnName:P,expectToBe:G,from:"Chart.constructor"}));T==="warning"&&console.warn(_t({columnName:P,expectToBe:G,from:"Chart.constructor"}))}}catch(D){throw new Error(D)}oe(s).selectAll("svg").remove();const f=oe(s).append("svg");f.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 c=f.append("g");c.classed("orbcharts__layout",!0);const p=c.append("g");p.classed("orbcharts__plugins",!0);const h={data$:new B,dataFormatter$:new B,plugins$:new B,chartParams$:new B,event$:new B},m=(D=>{const w=D||ut,y=w.preset?w.preset:{};return{name:y.name??"",description:y.description??"",descriptionZh:y.descriptionZh??"",chartParams:y.chartParams?st(y.chartParams,Le):Le,dataFormatter:y.dataFormatter?Ci(y.dataFormatter,t,o):t,pluginParams:y.pluginParams?y.pluginParams:{}}})(l),d=h.data$.pipe(g(1)),x=h.dataFormatter$.pipe(L(a),Tn({}),b(D=>{try{const{status:w,columnName:y,expectToBe:T}=e(D);if(w==="error")throw new Error($t({columnName:y,expectToBe:T,from:"Chart.dataFormatter$"}));w==="warning"&&console.warn(_t({columnName:y,expectToBe:T,from:"Chart.dataFormatter$"}))}catch(w){console.error(te(w))}try{return Ci(D,m.dataFormatter,o)}catch(w){throw new Error(Fn({from:"Chart.dataFormatter$",systemMessage:w}))}}),g(1)),$=h.chartParams$.pipe(L(a),Tn({}),b(D=>{try{const{status:w,columnName:y,expectToBe:T}=Sc(o,D);if(w==="error")throw new Error($t({columnName:y,expectToBe:T,from:"Chart.chartParams$"}));w==="warning"&&console.warn(_t({columnName:y,expectToBe:T,from:"Chart.chartParams$"}))}catch(w){console.error(te(w))}try{return st(D,m.chartParams)}catch(w){throw new Error(Fn({from:"Chart.chartParams$",systemMessage:w}))}}),g(1)),S=$.pipe(L(a),Tn({}),b(D=>st(D.padding??{},Ee)));S.pipe(L(a),cc()).subscribe(D=>{c.attr("transform",`translate(${D.left}, ${D.top})`)}),S.subscribe(D=>{c.transition().attr("transform",`translate(${D.left}, ${D.top})`)});const _=Dt({width:(l==null?void 0:l.width)??ut.width,height:(l==null?void 0:l.height)??ut.height}).pipe(F(D=>Ai(()=>D.width==="auto"||D.height==="auto",Ti(s).pipe(b(w=>({width:D.width==="auto"?w.width:D.width,height:D.height==="auto"?w.height:D.height}))),Dt(D))),L(a),An()),C=Dt().pipe(pc(_.pipe(ic(250)),_.pipe(mc(250))),V((D,w)=>JSON.stringify(D)===JSON.stringify(w)),An()),A=C.subscribe(),I=M({rootSize:C,mergedPadding:S}).pipe(L(a),F(async D=>{const w=D.rootSize.width>0?D.rootSize.width:En,y=D.rootSize.height>0?D.rootSize.height:Ln;return{width:w-D.mergedPadding.left-D.mergedPadding.right,height:y-D.mergedPadding.top-D.mergedPadding.bottom,top:D.mergedPadding.top,right:D.mergedPadding.right,bottom:D.mergedPadding.bottom,left:D.mergedPadding.left,rootWidth:w,rootHeight:y}}),g(1));I.subscribe(D=>{f.attr("width",D.rootWidth).attr("height",D.rootHeight)});const O=M({data:d,dataFormatter:x,chartParams:$}).pipe(L(a),F(async D=>D),F(D=>Dt(D).pipe(b(w=>{try{const{status:y,columnName:T,expectToBe:P}=r(w.data);if(y==="error")throw new Error($t({columnName:T,expectToBe:P,from:"Chart.data$"}));y==="warning"&&console.warn(_t({columnName:T,expectToBe:P,from:"Chart.data$"}))}catch(y){console.error(te(y))}try{return n({data:w.data,dataFormatter:w.dataFormatter,chartParams:w.chartParams})}catch(y){throw new Error(Fn({from:"Chart.data$",systemMessage:y}))}}))),g(1));O.subscribe();const k={};return h.plugins$.subscribe(D=>{try{const{status:w,columnName:y,expectToBe:T}=Tc(o,D);if(w==="error")throw new Error($t({columnName:y,expectToBe:T,from:"Chart.plugins$"}));w==="warning"&&console.warn(_t({columnName:y,expectToBe:T,from:"Chart.plugins$"}))}catch(w){throw new Error(w)}p.selectAll("g.orbcharts__plugin").data(D,w=>w.name).join(w=>w.append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`).each((y,T,P)=>{const G={fullParams$:new R,fullChartParams$:$,fullDataFormatter$:x,computedData$:O,layout$:I},dt=i({observer:G,subject:h}),rt={selection:oe(P[T]),rootSelection:f,name:y.name,chartType:o,subject:h,observer:dt};y.setPresetParams(m.pluginParams[y.name]??{}),y.setContext(rt),k[rt.name]=y,y.init()}),w=>w,w=>w.each((y,T,P)=>{k[y.name]&&(k[y.name].destroy(),k[y.name]=void 0)}).remove()).sort((w,y)=>w.layerIndex-y.layerIndex)}),{...h,selection:f,destroy(){oe(s).selectAll("svg").remove(),a.next(void 0),A.unsubscribe()}}}};class Bt{constructor({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a},o,u){this.data$=new B,this.dataFormatter$=new B,this.plugins$=new B,this.chartParams$=new B,this.event$=new B;try{const l=Mc({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a})(o,u);this.selection=l.selection,this.destroy=l.destroy,this.data$=l.data$,this.dataFormatter$=l.dataFormatter$,this.plugins$=l.plugins$,this.chartParams$=l.chartParams$,this.event$=l.event$}catch(s){console.error(te(s))}}}class Fc extends Bt{constructor(e,n){super({defaultDataFormatter:Oe,dataFormatterValidator:Qi,computedDataFn:al,dataValidator:ol,contextObserverCallback:xc},e,n)}}const Cc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},seriesDirection:{toBe:'"row" | "column"',test:n=>n==="row"||n==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(e.status==="error")return e;if(t.valueAxis){const n=E(t.valueAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(t.groupAxis){const n=E(t.groupAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&(typeof r[1]=="number"||r[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e};function Ei(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 s=Object.assign([],o);for(let l=s.length;l<n;l++)s[l]=null;return s}).map((o,u)=>o.map((s,l)=>s==null?{id:"",label:"",data:{},value:null}:typeof s=="number"?{id:"",label:"",data:{},value:s}:{id:s.id??"",label:s.label??"",data:s.data??{},value:s.value}));return Hr(e.seriesDirection,i)}catch{return[]}}const Ec=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=Ei(e,n),o=cn({transposedDataGrid:a,dataFormatterGrid:n,chartType:"grid"}),u=Yr({transposedDataGrid:a,dataFormatterGrid:n,chartType:"grid"});let s=0;i=a.map((l,f)=>l.map((c,p)=>{const h=Jt("grid",0,f,p),m=u[p],d={id:c.id?c.id:h,index:s,label:c.label?c.label:h,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:p,groupLabel:m,color:ct(f,r),visible:!0};return d.visible=n.visibleFilter(d,t),s++,d}))}catch(a){throw Error(a)}return i},Lc=t=>E({data:t},{data:{toBe:"(DataGridDatum | DataGridValue)[][]",test:n=>Array.isArray(n)}}),Li=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,u){const s=o.groupAxis.position==="top"||o.groupAxis.position==="bottom"?u.width:u.height,l=a[0]?a[0].length-1:0;return q({maxValue:l,minValue:0,axisWidth:s,scaleDomain:[0,l],scaleRange:[0,1]})}function i(a,o,u){const s=o.valueAxis.position==="left"||o.valueAxis.position==="right"?u.height:u.width,l=a.flat();let[f,c]=zr(l);return f===c&&c===0&&(c=1),q({maxValue:c,minValue:f,axisWidth:s,scaleDomain:["auto","auto"],scaleRange:[0,1]})}return M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async a=>a),b(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),u=i(a.computedData,a.fullDataFormatter,a.layout),s=u(0);return a.computedData.map((l,f)=>l.map((c,p)=>{const h=o(p),m=u(c.value??0);return{...c,axisX:h,axisY:m,axisYFromZero:m-s}}))}))},Cn=({fullDataFormatter$:t,layout$:e})=>{const n=new B;function r({xAxisPosition:o,yAxisPosition:u,width:s,height:l}){return(o==="bottom"||o==="top")&&(u==="left"||u==="right")?{width:s,height:l}:(o==="left"||o==="right")&&(u==="bottom"||u==="top")?{width:l,height:s}:{width:s,height:l}}const i=t.pipe(b(o=>o.groupAxis.position),V()),a=t.pipe(b(o=>o.valueAxis.position),V());return new R(o=>{M({groupAxisPosition:i,valueAxisPosition:a,layout:e}).pipe(L(n),F(async u=>u)).subscribe(u=>{const s=r({xAxisPosition:u.groupAxisPosition,yAxisPosition:u.valueAxisPosition,width:u.layout.width,height:u.layout.height});return o.next(s),function(){n.next(void 0)}})})},Pi=({fullDataFormatter$:t,containerSize$:e})=>Cn({fullDataFormatter$:t,layout$:e}),Oi=({computedData$:t})=>t.pipe(b(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Ii=({computedData$:t})=>t.pipe(b(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Ri=({computedAxesData$:t})=>t.pipe(b(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Pc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateSeries)return Et(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Et(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,u)=>a[0])}})),Bi=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(b(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((o,u)=>r.reduce((s,l)=>{if(l&&l[u]){const f=l[u].value==null||l[u].visible==!1?0:l[u].value;return s+f}return s},0));return r.map((o,u)=>o.map((s,l)=>({...s,value:i[l]})))}));return t.pipe(F(r=>Ai(()=>r,e,n)))},ki=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(F(async n=>n),b(n=>{const r=n.fullDataFormatter.groupAxis,i=n.computedData[0]?n.computedData[0].length-1:0,a=r.scaleDomain[0]-r.scalePadding,o=r.scaleDomain[1]==="max"?i+r.scalePadding:r.scaleDomain[1]+r.scalePadding;return[a,o]})),Ni=({computedData$:t,groupScaleDomainValue$:e})=>M({computedData:t,groupScaleDomainValue:e}).pipe(b(n=>{const r=n.computedData.map((a,o)=>a.filter((u,s)=>s>=n.groupScaleDomainValue[0]&&s<=n.groupScaleDomainValue[1]&&u.visible==!0));return fn(r)})),Vi=({fullDataFormatter$:t,layout$:e})=>{const n=new B;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 s=0,l=0,f=0,c=0,p=0;return i.position==="bottom"?a.position==="left"?(c=180,l=u):a.position==="right"?(c=180,p=180,s=o,l=u):(c=180,l=u):i.position==="top"?a.position==="left"||(a.position==="right"?(p=180,s=o):(c=180,l=u)):i.position==="left"?a.position==="bottom"?(f=-90,l=u):a.position==="top"?(f=-90,p=180):(c=180,l=u):i.position==="right"?a.position==="bottom"?(f=-90,c=180,l=u,s=o):a.position==="top"?(f=-90,c=180,p=180,s=o):(c=180,l=u):(c=180,l=u),{translate:[s,l],scale:[1,1],rotate:f,rotateX:c,rotateY:p,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${p}deg)`}}return new R(i=>(M({fullDataFormatter:t,layout:e}).pipe(L(n),F(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.groupAxis,yAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},Gi=({gridAxesTransform$:t})=>t.pipe(b(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) rotateX(${a}deg) rotateY(${o}deg) rotate(${i}deg)`}})),Xi=({computedData$:t,groupScaleDomainValue$:e,filteredMinMaxValue$:n,fullDataFormatter$:r,layout$:i})=>{const a=new B;function o({data:u,groupAxis:s,valueAxis:l,groupScaleDomainValue:f,filteredMinMaxValue:c,width:p,height:h}){let m=0,d=0,x=0,$=0;const S=s.position==="top"||s.position==="bottom"?p:h,_=0,C=u[0]?u[0].length-1:0,A=q({maxValue:C,minValue:_,axisWidth:S,scaleDomain:f,scaleRange:[0,1]}),I=A(_),O=A(C);_==C?(m=0,x=1):(m=I,x=(O-I)/S),c[0]===c[1]&&c[1]===0&&(c[1]=1);const k=l.position==="left"||l.position==="right"?h:p,D=q({maxValue:c[1],minValue:c[0],axisWidth:k,scaleDomain:l.scaleDomain,scaleRange:l.scaleRange}),w=fn(u);w[0]===w[1]&&w[1]===0&&(w[1]=1);const y=D(w[0]>0?0:w[0]),T=D(w[1]<0?0:w[1]);return d=y,$=(T-y)/k,{translate:[m,d],scale:[x,$],rotate:0,rotateX:0,rotateY:0,value:`translate(${m}px, ${d}px) scale(${x}, ${$})`}}return new R(u=>(M({computedData:t,groupScaleDomainValue:e,filteredMinMaxValue:n,fullDataFormatter:r,layout:i}).pipe(L(a),F(async s=>s)).subscribe(s=>{const l=o({data:s.computedData,groupAxis:s.fullDataFormatter.groupAxis,valueAxis:s.fullDataFormatter.valueAxis,groupScaleDomainValue:s.groupScaleDomainValue,filteredMinMaxValue:s.filteredMinMaxValue,width:s.layout.width,height:s.layout.height});u.next(l)}),function(){a.next(void 0)}))},Yi=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>M({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(F(async r=>r),b(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]]))),Oc=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=e.fullDataFormatter$.pipe(b(O=>O.separateSeries),V(),g(1)),i=Pc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),a=Ce({layout$:e.layout$,containerPosition$:i,container$:e.fullDataFormatter$.pipe(b(O=>O.container))}).pipe(g(1)),o=Cn({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),u=Pi({fullDataFormatter$:e.fullDataFormatter$,containerSize$:a}).pipe(g(1)),s=e.computedData$.pipe(b(O=>O.flat())).pipe(g(1)),l=mt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),f=Oi({computedData$:e.computedData$}),c=Fe({datumList$:s}).pipe(g(1)),p=Mn({datumList$:s}).pipe(g(1)),h=Li({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),m=Ii({computedData$:e.computedData$}).pipe(g(1)),d=Ri({computedAxesData$:h}).pipe(g(1)),x=Bi({computedData$:e.computedData$,isSeriesSeprate$:r}).pipe(g(1)),$=ki({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),S=Ni({computedData$:e.computedData$,groupScaleDomainValue$:$}).pipe(g(1)),_=Vi({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),C=Gi({gridAxesTransform$:_}).pipe(g(1)),A=Xi({computedData$:e.computedData$,groupScaleDomainValue$:$,filteredMinMaxValue$:S,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),I=Yi({gridContainerPosition$:i,gridAxesTransform$:_,gridGraphicTransform$:A}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isSeriesSeprate$:r,gridContainerPosition$:i,containerSize$:a,gridAxesSize$:o,gridAxesContainerSize$:u,gridHighlight$:l,seriesLabels$:f,SeriesDataMap$:c,GroupDataMap$:p,computedAxesData$:h,visibleComputedData$:m,visibleComputedAxesData$:d,computedStackedData$:x,groupScaleDomainValue$:$,filteredMinMaxValue$:S,gridAxesTransform$:_,gridAxesReverseTransform$:C,gridGraphicTransform$:A,gridGraphicReverseScale$:I}};class Ic extends Bt{constructor(e,n){super({defaultDataFormatter:Re,dataFormatterValidator:Cc,computedDataFn:Ec,dataValidator:Lc,contextObserverCallback:Oc},e,n)}}const Rc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},gridList:{toBeTypes:["object[]"]},container:{toBeTypes:["object"]},separateGrid:{toBeTypes:["boolean"]}});if(t.gridList){const r=t.gridList.map((i,a)=>{const o=E(i,{seriesDirection:{toBe:'"row" | "column"',test:u=>u==="row"||u==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(o.status==="error")return o;if(i.valueAxis){const u=E(i.valueAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:s=>s==="top"||s==="bottom"||s==="left"||s==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:s=>Array.isArray(s)&&s.length===2&&(typeof s[0]=="number"||s[0]==="min"||s[0]==="auto")&&(typeof s[1]=="number"||s[1]==="max"||s[1]==="auto")},scaleRange:{toBe:"[number, number]",test:s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"},label:{toBeTypes:["string"]}});if(u.status==="error")return u}else if(i.groupAxis){const u=E(i.groupAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:s=>s==="top"||s==="bottom"||s==="left"||s==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&(typeof s[1]=="number"||s[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(u.status==="error")return u}return{status:"success",columnName:"",expectToBe:""}}).find(i=>i.status==="error");if(r)return r}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e},Bc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||Nt,o=e.map((c,p)=>n.gridList[p]||a),u=e.map((c,p)=>Ei(c,o[p])),s=n.separateGrid?u.map((c,p)=>cn({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid"})):u.map((c,p)=>Xr({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid",gridIndex:p})),l=new Map;let f=0;s.flat().forEach((c,p)=>{if(!l.has(c)){const h=ct(f,r);l.set(c,h),f++}}),i=u.map((c,p)=>{const h=s[p],m=Ur({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid",gridIndex:p});let d=0;return c.map(($,S)=>$.map((_,C)=>{const A=Jt("multiGrid",p,S,C),I=m[C],O=h[S],k={id:_.id?_.id:A,index:d,label:_.label?_.label:A,description:_.description??"",data:_.data,value:_.value,gridIndex:p,seriesIndex:S,seriesLabel:O,groupIndex:C,groupLabel:I,color:l.get(O),visible:!0};return k.visible=n.visibleFilter(k,t),d++,k}))})}catch(a){throw Error(a)}return i},kc=t=>E({data:t},{data:{toBe:"DataGrid[]",test:n=>Array.isArray(n)}}),Nc=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i,containerSize$:a})=>{const o=new B,u=Ui({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(g(1));return M({fullDataFormatter:t,computedData:e,multiGridContainer:u}).pipe(F(async s=>s),b(s=>{o.next(void 0);const l=s.fullDataFormatter.gridList[0]??Nt;return s.computedData.map((f,c)=>{const p=s.fullDataFormatter.gridList[c]??l,h={type:"grid",visibleFilter:s.fullDataFormatter.visibleFilter,...p,container:{...s.fullDataFormatter.container}},m=Dt(h).pipe(L(o),g(1)),d=Dt(f).pipe(L(o),g(1)),x=m.pipe(b(gt=>gt.separateSeries),V(),g(1)),$=Dt(s.multiGridContainer[c]).pipe(L(o),g(1)),S=Cn({fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),_=Pi({fullDataFormatter$:m,containerSize$:a}).pipe(g(1)),C=d.pipe(b(gt=>gt.flat())).pipe(L(o),g(1)),A=Oi({computedData$:d}).pipe(L(o),g(1)),I=Fe({datumList$:C}).pipe(L(o),g(1)),O=Mn({datumList$:C}).pipe(L(o),g(1)),k=Ii({computedData$:d}).pipe(L(o),g(1)),D=Li({computedData$:d,fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),w=Ri({computedAxesData$:D}).pipe(L(o),g(1)),y=Bi({computedData$:d,isSeriesSeprate$:x}).pipe(g(1)),T=ki({computedData$:d,fullDataFormatter$:m}).pipe(L(o),g(1)),P=Ni({computedData$:d,groupScaleDomainValue$:T}).pipe(L(o),g(1)),G=Vi({fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),dt=Gi({gridAxesTransform$:G}).pipe(L(o),g(1)),Q=Xi({computedData$:d,groupScaleDomainValue$:T,filteredMinMaxValue$:P,fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),rt=Yi({gridContainerPosition$:$,gridAxesTransform$:G,gridGraphicTransform$:Q});return{isSeriesSeprate$:x,gridContainerPosition$:$,gridAxesSize$:S,gridAxesContainerSize$:_,seriesLabels$:A,SeriesDataMap$:I,GroupDataMap$:O,dataFormatter$:m,computedData$:d,computedAxesData$:D,visibleComputedData$:k,visibleComputedAxesData$:w,computedStackedData$:y,groupScaleDomainValue$:T,filteredMinMaxValue$:P,gridAxesTransform$:G,gridAxesReverseTransform$:dt,gridGraphicTransform$:Q,gridGraphicReverseScale$:rt}})}))},Ui=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async r=>r),b(r=>{const i=r.fullDataFormatter.gridList[0]??Nt,a=r.computedData.reduce((l,f,c)=>{const h=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return l+h},0)||1,o=Et(r.layout,r.fullDataFormatter.container,a);let u=0;return r.computedData.map((l,f)=>{const c=r.fullDataFormatter.gridList[f]??i,p=l.map((h,m)=>{const d=o[u];return c.separateSeries&&(u+=1),d});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(u+=1),p})})),Vc=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=Ui({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),i=Ce({layout$:e.layout$,containerPosition$:r.pipe(b(u=>u.flat())),container$:e.fullDataFormatter$.pipe(b(u=>u.container))}).pipe(g(1)),a=mt({datumList$:e.computedData$.pipe(b(u=>u.flat().flat()),g(1)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),o=Nc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$,containerSize$:i}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,containerSize$:i,multiGridHighlight$:a,multiGridContainerPosition$:r,multiGridEachDetail$:o}};class Gc extends Bt{constructor(e,n){super({defaultDataFormatter:Be,dataFormatterValidator:Rc,computedDataFn:Bc,dataValidator:kc,contextObserverCallback:Vc},e,n)}}const Xc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},categoryLabels:{toBeTypes:["string[]"]},valueLabels:{toBeTypes:["string[]"]},xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]},separateCategory:{toBeTypes:["boolean"]}});if(e.status==="error")return e;if(t.yAxis){const n=E(t.yAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]},valueIndex:{toBeTypes:["number"]}});if(n.status==="error")return n}if(t.xAxis){const n=E(t.xAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]},valueIndex:{toBeTypes:["number"]}});if(n.status==="error")return n}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e},Yc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=Ae();let a=[];try{const o=e.map((l,f)=>Array.isArray(l)?{id:"",label:"",description:"",data:{},categoryLabel:i,value:l}:U(l)?{id:l.id??"",label:l.label??"",description:l.description??"",data:l.data??{},categoryLabel:l.categoryLabel??i,value:l.value}:{id:"",label:"",description:"",data:{},categoryLabel:i,value:[]}),u=(()=>{const l=new Set(n.categoryLabels);for(let f of o){const c=f.categoryLabel??i;l.add(c)}return Array.from(l)})(),s=new Map(u.map((l,f)=>[l,f]));o.forEach((l,f)=>{const c=Jt(n.type,f),p=s.get(l.categoryLabel)??0,h=ct(p,r),m={id:l.id?l.id:c,index:f,label:l.label?l.label:c,description:l.description??"",data:l.data,value:l.value,categoryIndex:p,categoryLabel:l.categoryLabel,xValueIndex:n.xAxis.valueIndex,yValueIndex:n.yAxis.valueIndex,visible:!0,color:h};m.visible=n.visibleFilter(m,t),a[p]||(a[p]=[]),a[p].push(m)})}catch(o){throw Error(o)}return a},Uc=t=>E({data:t},{data:{toBe:"(DataMultiValueDatum | DataMultiValueValue[])[]",test:n=>Array.isArray(n)}}),zc=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(b(n=>n.computedData[0]&&n.computedData[0][0]&&n.computedData[0][0].value.length?n.computedData[0][0].value.map((r,i)=>n.fullDataFormatter.valueLabels[i]??Gr("multiValue",i)):[])),Hc=({computedData$:t,xyValueIndex$:e})=>M({computedData:t,xyValueIndex:e}).pipe(b(n=>{const r=n.computedData.flat(),[i,a]=lt(r.map(s=>s.value[n.xyValueIndex[0]])),[o,u]=lt(r.map(s=>s.value[n.xyValueIndex[1]]));return{minX:i,maxX:a,minY:o,maxY:u}})),jc=({computedData$:t,xyMinMax$:e,xyValueIndex$:n,fullDataFormatter$:r,layout$:i})=>{function a(u,s){let l=u.maxX,f=u.minX;return f===l&&l===0&&(l=1),q({maxValue:l,minValue:f,axisWidth:s.width,scaleDomain:["auto","auto"],scaleRange:[0,1]})}function o(u,s){let l=u.maxY,f=u.minY;return f===l&&l===0&&(l=1),q({maxValue:l,minValue:f,axisWidth:s.height,scaleDomain:["auto","auto"],scaleRange:[0,1],reverse:!0})}return M({computedData:t,xyMinMax:e,xyValueIndex:n,fullDataFormatter:r,layout:i}).pipe(F(async u=>u),b(u=>{const s=a(u.xyMinMax,u.layout),l=o(u.xyMinMax,u.layout);return u.computedData.map((f,c)=>f.map((p,h)=>({...p,axisX:s(p.value[u.xyValueIndex[0]]??0),axisY:l(p.value[u.xyValueIndex[1]]??0)})))}))},Wc=({computedData$:t,fullDataFormatter$:e})=>t.pipe(b(n=>n.map(r=>r[0]?r[0].categoryLabel:"")),V((n,r)=>JSON.stringify(n).length===JSON.stringify(r).length)),qc=({computedData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),Jc=({visibleComputedData$:t,fullDataFormatter$:e})=>M({visibleComputedData:t,fullDataFormatter:e}).pipe(b(n=>{let r=n.visibleComputedData[0]&&n.visibleComputedData[0][0]&&n.visibleComputedData[0][0].value.length?n.visibleComputedData[0][0].value.length-1:0;return[n.fullDataFormatter.xAxis.scaleDomain[0]==="auto"||n.fullDataFormatter.xAxis.scaleDomain[0]==="min"?0:n.fullDataFormatter.xAxis.scaleDomain[0],n.fullDataFormatter.xAxis.scaleDomain[1]==="auto"||n.fullDataFormatter.xAxis.scaleDomain[1]==="max"?r:n.fullDataFormatter.xAxis.scaleDomain[1]]}),V((n,r)=>n[0]===r[0]&&n[1]===r[1])),Zc=({visibleComputedData$:t,ordinalScaleDomain$:e})=>M({visibleComputedData:t,ordinalScaleDomain:e}).pipe(b(n=>n.visibleComputedData.map(r=>r.map((i,a)=>{let o=i;return o.sum=o.value.filter((u,s)=>s>=n.ordinalScaleDomain[0]&&s<=n.ordinalScaleDomain[1]).reduce((u,s)=>u+s,0),o})))),Kc=({xyValueIndex$:t,isCategorySeprate$:e,visibleComputedData$:n})=>M({isCategorySeprate:e,xyValueIndex:t,visibleComputedData:n}).pipe(F(async r=>r),b(r=>{const i=r.xyValueIndex[0];return r.isCategorySeprate?r.visibleComputedData.map(a=>a.sort((o,u)=>{const s=u.value[i]??-1/0,l=o.value[i]??-1/0;return s-l})):[r.visibleComputedData.flat().sort((a,o)=>{const u=o.value[i]??-1/0,s=a.value[i]??-1/0;return u-s})]})),Qc=({isCategorySeprate$:t,visibleComputedSumData$:e})=>M({isCategorySeprate:t,visibleComputedSumData:e}).pipe(F(async n=>n),b(n=>n.isCategorySeprate?n.visibleComputedSumData.map(r=>r.sort((i,a)=>a.sum-i.sum)):[n.visibleComputedSumData.flat().sort((r,i)=>i.sum-r.sum)])),tf=({computedXYData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),ef=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateCategory)return Et(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Et(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,u)=>a[0])}})),nf=({visibleComputedXYData$:t,xyMinMax$:e,xyValueIndex$:n,fullDataFormatter$:r})=>M({visibleComputedXYData:t,xyMinMax:e,xyValueIndex:n,fullDataFormatter:r}).pipe(b(i=>{const{minX:a,maxX:o,minY:u,maxY:s}=(()=>{let{minX:m,maxX:d,minY:x,maxY:$}=i.xyMinMax;return i.fullDataFormatter.xAxis.scaleDomain[0]==="auto"&&m>0?m=0:typeof i.fullDataFormatter.xAxis.scaleDomain[0]=="number"&&(m=i.fullDataFormatter.xAxis.scaleDomain[0]),i.fullDataFormatter.xAxis.scaleDomain[1]==="auto"&&d<0?d=0:typeof i.fullDataFormatter.xAxis.scaleDomain[1]=="number"&&(d=i.fullDataFormatter.xAxis.scaleDomain[1]),i.fullDataFormatter.yAxis.scaleDomain[0]==="auto"&&x>0?x=0:typeof i.fullDataFormatter.yAxis.scaleDomain[0]=="number"&&(x=i.fullDataFormatter.yAxis.scaleDomain[0]),i.fullDataFormatter.yAxis.scaleDomain[1]==="auto"&&$<0?$=0:typeof i.fullDataFormatter.yAxis.scaleDomain[1]=="number"&&($=i.fullDataFormatter.yAxis.scaleDomain[1]),{minX:m,maxX:d,minY:x,maxY:$}})();let l=[],f=null,c=null,p=null,h=null;for(let m of i.visibleComputedXYData)for(let d of m){const x=d.value[i.xyValueIndex[0]],$=d.value[i.xyValueIndex[1]];x>=a&&x<=o&&$>=u&&$<=s&&(l.push(d),(f==null||x<f.value[i.xyValueIndex[0]])&&(f=d),(c==null||x>c.value[i.xyValueIndex[0]])&&(c=d),(p==null||$<p.value[i.xyValueIndex[1]])&&(p=d),(h==null||$>h.value[i.xyValueIndex[1]])&&(h=d))}return{datumList:l,minXDatum:f,maxXDatum:c,minYDatum:p,maxYDatum:h}})),rf=({xyMinMax$:t,xyValueIndex$:e,filteredXYMinMaxData$:n,fullDataFormatter$:r,layout$:i})=>{const a=new B;function o({xyMinMax:u,xyValueIndex:s,filteredXYMinMaxData:l,xAxis:f,yAxis:c,width:p,height:h}){let m=0,d=0,x=0,$=0,{minX:S,maxX:_,minY:C,maxY:A}=u,I=l.minXDatum.value[s[0]]??0,O=l.maxXDatum.value[s[0]]??0,k=l.minYDatum.value[s[1]]??0,D=l.maxYDatum.value[s[1]]??0;I===O&&O===0&&(O=1),k===D&&D===0&&(D=1),S===_&&_===0&&(_=1),C===A&&A===0&&(A=1);const w=q({maxValue:O,minValue:I,axisWidth:p,scaleDomain:f.scaleDomain,scaleRange:f.scaleRange}),y=w(S>0?0:S),T=w(_<0?0:_);m=y,x=(T-y)/p;const G=q({maxValue:D,minValue:k,axisWidth:h,scaleDomain:c.scaleDomain,scaleRange:c.scaleRange,reverse:!0}),dt=G(C>0?0:C),Q=G(A<0?0:A);return d=Q,$=(dt-Q)/h,{translate:[m,d],scale:[x,$],rotate:0,rotateX:0,rotateY:0,value:`translate(${m}px, ${d}px) scale(${x}, ${$})`}}return new R(u=>(M({xyMinMax:t,xyValueIndex:e,filteredXYMinMaxData:n,fullDataFormatter:r,layout:i}).pipe(L(a),F(async s=>s)).subscribe(s=>{if(!s.filteredXYMinMaxData.minXDatum||!s.filteredXYMinMaxData.maxXDatum||s.filteredXYMinMaxData.minXDatum.value[s.xyValueIndex[0]]==null||s.filteredXYMinMaxData.maxXDatum.value[s.xyValueIndex[0]]==null||!s.filteredXYMinMaxData.minYDatum||!s.filteredXYMinMaxData.maxYDatum||s.filteredXYMinMaxData.minYDatum.value[s.xyValueIndex[1]]==null||s.filteredXYMinMaxData.maxYDatum.value[s.xyValueIndex[1]]==null)return;const l=o({xyMinMax:s.xyMinMax,xyValueIndex:s.xyValueIndex,filteredXYMinMaxData:s.filteredXYMinMaxData,xAxis:s.fullDataFormatter.xAxis,yAxis:s.fullDataFormatter.yAxis,width:s.layout.width,height:s.layout.height});u.next(l)}),function(){a.next(void 0)}))},af=({containerPosition$:t,graphicTransform$:e})=>M({containerPosition:t,graphicTransform:e}).pipe(F(async n=>n),b(n=>n.containerPosition.map((r,i)=>[1/n.graphicTransform.scale[0]/n.containerPosition[i].scale[0],1/n.graphicTransform.scale[1]/n.containerPosition[i].scale[1]]))),of=({visibleComputedSumData$:t,fullDataFormatter$:e,filteredXYMinMaxData$:n,containerSize$:r})=>M({visibleComputedSumData:t,fullDataFormatter:e,containerSize:r,filteredXYMinMaxData:n}).pipe(F(async i=>i),b(i=>{const a=i.fullDataFormatter.xAxis.valueIndex;if(!i.filteredXYMinMaxData.minXDatum||!i.filteredXYMinMaxData.maxXDatum)return;let o=i.filteredXYMinMaxData.maxXDatum.value[a],u=i.filteredXYMinMaxData.minXDatum.value[a];return o===u&&o===0&&(o=1),q({maxValue:o,minValue:u,axisWidth:i.containerSize.width,scaleDomain:i.fullDataFormatter.xAxis.scaleDomain,scaleRange:i.fullDataFormatter.xAxis.scaleRange})})),uf=({fullDataFormatter$:t,filteredXYMinMaxData$:e,containerSize$:n})=>M({fullDataFormatter:t,containerSize:n,filteredXYMinMaxData:e}).pipe(F(async r=>r),b(r=>{const i=r.fullDataFormatter.yAxis.valueIndex;if(!r.filteredXYMinMaxData.minYDatum||!r.filteredXYMinMaxData.maxYDatum||r.filteredXYMinMaxData.minYDatum.value[i]==null||r.filteredXYMinMaxData.maxYDatum.value[i]==null)return;let a=r.filteredXYMinMaxData.maxYDatum.value[i],o=r.filteredXYMinMaxData.minYDatum.value[i];return a===o&&a===0&&(a=1),q({maxValue:a,minValue:o,axisWidth:r.containerSize.height,scaleDomain:r.fullDataFormatter.yAxis.scaleDomain,scaleRange:r.fullDataFormatter.yAxis.scaleRange,reverse:!0})})),sf=({ordinalScaleDomain$:t,computedData$:e,containerSize$:n})=>M({ordinalScaleDomain:t,containerSize:n,computedData:e}).pipe(F(async r=>r),b(r=>{r.computedData[0]&&r.computedData[0][0]&&r.computedData[0][0].value.length&&r.computedData[0][0].value.length-1;let i=r.containerSize.width;const a=r.ordinalScaleDomain[1]-r.ordinalScaleDomain[0];return a>=1?i/(a+1)/2:0})),lf=({ordinalScaleDomain$:t,computedData$:e,containerSize$:n,ordinalPadding$:r})=>M({ordinalScaleDomain:t,computedData:e,containerSize:n,ordinalPadding:r}).pipe(F(async i=>i),b(i=>{let a=i.computedData[0]&&i.computedData[0][0]&&i.computedData[0][0].value.length?i.computedData[0][0].value.length-1:0,o=0,u=i.containerSize.width-i.ordinalPadding*2;return q({maxValue:a,minValue:o,axisWidth:u,scaleDomain:i.ordinalScaleDomain,scaleRange:[0,1]})})),cf=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=e.fullDataFormatter$.pipe(b(y=>y.separateCategory),V(),g(1)),i=ef({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),a=Ce({layout$:e.layout$,containerPosition$:i,container$:e.fullDataFormatter$.pipe(b(y=>y.container))}).pipe(g(1)),o=e.fullDataFormatter$.pipe(b(y=>[y.xAxis.valueIndex,y.yAxis.valueIndex]),V((y,T)=>y[0]===T[0]&&y[1]===T[1]),g(1)),u=e.computedData$.pipe(b(y=>y.flat().flat())).pipe(g(1)),s=mt({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),l=Wc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),f=Qt({datumList$:u}).pipe(g(1)),c=zc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$}).pipe(g(1)),p=Hc({computedData$:e.computedData$,xyValueIndex$:o}).pipe(g(1)),h=qc({computedData$:e.computedData$}).pipe(g(1)),m=Jc({fullDataFormatter$:e.fullDataFormatter$,visibleComputedData$:h}).pipe(g(1)),d=Zc({visibleComputedData$:h,ordinalScaleDomain$:m}).pipe(g(1)),x=Kc({xyValueIndex$:o,isCategorySeprate$:r,visibleComputedData$:h}).pipe(g(1)),$=Qc({isCategorySeprate$:r,visibleComputedSumData$:d}).pipe(g(1)),S=jc({computedData$:e.computedData$,xyMinMax$:p,xyValueIndex$:o,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),_=tf({computedXYData$:S}).pipe(g(1)),C=nf({visibleComputedXYData$:_,xyMinMax$:p,xyValueIndex$:o,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),A=rf({xyMinMax$:p,xyValueIndex$:o,filteredXYMinMaxData$:C,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),I=af({containerPosition$:i,graphicTransform$:A}).pipe(g(1)),O=of({visibleComputedSumData$:d,fullDataFormatter$:e.fullDataFormatter$,filteredXYMinMaxData$:C,containerSize$:a}).pipe(g(1)),k=uf({fullDataFormatter$:e.fullDataFormatter$,filteredXYMinMaxData$:C,containerSize$:a}).pipe(g(1)),D=sf({ordinalScaleDomain$:m,computedData$:e.computedData$,containerSize$:a}).pipe(g(1)),w=lf({ordinalScaleDomain$:m,computedData$:e.computedData$,containerSize$:a,ordinalPadding$:D}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isCategorySeprate$:r,containerPosition$:i,containerSize$:a,highlight$:s,categoryLabels$:l,CategoryDataMap$:f,valueLabels$:c,xyMinMax$:p,xyValueIndex$:o,visibleComputedData$:h,visibleComputedSumData$:d,visibleComputedRankingByIndexData$:x,visibleComputedRankingBySumData$:$,visibleComputedXYData$:_,filteredXYMinMaxData$:C,graphicTransform$:A,graphicReverseScale$:I,xScale$:O,yScale$:k,ordinalScaleDomain$:m,ordinalPadding$:D,ordinalScale$:w}};class ff extends Bt{constructor(e,n){super({defaultDataFormatter:ke,dataFormatterValidator:Xc,computedDataFn:Yc,dataValidator:Uc,contextObserverCallback:cf},e,n)}}const pf=t=>E(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),hf=t=>{const{data:e,dataFormatter:n,chartParams:r}=t,i=Ae();let a=[],o=[];try{let u=[],s=[];if(e.nodes)u=e.nodes,s=e.edges;else if(e[0])u=e[0],s=e[1];else return{nodes:[],edges:[]};const l=(()=>{const p=new Set(n.categoryLabels);for(let h of u){const m=h.categoryLabel??i;p.add(m)}for(let h of s){const m=h.categoryLabel??i;p.add(m)}return Array.from(p)})(),f=new Map(l.map((p,h)=>[p,h]));a=u.map((p,h)=>{const m=p.categoryLabel??i,d=f.get(m)??0,x={id:p.id,index:h,label:p.label??"",description:p.description??"",data:p.data??{},value:p.value??0,categoryIndex:d,categoryLabel:m,color:ct(d,r),visible:!0};return x.visible=n.visibleFilter(x,t),x});const c=new Map(a.map(p=>[p.id,p]));o=s.map((p,h)=>{const m=c.get(p.start),d=c.get(p.end);return{edge:p,startNode:m,endNode:d}}).filter(({edge:p})=>{const h=c.get(p.start),m=c.get(p.end);return h!=null&&m!=null}).map(({edge:p,startNode:h,endNode:m},d)=>{const x=p.categoryLabel??i;return{id:p.id,index:d,label:p.label??"",description:p.description??"",data:p.data??{},value:p.value??0,categoryIndex:f.get(x),categoryLabel:x,color:ct(d,r),startNode:h,endNode:m,visible:h.visible&&m.visible}})}catch(u){throw Error(u)}return{nodes:a,edges:o}},mf=t=>E({data:t},{data:{toBe:"DataRelationshipObj | DataRelationshipList",test:n=>U(n)||Array.isArray(n)}}),df=(t,e)=>M({CategoryNodeMap:t,CategoryEdgeMap:e}).pipe(F(async n=>n),b(n=>[...Array.from(n.CategoryNodeMap.keys()),...Array.from(n.CategoryEdgeMap.keys())]),V((n,r)=>JSON.stringify(n).length===JSON.stringify(r).length)),gf=t=>t.pipe(b(e=>{const n=new Map;return e.nodes.forEach(r=>{n.set(r.id,r)}),n})),yf=t=>t.pipe(b(e=>{const n=new Map;return e.edges.forEach(r=>{n.set(r.id,r)}),n})),bf=({computedData$:t,NodeMap$:e})=>M({computedData:t,NodeMap:e}).pipe(F(async n=>n),b(n=>({nodes:n.computedData.nodes.filter(r=>r.visible),edges:n.computedData.edges.filter(r=>r.visible).filter(r=>n.NodeMap.has(r.startNode.id)&&n.NodeMap.has(r.endNode.id))}))),vf=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=mt({datumList$:e.computedData$.pipe(b(c=>c.nodes)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),i=mt({datumList$:e.computedData$.pipe(b(c=>c.edges)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),a=Qt({datumList$:e.computedData$.pipe(b(c=>c.nodes))}).pipe(g(1)),o=Qt({datumList$:e.computedData$.pipe(b(c=>c.edges))}).pipe(g(1)),u=gf(e.computedData$).pipe(g(1)),s=yf(e.computedData$).pipe(g(1)),l=df(a,o).pipe(g(1)),f=bf({computedData$:e.computedData$,NodeMap$:u}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,relationshipHighlightNodes$:r,relationshipHighlightEdges$:i,categoryLabels$:l,CategoryNodeMap$:a,CategoryEdgeMap$:o,NodeMap$:u,EdgeMap$:s,visibleComputedData$:f}};class xf extends Bt{constructor(e,n){super({defaultDataFormatter:Ve,dataFormatterValidator:pf,computedDataFn:hf,dataValidator:mf,contextObserverCallback:vf},e,n)}}const Df=t=>E(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),wf=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=Ae(),a=new Map(n.categoryLabels.map((u,s)=>[u,s]));let o={id:"",index:0,label:"",description:"",categoryIndex:-1,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const u=function(){if(U(e)===!0)return JSON.parse(JSON.stringify(e));if(Array.isArray(e)===!1)return{id:""};let f;const c=new Map;e.forEach(h=>{if(!h.parent)f=h;else{const m=c.get(h.parent)??[];m.push(h),c.set(h.parent,m)}});const p=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel??i,children:(c.get(h.id)??[]).map(m=>p(m))});return f?p(f):{id:""}}();let s=0;const l=(f,c,p)=>{const h=c+1,m=f.categoryLabel??i;a.has(m)||a.set(m,a.size);const d=a.get(m)??0,x=s;s++;const $={id:f.id,index:x,level:c,seq:p,label:f.label??"",description:f.description??"",categoryIndex:d,categoryLabel:m,color:ct(d,r),data:f.data??{},value:f.value,visible:!0,children:(f.children??[]).map((S,_)=>l(S,h,_))};return $.visible=n.visibleFilter($,t),$};o=l(u,0,0)}catch(u){throw Error(u)}return o},$f=t=>E({data:t},{data:{toBe:"DataTreeObj | DataTreeDatum[]",test:n=>U(n)&&n.id!==void 0||Array.isArray(n)}}),_f=({computedData$:t})=>t.pipe(b(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),Af=t=>t.pipe(b(e=>Array.from(e.keys())),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Sf=({computedData$:t})=>t.pipe(b(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),Tf=({subject:t,observer:e})=>{const n=wt(e.fullChartParams$).pipe(g(1)),r=_f({computedData$:e.computedData$}).pipe(g(1)),i=mt({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),a=Qt({datumList$:r}).pipe(g(1)),o=Af(a).pipe(g(1)),u=Sf({computedData$:e.computedData$}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,categoryLabels$:o,CategoryDataMap$:a,visibleComputedData$:u}};class Mf extends Bt{constructor(e,n){super({defaultDataFormatter:Ne,dataFormatterValidator:Df,computedDataFn:wf,dataValidator:$f,contextObserverCallback:Tf},e,n)}}function Ff({chartType:t,config:e,initFn:n}){const r=new B,i=new WeakMap;let a=()=>{},o;const u=new ri(e.defaultParams),s=new ri({}),l=u.pipe(F(f=>s.pipe(L(r),b(c=>{try{const{status:p,columnName:h,expectToBe:m}=e.validator(c,{validateColumns:E});if(p==="error")throw new Error($t({columnName:h,expectToBe:m,from:`${e.name}.params$`}));p==="warning"&&console.warn(_t({columnName:h,expectToBe:m,from:`${e.name}.params$`}))}catch(p){console.error(te(p))}return st(c,f)}))),g(1));return{params$:s,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){o&&(a=n(o)??(()=>{}),i.set(o.selection,o))},destroy(){a(),o&&(o.selection.remove(),o=void 0),r.next(void 0)},setPresetParams:f=>{u.next(st(f,e.defaultParams))},setContext:f=>{o=f,o.observer.fullParams$=l}}}const At=t=>function(n){return function(i){return class{constructor(){const o=Ff({chartType:t,config:n,initFn:i});this.params$=o.params$,this.name=o.name,this.chartType=o.chartType,this.defaultParams=o.defaultParams,this.layerIndex=o.layerIndex,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},Cf=At("series"),Ef=At("grid"),Lf=At("multiGrid"),Pf=At("multiValue"),Of=At("noneData"),If=At("relationship"),Rf=At("tree");v.DEFAULTL_DATA_RELATIONA=Ji,v.DEFAULT_CHART_HEIGHT=Ln,v.DEFAULT_CHART_OPTIONS=ut,v.DEFAULT_CHART_PARAMS=Le,v.DEFAULT_CHART_WIDTH=En,v.DEFAULT_DATA_FORMATTER_CONTAINER=kt,v.DEFAULT_DATA_FORMATTER_GRID=Re,v.DEFAULT_DATA_FORMATTER_GRID_GRID=Ie,v.DEFAULT_DATA_FORMATTER_GROUP_AXIS=Pn,v.DEFAULT_DATA_FORMATTER_MULTI_GRID=Be,v.DEFAULT_DATA_FORMATTER_MULTI_GRID_GRID=Nt,v.DEFAULT_DATA_FORMATTER_MULTI_VALUE=ke,v.DEFAULT_DATA_FORMATTER_RELATIONSHIP=Ve,v.DEFAULT_DATA_FORMATTER_SERIES=Oe,v.DEFAULT_DATA_FORMATTER_TREE=Ne,v.DEFAULT_DATA_FORMATTER_VALUE_AXIS=z,v.DEFAULT_DATA_FORMATTER_X_Y_AXIS=Pe,v.DEFAULT_DATA_GRID=Hi,v.DEFAULT_DATA_MULTI_GRID=ji,v.DEFAULT_DATA_MULTI_VALUE=Wi,v.DEFAULT_DATA_SERIES=zi,v.DEFAULT_DATA_TREE=qi,v.DEFAULT_PADDING=Ee,v.GridChart=Ic,v.MultiGridChart=Gc,v.MultiValueChart=ff,v.RelationshipChart=xf,v.SeriesChart=Fc,v.TreeChart=Mf,v.calcContainerPosition=pn,v.calcContainerPositionScaled=Et,v.categoryDataMapObservable=Qt,v.containerSizeObservable=Ce,v.createAxisToLabelIndexScale=$c,v.createAxisToValueScale=Dc,v.createDefaultCategoryLabel=Ae,v.createDefaultDatumId=Jt,v.createDefaultGroupLabel=ln,v.createDefaultSeriesLabel=_e,v.createDefaultValueLabel=Gr,v.createGridGroupLabels=Yr,v.createGridSeriesLabels=cn,v.createLabelToAxisScale=wc,v.createMultiGridGroupLabels=Ur,v.createMultiGridSeriesLabels=Xr,v.createValueToAxisScale=q,v.defineGridPlugin=Ef,v.defineMultiGridPlugin=Lf,v.defineMultiValuePlugin=Pf,v.defineNoneDataPlugin=Of,v.defineRelationshipPlugin=If,v.defineSeriesPlugin=Cf,v.defineTreePlugin=Rf,v.formatCommaNumber=Zi,v.formatValueToLabel=tl,v.getMinMax=lt,v.getMinMaxGrid=fn,v.getMinMaxMultiGrid=nl,v.getMinMaxMultiValue=rl,v.getMinMaxMultiValueXY=il,v.getMinMaxSeries=el,v.getMinMaxValue=zr,v.groupDataMapObservable=Mn,v.highlightObservable=mt,v.isDom=In,v.isFunction=On,v.isPlainObject=U,v.mergeOptionsWithDefault=st,v.resizeObservable=Ti,v.seriesColorPredicate=ct,v.seriesDataMapObservable=Fe,v.textSizePxObservable=wt,v.transposeData=Hr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
8
+ ----> find in '${n}'`}function Ac(t){return t?E(t,{width:{toBe:'"auto" | number',test:n=>n==="auto"||typeof n=="number"},height:{toBe:'"auto" | number',test:n=>n==="auto"||typeof n=="number"},preset:{toBeTypes:["object"]}}):{status:"success",columnName:"",expectToBe:""}}function Sc(t){return E({element:t},{element:{toBe:"Dom",test:n=>Bn(n)}})}function Tc(t,e){const n={series:["series","datum","none"],grid:["series","group","datum","none"],multiGrid:["series","group","datum","none"],multiValue:["category","datum","none"],relationship:["category","datum","none"],tree:["category","datum","none"],noneData:["none"]},r=E(e,{padding:{toBeTypes:["object"]},highlightTarget:{toBe:n[t].map(i=>`"${i}"`).join(" | "),test:i=>n[t].includes(i)},highlightDefault:{toBeTypes:["string","null"]},colorScheme:{toBe:'"dark" | "light"',test:i=>i==="dark"||i==="light"},colors:{toBeTypes:["object"],test:i=>i.light&&i.dark},styles:{toBeTypes:["object"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(e&&e.padding){const i=E(e.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(i.status==="error")return i}if(e&&e.colors){const i=E(e.colors,{light:{toBeTypes:["object"]},dark:{toBeTypes:["object"]}});if(i.status==="error")return i;if(e.colors.light){const a=E(e.colors.light,{label:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},labelContrast:{toBeTypes:["string[]"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}if(e.colors.dark){const a=E(e.colors.dark,{label:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},labelContrast:{toBeTypes:["string[]"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}}return r}function Mc(t,e){return E({pluginEntities:e},{pluginEntities:{toBe:`PluginEntity<'${t}'>[]`,test:r=>Array.isArray(r)&&r.every(i=>i.chartType===t||i.chartType==="noneData")}})}function Ei(t,e,n){const r=lt(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return lt(i,o)})),r}const Fc=({defaultDataFormatter:t,dataFormatterValidator:e,computedDataFn:n,dataValidator:r,contextObserverCallback:i})=>{const a=new B,o=t.type;return function(s,l){try{const{status:x,columnName:w,expectToBe:y}=Ac(l);if(x==="error")throw new Error(_t({columnName:w,expectToBe:y,from:"Chart.constructor"}));if(x==="warning")console.warn(At({columnName:w,expectToBe:y,from:"Chart.constructor"}));else{const{status:T,columnName:P,expectToBe:G}=Sc(s);if(T==="error")throw new Error(_t({columnName:P,expectToBe:G,from:"Chart.constructor"}));T==="warning"&&console.warn(At({columnName:P,expectToBe:G,from:"Chart.constructor"}))}}catch(x){throw new Error(x)}ue(s).selectAll("svg").remove();const f=ue(s).append("svg");f.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 c=f.append("g");c.classed("orbcharts__layout",!0);const p=c.append("g");p.classed("orbcharts__plugins",!0);const h={data$:new B,dataFormatter$:new B,plugins$:new B,chartParams$:new B,event$:new B},m=(x=>{const w=x||st,y=w.preset?w.preset:{};return{name:y.name??"",description:y.description??"",descriptionZh:y.descriptionZh??"",chartParams:y.chartParams?lt(y.chartParams,Oe):Oe,dataFormatter:y.dataFormatter?Ei(y.dataFormatter,t,o):t,pluginParams:y.pluginParams?y.pluginParams:{}}})(l),d=h.data$.pipe(g(1)),D=h.dataFormatter$.pipe(L(a),Fn({}),b(x=>{try{const{status:w,columnName:y,expectToBe:T}=e(x);if(w==="error")throw new Error(_t({columnName:y,expectToBe:T,from:"Chart.dataFormatter$"}));w==="warning"&&console.warn(At({columnName:y,expectToBe:T,from:"Chart.dataFormatter$"}))}catch(w){console.error(ot(w))}try{return Ei(x,m.dataFormatter,o)}catch(w){throw new Error(En({from:"Chart.dataFormatter$",systemMessage:w}))}}),Ce(x=>(console.error(ot(x)),te)),g(1)),$=h.chartParams$.pipe(L(a),Fn({}),b(x=>{try{const{status:w,columnName:y,expectToBe:T}=Tc(o,x);if(w==="error")throw new Error(_t({columnName:y,expectToBe:T,from:"Chart.chartParams$"}));w==="warning"&&console.warn(At({columnName:y,expectToBe:T,from:"Chart.chartParams$"}))}catch(w){console.error(ot(w))}try{return lt(x,m.chartParams)}catch(w){throw new Error(En({from:"Chart.chartParams$",systemMessage:w}))}}),Ce(x=>(console.error(ot(x)),te)),g(1)),S=$.pipe(L(a),Fn({}),b(x=>lt(x.padding??{},Pe)));S.pipe(L(a),fc()).subscribe(x=>{c.attr("transform",`translate(${x.left}, ${x.top})`)}),S.subscribe(x=>{c.transition().attr("transform",`translate(${x.left}, ${x.top})`)});const _=wt({width:(l==null?void 0:l.width)??st.width,height:(l==null?void 0:l.height)??st.height}).pipe(F(x=>Si(()=>x.width==="auto"||x.height==="auto",Mi(s).pipe(b(w=>({width:x.width==="auto"?w.width:x.width,height:x.height==="auto"?w.height:x.height}))),wt(x))),L(a),Tn()),C=wt().pipe(hc(_.pipe(ac(250)),_.pipe(dc(250))),V((x,w)=>JSON.stringify(x)===JSON.stringify(w)),Tn()),A=C.subscribe(),I=M({rootSize:C,mergedPadding:S}).pipe(L(a),F(async x=>{const w=x.rootSize.width>0?x.rootSize.width:Pn,y=x.rootSize.height>0?x.rootSize.height:On;return{width:w-x.mergedPadding.left-x.mergedPadding.right,height:y-x.mergedPadding.top-x.mergedPadding.bottom,top:x.mergedPadding.top,right:x.mergedPadding.right,bottom:x.mergedPadding.bottom,left:x.mergedPadding.left,rootWidth:w,rootHeight:y}}),g(1));I.subscribe(x=>{f.attr("width",x.rootWidth).attr("height",x.rootHeight)});const O=M({data:d,dataFormatter:D,chartParams:$}).pipe(L(a),F(async x=>x),F(x=>wt(x).pipe(b(w=>{try{const{status:y,columnName:T,expectToBe:P}=r(w.data);if(y==="error")throw new Error(_t({columnName:T,expectToBe:P,from:"Chart.data$"}));y==="warning"&&console.warn(At({columnName:T,expectToBe:P,from:"Chart.data$"}))}catch(y){console.error(ot(y))}try{return n({data:w.data,dataFormatter:w.dataFormatter,chartParams:w.chartParams})}catch(y){throw new Error(En({from:"Chart.data$",systemMessage:y}))}}),Ce(w=>(console.error(ot(w)),te)))),g(1));O.subscribe();const k={};return h.plugins$.subscribe(x=>{try{const{status:w,columnName:y,expectToBe:T}=Mc(o,x);if(w==="error")throw new Error(_t({columnName:y,expectToBe:T,from:"Chart.plugins$"}));w==="warning"&&console.warn(At({columnName:y,expectToBe:T,from:"Chart.plugins$"}))}catch(w){console.error(ot(w));return}p.selectAll("g.orbcharts__plugin").data(x,w=>w.name).join(w=>w.append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`).each((y,T,P)=>{const G={fullParams$:new R,fullChartParams$:$,fullDataFormatter$:D,computedData$:O,layout$:I},gt=i({observer:G,subject:h}),rt={selection:ue(P[T]),rootSelection:f,name:y.name,chartType:o,subject:h,observer:gt};y.setPresetParams(m.pluginParams[y.name]??{}),y.setContext(rt),k[rt.name]=y,y.init()}),w=>w,w=>w.each((y,T,P)=>{k[y.name]&&(k[y.name].destroy(),k[y.name]=void 0)}).remove()).sort((w,y)=>w.layerIndex-y.layerIndex)}),{...h,selection:f,destroy(){ue(s).selectAll("svg").remove(),a.next(void 0),A.unsubscribe()}}}};class kt{constructor({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a},o,u){this.data$=new B,this.dataFormatter$=new B,this.plugins$=new B,this.chartParams$=new B,this.event$=new B;try{const l=Fc({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a})(o,u);this.selection=l.selection,this.destroy=l.destroy,this.data$=l.data$,this.dataFormatter$=l.dataFormatter$,this.plugins$=l.plugins$,this.chartParams$=l.chartParams$,this.event$=l.event$}catch(s){console.error(ot(s))}}}class Cc extends kt{constructor(e,n){super({defaultDataFormatter:Re,dataFormatterValidator:ta,computedDataFn:ol,dataValidator:ul,contextObserverCallback:Dc},e,n)}}const Ec=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},seriesDirection:{toBe:'"row" | "column"',test:n=>n==="row"||n==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(e.status==="error")return e;if(t.valueAxis){const n=E(t.valueAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(t.groupAxis){const n=E(t.groupAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&(typeof r[1]=="number"||r[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e};function Li(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 s=Object.assign([],o);for(let l=s.length;l<n;l++)s[l]=null;return s}).map((o,u)=>o.map((s,l)=>s==null?{id:"",label:"",data:{},value:null}:typeof s=="number"?{id:"",label:"",data:{},value:s}:{id:s.id??"",label:s.label??"",data:s.data??{},value:s.value}));return Wr(e.seriesDirection,i)}catch{return[]}}const Lc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=Li(e,n),o=pn({transposedDataGrid:a,dataFormatterGrid:n,chartType:"grid"}),u=zr({transposedDataGrid:a,dataFormatterGrid:n,chartType:"grid"});let s=0;i=a.map((l,f)=>l.map((c,p)=>{const h=Zt("grid",0,f,p),m=u[p],d={id:c.id?c.id:h,index:s,label:c.label?c.label:h,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:p,groupLabel:m,color:ft(f,r),visible:!0};return d.visible=n.visibleFilter(d,t),s++,d}))}catch(a){throw Error(a)}return i},Pc=t=>E({data:t},{data:{toBe:"(DataGridDatum | DataGridValue)[][]",test:n=>Array.isArray(n)}}),Pi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,u){const s=o.groupAxis.position==="top"||o.groupAxis.position==="bottom"?u.width:u.height,l=a[0]?a[0].length-1:0;return q({maxValue:l,minValue:0,axisWidth:s,scaleDomain:[0,l],scaleRange:[0,1]})}function i(a,o,u){const s=o.valueAxis.position==="left"||o.valueAxis.position==="right"?u.height:u.width,l=a.flat();let[f,c]=jr(l);return f===c&&c===0&&(c=1),q({maxValue:c,minValue:f,axisWidth:s,scaleDomain:["auto","auto"],scaleRange:[0,1]})}return M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async a=>a),b(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),u=i(a.computedData,a.fullDataFormatter,a.layout),s=u(0);return a.computedData.map((l,f)=>l.map((c,p)=>{const h=o(p),m=u(c.value??0);return{...c,axisX:h,axisY:m,axisYFromZero:m-s}}))}))},Ln=({fullDataFormatter$:t,layout$:e})=>{const n=new B;function r({xAxisPosition:o,yAxisPosition:u,width:s,height:l}){return(o==="bottom"||o==="top")&&(u==="left"||u==="right")?{width:s,height:l}:(o==="left"||o==="right")&&(u==="bottom"||u==="top")?{width:l,height:s}:{width:s,height:l}}const i=t.pipe(b(o=>o.groupAxis.position),V()),a=t.pipe(b(o=>o.valueAxis.position),V());return new R(o=>{M({groupAxisPosition:i,valueAxisPosition:a,layout:e}).pipe(L(n),F(async u=>u)).subscribe(u=>{const s=r({xAxisPosition:u.groupAxisPosition,yAxisPosition:u.valueAxisPosition,width:u.layout.width,height:u.layout.height});return o.next(s),function(){n.next(void 0)}})})},Oi=({fullDataFormatter$:t,containerSize$:e})=>Ln({fullDataFormatter$:t,layout$:e}),Ii=({computedData$:t})=>t.pipe(b(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Ri=({computedData$:t})=>t.pipe(b(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Bi=({computedAxesData$:t})=>t.pipe(b(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Oc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateSeries)return Lt(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Lt(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,u)=>a[0])}})),ki=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(b(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((o,u)=>r.reduce((s,l)=>{if(l&&l[u]){const f=l[u].value==null||l[u].visible==!1?0:l[u].value;return s+f}return s},0));return r.map((o,u)=>o.map((s,l)=>({...s,value:i[l]})))}));return t.pipe(F(r=>Si(()=>r,e,n)))},Ni=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(F(async n=>n),b(n=>{const r=n.fullDataFormatter.groupAxis,i=n.computedData[0]?n.computedData[0].length-1:0,a=r.scaleDomain[0]-r.scalePadding,o=r.scaleDomain[1]==="max"?i+r.scalePadding:r.scaleDomain[1]+r.scalePadding;return[a,o]})),Vi=({computedData$:t,groupScaleDomainValue$:e})=>M({computedData:t,groupScaleDomainValue:e}).pipe(b(n=>{const r=n.computedData.map((a,o)=>a.filter((u,s)=>s>=n.groupScaleDomainValue[0]&&s<=n.groupScaleDomainValue[1]&&u.visible==!0));return hn(r)})),Gi=({fullDataFormatter$:t,layout$:e})=>{const n=new B;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 s=0,l=0,f=0,c=0,p=0;return i.position==="bottom"?a.position==="left"?(c=180,l=u):a.position==="right"?(c=180,p=180,s=o,l=u):(c=180,l=u):i.position==="top"?a.position==="left"||(a.position==="right"?(p=180,s=o):(c=180,l=u)):i.position==="left"?a.position==="bottom"?(f=-90,l=u):a.position==="top"?(f=-90,p=180):(c=180,l=u):i.position==="right"?a.position==="bottom"?(f=-90,c=180,l=u,s=o):a.position==="top"?(f=-90,c=180,p=180,s=o):(c=180,l=u):(c=180,l=u),{translate:[s,l],scale:[1,1],rotate:f,rotateX:c,rotateY:p,value:`translate(${s}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${p}deg)`}}return new R(i=>(M({fullDataFormatter:t,layout:e}).pipe(L(n),F(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.groupAxis,yAxis:a.fullDataFormatter.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},Xi=({gridAxesTransform$:t})=>t.pipe(b(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) rotateX(${a}deg) rotateY(${o}deg) rotate(${i}deg)`}})),Yi=({computedData$:t,groupScaleDomainValue$:e,filteredMinMaxValue$:n,fullDataFormatter$:r,layout$:i})=>{const a=new B;function o({data:u,groupAxis:s,valueAxis:l,groupScaleDomainValue:f,filteredMinMaxValue:c,width:p,height:h}){let m=0,d=0,D=0,$=0;const S=s.position==="top"||s.position==="bottom"?p:h,_=0,C=u[0]?u[0].length-1:0,A=q({maxValue:C,minValue:_,axisWidth:S,scaleDomain:f,scaleRange:[0,1]}),I=A(_),O=A(C);_==C?(m=0,D=1):(m=I,D=(O-I)/S),c[0]===c[1]&&c[1]===0&&(c[1]=1);const k=l.position==="left"||l.position==="right"?h:p,x=q({maxValue:c[1],minValue:c[0],axisWidth:k,scaleDomain:l.scaleDomain,scaleRange:l.scaleRange}),w=hn(u);w[0]===w[1]&&w[1]===0&&(w[1]=1);const y=x(w[0]>0?0:w[0]),T=x(w[1]<0?0:w[1]);return d=y,$=(T-y)/k,{translate:[m,d],scale:[D,$],rotate:0,rotateX:0,rotateY:0,value:`translate(${m}px, ${d}px) scale(${D}, ${$})`}}return new R(u=>(M({computedData:t,groupScaleDomainValue:e,filteredMinMaxValue:n,fullDataFormatter:r,layout:i}).pipe(L(a),F(async s=>s)).subscribe(s=>{const l=o({data:s.computedData,groupAxis:s.fullDataFormatter.groupAxis,valueAxis:s.fullDataFormatter.valueAxis,groupScaleDomainValue:s.groupScaleDomainValue,filteredMinMaxValue:s.filteredMinMaxValue,width:s.layout.width,height:s.layout.height});u.next(l)}),function(){a.next(void 0)}))},Ui=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>M({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(F(async r=>r),b(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]]))),Ic=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=e.fullDataFormatter$.pipe(b(O=>O.separateSeries),V(),g(1)),i=Oc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),a=Le({layout$:e.layout$,containerPosition$:i,container$:e.fullDataFormatter$.pipe(b(O=>O.container))}).pipe(g(1)),o=Ln({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),u=Oi({fullDataFormatter$:e.fullDataFormatter$,containerSize$:a}).pipe(g(1)),s=e.computedData$.pipe(b(O=>O.flat())).pipe(g(1)),l=dt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),f=Ii({computedData$:e.computedData$}),c=Ee({datumList$:s}).pipe(g(1)),p=Cn({datumList$:s}).pipe(g(1)),h=Pi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),m=Ri({computedData$:e.computedData$}).pipe(g(1)),d=Bi({computedAxesData$:h}).pipe(g(1)),D=ki({computedData$:e.computedData$,isSeriesSeprate$:r}).pipe(g(1)),$=Ni({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),S=Vi({computedData$:e.computedData$,groupScaleDomainValue$:$}).pipe(g(1)),_=Gi({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),C=Xi({gridAxesTransform$:_}).pipe(g(1)),A=Yi({computedData$:e.computedData$,groupScaleDomainValue$:$,filteredMinMaxValue$:S,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),I=Ui({gridContainerPosition$:i,gridAxesTransform$:_,gridGraphicTransform$:A}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isSeriesSeprate$:r,gridContainerPosition$:i,containerSize$:a,gridAxesSize$:o,gridAxesContainerSize$:u,gridHighlight$:l,seriesLabels$:f,SeriesDataMap$:c,GroupDataMap$:p,computedAxesData$:h,visibleComputedData$:m,visibleComputedAxesData$:d,computedStackedData$:D,groupScaleDomainValue$:$,filteredMinMaxValue$:S,gridAxesTransform$:_,gridAxesReverseTransform$:C,gridGraphicTransform$:A,gridGraphicReverseScale$:I}};class Rc extends kt{constructor(e,n){super({defaultDataFormatter:ke,dataFormatterValidator:Ec,computedDataFn:Lc,dataValidator:Pc,contextObserverCallback:Ic},e,n)}}const Bc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},gridList:{toBeTypes:["object[]"]},container:{toBeTypes:["object"]},separateGrid:{toBeTypes:["boolean"]}});if(t.gridList){const r=t.gridList.map((i,a)=>{const o=E(i,{seriesDirection:{toBe:'"row" | "column"',test:u=>u==="row"||u==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(o.status==="error")return o;if(i.valueAxis){const u=E(i.valueAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:s=>s==="top"||s==="bottom"||s==="left"||s==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:s=>Array.isArray(s)&&s.length===2&&(typeof s[0]=="number"||s[0]==="min"||s[0]==="auto")&&(typeof s[1]=="number"||s[1]==="max"||s[1]==="auto")},scaleRange:{toBe:"[number, number]",test:s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&typeof s[1]=="number"},label:{toBeTypes:["string"]}});if(u.status==="error")return u}else if(i.groupAxis){const u=E(i.groupAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:s=>s==="top"||s==="bottom"||s==="left"||s==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:s=>Array.isArray(s)&&s.length===2&&typeof s[0]=="number"&&(typeof s[1]=="number"||s[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(u.status==="error")return u}return{status:"success",columnName:"",expectToBe:""}}).find(i=>i.status==="error");if(r)return r}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e},kc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||Vt,o=e.map((c,p)=>n.gridList[p]||a),u=e.map((c,p)=>Li(c,o[p])),s=n.separateGrid?u.map((c,p)=>pn({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid"})):u.map((c,p)=>Ur({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid",gridIndex:p})),l=new Map;let f=0;s.flat().forEach((c,p)=>{if(!l.has(c)){const h=ft(f,r);l.set(c,h),f++}}),i=u.map((c,p)=>{const h=s[p],m=Hr({transposedDataGrid:c,dataFormatterGrid:o[p],chartType:"multiGrid",gridIndex:p});let d=0;return c.map(($,S)=>$.map((_,C)=>{const A=Zt("multiGrid",p,S,C),I=m[C],O=h[S],k={id:_.id?_.id:A,index:d,label:_.label?_.label:A,description:_.description??"",data:_.data,value:_.value,gridIndex:p,seriesIndex:S,seriesLabel:O,groupIndex:C,groupLabel:I,color:l.get(O),visible:!0};return k.visible=n.visibleFilter(k,t),d++,k}))})}catch(a){throw Error(a)}return i},Nc=t=>E({data:t},{data:{toBe:"DataGrid[]",test:n=>Array.isArray(n)}}),Vc=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i,containerSize$:a})=>{const o=new B,u=zi({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(g(1));return M({fullDataFormatter:t,computedData:e,multiGridContainer:u}).pipe(F(async s=>s),b(s=>{o.next(void 0);const l=s.fullDataFormatter.gridList[0]??Vt;return s.computedData.map((f,c)=>{const p=s.fullDataFormatter.gridList[c]??l,h={type:"grid",visibleFilter:s.fullDataFormatter.visibleFilter,...p,container:{...s.fullDataFormatter.container}},m=wt(h).pipe(L(o),g(1)),d=wt(f).pipe(L(o),g(1)),D=m.pipe(b(yt=>yt.separateSeries),V(),g(1)),$=wt(s.multiGridContainer[c]).pipe(L(o),g(1)),S=Ln({fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),_=Oi({fullDataFormatter$:m,containerSize$:a}).pipe(g(1)),C=d.pipe(b(yt=>yt.flat())).pipe(L(o),g(1)),A=Ii({computedData$:d}).pipe(L(o),g(1)),I=Ee({datumList$:C}).pipe(L(o),g(1)),O=Cn({datumList$:C}).pipe(L(o),g(1)),k=Ri({computedData$:d}).pipe(L(o),g(1)),x=Pi({computedData$:d,fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),w=Bi({computedAxesData$:x}).pipe(L(o),g(1)),y=ki({computedData$:d,isSeriesSeprate$:D}).pipe(g(1)),T=Ni({computedData$:d,fullDataFormatter$:m}).pipe(L(o),g(1)),P=Vi({computedData$:d,groupScaleDomainValue$:T}).pipe(L(o),g(1)),G=Gi({fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),gt=Xi({gridAxesTransform$:G}).pipe(L(o),g(1)),Q=Yi({computedData$:d,groupScaleDomainValue$:T,filteredMinMaxValue$:P,fullDataFormatter$:m,layout$:n}).pipe(L(o),g(1)),rt=Ui({gridContainerPosition$:$,gridAxesTransform$:G,gridGraphicTransform$:Q});return{isSeriesSeprate$:D,gridContainerPosition$:$,gridAxesSize$:S,gridAxesContainerSize$:_,seriesLabels$:A,SeriesDataMap$:I,GroupDataMap$:O,dataFormatter$:m,computedData$:d,computedAxesData$:x,visibleComputedData$:k,visibleComputedAxesData$:w,computedStackedData$:y,groupScaleDomainValue$:T,filteredMinMaxValue$:P,gridAxesTransform$:G,gridAxesReverseTransform$:gt,gridGraphicTransform$:Q,gridGraphicReverseScale$:rt}})}))},zi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async r=>r),b(r=>{const i=r.fullDataFormatter.gridList[0]??Vt,a=r.computedData.reduce((l,f,c)=>{const h=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return l+h},0)||1,o=Lt(r.layout,r.fullDataFormatter.container,a);let u=0;return r.computedData.map((l,f)=>{const c=r.fullDataFormatter.gridList[f]??i,p=l.map((h,m)=>{const d=o[u];return c.separateSeries&&(u+=1),d});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(u+=1),p})})),Gc=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=zi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),i=Le({layout$:e.layout$,containerPosition$:r.pipe(b(u=>u.flat())),container$:e.fullDataFormatter$.pipe(b(u=>u.container))}).pipe(g(1)),a=dt({datumList$:e.computedData$.pipe(b(u=>u.flat().flat()),g(1)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),o=Vc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$,containerSize$:i}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,containerSize$:i,multiGridHighlight$:a,multiGridContainerPosition$:r,multiGridEachDetail$:o}};class Xc extends kt{constructor(e,n){super({defaultDataFormatter:Ne,dataFormatterValidator:Bc,computedDataFn:kc,dataValidator:Nc,contextObserverCallback:Gc},e,n)}}const Yc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},categoryLabels:{toBeTypes:["string[]"]},valueLabels:{toBeTypes:["string[]"]},xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]},separateCategory:{toBeTypes:["boolean"]}});if(e.status==="error")return e;if(t.yAxis){const n=E(t.yAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]},valueIndex:{toBeTypes:["number"]}});if(n.status==="error")return n}if(t.xAxis){const n=E(t.xAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]},valueIndex:{toBeTypes:["number"]}});if(n.status==="error")return n}if(t.container){const n=E(t.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"},rowGap:{toBe:'"auto" | number',test:r=>r==="auto"||typeof r=="number"}});if(n.status==="error")return n}return e},Uc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=Se();let a=[];try{const o=e.map((l,f)=>Array.isArray(l)?{id:"",label:"",description:"",data:{},categoryLabel:i,value:l}:U(l)?{id:l.id??"",label:l.label??"",description:l.description??"",data:l.data??{},categoryLabel:l.categoryLabel??i,value:l.value}:{id:"",label:"",description:"",data:{},categoryLabel:i,value:[]}),u=(()=>{const l=new Set(n.categoryLabels);for(let f of o){const c=f.categoryLabel??i;l.add(c)}return Array.from(l)})(),s=new Map(u.map((l,f)=>[l,f]));o.forEach((l,f)=>{const c=Zt(n.type,f),p=s.get(l.categoryLabel)??0,h=ft(p,r),m={id:l.id?l.id:c,index:f,label:l.label?l.label:c,description:l.description??"",data:l.data,value:l.value,categoryIndex:p,categoryLabel:l.categoryLabel,xValueIndex:n.xAxis.valueIndex,yValueIndex:n.yAxis.valueIndex,visible:!0,color:h};m.visible=n.visibleFilter(m,t),a[p]||(a[p]=[]),a[p].push(m)})}catch(o){throw Error(o)}return a},zc=t=>E({data:t},{data:{toBe:"(DataMultiValueDatum | DataMultiValueValue[])[]",test:n=>Array.isArray(n)}}),Hc=({computedData$:t,fullDataFormatter$:e})=>M({computedData:t,fullDataFormatter:e}).pipe(b(n=>n.computedData[0]&&n.computedData[0][0]&&n.computedData[0][0].value.length?n.computedData[0][0].value.map((r,i)=>n.fullDataFormatter.valueLabels[i]??Yr("multiValue",i)):[])),jc=({computedData$:t,xyValueIndex$:e})=>M({computedData:t,xyValueIndex:e}).pipe(b(n=>{const r=n.computedData.flat(),[i,a]=ct(r.map(s=>s.value[n.xyValueIndex[0]])),[o,u]=ct(r.map(s=>s.value[n.xyValueIndex[1]]));return{minX:i,maxX:a,minY:o,maxY:u}})),Wc=({computedData$:t,xyMinMax$:e,xyValueIndex$:n,fullDataFormatter$:r,layout$:i})=>{function a(u,s){let l=u.maxX,f=u.minX;return f===l&&l===0&&(l=1),q({maxValue:l,minValue:f,axisWidth:s.width,scaleDomain:["auto","auto"],scaleRange:[0,1]})}function o(u,s){let l=u.maxY,f=u.minY;return f===l&&l===0&&(l=1),q({maxValue:l,minValue:f,axisWidth:s.height,scaleDomain:["auto","auto"],scaleRange:[0,1],reverse:!0})}return M({computedData:t,xyMinMax:e,xyValueIndex:n,fullDataFormatter:r,layout:i}).pipe(F(async u=>u),b(u=>{const s=a(u.xyMinMax,u.layout),l=o(u.xyMinMax,u.layout);return u.computedData.map((f,c)=>f.map((p,h)=>({...p,axisX:s(p.value[u.xyValueIndex[0]]??0),axisY:l(p.value[u.xyValueIndex[1]]??0)})))}))},qc=({computedData$:t,fullDataFormatter$:e})=>t.pipe(b(n=>n.map(r=>r[0]?r[0].categoryLabel:"")),V((n,r)=>JSON.stringify(n).length===JSON.stringify(r).length)),Jc=({computedData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),Zc=({visibleComputedData$:t,fullDataFormatter$:e})=>M({visibleComputedData:t,fullDataFormatter:e}).pipe(b(n=>{let r=n.visibleComputedData[0]&&n.visibleComputedData[0][0]&&n.visibleComputedData[0][0].value.length?n.visibleComputedData[0][0].value.length-1:0;return[n.fullDataFormatter.xAxis.scaleDomain[0]==="auto"||n.fullDataFormatter.xAxis.scaleDomain[0]==="min"?0:n.fullDataFormatter.xAxis.scaleDomain[0],n.fullDataFormatter.xAxis.scaleDomain[1]==="auto"||n.fullDataFormatter.xAxis.scaleDomain[1]==="max"?r:n.fullDataFormatter.xAxis.scaleDomain[1]]}),V((n,r)=>n[0]===r[0]&&n[1]===r[1])),Kc=({visibleComputedData$:t,ordinalScaleDomain$:e})=>M({visibleComputedData:t,ordinalScaleDomain:e}).pipe(b(n=>n.visibleComputedData.map(r=>r.map((i,a)=>{let o=i;return o.sum=o.value.filter((u,s)=>s>=n.ordinalScaleDomain[0]&&s<=n.ordinalScaleDomain[1]).reduce((u,s)=>u+s,0),o})))),Qc=({xyValueIndex$:t,isCategorySeprate$:e,visibleComputedData$:n})=>M({isCategorySeprate:e,xyValueIndex:t,visibleComputedData:n}).pipe(F(async r=>r),b(r=>{const i=r.xyValueIndex[0];return r.isCategorySeprate?r.visibleComputedData.map(a=>a.sort((o,u)=>{const s=u.value[i]??-1/0,l=o.value[i]??-1/0;return s-l})):[r.visibleComputedData.flat().sort((a,o)=>{const u=o.value[i]??-1/0,s=a.value[i]??-1/0;return u-s})]})),tf=({isCategorySeprate$:t,visibleComputedSumData$:e})=>M({isCategorySeprate:t,visibleComputedSumData:e}).pipe(F(async n=>n),b(n=>n.isCategorySeprate?n.visibleComputedSumData.map(r=>r.sort((i,a)=>a.sum-i.sum)):[n.visibleComputedSumData.flat().sort((r,i)=>i.sum-r.sum)])),ef=({computedXYData$:t})=>t.pipe(b(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),nf=({computedData$:t,fullDataFormatter$:e,layout$:n})=>M({computedData:t,fullDataFormatter:e,layout:n}).pipe(F(async i=>i),b(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.fullDataFormatter.separateCategory)return Lt(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Lt(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,u)=>a[0])}})),rf=({visibleComputedXYData$:t,xyMinMax$:e,xyValueIndex$:n,fullDataFormatter$:r})=>M({visibleComputedXYData:t,xyMinMax:e,xyValueIndex:n,fullDataFormatter:r}).pipe(b(i=>{const{minX:a,maxX:o,minY:u,maxY:s}=(()=>{let{minX:m,maxX:d,minY:D,maxY:$}=i.xyMinMax;return i.fullDataFormatter.xAxis.scaleDomain[0]==="auto"&&m>0?m=0:typeof i.fullDataFormatter.xAxis.scaleDomain[0]=="number"&&(m=i.fullDataFormatter.xAxis.scaleDomain[0]),i.fullDataFormatter.xAxis.scaleDomain[1]==="auto"&&d<0?d=0:typeof i.fullDataFormatter.xAxis.scaleDomain[1]=="number"&&(d=i.fullDataFormatter.xAxis.scaleDomain[1]),i.fullDataFormatter.yAxis.scaleDomain[0]==="auto"&&D>0?D=0:typeof i.fullDataFormatter.yAxis.scaleDomain[0]=="number"&&(D=i.fullDataFormatter.yAxis.scaleDomain[0]),i.fullDataFormatter.yAxis.scaleDomain[1]==="auto"&&$<0?$=0:typeof i.fullDataFormatter.yAxis.scaleDomain[1]=="number"&&($=i.fullDataFormatter.yAxis.scaleDomain[1]),{minX:m,maxX:d,minY:D,maxY:$}})();let l=[],f=null,c=null,p=null,h=null;for(let m of i.visibleComputedXYData)for(let d of m){const D=d.value[i.xyValueIndex[0]],$=d.value[i.xyValueIndex[1]];D>=a&&D<=o&&$>=u&&$<=s&&(l.push(d),(f==null||D<f.value[i.xyValueIndex[0]])&&(f=d),(c==null||D>c.value[i.xyValueIndex[0]])&&(c=d),(p==null||$<p.value[i.xyValueIndex[1]])&&(p=d),(h==null||$>h.value[i.xyValueIndex[1]])&&(h=d))}return{datumList:l,minXDatum:f,maxXDatum:c,minYDatum:p,maxYDatum:h}})),af=({xyMinMax$:t,xyValueIndex$:e,filteredXYMinMaxData$:n,fullDataFormatter$:r,layout$:i})=>{const a=new B;function o({xyMinMax:u,xyValueIndex:s,filteredXYMinMaxData:l,xAxis:f,yAxis:c,width:p,height:h}){let m=0,d=0,D=0,$=0,{minX:S,maxX:_,minY:C,maxY:A}=u,I=l.minXDatum.value[s[0]]??0,O=l.maxXDatum.value[s[0]]??0,k=l.minYDatum.value[s[1]]??0,x=l.maxYDatum.value[s[1]]??0;I===O&&O===0&&(O=1),k===x&&x===0&&(x=1),S===_&&_===0&&(_=1),C===A&&A===0&&(A=1);const w=q({maxValue:O,minValue:I,axisWidth:p,scaleDomain:f.scaleDomain,scaleRange:f.scaleRange}),y=w(S>0?0:S),T=w(_<0?0:_);m=y,D=(T-y)/p;const G=q({maxValue:x,minValue:k,axisWidth:h,scaleDomain:c.scaleDomain,scaleRange:c.scaleRange,reverse:!0}),gt=G(C>0?0:C),Q=G(A<0?0:A);return d=Q,$=(gt-Q)/h,{translate:[m,d],scale:[D,$],rotate:0,rotateX:0,rotateY:0,value:`translate(${m}px, ${d}px) scale(${D}, ${$})`}}return new R(u=>(M({xyMinMax:t,xyValueIndex:e,filteredXYMinMaxData:n,fullDataFormatter:r,layout:i}).pipe(L(a),F(async s=>s)).subscribe(s=>{if(!s.filteredXYMinMaxData.minXDatum||!s.filteredXYMinMaxData.maxXDatum||s.filteredXYMinMaxData.minXDatum.value[s.xyValueIndex[0]]==null||s.filteredXYMinMaxData.maxXDatum.value[s.xyValueIndex[0]]==null||!s.filteredXYMinMaxData.minYDatum||!s.filteredXYMinMaxData.maxYDatum||s.filteredXYMinMaxData.minYDatum.value[s.xyValueIndex[1]]==null||s.filteredXYMinMaxData.maxYDatum.value[s.xyValueIndex[1]]==null)return;const l=o({xyMinMax:s.xyMinMax,xyValueIndex:s.xyValueIndex,filteredXYMinMaxData:s.filteredXYMinMaxData,xAxis:s.fullDataFormatter.xAxis,yAxis:s.fullDataFormatter.yAxis,width:s.layout.width,height:s.layout.height});u.next(l)}),function(){a.next(void 0)}))},of=({containerPosition$:t,graphicTransform$:e})=>M({containerPosition:t,graphicTransform:e}).pipe(F(async n=>n),b(n=>n.containerPosition.map((r,i)=>[1/n.graphicTransform.scale[0]/n.containerPosition[i].scale[0],1/n.graphicTransform.scale[1]/n.containerPosition[i].scale[1]]))),uf=({visibleComputedSumData$:t,fullDataFormatter$:e,filteredXYMinMaxData$:n,containerSize$:r})=>M({visibleComputedSumData:t,fullDataFormatter:e,containerSize:r,filteredXYMinMaxData:n}).pipe(F(async i=>i),b(i=>{const a=i.fullDataFormatter.xAxis.valueIndex;if(!i.filteredXYMinMaxData.minXDatum||!i.filteredXYMinMaxData.maxXDatum)return;let o=i.filteredXYMinMaxData.maxXDatum.value[a],u=i.filteredXYMinMaxData.minXDatum.value[a];return o===u&&o===0&&(o=1),q({maxValue:o,minValue:u,axisWidth:i.containerSize.width,scaleDomain:i.fullDataFormatter.xAxis.scaleDomain,scaleRange:i.fullDataFormatter.xAxis.scaleRange})})),sf=({fullDataFormatter$:t,filteredXYMinMaxData$:e,containerSize$:n})=>M({fullDataFormatter:t,containerSize:n,filteredXYMinMaxData:e}).pipe(F(async r=>r),b(r=>{const i=r.fullDataFormatter.yAxis.valueIndex;if(!r.filteredXYMinMaxData.minYDatum||!r.filteredXYMinMaxData.maxYDatum||r.filteredXYMinMaxData.minYDatum.value[i]==null||r.filteredXYMinMaxData.maxYDatum.value[i]==null)return;let a=r.filteredXYMinMaxData.maxYDatum.value[i],o=r.filteredXYMinMaxData.minYDatum.value[i];return a===o&&a===0&&(a=1),q({maxValue:a,minValue:o,axisWidth:r.containerSize.height,scaleDomain:r.fullDataFormatter.yAxis.scaleDomain,scaleRange:r.fullDataFormatter.yAxis.scaleRange,reverse:!0})})),lf=({ordinalScaleDomain$:t,computedData$:e,containerSize$:n})=>M({ordinalScaleDomain:t,containerSize:n,computedData:e}).pipe(F(async r=>r),b(r=>{r.computedData[0]&&r.computedData[0][0]&&r.computedData[0][0].value.length&&r.computedData[0][0].value.length-1;let i=r.containerSize.width;const a=r.ordinalScaleDomain[1]-r.ordinalScaleDomain[0];return a>=1?i/(a+1)/2:0})),cf=({ordinalScaleDomain$:t,computedData$:e,containerSize$:n,ordinalPadding$:r})=>M({ordinalScaleDomain:t,computedData:e,containerSize:n,ordinalPadding:r}).pipe(F(async i=>i),b(i=>{let a=i.computedData[0]&&i.computedData[0][0]&&i.computedData[0][0].value.length?i.computedData[0][0].value.length-1:0,o=0,u=i.containerSize.width-i.ordinalPadding*2;return q({maxValue:a,minValue:o,axisWidth:u,scaleDomain:i.ordinalScaleDomain,scaleRange:[0,1]})})),ff=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=e.fullDataFormatter$.pipe(b(y=>y.separateCategory),V(),g(1)),i=nf({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),a=Le({layout$:e.layout$,containerPosition$:i,container$:e.fullDataFormatter$.pipe(b(y=>y.container))}).pipe(g(1)),o=e.fullDataFormatter$.pipe(b(y=>[y.xAxis.valueIndex,y.yAxis.valueIndex]),V((y,T)=>y[0]===T[0]&&y[1]===T[1]),g(1)),u=e.computedData$.pipe(b(y=>y.flat().flat())).pipe(g(1)),s=dt({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),l=qc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),f=ee({datumList$:u}).pipe(g(1)),c=Hc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$}).pipe(g(1)),p=jc({computedData$:e.computedData$,xyValueIndex$:o}).pipe(g(1)),h=Jc({computedData$:e.computedData$}).pipe(g(1)),m=Zc({fullDataFormatter$:e.fullDataFormatter$,visibleComputedData$:h}).pipe(g(1)),d=Kc({visibleComputedData$:h,ordinalScaleDomain$:m}).pipe(g(1)),D=Qc({xyValueIndex$:o,isCategorySeprate$:r,visibleComputedData$:h}).pipe(g(1)),$=tf({isCategorySeprate$:r,visibleComputedSumData$:d}).pipe(g(1)),S=Wc({computedData$:e.computedData$,xyMinMax$:p,xyValueIndex$:o,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),_=ef({computedXYData$:S}).pipe(g(1)),C=rf({visibleComputedXYData$:_,xyMinMax$:p,xyValueIndex$:o,fullDataFormatter$:e.fullDataFormatter$}).pipe(g(1)),A=af({xyMinMax$:p,xyValueIndex$:o,filteredXYMinMaxData$:C,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(g(1)),I=of({containerPosition$:i,graphicTransform$:A}).pipe(g(1)),O=uf({visibleComputedSumData$:d,fullDataFormatter$:e.fullDataFormatter$,filteredXYMinMaxData$:C,containerSize$:a}).pipe(g(1)),k=sf({fullDataFormatter$:e.fullDataFormatter$,filteredXYMinMaxData$:C,containerSize$:a}).pipe(g(1)),x=lf({ordinalScaleDomain$:m,computedData$:e.computedData$,containerSize$:a}).pipe(g(1)),w=cf({ordinalScaleDomain$:m,computedData$:e.computedData$,containerSize$:a,ordinalPadding$:x}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isCategorySeprate$:r,containerPosition$:i,containerSize$:a,highlight$:s,categoryLabels$:l,CategoryDataMap$:f,valueLabels$:c,xyMinMax$:p,xyValueIndex$:o,visibleComputedData$:h,visibleComputedSumData$:d,visibleComputedRankingByIndexData$:D,visibleComputedRankingBySumData$:$,visibleComputedXYData$:_,filteredXYMinMaxData$:C,graphicTransform$:A,graphicReverseScale$:I,xScale$:O,yScale$:k,ordinalScaleDomain$:m,ordinalPadding$:x,ordinalScale$:w}};class pf extends kt{constructor(e,n){super({defaultDataFormatter:Ve,dataFormatterValidator:Yc,computedDataFn:Uc,dataValidator:zc,contextObserverCallback:ff},e,n)}}const hf=t=>E(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),mf=t=>{const{data:e,dataFormatter:n,chartParams:r}=t,i=Se();let a=[],o=[];try{let u=[],s=[];if(e.nodes)u=e.nodes,s=e.edges;else if(e[0])u=e[0],s=e[1];else return{nodes:[],edges:[]};const l=(()=>{const p=new Set(n.categoryLabels);for(let h of u){const m=h.categoryLabel??i;p.add(m)}for(let h of s){const m=h.categoryLabel??i;p.add(m)}return Array.from(p)})(),f=new Map(l.map((p,h)=>[p,h]));a=u.map((p,h)=>{const m=p.categoryLabel??i,d=f.get(m)??0,D={id:p.id,index:h,label:p.label??"",description:p.description??"",data:p.data??{},value:p.value??0,categoryIndex:d,categoryLabel:m,color:ft(d,r),visible:!0};return D.visible=n.visibleFilter(D,t),D});const c=new Map(a.map(p=>[p.id,p]));o=s.map((p,h)=>{const m=c.get(p.start),d=c.get(p.end);return{edge:p,startNode:m,endNode:d}}).filter(({edge:p})=>{const h=c.get(p.start),m=c.get(p.end);return h!=null&&m!=null}).map(({edge:p,startNode:h,endNode:m},d)=>{const D=p.categoryLabel??i;return{id:p.id,index:d,label:p.label??"",description:p.description??"",data:p.data??{},value:p.value??0,categoryIndex:f.get(D),categoryLabel:D,color:ft(d,r),startNode:h,endNode:m,visible:h.visible&&m.visible}})}catch(u){throw Error(u)}return{nodes:a,edges:o}},df=t=>E({data:t},{data:{toBe:"DataRelationshipObj | DataRelationshipList",test:n=>U(n)||Array.isArray(n)}}),gf=(t,e)=>M({CategoryNodeMap:t,CategoryEdgeMap:e}).pipe(F(async n=>n),b(n=>[...Array.from(n.CategoryNodeMap.keys()),...Array.from(n.CategoryEdgeMap.keys())]),V((n,r)=>JSON.stringify(n).length===JSON.stringify(r).length)),yf=t=>t.pipe(b(e=>{const n=new Map;return e.nodes.forEach(r=>{n.set(r.id,r)}),n})),bf=t=>t.pipe(b(e=>{const n=new Map;return e.edges.forEach(r=>{n.set(r.id,r)}),n})),vf=({computedData$:t,NodeMap$:e})=>M({computedData:t,NodeMap:e}).pipe(F(async n=>n),b(n=>({nodes:n.computedData.nodes.filter(r=>r.visible),edges:n.computedData.edges.filter(r=>r.visible).filter(r=>n.NodeMap.has(r.startNode.id)&&n.NodeMap.has(r.endNode.id))}))),xf=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=dt({datumList$:e.computedData$.pipe(b(c=>c.nodes)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),i=dt({datumList$:e.computedData$.pipe(b(c=>c.edges)),fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),a=ee({datumList$:e.computedData$.pipe(b(c=>c.nodes))}).pipe(g(1)),o=ee({datumList$:e.computedData$.pipe(b(c=>c.edges))}).pipe(g(1)),u=yf(e.computedData$).pipe(g(1)),s=bf(e.computedData$).pipe(g(1)),l=gf(a,o).pipe(g(1)),f=vf({computedData$:e.computedData$,NodeMap$:u}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,relationshipHighlightNodes$:r,relationshipHighlightEdges$:i,categoryLabels$:l,CategoryNodeMap$:a,CategoryEdgeMap$:o,NodeMap$:u,EdgeMap$:s,visibleComputedData$:f}};class Df extends kt{constructor(e,n){super({defaultDataFormatter:Xe,dataFormatterValidator:hf,computedDataFn:mf,dataValidator:df,contextObserverCallback:xf},e,n)}}const wf=t=>E(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),$f=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=Se(),a=new Map(n.categoryLabels.map((u,s)=>[u,s]));let o={id:"",index:0,label:"",description:"",categoryIndex:-1,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const u=function(){if(U(e)===!0)return JSON.parse(JSON.stringify(e));if(Array.isArray(e)===!1)return{id:""};let f;const c=new Map;e.forEach(h=>{if(!h.parent)f=h;else{const m=c.get(h.parent)??[];m.push(h),c.set(h.parent,m)}});const p=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel??i,children:(c.get(h.id)??[]).map(m=>p(m))});return f?p(f):{id:""}}();let s=0;const l=(f,c,p)=>{const h=c+1,m=f.categoryLabel??i;a.has(m)||a.set(m,a.size);const d=a.get(m)??0,D=s;s++;const $={id:f.id,index:D,level:c,seq:p,label:f.label??"",description:f.description??"",categoryIndex:d,categoryLabel:m,color:ft(d,r),data:f.data??{},value:f.value,visible:!0,children:(f.children??[]).map((S,_)=>l(S,h,_))};return $.visible=n.visibleFilter($,t),$};o=l(u,0,0)}catch(u){throw Error(u)}return o},_f=t=>E({data:t},{data:{toBe:"DataTreeObj | DataTreeDatum[]",test:n=>U(n)&&n.id!==void 0||Array.isArray(n)}}),Af=({computedData$:t})=>t.pipe(b(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),Sf=t=>t.pipe(b(e=>Array.from(e.keys())),V((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Tf=({computedData$:t})=>t.pipe(b(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)})),Mf=({subject:t,observer:e})=>{const n=$t(e.fullChartParams$).pipe(g(1)),r=Af({computedData$:e.computedData$}).pipe(g(1)),i=dt({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(g(1)),a=ee({datumList$:r}).pipe(g(1)),o=Sf(a).pipe(g(1)),u=Tf({computedData$:e.computedData$}).pipe(g(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,categoryLabels$:o,CategoryDataMap$:a,visibleComputedData$:u}};class Ff extends kt{constructor(e,n){super({defaultDataFormatter:Ge,dataFormatterValidator:wf,computedDataFn:$f,dataValidator:_f,contextObserverCallback:Mf},e,n)}}function Cf({chartType:t,config:e,initFn:n}){const r=new B,i=new WeakMap;let a=()=>{},o;const u=new ai(e.defaultParams),s=new ai({}),l=u.pipe(F(f=>s.pipe(L(r),b(c=>{try{const{status:p,columnName:h,expectToBe:m}=e.validator(c,{validateColumns:E});if(p==="error")throw new Error(_t({columnName:h,expectToBe:m,from:`${e.name}.params$`}));p==="warning"&&console.warn(At({columnName:h,expectToBe:m,from:`${e.name}.params$`}))}catch(p){console.error(ot(p))}return lt(c,f)}))),g(1));return{params$:s,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){o&&(a=n(o)??(()=>{}),i.set(o.selection,o))},destroy(){a(),o&&(o.selection.remove(),o=void 0),r.next(void 0)},setPresetParams:f=>{u.next(lt(f,e.defaultParams))},setContext:f=>{o=f,o.observer.fullParams$=l}}}const St=t=>function(n){return function(i){return class{constructor(){const o=Cf({chartType:t,config:n,initFn:i});this.params$=o.params$,this.name=o.name,this.chartType=o.chartType,this.defaultParams=o.defaultParams,this.layerIndex=o.layerIndex,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},Ef=St("series"),Lf=St("grid"),Pf=St("multiGrid"),Of=St("multiValue"),If=St("noneData"),Rf=St("relationship"),Bf=St("tree");v.DEFAULTL_DATA_RELATIONA=Zi,v.DEFAULT_CHART_HEIGHT=On,v.DEFAULT_CHART_OPTIONS=st,v.DEFAULT_CHART_PARAMS=Oe,v.DEFAULT_CHART_WIDTH=Pn,v.DEFAULT_DATA_FORMATTER_CONTAINER=Nt,v.DEFAULT_DATA_FORMATTER_GRID=ke,v.DEFAULT_DATA_FORMATTER_GRID_GRID=Be,v.DEFAULT_DATA_FORMATTER_GROUP_AXIS=In,v.DEFAULT_DATA_FORMATTER_MULTI_GRID=Ne,v.DEFAULT_DATA_FORMATTER_MULTI_GRID_GRID=Vt,v.DEFAULT_DATA_FORMATTER_MULTI_VALUE=Ve,v.DEFAULT_DATA_FORMATTER_RELATIONSHIP=Xe,v.DEFAULT_DATA_FORMATTER_SERIES=Re,v.DEFAULT_DATA_FORMATTER_TREE=Ge,v.DEFAULT_DATA_FORMATTER_VALUE_AXIS=z,v.DEFAULT_DATA_FORMATTER_X_Y_AXIS=Ie,v.DEFAULT_DATA_GRID=ji,v.DEFAULT_DATA_MULTI_GRID=Wi,v.DEFAULT_DATA_MULTI_VALUE=qi,v.DEFAULT_DATA_SERIES=Hi,v.DEFAULT_DATA_TREE=Ji,v.DEFAULT_PADDING=Pe,v.GridChart=Rc,v.MultiGridChart=Xc,v.MultiValueChart=pf,v.RelationshipChart=Df,v.SeriesChart=Cc,v.TreeChart=Ff,v.calcContainerPosition=mn,v.calcContainerPositionScaled=Lt,v.categoryDataMapObservable=ee,v.containerSizeObservable=Le,v.createAxisToLabelIndexScale=_c,v.createAxisToValueScale=wc,v.createDefaultCategoryLabel=Se,v.createDefaultDatumId=Zt,v.createDefaultGroupLabel=fn,v.createDefaultSeriesLabel=Ae,v.createDefaultValueLabel=Yr,v.createGridGroupLabels=zr,v.createGridSeriesLabels=pn,v.createLabelToAxisScale=$c,v.createMultiGridGroupLabels=Hr,v.createMultiGridSeriesLabels=Ur,v.createValueToAxisScale=q,v.defineGridPlugin=Lf,v.defineMultiGridPlugin=Pf,v.defineMultiValuePlugin=Of,v.defineNoneDataPlugin=If,v.defineRelationshipPlugin=Rf,v.defineSeriesPlugin=Ef,v.defineTreePlugin=Bf,v.formatCommaNumber=Ki,v.formatValueToLabel=el,v.getMinMax=ct,v.getMinMaxGrid=hn,v.getMinMaxMultiGrid=rl,v.getMinMaxMultiValue=il,v.getMinMaxMultiValueXY=al,v.getMinMaxSeries=nl,v.getMinMaxValue=jr,v.groupDataMapObservable=Cn,v.highlightObservable=dt,v.isDom=Bn,v.isFunction=Rn,v.isPlainObject=U,v.mergeOptionsWithDefault=lt,v.resizeObservable=Mi,v.seriesColorPredicate=ft,v.seriesDataMapObservable=Ee,v.textSizePxObservable=$t,v.transposeData=Wr,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});