@orbcharts/core 3.0.0-alpha.60 → 3.0.0-alpha.62
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/lib/core-types.d.ts +1 -0
- package/dist/orbcharts-core.es.js +3056 -2609
- package/dist/orbcharts-core.umd.js +6 -2
- package/dist/src/AbstractChart.d.ts +5 -3
- package/dist/src/GridChart.d.ts +1 -1
- package/dist/src/MultiGridChart.d.ts +1 -1
- package/dist/src/MultiValueChart.d.ts +1 -1
- package/dist/src/RelationshipChart.d.ts +1 -1
- package/dist/src/SeriesChart.d.ts +1 -1
- package/dist/src/TreeChart.d.ts +1 -1
- package/dist/src/base/createBaseChart.d.ts +1 -1
- package/dist/src/base/createBasePlugin.d.ts +1 -1
- package/dist/src/base/validators/chartOptionsValidator.d.ts +3 -0
- package/dist/src/base/validators/chartParamsValidator.d.ts +3 -0
- package/dist/src/base/validators/elementValidator.d.ts +3 -0
- package/dist/src/base/validators/pluginsValidator.d.ts +3 -0
- package/dist/src/defaults.d.ts +1 -16
- package/dist/src/defineGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiValuePlugin.d.ts +1 -1
- package/dist/src/defineNoneDataPlugin.d.ts +1 -1
- package/dist/src/defineRelationshipPlugin.d.ts +1 -1
- package/dist/src/defineSeriesPlugin.d.ts +1 -1
- package/dist/src/defineTreePlugin.d.ts +1 -1
- package/dist/src/grid/computedDataFn.d.ts +4 -0
- package/dist/src/grid/contextObserverCallback.d.ts +3 -0
- package/dist/src/grid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/grid/dataValidator.d.ts +3 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/multiGrid/computedDataFn.d.ts +3 -0
- package/dist/src/multiGrid/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiGrid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiGrid/dataValidator.d.ts +3 -0
- package/dist/src/multiValue/computedDataFn.d.ts +3 -0
- package/dist/src/multiValue/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiValue/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiValue/dataValidator.d.ts +3 -0
- package/dist/src/relationship/computedDataFn.d.ts +3 -0
- package/dist/src/relationship/contextObserverCallback.d.ts +3 -0
- package/dist/src/relationship/dataFormatterValidator.d.ts +3 -0
- package/dist/src/relationship/dataValidator.d.ts +3 -0
- package/dist/src/series/computedDataFn.d.ts +3 -0
- package/dist/src/series/contextObserverCallback.d.ts +3 -0
- package/dist/src/series/dataFormatterValidator.d.ts +3 -0
- package/dist/src/series/dataValidator.d.ts +3 -0
- package/dist/src/tree/computedDataFn.d.ts +3 -0
- package/dist/src/tree/contextObserverCallback.d.ts +3 -0
- package/dist/src/tree/dataFormatterValidator.d.ts +3 -0
- package/dist/src/tree/dataValidator.d.ts +3 -0
- package/dist/src/utils/commonUtils.d.ts +1 -0
- package/dist/src/utils/errorMessage.d.ts +14 -0
- package/dist/src/{grid → utils}/gridObservables.d.ts +2 -2
- package/dist/src/utils/index.d.ts +7 -3
- package/dist/src/{multiGrid → utils}/multiGridObservables.d.ts +1 -1
- package/dist/src/utils/observables.d.ts +2 -1
- package/dist/src/utils/orbchartsUtils.d.ts +1 -12
- package/dist/src/{series → utils}/seriesObservables.d.ts +3 -3
- package/dist/src/{tree → utils}/treeObservables.d.ts +1 -1
- package/dist/src/utils/validator.d.ts +3 -0
- package/lib/core-types.ts +7 -0
- package/package.json +42 -41
- package/src/AbstractChart.ts +57 -48
- package/src/GridChart.ts +24 -20
- package/src/MultiGridChart.ts +24 -20
- package/src/MultiValueChart.ts +24 -20
- package/src/RelationshipChart.ts +24 -20
- package/src/SeriesChart.ts +24 -20
- package/src/TreeChart.ts +24 -20
- package/src/base/createBaseChart.ts +500 -386
- package/src/base/createBasePlugin.ts +152 -95
- package/src/base/validators/chartOptionsValidator.ts +24 -0
- package/src/base/validators/chartParamsValidator.ts +134 -0
- package/src/base/validators/elementValidator.ts +14 -0
- package/src/base/validators/pluginsValidator.ts +15 -0
- package/src/defaults.ts +232 -226
- package/src/defineGridPlugin.ts +3 -3
- package/src/defineMultiGridPlugin.ts +3 -3
- package/src/defineMultiValuePlugin.ts +3 -3
- package/src/defineNoneDataPlugin.ts +4 -4
- package/src/defineRelationshipPlugin.ts +3 -3
- package/src/defineSeriesPlugin.ts +3 -3
- package/src/defineTreePlugin.ts +3 -3
- package/src/grid/{computeGridData.ts → computedDataFn.ts} +129 -134
- package/src/grid/{createGridContextObserver.ts → contextObserverCallback.ts} +155 -155
- package/src/grid/dataFormatterValidator.ts +9 -0
- package/src/grid/dataValidator.ts +9 -0
- package/src/index.ts +20 -21
- package/src/multiGrid/{computeMultiGridData.ts → computedDataFn.ts} +123 -130
- package/src/multiGrid/{createMultiGridContextObserver.ts → contextObserverCallback.ts} +41 -41
- package/src/multiGrid/dataFormatterValidator.ts +9 -0
- package/src/multiGrid/dataValidator.ts +9 -0
- package/src/multiValue/{computeMultiValueData.ts → computedDataFn.ts} +176 -179
- package/src/multiValue/{createMultiValueContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/multiValue/dataFormatterValidator.ts +9 -0
- package/src/multiValue/dataValidator.ts +9 -0
- package/src/relationship/{computeRelationshipData.ts → computedDataFn.ts} +125 -118
- package/src/relationship/{createRelationshipContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/relationship/dataFormatterValidator.ts +9 -0
- package/src/relationship/dataValidator.ts +9 -0
- package/src/series/{computeSeriesData.ts → computedDataFn.ts} +88 -90
- package/src/series/{createSeriesContextObserver.ts → contextObserverCallback.ts} +100 -93
- package/src/series/dataFormatterValidator.ts +9 -0
- package/src/series/dataValidator.ts +9 -0
- package/src/tree/{computeTreeData.ts → computedDataFn.ts} +130 -132
- package/src/tree/{createTreeContextObserver.ts → contextObserverCallback.ts} +61 -61
- package/src/tree/dataFormatterValidator.ts +9 -0
- package/src/tree/dataValidator.ts +9 -0
- package/src/utils/commonUtils.ts +54 -50
- package/src/utils/d3Utils.ts +108 -108
- package/src/utils/errorMessage.ts +43 -0
- package/src/{grid → utils}/gridObservables.ts +611 -614
- package/src/utils/index.ts +10 -4
- package/src/{multiGrid → utils}/multiGridObservables.ts +366 -365
- package/src/utils/observables.ts +218 -202
- package/src/utils/orbchartsUtils.ts +352 -349
- package/src/{series → utils}/seriesObservables.ts +175 -175
- package/src/{tree → utils}/treeObservables.ts +94 -94
- package/src/utils/validator.ts +126 -0
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite-env.d.ts +7 -0
- package/vite.config.js +22 -22
- package/dist/src/grid/computeGridData.d.ts +0 -6
- package/dist/src/grid/createGridContextObserver.d.ts +0 -3
- package/dist/src/multiGrid/computeMultiGridData.d.ts +0 -3
- package/dist/src/multiGrid/createMultiGridContextObserver.d.ts +0 -3
- package/dist/src/multiValue/computeMultiValueData.d.ts +0 -3
- package/dist/src/multiValue/createMultiValueContextObserver.d.ts +0 -3
- package/dist/src/relationship/computeRelationshipData.d.ts +0 -3
- package/dist/src/relationship/createRelationshipContextObserver.d.ts +0 -3
- package/dist/src/series/computeSeriesData.d.ts +0 -3
- package/dist/src/series/createSeriesContextObserver.d.ts +0 -3
- package/dist/src/tree/computeTreeData.d.ts +0 -3
- package/dist/src/tree/createTreeContextObserver.d.ts +0 -3
- package/dist/src/types/Axis.d.ts +0 -1
- package/dist/src/types/Chart.d.ts +0 -45
- package/dist/src/types/ChartParams.d.ts +0 -36
- package/dist/src/types/ComputedData.d.ts +0 -42
- package/dist/src/types/ComputedDataGrid.d.ts +0 -5
- package/dist/src/types/ComputedDataMultiGrid.d.ts +0 -3
- package/dist/src/types/ComputedDataMultiValue.d.ts +0 -6
- package/dist/src/types/ComputedDataRelationship.d.ts +0 -18
- package/dist/src/types/ComputedDataSeries.d.ts +0 -5
- package/dist/src/types/ComputedDataTree.d.ts +0 -7
- package/dist/src/types/ContextObserver.d.ts +0 -28
- package/dist/src/types/ContextObserverGrid.d.ts +0 -41
- package/dist/src/types/ContextObserverMultiGrid.d.ts +0 -15
- package/dist/src/types/ContextObserverMultiValue.d.ts +0 -4
- package/dist/src/types/ContextObserverRelationship.d.ts +0 -4
- package/dist/src/types/ContextObserverSeries.d.ts +0 -27
- package/dist/src/types/ContextObserverTree.d.ts +0 -11
- package/dist/src/types/ContextSubject.d.ts +0 -15
- package/dist/src/types/Data.d.ts +0 -19
- package/dist/src/types/DataFormatter.d.ts +0 -41
- package/dist/src/types/DataFormatterGrid.d.ts +0 -34
- package/dist/src/types/DataFormatterMultiGrid.d.ts +0 -20
- package/dist/src/types/DataFormatterMultiValue.d.ts +0 -18
- package/dist/src/types/DataFormatterRelationship.d.ts +0 -10
- package/dist/src/types/DataFormatterSeries.d.ts +0 -19
- package/dist/src/types/DataFormatterTree.d.ts +0 -7
- package/dist/src/types/DataGrid.d.ts +0 -6
- package/dist/src/types/DataMultiGrid.d.ts +0 -6
- package/dist/src/types/DataMultiValue.d.ts +0 -7
- package/dist/src/types/DataRelationship.d.ts +0 -21
- package/dist/src/types/DataSeries.d.ts +0 -6
- package/dist/src/types/DataTree.d.ts +0 -15
- package/dist/src/types/Event.d.ts +0 -56
- package/dist/src/types/Layout.d.ts +0 -8
- package/dist/src/types/Padding.d.ts +0 -6
- package/dist/src/types/Plugin.d.ts +0 -37
- package/dist/src/types/TransformData.d.ts +0 -8
- package/dist/src/types/index.d.ts +0 -37
- package/src/types/Axis.ts +0 -1
- package/src/types/Chart.ts +0 -54
- package/src/types/ChartParams.ts +0 -51
- package/src/types/ComputedData.ts +0 -84
- package/src/types/ComputedDataGrid.ts +0 -14
- package/src/types/ComputedDataMultiGrid.ts +0 -3
- package/src/types/ComputedDataMultiValue.ts +0 -9
- package/src/types/ComputedDataRelationship.ts +0 -20
- package/src/types/ComputedDataSeries.ts +0 -8
- package/src/types/ComputedDataTree.ts +0 -20
- package/src/types/ContextObserver.ts +0 -38
- package/src/types/ContextObserverGrid.ts +0 -43
- package/src/types/ContextObserverMultiGrid.ts +0 -17
- package/src/types/ContextObserverMultiValue.ts +0 -5
- package/src/types/ContextObserverRelationship.ts +0 -5
- package/src/types/ContextObserverSeries.ts +0 -29
- package/src/types/ContextObserverTree.ts +0 -11
- package/src/types/ContextSubject.ts +0 -18
- package/src/types/Data.ts +0 -45
- package/src/types/DataFormatter.ts +0 -74
- package/src/types/DataFormatterGrid.ts +0 -68
- package/src/types/DataFormatterMultiGrid.ts +0 -45
- package/src/types/DataFormatterMultiValue.ts +0 -24
- package/src/types/DataFormatterRelationship.ts +0 -26
- package/src/types/DataFormatterSeries.ts +0 -20
- package/src/types/DataFormatterTree.ts +0 -12
- package/src/types/DataGrid.ts +0 -11
- package/src/types/DataMultiGrid.ts +0 -7
- package/src/types/DataMultiValue.ts +0 -12
- package/src/types/DataRelationship.ts +0 -28
- package/src/types/DataSeries.ts +0 -11
- package/src/types/DataTree.ts +0 -20
- package/src/types/Event.ts +0 -153
- package/src/types/Layout.ts +0 -12
- package/src/types/Padding.ts +0 -6
- package/src/types/Plugin.ts +0 -60
- package/src/types/TransformData.ts +0 -8
- package/src/types/index.ts +0 -37
- /package/dist/src/{multiValue → utils}/multiValueObservables.d.ts +0 -0
- /package/dist/src/{relationship → utils}/relationshipObservables.d.ts +0 -0
- /package/src/{multiValue → utils}/multiValueObservables.ts +0 -0
- /package/src/{relationship → utils}/relationshipObservables.ts +0 -0
@@ -1,3 +1,7 @@
|
|
1
|
-
(function(w,lt){typeof exports=="object"&&typeof module<"u"?lt(exports):typeof define=="function"&&define.amd?define(["exports"],lt):(w=typeof globalThis<"u"?globalThis:w||self,lt(w["orbcharts-core"]={}))})(this,function(w){"use strict";const lt={},dn={top:60,right:60,bottom:60,left:60},pn={padding:dn,highlightTarget:"datum",highlightDefault:null,colorScheme:"light",colors:{light:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#1b1e23",secondary:"#e1e1e1",white:"#ffffff",background:"#ffffff"},dark:{series:["#67B7DC","#6794DC","#6771DC","#8067DC","#A367DC","#C767DC","#DC67CE","#DC67AB","#DC6788","#DC6967","#DC8C67","#DCAF67"],primary:"#f0f0f0",secondary:"#e1e1e1",white:"#ffffff",background:"#000000"}},styles:{textSize:"0.875rem",unhighlightedOpacity:.3},transitionDuration:800,transitionEase:"easeCubic"},Mi=800,Ci=500,tt={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Pi={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},$e={gap:120,rowAmount:1,columnAmount:1},mn={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...$e},separateSeries:!1,sumSeries:!1};mn.visibleFilter.toString=()=>"(datum, context) => true";const gn={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...tt},groupAxis:{...Pi},separateSeries:!1},yn={type:"grid",visibleFilter:(t,e)=>!0,grid:{...gn},container:{...$e}};yn.visibleFilter.toString=()=>"(datum, context) => true";const qt={...gn},vn={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...qt}],separateGrid:!1,container:{...$e}};vn.visibleFilter.toString=()=>"(datum, context) => true";const bn={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],multiValue:[],xAxis:{...tt},yAxis:{...tt}};bn.visibleFilter.toString=()=>"(datum, context) => true";const wn={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};wn.visibleFilter.toString=()=>"(datum, context) => true";const xn={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};xn.visibleFilter.toString=()=>"(datum, context) => true";function Yt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fi(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function _n(t){let e,n,r;t.length!==2?(e=Yt,n=(u,l)=>Yt(t(u),l),r=(u,l)=>t(u)-l):(e=t===Yt||t===Fi?t:Ei,n=t,r=t);function i(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<0?s=c+1:f=c}while(s<f)}return s}function a(u,l,s=0,f=u.length){if(s<f){if(e(l,l)!==0)return f;do{const c=s+f>>>1;n(u[c],l)<=0?s=c+1:f=c}while(s<f)}return s}function o(u,l,s=0,f=u.length){const c=i(u,l,s,f-1);return c>s&&r(u[c-1],l)>-r(u[c],l)?c-1:c}return{left:i,center:o,right:a}}function Ei(){return 0}function Li(t){return t===null?NaN:+t}const $n=_n(Yt).right;_n(Li).center;class Dn extends Map{constructor(e,n=Ni){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(An(this,e))}has(e){return super.has(An(this,e))}set(e,n){return super.set(Ti(this,e),n)}delete(e){return super.delete(Oi(this,e))}}function An({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Ti({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function Oi({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function Ni(t){return t!==null&&typeof t=="object"?t.valueOf():t}const ki=Math.sqrt(50),Ii=Math.sqrt(10),Ri=Math.sqrt(2);function Bt(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=ki?10:a>=Ii?5:a>=Ri?2:1;let u,l,s;return i<0?(s=Math.pow(10,-i)/o,u=Math.round(t*s),l=Math.round(e*s),u/s<t&&++u,l/s>e&&--l,s=-s):(s=Math.pow(10,i)*o,u=Math.round(t/s),l=Math.round(e/s),u*s<t&&++u,l*s>e&&--l),l<u&&.5<=n&&n<2?Bt(t,e,n*2):[u,l,s]}function Gi(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?Bt(e,t,n):Bt(t,e,n);if(!(a>=i))return[];const u=a-i+1,l=new Array(u);if(r)if(o<0)for(let s=0;s<u;++s)l[s]=(a-s)/-o;else for(let s=0;s<u;++s)l[s]=(a-s)*o;else if(o<0)for(let s=0;s<u;++s)l[s]=(i+s)/-o;else for(let s=0;s<u;++s)l[s]=(i+s)*o;return l}function De(t,e,n){return e=+e,t=+t,n=+n,Bt(t,e,n)[2]}function Vi(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?De(e,t,n):De(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function zi(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 Ui={value:()=>{}};function Sn(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Wt(n)}function Wt(t){this._=t}function Hi(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Wt.prototype=Sn.prototype={constructor:Wt,on:function(t,e){var n=this._,r=Hi(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=Xi(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Mn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Mn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Wt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function Xi(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Mn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Ui,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ae="http://www.w3.org/1999/xhtml";const Cn={svg:"http://www.w3.org/2000/svg",xhtml:Ae,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function jt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Cn.hasOwnProperty(e)?{space:Cn[e],local:t}:t}function qi(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ae&&e.documentElement.namespaceURI===Ae?e.createElement(t):e.createElementNS(n,t)}}function Yi(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Pn(t){var e=jt(t);return(e.local?Yi:qi)(e)}function Bi(){}function Se(t){return t==null?Bi:function(){return this.querySelector(t)}}function Wi(t){typeof t!="function"&&(t=Se(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=new Array(o),l,s,f=0;f<o;++f)(l=a[f])&&(s=t.call(l,l.__data__,f,a))&&("__data__"in l&&(s.__data__=l.__data__),u[f]=s);return new z(r,this._parents)}function ji(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ji(){return[]}function Fn(t){return t==null?Ji:function(){return this.querySelectorAll(t)}}function Ki(t){return function(){return ji(t.apply(this,arguments))}}function Zi(t){typeof t=="function"?t=Ki(t):t=Fn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&(r.push(t.call(l,l.__data__,s,o)),i.push(l));return new z(r,i)}function En(t){return function(){return this.matches(t)}}function Ln(t){return function(e){return e.matches(t)}}var Qi=Array.prototype.find;function ta(t){return function(){return Qi.call(this.children,t)}}function ea(){return this.firstElementChild}function na(t){return this.select(t==null?ea:ta(typeof t=="function"?t:Ln(t)))}var ra=Array.prototype.filter;function ia(){return Array.from(this.children)}function aa(t){return function(){return ra.call(this.children,t)}}function oa(t){return this.selectAll(t==null?ia:aa(typeof t=="function"?t:Ln(t)))}function ua(t){typeof t!="function"&&(t=En(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new z(r,this._parents)}function Tn(t){return new Array(t.length)}function sa(){return new z(this._enter||this._groups.map(Tn),this._parents)}function Jt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Jt.prototype={constructor:Jt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function la(t){return function(){return t}}function ca(t,e,n,r,i,a){for(var o=0,u,l=e.length,s=a.length;o<s;++o)(u=e[o])?(u.__data__=a[o],r[o]=u):n[o]=new Jt(t,a[o]);for(;o<l;++o)(u=e[o])&&(i[o]=u)}function fa(t,e,n,r,i,a,o){var u,l,s=new Map,f=e.length,c=a.length,h=new Array(f),d;for(u=0;u<f;++u)(l=e[u])&&(h[u]=d=o.call(l,l.__data__,u,e)+"",s.has(d)?i[u]=l:s.set(d,l));for(u=0;u<c;++u)d=o.call(t,a[u],u,a)+"",(l=s.get(d))?(r[u]=l,l.__data__=a[u],s.delete(d)):n[u]=new Jt(t,a[u]);for(u=0;u<f;++u)(l=e[u])&&s.get(h[u])===l&&(i[u]=l)}function ha(t){return t.__data__}function da(t,e){if(!arguments.length)return Array.from(this,ha);var n=e?fa:ca,r=this._parents,i=this._groups;typeof t!="function"&&(t=la(t));for(var a=i.length,o=new Array(a),u=new Array(a),l=new Array(a),s=0;s<a;++s){var f=r[s],c=i[s],h=c.length,d=pa(t.call(f,f&&f.__data__,s,r)),p=d.length,m=u[s]=new Array(p),b=o[s]=new Array(p),x=l[s]=new Array(h);n(f,c,m,b,x,d,e);for(var $=0,D=0,A,S;$<p;++$)if(A=m[$]){for($>=D&&(D=$+1);!(S=b[D])&&++D<p;);A._next=S||null}}return o=new z(o,r),o._enter=u,o._exit=l,o}function pa(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function ma(){return new z(this._exit||this._groups.map(Tn),this._parents)}function ga(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function ya(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),u=new Array(i),l=0;l<o;++l)for(var s=n[l],f=r[l],c=s.length,h=u[l]=new Array(c),d,p=0;p<c;++p)(d=s[p]||f[p])&&(h[p]=d);for(;l<i;++l)u[l]=n[l];return new z(u,this._parents)}function va(){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 ba(t){t||(t=wa);function e(c,h){return c&&h?t(c.__data__,h.__data__):!c-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],u=o.length,l=i[a]=new Array(u),s,f=0;f<u;++f)(s=o[f])&&(l[f]=s);l.sort(e)}return new z(i,this._parents).order()}function wa(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function xa(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function _a(){return Array.from(this)}function $a(){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 Da(){let t=0;for(const e of this)++t;return t}function Aa(){return!this.node()}function Sa(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,u;a<o;++a)(u=i[a])&&t.call(u,u.__data__,a,i);return this}function Ma(t){return function(){this.removeAttribute(t)}}function Ca(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Pa(t,e){return function(){this.setAttribute(t,e)}}function Fa(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ea(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function La(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 Ta(t,e){var n=jt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?Ca:Ma:typeof e=="function"?n.local?La:Ea:n.local?Fa:Pa)(n,e))}function On(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Oa(t){return function(){this.style.removeProperty(t)}}function Na(t,e,n){return function(){this.style.setProperty(t,e,n)}}function ka(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function Ia(t,e,n){return arguments.length>1?this.each((e==null?Oa:typeof e=="function"?ka:Na)(t,e,n??"")):vt(this.node(),t)}function vt(t,e){return t.style.getPropertyValue(e)||On(t).getComputedStyle(t,null).getPropertyValue(e)}function Ra(t){return function(){delete this[t]}}function Ga(t,e){return function(){this[t]=e}}function Va(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function za(t,e){return arguments.length>1?this.each((e==null?Ra:typeof e=="function"?Va:Ga)(t,e)):this.node()[t]}function Nn(t){return t.trim().split(/^|\s+/)}function Me(t){return t.classList||new kn(t)}function kn(t){this._node=t,this._names=Nn(t.getAttribute("class")||"")}kn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function In(t,e){for(var n=Me(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function Rn(t,e){for(var n=Me(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function Ua(t){return function(){In(this,t)}}function Ha(t){return function(){Rn(this,t)}}function Xa(t,e){return function(){(e.apply(this,arguments)?In:Rn)(this,t)}}function qa(t,e){var n=Nn(t+"");if(arguments.length<2){for(var r=Me(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?Xa:e?Ua:Ha)(n,e))}function Ya(){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 ja(t){return arguments.length?this.each(t==null?Ya:(typeof t=="function"?Wa:Ba)(t)):this.node().textContent}function Ja(){this.innerHTML=""}function Ka(t){return function(){this.innerHTML=t}}function Za(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Qa(t){return arguments.length?this.each(t==null?Ja:(typeof t=="function"?Za:Ka)(t)):this.node().innerHTML}function to(){this.nextSibling&&this.parentNode.appendChild(this)}function eo(){return this.each(to)}function no(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ro(){return this.each(no)}function io(t){var e=typeof t=="function"?t:Pn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function ao(){return null}function oo(t,e){var n=typeof t=="function"?t:Pn(t),r=e==null?ao:typeof e=="function"?e:Se(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function uo(){var t=this.parentNode;t&&t.removeChild(this)}function so(){return this.each(uo)}function lo(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function co(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function fo(t){return this.select(t?co:lo)}function ho(t){return arguments.length?this.property("__data__",t):this.node().__data__}function po(t){return function(e){t.call(this,e,this.__data__)}}function mo(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function go(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function yo(t,e,n){return function(){var r=this.__on,i,a=po(e);if(r){for(var o=0,u=r.length;o<u;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function vo(t,e,n){var r=mo(t+""),i,a=r.length,o;if(arguments.length<2){var u=this.node().__on;if(u){for(var l=0,s=u.length,f;l<s;++l)for(i=0,f=u[l];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(u=e?yo:go,i=0;i<a;++i)this.each(u(r[i],e,n));return this}function Gn(t,e,n){var r=On(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 bo(t,e){return function(){return Gn(this,t,e)}}function wo(t,e){return function(){return Gn(this,t,e.apply(this,arguments))}}function xo(t,e){return this.each((typeof e=="function"?wo:bo)(t,e))}function*_o(){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 Vn=[null];function z(t,e){this._groups=t,this._parents=e}function Ft(){return new z([[document.documentElement]],Vn)}function $o(){return this}z.prototype=Ft.prototype={constructor:z,select:Wi,selectAll:Zi,selectChild:na,selectChildren:oa,filter:ua,data:da,enter:sa,exit:ma,join:ga,merge:ya,selection:$o,order:va,sort:ba,call:xa,nodes:_a,node:$a,size:Da,empty:Aa,each:Sa,attr:Ta,style:Ia,property:za,classed:qa,text:ja,html:Qa,raise:eo,lower:ro,append:io,insert:oo,remove:so,clone:fo,datum:ho,on:vo,dispatch:xo,[Symbol.iterator]:_o};function Kt(t){return typeof t=="string"?new z([[document.querySelector(t)]],[document.documentElement]):new z([[t]],Vn)}function Ce(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Et(){}var Lt=.7,Zt=1/Lt,bt="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",W="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Do=/^#([0-9a-f]{3,8})$/,Ao=new RegExp(`^rgb\\(${bt},${bt},${bt}\\)$`),So=new RegExp(`^rgb\\(${W},${W},${W}\\)$`),Mo=new RegExp(`^rgba\\(${bt},${bt},${bt},${Tt}\\)$`),Co=new RegExp(`^rgba\\(${W},${W},${W},${Tt}\\)$`),Po=new RegExp(`^hsl\\(${Tt},${W},${W}\\)$`),Fo=new RegExp(`^hsla\\(${Tt},${W},${W},${Tt}\\)$`),Un={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ce(Et,ct,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Hn,formatHex:Hn,formatHex8:Eo,formatHsl:Lo,formatRgb:Xn,toString:Xn});function Hn(){return this.rgb().formatHex()}function Eo(){return this.rgb().formatHex8()}function Lo(){return jn(this).formatHsl()}function Xn(){return this.rgb().formatRgb()}function ct(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Do.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?qn(e):n===3?new V(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Qt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Qt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ao.exec(t))?new V(e[1],e[2],e[3],1):(e=So.exec(t))?new V(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Mo.exec(t))?Qt(e[1],e[2],e[3],e[4]):(e=Co.exec(t))?Qt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Po.exec(t))?Wn(e[1],e[2]/100,e[3]/100,1):(e=Fo.exec(t))?Wn(e[1],e[2]/100,e[3]/100,e[4]):Un.hasOwnProperty(t)?qn(Un[t]):t==="transparent"?new V(NaN,NaN,NaN,0):null}function qn(t){return new V(t>>16&255,t>>8&255,t&255,1)}function Qt(t,e,n,r){return r<=0&&(t=e=n=NaN),new V(t,e,n,r)}function To(t){return t instanceof Et||(t=ct(t)),t?(t=t.rgb(),new V(t.r,t.g,t.b,t.opacity)):new V}function Pe(t,e,n,r){return arguments.length===1?To(t):new V(t,e,n,r??1)}function V(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}Ce(V,Pe,zn(Et,{brighter(t){return t=t==null?Zt:Math.pow(Zt,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Lt:Math.pow(Lt,t),new V(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new V(ft(this.r),ft(this.g),ft(this.b),te(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Yn,formatHex:Yn,formatHex8:Oo,formatRgb:Bn,toString:Bn}));function Yn(){return`#${ht(this.r)}${ht(this.g)}${ht(this.b)}`}function Oo(){return`#${ht(this.r)}${ht(this.g)}${ht(this.b)}${ht((isNaN(this.opacity)?1:this.opacity)*255)}`}function Bn(){const t=te(this.opacity);return`${t===1?"rgb(":"rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${t===1?")":`, ${t})`}`}function te(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ft(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ht(t){return t=ft(t),(t<16?"0":"")+t.toString(16)}function Wn(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 jn(t){if(t instanceof q)return new q(t.h,t.s,t.l,t.opacity);if(t instanceof Et||(t=ct(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,u=a-i,l=(a+i)/2;return u?(e===a?o=(n-r)/u+(n<r)*6:n===a?o=(r-e)/u+2:o=(e-n)/u+4,u/=l<.5?a+i:2-a-i,o*=60):u=l>0&&l<1?0:o,new q(o,u,l,t.opacity)}function No(t,e,n,r){return arguments.length===1?jn(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}Ce(q,No,zn(Et,{brighter(t){return t=t==null?Zt:Math.pow(Zt,t),new q(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Lt:Math.pow(Lt,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 V(Fe(t>=240?t-240:t+120,i,r),Fe(t,i,r),Fe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new q(Jn(this.h),ee(this.s),ee(this.l),te(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=te(this.opacity);return`${t===1?"hsl(":"hsla("}${Jn(this.h)}, ${ee(this.s)*100}%, ${ee(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Jn(t){return t=(t||0)%360,t<0?t+360:t}function ee(t){return Math.max(0,Math.min(1,t||0))}function Fe(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 Ee=t=>()=>t;function ko(t,e){return function(n){return t+n*e}}function Io(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 Ro(t){return(t=+t)==1?Kn:function(e,n){return n-e?Io(e,n,t):Ee(isNaN(e)?n:e)}}function Kn(t,e){var n=e-t;return n?ko(t,n):Ee(isNaN(t)?e:t)}const ne=function t(e){var n=Ro(e);function r(i,a){var o=n((i=Pe(i)).r,(a=Pe(a)).r),u=n(i.g,a.g),l=n(i.b,a.b),s=Kn(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=u(f),i.b=l(f),i.opacity=s(f),i+""}}return r.gamma=t,r}(1);function Go(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 Vo(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zo(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=Oe(t[o],e[o]);for(;o<n;++o)a[o]=e[o];return function(u){for(o=0;o<r;++o)a[o]=i[o](u);return a}}function Uo(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 Ho(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Oe(t[i],e[i]):r[i]=e[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var Le=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Te=new RegExp(Le.source,"g");function Xo(t){return function(){return t}}function qo(t){return function(e){return t(e)+""}}function Zn(t,e){var n=Le.lastIndex=Te.lastIndex=0,r,i,a,o=-1,u=[],l=[];for(t=t+"",e=e+"";(r=Le.exec(t))&&(i=Te.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),u[o]?u[o]+=a:u[++o]=a),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,l.push({i:o,x:Y(r,i)})),n=Te.lastIndex;return n<e.length&&(a=e.slice(n),u[o]?u[o]+=a:u[++o]=a),u.length<2?l[0]?qo(l[0].x):Xo(e):(e=l.length,function(s){for(var f=0,c;f<e;++f)u[(c=l[f]).i]=c.x(s);return u.join("")})}function Oe(t,e){var n=typeof e,r;return e==null||n==="boolean"?Ee(e):(n==="number"?Y:n==="string"?(r=ct(e))?(e=r,ne):Zn:e instanceof ct?ne:e instanceof Date?Uo:Vo(e)?Go:Array.isArray(e)?zo:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Ho:Y)(t,e)}function Yo(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var Qn=180/Math.PI,Ne={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function tr(t,e,n,r,i,a){var o,u,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,l/=u),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Qn,skewX:Math.atan(l)*Qn,scaleX:o,scaleY:u}}var re;function Bo(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Ne:tr(e.a,e.b,e.c,e.d,e.e,e.f)}function Wo(t){return t==null||(re||(re=document.createElementNS("http://www.w3.org/2000/svg","g")),re.setAttribute("transform",t),!(t=re.transform.baseVal.consolidate()))?Ne:(t=t.matrix,tr(t.a,t.b,t.c,t.d,t.e,t.f))}function er(t,e,n,r){function i(s){return s.length?s.pop()+" ":""}function a(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push("translate(",null,e,null,n);p.push({i:m-4,x:Y(s,c)},{i:m-2,x:Y(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(s,f,c,h){s!==f?(s-f>180?f+=360:f-s>180&&(s+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Y(s,f)})):f&&c.push(i(c)+"rotate("+f+r)}function u(s,f,c,h){s!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Y(s,f)}):f&&c.push(i(c)+"skewX("+f+r)}function l(s,f,c,h,d,p){if(s!==c||f!==h){var m=d.push(i(d)+"scale(",null,",",null,")");p.push({i:m-4,x:Y(s,c)},{i:m-2,x:Y(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(s,f){var c=[],h=[];return s=t(s),f=t(f),a(s.translateX,s.translateY,f.translateX,f.translateY,c,h),o(s.rotate,f.rotate,c,h),u(s.skewX,f.skewX,c,h),l(s.scaleX,s.scaleY,f.scaleX,f.scaleY,c,h),s=f=null,function(d){for(var p=-1,m=h.length,b;++p<m;)c[(b=h[p]).i]=b.x(d);return c.join("")}}}var jo=er(Bo,"px, ","px)","deg)"),Jo=er(Wo,", ",")",")"),wt=0,Ot=0,Nt=0,nr=1e3,ie,kt,ae=0,dt=0,oe=0,It=typeof performance=="object"&&performance.now?performance:Date,rr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ke(){return dt||(rr(Ko),dt=It.now()+oe)}function Ko(){dt=0}function ue(){this._call=this._time=this._next=null}ue.prototype=ir.prototype={constructor:ue,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ke():+n)+(e==null?0:+e),!this._next&&kt!==this&&(kt?kt._next=this:ie=this,kt=this),this._call=t,this._time=n,Ie()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ie())}};function ir(t,e,n){var r=new ue;return r.restart(t,e,n),r}function Zo(){ke(),++wt;for(var t=ie,e;t;)(e=dt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--wt}function ar(){dt=(ae=It.now())+oe,wt=Ot=0;try{Zo()}finally{wt=0,tu(),dt=0}}function Qo(){var t=It.now(),e=t-ae;e>nr&&(oe-=e,ae=t)}function tu(){for(var t,e=ie,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:ie=n);kt=t,Ie(r)}function Ie(t){if(!wt){Ot&&(Ot=clearTimeout(Ot));var e=t-dt;e>24?(t<1/0&&(Ot=setTimeout(ar,t-It.now()-oe)),Nt&&(Nt=clearInterval(Nt))):(Nt||(ae=It.now(),Nt=setInterval(Qo,nr)),wt=1,rr(ar))}}function or(t,e,n){var r=new ue;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var eu=Sn("start","end","cancel","interrupt"),nu=[],ur=0,sr=1,Re=2,se=3,lr=4,Ge=5,le=6;function ce(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;ru(t,n,{name:e,index:r,group:i,on:eu,tween:nu,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:ur})}function Ve(t,e){var n=B(t,e);if(n.state>ur)throw new Error("too late; already scheduled");return n}function j(t,e){var n=B(t,e);if(n.state>se)throw new Error("too late; already running");return n}function B(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function ru(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=ir(a,0,n.time);function a(s){n.state=sr,n.timer.restart(o,n.delay,n.time),n.delay<=s&&o(s-n.delay)}function o(s){var f,c,h,d;if(n.state!==sr)return l();for(f in r)if(d=r[f],d.name===n.name){if(d.state===se)return or(o);d.state===lr?(d.state=le,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=le,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(or(function(){n.state===se&&(n.state=lr,n.timer.restart(u,n.delay,n.time),u(s))}),n.state=Re,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Re){for(n.state=se,i=new Array(h=n.tween.length),f=0,c=-1;f<h;++f)(d=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(i[++c]=d);i.length=c+1}}function u(s){for(var f=s<n.duration?n.ease.call(null,s/n.duration):(n.timer.restart(l),n.state=Ge,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===Ge&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=le,n.timer.stop(),delete r[e];for(var s in r)return;delete t.__transition}}function iu(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Re&&r.state<Ge,r.state=le,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function au(t){return this.each(function(){iu(this,t)})}function ou(t,e){var n,r;return function(){var i=j(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,u=r.length;o<u;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function uu(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=j(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var u={name:e,value:n},l=0,s=i.length;l<s;++l)if(i[l].name===e){i[l]=u;break}l===s&&i.push(u)}a.tween=i}}function su(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=B(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?ou:uu)(n,t,e))}function ze(t,e,n){var r=t._id;return t.each(function(){var i=j(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return B(i,r).value[e]}}function cr(t,e){var n;return(typeof e=="number"?Y:e instanceof ct?ne:(n=ct(e))?(e=n,ne):Zn)(t,e)}function lu(t){return function(){this.removeAttribute(t)}}function cu(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fu(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 hu(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 du(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function pu(t,e,n){var r,i,a;return function(){var o,u=n(this),l;return u==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=u+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u)))}}function mu(t,e){var n=jt(t),r=n==="transform"?Jo:cr;return this.attrTween(t,typeof e=="function"?(n.local?pu:du)(n,r,ze(this,"attr."+t,e)):e==null?(n.local?cu:lu)(n):(n.local?hu:fu)(n,r,e))}function gu(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function yu(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function vu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&yu(t,a)),n}return i._value=e,i}function bu(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&gu(t,a)),n}return i._value=e,i}function wu(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=jt(t);return this.tween(n,(r.local?vu:bu)(r,e))}function xu(t,e){return function(){Ve(this,t).delay=+e.apply(this,arguments)}}function _u(t,e){return e=+e,function(){Ve(this,t).delay=e}}function $u(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?xu:_u)(e,t)):B(this.node(),e).delay}function Du(t,e){return function(){j(this,t).duration=+e.apply(this,arguments)}}function Au(t,e){return e=+e,function(){j(this,t).duration=e}}function Su(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Du:Au)(e,t)):B(this.node(),e).duration}function Mu(t,e){if(typeof e!="function")throw new Error;return function(){j(this,t).ease=e}}function Cu(t){var e=this._id;return arguments.length?this.each(Mu(e,t)):B(this.node(),e).ease}function Pu(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;j(this,t).ease=n}}function Fu(t){if(typeof t!="function")throw new Error;return this.each(Pu(this._id,t))}function Eu(t){typeof t!="function"&&(t=En(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,u=r[i]=[],l,s=0;s<o;++s)(l=a[s])&&t.call(l,l.__data__,s,a)&&u.push(l);return new et(r,this._parents,this._name,this._id)}function Lu(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),u=0;u<a;++u)for(var l=e[u],s=n[u],f=l.length,c=o[u]=new Array(f),h,d=0;d<f;++d)(h=l[d]||s[d])&&(c[d]=h);for(;u<r;++u)o[u]=e[u];return new et(o,this._parents,this._name,this._id)}function Tu(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,a=Tu(e)?Ve:j;return function(){var o=a(this,t),u=o.on;u!==r&&(i=(r=u).copy()).on(e,n),o.on=i}}function Nu(t,e){var n=this._id;return arguments.length<2?B(this.node(),n).on.on(t):this.each(Ou(n,t,e))}function ku(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function Iu(){return this.on("end.remove",ku(this._id))}function Ru(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Se(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var u=r[o],l=u.length,s=a[o]=new Array(l),f,c,h=0;h<l;++h)(f=u[h])&&(c=t.call(f,f.__data__,h,u))&&("__data__"in f&&(c.__data__=f.__data__),s[h]=c,ce(s[h],e,n,h,s,B(f,n)));return new et(a,this._parents,e,n)}function Gu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Fn(t));for(var r=this._groups,i=r.length,a=[],o=[],u=0;u<i;++u)for(var l=r[u],s=l.length,f,c=0;c<s;++c)if(f=l[c]){for(var h=t.call(f,f.__data__,c,l),d,p=B(f,n),m=0,b=h.length;m<b;++m)(d=h[m])&&ce(d,e,n,m,h,p);a.push(h),o.push(f)}return new et(a,o,e,n)}var Vu=Ft.prototype.constructor;function zu(){return new Vu(this._groups,this._parents)}function Uu(t,e){var n,r,i;return function(){var a=vt(this,t),o=(this.style.removeProperty(t),vt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function fr(t){return function(){this.style.removeProperty(t)}}function Hu(t,e,n){var r,i=n+"",a;return function(){var o=vt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Xu(t,e,n){var r,i,a;return function(){var o=vt(this,t),u=n(this),l=u+"";return u==null&&(l=u=(this.style.removeProperty(t),vt(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,u))}}function qu(t,e){var n,r,i,a="style."+e,o="end."+a,u;return function(){var l=j(this,t),s=l.on,f=l.value[a]==null?u||(u=fr(e)):void 0;(s!==n||i!==f)&&(r=(n=s).copy()).on(o,i=f),l.on=r}}function Yu(t,e,n){var r=(t+="")=="transform"?jo:cr;return e==null?this.styleTween(t,Uu(t,r)).on("end.style."+t,fr(t)):typeof e=="function"?this.styleTween(t,Xu(t,r,ze(this,"style."+t,e))).each(qu(this._id,t)):this.styleTween(t,Hu(t,r,e),n).on("end.style."+t,null)}function Bu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Wu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Bu(t,o,n)),r}return a._value=e,a}function ju(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,Wu(t,e,n??""))}function Ju(t){return function(){this.textContent=t}}function Ku(t){return function(){var e=t(this);this.textContent=e??""}}function Zu(t){return this.tween("text",typeof t=="function"?Ku(ze(this,"text",t)):Ju(t==null?"":t+""))}function Qu(t){return function(e){this.textContent=t.call(this,e)}}function ts(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Qu(i)),e}return r._value=t,r}function es(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,ts(t))}function ns(){for(var t=this._name,e=this._id,n=hr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)if(l=o[s]){var f=B(l,e);ce(l,t,n,s,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new et(r,this._parents,t,n)}function rs(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var u={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var s=j(this,r),f=s.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(l)),s.on=e}),i===0&&a()})}var is=0;function et(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function hr(){return++is}var nt=Ft.prototype;et.prototype={constructor:et,select:Ru,selectAll:Gu,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:Eu,merge:Lu,selection:zu,transition:ns,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:Nu,attr:mu,attrTween:wu,style:Yu,styleTween:ju,text:Zu,textTween:es,remove:Iu,tween:su,delay:$u,duration:Su,ease:Cu,easeVarying:Fu,end:rs,[Symbol.iterator]:nt[Symbol.iterator]};function as(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var os={time:null,delay:0,duration:250,ease:as};function us(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 ss(t){var e,n;t instanceof et?(e=t._id,t=t._name):(e=hr(),(n=os).time=ke(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],u=o.length,l,s=0;s<u;++s)(l=o[s])&&ce(l,t,e,s,o,n||us(l,e));return new et(r,this._parents,t,e)}Ft.prototype.interrupt=au,Ft.prototype.transition=ss;function ls(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function fe(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function xt(t){return t=fe(Math.abs(t)),t?t[1]:NaN}function cs(t,e){return function(n,r){for(var i=n.length,a=[],o=0,u=t[0],l=0;i>0&&u>0&&(l+u+1>r&&(u=Math.max(1,r-l)),a.push(n.substring(i-=u,i+u)),!((l+=u+1)>r));)u=t[o=(o+1)%t.length];return a.reverse().join(e)}}function fs(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var hs=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function he(t){if(!(e=hs.exec(t)))throw new Error("invalid format: "+t);var e;return new Ue({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}he.prototype=Ue.prototype;function Ue(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}Ue.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ds(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 dr;function ps(t,e){var n=fe(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(dr=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+fe(t,Math.max(0,e+a-1))[0]}function pr(t,e){var n=fe(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const mr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:ls,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:ps,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function gr(t){return t}var yr=Array.prototype.map,vr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ms(t){var e=t.grouping===void 0||t.thousands===void 0?gr:cs(yr.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?gr:fs(yr.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",u=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function s(c){c=he(c);var h=c.fill,d=c.align,p=c.sign,m=c.symbol,b=c.zero,x=c.width,$=c.comma,D=c.precision,A=c.trim,S=c.type;S==="n"?($=!0,S="g"):mr[S]||(D===void 0&&(D=12),A=!0,S="g"),(b||h==="0"&&d==="=")&&(b=!0,h="0",d="=");var O=m==="$"?n:m==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",g=m==="$"?r:/[%p]/.test(S)?o:"",M=mr[S],P=/[defgprs%]/.test(S);D=D===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,D)):Math.max(0,Math.min(20,D));function X(v){var G=O,N=g,H,rt,yt;if(S==="c")N=M(v)+N,v="";else{v=+v;var Q=v<0||1/v<0;if(v=isNaN(v)?l:M(Math.abs(v),D),A&&(v=ds(v)),Q&&+v==0&&p!=="+"&&(Q=!1),G=(Q?p==="("?p:u:p==="-"||p==="("?"":p)+G,N=(S==="s"?vr[8+dr/3]:"")+N+(Q&&p==="("?")":""),P){for(H=-1,rt=v.length;++H<rt;)if(yt=v.charCodeAt(H),48>yt||yt>57){N=(yt===46?i+v.slice(H+1):v.slice(H))+N,v=v.slice(0,H);break}}}$&&!b&&(v=e(v,1/0));var _e=G.length+v.length+N.length,it=_e<x?new Array(x-_e+1).join(h):"";switch($&&b&&(v=e(it+v,it.length?x-N.length:1/0),it=""),d){case"<":v=G+v+N+it;break;case"=":v=G+it+v+N;break;case"^":v=it.slice(0,_e=it.length>>1)+G+v+N+it.slice(_e);break;default:v=it+G+v+N;break}return a(v)}return X.toString=function(){return c+""},X}function f(c,h){var d=s((c=he(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(xt(h)/3)))*3,m=Math.pow(10,-p),b=vr[8+p/3];return function(x){return d(m*x)+b}}return{format:s,formatPrefix:f}}var de,He,br;gs({thousands:",",grouping:[3],currency:["$",""]});function gs(t){return de=ms(t),He=de.format,br=de.formatPrefix,de}function ys(t){return Math.max(0,-xt(Math.abs(t)))}function vs(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xt(e)/3)))*3-xt(Math.abs(t)))}function bs(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xt(e)-xt(t))+1}function pe(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const wr=Symbol("implicit");function xr(){var t=new Dn,e=[],n=[],r=wr;function i(a){let o=t.get(a);if(o===void 0){if(r!==wr)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 Dn;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 xr(e,n).unknown(r)},pe.apply(i,arguments),i}function _r(){var t=xr().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,u=!1,l=0,s=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,m=d?r:i;a=(m-p)/Math.max(1,h-l+s*2),u&&(a=Math.floor(a)),p+=(m-p-a*(h-l))*f,o=a*(1-l),u&&(p=Math.round(p),o=Math.round(o));var b=zi(h).map(function(x){return p+a*x});return n(d?b.reverse():b)}return t.domain=function(h){return arguments.length?(e(h),c()):e()},t.range=function(h){return arguments.length?([r,i]=h,r=+r,i=+i,c()):[r,i]},t.rangeRound=function(h){return[r,i]=h,r=+r,i=+i,u=!0,c()},t.bandwidth=function(){return o},t.step=function(){return a},t.round=function(h){return arguments.length?(u=!!h,c()):u},t.padding=function(h){return arguments.length?(l=Math.min(1,s=+h),c()):l},t.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),c()):l},t.paddingOuter=function(h){return arguments.length?(s=+h,c()):s},t.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),c()):f},t.copy=function(){return _r(e(),[r,i]).round(u).paddingInner(l).paddingOuter(s).align(f)},pe.apply(c(),arguments)}function $r(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return $r(e())},t}function ws(){return $r(_r.apply(null,arguments).paddingInner(1))}function xs(t){return function(){return t}}function _s(t){return+t}var Dr=[0,1];function _t(t){return t}function Xe(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:xs(isNaN(e)?NaN:.5)}function $s(t,e){var n;return t>e&&(n=t,t=e,e=n),function(r){return Math.max(t,Math.min(e,r))}}function Ds(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=Xe(i,r),a=n(o,a)):(r=Xe(r,i),a=n(a,o)),function(u){return a(r(u))}}function As(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=Xe(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(u){var l=$n(t,u,1,r)-1;return a[l](i[l](u))}}function Ss(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ms(){var t=Dr,e=Dr,n=Oe,r,i,a,o=_t,u,l,s;function f(){var h=Math.min(t.length,e.length);return o!==_t&&(o=$s(t[0],t[h-1])),u=h>2?As:Ds,l=s=null,c}function c(h){return h==null||isNaN(h=+h)?a:(l||(l=u(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((s||(s=u(e,t.map(r),Y)))(h)))},c.domain=function(h){return arguments.length?(t=Array.from(h,_s),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=Yo,f()},c.clamp=function(h){return arguments.length?(o=h?!0:_t,f()):o!==_t},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function Cs(){return Ms()(_t,_t)}function Ps(t,e,n,r){var i=Vi(t,e,n),a;switch(r=he(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return r.precision==null&&!isNaN(a=vs(i,o))&&(r.precision=a),br(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=bs(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=ys(i))&&(r.precision=a-(r.type==="%")*2);break}}return He(r)}function Ar(t){var e=t.domain;return t.ticks=function(n){var r=e();return Gi(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Ps(i[0],i[i.length-1],n??10,r)},t.nice=function(n){n==null&&(n=10);var r=e(),i=0,a=r.length-1,o=r[i],u=r[a],l,s,f=10;for(u<o&&(s=o,o=u,u=s,s=i,i=a,a=s);f-- >0;){if(s=De(o,u,n),s===l)return r[i]=o,r[a]=u,e(r);if(s>0)o=Math.floor(o/s)*s,u=Math.ceil(u/s)*s;else if(s<0)o=Math.ceil(o*s)/s,u=Math.floor(u*s)/s;else break;l=s}return t},t}function Sr(){var t=Cs();return t.copy=function(){return Ss(t,Sr())},pe.apply(t,arguments),Ar(t)}function Mr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[$n(r,l,0,n)]:a}function u(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,u()):[t,e]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,u()):i.slice()},o.invertExtent=function(l){var s=i.indexOf(l);return s<0?[NaN,NaN]:s<1?[t,r[0]]:s>=n?[r[n-1],e]:[r[s-1],r[s]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Mr().domain([t,e]).range(i).unknown(a)},pe.apply(Ar(o),arguments)}function Rt(t,e,n){this.k=t,this.x=e,this.y=n}Rt.prototype={constructor:Rt,scale:function(t){return t===1?this:new Rt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Rt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Rt.prototype;function J(t){return Object.prototype.toString.call(t)==="[object Object]"}function Fs(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function at(t,e){if(J(t)===!1||J(e)===!1)return Object.assign({},e);const n=(r,i)=>{const a=Object.assign({},i);for(let o of Object.keys(r)){if(!(o in i))continue;let u;J(r[o])&&J(i[o])?(u=n(r[o],i[o]),a[o]=u):a[o]=r[o]}return a};return n(t,e)}function Es(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 Ls(t,e){return e instanceof Function?e(t):He(e)(t)}function Gt(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function me(t,e){return`${t}_series${e}`}function qe(t,e){return`${t}_group${e}`}function Ye({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){const r=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((i,a)=>r[a]!=null?r[a]:me(n,a))}function Cr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){const i=e.seriesDirection==="row"?e.rowLabels:e.columnLabels;return t.map((a,o)=>i[o]!=null?i[o]:me(`${n}_grid${r}`,o))}function Pr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="grid"}){if(t[0]==null)return[];const r=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((i,a)=>r[a]!=null?r[a]:qe(n,a))}function Fr({transposedDataGrid:t,dataFormatterGrid:e,chartType:n="multiGrid",gridIndex:r=0}){if(t[0]==null)return[];const i=e.seriesDirection==="row"?e.columnLabels:e.rowLabels;return t[0].map((a,o)=>i[o]!=null?i[o]:qe(`${n}_grid${r}`,o))}function $t(t){const e=[0,0];return t.length?t.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[t[0],t[0]]):e}function ge(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return $t(e)}function Ts(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||J(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return $t(n)}function Be(t){const n=t.flat().filter(r=>(r==null||J(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return $t(n)}function Os(t){const n=t.flat().flat().filter(r=>(r==null||J(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return $t(n)}function Ns(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||J(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return $t(r)}function Er(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 Vt(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 Lr(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function We(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Lr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=s*c+s*r;return{slotIndex:u,rowIndex:s,columnIndex:l,startX:h,startY:d,centerX:h+f/2,centerY:d+c/2,width:f,height:c}})}function ye(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:Lr(n);return new Array(n).fill(null).map((o,u)=>{const l=u%a,s=Math.floor(u/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=s*c+s*r,p=[h,d],m=[f/t.width,c/t.height];return{slotIndex:u,rowIndex:s,columnIndex:l,translate:p,scale:m}})}const ks=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,u,l,s)=>{const f=Gt(n.type,u,l),c=n.seriesLabels[u]||me("series",u),h=Vt(u,r);return typeof o=="number"?{id:f,index:s,seq:0,label:f,description:"",data:{},value:o,seriesIndex:u,seriesLabel:c,color:h,visible:!0}:{id:o.id?o.id:f,index:s,seq:0,label:o.label?o.label:f,description:o.description,data:o.data??{},value:o.value,seriesIndex:u,seriesLabel:c,color:h,visible:!0}};i=e.map((o,u)=>Array.isArray(o)?o.map((l,s)=>a(l,u,s,i.length+s)):a(o,u,0,i.length)).flat().sort(n.sort??void 0).map((o,u)=>(o.seq=u,o)).map(o=>(o.visible=n.visibleFilter(o,t),o)).sort((o,u)=>o.index-u.index).reduce((o,u)=>(o[u.seriesIndex]||(o[u.seriesIndex]=[]),o[u.seriesIndex].push(u),o),[])}catch(a){throw Error(a)}return i};var je=function(t,e){return je=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},je(t,e)};function K(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");je(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function Is(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function u(f){try{s(r.next(f))}catch(c){o(c)}}function l(f){try{s(r.throw(f))}catch(c){o(c)}}function s(f){f.done?a(f.value):i(f.value).then(u,l)}s((r=r.apply(t,e||[])).next())})}function Tr(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(f){return l([s,f])}}function l(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=e.call(t,n)}catch(f){s=[6,f],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Dt(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 ot(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function ut(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 At(t){return this instanceof At?(this.v=t,this):new At(t)}function Rs(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,c)}}function u(d,p){r[d]&&(i[d]=function(m){return new Promise(function(b,x){a.push([d,m,b,x])>1||l(d,m)})},p&&(i[d]=p(i[d])))}function l(d,p){try{s(r[d](p))}catch(m){h(a[0][3],m)}}function s(d){d.value instanceof At?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){l("next",d)}function c(d){l("throw",d)}function h(d,p){d(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function Gs(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 Dt=="function"?Dt(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(a){n[a]=t[a]&&function(o){return new Promise(function(u,l){o=t[a](o),i(u,l,o.done,o.value)})}}function i(a,o,u,l){Promise.resolve(l).then(function(s){a({value:s,done:u})},o)}}typeof SuppressedError=="function"&&SuppressedError;function L(t){return typeof t=="function"}function Je(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var Ke=Je(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
1
|
+
(function(m,ot){typeof exports=="object"&&typeof module<"u"?ot(exports):typeof define=="function"&&define.amd?define(["exports"],ot):(m=typeof globalThis<"u"?globalThis:m||self,ot(m["orbcharts-core"]={}))})(this,function(m){"use strict";const ot={width:"auto",height:"auto"},Me={top:60,right:60,bottom:60,left:60},Fe={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,Vn=500,Yi=[],Wi=[],ji=[],Ji=[],Ki=[],Zi={nodes:[],edges:[]},j={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Bn={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},Zt={gap:120,rowAmount:1,columnAmount:1},Le={type:"series",visibleFilter:(t,e)=>!0,sort:null,seriesLabels:[],container:{...Zt},separateSeries:!1,sumSeries:!1};Le.visibleFilter.toString=()=>"(datum, context) => true";const Oe={seriesDirection:"row",rowLabels:[],columnLabels:[],valueAxis:{...j},groupAxis:{...Bn},separateSeries:!1},Pe={type:"grid",visibleFilter:(t,e)=>!0,grid:{...Oe},container:{...Zt}};Pe.visibleFilter.toString=()=>"(datum, context) => true";const Pt={...Oe},Re={type:"multiGrid",visibleFilter:(t,e)=>!0,gridList:[{...Pt}],separateGrid:!1,container:{...Zt}};Re.visibleFilter.toString=()=>"(datum, context) => true";const Ne={type:"multiValue",visibleFilter:(t,e)=>!0,categoryLabels:[],multiValue:[],xAxis:{...j},yAxis:{...j}};Ne.visibleFilter.toString=()=>"(datum, context) => true";const Ie={type:"tree",visibleFilter:(t,e)=>!0,categoryLabels:[]};Ie.visibleFilter.toString=()=>"(datum, context) => true";const ke={type:"relationship",visibleFilter:(t,e)=>!0,categoryLabels:[]};ke.visibleFilter.toString=()=>"(datum, context) => true";const Qi=t=>({status:"success",message:""});function Qt(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ta(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Un(t){let e,n,r;t.length!==2?(e=Qt,n=(s,l)=>Qt(t(s),l),r=(s,l)=>t(s)-l):(e=t===Qt||t===ta?t:ea,n=t,r=t);function i(s,l,u=0,f=s.length){if(u<f){if(e(l,l)!==0)return f;do{const c=u+f>>>1;n(s[c],l)<0?u=c+1:f=c}while(u<f)}return u}function a(s,l,u=0,f=s.length){if(u<f){if(e(l,l)!==0)return f;do{const c=u+f>>>1;n(s[c],l)<=0?u=c+1:f=c}while(u<f)}return u}function o(s,l,u=0,f=s.length){const c=i(s,l,u,f-1);return c>u&&r(s[c-1],l)>-r(s[c],l)?c-1:c}return{left:i,center:o,right:a}}function ea(){return 0}function na(t){return t===null?NaN:+t}const zn=Un(Qt).right;Un(na).center;class Hn extends Map{constructor(e,n=aa){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),e!=null)for(const[r,i]of e)this.set(r,i)}get(e){return super.get(Xn(this,e))}has(e){return super.has(Xn(this,e))}set(e,n){return super.set(ra(this,e),n)}delete(e){return super.delete(ia(this,e))}}function Xn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function ra({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}function ia({_intern:t,_key:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}function aa(t){return t!==null&&typeof t=="object"?t.valueOf():t}const oa=Math.sqrt(50),sa=Math.sqrt(10),ua=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>=oa?10:a>=sa?5:a>=ua?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(t*u),l=Math.round(e*u),s/u<t&&++s,l/u>e&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(t/u),l=Math.round(e/u),s*u<t&&++s,l*u>e&&--l),l<s&&.5<=n&&n<2?te(t,e,n*2):[s,l,u]}function la(t,e,n){if(e=+e,t=+t,n=+n,!(n>0))return[];if(t===e)return[t];const r=e<t,[i,a,o]=r?te(e,t,n):te(t,e,n);if(!(a>=i))return[];const s=a-i+1,l=new Array(s);if(r)if(o<0)for(let u=0;u<s;++u)l[u]=(a-u)/-o;else for(let u=0;u<s;++u)l[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)l[u]=(i+u)/-o;else for(let u=0;u<s;++u)l[u]=(i+u)*o;return l}function Ge(t,e,n){return e=+e,t=+t,n=+n,te(t,e,n)[2]}function ca(t,e,n){e=+e,t=+t,n=+n;const r=e<t,i=r?Ge(e,t,n):Ge(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}function fa(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((e-t)/n))|0,a=new Array(i);++r<i;)a[r]=t+r*n;return a}var ha={value:()=>{}};function qn(){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 da(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=qn.prototype={constructor:ee,on:function(t,e){var n=this._,r=da(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=pa(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=Yn(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Yn(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new 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 pa(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Yn(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ha,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Ve="http://www.w3.org/1999/xhtml";const Wn={svg:"http://www.w3.org/2000/svg",xhtml:Ve,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)),Wn.hasOwnProperty(e)?{space:Wn[e],local:t}:t}function ma(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Ve&&e.documentElement.namespaceURI===Ve?e.createElement(t):e.createElementNS(n,t)}}function ga(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jn(t){var e=ne(t);return(e.local?ga:ma)(e)}function ya(){}function Be(t){return t==null?ya:function(){return this.querySelector(t)}}function va(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),l,u,f=0;f<o;++f)(l=a[f])&&(u=t.call(l,l.__data__,f,a))&&("__data__"in l&&(u.__data__=l.__data__),s[f]=u);return new z(r,this._parents)}function ba(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function wa(){return[]}function Jn(t){return t==null?wa:function(){return this.querySelectorAll(t)}}function _a(t){return function(){return ba(t.apply(this,arguments))}}function xa(t){typeof t=="function"?t=_a(t):t=Jn(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&(r.push(t.call(l,l.__data__,u,o)),i.push(l));return new z(r,i)}function Kn(t){return function(){return this.matches(t)}}function Zn(t){return function(e){return e.matches(t)}}var Da=Array.prototype.find;function Aa(t){return function(){return Da.call(this.children,t)}}function $a(){return this.firstElementChild}function Sa(t){return this.select(t==null?$a:Aa(typeof t=="function"?t:Zn(t)))}var Ta=Array.prototype.filter;function Ca(){return Array.from(this.children)}function Ea(t){return function(){return Ta.call(this.children,t)}}function Ma(t){return this.selectAll(t==null?Ca:Ea(typeof t=="function"?t:Zn(t)))}function Fa(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 a=e[i],o=a.length,s=r[i]=[],l,u=0;u<o;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&s.push(l);return new z(r,this._parents)}function Qn(t){return new Array(t.length)}function La(){return new z(this._enter||this._groups.map(Qn),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 Oa(t){return function(){return t}}function Pa(t,e,n,r,i,a){for(var o=0,s,l=e.length,u=a.length;o<u;++o)(s=e[o])?(s.__data__=a[o],r[o]=s):n[o]=new re(t,a[o]);for(;o<l;++o)(s=e[o])&&(i[o]=s)}function Ra(t,e,n,r,i,a,o){var s,l,u=new Map,f=e.length,c=a.length,h=new Array(f),d;for(s=0;s<f;++s)(l=e[s])&&(h[s]=d=o.call(l,l.__data__,s,e)+"",u.has(d)?i[s]=l:u.set(d,l));for(s=0;s<c;++s)d=o.call(t,a[s],s,a)+"",(l=u.get(d))?(r[s]=l,l.__data__=a[s],u.delete(d)):n[s]=new re(t,a[s]);for(s=0;s<f;++s)(l=e[s])&&u.get(h[s])===l&&(i[s]=l)}function Na(t){return t.__data__}function Ia(t,e){if(!arguments.length)return Array.from(this,Na);var n=e?Ra:Pa,r=this._parents,i=this._groups;typeof t!="function"&&(t=Oa(t));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),u=0;u<a;++u){var f=r[u],c=i[u],h=c.length,d=ka(t.call(f,f&&f.__data__,u,r)),p=d.length,g=s[u]=new Array(p),_=o[u]=new Array(p),x=l[u]=new Array(h);n(f,c,g,_,x,d,e);for(var D=0,$=0,S,T;D<p;++D)if(S=g[D]){for(D>=$&&($=D+1);!(T=_[$])&&++$<p;);S._next=T||null}}return o=new z(o,r),o._enter=s,o._exit=l,o}function ka(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ga(){return new z(this._exit||this._groups.map(Qn),this._parents)}function Va(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Ba(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),l=0;l<o;++l)for(var u=n[l],f=r[l],c=u.length,h=s[l]=new Array(c),d,p=0;p<c;++p)(d=u[p]||f[p])&&(h[p]=d);for(;l<i;++l)s[l]=n[l];return new z(s,this._parents)}function Ua(){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 za(t){t||(t=Ha);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,l=i[a]=new Array(s),u,f=0;f<s;++f)(u=o[f])&&(l[f]=u);l.sort(e)}return new z(i,this._parents).order()}function Ha(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Xa(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function qa(){return Array.from(this)}function Ya(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Wa(){let t=0;for(const e of this)++t;return t}function ja(){return!this.node()}function Ja(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&t.call(s,s.__data__,a,i);return this}function Ka(t){return function(){this.removeAttribute(t)}}function Za(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Qa(t,e){return function(){this.setAttribute(t,e)}}function to(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function eo(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function no(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ro(t,e){var n=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?Za:Ka:typeof e=="function"?n.local?no:eo:n.local?to:Qa)(n,e))}function tr(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function io(t){return function(){this.style.removeProperty(t)}}function ao(t,e,n){return function(){this.style.setProperty(t,e,n)}}function oo(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function so(t,e,n){return arguments.length>1?this.each((e==null?io:typeof e=="function"?oo:ao)(t,e,n??"")):_t(this.node(),t)}function _t(t,e){return t.style.getPropertyValue(e)||tr(t).getComputedStyle(t,null).getPropertyValue(e)}function uo(t){return function(){delete this[t]}}function lo(t,e){return function(){this[t]=e}}function co(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function fo(t,e){return arguments.length>1?this.each((e==null?uo:typeof e=="function"?co:lo)(t,e)):this.node()[t]}function er(t){return t.trim().split(/^|\s+/)}function Ue(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=Ue(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function ir(t,e){for(var n=Ue(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function ho(t){return function(){rr(this,t)}}function po(t){return function(){ir(this,t)}}function mo(t,e){return function(){(e.apply(this,arguments)?rr:ir)(this,t)}}function go(t,e){var n=er(t+"");if(arguments.length<2){for(var r=Ue(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?mo:e?ho:po)(n,e))}function yo(){this.textContent=""}function vo(t){return function(){this.textContent=t}}function bo(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function wo(t){return arguments.length?this.each(t==null?yo:(typeof t=="function"?bo:vo)(t)):this.node().textContent}function _o(){this.innerHTML=""}function xo(t){return function(){this.innerHTML=t}}function Do(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ao(t){return arguments.length?this.each(t==null?_o:(typeof t=="function"?Do:xo)(t)):this.node().innerHTML}function $o(){this.nextSibling&&this.parentNode.appendChild(this)}function So(){return this.each($o)}function To(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Co(){return this.each(To)}function Eo(t){var e=typeof t=="function"?t:jn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Mo(){return null}function Fo(t,e){var n=typeof t=="function"?t:jn(t),r=e==null?Mo:typeof e=="function"?e:Be(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Lo(){var t=this.parentNode;t&&t.removeChild(this)}function Oo(){return this.each(Lo)}function Po(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ro(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function No(t){return this.select(t?Ro:Po)}function Io(t){return arguments.length?this.property("__data__",t):this.node().__data__}function ko(t){return function(e){t.call(this,e,this.__data__)}}function Go(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Vo(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Bo(t,e,n){return function(){var r=this.__on,i,a=ko(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 Uo(t,e,n){var r=Go(t+""),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,f;l<u;++l)for(i=0,f=s[l];i<a;++i)if((o=r[i]).type===f.type&&o.name===f.name)return f.value}return}for(s=e?Bo:Vo,i=0;i<a;++i)this.each(s(r[i],e,n));return this}function ar(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 zo(t,e){return function(){return ar(this,t,e)}}function Ho(t,e){return function(){return ar(this,t,e.apply(this,arguments))}}function Xo(t,e){return this.each((typeof e=="function"?Ho:zo)(t,e))}function*qo(){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 or=[null];function z(t,e){this._groups=t,this._parents=e}function Rt(){return new z([[document.documentElement]],or)}function Yo(){return this}z.prototype=Rt.prototype={constructor:z,select:va,selectAll:xa,selectChild:Sa,selectChildren:Ma,filter:Fa,data:Ia,enter:La,exit:Ga,join:Va,merge:Ba,selection:Yo,order:Ua,sort:za,call:Xa,nodes:qa,node:Ya,size:Wa,empty:ja,each:Ja,attr:ro,style:so,property:fo,classed:go,text:wo,html:Ao,raise:So,lower:Co,append:Eo,insert:Fo,remove:Oo,clone:No,datum:Io,on:Uo,dispatch:Xo,[Symbol.iterator]:qo};function ie(t){return typeof t=="string"?new z([[document.querySelector(t)]],[document.documentElement]):new z([[t]],or)}function ze(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,ae=1/It,xt="\\s*([+-]?\\d+)\\s*",kt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",J="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wo=/^#([0-9a-f]{3,8})$/,jo=new RegExp(`^rgb\\(${xt},${xt},${xt}\\)$`),Jo=new RegExp(`^rgb\\(${J},${J},${J}\\)$`),Ko=new RegExp(`^rgba\\(${xt},${xt},${xt},${kt}\\)$`),Zo=new RegExp(`^rgba\\(${J},${J},${J},${kt}\\)$`),Qo=new RegExp(`^hsl\\(${kt},${J},${J}\\)$`),ts=new RegExp(`^hsla\\(${kt},${J},${J},${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};ze(Nt,ft,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:lr,formatHex:lr,formatHex8:es,formatHsl:ns,formatRgb:cr,toString:cr});function lr(){return this.rgb().formatHex()}function es(){return this.rgb().formatHex8()}function ns(){return mr(this).formatHsl()}function cr(){return this.rgb().formatRgb()}function ft(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Wo.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?fr(e):n===3?new U(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=jo.exec(t))?new U(e[1],e[2],e[3],1):(e=Jo.exec(t))?new U(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Ko.exec(t))?oe(e[1],e[2],e[3],e[4]):(e=Zo.exec(t))?oe(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Qo.exec(t))?pr(e[1],e[2]/100,e[3]/100,1):(e=ts.exec(t))?pr(e[1],e[2]/100,e[3]/100,e[4]):ur.hasOwnProperty(t)?fr(ur[t]):t==="transparent"?new U(NaN,NaN,NaN,0):null}function fr(t){return new U(t>>16&255,t>>8&255,t&255,1)}function oe(t,e,n,r){return r<=0&&(t=e=n=NaN),new U(t,e,n,r)}function rs(t){return t instanceof Nt||(t=ft(t)),t?(t=t.rgb(),new U(t.r,t.g,t.b,t.opacity)):new U}function He(t,e,n,r){return arguments.length===1?rs(t):new U(t,e,n,r??1)}function U(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ze(U,He,sr(Nt,{brighter(t){return t=t==null?ae:Math.pow(ae,t),new U(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?It:Math.pow(It,t),new U(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new U(ht(this.r),ht(this.g),ht(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:hr,formatHex:hr,formatHex8:is,formatRgb:dr,toString:dr}));function hr(){return`#${dt(this.r)}${dt(this.g)}${dt(this.b)}`}function is(){return`#${dt(this.r)}${dt(this.g)}${dt(this.b)}${dt((isNaN(this.opacity)?1:this.opacity)*255)}`}function dr(){const t=se(this.opacity);return`${t===1?"rgb(":"rgba("}${ht(this.r)}, ${ht(this.g)}, ${ht(this.b)}${t===1?")":`, ${t})`}`}function se(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),a=Math.max(e,n,r),o=NaN,s=a-i,l=(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/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new q(o,s,l,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}ze(q,as,sr(Nt,{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?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 U(Xe(t>=240?t-240:t+120,i,r),Xe(t,i,r),Xe(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new q(gr(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("}${gr(this.h)}, ${ue(this.s)*100}%, ${ue(this.l)*100}%${t===1?")":`, ${t})`}`}}));function gr(t){return t=(t||0)%360,t<0?t+360:t}function ue(t){return Math.max(0,Math.min(1,t||0))}function Xe(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 qe=t=>()=>t;function os(t,e){return function(n){return t+n*e}}function ss(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 us(t){return(t=+t)==1?yr:function(e,n){return n-e?ss(e,n,t):qe(isNaN(e)?n:e)}}function yr(t,e){var n=e-t;return n?os(t,n):qe(isNaN(t)?e:t)}const le=function t(e){var n=us(e);function r(i,a){var o=n((i=He(i)).r,(a=He(a)).r),s=n(i.g,a.g),l=n(i.b,a.b),u=yr(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return r.gamma=t,r}(1);function ls(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 cs(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function fs(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 hs(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 ds(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 Ye=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,We=new RegExp(Ye.source,"g");function ps(t){return function(){return t}}function ms(t){return function(e){return t(e)+""}}function vr(t,e){var n=Ye.lastIndex=We.lastIndex=0,r,i,a,o=-1,s=[],l=[];for(t=t+"",e=e+"";(r=Ye.exec(t))&&(i=We.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,l.push({i:o,x:Y(r,i)})),n=We.lastIndex;return n<e.length&&(a=e.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?ms(l[0].x):ps(e):(e=l.length,function(u){for(var f=0,c;f<e;++f)s[(c=l[f]).i]=c.x(u);return s.join("")})}function je(t,e){var n=typeof e,r;return e==null||n==="boolean"?qe(e):(n==="number"?Y:n==="string"?(r=ft(e))?(e=r,le):vr:e instanceof ft?le:e instanceof Date?hs:cs(e)?ls:Array.isArray(e)?fs:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?ds:Y)(t,e)}function gs(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}var br=180/Math.PI,Je={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function wr(t,e,n,r,i,a){var o,s,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*br,skewX:Math.atan(l)*br,scaleX:o,scaleY:s}}var ce;function ys(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Je:wr(e.a,e.b,e.c,e.d,e.e,e.f)}function vs(t){return t==null||(ce||(ce=document.createElementNS("http://www.w3.org/2000/svg","g")),ce.setAttribute("transform",t),!(t=ce.transform.baseVal.consolidate()))?Je:(t=t.matrix,wr(t.a,t.b,t.c,t.d,t.e,t.f))}function _r(t,e,n,r){function i(u){return u.length?u.pop()+" ":""}function a(u,f,c,h,d,p){if(u!==c||f!==h){var g=d.push("translate(",null,e,null,n);p.push({i:g-4,x:Y(u,c)},{i:g-2,x:Y(f,h)})}else(c||h)&&d.push("translate("+c+e+h+n)}function o(u,f,c,h){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),h.push({i:c.push(i(c)+"rotate(",null,r)-2,x:Y(u,f)})):f&&c.push(i(c)+"rotate("+f+r)}function s(u,f,c,h){u!==f?h.push({i:c.push(i(c)+"skewX(",null,r)-2,x:Y(u,f)}):f&&c.push(i(c)+"skewX("+f+r)}function l(u,f,c,h,d,p){if(u!==c||f!==h){var g=d.push(i(d)+"scale(",null,",",null,")");p.push({i:g-4,x:Y(u,c)},{i:g-2,x:Y(f,h)})}else(c!==1||h!==1)&&d.push(i(d)+"scale("+c+","+h+")")}return function(u,f){var c=[],h=[];return u=t(u),f=t(f),a(u.translateX,u.translateY,f.translateX,f.translateY,c,h),o(u.rotate,f.rotate,c,h),s(u.skewX,f.skewX,c,h),l(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,h),u=f=null,function(d){for(var p=-1,g=h.length,_;++p<g;)c[(_=h[p]).i]=_.x(d);return c.join("")}}}var bs=_r(ys,"px, ","px)","deg)"),ws=_r(vs,", ",")",")"),Dt=0,Gt=0,Vt=0,xr=1e3,fe,Bt,he=0,pt=0,de=0,Ut=typeof performance=="object"&&performance.now?performance:Date,Dr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Ke(){return pt||(Dr(_s),pt=Ut.now()+de)}function _s(){pt=0}function pe(){this._call=this._time=this._next=null}pe.prototype=Ar.prototype={constructor:pe,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Ke():+n)+(e==null?0:+e),!this._next&&Bt!==this&&(Bt?Bt._next=this:fe=this,Bt=this),this._call=t,this._time=n,Ze()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ze())}};function Ar(t,e,n){var r=new pe;return r.restart(t,e,n),r}function xs(){Ke(),++Dt;for(var t=fe,e;t;)(e=pt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Dt}function $r(){pt=(he=Ut.now())+de,Dt=Gt=0;try{xs()}finally{Dt=0,As(),pt=0}}function Ds(){var t=Ut.now(),e=t-he;e>xr&&(de-=e,he=t)}function As(){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);Bt=t,Ze(r)}function Ze(t){if(!Dt){Gt&&(Gt=clearTimeout(Gt));var e=t-pt;e>24?(t<1/0&&(Gt=setTimeout($r,t-Ut.now()-de)),Vt&&(Vt=clearInterval(Vt))):(Vt||(he=Ut.now(),Vt=setInterval(Ds,xr)),Dt=1,Dr($r))}}function Sr(t,e,n){var r=new pe;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var $s=qn("start","end","cancel","interrupt"),Ss=[],Tr=0,Cr=1,Qe=2,me=3,Er=4,tn=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;Ts(t,n,{name:e,index:r,group:i,on:$s,tween:Ss,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Tr})}function en(t,e){var n=W(t,e);if(n.state>Tr)throw new Error("too late; already scheduled");return n}function K(t,e){var n=W(t,e);if(n.state>me)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 Ts(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ar(a,0,n.time);function a(u){n.state=Cr,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var f,c,h,d;if(n.state!==Cr)return l();for(f in r)if(d=r[f],d.name===n.name){if(d.state===me)return Sr(o);d.state===Er?(d.state=ge,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete r[f]):+f<e&&(d.state=ge,d.timer.stop(),d.on.call("cancel",t,t.__data__,d.index,d.group),delete r[f])}if(Sr(function(){n.state===me&&(n.state=Er,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Qe,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Qe){for(n.state=me,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(u){for(var f=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=tn,1),c=-1,h=i.length;++c<h;)i[c].call(t,f);n.state===tn&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=ge,n.timer.stop(),delete r[e];for(var u in r)return;delete t.__transition}}function Cs(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>Qe&&r.state<tn,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 Es(t){return this.each(function(){Cs(this,t)})}function Ms(t,e){var n,r;return function(){var i=K(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 Fs(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=K(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=s;break}l===u&&i.push(s)}a.tween=i}}function Ls(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=W(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?Ms:Fs)(n,t,e))}function nn(t,e,n){var r=t._id;return t.each(function(){var i=K(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return W(i,r).value[e]}}function Mr(t,e){var n;return(typeof e=="number"?Y:e instanceof ft?le:(n=ft(e))?(e=n,le):vr)(t,e)}function Os(t){return function(){this.removeAttribute(t)}}function Ps(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Rs(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 Ns(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 Is(t,e,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s)))}}function ks(t,e,n){var r,i,a;return function(){var o,s=n(this),l;return s==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=s+"",o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s)))}}function Gs(t,e){var n=ne(t),r=n==="transform"?ws:Mr;return this.attrTween(t,typeof e=="function"?(n.local?ks:Is)(n,r,nn(this,"attr."+t,e)):e==null?(n.local?Ps:Os)(n):(n.local?Ns:Rs)(n,r,e))}function Vs(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Bs(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Us(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Bs(t,a)),n}return i._value=e,i}function zs(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Vs(t,a)),n}return i._value=e,i}function Hs(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?Us:zs)(r,e))}function Xs(t,e){return function(){en(this,t).delay=+e.apply(this,arguments)}}function qs(t,e){return e=+e,function(){en(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(){K(this,t).duration=+e.apply(this,arguments)}}function js(t,e){return e=+e,function(){K(this,t).duration=e}}function Js(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Ws:js)(e,t)):W(this.node(),e).duration}function Ks(t,e){if(typeof e!="function")throw new Error;return function(){K(this,t).ease=e}}function Zs(t){var e=this._id;return arguments.length?this.each(Ks(e,t)):W(this.node(),e).ease}function Qs(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;K(this,t).ease=n}}function tu(t){if(typeof t!="function")throw new Error;return this.each(Qs(this._id,t))}function eu(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 a=e[i],o=a.length,s=r[i]=[],l,u=0;u<o;++u)(l=a[u])&&t.call(l,l.__data__,u,a)&&s.push(l);return new et(r,this._parents,this._name,this._id)}function nu(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 l=e[s],u=n[s],f=l.length,c=o[s]=new Array(f),h,d=0;d<f;++d)(h=l[d]||u[d])&&(c[d]=h);for(;s<r;++s)o[s]=e[s];return new et(o,this._parents,this._name,this._id)}function ru(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 iu(t,e,n){var r,i,a=ru(e)?en:K;return function(){var o=a(this,t),s=o.on;s!==r&&(i=(r=s).copy()).on(e,n),o.on=i}}function au(t,e){var n=this._id;return arguments.length<2?W(this.node(),n).on.on(t):this.each(iu(n,t,e))}function ou(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function su(){return this.on("end.remove",ou(this._id))}function uu(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],l=s.length,u=a[o]=new Array(l),f,c,h=0;h<l;++h)(f=s[h])&&(c=t.call(f,f.__data__,h,s))&&("__data__"in f&&(c.__data__=f.__data__),u[h]=c,ye(u[h],e,n,h,u,W(f,n)));return new et(a,this._parents,e,n)}function lu(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Jn(t));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var l=r[s],u=l.length,f,c=0;c<u;++c)if(f=l[c]){for(var h=t.call(f,f.__data__,c,l),d,p=W(f,n),g=0,_=h.length;g<_;++g)(d=h[g])&&ye(d,e,n,g,h,p);a.push(h),o.push(f)}return new et(a,o,e,n)}var cu=Rt.prototype.constructor;function fu(){return new cu(this._groups,this._parents)}function hu(t,e){var n,r,i;return function(){var a=_t(this,t),o=(this.style.removeProperty(t),_t(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function Fr(t){return function(){this.style.removeProperty(t)}}function du(t,e,n){var r,i=n+"",a;return function(){var o=_t(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function pu(t,e,n){var r,i,a;return function(){var o=_t(this,t),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(t),_t(this,t))),o===l?null:o===r&&l===i?a:(i=l,a=e(r=o,s))}}function mu(t,e){var n,r,i,a="style."+e,o="end."+a,s;return function(){var l=K(this,t),u=l.on,f=l.value[a]==null?s||(s=Fr(e)):void 0;(u!==n||i!==f)&&(r=(n=u).copy()).on(o,i=f),l.on=r}}function gu(t,e,n){var r=(t+="")=="transform"?bs:Mr;return e==null?this.styleTween(t,hu(t,r)).on("end.style."+t,Fr(t)):typeof e=="function"?this.styleTween(t,pu(t,r,nn(this,"style."+t,e))).each(mu(this._id,t)):this.styleTween(t,du(t,r,e),n).on("end.style."+t,null)}function yu(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function vu(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&yu(t,o,n)),r}return a._value=e,a}function bu(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,vu(t,e,n??""))}function wu(t){return function(){this.textContent=t}}function _u(t){return function(){var e=t(this);this.textContent=e??""}}function xu(t){return this.tween("text",typeof t=="function"?_u(nn(this,"text",t)):wu(t==null?"":t+""))}function Du(t){return function(e){this.textContent=t.call(this,e)}}function Au(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 $u(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,Au(t))}function Su(){for(var t=this._name,e=this._id,n=Lr(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,u=0;u<s;++u)if(l=o[u]){var f=W(l,e);ye(l,t,n,u,o,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new et(r,this._parents,t,n)}function Tu(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};n.each(function(){var u=K(this,r),f=u.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(s),e._.interrupt.push(s),e._.end.push(l)),u.on=e}),i===0&&a()})}var Cu=0;function et(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Lr(){return++Cu}var nt=Rt.prototype;et.prototype={constructor:et,select:uu,selectAll:lu,selectChild:nt.selectChild,selectChildren:nt.selectChildren,filter:eu,merge:nu,selection:fu,transition:Su,call:nt.call,nodes:nt.nodes,node:nt.node,size:nt.size,empty:nt.empty,each:nt.each,on:au,attr:Gs,attrTween:Hs,style:gu,styleTween:bu,text:xu,textTween:$u,remove:su,tween:Ls,delay:Ys,duration:Js,ease:Zs,easeVarying:tu,end:Tu,[Symbol.iterator]:nt[Symbol.iterator]};function Eu(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Mu={time:null,delay:0,duration:250,ease:Eu};function Fu(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 Lu(t){var e,n;t instanceof et?(e=t._id,t=t._name):(e=Lr(),(n=Mu).time=Ke(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&ye(l,t,e,u,o,n||Fu(l,e));return new et(r,this._parents,t,e)}Rt.prototype.interrupt=Es,Rt.prototype.transition=Lu;function Ou(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 At(t){return t=ve(Math.abs(t)),t?t[1]:NaN}function Pu(t,e){return function(n,r){for(var i=n.length,a=[],o=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(e)}}function Ru(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var Nu=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function be(t){if(!(e=Nu.exec(t)))throw new Error("invalid format: "+t);var e;return new rn({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=rn.prototype;function rn(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+""}rn.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 Iu(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 ku(t,e){var n=ve(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(Or=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 Pr(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 Rr={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Ou,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:ku,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:Pu(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+"",a=t.numerals===void 0?Nr:Ru(Ir.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",s=t.minus===void 0?"−":t.minus+"",l=t.nan===void 0?"NaN":t.nan+"";function u(c){c=be(c);var h=c.fill,d=c.align,p=c.sign,g=c.symbol,_=c.zero,x=c.width,D=c.comma,$=c.precision,S=c.trim,T=c.type;T==="n"?(D=!0,T="g"):Rr[T]||($===void 0&&($=12),S=!0,T="g"),(_||h==="0"&&d==="=")&&(_=!0,h="0",d="=");var I=g==="$"?n:g==="#"&&/[boxX]/.test(T)?"0"+T.toLowerCase():"",R=g==="$"?r:/[%p]/.test(T)?o:"",N=Rr[T],v=/[defgprs%]/.test(T);$=$===void 0?6:/[gprs]/.test(T)?Math.max(1,Math.min(21,$)):Math.max(0,Math.min(20,$));function b(y){var C=I,M=R,V,it,wt;if(T==="c")M=N(y)+M,y="";else{y=+y;var tt=y<0||1/y<0;if(y=isNaN(y)?l:N(Math.abs(y),$),S&&(y=Iu(y)),tt&&+y==0&&p!=="+"&&(tt=!1),C=(tt?p==="("?p:s:p==="-"||p==="("?"":p)+C,M=(T==="s"?kr[8+Or/3]:"")+M+(tt&&p==="("?")":""),v){for(V=-1,it=y.length;++V<it;)if(wt=y.charCodeAt(V),48>wt||wt>57){M=(wt===46?i+y.slice(V+1):y.slice(V))+M,y=y.slice(0,V);break}}}D&&!_&&(y=e(y,1/0));var Ee=C.length+y.length+M.length,at=Ee<x?new Array(x-Ee+1).join(h):"";switch(D&&_&&(y=e(at+y,at.length?x-M.length:1/0),at=""),d){case"<":y=C+y+M+at;break;case"=":y=C+at+y+M;break;case"^":y=at.slice(0,Ee=at.length>>1)+C+y+M+at.slice(Ee);break;default:y=at+C+y+M;break}return a(y)}return b.toString=function(){return c+""},b}function f(c,h){var d=u((c=be(c),c.type="f",c)),p=Math.max(-8,Math.min(8,Math.floor(At(h)/3)))*3,g=Math.pow(10,-p),_=kr[8+p/3];return function(x){return d(g*x)+_}}return{format:u,formatPrefix:f}}var we,an,Gr;Vu({thousands:",",grouping:[3],currency:["$",""]});function Vu(t){return we=Gu(t),an=we.format,Gr=we.formatPrefix,we}function Bu(t){return Math.max(0,-At(Math.abs(t)))}function Uu(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(At(e)/3)))*3-At(Math.abs(t)))}function zu(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,At(e)-At(t))+1}function _e(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const Vr=Symbol("implicit");function Br(){var t=new Hn,e=[],n=[],r=Vr;function i(a){let o=t.get(a);if(o===void 0){if(r!==Vr)return r;t.set(a,o=e.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return e.slice();e=[],t=new Hn;for(const o of a)t.has(o)||t.set(o,e.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Br(e,n).unknown(r)},_e.apply(i,arguments),i}function Ur(){var t=Br().unknown(void 0),e=t.domain,n=t.range,r=0,i=1,a,o,s=!1,l=0,u=0,f=.5;delete t.unknown;function c(){var h=e().length,d=i<r,p=d?i:r,g=d?r:i;a=(g-p)/Math.max(1,h-l+u*2),s&&(a=Math.floor(a)),p+=(g-p-a*(h-l))*f,o=a*(1-l),s&&(p=Math.round(p),o=Math.round(o));var _=fa(h).map(function(x){return p+a*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 o},t.step=function(){return a},t.round=function(h){return arguments.length?(s=!!h,c()):s},t.padding=function(h){return arguments.length?(l=Math.min(1,u=+h),c()):l},t.paddingInner=function(h){return arguments.length?(l=Math.min(1,h),c()):l},t.paddingOuter=function(h){return arguments.length?(u=+h,c()):u},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(l).paddingOuter(u).align(f)},_e.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 Hu(){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 on(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],a=e[0],o=e[1];return i<r?(r=on(i,r),a=n(o,a)):(r=on(r,i),a=n(a,o)),function(s){return a(r(s))}}function ju(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]=on(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(s){var l=zn(t,s,1,r)-1;return a[l](i[l](s))}}function Ju(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Ku(){var t=Hr,e=Hr,n=je,r,i,a,o=$t,s,l,u;function f(){var h=Math.min(t.length,e.length);return o!==$t&&(o=Yu(t[0],t[h-1])),s=h>2?ju:Wu,l=u=null,c}function c(h){return h==null||isNaN(h=+h)?a:(l||(l=s(t.map(r),e,n)))(r(o(h)))}return c.invert=function(h){return o(i((u||(u=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=gs,f()},c.clamp=function(h){return arguments.length?(o=h?!0:$t,f()):o!==$t},c.interpolate=function(h){return arguments.length?(n=h,f()):n},c.unknown=function(h){return arguments.length?(a=h,c):a},function(h,d){return r=h,i=d,f()}}function Zu(){return Ku()($t,$t)}function Qu(t,e,n,r){var i=ca(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=Uu(i,o))&&(r.precision=a),Gr(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=zu(i,Math.max(Math.abs(t),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Bu(i))&&(r.precision=a-(r.type==="%")*2);break}}return an(r)}function Xr(t){var e=t.domain;return t.ticks=function(n){var r=e();return la(r[0],r[r.length-1],n??10)},t.tickFormat=function(n,r){var i=e();return Qu(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],l,u,f=10;for(s<o&&(u=o,o=s,s=u,u=i,i=a,a=u);f-- >0;){if(u=Ge(o,s,n),u===l)return r[i]=o,r[a]=s,e(r);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return t},t}function qr(){var t=Zu();return t.copy=function(){return Ju(t,qr())},_e.apply(t,arguments),Xr(t)}function Yr(){var t=0,e=1,n=1,r=[.5],i=[0,1],a;function o(l){return l!=null&&l<=l?i[zn(r,l,0,n)]:a}function s(){var l=-1;for(r=new Array(n);++l<n;)r[l]=((l+1)*e-(l-n)*t)/(n+1);return o}return o.domain=function(l){return arguments.length?([t,e]=l,t=+t,e=+e,s()):[t,e]},o.range=function(l){return arguments.length?(n=(i=Array.from(l)).length-1,s()):i.slice()},o.invertExtent=function(l){var u=i.indexOf(l);return u<0?[NaN,NaN]:u<1?[t,r[0]]:u>=n?[r[n-1],e]:[r[u-1],r[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Yr().domain([t,e]).range(i).unknown(a)},_e.apply(Xr(o),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 X(t){return Object.prototype.toString.call(t)==="[object Object]"}function Wr(t){return!!t&&!t.nodename&&t.constructor!=String&&t.constructor!=RegExp&&t.constructor!=Array&&/function/i.test(t+"")}function jr(t){return!!(t&&t.nodeType)}function st(t,e){if(X(t)===!1||X(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;X(r[o])&&X(i[o])?(s=n(r[o],i[o]),a[o]=s):a[o]=r[o]}return a};return n(t,e)}function tl(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 el(t,e){return e instanceof Function?e(t):an(e)(t)}function Ht(t,e,n,r){let i=`${t}_${e}_${n}`;return r!=null&&(i+=`_${r}`),i}function xe(t,e){return`${t}_series${e}`}function sn(t,e){return`${t}_group${e}`}function un({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 Jr({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 Kr({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]:sn(n,a))}function Zr({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]:sn(`${n}_grid${r}`,o))}function St(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 De(t){const e=t.filter(n=>n!=null&&n.value!=null).map(n=>n.value);return St(e)}function nl(t){const n=(t[0]&&Array.isArray(t[0])?t.flat():t).filter(r=>(r==null||X(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return St(n)}function ln(t){const n=t.flat().filter(r=>(r==null||X(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return St(n)}function rl(t){const n=t.flat().flat().filter(r=>(r==null||X(r)&&r.value==null)===!1).map(r=>typeof r=="number"?r:r.value);return St(n)}function il(t,e=2){const r=t.flat().filter((i,a)=>a==e).filter(i=>(i==null||X(i)&&i.value==null)===!1).map(i=>typeof i=="number"?i:i.value);return St(r)}function Qr(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 Xt(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 ti(t){let e=Math.floor(Math.sqrt(t)),n=Math.ceil(t/e);for(;e*n<t;)n++;return{rowAmount:e,columnAmount:n}}function cn(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:ti(n);return new Array(n).fill(null).map((o,s)=>{const l=s%a,u=Math.floor(s/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=u*c+u*r;return{slotIndex:s,rowIndex:u,columnIndex:l,startX:h,startY:d,centerX:h+f/2,centerY:d+c/2,width:f,height:c}})}function Ae(t,e,n){const{gap:r}=e,{rowAmount:i,columnAmount:a}=e.rowAmount*e.columnAmount>=n?e:ti(n);return new Array(n).fill(null).map((o,s)=>{const l=s%a,u=Math.floor(s/a),f=(t.width-r*(a-1))/a,c=(t.height-r*(i-1))/i,h=l*f+l*r,d=u*c+u*r,p=[h,d],g=[f/t.width,c/t.height];return{slotIndex:s,rowIndex:u,columnIndex:l,translate:p,scale:g}})}const al=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=(o,s,l,u)=>{const f=Ht(n.type,s,l),c=n.seriesLabels[s]||xe("series",s),h=Xt(s,r);return typeof o=="number"?{id:f,index:u,seq:0,label:f,description:"",data:{},value:o,seriesIndex:s,seriesLabel:c,color:h,visible:!0}:{id:o.id?o.id:f,index:u,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((l,u)=>a(l,s,u,i.length+u)):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},ol=t=>({status:"success",message:""});var fn=function(t,e){return fn=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])},fn(t,e)};function Z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fn(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function sl(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function s(f){try{u(r.next(f))}catch(c){o(c)}}function l(f){try{u(r.throw(f))}catch(c){o(c)}}function u(f){f.done?a(f.value):i(f.value).then(s,l)}u((r=r.apply(t,e||[])).next())})}function ei(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(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1],a=u;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(u);break}a[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(f){u=[6,f],i=0}finally{r=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Tt(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,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 lt(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 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,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(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){a.push([d,g,_,x])>1||l(d,g)})},p&&(i[d]=p(i[d])))}function l(d,p){try{u(r[d](p))}catch(g){h(a[0][3],g)}}function u(d){d.value instanceof Ct?Promise.resolve(d.value.v).then(f,c):h(a[0][2],d)}function f(d){l("next",d)}function c(d){l("throw",d)}function h(d,p){d(p),a.shift(),a.length&&l(a[0][0],a[0][1])}}function 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 Tt=="function"?Tt(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,l){o=t[a](o),i(s,l,o.done,o.value)})}}function i(a,o,s,l){Promise.resolve(l).then(function(u){a({value:u,done:s})},o)}}typeof SuppressedError=="function"&&SuppressedError;function O(t){return typeof t=="function"}function hn(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var dn=hn(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
2
2
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function ve(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zt=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,a;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=Dt(o),l=u.next();!l.done;l=u.next()){var s=l.value;s.remove(this)}}catch(m){e={error:m}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(L(f))try{f()}catch(m){a=m instanceof Ke?m.errors:[m]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=Dt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{kr(p)}catch(m){a=a??[],m instanceof Ke?a=ut(ut([],ot(a)),ot(m.errors)):a.push(m)}}}catch(m){r={error:m}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}}if(a)throw new Ke(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)kr(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&ve(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&ve(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Or=zt.EMPTY;function Nr(t){return t instanceof zt||t&&"closed"in t&&L(t.remove)&&L(t.add)&&L(t.unsubscribe)}function kr(t){L(t)?t():t.unsubscribe()}var Ir={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Rr={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ut([t,e],ot(n)))},clearTimeout:function(t){var e=Rr.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Gr(t){Rr.setTimeout(function(){throw t})}function Ze(){}function be(t){t()}var Qe=function(t){K(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Nr(n)&&n.add(r)):r.destination=Hs,r}return e.create=function(n,r,i){return new Ut(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(zt),Vs=Function.prototype.bind;function tn(t,e){return Vs.call(t,e)}var zs=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){we(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){we(r)}else we(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){we(n)}},t}(),Ut=function(t){K(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(L(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var u;a&&Ir.useDeprecatedNextContext?(u=Object.create(n),u.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&tn(n.next,u),error:n.error&&tn(n.error,u),complete:n.complete&&tn(n.complete,u)}):o=n}return a.destination=new zs(o),a}return e}(Qe);function we(t){Gr(t)}function Us(t){throw t}var Hs={closed:!0,next:Ze,error:Us,complete:Ze},en=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function St(t){return t}function Xs(t){return t.length===0?St:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var F=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=Ys(e)?e:new Ut(e,n,r);return be(function(){var o=i,u=o.operator,l=o.source;a.add(u?u.call(a,l):l?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=Vr(n),new n(function(i,a){var o=new Ut({next:function(u){try{e(u)}catch(l){a(l),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[en]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Xs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Vr(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 Vr(t){var e;return(e=t??Ir.Promise)!==null&&e!==void 0?e:Promise}function qs(t){return t&&L(t.next)&&L(t.error)&&L(t.complete)}function Ys(t){return t&&t instanceof Qe||qs(t)&&Nr(t)}function Bs(t){return L(t==null?void 0:t.lift)}function k(t){return function(e){if(Bs(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function I(t,e,n,r,i){return new Ws(t,e,n,r,i)}var Ws=function(t){K(e,t);function e(n,r,i,a,o,u){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=u,l._next=r?function(s){try{r(s)}catch(f){n.error(f)}}:t.prototype._next,l._error=a?function(s){try{a(s)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(s){n.error(s)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Qe),js=Je(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),E=function(t){K(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 zr(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new js},e.prototype.next=function(n){var r=this;be(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Dt(r.currentObservers),u=o.next();!u.done;u=o.next()){var l=u.value;l.next(n)}}catch(s){i={error:s}}finally{try{u&&!u.done&&(a=o.return)&&a.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;be(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;be(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,a=i.hasError,o=i.isStopped,u=i.observers;return a||o?Or:(this.currentObservers=null,u.push(n),new zt(function(){r.currentObservers=null,ve(u,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,a=r.thrownError,o=r.isStopped;i?n.error(a):o&&n.complete()},e.prototype.asObservable=function(){var n=new F;return n.source=this,n},e.create=function(n,r){return new zr(n,r)},e}(F),zr=function(t){K(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:Or},e}(E),Ur=function(t){K(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,a=n._value;if(r)throw i;return this._throwIfClosed(),a},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(E),nn={now:function(){return(nn.delegate||Date).now()},delegate:void 0},Js=function(t){K(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=nn);var a=t.call(this)||this;return a._bufferSize=n,a._windowTime=r,a._timestampProvider=i,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=r===1/0,a._bufferSize=Math.max(1,n),a._windowTime=Math.max(1,r),a}return e.prototype.next=function(n){var r=this,i=r.isStopped,a=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,l=r._windowTime;i||(a.push(n),!o&&a.push(u.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),l=0;l<u.length&&!n.closed;l+=a?1:2)n.next(u[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<a.length&&a.splice(0,a.length-u),!o){for(var l=i.now(),s=0,f=1;f<a.length&&a[f]<=l;f+=2)s=f;s&&a.splice(0,s+1)}},e}(E),Ks=function(t){K(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(zt),rn={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ut([t,e],ot(n)))},clearInterval:function(t){var e=rn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},Zs=function(t){K(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var a=this.id,o=this.scheduler;return a!=null&&(this.id=this.recycleAsyncId(o,a,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),rn.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&rn.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,a;try{this.work(n)}catch(o){i=!0,a=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),a},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,a=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ve(a,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Ks),Hr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=nn.now,t}(),Qs=function(t){K(e,t);function e(n,r){r===void 0&&(r=Hr.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}(Hr),an=new Qs(Zs),tl=an,on=new F(function(t){return t.complete()});function Xr(t){return t&&L(t.schedule)}function un(t){return t[t.length-1]}function el(t){return L(un(t))?t.pop():void 0}function Mt(t){return Xr(un(t))?t.pop():void 0}function qr(t,e){return typeof un(t)=="number"?t.pop():e}var Yr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Br(t){return L(t==null?void 0:t.then)}function Wr(t){return L(t[en])}function jr(t){return Symbol.asyncIterator&&L(t==null?void 0:t[Symbol.asyncIterator])}function Jr(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 nl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kr=nl();function Zr(t){return L(t==null?void 0:t[Kr])}function Qr(t){return Rs(this,arguments,function(){var n,r,i,a;return Tr(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,At(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,At(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,At(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 ti(t){return L(t==null?void 0:t.getReader)}function U(t){if(t instanceof F)return t;if(t!=null){if(Wr(t))return rl(t);if(Yr(t))return il(t);if(Br(t))return al(t);if(jr(t))return ei(t);if(Zr(t))return ol(t);if(ti(t))return ul(t)}throw Jr(t)}function rl(t){return new F(function(e){var n=t[en]();if(L(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function il(t){return new F(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function al(t){return new F(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Gr)})}function ol(t){return new F(function(e){var n,r;try{for(var i=Dt(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.next(o),e.closed)return}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function ei(t){return new F(function(e){sl(t,e).catch(function(n){return e.error(n)})})}function ul(t){return ei(Qr(t))}function sl(t,e){var n,r,i,a;return Is(this,void 0,void 0,function(){var o,u;return Tr(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=Gs(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=l.sent(),i={error:u},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function st(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 ni(t,e){return e===void 0&&(e=0),k(function(n,r){n.subscribe(I(r,function(i){return st(r,t,function(){return r.next(i)},e)},function(){return st(r,t,function(){return r.complete()},e)},function(i){return st(r,t,function(){return r.error(i)},e)}))})}function ri(t,e){return e===void 0&&(e=0),k(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function ll(t,e){return U(t).pipe(ri(e),ni(e))}function cl(t,e){return U(t).pipe(ri(e),ni(e))}function fl(t,e){return new F(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function hl(t,e){return new F(function(n){var r;return st(n,e,function(){r=t[Kr](),st(n,e,function(){var i,a,o;try{i=r.next(),a=i.value,o=i.done}catch(u){n.error(u);return}o?n.complete():n.next(a)},0,!0)}),function(){return L(r==null?void 0:r.return)&&r.return()}})}function ii(t,e){if(!t)throw new Error("Iterable cannot be null");return new F(function(n){st(n,e,function(){var r=t[Symbol.asyncIterator]();st(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function dl(t,e){return ii(Qr(t),e)}function pl(t,e){if(t!=null){if(Wr(t))return ll(t,e);if(Yr(t))return fl(t,e);if(Br(t))return cl(t,e);if(jr(t))return ii(t,e);if(Zr(t))return hl(t,e);if(ti(t))return dl(t,e)}throw Jr(t)}function Ct(t,e){return e?pl(t,e):U(t)}function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Mt(t);return Ct(t,n)}var ai=Je(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function ml(t){return t instanceof Date&&!isNaN(t)}function _(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(a){r.next(t.call(e,a,i++))}))})}var gl=Array.isArray;function yl(t,e){return gl(e)?t.apply(void 0,ut([],ot(e))):t(e)}function vl(t){return _(function(e){return yl(t,e)})}var bl=Array.isArray,wl=Object.getPrototypeOf,xl=Object.prototype,_l=Object.keys;function $l(t){if(t.length===1){var e=t[0];if(bl(e))return{args:e,keys:null};if(Dl(e)){var n=_l(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Dl(t){return t&&typeof t=="object"&&wl(t)===xl}function Al(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=Mt(t),r=el(t),i=$l(t),a=i.args,o=i.keys;if(a.length===0)return Ct([],n);var u=new F(Sl(a,n,o?function(l){return Al(o,l)}:St));return r?u.pipe(vl(r)):u}function Sl(t,e,n){return n===void 0&&(n=St),function(r){oi(e,function(){for(var i=t.length,a=new Array(i),o=i,u=i,l=function(f){oi(e,function(){var c=Ct(t[f],e),h=!1;c.subscribe(I(r,function(d){a[f]=d,h||(h=!0,u--),u||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},s=0;s<i;s++)l(s)},r)}}function oi(t,e,n){t?st(n,t,e):e()}function Ml(t,e,n,r,i,a,o,u){var l=[],s=0,f=0,c=!1,h=function(){c&&!l.length&&!s&&e.complete()},d=function(m){return s<r?p(m):l.push(m)},p=function(m){s++;var b=!1;U(n(m,f++)).subscribe(I(e,function(x){e.next(x)},function(){b=!0},void 0,function(){if(b)try{s--;for(var x=function(){var $=l.shift();o||p($)};l.length&&s<r;)x();h()}catch($){e.error($)}}))};return t.subscribe(I(e,d,function(){c=!0,h()})),function(){}}function ui(t,e,n){return n===void 0&&(n=1/0),L(e)?ui(function(r,i){return _(function(a,o){return e(r,a,i,o)})(U(t(r,i)))},n):(typeof e=="number"&&(n=e),k(function(r,i){return Ml(r,i,t,n)}))}function sn(t){return t===void 0&&(t=1/0),ui(St,t)}function Cl(){return sn(1)}function si(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Cl()(Ct(t,Mt(t)))}function Pl(t){return new F(function(e){U(t()).subscribe(e)})}function li(t,e,n){return Pl(function(){return t()?e:n})}function Fl(t,e,n){n===void 0&&(n=tl);var r=-1;return e!=null&&(Xr(e)?n=e:r=e),new F(function(i){var a=ml(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 El(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Mt(t),r=qr(t,1/0),i=t;return i.length?i.length===1?U(i[0]):sn(r)(Ct(i,n)):on}var Ll=Array.isArray;function Tl(t){return t.length===1&&Ll(t[0])?t[0]:t}function ci(t,e){return k(function(n,r){var i=0;n.subscribe(I(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function fi(t){return k(function(e,n){var r=null,i=!1,a;r=e.subscribe(I(n,void 0,void 0,function(o){a=U(t(o,fi(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function Ol(t,e){return e===void 0&&(e=an),k(function(n,r){var i=null,a=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var s=a;a=null,r.next(s)}};function l(){var s=o+t,f=e.now();if(f<s){i=this.schedule(void 0,s-f),r.add(i);return}u()}n.subscribe(I(r,function(s){a=s,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){u(),r.complete()},void 0,function(){a=i=null}))})}function Nl(t){return k(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function kl(t){return t<=0?function(){return on}:k(function(e,n){var r=0;e.subscribe(I(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Z(t,e){return e===void 0&&(e=St),t=t??Il,k(function(n,r){var i,a=!0;n.subscribe(I(r,function(o){var u=e(o);(a||!t(i,u))&&(a=!1,i=u,r.next(o))}))})}function Il(t,e){return t===e}function Rl(t){return t===void 0&&(t=Gl),k(function(e,n){var r=!1;e.subscribe(I(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function Gl(){return new ai}function Vl(t,e){var n=arguments.length>=2;return function(r){return r.pipe(St,kl(1),n?Nl(e):Rl(function(){return new ai}))}}function zl(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Mt(t),r=qr(t,1/0);return t=Tl(t),k(function(i,a){sn(r)(Ct(ut([i],ot(t)),n)).subscribe(a)})}function Ul(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return zl.apply(void 0,ut([],ot(t)))}function ln(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new E}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,u=t.resetOnRefCountZero,l=u===void 0?!0:u;return function(s){var f,c,h,d=0,p=!1,m=!1,b=function(){c==null||c.unsubscribe(),c=void 0},x=function(){b(),f=h=void 0,p=m=!1},$=function(){var D=f;x(),D==null||D.unsubscribe()};return k(function(D,A){d++,!m&&!p&&b();var S=h=h??n();A.add(function(){d--,d===0&&!m&&!p&&(c=cn($,l))}),S.subscribe(A),!f&&d>0&&(f=new Ut({next:function(O){return S.next(O)},error:function(O){m=!0,b(),c=cn(x,i,O),S.error(O)},complete:function(){p=!0,b(),c=cn(x,o),S.complete()}}),U(D).subscribe(f))})(s)}}function cn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Ut({next:function(){i.unsubscribe(),t()}});return U(e.apply(void 0,ut([],ot(n)))).subscribe(i)}}function y(t,e,n){var r,i=!1;return r=t,ln({connector:function(){return new Js(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Mt(t);return k(function(r,i){(n?si(t,r,n):si(t,r)).subscribe(i)})}function T(t,e){return k(function(n,r){var i=null,a=0,o=!1,u=function(){return o&&!i&&r.complete()};n.subscribe(I(r,function(l){i==null||i.unsubscribe();var s=0,f=a++;U(t(l,f)).subscribe(i=I(r,function(c){return r.next(e?e(l,c,f,s++):c)},function(){i=null,u()}))},function(){o=!0,u()}))})}function C(t){return k(function(e,n){U(t).subscribe(I(n,function(){return n.complete()},Ze)),!n.closed&&e.subscribe(n)})}function Hl(t,e){return k(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,u=i.trailing,l=u===void 0?!1:u,s=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(b(),h&&r.complete())},p=function(){c=null,h&&r.complete()},m=function(x){return c=U(t(x)).subscribe(I(r,d,p))},b=function(){if(s){s=!1;var x=f;f=null,r.next(x),!h&&m(x)}};n.subscribe(I(r,function(x){s=!0,f=x,!(c&&!c.closed)&&(o?b():m(x))},function(){h=!0,!(l&&s&&c&&!c.closed)&&r.complete()}))})}function Xl(t,e,n){e===void 0&&(e=an);var r=Fl(t,e);return Hl(function(){return r},n)}const Ht=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new E,i=e.pipe(C(r),_(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),Z()),a=n.pipe(C(r),ci(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(C(r),ci(c=>c.eventName==="mouseout"),T(c=>i));function u(c,h){const d=c.find(p=>p.id===h);return d?[d]:[]}function l(c,h){return h==null?[]:c.filter(d=>d.seriesLabel===h)}function s(c,h){return h==null?[]:c.filter(d=>d.groupLabel===h)}function f(c,h){return h==null?[]:c.filter(d=>d.categoryLabel===h)}return new F(c=>(R({target:El(a,o,i),datumList:t,fullChartParams:e}).pipe(C(r),T(async h=>h)).subscribe(h=>{let d=[];h.fullChartParams.highlightTarget==="datum"?d=u(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=l(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=s(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},xe=({datumList$:t})=>t.pipe(_(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),hn=({datumList$:t})=>t.pipe(_(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),hi=({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})),Xt=t=>t.pipe(_(e=>e.styles.textSize),Z(),_(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})),ql=({fullDataFormatter$:t})=>t.pipe(_(e=>e.separateSeries),Z()),Yl=({computedData$:t})=>t.pipe(_(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),Z((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),di=({computedData$:t})=>t.pipe(_(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Bl=({computedData$:t,fullDataFormatter$:e})=>R({computedData:t,fullDataFormatter:e}).pipe(T(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)]})),Wl=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(T(async i=>i),_(i=>i.fullDataFormatter.separateSeries?We(i.layout,i.fullDataFormatter.container,i.computedData.length):We(i.layout,i.fullDataFormatter.container,1))),jl=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>R({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(T(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]])))),Jl=({subject:t,observer:e})=>{const n=Xt(e.fullChartParams$).pipe(y(1)),r=ql({fullDataFormatter$:e.fullDataFormatter$}),i=di({computedData$:e.computedData$}),a=Bl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(y(1)),o=di({computedData$:a}),u=e.computedData$.pipe(_(d=>d.flat())).pipe(y(1)),l=Ht({datumList$:u,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(y(1)),s=Yl({computedData$:e.computedData$}),f=xe({datumList$:u}).pipe(y(1)),c=Wl({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(y(1)),h=jl({seriesContainerPosition$:c,seriesLabels$:s,separateSeries$:r}).pipe(y(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,visibleComputedData$:i,visibleComputedLayoutData$:o,separateSeries$:r,computedLayoutData$:a,seriesHighlight$:l,seriesLabels$:s,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:h}},mt=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=tt.scaleDomain,scaleRange:i=tt.scaleRange})=>{const a=r[0]??tt.scaleDomain[0],o=r[1]??tt.scaleDomain[1],u=i[0]??tt.scaleRange[0],l=i[1]??tt.scaleRange[1];let s=a==="auto"?e<0?e:0:a==="min"?e:a,f=o==="auto"?t>=0?t:0:o==="max"?t:o;const c=t-(t-s)/(1-u),h=f/l;return Sr().domain([c,h]).range([0,n])},Kl=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return ws().domain(t).range(r).padding(n)},Zl=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((l,s)=>s);r&&i.reverse();const a=i.length-1+n*2,o=e/a,u=o*n-o*.5;return Mr().domain([u,e-u]).range(i)};function Ql(t){return new F(e=>{const n=new ResizeObserver(r=>{const i=r[0];i&&i.contentRect&&e.next(i.contentRect)});return n.observe(t),function(){n.unobserve(t)}})}function pi(t,e,n){const r=at(t,e);return n==="multiGrid"&&t.gridList!=null&&(r.gridList=t.gridList.map((i,a)=>{const o=e.gridList[a]||e.gridList[0];return at(i,o)})),r}const tc=({defaultDataFormatter:t,computedDataFn:e,contextObserverFn:n})=>{const r=new E,i=t.type;return function(o,u){Kt(o).selectAll("svg").remove();const l=Kt(o).append("svg");l.attr("xmlns:xlink","http://www.w3.org/1999/xlink").attr("xmls","http://www.w3.org/2000/svg").attr("version","1.1").style("position","absolute").classed("orbcharts__root",!0);const s=l.append("g");s.classed("orbcharts__layout",!0);const f=s.append("g");f.classed("orbcharts__plugins",!0);const c={data$:new E,dataFormatter$:new E,plugins$:new E,chartParams$:new E,event$:new E},h=(g=>{const M=g||lt,P=M.preset?M.preset:{};return{name:P.name??"",description:P.description??"",chartParams:P.chartParams?at(P.chartParams,pn):pn,dataFormatter:P.dataFormatter?pi(P.dataFormatter,t,i):t,allPluginParams:P.allPluginParams?P.allPluginParams:{}}})(u),d=c.data$.pipe(y(1)),p=c.dataFormatter$.pipe(C(r),fn({}),_(g=>pi(g,h.dataFormatter,i)),y(1)),m=c.chartParams$.pipe(C(r),fn({}),_(g=>at(g,h.chartParams)),y(1)),b=m.pipe(C(r),fn({}),_(g=>at(g.padding??{},dn)));b.pipe(C(r),Vl()).subscribe(g=>{s.attr("transform",`translate(${g.left}, ${g.top})`)}),b.subscribe(g=>{s.transition().attr("transform",`translate(${g.left}, ${g.top})`)});const x=pt({width:(u==null?void 0:u.width)??lt.width,height:(u==null?void 0:u.height)??lt.height}).pipe(T(g=>li(()=>g.width==="auto"||g.height==="auto",Ql(o).pipe(_(M=>({width:g.width==="auto"?M.width:g.width,height:g.height==="auto"?M.height:g.height}))),pt(g))),C(r),ln()),$=pt().pipe(Ul(x.pipe(Ol(250)),x.pipe(Xl(250))),Z((g,M)=>JSON.stringify(g)===JSON.stringify(M)),ln()),D=$.subscribe(),A=R({rootSize:$,mergedPadding:b}).pipe(C(r),T(async g=>{const M=g.rootSize.width>0?g.rootSize.width:Mi,P=g.rootSize.height>0?g.rootSize.height:Ci;return{width:M-g.mergedPadding.left-g.mergedPadding.right,height:P-g.mergedPadding.top-g.mergedPadding.bottom,top:g.mergedPadding.top,right:g.mergedPadding.right,bottom:g.mergedPadding.bottom,left:g.mergedPadding.left,rootWidth:M,rootHeight:P}}),y(1));A.subscribe(g=>{l.attr("width",g.rootWidth).attr("height",g.rootHeight)});const S=R({data:d,dataFormatter:p,chartParams:m}).pipe(C(r),T(async g=>g),T(g=>pt(g).pipe(_(M=>{try{return e({data:M.data,dataFormatter:M.dataFormatter,chartParams:M.chartParams})}catch(P){throw console.error(P),new Error(P)}}),fi(()=>on))),y(1));S.subscribe();const O={};return c.plugins$.subscribe(g=>{if(!g)return;const M=f.selectAll("g.orbcharts__plugin").data(g,v=>v.name),P=M.enter().append("g").attr("class",v=>`orbcharts__plugin orbcharts__${v.name}`);M.exit().remove().each((v,G,N)=>{O[v.name]&&(O[v.name].destroy(),O[v.name]=void 0)}),P.each((v,G,N)=>{const H={fullParams$:new F,fullChartParams$:m,fullDataFormatter$:p,computedData$:S,layout$:A},rt=n({observer:H,subject:c}),Q={selection:Kt(N[G]),rootSelection:l,name:v.name,chartType:i,subject:c,observer:rt};v.setPresetParams(h.allPluginParams[v.name]??{}),v.setContext(Q),O[Q.name]=v,v.init()})}),{...c,selection:l,destroy(){Kt(o).selectAll("svg").remove(),r.next(void 0),D.unsubscribe()}}}};class Pt{constructor({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r},i,a){this.data$=new E,this.dataFormatter$=new E,this.plugins$=new E,this.chartParams$=new E,this.event$=new E;const u=tc({defaultDataFormatter:e,computedDataFn:n,contextObserverFn:r})(i,a);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}}class ec extends Pt{constructor(e,n){super({defaultDataFormatter:mn,computedDataFn:ks,contextObserverFn:Jl},e,n)}}function mi(t,e){if(!t.length)return[];try{const n=t.reduce((o,u)=>u.length>o?u.length:o,0),i=t.map((o,u)=>{if(o.length===n)return o;const l=Object.assign([],o);for(let s=l.length;s<n;s++)l[s]=null;return l}).map((o,u)=>o.map((l,s)=>l==null?{id:"",label:"",data:{},value:null}:typeof l=="number"?{id:"",label:"",data:{},value:l}:{id:l.id??"",label:l.label??"",data:l.data??{},value:l.value}));return Er(e.seriesDirection,i)}catch{return[]}}const nc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=mi(e,n.grid),o=Ye({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"}),u=Pr({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"});let l=0;i=a.map((s,f)=>s.map((c,h)=>{const d=Gt("grid",0,f,h),p=u[h],m={id:c.id?c.id:d,index:l,label:c.label?c.label:d,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:h,groupLabel:p,color:Vt(f,r),visible:!0};return m.visible=n.visibleFilter(m,t),l++,m}))}catch(a){throw Error(a)}return i},gi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,u){const l=o.grid.groupAxis.position==="top"||o.grid.groupAxis.position==="bottom"?u.width:u.height,s=a[0]?a[0].length-1:0;return mt({maxValue:s,minValue:0,axisWidth:l,scaleDomain:[0,s],scaleRange:[0,1]})}function i(a,o,u){const l=o.grid.valueAxis.position==="left"||o.grid.valueAxis.position==="right"?u.height:u.width,s=a.flat(),[f,c]=ge(s);return mt({maxValue:c,minValue:f,axisWidth:l,scaleDomain:[f,c],scaleRange:[0,1]})}return R({computedData:t,fullDataFormatter:e,layout:n}).pipe(T(async a=>a),_(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),u=i(a.computedData,a.fullDataFormatter,a.layout),l=u(0);return a.computedData.map((s,f)=>s.map((c,h)=>{const d=o(h),p=u(c.value??0);return{...c,axisX:d,axisY:p,axisYFromZero:p-l}}))}))},yi=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxis:i,yAxis:a,width:o,height:u}){if(!i||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,s=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,s=u):a.position==="right"?(c=180,h=180,l=o,s=u):(c=180,s=u):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,l=o):(c=180,s=u)):i.position==="left"?a.position==="bottom"?(f=-90,s=u):a.position==="top"?(f=-90,h=180):(c=180,s=u):i.position==="right"?a.position==="bottom"?(f=-90,c=180,s=u,l=o):a.position==="top"?(f=-90,c=180,h=180,l=o):(c=180,s=u):(c=180,s=u),{translate:[l,s],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${l}px, ${s}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new F(i=>(R({fullDataFormatter:t,layout:e}).pipe(C(n),T(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)}))},vi=({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)`}})),bi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new E;function i({data:a,groupAxis:o,valueAxis:u,width:l,height:s}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:s,m=0,b=a[0]?a[0].length-1:0,x=o.scaleDomain[0]-o.scalePadding,$=o.scaleDomain[1]==="max"?b+o.scalePadding:o.scaleDomain[1]+o.scalePadding,D=mt({maxValue:b,minValue:m,axisWidth:p,scaleDomain:[x,$],scaleRange:[0,1]}),A=D(m),S=D(b);m==b?(f=0,h=1):(f=A,h=(S-A)/p);const O=a.map((H,rt)=>H.filter((yt,Q)=>Q>=x&&Q<=$&&yt.visible==!0)),g=Be(O);g[0]===g[1]&&(g[0]=g[1]-1);const M=u.position==="left"||u.position==="right"?s:l,P=mt({maxValue:g[1],minValue:g[0],axisWidth:M,scaleDomain:u.scaleDomain,scaleRange:u.scaleRange}),X=Be(a);X[0]===X[1]&&(X[0]=X[1]-1);const v=P(X[0]),G=P(X[1]);return c=v,d=(G-v)/M,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new F(a=>(R({computedData:t,fullDataFormatter:e,layout:n}).pipe(C(r),T(async o=>o)).subscribe(o=>{const u=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(u)}),function(){r.next(void 0)}))},wi=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>R({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(T(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]]))),xi=({fullDataFormatter$:t,layout$:e})=>{const n=new E;function r({xAxisPosition:i,yAxisPosition:a,width:o,height:u}){return(i==="bottom"||i==="top")&&(a==="left"||a==="right")?{width:o,height:u}:(i==="left"||i==="right")&&(a==="bottom"||a==="top")?{width:u,height:o}:{width:o,height:u}}return new F(i=>{R({fullDataFormatter:t,layout:e}).pipe(C(n),T(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)}})})},_i=({computedData$:t})=>t.pipe(_(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),Z((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),$i=({computedData$:t})=>t.pipe(_(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Di=({computedLayoutData$:t})=>t.pipe(_(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),rc=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(T(async i=>i),_(i=>{if(i.fullDataFormatter.grid.separateSeries)return ye(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=ye(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,u)=>a[0])}})),Ai=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(_(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((o,u)=>r.reduce((l,s)=>{if(s&&s[u]){const f=s[u].value==null||s[u].visible==!1?0:s[u].value;return l+f}return l},0));return r.map((o,u)=>o.map((l,s)=>({...l,value:i[s]})))}));return t.pipe(T(r=>li(()=>r,e,n)))},ic=({subject:t,observer:e})=>{const n=Xt(e.fullChartParams$).pipe(y(1)),r=e.fullDataFormatter$.pipe(_(D=>D.grid.separateSeries),Z(),y(1)),i=rc({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),a=yi({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(y(1)),o=vi({gridAxesTransform$:a}).pipe(y(1)),u=bi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(y(1)),l=wi({gridContainerPosition$:i,gridAxesTransform$:a,gridGraphicTransform$:u}),s=xi({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(y(1)),f=e.computedData$.pipe(_(D=>D.flat())).pipe(y(1)),c=Ht({datumList$:f,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(y(1)),h=_i({computedData$:e.computedData$}),d=xe({datumList$:f}).pipe(y(1)),p=hn({datumList$:f}).pipe(y(1)),m=gi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(y(1)),b=$i({computedData$:e.computedData$}).pipe(y(1)),x=Di({computedLayoutData$:m}).pipe(y(1)),$=Ai({computedData$:e.computedData$,isSeriesSeprate$:r}).pipe(y(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,isSeriesSeprate$:r,gridContainerPosition$:i,gridAxesTransform$:a,gridAxesReverseTransform$:o,gridGraphicTransform$:u,gridGraphicReverseScale$:l,gridAxesSize$:s,gridHighlight$:c,seriesLabels$:h,SeriesDataMap$:d,GroupDataMap$:p,computedLayoutData$:m,visibleComputedData$:b,visibleComputedLayoutData$:x,computedStackedData$:$}};class ac extends Pt{constructor(e,n){super({defaultDataFormatter:yn,computedDataFn:nc,contextObserverFn:ic},e,n)}}const oc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||qt,o=e.map((c,h)=>n.gridList[h]||a),u=e.map((c,h)=>mi(c,o[h])),l=n.separateGrid?u.map((c,h)=>Ye({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid"})):u.map((c,h)=>Cr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h})),s=new Map;let f=0;l.flat().forEach((c,h)=>{if(!s.has(c)){const d=Vt(f,r);s.set(c,d),f++}}),i=u.map((c,h)=>{const d=l[h],p=Fr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h});let m=0;return c.map((x,$)=>x.map((D,A)=>{const S=Gt("multiGrid",h,$,A),O=p[A],g=d[$],M={id:D.id?D.id:S,index:m,label:D.label?D.label:S,description:D.description??"",data:D.data,value:D.value,gridIndex:h,seriesIndex:$,seriesLabel:g,groupIndex:A,groupLabel:O,color:s.get(g),visible:!0};return M.visible=n.visibleFilter(M,t),m++,M}))})}catch(a){throw Error(a)}return i},uc=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new E,o=Ht({datumList$:e.pipe(_(l=>l.flat().flat()),y(1)),fullChartParams$:r,event$:i}).pipe(y(1)),u=Si({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(y(1));return R({fullDataFormatter:t,computedData:e,multiGridContainer:u}).pipe(T(async l=>l),_(l=>{a.next(void 0);const s=l.fullDataFormatter.gridList[0]??qt;return l.computedData.map((f,c)=>{const h=l.fullDataFormatter.gridList[c]??s,d={type:"grid",visibleFilter:l.fullDataFormatter.visibleFilter,grid:{...h},container:{...l.fullDataFormatter.container}},p=pt(d).pipe(C(a),y(1)),m=pt(f).pipe(C(a),y(1)),b=p.pipe(_(rt=>rt.grid.separateSeries),Z(),y(1)),x=pt(l.multiGridContainer[c]).pipe(C(a),y(1)),$=yi({fullDataFormatter$:p,layout$:n}).pipe(C(a),y(1)),D=vi({gridAxesTransform$:$}).pipe(C(a),y(1)),A=bi({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),y(1)),S=wi({gridContainerPosition$:x,gridAxesTransform$:$,gridGraphicTransform$:A}),O=xi({fullDataFormatter$:p,layout$:n}).pipe(C(a),y(1)),g=m.pipe(_(rt=>rt.flat())).pipe(C(a),y(1)),M=_i({computedData$:m}).pipe(C(a),y(1)),P=xe({datumList$:g}).pipe(C(a),y(1)),X=hn({datumList$:g}).pipe(C(a),y(1)),v=$i({computedData$:m}).pipe(C(a),y(1)),G=gi({computedData$:m,fullDataFormatter$:p,layout$:n}).pipe(C(a),y(1)),N=Di({computedLayoutData$:G}).pipe(C(a),y(1)),H=Ai({computedData$:m,isSeriesSeprate$:b}).pipe(y(1));return{isSeriesSeprate$:b,gridContainerPosition$:x,gridAxesTransform$:$,gridAxesReverseTransform$:D,gridGraphicTransform$:A,gridGraphicReverseScale$:S,gridAxesSize$:O,gridHighlight$:o,seriesLabels$:M,SeriesDataMap$:P,GroupDataMap$:X,dataFormatter$:p,computedData$:m,computedLayoutData$:G,visibleComputedData$:v,visibleComputedLayoutData$:N,computedStackedData$:H}})}))},Si=({computedData$:t,fullDataFormatter$:e,layout$:n})=>R({computedData:t,fullDataFormatter:e,layout:n}).pipe(T(async r=>r),_(r=>{const i=r.fullDataFormatter.gridList[0]??qt,a=r.computedData.reduce((s,f,c)=>{const d=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return s+d},0)||1,o=ye(r.layout,r.fullDataFormatter.container,a);let u=0;return r.computedData.map((s,f)=>{const c=r.fullDataFormatter.gridList[f]??i,h=s.map((d,p)=>{const m=o[u];return c.separateSeries&&(u+=1),m});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(u+=1),h})})),sc=({subject:t,observer:e})=>{const n=Xt(e.fullChartParams$).pipe(y(1)),r=uc({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(y(1)),i=Si({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 lc extends Pt{constructor(e,n){super({defaultDataFormatter:vn,computedDataFn:oc,contextObserverFn:sc},e,n)}}const cc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i={width:1e3,height:1e3};let a=[];try{const o=e.map(($,D)=>$.map((A,S)=>typeof A=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:A}:{id:A.id??"",label:A.label??"",description:A.description??"",data:A.data??{},categoryLabel:A.categoryLabel??"",value:A.value})),[u,l]=ge(o.map($=>$[0])),[s,f]=ge(o.map($=>$[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=mt({maxValue:l,minValue:u,axisWidth:c,scaleDomain:[u,l],scaleRange:[0,1]}),p=mt({maxValue:f,minValue:s,axisWidth:h,scaleDomain:[s,f],scaleRange:[0,1]}),m=[n.xAxis.scaleDomain[0]==="auto"?u<0?u:0:n.xAxis.scaleDomain[0]==="min"?u:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"?l>=0?l:0:n.xAxis.scaleDomain[1]==="max"?l:n.xAxis.scaleDomain[1]],b=[n.yAxis.scaleDomain[0]==="auto"?u<0?u:0:n.yAxis.scaleDomain[0]==="min"?u:n.yAxis.scaleDomain[0],n.yAxis.scaleDomain[1]==="auto"?l>=0?l:0:n.yAxis.scaleDomain[1]==="max"?l:n.yAxis.scaleDomain[1]];let x=0;a=o.map(($,D)=>$.map((A,S)=>{const O=x;x++;const g=Gt(n.type,D,S),M={id:A.id?A.id:g,index:O,label:A.label?A.label:g,description:A.description??"",data:A.data,value:A.value,categoryIndex:0,categoryLabel:"",axis:S==0?d(A.value):p(A.value),visible:!0,color:""};return M.visible=n.visibleFilter(M,t),M}))}catch(o){throw Error(o)}return a},fc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class hc extends Pt{constructor(e,n){super({defaultDataFormatter:bn,computedDataFn:cc,contextObserverFn:fc},e,n)}}const dc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;let i=[],a=[];try{let o=[],u=[];if(e.nodes)o=e.nodes,u=e.edges;else if(e[0])o=e[0],u=e[1];else return{nodes:[],edges:[]};i=o.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,categoryIndex:0,categoryLabel:"",color:"",startNodes:[],startNodeIds:[],endNodes:[],endNodeIds:[],visible:!0}));const l=new Map(i.map(c=>[c.id,c]));a=u.map((c,h)=>({id:c.id,index:h,label:c.label??"",description:c.description??"",data:c.data??{},value:c.value??0,startNode:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:!0}));const s=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(l).forEach(([c,h])=>{h.startNodes=s.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id),h.visible=n.visibleFilter(h,t)}),a=a.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(o){throw Error(o)}return{nodes:i,edges:a}},pc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class mc extends Pt{constructor(e,n){super({defaultDataFormatter:xn,computedDataFn:dc,contextObserverFn:pc},e,n)}}const gc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,u)=>[o,u]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(J(e)===!0)return JSON.parse(JSON.stringify(e));if(Array.isArray(e)===!1)return{id:""};let s;const f=new Map;e.forEach(h=>{if(!h.parent)s=h;else{const d=f.get(h.parent)??[];d.push(h),f.set(h.parent,d)}});const c=h=>({id:h.id,label:h.label,data:h.data,value:h.value,categoryLabel:h.categoryLabel,children:(f.get(h.id)??[]).map(d=>c(d))});return s?c(s):{id:""}}();let u=0;const l=(s,f,c)=>{const h=f+1,d=s.categoryLabel??null;let p=0;d!=null&&(i.has(d)||i.set(d,i.size),p=i.get(d)??0);const m=u;u++;const b={id:s.id,index:m,level:f,seq:c,label:s.label??"",description:s.description??"",categoryIndex:p,categoryLabel:d,color:Vt(p,r),data:s.data??{},value:s.value,visible:!0,children:(s.children??[]).map((x,$)=>l(x,h,$))};return b.visible=n.visibleFilter(b,t),b};a=l(o,0,0)}catch(o){throw Error(o)}return a},yc=({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)})),vc=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe(_(r=>r.categoryLabels),Z((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return R({nodeList:t,categoryLabels:n}).pipe(T(async r=>r),_(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),Z((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},bc=({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)})),wc=({subject:t,observer:e})=>{const n=Xt(e.fullChartParams$).pipe(y(1)),r=yc({computedData$:e.computedData$}).pipe(y(1)),i=Ht({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(y(1)),a=vc({nodeList$:r,fullDataFormatter$:e.fullDataFormatter$}).pipe(y(1)),o=hi({datumList$:r}).pipe(y(1)),u=bc({computedData$:e.computedData$}).pipe(y(1));return{fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,textSizePx$:n,treeHighlight$:i,existCategoryLabels$:a,CategoryDataMap$:o,visibleComputedData$:u}};class xc extends Pt{constructor(e,n){super({defaultDataFormatter:wn,computedDataFn:gc,contextObserverFn:wc},e,n)}}function _c({name:t,defaultParams:e,initFn:n}){const r=new E,i=new WeakMap;let a=()=>{},o;const u=new Ur(e),l=new Ur({}),s=u.pipe(T(c=>l.pipe(C(r),_(h=>at(h,c)))),y(1));return{params$:l,name:t,defaultParams:e,init(){o&&(a=n(o)??(()=>{}),i.set(o.selection,o))},destroy(){a(),o&&(o.selection.remove(),o=void 0),r.next(void 0)},setPresetParams:c=>{u.next(at(c,e))},setContext:c=>{o=c,o.observer.fullParams$=s}}}const gt=()=>function(e,n){return function(i){return class{constructor(){const o=_c({name:e,defaultParams:n,initFn:i});this.params$=o.params$,this.name=o.name,this.defaultParams=o.defaultParams,this.init=o.init,this.destroy=o.destroy,this.setPresetParams=o.setPresetParams,this.setContext=o.setContext}}}},$c=gt(),Dc=gt(),Ac=gt(),Sc=gt(),Mc=gt(),Cc=gt(),Pc=gt();w.GridChart=ac,w.MultiGridChart=lc,w.MultiValueChart=hc,w.RelationshipChart=mc,w.SeriesChart=ec,w.TreeChart=xc,w.calcGridContainerLayout=ye,w.calcSeriesContainerLayout=We,w.categoryDataMapObservable=hi,w.createAxisLinearScale=mt,w.createAxisPointScale=Kl,w.createAxisQuantizeScale=Zl,w.createDefaultDatumId=Gt,w.createDefaultGroupLabel=qe,w.createDefaultSeriesLabel=me,w.createGridGroupLabels=Pr,w.createGridSeriesLabels=Ye,w.createMultiGridGroupLabels=Fr,w.createMultiGridSeriesLabels=Cr,w.defineGridPlugin=Dc,w.defineMultiGridPlugin=Ac,w.defineMultiValuePlugin=Sc,w.defineNoneDataPlugin=Mc,w.defineRelationshipPlugin=Cc,w.defineSeriesPlugin=$c,w.defineTreePlugin=Pc,w.formatCommaNumber=Es,w.formatValueToLabel=Ls,w.getMinAndMax=$t,w.getMinAndMaxGrid=Be,w.getMinAndMaxMultiGrid=Os,w.getMinAndMaxMultiValue=Ns,w.getMinAndMaxSeries=Ts,w.getMinAndMaxValue=ge,w.groupDataMapObservable=hn,w.highlightObservable=Ht,w.isFunction=Fs,w.isPlainObject=J,w.mergeOptionsWithDefault=at,w.seriesColorPredicate=Vt,w.seriesDataMapObservable=xe,w.textSizePxObservable=Xt,w.transposeData=Er,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
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 qt=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=Tt(o),l=s.next();!l.done;l=s.next()){var u=l.value;u.remove(this)}}catch(g){e={error:g}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(O(f))try{f()}catch(g){a=g instanceof dn?g.errors:[g]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var h=Tt(c),d=h.next();!d.done;d=h.next()){var p=d.value;try{ii(p)}catch(g){a=a??[],g instanceof dn?a=lt(lt([],ut(a)),ut(g.errors)):a.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(a)throw new dn(a)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ii(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}(),ni=qt.EMPTY;function ri(t){return t instanceof qt||t&&"closed"in t&&O(t.remove)&&O(t.add)&&O(t.unsubscribe)}function ii(t){O(t)?t():t.unsubscribe()}var ai={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},oi={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=oi.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function si(t){oi.setTimeout(function(){throw t})}function pn(){}function Se(t){t()}var mn=function(t){Z(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,ri(n)&&n.add(r)):r.destination=dl,r}return e.create=function(n,r,i){return new Yt(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}(qt),cl=Function.prototype.bind;function gn(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){Te(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Te(r)}else Te(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Te(n)}},t}(),Yt=function(t){Z(e,t);function e(n,r,i){var a=t.call(this)||this,o;if(O(n)||!n)o={next:n??void 0,error:r??void 0,complete:i??void 0};else{var s;a&&ai.useDeprecatedNextContext?(s=Object.create(n),s.unsubscribe=function(){return a.unsubscribe()},o={next:n.next&&gn(n.next,s),error:n.error&&gn(n.error,s),complete:n.complete&&gn(n.complete,s)}):o=n}return a.destination=new fl(o),a}return e}(mn);function Te(t){si(t)}function hl(t){throw t}var dl={closed:!0,next:pn,error:hl,complete:pn},yn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Et(t){return t}function pl(t){return t.length===0?Et:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var F=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,a=gl(e)?e:new Yt(e,n,r);return Se(function(){var o=i,s=o.operator,l=o.source;a.add(s?s.call(a,l):l?i._subscribe(a):i._trySubscribe(a))}),a},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=ui(n),new n(function(i,a){var o=new Yt({next:function(s){try{e(s)}catch(l){a(l),o.unsubscribe()}},error:a,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[yn]=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=ui(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 ui(t){var e;return(e=t??ai.Promise)!==null&&e!==void 0?e:Promise}function ml(t){return t&&O(t.next)&&O(t.error)&&O(t.complete)}function gl(t){return t&&t instanceof mn||ml(t)&&ri(t)}function yl(t){return O(t==null?void 0:t.lift)}function k(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){Z(e,t);function e(n,r,i,a,o,s){var l=t.call(this,n)||this;return l.onFinalize=o,l.shouldUnsubscribe=s,l._next=r?function(u){try{r(u)}catch(f){n.error(f)}}:t.prototype._next,l._error=a?function(u){try{a(u)}catch(f){n.error(f)}finally{this.unsubscribe()}}:t.prototype._error,l._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:t.prototype._complete,l}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(mn),bl=hn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),L=function(t){Z(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 li(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;Se(function(){var i,a;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Tt(r.currentObservers),s=o.next();!s.done;s=o.next()){var l=s.value;l.next(n)}}catch(u){i={error:u}}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;Se(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;Se(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?ni:(this.currentObservers=null,s.push(n),new qt(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 F;return n.source=this,n},e.create=function(n,r){return new li(n,r)},e}(F),li=function(t){Z(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:ni},e}(L),ci=function(t){Z(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}(L),vn={now:function(){return(vn.delegate||Date).now()},delegate:void 0},wl=function(t){Z(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=vn);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,l=r._windowTime;i||(a.push(n),!o&&a.push(s.now()+l)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,a=i._infiniteTimeWindow,o=i._buffer,s=o.slice(),l=0;l<s.length&&!n.closed;l+=a?1:2)n.next(s[l]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,a=n._buffer,o=n._infiniteTimeWindow,s=(o?1:2)*r;if(r<1/0&&s<a.length&&a.splice(0,a.length-s),!o){for(var l=i.now(),u=0,f=1;f<a.length&&a[f]<=l;f+=2)u=f;u&&a.splice(0,u+1)}},e}(L),_l=function(t){Z(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(qt),bn={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=bn.delegate;return((e==null?void 0:e.clearInterval)||clearInterval)(t)},delegate:void 0},xl=function(t){Z(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),bn.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&&bn.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),fi=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=vn.now,t}(),Dl=function(t){Z(e,t);function e(n,r){r===void 0&&(r=fi.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}(fi),wn=new Dl(xl),Al=wn,Mt=new F(function(t){return t.complete()});function hi(t){return t&&O(t.schedule)}function _n(t){return t[t.length-1]}function $l(t){return O(_n(t))?t.pop():void 0}function Ft(t){return hi(_n(t))?t.pop():void 0}function di(t,e){return typeof _n(t)=="number"?t.pop():e}var pi=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function mi(t){return O(t==null?void 0:t.then)}function gi(t){return O(t[yn])}function yi(t){return Symbol.asyncIterator&&O(t==null?void 0:t[Symbol.asyncIterator])}function vi(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Sl(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var bi=Sl();function wi(t){return O(t==null?void 0:t[bi])}function _i(t){return ul(this,arguments,function(){var n,r,i,a;return ei(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,Ct(n.read())];case 3:return r=o.sent(),i=r.value,a=r.done,a?[4,Ct(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ct(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 xi(t){return O(t==null?void 0:t.getReader)}function H(t){if(t instanceof F)return t;if(t!=null){if(gi(t))return Tl(t);if(pi(t))return Cl(t);if(mi(t))return El(t);if(yi(t))return Di(t);if(wi(t))return Ml(t);if(xi(t))return Fl(t)}throw vi(t)}function Tl(t){return new F(function(e){var n=t[yn]();if(O(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Cl(t){return new F(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function El(t){return new F(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,si)})}function Ml(t){return new F(function(e){var n,r;try{for(var i=Tt(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 Di(t){return new F(function(e){Ll(t,e).catch(function(n){return e.error(n)})})}function Fl(t){return Di(_i(t))}function Ll(t,e){var n,r,i,a;return sl(this,void 0,void 0,function(){var o,s;return ei(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),n=ll(t),l.label=1;case 1:return[4,n.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),i={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ct(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 Ai(t,e){return e===void 0&&(e=0),k(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 $i(t,e){return e===void 0&&(e=0),k(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Ol(t,e){return H(t).pipe($i(e),Ai(e))}function Pl(t,e){return H(t).pipe($i(e),Ai(e))}function Rl(t,e){return new F(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 F(function(n){var r;return ct(n,e,function(){r=t[bi](),ct(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 O(r==null?void 0:r.return)&&r.return()}})}function Si(t,e){if(!t)throw new Error("Iterable cannot be null");return new F(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 Si(_i(t),e)}function kl(t,e){if(t!=null){if(gi(t))return Ol(t,e);if(pi(t))return Rl(t,e);if(mi(t))return Pl(t,e);if(yi(t))return Si(t,e);if(wi(t))return Nl(t,e);if(xi(t))return Il(t,e)}throw vi(t)}function Lt(t,e){return e?kl(t,e):H(t)}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ft(t);return Lt(t,n)}var Ti=hn(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function Gl(t){return t instanceof Date&&!isNaN(t)}function A(t,e){return k(function(n,r){var i=0;n.subscribe(G(r,function(a){r.next(t.call(e,a,i++))}))})}var Vl=Array.isArray;function Bl(t,e){return Vl(e)?t.apply(void 0,lt([],ut(e))):t(e)}function Ul(t){return A(function(e){return Bl(t,e)})}var zl=Array.isArray,Hl=Object.getPrototypeOf,Xl=Object.prototype,ql=Object.keys;function Yl(t){if(t.length===1){var e=t[0];if(zl(e))return{args:e,keys:null};if(Wl(e)){var n=ql(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function Wl(t){return t&&typeof t=="object"&&Hl(t)===Xl}function jl(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function B(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ft(t),r=$l(t),i=Yl(t),a=i.args,o=i.keys;if(a.length===0)return Lt([],n);var s=new F(Jl(a,n,o?function(l){return jl(o,l)}:Et));return r?s.pipe(Ul(r)):s}function Jl(t,e,n){return n===void 0&&(n=Et),function(r){Ci(e,function(){for(var i=t.length,a=new Array(i),o=i,s=i,l=function(f){Ci(e,function(){var c=Lt(t[f],e),h=!1;c.subscribe(G(r,function(d){a[f]=d,h||(h=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}))},r)},u=0;u<i;u++)l(u)},r)}}function Ci(t,e,n){t?ct(n,t,e):e()}function Kl(t,e,n,r,i,a,o,s){var l=[],u=0,f=0,c=!1,h=function(){c&&!l.length&&!u&&e.complete()},d=function(g){return u<r?p(g):l.push(g)},p=function(g){u++;var _=!1;H(n(g,f++)).subscribe(G(e,function(x){e.next(x)},function(){_=!0},void 0,function(){if(_)try{u--;for(var x=function(){var D=l.shift();o||p(D)};l.length&&u<r;)x();h()}catch(D){e.error(D)}}))};return t.subscribe(G(e,d,function(){c=!0,h()})),function(){}}function Ei(t,e,n){return n===void 0&&(n=1/0),O(e)?Ei(function(r,i){return A(function(a,o){return e(r,a,i,o)})(H(t(r,i)))},n):(typeof e=="number"&&(n=e),k(function(r,i){return Kl(r,i,t,n)}))}function xn(t){return t===void 0&&(t=1/0),Ei(Et,t)}function Zl(){return xn(1)}function Mi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zl()(Lt(t,Ft(t)))}function Ql(t){return new F(function(e){H(t()).subscribe(e)})}function Fi(t,e,n){return Ql(function(){return t()?e:n})}function tc(t,e,n){n===void 0&&(n=Al);var r=-1;return e!=null&&(hi(e)?n=e:r=e),new F(function(i){var a=Gl(t)?+t-n.now():t;a<0&&(a=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},a)})}function ec(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ft(t),r=di(t,1/0),i=t;return i.length?i.length===1?H(i[0]):xn(r)(Lt(i,n)):Mt}var nc=Array.isArray;function rc(t){return t.length===1&&nc(t[0])?t[0]:t}function Li(t,e){return k(function(n,r){var i=0;n.subscribe(G(r,function(a){return t.call(e,a,i++)&&r.next(a)}))})}function Wt(t){return k(function(e,n){var r=null,i=!1,a;r=e.subscribe(G(n,void 0,void 0,function(o){a=H(t(o,Wt(t)(e))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function ic(t,e){return e===void 0&&(e=wn),k(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var u=a;a=null,r.next(u)}};function l(){var u=o+t,f=e.now();if(f<u){i=this.schedule(void 0,u-f),r.add(i);return}s()}n.subscribe(G(r,function(u){a=u,o=e.now(),i||(i=e.schedule(l,t),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function ac(t){return k(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 oc(t){return t<=0?function(){return Mt}:k(function(e,n){var r=0;e.subscribe(G(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Q(t,e){return e===void 0&&(e=Et),t=t??sc,k(function(n,r){var i,a=!0;n.subscribe(G(r,function(o){var s=e(o);(a||!t(i,s))&&(a=!1,i=s,r.next(o))}))})}function sc(t,e){return t===e}function uc(t){return t===void 0&&(t=lc),k(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(Et,oc(1),n?ac(e):uc(function(){return new Ti}))}}function fc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ft(t),r=di(t,1/0);return t=rc(t),k(function(i,a){xn(r)(Lt(lt([i],ut(t)),n)).subscribe(a)})}function hc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return fc.apply(void 0,lt([],ut(t)))}function Dn(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new L}:e,r=t.resetOnError,i=r===void 0?!0:r,a=t.resetOnComplete,o=a===void 0?!0:a,s=t.resetOnRefCountZero,l=s===void 0?!0:s;return function(u){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},D=function(){var $=f;x(),$==null||$.unsubscribe()};return k(function($,S){d++,!g&&!p&&_();var T=h=h??n();S.add(function(){d--,d===0&&!g&&!p&&(c=An(D,l))}),T.subscribe(S),!f&&d>0&&(f=new Yt({next:function(I){return T.next(I)},error:function(I){g=!0,_(),c=An(x,i,I),T.error(I)},complete:function(){p=!0,_(),c=An(x,o),T.complete()}}),H($).subscribe(f))})(u)}}function An(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 Yt({next:function(){i.unsubscribe(),t()}});return H(e.apply(void 0,lt([],ut(n)))).subscribe(i)}}function w(t,e,n){var r,i=!1;return r=t,Dn({connector:function(){return new wl(r,e,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function $n(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ft(t);return k(function(r,i){(n?Mi(t,r,n):Mi(t,r)).subscribe(i)})}function P(t,e){return k(function(n,r){var i=null,a=0,o=!1,s=function(){return o&&!i&&r.complete()};n.subscribe(G(r,function(l){i==null||i.unsubscribe();var u=0,f=a++;H(t(l,f)).subscribe(i=G(r,function(c){return r.next(e?e(l,c,f,u++):c)},function(){i=null,s()}))},function(){o=!0,s()}))})}function E(t){return k(function(e,n){H(t).subscribe(G(n,function(){return n.complete()},pn)),!n.closed&&e.subscribe(n)})}function dc(t,e){return k(function(n,r){var i=e??{},a=i.leading,o=a===void 0?!0:a,s=i.trailing,l=s===void 0?!1:s,u=!1,f=null,c=null,h=!1,d=function(){c==null||c.unsubscribe(),c=null,l&&(_(),h&&r.complete())},p=function(){c=null,h&&r.complete()},g=function(x){return c=H(t(x)).subscribe(G(r,d,p))},_=function(){if(u){u=!1;var x=f;f=null,r.next(x),!h&&g(x)}};n.subscribe(G(r,function(x){u=!0,f=x,!(c&&!c.closed)&&(o?_():g(x))},function(){h=!0,!(l&&u&&c&&!c.closed)&&r.complete()}))})}function pc(t,e,n){e===void 0&&(e=wn);var r=tc(t,e);return dc(function(){return r},n)}function Oi(t){return new F(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 jt=({datumList$:t,fullChartParams$:e,event$:n})=>{const r=new L,i=e.pipe(E(r),A(c=>({id:null,seriesLabel:null,groupLabel:null,categoryLabel:null,highlightDefault:c.highlightDefault})),Q()),a=n.pipe(E(r),Li(c=>c.eventName==="mouseover"),A(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(E(r),Li(c=>c.eventName==="mouseout"),P(c=>i));function s(c,h){const d=c.find(p=>p.id===h);return d?[d]:[]}function l(c,h){return h==null?[]:c.filter(d=>d.seriesLabel===h)}function u(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 F(c=>(B({target:ec(a,o,i),datumList:t,fullChartParams:e}).pipe(E(r),P(async h=>h)).subscribe(h=>{let d=[];h.fullChartParams.highlightTarget==="datum"?d=s(h.datumList,h.target.id):h.fullChartParams.highlightTarget==="series"?d=l(h.datumList,h.target.seriesLabel):h.fullChartParams.highlightTarget==="group"?d=u(h.datumList,h.target.groupLabel):h.fullChartParams.highlightTarget==="category"&&(d=f(h.datumList,h.target.categoryLabel)),c.next(d)}),function(){r.next(void 0)}))},Ce=({datumList$:t})=>t.pipe(A(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.seriesLabel)??[];i.push(r),n.set(r.seriesLabel,i)}),n})),Sn=({datumList$:t})=>t.pipe(A(e=>{const n=new Map;return e.forEach(r=>{const i=n.get(r.groupLabel)??[];i.push(r),n.set(r.groupLabel,i)}),n})),Pi=({datumList$:t})=>t.pipe(A(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})),Jt=t=>t.pipe(A(e=>e.styles.textSize),Q(),A(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})),Ri=({fullDataFormatter$:t})=>t.pipe(A(e=>e.separateSeries),Q()),Ni=({computedData$:t})=>t.pipe(A(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),Q((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Tn=({computedData$:t})=>t.pipe(A(e=>e.map(n=>n.filter(r=>r.visible!=!1)))),Ii=({computedData$:t,fullDataFormatter$:e})=>B({computedData:t,fullDataFormatter:e}).pipe(P(async n=>n),A(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)]})),ki=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(P(async i=>i),A(i=>i.fullDataFormatter.separateSeries?cn(i.layout,i.fullDataFormatter.container,i.computedData.length):cn(i.layout,i.fullDataFormatter.container,1))),Gi=({seriesContainerPosition$:t,seriesLabels$:e,separateSeries$:n})=>B({seriesContainerPosition:t,seriesLabels:e,separateSeries:n}).pipe(P(async r=>r),A(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]])))),mc=({subject:t,observer:e})=>{const n=Jt(e.fullChartParams$).pipe(w(1)),r=Ri({fullDataFormatter$:e.fullDataFormatter$}),i=Tn({computedData$:e.computedData$}),a=Ii({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$}).pipe(w(1)),o=Tn({computedData$:a}),s=e.computedData$.pipe(A(d=>d.flat())).pipe(w(1)),l=jt({datumList$:s,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),u=Ni({computedData$:e.computedData$}),f=Ce({datumList$:s}).pipe(w(1)),c=ki({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),h=Gi({seriesContainerPosition$:c,seriesLabels$:u,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$:o,separateSeries$:r,computedLayoutData$:a,seriesHighlight$:l,seriesLabels$:u,SeriesDataMap$:f,seriesContainerPosition$:c,SeriesContainerPositionMap$:h}},gt=({maxValue:t=1,minValue:e=0,axisWidth:n,scaleDomain:r=j.scaleDomain,scaleRange:i=j.scaleRange})=>{const a=r[0]??j.scaleDomain[0],o=r[1]??j.scaleDomain[1],s=i[0]??j.scaleRange[0],l=i[1]??j.scaleRange[1];let u=a==="auto"?e<0?e:0:a==="min"?e:a,f=o==="auto"?t>=0?t:0:o==="max"?t:o;const c=t-(t-u)/(1-s),h=f/l;return qr().domain([c,h]).range([0,n])},gc=({axisLabels:t,axisWidth:e,padding:n=.5})=>{let r=[0,e];return Hu().domain(t).range(r).padding(n)},yc=({axisLabels:t,axisWidth:e,padding:n=0,reverse:r=!1})=>{let i=t.map((l,u)=>u);r&&i.reverse();const a=i.length-1+n*2,o=e/a,s=o*n-o*.5;return Yr().domain([s,e-s]).range(i)},Cn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{function r(a,o,s){const l=o.grid.groupAxis.position==="top"||o.grid.groupAxis.position==="bottom"?s.width:s.height,u=a[0]?a[0].length-1:0;return gt({maxValue:u,minValue:0,axisWidth:l,scaleDomain:[0,u],scaleRange:[0,1]})}function i(a,o,s){const l=o.grid.valueAxis.position==="left"||o.grid.valueAxis.position==="right"?s.height:s.width,u=a.flat(),[f,c]=De(u);return gt({maxValue:c,minValue:f,axisWidth:l,scaleDomain:[f,c],scaleRange:[0,1]})}return B({computedData:t,fullDataFormatter:e,layout:n}).pipe(P(async a=>a),A(a=>{const o=r(a.computedData,a.fullDataFormatter,a.layout),s=i(a.computedData,a.fullDataFormatter,a.layout),l=s(0);return a.computedData.map((u,f)=>u.map((c,h)=>{const d=o(h),p=s(c.value??0);return{...c,axisX:d,axisY:p,axisYFromZero:p-l}}))}))},En=({fullDataFormatter$:t,layout$:e})=>{const n=new L;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 l=0,u=0,f=0,c=0,h=0;return i.position==="bottom"?a.position==="left"?(c=180,u=s):a.position==="right"?(c=180,h=180,l=o,u=s):(c=180,u=s):i.position==="top"?a.position==="left"||(a.position==="right"?(h=180,l=o):(c=180,u=s)):i.position==="left"?a.position==="bottom"?(f=-90,u=s):a.position==="top"?(f=-90,h=180):(c=180,u=s):i.position==="right"?a.position==="bottom"?(f=-90,c=180,u=s,l=o):a.position==="top"?(f=-90,c=180,h=180,l=o):(c=180,u=s):(c=180,u=s),{translate:[l,u],scale:[1,1],rotate:f,rotateX:c,rotateY:h,value:`translate(${l}px, ${u}px) rotate(${f}deg) rotateX(${c}deg) rotateY(${h}deg)`}}return new F(i=>(B({fullDataFormatter:t,layout:e}).pipe(E(n),P(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)}))},Mn=({gridAxesTransform$:t})=>t.pipe(A(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)`}})),Fn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>{const r=new L;function i({data:a,groupAxis:o,valueAxis:s,width:l,height:u}){let f=0,c=0,h=0,d=0;const p=o.position==="top"||o.position==="bottom"?l:u,g=0,_=a[0]?a[0].length-1:0,x=o.scaleDomain[0]-o.scalePadding,D=o.scaleDomain[1]==="max"?_+o.scalePadding:o.scaleDomain[1]+o.scalePadding,$=gt({maxValue:_,minValue:g,axisWidth:p,scaleDomain:[x,D],scaleRange:[0,1]}),S=$(g),T=$(_);g==_?(f=0,h=1):(f=S,h=(T-S)/p);const I=a.map((V,it)=>V.filter((wt,tt)=>tt>=x&&tt<=D&&wt.visible==!0)),R=ln(I);R[0]===R[1]&&(R[0]=R[1]-1);const N=s.position==="left"||s.position==="right"?u:l,v=gt({maxValue:R[1],minValue:R[0],axisWidth:N,scaleDomain:s.scaleDomain,scaleRange:s.scaleRange}),b=ln(a);b[0]===b[1]&&(b[0]=b[1]-1);const y=v(b[0]),C=v(b[1]);return c=y,d=(C-y)/N,{translate:[f,c],scale:[h,d],rotate:0,rotateX:0,rotateY:0,value:`translate(${f}px, ${c}px) scale(${h}, ${d})`}}return new F(a=>(B({computedData:t,fullDataFormatter:e,layout:n}).pipe(E(r),P(async o=>o)).subscribe(o=>{const s=i({data:o.computedData,groupAxis:o.fullDataFormatter.grid.groupAxis,valueAxis:o.fullDataFormatter.grid.valueAxis,width:o.layout.width,height:o.layout.height});a.next(s)}),function(){r.next(void 0)}))},Ln=({gridContainerPosition$:t,gridAxesTransform$:e,gridGraphicTransform$:n})=>B({gridContainerPosition:t,gridAxesTransform:e,gridGraphicTransform:n}).pipe(P(async r=>r),A(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]]))),On=({fullDataFormatter$:t,layout$:e})=>{const n=new L;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 F(i=>{B({fullDataFormatter:t,layout:e}).pipe(E(n),P(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)}})})},Pn=({computedData$:t})=>t.pipe(A(e=>e.filter(n=>n.length).map(n=>n[0].seriesLabel)),Q((e,n)=>JSON.stringify(e).length===JSON.stringify(n).length)),Rn=({computedData$:t})=>t.pipe(A(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Nn=({computedLayoutData$:t})=>t.pipe(A(e=>e.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),Vi=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(P(async i=>i),A(i=>{if(i.fullDataFormatter.grid.separateSeries)return Ae(i.layout,i.fullDataFormatter.container,i.computedData.length);{const a=Ae(i.layout,i.fullDataFormatter.container,1);return i.computedData.map((o,s)=>a[0])}})),In=({isSeriesSeprate$:t,computedData$:e})=>{const n=e.pipe(A(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((o,s)=>r.reduce((l,u)=>{if(u&&u[s]){const f=u[s].value==null||u[s].visible==!1?0:u[s].value;return l+f}return l},0));return r.map((o,s)=>o.map((l,u)=>({...l,value:i[u]})))}));return t.pipe(P(r=>Fi(()=>r,e,n)))},Bi=({fullDataFormatter$:t,computedData$:e,layout$:n,fullChartParams$:r,event$:i})=>{const a=new L,o=jt({datumList$:e.pipe(A(l=>l.flat().flat()),w(1)),fullChartParams$:r,event$:i}).pipe(w(1)),s=kn({computedData$:e,fullDataFormatter$:t,layout$:n}).pipe(w(1));return B({fullDataFormatter:t,computedData:e,multiGridContainer:s}).pipe(P(async l=>l),A(l=>{a.next(void 0);const u=l.fullDataFormatter.gridList[0]??Pt;return l.computedData.map((f,c)=>{const h=l.fullDataFormatter.gridList[c]??u,d={type:"grid",visibleFilter:l.fullDataFormatter.visibleFilter,grid:{...h},container:{...l.fullDataFormatter.container}},p=mt(d).pipe(E(a),w(1)),g=mt(f).pipe(E(a),w(1)),_=p.pipe(A(it=>it.grid.separateSeries),Q(),w(1)),x=mt(l.multiGridContainer[c]).pipe(E(a),w(1)),D=En({fullDataFormatter$:p,layout$:n}).pipe(E(a),w(1)),$=Mn({gridAxesTransform$:D}).pipe(E(a),w(1)),S=Fn({computedData$:g,fullDataFormatter$:p,layout$:n}).pipe(E(a),w(1)),T=Ln({gridContainerPosition$:x,gridAxesTransform$:D,gridGraphicTransform$:S}),I=On({fullDataFormatter$:p,layout$:n}).pipe(E(a),w(1)),R=g.pipe(A(it=>it.flat())).pipe(E(a),w(1)),N=Pn({computedData$:g}).pipe(E(a),w(1)),v=Ce({datumList$:R}).pipe(E(a),w(1)),b=Sn({datumList$:R}).pipe(E(a),w(1)),y=Rn({computedData$:g}).pipe(E(a),w(1)),C=Cn({computedData$:g,fullDataFormatter$:p,layout$:n}).pipe(E(a),w(1)),M=Nn({computedLayoutData$:C}).pipe(E(a),w(1)),V=In({computedData$:g,isSeriesSeprate$:_}).pipe(w(1));return{isSeriesSeprate$:_,gridContainerPosition$:x,gridAxesTransform$:D,gridAxesReverseTransform$:$,gridGraphicTransform$:S,gridGraphicReverseScale$:T,gridAxesSize$:I,gridHighlight$:o,seriesLabels$:N,SeriesDataMap$:v,GroupDataMap$:b,dataFormatter$:p,computedData$:g,computedLayoutData$:C,visibleComputedData$:y,visibleComputedLayoutData$:M,computedStackedData$:V}})}))},kn=({computedData$:t,fullDataFormatter$:e,layout$:n})=>B({computedData:t,fullDataFormatter:e,layout:n}).pipe(P(async r=>r),A(r=>{const i=r.fullDataFormatter.gridList[0]??Pt,a=r.computedData.reduce((u,f,c)=>{const d=(r.fullDataFormatter.gridList[c]??i).separateSeries?f.length:r.fullDataFormatter.separateGrid?1:0;return u+d},0)||1,o=Ae(r.layout,r.fullDataFormatter.container,a);let s=0;return r.computedData.map((u,f)=>{const c=r.fullDataFormatter.gridList[f]??i,h=u.map((d,p)=>{const g=o[s];return c.separateSeries&&(s+=1),g});return!c.separateSeries&&r.fullDataFormatter.separateGrid&&(s+=1),h})})),Ui=({computedData$:t})=>t.pipe(A(e=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(a=>{r=n(r,a)}),r}return n([],e)})),zi=({nodeList$:t,fullDataFormatter$:e})=>{const n=e.pipe(A(r=>r.categoryLabels),Q((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length));return B({nodeList:t,categoryLabels:n}).pipe(P(async r=>r),A(r=>{const i=new Set(r.categoryLabels),a=new Set(r.nodeList.filter(o=>o.visible).map(o=>o.categoryLabel));return Array.from(a).forEach(o=>{i.has(o)||i.add(o)}),Array.from(i).forEach(o=>{a.has(o)||a.delete(o)}),Array.from(i)}),Q((r,i)=>JSON.stringify(r).length===JSON.stringify(i).length))},Hi=({computedData$:t})=>t.pipe(A(e=>{function n(r){return r.children&&(r.children=r.children.filter(i=>i.visible).map(i=>n(i))),r}return n(e)}));function Kt(t){return`[OrbCharts warn]: ${t.message}`}function yt({columnName:t,expectToBe:e,from:n}){return`Invalid value: '${t}' must be '${e}'
|
4
|
+
|
5
|
+
----> find in '${n}'`}function vt({columnName:t,expectToBe:e,from:n}){return`Value is not correct: '${t}' suppose to be '${e}', it may cause unexpected errors.'
|
6
|
+
|
7
|
+
----> find in '${n}'`}function vc(t,e){const n={string:a=>typeof a=="string",number:a=>typeof a=="number",boolean:a=>typeof a=="boolean",object:a=>X(a),"object[]":a=>Array.isArray(a)&&a.every(o=>X(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=>Wr(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:l,test:u}=o;if(u(s)===!1)return!0}else if(o.toBeOption){const l=o.toBeOption;if(r[l](s)===!1)return!0}}return!1})}function rt(t,e){const n=vc(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:""}}function bc(t){return t?rt(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 wc(t){return rt({element:t},{element:{toBe:"Dom",test:n=>jr(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=rt(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=rt(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=rt(e.colors,{light:{toBeTypes:["object"]},dark:{toBeTypes:["object"]}});if(i.status==="error")return i;if(e.colors.light){const a=rt(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=rt(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 xc(t,e){return rt({pluginEntities:e},{pluginEntities:{toBe:`PluginEntity<'${t}'>[]`,test:r=>Array.isArray(r)&&r.every(i=>i.chartType===t||i.chartType==="noneData")}})}function Xi(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 Dc=({defaultDataFormatter:t,dataFormatterValidator:e,computedDataFn:n,dataValidator:r,contextObserverCallback:i})=>{const a=new L,o=t.type;return function(l,u){try{const{status:v,columnName:b,expectToBe:y}=bc(u);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:M,expectToBe:V}=wc(l);if(C==="error")throw new Error(yt({columnName:M,expectToBe:V,from:"Chart.constructor"}));C==="warning"&&console.warn(vt({columnName:M,expectToBe:V,from:"Chart.constructor"}))}}catch(v){throw new Error(v)}ie(l).selectAll("svg").remove();const f=ie(l).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 L,dataFormatter$:new L,plugins$:new L,chartParams$:new L,event$:new L},p=(v=>{const b=v||ot,y=b.preset?b.preset:{};return{name:y.name??"",description:y.description??"",chartParams:y.chartParams?st(y.chartParams,Fe):Fe,dataFormatter:y.dataFormatter?Xi(y.dataFormatter,t,o):t,allPluginParams:y.allPluginParams?y.allPluginParams:{}}})(u),g=d.data$.pipe(w(1)),_=d.dataFormatter$.pipe(E(a),$n({}),A(v=>{try{const{status:b,columnName:y,expectToBe:C}=e(v);if(b==="error")throw new Error(yt({columnName:y,expectToBe:C,from:"Chart.constructor"}));return b==="warning"&&console.warn(vt({columnName:y,expectToBe:C,from:"Chart.constructor"})),Xi(v,p.dataFormatter,o)}catch(b){throw new Error(b)}}),Wt(v=>(console.error(Kt(v)),Mt)),w(1)),x=d.chartParams$.pipe(E(a),$n({}),A(v=>{try{const{status:b,columnName:y,expectToBe:C}=_c(o,v);if(b==="error")throw new Error(yt({columnName:y,expectToBe:C,from:"Chart.constructor"}));return b==="warning"&&console.warn(vt({columnName:y,expectToBe:C,from:"Chart.constructor"})),st(v,p.chartParams)}catch(b){throw new Error(b)}}),Wt(v=>(console.error(Kt(v)),Mt)),w(1)),D=x.pipe(E(a),$n({}),A(v=>st(v.padding??{},Me)));D.pipe(E(a),cc()).subscribe(v=>{c.attr("transform",`translate(${v.left}, ${v.top})`)}),D.subscribe(v=>{c.transition().attr("transform",`translate(${v.left}, ${v.top})`)});const $=mt({width:(u==null?void 0:u.width)??ot.width,height:(u==null?void 0:u.height)??ot.height}).pipe(P(v=>Fi(()=>v.width==="auto"||v.height==="auto",Oi(l).pipe(A(b=>({width:v.width==="auto"?b.width:v.width,height:v.height==="auto"?b.height:v.height}))),mt(v))),E(a),Dn()),S=mt().pipe(hc($.pipe(ic(250)),$.pipe(pc(250))),Q((v,b)=>JSON.stringify(v)===JSON.stringify(b)),Dn()),T=S.subscribe(),I=B({rootSize:S,mergedPadding:D}).pipe(E(a),P(async v=>{const b=v.rootSize.width>0?v.rootSize.width:Gn,y=v.rootSize.height>0?v.rootSize.height:Vn;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));I.subscribe(v=>{f.attr("width",v.rootWidth).attr("height",v.rootHeight)});const R=B({data:g,dataFormatter:_,chartParams:x}).pipe(E(a),P(async v=>v),P(v=>mt(v).pipe(A(b=>{try{const{status:y,columnName:C,expectToBe:M}=r(b.data);if(y==="error")throw new Error(yt({columnName:C,expectToBe:M,from:"Chart.constructor"}));return y==="warning"&&console.warn(vt({columnName:C,expectToBe:M,from:"Chart.constructor"})),n({data:b.data,dataFormatter:b.dataFormatter,chartParams:b.chartParams})}catch(y){throw new Error(y)}}),Wt(b=>(console.error(Kt(b)),Mt)))),w(1));R.subscribe();const N={};return d.plugins$.subscribe(v=>{try{const{status:b,columnName:y,expectToBe:C}=xc(o,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){throw new Error(b)}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,M)=>{const V={fullParams$:new F,fullChartParams$:x,fullDataFormatter$:_,computedData$:R,layout$:I},it=i({observer:V,subject:d}),tt={selection:ie(M[C]),rootSelection:f,name:y.name,chartType:o,subject:d,observer:it};y.setPresetParams(p.allPluginParams[y.name]??{}),y.setContext(tt),N[tt.name]=y,y.init()}),b=>b,b=>b.each((y,C,M)=>{N[y.name]&&(N[y.name].destroy(),N[y.name]=void 0)}).remove()).sort((b,y)=>b.layerIndex-y.layerIndex)}),{...d,selection:f,destroy(){ie(l).selectAll("svg").remove(),a.next(void 0),T.unsubscribe()}}}};class Ot{constructor({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a},o,s){this.data$=new L,this.dataFormatter$=new L,this.plugins$=new L,this.chartParams$=new L,this.event$=new L;try{const u=Dc({defaultDataFormatter:e,dataFormatterValidator:n,computedDataFn:r,dataValidator:i,contextObserverCallback:a})(o,s);this.selection=u.selection,this.destroy=u.destroy,this.data$=u.data$,this.dataFormatter$=u.dataFormatter$,this.plugins$=u.plugins$,this.chartParams$=u.chartParams$,this.event$=u.event$}catch(l){console.error(Kt(l))}}}class Ac extends Ot{constructor(e,n){super({defaultDataFormatter:Le,dataFormatterValidator:Qi,computedDataFn:al,dataValidator:ol,contextObserverCallback:mc},e,n)}}const $c=t=>({status:"success",message:""});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 l=Object.assign([],o);for(let u=l.length;u<n;u++)l[u]=null;return l}).map((o,s)=>o.map((l,u)=>l==null?{id:"",label:"",data:{},value:null}:typeof l=="number"?{id:"",label:"",data:{},value:l}:{id:l.id??"",label:l.label??"",data:l.data??{},value:l.value}));return Qr(e.seriesDirection,i)}catch{return[]}}const Sc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i;try{const a=qi(e,n.grid),o=un({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"}),s=Kr({transposedDataGrid:a,dataFormatterGrid:n.grid,chartType:"grid"});let l=0;i=a.map((u,f)=>u.map((c,h)=>{const d=Ht("grid",0,f,h),p=s[h],g={id:c.id?c.id:d,index:l,label:c.label?c.label:d,description:c.description??"",data:c.data,value:c.value,gridIndex:0,seriesIndex:f,seriesLabel:o[f],groupIndex:h,groupLabel:p,color:Xt(f,r),visible:!0};return g.visible=n.visibleFilter(g,t),l++,g}))}catch(a){throw Error(a)}return i},Tc=t=>({status:"success",message:""}),Cc=({subject:t,observer:e})=>{const n=Jt(e.fullChartParams$).pipe(w(1)),r=e.fullDataFormatter$.pipe(A($=>$.grid.separateSeries),Q(),w(1)),i=Vi({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}),a=En({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),o=Mn({gridAxesTransform$:a}).pipe(w(1)),s=Fn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),l=Ln({gridContainerPosition$:i,gridAxesTransform$:a,gridGraphicTransform$:s}),u=On({fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),f=e.computedData$.pipe(A($=>$.flat())).pipe(w(1)),c=jt({datumList$:f,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),h=Pn({computedData$:e.computedData$}),d=Ce({datumList$:f}).pipe(w(1)),p=Sn({datumList$:f}).pipe(w(1)),g=Cn({computedData$:e.computedData$,fullDataFormatter$:e.fullDataFormatter$,layout$:e.layout$}).pipe(w(1)),_=Rn({computedData$:e.computedData$}).pipe(w(1)),x=Nn({computedLayoutData$:g}).pipe(w(1)),D=In({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$:a,gridAxesReverseTransform$:o,gridGraphicTransform$:s,gridGraphicReverseScale$:l,gridAxesSize$:u,gridHighlight$:c,seriesLabels$:h,SeriesDataMap$:d,GroupDataMap$:p,computedLayoutData$:g,visibleComputedData$:_,visibleComputedLayoutData$:x,computedStackedData$:D}};class Ec extends Ot{constructor(e,n){super({defaultDataFormatter:Pe,dataFormatterValidator:$c,computedDataFn:Sc,dataValidator:Tc,contextObserverCallback:Cc},e,n)}}const Mc=t=>({status:"success",message:""}),Fc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t;if(!e.length)return[];let i=[];try{const a=n.gridList[0]||Pt,o=e.map((c,h)=>n.gridList[h]||a),s=e.map((c,h)=>qi(c,o[h])),l=n.separateGrid?s.map((c,h)=>un({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid"})):s.map((c,h)=>Jr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h})),u=new Map;let f=0;l.flat().forEach((c,h)=>{if(!u.has(c)){const d=Xt(f,r);u.set(c,d),f++}}),i=s.map((c,h)=>{const d=l[h],p=Zr({transposedDataGrid:c,dataFormatterGrid:o[h],chartType:"multiGrid",gridIndex:h});let g=0;return c.map((x,D)=>x.map(($,S)=>{const T=Ht("multiGrid",h,D,S),I=p[S],R=d[D],N={id:$.id?$.id:T,index:g,label:$.label?$.label:T,description:$.description??"",data:$.data,value:$.value,gridIndex:h,seriesIndex:D,seriesLabel:R,groupIndex:S,groupLabel:I,color:u.get(R),visible:!0};return N.visible=n.visibleFilter(N,t),g++,N}))})}catch(a){throw Error(a)}return i},Lc=t=>({status:"success",message:""}),Oc=({subject:t,observer:e})=>{const n=Jt(e.fullChartParams$).pipe(w(1)),r=Bi({fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),i=kn({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 Pc extends Ot{constructor(e,n){super({defaultDataFormatter:Re,dataFormatterValidator:Mc,computedDataFn:Fc,dataValidator:Lc,contextObserverCallback:Oc},e,n)}}const Rc=t=>({status:"success",message:""}),Nc=t=>{const{data:e,dataFormatter:n,chartParams:r}=t;if(!e.length)return[];const i={width:1e3,height:1e3};let a=[];try{const o=e.map((D,$)=>D.map((S,T)=>typeof S=="number"?{id:"",label:"",description:"",data:{},categoryLabel:"",value:S}:{id:S.id??"",label:S.label??"",description:S.description??"",data:S.data??{},categoryLabel:S.categoryLabel??"",value:S.value})),[s,l]=De(o.map(D=>D[0])),[u,f]=De(o.map(D=>D[1])),c=n.xAxis.position==="top"||n.xAxis.position==="bottom"?i.width:i.height,h=n.yAxis.position==="left"||n.yAxis.position==="right"?i.height:i.width,d=gt({maxValue:l,minValue:s,axisWidth:c,scaleDomain:[s,l],scaleRange:[0,1]}),p=gt({maxValue:f,minValue:u,axisWidth:h,scaleDomain:[u,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"?l>=0?l:0:n.xAxis.scaleDomain[1]==="max"?l: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"?l>=0?l:0:n.yAxis.scaleDomain[1]==="max"?l:n.yAxis.scaleDomain[1]];let x=0;a=o.map((D,$)=>D.map((S,T)=>{const I=x;x++;const R=Ht(n.type,$,T),N={id:S.id?S.id:R,index:I,label:S.label?S.label:R,description:S.description??"",data:S.data,value:S.value,categoryIndex:0,categoryLabel:"",axis:T==0?d(S.value):p(S.value),visible:!0,color:""};return N.visible=n.visibleFilter(N,t),N}))}catch(o){throw Error(o)}return a},Ic=t=>({status:"success",message:""}),kc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Gc extends Ot{constructor(e,n){super({defaultDataFormatter:Ne,dataFormatterValidator:Rc,computedDataFn:Nc,dataValidator:Ic,contextObserverCallback:kc},e,n)}}const Vc=t=>({status:"success",message:""}),Bc=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 l=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??{},value:c.value??0,startNode:l.get(c.start),startNodeId:c.start,endNode:l.get(c.end),endNodeId:c.end,visible:!0}));const u=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.endNodeId)??[];d.push(h.startNode),c.set(h.endNodeId,d)}),c}(),f=function(){const c=new Map;return a.forEach(h=>{const d=c.get(h.startNodeId)??[];d.push(h.endNode),c.set(h.startNodeId,d)}),c}();Array.from(l).forEach(([c,h])=>{h.startNodes=u.get(c),h.startNodeIds=h.startNodes.map(d=>d.id),h.endNodes=f.get(c),h.endNodeIds=h.endNodes.map(d=>d.id),h.visible=n.visibleFilter(h,t)}),a=a.map(c=>(c.visible=!!(c.startNode.visible&&c.endNode.visible),c))}catch(o){throw Error(o)}return{nodes:i,edges:a}},Uc=t=>({status:"success",message:""}),zc=({subject:t,observer:e})=>({fullParams$:e.fullParams$,fullChartParams$:e.fullChartParams$,fullDataFormatter$:e.fullDataFormatter$,computedData$:e.computedData$,layout$:e.layout$});class Hc extends Ot{constructor(e,n){super({defaultDataFormatter:ke,dataFormatterValidator:Vc,computedDataFn:Bc,dataValidator:Uc,contextObserverCallback:zc},e,n)}}const Xc=t=>({status:"success",message:""}),qc=t=>{const{data:e=[],dataFormatter:n,chartParams:r}=t,i=new Map(n.categoryLabels.map((o,s)=>[o,s]));let a={id:"",index:0,label:"",description:"",categoryIndex:0,categoryLabel:"",color:"",visible:!0,data:{},value:0,level:0,seq:0,children:[]};try{const o=function(){if(X(e)===!0)return JSON.parse(JSON.stringify(e));if(Array.isArray(e)===!1)return{id:""};let u;const f=new Map;e.forEach(h=>{if(!h.parent)u=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 u?c(u):{id:""}}();let s=0;const l=(u,f,c)=>{const h=f+1,d=u.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:u.id,index:g,level:f,seq:c,label:u.label??"",description:u.description??"",categoryIndex:p,categoryLabel:d,color:Xt(p,r),data:u.data??{},value:u.value,visible:!0,children:(u.children??[]).map((x,D)=>l(x,h,D))};return _.visible=n.visibleFilter(_,t),_};a=l(o,0,0)}catch(o){throw Error(o)}return a},Yc=t=>({status:"success",message:""}),Wc=({subject:t,observer:e})=>{const n=Jt(e.fullChartParams$).pipe(w(1)),r=Ui({computedData$:e.computedData$}).pipe(w(1)),i=jt({datumList$:r,fullChartParams$:e.fullChartParams$,event$:t.event$}).pipe(w(1)),a=zi({nodeList$:r,fullDataFormatter$:e.fullDataFormatter$}).pipe(w(1)),o=Pi({datumList$:r}).pipe(w(1)),s=Hi({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$:a,CategoryDataMap$:o,visibleComputedData$:s}};class jc extends Ot{constructor(e,n){super({defaultDataFormatter:Ie,dataFormatterValidator:Xc,computedDataFn:qc,dataValidator:Yc,contextObserverCallback:Wc},e,n)}}function Jc({chartType:t,config:e,initFn:n}){const r=new L,i=new WeakMap;let a=()=>{},o;const s=new ci(e.defaultParams),l=new ci({}),u=s.pipe(P(f=>l.pipe(E(r),A(c=>{try{const{status:h,columnName:d,expectToBe:p}=e.validator(c,{validateColumns:rt});if(h==="error")throw new Error(yt({columnName:d,expectToBe:p,from:"Chart.constructor"}));return h==="warning"&&console.warn(vt({columnName:d,expectToBe:p,from:"Chart.constructor"})),st(c,f)}catch(h){throw new Error(h.message)}}),Wt(c=>(console.error(Kt(c)),Mt)))),w(1));return{params$:l,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$=u}}}const bt=t=>function(n){return function(i){return class{constructor(){const o=Jc({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}}}},Kc=bt("series"),Zc=bt("grid"),Qc=bt("multiGrid"),tf=bt("multiValue"),ef=bt("noneData"),nf=bt("relationship"),rf=bt("tree");m.CHART_HEIGHT_DEFAULT=Vn,m.CHART_OPTIONS_DEFAULT=ot,m.CHART_PARAMS_DEFAULT=Fe,m.CHART_WIDTH_DEFAULT=Gn,m.DATA_FORMATTER_CONTAINER_DEFAULT=Zt,m.DATA_FORMATTER_GRID_DEFAULT=Pe,m.DATA_FORMATTER_GRID_GRID_DEFAULT=Oe,m.DATA_FORMATTER_GROUP_AXIS_DEFAULT=Bn,m.DATA_FORMATTER_MULTI_GRID_DEFAULT=Re,m.DATA_FORMATTER_MULTI_GRID_GRID_DEFAULT=Pt,m.DATA_FORMATTER_MULTI_VALUE_DEFAULT=Ne,m.DATA_FORMATTER_RELATIONAL_DEFAULT=ke,m.DATA_FORMATTER_SERIES_DEFAULT=Le,m.DATA_FORMATTER_TREE_DEFAULT=Ie,m.DATA_FORMATTER_VALUE_AXIS_DEFAULT=j,m.DATA_GRID_DEFAULT=Wi,m.DATA_MULTI_GRID_DEFAULT=ji,m.DATA_MULTI_VALUE_DEFAULT=Ji,m.DATA_RELATIONA_DEFAULTL=Zi,m.DATA_SERIES_DEFAULT=Yi,m.DATA_TREE_DEFAULT=Ki,m.GridChart=Ec,m.MultiGridChart=Pc,m.MultiValueChart=Gc,m.PADDING_DEFAULT=Me,m.RelationshipChart=Hc,m.SeriesChart=Ac,m.TreeChart=jc,m.calcGridContainerLayout=Ae,m.calcSeriesContainerLayout=cn,m.categoryDataMapObservable=Pi,m.computedStackedDataObservables=In,m.createAxisLinearScale=gt,m.createAxisPointScale=gc,m.createAxisQuantizeScale=yc,m.createDefaultDatumId=Ht,m.createDefaultGroupLabel=sn,m.createDefaultSeriesLabel=xe,m.createGridGroupLabels=Kr,m.createGridSeriesLabels=un,m.createMultiGridGroupLabels=Zr,m.createMultiGridSeriesLabels=Jr,m.defineGridPlugin=Zc,m.defineMultiGridPlugin=Qc,m.defineMultiValuePlugin=tf,m.defineNoneDataPlugin=ef,m.defineRelationshipPlugin=nf,m.defineSeriesPlugin=Kc,m.defineTreePlugin=rf,m.existCategoryLabelsObservable=zi,m.formatCommaNumber=tl,m.formatValueToLabel=el,m.getMinAndMax=St,m.getMinAndMaxGrid=ln,m.getMinAndMaxMultiGrid=rl,m.getMinAndMaxMultiValue=il,m.getMinAndMaxSeries=nl,m.getMinAndMaxValue=De,m.gridAxesReverseTransformObservable=Mn,m.gridAxesSizeObservable=On,m.gridAxesTransformObservable=En,m.gridComputedLayoutDataObservable=Cn,m.gridContainerPositionObservable=Vi,m.gridGraphicReverseScaleObservable=Ln,m.gridGraphicTransformObservable=Fn,m.gridSeriesLabelsObservable=Pn,m.gridVisibleComputedDataObservable=Rn,m.gridVisibleComputedLayoutDataObservable=Nn,m.groupDataMapObservable=Sn,m.highlightObservable=jt,m.isDom=jr,m.isFunction=Wr,m.isPlainObject=X,m.mergeOptionsWithDefault=st,m.multiGridContainerObservable=kn,m.multiGridEachDetailObservable=Bi,m.nodeListObservable=Ui,m.resizeObservable=Oi,m.separateSeriesObservable=Ri,m.seriesColorPredicate=Xt,m.seriesComputedLayoutDataObservable=Ii,m.seriesContainerPositionMapObservable=Gi,m.seriesContainerPositionObservable=ki,m.seriesDataMapObservable=Ce,m.seriesLabelsObservable=Ni,m.seriesVisibleComputedDataObservable=Tn,m.textSizePxObservable=Jt,m.transposeData=Qr,m.treeVisibleComputedDataObservable=Hi,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|