@orbcharts/core 3.0.0-beta.3 → 3.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orbcharts-core.es.js +2665 -2376
- package/dist/orbcharts-core.umd.js +4 -4
- package/dist/src/utils/d3Scale.d.ts +28 -0
- package/dist/src/utils/gridObservables.d.ts +29 -19
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/multiGridObservables.d.ts +2 -2
- package/dist/src/utils/multiValueObservables.d.ts +73 -0
- package/dist/src/utils/orbchartsUtils.d.ts +19 -5
- package/dist/src/utils/seriesObservables.d.ts +4 -4
- package/dist/src/utils/treeObservables.d.ts +2 -5
- package/package.json +2 -2
- package/src/defaults.ts +4 -1
- package/src/grid/contextObserverCallback.ts +57 -36
- package/src/multiValue/computedDataFn.ts +81 -147
- package/src/multiValue/contextObserverCallback.ts +150 -2
- package/src/relationship/computedDataFn.ts +1 -1
- package/src/tree/computedDataFn.ts +9 -10
- package/src/tree/contextObserverCallback.ts +6 -9
- package/src/utils/d3Scale.ts +198 -0
- package/src/utils/gridObservables.ts +303 -234
- package/src/utils/index.ts +1 -1
- package/src/utils/multiGridObservables.ts +68 -42
- package/src/utils/multiValueObservables.ts +662 -0
- package/src/utils/orbchartsUtils.ts +70 -45
- package/src/utils/seriesObservables.ts +7 -7
- package/src/utils/treeObservables.ts +44 -33
- package/src/utils/validator.ts +3 -2
- package/dist/src/utils/d3Utils.d.ts +0 -19
- package/src/utils/d3Utils.ts +0 -108
@@ -1,7 +1,7 @@
|
|
1
|
-
(function(m,at){typeof exports=="object"&&typeof module<"u"?at(exports):typeof define=="function"&&define.amd?define(["exports"],at):(m=typeof globalThis<"u"?globalThis:m||self,at(m["orbcharts-core"]={}))})(this,function(m){"use strict";const at={width:"auto",height:"auto"},Ce={top:60,right:60,bottom:60,left:60},Me={padding:Ce,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},In=800,kn=500,Xi=[],qi=[],Yi=[],Wi=[],Ji=[],Ki={nodes:[],edges:[]},J={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Bn={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},Jt={gap:120,rowAmount:1,columnAmount:1},Ee={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...Jt},separateSeries:!1,sumSeries:!1};Ee.visibleFilter.toString=()=>"(datum, context) => true";const Fe={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...J},groupAxis:{...Bn},separateSeries:!1},Le={type:"grid",visibleFilter:(t,e)=>!0,grid:{...Fe},container:{...Jt}};Le.visibleFilter.toString=()=>"(datum, context) => true";const Pt={...Fe},Oe={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...Pt}],separateGrid:!1,container:{...Jt}};Oe.visibleFilter.toString=()=>"(datum, context) => true";const Pe={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],multiValue:[],xAxis:{...J},yAxis:{...J}};Pe.visibleFilter.toString=()=>"(datum, context) => true";const Re={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};Re.visibleFilter.toString=()=>"(datum, context) => true";const Ne={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ne.visibleFilter.toString=()=>"(datum, context) => true";function H(t){return Object.prototype.toString.call(t)==="[object Object]"}function Gn(t){return Object.prototype.toString.call(t)==="[object Function]"}function Vn(t){return!!(t&&t.nodeType)}function st(t,e){if(H(t)===!1||H(e)===!1)return Object.assign({},e);const n=(r,i)=>{const o=Object.assign({},i);for(let a of Object.keys(r)){if(!(a in i))continue;let s;H(r[a])&&H(i[a])?(s=n(r[a],i[a]),o[a]=s):o[a]=r[a]}return o};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 Qi(t,e){const n={string:o=>typeof o=="string",number:o=>typeof o=="number",boolean:o=>typeof o=="boolean",object:o=>H(o),"object[]":o=>Array.isArray(o)&&o.every(a=>H(a)),"string[]":o=>Array.isArray(o)&&o.every(a=>typeof a=="string"),"number[]":o=>Array.isArray(o)&&o.every(a=>typeof a=="number"),Function:o=>Gn(o),null:o=>o===null,undefined:o=>o===void 0},r={ColorType:o=>o==="none"||o==="series"||o==="primary"||o==="secondary"||o==="white"||o==="background"};return Object.keys(t).find(o=>{if(e[o]){const a=e[o],s=t[o];if(a.toBeTypes){if(a.toBeTypes.some(f=>n[f](s))===!1)return!0}else if(a.toBe){const{toBe:u,test:l}=a;if(l(s)===!1)return!0}else if(a.toBeOption){const u=a.toBeOption;if(r[u](s)===!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 to=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,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e};function Kt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function eo(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Un(t){let e,n,r;t.length!==2?(e=Kt,n=(s,u)=>Kt(t(s),u),r=(s,u)=>t(s)-u):(e=t===Kt||t===eo?t:no,n=t,r=t);function i(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<0?l=c+1:f=c}while(l<f)}return l}function o(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<=0?l=c+1:f=c}while(l<f)}return l}function a(s,u,l=0,f=s.length){const c=i(s,u,l,f-1);return c>l&&r(s[c-1],u)>-r(s[c],u)?c-1:c}return{left:i,center:a,right:o}}function no(){return 0}function ro(t){return t===null?NaN:+t}const zn=Un(Kt).right;Un(ro).center;class Hn extends Map{constructor(e,n=ao){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(jn(this,e))}has(e){return super.has(jn(this,e))}set(e,n){return super.set(io(this,e),n)}delete(e){return super.delete(oo(this,e))}}function jn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function io({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function oo({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function ao(t){return t!==null&&typeof t=="object"?t.valueOf():t}const so=Math.sqrt(50),uo=Math.sqrt(10),lo=Math.sqrt(2);function Zt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=so?10:o>=uo?5:o>=lo?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?Zt(t,e,n*2):[s,u,l]}function co(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,o,a]=r?Zt(e,t,n):Zt(t,e,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function Ie(t,e,n){return e=+e,t=+t,n=+n,Zt(t,e,n)[2]}function fo(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ie(e,t,n):Ie(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function ho(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,o=new Array(i);++r<i;)o[r]=t+r*n;return o}var po={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 Qt(n)}function Qt(t){this._=t}function mo(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}})}Qt.prototype=Xn.prototype={constructor:Qt,on:function(t,e){var n=this._,r=mo(t+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(t=r[o]).type)&&(i=go(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++o<a;)if(i=(t=r[o]).type)n[i]=qn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=qn(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 Qt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};function go(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function qn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=po,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ke="http://www.w3.org/1999/xhtml";const Yn={svg:"http://www.w3.org/2000/svg",xhtml:ke,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function te(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Yn.hasOwnProperty(e)?{space:Yn[e],local:t}:t}function yo(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ke&&e.documentElement.namespaceURI===ke?e.createElement(t):e.createElementNS(n,t)}}function vo(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Wn(t){var e=te(t);return(e.local?vo:yo)(e)}function bo(){}function Be(t){return t==null?bo:function(){return this.querySelector(t)}}function wo(t){typeof t!="function"&&(t=Be(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=new Array(a),u,l,f=0;f<a;++f)(u=o[f])&&(l=t.call(u,u.__data__,f,o))&&("__data__"in u&&(l.__data__=u.__data__),s[f]=l);return new j(r,this._parents)}function _o(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function xo(){return[]}function Jn(t){return t==null?xo:function(){return this.querySelectorAll(t)}}function Ao(t){return function(){return _o(t.apply(this,arguments))}}function Do(t){typeof t=="function"?t=Ao(t):t=Jn(t);for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a=e[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(t.call(u,u.__data__,l,a)),i.push(u));return new j(r,i)}function Kn(t){return function(){return this.matches(t)}}function Zn(t){return function(e){return e.matches(t)}}var $o=Array.prototype.find;function To(t){return function(){return $o.call(this.children,t)}}function So(){return this.firstElementChild}function Co(t){return this.select(t==null?So:To(typeof t=="function"?t:Zn(t)))}var Mo=Array.prototype.filter;function Eo(){return Array.from(this.children)}function Fo(t){return function(){return Mo.call(this.children,t)}}function Lo(t){return this.selectAll(t==null?Eo:Fo(typeof t=="function"?t:Zn(t)))}function Oo(t){typeof t!="function"&&(t=Kn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new j(r,this._parents)}function Qn(t){return new Array(t.length)}function Po(){return new j(this._enter||this._groups.map(Qn),this._parents)}function ee(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}ee.prototype={constructor:ee,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 Ro(t){return function(){return t}}function No(t,e,n,r,i,o){for(var a=0,s,u=e.length,l=o.length;a<l;++a)(s=e[a])?(s.__data__=o[a],r[a]=s):n[a]=new ee(t,o[a]);for(;a<u;++a)(s=e[a])&&(i[a]=s)}function Io(t,e,n,r,i,o,a){var s,u,l=new Map,f=e.length,c=o.length,h=new Array(f),d;for(s=0;s<f;++s)(u=e[s])&&(h[s]=d=a.call(u,u.__data__,s,e)+"",l.has(d)?i[s]=u:l.set(d,u));for(s=0;s<c;++s)d=a.call(t,o[s],s,o)+"",(u=l.get(d))?(r[s]=u,u.__data__=o[s],l.delete(d)):n[s]=new ee(t,o[s]);for(s=0;s<f;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function ko(t){return t.__data__}function Bo(t,e){if(!arguments.length)return Array.from(this,ko);var n=e?Io:No,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ro(t));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var f=r[l],c=i[l],h=c.length,d=Go(t.call(f,f&&f.__data__,l,r)),p=d.length,g=s[l]=new Array(p),_=a[l]=new Array(p),x=u[l]=new Array(h);n(f,c,g,_,x,d,e);for(var A=0,$=0,T,S;A<p;++A)if(T=g[A]){for(A>=$&&($=A+1);!(S=_[$])&&++$<p;);T._next=S||null}}return a=new j(a,r),a._enter=s,a._exit=u,a}function Go(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Vo(){return new j(this._exit||this._groups.map(Qn),this._parents)}function Uo(t,e,n){var r=this.enter(),i=this,o=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function zo(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),u=0;u<a;++u)for(var l=n[u],f=r[u],c=l.length,h=s[u]=new Array(c),d,p=0;p<c;++p)(d=l[p]||f[p])&&(h[p]=d);for(;u<i;++u)s[u]=n[u];return new j(s,this._parents)}function Ho(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function jo(t){t||(t=Xo);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,f=0;f<s;++f)(l=a[f])&&(u[f]=l);u.sort(e)}return new j(i,this._parents).order()}function Xo(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function qo(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Yo(){return Array.from(this)}function Wo(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function Jo(){let t=0;for(const e of this)++t;return t}function Ko(){return!this.node()}function Zo(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&t.call(s,s.__data__,o,i);return this}function Qo(t){return function(){this.removeAttribute(t)}}function ta(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ea(t,e){return function(){this.setAttribute(t,e)}}function na(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ra(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ia(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 oa(t,e){var n=te(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?ta:Qo:typeof e=="function"?n.local?ia:ra:n.local?na:ea)(n,e))}function tr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function aa(t){return function(){this.style.removeProperty(t)}}function sa(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ua(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function la(t,e,n){return arguments.length>1?this.each((e==null?aa:typeof e=="function"?ua:sa)(t,e,n??"")):_t(this.node(),t)}function _t(t,e){return t.style.getPropertyValue(e)||tr(t).getComputedStyle(t,null).getPropertyValue(e)}function ca(t){return function(){delete this[t]}}function fa(t,e){return function(){this[t]=e}}function ha(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function da(t,e){return arguments.length>1?this.each((e==null?ca:typeof e=="function"?ha:fa)(t,e)):this.node()[t]}function er(t){return t.trim().split(/^|\s+/)}function Ge(t){return t.classList||new nr(t)}function nr(t){this._node=t,this._names=er(t.getAttribute("class")||"")}nr.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 rr(t,e){for(var n=Ge(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ir(t,e){for(var n=Ge(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function pa(t){return function(){rr(this,t)}}function ma(t){return function(){ir(this,t)}}function ga(t,e){return function(){(e.apply(this,arguments)?rr:ir)(this,t)}}function ya(t,e){var n=er(t+"");if(arguments.length<2){for(var r=Ge(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?ga:e?pa:ma)(n,e))}function va(){this.textContent=""}function ba(t){return function(){this.textContent=t}}function wa(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function _a(t){return arguments.length?this.each(t==null?va:(typeof t=="function"?wa:ba)(t)):this.node().textContent}function xa(){this.innerHTML=""}function Aa(t){return function(){this.innerHTML=t}}function Da(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function $a(t){return arguments.length?this.each(t==null?xa:(typeof t=="function"?Da:Aa)(t)):this.node().innerHTML}function Ta(){this.nextSibling&&this.parentNode.appendChild(this)}function Sa(){return this.each(Ta)}function Ca(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ma(){return this.each(Ca)}function Ea(t){var e=typeof t=="function"?t:Wn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Fa(){return null}function La(t,e){var n=typeof t=="function"?t:Wn(t),r=e==null?Fa:typeof e=="function"?e:Be(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Oa(){var t=this.parentNode;t&&t.removeChild(this)}function Pa(){return this.each(Oa)}function Ra(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Na(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ia(t){return this.select(t?Na:Ra)}function ka(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ba(t){return function(e){t.call(this,e,this.__data__)}}function Ga(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 Va(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,o;n<i;++n)o=e[n],(!t.type||o.type===t.type)&&o.name===t.name?this.removeEventListener(o.type,o.listener,o.options):e[++r]=o;++r?e.length=r:delete this.__on}}}function Ua(t,e,n){return function(){var r=this.__on,i,o=Ba(e);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=e;return}}this.addEventListener(t.type,o,n),i={type:t.type,name:t.name,value:e,listener:o,options:n},r?r.push(i):this.__on=[i]}}function za(t,e,n){var r=Ga(t+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,f;u<l;++u)for(i=0,f=s[u];i<o;++i)if((a=r[i]).type===f.type&&a.name===f.name)return f.value}return}for(s=e?Ua:Va,i=0;i<o;++i)this.each(s(r[i],e,n));return this}function or(t,e,n){var r=tr(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 Ha(t,e){return function(){return or(this,t,e)}}function ja(t,e){return function(){return or(this,t,e.apply(this,arguments))}}function Xa(t,e){return this.each((typeof e=="function"?ja:Ha)(t,e))}function*qa(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var ar=[null];function j(t,e){this._groups=t,this._parents=e}function Rt(){return new j([[document.documentElement]],ar)}function Ya(){return this}j.prototype=Rt.prototype={constructor:j,select:wo,selectAll:Do,selectChild:Co,selectChildren:Lo,filter:Oo,data:Bo,enter:Po,exit:Vo,join:Uo,merge:zo,selection:Ya,order:Ho,sort:jo,call:qo,nodes:Yo,node:Wo,size:Jo,empty:Ko,each:Zo,attr:oa,style:la,property:da,classed:ya,text:_a,html:$a,raise:Sa,lower:Ma,append:Ea,insert:La,remove:Pa,clone:Ia,datum:ka,on:za,dispatch:Xa,[Symbol.iterator]:qa};function ne(t){return typeof t=="string"?new j([[document.querySelector(t)]],[document.documentElement]):new j([[t]],ar)}function Ve(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Nt(){}var It=.7,re=1/It,xt="\\s*([+-]?\\d+)\\s*",kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",K="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wa=/^#([0-9a-f]{3,8})$/,Ja=new RegExp(`^rgb\\(${xt},${xt},${xt}\\)$`),Ka=new RegExp(`^rgb\\(${K},${K},${K}\\)$`),Za=new RegExp(`^rgba\\(${xt},${xt},${xt},${kt}\\)$`),Qa=new RegExp(`^rgba\\(${K},${K},${K},${kt}\\)$`),ts=new RegExp(`^hsl\\(${kt},${K},${K}\\)$`),es=new RegExp(`^hsla\\(${kt},${K},${K},${kt}\\)$`),ur={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};Ve(Nt,ft,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:lr,formatHex:lr,formatHex8:ns,formatHsl:rs,formatRgb:cr,toString:cr});function lr(){return this.rgb().formatHex()}function ns(){return this.rgb().formatHex8()}function rs(){return mr(this).formatHsl()}function cr(){return this.rgb().formatRgb()}function ft(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Wa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?fr(e):n===3?new z(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?ie(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?ie(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=Ja.exec(t))?new z(e[1],e[2],e[3],1):(e=Ka.exec(t))?new z(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Za.exec(t))?ie(e[1],e[2],e[3],e[4]):(e=Qa.exec(t))?ie(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=ts.exec(t))?pr(e[1],e[2]/100,e[3]/100,1):(e=es.exec(t))?pr(e[1],e[2]/100,e[3]/100,e[4]):ur.hasOwnProperty(t)?fr(ur[t]):t==="transparent"?new z(NaN,NaN,NaN,0):null}function fr(t){return new z(t>>16&255,t>>8&255,t&255,1)}function ie(t,e,n,r){return r<=0&&(t=e=n=NaN),new z(t,e,n,r)}function is(t){return t instanceof Nt||(t=ft(t)),t?(t=t.rgb(),new z(t.r,t.g,t.b,t.opacity)):new z}function Ue(t,e,n,r){return arguments.length===1?is(t):new z(t,e,n,r??1)}function z(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Ve(z,Ue,sr(Nt,{brighter(t){return t=t==null?re:Math.pow(re,t),new z(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?It:Math.pow(It,t),new z(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new z(ht(this.r),ht(this.g),ht(this.b),oe(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:hr,formatHex:hr,formatHex8:os,formatRgb:dr,toString:dr}));function hr(){return`#${dt(this.r)}${dt(this.g)}${dt(this.b)}`}function os(){return`#${dt(this.r)}${dt(this.g)}${dt(this.b)}${dt((isNaN(this.opacity)?1:this.opacity)*255)}`}function dr(){const t=oe(this.opacity);return`${t===1?"rgb(":"rgba("}${ht(this.r)}, ${ht(this.g)}, ${ht(this.b)}${t===1?")":`, ${t})`}`}function oe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ht(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function dt(t){return t=ht(t),(t<16?"0":"")+t.toString(16)}function pr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new q(t,e,n,r)}function mr(t){if(t instanceof q)return new q(t.h,t.s,t.l,t.opacity);if(t instanceof Nt||(t=ft(t)),!t)return new q;if(t instanceof q)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(e===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-e)/s+2:a=(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new q(a,s,u,t.opacity)}function as(t,e,n,r){return arguments.length===1?mr(t):new q(t,e,n,r??1)}function q(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Ve(q,as,sr(Nt,{brighter(t){return t=t==null?re:Math.pow(re,t),new q(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?It:Math.pow(It,t),new q(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 z(ze(t>=240?t-240:t+120,i,r),ze(t,i,r),ze(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new q(gr(this.h),ae(this.s),ae(this.l),oe(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=oe(this.opacity);return`${t===1?"hsl(":"hsla("}${gr(this.h)}, ${ae(this.s)*100}%, ${ae(this.l)*100}%${t===1?")":`, ${t})`}`}}));function gr(t){return t=(t||0)%360,t<0?t+360:t}function ae(t){return Math.max(0,Math.min(1,t||0))}function ze(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 He=t=>()=>t;function ss(t,e){return function(n){return t+n*e}}function us(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 ls(t){return(t=+t)==1?yr:function(e,n){return n-e?us(e,n,t):He(isNaN(e)?n:e)}}function yr(t,e){var n=e-t;return n?ss(t,n):He(isNaN(t)?e:t)}const se=function t(e){var n=ls(e);function r(i,o){var a=n((i=Ue(i)).r,(o=Ue(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=yr(i.opacity,o.opacity);return function(f){return i.r=a(f),i.g=s(f),i.b=u(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function cs(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=t[i]*(1-o)+e[i]*o;return r}}function fs(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function hs(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),o=new Array(n),a;for(a=0;a<r;++a)i[a]=qe(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(s){for(a=0;a<r;++a)o[a]=i[a](s);return o}}function ds(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Y(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ps(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(o){for(i in n)r[i]=n[i](o);return r}}var je=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xe=new RegExp(je.source,"g");function ms(t){return function(){return t}}function gs(t){return function(e){return t(e)+""}}function vr(t,e){var n=je.lastIndex=Xe.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(t=t+"",e=e+"";(r=je.exec(t))&&(i=Xe.exec(e));)(o=i.index)>n&&(o=e.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,u.push({i:a,x:Y(r,i)})),n=Xe.lastIndex;return n<e.length&&(o=e.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?gs(u[0].x):ms(e):(e=u.length,function(l){for(var f=0,c;f<e;++f)s[(c=u[f]).i]=c.x(l);return s.join("")})}function qe(t,e){var n=typeof e,r;return e==null||n==="boolean"?He(e):(n==="number"?Y:n==="string"?(r=ft(e))?(e=r,se):vr:e instanceof ft?se:e instanceof Date?ds:fs(e)?cs:Array.isArray(e)?hs:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ps:Y)(t,e)}function ys(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var br=180/Math.PI,Ye={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wr(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*br,skewX:Math.atan(u)*br,scaleX:a,scaleY:s}}var ue;function vs(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ye:wr(e.a,e.b,e.c,e.d,e.e,e.f)}function bs(t){return t==null||(ue||(ue=document.createElementNS("http://www.w3.org/2000/svg","g")),ue.setAttribute("transform",t),!(t=ue.transform.baseVal.consolidate()))?Ye:(t=t.matrix,wr(t.a,t.b,t.c,t.d,t.e,t.f))}function _r(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,f,c,h,d,p){if(l!==c||f!==h){var g=d.push("translate(",null,e,null,n);p.push({i:g-4,x:Y(l,c)},{i:g-2,x:Y(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function a(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Y(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function s(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Y(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function u(l,f,c,h,d,p){if(l!==c||f!==h){var g=d.push(i(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Y(l,c)},{i:g-2,x:Y(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),o(l.translateX,l.translateY,f.translateX,f.translateY,c,h),a(l.rotate,f.rotate,c,h),s(l.skewX,f.skewX,c,h),u(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(d){for(var p=-1,g=h.length,_;++p<g;)c[(_=h[p]).i]=_.x(d);return c.join("")}}}var ws=_r(vs,"px, ","px)","deg)"),_s=_r(bs,", ",")",")"),At=0,Bt=0,Gt=0,xr=1e3,le,Vt,ce=0,pt=0,fe=0,Ut=typeof performance=="object"&&performance.now?performance:Date,Ar=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function We(){return pt||(Ar(xs),pt=Ut.now()+fe)}function xs(){pt=0}function he(){this._call=this._time=this._next=null}he.prototype=Dr.prototype={constructor:he,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?We():+n)+(e==null?0:+e),!this._next&&Vt!==this&&(Vt?Vt._next=this:le=this,Vt=this),this._call=t,this._time=n,Je()},stop:function(){this._call&&(this._call=null,this._time=1/0,Je())}};function Dr(t,e,n){var r=new he;return r.restart(t,e,n),r}function As(){We(),++At;for(var t=le,e;t;)(e=pt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--At}function $r(){pt=(ce=Ut.now())+fe,At=Bt=0;try{As()}finally{At=0,$s(),pt=0}}function Ds(){var t=Ut.now(),e=t-ce;e>xr&&(fe-=e,ce=t)}function $s(){for(var t,e=le,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:le=n);Vt=t,Je(r)}function Je(t){if(!At){Bt&&(Bt=clearTimeout(Bt));var e=t-pt;e>24?(t<1/0&&(Bt=setTimeout($r,t-Ut.now()-fe)),Gt&&(Gt=clearInterval(Gt))):(Gt||(ce=Ut.now(),Gt=setInterval(Ds,xr)),At=1,Ar($r))}}function Tr(t,e,n){var r=new he;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Ts=Xn("start","end","cancel","interrupt"),Ss=[],Sr=0,Cr=1,Ke=2,de=3,Mr=4,Ze=5,pe=6;function me(t,e,n,r,i,o){var a=t.__transition;if(!a)t.__transition={};else if(n in a)return;Cs(t,n,{name:e,index:r,group:i,on:Ts,tween:Ss,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:Sr})}function Qe(t,e){var n=W(t,e);if(n.state>Sr)throw new Error("too late; already scheduled");return n}function Z(t,e){var n=W(t,e);if(n.state>de)throw new Error("too late; already running");return n}function W(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Cs(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Dr(o,0,n.time);function o(l){n.state=Cr,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var f,c,h,d;if(n.state!==Cr)return u();for(f in r)if(d=r[f],d.name===n.name){if(d.state===de)return Tr(a);d.state===Mr?(d.state=pe,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=pe,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Tr(function(){n.state===de&&(n.state=Mr,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=Ke,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ke){for(n.state=de,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function s(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=Ze,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Ze&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=pe,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Ms(t,e){var n=t.__transition,r,i,o=!0,a;if(n){e=e==null?null:e+"";for(a in n){if((r=n[a]).name!==e){o=!1;continue}i=r.state>Ke&&r.state<Ze,r.state=pe,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[a]}o&&delete t.__transition}}function Es(t){return this.each(function(){Ms(this,t)})}function Fs(t,e){var n,r;return function(){var i=Z(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===e){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function Ls(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Z(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function Os(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=W(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===t)return a.value;return null}return this.each((e==null?Fs:Ls)(n,t,e))}function tn(t,e,n){var r=t._id;return t.each(function(){var i=Z(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return W(i,r).value[e]}}function Er(t,e){var n;return(typeof e=="number"?Y:e instanceof ft?se:(n=ft(e))?(e=n,se):vr)(t,e)}function Ps(t){return function(){this.removeAttribute(t)}}function Rs(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ns(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=e(r=a,n)}}function Is(t,e,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=e(r=a,n)}}function ks(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(t):(a=this.getAttribute(t),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function Bs(t,e,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s)))}}function Gs(t,e){var n=te(t),r=n==="transform"?_s:Er;return this.attrTween(t,typeof e=="function"?(n.local?Bs:ks)(n,r,tn(this,"attr."+t,e)):e==null?(n.local?Rs:Ps)(n):(n.local?Is:Ns)(n,r,e))}function Vs(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Us(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function zs(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Us(t,o)),n}return i._value=e,i}function Hs(t,e){var n,r;function i(){var o=e.apply(this,arguments);return o!==r&&(n=(r=o)&&Vs(t,o)),n}return i._value=e,i}function js(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=te(t);return this.tween(n,(r.local?zs:Hs)(r,e))}function Xs(t,e){return function(){Qe(this,t).delay=+e.apply(this,arguments)}}function qs(t,e){return e=+e,function(){Qe(this,t).delay=e}}function Ys(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xs:qs)(e,t)):W(this.node(),e).delay}function Ws(t,e){return function(){Z(this,t).duration=+e.apply(this,arguments)}}function Js(t,e){return e=+e,function(){Z(this,t).duration=e}}function Ks(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ws:Js)(e,t)):W(this.node(),e).duration}function Zs(t,e){if(typeof e!="function")throw new Error;return function(){Z(this,t).ease=e}}function Qs(t){var e=this._id;return arguments.length?this.each(Zs(e,t)):W(this.node(),e).ease}function tu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Z(this,t).ease=n}}function eu(t){if(typeof t!="function")throw new Error;return this.each(tu(this._id,t))}function nu(t){typeof t!="function"&&(t=Kn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o=e[i],a=o.length,s=r[i]=[],u,l=0;l<a;++l)(u=o[l])&&t.call(u,u.__data__,l,o)&&s.push(u);return new nt(r,this._parents,this._name,this._id)}function ru(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u=e[s],l=n[s],f=u.length,c=a[s]=new Array(f),h,d=0;d<f;++d)(h=u[d]||l[d])&&(c[d]=h);for(;s<r;++s)a[s]=e[s];return new nt(a,this._parents,this._name,this._id)}function iu(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 ou(t,e,n){var r,i,o=iu(e)?Qe:Z;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}function au(t,e){var n=this._id;return arguments.length<2?W(this.node(),n).on.on(t):this.each(ou(n,t,e))}function su(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function uu(){return this.on("end.remove",su(this._id))}function lu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Be(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),f,c,h=0;h<u;++h)(f=s[h])&&(c=t.call(f,f.__data__,h,s))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,me(l[h],e,n,h,l,W(f,n)));return new nt(o,this._parents,e,n)}function cu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jn(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,f,c=0;c<l;++c)if(f=u[c]){for(var h=t.call(f,f.__data__,c,u),d,p=W(f,n),g=0,_=h.length;g<_;++g)(d=h[g])&&me(d,e,n,g,h,p);o.push(h),a.push(f)}return new nt(o,a,e,n)}var fu=Rt.prototype.constructor;function hu(){return new fu(this._groups,this._parents)}function du(t,e){var n,r,i;return function(){var o=_t(this,t),a=(this.style.removeProperty(t),_t(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}function Fr(t){return function(){this.style.removeProperty(t)}}function pu(t,e,n){var r,i=n+"",o;return function(){var a=_t(this,t);return a===i?null:a===r?o:o=e(r=a,n)}}function mu(t,e,n){var r,i,o;return function(){var a=_t(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),_t(this,t))),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}function gu(t,e){var n,r,i,o="style."+e,a="end."+o,s;return function(){var u=Z(this,t),l=u.on,f=u.value[o]==null?s||(s=Fr(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(a,i=f),u.on=r}}function yu(t,e,n){var r=(t+="")=="transform"?ws:Er;return e==null?this.styleTween(t,du(t,r)).on("end.style."+t,Fr(t)):typeof e=="function"?this.styleTween(t,mu(t,r,tn(this,"style."+t,e))).each(gu(this._id,t)):this.styleTween(t,pu(t,r,e),n).on("end.style."+t,null)}function vu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function bu(t,e,n){var r,i;function o(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&vu(t,a,n)),r}return o._value=e,o}function wu(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,bu(t,e,n??""))}function _u(t){return function(){this.textContent=t}}function xu(t){return function(){var e=t(this);this.textContent=e??""}}function Au(t){return this.tween("text",typeof t=="function"?xu(tn(this,"text",t)):_u(t==null?"":t+""))}function Du(t){return function(e){this.textContent=t.call(this,e)}}function $u(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Du(i)),e}return r._value=t,r}function Tu(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,$u(t))}function Su(){for(var t=this._name,e=this._id,n=Lr(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var f=W(u,e);me(u,t,n,l,a,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new nt(r,this._parents,t,n)}function Cu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Z(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&o()})}var Mu=0;function nt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Lr(){return++Mu}var rt=Rt.prototype;nt.prototype={constructor:nt,select:lu,selectAll:cu,selectChild:rt.selectChild,selectChildren:rt.selectChildren,filter:nu,merge:ru,selection:hu,transition:Su,call:rt.call,nodes:rt.nodes,node:rt.node,size:rt.size,empty:rt.empty,each:rt.each,on:au,attr:Gs,attrTween:js,style:yu,styleTween:wu,text:Au,textTween:Tu,remove:uu,tween:Os,delay:Ys,duration:Ks,ease:Qs,easeVarying:eu,end:Cu,[Symbol.iterator]:rt[Symbol.iterator]};function Eu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Fu={time:null,delay:0,duration:250,ease:Eu};function Lu(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 Ou(t){var e,n;t instanceof nt?(e=t._id,t=t._name):(e=Lr(),(n=Fu).time=We(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&me(u,t,e,l,a,n||Lu(u,e));return new nt(r,this._parents,t,e)}Rt.prototype.interrupt=Es,Rt.prototype.transition=Ou;function Pu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ge(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 Dt(t){return t=ge(Math.abs(t)),t?t[1]:NaN}function Ru(t,e){return function(n,r){for(var i=n.length,o=[],a=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(e)}}function Nu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Iu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ye(t){if(!(e=Iu.exec(t)))throw new Error("invalid format: "+t);var e;return new en({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]})}ye.prototype=en.prototype;function en(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+""}en.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 ku(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 Or;function Bu(t,e){var n=ge(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Or=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ge(t,Math.max(0,e+o-1))[0]}function Pr(t,e){var n=ge(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const Rr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Pu,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)=>Pr(t*100,e),r:Pr,s:Bu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Nr(t){return t}var Ir=Array.prototype.map,kr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Gu(t){var e=t.grouping===void 0||t.thousands===void 0?Nr:Ru(Ir.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",r=t.currency===void 0?"":t.currency[1]+"",i=t.decimal===void 0?".":t.decimal+"",o=t.numerals===void 0?Nr:Nu(Ir.call(t.numerals,String)),a=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(c){c=ye(c);var h=c.fill,d=c.align,p=c.sign,g=c.symbol,_=c.zero,x=c.width,A=c.comma,$=c.precision,T=c.trim,S=c.type;S==="n"?(A=!0,S="g"):Rr[S]||($===void 0&&($=12),T=!0,S="g"),(_||h==="0"&&d==="=")&&(_=!0,h="0",d="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",N=g==="$"?r:/[%p]/.test(S)?a:"",I=Rr[S],v=/[defgprs%]/.test(S);$=$===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,$)):Math.max(0,Math.min(20,$));function b(y){var C=k,F=N,V,it,wt;if(S==="c")F=I(y)+F,y="";else{y=+y;var et=y<0||1/y<0;if(y=isNaN(y)?u:I(Math.abs(y),$),T&&(y=ku(y)),et&&+y==0&&p!=="+"&&(et=!1),C=(et?p==="("?p:s:p==="-"||p==="("?"":p)+C,F=(S==="s"?kr[8+Or/3]:"")+F+(et&&p==="("?")":""),v){for(V=-1,it=y.length;++V<it;)if(wt=y.charCodeAt(V),48>wt||wt>57){F=(wt===46?i+y.slice(V+1):y.slice(V))+F,y=y.slice(0,V);break}}}A&&!_&&(y=e(y,1/0));var Se=C.length+y.length+F.length,ot=Se<x?new Array(x-Se+1).join(h):"";switch(A&&_&&(y=e(ot+y,ot.length?x-F.length:1/0),ot=""),d){case"<":y=C+y+F+ot;break;case"=":y=C+ot+y+F;break;case"^":y=ot.slice(0,Se=ot.length>>1)+C+y+F+ot.slice(Se);break;default:y=ot+C+y+F;break}return o(y)}return b.toString=function(){return c+""},b}function f(c,h){var d=l((c=ye(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(Dt(h)/3)))*3,g=Math.pow(10,-p),_=kr[8+p/3];return function(x){return d(g*x)+_}}return{format:l,formatPrefix:f}}var ve,nn,Br;Vu({thousands:",",grouping:[3],currency:["$",""]});function Vu(t){return ve=Gu(t),nn=ve.format,Br=ve.formatPrefix,ve}function Uu(t){return Math.max(0,-Dt(Math.abs(t)))}function zu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Dt(e)/3)))*3-Dt(Math.abs(t)))}function Hu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Dt(e)-Dt(t))+1}function be(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Gr=Symbol("implicit");function Vr(){var t=new Hn,e=[],n=[],r=Gr;function i(o){let a=t.get(o);if(a===void 0){if(r!==Gr)return r;t.set(o,a=e.push(o)-1)}return n[a%n.length]}return i.domain=function(o){if(!arguments.length)return e.slice();e=[],t=new Hn;for(const a of o)t.has(a)||t.set(a,e.push(a)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Vr(e,n).unknown(r)},be.apply(i,arguments),i}function Ur(){var t=Vr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,o,a,s=!1,u=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,g=d?r:i;o=(g-p)/Math.max(1,h-u+l*2),s&&(o=Math.floor(o)),p+=(g-p-o*(h-u))*f,a=o*(1-u),s&&(p=Math.round(p),a=Math.round(a));var _=ho(h).map(function(x){return p+o*x});return n(d?_.reverse():_)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,c()},t.bandwidth=function(){return a},t.step=function(){return o},t.round=function(h){return arguments.length?(s=!!h,c()):s},t.padding=function(h){return arguments.length?(u=Math.min(1,l=+h),c()):u},t.paddingInner=function(h){return arguments.length?(u=Math.min(1,h),c()):u},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return Ur(e(),[r,i]).round(s).paddingInner(u).paddingOuter(l).align(f)},be.apply(c(),arguments)}function zr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return zr(e())},t}function ju(){return zr(Ur.apply(null,arguments).paddingInner(1))}function Xu(t){return function(){return t}}function qu(t){return+t}var Hr=[0,1];function $t(t){return t}function rn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Xu(isNaN(e)?NaN:.5)}function Yu(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Wu(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i<r?(r=rn(i,r),o=n(a,o)):(r=rn(r,i),o=n(o,a)),function(s){return o(r(s))}}function Ju(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<r;)i[a]=rn(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(s){var u=zn(t,s,1,r)-1;return o[u](i[u](s))}}function Ku(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Zu(){var t=Hr,e=Hr,n=qe,r,i,o,a=$t,s,u,l;function f(){var h=Math.min(t.length,e.length);return a!==$t&&(a=Yu(t[0],t[h-1])),s=h>2?Ju:Wu,u=l=null,c}function c(h){return h==null||isNaN(h=+h)?o:(u||(u=s(t.map(r),e,n)))(r(a(h)))}return c.invert=function(h){return a(i((l||(l=s(e,t.map(r),Y)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,qu),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=ys,f()},c.clamp=function(h){return arguments.length?(a=h?!0:$t,f()):a!==$t},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(o=h,c):o},function(h,d){return r=h,i=d,f()}}function Qu(){return Zu()($t,$t)}function tl(t,e,n,r){var i=fo(t,e,n),o;switch(r=ye(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(o=zu(i,a))&&(r.precision=o),Br(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=Hu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=Uu(i))&&(r.precision=o-(r.type==="%")*2);break}}return nn(r)}function jr(t){var e=t.domain;return t.ticks=function(n){var r=e();return co(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,o=r.length-1,a=r[i],s=r[o],u,l,f=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);f-- >0;){if(l=Ie(a,s,n),l===u)return r[i]=a,r[o]=s,e(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function Xr(){var t=Qu();return t.copy=function(){return Ku(t,Xr())},be.apply(t,arguments),jr(t)}function qr(){var t=0,e=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[zn(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return a}return a.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return qr().domain([t,e]).range(i).unknown(o)},be.apply(jr(a),arguments)}function zt(t,e,n){this.k=t,this.x=e,this.y=n}zt.prototype={constructor:zt,scale:function(t){return t===1?this:new zt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new zt(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+")"}},zt.prototype;function el(t,e){return e instanceof Function?e(t):nn(e)(t)}function Ht(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function we(t,e){return`${t}_series${e}`}function on(t,e){return`${t}_group${e}`}function an({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){const r=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((i,o)=>r[o]!=null?r[o]:we(n,o))}function Yr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((o,a)=>i[a]!=null?i[a]:we(`${n}_grid${r}`,a))}function Wr({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,o)=>r[o]!=null?r[o]:on(n,o))}function Jr({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((o,a)=>i[a]!=null?i[a]:on(`${n}_grid${r}`,a))}function Tt(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 _e(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return Tt(e)}function nl(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||H(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return Tt(n)}function sn(t){const n=t.flat().filter(r=>(r==null||H(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return Tt(n)}function rl(t){const n=t.flat().flat().filter(r=>(r==null||H(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return Tt(n)}function il(t,e=2){const r=t.flat().filter((i,o)=>o==e).filter(i=>(i==null||H(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return Tt(r)}function Kr(t,e){if(t==="row")return Object.assign([],e);const n=e.length,r=e.reduce((o,a)=>Math.max(o,a.length),0),i=new Array(r).fill(null).map(()=>new Array(n).fill(null));for(let o=0;o<n;o++)for(let a=0;a<r;a++)i[a][o]=e[o][a];return i}function jt(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function Zr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function un(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Zr(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),f=(t.width-r*(o-1))/o,c=(t.height-r*(i-1))/i,h=u*f+u*r,d=l*c+l*r;return{slotIndex:s,rowIndex:l,columnIndex:u,startX:h,startY:d,centerX:h+f/2,centerY:d+c/2,width:f,height:c}})}function xe(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:o}=e.rowAmount*e.columnAmount>=n?e:Zr(n);return new Array(n).fill(null).map((a,s)=>{const u=s%o,l=Math.floor(s/o),f=(t.width-r*(o-1))/o,c=(t.height-r*(i-1))/i,h=u*f+u*r,d=l*c+l*r,p=[h,d],g=[f/t.width,c/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:p,scale:g}})}const ol=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const o=(a,s,u,l)=>{const f=Ht(n.type,s,u),c=n.seriesLabels[s]||we("series",s),h=jt(s,r);return typeof a=="number"?{id:f,index:l,seq:0,label:f,description:"",data:{},value:a,seriesIndex:s,seriesLabel:c,color:h,visible:!0}:{id:a.id?a.id:f,index:l,seq:0,label:a.label?a.label:f,description:a.description,data:a.data??{},value:a.value,seriesIndex:s,seriesLabel:c,color:h,visible:!0}};i=e.map((a,s)=>Array.isArray(a)?a.map((u,l)=>o(u,s,l,i.length+l)):o(a,s,0,i.length)).flat().sort(n.sort??void 0).map((a,s)=>(a.seq=s,a)).map(a=>(a.visible=n.visibleFilter(a,t),a)).sort((a,s)=>a.index-s.index).reduce((a,s)=>(a[s.seriesIndex]||(a[s.seriesIndex]=[]),a[s.seriesIndex].push(s),a),[])}catch(o){throw Error(o)}return i},al=t=>E({data:t},{data:{toBe:"(DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]",test:n=>Array.isArray(n)}});var ln=function(t,e){return ln=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])},ln(t,e)};function Q(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ln(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(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{l(r.next(f))}catch(c){a(c)}}function u(f){try{l(r.throw(f))}catch(c){a(c)}}function l(f){f.done?o(f.value):i(f.value).then(s,u)}l((r=r.apply(t,e||[])).next())})}function Qr(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(f){return u([l,f])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(f){l=[6,f],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function St(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 ut(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function lt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}function Ct(t){return this instanceof Ct?(this.v=t,this):new Ct(t)}function ul(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(d){return function(p){return Promise.resolve(p).then(d,c)}}function s(d,p){r[d]&&(i[d]=function(g){return new Promise(function(_,x){o.push([d,g,_,x])>1||u(d,g)})},p&&(i[d]=p(i[d])))}function u(d,p){try{l(r[d](p))}catch(g){h(o[0][3],g)}}function l(d){d.value instanceof Ct?Promise.resolve(d.value.v).then(f,c):h(o[0][2],d)}function f(d){u("next",d)}function c(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[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 St=="function"?St(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=t[o]&&function(a){return new Promise(function(s,u){a=t[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function P(t){return typeof t=="function"}function cn(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 fn=cn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
1
|
+
(function(g,ot){typeof exports=="object"&&typeof module<"u"?ot(exports):typeof define=="function"&&define.amd?define(["exports"],ot):(g=typeof globalThis<"u"?globalThis:g||self,ot(g["orbcharts-core"]={}))})(this,function(g){"use strict";const ot={width:"auto",height:"auto"},Me={top:60,right:60,bottom:60,left:60},Ce={padding:Me,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},Gn=800,Xn=500,Wi=[],Ji=[],Ki=[],Zi=[],Qi=[],ta={nodes:[],edges:[]},V={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Yn={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},kt={gap:120,rowAmount:1,columnAmount:1},Fe={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...kt},separateSeries:!1,sumSeries:!1};Fe.visibleFilter.toString=()=>"(datum, context) => true";const Ee={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...V},groupAxis:{...Yn},separateSeries:!1},Le={type:"grid",visibleFilter:(t,e)=>!0,grid:{...Ee},container:{...kt}};Le.visibleFilter.toString=()=>"(datum, context) => true";const Bt={...Ee},Oe={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...Bt}],separateGrid:!1,container:{...kt}};Oe.visibleFilter.toString=()=>"(datum, context) => true";const Pe={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],xAxis:{...V},yAxis:{...V},container:{...kt},separateCategory:!1};Pe.visibleFilter.toString=()=>"(datum, context) => true";const Re={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};Re.visibleFilter.toString=()=>"(datum, context) => true";const Ne={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ne.visibleFilter.toString=()=>"(datum, context) => true";function U(t){return Object.prototype.toString.call(t)==="[object Object]"}function Un(t){return Object.prototype.toString.call(t)==="[object Function]"}function Hn(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 s;U(r[o])&&U(i[o])?(s=n(r[o],i[o]),a[o]=s):a[o]=r[o]}return a};return n(t,e)}function ea(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 na(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=>Un(a),null:a=>a===null,undefined:a=>a===void 0},r={ColorType:a=>a==="none"||a==="series"||a==="primary"||a==="secondary"||a==="white"||a==="background"};return Object.keys(t).find(a=>{if(e[a]){const o=e[a],s=t[a];if(o.toBeTypes){if(o.toBeTypes.some(f=>n[f](s))===!1)return!0}else if(o.toBe){const{toBe:u,test:l}=o;if(l(s)===!1)return!0}else if(o.toBeOption){const u=o.toBeOption;if(r[u](s)===!1)return!0}}return!1})}function F(t,e){const n=na(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 ra=t=>{const e=F(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=F(t.container,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e};function Qt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ia(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zn(t){let e,n,r;t.length!==2?(e=Qt,n=(s,u)=>Qt(t(s),u),r=(s,u)=>t(s)-u):(e=t===Qt||t===ia?t:aa,n=t,r=t);function i(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<0?l=c+1:f=c}while(l<f)}return l}function a(s,u,l=0,f=s.length){if(l<f){if(e(u,u)!==0)return f;do{const c=l+f>>>1;n(s[c],u)<=0?l=c+1:f=c}while(l<f)}return l}function o(s,u,l=0,f=s.length){const c=i(s,u,l,f-1);return c>l&&r(s[c-1],u)>-r(s[c],u)?c-1:c}return{left:i,center:o,right:a}}function aa(){return 0}function oa(t){return t===null?NaN:+t}const jn=zn(Qt).right;zn(oa).center;class qn extends Map{constructor(e,n=la){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(Wn(this,e))}has(e){return super.has(Wn(this,e))}set(e,n){return super.set(sa(this,e),n)}delete(e){return super.delete(ua(this,e))}}function Wn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function sa({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function ua({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function la(t){return t!==null&&typeof t=="object"?t.valueOf():t}const ca=Math.sqrt(50),fa=Math.sqrt(10),ha=Math.sqrt(2);function te(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>=ca?10:a>=fa?5:a>=ha?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),u=Math.round(e*l),s/l<t&&++s,u/l>e&&--u,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),u=Math.round(e/l),s*l<t&&++s,u*l>e&&--u),u<s&&.5<=n&&n<2?te(t,e,n*2):[s,u,l]}function pa(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?te(e,t,n):te(t,e,n);if(!(a>=i))return[];const s=a-i+1,u=new Array(s);if(r)if(o<0)for(let l=0;l<s;++l)u[l]=(a-l)/-o;else for(let l=0;l<s;++l)u[l]=(a-l)*o;else if(o<0)for(let l=0;l<s;++l)u[l]=(i+l)/-o;else for(let l=0;l<s;++l)u[l]=(i+l)*o;return u}function Ie(t,e,n){return e=+e,t=+t,n=+n,te(t,e,n)[2]}function da(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ie(e,t,n):Ie(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function ma(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 ga={value:()=>{}};function Jn(){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 ee(n)}function ee(t){this._=t}function ya(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}})}ee.prototype=Jn.prototype={constructor:ee,on:function(t,e){var n=this._,r=ya(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=va(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]=Kn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Kn(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 ee(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 va(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Kn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ga,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var ke="http://www.w3.org/1999/xhtml";const Zn={svg:"http://www.w3.org/2000/svg",xhtml:ke,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ne(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Zn.hasOwnProperty(e)?{space:Zn[e],local:t}:t}function ba(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===ke&&e.documentElement.namespaceURI===ke?e.createElement(t):e.createElementNS(n,t)}}function wa(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Qn(t){var e=ne(t);return(e.local?wa:ba)(e)}function Da(){}function Be(t){return t==null?Da:function(){return this.querySelector(t)}}function xa(t){typeof t!="function"&&(t=Be(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,s=r[i]=new Array(o),u,l,f=0;f<o;++f)(u=a[f])&&(l=t.call(u,u.__data__,f,a))&&("__data__"in u&&(l.__data__=u.__data__),s[f]=l);return new z(r,this._parents)}function _a(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Aa(){return[]}function tr(t){return t==null?Aa:function(){return this.querySelectorAll(t)}}function $a(t){return function(){return _a(t.apply(this,arguments))}}function Ta(t){typeof t=="function"?t=$a(t):t=tr(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],s=o.length,u,l=0;l<s;++l)(u=o[l])&&(r.push(t.call(u,u.__data__,l,o)),i.push(u));return new z(r,i)}function er(t){return function(){return this.matches(t)}}function nr(t){return function(e){return e.matches(t)}}var Sa=Array.prototype.find;function Ma(t){return function(){return Sa.call(this.children,t)}}function Ca(){return this.firstElementChild}function Fa(t){return this.select(t==null?Ca:Ma(typeof t=="function"?t:nr(t)))}var Ea=Array.prototype.filter;function La(){return Array.from(this.children)}function Oa(t){return function(){return Ea.call(this.children,t)}}function Pa(t){return this.selectAll(t==null?La:Oa(typeof t=="function"?t:nr(t)))}function Ra(t){typeof t!="function"&&(t=er(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,s=r[i]=[],u,l=0;l<o;++l)(u=a[l])&&t.call(u,u.__data__,l,a)&&s.push(u);return new z(r,this._parents)}function rr(t){return new Array(t.length)}function Na(){return new z(this._enter||this._groups.map(rr),this._parents)}function re(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}re.prototype={constructor:re,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 Ia(t){return function(){return t}}function ka(t,e,n,r,i,a){for(var o=0,s,u=e.length,l=a.length;o<l;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new re(t,a[o]);for(;o<u;++o)(s=e[o])&&(i[o]=s)}function Ba(t,e,n,r,i,a,o){var s,u,l=new Map,f=e.length,c=a.length,h=new Array(f),p;for(s=0;s<f;++s)(u=e[s])&&(h[s]=p=o.call(u,u.__data__,s,e)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<c;++s)p=o.call(t,a[s],s,a)+"",(u=l.get(p))?(r[s]=u,u.__data__=a[s],l.delete(p)):n[s]=new re(t,a[s]);for(s=0;s<f;++s)(u=e[s])&&l.get(h[s])===u&&(i[s]=u)}function Va(t){return t.__data__}function Ga(t,e){if(!arguments.length)return Array.from(this,Va);var n=e?Ba:ka,r=this._parents,i=this._groups;typeof t!="function"&&(t=Ia(t));for(var a=i.length,o=new Array(a),s=new Array(a),u=new Array(a),l=0;l<a;++l){var f=r[l],c=i[l],h=c.length,p=Xa(t.call(f,f&&f.__data__,l,r)),d=p.length,m=s[l]=new Array(d),b=o[l]=new Array(d),x=u[l]=new Array(h);n(f,c,m,b,x,p,e);for(var T=0,A=0,E,$;T<d;++T)if(E=m[T]){for(T>=A&&(A=T+1);!($=b[A])&&++A<d;);E._next=$||null}}return o=new z(o,r),o._enter=s,o._exit=u,o}function Xa(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ya(){return new z(this._exit||this._groups.map(rr),this._parents)}function Ua(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 Ha(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),s=new Array(i),u=0;u<o;++u)for(var l=n[u],f=r[u],c=l.length,h=s[u]=new Array(c),p,d=0;d<c;++d)(p=l[d]||f[d])&&(h[d]=p);for(;u<i;++u)s[u]=n[u];return new z(s,this._parents)}function za(){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 ja(t){t||(t=qa);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,u=i[a]=new Array(s),l,f=0;f<s;++f)(l=o[f])&&(u[f]=l);u.sort(e)}return new z(i,this._parents).order()}function qa(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Wa(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Ja(){return Array.from(this)}function Ka(){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 Za(){let t=0;for(const e of this)++t;return t}function Qa(){return!this.node()}function to(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&t.call(s,s.__data__,a,i);return this}function eo(t){return function(){this.removeAttribute(t)}}function no(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ro(t,e){return function(){this.setAttribute(t,e)}}function io(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ao(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function oo(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 so(t,e){var n=ne(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?no:eo:typeof e=="function"?n.local?oo:ao:n.local?io:ro)(n,e))}function ir(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function uo(t){return function(){this.style.removeProperty(t)}}function lo(t,e,n){return function(){this.style.setProperty(t,e,n)}}function co(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function fo(t,e,n){return arguments.length>1?this.each((e==null?uo:typeof e=="function"?co:lo)(t,e,n??"")):xt(this.node(),t)}function xt(t,e){return t.style.getPropertyValue(e)||ir(t).getComputedStyle(t,null).getPropertyValue(e)}function ho(t){return function(){delete this[t]}}function po(t,e){return function(){this[t]=e}}function mo(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function go(t,e){return arguments.length>1?this.each((e==null?ho:typeof e=="function"?mo:po)(t,e)):this.node()[t]}function ar(t){return t.trim().split(/^|\s+/)}function Ve(t){return t.classList||new or(t)}function or(t){this._node=t,this._names=ar(t.getAttribute("class")||"")}or.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 sr(t,e){for(var n=Ve(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ur(t,e){for(var n=Ve(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function yo(t){return function(){sr(this,t)}}function vo(t){return function(){ur(this,t)}}function bo(t,e){return function(){(e.apply(this,arguments)?sr:ur)(this,t)}}function wo(t,e){var n=ar(t+"");if(arguments.length<2){for(var r=Ve(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?bo:e?yo:vo)(n,e))}function Do(){this.textContent=""}function xo(t){return function(){this.textContent=t}}function _o(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ao(t){return arguments.length?this.each(t==null?Do:(typeof t=="function"?_o:xo)(t)):this.node().textContent}function $o(){this.innerHTML=""}function To(t){return function(){this.innerHTML=t}}function So(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Mo(t){return arguments.length?this.each(t==null?$o:(typeof t=="function"?So:To)(t)):this.node().innerHTML}function Co(){this.nextSibling&&this.parentNode.appendChild(this)}function Fo(){return this.each(Co)}function Eo(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Lo(){return this.each(Eo)}function Oo(t){var e=typeof t=="function"?t:Qn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Po(){return null}function Ro(t,e){var n=typeof t=="function"?t:Qn(t),r=e==null?Po:typeof e=="function"?e:Be(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function No(){var t=this.parentNode;t&&t.removeChild(this)}function Io(){return this.each(No)}function ko(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Bo(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Vo(t){return this.select(t?Bo:ko)}function Go(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Xo(t){return function(e){t.call(this,e,this.__data__)}}function Yo(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 Uo(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Ho(t,e,n){return function(){var r=this.__on,i,a=Xo(e);if(r){for(var o=0,s=r.length;o<s;++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 zo(t,e,n){var r=Yo(t+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,f;u<l;++u)for(i=0,f=s[u];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(s=e?Ho:Uo,i=0;i<a;++i)this.each(s(r[i],e,n));return this}function lr(t,e,n){var r=ir(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 jo(t,e){return function(){return lr(this,t,e)}}function qo(t,e){return function(){return lr(this,t,e.apply(this,arguments))}}function Wo(t,e){return this.each((typeof e=="function"?qo:jo)(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 cr=[null];function z(t,e){this._groups=t,this._parents=e}function Vt(){return new z([[document.documentElement]],cr)}function Ko(){return this}z.prototype=Vt.prototype={constructor:z,select:xa,selectAll:Ta,selectChild:Fa,selectChildren:Pa,filter:Ra,data:Ga,enter:Na,exit:Ya,join:Ua,merge:Ha,selection:Ko,order:za,sort:ja,call:Wa,nodes:Ja,node:Ka,size:Za,empty:Qa,each:to,attr:so,style:fo,property:go,classed:wo,text:Ao,html:Mo,raise:Fo,lower:Lo,append:Oo,insert:Ro,remove:Io,clone:Vo,datum:Go,on:zo,dispatch:Wo,[Symbol.iterator]:Jo};function ie(t){return typeof t=="string"?new z([[document.querySelector(t)]],[document.documentElement]):new z([[t]],cr)}function Ge(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function fr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Gt(){}var Xt=.7,ae=1/Xt,_t="\\s*([+-]?\\d+)\\s*",Yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Q="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zo=/^#([0-9a-f]{3,8})$/,Qo=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),ts=new RegExp(`^rgb\\(${Q},${Q},${Q}\\)$`),es=new RegExp(`^rgba\\(${_t},${_t},${_t},${Yt}\\)$`),ns=new RegExp(`^rgba\\(${Q},${Q},${Q},${Yt}\\)$`),rs=new RegExp(`^hsl\\(${Yt},${Q},${Q}\\)$`),is=new RegExp(`^hsla\\(${Yt},${Q},${Q},${Yt}\\)$`),hr={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};Ge(Gt,pt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:pr,formatHex:pr,formatHex8:as,formatHsl:os,formatRgb:dr,toString:dr});function pr(){return this.rgb().formatHex()}function as(){return this.rgb().formatHex8()}function os(){return br(this).formatHsl()}function dr(){return this.rgb().formatRgb()}function pt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Zo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?mr(e):n===3?new H(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?oe(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?oe(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=ts.exec(t))?new H(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=es.exec(t))?oe(e[1],e[2],e[3],e[4]):(e=ns.exec(t))?oe(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=rs.exec(t))?vr(e[1],e[2]/100,e[3]/100,1):(e=is.exec(t))?vr(e[1],e[2]/100,e[3]/100,e[4]):hr.hasOwnProperty(t)?mr(hr[t]):t==="transparent"?new H(NaN,NaN,NaN,0):null}function mr(t){return new H(t>>16&255,t>>8&255,t&255,1)}function oe(t,e,n,r){return r<=0&&(t=e=n=NaN),new H(t,e,n,r)}function ss(t){return t instanceof Gt||(t=pt(t)),t?(t=t.rgb(),new H(t.r,t.g,t.b,t.opacity)):new H}function Xe(t,e,n,r){return arguments.length===1?ss(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}Ge(H,Xe,fr(Gt,{brighter(t){return t=t==null?ae:Math.pow(ae,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(dt(this.r),dt(this.g),dt(this.b),se(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:gr,formatHex:gr,formatHex8:us,formatRgb:yr,toString:yr}));function gr(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}`}function us(){return`#${mt(this.r)}${mt(this.g)}${mt(this.b)}${mt((isNaN(this.opacity)?1:this.opacity)*255)}`}function yr(){const t=se(this.opacity);return`${t===1?"rgb(":"rgba("}${dt(this.r)}, ${dt(this.g)}, ${dt(this.b)}${t===1?")":`, ${t})`}`}function se(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function dt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mt(t){return t=dt(t),(t<16?"0":"")+t.toString(16)}function vr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new q(t,e,n,r)}function br(t){if(t instanceof q)return new q(t.h,t.s,t.l,t.opacity);if(t instanceof Gt||(t=pt(t)),!t)return new q;if(t instanceof q)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,s=a-i,u=(a+i)/2;return s?(e===a?o=(n-r)/s+(n<r)*6:n===a?o=(r-e)/s+2:o=(e-n)/s+4,s/=u<.5?a+i:2-a-i,o*=60):s=u>0&&u<1?0:o,new q(o,s,u,t.opacity)}function ls(t,e,n,r){return arguments.length===1?br(t):new q(t,e,n,r??1)}function q(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}Ge(q,ls,fr(Gt,{brighter(t){return t=t==null?ae:Math.pow(ae,t),new q(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Xt:Math.pow(Xt,t),new q(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(Ye(t>=240?t-240:t+120,i,r),Ye(t,i,r),Ye(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new q(wr(this.h),ue(this.s),ue(this.l),se(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=se(this.opacity);return`${t===1?"hsl(":"hsla("}${wr(this.h)}, ${ue(this.s)*100}%, ${ue(this.l)*100}%${t===1?")":`, ${t})`}`}}));function wr(t){return t=(t||0)%360,t<0?t+360:t}function ue(t){return Math.max(0,Math.min(1,t||0))}function Ye(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 Ue=t=>()=>t;function cs(t,e){return function(n){return t+n*e}}function fs(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 hs(t){return(t=+t)==1?Dr:function(e,n){return n-e?fs(e,n,t):Ue(isNaN(e)?n:e)}}function Dr(t,e){var n=e-t;return n?cs(t,n):Ue(isNaN(t)?e:t)}const le=function t(e){var n=hs(e);function r(i,a){var o=n((i=Xe(i)).r,(a=Xe(a)).r),s=n(i.g,a.g),u=n(i.b,a.b),l=Dr(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=u(f),i.opacity=l(f),i+""}}return r.gamma=t,r}(1);function ps(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 ds(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function ms(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]=je(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(s){for(o=0;o<r;++o)a[o]=i[o](s);return a}}function gs(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function W(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function ys(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]=je(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var He=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ze=new RegExp(He.source,"g");function vs(t){return function(){return t}}function bs(t){return function(e){return t(e)+""}}function xr(t,e){var n=He.lastIndex=ze.lastIndex=0,r,i,a,o=-1,s=[],u=[];for(t=t+"",e=e+"";(r=He.exec(t))&&(i=ze.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,u.push({i:o,x:W(r,i)})),n=ze.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?u[0]?bs(u[0].x):vs(e):(e=u.length,function(l){for(var f=0,c;f<e;++f)s[(c=u[f]).i]=c.x(l);return s.join("")})}function je(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ue(e):(n==="number"?W:n==="string"?(r=pt(e))?(e=r,le):xr:e instanceof pt?le:e instanceof Date?gs:ds(e)?ps:Array.isArray(e)?ms:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ys:W)(t,e)}function ws(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var _r=180/Math.PI,qe={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ar(t,e,n,r,i,a){var o,s,u;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*_r,skewX:Math.atan(u)*_r,scaleX:o,scaleY:s}}var ce;function Ds(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?qe:Ar(e.a,e.b,e.c,e.d,e.e,e.f)}function xs(t){return t==null||(ce||(ce=document.createElementNS("http://www.w3.org/2000/svg","g")),ce.setAttribute("transform",t),!(t=ce.transform.baseVal.consolidate()))?qe:(t=t.matrix,Ar(t.a,t.b,t.c,t.d,t.e,t.f))}function $r(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,f,c,h,p,d){if(l!==c||f!==h){var m=p.push("translate(",null,e,null,n);d.push({i:m-4,x:W(l,c)},{i:m-2,x:W(f,h)})}else(c||h)&&p.push("translate("+c+e+h+n)}function o(l,f,c,h){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:W(l,f)})):f&&c.push(i(c)+"rotate("+f+r)}function s(l,f,c,h){l!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:W(l,f)}):f&&c.push(i(c)+"skewX("+f+r)}function u(l,f,c,h,p,d){if(l!==c||f!==h){var m=p.push(i(p)+"scale(",null,",",null,")");d.push({i:m-4,x:W(l,c)},{i:m-2,x:W(f,h)})}else(c!==1||h!==1)&&p.push(i(p)+"scale("+c+","+h+")")}return function(l,f){var c=[],h=[];return l=t(l),f=t(f),a(l.translateX,l.translateY,f.translateX,f.translateY,c,h),o(l.rotate,f.rotate,c,h),s(l.skewX,f.skewX,c,h),u(l.scaleX,l.scaleY,f.scaleX,f.scaleY,c,h),l=f=null,function(p){for(var d=-1,m=h.length,b;++d<m;)c[(b=h[d]).i]=b.x(p);return c.join("")}}}var _s=$r(Ds,"px, ","px)","deg)"),As=$r(xs,", ",")",")"),At=0,Ut=0,Ht=0,Tr=1e3,fe,zt,he=0,gt=0,pe=0,jt=typeof performance=="object"&&performance.now?performance:Date,Sr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function We(){return gt||(Sr($s),gt=jt.now()+pe)}function $s(){gt=0}function de(){this._call=this._time=this._next=null}de.prototype=Mr.prototype={constructor:de,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?We():+n)+(e==null?0:+e),!this._next&&zt!==this&&(zt?zt._next=this:fe=this,zt=this),this._call=t,this._time=n,Je()},stop:function(){this._call&&(this._call=null,this._time=1/0,Je())}};function Mr(t,e,n){var r=new de;return r.restart(t,e,n),r}function Ts(){We(),++At;for(var t=fe,e;t;)(e=gt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--At}function Cr(){gt=(he=jt.now())+pe,At=Ut=0;try{Ts()}finally{At=0,Ms(),gt=0}}function Ss(){var t=jt.now(),e=t-he;e>Tr&&(pe-=e,he=t)}function Ms(){for(var t,e=fe,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:fe=n);zt=t,Je(r)}function Je(t){if(!At){Ut&&(Ut=clearTimeout(Ut));var e=t-gt;e>24?(t<1/0&&(Ut=setTimeout(Cr,t-jt.now()-pe)),Ht&&(Ht=clearInterval(Ht))):(Ht||(he=jt.now(),Ht=setInterval(Ss,Tr)),At=1,Sr(Cr))}}function Fr(t,e,n){var r=new de;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Cs=Jn("start","end","cancel","interrupt"),Fs=[],Er=0,Lr=1,Ke=2,me=3,Or=4,Ze=5,ge=6;function ye(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Es(t,n,{name:e,index:r,group:i,on:Cs,tween:Fs,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Er})}function Qe(t,e){var n=J(t,e);if(n.state>Er)throw new Error("too late; already scheduled");return n}function tt(t,e){var n=J(t,e);if(n.state>me)throw new Error("too late; already running");return n}function J(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Es(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Mr(a,0,n.time);function a(l){n.state=Lr,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var f,c,h,p;if(n.state!==Lr)return u();for(f in r)if(p=r[f],p.name===n.name){if(p.state===me)return Fr(o);p.state===Or?(p.state=ge,p.timer.stop(),p.on.call("interrupt",t,t.__data__,p.index,p.group),delete r[f]):+f<e&&(p.state=ge,p.timer.stop(),p.on.call("cancel",t,t.__data__,p.index,p.group),delete r[f])}if(Fr(function(){n.state===me&&(n.state=Or,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=Ke,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Ke){for(n.state=me,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(p=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=p);i.length=c+1}}function s(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=Ze,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Ze&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){n.state=ge,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Ls(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>Ke&&r.state<Ze,r.state=ge,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Os(t){return this.each(function(){Ls(this,t)})}function Ps(t,e){var n,r;return function(){var i=tt(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Rs(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=tt(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}a.tween=i}}function Ns(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=J(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?Ps:Rs)(n,t,e))}function tn(t,e,n){var r=t._id;return t.each(function(){var i=tt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return J(i,r).value[e]}}function Pr(t,e){var n;return(typeof e=="number"?W:e instanceof pt?le:(n=pt(e))?(e=n,le):xr)(t,e)}function Is(t){return function(){this.removeAttribute(t)}}function ks(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Bs(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 Vs(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 Gs(t,e,n){var r,i,a;return function(){var o,s=n(this),u;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),u=s+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s)))}}function Xs(t,e,n){var r,i,a;return function(){var o,s=n(this),u;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),u=s+"",o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s)))}}function Ys(t,e){var n=ne(t),r=n==="transform"?As:Pr;return this.attrTween(t,typeof e=="function"?(n.local?Xs:Gs)(n,r,tn(this,"attr."+t,e)):e==null?(n.local?ks:Is)(n):(n.local?Vs:Bs)(n,r,e))}function Us(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Hs(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function zs(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Hs(t,a)),n}return i._value=e,i}function js(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Us(t,a)),n}return i._value=e,i}function qs(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=ne(t);return this.tween(n,(r.local?zs:js)(r,e))}function Ws(t,e){return function(){Qe(this,t).delay=+e.apply(this,arguments)}}function Js(t,e){return e=+e,function(){Qe(this,t).delay=e}}function Ks(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ws:Js)(e,t)):J(this.node(),e).delay}function Zs(t,e){return function(){tt(this,t).duration=+e.apply(this,arguments)}}function Qs(t,e){return e=+e,function(){tt(this,t).duration=e}}function tu(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Zs:Qs)(e,t)):J(this.node(),e).duration}function eu(t,e){if(typeof e!="function")throw new Error;return function(){tt(this,t).ease=e}}function nu(t){var e=this._id;return arguments.length?this.each(eu(e,t)):J(this.node(),e).ease}function ru(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;tt(this,t).ease=n}}function iu(t){if(typeof t!="function")throw new Error;return this.each(ru(this._id,t))}function au(t){typeof t!="function"&&(t=er(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,s=r[i]=[],u,l=0;l<o;++l)(u=a[l])&&t.call(u,u.__data__,l,a)&&s.push(u);return new nt(r,this._parents,this._name,this._id)}function ou(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),s=0;s<a;++s)for(var u=e[s],l=n[s],f=u.length,c=o[s]=new Array(f),h,p=0;p<f;++p)(h=u[p]||l[p])&&(c[p]=h);for(;s<r;++s)o[s]=e[s];return new nt(o,this._parents,this._name,this._id)}function su(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 uu(t,e,n){var r,i,a=su(e)?Qe:tt;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}function lu(t,e){var n=this._id;return arguments.length<2?J(this.node(),n).on.on(t):this.each(uu(n,t,e))}function cu(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function fu(){return this.on("end.remove",cu(this._id))}function hu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Be(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var s=r[o],u=s.length,l=a[o]=new Array(u),f,c,h=0;h<u;++h)(f=s[h])&&(c=t.call(f,f.__data__,h,s))&&("__data__"in f&&(c.__data__=f.__data__),l[h]=c,ye(l[h],e,n,h,l,J(f,n)));return new nt(a,this._parents,e,n)}function pu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=tr(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var u=r[s],l=u.length,f,c=0;c<l;++c)if(f=u[c]){for(var h=t.call(f,f.__data__,c,u),p,d=J(f,n),m=0,b=h.length;m<b;++m)(p=h[m])&&ye(p,e,n,m,h,d);a.push(h),o.push(f)}return new nt(a,o,e,n)}var du=Vt.prototype.constructor;function mu(){return new du(this._groups,this._parents)}function gu(t,e){var n,r,i;return function(){var a=xt(this,t),o=(this.style.removeProperty(t),xt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Rr(t){return function(){this.style.removeProperty(t)}}function yu(t,e,n){var r,i=n+"",a;return function(){var o=xt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function vu(t,e,n){var r,i,a;return function(){var o=xt(this,t),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(t),xt(this,t))),o===u?null:o===r&&u===i?a:(i=u,a=e(r=o,s))}}function bu(t,e){var n,r,i,a="style."+e,o="end."+a,s;return function(){var u=tt(this,t),l=u.on,f=u.value[a]==null?s||(s=Rr(e)):void 0;(l!==n||i!==f)&&(r=(n=l).copy()).on(o,i=f),u.on=r}}function wu(t,e,n){var r=(t+="")=="transform"?_s:Pr;return e==null?this.styleTween(t,gu(t,r)).on("end.style."+t,Rr(t)):typeof e=="function"?this.styleTween(t,vu(t,r,tn(this,"style."+t,e))).each(bu(this._id,t)):this.styleTween(t,yu(t,r,e),n).on("end.style."+t,null)}function Du(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function xu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Du(t,o,n)),r}return a._value=e,a}function _u(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,xu(t,e,n??""))}function Au(t){return function(){this.textContent=t}}function $u(t){return function(){var e=t(this);this.textContent=e??""}}function Tu(t){return this.tween("text",typeof t=="function"?$u(tn(this,"text",t)):Au(t==null?"":t+""))}function Su(t){return function(e){this.textContent=t.call(this,e)}}function Mu(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Su(i)),e}return r._value=t,r}function Cu(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,Mu(t))}function Fu(){for(var t=this._name,e=this._id,n=Nr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,u,l=0;l<s;++l)if(u=o[l]){var f=J(u,e);ye(u,t,n,l,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new nt(r,this._parents,t,n)}function Eu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},u={value:function(){--i===0&&a()}};n.each(function(){var l=tt(this,r),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),l.on=e}),i===0&&a()})}var Lu=0;function nt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Nr(){return++Lu}var rt=Vt.prototype;nt.prototype={constructor:nt,select:hu,selectAll:pu,selectChild:rt.selectChild,selectChildren:rt.selectChildren,filter:au,merge:ou,selection:mu,transition:Fu,call:rt.call,nodes:rt.nodes,node:rt.node,size:rt.size,empty:rt.empty,each:rt.each,on:lu,attr:Ys,attrTween:qs,style:wu,styleTween:_u,text:Tu,textTween:Cu,remove:fu,tween:Ns,delay:Ks,duration:tu,ease:nu,easeVarying:iu,end:Eu,[Symbol.iterator]:rt[Symbol.iterator]};function Ou(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Pu={time:null,delay:0,duration:250,ease:Ou};function Ru(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 Nu(t){var e,n;t instanceof nt?(e=t._id,t=t._name):(e=Nr(),(n=Pu).time=We(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,u,l=0;l<s;++l)(u=o[l])&&ye(u,t,e,l,o,n||Ru(u,e));return new nt(r,this._parents,t,e)}Vt.prototype.interrupt=Os,Vt.prototype.transition=Nu;function Iu(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function ve(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 $t(t){return t=ve(Math.abs(t)),t?t[1]:NaN}function ku(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),a.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Bu(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Vu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function be(t){if(!(e=Vu.exec(t)))throw new Error("invalid format: "+t);var e;return new en({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]})}be.prototype=en.prototype;function en(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+""}en.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 Gu(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 Ir;function Xu(t,e){var n=ve(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Ir=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")+ve(t,Math.max(0,e+a-1))[0]}function kr(t,e){var n=ve(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 Br={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Iu,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)=>kr(t*100,e),r:kr,s:Xu,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Vr(t){return t}var Gr=Array.prototype.map,Xr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Yu(t){var e=t.grouping===void 0||t.thousands===void 0?Vr:ku(Gr.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?Vr:Bu(Gr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function l(c){c=be(c);var h=c.fill,p=c.align,d=c.sign,m=c.symbol,b=c.zero,x=c.width,T=c.comma,A=c.precision,E=c.trim,$=c.type;$==="n"?(T=!0,$="g"):Br[$]||(A===void 0&&(A=12),E=!0,$="g"),(b||h==="0"&&p==="=")&&(b=!0,h="0",p="=");var k=m==="$"?n:m==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",Y=m==="$"?r:/[%p]/.test($)?o:"",I=Br[$],w=/[defgprs%]/.test($);A=A===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function D(y){var S=k,C=Y,B,ht,Dt;if($==="c")C=I(y)+C,y="";else{y=+y;var Z=y<0||1/y<0;if(y=isNaN(y)?u:I(Math.abs(y),A),E&&(y=Gu(y)),Z&&+y==0&&d!=="+"&&(Z=!1),S=(Z?d==="("?d:s:d==="-"||d==="("?"":d)+S,C=($==="s"?Xr[8+Ir/3]:"")+C+(Z&&d==="("?")":""),w){for(B=-1,ht=y.length;++B<ht;)if(Dt=y.charCodeAt(B),48>Dt||Dt>57){C=(Dt===46?i+y.slice(B+1):y.slice(B))+C,y=y.slice(0,B);break}}}T&&!b&&(y=e(y,1/0));var Se=S.length+y.length+C.length,at=Se<x?new Array(x-Se+1).join(h):"";switch(T&&b&&(y=e(at+y,at.length?x-C.length:1/0),at=""),p){case"<":y=S+y+C+at;break;case"=":y=S+at+y+C;break;case"^":y=at.slice(0,Se=at.length>>1)+S+y+C+at.slice(Se);break;default:y=at+S+y+C;break}return a(y)}return D.toString=function(){return c+""},D}function f(c,h){var p=l((c=be(c),c.type="f",c)),d=Math.max(-8,Math.min(8,Math.floor($t(h)/3)))*3,m=Math.pow(10,-d),b=Xr[8+d/3];return function(x){return p(m*x)+b}}return{format:l,formatPrefix:f}}var we,nn,Yr;Uu({thousands:",",grouping:[3],currency:["$",""]});function Uu(t){return we=Yu(t),nn=we.format,Yr=we.formatPrefix,we}function Hu(t){return Math.max(0,-$t(Math.abs(t)))}function zu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($t(e)/3)))*3-$t(Math.abs(t)))}function ju(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,$t(e)-$t(t))+1}function De(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Ur=Symbol("implicit");function Hr(){var t=new qn,e=[],n=[],r=Ur;function i(a){let o=t.get(a);if(o===void 0){if(r!==Ur)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 qn;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 Hr(e,n).unknown(r)},De.apply(i,arguments),i}function zr(){var t=Hr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,s=!1,u=0,l=0,f=.5;delete t.unknown;function c(){var h=e().length,p=i<r,d=p?i:r,m=p?r:i;a=(m-d)/Math.max(1,h-u+l*2),s&&(a=Math.floor(a)),d+=(m-d-a*(h-u))*f,o=a*(1-u),s&&(d=Math.round(d),o=Math.round(o));var b=ma(h).map(function(x){return d+a*x});return n(p?b.reverse():b)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,s=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(s=!!h,c()):s},t.padding=function(h){return arguments.length?(u=Math.min(1,l=+h),c()):u},t.paddingInner=function(h){return arguments.length?(u=Math.min(1,h),c()):u},t.paddingOuter=function(h){return arguments.length?(l=+h,c()):l},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return zr(e(),[r,i]).round(s).paddingInner(u).paddingOuter(l).align(f)},De.apply(c(),arguments)}function jr(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return jr(e())},t}function qu(){return jr(zr.apply(null,arguments).paddingInner(1))}function Wu(t){return function(){return t}}function Ju(t){return+t}var qr=[0,1];function Tt(t){return t}function rn(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:Wu(isNaN(e)?NaN:.5)}function Ku(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Zu(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=rn(i,r),a=n(o,a)):(r=rn(r,i),a=n(a,o)),function(s){return a(r(s))}}function Qu(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]=rn(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(s){var u=jn(t,s,1,r)-1;return a[u](i[u](s))}}function tl(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function el(){var t=qr,e=qr,n=je,r,i,a,o=Tt,s,u,l;function f(){var h=Math.min(t.length,e.length);return o!==Tt&&(o=Ku(t[0],t[h-1])),s=h>2?Qu:Zu,u=l=null,c}function c(h){return h==null||isNaN(h=+h)?a:(u||(u=s(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((l||(l=s(e,t.map(r),W)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,Ju),f()):t.slice()},c.range=function(h){return arguments.length?(e=Array.from(h),f()):e.slice()},c.rangeRound=function(h){return e=Array.from(h),n=ws,f()},c.clamp=function(h){return arguments.length?(o=h?!0:Tt,f()):o!==Tt},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,p){return r=h,i=p,f()}}function nl(){return el()(Tt,Tt)}function rl(t,e,n,r){var i=da(t,e,n),a;switch(r=be(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=zu(i,o))&&(r.precision=a),Yr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=ju(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Hu(i))&&(r.precision=a-(r.type==="%")*2);break}}return nn(r)}function Wr(t){var e=t.domain;return t.ticks=function(n){var r=e();return pa(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return rl(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],s=r[a],u,l,f=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);f-- >0;){if(l=Ie(o,s,n),l===u)return r[i]=o,r[a]=s,e(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;u=l}return t},t}function qt(){var t=nl();return t.copy=function(){return tl(t,qt())},De.apply(t,arguments),Wr(t)}function Jr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(u){return u!=null&&u<=u?i[jn(r,u,0,n)]:a}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*e-(u-n)*t)/(n+1);return o}return o.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,s()):[t,e]},o.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},o.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[t,r[0]]:l>=n?[r[n-1],e]:[r[l-1],r[l]]},o.unknown=function(u){return arguments.length&&(a=u),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Jr().domain([t,e]).range(i).unknown(a)},De.apply(Wr(o),arguments)}function Wt(t,e,n){this.k=t,this.x=e,this.y=n}Wt.prototype={constructor:Wt,scale:function(t){return t===1?this:new Wt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Wt(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+")"}},Wt.prototype;function il(t,e){return e instanceof Function?e(t):nn(e)(t)}function Jt(t,e,n,r){let i=`${t}_${e}`;return n!=null&&(i+=`_${n}`),r!=null&&(i+=`_${r}`),i}function xe(t,e){return`${t}_series${e}`}function an(t,e){return`${t}_group${e}`}function on(){return""}function sn({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]:xe(n,a))}function Kr({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]:xe(`${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]:an(n,a))}function Qr({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]:an(`${n}_grid${r}`,o))}function ut(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 ti(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return ut(e)}function al(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 ut(n)}function un(t){const n=t.flat().filter(r=>(r==null||U(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return ut(n)}function ol(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 ut(n)}function sl(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 ut(n)}function ul({data:t,minX:e,maxX:n,minY:r,maxY:i}){let a=[],o=null,s=null,u=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),(s==null||c.axisX>s.axisX)&&(s=c),(u==null||c.axisY<u.axisY)&&(u=c),(l==null||c.axisY>l.axisY)&&(l=c));return{minXDatum:o,maxXDatum:s,minYDatum:u,maxYDatum:l,filteredData:a}}function ei(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 St(t,e){return t<e.colors[e.colorScheme].series.length?e.colors[e.colorScheme].series[t]:e.colors[e.colorScheme].series[t%e.colors[e.colorScheme].series.length]}function ni(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function ln(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:ni(n);return new Array(n).fill(null).map((o,s)=>{const u=s%a,l=Math.floor(s/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=u*f+u*r,p=l*c+l*r;return{slotIndex:s,rowIndex:l,columnIndex:u,startX:h,startY:p,centerX:h+f/2,centerY:p+c/2,width:f,height:c}})}function Mt(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:ni(n);return new Array(n).fill(null).map((o,s)=>{const u=s%a,l=Math.floor(s/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=u*f+u*r,p=l*c+l*r,d=[h,p],m=[f/t.width,c/t.height];return{slotIndex:s,rowIndex:l,columnIndex:u,translate:d,scale:m}})}const ll=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,s,u,l)=>{const f=Jt(n.type,s,u),c=n.seriesLabels[s]||xe("series",s),h=St(s,r);return typeof o=="number"?{id:f,index:l,seq:0,label:f,description:"",data:{},value:o,seriesIndex:s,seriesLabel:c,color:h,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:s,seriesLabel:c,color:h,visible:!0}};i=e.map((o,s)=>Array.isArray(o)?o.map((u,l)=>a(u,s,l,i.length+l)):a(o,s,0,i.length)).flat().sort(n.sort??void 0).map((o,s)=>(o.seq=s,o)).map(o=>(o.visible=n.visibleFilter(o,t),o)).sort((o,s)=>o.index-s.index).reduce((o,s)=>(o[s.seriesIndex]||(o[s.seriesIndex]=[]),o[s.seriesIndex].push(s),o),[])}catch(a){throw Error(a)}return i},cl=t=>F({data:t},{data:{toBe:"(DataSeriesDatum | DataSeriesValue)[][] | (DataSeriesDatum | DataSeriesValue)[]",test:n=>Array.isArray(n)}});var cn=function(t,e){return cn=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])},cn(t,e)};function et(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");cn(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function fl(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 s(f){try{l(r.next(f))}catch(c){o(c)}}function u(f){try{l(r.throw(f))}catch(c){o(c)}}function l(f){f.done?a(f.value):i(f.value).then(s,u)}l((r=r.apply(t,e||[])).next())})}function ri(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=s(0),o.throw=s(1),o.return=s(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(l){return function(f){return u([l,f])}}function u(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 Ct(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 lt(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(s){o={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ct(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 Ft(t){return this instanceof Ft?(this.v=t,this):new Ft(t)}function hl(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),s("next"),s("throw"),s("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(p){return function(d){return Promise.resolve(d).then(p,c)}}function s(p,d){r[p]&&(i[p]=function(m){return new Promise(function(b,x){a.push([p,m,b,x])>1||u(p,m)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(m){h(a[0][3],m)}}function l(p){p.value instanceof Ft?Promise.resolve(p.value.v).then(f,c):h(a[0][2],p)}function f(p){u("next",p)}function c(p){u("throw",p)}function h(p,d){p(d),a.shift(),a.length&&u(a[0][0],a[0][1])}}function pl(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 Ct=="function"?Ct(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(s,u){o=t[a](o),i(s,u,o.done,o.value)})}}function i(a,o,s,u){Promise.resolve(u).then(function(l){a({value:l,done:s})},o)}}typeof SuppressedError=="function"&&SuppressedError;function N(t){return typeof t=="function"}function fn(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 hn=fn(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 Ae(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Xt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=St(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else a.remove(this);var f=this.initialTeardown;if(P(f))try{f()}catch(g){o=g instanceof fn?g.errors:[g]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=St(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{ni(p)}catch(g){o=o??[],g instanceof fn?o=lt(lt([],ut(o)),ut(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(o)throw new fn(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ni(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)&&Ae(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Ae(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),ti=Xt.EMPTY;function ei(t){return t instanceof Xt||t&&"closed"in t&&P(t.remove)&&P(t.add)&&P(t.unsubscribe)}function ni(t){P(t)?t():t.unsubscribe()}var ri={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ii={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,lt([t,e],ut(n)))},clearTimeout:function(t){var e=ii.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function oi(t){ii.setTimeout(function(){throw t})}function hn(){}function De(t){t()}var dn=function(t){Q(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,ei(n)&&n.add(r)):r.destination=dl,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}(Xt),cl=Function.prototype.bind;function pn(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){$e(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){$e(r)}else $e(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){$e(n)}},t}(),qt=function(t){Q(e,t);function e(n,r,i){var o=t.call(this)||this,a;if(P(n)||!n)a={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;o&&ri.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return o.unsubscribe()},a={next:n.next&&pn(n.next,s),error:n.error&&pn(n.error,s),complete:n.complete&&pn(n.complete,s)}):a=n}return o.destination=new fl(a),o}return e}(dn);function $e(t){oi(t)}function hl(t){throw t}var dl={closed:!0,next:hn,error:hl,complete:hn},mn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Mt(t){return t}function pl(t){return t.length===0?Mt:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var L=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,o=gl(e)?e:new qt(e,n,r);return De(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ai(n),new n(function(i,o){var a=new qt({next:function(s){try{e(s)}catch(u){o(u),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[mn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return pl(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ai(e),new e(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},t.create=function(e){return new t(e)},t}();function ai(t){var e;return(e=t??ri.Promise)!==null&&e!==void 0?e:Promise}function ml(t){return t&&P(t.next)&&P(t.error)&&P(t.complete)}function gl(t){return t&&t instanceof dn||ml(t)&&ei(t)}function yl(t){return P(t==null?void 0:t.lift)}function B(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 G(t,e,n,r,i){return new vl(t,e,n,r,i)}var vl=function(t){Q(e,t);function e(n,r,i,o,a,s){var u=t.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,u._error=o?function(l){try{o(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}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}(dn),bl=cn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),O=function(t){Q(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new si(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new bl},e.prototype.next=function(n){var r=this;De(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=St(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;De(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;De(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?ti:(this.currentObservers=null,s.push(n),new Xt(function(){r.currentObservers=null,Ae(s,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},e.prototype.asObservable=function(){var n=new L;return n.source=this,n},e.create=function(n,r){return new si(n,r)},e}(L),si=function(t){Q(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:ti},e}(O),ui=function(t){Q(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,o=n._value;if(r)throw i;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(O),gn={now:function(){return(gn.delegate||Date).now()},delegate:void 0},wl=function(t){Q(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=gn);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return e.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var u=i.now(),l=0,f=1;f<o.length&&o[f]<=u;f+=2)l=f;l&&o.splice(0,l+1)}},e}(O),_l=function(t){Q(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Xt),yn={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,lt([t,e],ut(n)))},clearInterval:function(t){var e=yn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},xl=function(t){Q(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),yn.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&&yn.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ae(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(_l),li=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=gn.now,t}(),Al=function(t){Q(e,t);function e(n,r){r===void 0&&(r=li.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}(li),vn=new Al(xl),Dl=vn,ci=new L(function(t){return t.complete()});function fi(t){return t&&P(t.schedule)}function bn(t){return t[t.length-1]}function $l(t){return P(bn(t))?t.pop():void 0}function Et(t){return fi(bn(t))?t.pop():void 0}function hi(t,e){return typeof bn(t)=="number"?t.pop():e}var di=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function pi(t){return P(t==null?void 0:t.then)}function mi(t){return P(t[mn])}function gi(t){return Symbol.asyncIterator&&P(t==null?void 0:t[Symbol.asyncIterator])}function yi(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 vi=Tl();function bi(t){return P(t==null?void 0:t[vi])}function wi(t){return ul(this,arguments,function(){var n,r,i,o;return Qr(this,function(a){switch(a.label){case 0:n=t.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Ct(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,Ct(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Ct(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function _i(t){return P(t==null?void 0:t.getReader)}function X(t){if(t instanceof L)return t;if(t!=null){if(mi(t))return Sl(t);if(di(t))return Cl(t);if(pi(t))return Ml(t);if(gi(t))return xi(t);if(bi(t))return El(t);if(_i(t))return Fl(t)}throw yi(t)}function Sl(t){return new L(function(e){var n=t[mn]();if(P(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Cl(t){return new L(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Ml(t){return new L(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,oi)})}function El(t){return new L(function(e){var n,r;try{for(var i=St(t),o=i.next();!o.done;o=i.next()){var a=o.value;if(e.next(a),e.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function xi(t){return new L(function(e){Ll(t,e).catch(function(n){return e.error(n)})})}function Fl(t){return xi(wi(t))}function Ll(t,e){var n,r,i,o;return sl(this,void 0,void 0,function(){var a,s;return Qr(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=ll(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,e.next(a),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.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 ct(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(o),!i)return o}function Ai(t,e){return e===void 0&&(e=0),B(function(n,r){n.subscribe(G(r,function(i){return ct(r,t,function(){return r.next(i)},e)},function(){return ct(r,t,function(){return r.complete()},e)},function(i){return ct(r,t,function(){return r.error(i)},e)}))})}function Di(t,e){return e===void 0&&(e=0),B(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Ol(t,e){return X(t).pipe(Di(e),Ai(e))}function Pl(t,e){return X(t).pipe(Di(e),Ai(e))}function Rl(t,e){return new L(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Nl(t,e){return new L(function(n){var r;return ct(n,e,function(){r=t[vi](),ct(n,e,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return P(r==null?void 0:r.return)&&r.return()}})}function $i(t,e){if(!t)throw new Error("Iterable cannot be null");return new L(function(n){ct(n,e,function(){var r=t[Symbol.asyncIterator]();ct(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Il(t,e){return $i(wi(t),e)}function kl(t,e){if(t!=null){if(mi(t))return Ol(t,e);if(di(t))return Rl(t,e);if(pi(t))return Pl(t,e);if(gi(t))return $i(t,e);if(bi(t))return Nl(t,e);if(_i(t))return Il(t,e)}throw yi(t)}function Ft(t,e){return e?kl(t,e):X(t)}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Et(t);return Ft(t,n)}var Ti=cn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Bl(t){return t instanceof Date&&!isNaN(t)}function D(t,e){return B(function(n,r){var i=0;n.subscribe(G(r,function(o){r.next(t.call(e,o,i++))}))})}var Gl=Array.isArray;function Vl(t,e){return Gl(e)?t.apply(void 0,lt([],ut(e))):t(e)}function Ul(t){return D(function(e){return Vl(t,e)})}var zl=Array.isArray,Hl=Object.getPrototypeOf,jl=Object.prototype,Xl=Object.keys;function ql(t){if(t.length===1){var e=t[0];if(zl(e))return{args:e,keys:null};if(Yl(e)){var n=Xl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Yl(t){return t&&typeof t=="object"&&Hl(t)===jl}function Wl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Et(t),r=$l(t),i=ql(t),o=i.args,a=i.keys;if(o.length===0)return Ft([],n);var s=new L(Jl(o,n,a?function(u){return Wl(a,u)}:Mt));return r?s.pipe(Ul(r)):s}function Jl(t,e,n){return n===void 0&&(n=Mt),function(r){Si(e,function(){for(var i=t.length,o=new Array(i),a=i,s=i,u=function(f){Si(e,function(){var c=Ft(t[f],e),h=!1;c.subscribe(G(r,function(d){o[f]=d,h||(h=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Si(t,e,n){t?ct(n,t,e):e()}function Kl(t,e,n,r,i,o,a,s){var u=[],l=0,f=0,c=!1,h=function(){c&&!u.length&&!l&&e.complete()},d=function(g){return l<r?p(g):u.push(g)},p=function(g){l++;var _=!1;X(n(g,f++)).subscribe(G(e,function(x){e.next(x)},function(){_=!0},void 0,function(){if(_)try{l--;for(var x=function(){var A=u.shift();a||p(A)};u.length&&l<r;)x();h()}catch(A){e.error(A)}}))};return t.subscribe(G(e,d,function(){c=!0,h()})),function(){}}function Ci(t,e,n){return n===void 0&&(n=1/0),P(e)?Ci(function(r,i){return D(function(o,a){return e(r,o,i,a)})(X(t(r,i)))},n):(typeof e=="number"&&(n=e),B(function(r,i){return Kl(r,i,t,n)}))}function wn(t){return t===void 0&&(t=1/0),Ci(Mt,t)}function Zl(){return wn(1)}function Mi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zl()(Ft(t,Et(t)))}function Ql(t){return new L(function(e){X(t()).subscribe(e)})}function Ei(t,e,n){return Ql(function(){return t()?e:n})}function tc(t,e,n){n===void 0&&(n=Dl);var r=-1;return e!=null&&(fi(e)?n=e:r=e),new L(function(i){var o=Bl(t)?+t-n.now():t;o<0&&(o=0);var a=0;return n.schedule(function(){i.closed||(i.next(a++),0<=r?this.schedule(void 0,r):i.complete())},o)})}function ec(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Et(t),r=hi(t,1/0),i=t;return i.length?i.length===1?X(i[0]):wn(r)(Ft(i,n)):ci}var nc=Array.isArray;function rc(t){return t.length===1&&nc(t[0])?t[0]:t}function Fi(t,e){return B(function(n,r){var i=0;n.subscribe(G(r,function(o){return t.call(e,o,i++)&&r.next(o)}))})}function ic(t,e){return e===void 0&&(e=vn),B(function(n,r){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var l=o;o=null,r.next(l)}};function u(){var l=a+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}s()}n.subscribe(G(r,function(l){o=l,a=e.now(),i||(i=e.schedule(u,t),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function oc(t){return B(function(e,n){var r=!1;e.subscribe(G(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function ac(t){return t<=0?function(){return ci}:B(function(e,n){var r=0;e.subscribe(G(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function tt(t,e){return e===void 0&&(e=Mt),t=t??sc,B(function(n,r){var i,o=!0;n.subscribe(G(r,function(a){var s=e(a);(o||!t(i,s))&&(o=!1,i=s,r.next(a))}))})}function sc(t,e){return t===e}function uc(t){return t===void 0&&(t=lc),B(function(e,n){var r=!1;e.subscribe(G(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function lc(){return new Ti}function cc(t,e){var n=arguments.length>=2;return function(r){return r.pipe(Mt,ac(1),n?oc(e):uc(function(){return new Ti}))}}function fc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Et(t),r=hi(t,1/0);return t=rc(t),B(function(i,o){wn(r)(Ft(lt([i],ut(t)),n)).subscribe(o)})}function hc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fc.apply(void 0,lt([],ut(t)))}function _n(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new O}:e,r=t.resetOnError,i=r===void 0?!0:r,o=t.resetOnComplete,a=o===void 0?!0:o,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var f,c,h,d=0,p=!1,g=!1,_=function(){c==null||c.unsubscribe(),c=void 0},x=function(){_(),f=h=void 0,p=g=!1},A=function(){var $=f;x(),$==null||$.unsubscribe()};return B(function($,T){d++,!g&&!p&&_();var S=h=h??n();T.add(function(){d--,d===0&&!g&&!p&&(c=xn(A,u))}),S.subscribe(T),!f&&d>0&&(f=new qt({next:function(k){return S.next(k)},error:function(k){g=!0,_(),c=xn(x,i,k),S.error(k)},complete:function(){p=!0,_(),c=xn(x,a),S.complete()}}),X($).subscribe(f))})(l)}}function xn(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 X(e.apply(void 0,lt([],ut(n)))).subscribe(i)}}function w(t,e,n){var r,i=!1;return r=t,_n({connector:function(){return new wl(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function An(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Et(t);return B(function(r,i){(n?Mi(t,r,n):Mi(t,r)).subscribe(i)})}function R(t,e){return B(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(G(r,function(u){i==null||i.unsubscribe();var l=0,f=o++;X(t(u,f)).subscribe(i=G(r,function(c){return r.next(e?e(u,c,f,l++):c)},function(){i=null,s()}))},function(){a=!0,s()}))})}function M(t){return B(function(e,n){X(t).subscribe(G(n,function(){return n.complete()},hn)),!n.closed&&e.subscribe(n)})}function dc(t,e){return B(function(n,r){var i=e??{},o=i.leading,a=o===void 0?!0:o,s=i.trailing,u=s===void 0?!1:s,l=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,u&&(_(),h&&r.complete())},p=function(){c=null,h&&r.complete()},g=function(x){return c=X(t(x)).subscribe(G(r,d,p))},_=function(){if(l){l=!1;var x=f;f=null,r.next(x),!h&&g(x)}};n.subscribe(G(r,function(x){l=!0,f=x,!(c&&!c.closed)&&(a?_():g(x))},function(){h=!0,!(u&&l&&c&&!c.closed)&&r.complete()}))})}function pc(t,e,n){e===void 0&&(e=vn);var r=tc(t,e);return dc(function(){return r},n)}function Li(t){return new L(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}const Yt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new O,i=e.pipe(M(r),D(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),tt()),o=n.pipe(M(r),Fi(c=>c.eventName==="mouseover"),D(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),a=n.pipe(M(r),Fi(c=>c.eventName==="mouseout"),R(c=>i));function s(c,h){const d=c.find(p=>p.id===h);return d?[d]:[]}function u(c,h){return h==null?[]:c.filter(d=>d.seriesLabel===h)}function l(c,h){return h==null?[]:c.filter(d=>d.groupLabel===h)}function f(c,h){return h==null?[]:c.filter(d=>d.categoryLabel===h)}return new L(c=>(U({target:ec(o,a,i),datumList:t,fullChartParams:e}).pipe(M(r),R(async h=>h)).subscribe(h=>{let d=[];h.fullChartParams.highlightTarget==="datum"?d=s(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=u(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=l(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},Te=({datumList$:t})=>t.pipe(D(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),Dn=({datumList$:t})=>t.pipe(D(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Oi=({datumList$:t})=>t.pipe(D(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(D(e=>e.styles.textSize),tt(),D(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})),Pi=({fullDataFormatter$:t})=>t.pipe(D(e=>e.separateSeries),tt()),Ri=({computedData$:t})=>t.pipe(D(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),tt((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),$n=({computedData$:t})=>t.pipe(D(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Ni=({computedData$:t,fullDataFormatter$:e})=>U({computedData:t,fullDataFormatter:e}).pipe(R(async n=>n),D(n=>{const r=n.fullDataFormatter.sumSeries==!0?n.computedData.map(i=>[i.reduce((o,a)=>o==null?a:(o.value=o.value+a.value,o),null)]):n.computedData;return n.fullDataFormatter.separateSeries==!0?r.map(i=>i.sort((o,a)=>o.seq-a.seq)):[r.flat().sort((i,o)=>i.seq-o.seq)]})),Ii=({computedData$:t,fullDataFormatter$:e,layout$:n})=>U({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(async i=>i),D(i=>i.fullDataFormatter.separateSeries?un(i.layout,i.fullDataFormatter.container,i.computedData.length):un(i.layout,i.fullDataFormatter.container,1))),ki=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>U({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(R(async r=>r),D(r=>r.separateSeries?new Map(r.seriesLabels.map((i,o)=>[i,r.seriesContainerPosition[o]??r.seriesContainerPosition[0]])):new Map(r.seriesLabels.map((i,o)=>[i,r.seriesContainerPosition[0]])))),mc=({subject:t,observer:e})=>{const n=Wt(e.fullChartParams$).pipe(w(1)),r=Pi({fullDataFormatter$:e.fullDataFormatter$}),i=$n({computedData$:e.computedData$}),o=Ni({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(w(1)),a=$n({computedData$:o}),s=e.computedData$.pipe(D(d=>d.flat())).pipe(w(1)),u=Yt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),l=Ri({computedData$:e.computedData$}),f=Te({datumList$:s}).pipe(w(1)),c=Ii({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),h=ki({seriesContainerPosition$:c,seriesLabels$:l,separateSeries$:r}).pipe(w(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedLayoutData$:a,separateSeries$:r,computedLayoutData$:o,seriesHighlight$:u,seriesLabels$:l,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:h}},gt=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=J.scaleDomain,scaleRange:i=J.scaleRange})=>{const o=r[0]??J.scaleDomain[0],a=r[1]??J.scaleDomain[1],s=i[0]??J.scaleRange[0],u=i[1]??J.scaleRange[1];let l=o==="auto"?e<0?e:0:o==="min"?e:o,f=a==="auto"?t>=0?t:0:a==="max"?t:a;const c=t-(t-l)/(1-s),h=f/u;return Xr().domain([c,h]).range([0,n])},gc=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ju().domain(t).range(r).padding(n)},yc=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((u,l)=>l);r&&i.reverse();const o=i.length-1+n*2,a=e/o,s=a*n-a*.5;return qr().domain([s,e-s]).range(i)},Tn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(o,a,s){const u=a.grid.groupAxis.position==="top"||a.grid.groupAxis.position==="bottom"?s.width:s.height,l=o[0]?o[0].length-1:0;return gt({maxValue:l,minValue:0,axisWidth:u,scaleDomain:[0,l],scaleRange:[0,1]})}function i(o,a,s){const u=a.grid.valueAxis.position==="left"||a.grid.valueAxis.position==="right"?s.height:s.width,l=o.flat(),[f,c]=_e(l);return gt({maxValue:c,minValue:f,axisWidth:u,scaleDomain:["auto","auto"],scaleRange:[0,1]})}return U({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(async o=>o),D(o=>{const a=r(o.computedData,o.fullDataFormatter,o.layout),s=i(o.computedData,o.fullDataFormatter,o.layout),u=s(0);return o.computedData.map((l,f)=>l.map((c,h)=>{const d=a(h),p=s(c.value??0);return{...c,axisX:d,axisY:p,axisYFromZero:p-u}}))}))},Sn=({fullDataFormatter$:t,layout$:e})=>{const n=new O;function r({xAxis:i,yAxis:o,width:a,height:s}){if(!i||!o)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?o.position==="left"?(c=180,l=s):o.position==="right"?(c=180,h=180,u=a,l=s):(c=180,l=s):i.position==="top"?o.position==="left"||(o.position==="right"?(h=180,u=a):(c=180,l=s)):i.position==="left"?o.position==="bottom"?(f=-90,l=s):o.position==="top"?(f=-90,h=180):(c=180,l=s):i.position==="right"?o.position==="bottom"?(f=-90,c=180,l=s,u=a):o.position==="top"?(f=-90,c=180,h=180,u=a):(c=180,l=s):(c=180,l=s),{translate:[u,l],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new L(i=>(U({fullDataFormatter:t,layout:e}).pipe(M(n),R(async o=>o)).subscribe(o=>{const a=r({xAxis:o.fullDataFormatter.grid.groupAxis,yAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});i.next(a)}),function(){n.next(void 0)}))},Cn=({gridAxesTransform$:t})=>t.pipe(D(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,o=e.rotateX*-1,a=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:o,rotateY:a,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${o}deg) rotateY(${a}deg) rotate(${i}deg)`}})),Mn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new O;function i({data:o,groupAxis:a,valueAxis:s,width:u,height:l}){let f=0,c=0,h=0,d=0;const p=a.position==="top"||a.position==="bottom"?u:l,g=0,_=o[0]?o[0].length-1:0,x=a.scaleDomain[0]-a.scalePadding,A=a.scaleDomain[1]==="max"?_+a.scalePadding:a.scaleDomain[1]+a.scalePadding,$=gt({maxValue:_,minValue:g,axisWidth:p,scaleDomain:[x,A],scaleRange:[0,1]}),T=$(g),S=$(_);g==_?(f=0,h=1):(f=T,h=(S-T)/p);const k=o.map((V,it)=>V.filter((wt,et)=>et>=x&&et<=A&&wt.visible==!0)),N=sn(k);N[0]===N[1]&&(N[0]=N[1]-1);const I=s.position==="left"||s.position==="right"?l:u,v=gt({maxValue:N[1],minValue:N[0],axisWidth:I,scaleDomain:s.scaleDomain,scaleRange:s.scaleRange}),b=sn(o);b[0]===b[1]&&(b[0]=b[1]-1);const y=v(b[0]>0?0:b[0]),C=v(b[1]<0?0:b[1]);return c=y,d=(C-y)/I,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new L(o=>(U({computedData:t,fullDataFormatter:e,layout:n}).pipe(M(r),R(async a=>a)).subscribe(a=>{const s=i({data:a.computedData,groupAxis:a.fullDataFormatter.grid.groupAxis,valueAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});o.next(s)}),function(){r.next(void 0)}))},En=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>U({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(R(async r=>r),D(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainerPosition.map((i,o)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[o].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[o].scale[1]]):r.gridContainerPosition.map((i,o)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[o].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[o].scale[0]]))),Fn=({fullDataFormatter$:t,layout$:e})=>{const n=new O;function r({xAxisPosition:i,yAxisPosition:o,width:a,height:s}){return(i==="bottom"||i==="top")&&(o==="left"||o==="right")?{width:a,height:s}:(i==="left"||i==="right")&&(o==="bottom"||o==="top")?{width:s,height:a}:{width:a,height:s}}return new L(i=>{U({fullDataFormatter:t,layout:e}).pipe(M(n),R(async o=>o)).subscribe(o=>{const a=r({xAxisPosition:o.fullDataFormatter.grid.groupAxis.position,yAxisPosition:o.fullDataFormatter.grid.valueAxis.position,width:o.layout.width,height:o.layout.height});return i.next(a),function(){n.next(void 0)}})})},Ln=({computedData$:t})=>t.pipe(D(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),tt((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),On=({computedData$:t})=>t.pipe(D(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Pn=({computedLayoutData$:t})=>t.pipe(D(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Bi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>U({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(async i=>i),D(i=>{if(i.fullDataFormatter.grid.separateSeries)return xe(i.layout,i.fullDataFormatter.container,i.computedData.length);{const o=xe(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((a,s)=>o[0])}})),Rn=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(D(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((a,s)=>r.reduce((u,l)=>{if(l&&l[s]){const f=l[s].value==null||l[s].visible==!1?0:l[s].value;return u+f}return u},0));return r.map((a,s)=>a.map((u,l)=>({...u,value:i[l]})))}));return t.pipe(R(r=>Ei(()=>r,e,n)))},Gi=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const o=new O,a=Yt({datumList$:e.pipe(D(u=>u.flat().flat()),w(1)),fullChartParams$:r,event$:i}).pipe(w(1)),s=Nn({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(w(1));return U({fullDataFormatter:t,computedData:e,multiGridContainer:s}).pipe(R(async u=>u),D(u=>{o.next(void 0);const l=u.fullDataFormatter.gridList[0]??Pt;return u.computedData.map((f,c)=>{const h=u.fullDataFormatter.gridList[c]??l,d={type:"grid",visibleFilter:u.fullDataFormatter.visibleFilter,grid:{...h},container:{...u.fullDataFormatter.container}},p=mt(d).pipe(M(o),w(1)),g=mt(f).pipe(M(o),w(1)),_=p.pipe(D(it=>it.grid.separateSeries),tt(),w(1)),x=mt(u.multiGridContainer[c]).pipe(M(o),w(1)),A=Sn({fullDataFormatter$:p,layout$:n}).pipe(M(o),w(1)),$=Cn({gridAxesTransform$:A}).pipe(M(o),w(1)),T=Mn({computedData$:g,fullDataFormatter$:p,layout$:n}).pipe(M(o),w(1)),S=En({gridContainerPosition$:x,gridAxesTransform$:A,gridGraphicTransform$:T}),k=Fn({fullDataFormatter$:p,layout$:n}).pipe(M(o),w(1)),N=g.pipe(D(it=>it.flat())).pipe(M(o),w(1)),I=Ln({computedData$:g}).pipe(M(o),w(1)),v=Te({datumList$:N}).pipe(M(o),w(1)),b=Dn({datumList$:N}).pipe(M(o),w(1)),y=On({computedData$:g}).pipe(M(o),w(1)),C=Tn({computedData$:g,fullDataFormatter$:p,layout$:n}).pipe(M(o),w(1)),F=Pn({computedLayoutData$:C}).pipe(M(o),w(1)),V=Rn({computedData$:g,isSeriesSeprate$:_}).pipe(w(1));return{isSeriesSeprate$:_,gridContainerPosition$:x,gridAxesTransform$:A,gridAxesReverseTransform$:$,gridGraphicTransform$:T,gridGraphicReverseScale$:S,gridAxesSize$:k,gridHighlight$:a,seriesLabels$:I,SeriesDataMap$:v,GroupDataMap$:b,dataFormatter$:p,computedData$:g,computedLayoutData$:C,visibleComputedData$:y,visibleComputedLayoutData$:F,computedStackedData$:V}})}))},Nn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>U({computedData:t,fullDataFormatter:e,layout:n}).pipe(R(async r=>r),D(r=>{const i=r.fullDataFormatter.gridList[0]??Pt,o=r.computedData.reduce((l,f,c)=>{const d=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return l+d},0)||1,a=xe(r.layout,r.fullDataFormatter.container,o);let s=0;return r.computedData.map((l,f)=>{const c=r.fullDataFormatter.gridList[f]??i,h=l.map((d,p)=>{const g=a[s];return c.separateSeries&&(s+=1),g});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(s+=1),h})})),Vi=({computedData$:t})=>t.pipe(D(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(o=>{r=n(r,o)}),r}return n([],e)})),Ui=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe(D(r=>r.categoryLabels),tt((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return U({nodeList:t,categoryLabels:n}).pipe(R(async r=>r),D(r=>{const i=new Set(r.categoryLabels),o=new Set(r.nodeList.filter(a=>a.visible).map(a=>a.categoryLabel));return Array.from(o).forEach(a=>{i.has(a)||i.add(a)}),Array.from(i).forEach(a=>{o.has(a)||o.delete(a)}),Array.from(i)}),tt((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},zi=({computedData$:t})=>t.pipe(D(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)}));function Lt(t){return`[OrbCharts warn]: ${t.message}`}function yt({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function _e(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 s=Ct(o),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(m){e={error:m}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(N(f))try{f()}catch(m){a=m instanceof hn?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=Ct(c),p=h.next();!p.done;p=h.next()){var d=p.value;try{oi(d)}catch(m){a=a??[],m instanceof hn?a=ct(ct([],lt(a)),lt(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new hn(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)oi(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)&&_e(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&_e(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),ii=Kt.EMPTY;function ai(t){return t instanceof Kt||t&&"closed"in t&&N(t.remove)&&N(t.add)&&N(t.unsubscribe)}function oi(t){N(t)?t():t.unsubscribe()}var si={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ui={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ct([t,e],lt(n)))},clearTimeout:function(t){var e=ui.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function li(t){ui.setTimeout(function(){throw t})}function pn(){}function Ae(t){t()}var dn=function(t){et(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,ai(n)&&n.add(r)):r.destination=yl,r}return e.create=function(n,r,i){return new Zt(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),dl=Function.prototype.bind;function mn(t,e){return dl.call(t,e)}var ml=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){$e(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){$e(r)}else $e(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){$e(n)}},t}(),Zt=function(t){et(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 s;a&&si.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&mn(n.next,s),error:n.error&&mn(n.error,s),complete:n.complete&&mn(n.complete,s)}):o=n}return a.destination=new ml(o),a}return e}(dn);function $e(t){li(t)}function gl(t){throw t}var yl={closed:!0,next:pn,error:gl,complete:pn},gn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Et(t){return t}function vl(t){return t.length===0?Et:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var O=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=wl(e)?e:new Zt(e,n,r);return Ae(function(){var o=i,s=o.operator,u=o.source;a.add(s?s.call(a,u):u?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=ci(n),new n(function(i,a){var o=new Zt({next:function(s){try{e(s)}catch(u){a(u),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[gn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return vl(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=ci(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 ci(t){var e;return(e=t??si.Promise)!==null&&e!==void 0?e:Promise}function bl(t){return t&&N(t.next)&&N(t.error)&&N(t.complete)}function wl(t){return t&&t instanceof dn||bl(t)&&ai(t)}function Dl(t){return N(t==null?void 0:t.lift)}function G(t){return function(e){if(Dl(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 X(t,e,n,r,i){return new xl(t,e,n,r,i)}var xl=function(t){et(e,t);function e(n,r,i,a,o,s){var u=t.call(this,n)||this;return u.onFinalize=o,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(f){n.error(f)}}:t.prototype._next,u._error=a?function(l){try{a(l)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,u}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}(dn),_l=fn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),P=function(t){et(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 fi(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new _l},e.prototype.next=function(n){var r=this;Ae(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Ct(r.currentObservers),s=o.next();!s.done;s=o.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Ae(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;Ae(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,s=i.observers;return a||o?ii:(this.currentObservers=null,s.push(n),new Kt(function(){r.currentObservers=null,_e(s,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 O;return n.source=this,n},e.create=function(n,r){return new fi(n,r)},e}(O),fi=function(t){et(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:ii},e}(P),hi=function(t){et(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}(P),yn={now:function(){return(yn.delegate||Date).now()},delegate:void 0},Al=function(t){et(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=yn);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,s=r._timestampProvider,u=r._windowTime;i||(a.push(n),!o&&a.push(s.now()+u)),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,s=o.slice(),u=0;u<s.length&&!n.closed;u+=a?1:2)n.next(s[u]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,s=(o?1:2)*r;if(r<1/0&&s<a.length&&a.splice(0,a.length-s),!o){for(var u=i.now(),l=0,f=1;f<a.length&&a[f]<=u;f+=2)l=f;l&&a.splice(0,l+1)}},e}(P),$l=function(t){et(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Kt),vn={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ct([t,e],lt(n)))},clearInterval:function(t){var e=vn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Tl=function(t){et(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),vn.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&&vn.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,_e(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}($l),pi=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=yn.now,t}(),Sl=function(t){et(e,t);function e(n,r){r===void 0&&(r=pi.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}(pi),bn=new Sl(Tl),Ml=bn,di=new O(function(t){return t.complete()});function mi(t){return t&&N(t.schedule)}function wn(t){return t[t.length-1]}function Cl(t){return N(wn(t))?t.pop():void 0}function Lt(t){return mi(wn(t))?t.pop():void 0}function gi(t,e){return typeof wn(t)=="number"?t.pop():e}var yi=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function vi(t){return N(t==null?void 0:t.then)}function bi(t){return N(t[gn])}function wi(t){return Symbol.asyncIterator&&N(t==null?void 0:t[Symbol.asyncIterator])}function Di(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 Fl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var xi=Fl();function _i(t){return N(t==null?void 0:t[xi])}function Ai(t){return hl(this,arguments,function(){var n,r,i,a;return ri(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,Ft(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Ft(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ft(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 $i(t){return N(t==null?void 0:t.getReader)}function j(t){if(t instanceof O)return t;if(t!=null){if(bi(t))return El(t);if(yi(t))return Ll(t);if(vi(t))return Ol(t);if(wi(t))return Ti(t);if(_i(t))return Pl(t);if($i(t))return Rl(t)}throw Di(t)}function El(t){return new O(function(e){var n=t[gn]();if(N(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ll(t){return new O(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Ol(t){return new O(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,li)})}function Pl(t){return new O(function(e){var n,r;try{for(var i=Ct(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function Ti(t){return new O(function(e){Nl(t,e).catch(function(n){return e.error(n)})})}function Rl(t){return Ti(Ai(t))}function Nl(t,e){var n,r,i,a;return fl(this,void 0,void 0,function(){var o,s;return ri(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=pl(t),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:u.sent(),u.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 ft(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 Si(t,e){return e===void 0&&(e=0),G(function(n,r){n.subscribe(X(r,function(i){return ft(r,t,function(){return r.next(i)},e)},function(){return ft(r,t,function(){return r.complete()},e)},function(i){return ft(r,t,function(){return r.error(i)},e)}))})}function Mi(t,e){return e===void 0&&(e=0),G(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Il(t,e){return j(t).pipe(Mi(e),Si(e))}function kl(t,e){return j(t).pipe(Mi(e),Si(e))}function Bl(t,e){return new O(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Vl(t,e){return new O(function(n){var r;return ft(n,e,function(){r=t[xi](),ft(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(s){n.error(s);return}o?n.complete():n.next(a)},0,!0)}),function(){return N(r==null?void 0:r.return)&&r.return()}})}function Ci(t,e){if(!t)throw new Error("Iterable cannot be null");return new O(function(n){ft(n,e,function(){var r=t[Symbol.asyncIterator]();ft(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Gl(t,e){return Ci(Ai(t),e)}function Xl(t,e){if(t!=null){if(bi(t))return Il(t,e);if(yi(t))return Bl(t,e);if(vi(t))return kl(t,e);if(wi(t))return Ci(t,e);if(_i(t))return Vl(t,e);if($i(t))return Gl(t,e)}throw Di(t)}function Ot(t,e){return e?Xl(t,e):j(t)}function yt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Lt(t);return Ot(t,n)}var Fi=fn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Yl(t){return t instanceof Date&&!isNaN(t)}function _(t,e){return G(function(n,r){var i=0;n.subscribe(X(r,function(a){r.next(t.call(e,a,i++))}))})}var Ul=Array.isArray;function Hl(t,e){return Ul(e)?t.apply(void 0,ct([],lt(e))):t(e)}function zl(t){return _(function(e){return Hl(t,e)})}var jl=Array.isArray,ql=Object.getPrototypeOf,Wl=Object.prototype,Jl=Object.keys;function Kl(t){if(t.length===1){var e=t[0];if(jl(e))return{args:e,keys:null};if(Zl(e)){var n=Jl(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Zl(t){return t&&typeof t=="object"&&ql(t)===Wl}function Ql(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function R(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Lt(t),r=Cl(t),i=Kl(t),a=i.args,o=i.keys;if(a.length===0)return Ot([],n);var s=new O(tc(a,n,o?function(u){return Ql(o,u)}:Et));return r?s.pipe(zl(r)):s}function tc(t,e,n){return n===void 0&&(n=Et),function(r){Ei(e,function(){for(var i=t.length,a=new Array(i),o=i,s=i,u=function(f){Ei(e,function(){var c=Ot(t[f],e),h=!1;c.subscribe(X(r,function(p){a[f]=p,h||(h=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Ei(t,e,n){t?ft(n,t,e):e()}function ec(t,e,n,r,i,a,o,s){var u=[],l=0,f=0,c=!1,h=function(){c&&!u.length&&!l&&e.complete()},p=function(m){return l<r?d(m):u.push(m)},d=function(m){l++;var b=!1;j(n(m,f++)).subscribe(X(e,function(x){e.next(x)},function(){b=!0},void 0,function(){if(b)try{l--;for(var x=function(){var T=u.shift();o||d(T)};u.length&&l<r;)x();h()}catch(T){e.error(T)}}))};return t.subscribe(X(e,p,function(){c=!0,h()})),function(){}}function Li(t,e,n){return n===void 0&&(n=1/0),N(e)?Li(function(r,i){return _(function(a,o){return e(r,a,i,o)})(j(t(r,i)))},n):(typeof e=="number"&&(n=e),G(function(r,i){return ec(r,i,t,n)}))}function Dn(t){return t===void 0&&(t=1/0),Li(Et,t)}function nc(){return Dn(1)}function Oi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return nc()(Ot(t,Lt(t)))}function rc(t){return new O(function(e){j(t()).subscribe(e)})}function Pi(t,e,n){return rc(function(){return t()?e:n})}function ic(t,e,n){n===void 0&&(n=Ml);var r=-1;return e!=null&&(mi(e)?n=e:r=e),new O(function(i){var a=Yl(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 ac(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Lt(t),r=gi(t,1/0),i=t;return i.length?i.length===1?j(i[0]):Dn(r)(Ot(i,n)):di}var oc=Array.isArray;function sc(t){return t.length===1&&oc(t[0])?t[0]:t}function Ri(t,e){return G(function(n,r){var i=0;n.subscribe(X(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function uc(t,e){return e===void 0&&(e=bn),G(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var l=a;a=null,r.next(l)}};function u(){var l=o+t,f=e.now();if(f<l){i=this.schedule(void 0,l-f),r.add(i);return}s()}n.subscribe(X(r,function(l){a=l,o=e.now(),i||(i=e.schedule(u,t),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function lc(t){return G(function(e,n){var r=!1;e.subscribe(X(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function cc(t){return t<=0?function(){return di}:G(function(e,n){var r=0;e.subscribe(X(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function K(t,e){return e===void 0&&(e=Et),t=t??fc,G(function(n,r){var i,a=!0;n.subscribe(X(r,function(o){var s=e(o);(a||!t(i,s))&&(a=!1,i=s,r.next(o))}))})}function fc(t,e){return t===e}function hc(t){return t===void 0&&(t=pc),G(function(e,n){var r=!1;e.subscribe(X(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function pc(){return new Fi}function dc(t,e){var n=arguments.length>=2;return function(r){return r.pipe(Et,cc(1),n?lc(e):hc(function(){return new Fi}))}}function mc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Lt(t),r=gi(t,1/0);return t=sc(t),G(function(i,a){Dn(r)(Ot(ct([i],lt(t)),n)).subscribe(a)})}function gc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return mc.apply(void 0,ct([],lt(t)))}function xn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new P}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,s=t.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var f,c,h,p=0,d=!1,m=!1,b=function(){c==null||c.unsubscribe(),c=void 0},x=function(){b(),f=h=void 0,d=m=!1},T=function(){var A=f;x(),A==null||A.unsubscribe()};return G(function(A,E){p++,!m&&!d&&b();var $=h=h??n();E.add(function(){p--,p===0&&!m&&!d&&(c=_n(T,u))}),$.subscribe(E),!f&&p>0&&(f=new Zt({next:function(k){return $.next(k)},error:function(k){m=!0,b(),c=_n(x,i,k),$.error(k)},complete:function(){d=!0,b(),c=_n(x,o),$.complete()}}),j(A).subscribe(f))})(l)}}function _n(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 Zt({next:function(){i.unsubscribe(),t()}});return j(e.apply(void 0,ct([],lt(n)))).subscribe(i)}}function v(t,e,n){var r,i=!1;return r=t,xn({connector:function(){return new Al(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function An(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Lt(t);return G(function(r,i){(n?Oi(t,r,n):Oi(t,r)).subscribe(i)})}function L(t,e){return G(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(X(r,function(u){i==null||i.unsubscribe();var l=0,f=a++;j(t(u,f)).subscribe(i=X(r,function(c){return r.next(e?e(u,c,f,l++):c)},function(){i=null,s()}))},function(){o=!0,s()}))})}function M(t){return G(function(e,n){j(t).subscribe(X(n,function(){return n.complete()},pn)),!n.closed&&e.subscribe(n)})}function yc(t,e){return G(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,s=i.trailing,u=s===void 0?!1:s,l=!1,f=null,c=null,h=!1,p=function(){c==null||c.unsubscribe(),c=null,u&&(b(),h&&r.complete())},d=function(){c=null,h&&r.complete()},m=function(x){return c=j(t(x)).subscribe(X(r,p,d))},b=function(){if(l){l=!1;var x=f;f=null,r.next(x),!h&&m(x)}};n.subscribe(X(r,function(x){l=!0,f=x,!(c&&!c.closed)&&(o?b():m(x))},function(){h=!0,!(u&&l&&c&&!c.closed)&&r.complete()}))})}function vc(t,e,n){e===void 0&&(e=bn);var r=ic(t,e);return yc(function(){return r},n)}function Ni(t){return new O(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 Pt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new P,i=e.pipe(M(r),_(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),K()),a=n.pipe(M(r),Ri(c=>c.eventName==="mouseover"),_(c=>c.datum?{id:c.datum.id,seriesLabel:c.datum.seriesLabel,groupLabel:c.datum.groupLabel,categoryLabel:c.datum.categoryLabel,highlightDefault:null}:{id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:null})),o=n.pipe(M(r),Ri(c=>c.eventName==="mouseout"),L(c=>i));function s(c,h){const p=c.find(d=>d.id===h);return p?[p]:[]}function u(c,h){return h==null?[]:c.filter(p=>p.seriesLabel===h)}function l(c,h){return h==null?[]:c.filter(p=>p.groupLabel===h)}function f(c,h){return h==null?[]:c.filter(p=>p.categoryLabel===h)}return new O(c=>(R({target:ac(a,o,i),datumList:t,fullChartParams:e}).pipe(M(r),L(async h=>h)).subscribe(h=>{let p=[];h.fullChartParams.highlightTarget==="datum"?p=s(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?p=u(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?p=l(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(p=f(h.datumList,h.target.categoryLabel)),c.next(p)}),function(){r.next(void 0)}))},Te=({datumList$:t})=>t.pipe(_(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),$n=({datumList$:t})=>t.pipe(_(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Tn=({datumList$:t})=>t.pipe(_(e=>{const n=new Map;return e.filter(r=>r.categoryLabel!=null).forEach(r=>{const i=n.get(r.categoryLabel)??[];i.push(r),n.set(r.categoryLabel,i)}),n})),Rt=t=>t.pipe(_(e=>e.styles.textSize),K(),_(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})),Ii=({fullDataFormatter$:t})=>t.pipe(_(e=>e.separateSeries),K()),ki=({computedData$:t})=>t.pipe(_(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),K((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Sn=({computedData$:t})=>t.pipe(_(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Bi=({computedData$:t,fullDataFormatter$:e})=>R({computedData:t,fullDataFormatter:e}).pipe(L(async n=>n),_(n=>{const r=n.fullDataFormatter.sumSeries==!0?n.computedData.map(i=>[i.reduce((a,o)=>a==null?o:(a.value=a.value+o.value,a),null)]):n.computedData;return n.fullDataFormatter.separateSeries==!0?r.map(i=>i.sort((a,o)=>a.seq-o.seq)):[r.flat().sort((i,a)=>i.seq-a.seq)]})),Vi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(L(async i=>i),_(i=>i.fullDataFormatter.separateSeries?ln(i.layout,i.fullDataFormatter.container,i.computedData.length):ln(i.layout,i.fullDataFormatter.container,1))),Gi=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>R({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(L(async r=>r),_(r=>r.separateSeries?new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[a]??r.seriesContainerPosition[0]])):new Map(r.seriesLabels.map((i,a)=>[i,r.seriesContainerPosition[0]])))),bc=({subject:t,observer:e})=>{const n=Rt(e.fullChartParams$).pipe(v(1)),r=Ii({fullDataFormatter$:e.fullDataFormatter$}),i=Sn({computedData$:e.computedData$}),a=Bi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),o=Sn({computedData$:a}),s=e.computedData$.pipe(_(p=>p.flat())).pipe(v(1)),u=Pt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),l=ki({computedData$:e.computedData$}),f=Te({datumList$:s}).pipe(v(1)),c=Vi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),h=Gi({seriesContainerPosition$:c,seriesLabels$:l,separateSeries$:r}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedLayoutData$:o,separateSeries$:r,computedLayoutData$:a,seriesHighlight$:u,seriesLabels$:l,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:h}},it=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=V.scaleDomain,scaleRange:i=V.scaleRange,reverse:a=!1})=>{const o=r[0]??V.scaleDomain[0],s=r[1]??V.scaleDomain[1],u=i[0]??V.scaleRange[0],l=i[1]??V.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=s==="auto"?t>=0?t:0:s==="max"?t:s;const h=t-(t-f)/(1-u),p=c/l;return a?qt().domain([h,p]).range([n,0]):qt().domain([h,p]).range([0,n])},wc=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=V.scaleDomain,scaleRange:i=V.scaleRange,reverse:a=!1})=>{e===t&&(t+=1,e-=1);const o=r[0]??V.scaleDomain[0],s=r[1]??V.scaleDomain[1],u=i[0]??V.scaleRange[0],l=i[1]??V.scaleRange[1];let f=o==="auto"?e<0?e:0:o==="min"?e:o,c=s==="auto"?t>=0?t:0:s==="max"?t:s;const h=t-(t-f)/(1-u),p=c/l;return a?qt().domain([n,0]).range([h,p]):qt().domain([0,n]).range([h,p])},Dc=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return qu().domain(t).range(r).padding(n)},xc=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((u,l)=>l);r&&i.reverse();const a=i.length-1+n*2,o=e/a,s=o*n-o*.5;return Jr().domain([s,e-s]).range(i)},Mn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,s){const u=o.grid.groupAxis.position==="top"||o.grid.groupAxis.position==="bottom"?s.width:s.height,l=a[0]?a[0].length-1:0;return it({maxValue:l,minValue:0,axisWidth:u,scaleDomain:[0,l],scaleRange:[0,1]})}function i(a,o,s){const u=o.grid.valueAxis.position==="left"||o.grid.valueAxis.position==="right"?s.height:s.width,l=a.flat();let[f,c]=ti(l);return f===c&&c===0&&(c=1),it({maxValue:c,minValue:f,axisWidth:u,scaleDomain:["auto","auto"],scaleRange:[0,1]})}return R({computedData:t,fullDataFormatter:e,layout:n}).pipe(L(async a=>a),_(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),s=i(a.computedData,a.fullDataFormatter,a.layout),u=s(0);return a.computedData.map((l,f)=>l.map((c,h)=>{const p=o(h),d=s(c.value??0);return{...c,axisX:p,axisY:d,axisYFromZero:d-u}}))}))},Cn=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:s}){return(i==="bottom"||i==="top")&&(a==="left"||a==="right")?{width:o,height:s}:(i==="left"||i==="right")&&(a==="bottom"||a==="top")?{width:s,height:o}:{width:o,height:s}}return new O(i=>{R({fullDataFormatter:t,layout:e}).pipe(M(n),L(async a=>a)).subscribe(a=>{const o=r({xAxisPosition:a.fullDataFormatter.grid.groupAxis.position,yAxisPosition:a.fullDataFormatter.grid.valueAxis.position,width:a.layout.width,height:a.layout.height});return i.next(o),function(){n.next(void 0)}})})},Fn=({computedData$:t})=>t.pipe(_(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),K((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),En=({computedData$:t})=>t.pipe(_(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Ln=({computedLayoutData$:t})=>t.pipe(_(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Xi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(L(async i=>i),_(i=>{if(i.fullDataFormatter.grid.separateSeries)return Mt(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Mt(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,s)=>a[0])}})),On=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(_(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((o,s)=>r.reduce((u,l)=>{if(l&&l[s]){const f=l[s].value==null||l[s].visible==!1?0:l[s].value;return u+f}return u},0));return r.map((o,s)=>o.map((u,l)=>({...u,value:i[l]})))}));return t.pipe(L(r=>Pi(()=>r,e,n)))},Pn=({computedData$:t,fullDataFormatter$:e})=>R({computedData:t,fullDataFormatter:e}).pipe(L(async n=>n),_(n=>{const r=n.fullDataFormatter.grid.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]})),Rn=({computedData$:t,groupScaleDomainValue$:e})=>R({computedData:t,groupScaleDomainValue:e}).pipe(_(n=>{const r=n.computedData.map((a,o)=>a.filter((s,u)=>u>=n.groupScaleDomainValue[0]&&u<=n.groupScaleDomainValue[1]&&s.visible==!0));return un(r)})),Nn=({fullDataFormatter$:t,layout$:e})=>{const n=new P;function r({xAxis:i,yAxis:a,width:o,height:s}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let u=0,l=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,l=s):a.position==="right"?(c=180,h=180,u=o,l=s):(c=180,l=s):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,u=o):(c=180,l=s)):i.position==="left"?a.position==="bottom"?(f=-90,l=s):a.position==="top"?(f=-90,h=180):(c=180,l=s):i.position==="right"?a.position==="bottom"?(f=-90,c=180,l=s,u=o):a.position==="top"?(f=-90,c=180,h=180,u=o):(c=180,l=s):(c=180,l=s),{translate:[u,l],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${u}px, ${l}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new O(i=>(R({fullDataFormatter:t,layout:e}).pipe(M(n),L(async a=>a)).subscribe(a=>{const o=r({xAxis:a.fullDataFormatter.grid.groupAxis,yAxis:a.fullDataFormatter.grid.valueAxis,width:a.layout.width,height:a.layout.height});i.next(o)}),function(){n.next(void 0)}))},In=({gridAxesTransform$:t})=>t.pipe(_(e=>{const n=[0,0],r=[1/e.scale[0],1/e.scale[1]],i=e.rotate*-1,a=e.rotateX*-1,o=e.rotateY*-1;return{translate:n,scale:r,rotate:i,rotateX:a,rotateY:o,value:`translate(${n[0]}px, ${n[1]}px) rotateX(${a}deg) rotateY(${o}deg) rotate(${i}deg)`}})),kn=({computedData$:t,groupScaleDomainValue$:e,filteredMinMaxValue$:n,fullDataFormatter$:r,layout$:i})=>{const a=new P;function o({data:s,groupAxis:u,valueAxis:l,groupScaleDomainValue:f,filteredMinMaxValue:c,width:h,height:p}){let d=0,m=0,b=0,x=0;const T=u.position==="top"||u.position==="bottom"?h:p,A=0,E=s[0]?s[0].length-1:0,$=it({maxValue:E,minValue:A,axisWidth:T,scaleDomain:f,scaleRange:[0,1]}),k=$(A),Y=$(E);A==E?(d=0,b=1):(d=k,b=(Y-k)/T),c[0]===c[1]&&c[1]===0&&(c[1]=1);const I=l.position==="left"||l.position==="right"?p:h,w=it({maxValue:c[1],minValue:c[0],axisWidth:I,scaleDomain:l.scaleDomain,scaleRange:l.scaleRange}),D=un(s);D[0]===D[1]&&D[1]===0&&(D[1]=1);const y=w(D[0]>0?0:D[0]),S=w(D[1]<0?0:D[1]);return m=y,x=(S-y)/I,{translate:[d,m],scale:[b,x],rotate:0,rotateX:0,rotateY:0,value:`translate(${d}px, ${m}px) scale(${b}, ${x})`}}return new O(s=>(R({computedData:t,groupScaleDomainValue:e,filteredMinMaxValue:n,fullDataFormatter:r,layout:i}).pipe(M(a),L(async u=>u)).subscribe(u=>{const l=o({data:u.computedData,groupAxis:u.fullDataFormatter.grid.groupAxis,valueAxis:u.fullDataFormatter.grid.valueAxis,groupScaleDomainValue:u.groupScaleDomainValue,filteredMinMaxValue:u.filteredMinMaxValue,width:u.layout.width,height:u.layout.height});s.next(l)}),function(){a.next(void 0)}))},Bn=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>R({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(L(async r=>r),_(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[1]]):r.gridContainerPosition.map((i,a)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[a].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[a].scale[0]]))),Yi=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new P,o=Pt({datumList$:e.pipe(_(u=>u.flat().flat()),v(1)),fullChartParams$:r,event$:i}).pipe(v(1)),s=Vn({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(v(1));return R({fullDataFormatter:t,computedData:e,multiGridContainer:s}).pipe(L(async u=>u),_(u=>{a.next(void 0);const l=u.fullDataFormatter.gridList[0]??Bt;return u.computedData.map((f,c)=>{const h=u.fullDataFormatter.gridList[c]??l,p={type:"grid",visibleFilter:u.fullDataFormatter.visibleFilter,grid:{...h},container:{...u.fullDataFormatter.container}},d=yt(p).pipe(M(a),v(1)),m=yt(f).pipe(M(a),v(1)),b=d.pipe(_(Z=>Z.grid.separateSeries),K(),v(1)),x=yt(u.multiGridContainer[c]).pipe(M(a),v(1)),T=Cn({fullDataFormatter$:d,layout$:n}).pipe(M(a),v(1)),A=m.pipe(_(Z=>Z.flat())).pipe(M(a),v(1)),E=Fn({computedData$:m}).pipe(M(a),v(1)),$=Te({datumList$:A}).pipe(M(a),v(1)),k=$n({datumList$:A}).pipe(M(a),v(1)),Y=En({computedData$:m}).pipe(M(a),v(1)),I=Mn({computedData$:m,fullDataFormatter$:d,layout$:n}).pipe(M(a),v(1)),w=Ln({computedLayoutData$:I}).pipe(M(a),v(1)),D=On({computedData$:m,isSeriesSeprate$:b}).pipe(v(1)),y=Pn({computedData$:m,fullDataFormatter$:d}).pipe(M(a),v(1)),S=Rn({computedData$:m,groupScaleDomainValue$:y}).pipe(M(a),v(1)),C=Nn({fullDataFormatter$:d,layout$:n}).pipe(M(a),v(1)),B=In({gridAxesTransform$:C}).pipe(M(a),v(1)),ht=kn({computedData$:m,groupScaleDomainValue$:y,filteredMinMaxValue$:S,fullDataFormatter$:d,layout$:n}).pipe(M(a),v(1)),Dt=Bn({gridContainerPosition$:x,gridAxesTransform$:C,gridGraphicTransform$:ht});return{isSeriesSeprate$:b,gridContainerPosition$:x,gridAxesSize$:T,gridHighlight$:o,seriesLabels$:E,SeriesDataMap$:$,GroupDataMap$:k,dataFormatter$:d,computedData$:m,computedLayoutData$:I,visibleComputedData$:Y,visibleComputedLayoutData$:w,computedStackedData$:D,groupScaleDomainValue$:y,filteredMinMaxValue$:S,gridAxesTransform$:C,gridAxesReverseTransform$:B,gridGraphicTransform$:ht,gridGraphicReverseScale$:Dt}})}))},Vn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(L(async r=>r),_(r=>{const i=r.fullDataFormatter.gridList[0]??Bt,a=r.computedData.reduce((l,f,c)=>{const p=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return l+p},0)||1,o=Mt(r.layout,r.fullDataFormatter.container,a);let s=0;return r.computedData.map((l,f)=>{const c=r.fullDataFormatter.gridList[f]??i,h=l.map((p,d)=>{const m=o[s];return c.separateSeries&&(s+=1),m});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(s+=1),h})})),Ui=({computedData$:t})=>t.pipe(_(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),Hi=t=>t.pipe(_(e=>Array.from(e.keys())),K((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),zi=({computedData$:t})=>t.pipe(_(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)}));function Nt(t){return`[OrbCharts warn]: ${t.message}`}function vt({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
|
4
4
|
|
5
|
-
----> find in '${n}'`}function
|
5
|
+
----> find in '${n}'`}function bt({columnName:t,expectToBe:e,from:n}){return`Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
|
6
6
|
|
7
|
-
----> find in '${n}'`}function vc(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 bc(t){return E({element:t},{element:{toBe:"Dom",test:n=>Vn(n)}})}function wc(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 o=E(e.colors.light,{series:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},white:{toBeTypes:["string"]},background:{toBeTypes:["string"]}});if(o.status==="error")return o}if(e.colors.dark){const o=E(e.colors.dark,{series:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},white:{toBeTypes:["string"]},background:{toBeTypes:["string"]}});if(o.status==="error")return o}}return r}function _c(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 Hi(t,e,n){const r=st(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,o)=>{const a=e.gridList[o]||e.gridList[0];return st(i,a)})),r}const xc=({defaultDataFormatter:t,dataFormatterValidator:e,computedDataFn:n,dataValidator:r,contextObserverCallback:i})=>{const o=new O,a=t.type;return function(u,l){try{const{status:v,columnName:b,expectToBe:y}=vc(l);if(v==="error")throw new Error(yt({columnName:b,expectToBe:y,from:"Chart.constructor"}));if(v==="warning")console.warn(vt({columnName:b,expectToBe:y,from:"Chart.constructor"}));else{const{status:C,columnName:F,expectToBe:V}=bc(u);if(C==="error")throw new Error(yt({columnName:F,expectToBe:V,from:"Chart.constructor"}));C==="warning"&&console.warn(vt({columnName:F,expectToBe:V,from:"Chart.constructor"}))}}catch(v){throw new Error(v)}ne(u).selectAll("svg").remove();const f=ne(u).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 h=c.append("g");h.classed("orbcharts__plugins",!0);const d={data$:new O,dataFormatter$:new O,plugins$:new O,chartParams$:new O,event$:new O},p=(v=>{const b=v||at,y=b.preset?b.preset:{};return{name:y.name??"",description:y.description??"",chartParams:y.chartParams?st(y.chartParams,Me):Me,dataFormatter:y.dataFormatter?Hi(y.dataFormatter,t,a):t,allPluginParams:y.allPluginParams?y.allPluginParams:{}}})(l),g=d.data$.pipe(w(1)),_=d.dataFormatter$.pipe(M(o),An({}),D(v=>{try{const{status:b,columnName:y,expectToBe:C}=e(v);if(b==="error")throw new Error(yt({columnName:y,expectToBe:C,from:"Chart.dataFormatter$"}));b==="warning"&&console.warn(vt({columnName:y,expectToBe:C,from:"Chart.dataFormatter$"}))}catch(b){console.error(Lt(b))}return Hi(v,p.dataFormatter,a)}),w(1)),x=d.chartParams$.pipe(M(o),An({}),D(v=>{try{const{status:b,columnName:y,expectToBe:C}=wc(a,v);if(b==="error")throw new Error(yt({columnName:y,expectToBe:C,from:"Chart.chartParams$"}));b==="warning"&&console.warn(vt({columnName:y,expectToBe:C,from:"Chart.chartParams$"}))}catch(b){console.error(Lt(b))}return st(v,p.chartParams)}),w(1)),A=x.pipe(M(o),An({}),D(v=>st(v.padding??{},Ce)));A.pipe(M(o),cc()).subscribe(v=>{c.attr("transform",`translate(${v.left}, ${v.top})`)}),A.subscribe(v=>{c.transition().attr("transform",`translate(${v.left}, ${v.top})`)});const $=mt({width:(l==null?void 0:l.width)??at.width,height:(l==null?void 0:l.height)??at.height}).pipe(R(v=>Ei(()=>v.width==="auto"||v.height==="auto",Li(u).pipe(D(b=>({width:v.width==="auto"?b.width:v.width,height:v.height==="auto"?b.height:v.height}))),mt(v))),M(o),_n()),T=mt().pipe(hc($.pipe(ic(250)),$.pipe(pc(250))),tt((v,b)=>JSON.stringify(v)===JSON.stringify(b)),_n()),S=T.subscribe(),k=U({rootSize:T,mergedPadding:A}).pipe(M(o),R(async v=>{const b=v.rootSize.width>0?v.rootSize.width:In,y=v.rootSize.height>0?v.rootSize.height:kn;return{width:b-v.mergedPadding.left-v.mergedPadding.right,height:y-v.mergedPadding.top-v.mergedPadding.bottom,top:v.mergedPadding.top,right:v.mergedPadding.right,bottom:v.mergedPadding.bottom,left:v.mergedPadding.left,rootWidth:b,rootHeight:y}}),w(1));k.subscribe(v=>{f.attr("width",v.rootWidth).attr("height",v.rootHeight)});const N=U({data:g,dataFormatter:_,chartParams:x}).pipe(M(o),R(async v=>v),R(v=>mt(v).pipe(D(b=>{try{const{status:y,columnName:C,expectToBe:F}=r(b.data);if(y==="error")throw new Error(yt({columnName:C,expectToBe:F,from:"Chart.data$"}));y==="warning"&&console.warn(vt({columnName:C,expectToBe:F,from:"Chart.data$"}))}catch(y){console.error(Lt(y))}return n({data:b.data,dataFormatter:b.dataFormatter,chartParams:b.chartParams})}))),w(1));N.subscribe();const I={};return d.plugins$.subscribe(v=>{try{const{status:b,columnName:y,expectToBe:C}=_c(a,v);if(b==="error")throw new Error(yt({columnName:y,expectToBe:C,from:"Chart.plugins$"}));b==="warning"&&console.warn(vt({columnName:y,expectToBe:C,from:"Chart.plugins$"}))}catch(b){console.error(Lt(b));return}h.selectAll("g.orbcharts__plugin").data(v,b=>b.name).join(b=>b.append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`).each((y,C,F)=>{const V={fullParams$:new L,fullChartParams$:x,fullDataFormatter$:_,computedData$:N,layout$:k},it=i({observer:V,subject:d}),et={selection:ne(F[C]),rootSelection:f,name:y.name,chartType:a,subject:d,observer:it};y.setPresetParams(p.allPluginParams[y.name]??{}),y.setContext(et),I[et.name]=y,y.init()}),b=>b,b=>b.each((y,C,F)=>{I[y.name]&&(I[y.name].destroy(),I[y.name]=void 0)}).remove()).sort((b,y)=>b.layerIndex-y.layerIndex)}),{...d,selection:f,destroy(){ne(u).selectAll("svg").remove(),o.next(void 0),S.unsubscribe()}}}};class Ot{constructor({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:o},a,s){this.data$=new O,this.dataFormatter$=new O,this.plugins$=new O,this.chartParams$=new O,this.event$=new O;try{const l=xc({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:o})(a,s);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(u){console.error(Lt(u))}}}class Ac extends Ot{constructor(e,n){super({defaultDataFormatter:Ee,dataFormatterValidator:to,computedDataFn:ol,dataValidator:al,contextObserverCallback:mc},e,n)}}const Dc=t=>{const e=E(t,{visibleFilter:{toBeTypes:["Function"]},grid:{toBeTypes:["object"]},container:{toBeTypes:["object"]}});if(t.grid){const n=E(t.grid,{seriesDirection:{toBe:'"row" | "column"',test:r=>r==="row"||r==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(n.status==="error")return n;if(t.grid.valueAxis){const r=E(t.grid.valueAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:i=>i==="bottom"||i==="left"||i==="top"||i==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:i=>Array.isArray(i)&&i.length===2&&(typeof i[0]=="number"||i[0]==="min"||i[0]==="auto")&&(typeof i[1]=="number"||i[1]==="max"||i[1]==="auto")},scaleRange:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},label:{toBeTypes:["string"]}});if(r.status==="error")return r}if(t.grid.groupAxis){const r=E(t.grid.groupAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:i=>i==="bottom"||i==="left"||i==="top"||i==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&(typeof i[1]=="number"||i[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(r.status==="error")return r}}if(t.container){const n=E(t.container,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e};function ji(t,e){if(!t.length)return[];try{const n=t.reduce((a,s)=>s.length>a?s.length:a,0),i=t.map((a,s)=>{if(a.length===n)return a;const u=Object.assign([],a);for(let l=u.length;l<n;l++)u[l]=null;return u}).map((a,s)=>a.map((u,l)=>u==null?{id:"",label:"",data:{},value:null}:typeof u=="number"?{id:"",label:"",data:{},value:u}:{id:u.id??"",label:u.label??"",data:u.data??{},value:u.value}));return Kr(e.seriesDirection,i)}catch{return[]}}const $c=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const o=ji(e,n.grid),a=an({transposedDataGrid:o,dataFormatterGrid:n.grid,chartType:"grid"}),s=Wr({transposedDataGrid:o,dataFormatterGrid:n.grid,chartType:"grid"});let u=0;i=o.map((l,f)=>l.map((c,h)=>{const d=Ht("grid",0,f,h),p=s[h],g={id:c.id?c.id:d,index:u,label:c.label?c.label:d,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:a[f],groupIndex:h,groupLabel:p,color:jt(f,r),visible:!0};return g.visible=n.visibleFilter(g,t),u++,g}))}catch(o){throw Error(o)}return i},Tc=t=>E({data:t},{data:{toBe:"(DataGridDatum | DataGridValue)[][]",test:n=>Array.isArray(n)}}),Sc=({subject:t,observer:e})=>{const n=Wt(e.fullChartParams$).pipe(w(1)),r=e.fullDataFormatter$.pipe(D($=>$.grid.separateSeries),tt(),w(1)),i=Bi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),o=Sn({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),a=Cn({gridAxesTransform$:o}).pipe(w(1)),s=Mn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),u=En({gridContainerPosition$:i,gridAxesTransform$:o,gridGraphicTransform$:s}),l=Fn({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),f=e.computedData$.pipe(D($=>$.flat())).pipe(w(1)),c=Yt({datumList$:f,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),h=Ln({computedData$:e.computedData$}),d=Te({datumList$:f}).pipe(w(1)),p=Dn({datumList$:f}).pipe(w(1)),g=Tn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),_=On({computedData$:e.computedData$}).pipe(w(1)),x=Pn({computedLayoutData$:g}).pipe(w(1)),A=Rn({computedData$:e.computedData$,isSeriesSeprate$:r}).pipe(w(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isSeriesSeprate$:r,gridContainerPosition$:i,gridAxesTransform$:o,gridAxesReverseTransform$:a,gridGraphicTransform$:s,gridGraphicReverseScale$:u,gridAxesSize$:l,gridHighlight$:c,seriesLabels$:h,SeriesDataMap$:d,GroupDataMap$:p,computedLayoutData$:g,visibleComputedData$:_,visibleComputedLayoutData$:x,computedStackedData$:A}};class Cc extends Ot{constructor(e,n){super({defaultDataFormatter:Le,dataFormatterValidator:Dc,computedDataFn:$c,dataValidator:Tc,contextObserverCallback:Sc},e,n)}}const Mc=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,o)=>{const a=E(i,{seriesDirection:{toBe:'"row" | "column"',test:s=>s==="row"||s==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(a.status==="error")return a;if(i.valueAxis){const s=E(i.valueAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:u=>u==="top"||u==="bottom"||u==="left"||u==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:u=>Array.isArray(u)&&u.length===2&&(typeof u[0]=="number"||u[0]==="min"||u[0]==="auto")&&(typeof u[1]=="number"||u[1]==="max"||u[1]==="auto")},scaleRange:{toBe:"[number, number]",test:u=>Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"},label:{toBeTypes:["string"]}});if(s.status==="error")return s}else if(i.groupAxis){const s=E(i.groupAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:u=>u==="top"||u==="bottom"||u==="left"||u==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:u=>Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&(typeof u[1]=="number"||u[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(s.status==="error")return s}return{status:"success",columnName:"",expectToBe:""}}).find(i=>i.status==="error");if(r)return r}if(t.container){const n=E(t.container,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e},Ec=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const o=n.gridList[0]||Pt,a=e.map((c,h)=>n.gridList[h]||o),s=e.map((c,h)=>ji(c,a[h])),u=n.separateGrid?s.map((c,h)=>an({transposedDataGrid:c,dataFormatterGrid:a[h],chartType:"multiGrid"})):s.map((c,h)=>Yr({transposedDataGrid:c,dataFormatterGrid:a[h],chartType:"multiGrid",gridIndex:h})),l=new Map;let f=0;u.flat().forEach((c,h)=>{if(!l.has(c)){const d=jt(f,r);l.set(c,d),f++}}),i=s.map((c,h)=>{const d=u[h],p=Jr({transposedDataGrid:c,dataFormatterGrid:a[h],chartType:"multiGrid",gridIndex:h});let g=0;return c.map((x,A)=>x.map(($,T)=>{const S=Ht("multiGrid",h,A,T),k=p[T],N=d[A],I={id:$.id?$.id:S,index:g,label:$.label?$.label:S,description:$.description??"",data:$.data,value:$.value,gridIndex:h,seriesIndex:A,seriesLabel:N,groupIndex:T,groupLabel:k,color:l.get(N),visible:!0};return I.visible=n.visibleFilter(I,t),g++,I}))})}catch(o){throw Error(o)}return i},Fc=t=>E({data:t},{data:{toBe:"DataGrid[]",test:n=>Array.isArray(n)}}),Lc=({subject:t,observer:e})=>{const n=Wt(e.fullChartParams$).pipe(w(1)),r=Gi({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),i=Nn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,multiGridContainerPosition$:i,multiGridEachDetail$:r}};class Oc extends Ot{constructor(e,n){super({defaultDataFormatter:Oe,dataFormatterValidator:Mc,computedDataFn:Ec,dataValidator:Fc,contextObserverCallback:Lc},e,n)}}const Pc=t=>({status:"success",columnName:"",expectToBe:""}),Rc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i={width:1e3,height:1e3};let o=[];try{const a=e.map((A,$)=>A.map((T,S)=>typeof T=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:T}:{id:T.id??"",label:T.label??"",description:T.description??"",data:T.data??{},categoryLabel:T.categoryLabel??"",value:T.value})),[s,u]=_e(a.map(A=>A[0])),[l,f]=_e(a.map(A=>A[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=gt({maxValue:u,minValue:s,axisWidth:c,scaleDomain:[s,u],scaleRange:[0,1]}),p=gt({maxValue:f,minValue:l,axisWidth:h,scaleDomain:[l,f],scaleRange:[0,1]}),g=[n.xAxis.scaleDomain[0]==="auto"?s<0?s:0:n.xAxis.scaleDomain[0]==="min"?s:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?u>=0?u:0:n.xAxis.scaleDomain[1]==="max"?u:n.xAxis.scaleDomain[1]],_=[n.yAxis.scaleDomain[0]==="auto"?s<0?s:0:n.yAxis.scaleDomain[0]==="min"?s:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?u>=0?u:0:n.yAxis.scaleDomain[1]==="max"?u:n.yAxis.scaleDomain[1]];let x=0;o=a.map((A,$)=>A.map((T,S)=>{const k=x;x++;const N=Ht(n.type,$,S),I={id:T.id?T.id:N,index:k,label:T.label?T.label:N,description:T.description??"",data:T.data,value:T.value,categoryIndex:0,categoryLabel:"",axis:S==0?d(T.value):p(T.value),visible:!0,color:""};return I.visible=n.visibleFilter(I,t),I}))}catch(a){throw Error(a)}return o},Nc=t=>({status:"success",columnName:"",expectToBe:""}),Ic=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class kc extends Ot{constructor(e,n){super({defaultDataFormatter:Pe,dataFormatterValidator:Pc,computedDataFn:Rc,dataValidator:Nc,contextObserverCallback:Ic},e,n)}}const Bc=t=>({status:"success",columnName:"",expectToBe:""}),Gc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],o=[];try{let a=[],s=[];if(e.nodes)a=e.nodes,s=e.edges;else if(e[0])a=e[0],s=e[1];else return{nodes:[],edges:[]};i=a.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:!0}));const u=new Map(i.map(c=>[c.id,c]));o=s.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:u.get(c.start),startNodeId:c.start,endNode:u.get(c.end),endNodeId:c.end,visible:!0}));const l=function(){const c=new Map;return o.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return o.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(u).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id),h.visible=n.visibleFilter(h,t)}),o=o.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(a){throw Error(a)}return{nodes:i,edges:o}},Vc=t=>({status:"success",columnName:"",expectToBe:""}),Uc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class zc extends Ot{constructor(e,n){super({defaultDataFormatter:Ne,dataFormatterValidator:Bc,computedDataFn:Gc,dataValidator:Vc,contextObserverCallback:Uc},e,n)}}const Hc=t=>E(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),jc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((a,s)=>[a,s]));let o={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const a=function(){if(H(e)===!0)return JSON.parse(JSON.stringify(e));if(Array.isArray(e)===!1)return{id:""};let l;const f=new Map;e.forEach(h=>{if(!h.parent)l=h;else{const d=f.get(h.parent)??[];d.push(h),f.set(h.parent,d)}});const c=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel,children:(f.get(h.id)??[]).map(d=>c(d))});return l?c(l):{id:""}}();let s=0;const u=(l,f,c)=>{const h=f+1,d=l.categoryLabel??null;let p=0;d!=null&&(i.has(d)||i.set(d,i.size),p=i.get(d)??0);const g=s;s++;const _={id:l.id,index:g,level:f,seq:c,label:l.label??"",description:l.description??"",categoryIndex:p,categoryLabel:d,color:jt(p,r),data:l.data??{},value:l.value,visible:!0,children:(l.children??[]).map((x,A)=>u(x,h,A))};return _.visible=n.visibleFilter(_,t),_};o=u(a,0,0)}catch(a){throw Error(a)}return o},Xc=t=>E({data:t},{data:{toBe:"DataTreeObj | DataTreeDatum[]",test:n=>H(n)&&n.id!==void 0}}),qc=({subject:t,observer:e})=>{const n=Wt(e.fullChartParams$).pipe(w(1)),r=Vi({computedData$:e.computedData$}).pipe(w(1)),i=Yt({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),o=Ui({nodeList$:r,fullDataFormatter$:e.fullDataFormatter$}).pipe(w(1)),a=Oi({datumList$:r}).pipe(w(1)),s=zi({computedData$:e.computedData$}).pipe(w(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,existCategoryLabels$:o,CategoryDataMap$:a,visibleComputedData$:s}};class Yc extends Ot{constructor(e,n){super({defaultDataFormatter:Re,dataFormatterValidator:Hc,computedDataFn:jc,dataValidator:Xc,contextObserverCallback:qc},e,n)}}function Wc({chartType:t,config:e,initFn:n}){const r=new O,i=new WeakMap;let o=()=>{},a;const s=new ui(e.defaultParams),u=new ui({}),l=s.pipe(R(f=>u.pipe(M(r),D(c=>{try{const{status:h,columnName:d,expectToBe:p}=e.validator(c,{validateColumns:E});if(h==="error")throw new Error(yt({columnName:d,expectToBe:p,from:`${e.name}.params$`}));h==="warning"&&console.warn(vt({columnName:d,expectToBe:p,from:`${e.name}.params$`}))}catch(h){console.error(Lt(h))}return st(c,f)}))),w(1));return{params$:u,name:e.name,chartType:t,defaultParams:e.defaultParams,layerIndex:e.layerIndex,init(){a&&(o=n(a)??(()=>{}),i.set(a.selection,a))},destroy(){o(),a&&(a.selection.remove(),a=void 0),r.next(void 0)},setPresetParams:f=>{s.next(st(f,e.defaultParams))},setContext:f=>{a=f,a.observer.fullParams$=l}}}const bt=t=>function(n){return function(i){return class{constructor(){const a=Wc({chartType:t,config:n,initFn:i});this.params$=a.params$,this.name=a.name,this.chartType=a.chartType,this.defaultParams=a.defaultParams,this.layerIndex=a.layerIndex,this.init=a.init,this.destroy=a.destroy,this.setPresetParams=a.setPresetParams,this.setContext=a.setContext}}}},Jc=bt("series"),Kc=bt("grid"),Zc=bt("multiGrid"),Qc=bt("multiValue"),tf=bt("noneData"),ef=bt("relationship"),nf=bt("tree");m.CHART_HEIGHT_DEFAULT=kn,m.CHART_OPTIONS_DEFAULT=at,m.CHART_PARAMS_DEFAULT=Me,m.CHART_WIDTH_DEFAULT=In,m.DATA_FORMATTER_CONTAINER_DEFAULT=Jt,m.DATA_FORMATTER_GRID_DEFAULT=Le,m.DATA_FORMATTER_GRID_GRID_DEFAULT=Fe,m.DATA_FORMATTER_GROUP_AXIS_DEFAULT=Bn,m.DATA_FORMATTER_MULTI_GRID_DEFAULT=Oe,m.DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT=Pt,m.DATA_FORMATTER_MULTI_VALUE_DEFAULT=Pe,m.DATA_FORMATTER_RELATIONAL_DEFAULT=Ne,m.DATA_FORMATTER_SERIES_DEFAULT=Ee,m.DATA_FORMATTER_TREE_DEFAULT=Re,m.DATA_FORMATTER_VALUE_AXIS_DEFAULT=J,m.DATA_GRID_DEFAULT=qi,m.DATA_MULTI_GRID_DEFAULT=Yi,m.DATA_MULTI_VALUE_DEFAULT=Wi,m.DATA_RELATIONA_DEFAULTL=Ki,m.DATA_SERIES_DEFAULT=Xi,m.DATA_TREE_DEFAULT=Ji,m.GridChart=Cc,m.MultiGridChart=Oc,m.MultiValueChart=kc,m.PADDING_DEFAULT=Ce,m.RelationshipChart=zc,m.SeriesChart=Ac,m.TreeChart=Yc,m.calcGridContainerLayout=xe,m.calcSeriesContainerLayout=un,m.categoryDataMapObservable=Oi,m.computedStackedDataObservables=Rn,m.createAxisLinearScale=gt,m.createAxisPointScale=gc,m.createAxisQuantizeScale=yc,m.createDefaultDatumId=Ht,m.createDefaultGroupLabel=on,m.createDefaultSeriesLabel=we,m.createGridGroupLabels=Wr,m.createGridSeriesLabels=an,m.createMultiGridGroupLabels=Jr,m.createMultiGridSeriesLabels=Yr,m.defineGridPlugin=Kc,m.defineMultiGridPlugin=Zc,m.defineMultiValuePlugin=Qc,m.defineNoneDataPlugin=tf,m.defineRelationshipPlugin=ef,m.defineSeriesPlugin=Jc,m.defineTreePlugin=nf,m.existCategoryLabelsObservable=Ui,m.formatCommaNumber=Zi,m.formatValueToLabel=el,m.getMinAndMax=Tt,m.getMinAndMaxGrid=sn,m.getMinAndMaxMultiGrid=rl,m.getMinAndMaxMultiValue=il,m.getMinAndMaxSeries=nl,m.getMinAndMaxValue=_e,m.gridAxesReverseTransformObservable=Cn,m.gridAxesSizeObservable=Fn,m.gridAxesTransformObservable=Sn,m.gridComputedLayoutDataObservable=Tn,m.gridContainerPositionObservable=Bi,m.gridGraphicReverseScaleObservable=En,m.gridGraphicTransformObservable=Mn,m.gridSeriesLabelsObservable=Ln,m.gridVisibleComputedDataObservable=On,m.gridVisibleComputedLayoutDataObservable=Pn,m.groupDataMapObservable=Dn,m.highlightObservable=Yt,m.isDom=Vn,m.isFunction=Gn,m.isPlainObject=H,m.mergeOptionsWithDefault=st,m.multiGridContainerObservable=Nn,m.multiGridEachDetailObservable=Gi,m.nodeListObservable=Vi,m.resizeObservable=Li,m.separateSeriesObservable=Pi,m.seriesColorPredicate=jt,m.seriesComputedLayoutDataObservable=Ni,m.seriesContainerPositionMapObservable=ki,m.seriesContainerPositionObservable=Ii,m.seriesDataMapObservable=Te,m.seriesLabelsObservable=Ri,m.seriesVisibleComputedDataObservable=$n,m.textSizePxObservable=Wt,m.transposeData=Kr,m.treeVisibleComputedDataObservable=zi,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
7
|
+
----> find in '${n}'`}function _c(t){return t?F(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 F({element:t},{element:{toBe:"Dom",test:n=>Hn(n)}})}function $c(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=F(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=F(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=F(e.colors,{light:{toBeTypes:["object"]},dark:{toBeTypes:["object"]}});if(i.status==="error")return i;if(e.colors.light){const a=F(e.colors.light,{series:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},white:{toBeTypes:["string"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}if(e.colors.dark){const a=F(e.colors.dark,{series:{toBeTypes:["string[]"]},primary:{toBeTypes:["string"]},secondary:{toBeTypes:["string"]},white:{toBeTypes:["string"]},background:{toBeTypes:["string"]}});if(a.status==="error")return a}}return r}function Tc(t,e){return F({pluginEntities:e},{pluginEntities:{toBe:`PluginEntity<'${t}'>[]`,test:r=>Array.isArray(r)&&r.every(i=>i.chartType===t||i.chartType==="noneData")}})}function ji(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 Sc=({defaultDataFormatter:t,dataFormatterValidator:e,computedDataFn:n,dataValidator:r,contextObserverCallback:i})=>{const a=new P,o=t.type;return function(u,l){try{const{status:w,columnName:D,expectToBe:y}=_c(l);if(w==="error")throw new Error(vt({columnName:D,expectToBe:y,from:"Chart.constructor"}));if(w==="warning")console.warn(bt({columnName:D,expectToBe:y,from:"Chart.constructor"}));else{const{status:S,columnName:C,expectToBe:B}=Ac(u);if(S==="error")throw new Error(vt({columnName:C,expectToBe:B,from:"Chart.constructor"}));S==="warning"&&console.warn(bt({columnName:C,expectToBe:B,from:"Chart.constructor"}))}}catch(w){throw new Error(w)}ie(u).selectAll("svg").remove();const f=ie(u).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 h=c.append("g");h.classed("orbcharts__plugins",!0);const p={data$:new P,dataFormatter$:new P,plugins$:new P,chartParams$:new P,event$:new P},d=(w=>{const D=w||ot,y=D.preset?D.preset:{};return{name:y.name??"",description:y.description??"",chartParams:y.chartParams?st(y.chartParams,Ce):Ce,dataFormatter:y.dataFormatter?ji(y.dataFormatter,t,o):t,allPluginParams:y.allPluginParams?y.allPluginParams:{}}})(l),m=p.data$.pipe(v(1)),b=p.dataFormatter$.pipe(M(a),An({}),_(w=>{try{const{status:D,columnName:y,expectToBe:S}=e(w);if(D==="error")throw new Error(vt({columnName:y,expectToBe:S,from:"Chart.dataFormatter$"}));D==="warning"&&console.warn(bt({columnName:y,expectToBe:S,from:"Chart.dataFormatter$"}))}catch(D){console.error(Nt(D))}return ji(w,d.dataFormatter,o)}),v(1)),x=p.chartParams$.pipe(M(a),An({}),_(w=>{try{const{status:D,columnName:y,expectToBe:S}=$c(o,w);if(D==="error")throw new Error(vt({columnName:y,expectToBe:S,from:"Chart.chartParams$"}));D==="warning"&&console.warn(bt({columnName:y,expectToBe:S,from:"Chart.chartParams$"}))}catch(D){console.error(Nt(D))}return st(w,d.chartParams)}),v(1)),T=x.pipe(M(a),An({}),_(w=>st(w.padding??{},Me)));T.pipe(M(a),dc()).subscribe(w=>{c.attr("transform",`translate(${w.left}, ${w.top})`)}),T.subscribe(w=>{c.transition().attr("transform",`translate(${w.left}, ${w.top})`)});const A=yt({width:(l==null?void 0:l.width)??ot.width,height:(l==null?void 0:l.height)??ot.height}).pipe(L(w=>Pi(()=>w.width==="auto"||w.height==="auto",Ni(u).pipe(_(D=>({width:w.width==="auto"?D.width:w.width,height:w.height==="auto"?D.height:w.height}))),yt(w))),M(a),xn()),E=yt().pipe(gc(A.pipe(uc(250)),A.pipe(vc(250))),K((w,D)=>JSON.stringify(w)===JSON.stringify(D)),xn()),$=E.subscribe(),k=R({rootSize:E,mergedPadding:T}).pipe(M(a),L(async w=>{const D=w.rootSize.width>0?w.rootSize.width:Gn,y=w.rootSize.height>0?w.rootSize.height:Xn;return{width:D-w.mergedPadding.left-w.mergedPadding.right,height:y-w.mergedPadding.top-w.mergedPadding.bottom,top:w.mergedPadding.top,right:w.mergedPadding.right,bottom:w.mergedPadding.bottom,left:w.mergedPadding.left,rootWidth:D,rootHeight:y}}),v(1));k.subscribe(w=>{f.attr("width",w.rootWidth).attr("height",w.rootHeight)});const Y=R({data:m,dataFormatter:b,chartParams:x}).pipe(M(a),L(async w=>w),L(w=>yt(w).pipe(_(D=>{try{const{status:y,columnName:S,expectToBe:C}=r(D.data);if(y==="error")throw new Error(vt({columnName:S,expectToBe:C,from:"Chart.data$"}));y==="warning"&&console.warn(bt({columnName:S,expectToBe:C,from:"Chart.data$"}))}catch(y){console.error(Nt(y))}return n({data:D.data,dataFormatter:D.dataFormatter,chartParams:D.chartParams})}))),v(1));Y.subscribe();const I={};return p.plugins$.subscribe(w=>{try{const{status:D,columnName:y,expectToBe:S}=Tc(o,w);if(D==="error")throw new Error(vt({columnName:y,expectToBe:S,from:"Chart.plugins$"}));D==="warning"&&console.warn(bt({columnName:y,expectToBe:S,from:"Chart.plugins$"}))}catch(D){console.error(Nt(D));return}h.selectAll("g.orbcharts__plugin").data(w,D=>D.name).join(D=>D.append("g").attr("class",y=>`orbcharts__plugin orbcharts__${y.name}`).each((y,S,C)=>{const B={fullParams$:new O,fullChartParams$:x,fullDataFormatter$:b,computedData$:Y,layout$:k},ht=i({observer:B,subject:p}),Z={selection:ie(C[S]),rootSelection:f,name:y.name,chartType:o,subject:p,observer:ht};y.setPresetParams(d.allPluginParams[y.name]??{}),y.setContext(Z),I[Z.name]=y,y.init()}),D=>D,D=>D.each((y,S,C)=>{I[y.name]&&(I[y.name].destroy(),I[y.name]=void 0)}).remove()).sort((D,y)=>D.layerIndex-y.layerIndex)}),{...p,selection:f,destroy(){ie(u).selectAll("svg").remove(),a.next(void 0),$.unsubscribe()}}}};class It{constructor({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a},o,s){this.data$=new P,this.dataFormatter$=new P,this.plugins$=new P,this.chartParams$=new P,this.event$=new P;try{const l=Sc({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a})(o,s);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(u){console.error(Nt(u))}}}class Mc extends It{constructor(e,n){super({defaultDataFormatter:Fe,dataFormatterValidator:ra,computedDataFn:ll,dataValidator:cl,contextObserverCallback:bc},e,n)}}const Cc=t=>{const e=F(t,{visibleFilter:{toBeTypes:["Function"]},grid:{toBeTypes:["object"]},container:{toBeTypes:["object"]}});if(t.grid){const n=F(t.grid,{seriesDirection:{toBe:'"row" | "column"',test:r=>r==="row"||r==="column"},rowLabels:{toBeTypes:["string[]"]},columnLabels:{toBeTypes:["string[]"]},valueAxis:{toBeTypes:["object"]},groupAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]}});if(n.status==="error")return n;if(t.grid.valueAxis){const r=F(t.grid.valueAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:i=>i==="bottom"||i==="left"||i==="top"||i==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:i=>Array.isArray(i)&&i.length===2&&(typeof i[0]=="number"||i[0]==="min"||i[0]==="auto")&&(typeof i[1]=="number"||i[1]==="max"||i[1]==="auto")},scaleRange:{toBe:"[number, number]",test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"},label:{toBeTypes:["string"]}});if(r.status==="error")return r}if(t.grid.groupAxis){const r=F(t.grid.groupAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:i=>i==="bottom"||i==="left"||i==="top"||i==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:i=>Array.isArray(i)&&i.length===2&&typeof i[0]=="number"&&(typeof i[1]=="number"||i[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(r.status==="error")return r}}if(t.container){const n=F(t.container,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e};function qi(t,e){if(!t.length)return[];try{const n=t.reduce((o,s)=>s.length>o?s.length:o,0),i=t.map((o,s)=>{if(o.length===n)return o;const u=Object.assign([],o);for(let l=u.length;l<n;l++)u[l]=null;return u}).map((o,s)=>o.map((u,l)=>u==null?{id:"",label:"",data:{},value:null}:typeof u=="number"?{id:"",label:"",data:{},value:u}:{id:u.id??"",label:u.label??"",data:u.data??{},value:u.value}));return ei(e.seriesDirection,i)}catch{return[]}}const Fc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=qi(e,n.grid),o=sn({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"}),s=Zr({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"});let u=0;i=a.map((l,f)=>l.map((c,h)=>{const p=Jt("grid",0,f,h),d=s[h],m={id:c.id?c.id:p,index:u,label:c.label?c.label:p,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:h,groupLabel:d,color:St(f,r),visible:!0};return m.visible=n.visibleFilter(m,t),u++,m}))}catch(a){throw Error(a)}return i},Ec=t=>F({data:t},{data:{toBe:"(DataGridDatum | DataGridValue)[][]",test:n=>Array.isArray(n)}}),Lc=({subject:t,observer:e})=>{const n=Rt(e.fullChartParams$).pipe(v(1)),r=e.fullDataFormatter$.pipe(_($=>$.grid.separateSeries),K(),v(1)),i=Xi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),a=Cn({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),o=e.computedData$.pipe(_($=>$.flat())).pipe(v(1)),s=Pt({datumList$:o,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),u=Fn({computedData$:e.computedData$}),l=Te({datumList$:o}).pipe(v(1)),f=$n({datumList$:o}).pipe(v(1)),c=Mn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),h=En({computedData$:e.computedData$}).pipe(v(1)),p=Ln({computedLayoutData$:c}).pipe(v(1)),d=On({computedData$:e.computedData$,isSeriesSeprate$:r}).pipe(v(1)),m=Pn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),b=Rn({computedData$:e.computedData$,groupScaleDomainValue$:m}).pipe(v(1)),x=Nn({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),T=In({gridAxesTransform$:x}).pipe(v(1)),A=kn({computedData$:e.computedData$,groupScaleDomainValue$:m,filteredMinMaxValue$:b,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),E=Bn({gridContainerPosition$:i,gridAxesTransform$:x,gridGraphicTransform$:A});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isSeriesSeprate$:r,gridContainerPosition$:i,gridAxesSize$:a,gridHighlight$:s,seriesLabels$:u,SeriesDataMap$:l,GroupDataMap$:f,computedLayoutData$:c,visibleComputedData$:h,visibleComputedLayoutData$:p,computedStackedData$:d,groupScaleDomainValue$:m,filteredMinMaxValue$:b,gridAxesTransform$:x,gridAxesReverseTransform$:T,gridGraphicTransform$:A,gridGraphicReverseScale$:E}};class Oc extends It{constructor(e,n){super({defaultDataFormatter:Le,dataFormatterValidator:Cc,computedDataFn:Fc,dataValidator:Ec,contextObserverCallback:Lc},e,n)}}const Pc=t=>{const e=F(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=F(i,{seriesDirection:{toBe:'"row" | "column"',test:s=>s==="row"||s==="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 s=F(i.valueAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:u=>u==="top"||u==="bottom"||u==="left"||u==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:u=>Array.isArray(u)&&u.length===2&&(typeof u[0]=="number"||u[0]==="min"||u[0]==="auto")&&(typeof u[1]=="number"||u[1]==="max"||u[1]==="auto")},scaleRange:{toBe:"[number, number]",test:u=>Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&typeof u[1]=="number"},label:{toBeTypes:["string"]}});if(s.status==="error")return s}else if(i.groupAxis){const s=F(i.groupAxis,{position:{toBe:'"top" | "bottom" | "left" | "right"',test:u=>u==="top"||u==="bottom"||u==="left"||u==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:u=>Array.isArray(u)&&u.length===2&&typeof u[0]=="number"&&(typeof u[1]=="number"||u[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(s.status==="error")return s}return{status:"success",columnName:"",expectToBe:""}}).find(i=>i.status==="error");if(r)return r}if(t.container){const n=F(t.container,{gap:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnAmount:{toBeTypes:["number"]}});if(n.status==="error")return n}return e},Rc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||Bt,o=e.map((c,h)=>n.gridList[h]||a),s=e.map((c,h)=>qi(c,o[h])),u=n.separateGrid?s.map((c,h)=>sn({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid"})):s.map((c,h)=>Kr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h})),l=new Map;let f=0;u.flat().forEach((c,h)=>{if(!l.has(c)){const p=St(f,r);l.set(c,p),f++}}),i=s.map((c,h)=>{const p=u[h],d=Qr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h});let m=0;return c.map((x,T)=>x.map((A,E)=>{const $=Jt("multiGrid",h,T,E),k=d[E],Y=p[T],I={id:A.id?A.id:$,index:m,label:A.label?A.label:$,description:A.description??"",data:A.data,value:A.value,gridIndex:h,seriesIndex:T,seriesLabel:Y,groupIndex:E,groupLabel:k,color:l.get(Y),visible:!0};return I.visible=n.visibleFilter(I,t),m++,I}))})}catch(a){throw Error(a)}return i},Nc=t=>F({data:t},{data:{toBe:"DataGrid[]",test:n=>Array.isArray(n)}}),Ic=({subject:t,observer:e})=>{const n=Rt(e.fullChartParams$).pipe(v(1)),r=Yi({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),i=Vn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,multiGridContainerPosition$:i,multiGridEachDetail$:r}};class kc extends It{constructor(e,n){super({defaultDataFormatter:Oe,dataFormatterValidator:Pc,computedDataFn:Rc,dataValidator:Nc,contextObserverCallback:Ic},e,n)}}const Bc=t=>({status:"success",columnName:"",expectToBe:""}),Vc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i=on();let a=[];try{const o=e.map((f,c)=>Array.isArray(f)?{id:"",label:"",description:"",data:{},categoryLabel:i,value:f}:U(f)?{id:f.id??"",label:f.label??"",description:f.description??"",data:f.data??{},categoryLabel:f.categoryLabel??i,value:f.value}:{id:"",label:"",description:"",data:{},categoryLabel:i,value:[]}),s=(()=>{const f=new Set(n.categoryLabels);for(let c of o){const h=c.categoryLabel??i;f.add(h)}return Array.from(f)})(),u=new Map(s.map((f,c)=>[f,c]));let l=0;o.forEach((f,c)=>{const h=l;l++;const p=Jt(n.type,c),d=u.get(f.categoryLabel)??0,m=St(d,r),b={id:f.id?f.id:p,index:h,label:f.label?f.label:p,description:f.description??"",data:f.data,datumIndex:c,value:f.value,categoryIndex:d,categoryLabel:f.categoryLabel,visible:!0,color:m};b.visible=n.visibleFilter(b,t),a[d]||(a[d]=[]),a[d].push(b)})}catch(o){throw Error(o)}return a},Gc=t=>({status:"success",columnName:"",expectToBe:""}),Xc=({computedData$:t})=>t.pipe(_(e=>{const n=e.flat(),[r,i]=ut(n.map(s=>s.value[0])),[a,o]=ut(n.map(s=>s.value[1]));return{minX:r,maxX:i,minY:a,maxY:o}})),Yc=({computedData$:t,minMaxXY$:e,fullDataFormatter$:n,layout$:r})=>{function i(o,s){let u=o.maxX,l=o.minX;return l===u&&u===0&&(u=1),it({maxValue:u,minValue:l,axisWidth:s.width,scaleDomain:["auto","auto"],scaleRange:[0,1]})}function a(o,s){let u=o.maxY,l=o.minY;return l===u&&u===0&&(u=1),it({maxValue:u,minValue:l,axisWidth:s.height,scaleDomain:["auto","auto"],scaleRange:[0,1],reverse:!0})}return R({computedData:t,minMaxXY:e,fullDataFormatter:n,layout:r}).pipe(L(async o=>o),_(o=>{const s=i(o.minMaxXY,o.layout),u=a(o.minMaxXY,o.layout);return o.computedData.map((l,f)=>l.map((c,h)=>({...c,axisX:s(c.value[0]??0),axisY:u(c.value[1]??0)})))}))},Uc=({computedData$:t,fullDataFormatter$:e})=>t.pipe(_(n=>n.map(r=>r[0]?r[0].categoryLabel:"")),K((n,r)=>JSON.stringify(n).length===JSON.stringify(r).length)),Hc=({computedData$:t})=>t.pipe(_(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),zc=({computedLayoutData$:t})=>t.pipe(_(e=>e.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),jc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(L(async i=>i),_(i=>{if(i.fullDataFormatter.separateCategory)return Mt(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Mt(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,s)=>a[0])}})),qc=({visibleComputedLayoutData$:t,minMaxXY$:e,fullDataFormatter$:n})=>R({visibleComputedLayoutData:t,minMaxXY:e,fullDataFormatter:n}).pipe(_(r=>{const{minX:i,maxX:a,minY:o,maxY:s}=(()=>{let{minX:p,maxX:d,minY:m,maxY:b}=r.minMaxXY;return r.fullDataFormatter.xAxis.scaleDomain[0]==="auto"&&p>0?p=0:typeof r.fullDataFormatter.xAxis.scaleDomain[0]=="number"&&(p=r.fullDataFormatter.xAxis.scaleDomain[0]),r.fullDataFormatter.xAxis.scaleDomain[1]==="auto"&&d<0?d=0:typeof r.fullDataFormatter.xAxis.scaleDomain[1]=="number"&&(d=r.fullDataFormatter.xAxis.scaleDomain[1]),r.fullDataFormatter.yAxis.scaleDomain[0]==="auto"&&m>0?m=0:typeof r.fullDataFormatter.yAxis.scaleDomain[0]=="number"&&(m=r.fullDataFormatter.yAxis.scaleDomain[0]),r.fullDataFormatter.yAxis.scaleDomain[1]==="auto"&&b<0?b=0:typeof r.fullDataFormatter.yAxis.scaleDomain[1]=="number"&&(b=r.fullDataFormatter.yAxis.scaleDomain[1]),{minX:p,maxX:d,minY:m,maxY:b}})();let u=[],l=null,f=null,c=null,h=null;for(let p of r.visibleComputedLayoutData)for(let d of p)d.value[0]>=i&&d.value[0]<=a&&d.value[1]>=o&&d.value[1]<=s&&(u.push(d),(l==null||d.value[0]<l.value[0])&&(l=d),(f==null||d.value[0]>f.value[0])&&(f=d),(c==null||d.value[1]<c.value[1])&&(c=d),(h==null||d.value[1]>h.value[1])&&(h=d));return{datumList:u,minXDatum:l,maxXDatum:f,minYDatum:c,maxYDatum:h}})),Wc=({minMaxXY$:t,filteredMinMaxXYData$:e,fullDataFormatter$:n,layout$:r})=>{const i=new P;function a({minMaxXY:o,filteredMinMaxXYData:s,xAxis:u,yAxis:l,width:f,height:c}){let h=0,p=0,d=0,m=0,{minX:b,maxX:x,minY:T,maxY:A}=o,E=s.minXDatum.value[0]??0,$=s.maxXDatum.value[0]??0,k=s.minYDatum.value[1]??0,Y=s.maxYDatum.value[1]??0;E===$&&$===0&&($=1),k===Y&&Y===0&&(Y=1),b===x&&x===0&&(x=1),T===A&&A===0&&(A=1);const I=it({maxValue:$,minValue:E,axisWidth:f,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),w=I(b>0?0:b),D=I(x<0?0:x);h=w,d=(D-w)/f;const S=it({maxValue:Y,minValue:k,axisWidth:c,scaleDomain:l.scaleDomain,scaleRange:l.scaleRange,reverse:!0}),C=S(T>0?0:T),B=S(A<0?0:A);return p=B,m=(C-B)/c,{translate:[h,p],scale:[d,m],rotate:0,rotateX:0,rotateY:0,value:`translate(${h}px, ${p}px) scale(${d}, ${m})`}}return new O(o=>(R({minMaxXY:t,filteredMinMaxXYData:e,fullDataFormatter:n,layout:r}).pipe(M(i),L(async s=>s)).subscribe(s=>{if(!s.filteredMinMaxXYData.minXDatum||!s.filteredMinMaxXYData.maxXDatum||s.filteredMinMaxXYData.minXDatum.value[0]==null||s.filteredMinMaxXYData.maxXDatum.value[0]==null||!s.filteredMinMaxXYData.minYDatum||!s.filteredMinMaxXYData.maxYDatum||s.filteredMinMaxXYData.minYDatum.value[1]==null||s.filteredMinMaxXYData.maxYDatum.value[1]==null)return;const u=a({minMaxXY:s.minMaxXY,filteredMinMaxXYData:s.filteredMinMaxXYData,xAxis:s.fullDataFormatter.xAxis,yAxis:s.fullDataFormatter.yAxis,width:s.layout.width,height:s.layout.height});o.next(u)}),function(){i.next(void 0)}))},Jc=({multiValueContainerPosition$:t,multiValueGraphicTransform$:e})=>R({multiValueContainerPosition:t,multiValueGraphicTransform:e}).pipe(L(async n=>n),_(n=>n.multiValueContainerPosition.map((r,i)=>[1/n.multiValueGraphicTransform.scale[0]/n.multiValueContainerPosition[i].scale[0],1/n.multiValueGraphicTransform.scale[1]/n.multiValueContainerPosition[i].scale[1]]))),Kc=({subject:t,observer:e})=>{const n=Rt(e.fullChartParams$).pipe(v(1)),r=e.fullDataFormatter$.pipe(_(b=>b.separateCategory),K(),v(1)),i=jc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),a=e.computedData$.pipe(_(b=>b.flat().flat())).pipe(v(1)),o=Pt({datumList$:a,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),s=Uc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}),u=Tn({datumList$:a}).pipe(v(1)),l=Xc({computedData$:e.computedData$}).pipe(v(1)),f=Yc({computedData$:e.computedData$,minMaxXY$:l,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),c=Hc({computedData$:e.computedData$}).pipe(v(1)),h=zc({computedLayoutData$:f}).pipe(v(1)),p=qc({visibleComputedLayoutData$:h,minMaxXY$:l,fullDataFormatter$:e.fullDataFormatter$}).pipe(v(1)),d=Wc({minMaxXY$:l,filteredMinMaxXYData$:p,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(v(1)),m=Jc({multiValueContainerPosition$:i,multiValueGraphicTransform$:d});return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isCategorySeprate$:r,multiValueContainerPosition$:i,multiValueHighlight$:o,categoryLabels$:s,CategoryDataMap$:u,minMaxXY$:l,computedLayoutData$:f,visibleComputedData$:c,visibleComputedLayoutData$:h,filteredMinMaxXYData$:p,multiValueGraphicTransform$:d,multiValueGraphicReverseScale$:m}};class Zc extends It{constructor(e,n){super({defaultDataFormatter:Pe,dataFormatterValidator:Bc,computedDataFn:Vc,dataValidator:Gc,contextObserverCallback:Kc},e,n)}}const Qc=t=>({status:"success",columnName:"",expectToBe:""}),tf=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],s=[];if(e.nodes)o=e.nodes,s=e.edges;else if(e[0])o=e[0],s=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:!0}));const u=new Map(i.map(c=>[c.id,c]));a=s.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},startNode:u.get(c.start),startNodeId:c.start,endNode:u.get(c.end),endNodeId:c.end,visible:!0}));const l=function(){const c=new Map;return a.forEach(h=>{const p=c.get(h.endNodeId)??[];p.push(h.startNode),c.set(h.endNodeId,p)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const p=c.get(h.startNodeId)??[];p.push(h.endNode),c.set(h.startNodeId,p)}),c}();Array.from(u).forEach(([c,h])=>{h.startNodes=l.get(c),h.startNodeIds=h.startNodes.map(p=>p.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(p=>p.id),h.visible=n.visibleFilter(h,t)}),a=a.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(o){throw Error(o)}return{nodes:i,edges:a}},ef=t=>({status:"success",columnName:"",expectToBe:""}),nf=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class rf extends It{constructor(e,n){super({defaultDataFormatter:Ne,dataFormatterValidator:Qc,computedDataFn:tf,dataValidator:ef,contextObserverCallback:nf},e,n)}}const af=t=>F(t,{visibleFilter:{toBeTypes:["Function"]},categoryLabels:{toBeTypes:["string[]"]}}),of=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=on(),a=new Map(n.categoryLabels.map((s,u)=>[s,u]));let o={id:"",index:0,label:"",description:"",categoryIndex:-1,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const s=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(p=>{if(!p.parent)f=p;else{const d=c.get(p.parent)??[];d.push(p),c.set(p.parent,d)}});const h=p=>({id:p.id,label:p.label,data:p.data,value:p.value,categoryLabel:p.categoryLabel??i,children:(c.get(p.id)??[]).map(d=>h(d))});return f?h(f):{id:""}}();let u=0;const l=(f,c,h)=>{const p=c+1,d=f.categoryLabel??i;a.has(d)||a.set(d,a.size);const m=a.get(d)??0,b=u;u++;const x={id:f.id,index:b,level:c,seq:h,label:f.label??"",description:f.description??"",categoryIndex:m,categoryLabel:d,color:St(m,r),data:f.data??{},value:f.value,visible:!0,children:(f.children??[]).map((T,A)=>l(T,p,A))};return x.visible=n.visibleFilter(x,t),x};o=l(s,0,0)}catch(s){throw Error(s)}return o},sf=t=>F({data:t},{data:{toBe:"DataTreeObj | DataTreeDatum[]",test:n=>U(n)&&n.id!==void 0}}),uf=({subject:t,observer:e})=>{const n=Rt(e.fullChartParams$).pipe(v(1)),r=Ui({computedData$:e.computedData$}).pipe(v(1)),i=Pt({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(v(1)),a=Tn({datumList$:r}).pipe(v(1)),o=Hi(a).pipe(v(1)),s=zi({computedData$:e.computedData$}).pipe(v(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,categoryLabels$:o,CategoryDataMap$:a,visibleComputedData$:s}};class lf extends It{constructor(e,n){super({defaultDataFormatter:Re,dataFormatterValidator:af,computedDataFn:of,dataValidator:sf,contextObserverCallback:uf},e,n)}}function cf({chartType:t,config:e,initFn:n}){const r=new P,i=new WeakMap;let a=()=>{},o;const s=new hi(e.defaultParams),u=new hi({}),l=s.pipe(L(f=>u.pipe(M(r),_(c=>{try{const{status:h,columnName:p,expectToBe:d}=e.validator(c,{validateColumns:F});if(h==="error")throw new Error(vt({columnName:p,expectToBe:d,from:`${e.name}.params$`}));h==="warning"&&console.warn(bt({columnName:p,expectToBe:d,from:`${e.name}.params$`}))}catch(h){console.error(Nt(h))}return st(c,f)}))),v(1));return{params$:u,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=>{s.next(st(f,e.defaultParams))},setContext:f=>{o=f,o.observer.fullParams$=l}}}const wt=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}}}},ff=wt("series"),hf=wt("grid"),pf=wt("multiGrid"),df=wt("multiValue"),mf=wt("noneData"),gf=wt("relationship"),yf=wt("tree");g.CHART_HEIGHT_DEFAULT=Xn,g.CHART_OPTIONS_DEFAULT=ot,g.CHART_PARAMS_DEFAULT=Ce,g.CHART_WIDTH_DEFAULT=Gn,g.DATA_FORMATTER_CONTAINER_DEFAULT=kt,g.DATA_FORMATTER_GRID_DEFAULT=Le,g.DATA_FORMATTER_GRID_GRID_DEFAULT=Ee,g.DATA_FORMATTER_GROUP_AXIS_DEFAULT=Yn,g.DATA_FORMATTER_MULTI_GRID_DEFAULT=Oe,g.DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT=Bt,g.DATA_FORMATTER_MULTI_VALUE_DEFAULT=Pe,g.DATA_FORMATTER_RELATIONAL_DEFAULT=Ne,g.DATA_FORMATTER_SERIES_DEFAULT=Fe,g.DATA_FORMATTER_TREE_DEFAULT=Re,g.DATA_FORMATTER_VALUE_AXIS_DEFAULT=V,g.DATA_GRID_DEFAULT=Ji,g.DATA_MULTI_GRID_DEFAULT=Ki,g.DATA_MULTI_VALUE_DEFAULT=Zi,g.DATA_RELATIONA_DEFAULTL=ta,g.DATA_SERIES_DEFAULT=Wi,g.DATA_TREE_DEFAULT=Qi,g.GridChart=Oc,g.MultiGridChart=kc,g.MultiValueChart=Zc,g.PADDING_DEFAULT=Me,g.RelationshipChart=rf,g.SeriesChart=Mc,g.TreeChart=lf,g.calcGridContainerLayout=Mt,g.calcSeriesContainerLayout=ln,g.categoryDataMapObservable=Tn,g.categoryLabelsObservable=Hi,g.computedStackedDataObservables=On,g.createAxisToLabelIndexScale=xc,g.createAxisToValueScale=wc,g.createDefaultCategoryLabel=on,g.createDefaultDatumId=Jt,g.createDefaultGroupLabel=an,g.createDefaultSeriesLabel=xe,g.createGridGroupLabels=Zr,g.createGridSeriesLabels=sn,g.createLabelToAxisScale=Dc,g.createMultiGridGroupLabels=Qr,g.createMultiGridSeriesLabels=Kr,g.createValueToAxisScale=it,g.defineGridPlugin=hf,g.defineMultiGridPlugin=pf,g.defineMultiValuePlugin=df,g.defineNoneDataPlugin=mf,g.defineRelationshipPlugin=gf,g.defineSeriesPlugin=ff,g.defineTreePlugin=yf,g.filteredMinMaxValueObservable=Rn,g.formatCommaNumber=ea,g.formatValueToLabel=il,g.getMinAndMax=ut,g.getMinAndMaxGrid=un,g.getMinAndMaxMultiGrid=ol,g.getMinAndMaxMultiValue=sl,g.getMinAndMaxMultiValueXY=ul,g.getMinAndMaxSeries=al,g.getMinAndMaxValue=ti,g.gridAxesReverseTransformObservable=In,g.gridAxesSizeObservable=Cn,g.gridAxesTransformObservable=Nn,g.gridComputedLayoutDataObservable=Mn,g.gridContainerPositionObservable=Xi,g.gridGraphicReverseScaleObservable=Bn,g.gridGraphicTransformObservable=kn,g.gridSeriesLabelsObservable=Fn,g.gridVisibleComputedDataObservable=En,g.gridVisibleComputedLayoutDataObservable=Ln,g.groupDataMapObservable=$n,g.groupScaleDomainValueObservable=Pn,g.highlightObservable=Pt,g.isDom=Hn,g.isFunction=Un,g.isPlainObject=U,g.mergeOptionsWithDefault=st,g.multiGridContainerObservable=Vn,g.multiGridEachDetailObservable=Yi,g.nodeListObservable=Ui,g.resizeObservable=Ni,g.separateSeriesObservable=Ii,g.seriesColorPredicate=St,g.seriesComputedLayoutDataObservable=Bi,g.seriesContainerPositionMapObservable=Gi,g.seriesContainerPositionObservable=Vi,g.seriesDataMapObservable=Te,g.seriesLabelsObservable=ki,g.seriesVisibleComputedDataObservable=Sn,g.textSizePxObservable=Rt,g.transposeData=ei,g.treeVisibleComputedDataObservable=zi,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|