@ytsaurus/ui 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/public/build/assets-manifest.json +39 -39
  2. package/dist/public/build/css/{9030.30b67fe6.chunk.css → 3792.a5336147.chunk.css} +1 -1
  3. package/dist/public/build/css/{9030.30b67fe6.chunk.css.map → 3792.a5336147.chunk.css.map} +1 -1
  4. package/dist/public/build/js/2142.9a9a44af.chunk.js +2 -0
  5. package/dist/public/build/js/2142.9a9a44af.chunk.js.map +1 -0
  6. package/dist/public/build/js/3225.0ca5646d.chunk.js +2 -0
  7. package/dist/public/build/js/3225.0ca5646d.chunk.js.map +1 -0
  8. package/dist/public/build/js/{9030.200c7642.chunk.js → 3792.1af8dc36.chunk.js} +2 -2
  9. package/dist/public/build/js/{9030.200c7642.chunk.js.map → 3792.1af8dc36.chunk.js.map} +1 -1
  10. package/dist/public/build/js/3848.db687afa.chunk.js +2 -0
  11. package/dist/public/build/js/3848.db687afa.chunk.js.map +1 -0
  12. package/dist/public/build/js/{9361.f5606246.chunk.js → 9361.632ac658.chunk.js} +3 -3
  13. package/dist/public/build/js/9361.632ac658.chunk.js.map +1 -0
  14. package/dist/public/build/js/acl.86dde5b4.chunk.js +2 -0
  15. package/dist/public/build/js/acl.86dde5b4.chunk.js.map +1 -0
  16. package/dist/public/build/js/{chart-kit.6c826f92.chunk.js → chart-kit.bc706a72.chunk.js} +2 -2
  17. package/dist/public/build/js/{chart-kit.6c826f92.chunk.js.map → chart-kit.bc706a72.chunk.js.map} +1 -1
  18. package/dist/public/build/js/{cluster-page-wrapper.24759f54.chunk.js → cluster-page-wrapper.69410672.chunk.js} +2 -2
  19. package/dist/public/build/js/{cluster-page-wrapper.24759f54.chunk.js.map → cluster-page-wrapper.69410672.chunk.js.map} +1 -1
  20. package/dist/public/build/js/{dashboard.5baf76be.chunk.js → dashboard.705aef5e.chunk.js} +2 -2
  21. package/dist/public/build/js/{dashboard.5baf76be.chunk.js.map → dashboard.705aef5e.chunk.js.map} +1 -1
  22. package/dist/public/build/js/{incarnations.db35d3e7.chunk.js → incarnations.b6c8305d.chunk.js} +2 -2
  23. package/dist/public/build/js/incarnations.b6c8305d.chunk.js.map +1 -0
  24. package/dist/public/build/js/main.2691b74a.js +3 -0
  25. package/dist/public/build/js/main.2691b74a.js.map +1 -0
  26. package/dist/public/build/js/navigation.b95d53a4.chunk.js +2 -0
  27. package/dist/public/build/js/navigation.b95d53a4.chunk.js.map +1 -0
  28. package/dist/public/build/js/{runtime.0bd241cc.js → runtime.cd2507d5.js} +2 -2
  29. package/dist/public/build/js/{runtime.0bd241cc.js.map → runtime.cd2507d5.js.map} +1 -1
  30. package/dist/public/build/js/settings-panel.5508764a.chunk.js +2 -0
  31. package/dist/public/build/js/settings-panel.5508764a.chunk.js.map +1 -0
  32. package/dist/public/build/js/{yt-df-dialog.3c75c1c6.chunk.js → yt-df-dialog.d8b77493.chunk.js} +3 -3
  33. package/dist/public/build/js/yt-df-dialog.d8b77493.chunk.js.map +1 -0
  34. package/dist/public/build/js/yt-queries-list.9b028808.chunk.js +2 -0
  35. package/dist/public/build/js/yt-queries-list.9b028808.chunk.js.map +1 -0
  36. package/dist/public/build/manifest.json +34 -34
  37. package/package.json +2 -2
  38. package/dist/public/build/js/2142.e3f4501e.chunk.js +0 -2
  39. package/dist/public/build/js/2142.e3f4501e.chunk.js.map +0 -1
  40. package/dist/public/build/js/3225.1bafd8e7.chunk.js +0 -2
  41. package/dist/public/build/js/3225.1bafd8e7.chunk.js.map +0 -1
  42. package/dist/public/build/js/3792.87728e87.chunk.js +0 -2
  43. package/dist/public/build/js/3792.87728e87.chunk.js.map +0 -1
  44. package/dist/public/build/js/9361.f5606246.chunk.js.map +0 -1
  45. package/dist/public/build/js/acl.ad72cb19.chunk.js +0 -2
  46. package/dist/public/build/js/acl.ad72cb19.chunk.js.map +0 -1
  47. package/dist/public/build/js/incarnations.db35d3e7.chunk.js.map +0 -1
  48. package/dist/public/build/js/main.10db4a06.js +0 -3
  49. package/dist/public/build/js/main.10db4a06.js.map +0 -1
  50. package/dist/public/build/js/navigation.dd0f8fc8.chunk.js +0 -2
  51. package/dist/public/build/js/navigation.dd0f8fc8.chunk.js.map +0 -1
  52. package/dist/public/build/js/settings-panel.4be91fef.chunk.js +0 -2
  53. package/dist/public/build/js/settings-panel.4be91fef.chunk.js.map +0 -1
  54. package/dist/public/build/js/yt-df-dialog.3c75c1c6.chunk.js.map +0 -1
  55. package/dist/public/build/js/yt-queries-list.e40d766e.chunk.js +0 -2
  56. package/dist/public/build/js/yt-queries-list.e40d766e.chunk.js.map +0 -1
  57. /package/dist/public/build/js/{9361.f5606246.chunk.js.LICENSE.txt → 9361.632ac658.chunk.js.LICENSE.txt} +0 -0
  58. /package/dist/public/build/js/{main.10db4a06.js.LICENSE.txt → main.2691b74a.js.LICENSE.txt} +0 -0
  59. /package/dist/public/build/js/{yt-df-dialog.3c75c1c6.chunk.js.LICENSE.txt → yt-df-dialog.d8b77493.chunk.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[9030],{3792:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ri});var n=a(77810),i=a(13934),r=a(24503),s=a.n(r),l=a(50326);const o=JSON.parse('{"error":{"label_no-data":"No data","label_unknown-plugin":"Unknown plugin type \\"{{type}}\\"","label_unknown-error":"Unknown error","label_invalid-axis-category-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"category\\". Strings and numbers are allowed.","label_invalid-axis-datetime-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"datetime\\". Only numbers are allowed.","label_invalid-axis-linear-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"linear\\". Numbers and nulls are allowed.","label_invalid-pie-data-value":"It seems you are trying to use inappropriate data type for \\"value\\" value. Only numbers are allowed.","label_invalid-series-type":"It seems you haven\'t defined \\"series.type\\" property, or defined it incorrectly. Available values: [{{types}}].","label_invalid-series-property":"It seems you are trying to use inappropriate value for \\"{{key}}\\", or defined it incorrectly. Available values: [{{values}}].","label_invalid-treemap-redundant-value":"It seems you are trying to set \\"value\\" for container node. Check node with this properties: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-treemap-missing-value":"It seems you are trying to use node without \\"value\\". Check node with this properties: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-y-axis-index":"It seems you are trying to use inappropriate index for Y axis: \\"{{index}}\\""}}'),c=JSON.parse('{"error":{"label_no-data":"Нет данных","label_unknown-plugin":"Неизвестный тип плагина \\"{{type}}\\"","label_unknown-error":"Неизвестная ошибка","label_invalid-axis-category-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"category\\". Допускается использование строк и чисел.","label_invalid-axis-datetime-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"datetime\\". Допускается только использование чисел.","label_invalid-axis-linear-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"linear\\". Допускается использование чисел и значений null.","label_invalid-pie-data-value":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"value\\". Допускается только использование чисел.","label_invalid-series-type":"Похоже, что вы не указали значение \\"series.type\\" или указали его неверно. Доступные значения: [{{types}}].","label_invalid-series-property":"Похоже, что вы пытаетесь использовать недопустимое значение для \\"{{key}}\\", или указали его неверно. Доступные значения: [{{values}}].","label_invalid-treemap-redundant-value":"Похоже, что вы пытаетесь установить значение \\"value\\" для узла, используемого в качестве контейнера. Проверьте узел с этими свойствами: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-treemap-missing-value":"Похоже, что вы пытаетесь использовать узел без значения \\"value\\". Проверьте узел с этими свойствами: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-y-axis-index":"Похоже, что вы пытаетесь использовать некорректный индекс для оси Y: \\"{{index}}\\""}}'),d=new l.TH;d.registerKeysets("en",o),d.registerKeysets("ru",c),d.setLang("en"),d.setFallbackLang("en");const u=d.i18n.bind(d);function h(){return`gravity-chart.${function(e,t){let a="";for(let e=5;e>0;--e)a+=t[Math.floor(36*Math.random())];return a}(0,"0123456789abcdefghijklmnopqrstuvwxyz")}`}var p=a(81214),m=a.n(p),g=a(96843),f=a.n(g);const y={Area:"area",BarX:"bar-x",BarY:"bar-y",Line:"line",Pie:"pie",Scatter:"scatter",Treemap:"treemap",Waterfall:"waterfall",Sankey:"sankey"};var v,b,x,w;!function(e){e.Dash="Dash",e.DashDot="DashDot",e.Dot="Dot",e.LongDash="LongDash",e.LongDashDot="LongDashDot",e.LongDashDotDot="LongDashDotDot",e.ShortDash="ShortDash",e.ShortDashDot="ShortDashDot",e.ShortDashDotDot="ShortDashDotDot",e.ShortDot="ShortDot",e.Solid="Solid"}(v||(v={})),function(e){e.Circle="circle",e.Diamond="diamond",e.Square="square",e.Triangle="triangle",e.TriangleDown="triangle-down"}(b||(b={})),function(e){e.Butt="butt",e.Round="round",e.Square="square",e.None="none"}(x||(x={})),function(e){e.Binary="binary",e.Dice="dice",e.Slice="slice",e.SliceDice="slice-dice",e.Squarify="squarify"}(w||(w={}));const k=["#4DA2F1","#FF3D64","#8AD554","#FFC636","#FFB9DD","#84D1EE","#FF91A1","#54A520","#DB9100","#BA74B3","#1F68A9","#ED65A9","#0FA08D","#FF7E00","#E8B0A4","#52A6C5","#BE2443","#70C1AF","#FFB46C","#DCA3D7"],S="11px",L={text:"",margin:0,style:{fontSize:"14px"},align:"center",maxRowCount:1},A=Object.assign(Object.assign({},L),{margin:4}),E=Object.assign(Object.assign({},L),{margin:8}),M="linear",z="ERR.CK.INVALID_DATA";class C extends Error{constructor({originalError:e,message:t,code:a="ERR.CK.UNKNOWN_ERROR"}={}){super(t),this.isCustomError=!0,this.code=a,e&&(this.name=e.name,this.stack=e.stack)}}const R=Object.values(y),O=e=>{const{series:t,xAxis:a,yAxis:n=[]}=e,i=m()(t,"yAxis",0),r=n[i];if(0!==i&&void 0===r)throw new C({code:z,message:u("error","label_invalid-y-axis-index",{index:i})});const s=m()(a,"type",M),l=m()(r,"type",M);t.data.forEach((({x:e,y:a})=>{switch(s){case"category":if("string"!=typeof e&&"number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-axis-category-data-point",{key:"x",seriesName:t.name})});break;case"datetime":if("number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-axis-datetime-data-point",{key:"x",seriesName:t.name})});break;case"linear":if("number"!=typeof e&&null!==e)throw new C({code:z,message:u("error","label_invalid-axis-linear-data-point",{key:"x",seriesName:t.name})})}switch(l){case"category":if("string"!=typeof a&&"number"!=typeof a)throw new C({code:z,message:u("error","label_invalid-axis-category-data-point",{key:"y",seriesName:t.name})});break;case"datetime":if("number"!=typeof a)throw new C({code:z,message:u("error","label_invalid-axis-datetime-data-point",{key:"y",seriesName:t.name})});break;case"linear":if("number"!=typeof a&&null!==a)throw new C({code:z,message:u("error","label_invalid-axis-linear-data-point",{key:"y",seriesName:t.name})})}}))};var W=a(29717);(0,W.withNaming)({e:"__",m:"_"});const D=(0,W.withNaming)({n:"gcharts-",e:"__",m:"_"}),_="click-chart",N="hover-shape",j="pointermove-chart";var H=a(45041),T=a.n(H);const I=e=>{const{value:t="",base:a}=e;if(!T()(t))return"string"==typeof t?((e="")=>e.endsWith("%")&&!Number.isNaN(Number.parseFloat(e)))(t)&&"number"==typeof a?a*(Number.parseFloat(t)/100):((e="")=>e.endsWith("px")&&!Number.isNaN(Number.parseFloat(e)))(t)?Number.parseFloat(t):void 0:t};function P(e,t=2){const a=Math.pow(10,t);return Math.floor(Math.cos(Math.PI/180*e)*a)/a}function B(e,t=2){const a=Math.pow(10,t);return Math.floor(Math.sin(Math.PI/180*e)*a)/a}var $=a(26116),F=a(61894);const Y=8,K=5,U={fontSize:"11px",fontWeight:"bold",fontColor:"var(--d3-data-labels)"},J={enabled:!0,opacity:.25,size:6},X={radius:4,borderColor:"",borderWidth:0,symbol:"circle"},q=e=>e.reduce(((e,t)=>(t.legend.enabled&&t.visible&&e.push(t.name),e)),[]);function V(e,t){var a;const n=(null===(a=e.legend)||void 0===a?void 0:a.symbol)||{};return{shape:"symbol",symbolType:t||b.Circle,width:(null==n?void 0:n.width)||Y,padding:(null==n?void 0:n.padding)||K}}const G=a.n(F)()(h);function Z(e){let t=e.stackId;return t||(t=e.stacking?G():h()),t}const Q=new l.TH;Q.setLang("ru");const ee=JSON.parse('{"units":{"value_short-bytes":"B","value_short-kilobytes":"KB","value_short-megabytes":"MB","value_short-milliseconds":"ms","value_short-seconds":"s","value_short-minutes":"m","value_short-empty":"","value_short-k":"K","value_short-m":"M","value_short-b":"B","value_short-t":"T","value_space-delimiter":" ","value_number-delimiter":""}}'),te=(ae={ru:JSON.parse('{"units":{"value_short-bytes":"Б","value_short-kilobytes":"КБ","value_short-megabytes":"МБ","value_short-milliseconds":"мс","value_short-seconds":"с","value_short-minutes":"м","value_short-empty":"","value_short-k":"K","value_short-m":"M","value_short-b":"B","value_short-t":"T","value_space-delimiter":" ","value_number-delimiter":""}}'),en:ee},Object.entries(ae).forEach((([e,t])=>Q.registerKeysets(e,t))),Q.i18n.bind(Q,"units"));var ae;function ne(e,t,a){let n=1;for(;Math.abs(e/Math.pow(t,n))>=1&&n<10&&te(a[n]);)n++;return n-1}const ie=({exponent:e,unitsI18nKeys:t,unitDelimiterI18nKey:a})=>function(n,i={}){const{precision:r,unitRate:s,showRankDelimiter:l=!0,lang:o}=i,c=Q.lang;o&&Q.setLang(o);const d="number"==typeof s?s:ne(n,e,t);let u=n/Math.pow(e,d);"number"==typeof r?u=Number(u.toFixed(r)):"auto"===r&&u%1!=0&&(u=Number(u.toFixed(Math.abs(u)>1?2:4))),u=new Intl.NumberFormat(null!=o?o:c,{minimumFractionDigits:"number"==typeof r?r:0,maximumFractionDigits:20,useGrouping:l}).format(u);const h=te(t[d]),p=te(a);return Q.setLang(c),`${u}${p}${h}`},re=(ie({exponent:1024,unitDelimiterI18nKey:"value_space-delimiter",unitsI18nKeys:["value_short-bytes","value_short-kilobytes","value_short-megabytes"]}),ie({exponent:1e3,unitDelimiterI18nKey:"value_space-delimiter",unitsI18nKeys:["value_short-milliseconds","value_short-seconds","value_short-minutes"]}),["value_short-empty","value_short-k","value_short-m","value_short-b","value_short-t"]),se=ie({exponent:1e3,unitDelimiterI18nKey:"value_number-delimiter",unitsI18nKeys:re}),le=e=>ne(e,1e3,re),oe={default:0,auto:void 0,k:1,m:2,b:3,t:4},ce=(e,t={})=>{if(Number.isNaN(e)||Number.isNaN(Number(e)))return new Intl.NumberFormat("en").format(Number(e));const{format:a="number",multiplier:n=1,prefix:i="",postfix:r="",unit:s,unitRate:l,labelMode:o}=t;let c=n,d="";return"percent"===a&&(c=100,d="%"),"percent"===o&&(d="%"),`${i}${se(Number(e)*c,Object.assign(Object.assign({},t),{unitRate:null!=l?l:oe[null!=s?s:"default"]}))}${d}${r}`},de={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},ue={millisecond:"DD.MM.YY HH:mm:ss.SSS",second:"DD.MM.YY HH:mm:ss",minute:"DD.MM.YY HH:mm",hour:"DD.MM.YY HH:mm",day:"DD.MM.YY",week:"DD.MM.YY",month:"MMM 'YY",year:"YYYY"};const he=["pie","treemap","sankey"],pe=["bar-x","area","waterfall"],me=["bar-y"];function ge(e){return!he.includes(e.type)}function fe(e){return ge(e)}function ye(e){return ge(e)}function ve(e,t="x",a="y"){const n=[],r=(0,i.Os0)(e,Z);return Array.from(r).forEach((([e,i])=>{const r={};i.forEach((e=>{const n=new Map;e.data.forEach((e=>{const i=String(e[t]);let r=0;a in e&&"number"==typeof e[a]&&(r=e[a]),n.has(i)&&(r=Math.max(r,n.get(i))),n.set(i,r)})),Array.from(n).forEach((([e,t])=>{r[e]=(r[e]||0)+t}))})),n.push(...Object.values(r))})),n}const be=e=>{const t=(0,i.Os0)(e,(e=>e.type));return Array.from(t).reduce(((e,[t,a])=>("bar-y"===t?e.push(...ve(a,"y","x")):a.filter(fe).forEach((t=>{e.push(...t.data.map((e=>e.x)))})),e)),[])},xe=e=>{const t=(0,i.Os0)(e,(e=>e.type));return Array.from(t).reduce(((e,[t,a])=>{switch(t){case"area":case"bar-x":e.push(...ve(a));break;case"waterfall":{let t=0;a.forEach((a=>{a.data.forEach((a=>{t+=Number(a.y)||0,e.push(t)}))}));break}default:a.filter(ye).forEach((t=>{e.push(...t.data.map((e=>e.y)))}))}return e}),[])},we=e=>e.filter((e=>e.visible)),ke=e=>{const{axis:t,value:a,step:n}=e;switch(t.type){case"category":return a;case"datetime":{const e=a,i=t.labels.dateFormat||function(e){if(e){const t=function(e){const t=Object.keys(de),a=t.findIndex((t=>e<de[t]));return-1===a?"year":t[a-1]}(e);if(t in ue)return ue[t]}return ue.day}(n);return(0,$.KQ)({input:e}).format(i)}default:{const e=Object.assign({unitRate:a&&n?le(n):void 0},t.labels.numberFormat);return ce(a,e)}}},Se=e=>{var t;const{text:a,style:n}=e,r=(0,i.Ltv)(document.body).append("svg"),s=r.append("text").text(a),l=m()(n,"fontSize",S);l&&s.style("font-size",l).style("alignment-baseline","after-edge");const o=(null===(t=s.node())||void 0===t?void 0:t.getBoundingClientRect().height)||0;return r.remove(),o},Le=e=>{const{axisDirection:t,categories:a,data:n}=e,i=(e=>{const{axisDirection:t,categories:a,data:n}=e,i=m()(n,t);let r;if("category"in n&&n.category&&(r=n.category),"string"==typeof i&&(r=i),"number"==typeof i&&(r=a[i]),T()(r))throw new Error("It seems you are trying to get non-existing category value");return r})({axisDirection:t,categories:a,data:n});return i};function Ae(e,t){if("category"!==e.type)return t[1]-t[0]}var Ee=a(34563);function Me(e,t){var a,n,i;if(!e)return;const r=e.closest("svg");if(!r)return;const s=e.closest("text"),l=(null===(a=Array.from((null==s?void 0:s.transform.baseVal)||[]).find((e=>e.angle)))||void 0===a?void 0:a.angle)||0,o=r.createSVGTransform();o.setRotate(-l,0,0),null==s||s.transform.baseVal.appendItem(o);let c=e.textContent||"",d=(null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width)||0;for(;d>t&&c.length>1;)c=c.slice(0,-1),e.textContent=c+"…",d=(null===(i=e.getBoundingClientRect())||void 0===i?void 0:i.width)||0;null==s||s.transform.baseVal.removeItem((null==s?void 0:s.transform.baseVal.length)-1)}function ze(e,t){const a=e.text();e.text(null).append("title").text(a),Me(e.append("tspan").text(a).style("alignment-baseline","inherit").node(),t)}function Ce(e,t){e.each((function(e){const a="function"==typeof t?t(e):t;ze((0,Ee.A)(this),a)}))}function Re({labels:e,style:t,rotation:a,html:n}){var i,r,s;if(!e.filter(Boolean).length)return{maxHeight:0,maxWidth:0};const l=(0,Ee.A)(document.body).append("div"),o={maxHeight:0,maxWidth:0};let c;if(n){c=l.append("div").style("position","absolute").node();const{height:t,width:a}=e.reduce(((e,t)=>{var a,n;c&&(c.innerHTML=t);const i=null==c?void 0:c.getBoundingClientRect();return{width:Math.max(e.width,null!==(a=null==i?void 0:i.width)&&void 0!==a?a:0),height:Math.max(e.height,null!==(n=null==i?void 0:i.height)&&void 0!==n?n:0)}}),{height:0,width:0});o.maxWidth=a,o.maxHeight=t}else{const n=l.append("svg"),c=function(e,{labels:t,style:a={},attrs:n={}}){const i=e.append("g").append("text");return i.style("font-size",a.fontSize||""),i.style("font-weight",a.fontWeight||""),Object.entries(n).forEach((([e,t])=>{i.attr(e,t)})),i.selectAll("tspan").data(t).enter().append("tspan").attr("x",0).attr("dy",0).text((e=>e)),i}(n,{labels:e,style:t});a&&c.attr("text-anchor",a>0?"start":"end").style("transform",`rotate(${a}deg)`);const d=null===(i=n.select("g").node())||void 0===i?void 0:i.getBoundingClientRect();o.maxWidth=null!==(r=null==d?void 0:d.width)&&void 0!==r?r:0,o.maxHeight=null!==(s=null==d?void 0:d.height)&&void 0!==s?s:0}return l.remove(),o}function Oe(e){const{text:t,style:a,width:n}=e,i=Re({labels:[t],style:a}).maxHeight,r=new Intl.Segmenter([],{granularity:"word"});return Array.from(r.segment(t)).reduce(((e,t)=>{const r=t;e.length||e.push({text:"",y:e.length*i});let s=e[e.length-1];return r.isWordLike&&Re({labels:[s.text+r.segment],style:a}).maxWidth>n&&(s={text:"",y:e.length*i},e.push(s)),s.text+=r.segment,e}),[])}function We({axis:e,range:t}){let a;return e.ticks.pixelInterval&&(a=Math.ceil(t/e.ticks.pixelInterval)),a}function De(e,t){return"ticks"in e&&"function"==typeof e.ticks?e.ticks(t):e.domain()}function _e({scale:e,count:t,maxCount:a}){let n=De(e,t);if(a&&n.length>a){const e=Math.ceil(n.length/a);n=n.filter(((t,a)=>a%e==0))}return n}function Ne({axis:e,width:t}){const a=parseInt(e.labels.style.fontSize)+e.labels.padding;return Math.floor(t/a)}function je(e){const{split:t,boundsHeight:a}=e;return t.plots.length>1?t.plots[0].height:a}function He(e){const{axis:t,textMaxWidth:a}=e;return t.title.maxRowCount<1?[]:Oe({text:t.title.text,style:t.title.style,width:a}).reduce(((e,a,n)=>(n<t.title.maxRowCount?e.push(a):e[t.title.maxRowCount-1].text+=a.text,e)),[])}function Te(e,t=2){return e.toLowerCase().replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",").map((e=>""+parseInt(e,10)*t)).join(",").replace(/NaN/g,"none")}const Ie=D("d3-axis"),Pe=e=>{const{axes:t,width:a,height:r,scale:s,split:l,plotRef:o}=e,c=je({split:l,boundsHeight:r}),d=n.useRef(null);return n.useEffect((()=>{if(!d.current)return;const e=(0,i.Ltv)(d.current);e.selectAll("*").remove();const n=e=>{var t;const n=(null===(t=l.plots[e.plotIndex])||void 0===t?void 0:t.top)||0;return"left"===e.position?`translate(0, ${n}px)`:`translate(${a}px, 0)`},r=t.reduce(((e,t)=>(t.plotLines.length&&e.push(...t.plotLines.map((e=>Object.assign(Object.assign({},e),{transform:n(t)})))),e)),[]),u=e.selectAll("axis").data(t).join("g").attr("class",Ie()).style("transform",(e=>n(e)));u.each(((e,t,n)=>{const l=s[t],d=(0,i.Ltv)(n[t]),u=l,h=function(e){const{preparedAxis:t,axisGenerator:a,width:n,height:i,scale:r}=e,s=t.grid.enabled?-1*n:0,l=Ae(t,De(r));let o=a.tickSize(s).tickPadding(t.labels.margin).tickFormat((e=>t.labels.enabled?ke({axis:t,value:e,step:l}):""));const c=We({axis:t,range:i});return c&&(o=o.ticks(c)),o}({axisGenerator:"left"===e.position?(0,i.V4s)(u):(0,i.eH3)(u),preparedAxis:e,height:c,width:a,scale:l});if(h(d),e.labels.enabled){const t=d.selectAll(".tick text").attr("x",null).attr("dy",null).style("font-size",e.labels.style.fontSize).style("transform",(function(){return function(e){const{node:t,axis:a}=e;let n=a.labels.lineHeight/2,i=a.labels.margin;return"left"===a.position&&(i*=-1),a.labels.rotation?(a.labels.rotation>0?(i-=a.labels.lineHeight*B(a.labels.rotation),n=a.labels.lineHeight*P(a.labels.rotation),a.labels.rotation%360==90&&(n=((null==t?void 0:t.getBoundingClientRect().width)||0)/2)):(n=0,a.labels.rotation%360==-90&&(n=-((null==t?void 0:t.getBoundingClientRect().width)||0)/2)),`translate(${i}px, ${n}px) rotate(${a.labels.rotation}deg)`):`translate(${i}px, ${n}px)`}({node:this,axis:e})})),a=e.labels.rotation&&Math.abs(e.labels.rotation)%360==90?(c-e.labels.padding*(t.size()-1))/t.size():e.labels.maxWidth;t.call(Ce,a)}if(!e.labels.rotation){let t=0;d.selectAll(".tick").filter((function(a,n){const i=this.getBoundingClientRect();return i.bottom>t&&0!==n||(t=i.top-e.labels.padding,!1)})).remove()}if(o&&e.plotLines.length>0){const e=Ie("plotLine"),t=(0,i.Ltv)(o.current);t.selectAll(`.${e}`).remove();const n=t.selectAll(`.${e}`).data(r).join("g").attr("class",e).style("transform",(e=>e.transform));n.append("path").attr("d",(e=>{const t=Number(u(e.value)),n=[[0,t],[a,t]];return(0,i.n8j)()(n)})).attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-dasharray",(e=>Te(e.dashStyle,e.width))).attr("opacity",(e=>e.opacity)),n.each(((e,t,a)=>{const n=(0,i.Ltv)(a[t]);"before"===e.layerPlacement?n.lower():n.raise()}))}return d})),u.select(".domain").attr("d",(()=>{const e=[[0,0],[0,c]];return(0,i.n8j)()(e)})).style("stroke",(e=>e.lineColor||"")),e.selectAll(".tick").each(((e,t,a)=>{const n=(0,i.Ltv)(a[t]);(e=>{var t;if(!e)return{};const a=(null===(t=e.match(/\((.*?)\)/))||void 0===t?void 0:t[1])||"",[n,i]=a.split(",");return{x:Number.isNaN(Number(n))?void 0:Number(n),y:Number.isNaN(Number(i))?void 0:Number(i)}})(n.attr("transform")).y===c&&n.select("line").style("stroke","none")})),u.append("text").attr("class",Ie("title")).attr("text-anchor","middle").attr("font-size",(e=>e.title.style.fontSize)).attr("transform",(e=>{const t=Oe({text:e.title.text,style:e.title.style,width:c}),a=Math.min(t.length,e.title.maxRowCount),{x:n,y:i}=function(e){const{axis:t,axisHeight:a,rowCount:n}=e;if(n<1)return{x:0,y:0};const i=-(t.title.height-t.title.height/n+t.title.margin+t.labels.margin+t.labels.width);let r;switch(t.title.align){case"left":r=a-t.title.width/2;break;case"right":r=t.title.width/2;break;case"center":r=a/2}return{x:i,y:r}}({axis:e,axisHeight:c,rowCount:a});return`translate(${n}, ${i}) rotate(${"left"===e.position?-90:90})`})).selectAll("tspan").data((e=>He({axis:e,textMaxWidth:c}))).join("tspan").attr("x",0).attr("y",(e=>e.y)).text((e=>e.text)).each(((e,t,a)=>{t===a.length-1&&Me(a[t],c)}))}),[t,a,c,s,l]),n.createElement("g",{ref:d,className:Ie("container")})};function Be(e,t){const{size:a,color:n}=t,i=e.selectAll(".domain").data([null]).enter().insert("path",".tick").attr("class","domain").attr("d",`M0,0V0H${a}`);n&&i.style("stroke",n)}function $e(e){const{scale:t,ticks:{labelFormat:a=(e=>String(e)),labelsPaddings:n=0,labelsMargin:r=0,labelsMaxWidth:s=1/0,labelsStyle:l,labelsLineHeight:o,items:c,count:d,maxTickCount:u,rotation:h=0,tickColor:p},domain:m}=e,g="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,f=function({scale:e,offset:t}){return function(e){return"bandwidth"in e&&"function"==typeof e.bandwidth}(e)?function(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),a=>Number(e(a))+t}(e.copy(),t):function(e){return t=>Number(e(t))}(e.copy())}({scale:t,offset:g}),y=_e({scale:t,count:d,maxCount:u}),v=Re({labels:y,style:l}).maxHeight;return function(e){var t,d,u;const b=null===(t=e.node())||void 0===t?void 0:t.getBoundingClientRect(),x=((null==b?void 0:b.x)||0)+m.size,w=-(null!==(u=null===(d=null==c?void 0:c[0])||void 0===d?void 0:d[0])&&void 0!==u?u:0);let k=`translate(0, ${v+r-w}px)`;if(h){const e=v*P(h)+r-w;let t=B(h)*v;Math.abs(h)%360==90&&(t+=(h>0?-1:1)*v/2),k=`translate(${-t}px, ${e}px) rotate(${h}deg)`}const S=(0,i.AeT)();null==c||c.forEach((([e,t])=>{S.moveTo(0,e),S.lineTo(0,t)})),e.selectAll(".tick").data(y).order().join((e=>{const t=e.append("g").attr("class","tick");return t.append("path").attr("d",S.toString()).attr("stroke",null!=p?p:"currentColor"),t.append("text").text(a).attr("fill","currentColor").attr("text-anchor",(()=>h?h>0?"start":"end":"middle")).style("transform",k).style("alignment-baseline","after-edge"),t})).attr("transform",(function(e){return`translate(${f(e)+g}, ${w})`})),e.select(".tick").filter((e=>0===f(e))).select("line").remove();const L=e.selectAll(".tick text");if(h){const e=s*P(h)+o*B(h);L.each((function(){ze((0,i.Ltv)(this),e)}))}else{let t=0;e.selectAll(".tick").filter((function(){const e=this.getBoundingClientRect();return e.left<t||(t=e.right+n,!1)})).remove(),L.each((function(e,t,a){if(t===a.length-1){const e=this,r=a[t-1],s=(0,i.Ltv)(e),l=e.getBoundingClientRect(),o=null==r?void 0:r.getBoundingClientRect(),c=Math.max(0,l.right-x);if(c){const e=x-((null==o?void 0:o.right)||0)-n,t=l.width/2-c;s.attr("text-anchor","end").attr("transform",`translate(${t},0)`),ze(s,e)}}}))}const{size:A,color:E}=m;e.call(Be,{size:A,color:E}).style("font-size",(null==l?void 0:l.fontSize)||"")}}const Fe=D("d3-axis");function Ye({axis:e,scale:t}){const a=De(t),n=Ae(e,a);return t=>e.labels.enabled?ke({axis:e,value:t,step:n}):""}const Ke=n.memo((function(e){const{axis:t,width:a,height:r,scale:s,split:l}=e,o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return;let e=[];t.grid.enabled&&(e=new Array(l.plots.length||1).fill(null).map(((e,t)=>{var a,n;const i=(null===(a=l.plots[t])||void 0===a?void 0:a.top)||0;return[-i,-(i+((null===(n=l.plots[t])||void 0===n?void 0:n.height)||r))]})));const n=$e({scale:s,ticks:{items:e,labelFormat:Ye({axis:t,scale:s}),labelsPaddings:t.labels.padding,labelsMargin:t.labels.margin,labelsStyle:t.labels.style,labelsMaxWidth:t.labels.maxWidth,labelsLineHeight:t.labels.lineHeight,count:We({axis:t,range:a}),maxTickCount:Ne({axis:t,width:a}),rotation:t.labels.rotation},domain:{size:a,color:t.lineColor}}),c=(0,i.Ltv)(o.current);if(c.selectAll("*").remove(),c.call(n).attr("class",Fe()),t.title.text){const e=He({axis:t,textMaxWidth:a});c.append("text").attr("class",Fe("title")).attr("transform",(()=>{const{x:n,y:i}=function(e){const{axis:t,width:a,rowCount:n}=e;if(n<1)return{x:0,y:0};let i;const r=t.title.height/n+t.title.margin+t.labels.height+t.labels.margin;switch(t.title.align){case"left":i=t.title.width/2;break;case"right":i=a-t.title.width/2;break;case"center":i=a/2}return{x:i,y:r}}({axis:t,width:a,rowCount:e.length});return`translate(${n}, ${i})`})).attr("font-size",t.title.style.fontSize).attr("text-anchor","middle").selectAll("tspan").data(e).join("tspan").attr("x",0).attr("y",(e=>e.y)).text((e=>e.text)).each(((e,n,i)=>{n===t.title.maxRowCount-1&&Me(i[n],a)}))}}),[t,a,r,s,l]),n.createElement("g",{ref:o})})),Ue={fontSize:"12px"},Je=e=>{const t=Object.values(b);return t[e%t.length]},Xe=Math.sqrt(3),qe={draw:(e,t)=>{const a=.6824*Math.sqrt(t),n=a/2,i=a*Xe/2;e.moveTo(0,a),e.lineTo(i,-n),e.lineTo(-i,-n),e.closePath()}},Ve=e=>{switch(e){case b.Diamond:return i.zyz;case b.Circle:return i.hKN;case b.Square:return i.yDW;case b.Triangle:return i.L13;case b.TriangleDown:return qe;default:return i.hKN}};function Ge(e,t){const{x:a=0,y:n=0,width:i,height:r,interpolator:s}=t,l=document.createElement("canvas");l.width=256,l.height=1;const o=l.getContext("2d");if(!o)throw Error("Couldn't get canvas context");for(let e=0,t=255;e<256;++e)o.fillStyle=s(e/t),o.fillRect(e,0,1,r);return e.append("image").attr("preserveAspectRatio","none").attr("height",r).attr("width",i).attr("x",a).attr("y",n).attr("xlink:href",l.toDataURL())}function Ze(e){return(0,i.y17)(e).map((t=>t/e))}function Qe(e){const{values:t,colors:a,stops:n}=e,r=Math.min(...t),s=Math.max(...t),l=null!=n?n:Ze(a.length),o=(0,i.m4Y)(l,a);return e=>o((e-r)/(s-r))}const et=D("d3-legend"),tt=e=>{const{align:t,offsetWidth:a=0,width:n,contentWidth:i}=e;return"left"===t?{top:0,left:a}:"right"===t?{top:0,left:a+n-i}:{top:0,left:a+n/2-i/2}},at=e=>{const{container:t,offset:a,maxPage:n,legend:i,transform:r,onArrowClick:s}=e,l=t.append("g").attr("class",et("pagination"));let o=0;l.append("text").text("▲").attr("class",(function(){return et("pagination-arrow",{inactive:0===a})})).style("font-size",i.itemStyle.fontSize).each((function(){o+=this.getComputedTextLength()})).on("click",(function(){a-1>=0&&s(a-1)})),l.append("text").text(`${a+1}/${n}`).attr("class",et("pagination-counter")).attr("x",o).style("font-size",i.itemStyle.fontSize).each((function(){o+=this.getComputedTextLength()})),l.append("text").text("▼").attr("class",(function(){return et("pagination-arrow",{inactive:a===n-1})})).attr("x",o).style("font-size",i.itemStyle.fontSize).on("click",(function(){a+1<n&&s(a+1)})),l.attr("transform",r)},nt=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));const it=e=>{const{boundsWidth:t,chartSeries:a,legend:r,items:s,config:l,onItemClick:o,onUpdate:c}=e,d=n.useRef(null),[u,h]=n.useState(0);return n.useEffect((()=>{h(0)}),[t]),n.useEffect((()=>{var e,a,n,p,m;if(!d.current)return;const g=(0,i.Ltv)(d.current);g.selectAll("*").remove();let f=0;if("discrete"===r.type){const a=null===(e=l.pagination)||void 0===e?void 0:e.limit;if(("number"==typeof a?s.slice(u*a,u*a+a):s).forEach(((e,a)=>{var n;const s=g.append("g").attr("class",et("line")),l=s.selectAll("legend-history").data(e).enter().append("g").attr("class",et("item")).on("click",(function(e,t){o({name:t.name,metaKey:e.metaKey}),null==c||c()}));(function(e){const{selection:t,legend:a}=e,n=t.data();t.each((function(e,t){const r=(0,i.Ltv)(this),s=(e=>n.slice(0,e).reduce(((e,t)=>e+t.symbol.width+t.symbol.padding+t.textWidth+a.itemDistance),0))(t),l=et("item-symbol",{shape:e.symbol.shape,unselected:!e.visible}),o=e.visible?e.color:"";switch(e.symbol.shape){case"path":{const t=a.lineHeight/2,n=[{x:s,y:t},{x:s+e.symbol.width,y:t}];r.append("path").attr("d",nt(n)).attr("fill","none").attr("stroke-width",e.symbol.strokeWidth).attr("class",l).style("stroke",o),e.dashStyle&&r.attr("stroke-dasharray",Te(e.dashStyle,e.symbol.strokeWidth));break}case"rect":{const t=(a.lineHeight-e.symbol.height)/2;r.append("rect").attr("x",s).attr("y",t).attr("width",e.symbol.width).attr("height",e.symbol.height).attr("rx",e.symbol.radius).attr("class",l).style("fill",o);break}case"symbol":{const t=a.lineHeight/2;r.append("svg:path").attr("d",(()=>{const t=Ve(e.symbol.symbolType);return(0,i.HRO)(t,e.symbol.width*e.symbol.width)()})).attr("transform",(()=>"translate("+s+","+t+")")).attr("class",l).style("fill",o);break}}}))})({selection:l,legend:r}),l.append("text").attr("x",(function(t,a){return(t=>e.slice(0,t).reduce(((e,t)=>e+t.symbol.width+t.symbol.padding+t.textWidth+r.itemDistance),0))(a)+t.symbol.width+t.symbol.padding})).attr("height",r.lineHeight).attr("class",(function(e){const t={selected:e.visible,unselected:!e.visible};return et("item-text",t)})).text((function(e){return"name"in e&&e.name})).style("font-size",r.itemStyle.fontSize);const d=(null===(n=s.node())||void 0===n?void 0:n.getBoundingClientRect().width)||0,{left:u}=tt({align:r.align,width:t,offsetWidth:0,contentWidth:d}),h=r.lineHeight*a;s.attr("transform",`translate(${[u,h].join(",")})`)})),f=t,l.pagination){const e=`translate(${[0,r.lineHeight*l.pagination.limit+r.lineHeight/2].join(",")})`;at({container:g,offset:u,maxPage:l.pagination.maxPage,legend:r,transform:e,onArrowClick:h})}}else{const e=null!==(a=r.colorScale.domain)&&void 0!==a?a:[],t=12;g.call(Ge,{y:r.title.height+r.title.margin,height:t,width:r.width,interpolator:Qe({values:[0,1],colors:r.colorScale.colors,stops:r.colorScale.stops})});const n=$e({scale:(0,i.m4Y)(e,[0,r.width]),ticks:{items:[[0,-t]],labelsMargin:r.ticks.labelsMargin,labelsLineHeight:r.ticks.labelsLineHeight,maxTickCount:4,tickColor:"#fff",labelFormat:e=>ce(e,{unit:"auto"})},domain:{size:r.width,color:"transparent"}}),s=r.title.height+r.title.margin+t;g.append("g").attr("transform",`translate(0, ${s})`).call(n),f=r.width}if(r.title.enable){const{maxWidth:e}=Re({labels:[r.title.text],style:r.title.style});let t=0;switch(r.title.align){case"center":t=r.width/2-e/2;break;case"right":t=r.width-e;break;default:t=0}g.append("g").attr("class",et("title")).append("text").attr("dx",t).attr("font-weight",null!==(n=r.title.style.fontWeight)&&void 0!==n?n:null).attr("font-size",null!==(p=r.title.style.fontSize)&&void 0!==p?p:null).attr("fill",null!==(m=r.title.style.fontColor)&&void 0!==m?m:null).style("alignment-baseline","before-edge").text(r.title.text)}const{left:y}=tt({align:r.align,width:t,offsetWidth:l.offset.left,contentWidth:f});g.attr("transform",`translate(${[y,l.offset.top].join(",")})`)}),[t,a,o,c,r,s,l,u]),n.createElement("g",{className:et(),ref:d,width:t,height:r.height})},rt=D("plot-title"),st=e=>{const{title:t}=e;if(!t)return null;const{x:a,y:i,text:r,style:s,height:l}=t;return n.createElement("text",{className:rt(),dx:a,dy:i,dominantBaseline:"middle",textAnchor:"middle",style:Object.assign({lineHeight:`${l}px`},s)},n.createElement("tspan",null,r))},lt=D("d3-title"),ot=e=>{const{chartWidth:t,text:a,height:i,style:r}=e;return n.createElement("text",{className:lt(),dx:t/2,dy:i/2,dominantBaseline:"middle",textAnchor:"middle",style:Object.assign({lineHeight:`${i}px`},r)},n.createElement("tspan",null,a))};var ct=a(44304),dt=a(73384);function ut(e,t){return e.color?e.color:e.total?t.color:Number(e.y)>0?t.positiveColor:t.negativeColor}function ht(e,t){const a=t.data.indexOf(e);return-1===a?null:t.data.reduce(((e,t,n)=>n<=a?e+(t.total?0:Number(t.y)):e),0)}const pt=D("tooltip"),mt=(e,t,a)=>{switch(null==a?void 0:a.type){case"category":{const n=m()(a,"categories",[]);return Le({axisDirection:e,categories:n,data:t})}case"datetime":{const a=m()(t,e);if(!a)return;return(0,$.KQ)({input:a}).format("DD.MM.YY")}default:{const a=m()(t,e);return ce(a)}}},gt=(e,t)=>mt("x",e,t),ft=(e,t)=>mt("y",e,t),yt=({hovered:e,xAxis:t,yAxis:a})=>{const i=((e,t,a)=>{var n,i;return e.every((e=>["pie","treemap","waterfall","sankey"].includes(e.series.type)))?null:e.some((e=>"bar-y"===e.series.type))?ft(null===(n=e[0])||void 0===n?void 0:n.data,a):gt(null===(i=e[0])||void 0===i?void 0:i.data,t)})(e,t,a);return n.createElement(n.Fragment,null,i&&n.createElement("div",null,i),e.map(((e,i)=>{var r;const{data:s,series:l,closest:o}=e,c=`${m()(l,"id")}_${i}`,d=m()(l,"color");switch(l.type){case"scatter":case"line":case"area":case"bar-x":{const e=n.createElement(n.Fragment,null,l.name,": ",ft(s,a));return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("div",null,o?n.createElement("b",null,e):n.createElement("span",null,e)))}case"waterfall":{const e=m()(s,"total",!1),i=ht(s,l);return n.createElement("div",{key:`${c}_${m()(s,"x")}`},!e&&n.createElement(n.Fragment,null,n.createElement("div",{key:c,className:pt("content-row")},n.createElement("b",null,gt(s,t))),n.createElement("div",{className:pt("content-row")},n.createElement("span",null,l.name," "),n.createElement("span",null,ft(s,a)))),n.createElement("div",{key:c,className:pt("content-row")},e?"Total":"Subtotal",": ",i))}case"bar-y":{const e=n.createElement(n.Fragment,null,l.name,": ",gt(s,t));return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("div",null,o?n.createElement("b",null,e):n.createElement("span",null,e)))}case"pie":case"treemap":{const e=s;return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("span",null,e.name||e.id," "),n.createElement("span",null,e.value))}case"sankey":{const{target:t,data:a}=e,i=null===(r=a.links.find((e=>e.name===(null==t?void 0:t.name))))||void 0===r?void 0:r.value;return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:a.color}}),n.createElement("div",{style:{display:"flex",gap:8,verticalAlign:"center"}},a.name," ",n.createElement("span",null,"→")," ",null==t?void 0:t.name,": ",i))}default:return null}})))},vt=e=>{const{hovered:t,xAxis:a,yAxis:i,renderer:r}=e;if(!t)return null;const s=null==r?void 0:r({hovered:t,xAxis:a,yAxis:i});return T()(s)?n.createElement(yt,{hovered:t,xAxis:a,yAxis:i}):s},bt=D("tooltip"),xt=e=>{const{tooltip:t,xAxis:a,yAxis:i,svgContainer:r,dispatcher:s,tooltipPinned:l,onOutsideClick:o}=e,{hovered:c,pointerPosition:d}=(({dispatcher:e,tooltip:t})=>{const[{hovered:a,pointerPosition:i},r]=n.useState({});return n.useEffect((()=>((null==t?void 0:t.enabled)&&e.on("hover-shape.tooltip",((e,t)=>{r({hovered:e,pointerPosition:t})})),()=>{(null==t?void 0:t.enabled)&&e.on("hover-shape.tooltip",null)})),[e,t]),{hovered:a,pointerPosition:i}})({dispatcher:s,tooltip:t}),u=(null==r?void 0:r.getBoundingClientRect())||{left:0,top:0},h=((null==d?void 0:d[0])||0)+u.left,p=((null==d?void 0:d[1])||0)+u.top,m=(0,ct.m)({rect:{left:h,top:p}});return n.useEffect((()=>{window.dispatchEvent(new CustomEvent("scroll"))}),[h,p]),(null==c?void 0:c.length)?n.createElement(dt.z,{className:bt({pinned:l}),contentClassName:bt("popup-content"),open:!0,anchorRef:m,offset:[0,20],placement:["right","left","top","bottom"],modifiers:[{name:"preventOverflow",options:{padding:10,altAxis:!0}}],onOutsideClick:l?e=>{(null==r?void 0:r.contains(e.target))||null==o||o()}:void 0},n.createElement("div",{className:bt("content")},n.createElement(vt,{hovered:c,xAxis:a,yAxis:i,renderer:t.renderer}))):null};var wt=a(31680),kt=a.n(wt);const St="object"==typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0);var Lt=a(94904),At=a.n(Lt);function Et(e,t,a){var n,r,s,l;const o=(0,i.diJ)(a,(e=>e.x)),c=(0,i.ylB)((e=>e.x)).center(o,e);if(-1===c)return[];const d=o[c].x,u=(0,i.diJ)(a.filter((e=>e.x===d)),(e=>e.y0));let h=-1;if(t<(null===(n=u[0])||void 0===n?void 0:n.y0))h=0;else if(t>(null===(r=u[u.length-1])||void 0===r?void 0:r.y1))h=u.length-1;else if(h=u.findIndex((e=>t>e.y0&&t<e.y1)),-1===h){const e=(0,i.diJ)(u.map(((e,t)=>({index:t,y:e.y1+(e.y0-e.y1)/2}))),(e=>e.y)),a=(0,i.ylB)((e=>e.y)).center(e,t);h=null!==(l=null===(s=e[a])||void 0===s?void 0:s.index)&&void 0!==l?l:-1}return u.map(((e,t)=>({data:e.data,series:e.series,closest:t===h})))}function Mt(e){return m()(e,"series.type")||m()(e,"point.series.type")}function zt(e){const{position:t,shapesData:a,boundsHeight:n,boundsWidth:r}=e,[s,l]=t,o=[],c=At()(a,Mt);return Object.entries(c).forEach((([e,t])=>{var a,c;switch(e){case"bar-x":{const e=t.map((e=>({data:e.data,series:e.series,x:e.x+e.width/2,y0:e.y,y1:e.y+e.height})));o.push(...Et(s,l,e));break}case"waterfall":{const e=t.map((e=>({data:e.data,series:e.series,x:e.x+e.width/2,y0:e.y,y1:e.y+e.height})));o.push(...Et(s,l,e));break}case"area":{const e=t.reduce(((e,t)=>(Array.prototype.push.apply(e,t.points.map((e=>({data:e.data,series:e.series,x:e.x,y0:e.y0,y1:e.y})))),e)),[]);o.push(...Et(s,l,e));break}case"line":{const e=t.reduce(((e,t)=>(e.push(...t.points.map((e=>({data:e.data,series:e.series,x:e.x,y0:e.y,y1:e.y})))),e)),[]);o.push(...Et(s,l,e));break}case"bar-y":{const e=t,n=(0,i.diJ)(e,(e=>e.y)),r=(0,i.ylB)((e=>e.y)).center(n,l);let c=[],d=-1;if(-1!==r){const t=n[r].y;c=(0,i.diJ)(e.filter((e=>e.y===t)),(e=>e.x));const l=c[c.length-1];d=s<(null===(a=c[0])||void 0===a?void 0:a.x)?0:l&&s>l.x+l.width?c.length-1:c.findIndex((e=>s>e.x&&s<e.x+e.width))}o.push(...c.map(((e,t)=>({data:e.data,series:e.series,closest:t===d}))));break}case"scatter":{const e=t,a=e[i.wbF.from(e,(e=>e.point.x),(e=>e.point.y)).find(s,l)];a&&o.push({data:a.point.data,series:a.point.series,closest:!0});break}case"pie":{const e=t.map((e=>e.segments)).flat().find((e=>{const{center:t}=e.data.pie,a=s-t[0],n=l-t[1];let i=Math.atan2(n,a)+.5*Math.PI;i=i<0?2*Math.PI+i:i;const r=Math.sqrt(a*a+n*n);return i>=e.startAngle&&i<=e.endAngle&&r<e.data.radius}));e&&o.push({data:e.data.series.data,series:e.data.series,closest:!0});break}case"treemap":{const e=t,a=null===(c=e[0])||void 0===c?void 0:c.leaves.find((e=>s>=e.x0&&s<=e.x1&&l>=e.y0&&l<=e.y1));a&&o.push({data:a.data,series:e[0].series,closest:!0});break}case"sankey":{const[e]=t,a=e.links.find((e=>{var t;return function(e){const{path:t,point:a,width:n,height:i,strokeWidth:r}=e,s=document.createElement("canvas");s.width=n,s.height=i;const l=s.getContext("2d");if(l){l.lineWidth=r;const e=new Path2D(t);return l.stroke(e),l.isPointInPath(e,...a)||l.isPointInStroke(e,...a)}return null}({path:null!==(t=e.path)&&void 0!==t?t:"",strokeWidth:e.strokeWidth,point:[s,l],width:r,height:n})}));a&&o.push({data:a.source,target:a.target,series:e.series,closest:!0});break}}})),o}function Ct(e){const t=n.useRef();return n.useEffect((()=>{t.current=e}),[e]),t.current}const Rt=e=>{const{chart:t,preparedTitle:a}=e,n=(e=>{const{chart:t,preparedTitle:a}=e;let n=m()(t,"margin.top",0);return(null==a?void 0:a.height)&&(n+=a.height),n})({chart:t,preparedTitle:a}),i=m()(t,"margin.bottom",0),r=m()(t,"margin.left",0),s=(e=>{const{chart:t}=e;return m()(t,"margin.right",0)})({chart:t});return{margin:{top:n,right:s,bottom:i,left:r}}};var Ot=a(30063),Wt=a.n(Ot),Dt=a(7522),_t=a.n(Dt);const Nt=e=>{const{chartWidth:t,chartMargin:a,preparedYAxis:n}=e;return t-a.right-a.left-function(e){const{preparedAxis:t}=e;let a=0,n=0;return null==t||t.forEach((e=>{const t=jt(e);"right"===e.position?n=Math.max(n,t):a=Math.max(a,t)})),a+n}({preparedAxis:n})};function jt(e){let t=0;return(null==e?void 0:e.title.text)&&(t+=e.title.height+e.title.margin),(null==e?void 0:e.labels.enabled)&&(t+=e.labels.margin+e.labels.width),t}const Ht=e=>{const{maxLegendWidth:t,items:a,preparedLegend:n}=e,r=[[]];let s=[0],l=0;return a.forEach((e=>{(0,i.Ltv)(document.body).append("text").text(e.name).style("font-size",n.itemStyle.fontSize).each((function(){const a=Wt()(e),i=this.getBoundingClientRect().width;a.textWidth=i,s.push(i);const o=s.reduce(((e,t)=>e+t),0);r[l].push(a);const c=r[l].reduce(((e,{symbol:t})=>e+t.width+t.padding),0),d=(r[l].length-1)*n.itemDistance;if(t<o+c+d){r[l].pop(),l+=1,s=[i];const e=l;r[e]=[],r[e].push(a)}})).remove()})),r},Tt={"bar-x":{barMaxWidth:50,barPadding:.1,groupPadding:.2,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},"bar-y":{barMaxWidth:50,barPadding:.1,groupPadding:.2,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},pie:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},scatter:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},line:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},area:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},treemap:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},waterfall:{barMaxWidth:50,barPadding:.1,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}}},It=Object.assign(Object.assign({},X),{enabled:!1});function Pt(e,t){var a;const n=m()(t,"area.states.hover"),i=Object.assign({},It,null===(a=null==t?void 0:t.area)||void 0===a?void 0:a.marker,e.marker),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}function Bt(e){var t;const a=m()(e,"dataLabels.enabled",!1),n=Object.assign({},U,null===(t=e.dataLabels)||void 0===t?void 0:t.style),i=m()(e,"dataLabels.html",!1),r=a?e.data.map((e=>String(e.label||e.x))):[],{maxHeight:s=0,maxWidth:l=0}=Re({labels:r,style:n,html:i});return{enabled:a,inside:"percent"===e.stacking||m()(e,"dataLabels.inside",!1),style:n,maxHeight:s,maxWidth:l,html:i}}const $t=16,Ft=1,Yt=v.Solid,Kt=Object.assign(Object.assign({},X),{enabled:!1});function Ut(e,t,a){const n=e===v.Solid?x.Round:x.None,i=m()(a,"line.linecap",n);return m()(t,"linecap",i)}function Jt(e,t){var a;const n=(null===(a=e.legend)||void 0===a?void 0:a.symbol)||{},i=m()(t,"line.lineWidth",Ft);return{shape:"path",width:(null==n?void 0:n.width)||$t,padding:(null==n?void 0:n.padding)||K,strokeWidth:m()(e,"lineWidth",i)}}function Xt(e,t){var a;const n=m()(t,"line.states.hover"),i=Object.assign({},Kt,null===(a=null==t?void 0:t.line)||void 0===a?void 0:a.marker,e.marker),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}function qt(e,t,a){const n=m()(t,"scatter.states.hover"),i=Object.assign(Object.assign({},X),{enabled:!0,symbol:e.symbolType||Je(a)}),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}const Vt=e=>{const{chartWidth:t,chartHeight:a,chartMargin:r,legend:s,preparedYAxis:l,series:{data:o,options:c}}=e,d=n.useMemo((()=>(e=>{var t,a,n,i,r,s,l;const{legend:o,series:c}=e,d=Boolean("boolean"==typeof(null==o?void 0:o.enabled)?null==o?void 0:o.enabled:c.length>1),u=Wt()(Ue),h=m()(o,"itemStyle"),p=_t()(u,h),g=Se({text:"Tmp",style:p}),f=m()(o,"type","discrete"),y=Boolean(null===(t=null==o?void 0:o.title)||void 0===t?void 0:t.text),v=y?m()(o,"title.margin",4):0,b=Object.assign({fontSize:"12px",fontWeight:"bold"},m()(o,"title.style")),x=y?m()(o,"title.text",""):"",w=y?Re({labels:[x],style:b}).maxHeight:0,k={labelsMargin:4,labelsLineHeight:12},S={colors:[],domain:[],stops:[]};let L=0;d&&(L+=w+v,"continuous"===f?(L+=12,L+=k.labelsLineHeight+k.labelsMargin,S.colors=null!==(n=null===(a=null==o?void 0:o.colorScale)||void 0===a?void 0:a.colors)&&void 0!==n?n:[],S.stops=null!==(r=null===(i=null==o?void 0:o.colorScale)||void 0===i?void 0:i.stops)&&void 0!==r?r:Ze(S.colors.length),S.domain=null!==(l=null===(s=null==o?void 0:o.colorScale)||void 0===s?void 0:s.domain)&&void 0!==l?l:function(e){const{series:t}=e,a=t.reduce(((e,t)=>{switch(t.type){case"pie":e.push(...t.data.map((e=>e.value)));break;case"bar-y":e.push(...t.data.map((e=>Number(e.x))));break;case"scatter":case"bar-x":case"waterfall":case"line":case"area":e.push(...t.data.map((e=>Number(e.y))));break;default:throw Error(`The method for calculation a domain for a continuous color scale for the "${t.type}" series is not defined`)}return e}),[]);return[Math.min(...a),Math.max(...a)]}({series:c})):L+=g);const A=m()(o,"width",200);return{align:m()(o,"align","center"),enabled:d,height:L,itemDistance:m()(o,"itemDistance",20),itemStyle:p,lineHeight:g,margin:m()(o,"margin",15),type:f,title:{enable:y,text:x,margin:v,style:b,height:w,align:m()(o,"title.align","left")},width:A,ticks:k,colorScale:S}})({legend:s,series:o})),[s,o]),u=n.useMemo((()=>{const e=(e=>e.reduce(((e,t)=>("name"in t&&"string"==typeof t.name&&e.push(t.name),e)),[]))(o),t=(0,i.UMr)(e,k),a=(0,i.Os0)(o,(e=>e.type));return Array.from(a).reduce(((e,[a,n])=>(e.push(...function(e){const{type:t,series:a,seriesOptions:n,legend:r,colorScale:s}=e;switch(t){case"pie":return a.reduce(((e,t)=>(e.push(...function(e){const{series:t,seriesOptions:a,legend:n}=e,r=t.data.map((e=>e.name)),s=(0,i.UMr)(r,k),l=h(),o=m()(a,"pie.states.hover");return t.data.map(((e,a)=>{var i,r,c,d,u;return{type:"pie",data:e,dataLabels:{enabled:m()(t,"dataLabels.enabled",!0),style:Object.assign({},U,null===(i=t.dataLabels)||void 0===i?void 0:i.style),padding:m()(t,"dataLabels.padding",5),allowOverlap:m()(t,"dataLabels.allowOverlap",!1),connectorPadding:m()(t,"dataLabels.connectorPadding",5),connectorShape:m()(t,"dataLabels.connectorShape","polyline"),distance:m()(t,"dataLabels.distance",25),connectorCurve:m()(t,"dataLabels.connectorCurve","basic"),html:m()(t,"dataLabels.html",!1)},label:e.label,value:e.value,visible:"boolean"!=typeof e.visible||e.visible,name:e.name,id:`Series ${a}`,color:e.color||s(e.name),legend:{enabled:m()(t,"legend.enabled",n.enabled),symbol:V(t)},center:t.center||["50%","50%"],borderColor:t.borderColor||"",borderRadius:null!==(r=t.borderRadius)&&void 0!==r?r:0,borderWidth:null!==(c=t.borderWidth)&&void 0!==c?c:1,radius:null!==(u=null!==(d=e.radius)&&void 0!==d?d:t.radius)&&void 0!==u?u:"100%",innerRadius:t.innerRadius||0,stackId:l,states:{hover:{halo:{enabled:m()(o,"halo.enabled",!0),opacity:m()(o,"halo.opacity",.25),size:m()(o,"halo.size",10)}}},renderCustomShape:t.renderCustomShape,opacity:m()(e,"opacity",null),cursor:m()(t,"cursor",null)}}))}({series:t,seriesOptions:n,legend:r})),e)),[]);case"bar-x":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map((e=>{var a,r,s,l,o;const c=e.name||"",d=e.color||t(c);return{type:e.type,color:d,name:c,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,inside:"boolean"==typeof(null===(r=e.dataLabels)||void 0===r?void 0:r.inside)&&(null===(s=e.dataLabels)||void 0===s?void 0:s.inside),style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),allowOverlap:(null===(o=e.dataLabels)||void 0===o?void 0:o.allowOverlap)||!1,padding:m()(e,"dataLabels.padding",5),html:m()(e,"dataLabels.html",!1)},cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0),borderRadius:m()(e,"borderRadius",m()(n,"bar-x.borderRadius",0))}}),[])}({series:a,legend:r,colorScale:s,seriesOptions:n});case"bar-y":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map((e=>{var a,r,s;const l=e.name||"",o=e.color||t(l);return{type:e.type,color:o,name:l,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:Bt(e),cursor:m()(e,"cursor",null),borderRadius:null!==(s=null!==(a=e.borderRadius)&&void 0!==a?a:null===(r=null==n?void 0:n["bar-y"])||void 0===r?void 0:r.borderRadius)&&void 0!==s?s:0}}),[])}({series:a,legend:r,colorScale:s,seriesOptions:n});case"scatter":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map(((e,a)=>{const r=h(),s="name"in e&&e.name?e.name:"",l=e.symbolType||Je(a);return{id:r,type:e.type,name:s,color:m()(e,"color",t(s)),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e,l)},data:e.data,marker:qt(e,n,a),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,legend:r,colorScale:s});case"line":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e,r=m()(n,"line.lineWidth",Ft),s=m()(n,"line.dashStyle",Yt);return a.map((e=>{var a,l;const o=h(),c=e.name||"",d=e.color||t(c),u=m()(e,"dashStyle",s);return{type:e.type,color:d,lineWidth:m()(e,"lineWidth",r),name:c,id:o,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:Jt(e,n)},data:e.data,dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1)},marker:Xt(e,n),dashStyle:u,linecap:Ut(u,e,n),opacity:m()(e,"opacity",null),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,seriesOptions:n,legend:r,colorScale:s});case"area":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e,r=m()(n,"area.lineWidth",1),s=m()(n,"area.opacity",.75);return a.map((e=>{var a,l;const o=h(),c=e.name||"",d=e.color||t(c);return{type:e.type,color:d,opacity:m()(e,"opacity",s),lineWidth:m()(e,"lineWidth",r),name:c,id:o,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1)},marker:Pt(e,n),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,seriesOptions:n,legend:r,colorScale:s});case"treemap":return function(e){const{colorScale:t,legend:a,series:n}=e;return n.map((e=>{var n;const i=h(),r=e.name||"";return{color:e.color||t(r),data:e.data,dataLabels:{enabled:m()(e,"dataLabels.enabled",!0),style:Object.assign({},U,null===(n=e.dataLabels)||void 0===n?void 0:n.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1),align:m()(e,"dataLabels.align","left")},id:i,type:e.type,name:r,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",a.enabled),symbol:V(e)},levels:e.levels,layoutAlgorithm:m()(e,"layoutAlgorithm",w.Binary),cursor:m()(e,"cursor",null)}}))}({series:a,seriesOptions:n,legend:r,colorScale:s});case"waterfall":return function(e){const{colorScale:t,series:a,legend:n}=e,[,i,r]=k;return a.map((e=>{var a,s,l;const o=e.name||"",c=e.color||t(o);return{type:e.type,color:c,positiveColor:r,negativeColor:i,name:o,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",n.enabled),symbol:V(e)},data:e.data,dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(s=e.dataLabels)||void 0===s?void 0:s.style),allowOverlap:(null===(l=e.dataLabels)||void 0===l?void 0:l.allowOverlap)||!1,padding:m()(e,"dataLabels.padding",5),html:m()(e,"dataLabels.html",!1)},cursor:m()(e,"cursor",null)}}),[])}({series:a,legend:r,colorScale:s});case"sankey":return function(e){const{colorScale:t,legend:a,series:n}=e;return n.map((e=>{var n;const i=h(),r=e.name||"",s={color:t(r),data:e.data.map((e=>{var a;return{name:e.name,color:null!==(a=e.color)&&void 0!==a?a:t(e.name),links:e.links}})),dataLabels:{enabled:m()(e,"dataLabels.enabled",!0),style:Object.assign({},U,null===(n=e.dataLabels)||void 0===n?void 0:n.style)},id:i,type:e.type,name:r,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",a.enabled),symbol:V(e)},cursor:m()(e,"cursor",null)};return s}))}({series:a,seriesOptions:n,colorScale:s,legend:r});default:throw new C({message:`Series type "${t}" does not support data preparation for series that do not support the presence of axes`})}}({type:a,series:n,seriesOptions:c,legend:d,colorScale:t})),e)),[])}),[o,c,d]),p=n.useMemo((()=>{return e=c,_t()({},Tt,e);var e}),[c]),[g,f]=n.useState(q(u)),y=n.useMemo((()=>u.map((e=>e.legend.enabled?Object.assign(Object.assign({},e),{visible:g.includes(e.name)}):e))),[u,g]),{legendConfig:v,legendItems:b}=n.useMemo((()=>(e=>{const{chartWidth:t,chartHeight:a,chartMargin:n,series:i,preparedLegend:r,preparedYAxis:s}=e,l=Nt({chartWidth:t,chartMargin:n,preparedYAxis:s}),o=(a-n.top-n.bottom-r.margin)/2,c=(e=>e.reduce(((e,t)=>(m()(t,"legend.enabled",!0)&&e.push(Object.assign(Object.assign({},t),{symbol:t.legend.symbol})),e)),[]))(i),d=Ht({maxLegendWidth:l,items:c,preparedLegend:r});let u;if("discrete"===r.type){let e=r.lineHeight*d.length;if(o<e){const t=Math.floor(o/r.lineHeight)-1;u={limit:t,maxPage:Math.ceil(d.length/t)},e=o}r.height=e}const h=a-n.bottom-r.height;return{legendConfig:{offset:{left:n.left+jt(s[0]),top:h},pagination:u},legendItems:d}})({chartHeight:a,chartMargin:r,chartWidth:t,series:y,preparedLegend:d,preparedYAxis:l})),[t,a,r,y,d,l]),x=n.useCallback((({name:e,metaKey:t})=>{const a=(e=>e.map((e=>e.name)))(u),n=1===g.length&&g.includes(e);let i;i=t&&g.includes(e)?g.filter((t=>t!==e)):t&&!g.includes(e)?g.concat(e):n&&1===a.length?[]:n?a:[e],f(i)}),[u,g]);return n.useEffect((()=>{f(q(u))}),[u]),{legendItems:b,legendConfig:v,preparedLegend:d,preparedSeries:y,preparedSeriesOptions:p,handleLegendItemClick:x}},Gt=e=>e.every((e=>"number"==typeof e||null===e)),Zt=e=>{const{axisDirection:t,categories:a,series:n}=e,i=new Set;return n.forEach((e=>{(function(e){return ge(e)})(e)&&e.data.forEach((e=>{i.add(Le({axisDirection:t,categories:a,data:e}))}))})),a.filter((e=>i.has(e)))};function Qt(e,t,a){const n=m()(e,"type",M),r=m()(e,"min"),s=m()(e,"categories"),l=m()(e,"timestamps");switch(n){case"linear":case"logarithmic":{const s=xe(t),l=[a,a*e.maxPadding];if(Gt(s)){const[e,a]=(0,i.Xxv)(s),o="number"==typeof r?r:e;let c=a;return t.some((e=>pe.includes(e.type)))&&(c=Math.max(c,0)),("logarithmic"===n?i.ZEH:i.m4Y)().domain([o,c]).range(l).nice()}break}case"category":if(s){const e=Zt({axisDirection:"y",categories:s,series:t});return(0,i.WH)().domain(e).range([a,0])}break;case"datetime":{const n=[a,a*e.maxPadding];if(l){const[e,t]=(0,i.Xxv)(l);return(0,i.Pps)().domain([e,t]).range(n).nice()}{const e=xe(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e);return(0,i.Pps)().domain([t,a]).range(n).nice()}}break}}throw new Error("Failed to create yScale")}function ea(e,t,a){const n=m()(e,"min"),r=function(e){if(e.some((e=>"bar-y"===e.type)))return 0}(t),s=m()(e,"type",M),l=m()(e,"categories"),o=m()(e,"timestamps"),c=a*m()(e,"maxPadding",0)+function(e){let t=0;return e.forEach((e=>{if("bar-y"===e.type&&!m()(e,"dataLabels.inside")){const a=m()(e,"dataLabels.maxWidth",0);t=Math.max(t,a)}})),t}(t),d=[0,a-c];switch(s){case"linear":case"logarithmic":{const e=be(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e),l="number"==typeof n?n:t,o="number"==typeof r?Math.max(r,a):a;return("logarithmic"===s?i.ZEH:i.m4Y)().domain([l,o]).range(d).nice()}break}case"category":if(l){const e=Zt({axisDirection:"x",categories:l,series:t}),n=(0,i.WH)().domain(e).range([0,a]);return n.step()/2<c&&n.range(d),n}break;case"datetime":if(o){const[e,t]=(0,i.Xxv)(o);return(0,i.Pps)().domain([e,t]).range(d).nice()}{const e=be(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e);return(0,i.Pps)().domain([t,a]).range(d).nice()}}}throw new Error("Failed to create xScale")}var ta=a(63281),aa=a.n(ta);function na(e){switch(e.textAnchor){case"start":default:return e.x;case"middle":return e.x-e.size.width/2;case"end":return e.x-e.size.width}}function ia(e,t,a=0){return Boolean(function(e,t,a=0){const n=na(e),i=n+e.size.width,r=na(t),s=r+t.size.width;return Math.max(0,Math.min(i,s)-Math.max(n,r)+a)}(e,t,a)&&function(e,t,a=0){const n=e.y-e.size.height,i=e.y,r=t.y-t.size.height,s=t.y;return Math.max(0,Math.min(i,s)-Math.max(n,r)+a)}(e,t,a))}function ra(e){const t=[];return aa()(e,(e=>e.y),na).forEach((e=>{t.some((t=>ia(e,t)))||t.push(e)})),t}var sa=a(84203);const la=e=>{const{htmlLayout:t,preparedData:a}=e,i=n.useMemo((()=>Array.isArray(a)?a.reduce(((e,t)=>(e.push(...t.htmlElements),e)),[]):a.htmlElements),[a]);return t?n.createElement(sa.Z,{container:t},i.map(((e,t)=>n.createElement("div",{key:t,dangerouslySetInnerHTML:{__html:e.content},style:{position:"absolute",left:e.x,top:e.y}})))):null},oa=D("d3-marker"),ca=oa("halo"),da=oa("symbol");function ua(e){const t=e.attr("class",oa("wrapper")).attr("visibility",ha).attr("transform",(e=>`translate(${e.point.x},${e.point.y})`));return t.append("path").attr("class",ca).attr("d",(e=>{const t=e.point.series;return ga(t.marker.states.normal.symbol,m()(e.point.data,"radius",t.marker.states.hover.radius)+t.marker.states.hover.halo.size)})).attr("fill",(e=>e.point.series.color)).attr("opacity",(e=>e.point.series.marker.states.hover.halo.opacity)).attr("z-index",-1).attr("visibility",pa),t.append("path").attr("class",da).call(ma,"normal").attr("fill",(e=>e.point.series.color)),t}function ha(e){const t=e.point.series.marker.states;let a;return a=e.hovered?t.hover.enabled&&e.hovered:t.normal.enabled||m()(e.point.data,"marker.states.normal.enabled",!1),a?"":"hidden"}function pa(e){return e.point.series.marker.states.hover.halo.enabled&&e.hovered?"":"hidden"}function ma(e,t){e.attr("d",(e=>{const a=e.point.series;return ga(a.marker.states.normal.symbol,m()(e.point.data,"radius",a.marker.states[t].radius)+a.marker.states[t].borderWidth)})).attr("stroke-width",(e=>e.point.series.marker.states[t].borderWidth)).attr("stroke",(e=>e.point.series.marker.states[t].borderColor))}function ga(e=b.Circle,t){const a=Ve(e),n=Math.pow(t,2)*Math.PI;return(0,i.HRO)(a,n)()}function fa(e){return e.select(`.${ca}`)}function ya(e){return e.select(`.${da}`)}function va(e){const{point:t,xAxis:a,xScale:n}=e;if("category"===a.type){const e=n,i=m()(a,"categories",[]);return(e(Le({axisDirection:"x",categories:i,data:t}))||0)+e.step()/2}return n(t.x)}function ba(e){const{point:t,yAxis:a,yScale:n}=e;if("category"===a.type){const e=n,i=m()(a,"categories",[]);return(e(Le({axisDirection:"y",categories:i,data:t}))||0)+e.step()/2}return n(t.y)}function xa(e){return e.id||-1}function wa(e){const{element:t,datum:a,state:n,active:r}=e,s=(0,i.Ltv)(t);if(a.active!==r){a.active=r;const e=a.active?null:null==n?void 0:n.opacity;s.attr("opacity",e||null)}return a}function ka(e){const{x:t,y:a,width:n,height:r,borderRadius:s=0}=e,l="number"==typeof s?new Array(4).fill(s):s,[o=0,c=0,d=0,u=0]=null!=l?l:[],h=(0,i.AeT)();let p=-Math.PI/2;const m=Math.PI/2;return h.moveTo(t+o,a),h.lineTo(t+n-c,a),h.arc(t+n-c,a+c,c,p,p+m),p+=m,h.lineTo(t+n,a+r-d),h.arc(t+n-d,a+r-d,d,p,p+m),p+=m,h.lineTo(t+u,a+r),h.arc(t+u,a+r-u,u,p,p+m),p+=m,h.lineTo(t,a+o),h.arc(t+o,a+o,o,p,p+m),h.closePath(),h}const Sa=D("d3-area"),La=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"area.states.hover"),c=m()(r,"area.states.inactive"),d=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));n.selectAll("*").remove();const u=n.selectAll("shape").data(a).join("g").attr("class",Sa("series")).attr("cursor",(e=>e.series.cursor));u.append("path").attr("class",Sa("line")).attr("d",(e=>d(e.points))).attr("fill","none").attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-linejoin","round").attr("stroke-linecap","round");const h=(0,i.Wcw)().x((e=>e.x)).y0((e=>e.y0)).y1((e=>e.y));u.append("path").attr("class",Sa("region")).attr("d",(e=>h(e.points))).attr("fill",(e=>e.color)).attr("opacity",(e=>e.opacity));let p=a.reduce(((e,t)=>e.concat(t.labels)),[]);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(p=ra(p));const g=n.selectAll("text").data(p).join("text").text((e=>e.text)).attr("class",Sa("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),f=a.reduce(((e,t)=>e.concat(t.markers)),[]),y=n.selectAll("marker").data(f).join("g").call(ua),v=null==s?void 0:s.enabled,b=null==c?void 0:c.enabled;function x(e){l.current=e;const t=(null==e?void 0:e.filter((e=>"area"===e.series.type)))||[],a=t.map((e=>e.data)),n=t.map((e=>{var t;return null===(t=e.series)||void 0===t?void 0:t.id}));u.datum(((e,t,a)=>{var r;const l=(0,i.Ltv)(a[t]),o=Boolean(v&&n.includes(e.id));if(e.hovered!==o){e.hovered=o;let t=e.color||"";e.hovered&&(t=(null===(r=(0,i.yWT)(t))||void 0===r?void 0:r.brighter(null==s?void 0:s.brightness).toString())||t),l.selectAll(`.${Sa("line")}`).attr("stroke",t),l.selectAll(`.${Sa("region")}`).attr("fill",t)}return wa({element:a[t],state:c,active:Boolean(!b||!n.length||n.includes(e.id)),datum:e})})),g.datum(((e,t,a)=>wa({element:a[t],state:c,active:Boolean(!b||!n.length||n.includes(e.series.id)),datum:e}))),y.datum(((e,t,r)=>{const s=(0,i.Ltv)(r[t]),l=Boolean(v&&a.includes(e.point.data));if(e.hovered!==l&&(e.hovered=l,s.attr("visibility",ha(e)),fa(s).attr("visibility",pa),ya(s).call(ma,l?"hover":"normal")),e.point.series.marker.states.normal.enabled){const a=Boolean(!b||!n.length||n.includes(e.point.series.id));wa({element:r[t],state:c,active:a,datum:e})}return e}))}return null!==l.current&&x(l.current),t.on("hover-shape.area",x),()=>{t.on("hover-shape.area",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Sa()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};function Aa(e){if(!e.series.dataLabels.enabled)return;const t=String(e.data.label||e.data.y),a=e.series.dataLabels.style,n=e.series.dataLabels.html,{maxHeight:i,maxWidth:r}=Re({labels:[t],style:a,html:n});let s=Math.max(i,e.y-e.series.dataLabels.padding);e.series.dataLabels.inside&&(s=e.y+e.height/2);const l=e.x+e.width/2;return{text:t,x:n?l-r/2:l,y:n?s-i:s,style:a,size:{width:r,height:i},textAnchor:"middle",series:e.series}}const Ea=D("bar-x"),Ma=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"bar-x.states.hover"),c=m()(r,"bar-x.states.inactive");n.selectAll("*").remove();const d=n.selectAll("allRects").data(a).join("path").attr("d",(e=>{const t=e.isLastStackItem?Math.min(e.height,e.width/2,e.series.borderRadius):0;return ka({x:e.x,y:e.y,width:e.width,height:e.height,borderRadius:[t,t,0,0]}).toString()})).attr("class",Ea("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>e.data.color||e.series.color)).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let u=a.map((e=>e.label)).filter(Boolean);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(u=ra(u));const h=n.selectAll("text").data(u).join("text").text((e=>e.text)).attr("class",Ea("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null));function p(e){l.current=e;const t=null==s?void 0:s.enabled,a=null==c?void 0:c.enabled;if(!e)return t&&d.attr("fill",(e=>e.data.color||e.series.color)),void(a&&(d.attr("opacity",null),h.attr("opacity",null)));if(t){const t=e.map((e=>e.data.x));d.attr("fill",(e=>{var a;const n=e.data.color||e.series.color;return t.includes(e.data.x)&&(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(null==s?void 0:s.brightness).toString())||n}))}if(a){const t=e.map((e=>e.series.id));d.attr("opacity",(e=>t.includes(e.series.id)?null:(null==c?void 0:c.opacity)||null)),h.attr("opacity",(e=>t.includes(e.series.id)?null:(null==c?void 0:c.opacity)||null))}}return null!==l.current&&p(l.current),t.on("hover-shape.bar-x",p),()=>{t.on("hover-shape.bar-x",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ea()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},za=D("bar-y"),Ca=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove();const n=e.selectAll("rect").data(a).join("path").attr("d",(e=>{const t=e.isLastStackItem?Math.min(e.height,e.width/2,e.series.borderRadius):0;return ka({x:e.x,y:e.y,width:e.width,height:e.height,borderRadius:[0,t,t,0]}).toString()})).attr("class",za("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>e.color)).attr("opacity",(e=>e.data.opacity||null)).attr("cursor",(e=>e.series.cursor)),s=a.reduce(((e,t)=>(t.label&&e.push(t.label),e)),[]),c=e.selectAll("text").data(s).join("text").text((e=>e.text)).attr("class",za("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),d=m()(r,"bar-y.states.hover"),u=m()(r,"bar-y.states.inactive");function h(e){if(l.current=e,null==d?void 0:d.enabled){const t=null==e?void 0:e.reduce(((e,t)=>(e.add(t.data.y),e)),new Set);n.attr("fill",(e=>{var a;const n=e.color;return(null==t?void 0:t.has(e.data.y))&&(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(d.brightness).toString())||n}))}if(null==u?void 0:u.enabled){const t=null==e?void 0:e.map((e=>e.series.id)),a=e=>(null==t?void 0:t.length)&&!t.includes(e.series.id)&&u.opacity||null;n.attr("opacity",a),c.attr("opacity",a)}}return null!==l.current&&h(l.current),t.on("hover-shape.bar-y",h),()=>{t.on("hover-shape.bar-y",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:za()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Ra=D("d3-line"),Oa=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"line.states.hover"),c=m()(r,"line.states.inactive"),d=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));n.selectAll("*").remove();const u=n.selectAll("path").data(a).join("path").attr("d",(e=>d(e.points))).attr("fill","none").attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-linejoin",(e=>e.linecap)).attr("stroke-linecap",(e=>e.linecap)).attr("stroke-dasharray",(e=>Te(e.dashStyle,e.width))).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let h=a.reduce(((e,t)=>e.concat(t.labels)),[]);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(h=ra(h));const p=n.selectAll("text").data(h).join("text").text((e=>e.text)).attr("class",Ra("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),g=a.reduce(((e,t)=>e.concat(t.markers)),[]),f=n.selectAll("marker").data(g).join("g").call(ua),y=null==s?void 0:s.enabled,v=null==c?void 0:c.enabled;function b(e){l.current=e;const t=(null==e?void 0:e.filter((e=>"line"===e.series.type)))||[],a=t.map((e=>e.data)),n=t.map((e=>{var t;return null===(t=e.series)||void 0===t?void 0:t.id}));u.datum(((e,t,a)=>{const r=(0,i.Ltv)(a[t]),l=Boolean(y&&n.includes(e.id));return e.hovered!==l&&(e.hovered=l,r.attr("stroke",(e=>{var t;const a=e.color||"";return e.hovered&&(null===(t=(0,i.yWT)(a))||void 0===t?void 0:t.brighter(null==s?void 0:s.brightness).toString())||a}))),wa({element:a[t],state:c,active:Boolean(!v||!n.length||n.includes(e.id)),datum:e})})),p.datum(((e,t,a)=>wa({element:a[t],state:c,active:Boolean(!v||!n.length||n.includes(e.series.id)),datum:e}))),f.datum(((e,t,r)=>{const s=(0,i.Ltv)(r[t]),l=Boolean(y&&a.includes(e.point.data));if(e.hovered!==l&&(e.hovered=l,s.attr("visibility",ha(e)),fa(s).attr("visibility",pa),ya(s).call(ma,l?"hover":"normal")),e.point.series.marker.states.normal.enabled){const a=Boolean(!v||!n.length||n.includes(e.point.series.id));wa({element:r[t],state:c,active:a,datum:e})}return e}))}return null!==l.current&&b(l.current),t.on("hover-shape.line",b),()=>{t.on("hover-shape.line",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ra()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Wa=D("d3-pie");function Da(e){return e.data.pie.halo.enabled&&e.data.hovered?"":"hidden"}function _a(e){const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null);n.useEffect((()=>{if(!l.current)return()=>{};const e=(0,i.Ltv)(l.current);e.selectAll("*").remove();const n=`.${Wa("segment")}`,s=`.${Wa("connector")}`,o=e.selectAll("pie").data(a).join("g").attr("id",(e=>e.id)).attr("class",Wa("item")).attr("transform",(e=>{const[t,a]=e.center;return`translate(${t}, ${a})`})).style("stroke-width",(e=>e.borderWidth)).attr("cursor",(e=>e.series.cursor));o.selectAll("halo").data((e=>e.halo.enabled?e.segments:[])).join("path").attr("d",(e=>(0,i.JLW)().innerRadius(e.data.pie.innerRadius).outerRadius(e.data.radius+e.data.pie.halo.size).cornerRadius(e.data.pie.borderRadius)(e))).attr("class",Wa("halo")).attr("fill",(e=>e.data.color)).attr("opacity",(e=>e.data.pie.halo.opacity)).attr("z-index",-1).attr("visibility",Da),o.selectAll(n).data((e=>e.segments)).join("path").attr("d",(e=>(0,i.JLW)().innerRadius(e.data.pie.innerRadius).outerRadius(e.data.radius).cornerRadius(e.data.pie.borderRadius)(e))).attr("class",Wa("segment")).style("stroke",(e=>e.data.series.borderColor)).attr("fill",(e=>e.data.color)).attr("opacity",(e=>e.data.opacity)),o.selectAll("text").data((e=>e.labels)).join("text").text((e=>e.text)).attr("class",Wa("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)).call(Ce,(e=>e.size.width>e.maxWidth?e.maxWidth:1/0)),o.selectAll(s).data((e=>e.connectors)).enter().append("path").attr("class",Wa("connector")).attr("d",(e=>e.path)).attr("stroke",(e=>e.color)).attr("stroke-width",1).attr("stroke-linejoin","round").attr("stroke-linecap","round").style("fill","none"),o.each((function(e,t,a){var n,i;const r=null===(i=(n=e.series).renderCustomShape)||void 0===i?void 0:i.call(n,{series:{innerRadius:e.innerRadius}});r&&a[t].append(r)}));const c="hover-shape.pie",d=m()(r,"pie.states.hover"),u=m()(r,"pie.states.inactive");return t.on(c,(e=>{var t,a;const r=null===(a=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.series)||void 0===a?void 0:a.id,l=null==d?void 0:d.enabled,c=null==u?void 0:u.enabled;o.datum(((e,t,a)=>{const o=(0,i.Ltv)(a[t]),h=o.selectAll(`.${Wa("halo")}`);o.selectAll(n).datum(((e,t,a)=>{const n=Boolean(l&&e.data.series.id===r);if(e.data.hovered!==n){e.data.hovered=n,(0,i.Ltv)(a[t]).attr("fill",(()=>{var t;const a=e.data.color;return e.data.hovered&&(null===(t=(0,i.yWT)(a))||void 0===t?void 0:t.brighter(null==d?void 0:d.brightness).toString())||a}));const r=h.nodes()[t];(0,i.Ltv)(r).attr("visibility",Da)}return wa({element:a[t],state:u,active:Boolean(!c||!r||r===e.data.series.id),datum:e.data}),e}));const p=o.selectAll("tspan"),m=o.selectAll(s);p.merge(m).datum(((e,t,a)=>wa({element:a[t],state:u,active:Boolean(!c||!r||r===e.series.id),datum:e})))}))})),()=>{t.on(c,null)}}),[t,a,r]);const o=a.map((e=>e.htmlLabels)).flat();return n.createElement(n.Fragment,null,n.createElement("g",{ref:l,className:Wa(),style:{zIndex:9}}),n.createElement(la,{preparedData:{htmlElements:o},htmlLayout:s}))}const Na=(0,i.rLf)().value((e=>e.value)).sort(null),ja=2*Math.PI,Ha=(e,t,a)=>{var n,i;const r=.5*e,s=.5*t;if(!a)return[r,s];const[l,o]=a;return[null!==(n=I({value:l,base:e}))&&void 0!==n?n:r,null!==(i=I({value:o,base:t}))&&void 0!==i?i:s]};const Ta=D("sankey"),Ia=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove(),e.append("g").selectAll().data(a.nodes).join("rect").attr("x",(e=>e.x0)).attr("y",(e=>e.y0)).attr("height",(e=>e.y1-e.y0)).attr("width",(e=>e.x1-e.x0)).attr("fill",(e=>e.color)),e.append("g").attr("fill","none").selectAll().data(a.links).join("g").append("path").attr("stroke-opacity",(e=>e.opacity)).attr("d",(e=>e.path)).attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.strokeWidth)),e.append("g").selectAll().data(a.labels).join("text").text((e=>e.text)).attr("class",Ta("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("dy","0.35em").attr("text-anchor",(e=>e.textAnchor)).attr("fill",(e=>{var t;return null!==(t=e.style.fontColor)&&void 0!==t?t:null}));const n="hover-shape.sankey";function r(e){l.current=e}return null!==l.current&&r(l.current),t.on(n,r),()=>{t.on(n,null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ta()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};function Pa(e,t){let a=0;if(void 0===t)for(let t of e)(t=+t)&&(a+=t);else{let n=-1;for(let i of e)(i=+t(i,++n,e))&&(a+=i)}return a}function Ba(e,t){let a;if(void 0===t)for(const t of e)null!=t&&(a<t||void 0===a&&t>=t)&&(a=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(a<i||void 0===a&&i>=i)&&(a=i)}return a}function $a(e,t){return e.sourceLinks.length?e.depth:t-1}function Fa(e){return function(){return e}}function Ya(e,t){return Ua(e.source,t.source)||e.index-t.index}function Ka(e,t){return Ua(e.target,t.target)||e.index-t.index}function Ua(e,t){return e.y0-t.y0}function Ja(e){return e.value}function Xa(e){return e.index}function qa(e){return e.nodes}function Va(e){return e.links}function Ga(e,t){const a=e.get(t);if(!a)throw new Error("missing: "+t);return a}function Za({nodes:e}){for(const t of e){let e=t.y0,a=e;for(const a of t.sourceLinks)a.y0=e+a.width/2,e+=a.width;for(const e of t.targetLinks)e.y1=a+e.width/2,a+=e.width}}var Qa=Math.PI,en=2*Qa,tn=1e-6,an=en-tn;function nn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function rn(){return new nn}nn.prototype=rn.prototype={constructor:nn,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,a,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+a)+","+(this._y1=+n)},bezierCurveTo:function(e,t,a,n,i,r){this._+="C"+ +e+","+ +t+","+ +a+","+ +n+","+(this._x1=+i)+","+(this._y1=+r)},arcTo:function(e,t,a,n,i){e=+e,t=+t,a=+a,n=+n,i=+i;var r=this._x1,s=this._y1,l=a-e,o=n-t,c=r-e,d=s-t,u=c*c+d*d;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(u>tn)if(Math.abs(d*l-o*c)>tn&&i){var h=a-r,p=n-s,m=l*l+o*o,g=h*h+p*p,f=Math.sqrt(m),y=Math.sqrt(u),v=i*Math.tan((Qa-Math.acos((m+u-g)/(2*f*y)))/2),b=v/y,x=v/f;Math.abs(b-1)>tn&&(this._+="L"+(e+b*c)+","+(t+b*d)),this._+="A"+i+","+i+",0,0,"+ +(d*h>c*p)+","+(this._x1=e+x*l)+","+(this._y1=t+x*o)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,a,n,i,r){e=+e,t=+t,r=!!r;var s=(a=+a)*Math.cos(n),l=a*Math.sin(n),o=e+s,c=t+l,d=1^r,u=r?n-i:i-n;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+o+","+c:(Math.abs(this._x1-o)>tn||Math.abs(this._y1-c)>tn)&&(this._+="L"+o+","+c),a&&(u<0&&(u=u%en+en),u>an?this._+="A"+a+","+a+",0,1,"+d+","+(e-s)+","+(t-l)+"A"+a+","+a+",0,1,"+d+","+(this._x1=o)+","+(this._y1=c):u>tn&&(this._+="A"+a+","+a+",0,"+ +(u>=Qa)+","+d+","+(this._x1=e+a*Math.cos(i))+","+(this._y1=t+a*Math.sin(i))))},rect:function(e,t,a,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +a+"v"+ +n+"h"+-a+"Z"},toString:function(){return this._}};const sn=rn;var ln=Array.prototype.slice;function on(e){return function(){return e}}function cn(e){return e[0]}function dn(e){return e[1]}function un(e){return e.source}function hn(e){return e.target}function pn(e,t,a,n,i){e.moveTo(t,a),e.bezierCurveTo(t=(t+n)/2,a,t,i,n,i)}function mn(e){return[e.source.x1,e.y0]}function gn(e){return[e.target.x0,e.y1]}function fn(){return function(e){var t=un,a=hn,n=cn,i=dn,r=null;function s(){var s,l=ln.call(arguments),o=t.apply(this,l),c=a.apply(this,l);if(r||(r=s=sn()),e(r,+n.apply(this,(l[0]=o,l)),+i.apply(this,l),+n.apply(this,(l[0]=c,l)),+i.apply(this,l)),s)return r=null,s+""||null}return s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(a=e,s):a},s.x=function(e){return arguments.length?(n="function"==typeof e?e:on(+e),s):n},s.y=function(e){return arguments.length?(i="function"==typeof e?e:on(+e),s):i},s.context=function(e){return arguments.length?(r=null==e?null:e,s):r},s}(pn).source(mn).target(gn)}const yn=D("d3-scatter");function vn(e){const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current),n=m()(r,"scatter.states.hover"),s=m()(r,"scatter.states.inactive");e.selectAll("*").remove();const c=e.selectAll("path").data(a,xa).join("g").call(ua).attr("fill",(e=>e.point.data.color||e.point.series.color||"")).attr("opacity",(e=>e.point.opacity)).attr("cursor",(e=>e.point.series.cursor)),d=null==n?void 0:n.enabled,u=null==s?void 0:s.enabled;function h(e){var t;l.current=e;const a=null==e?void 0:e.find((e=>"scatter"===e.series.type)),n=null==a?void 0:a.data,r=null===(t=null==a?void 0:a.series)||void 0===t?void 0:t.id;c.datum(((e,t,a)=>{const l=(0,i.Ltv)(a[t]),o=Boolean(d&&e.point.data===n);if(e.hovered!==o&&(e.hovered=o,l.attr("z-index",o?999:null),fa(l).attr("visibility",pa),ya(l).call(ma,o?"hover":"normal")),o&&l.raise(),e.point.series.marker.states.normal.enabled){const n=Boolean(!u||!r||r===e.point.series.id);wa({element:a[t],state:s,active:n,datum:e})}return e}))}return null!==l.current&&h(l.current),t.on("hover-shape.scatter",h),()=>{t.on("hover-shape.scatter",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:yn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))}const bn=D("d3-treemap"),xn=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove();const{labelData:n,leaves:s,series:c}=a,d=e.selectAll("g").data(s).join("g").attr("transform",(e=>`translate(${e.x0},${e.y0})`)).attr("cursor",c.cursor).append("rect").attr("id",(e=>e.id||e.name)).attr("fill",(e=>{var t;if(e.data.color)return e.data.color;const a=null===(t=c.levels)||void 0===t?void 0:t.find((t=>t.index===e.depth));return(null==a?void 0:a.color)||c.color})).attr("width",(e=>e.x1-e.x0)).attr("height",(e=>e.y1-e.y0)),u=e.selectAll("tspan").data(n).join("text").text((e=>e.text)).attr("class",bn("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).style("font-size",(()=>c.dataLabels.style.fontSize)).style("font-weight",(()=>{var e;return(null===(e=c.dataLabels.style)||void 0===e?void 0:e.fontWeight)||null})).style("fill",(()=>{var e;return(null===(e=c.dataLabels.style)||void 0===e?void 0:e.fontColor)||null})).call(Ce,(e=>e.width)),h="hover-shape.treemap",p=m()(r,"treemap.states.hover"),g=m()(r,"treemap.states.inactive");function f(e){var t;l.current=e;const a=null==p?void 0:p.enabled,n=null==g?void 0:g.enabled,r=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.data;d.datum(((e,t,s)=>{const l=(0,i.Ltv)(s[t]),o=Boolean(a&&r===e.data),d=Boolean(n&&r&&!o);return l.attr("fill",(t=>{var a,n;const r=null===(a=c.levels)||void 0===a?void 0:a.find((e=>e.index===t.depth)),s=(null==r?void 0:r.color)||e.data.color||c.color;return o&&(null===(n=(0,i.yWT)(s))||void 0===n?void 0:n.brighter(null==p?void 0:p.brightness).toString())||s})).attr("opacity",(()=>d&&(null==g?void 0:g.opacity)||null)),e})),u.datum(((e,t,s)=>{const l=(0,i.Ltv)(s[t]),o=Boolean(a&&r===e.nodeData),c=Boolean(n&&r&&!o);return l.attr("opacity",(()=>c&&(null==g?void 0:g.opacity)||null)),e}))}return null!==l.current&&f(l.current),t.on(h,f),()=>{t.on(h,null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:bn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};const wn=D("d3-waterfall"),kn=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null),c=`.${wn("connector")}`;return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"waterfall.states.hover"),d=m()(r,"waterfall.states.inactive");n.selectAll("*").remove();const u=n.selectAll("allRects").data(a).join("rect").attr("class",wn("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>ut(e.data,e.series))).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let h=a.map((e=>e.label)).filter(Boolean);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(h=ra(h));const p=n.selectAll("text").data(h).join("text").text((e=>e.text)).attr("class",wn("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null));function g(e){l.current=e;const t=null==s?void 0:s.enabled,a=null==d?void 0:d.enabled;if(!e)return t&&u.attr("fill",(e=>ut(e.data,e.series))),void(a&&(u.attr("opacity",null),p.attr("opacity",null)));if(t){const t=e.map((e=>e.data.x));u.attr("fill",(e=>{var a;const n=ut(e.data,e.series);if(t.includes(e.data.x)){const e=null==s?void 0:s.brightness;return(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(e).toString())||n}return n}))}if(a){const t=e.map((e=>e.series.id));u.attr("opacity",(e=>t.includes(e.series.id)?null:(null==d?void 0:d.opacity)||null)),p.attr("opacity",(e=>t.includes(e.series.id)?null:(null==d?void 0:d.opacity)||null))}}return n.selectAll(c).data(a).join("path").attr("class",wn("connector")).attr("d",((e,t)=>{const n=(0,i.n8j)(),r=a[t-1];if(!r)return null;const s=[];return Number(r.data.y)>0?s.push([r.x,r.y]):s.push([r.x,r.y+r.height]),Number(e.data.y)>0&&!e.data.total?s.push([e.x+e.width,e.y+e.height]):s.push([e.x+e.width,e.y]),n(s)})).attr("stroke-width",1).attr("stroke-dasharray",(()=>Te(v.Dash,1))),null!==l.current&&g(l.current),t.on("hover-shape.waterfall",g),()=>{t.on("hover-shape.waterfall",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:wn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Sn=e=>{const{boundsWidth:t,boundsHeight:a,dispatcher:r,series:s,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u,split:h,htmlLayout:p}=e,g=n.useMemo((()=>{const e=we(s),g=(0,i.Os0)(e,(e=>e.type)),f=[],y=Array.from(g).reduce(((e,s)=>{const[g,y]=s;switch(g){case"bar-x":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,xAxis:n,xScale:r,yScale:s,boundsHeight:l}=e,o=m()(n,"categories",[]),c=m()(a,"bar-x.barMaxWidth"),d=m()(a,"bar-x.barPadding"),u=m()(a,"bar-x.groupPadding"),h=m()(a,"bar-x.dataSorting"),p="desc"===(null==h?void 0:h.direction)?i.rGT:i.V_A,g=(()=>{switch(null==h?void 0:h.key){case"y":return"data.y";case"name":return"series.name";default:return}})(),f={};t.forEach((e=>{e.data.forEach((t=>{const a="category"===n.type?Le({axisDirection:"x",categories:o,data:t}):t.x;if(a){f[a]||(f[a]={});const n=f[a];n[e.stackId]||(n[e.stackId]=[]),n[e.stackId].push({data:t,series:e})}}))}));let y=1/0;if("category"===n.type)y=r.bandwidth();else{const e=r,a=t.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.x)))),e)),[]);a.sort().forEach(((t,n)=>{if(n>0&&t!==a[n-1]){const i=e(t)-e(a[n-1]);i<y&&(y=i)}}))}const v=(0,i.T9B)(Object.values(f),(e=>Object.values(e).length))||1,b=Math.max(y*u,1),x=y-b,w=Math.max(y*d,1),k=Math.max(1,Math.min(x/v-w,c)),S=[];return Object.entries(f).forEach((([e,a])=>{const o=Object.values(a),c=k*o.length+w*(o.length-1);o.forEach(((a,o)=>{let d=0;const u=[],h=g?(0,i.diJ)(a,((e,t)=>p(m()(e,g),m()(t,g)))):a;if(h.forEach(((t,a)=>{const i=t.series.yAxis,l=s[i];let p;if("category"===n.type){const t=r;p=(t(e)||0)+t.bandwidth()/2}else p=r(Number(e));const g=p-c/2+(k+w)*o,f=t.data.y,y=l(f),v=l(0),b=f>0?v-y:y-v,x={x:g,y:f>0?y-d:l(0),width:k,height:b,opacity:m()(t.data,"opacity",null),data:t.data,series:t.series,htmlElements:[],isLastStackItem:a===h.length-1},S=Aa(x);t.series.dataLabels.html&&S?x.htmlElements.push({x:S.x,y:S.y,content:S.text,size:S.size}):x.label=Aa(x),u.push(x),d+=b+1})),t.some((e=>"percent"===e.stacking))){let e=0;const t=l/(d-u.length);u.forEach((a=>{a.height=a.height*t,a.y=l-a.height-e,e+=a.height+1}))}S.push(...u)}))})),S})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u,boundsHeight:a});e.push(n.createElement(Ma,{key:"bar-x",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"bar-y":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,yAxis:n,xScale:r,yScale:[s]}=e,l=r,o=l(l.domain()[1]),c=m()(a,"bar-y.barMaxWidth"),d=m()(a,"bar-y.barPadding"),u=m()(a,"bar-y.groupPadding"),h=m()(a,"bar-y.dataSorting"),p="desc"===(null==h?void 0:h.direction)?i.rGT:i.V_A,g=(()=>{switch(null==h?void 0:h.key){case"x":return"data.x";case"name":return"series.name";default:return}})(),f=function(e,t){const a={};return e.forEach((e=>{e.data.forEach((n=>{const i=m()(e,"yAxis",0),r=t[i],s=m()(r,"categories",[]),l="category"===r.type?Le({axisDirection:"y",categories:s,data:n}):n.y;l&&(a[l]||(a[l]={}),a[l][e.stackId]||(a[l][e.stackId]=[]),a[l][e.stackId].push({data:n,series:e}))}))})),a}(t,n),y=function(e,t,a){let n=1/0;if("category"===t[0].type)n=a.bandwidth();else{const t=a,i=e.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.y)))),e)),[]);i.sort().forEach(((e,a)=>{if(a>0&&e!==i[a-1]){const r=t(e)-t(i[a-1]);r<n&&(n=r)}}))}return n}(t,n,s),v=(0,i.T9B)(Object.values(f),(e=>Object.values(e).length))||1,b=Math.max(y*u,1),x=y-b,w=Math.max(y*d,1),k=Math.max(1,Math.min(x/v-w,c)),S=[];return Object.entries(f).forEach((([e,a])=>{const r=Object.values(a),c=k*r.length+w*(r.length-1);r.forEach(((a,r)=>{const d=l(0);let u=d;const h=[],f=g?(0,i.diJ)(a,((e,t)=>p(m()(e,g),m()(t,g)))):a;if(f.forEach((({data:t,series:a},i)=>{let o;o="category"===n[0].type?(s(e)||0)+y/2:s(Number(e));const p=o-c/2+(k+w)*r,g=Number(t.x),v=g>0?l(g)-d:d-l(g),b={x:g>0?u:u-v,y:p,width:v,height:k,color:t.color||a.color,opacity:m()(t,"opacity",null),data:t,series:a,htmlElements:[],isLastStackItem:i===f.length-1};h.push(b),u+=v+1})),t.some((e=>"percent"===e.stacking))){let e=0;const t=o/(u-h.length);h.forEach((a=>{a.width=a.width*t,a.x=e,e+=a.width}))}S.push(...h)}))})),S.forEach((e=>{!function(e){const t=e.series.dataLabels;if(!t.enabled)return;const a=e.data,n=String(a.label||a.x),{maxHeight:i,maxWidth:r}=Re({labels:[n],style:t.style,html:t.html}),s=t.inside?e.x+e.width/2:e.x+e.width+7,l=e.y+e.height/2;t.html?e.htmlElements.push({x:s,y:l-i/2,content:n,size:{width:r,height:i}}):e.label={x:s,y:l+i/2,text:n,textAnchor:t.inside?"middle":"right",style:t.style,series:e.series,size:{width:r,height:i}}}(e)})),S})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(Ca,{key:"bar-y",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"waterfall":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,xAxis:n,xScale:i,yAxis:[r],yScale:[s]}=e,l=s(s.domain()[0]),o=m()(a,"waterfall.barMaxWidth"),c=m()(a,"waterfall.barPadding"),d=t.reduce(((e,t)=>(e.push(...t.data.map((e=>({data:e,series:t})))),e)),[]),u=aa()(d,(e=>e.data.x)),h=function(e){const{series:t,xAxis:a,xScale:n}=e;if("category"===a.type)return n.bandwidth();const i=n,r=t.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.x)))),e)),[]);let s=1/0;return r.sort().forEach(((e,t)=>{if(t>0&&e!==r[t-1]){const a=i(e)-i(r[t-1]);a<s&&(s=a)}})),s}({series:t,xAxis:n,xScale:i}),p=Math.max(h*c,1),g=Math.max(1,Math.min(h-p,o)),f=ba({point:{y:0},yScale:s,yAxis:r});let y=0;const v=[];return u.forEach(((e,t)=>{if("number"!=typeof e.data.y&&!e.data.total)return;e.data.total||(y+=Number(e.data.y));const a=v[v.length-1],o=va({point:e.data,xAxis:n,xScale:i})-g/2,c=Number(e.data.total?y:e.data.y),d=f-ba({point:{y:Math.abs(c)},yScale:s,yAxis:r});let u;u=!a||e.data.total?ba({point:{y:c>0?c:0},yScale:s,yAxis:r}):Number(a.data.y)<0?Number(e.data.y)>0?a.y+a.height-d:a.y+a.height:Number(e.data.y)<0?a.y:a.y-d;const h={x:o,y:u,width:g,height:d,opacity:m()(e.data,"opacity",null),data:e.data,series:e.series,subTotal:y,htmlElements:[]};h.label=function(e,t){if(!e.series.dataLabels.enabled)return;const a=String(e.data.label||e.subTotal),n=e.series.dataLabels.style,{maxHeight:i,maxWidth:r}=Re({labels:[a],style:n});let s;return s=Number(e.data.y)>0||e.data.total?Math.max(i,e.y-e.series.dataLabels.padding):Math.min(t-e.series.dataLabels.padding,e.y+e.height+e.series.dataLabels.padding+i),{text:a,x:e.x+e.width/2,y:s,style:n,size:{width:r,height:i},textAnchor:"middle",series:e.series}}(h,l),v.push(h)})),v})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(kn,{key:"waterfall",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"line":if(c&&u){const t=(e=>{const{series:t,xAxis:a,yAxis:n,xScale:i,yScale:r,split:s}=e,[l,o]=i.range(),c=o/(1-a.maxPadding);return t.reduce(((e,t)=>{var l;const o=t.yAxis,d=n[o],u=(null===(l=s.plots[d.plotIndex])||void 0===l?void 0:l.top)||0,h=r[t.yAxis],p=t.data.map((e=>({x:va({point:e,xAxis:a,xScale:i}),y:u+ba({point:e,yAxis:d,yScale:h}),active:!0,data:e,series:t}))),m=[];let g=[];t.dataLabels.enabled&&(t.dataLabels.html?m.push(...p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=Re({labels:[n],html:!0});return{x:Math.min(a-i.maxWidth,Math.max(0,e.x)),y:Math.max(0,e.y-t.dataLabels.padding-i.maxHeight),content:n,size:{width:i.maxWidth,height:i.maxHeight}}}(e,t,c)))):g=p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=t.dataLabels.style,r=Re({labels:[n],style:i}),s={text:n,x:e.x,y:e.y-t.dataLabels.padding,style:i,size:{width:r.maxWidth,height:r.maxHeight},textAnchor:"middle",series:t,active:!0},l=na(s);if(l<0)s.x=s.x+Math.abs(l);else{const e=l+s.size.width;e>a&&(s.x=s.x-a-e)}return s}(e,t,c))));let f=[];(t.marker.states.normal.enabled||t.marker.states.hover.enabled)&&(f=p.map((e=>({point:e,active:!0,hovered:!1}))));const y={points:p,markers:f,labels:g,color:t.color,width:t.lineWidth,series:t,hovered:!1,active:!0,id:t.id,dashStyle:t.dashStyle,linecap:t.linecap,opacity:t.opacity,htmlElements:m};return e.push(y),e}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u,split:h});e.push(n.createElement(Oa,{key:"line",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"area":if(c&&u){const t=(e=>{const{series:t,xAxis:a,xScale:n,yAxis:r,yScale:s,boundsHeight:l}=e,[o,c]=n.range(),d=c/(1-a.maxPadding);return Array.from((0,i.Os0)(t,(e=>e.stackId))).reduce(((e,[o,c])=>{const u=function(e,t,a){const n=t.categories||[],r=e.reduce(((e,i)=>(i.data.forEach((i=>{const r=String("category"===t.type?Le({axisDirection:"x",categories:n,data:i}):i.x);e.has(r)||e.set(r,va({point:i,xAxis:t,xScale:a}))})),e)),new Map);return"category"===t.type?n.reduce(((e,t)=>{const a=r.get(t);return"number"==typeof a&&e.push([t,a]),e}),[]):(0,i.diJ)(Array.from(r),(([e,t])=>t))}(c,a,n),h=new Map;u.forEach((([e])=>{h.set(e,0)}));const p=c.reduce(((e,t)=>{const n=t.yAxis,i=r[n],l=s[n],o=ba({point:{y:0},yAxis:i,yScale:l}),c=t.data.reduce(((e,t)=>{const n=String("category"===a.type?Le({axisDirection:"x",categories:a.categories||[],data:t}):t.x);return e.set(n,t)}),new Map),p=u.reduce(((e,[a,n])=>{const r=h.get(a)||0,s=c.get(a)||{x:a,y:0},d=ba({point:s,yAxis:i,yScale:l})-r;return h.set(a,o-d),e.push({y0:o-r,x:n,y:d,data:s,series:t}),e}),[]);let m=[];const g=[];if(t.dataLabels.enabled){const e=p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=t.dataLabels.style,r=Re({labels:[n],style:i,html:t.dataLabels.html}),s={text:n,x:e.x,y:e.y-t.dataLabels.padding,style:i,size:{width:r.maxWidth,height:r.maxHeight},textAnchor:"middle",series:t,active:!0},l=na(s);if(l<0)s.x=s.x+Math.abs(l);else{const e=l+s.size.width;e>a&&(s.x=s.x-(e-a))}return s}(e,t,d)));if(t.dataLabels.html){const a=e.map((e=>{var a;const n=null!==(a=e.style)&&void 0!==a?a:t.dataLabels.style,i=Re({labels:[e.text],style:n,html:!0});return{x:e.x-e.size.width/2,y:e.y,content:e.text,size:{width:i.maxWidth,height:i.maxHeight}}}));g.push(...a)}else m=e}let f=[];return(t.marker.states.normal.enabled||t.marker.states.hover.enabled)&&(f=p.map((e=>({point:e,active:!0,hovered:!1})))),e.push({points:p,markers:f,labels:m,color:t.color,opacity:t.opacity,width:t.lineWidth,series:t,hovered:!1,active:!0,id:t.id,htmlElements:g}),e}),[]);return t.some((e=>"percent"===e.stacking))&&u.forEach((([e],t)=>{const a=h.get(e)||0;let n=0;const i=l/a;p.forEach((e=>{const a=e.points[t];if(a){const e=(a.y0-a.y)*i;a.y0=l-e-n,a.y=a.y0+e,n+=e}}))})),e.concat(p)}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u,boundsHeight:a});e.push(n.createElement(La,{key:"area",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"scatter":if(c&&u){const t=(e=>{const{series:t,xAxis:a,xScale:n,yAxis:i,yScale:r}=e;return t.reduce(((e,t)=>{const s=m()(t,"yAxis",0),l=i[s],o=r[s];return("category"===a.type||"category"===l.type?t.data:t.data.filter((e=>"number"==typeof e.x&&"number"==typeof e.y))).forEach((i=>{e.push({point:{data:i,series:t,x:va({point:i,xAxis:a,xScale:n}),y:ba({point:i,yAxis:l,yScale:o}),opacity:m()(i,"opacity",null)},hovered:!1,active:!0,htmlElements:[]})})),e}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(vn,{key:"scatter",dispatcher:r,preparedData:t,seriesOptions:l,htmlLayout:p})),f.push(...t)}break;case"pie":{const s=function(e){const{series:t,boundsWidth:a,boundsHeight:n}=e,r=Math.min(a,n)/2,s=(0,i.Os0)(t,(e=>e.stackId)),l=e=>{const{data:t,series:n}=e,{dataLabels:r}=n[0],s=[],l=[],o=[];if(!r.enabled)return{labels:s,htmlLabels:l,connectors:o};let c=(0,i.n8j)();const d=function(e){switch(e.connectorCurve){case"basic":return i.qrM;case"linear":return i.lUB}}(t);d&&(c=c.curve(d));const{style:u,connectorPadding:h,distance:p}=r,{maxHeight:m}=Re({labels:["Some Label"],style:u}),g=(0,i.JLW)().innerRadius((e=>e.data.radius)).outerRadius((e=>e.data.radius)),f=(0,i.JLW)().innerRadius((e=>e.data.radius+p/2)).outerRadius((e=>e.data.radius+p/2)),y=(0,i.JLW)().innerRadius((e=>e.data.radius+p)).outerRadius((e=>e.data.radius+p)),v=(0,i.JLW)().innerRadius((e=>e.data.radius+p+h)).outerRadius((e=>e.data.radius+p+h));return n.forEach(((e,n)=>{const i=s[s.length-1],d=String(e.data.label||e.data.value),h=r.html,p=Re({labels:[d],style:u,html:h}),b=p.maxWidth,x=t.segments[n],w=e=>{let[t,n]=v.centroid(Object.assign(Object.assign({},x),{startAngle:e,endAngle:e}));return h?(t=t<0?t-b:t,n-=p.maxHeight):n=n<0?n-m:n,t=Math.max(-a/2,t),[t,n]},k=e=>{const t=g.centroid(x),a=y.centroid(Object.assign(Object.assign({},x),{startAngle:e,endAngle:e}));return"straight-line"===r.connectorShape?[t,a]:[t,f.centroid(x),a]},S=Math.max((null==i?void 0:i.angle)||0,x.startAngle+(x.endAngle-x.startAngle)/2),[L,A]=w(S),E={text:d,x:L,y:A,style:u,size:{width:b,height:m},maxWidth:b,textAnchor:S<Math.PI?"start":"end",series:{id:e.id},active:!0,segment:x.data,angle:S};let M=!1;if(i&&(M=ia(i,E,r.padding),M)){let e=!0;const t=Math.PI/180;for(;e;){const a=E.angle+t;if(a>ja&&a%ja>s[0].angle)e=!1;else{E.angle=a;const[t,n]=w(a);E.x=t,E.y=n,ia(i,E,r.padding)||(e=!1,M=!1)}}}if(r.allowOverlap||!M){const e=na(E);if(Math.abs(e)>a/2)E.maxWidth=E.size.width-(Math.abs(e)-a/2);else{const t=e+E.size.width;t>a/2&&(E.maxWidth=E.size.width-(t-a/2))}h?l.push({x:t.center[0]+E.x,y:Math.max(0,t.center[1]+E.y),content:E.text,size:E.size}):s.push(E);const n={path:c(k(S)),color:x.data.color};o.push(n)}})),{labels:s,htmlLabels:l,connectors:o}};return Array.from(s).map((([e,t])=>{const i=((e,t)=>{var i;const s=t[0],{center:l,borderWidth:o,borderColor:c,borderRadius:d,innerRadius:u,dataLabels:h}=s,p={id:e,center:Ha(a,n,l),innerRadius:0,segments:[],labels:[],htmlLabels:[],connectors:[],borderColor:c,borderWidth:o,borderRadius:d,series:t[0],connectorCurve:h.connectorCurve,halo:{enabled:s.states.hover.halo.enabled,opacity:s.states.hover.halo.opacity,size:s.states.hover.halo.size}},{maxHeight:m}=Re({labels:["Some Label"],style:h.style});let g=0;const f=t.map((e=>{var t;let a=r;h.enabled&&(a-=h.distance+h.connectorPadding+m);const n=null!==(t=I({value:e.radius,base:a}))&&void 0!==t?t:a;return g=Math.max(g,n),{value:e.value,color:e.color,opacity:e.opacity,series:e,hovered:!1,active:!0,pie:p,radius:n}}));return p.segments=Na(f),p.innerRadius=null!==(i=I({value:u,base:g}))&&void 0!==i?i:0,p})(e,t),s=l({data:i,series:t}),o=Math.max(...i.segments.map((e=>e.data.radius))),c=Math.min(i.center[1]-o,...s.labels.map((e=>e.y+i.center[1])),...s.htmlLabels.map((e=>e.y))),d=Math.max(i.center[1]+o,...s.labels.map((e=>e.y+i.center[1]+e.size.height)),...s.htmlLabels.map((e=>e.y+e.size.height))),u=Math.floor(c-i.halo.size);u>0&&(i.segments.forEach((e=>{e.data.radius+=u/2})),i.center[1]-=u/2);const h=Math.floor(n-d-i.halo.size);h>0&&(i.segments.forEach((e=>{e.data.radius+=h/2})),i.center[1]+=h/2);const{labels:p,htmlLabels:m,connectors:g}=l({data:i,series:t});return i.labels=p,i.htmlLabels=m,i.connectors=g,i}))}({series:y,boundsWidth:t,boundsHeight:a});e.push(n.createElement(_a,{key:"pie",dispatcher:r,preparedData:s,seriesOptions:l,htmlLayout:p})),f.push(...s);break}case"treemap":{const s=function(e){var t;const{series:a,width:n,height:r}=e,s=function(e){return e.data.reduce(((t,a)=>{const n=Object.assign({},a);return n.parentId||(n.parentId=e.id),t.push(n),t}),[{name:e.name,id:e.id}])}(a),l=(0,i.zTO)().id((e=>e.id?e.id:Array.isArray(e.name)?e.name.join():e.name)).parentId((e=>e.parentId))(s).sum((e=>e.value||0)),o=(0,i.hkb)();switch(a.layoutAlgorithm){case w.Binary:o.tile(i.GaH);break;case w.Dice:o.tile(i.iLc);break;case w.Slice:o.tile(i.XvW);break;case w.SliceDice:o.tile(i.Yix);break;case w.Squarify:o.tile(i.bC4)}const c=o.size([n,r]).paddingInner((e=>{var t,n;const i=null===(t=a.levels)||void 0===t?void 0:t.find((t=>t.index===e.depth+1));return null!==(n=null==i?void 0:i.padding)&&void 0!==n?n:1}))(l),d=c.leaves();let u=[];const h=[];if(null===(t=a.dataLabels)||void 0===t?void 0:t.enabled){const{html:e,padding:t,align:n}=a.dataLabels,i=function(e){const{data:t,html:a,padding:n,align:i}=e;return t.reduce(((e,t)=>((Array.isArray(t.data.name)?t.data.name:[t.data.name]).forEach(((r,s)=>{var l;const{maxHeight:o,maxWidth:c}=null!==(l=Re({labels:[r],html:a}))&&void 0!==l?l:{},d=t.x0+n,u=t.x1-n,h=Math.max(0,u-d);let p=d;const m=s*o+t.y0+n;switch(i){case"left":p=d;break;case"center":p=Math.max(d,d+(h-c)/2);break;case"right":p=Math.max(d,u-c)}const g=a?{content:r,x:p,y:m,size:{width:h,height:o}}:{text:r,x:p,y:m,width:h,nodeData:t.data};e.push(g)})),e)),[])}({html:e,padding:t,align:n,data:d});e?h.push(...i):u=i}return{labelData:u,leaves:d,series:a,htmlElements:h}}({series:y[0],width:t,height:a});e.push(n.createElement(xn,{key:"treemap",dispatcher:r,preparedData:s,seriesOptions:l,htmlLayout:p})),f.push(s);break}case"sankey":{const i=function(e){const{series:t,width:a,height:n}=e,i=function(){let e,t,a,n=0,i=0,r=1,s=1,l=24,o=8,c=Xa,d=$a,u=qa,h=Va,p=6;function m(){const m={nodes:u.apply(null,arguments),links:h.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,a]of e.entries())a.index=t,a.sourceLinks=[],a.targetLinks=[];const n=new Map(e.map(((t,a)=>[c(t,a,e),t])));for(const[e,a]of t.entries()){a.index=e;let{source:t,target:i}=a;"object"!=typeof t&&(t=a.source=Ga(n,t)),"object"!=typeof i&&(i=a.target=Ga(n,i)),t.sourceLinks.push(a),i.targetLinks.push(a)}if(null!=a)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(a),n.sort(a)}(m),function({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(Pa(t.sourceLinks,Ja),Pa(t.targetLinks,Ja)):t.fixedValue}(m),function({nodes:e}){const t=e.length;let a=new Set(e),n=new Set,i=0;for(;a.size;){for(const e of a){e.depth=i;for(const{target:t}of e.sourceLinks)n.add(t)}if(++i>t)throw new Error("circular link");a=n,n=new Set}}(m),function({nodes:e}){const t=e.length;let a=new Set(e),n=new Set,i=0;for(;a.size;){for(const e of a){e.height=i;for(const{source:t}of e.targetLinks)n.add(t)}if(++i>t)throw new Error("circular link");a=n,n=new Set}}(m),function(a){const c=function({nodes:e}){const a=Ba(e,(e=>e.depth))+1,i=(r-n-l)/(a-1),s=new Array(a);for(const t of e){const e=Math.max(0,Math.min(a-1,Math.floor(d.call(null,t,a))));t.layer=e,t.x0=n+e*i,t.x1=t.x0+l,s[e]?s[e].push(t):s[e]=[t]}if(t)for(const e of s)e.sort(t);return s}(a);e=Math.min(o,(s-i)/(Ba(c,(e=>e.length))-1)),function(t){const a=function(e,t){let a;if(void 0===t)for(const t of e)null!=t&&(a>t||void 0===a&&t>=t)&&(a=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n))&&(a>i||void 0===a&&i>=i)&&(a=i)}return a}(t,(t=>(s-i-(t.length-1)*e)/Pa(t,Ja)));for(const n of t){let t=i;for(const i of n){i.y0=t,i.y1=t+i.value*a,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*a}t=(s-t+e)/(n.length+1);for(let e=0;e<n.length;++e){const a=n[e];a.y0+=t*(e+1),a.y1+=t*(e+1)}w(n)}}(c);for(let e=0;e<p;++e){const t=Math.pow(.99,e),a=Math.max(1-t,(e+1)/p);f(c,t,a),g(c,t,a)}}(m),Za(m),m}function g(e,a,n){for(let i=1,r=e.length;i<r;++i){const r=e[i];for(const e of r){let t=0,n=0;for(const{source:a,value:i}of e.targetLinks){let r=i*(e.layer-a.layer);t+=k(a,e)*r,n+=r}if(!(n>0))continue;let i=(t/n-e.y0)*a;e.y0+=i,e.y1+=i,x(e)}void 0===t&&r.sort(Ua),y(r,n)}}function f(e,a,n){for(let i=e.length-2;i>=0;--i){const r=e[i];for(const e of r){let t=0,n=0;for(const{target:a,value:i}of e.sourceLinks){let r=i*(a.layer-e.layer);t+=S(e,a)*r,n+=r}if(!(n>0))continue;let i=(t/n-e.y0)*a;e.y0+=i,e.y1+=i,x(e)}void 0===t&&r.sort(Ua),y(r,n)}}function y(t,a){const n=t.length>>1,r=t[n];b(t,r.y0-e,n-1,a),v(t,r.y1+e,n+1,a),b(t,s,t.length-1,a),v(t,i,0,a)}function v(t,a,n,i){for(;n<t.length;++n){const r=t[n],s=(a-r.y0)*i;s>1e-6&&(r.y0+=s,r.y1+=s),a=r.y1+e}}function b(t,a,n,i){for(;n>=0;--n){const r=t[n],s=(r.y1-a)*i;s>1e-6&&(r.y0-=s,r.y1-=s),a=r.y0-e}}function x({sourceLinks:e,targetLinks:t}){if(void 0===a){for(const{source:{sourceLinks:e}}of t)e.sort(Ka);for(const{target:{targetLinks:t}}of e)t.sort(Ya)}}function w(e){if(void 0===a)for(const{sourceLinks:t,targetLinks:a}of e)t.sort(Ka),a.sort(Ya)}function k(t,a){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:r}of t.sourceLinks){if(i===a)break;n+=r+e}for(const{source:e,width:i}of a.targetLinks){if(e===t)break;n-=i}return n}function S(t,a){let n=a.y0-(a.targetLinks.length-1)*e/2;for(const{source:i,width:r}of a.targetLinks){if(i===t)break;n+=r+e}for(const{target:e,width:i}of t.sourceLinks){if(e===a)break;n-=i}return n}return m.update=function(e){return Za(e),e},m.nodeId=function(e){return arguments.length?(c="function"==typeof e?e:Fa(e),m):c},m.nodeAlign=function(e){return arguments.length?(d="function"==typeof e?e:Fa(e),m):d},m.nodeSort=function(e){return arguments.length?(t=e,m):t},m.nodeWidth=function(e){return arguments.length?(l=+e,m):l},m.nodePadding=function(t){return arguments.length?(o=e=+t,m):o},m.nodes=function(e){return arguments.length?(u="function"==typeof e?e:Fa(e),m):u},m.links=function(e){return arguments.length?(h="function"==typeof e?e:Fa(e),m):h},m.linkSort=function(e){return arguments.length?(a=e,m):a},m.size=function(e){return arguments.length?(n=i=0,r=+e[0],s=+e[1],m):[r-n,s-i]},m.extent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],i=+e[0][1],s=+e[1][1],m):[[n,i],[r,s]]},m.iterations=function(e){return arguments.length?(p=+e,m):p},m}().nodeId((e=>e.name)).nodeSort((e=>e.index)).nodeWidth(15).nodePadding(10).extent([[1,5],[a-1,n-5]]),{nodes:r,links:s}=i({nodes:t.data,links:t.data.reduce(((e,a)=>(a.links.forEach((n=>{const i=t.data.find((e=>e.name===n.name));i&&e.push({source:a,target:i,value:n.value})})),e)),[])}),l=r.map((e=>{var a,n,i,r,s,l;return{x0:null!==(a=e.x0)&&void 0!==a?a:0,x1:null!==(n=e.x1)&&void 0!==n?n:0,y0:null!==(i=e.y0)&&void 0!==i?i:0,y1:null!==(r=e.y1)&&void 0!==r?r:0,color:null!==(s=e.color)&&void 0!==s?s:"",data:t.data[null!==(l=e.index)&&void 0!==l?l:0]}})),o=s.map((e=>{var t,a;return{opacity:.75,color:null!==(t=e.source.color)&&void 0!==t?t:"",path:fn()(e),strokeWidth:Math.max(1,null!==(a=e.width)&&void 0!==a?a:0),source:e.source,target:e.target,value:e.value}})),c=[];if(t.dataLabels.enabled){const e=r.map((e=>{var n,i,r,s;const l=null!==(n=e.x0)&&void 0!==n?n:0,o=null!==(i=e.x1)&&void 0!==i?i:0,c=null!==(r=e.y0)&&void 0!==r?r:0,d=null!==(s=e.y1)&&void 0!==s?s:0;return{text:e.name,x:l<a/2?o+6:l-6,y:(d+c)/2,textAnchor:l<a/2?"start":"end",style:t.dataLabels.style}}));c.push(...e)}return{series:t,nodes:l,links:o,htmlElements:[],labels:c}}({series:y[0],width:t,height:a});e.push(n.createElement(Ia,{key:"sankey",dispatcher:r,preparedData:i,seriesOptions:l,htmlLayout:p})),f.push(i);break}default:throw new C({message:`The display method is not defined for a series with type "${g}"`})}return e}),[]);return{shapes:y,shapesData:f}}),[t,a,r,s,l,o,c,d,u]);return{shapes:g.shapes,shapesData:g.shapesData}};function Ln(e,t){const a=null==e?void 0:e.min;return void 0===a&&(null==t?void 0:t.some((e=>me.includes(e.type))))?t.reduce(((e,t)=>{const a=t.data.reduce(((e,t)=>Math.min(e,m()(t,"x",0))),0);return Math.min(e,a)}),0):a}function An(e,t){const a=null==e?void 0:e.min;return void 0===a&&(null==t?void 0:t.some((e=>pe.includes(e.type))))?t.reduce(((e,t)=>{if("waterfall"===t.type){const a=t.data.reduce(((e,a)=>Math.min(e,ht(a,t)||0)),0);return Math.min(e,a)}{const a=t.data.reduce(((e,t)=>Math.min(e,m()(t,"y",0))),0);return Math.min(e,a)}}),0):a}function En(e){const{width:t,height:a,data:i,dispatcher:r,htmlLayout:s}=e,l=Ct(t),o=Ct(a),{chart:c,title:d,tooltip:u}=(e=>{const{data:{chart:t,title:a,tooltip:i}}=e,r=n.useMemo((()=>{const e=(({title:e})=>{const t=m()(e,"text"),a={fontSize:m()(e,"style.fontSize","15px"),fontWeight:m()(e,"style.fontWeight")},n=t?Se({text:t,style:a})+16:0;return t?{text:t,style:a,height:n}:void 0})({title:a}),n=(e=>{const{tooltip:t}=e;return Object.assign(Object.assign({},t),{enabled:m()(t,"enabled",!0)})})({tooltip:i});return{chart:Rt({chart:t,preparedTitle:e}),title:e,tooltip:n}}),[t,a,i]);return r})({data:i}),h=n.useMemo((()=>(({xAxis:e,series:t,width:a})=>{var n;const i=m()(e,"title.text",""),r=Object.assign(Object.assign({},A.style),m()(e,"title.style")),s=m()(e,"title.maxRowCount",A.maxRowCount),l=Oe({text:i,style:r,width:a}).slice(0,s),o=Re({labels:[i],style:r}),c={fontSize:m()(e,"labels.style.fontSize",S)},d={type:m()(e,"type","linear"),labels:{enabled:m()(e,"labels.enabled",!0),margin:m()(e,"labels.margin",10),padding:m()(e,"labels.padding",10),dateFormat:m()(e,"labels.dateFormat"),numberFormat:m()(e,"labels.numberFormat"),rotation:m()(e,"labels.rotation",0),style:c,width:0,height:0,lineHeight:Se({text:"Tmp",style:c}),maxWidth:m()(e,"labels.maxWidth",80)},lineColor:m()(e,"lineColor"),categories:m()(e,"categories"),timestamps:m()(e,"timestamps"),title:{text:i,style:r,margin:m()(e,"title.margin",A.margin),height:o.maxHeight*l.length,width:o.maxWidth,align:m()(e,"title.align",A.align),maxRowCount:m()(e,"title.maxRowCount",A.maxRowCount)},min:Ln(e,t),maxPadding:m()(e,"maxPadding",.01),grid:{enabled:m()(e,"grid.enabled",!0)},ticks:{pixelInterval:m()(e,"ticks.pixelInterval")},position:"bottom",plotIndex:0,plotLines:[]},{height:u,rotation:h}=function({axis:e,series:t,width:a,autoRotation:n=!0}){const i=_e({scale:ea(e,t,a),count:We({axis:e,range:a}),maxCount:Ne({width:a,axis:e})}),r=Ae(e,i),s=i.map((t=>ke({axis:e,value:t,step:r}))),l=function({width:e,labels:t,padding:a=0,style:n}){const i=(e-a*(t.length-1))/t.length,r=(0,Ee.A)(document.body).append("text").style("font-size",(null==n?void 0:n.fontSize)||""),s=t.some((e=>{var t,a;return((null===(a=null===(t=r.text(e).node())||void 0===t?void 0:t.getBoundingClientRect())||void 0===a?void 0:a.width)||0)>i}));return r.remove(),s}({width:a,labels:s,padding:e.labels.padding,style:e.labels.style}),o=l&&n?-45:0,c=e.labels.rotation||o,d=c?Re({labels:s,style:e.labels.style,rotation:c}).maxHeight:e.labels.lineHeight,u=c?P(c)*e.labels.maxWidth:d;return{height:Math.min(u,d),rotation:c}}({axis:d,series:t,width:a,autoRotation:null===(n=null==e?void 0:e.labels)||void 0===n?void 0:n.autoRotation});return d.labels.height=u,d.labels.rotation=h,d})({xAxis:i.xAxis,width:t,series:i.series.data})),[i,t]),p=n.useMemo((()=>(({series:e,yAxis:t,height:a})=>{const n=[];return(t||[{}]).map((t=>{const i=m()(t,"plotIndex",0),r=!n[i];r&&(n[i]=[]),n[i].push(t);const s=r?"left":"right",l=m()(t,"labels.enabled",!0),o={fontSize:m()(t,"labels.style.fontSize",S)},c=m()(t,"title.text",""),d=Object.assign(Object.assign({},E.style),m()(t,"title.style")),u=m()(t,"title.maxRowCount",E.maxRowCount),h=Oe({text:c,style:d,width:a}).slice(0,u),p=Re({labels:[c],style:d}),g={type:m()(t,"type",M),labels:{enabled:l,margin:l?m()(t,"labels.margin",10):0,padding:l?m()(t,"labels.padding",10):0,dateFormat:m()(t,"labels.dateFormat"),numberFormat:m()(t,"labels.numberFormat"),style:o,rotation:m()(t,"labels.rotation",0),width:0,height:0,lineHeight:Se({text:"TmpLabel",style:o}),maxWidth:m()(t,"labels.maxWidth",80)},lineColor:m()(t,"lineColor"),categories:m()(t,"categories"),timestamps:m()(t,"timestamps"),title:{text:c,margin:m()(t,"title.margin",E.margin),style:d,width:p.maxWidth,height:p.maxHeight*h.length,align:m()(t,"title.align",E.align),maxRowCount:u},min:An(t,e),maxPadding:m()(t,"maxPadding",.05),grid:{enabled:m()(t,"grid.enabled",r)},ticks:{pixelInterval:m()(t,"ticks.pixelInterval")},position:m()(t,"position",s),plotIndex:m()(t,"plotIndex",0),plotLines:m()(t,"plotLines",[]).map((e=>({value:m()(e,"value",0),color:m()(e,"color","var(--g-color-base-brand)"),width:m()(e,"width",1),dashStyle:m()(e,"dashStyle",v.Solid),opacity:m()(e,"opacity",1),layerPlacement:m()(e,"layerPlacement","before")})))};return l&&(g.labels.width=(e=>{const{axis:t,series:a}=e;if(!t.labels.enabled)return 0;const n=De(Qt(t,a,1)),i=Ae(t,n);return Re({labels:n.map((e=>ke({axis:t,value:e,step:i}))),style:t.labels.style,rotation:t.labels.rotation}).maxWidth})({axis:g,series:e})),g}))})({series:i.series.data,yAxis:i.yAxis,height:a})),[i,a]),{legendItems:g,legendConfig:f,preparedSeries:y,preparedSeriesOptions:b,preparedLegend:x,handleLegendItemClick:w}=Vt({chartWidth:t,chartHeight:a,chartMargin:c.margin,series:i.series,legend:i.legend,preparedYAxis:p}),{boundsWidth:k,boundsHeight:L}=(e=>{const{margin:t,width:a,height:i,preparedLegend:r,preparedXAxis:s,preparedYAxis:l,preparedSeries:o}=e;return n.useMemo((()=>{const e=o.some(ge),n=Nt({chartWidth:a,chartMargin:t,preparedYAxis:l}),c=(e=>{const{hasAxisRelatedSeries:t,preparedLegend:a,preparedXAxis:n}=e;let i=0;return a.enabled&&(i+=a.height+a.margin),t&&(n.title.text&&(i+=n.title.height+n.title.margin),n.labels.enabled&&(i+=n.labels.margin+n.labels.height)),i})({hasAxisRelatedSeries:e,preparedLegend:r,preparedXAxis:s});return{boundsWidth:n,boundsHeight:i-t.top-t.bottom-c}}),[t,a,i,r,s,l,o])})({width:t,height:a,margin:c.margin,preparedLegend:x,preparedXAxis:h,preparedYAxis:p,preparedSeries:y}),z=(e=>{var t;const{split:a,boundsHeight:n,chartWidth:i}=e,r=null!==(t=I({value:null==a?void 0:a.gap,base:n}))&&void 0!==t?t:0,s=function(e){const{split:t,boundsHeight:a,gap:n}=e,i=(null==t?void 0:t.plots)||[];return i.length>1?(a-n*(i.length-1))/i.length:a}({split:a,boundsHeight:n,gap:r});return{plots:((null==a?void 0:a.plots)||[]).map(((e,t)=>{const a=function(e){const{title:t,plotIndex:a,plotHeight:n,chartWidth:i,gap:r}=e,s=(null==t?void 0:t.text)||"",l={fontSize:m()(t,"style.fontSize","15px"),fontWeight:m()(t,"style.fontWeight")},o=s?Se({text:s,style:l})+16:0;return{text:s,x:i/2,y:a*(n+r)+o/2,style:l,height:o}}({title:e.title,plotIndex:t,gap:r,plotHeight:s,chartWidth:i});return{top:t*(s+r)+a.height,height:s-a.height,title:a}})),gap:r}})({split:i.split,boundsHeight:L,chartWidth:t}),{xScale:C,yScale:R}=(e=>{const{boundsWidth:t,boundsHeight:a,series:i,xAxis:r,yAxis:s,split:l}=e;return n.useMemo((()=>{let e,n;return i.some(ge)&&({xScale:e,yScale:n}=(e=>{const{boundsWidth:t,boundsHeight:a,series:n,xAxis:i,yAxis:r,split:s}=e;let l=we(n);return l=0===l.length?n:l,{xScale:ea(i,l,t),yScale:r.map(((e,t)=>{const i=n.filter((e=>m()(e,"yAxis",0)===t)),r=we(i),l=je({boundsHeight:a,split:s});return Qt(e,r.length?r:i,l)}))}})({boundsWidth:t,boundsHeight:a,series:i,xAxis:r,yAxis:s,split:l})),{xScale:e,yScale:n}}),[t,a,i,r,s,l])})({boundsWidth:k,boundsHeight:L,series:y,xAxis:h,yAxis:p,split:z}),{shapes:O,shapesData:W}=Sn({boundsWidth:k,boundsHeight:L,dispatcher:r,series:y,seriesOptions:b,xAxis:h,xScale:C,yAxis:p,yScale:R,split:z,htmlLayout:s}),D=c.margin.top;return{boundsHeight:L,boundsOffsetLeft:c.margin.left+jt(p[0]),boundsOffsetTop:D,boundsWidth:k,handleLegendItemClick:w,legendConfig:f,legendItems:g,preparedLegend:x,preparedSeries:y,preparedSplit:z,prevHeight:o,prevWidth:l,shapes:O,shapesData:W,title:d,tooltip:u,xAxis:h,xScale:C,yAxis:p,yScale:R}}const Mn=D("d3"),zn=e=>{var t,a,r,s;const{width:l,height:o,data:c}=e,d=n.useRef(null),u=n.useRef(null),h=n.useRef(null),p=n.useMemo((()=>(0,i.JDs)(_,N,j)),[]),{boundsHeight:m,boundsOffsetLeft:g,boundsOffsetTop:f,boundsWidth:y,handleLegendItemClick:v,legendConfig:b,legendItems:x,preparedSeries:w,preparedSplit:k,preparedLegend:S,prevHeight:L,prevWidth:A,shapes:E,shapesData:M,title:z,tooltip:C,xAxis:R,xScale:O,yAxis:W,yScale:D}=En(Object.assign(Object.assign({},e),{dispatcher:p,htmlLayout:u.current})),{tooltipPinned:H,togglePinTooltip:T,unpinTooltip:I}=function(e){var t,a;const{dispatcher:i,tooltip:r}=e,[s,l]=n.useState(!1),o=null==r?void 0:r.enabled,c=null===(t=null==r?void 0:r.pin)||void 0===t?void 0:t.enabled,d=null===(a=null==r?void 0:r.pin)||void 0===a?void 0:a.modifierKey,u=n.useCallback(((e,t)=>{let a=e;if(e&&d)switch(d){case"altKey":a=t.altKey;break;case"metaKey":a="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform)?t.metaKey:t.ctrlKey}l(a)}),[d]),h=n.useCallback((()=>{l(!1),i.call(N,{},void 0)}),[i]);return{tooltipPinned:s,togglePinTooltip:o&&c?u:void 0,unpinTooltip:o&&c?h:void 0}}({dispatcher:p,tooltip:C}),{handleChartClick:P,handleMouseLeave:B,throttledHandleMouseMove:$,throttledHandleTouchMove:F}=function(e){const{boundsHeight:t,boundsOffsetLeft:a,boundsOffsetTop:r,boundsWidth:s,dispatcher:l,shapesData:o,svgContainer:c,togglePinTooltip:d,tooltipPinned:u,unpinTooltip:h,xAxis:p,yAxis:m}=e,g=n.useCallback(((e,a)=>e<0||e>s||a<0||a>t),[t,s]),f=([e,n],i)=>{if(u)return;const c=e-a,d=n-r;if(g(c,d))return l.call(N,{},void 0),void l.call(j,{},void 0,i);const h=zt({position:[c,d],shapesData:o,boundsHeight:t,boundsWidth:s});l.call(N,i.target,h,[e,n]),l.call(j,{},{hovered:h,xAxis:p,yAxis:m[0]},i)},y=St?void 0:kt()((e=>{const[t,a]=(0,i.WnM)(e,c);f([t,a],e)}),50),v=St?kt()((e=>{const t=e.touches[0],[a,n]=(0,i.WnM)(t,c);f([a,n],e)}),50):void 0;return{handleChartClick:e=>{const[n,f]=(0,i.WnM)(e,c),y=n-a,v=f-r;if(g(y,v))return;const b=zt({position:[y,v],shapesData:o,boundsHeight:t,boundsWidth:s}),x=null==b?void 0:b.find((e=>e.closest));if(!x)return void(u&&(null==h||h()));l.call(_,void 0,{point:x.data,series:x.series},e);const w=!u;w||(l.call(N,e.target,b,[n,f]),l.call(j,{},{hovered:b,xAxis:p,yAxis:m[0]},e)),null==d||d(w,e)},handleMouseLeave:e=>{u||(null==y||y.cancel(),l.call(N,{},void 0),l.call(j,{},void 0,e))},throttledHandleMouseMove:y,throttledHandleTouchMove:v}}({boundsHeight:m,boundsOffsetLeft:g,boundsOffsetTop:f,boundsWidth:y,dispatcher:p,shapesData:M,svgContainer:d.current,togglePinTooltip:T,tooltipPinned:H,unpinTooltip:I,xAxis:R,yAxis:W}),Y=null===(a=null===(t=c.chart)||void 0===t?void 0:t.events)||void 0===a?void 0:a.click,K=null===(s=null===(r=c.chart)||void 0===r?void 0:r.events)||void 0===s?void 0:s.pointermove;return n.useEffect((()=>(Y&&p.on(_,Y),K&&p.on(j,((...e)=>{const[t,a]=e;K(t,a)})),()=>{p.on(_,null),p.on(j,null)})),[p,Y,K]),n.useEffect((()=>{A===l&&L===o||!H||null==I||I()}),[A,l,L,o,H,I]),n.createElement(n.Fragment,null,n.createElement("svg",{ref:d,className:Mn(),width:l,height:o,onMouseMove:$,onMouseLeave:B,onTouchStart:F,onTouchMove:F,onClick:P},z&&n.createElement(ot,Object.assign({},z,{chartWidth:l})),n.createElement("g",{transform:`translate(0, ${f})`},k.plots.map(((e,t)=>n.createElement(st,{key:`plot-${t}`,title:e.title})))),n.createElement("g",{width:y,height:m,transform:`translate(${[g,f].join(",")})`,ref:h},O&&(null==D?void 0:D.length)&&n.createElement(n.Fragment,null,n.createElement(Pe,{axes:W,width:y,height:m,scale:D,split:k,plotRef:h}),n.createElement("g",{transform:`translate(0, ${m})`},n.createElement(Ke,{axis:R,width:y,height:m,scale:O,split:k}))),E),S.enabled&&n.createElement(it,{chartSeries:w,boundsWidth:y,legend:S,items:x,config:b,onItemClick:v,onUpdate:I})),n.createElement("div",{className:Mn("html-layer"),ref:u,style:{transform:`translate(${g}px, ${f}px)`}}),n.createElement(xt,{dispatcher:p,tooltip:C,svgContainer:d.current,xAxis:R,yAxis:W[0],onOutsideClick:I,tooltipPinned:H}))},Cn=n.forwardRef((function(e,t){const{data:a,lang:r,onResize:l}=e,o=n.useRef(),c=n.useRef(null),p=n.useRef(),[m,g]=n.useState();o.current!==a&&((e=>{if(f()(e)||f()(e.series)||f()(e.series.data))throw new C({code:"ERR.CK.NO_DATA",message:u("error","label_no-data")});if(e.series.data.some((e=>f()(e.data))))throw new C({code:z,message:"You should specify data for all series"});if((e=>{const{series:t,type:a}=e;let n=0;return t.forEach((e=>{e.type===a&&(n+=1)})),n})({series:e.series.data,type:y.Treemap})>1)throw new C({code:z,message:'It looks like you are trying to define more than one "treemap" series.'});e.series.data.forEach((t=>{(e=>{const{series:t,xAxis:a,yAxis:n}=e;if(!R.includes(t.type))throw new C({code:z,message:u("error","label_invalid-series-type",{types:R.join(", ")})});switch(t.type){case"area":case"bar-y":case"bar-x":O({series:t,xAxis:a,yAxis:n}),(({series:e})=>{const t=["normal","percent"];if(e.stacking&&!t.includes(e.stacking))throw new C({code:z,message:u("error","label_invalid-series-property",{key:"stacking",values:t})})})({series:t});break;case"line":case"scatter":O({series:t,xAxis:a,yAxis:n});break;case"pie":(({series:e})=>{e.data.forEach((({value:e})=>{if("number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-pie-data-value")})}))})({series:t});break;case"treemap":(({series:e})=>{const t={};e.data.forEach((e=>{e.parentId&&!t[e.parentId]&&(t[e.parentId]=!0)})),e.data.forEach((e=>{let a=e.id;if(a||(a=Array.isArray(e.name)?e.name.join():e.name),t[a]&&"number"==typeof e.value)throw new C({code:z,message:u("error","label_invalid-treemap-redundant-value",{id:e.id,name:e.name})});if(!t[a]&&"number"!=typeof e.value)throw new C({code:z,message:u("error","label_invalid-treemap-missing-value",{id:e.id,name:e.name})})}))})({series:t})}})({series:t,yAxis:e.yAxis,xAxis:e.xAxis})}))})(a),o.current=a);const v=n.useCallback((()=>{var e;const t=null===(e=c.current)||void 0===e?void 0:e.parentElement;if(t){const{width:e,height:a}=t.getBoundingClientRect();g({width:e,height:a})}}),[]),b=n.useMemo((()=>{var e;return null===(e=p.current)||void 0===e||e.cancel(),p.current=s()(v,200),p.current}),[v]);return n.useImperativeHandle(t,(()=>({reflow(){b()}})),[b]),n.useEffect((()=>{b()}),[b]),n.useEffect((()=>{const e=(0,i.Ltv)(window),t=`resize.${h()}`;return e.on(t,b),()=>{e.on(t,null)}}),[b]),n.useEffect((()=>{"function"==typeof l&&l({dimensions:m})}),[m,l]),n.useEffect((()=>{r&&d.lang!==r&&d.setLang(r)}),[r]),n.createElement("div",{ref:c,style:{width:(null==m?void 0:m.width)||"100%",height:(null==m?void 0:m.height)||"100%",position:"relative"}},(null==m?void 0:m.height)&&(null==m?void 0:m.width)&&n.createElement(zn,{height:null==m?void 0:m.height,width:null==m?void 0:m.width,data:a}))}));var Rn=[],On=new MessageChannel,Wn=function(){this.postMessage(void 0)}.bind(On.port2);On.port1.onmessage=function(){var e=Rn;Rn=[];for(var t=performance.now(),a=0;a<e.length;a++)e[a](t)},On=null;var Dn=a(52789);function _n(){const e=performance.now();return{end:()=>performance.now()-e}}var Nn=a(56911),jn=a(50823),Hn=a(96464);const Tn="horizontal",In="vertical";var Pn=a(67901);class Bn extends n.PureComponent{render(){const{children:e,className:t,split:a,style:i,size:r,eleRef:s}=this.props,l=["Pane",a,t];let o={flex:1,position:"relative",outline:"none"};return void 0!==r&&("vertical"===a?o.width=r:(o.height=r,o.display="flex"),o.flex="none"),o=Object.assign({},o,i||{}),n.createElement("div",{ref:s,className:l.join(" "),style:o},e)}}const $n="Resizer";class Fn extends n.Component{render(){const{className:e,onClick:t,onDoubleClick:a,onMouseDown:i,onTouchEnd:r,onTouchStart:s,resizerClassName:l=$n,split:o,style:c}=this.props,d=[l,o,e];return n.createElement("span",{role:"presentation",className:d.join(" "),style:c,onMouseDown:e=>i(e),onTouchStart:e=>{s(e)},onTouchEnd:e=>{e.preventDefault(),r(e)},onClick:e=>{t&&(e.preventDefault(),t(e))},onDoubleClick:e=>{a&&(e.preventDefault(),a(e))}})}}function Yn(){var e;null===(e=window.getSelection())||void 0===e||e.removeAllRanges()}function Kn(e,t,a,n){if("number"==typeof n){const e="number"==typeof t?t:0,i="number"==typeof a&&a>=0?a:1/0;return Math.max(e,Math.min(i,n))}return void 0!==e?e:t}class Un extends n.Component{static getDerivedStateFromProps(e,t){return Un.getSizeUpdate(e,t)}static getSizeUpdate(e,t){const a={},{instanceProps:n}=t;if(n.size===e.size&&void 0!==e.size)return{};const i=void 0===e.size?Kn(e.defaultSize,e.minSize,e.maxSize,t.draggedSize):e.size;void 0!==e.size&&(a.draggedSize=i);const r="first"===e.primary;return a[r?"pane1Size":"pane2Size"]=i,a[r?"pane2Size":"pane1Size"]=void 0,a.instanceProps={size:e.size},a}constructor(e){super(e),this.splitPane=null,this.pane1=null,this.pane2=null,this.onMouseDown=e=>{const t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchStart(t)},this.onTouchStart=e=>{const{allowResize:t,onDragStarted:a,split:n}=this.props;if(t){Yn();const t="vertical"===n?e.touches[0].clientX:e.touches[0].clientY;"function"==typeof a&&a(),this.setState({active:!0,position:t})}},this.onMouseMove=e=>{const t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchMove(t)},this.onTouchMove=e=>{const{allowResize:t,maxSize:a,minSize:n,onChange:i,split:r,step:s}=this.props,{active:l,position:o}=this.state;if(t&&l){Yn();const t="first"===this.props.primary,l=t?this.pane1:this.pane2,c=t?this.pane2:this.pane1;if(l){const d=l,u=c;if(d.getBoundingClientRect){const l=d.getBoundingClientRect().width,c=d.getBoundingClientRect().height,h="vertical"===r?l:c;let p=o-("vertical"===r?e.touches[0].clientX:e.touches[0].clientY);if(s){if(Math.abs(p)<s)return;p=~~(p/s)*s}let m=t?p:-p;parseInt(window.getComputedStyle(d).order)>parseInt(window.getComputedStyle(u).order)&&(m=-m);let g=a;if(void 0!==a&&a<=0){const e=this.splitPane;g="vertical"===r?e.getBoundingClientRect().width+a:e.getBoundingClientRect().height+a}let f=h-m;const y=o-p;f<n?f=n:void 0!==a&&f>g?f=g:this.setState({position:y,resized:!0}),i&&i(f),this.setState({draggedSize:f,[t?"pane1Size":"pane2Size"]:f})}}}},this.onMouseUp=()=>{const{allowResize:e,onDragFinished:t}=this.props,{active:a,draggedSize:n}=this.state;e&&a&&("function"==typeof t&&t(n),this.setState({active:!1}))};const{size:t,defaultSize:a,minSize:n,maxSize:i,primary:r}=e,s=void 0===t?Kn(a,n,i):t;this.state={active:!1,resized:!1,position:0,draggedSize:0,pane1Size:"first"===r?s:void 0,pane2Size:"second"===r?s:void 0,instanceProps:{size:t}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(Un.getSizeUpdate(this.props,this.state))}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}render(){const{allowResize:e,children:t,className:a,onResizerClick:i,onResizerDoubleClick:r,paneClassName:s,pane1ClassName:l,pane2ClassName:o,paneStyle:c,pane1Style:d,pane2Style:u,resizerClassName:h,resizerStyle:p,split:m,style:g}=this.props,{pane1Size:f,pane2Size:y}=this.state,v=e?"":"disabled",b=h?`${h} ${$n}`:h,x=function(e){return n.Children.toArray(e).filter((e=>e))}(t),w=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);"vertical"===m?Object.assign(w,{flexDirection:"row",left:0,right:0}):Object.assign(w,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const k=["SplitPane",a,m,v],S=Object.assign(Object.assign({},c),d),L=Object.assign(Object.assign({},c),u),A=["Pane1",s,l].join(" "),E=["Pane2",s,o].join(" ");return n.createElement("div",{className:k.join(" "),ref:e=>{this.splitPane=e},style:w},n.createElement(Bn,{className:A,key:"pane1",eleRef:e=>{this.pane1=e},size:f,split:m,style:S},x[0]),n.createElement(Fn,{className:v,onClick:i,onDoubleClick:r,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:b,split:m,style:p||{}}),n.createElement(Bn,{className:E,key:"pane2",eleRef:e=>{this.pane2=e},size:y,split:m,style:L},x[1]))}}Un.defaultProps={allowResize:!0,minSize:50,primary:"first",split:"vertical",paneClassName:"",pane1ClassName:"",pane2ClassName:""};const Jn=(0,Pn.cn)("styled-split-pane"),Xn=Jn("pane-resizer"),qn=e=>{var{paneOneRender:t,paneTwoRender:a}=e,i=(0,Nn.Tt)(e,["paneOneRender","paneTwoRender"]);const r=n.useRef(null);return n.useEffect((()=>{var e,t;const a=null===(t=null===(e=r.current)||void 0===e?void 0:e.splitPane)||void 0===t?void 0:t.getElementsByClassName(Xn)[0],n=`${Xn}_hovered`,i=()=>{null==a||a.classList.add(n)},s=()=>{null==a||a.classList.remove(n)};return null==a||a.addEventListener("touchstart",i),null==a||a.addEventListener("touchend",s),function(){null==a||a.removeEventListener("touchstart",i),null==a||a.removeEventListener("touchend",s)}}),[]),n.createElement(Un,Object.assign({},i,{ref:r,className:Jn(),resizerClassName:Xn}),n.createElement(Bn,null,t()),n.createElement(Bn,null,a()))},Vn="object"==typeof window,Gn=Vn&&"function"==typeof window.ScreenOrientation&&"function"==typeof screen.orientation.addEventListener&&"string"==typeof screen.orientation.type,Zn=Object.values({PORTRAIT_PRIMARY:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary",LANDSCAPE_PRIMARY:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary"});function Qn(e){const t=n.useRef();return n.useEffect((()=>{t.current=e}),[e]),t.current}const ei=n.forwardRef((function(e,t){const{renderer:a}=e,[i,r]=n.useState();return n.useImperativeHandle(t,(()=>({redraw(e){r(e)}})),[]),n.createElement(vt,Object.assign({},i,{renderer:a}))})),ti=.6;function ai(){return window.innerWidth*ti}const ni={overflow:"auto"},ii=function(e){const t=(0,jn.x)(e),a=n.forwardRef((function(t,a){var i;const{data:r}=t,s=(0,Nn.Tt)(t,["data"]),l=n.useRef(null),o=n.useRef(null),c=n.useRef(null),d=n.useRef(null),{allowResize:u,minSize:h,maxSize:p,tooltipHeight:m,split:g,size:f,setTooltipHeight:y,setSplit:v,setSize:b}=function(e){const{container:t}=e,[a,i]=n.useState(0),[r,s]=n.useState(Vn&&window.innerWidth>window.innerHeight?In:Tn),[l,o]=n.useState(function(e){return Vn&&e===In?ai():"calc(100% - 24px)"}(r)),c=r===Tn;let d,u;if(Vn&&t&&r===Tn){const e=t.getBoundingClientRect().height;d=e-24-a,u=e/3}return{allowResize:c,maxSize:d,minSize:u,tooltipHeight:a,setTooltipHeight:i,split:r,setSplit:s,size:l,setSize:o}}({container:l.current}),x=Qn(m),w=Qn(g);if(w&&g!==w&&g===In)b(ai());else if(g===Tn&&l.current&&0===x&&m!==x){const e=l.current.getBoundingClientRect().height;e-24===f&&(b(e-24-m),null===(i=c.current)||void 0===i||i.reflow())}const k=n.useCallback((()=>{if(!o.current)return;const e=o.current.getBoundingClientRect().height;y(e)}),[y]);(0,Hn.w)({ref:o,onResize:k});const S=n.useMemo((()=>{var e,t,a;const n=null===(t=null===(e=r.chart)||void 0===e?void 0:e.events)||void 0===t?void 0:t.pointermove;return Object.assign(Object.assign({},r),{chart:Object.assign(Object.assign({},r.chart),{events:Object.assign(Object.assign({},null===(a=r.chart)||void 0===a?void 0:a.events),{pointermove:(e,t)=>{var a;null===(a=d.current)||void 0===a||a.redraw(e),null==n||n(e,t)}})}),tooltip:Object.assign(Object.assign({},r.tooltip),{enabled:!1})})}),[r]),L=n.useCallback((()=>{const e=window.innerWidth>window.innerHeight?In:Tn;v(e)}),[v]),A=n.useCallback((e=>{const t=e.target&&"type"in e.target&&e.target.type;(function(e){return"string"==typeof e&&Zn.includes(e)})(t)&&v(function(e){switch(e){case"landscape-primary":case"landscape-secondary":return"vertical";default:return"horizontal"}}(t))}),[v]),E=n.useCallback((e=>{var t;null===(t=c.current)||void 0===t||t.reflow(),g===Tn&&b(e)}),[g,b]);return n.useLayoutEffect((()=>(Gn?screen.orientation.addEventListener("change",A):Vn&&window.addEventListener("orientationchange",L),()=>{Gn?screen.orientation.removeEventListener("change",A):Vn&&window.removeEventListener("orientationchange",L)})),[L,A]),n.createElement("div",{ref:l,style:{position:"relative",height:"100%"}},n.createElement(qn,{allowResize:u,maxSize:p,minSize:h,size:f,split:g,onChange:E,paneOneRender:()=>n.createElement(e,Object.assign({},s,{ref:c,data:S})),paneTwoRender:()=>n.createElement("div",{ref:o},n.createElement(ei,{ref:d,renderer:S.tooltip.renderer})),pane2Style:ni}))}));return a.displayName=`withSplitPane(${t})`,a}(Cn),ri=n.forwardRef((function(e,t){const{data:a,tooltip:i,onLoad:r,onRender:s,onChartLoad:l}=e,o=Dn.W.get("lang"),c=n.useRef(_n()),d=n.useRef(null),u=(null==i?void 0:i.splitted)?ii:Cn,h=n.useCallback((({dimensions:e})=>{e&&(c.current||(c.current=_n()),function(e){1===Rn.push(e)&&requestAnimationFrame(Wn)}((()=>{var e;const t=null===(e=c.current)||void 0===e?void 0:e.end();null==s||s({renderTime:t}),null==r||r({widgetRendering:t}),c.current=null})))}),[s,r]);return n.useImperativeHandle(t,(()=>({reflow(){var e;null===(e=d.current)||void 0===e||e.reflow()}})),[]),n.useLayoutEffect((()=>{l&&l({})}),[l]),n.createElement(u,{ref:d,data:a,lang:o,onResize:h})}))},44304:(e,t,a)=>{a.d(t,{m:()=>r});var n=a(77810);const i={top:0,right:0,bottom:0,left:0};function r(e={}){const{rect:t,contextElement:a}=e,r=n.useRef(i),s=n.useRef({contextElement:a,getBoundingClientRect(){const{top:e,right:t,bottom:a,left:n}=r.current;return{top:e,right:t,bottom:a,left:n,width:t-n,height:a-e}}});if(s.current.contextElement=a,t){const{top:e=0,left:a=0,right:n=a,bottom:i=e}=t;r.current={top:e,right:n,bottom:i,left:a}}else r.current=i;return s}},96464:(e,t,a)=>{a.d(t,{w:()=>i});var n=a(77810);function i({ref:e,onResize:t,box:a}){n.useEffect((()=>{const n=null==e?void 0:e.current;if(!n)return;if(void 0===window.ResizeObserver)return window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)};const i=new ResizeObserver((e=>{e.length&&t()}));return i.observe(n,{box:a}),()=>{i.disconnect()}}),[e,t,a])}}}]);
2
- //# sourceMappingURL=9030.200c7642.chunk.js.map
1
+ "use strict";(self.webpackChunk_ytsaurus_ui=self.webpackChunk_ytsaurus_ui||[]).push([[3792],{3792:(e,t,a)=>{a.r(t),a.d(t,{default:()=>ri});var n=a(77810),i=a(13934),r=a(24503),s=a.n(r),l=a(50326);const o=JSON.parse('{"error":{"label_no-data":"No data","label_unknown-plugin":"Unknown plugin type \\"{{type}}\\"","label_unknown-error":"Unknown error","label_invalid-axis-category-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"category\\". Strings and numbers are allowed.","label_invalid-axis-datetime-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"datetime\\". Only numbers are allowed.","label_invalid-axis-linear-data-point":"It seems you are trying to use inappropriate data type for \\"{{key}}\\" value in series \\"{{seriesName}}\\" for axis with type \\"linear\\". Numbers and nulls are allowed.","label_invalid-pie-data-value":"It seems you are trying to use inappropriate data type for \\"value\\" value. Only numbers are allowed.","label_invalid-series-type":"It seems you haven\'t defined \\"series.type\\" property, or defined it incorrectly. Available values: [{{types}}].","label_invalid-series-property":"It seems you are trying to use inappropriate value for \\"{{key}}\\", or defined it incorrectly. Available values: [{{values}}].","label_invalid-treemap-redundant-value":"It seems you are trying to set \\"value\\" for container node. Check node with this properties: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-treemap-missing-value":"It seems you are trying to use node without \\"value\\". Check node with this properties: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-y-axis-index":"It seems you are trying to use inappropriate index for Y axis: \\"{{index}}\\""}}'),c=JSON.parse('{"error":{"label_no-data":"Нет данных","label_unknown-plugin":"Неизвестный тип плагина \\"{{type}}\\"","label_unknown-error":"Неизвестная ошибка","label_invalid-axis-category-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"category\\". Допускается использование строк и чисел.","label_invalid-axis-datetime-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"datetime\\". Допускается только использование чисел.","label_invalid-axis-linear-data-point":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"{{key}}\\" в серии \\"{{seriesName}}\\" для оси с типом \\"linear\\". Допускается использование чисел и значений null.","label_invalid-pie-data-value":"Похоже, что вы пытаетесь использовать недопустимый тип данных для значения \\"value\\". Допускается только использование чисел.","label_invalid-series-type":"Похоже, что вы не указали значение \\"series.type\\" или указали его неверно. Доступные значения: [{{types}}].","label_invalid-series-property":"Похоже, что вы пытаетесь использовать недопустимое значение для \\"{{key}}\\", или указали его неверно. Доступные значения: [{{values}}].","label_invalid-treemap-redundant-value":"Похоже, что вы пытаетесь установить значение \\"value\\" для узла, используемого в качестве контейнера. Проверьте узел с этими свойствами: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-treemap-missing-value":"Похоже, что вы пытаетесь использовать узел без значения \\"value\\". Проверьте узел с этими свойствами: { id: \\"{{id}}\\", name: \\"{{name}}\\" }","label_invalid-y-axis-index":"Похоже, что вы пытаетесь использовать некорректный индекс для оси Y: \\"{{index}}\\""}}'),d=new l.TH;d.registerKeysets("en",o),d.registerKeysets("ru",c),d.setLang("en"),d.setFallbackLang("en");const u=d.i18n.bind(d);function h(){return`gravity-chart.${function(e,t){let a="";for(let e=5;e>0;--e)a+=t[Math.floor(36*Math.random())];return a}(0,"0123456789abcdefghijklmnopqrstuvwxyz")}`}var p=a(81214),m=a.n(p),g=a(96843),f=a.n(g);const y={Area:"area",BarX:"bar-x",BarY:"bar-y",Line:"line",Pie:"pie",Scatter:"scatter",Treemap:"treemap",Waterfall:"waterfall",Sankey:"sankey"};var v,b,x,w;!function(e){e.Dash="Dash",e.DashDot="DashDot",e.Dot="Dot",e.LongDash="LongDash",e.LongDashDot="LongDashDot",e.LongDashDotDot="LongDashDotDot",e.ShortDash="ShortDash",e.ShortDashDot="ShortDashDot",e.ShortDashDotDot="ShortDashDotDot",e.ShortDot="ShortDot",e.Solid="Solid"}(v||(v={})),function(e){e.Circle="circle",e.Diamond="diamond",e.Square="square",e.Triangle="triangle",e.TriangleDown="triangle-down"}(b||(b={})),function(e){e.Butt="butt",e.Round="round",e.Square="square",e.None="none"}(x||(x={})),function(e){e.Binary="binary",e.Dice="dice",e.Slice="slice",e.SliceDice="slice-dice",e.Squarify="squarify"}(w||(w={}));const k=["#4DA2F1","#FF3D64","#8AD554","#FFC636","#FFB9DD","#84D1EE","#FF91A1","#54A520","#DB9100","#BA74B3","#1F68A9","#ED65A9","#0FA08D","#FF7E00","#E8B0A4","#52A6C5","#BE2443","#70C1AF","#FFB46C","#DCA3D7"],S="11px",L={text:"",margin:0,style:{fontSize:"14px"},align:"center",maxRowCount:1},A=Object.assign(Object.assign({},L),{margin:4}),E=Object.assign(Object.assign({},L),{margin:8}),M="linear",z="ERR.CK.INVALID_DATA";class C extends Error{constructor({originalError:e,message:t,code:a="ERR.CK.UNKNOWN_ERROR"}={}){super(t),this.isCustomError=!0,this.code=a,e&&(this.name=e.name,this.stack=e.stack)}}const R=Object.values(y),O=e=>{const{series:t,xAxis:a,yAxis:n=[]}=e,i=m()(t,"yAxis",0),r=n[i];if(0!==i&&void 0===r)throw new C({code:z,message:u("error","label_invalid-y-axis-index",{index:i})});const s=m()(a,"type",M),l=m()(r,"type",M);t.data.forEach((({x:e,y:a})=>{switch(s){case"category":if("string"!=typeof e&&"number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-axis-category-data-point",{key:"x",seriesName:t.name})});break;case"datetime":if("number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-axis-datetime-data-point",{key:"x",seriesName:t.name})});break;case"linear":if("number"!=typeof e&&null!==e)throw new C({code:z,message:u("error","label_invalid-axis-linear-data-point",{key:"x",seriesName:t.name})})}switch(l){case"category":if("string"!=typeof a&&"number"!=typeof a)throw new C({code:z,message:u("error","label_invalid-axis-category-data-point",{key:"y",seriesName:t.name})});break;case"datetime":if("number"!=typeof a)throw new C({code:z,message:u("error","label_invalid-axis-datetime-data-point",{key:"y",seriesName:t.name})});break;case"linear":if("number"!=typeof a&&null!==a)throw new C({code:z,message:u("error","label_invalid-axis-linear-data-point",{key:"y",seriesName:t.name})})}}))};var W=a(29717);(0,W.withNaming)({e:"__",m:"_"});const D=(0,W.withNaming)({n:"gcharts-",e:"__",m:"_"}),_="click-chart",N="hover-shape",j="pointermove-chart";var H=a(45041),T=a.n(H);const I=e=>{const{value:t="",base:a}=e;if(!T()(t))return"string"==typeof t?((e="")=>e.endsWith("%")&&!Number.isNaN(Number.parseFloat(e)))(t)&&"number"==typeof a?a*(Number.parseFloat(t)/100):((e="")=>e.endsWith("px")&&!Number.isNaN(Number.parseFloat(e)))(t)?Number.parseFloat(t):void 0:t};function P(e,t=2){const a=Math.pow(10,t);return Math.floor(Math.cos(Math.PI/180*e)*a)/a}function B(e,t=2){const a=Math.pow(10,t);return Math.floor(Math.sin(Math.PI/180*e)*a)/a}var $=a(26116),F=a(61894);const Y=8,K=5,U={fontSize:"11px",fontWeight:"bold",fontColor:"var(--d3-data-labels)"},J={enabled:!0,opacity:.25,size:6},X={radius:4,borderColor:"",borderWidth:0,symbol:"circle"},q=e=>e.reduce(((e,t)=>(t.legend.enabled&&t.visible&&e.push(t.name),e)),[]);function V(e,t){var a;const n=(null===(a=e.legend)||void 0===a?void 0:a.symbol)||{};return{shape:"symbol",symbolType:t||b.Circle,width:(null==n?void 0:n.width)||Y,padding:(null==n?void 0:n.padding)||K}}const G=a.n(F)()(h);function Z(e){let t=e.stackId;return t||(t=e.stacking?G():h()),t}const Q=new l.TH;Q.setLang("ru");const ee=JSON.parse('{"units":{"value_short-bytes":"B","value_short-kilobytes":"KB","value_short-megabytes":"MB","value_short-milliseconds":"ms","value_short-seconds":"s","value_short-minutes":"m","value_short-empty":"","value_short-k":"K","value_short-m":"M","value_short-b":"B","value_short-t":"T","value_space-delimiter":" ","value_number-delimiter":""}}'),te=(ae={ru:JSON.parse('{"units":{"value_short-bytes":"Б","value_short-kilobytes":"КБ","value_short-megabytes":"МБ","value_short-milliseconds":"мс","value_short-seconds":"с","value_short-minutes":"м","value_short-empty":"","value_short-k":"K","value_short-m":"M","value_short-b":"B","value_short-t":"T","value_space-delimiter":" ","value_number-delimiter":""}}'),en:ee},Object.entries(ae).forEach((([e,t])=>Q.registerKeysets(e,t))),Q.i18n.bind(Q,"units"));var ae;function ne(e,t,a){let n=1;for(;Math.abs(e/Math.pow(t,n))>=1&&n<10&&te(a[n]);)n++;return n-1}const ie=({exponent:e,unitsI18nKeys:t,unitDelimiterI18nKey:a})=>function(n,i={}){const{precision:r,unitRate:s,showRankDelimiter:l=!0,lang:o}=i,c=Q.lang;o&&Q.setLang(o);const d="number"==typeof s?s:ne(n,e,t);let u=n/Math.pow(e,d);"number"==typeof r?u=Number(u.toFixed(r)):"auto"===r&&u%1!=0&&(u=Number(u.toFixed(Math.abs(u)>1?2:4))),u=new Intl.NumberFormat(null!=o?o:c,{minimumFractionDigits:"number"==typeof r?r:0,maximumFractionDigits:20,useGrouping:l}).format(u);const h=te(t[d]),p=te(a);return Q.setLang(c),`${u}${p}${h}`},re=(ie({exponent:1024,unitDelimiterI18nKey:"value_space-delimiter",unitsI18nKeys:["value_short-bytes","value_short-kilobytes","value_short-megabytes"]}),ie({exponent:1e3,unitDelimiterI18nKey:"value_space-delimiter",unitsI18nKeys:["value_short-milliseconds","value_short-seconds","value_short-minutes"]}),["value_short-empty","value_short-k","value_short-m","value_short-b","value_short-t"]),se=ie({exponent:1e3,unitDelimiterI18nKey:"value_number-delimiter",unitsI18nKeys:re}),le=e=>ne(e,1e3,re),oe={default:0,auto:void 0,k:1,m:2,b:3,t:4},ce=(e,t={})=>{if(Number.isNaN(e)||Number.isNaN(Number(e)))return new Intl.NumberFormat("en").format(Number(e));const{format:a="number",multiplier:n=1,prefix:i="",postfix:r="",unit:s,unitRate:l,labelMode:o}=t;let c=n,d="";return"percent"===a&&(c=100,d="%"),"percent"===o&&(d="%"),`${i}${se(Number(e)*c,Object.assign(Object.assign({},t),{unitRate:null!=l?l:oe[null!=s?s:"default"]}))}${d}${r}`},de={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},ue={millisecond:"DD.MM.YY HH:mm:ss.SSS",second:"DD.MM.YY HH:mm:ss",minute:"DD.MM.YY HH:mm",hour:"DD.MM.YY HH:mm",day:"DD.MM.YY",week:"DD.MM.YY",month:"MMM 'YY",year:"YYYY"};const he=["pie","treemap","sankey"],pe=["bar-x","area","waterfall"],me=["bar-y"];function ge(e){return!he.includes(e.type)}function fe(e){return ge(e)}function ye(e){return ge(e)}function ve(e,t="x",a="y"){const n=[],r=(0,i.Os0)(e,Z);return Array.from(r).forEach((([e,i])=>{const r={};i.forEach((e=>{const n=new Map;e.data.forEach((e=>{const i=String(e[t]);let r=0;a in e&&"number"==typeof e[a]&&(r=e[a]),n.has(i)&&(r=Math.max(r,n.get(i))),n.set(i,r)})),Array.from(n).forEach((([e,t])=>{r[e]=(r[e]||0)+t}))})),n.push(...Object.values(r))})),n}const be=e=>{const t=(0,i.Os0)(e,(e=>e.type));return Array.from(t).reduce(((e,[t,a])=>("bar-y"===t?e.push(...ve(a,"y","x")):a.filter(fe).forEach((t=>{e.push(...t.data.map((e=>e.x)))})),e)),[])},xe=e=>{const t=(0,i.Os0)(e,(e=>e.type));return Array.from(t).reduce(((e,[t,a])=>{switch(t){case"area":case"bar-x":e.push(...ve(a));break;case"waterfall":{let t=0;a.forEach((a=>{a.data.forEach((a=>{t+=Number(a.y)||0,e.push(t)}))}));break}default:a.filter(ye).forEach((t=>{e.push(...t.data.map((e=>e.y)))}))}return e}),[])},we=e=>e.filter((e=>e.visible)),ke=e=>{const{axis:t,value:a,step:n}=e;switch(t.type){case"category":return a;case"datetime":{const e=a,i=t.labels.dateFormat||function(e){if(e){const t=function(e){const t=Object.keys(de),a=t.findIndex((t=>e<de[t]));return-1===a?"year":t[a-1]}(e);if(t in ue)return ue[t]}return ue.day}(n);return(0,$.KQ)({input:e}).format(i)}default:{const e=Object.assign({unitRate:a&&n?le(n):void 0},t.labels.numberFormat);return ce(a,e)}}},Se=e=>{var t;const{text:a,style:n}=e,r=(0,i.Ltv)(document.body).append("svg"),s=r.append("text").text(a),l=m()(n,"fontSize",S);l&&s.style("font-size",l).style("alignment-baseline","after-edge");const o=(null===(t=s.node())||void 0===t?void 0:t.getBoundingClientRect().height)||0;return r.remove(),o},Le=e=>{const{axisDirection:t,categories:a,data:n}=e,i=(e=>{const{axisDirection:t,categories:a,data:n}=e,i=m()(n,t);let r;if("category"in n&&n.category&&(r=n.category),"string"==typeof i&&(r=i),"number"==typeof i&&(r=a[i]),T()(r))throw new Error("It seems you are trying to get non-existing category value");return r})({axisDirection:t,categories:a,data:n});return i};function Ae(e,t){if("category"!==e.type)return t[1]-t[0]}var Ee=a(34563);function Me(e,t){var a,n,i;if(!e)return;const r=e.closest("svg");if(!r)return;const s=e.closest("text"),l=(null===(a=Array.from((null==s?void 0:s.transform.baseVal)||[]).find((e=>e.angle)))||void 0===a?void 0:a.angle)||0,o=r.createSVGTransform();o.setRotate(-l,0,0),null==s||s.transform.baseVal.appendItem(o);let c=e.textContent||"",d=(null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width)||0;for(;d>t&&c.length>1;)c=c.slice(0,-1),e.textContent=c+"…",d=(null===(i=e.getBoundingClientRect())||void 0===i?void 0:i.width)||0;null==s||s.transform.baseVal.removeItem((null==s?void 0:s.transform.baseVal.length)-1)}function ze(e,t){const a=e.text();e.text(null).append("title").text(a),Me(e.append("tspan").text(a).style("alignment-baseline","inherit").node(),t)}function Ce(e,t){e.each((function(e){const a="function"==typeof t?t(e):t;ze((0,Ee.A)(this),a)}))}function Re({labels:e,style:t,rotation:a,html:n}){var i,r,s;if(!e.filter(Boolean).length)return{maxHeight:0,maxWidth:0};const l=(0,Ee.A)(document.body).append("div"),o={maxHeight:0,maxWidth:0};let c;if(n){c=l.append("div").style("position","absolute").node();const{height:t,width:a}=e.reduce(((e,t)=>{var a,n;c&&(c.innerHTML=t);const i=null==c?void 0:c.getBoundingClientRect();return{width:Math.max(e.width,null!==(a=null==i?void 0:i.width)&&void 0!==a?a:0),height:Math.max(e.height,null!==(n=null==i?void 0:i.height)&&void 0!==n?n:0)}}),{height:0,width:0});o.maxWidth=a,o.maxHeight=t}else{const n=l.append("svg"),c=function(e,{labels:t,style:a={},attrs:n={}}){const i=e.append("g").append("text");return i.style("font-size",a.fontSize||""),i.style("font-weight",a.fontWeight||""),Object.entries(n).forEach((([e,t])=>{i.attr(e,t)})),i.selectAll("tspan").data(t).enter().append("tspan").attr("x",0).attr("dy",0).text((e=>e)),i}(n,{labels:e,style:t});a&&c.attr("text-anchor",a>0?"start":"end").style("transform",`rotate(${a}deg)`);const d=null===(i=n.select("g").node())||void 0===i?void 0:i.getBoundingClientRect();o.maxWidth=null!==(r=null==d?void 0:d.width)&&void 0!==r?r:0,o.maxHeight=null!==(s=null==d?void 0:d.height)&&void 0!==s?s:0}return l.remove(),o}function Oe(e){const{text:t,style:a,width:n}=e,i=Re({labels:[t],style:a}).maxHeight,r=new Intl.Segmenter([],{granularity:"word"});return Array.from(r.segment(t)).reduce(((e,t)=>{const r=t;e.length||e.push({text:"",y:e.length*i});let s=e[e.length-1];return r.isWordLike&&Re({labels:[s.text+r.segment],style:a}).maxWidth>n&&(s={text:"",y:e.length*i},e.push(s)),s.text+=r.segment,e}),[])}function We({axis:e,range:t}){let a;return e.ticks.pixelInterval&&(a=Math.ceil(t/e.ticks.pixelInterval)),a}function De(e,t){return"ticks"in e&&"function"==typeof e.ticks?e.ticks(t):e.domain()}function _e({scale:e,count:t,maxCount:a}){let n=De(e,t);if(a&&n.length>a){const e=Math.ceil(n.length/a);n=n.filter(((t,a)=>a%e==0))}return n}function Ne({axis:e,width:t}){const a=parseInt(e.labels.style.fontSize)+e.labels.padding;return Math.floor(t/a)}function je(e){const{split:t,boundsHeight:a}=e;return t.plots.length>1?t.plots[0].height:a}function He(e){const{axis:t,textMaxWidth:a}=e;return t.title.maxRowCount<1?[]:Oe({text:t.title.text,style:t.title.style,width:a}).reduce(((e,a,n)=>(n<t.title.maxRowCount?e.push(a):e[t.title.maxRowCount-1].text+=a.text,e)),[])}function Te(e,t=2){return e.toLowerCase().replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",").map((e=>""+parseInt(e,10)*t)).join(",").replace(/NaN/g,"none")}const Ie=D("d3-axis"),Pe=e=>{const{axes:t,width:a,height:r,scale:s,split:l,plotRef:o}=e,c=je({split:l,boundsHeight:r}),d=n.useRef(null);return n.useEffect((()=>{if(!d.current)return;const e=(0,i.Ltv)(d.current);e.selectAll("*").remove();const n=e=>{var t;const n=(null===(t=l.plots[e.plotIndex])||void 0===t?void 0:t.top)||0;return"left"===e.position?`translate(0, ${n}px)`:`translate(${a}px, 0)`},r=t.reduce(((e,t)=>(t.plotLines.length&&e.push(...t.plotLines.map((e=>Object.assign(Object.assign({},e),{transform:n(t)})))),e)),[]),u=e.selectAll("axis").data(t).join("g").attr("class",Ie()).style("transform",(e=>n(e)));u.each(((e,t,n)=>{const l=s[t],d=(0,i.Ltv)(n[t]),u=l,h=function(e){const{preparedAxis:t,axisGenerator:a,width:n,height:i,scale:r}=e,s=t.grid.enabled?-1*n:0,l=Ae(t,De(r));let o=a.tickSize(s).tickPadding(t.labels.margin).tickFormat((e=>t.labels.enabled?ke({axis:t,value:e,step:l}):""));const c=We({axis:t,range:i});return c&&(o=o.ticks(c)),o}({axisGenerator:"left"===e.position?(0,i.V4s)(u):(0,i.eH3)(u),preparedAxis:e,height:c,width:a,scale:l});if(h(d),e.labels.enabled){const t=d.selectAll(".tick text").attr("x",null).attr("dy",null).style("font-size",e.labels.style.fontSize).style("transform",(function(){return function(e){const{node:t,axis:a}=e;let n=a.labels.lineHeight/2,i=a.labels.margin;return"left"===a.position&&(i*=-1),a.labels.rotation?(a.labels.rotation>0?(i-=a.labels.lineHeight*B(a.labels.rotation),n=a.labels.lineHeight*P(a.labels.rotation),a.labels.rotation%360==90&&(n=((null==t?void 0:t.getBoundingClientRect().width)||0)/2)):(n=0,a.labels.rotation%360==-90&&(n=-((null==t?void 0:t.getBoundingClientRect().width)||0)/2)),`translate(${i}px, ${n}px) rotate(${a.labels.rotation}deg)`):`translate(${i}px, ${n}px)`}({node:this,axis:e})})),a=e.labels.rotation&&Math.abs(e.labels.rotation)%360==90?(c-e.labels.padding*(t.size()-1))/t.size():e.labels.maxWidth;t.call(Ce,a)}if(!e.labels.rotation){let t=0;d.selectAll(".tick").filter((function(a,n){const i=this.getBoundingClientRect();return i.bottom>t&&0!==n||(t=i.top-e.labels.padding,!1)})).remove()}if(o&&e.plotLines.length>0){const e=Ie("plotLine"),t=(0,i.Ltv)(o.current);t.selectAll(`.${e}`).remove();const n=t.selectAll(`.${e}`).data(r).join("g").attr("class",e).style("transform",(e=>e.transform));n.append("path").attr("d",(e=>{const t=Number(u(e.value)),n=[[0,t],[a,t]];return(0,i.n8j)()(n)})).attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-dasharray",(e=>Te(e.dashStyle,e.width))).attr("opacity",(e=>e.opacity)),n.each(((e,t,a)=>{const n=(0,i.Ltv)(a[t]);"before"===e.layerPlacement?n.lower():n.raise()}))}return d})),u.select(".domain").attr("d",(()=>{const e=[[0,0],[0,c]];return(0,i.n8j)()(e)})).style("stroke",(e=>e.lineColor||"")),e.selectAll(".tick").each(((e,t,a)=>{const n=(0,i.Ltv)(a[t]);(e=>{var t;if(!e)return{};const a=(null===(t=e.match(/\((.*?)\)/))||void 0===t?void 0:t[1])||"",[n,i]=a.split(",");return{x:Number.isNaN(Number(n))?void 0:Number(n),y:Number.isNaN(Number(i))?void 0:Number(i)}})(n.attr("transform")).y===c&&n.select("line").style("stroke","none")})),u.append("text").attr("class",Ie("title")).attr("text-anchor","middle").attr("font-size",(e=>e.title.style.fontSize)).attr("transform",(e=>{const t=Oe({text:e.title.text,style:e.title.style,width:c}),a=Math.min(t.length,e.title.maxRowCount),{x:n,y:i}=function(e){const{axis:t,axisHeight:a,rowCount:n}=e;if(n<1)return{x:0,y:0};const i=-(t.title.height-t.title.height/n+t.title.margin+t.labels.margin+t.labels.width);let r;switch(t.title.align){case"left":r=a-t.title.width/2;break;case"right":r=t.title.width/2;break;case"center":r=a/2}return{x:i,y:r}}({axis:e,axisHeight:c,rowCount:a});return`translate(${n}, ${i}) rotate(${"left"===e.position?-90:90})`})).selectAll("tspan").data((e=>He({axis:e,textMaxWidth:c}))).join("tspan").attr("x",0).attr("y",(e=>e.y)).text((e=>e.text)).each(((e,t,a)=>{t===a.length-1&&Me(a[t],c)}))}),[t,a,c,s,l]),n.createElement("g",{ref:d,className:Ie("container")})};function Be(e,t){const{size:a,color:n}=t,i=e.selectAll(".domain").data([null]).enter().insert("path",".tick").attr("class","domain").attr("d",`M0,0V0H${a}`);n&&i.style("stroke",n)}function $e(e){const{scale:t,ticks:{labelFormat:a=(e=>String(e)),labelsPaddings:n=0,labelsMargin:r=0,labelsMaxWidth:s=1/0,labelsStyle:l,labelsLineHeight:o,items:c,count:d,maxTickCount:u,rotation:h=0,tickColor:p},domain:m}=e,g="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,f=function({scale:e,offset:t}){return function(e){return"bandwidth"in e&&"function"==typeof e.bandwidth}(e)?function(e,t){return t=Math.max(0,e.bandwidth()-2*t)/2,e.round()&&(t=Math.round(t)),a=>Number(e(a))+t}(e.copy(),t):function(e){return t=>Number(e(t))}(e.copy())}({scale:t,offset:g}),y=_e({scale:t,count:d,maxCount:u}),v=Re({labels:y,style:l}).maxHeight;return function(e){var t,d,u;const b=null===(t=e.node())||void 0===t?void 0:t.getBoundingClientRect(),x=((null==b?void 0:b.x)||0)+m.size,w=-(null!==(u=null===(d=null==c?void 0:c[0])||void 0===d?void 0:d[0])&&void 0!==u?u:0);let k=`translate(0, ${v+r-w}px)`;if(h){const e=v*P(h)+r-w;let t=B(h)*v;Math.abs(h)%360==90&&(t+=(h>0?-1:1)*v/2),k=`translate(${-t}px, ${e}px) rotate(${h}deg)`}const S=(0,i.AeT)();null==c||c.forEach((([e,t])=>{S.moveTo(0,e),S.lineTo(0,t)})),e.selectAll(".tick").data(y).order().join((e=>{const t=e.append("g").attr("class","tick");return t.append("path").attr("d",S.toString()).attr("stroke",null!=p?p:"currentColor"),t.append("text").text(a).attr("fill","currentColor").attr("text-anchor",(()=>h?h>0?"start":"end":"middle")).style("transform",k).style("alignment-baseline","after-edge"),t})).attr("transform",(function(e){return`translate(${f(e)+g}, ${w})`})),e.select(".tick").filter((e=>0===f(e))).select("line").remove();const L=e.selectAll(".tick text");if(h){const e=s*P(h)+o*B(h);L.each((function(){ze((0,i.Ltv)(this),e)}))}else{let t=0;e.selectAll(".tick").filter((function(){const e=this.getBoundingClientRect();return e.left<t||(t=e.right+n,!1)})).remove(),L.each((function(e,t,a){if(t===a.length-1){const e=this,r=a[t-1],s=(0,i.Ltv)(e),l=e.getBoundingClientRect(),o=null==r?void 0:r.getBoundingClientRect(),c=Math.max(0,l.right-x);if(c){const e=x-((null==o?void 0:o.right)||0)-n,t=l.width/2-c;s.attr("text-anchor","end").attr("transform",`translate(${t},0)`),ze(s,e)}}}))}const{size:A,color:E}=m;e.call(Be,{size:A,color:E}).style("font-size",(null==l?void 0:l.fontSize)||"")}}const Fe=D("d3-axis");function Ye({axis:e,scale:t}){const a=De(t),n=Ae(e,a);return t=>e.labels.enabled?ke({axis:e,value:t,step:n}):""}const Ke=n.memo((function(e){const{axis:t,width:a,height:r,scale:s,split:l}=e,o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return;let e=[];t.grid.enabled&&(e=new Array(l.plots.length||1).fill(null).map(((e,t)=>{var a,n;const i=(null===(a=l.plots[t])||void 0===a?void 0:a.top)||0;return[-i,-(i+((null===(n=l.plots[t])||void 0===n?void 0:n.height)||r))]})));const n=$e({scale:s,ticks:{items:e,labelFormat:Ye({axis:t,scale:s}),labelsPaddings:t.labels.padding,labelsMargin:t.labels.margin,labelsStyle:t.labels.style,labelsMaxWidth:t.labels.maxWidth,labelsLineHeight:t.labels.lineHeight,count:We({axis:t,range:a}),maxTickCount:Ne({axis:t,width:a}),rotation:t.labels.rotation},domain:{size:a,color:t.lineColor}}),c=(0,i.Ltv)(o.current);if(c.selectAll("*").remove(),c.call(n).attr("class",Fe()),t.title.text){const e=He({axis:t,textMaxWidth:a});c.append("text").attr("class",Fe("title")).attr("transform",(()=>{const{x:n,y:i}=function(e){const{axis:t,width:a,rowCount:n}=e;if(n<1)return{x:0,y:0};let i;const r=t.title.height/n+t.title.margin+t.labels.height+t.labels.margin;switch(t.title.align){case"left":i=t.title.width/2;break;case"right":i=a-t.title.width/2;break;case"center":i=a/2}return{x:i,y:r}}({axis:t,width:a,rowCount:e.length});return`translate(${n}, ${i})`})).attr("font-size",t.title.style.fontSize).attr("text-anchor","middle").selectAll("tspan").data(e).join("tspan").attr("x",0).attr("y",(e=>e.y)).text((e=>e.text)).each(((e,n,i)=>{n===t.title.maxRowCount-1&&Me(i[n],a)}))}}),[t,a,r,s,l]),n.createElement("g",{ref:o})})),Ue={fontSize:"12px"},Je=e=>{const t=Object.values(b);return t[e%t.length]},Xe=Math.sqrt(3),qe={draw:(e,t)=>{const a=.6824*Math.sqrt(t),n=a/2,i=a*Xe/2;e.moveTo(0,a),e.lineTo(i,-n),e.lineTo(-i,-n),e.closePath()}},Ve=e=>{switch(e){case b.Diamond:return i.zyz;case b.Circle:return i.hKN;case b.Square:return i.yDW;case b.Triangle:return i.L13;case b.TriangleDown:return qe;default:return i.hKN}};function Ge(e,t){const{x:a=0,y:n=0,width:i,height:r,interpolator:s}=t,l=document.createElement("canvas");l.width=256,l.height=1;const o=l.getContext("2d");if(!o)throw Error("Couldn't get canvas context");for(let e=0,t=255;e<256;++e)o.fillStyle=s(e/t),o.fillRect(e,0,1,r);return e.append("image").attr("preserveAspectRatio","none").attr("height",r).attr("width",i).attr("x",a).attr("y",n).attr("xlink:href",l.toDataURL())}function Ze(e){return(0,i.y17)(e).map((t=>t/e))}function Qe(e){const{values:t,colors:a,stops:n}=e,r=Math.min(...t),s=Math.max(...t),l=null!=n?n:Ze(a.length),o=(0,i.m4Y)(l,a);return e=>o((e-r)/(s-r))}const et=D("d3-legend"),tt=e=>{const{align:t,offsetWidth:a=0,width:n,contentWidth:i}=e;return"left"===t?{top:0,left:a}:"right"===t?{top:0,left:a+n-i}:{top:0,left:a+n/2-i/2}},at=e=>{const{container:t,offset:a,maxPage:n,legend:i,transform:r,onArrowClick:s}=e,l=t.append("g").attr("class",et("pagination"));let o=0;l.append("text").text("▲").attr("class",(function(){return et("pagination-arrow",{inactive:0===a})})).style("font-size",i.itemStyle.fontSize).each((function(){o+=this.getComputedTextLength()})).on("click",(function(){a-1>=0&&s(a-1)})),l.append("text").text(`${a+1}/${n}`).attr("class",et("pagination-counter")).attr("x",o).style("font-size",i.itemStyle.fontSize).each((function(){o+=this.getComputedTextLength()})),l.append("text").text("▼").attr("class",(function(){return et("pagination-arrow",{inactive:a===n-1})})).attr("x",o).style("font-size",i.itemStyle.fontSize).on("click",(function(){a+1<n&&s(a+1)})),l.attr("transform",r)},nt=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));const it=e=>{const{boundsWidth:t,chartSeries:a,legend:r,items:s,config:l,onItemClick:o,onUpdate:c}=e,d=n.useRef(null),[u,h]=n.useState(0);return n.useEffect((()=>{h(0)}),[t]),n.useEffect((()=>{var e,a,n,p,m;if(!d.current)return;const g=(0,i.Ltv)(d.current);g.selectAll("*").remove();let f=0;if("discrete"===r.type){const a=null===(e=l.pagination)||void 0===e?void 0:e.limit;if(("number"==typeof a?s.slice(u*a,u*a+a):s).forEach(((e,a)=>{var n;const s=g.append("g").attr("class",et("line")),l=s.selectAll("legend-history").data(e).enter().append("g").attr("class",et("item")).on("click",(function(e,t){o({name:t.name,metaKey:e.metaKey}),null==c||c()}));(function(e){const{selection:t,legend:a}=e,n=t.data();t.each((function(e,t){const r=(0,i.Ltv)(this),s=(e=>n.slice(0,e).reduce(((e,t)=>e+t.symbol.width+t.symbol.padding+t.textWidth+a.itemDistance),0))(t),l=et("item-symbol",{shape:e.symbol.shape,unselected:!e.visible}),o=e.visible?e.color:"";switch(e.symbol.shape){case"path":{const t=a.lineHeight/2,n=[{x:s,y:t},{x:s+e.symbol.width,y:t}];r.append("path").attr("d",nt(n)).attr("fill","none").attr("stroke-width",e.symbol.strokeWidth).attr("class",l).style("stroke",o),e.dashStyle&&r.attr("stroke-dasharray",Te(e.dashStyle,e.symbol.strokeWidth));break}case"rect":{const t=(a.lineHeight-e.symbol.height)/2;r.append("rect").attr("x",s).attr("y",t).attr("width",e.symbol.width).attr("height",e.symbol.height).attr("rx",e.symbol.radius).attr("class",l).style("fill",o);break}case"symbol":{const t=a.lineHeight/2;r.append("svg:path").attr("d",(()=>{const t=Ve(e.symbol.symbolType);return(0,i.HRO)(t,e.symbol.width*e.symbol.width)()})).attr("transform",(()=>"translate("+s+","+t+")")).attr("class",l).style("fill",o);break}}}))})({selection:l,legend:r}),l.append("text").attr("x",(function(t,a){return(t=>e.slice(0,t).reduce(((e,t)=>e+t.symbol.width+t.symbol.padding+t.textWidth+r.itemDistance),0))(a)+t.symbol.width+t.symbol.padding})).attr("height",r.lineHeight).attr("class",(function(e){const t={selected:e.visible,unselected:!e.visible};return et("item-text",t)})).text((function(e){return"name"in e&&e.name})).style("font-size",r.itemStyle.fontSize);const d=(null===(n=s.node())||void 0===n?void 0:n.getBoundingClientRect().width)||0,{left:u}=tt({align:r.align,width:t,offsetWidth:0,contentWidth:d}),h=r.lineHeight*a;s.attr("transform",`translate(${[u,h].join(",")})`)})),f=t,l.pagination){const e=`translate(${[0,r.lineHeight*l.pagination.limit+r.lineHeight/2].join(",")})`;at({container:g,offset:u,maxPage:l.pagination.maxPage,legend:r,transform:e,onArrowClick:h})}}else{const e=null!==(a=r.colorScale.domain)&&void 0!==a?a:[],t=12;g.call(Ge,{y:r.title.height+r.title.margin,height:t,width:r.width,interpolator:Qe({values:[0,1],colors:r.colorScale.colors,stops:r.colorScale.stops})});const n=$e({scale:(0,i.m4Y)(e,[0,r.width]),ticks:{items:[[0,-t]],labelsMargin:r.ticks.labelsMargin,labelsLineHeight:r.ticks.labelsLineHeight,maxTickCount:4,tickColor:"#fff",labelFormat:e=>ce(e,{unit:"auto"})},domain:{size:r.width,color:"transparent"}}),s=r.title.height+r.title.margin+t;g.append("g").attr("transform",`translate(0, ${s})`).call(n),f=r.width}if(r.title.enable){const{maxWidth:e}=Re({labels:[r.title.text],style:r.title.style});let t=0;switch(r.title.align){case"center":t=r.width/2-e/2;break;case"right":t=r.width-e;break;default:t=0}g.append("g").attr("class",et("title")).append("text").attr("dx",t).attr("font-weight",null!==(n=r.title.style.fontWeight)&&void 0!==n?n:null).attr("font-size",null!==(p=r.title.style.fontSize)&&void 0!==p?p:null).attr("fill",null!==(m=r.title.style.fontColor)&&void 0!==m?m:null).style("alignment-baseline","before-edge").text(r.title.text)}const{left:y}=tt({align:r.align,width:t,offsetWidth:l.offset.left,contentWidth:f});g.attr("transform",`translate(${[y,l.offset.top].join(",")})`)}),[t,a,o,c,r,s,l,u]),n.createElement("g",{className:et(),ref:d,width:t,height:r.height})},rt=D("plot-title"),st=e=>{const{title:t}=e;if(!t)return null;const{x:a,y:i,text:r,style:s,height:l}=t;return n.createElement("text",{className:rt(),dx:a,dy:i,dominantBaseline:"middle",textAnchor:"middle",style:Object.assign({lineHeight:`${l}px`},s)},n.createElement("tspan",null,r))},lt=D("d3-title"),ot=e=>{const{chartWidth:t,text:a,height:i,style:r}=e;return n.createElement("text",{className:lt(),dx:t/2,dy:i/2,dominantBaseline:"middle",textAnchor:"middle",style:Object.assign({lineHeight:`${i}px`},r)},n.createElement("tspan",null,a))};var ct=a(44304),dt=a(73384);function ut(e,t){return e.color?e.color:e.total?t.color:Number(e.y)>0?t.positiveColor:t.negativeColor}function ht(e,t){const a=t.data.indexOf(e);return-1===a?null:t.data.reduce(((e,t,n)=>n<=a?e+(t.total?0:Number(t.y)):e),0)}const pt=D("tooltip"),mt=(e,t,a)=>{switch(null==a?void 0:a.type){case"category":{const n=m()(a,"categories",[]);return Le({axisDirection:e,categories:n,data:t})}case"datetime":{const a=m()(t,e);if(!a)return;return(0,$.KQ)({input:a}).format("DD.MM.YY")}default:{const a=m()(t,e);return ce(a)}}},gt=(e,t)=>mt("x",e,t),ft=(e,t)=>mt("y",e,t),yt=({hovered:e,xAxis:t,yAxis:a})=>{const i=((e,t,a)=>{var n,i;return e.every((e=>["pie","treemap","waterfall","sankey"].includes(e.series.type)))?null:e.some((e=>"bar-y"===e.series.type))?ft(null===(n=e[0])||void 0===n?void 0:n.data,a):gt(null===(i=e[0])||void 0===i?void 0:i.data,t)})(e,t,a);return n.createElement(n.Fragment,null,i&&n.createElement("div",null,i),e.map(((e,i)=>{var r;const{data:s,series:l,closest:o}=e,c=`${m()(l,"id")}_${i}`,d=m()(l,"color");switch(l.type){case"scatter":case"line":case"area":case"bar-x":{const e=n.createElement(n.Fragment,null,l.name,": ",ft(s,a));return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("div",null,o?n.createElement("b",null,e):n.createElement("span",null,e)))}case"waterfall":{const e=m()(s,"total",!1),i=ht(s,l);return n.createElement("div",{key:`${c}_${m()(s,"x")}`},!e&&n.createElement(n.Fragment,null,n.createElement("div",{key:c,className:pt("content-row")},n.createElement("b",null,gt(s,t))),n.createElement("div",{className:pt("content-row")},n.createElement("span",null,l.name," "),n.createElement("span",null,ft(s,a)))),n.createElement("div",{key:c,className:pt("content-row")},e?"Total":"Subtotal",": ",i))}case"bar-y":{const e=n.createElement(n.Fragment,null,l.name,": ",gt(s,t));return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("div",null,o?n.createElement("b",null,e):n.createElement("span",null,e)))}case"pie":case"treemap":{const e=s;return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:d}}),n.createElement("span",null,e.name||e.id," "),n.createElement("span",null,e.value))}case"sankey":{const{target:t,data:a}=e,i=null===(r=a.links.find((e=>e.name===(null==t?void 0:t.name))))||void 0===r?void 0:r.value;return n.createElement("div",{key:c,className:pt("content-row")},n.createElement("div",{className:pt("color"),style:{backgroundColor:a.color}}),n.createElement("div",{style:{display:"flex",gap:8,verticalAlign:"center"}},a.name," ",n.createElement("span",null,"→")," ",null==t?void 0:t.name,": ",i))}default:return null}})))},vt=e=>{const{hovered:t,xAxis:a,yAxis:i,renderer:r}=e;if(!t)return null;const s=null==r?void 0:r({hovered:t,xAxis:a,yAxis:i});return T()(s)?n.createElement(yt,{hovered:t,xAxis:a,yAxis:i}):s},bt=D("tooltip"),xt=e=>{const{tooltip:t,xAxis:a,yAxis:i,svgContainer:r,dispatcher:s,tooltipPinned:l,onOutsideClick:o}=e,{hovered:c,pointerPosition:d}=(({dispatcher:e,tooltip:t})=>{const[{hovered:a,pointerPosition:i},r]=n.useState({});return n.useEffect((()=>((null==t?void 0:t.enabled)&&e.on("hover-shape.tooltip",((e,t)=>{r({hovered:e,pointerPosition:t})})),()=>{(null==t?void 0:t.enabled)&&e.on("hover-shape.tooltip",null)})),[e,t]),{hovered:a,pointerPosition:i}})({dispatcher:s,tooltip:t}),u=(null==r?void 0:r.getBoundingClientRect())||{left:0,top:0},h=((null==d?void 0:d[0])||0)+u.left,p=((null==d?void 0:d[1])||0)+u.top,m=(0,ct.m)({rect:{left:h,top:p}});return n.useEffect((()=>{window.dispatchEvent(new CustomEvent("scroll"))}),[h,p]),(null==c?void 0:c.length)?n.createElement(dt.z,{className:bt({pinned:l}),contentClassName:bt("popup-content"),open:!0,anchorRef:m,offset:[0,20],placement:["right","left","top","bottom"],modifiers:[{name:"preventOverflow",options:{padding:10,altAxis:!0}}],onOutsideClick:l?e=>{(null==r?void 0:r.contains(e.target))||null==o||o()}:void 0},n.createElement("div",{className:bt("content")},n.createElement(vt,{hovered:c,xAxis:a,yAxis:i,renderer:t.renderer}))):null};var wt=a(31680),kt=a.n(wt);const St="object"==typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0);var Lt=a(94904),At=a.n(Lt);function Et(e,t,a){var n,r,s,l;const o=(0,i.diJ)(a,(e=>e.x)),c=(0,i.ylB)((e=>e.x)).center(o,e);if(-1===c)return[];const d=o[c].x,u=(0,i.diJ)(a.filter((e=>e.x===d)),(e=>e.y0));let h=-1;if(t<(null===(n=u[0])||void 0===n?void 0:n.y0))h=0;else if(t>(null===(r=u[u.length-1])||void 0===r?void 0:r.y1))h=u.length-1;else if(h=u.findIndex((e=>t>e.y0&&t<e.y1)),-1===h){const e=(0,i.diJ)(u.map(((e,t)=>({index:t,y:e.y1+(e.y0-e.y1)/2}))),(e=>e.y)),a=(0,i.ylB)((e=>e.y)).center(e,t);h=null!==(l=null===(s=e[a])||void 0===s?void 0:s.index)&&void 0!==l?l:-1}return u.map(((e,t)=>({data:e.data,series:e.series,closest:t===h})))}function Mt(e){return m()(e,"series.type")||m()(e,"point.series.type")}function zt(e){const{position:t,shapesData:a,boundsHeight:n,boundsWidth:r}=e,[s,l]=t,o=[],c=At()(a,Mt);return Object.entries(c).forEach((([e,t])=>{var a,c;switch(e){case"bar-x":{const e=t.map((e=>({data:e.data,series:e.series,x:e.x+e.width/2,y0:e.y,y1:e.y+e.height})));o.push(...Et(s,l,e));break}case"waterfall":{const e=t.map((e=>({data:e.data,series:e.series,x:e.x+e.width/2,y0:e.y,y1:e.y+e.height})));o.push(...Et(s,l,e));break}case"area":{const e=t.reduce(((e,t)=>(Array.prototype.push.apply(e,t.points.map((e=>({data:e.data,series:e.series,x:e.x,y0:e.y0,y1:e.y})))),e)),[]);o.push(...Et(s,l,e));break}case"line":{const e=t.reduce(((e,t)=>(e.push(...t.points.map((e=>({data:e.data,series:e.series,x:e.x,y0:e.y,y1:e.y})))),e)),[]);o.push(...Et(s,l,e));break}case"bar-y":{const e=t,n=(0,i.diJ)(e,(e=>e.y)),r=(0,i.ylB)((e=>e.y)).center(n,l);let c=[],d=-1;if(-1!==r){const t=n[r].y;c=(0,i.diJ)(e.filter((e=>e.y===t)),(e=>e.x));const l=c[c.length-1];d=s<(null===(a=c[0])||void 0===a?void 0:a.x)?0:l&&s>l.x+l.width?c.length-1:c.findIndex((e=>s>e.x&&s<e.x+e.width))}o.push(...c.map(((e,t)=>({data:e.data,series:e.series,closest:t===d}))));break}case"scatter":{const e=t,a=e[i.wbF.from(e,(e=>e.point.x),(e=>e.point.y)).find(s,l)];a&&o.push({data:a.point.data,series:a.point.series,closest:!0});break}case"pie":{const e=t.map((e=>e.segments)).flat().find((e=>{const{center:t}=e.data.pie,a=s-t[0],n=l-t[1];let i=Math.atan2(n,a)+.5*Math.PI;i=i<0?2*Math.PI+i:i;const r=Math.sqrt(a*a+n*n);return i>=e.startAngle&&i<=e.endAngle&&r<e.data.radius}));e&&o.push({data:e.data.series.data,series:e.data.series,closest:!0});break}case"treemap":{const e=t,a=null===(c=e[0])||void 0===c?void 0:c.leaves.find((e=>s>=e.x0&&s<=e.x1&&l>=e.y0&&l<=e.y1));a&&o.push({data:a.data,series:e[0].series,closest:!0});break}case"sankey":{const[e]=t,a=e.links.find((e=>{var t;return function(e){const{path:t,point:a,width:n,height:i,strokeWidth:r}=e,s=document.createElement("canvas");s.width=n,s.height=i;const l=s.getContext("2d");if(l){l.lineWidth=r;const e=new Path2D(t);return l.stroke(e),l.isPointInPath(e,...a)||l.isPointInStroke(e,...a)}return null}({path:null!==(t=e.path)&&void 0!==t?t:"",strokeWidth:e.strokeWidth,point:[s,l],width:r,height:n})}));a&&o.push({data:a.source,target:a.target,series:e.series,closest:!0});break}}})),o}function Ct(e){const t=n.useRef();return n.useEffect((()=>{t.current=e}),[e]),t.current}const Rt=e=>{const{chart:t,preparedTitle:a}=e,n=(e=>{const{chart:t,preparedTitle:a}=e;let n=m()(t,"margin.top",0);return(null==a?void 0:a.height)&&(n+=a.height),n})({chart:t,preparedTitle:a}),i=m()(t,"margin.bottom",0),r=m()(t,"margin.left",0),s=(e=>{const{chart:t}=e;return m()(t,"margin.right",0)})({chart:t});return{margin:{top:n,right:s,bottom:i,left:r}}};var Ot=a(30063),Wt=a.n(Ot),Dt=a(7522),_t=a.n(Dt);const Nt=e=>{const{chartWidth:t,chartMargin:a,preparedYAxis:n}=e;return t-a.right-a.left-function(e){const{preparedAxis:t}=e;let a=0,n=0;return null==t||t.forEach((e=>{const t=jt(e);"right"===e.position?n=Math.max(n,t):a=Math.max(a,t)})),a+n}({preparedAxis:n})};function jt(e){let t=0;return(null==e?void 0:e.title.text)&&(t+=e.title.height+e.title.margin),(null==e?void 0:e.labels.enabled)&&(t+=e.labels.margin+e.labels.width),t}const Ht=e=>{const{maxLegendWidth:t,items:a,preparedLegend:n}=e,r=[[]];let s=[0],l=0;return a.forEach((e=>{(0,i.Ltv)(document.body).append("text").text(e.name).style("font-size",n.itemStyle.fontSize).each((function(){const a=Wt()(e),i=this.getBoundingClientRect().width;a.textWidth=i,s.push(i);const o=s.reduce(((e,t)=>e+t),0);r[l].push(a);const c=r[l].reduce(((e,{symbol:t})=>e+t.width+t.padding),0),d=(r[l].length-1)*n.itemDistance;if(t<o+c+d){r[l].pop(),l+=1,s=[i];const e=l;r[e]=[],r[e].push(a)}})).remove()})),r},Tt={"bar-x":{barMaxWidth:50,barPadding:.1,groupPadding:.2,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},"bar-y":{barMaxWidth:50,barPadding:.1,groupPadding:.2,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},pie:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},scatter:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},line:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},area:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},treemap:{states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}},waterfall:{barMaxWidth:50,barPadding:.1,states:{hover:{enabled:!0,brightness:.3},inactive:{enabled:!1,opacity:.5}}}},It=Object.assign(Object.assign({},X),{enabled:!1});function Pt(e,t){var a;const n=m()(t,"area.states.hover"),i=Object.assign({},It,null===(a=null==t?void 0:t.area)||void 0===a?void 0:a.marker,e.marker),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}function Bt(e){var t;const a=m()(e,"dataLabels.enabled",!1),n=Object.assign({},U,null===(t=e.dataLabels)||void 0===t?void 0:t.style),i=m()(e,"dataLabels.html",!1),r=a?e.data.map((e=>String(e.label||e.x))):[],{maxHeight:s=0,maxWidth:l=0}=Re({labels:r,style:n,html:i});return{enabled:a,inside:"percent"===e.stacking||m()(e,"dataLabels.inside",!1),style:n,maxHeight:s,maxWidth:l,html:i}}const $t=16,Ft=1,Yt=v.Solid,Kt=Object.assign(Object.assign({},X),{enabled:!1});function Ut(e,t,a){const n=e===v.Solid?x.Round:x.None,i=m()(a,"line.linecap",n);return m()(t,"linecap",i)}function Jt(e,t){var a;const n=(null===(a=e.legend)||void 0===a?void 0:a.symbol)||{},i=m()(t,"line.lineWidth",Ft);return{shape:"path",width:(null==n?void 0:n.width)||$t,padding:(null==n?void 0:n.padding)||K,strokeWidth:m()(e,"lineWidth",i)}}function Xt(e,t){var a;const n=m()(t,"line.states.hover"),i=Object.assign({},Kt,null===(a=null==t?void 0:t.line)||void 0===a?void 0:a.marker,e.marker),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}function qt(e,t,a){const n=m()(t,"scatter.states.hover"),i=Object.assign(Object.assign({},X),{enabled:!0,symbol:e.symbolType||Je(a)}),r={enabled:!0,radius:i.radius,borderWidth:1,borderColor:"#ffffff",halo:J};return{states:{normal:i,hover:_t()(r,null==n?void 0:n.marker)}}}const Vt=e=>{const{chartWidth:t,chartHeight:a,chartMargin:r,legend:s,preparedYAxis:l,series:{data:o,options:c}}=e,d=n.useMemo((()=>(e=>{var t,a,n,i,r,s,l;const{legend:o,series:c}=e,d=Boolean("boolean"==typeof(null==o?void 0:o.enabled)?null==o?void 0:o.enabled:c.length>1),u=Wt()(Ue),h=m()(o,"itemStyle"),p=_t()(u,h),g=Se({text:"Tmp",style:p}),f=m()(o,"type","discrete"),y=Boolean(null===(t=null==o?void 0:o.title)||void 0===t?void 0:t.text),v=y?m()(o,"title.margin",4):0,b=Object.assign({fontSize:"12px",fontWeight:"bold"},m()(o,"title.style")),x=y?m()(o,"title.text",""):"",w=y?Re({labels:[x],style:b}).maxHeight:0,k={labelsMargin:4,labelsLineHeight:12},S={colors:[],domain:[],stops:[]};let L=0;d&&(L+=w+v,"continuous"===f?(L+=12,L+=k.labelsLineHeight+k.labelsMargin,S.colors=null!==(n=null===(a=null==o?void 0:o.colorScale)||void 0===a?void 0:a.colors)&&void 0!==n?n:[],S.stops=null!==(r=null===(i=null==o?void 0:o.colorScale)||void 0===i?void 0:i.stops)&&void 0!==r?r:Ze(S.colors.length),S.domain=null!==(l=null===(s=null==o?void 0:o.colorScale)||void 0===s?void 0:s.domain)&&void 0!==l?l:function(e){const{series:t}=e,a=t.reduce(((e,t)=>{switch(t.type){case"pie":e.push(...t.data.map((e=>e.value)));break;case"bar-y":e.push(...t.data.map((e=>Number(e.x))));break;case"scatter":case"bar-x":case"waterfall":case"line":case"area":e.push(...t.data.map((e=>Number(e.y))));break;default:throw Error(`The method for calculation a domain for a continuous color scale for the "${t.type}" series is not defined`)}return e}),[]);return[Math.min(...a),Math.max(...a)]}({series:c})):L+=g);const A=m()(o,"width",200);return{align:m()(o,"align","center"),enabled:d,height:L,itemDistance:m()(o,"itemDistance",20),itemStyle:p,lineHeight:g,margin:m()(o,"margin",15),type:f,title:{enable:y,text:x,margin:v,style:b,height:w,align:m()(o,"title.align","left")},width:A,ticks:k,colorScale:S}})({legend:s,series:o})),[s,o]),u=n.useMemo((()=>{const e=(e=>e.reduce(((e,t)=>("name"in t&&"string"==typeof t.name&&e.push(t.name),e)),[]))(o),t=(0,i.UMr)(e,k),a=(0,i.Os0)(o,(e=>e.type));return Array.from(a).reduce(((e,[a,n])=>(e.push(...function(e){const{type:t,series:a,seriesOptions:n,legend:r,colorScale:s}=e;switch(t){case"pie":return a.reduce(((e,t)=>(e.push(...function(e){const{series:t,seriesOptions:a,legend:n}=e,r=t.data.map((e=>e.name)),s=(0,i.UMr)(r,k),l=h(),o=m()(a,"pie.states.hover");return t.data.map(((e,a)=>{var i,r,c,d,u;return{type:"pie",data:e,dataLabels:{enabled:m()(t,"dataLabels.enabled",!0),style:Object.assign({},U,null===(i=t.dataLabels)||void 0===i?void 0:i.style),padding:m()(t,"dataLabels.padding",5),allowOverlap:m()(t,"dataLabels.allowOverlap",!1),connectorPadding:m()(t,"dataLabels.connectorPadding",5),connectorShape:m()(t,"dataLabels.connectorShape","polyline"),distance:m()(t,"dataLabels.distance",25),connectorCurve:m()(t,"dataLabels.connectorCurve","basic"),html:m()(t,"dataLabels.html",!1)},label:e.label,value:e.value,visible:"boolean"!=typeof e.visible||e.visible,name:e.name,id:`Series ${a}`,color:e.color||s(e.name),legend:{enabled:m()(t,"legend.enabled",n.enabled),symbol:V(t)},center:t.center||["50%","50%"],borderColor:t.borderColor||"",borderRadius:null!==(r=t.borderRadius)&&void 0!==r?r:0,borderWidth:null!==(c=t.borderWidth)&&void 0!==c?c:1,radius:null!==(u=null!==(d=e.radius)&&void 0!==d?d:t.radius)&&void 0!==u?u:"100%",innerRadius:t.innerRadius||0,stackId:l,states:{hover:{halo:{enabled:m()(o,"halo.enabled",!0),opacity:m()(o,"halo.opacity",.25),size:m()(o,"halo.size",10)}}},renderCustomShape:t.renderCustomShape,opacity:m()(e,"opacity",null),cursor:m()(t,"cursor",null)}}))}({series:t,seriesOptions:n,legend:r})),e)),[]);case"bar-x":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map((e=>{var a,r,s,l,o;const c=e.name||"",d=e.color||t(c);return{type:e.type,color:d,name:c,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,inside:"boolean"==typeof(null===(r=e.dataLabels)||void 0===r?void 0:r.inside)&&(null===(s=e.dataLabels)||void 0===s?void 0:s.inside),style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),allowOverlap:(null===(o=e.dataLabels)||void 0===o?void 0:o.allowOverlap)||!1,padding:m()(e,"dataLabels.padding",5),html:m()(e,"dataLabels.html",!1)},cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0),borderRadius:m()(e,"borderRadius",m()(n,"bar-x.borderRadius",0))}}),[])}({series:a,legend:r,colorScale:s,seriesOptions:n});case"bar-y":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map((e=>{var a,r,s;const l=e.name||"",o=e.color||t(l);return{type:e.type,color:o,name:l,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:Bt(e),cursor:m()(e,"cursor",null),borderRadius:null!==(s=null!==(a=e.borderRadius)&&void 0!==a?a:null===(r=null==n?void 0:n["bar-y"])||void 0===r?void 0:r.borderRadius)&&void 0!==s?s:0}}),[])}({series:a,legend:r,colorScale:s,seriesOptions:n});case"scatter":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e;return a.map(((e,a)=>{const r=h(),s="name"in e&&e.name?e.name:"",l=e.symbolType||Je(a);return{id:r,type:e.type,name:s,color:m()(e,"color",t(s)),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e,l)},data:e.data,marker:qt(e,n,a),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,legend:r,colorScale:s});case"line":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e,r=m()(n,"line.lineWidth",Ft),s=m()(n,"line.dashStyle",Yt);return a.map((e=>{var a,l;const o=h(),c=e.name||"",d=e.color||t(c),u=m()(e,"dashStyle",s);return{type:e.type,color:d,lineWidth:m()(e,"lineWidth",r),name:c,id:o,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:Jt(e,n)},data:e.data,dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1)},marker:Xt(e,n),dashStyle:u,linecap:Ut(u,e,n),opacity:m()(e,"opacity",null),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,seriesOptions:n,legend:r,colorScale:s});case"area":return function(e){const{colorScale:t,series:a,seriesOptions:n,legend:i}=e,r=m()(n,"area.lineWidth",1),s=m()(n,"area.opacity",.75);return a.map((e=>{var a,l;const o=h(),c=e.name||"",d=e.color||t(c);return{type:e.type,color:d,opacity:m()(e,"opacity",s),lineWidth:m()(e,"lineWidth",r),name:c,id:o,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",i.enabled),symbol:V(e)},data:e.data,stacking:e.stacking,stackId:Z(e),dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(l=e.dataLabels)||void 0===l?void 0:l.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1)},marker:Pt(e,n),cursor:m()(e,"cursor",null),yAxis:m()(e,"yAxis",0)}}),[])}({series:a,seriesOptions:n,legend:r,colorScale:s});case"treemap":return function(e){const{colorScale:t,legend:a,series:n}=e;return n.map((e=>{var n;const i=h(),r=e.name||"";return{color:e.color||t(r),data:e.data,dataLabels:{enabled:m()(e,"dataLabels.enabled",!0),style:Object.assign({},U,null===(n=e.dataLabels)||void 0===n?void 0:n.style),padding:m()(e,"dataLabels.padding",5),allowOverlap:m()(e,"dataLabels.allowOverlap",!1),html:m()(e,"dataLabels.html",!1),align:m()(e,"dataLabels.align","left")},id:i,type:e.type,name:r,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",a.enabled),symbol:V(e)},levels:e.levels,layoutAlgorithm:m()(e,"layoutAlgorithm",w.Binary),cursor:m()(e,"cursor",null)}}))}({series:a,seriesOptions:n,legend:r,colorScale:s});case"waterfall":return function(e){const{colorScale:t,series:a,legend:n}=e,[,i,r]=k;return a.map((e=>{var a,s,l;const o=e.name||"",c=e.color||t(o);return{type:e.type,color:c,positiveColor:r,negativeColor:i,name:o,id:h(),visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",n.enabled),symbol:V(e)},data:e.data,dataLabels:{enabled:(null===(a=e.dataLabels)||void 0===a?void 0:a.enabled)||!1,style:Object.assign({},U,null===(s=e.dataLabels)||void 0===s?void 0:s.style),allowOverlap:(null===(l=e.dataLabels)||void 0===l?void 0:l.allowOverlap)||!1,padding:m()(e,"dataLabels.padding",5),html:m()(e,"dataLabels.html",!1)},cursor:m()(e,"cursor",null)}}),[])}({series:a,legend:r,colorScale:s});case"sankey":return function(e){const{colorScale:t,legend:a,series:n}=e;return n.map((e=>{var n;const i=h(),r=e.name||"",s={color:t(r),data:e.data.map((e=>{var a;return{name:e.name,color:null!==(a=e.color)&&void 0!==a?a:t(e.name),links:e.links}})),dataLabels:{enabled:m()(e,"dataLabels.enabled",!0),style:Object.assign({},U,null===(n=e.dataLabels)||void 0===n?void 0:n.style)},id:i,type:e.type,name:r,visible:m()(e,"visible",!0),legend:{enabled:m()(e,"legend.enabled",a.enabled),symbol:V(e)},cursor:m()(e,"cursor",null)};return s}))}({series:a,seriesOptions:n,colorScale:s,legend:r});default:throw new C({message:`Series type "${t}" does not support data preparation for series that do not support the presence of axes`})}}({type:a,series:n,seriesOptions:c,legend:d,colorScale:t})),e)),[])}),[o,c,d]),p=n.useMemo((()=>{return e=c,_t()({},Tt,e);var e}),[c]),[g,f]=n.useState(q(u)),y=n.useMemo((()=>u.map((e=>e.legend.enabled?Object.assign(Object.assign({},e),{visible:g.includes(e.name)}):e))),[u,g]),{legendConfig:v,legendItems:b}=n.useMemo((()=>(e=>{const{chartWidth:t,chartHeight:a,chartMargin:n,series:i,preparedLegend:r,preparedYAxis:s}=e,l=Nt({chartWidth:t,chartMargin:n,preparedYAxis:s}),o=(a-n.top-n.bottom-r.margin)/2,c=(e=>e.reduce(((e,t)=>(m()(t,"legend.enabled",!0)&&e.push(Object.assign(Object.assign({},t),{symbol:t.legend.symbol})),e)),[]))(i),d=Ht({maxLegendWidth:l,items:c,preparedLegend:r});let u;if("discrete"===r.type){let e=r.lineHeight*d.length;if(o<e){const t=Math.floor(o/r.lineHeight)-1;u={limit:t,maxPage:Math.ceil(d.length/t)},e=o}r.height=e}const h=a-n.bottom-r.height;return{legendConfig:{offset:{left:n.left+jt(s[0]),top:h},pagination:u},legendItems:d}})({chartHeight:a,chartMargin:r,chartWidth:t,series:y,preparedLegend:d,preparedYAxis:l})),[t,a,r,y,d,l]),x=n.useCallback((({name:e,metaKey:t})=>{const a=(e=>e.map((e=>e.name)))(u),n=1===g.length&&g.includes(e);let i;i=t&&g.includes(e)?g.filter((t=>t!==e)):t&&!g.includes(e)?g.concat(e):n&&1===a.length?[]:n?a:[e],f(i)}),[u,g]);return n.useEffect((()=>{f(q(u))}),[u]),{legendItems:b,legendConfig:v,preparedLegend:d,preparedSeries:y,preparedSeriesOptions:p,handleLegendItemClick:x}},Gt=e=>e.every((e=>"number"==typeof e||null===e)),Zt=e=>{const{axisDirection:t,categories:a,series:n}=e,i=new Set;return n.forEach((e=>{(function(e){return ge(e)})(e)&&e.data.forEach((e=>{i.add(Le({axisDirection:t,categories:a,data:e}))}))})),a.filter((e=>i.has(e)))};function Qt(e,t,a){const n=m()(e,"type",M),r=m()(e,"min"),s=m()(e,"categories"),l=m()(e,"timestamps");switch(n){case"linear":case"logarithmic":{const s=xe(t),l=[a,a*e.maxPadding];if(Gt(s)){const[e,a]=(0,i.Xxv)(s),o="number"==typeof r?r:e;let c=a;return t.some((e=>pe.includes(e.type)))&&(c=Math.max(c,0)),("logarithmic"===n?i.ZEH:i.m4Y)().domain([o,c]).range(l).nice()}break}case"category":if(s){const e=Zt({axisDirection:"y",categories:s,series:t});return(0,i.WH)().domain(e).range([a,0])}break;case"datetime":{const n=[a,a*e.maxPadding];if(l){const[e,t]=(0,i.Xxv)(l);return(0,i.Pps)().domain([e,t]).range(n).nice()}{const e=xe(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e);return(0,i.Pps)().domain([t,a]).range(n).nice()}}break}}throw new Error("Failed to create yScale")}function ea(e,t,a){const n=m()(e,"min"),r=function(e){if(e.some((e=>"bar-y"===e.type)))return 0}(t),s=m()(e,"type",M),l=m()(e,"categories"),o=m()(e,"timestamps"),c=a*m()(e,"maxPadding",0)+function(e){let t=0;return e.forEach((e=>{if("bar-y"===e.type&&!m()(e,"dataLabels.inside")){const a=m()(e,"dataLabels.maxWidth",0);t=Math.max(t,a)}})),t}(t),d=[0,a-c];switch(s){case"linear":case"logarithmic":{const e=be(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e),l="number"==typeof n?n:t,o="number"==typeof r?Math.max(r,a):a;return("logarithmic"===s?i.ZEH:i.m4Y)().domain([l,o]).range(d).nice()}break}case"category":if(l){const e=Zt({axisDirection:"x",categories:l,series:t}),n=(0,i.WH)().domain(e).range([0,a]);return n.step()/2<c&&n.range(d),n}break;case"datetime":if(o){const[e,t]=(0,i.Xxv)(o);return(0,i.Pps)().domain([e,t]).range(d).nice()}{const e=be(t);if(Gt(e)){const[t,a]=(0,i.Xxv)(e);return(0,i.Pps)().domain([t,a]).range(d).nice()}}}throw new Error("Failed to create xScale")}var ta=a(63281),aa=a.n(ta);function na(e){switch(e.textAnchor){case"start":default:return e.x;case"middle":return e.x-e.size.width/2;case"end":return e.x-e.size.width}}function ia(e,t,a=0){return Boolean(function(e,t,a=0){const n=na(e),i=n+e.size.width,r=na(t),s=r+t.size.width;return Math.max(0,Math.min(i,s)-Math.max(n,r)+a)}(e,t,a)&&function(e,t,a=0){const n=e.y-e.size.height,i=e.y,r=t.y-t.size.height,s=t.y;return Math.max(0,Math.min(i,s)-Math.max(n,r)+a)}(e,t,a))}function ra(e){const t=[];return aa()(e,(e=>e.y),na).forEach((e=>{t.some((t=>ia(e,t)))||t.push(e)})),t}var sa=a(84203);const la=e=>{const{htmlLayout:t,preparedData:a}=e,i=n.useMemo((()=>Array.isArray(a)?a.reduce(((e,t)=>(e.push(...t.htmlElements),e)),[]):a.htmlElements),[a]);return t?n.createElement(sa.Z,{container:t},i.map(((e,t)=>n.createElement("div",{key:t,dangerouslySetInnerHTML:{__html:e.content},style:{position:"absolute",left:e.x,top:e.y}})))):null},oa=D("d3-marker"),ca=oa("halo"),da=oa("symbol");function ua(e){const t=e.attr("class",oa("wrapper")).attr("visibility",ha).attr("transform",(e=>`translate(${e.point.x},${e.point.y})`));return t.append("path").attr("class",ca).attr("d",(e=>{const t=e.point.series;return ga(t.marker.states.normal.symbol,m()(e.point.data,"radius",t.marker.states.hover.radius)+t.marker.states.hover.halo.size)})).attr("fill",(e=>e.point.series.color)).attr("opacity",(e=>e.point.series.marker.states.hover.halo.opacity)).attr("z-index",-1).attr("visibility",pa),t.append("path").attr("class",da).call(ma,"normal").attr("fill",(e=>e.point.series.color)),t}function ha(e){const t=e.point.series.marker.states;let a;return a=e.hovered?t.hover.enabled&&e.hovered:t.normal.enabled||m()(e.point.data,"marker.states.normal.enabled",!1),a?"":"hidden"}function pa(e){return e.point.series.marker.states.hover.halo.enabled&&e.hovered?"":"hidden"}function ma(e,t){e.attr("d",(e=>{const a=e.point.series;return ga(a.marker.states.normal.symbol,m()(e.point.data,"radius",a.marker.states[t].radius)+a.marker.states[t].borderWidth)})).attr("stroke-width",(e=>e.point.series.marker.states[t].borderWidth)).attr("stroke",(e=>e.point.series.marker.states[t].borderColor))}function ga(e=b.Circle,t){const a=Ve(e),n=Math.pow(t,2)*Math.PI;return(0,i.HRO)(a,n)()}function fa(e){return e.select(`.${ca}`)}function ya(e){return e.select(`.${da}`)}function va(e){const{point:t,xAxis:a,xScale:n}=e;if("category"===a.type){const e=n,i=m()(a,"categories",[]);return(e(Le({axisDirection:"x",categories:i,data:t}))||0)+e.step()/2}return n(t.x)}function ba(e){const{point:t,yAxis:a,yScale:n}=e;if("category"===a.type){const e=n,i=m()(a,"categories",[]);return(e(Le({axisDirection:"y",categories:i,data:t}))||0)+e.step()/2}return n(t.y)}function xa(e){return e.id||-1}function wa(e){const{element:t,datum:a,state:n,active:r}=e,s=(0,i.Ltv)(t);if(a.active!==r){a.active=r;const e=a.active?null:null==n?void 0:n.opacity;s.attr("opacity",e||null)}return a}function ka(e){const{x:t,y:a,width:n,height:r,borderRadius:s=0}=e,l="number"==typeof s?new Array(4).fill(s):s,[o=0,c=0,d=0,u=0]=null!=l?l:[],h=(0,i.AeT)();let p=-Math.PI/2;const m=Math.PI/2;return h.moveTo(t+o,a),h.lineTo(t+n-c,a),h.arc(t+n-c,a+c,c,p,p+m),p+=m,h.lineTo(t+n,a+r-d),h.arc(t+n-d,a+r-d,d,p,p+m),p+=m,h.lineTo(t+u,a+r),h.arc(t+u,a+r-u,u,p,p+m),p+=m,h.lineTo(t,a+o),h.arc(t+o,a+o,o,p,p+m),h.closePath(),h}const Sa=D("d3-area"),La=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"area.states.hover"),c=m()(r,"area.states.inactive"),d=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));n.selectAll("*").remove();const u=n.selectAll("shape").data(a).join("g").attr("class",Sa("series")).attr("cursor",(e=>e.series.cursor));u.append("path").attr("class",Sa("line")).attr("d",(e=>d(e.points))).attr("fill","none").attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-linejoin","round").attr("stroke-linecap","round");const h=(0,i.Wcw)().x((e=>e.x)).y0((e=>e.y0)).y1((e=>e.y));u.append("path").attr("class",Sa("region")).attr("d",(e=>h(e.points))).attr("fill",(e=>e.color)).attr("opacity",(e=>e.opacity));let p=a.reduce(((e,t)=>e.concat(t.labels)),[]);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(p=ra(p));const g=n.selectAll("text").data(p).join("text").text((e=>e.text)).attr("class",Sa("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),f=a.reduce(((e,t)=>e.concat(t.markers)),[]),y=n.selectAll("marker").data(f).join("g").call(ua),v=null==s?void 0:s.enabled,b=null==c?void 0:c.enabled;function x(e){l.current=e;const t=(null==e?void 0:e.filter((e=>"area"===e.series.type)))||[],a=t.map((e=>e.data)),n=t.map((e=>{var t;return null===(t=e.series)||void 0===t?void 0:t.id}));u.datum(((e,t,a)=>{var r;const l=(0,i.Ltv)(a[t]),o=Boolean(v&&n.includes(e.id));if(e.hovered!==o){e.hovered=o;let t=e.color||"";e.hovered&&(t=(null===(r=(0,i.yWT)(t))||void 0===r?void 0:r.brighter(null==s?void 0:s.brightness).toString())||t),l.selectAll(`.${Sa("line")}`).attr("stroke",t),l.selectAll(`.${Sa("region")}`).attr("fill",t)}return wa({element:a[t],state:c,active:Boolean(!b||!n.length||n.includes(e.id)),datum:e})})),g.datum(((e,t,a)=>wa({element:a[t],state:c,active:Boolean(!b||!n.length||n.includes(e.series.id)),datum:e}))),y.datum(((e,t,r)=>{const s=(0,i.Ltv)(r[t]),l=Boolean(v&&a.includes(e.point.data));if(e.hovered!==l&&(e.hovered=l,s.attr("visibility",ha(e)),fa(s).attr("visibility",pa),ya(s).call(ma,l?"hover":"normal")),e.point.series.marker.states.normal.enabled){const a=Boolean(!b||!n.length||n.includes(e.point.series.id));wa({element:r[t],state:c,active:a,datum:e})}return e}))}return null!==l.current&&x(l.current),t.on("hover-shape.area",x),()=>{t.on("hover-shape.area",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Sa()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};function Aa(e){if(!e.series.dataLabels.enabled)return;const t=String(e.data.label||e.data.y),a=e.series.dataLabels.style,n=e.series.dataLabels.html,{maxHeight:i,maxWidth:r}=Re({labels:[t],style:a,html:n});let s=Math.max(i,e.y-e.series.dataLabels.padding);e.series.dataLabels.inside&&(s=e.y+e.height/2);const l=e.x+e.width/2;return{text:t,x:n?l-r/2:l,y:n?s-i:s,style:a,size:{width:r,height:i},textAnchor:"middle",series:e.series}}const Ea=D("bar-x"),Ma=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"bar-x.states.hover"),c=m()(r,"bar-x.states.inactive");n.selectAll("*").remove();const d=n.selectAll("allRects").data(a).join("path").attr("d",(e=>{const t=e.isLastStackItem?Math.min(e.height,e.width/2,e.series.borderRadius):0;return ka({x:e.x,y:e.y,width:e.width,height:e.height,borderRadius:[t,t,0,0]}).toString()})).attr("class",Ea("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>e.data.color||e.series.color)).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let u=a.map((e=>e.label)).filter(Boolean);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(u=ra(u));const h=n.selectAll("text").data(u).join("text").text((e=>e.text)).attr("class",Ea("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null));function p(e){l.current=e;const t=null==s?void 0:s.enabled,a=null==c?void 0:c.enabled;if(!e)return t&&d.attr("fill",(e=>e.data.color||e.series.color)),void(a&&(d.attr("opacity",null),h.attr("opacity",null)));if(t){const t=e.map((e=>e.data.x));d.attr("fill",(e=>{var a;const n=e.data.color||e.series.color;return t.includes(e.data.x)&&(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(null==s?void 0:s.brightness).toString())||n}))}if(a){const t=e.map((e=>e.series.id));d.attr("opacity",(e=>t.includes(e.series.id)?null:(null==c?void 0:c.opacity)||null)),h.attr("opacity",(e=>t.includes(e.series.id)?null:(null==c?void 0:c.opacity)||null))}}return null!==l.current&&p(l.current),t.on("hover-shape.bar-x",p),()=>{t.on("hover-shape.bar-x",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ea()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},za=D("bar-y"),Ca=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove();const n=e.selectAll("rect").data(a).join("path").attr("d",(e=>{const t=e.isLastStackItem?Math.min(e.height,e.width/2,e.series.borderRadius):0;return ka({x:e.x,y:e.y,width:e.width,height:e.height,borderRadius:[0,t,t,0]}).toString()})).attr("class",za("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>e.color)).attr("opacity",(e=>e.data.opacity||null)).attr("cursor",(e=>e.series.cursor)),s=a.reduce(((e,t)=>(t.label&&e.push(t.label),e)),[]),c=e.selectAll("text").data(s).join("text").text((e=>e.text)).attr("class",za("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),d=m()(r,"bar-y.states.hover"),u=m()(r,"bar-y.states.inactive");function h(e){if(l.current=e,null==d?void 0:d.enabled){const t=null==e?void 0:e.reduce(((e,t)=>(e.add(t.data.y),e)),new Set);n.attr("fill",(e=>{var a;const n=e.color;return(null==t?void 0:t.has(e.data.y))&&(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(d.brightness).toString())||n}))}if(null==u?void 0:u.enabled){const t=null==e?void 0:e.map((e=>e.series.id)),a=e=>(null==t?void 0:t.length)&&!t.includes(e.series.id)&&u.opacity||null;n.attr("opacity",a),c.attr("opacity",a)}}return null!==l.current&&h(l.current),t.on("hover-shape.bar-y",h),()=>{t.on("hover-shape.bar-y",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:za()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Ra=D("d3-line"),Oa=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"line.states.hover"),c=m()(r,"line.states.inactive"),d=(0,i.n8j)().x((e=>e.x)).y((e=>e.y));n.selectAll("*").remove();const u=n.selectAll("path").data(a).join("path").attr("d",(e=>d(e.points))).attr("fill","none").attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.width)).attr("stroke-linejoin",(e=>e.linecap)).attr("stroke-linecap",(e=>e.linecap)).attr("stroke-dasharray",(e=>Te(e.dashStyle,e.width))).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let h=a.reduce(((e,t)=>e.concat(t.labels)),[]);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(h=ra(h));const p=n.selectAll("text").data(h).join("text").text((e=>e.text)).attr("class",Ra("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)),g=a.reduce(((e,t)=>e.concat(t.markers)),[]),f=n.selectAll("marker").data(g).join("g").call(ua),y=null==s?void 0:s.enabled,v=null==c?void 0:c.enabled;function b(e){l.current=e;const t=(null==e?void 0:e.filter((e=>"line"===e.series.type)))||[],a=t.map((e=>e.data)),n=t.map((e=>{var t;return null===(t=e.series)||void 0===t?void 0:t.id}));u.datum(((e,t,a)=>{const r=(0,i.Ltv)(a[t]),l=Boolean(y&&n.includes(e.id));return e.hovered!==l&&(e.hovered=l,r.attr("stroke",(e=>{var t;const a=e.color||"";return e.hovered&&(null===(t=(0,i.yWT)(a))||void 0===t?void 0:t.brighter(null==s?void 0:s.brightness).toString())||a}))),wa({element:a[t],state:c,active:Boolean(!v||!n.length||n.includes(e.id)),datum:e})})),p.datum(((e,t,a)=>wa({element:a[t],state:c,active:Boolean(!v||!n.length||n.includes(e.series.id)),datum:e}))),f.datum(((e,t,r)=>{const s=(0,i.Ltv)(r[t]),l=Boolean(y&&a.includes(e.point.data));if(e.hovered!==l&&(e.hovered=l,s.attr("visibility",ha(e)),fa(s).attr("visibility",pa),ya(s).call(ma,l?"hover":"normal")),e.point.series.marker.states.normal.enabled){const a=Boolean(!v||!n.length||n.includes(e.point.series.id));wa({element:r[t],state:c,active:a,datum:e})}return e}))}return null!==l.current&&b(l.current),t.on("hover-shape.line",b),()=>{t.on("hover-shape.line",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ra()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Wa=D("d3-pie");function Da(e){return e.data.pie.halo.enabled&&e.data.hovered?"":"hidden"}function _a(e){const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null);n.useEffect((()=>{if(!l.current)return()=>{};const e=(0,i.Ltv)(l.current);e.selectAll("*").remove();const n=`.${Wa("segment")}`,s=`.${Wa("connector")}`,o=e.selectAll("pie").data(a).join("g").attr("id",(e=>e.id)).attr("class",Wa("item")).attr("transform",(e=>{const[t,a]=e.center;return`translate(${t}, ${a})`})).style("stroke-width",(e=>e.borderWidth)).attr("cursor",(e=>e.series.cursor));o.selectAll("halo").data((e=>e.halo.enabled?e.segments:[])).join("path").attr("d",(e=>(0,i.JLW)().innerRadius(e.data.pie.innerRadius).outerRadius(e.data.radius+e.data.pie.halo.size).cornerRadius(e.data.pie.borderRadius)(e))).attr("class",Wa("halo")).attr("fill",(e=>e.data.color)).attr("opacity",(e=>e.data.pie.halo.opacity)).attr("z-index",-1).attr("visibility",Da),o.selectAll(n).data((e=>e.segments)).join("path").attr("d",(e=>(0,i.JLW)().innerRadius(e.data.pie.innerRadius).outerRadius(e.data.radius).cornerRadius(e.data.pie.borderRadius)(e))).attr("class",Wa("segment")).style("stroke",(e=>e.data.series.borderColor)).attr("fill",(e=>e.data.color)).attr("opacity",(e=>e.data.opacity)),o.selectAll("text").data((e=>e.labels)).join("text").text((e=>e.text)).attr("class",Wa("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null)).call(Ce,(e=>e.size.width>e.maxWidth?e.maxWidth:1/0)),o.selectAll(s).data((e=>e.connectors)).enter().append("path").attr("class",Wa("connector")).attr("d",(e=>e.path)).attr("stroke",(e=>e.color)).attr("stroke-width",1).attr("stroke-linejoin","round").attr("stroke-linecap","round").style("fill","none"),o.each((function(e,t,a){var n,i;const r=null===(i=(n=e.series).renderCustomShape)||void 0===i?void 0:i.call(n,{series:{innerRadius:e.innerRadius}});r&&a[t].append(r)}));const c="hover-shape.pie",d=m()(r,"pie.states.hover"),u=m()(r,"pie.states.inactive");return t.on(c,(e=>{var t,a;const r=null===(a=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.series)||void 0===a?void 0:a.id,l=null==d?void 0:d.enabled,c=null==u?void 0:u.enabled;o.datum(((e,t,a)=>{const o=(0,i.Ltv)(a[t]),h=o.selectAll(`.${Wa("halo")}`);o.selectAll(n).datum(((e,t,a)=>{const n=Boolean(l&&e.data.series.id===r);if(e.data.hovered!==n){e.data.hovered=n,(0,i.Ltv)(a[t]).attr("fill",(()=>{var t;const a=e.data.color;return e.data.hovered&&(null===(t=(0,i.yWT)(a))||void 0===t?void 0:t.brighter(null==d?void 0:d.brightness).toString())||a}));const r=h.nodes()[t];(0,i.Ltv)(r).attr("visibility",Da)}return wa({element:a[t],state:u,active:Boolean(!c||!r||r===e.data.series.id),datum:e.data}),e}));const p=o.selectAll("tspan"),m=o.selectAll(s);p.merge(m).datum(((e,t,a)=>wa({element:a[t],state:u,active:Boolean(!c||!r||r===e.series.id),datum:e})))}))})),()=>{t.on(c,null)}}),[t,a,r]);const o=a.map((e=>e.htmlLabels)).flat();return n.createElement(n.Fragment,null,n.createElement("g",{ref:l,className:Wa(),style:{zIndex:9}}),n.createElement(la,{preparedData:{htmlElements:o},htmlLayout:s}))}const Na=(0,i.rLf)().value((e=>e.value)).sort(null),ja=2*Math.PI,Ha=(e,t,a)=>{var n,i;const r=.5*e,s=.5*t;if(!a)return[r,s];const[l,o]=a;return[null!==(n=I({value:l,base:e}))&&void 0!==n?n:r,null!==(i=I({value:o,base:t}))&&void 0!==i?i:s]};const Ta=D("sankey"),Ia=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove(),e.append("g").selectAll().data(a.nodes).join("rect").attr("x",(e=>e.x0)).attr("y",(e=>e.y0)).attr("height",(e=>e.y1-e.y0)).attr("width",(e=>e.x1-e.x0)).attr("fill",(e=>e.color)),e.append("g").attr("fill","none").selectAll().data(a.links).join("g").append("path").attr("stroke-opacity",(e=>e.opacity)).attr("d",(e=>e.path)).attr("stroke",(e=>e.color)).attr("stroke-width",(e=>e.strokeWidth)),e.append("g").selectAll().data(a.labels).join("text").text((e=>e.text)).attr("class",Ta("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("dy","0.35em").attr("text-anchor",(e=>e.textAnchor)).attr("fill",(e=>{var t;return null!==(t=e.style.fontColor)&&void 0!==t?t:null}));const n="hover-shape.sankey";function r(e){l.current=e}return null!==l.current&&r(l.current),t.on(n,r),()=>{t.on(n,null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:Ta()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};function Pa(e,t){let a=0;if(void 0===t)for(let t of e)(t=+t)&&(a+=t);else{let n=-1;for(let i of e)(i=+t(i,++n,e))&&(a+=i)}return a}function Ba(e,t){let a;if(void 0===t)for(const t of e)null!=t&&(a<t||void 0===a&&t>=t)&&(a=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n,e))&&(a<i||void 0===a&&i>=i)&&(a=i)}return a}function $a(e,t){return e.sourceLinks.length?e.depth:t-1}function Fa(e){return function(){return e}}function Ya(e,t){return Ua(e.source,t.source)||e.index-t.index}function Ka(e,t){return Ua(e.target,t.target)||e.index-t.index}function Ua(e,t){return e.y0-t.y0}function Ja(e){return e.value}function Xa(e){return e.index}function qa(e){return e.nodes}function Va(e){return e.links}function Ga(e,t){const a=e.get(t);if(!a)throw new Error("missing: "+t);return a}function Za({nodes:e}){for(const t of e){let e=t.y0,a=e;for(const a of t.sourceLinks)a.y0=e+a.width/2,e+=a.width;for(const e of t.targetLinks)e.y1=a+e.width/2,a+=e.width}}var Qa=Math.PI,en=2*Qa,tn=1e-6,an=en-tn;function nn(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function rn(){return new nn}nn.prototype=rn.prototype={constructor:nn,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,a,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+a)+","+(this._y1=+n)},bezierCurveTo:function(e,t,a,n,i,r){this._+="C"+ +e+","+ +t+","+ +a+","+ +n+","+(this._x1=+i)+","+(this._y1=+r)},arcTo:function(e,t,a,n,i){e=+e,t=+t,a=+a,n=+n,i=+i;var r=this._x1,s=this._y1,l=a-e,o=n-t,c=r-e,d=s-t,u=c*c+d*d;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(u>tn)if(Math.abs(d*l-o*c)>tn&&i){var h=a-r,p=n-s,m=l*l+o*o,g=h*h+p*p,f=Math.sqrt(m),y=Math.sqrt(u),v=i*Math.tan((Qa-Math.acos((m+u-g)/(2*f*y)))/2),b=v/y,x=v/f;Math.abs(b-1)>tn&&(this._+="L"+(e+b*c)+","+(t+b*d)),this._+="A"+i+","+i+",0,0,"+ +(d*h>c*p)+","+(this._x1=e+x*l)+","+(this._y1=t+x*o)}else this._+="L"+(this._x1=e)+","+(this._y1=t)},arc:function(e,t,a,n,i,r){e=+e,t=+t,r=!!r;var s=(a=+a)*Math.cos(n),l=a*Math.sin(n),o=e+s,c=t+l,d=1^r,u=r?n-i:i-n;if(a<0)throw new Error("negative radius: "+a);null===this._x1?this._+="M"+o+","+c:(Math.abs(this._x1-o)>tn||Math.abs(this._y1-c)>tn)&&(this._+="L"+o+","+c),a&&(u<0&&(u=u%en+en),u>an?this._+="A"+a+","+a+",0,1,"+d+","+(e-s)+","+(t-l)+"A"+a+","+a+",0,1,"+d+","+(this._x1=o)+","+(this._y1=c):u>tn&&(this._+="A"+a+","+a+",0,"+ +(u>=Qa)+","+d+","+(this._x1=e+a*Math.cos(i))+","+(this._y1=t+a*Math.sin(i))))},rect:function(e,t,a,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +a+"v"+ +n+"h"+-a+"Z"},toString:function(){return this._}};const sn=rn;var ln=Array.prototype.slice;function on(e){return function(){return e}}function cn(e){return e[0]}function dn(e){return e[1]}function un(e){return e.source}function hn(e){return e.target}function pn(e,t,a,n,i){e.moveTo(t,a),e.bezierCurveTo(t=(t+n)/2,a,t,i,n,i)}function mn(e){return[e.source.x1,e.y0]}function gn(e){return[e.target.x0,e.y1]}function fn(){return function(e){var t=un,a=hn,n=cn,i=dn,r=null;function s(){var s,l=ln.call(arguments),o=t.apply(this,l),c=a.apply(this,l);if(r||(r=s=sn()),e(r,+n.apply(this,(l[0]=o,l)),+i.apply(this,l),+n.apply(this,(l[0]=c,l)),+i.apply(this,l)),s)return r=null,s+""||null}return s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(a=e,s):a},s.x=function(e){return arguments.length?(n="function"==typeof e?e:on(+e),s):n},s.y=function(e){return arguments.length?(i="function"==typeof e?e:on(+e),s):i},s.context=function(e){return arguments.length?(r=null==e?null:e,s):r},s}(pn).source(mn).target(gn)}const yn=D("d3-scatter");function vn(e){const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current),n=m()(r,"scatter.states.hover"),s=m()(r,"scatter.states.inactive");e.selectAll("*").remove();const c=e.selectAll("path").data(a,xa).join("g").call(ua).attr("fill",(e=>e.point.data.color||e.point.series.color||"")).attr("opacity",(e=>e.point.opacity)).attr("cursor",(e=>e.point.series.cursor)),d=null==n?void 0:n.enabled,u=null==s?void 0:s.enabled;function h(e){var t;l.current=e;const a=null==e?void 0:e.find((e=>"scatter"===e.series.type)),n=null==a?void 0:a.data,r=null===(t=null==a?void 0:a.series)||void 0===t?void 0:t.id;c.datum(((e,t,a)=>{const l=(0,i.Ltv)(a[t]),o=Boolean(d&&e.point.data===n);if(e.hovered!==o&&(e.hovered=o,l.attr("z-index",o?999:null),fa(l).attr("visibility",pa),ya(l).call(ma,o?"hover":"normal")),o&&l.raise(),e.point.series.marker.states.normal.enabled){const n=Boolean(!u||!r||r===e.point.series.id);wa({element:a[t],state:s,active:n,datum:e})}return e}))}return null!==l.current&&h(l.current),t.on("hover-shape.scatter",h),()=>{t.on("hover-shape.scatter",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:yn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))}const bn=D("d3-treemap"),xn=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null);return n.useEffect((()=>{if(!o.current)return()=>{};const e=(0,i.Ltv)(o.current);e.selectAll("*").remove();const{labelData:n,leaves:s,series:c}=a,d=e.selectAll("g").data(s).join("g").attr("transform",(e=>`translate(${e.x0},${e.y0})`)).attr("cursor",c.cursor).append("rect").attr("id",(e=>e.id||e.name)).attr("fill",(e=>{var t;if(e.data.color)return e.data.color;const a=null===(t=c.levels)||void 0===t?void 0:t.find((t=>t.index===e.depth));return(null==a?void 0:a.color)||c.color})).attr("width",(e=>e.x1-e.x0)).attr("height",(e=>e.y1-e.y0)),u=e.selectAll("tspan").data(n).join("text").text((e=>e.text)).attr("class",bn("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).style("font-size",(()=>c.dataLabels.style.fontSize)).style("font-weight",(()=>{var e;return(null===(e=c.dataLabels.style)||void 0===e?void 0:e.fontWeight)||null})).style("fill",(()=>{var e;return(null===(e=c.dataLabels.style)||void 0===e?void 0:e.fontColor)||null})).call(Ce,(e=>e.width)),h="hover-shape.treemap",p=m()(r,"treemap.states.hover"),g=m()(r,"treemap.states.inactive");function f(e){var t;l.current=e;const a=null==p?void 0:p.enabled,n=null==g?void 0:g.enabled,r=null===(t=null==e?void 0:e[0])||void 0===t?void 0:t.data;d.datum(((e,t,s)=>{const l=(0,i.Ltv)(s[t]),o=Boolean(a&&r===e.data),d=Boolean(n&&r&&!o);return l.attr("fill",(t=>{var a,n;const r=null===(a=c.levels)||void 0===a?void 0:a.find((e=>e.index===t.depth)),s=(null==r?void 0:r.color)||e.data.color||c.color;return o&&(null===(n=(0,i.yWT)(s))||void 0===n?void 0:n.brighter(null==p?void 0:p.brightness).toString())||s})).attr("opacity",(()=>d&&(null==g?void 0:g.opacity)||null)),e})),u.datum(((e,t,s)=>{const l=(0,i.Ltv)(s[t]),o=Boolean(a&&r===e.nodeData),c=Boolean(n&&r&&!o);return l.attr("opacity",(()=>c&&(null==g?void 0:g.opacity)||null)),e}))}return null!==l.current&&f(l.current),t.on(h,f),()=>{t.on(h,null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:bn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))};const wn=D("d3-waterfall"),kn=e=>{const{dispatcher:t,preparedData:a,seriesOptions:r,htmlLayout:s}=e,l=n.useRef(null),o=n.useRef(null),c=`.${wn("connector")}`;return n.useEffect((()=>{var e;if(!o.current)return()=>{};const n=(0,i.Ltv)(o.current),s=m()(r,"waterfall.states.hover"),d=m()(r,"waterfall.states.inactive");n.selectAll("*").remove();const u=n.selectAll("allRects").data(a).join("rect").attr("class",wn("segment")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("height",(e=>e.height)).attr("width",(e=>e.width)).attr("fill",(e=>ut(e.data,e.series))).attr("opacity",(e=>e.opacity)).attr("cursor",(e=>e.series.cursor));let h=a.map((e=>e.label)).filter(Boolean);(null===(e=a[0])||void 0===e?void 0:e.series.dataLabels.allowOverlap)||(h=ra(h));const p=n.selectAll("text").data(h).join("text").text((e=>e.text)).attr("class",wn("label")).attr("x",(e=>e.x)).attr("y",(e=>e.y)).attr("text-anchor",(e=>e.textAnchor)).style("font-size",(e=>e.style.fontSize)).style("font-weight",(e=>e.style.fontWeight||null)).style("fill",(e=>e.style.fontColor||null));function g(e){l.current=e;const t=null==s?void 0:s.enabled,a=null==d?void 0:d.enabled;if(!e)return t&&u.attr("fill",(e=>ut(e.data,e.series))),void(a&&(u.attr("opacity",null),p.attr("opacity",null)));if(t){const t=e.map((e=>e.data.x));u.attr("fill",(e=>{var a;const n=ut(e.data,e.series);if(t.includes(e.data.x)){const e=null==s?void 0:s.brightness;return(null===(a=(0,i.yWT)(n))||void 0===a?void 0:a.brighter(e).toString())||n}return n}))}if(a){const t=e.map((e=>e.series.id));u.attr("opacity",(e=>t.includes(e.series.id)?null:(null==d?void 0:d.opacity)||null)),p.attr("opacity",(e=>t.includes(e.series.id)?null:(null==d?void 0:d.opacity)||null))}}return n.selectAll(c).data(a).join("path").attr("class",wn("connector")).attr("d",((e,t)=>{const n=(0,i.n8j)(),r=a[t-1];if(!r)return null;const s=[];return Number(r.data.y)>0?s.push([r.x,r.y]):s.push([r.x,r.y+r.height]),Number(e.data.y)>0&&!e.data.total?s.push([e.x+e.width,e.y+e.height]):s.push([e.x+e.width,e.y]),n(s)})).attr("stroke-width",1).attr("stroke-dasharray",(()=>Te(v.Dash,1))),null!==l.current&&g(l.current),t.on("hover-shape.waterfall",g),()=>{t.on("hover-shape.waterfall",null)}}),[t,a,r]),n.createElement(n.Fragment,null,n.createElement("g",{ref:o,className:wn()}),n.createElement(la,{preparedData:a,htmlLayout:s}))},Sn=e=>{const{boundsWidth:t,boundsHeight:a,dispatcher:r,series:s,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u,split:h,htmlLayout:p}=e,g=n.useMemo((()=>{const e=we(s),g=(0,i.Os0)(e,(e=>e.type)),f=[],y=Array.from(g).reduce(((e,s)=>{const[g,y]=s;switch(g){case"bar-x":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,xAxis:n,xScale:r,yScale:s,boundsHeight:l}=e,o=m()(n,"categories",[]),c=m()(a,"bar-x.barMaxWidth"),d=m()(a,"bar-x.barPadding"),u=m()(a,"bar-x.groupPadding"),h=m()(a,"bar-x.dataSorting"),p="desc"===(null==h?void 0:h.direction)?i.rGT:i.V_A,g=(()=>{switch(null==h?void 0:h.key){case"y":return"data.y";case"name":return"series.name";default:return}})(),f={};t.forEach((e=>{e.data.forEach((t=>{const a="category"===n.type?Le({axisDirection:"x",categories:o,data:t}):t.x;if(a){f[a]||(f[a]={});const n=f[a];n[e.stackId]||(n[e.stackId]=[]),n[e.stackId].push({data:t,series:e})}}))}));let y=1/0;if("category"===n.type)y=r.bandwidth();else{const e=r,a=t.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.x)))),e)),[]);a.sort().forEach(((t,n)=>{if(n>0&&t!==a[n-1]){const i=e(t)-e(a[n-1]);i<y&&(y=i)}}))}const v=(0,i.T9B)(Object.values(f),(e=>Object.values(e).length))||1,b=Math.max(y*u,1),x=y-b,w=Math.max(y*d,1),k=Math.max(1,Math.min(x/v-w,c)),S=[];return Object.entries(f).forEach((([e,a])=>{const o=Object.values(a),c=k*o.length+w*(o.length-1);o.forEach(((a,o)=>{let d=0;const u=[],h=g?(0,i.diJ)(a,((e,t)=>p(m()(e,g),m()(t,g)))):a;if(h.forEach(((t,a)=>{const i=t.series.yAxis,l=s[i];let p;if("category"===n.type){const t=r;p=(t(e)||0)+t.bandwidth()/2}else p=r(Number(e));const g=p-c/2+(k+w)*o,f=t.data.y,y=l(f),v=l(0),b=f>0?v-y:y-v,x={x:g,y:f>0?y-d:l(0),width:k,height:b,opacity:m()(t.data,"opacity",null),data:t.data,series:t.series,htmlElements:[],isLastStackItem:a===h.length-1},S=Aa(x);t.series.dataLabels.html&&S?x.htmlElements.push({x:S.x,y:S.y,content:S.text,size:S.size}):x.label=Aa(x),u.push(x),d+=b+1})),t.some((e=>"percent"===e.stacking))){let e=0;const t=l/(d-u.length);u.forEach((a=>{a.height=a.height*t,a.y=l-a.height-e,e+=a.height+1}))}S.push(...u)}))})),S})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u,boundsHeight:a});e.push(n.createElement(Ma,{key:"bar-x",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"bar-y":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,yAxis:n,xScale:r,yScale:[s]}=e,l=r,o=l(l.domain()[1]),c=m()(a,"bar-y.barMaxWidth"),d=m()(a,"bar-y.barPadding"),u=m()(a,"bar-y.groupPadding"),h=m()(a,"bar-y.dataSorting"),p="desc"===(null==h?void 0:h.direction)?i.rGT:i.V_A,g=(()=>{switch(null==h?void 0:h.key){case"x":return"data.x";case"name":return"series.name";default:return}})(),f=function(e,t){const a={};return e.forEach((e=>{e.data.forEach((n=>{const i=m()(e,"yAxis",0),r=t[i],s=m()(r,"categories",[]),l="category"===r.type?Le({axisDirection:"y",categories:s,data:n}):n.y;l&&(a[l]||(a[l]={}),a[l][e.stackId]||(a[l][e.stackId]=[]),a[l][e.stackId].push({data:n,series:e}))}))})),a}(t,n),y=function(e,t,a){let n=1/0;if("category"===t[0].type)n=a.bandwidth();else{const t=a,i=e.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.y)))),e)),[]);i.sort().forEach(((e,a)=>{if(a>0&&e!==i[a-1]){const r=t(e)-t(i[a-1]);r<n&&(n=r)}}))}return n}(t,n,s),v=(0,i.T9B)(Object.values(f),(e=>Object.values(e).length))||1,b=Math.max(y*u,1),x=y-b,w=Math.max(y*d,1),k=Math.max(1,Math.min(x/v-w,c)),S=[];return Object.entries(f).forEach((([e,a])=>{const r=Object.values(a),c=k*r.length+w*(r.length-1);r.forEach(((a,r)=>{const d=l(0);let u=d;const h=[],f=g?(0,i.diJ)(a,((e,t)=>p(m()(e,g),m()(t,g)))):a;if(f.forEach((({data:t,series:a},i)=>{let o;o="category"===n[0].type?(s(e)||0)+y/2:s(Number(e));const p=o-c/2+(k+w)*r,g=Number(t.x),v=g>0?l(g)-d:d-l(g),b={x:g>0?u:u-v,y:p,width:v,height:k,color:t.color||a.color,opacity:m()(t,"opacity",null),data:t,series:a,htmlElements:[],isLastStackItem:i===f.length-1};h.push(b),u+=v+1})),t.some((e=>"percent"===e.stacking))){let e=0;const t=o/(u-h.length);h.forEach((a=>{a.width=a.width*t,a.x=e,e+=a.width}))}S.push(...h)}))})),S.forEach((e=>{!function(e){const t=e.series.dataLabels;if(!t.enabled)return;const a=e.data,n=String(a.label||a.x),{maxHeight:i,maxWidth:r}=Re({labels:[n],style:t.style,html:t.html}),s=t.inside?e.x+e.width/2:e.x+e.width+7,l=e.y+e.height/2;t.html?e.htmlElements.push({x:s,y:l-i/2,content:n,size:{width:r,height:i}}):e.label={x:s,y:l+i/2,text:n,textAnchor:t.inside?"middle":"right",style:t.style,series:e.series,size:{width:r,height:i}}}(e)})),S})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(Ca,{key:"bar-y",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"waterfall":if(c&&u){const t=(e=>{const{series:t,seriesOptions:a,xAxis:n,xScale:i,yAxis:[r],yScale:[s]}=e,l=s(s.domain()[0]),o=m()(a,"waterfall.barMaxWidth"),c=m()(a,"waterfall.barPadding"),d=t.reduce(((e,t)=>(e.push(...t.data.map((e=>({data:e,series:t})))),e)),[]),u=aa()(d,(e=>e.data.x)),h=function(e){const{series:t,xAxis:a,xScale:n}=e;if("category"===a.type)return n.bandwidth();const i=n,r=t.reduce(((e,t)=>(t.data.forEach((t=>e.push(Number(t.x)))),e)),[]);let s=1/0;return r.sort().forEach(((e,t)=>{if(t>0&&e!==r[t-1]){const a=i(e)-i(r[t-1]);a<s&&(s=a)}})),s}({series:t,xAxis:n,xScale:i}),p=Math.max(h*c,1),g=Math.max(1,Math.min(h-p,o)),f=ba({point:{y:0},yScale:s,yAxis:r});let y=0;const v=[];return u.forEach(((e,t)=>{if("number"!=typeof e.data.y&&!e.data.total)return;e.data.total||(y+=Number(e.data.y));const a=v[v.length-1],o=va({point:e.data,xAxis:n,xScale:i})-g/2,c=Number(e.data.total?y:e.data.y),d=f-ba({point:{y:Math.abs(c)},yScale:s,yAxis:r});let u;u=!a||e.data.total?ba({point:{y:c>0?c:0},yScale:s,yAxis:r}):Number(a.data.y)<0?Number(e.data.y)>0?a.y+a.height-d:a.y+a.height:Number(e.data.y)<0?a.y:a.y-d;const h={x:o,y:u,width:g,height:d,opacity:m()(e.data,"opacity",null),data:e.data,series:e.series,subTotal:y,htmlElements:[]};h.label=function(e,t){if(!e.series.dataLabels.enabled)return;const a=String(e.data.label||e.subTotal),n=e.series.dataLabels.style,{maxHeight:i,maxWidth:r}=Re({labels:[a],style:n});let s;return s=Number(e.data.y)>0||e.data.total?Math.max(i,e.y-e.series.dataLabels.padding):Math.min(t-e.series.dataLabels.padding,e.y+e.height+e.series.dataLabels.padding+i),{text:a,x:e.x+e.width/2,y:s,style:n,size:{width:r,height:i},textAnchor:"middle",series:e.series}}(h,l),v.push(h)})),v})({series:y,seriesOptions:l,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(kn,{key:"waterfall",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"line":if(c&&u){const t=(e=>{const{series:t,xAxis:a,yAxis:n,xScale:i,yScale:r,split:s}=e,[l,o]=i.range(),c=o/(1-a.maxPadding);return t.reduce(((e,t)=>{var l;const o=t.yAxis,d=n[o],u=(null===(l=s.plots[d.plotIndex])||void 0===l?void 0:l.top)||0,h=r[t.yAxis],p=t.data.map((e=>({x:va({point:e,xAxis:a,xScale:i}),y:u+ba({point:e,yAxis:d,yScale:h}),active:!0,data:e,series:t}))),m=[];let g=[];t.dataLabels.enabled&&(t.dataLabels.html?m.push(...p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=Re({labels:[n],html:!0});return{x:Math.min(a-i.maxWidth,Math.max(0,e.x)),y:Math.max(0,e.y-t.dataLabels.padding-i.maxHeight),content:n,size:{width:i.maxWidth,height:i.maxHeight}}}(e,t,c)))):g=p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=t.dataLabels.style,r=Re({labels:[n],style:i}),s={text:n,x:e.x,y:e.y-t.dataLabels.padding,style:i,size:{width:r.maxWidth,height:r.maxHeight},textAnchor:"middle",series:t,active:!0},l=na(s);if(l<0)s.x=s.x+Math.abs(l);else{const e=l+s.size.width;e>a&&(s.x=s.x-a-e)}return s}(e,t,c))));let f=[];(t.marker.states.normal.enabled||t.marker.states.hover.enabled)&&(f=p.map((e=>({point:e,active:!0,hovered:!1}))));const y={points:p,markers:f,labels:g,color:t.color,width:t.lineWidth,series:t,hovered:!1,active:!0,id:t.id,dashStyle:t.dashStyle,linecap:t.linecap,opacity:t.opacity,htmlElements:m};return e.push(y),e}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u,split:h});e.push(n.createElement(Oa,{key:"line",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"area":if(c&&u){const t=(e=>{const{series:t,xAxis:a,xScale:n,yAxis:r,yScale:s,boundsHeight:l}=e,[o,c]=n.range(),d=c/(1-a.maxPadding);return Array.from((0,i.Os0)(t,(e=>e.stackId))).reduce(((e,[o,c])=>{const u=function(e,t,a){const n=t.categories||[],r=e.reduce(((e,i)=>(i.data.forEach((i=>{const r=String("category"===t.type?Le({axisDirection:"x",categories:n,data:i}):i.x);e.has(r)||e.set(r,va({point:i,xAxis:t,xScale:a}))})),e)),new Map);return"category"===t.type?n.reduce(((e,t)=>{const a=r.get(t);return"number"==typeof a&&e.push([t,a]),e}),[]):(0,i.diJ)(Array.from(r),(([e,t])=>t))}(c,a,n),h=new Map;u.forEach((([e])=>{h.set(e,0)}));const p=c.reduce(((e,t)=>{const n=t.yAxis,i=r[n],l=s[n],o=ba({point:{y:0},yAxis:i,yScale:l}),c=t.data.reduce(((e,t)=>{const n=String("category"===a.type?Le({axisDirection:"x",categories:a.categories||[],data:t}):t.x);return e.set(n,t)}),new Map),p=u.reduce(((e,[a,n])=>{const r=h.get(a)||0,s=c.get(a)||{x:a,y:0},d=ba({point:s,yAxis:i,yScale:l})-r;return h.set(a,o-d),e.push({y0:o-r,x:n,y:d,data:s,series:t}),e}),[]);let m=[];const g=[];if(t.dataLabels.enabled){const e=p.map((e=>function(e,t,a){const n=String(e.data.label||e.data.y),i=t.dataLabels.style,r=Re({labels:[n],style:i,html:t.dataLabels.html}),s={text:n,x:e.x,y:e.y-t.dataLabels.padding,style:i,size:{width:r.maxWidth,height:r.maxHeight},textAnchor:"middle",series:t,active:!0},l=na(s);if(l<0)s.x=s.x+Math.abs(l);else{const e=l+s.size.width;e>a&&(s.x=s.x-(e-a))}return s}(e,t,d)));if(t.dataLabels.html){const a=e.map((e=>{var a;const n=null!==(a=e.style)&&void 0!==a?a:t.dataLabels.style,i=Re({labels:[e.text],style:n,html:!0});return{x:e.x-e.size.width/2,y:e.y,content:e.text,size:{width:i.maxWidth,height:i.maxHeight}}}));g.push(...a)}else m=e}let f=[];return(t.marker.states.normal.enabled||t.marker.states.hover.enabled)&&(f=p.map((e=>({point:e,active:!0,hovered:!1})))),e.push({points:p,markers:f,labels:m,color:t.color,opacity:t.opacity,width:t.lineWidth,series:t,hovered:!1,active:!0,id:t.id,htmlElements:g}),e}),[]);return t.some((e=>"percent"===e.stacking))&&u.forEach((([e],t)=>{const a=h.get(e)||0;let n=0;const i=l/a;p.forEach((e=>{const a=e.points[t];if(a){const e=(a.y0-a.y)*i;a.y0=l-e-n,a.y=a.y0+e,n+=e}}))})),e.concat(p)}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u,boundsHeight:a});e.push(n.createElement(La,{key:"area",dispatcher:r,seriesOptions:l,preparedData:t,htmlLayout:p})),f.push(...t)}break;case"scatter":if(c&&u){const t=(e=>{const{series:t,xAxis:a,xScale:n,yAxis:i,yScale:r}=e;return t.reduce(((e,t)=>{const s=m()(t,"yAxis",0),l=i[s],o=r[s];return("category"===a.type||"category"===l.type?t.data:t.data.filter((e=>"number"==typeof e.x&&"number"==typeof e.y))).forEach((i=>{e.push({point:{data:i,series:t,x:va({point:i,xAxis:a,xScale:n}),y:ba({point:i,yAxis:l,yScale:o}),opacity:m()(i,"opacity",null)},hovered:!1,active:!0,htmlElements:[]})})),e}),[])})({series:y,xAxis:o,xScale:c,yAxis:d,yScale:u});e.push(n.createElement(vn,{key:"scatter",dispatcher:r,preparedData:t,seriesOptions:l,htmlLayout:p})),f.push(...t)}break;case"pie":{const s=function(e){const{series:t,boundsWidth:a,boundsHeight:n}=e,r=Math.min(a,n)/2,s=(0,i.Os0)(t,(e=>e.stackId)),l=e=>{const{data:t,series:n}=e,{dataLabels:r}=n[0],s=[],l=[],o=[];if(!r.enabled)return{labels:s,htmlLabels:l,connectors:o};let c=(0,i.n8j)();const d=function(e){switch(e.connectorCurve){case"basic":return i.qrM;case"linear":return i.lUB}}(t);d&&(c=c.curve(d));const{style:u,connectorPadding:h,distance:p}=r,{maxHeight:m}=Re({labels:["Some Label"],style:u}),g=(0,i.JLW)().innerRadius((e=>e.data.radius)).outerRadius((e=>e.data.radius)),f=(0,i.JLW)().innerRadius((e=>e.data.radius+p/2)).outerRadius((e=>e.data.radius+p/2)),y=(0,i.JLW)().innerRadius((e=>e.data.radius+p)).outerRadius((e=>e.data.radius+p)),v=(0,i.JLW)().innerRadius((e=>e.data.radius+p+h)).outerRadius((e=>e.data.radius+p+h));return n.forEach(((e,n)=>{const i=s[s.length-1],d=String(e.data.label||e.data.value),h=r.html,p=Re({labels:[d],style:u,html:h}),b=p.maxWidth,x=t.segments[n],w=e=>{let[t,n]=v.centroid(Object.assign(Object.assign({},x),{startAngle:e,endAngle:e}));return h?(t=t<0?t-b:t,n-=p.maxHeight):n=n<0?n-m:n,t=Math.max(-a/2,t),[t,n]},k=e=>{const t=g.centroid(x),a=y.centroid(Object.assign(Object.assign({},x),{startAngle:e,endAngle:e}));return"straight-line"===r.connectorShape?[t,a]:[t,f.centroid(x),a]},S=Math.max((null==i?void 0:i.angle)||0,x.startAngle+(x.endAngle-x.startAngle)/2),[L,A]=w(S),E={text:d,x:L,y:A,style:u,size:{width:b,height:m},maxWidth:b,textAnchor:S<Math.PI?"start":"end",series:{id:e.id},active:!0,segment:x.data,angle:S};let M=!1;if(i&&(M=ia(i,E,r.padding),M)){let e=!0;const t=Math.PI/180;for(;e;){const a=E.angle+t;if(a>ja&&a%ja>s[0].angle)e=!1;else{E.angle=a;const[t,n]=w(a);E.x=t,E.y=n,ia(i,E,r.padding)||(e=!1,M=!1)}}}if(r.allowOverlap||!M){const e=na(E);if(Math.abs(e)>a/2)E.maxWidth=E.size.width-(Math.abs(e)-a/2);else{const t=e+E.size.width;t>a/2&&(E.maxWidth=E.size.width-(t-a/2))}h?l.push({x:t.center[0]+E.x,y:Math.max(0,t.center[1]+E.y),content:E.text,size:E.size}):s.push(E);const n={path:c(k(S)),color:x.data.color};o.push(n)}})),{labels:s,htmlLabels:l,connectors:o}};return Array.from(s).map((([e,t])=>{const i=((e,t)=>{var i;const s=t[0],{center:l,borderWidth:o,borderColor:c,borderRadius:d,innerRadius:u,dataLabels:h}=s,p={id:e,center:Ha(a,n,l),innerRadius:0,segments:[],labels:[],htmlLabels:[],connectors:[],borderColor:c,borderWidth:o,borderRadius:d,series:t[0],connectorCurve:h.connectorCurve,halo:{enabled:s.states.hover.halo.enabled,opacity:s.states.hover.halo.opacity,size:s.states.hover.halo.size}},{maxHeight:m}=Re({labels:["Some Label"],style:h.style});let g=0;const f=t.map((e=>{var t;let a=r;h.enabled&&(a-=h.distance+h.connectorPadding+m);const n=null!==(t=I({value:e.radius,base:a}))&&void 0!==t?t:a;return g=Math.max(g,n),{value:e.value,color:e.color,opacity:e.opacity,series:e,hovered:!1,active:!0,pie:p,radius:n}}));return p.segments=Na(f),p.innerRadius=null!==(i=I({value:u,base:g}))&&void 0!==i?i:0,p})(e,t),s=l({data:i,series:t}),o=Math.max(...i.segments.map((e=>e.data.radius))),c=Math.min(i.center[1]-o,...s.labels.map((e=>e.y+i.center[1])),...s.htmlLabels.map((e=>e.y))),d=Math.max(i.center[1]+o,...s.labels.map((e=>e.y+i.center[1]+e.size.height)),...s.htmlLabels.map((e=>e.y+e.size.height))),u=Math.floor(c-i.halo.size);u>0&&(i.segments.forEach((e=>{e.data.radius+=u/2})),i.center[1]-=u/2);const h=Math.floor(n-d-i.halo.size);h>0&&(i.segments.forEach((e=>{e.data.radius+=h/2})),i.center[1]+=h/2);const{labels:p,htmlLabels:m,connectors:g}=l({data:i,series:t});return i.labels=p,i.htmlLabels=m,i.connectors=g,i}))}({series:y,boundsWidth:t,boundsHeight:a});e.push(n.createElement(_a,{key:"pie",dispatcher:r,preparedData:s,seriesOptions:l,htmlLayout:p})),f.push(...s);break}case"treemap":{const s=function(e){var t;const{series:a,width:n,height:r}=e,s=function(e){return e.data.reduce(((t,a)=>{const n=Object.assign({},a);return n.parentId||(n.parentId=e.id),t.push(n),t}),[{name:e.name,id:e.id}])}(a),l=(0,i.zTO)().id((e=>e.id?e.id:Array.isArray(e.name)?e.name.join():e.name)).parentId((e=>e.parentId))(s).sum((e=>e.value||0)),o=(0,i.hkb)();switch(a.layoutAlgorithm){case w.Binary:o.tile(i.GaH);break;case w.Dice:o.tile(i.iLc);break;case w.Slice:o.tile(i.XvW);break;case w.SliceDice:o.tile(i.Yix);break;case w.Squarify:o.tile(i.bC4)}const c=o.size([n,r]).paddingInner((e=>{var t,n;const i=null===(t=a.levels)||void 0===t?void 0:t.find((t=>t.index===e.depth+1));return null!==(n=null==i?void 0:i.padding)&&void 0!==n?n:1}))(l),d=c.leaves();let u=[];const h=[];if(null===(t=a.dataLabels)||void 0===t?void 0:t.enabled){const{html:e,padding:t,align:n}=a.dataLabels,i=function(e){const{data:t,html:a,padding:n,align:i}=e;return t.reduce(((e,t)=>((Array.isArray(t.data.name)?t.data.name:[t.data.name]).forEach(((r,s)=>{var l;const{maxHeight:o,maxWidth:c}=null!==(l=Re({labels:[r],html:a}))&&void 0!==l?l:{},d=t.x0+n,u=t.x1-n,h=Math.max(0,u-d);let p=d;const m=s*o+t.y0+n;switch(i){case"left":p=d;break;case"center":p=Math.max(d,d+(h-c)/2);break;case"right":p=Math.max(d,u-c)}const g=a?{content:r,x:p,y:m,size:{width:h,height:o}}:{text:r,x:p,y:m,width:h,nodeData:t.data};e.push(g)})),e)),[])}({html:e,padding:t,align:n,data:d});e?h.push(...i):u=i}return{labelData:u,leaves:d,series:a,htmlElements:h}}({series:y[0],width:t,height:a});e.push(n.createElement(xn,{key:"treemap",dispatcher:r,preparedData:s,seriesOptions:l,htmlLayout:p})),f.push(s);break}case"sankey":{const i=function(e){const{series:t,width:a,height:n}=e,i=function(){let e,t,a,n=0,i=0,r=1,s=1,l=24,o=8,c=Xa,d=$a,u=qa,h=Va,p=6;function m(){const m={nodes:u.apply(null,arguments),links:h.apply(null,arguments)};return function({nodes:e,links:t}){for(const[t,a]of e.entries())a.index=t,a.sourceLinks=[],a.targetLinks=[];const n=new Map(e.map(((t,a)=>[c(t,a,e),t])));for(const[e,a]of t.entries()){a.index=e;let{source:t,target:i}=a;"object"!=typeof t&&(t=a.source=Ga(n,t)),"object"!=typeof i&&(i=a.target=Ga(n,i)),t.sourceLinks.push(a),i.targetLinks.push(a)}if(null!=a)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(a),n.sort(a)}(m),function({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(Pa(t.sourceLinks,Ja),Pa(t.targetLinks,Ja)):t.fixedValue}(m),function({nodes:e}){const t=e.length;let a=new Set(e),n=new Set,i=0;for(;a.size;){for(const e of a){e.depth=i;for(const{target:t}of e.sourceLinks)n.add(t)}if(++i>t)throw new Error("circular link");a=n,n=new Set}}(m),function({nodes:e}){const t=e.length;let a=new Set(e),n=new Set,i=0;for(;a.size;){for(const e of a){e.height=i;for(const{source:t}of e.targetLinks)n.add(t)}if(++i>t)throw new Error("circular link");a=n,n=new Set}}(m),function(a){const c=function({nodes:e}){const a=Ba(e,(e=>e.depth))+1,i=(r-n-l)/(a-1),s=new Array(a);for(const t of e){const e=Math.max(0,Math.min(a-1,Math.floor(d.call(null,t,a))));t.layer=e,t.x0=n+e*i,t.x1=t.x0+l,s[e]?s[e].push(t):s[e]=[t]}if(t)for(const e of s)e.sort(t);return s}(a);e=Math.min(o,(s-i)/(Ba(c,(e=>e.length))-1)),function(t){const a=function(e,t){let a;if(void 0===t)for(const t of e)null!=t&&(a>t||void 0===a&&t>=t)&&(a=t);else{let n=-1;for(let i of e)null!=(i=t(i,++n))&&(a>i||void 0===a&&i>=i)&&(a=i)}return a}(t,(t=>(s-i-(t.length-1)*e)/Pa(t,Ja)));for(const n of t){let t=i;for(const i of n){i.y0=t,i.y1=t+i.value*a,t=i.y1+e;for(const e of i.sourceLinks)e.width=e.value*a}t=(s-t+e)/(n.length+1);for(let e=0;e<n.length;++e){const a=n[e];a.y0+=t*(e+1),a.y1+=t*(e+1)}w(n)}}(c);for(let e=0;e<p;++e){const t=Math.pow(.99,e),a=Math.max(1-t,(e+1)/p);f(c,t,a),g(c,t,a)}}(m),Za(m),m}function g(e,a,n){for(let i=1,r=e.length;i<r;++i){const r=e[i];for(const e of r){let t=0,n=0;for(const{source:a,value:i}of e.targetLinks){let r=i*(e.layer-a.layer);t+=k(a,e)*r,n+=r}if(!(n>0))continue;let i=(t/n-e.y0)*a;e.y0+=i,e.y1+=i,x(e)}void 0===t&&r.sort(Ua),y(r,n)}}function f(e,a,n){for(let i=e.length-2;i>=0;--i){const r=e[i];for(const e of r){let t=0,n=0;for(const{target:a,value:i}of e.sourceLinks){let r=i*(a.layer-e.layer);t+=S(e,a)*r,n+=r}if(!(n>0))continue;let i=(t/n-e.y0)*a;e.y0+=i,e.y1+=i,x(e)}void 0===t&&r.sort(Ua),y(r,n)}}function y(t,a){const n=t.length>>1,r=t[n];b(t,r.y0-e,n-1,a),v(t,r.y1+e,n+1,a),b(t,s,t.length-1,a),v(t,i,0,a)}function v(t,a,n,i){for(;n<t.length;++n){const r=t[n],s=(a-r.y0)*i;s>1e-6&&(r.y0+=s,r.y1+=s),a=r.y1+e}}function b(t,a,n,i){for(;n>=0;--n){const r=t[n],s=(r.y1-a)*i;s>1e-6&&(r.y0-=s,r.y1-=s),a=r.y0-e}}function x({sourceLinks:e,targetLinks:t}){if(void 0===a){for(const{source:{sourceLinks:e}}of t)e.sort(Ka);for(const{target:{targetLinks:t}}of e)t.sort(Ya)}}function w(e){if(void 0===a)for(const{sourceLinks:t,targetLinks:a}of e)t.sort(Ka),a.sort(Ya)}function k(t,a){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:i,width:r}of t.sourceLinks){if(i===a)break;n+=r+e}for(const{source:e,width:i}of a.targetLinks){if(e===t)break;n-=i}return n}function S(t,a){let n=a.y0-(a.targetLinks.length-1)*e/2;for(const{source:i,width:r}of a.targetLinks){if(i===t)break;n+=r+e}for(const{target:e,width:i}of t.sourceLinks){if(e===a)break;n-=i}return n}return m.update=function(e){return Za(e),e},m.nodeId=function(e){return arguments.length?(c="function"==typeof e?e:Fa(e),m):c},m.nodeAlign=function(e){return arguments.length?(d="function"==typeof e?e:Fa(e),m):d},m.nodeSort=function(e){return arguments.length?(t=e,m):t},m.nodeWidth=function(e){return arguments.length?(l=+e,m):l},m.nodePadding=function(t){return arguments.length?(o=e=+t,m):o},m.nodes=function(e){return arguments.length?(u="function"==typeof e?e:Fa(e),m):u},m.links=function(e){return arguments.length?(h="function"==typeof e?e:Fa(e),m):h},m.linkSort=function(e){return arguments.length?(a=e,m):a},m.size=function(e){return arguments.length?(n=i=0,r=+e[0],s=+e[1],m):[r-n,s-i]},m.extent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],i=+e[0][1],s=+e[1][1],m):[[n,i],[r,s]]},m.iterations=function(e){return arguments.length?(p=+e,m):p},m}().nodeId((e=>e.name)).nodeSort((e=>e.index)).nodeWidth(15).nodePadding(10).extent([[1,5],[a-1,n-5]]),{nodes:r,links:s}=i({nodes:t.data,links:t.data.reduce(((e,a)=>(a.links.forEach((n=>{const i=t.data.find((e=>e.name===n.name));i&&e.push({source:a,target:i,value:n.value})})),e)),[])}),l=r.map((e=>{var a,n,i,r,s,l;return{x0:null!==(a=e.x0)&&void 0!==a?a:0,x1:null!==(n=e.x1)&&void 0!==n?n:0,y0:null!==(i=e.y0)&&void 0!==i?i:0,y1:null!==(r=e.y1)&&void 0!==r?r:0,color:null!==(s=e.color)&&void 0!==s?s:"",data:t.data[null!==(l=e.index)&&void 0!==l?l:0]}})),o=s.map((e=>{var t,a;return{opacity:.75,color:null!==(t=e.source.color)&&void 0!==t?t:"",path:fn()(e),strokeWidth:Math.max(1,null!==(a=e.width)&&void 0!==a?a:0),source:e.source,target:e.target,value:e.value}})),c=[];if(t.dataLabels.enabled){const e=r.map((e=>{var n,i,r,s;const l=null!==(n=e.x0)&&void 0!==n?n:0,o=null!==(i=e.x1)&&void 0!==i?i:0,c=null!==(r=e.y0)&&void 0!==r?r:0,d=null!==(s=e.y1)&&void 0!==s?s:0;return{text:e.name,x:l<a/2?o+6:l-6,y:(d+c)/2,textAnchor:l<a/2?"start":"end",style:t.dataLabels.style}}));c.push(...e)}return{series:t,nodes:l,links:o,htmlElements:[],labels:c}}({series:y[0],width:t,height:a});e.push(n.createElement(Ia,{key:"sankey",dispatcher:r,preparedData:i,seriesOptions:l,htmlLayout:p})),f.push(i);break}default:throw new C({message:`The display method is not defined for a series with type "${g}"`})}return e}),[]);return{shapes:y,shapesData:f}}),[t,a,r,s,l,o,c,d,u]);return{shapes:g.shapes,shapesData:g.shapesData}};function Ln(e,t){const a=null==e?void 0:e.min;return void 0===a&&(null==t?void 0:t.some((e=>me.includes(e.type))))?t.reduce(((e,t)=>{const a=t.data.reduce(((e,t)=>Math.min(e,m()(t,"x",0))),0);return Math.min(e,a)}),0):a}function An(e,t){const a=null==e?void 0:e.min;return void 0===a&&(null==t?void 0:t.some((e=>pe.includes(e.type))))?t.reduce(((e,t)=>{if("waterfall"===t.type){const a=t.data.reduce(((e,a)=>Math.min(e,ht(a,t)||0)),0);return Math.min(e,a)}{const a=t.data.reduce(((e,t)=>Math.min(e,m()(t,"y",0))),0);return Math.min(e,a)}}),0):a}function En(e){const{width:t,height:a,data:i,dispatcher:r,htmlLayout:s}=e,l=Ct(t),o=Ct(a),{chart:c,title:d,tooltip:u}=(e=>{const{data:{chart:t,title:a,tooltip:i}}=e,r=n.useMemo((()=>{const e=(({title:e})=>{const t=m()(e,"text"),a={fontSize:m()(e,"style.fontSize","15px"),fontWeight:m()(e,"style.fontWeight")},n=t?Se({text:t,style:a})+16:0;return t?{text:t,style:a,height:n}:void 0})({title:a}),n=(e=>{const{tooltip:t}=e;return Object.assign(Object.assign({},t),{enabled:m()(t,"enabled",!0)})})({tooltip:i});return{chart:Rt({chart:t,preparedTitle:e}),title:e,tooltip:n}}),[t,a,i]);return r})({data:i}),h=n.useMemo((()=>(({xAxis:e,series:t,width:a})=>{var n;const i=m()(e,"title.text",""),r=Object.assign(Object.assign({},A.style),m()(e,"title.style")),s=m()(e,"title.maxRowCount",A.maxRowCount),l=Oe({text:i,style:r,width:a}).slice(0,s),o=Re({labels:[i],style:r}),c={fontSize:m()(e,"labels.style.fontSize",S)},d={type:m()(e,"type","linear"),labels:{enabled:m()(e,"labels.enabled",!0),margin:m()(e,"labels.margin",10),padding:m()(e,"labels.padding",10),dateFormat:m()(e,"labels.dateFormat"),numberFormat:m()(e,"labels.numberFormat"),rotation:m()(e,"labels.rotation",0),style:c,width:0,height:0,lineHeight:Se({text:"Tmp",style:c}),maxWidth:m()(e,"labels.maxWidth",80)},lineColor:m()(e,"lineColor"),categories:m()(e,"categories"),timestamps:m()(e,"timestamps"),title:{text:i,style:r,margin:m()(e,"title.margin",A.margin),height:o.maxHeight*l.length,width:o.maxWidth,align:m()(e,"title.align",A.align),maxRowCount:m()(e,"title.maxRowCount",A.maxRowCount)},min:Ln(e,t),maxPadding:m()(e,"maxPadding",.01),grid:{enabled:m()(e,"grid.enabled",!0)},ticks:{pixelInterval:m()(e,"ticks.pixelInterval")},position:"bottom",plotIndex:0,plotLines:[]},{height:u,rotation:h}=function({axis:e,series:t,width:a,autoRotation:n=!0}){const i=_e({scale:ea(e,t,a),count:We({axis:e,range:a}),maxCount:Ne({width:a,axis:e})}),r=Ae(e,i),s=i.map((t=>ke({axis:e,value:t,step:r}))),l=function({width:e,labels:t,padding:a=0,style:n}){const i=(e-a*(t.length-1))/t.length,r=(0,Ee.A)(document.body).append("text").style("font-size",(null==n?void 0:n.fontSize)||""),s=t.some((e=>{var t,a;return((null===(a=null===(t=r.text(e).node())||void 0===t?void 0:t.getBoundingClientRect())||void 0===a?void 0:a.width)||0)>i}));return r.remove(),s}({width:a,labels:s,padding:e.labels.padding,style:e.labels.style}),o=l&&n?-45:0,c=e.labels.rotation||o,d=c?Re({labels:s,style:e.labels.style,rotation:c}).maxHeight:e.labels.lineHeight,u=c?P(c)*e.labels.maxWidth:d;return{height:Math.min(u,d),rotation:c}}({axis:d,series:t,width:a,autoRotation:null===(n=null==e?void 0:e.labels)||void 0===n?void 0:n.autoRotation});return d.labels.height=u,d.labels.rotation=h,d})({xAxis:i.xAxis,width:t,series:i.series.data})),[i,t]),p=n.useMemo((()=>(({series:e,yAxis:t,height:a})=>{const n=[];return(t||[{}]).map((t=>{const i=m()(t,"plotIndex",0),r=!n[i];r&&(n[i]=[]),n[i].push(t);const s=r?"left":"right",l=m()(t,"labels.enabled",!0),o={fontSize:m()(t,"labels.style.fontSize",S)},c=m()(t,"title.text",""),d=Object.assign(Object.assign({},E.style),m()(t,"title.style")),u=m()(t,"title.maxRowCount",E.maxRowCount),h=Oe({text:c,style:d,width:a}).slice(0,u),p=Re({labels:[c],style:d}),g={type:m()(t,"type",M),labels:{enabled:l,margin:l?m()(t,"labels.margin",10):0,padding:l?m()(t,"labels.padding",10):0,dateFormat:m()(t,"labels.dateFormat"),numberFormat:m()(t,"labels.numberFormat"),style:o,rotation:m()(t,"labels.rotation",0),width:0,height:0,lineHeight:Se({text:"TmpLabel",style:o}),maxWidth:m()(t,"labels.maxWidth",80)},lineColor:m()(t,"lineColor"),categories:m()(t,"categories"),timestamps:m()(t,"timestamps"),title:{text:c,margin:m()(t,"title.margin",E.margin),style:d,width:p.maxWidth,height:p.maxHeight*h.length,align:m()(t,"title.align",E.align),maxRowCount:u},min:An(t,e),maxPadding:m()(t,"maxPadding",.05),grid:{enabled:m()(t,"grid.enabled",r)},ticks:{pixelInterval:m()(t,"ticks.pixelInterval")},position:m()(t,"position",s),plotIndex:m()(t,"plotIndex",0),plotLines:m()(t,"plotLines",[]).map((e=>({value:m()(e,"value",0),color:m()(e,"color","var(--g-color-base-brand)"),width:m()(e,"width",1),dashStyle:m()(e,"dashStyle",v.Solid),opacity:m()(e,"opacity",1),layerPlacement:m()(e,"layerPlacement","before")})))};return l&&(g.labels.width=(e=>{const{axis:t,series:a}=e;if(!t.labels.enabled)return 0;const n=De(Qt(t,a,1)),i=Ae(t,n);return Re({labels:n.map((e=>ke({axis:t,value:e,step:i}))),style:t.labels.style,rotation:t.labels.rotation}).maxWidth})({axis:g,series:e})),g}))})({series:i.series.data,yAxis:i.yAxis,height:a})),[i,a]),{legendItems:g,legendConfig:f,preparedSeries:y,preparedSeriesOptions:b,preparedLegend:x,handleLegendItemClick:w}=Vt({chartWidth:t,chartHeight:a,chartMargin:c.margin,series:i.series,legend:i.legend,preparedYAxis:p}),{boundsWidth:k,boundsHeight:L}=(e=>{const{margin:t,width:a,height:i,preparedLegend:r,preparedXAxis:s,preparedYAxis:l,preparedSeries:o}=e;return n.useMemo((()=>{const e=o.some(ge),n=Nt({chartWidth:a,chartMargin:t,preparedYAxis:l}),c=(e=>{const{hasAxisRelatedSeries:t,preparedLegend:a,preparedXAxis:n}=e;let i=0;return a.enabled&&(i+=a.height+a.margin),t&&(n.title.text&&(i+=n.title.height+n.title.margin),n.labels.enabled&&(i+=n.labels.margin+n.labels.height)),i})({hasAxisRelatedSeries:e,preparedLegend:r,preparedXAxis:s});return{boundsWidth:n,boundsHeight:i-t.top-t.bottom-c}}),[t,a,i,r,s,l,o])})({width:t,height:a,margin:c.margin,preparedLegend:x,preparedXAxis:h,preparedYAxis:p,preparedSeries:y}),z=(e=>{var t;const{split:a,boundsHeight:n,chartWidth:i}=e,r=null!==(t=I({value:null==a?void 0:a.gap,base:n}))&&void 0!==t?t:0,s=function(e){const{split:t,boundsHeight:a,gap:n}=e,i=(null==t?void 0:t.plots)||[];return i.length>1?(a-n*(i.length-1))/i.length:a}({split:a,boundsHeight:n,gap:r});return{plots:((null==a?void 0:a.plots)||[]).map(((e,t)=>{const a=function(e){const{title:t,plotIndex:a,plotHeight:n,chartWidth:i,gap:r}=e,s=(null==t?void 0:t.text)||"",l={fontSize:m()(t,"style.fontSize","15px"),fontWeight:m()(t,"style.fontWeight")},o=s?Se({text:s,style:l})+16:0;return{text:s,x:i/2,y:a*(n+r)+o/2,style:l,height:o}}({title:e.title,plotIndex:t,gap:r,plotHeight:s,chartWidth:i});return{top:t*(s+r)+a.height,height:s-a.height,title:a}})),gap:r}})({split:i.split,boundsHeight:L,chartWidth:t}),{xScale:C,yScale:R}=(e=>{const{boundsWidth:t,boundsHeight:a,series:i,xAxis:r,yAxis:s,split:l}=e;return n.useMemo((()=>{let e,n;return i.some(ge)&&({xScale:e,yScale:n}=(e=>{const{boundsWidth:t,boundsHeight:a,series:n,xAxis:i,yAxis:r,split:s}=e;let l=we(n);return l=0===l.length?n:l,{xScale:ea(i,l,t),yScale:r.map(((e,t)=>{const i=n.filter((e=>m()(e,"yAxis",0)===t)),r=we(i),l=je({boundsHeight:a,split:s});return Qt(e,r.length?r:i,l)}))}})({boundsWidth:t,boundsHeight:a,series:i,xAxis:r,yAxis:s,split:l})),{xScale:e,yScale:n}}),[t,a,i,r,s,l])})({boundsWidth:k,boundsHeight:L,series:y,xAxis:h,yAxis:p,split:z}),{shapes:O,shapesData:W}=Sn({boundsWidth:k,boundsHeight:L,dispatcher:r,series:y,seriesOptions:b,xAxis:h,xScale:C,yAxis:p,yScale:R,split:z,htmlLayout:s}),D=c.margin.top;return{boundsHeight:L,boundsOffsetLeft:c.margin.left+jt(p[0]),boundsOffsetTop:D,boundsWidth:k,handleLegendItemClick:w,legendConfig:f,legendItems:g,preparedLegend:x,preparedSeries:y,preparedSplit:z,prevHeight:o,prevWidth:l,shapes:O,shapesData:W,title:d,tooltip:u,xAxis:h,xScale:C,yAxis:p,yScale:R}}const Mn=D("d3"),zn=e=>{var t,a,r,s;const{width:l,height:o,data:c}=e,d=n.useRef(null),u=n.useRef(null),h=n.useRef(null),p=n.useMemo((()=>(0,i.JDs)(_,N,j)),[]),{boundsHeight:m,boundsOffsetLeft:g,boundsOffsetTop:f,boundsWidth:y,handleLegendItemClick:v,legendConfig:b,legendItems:x,preparedSeries:w,preparedSplit:k,preparedLegend:S,prevHeight:L,prevWidth:A,shapes:E,shapesData:M,title:z,tooltip:C,xAxis:R,xScale:O,yAxis:W,yScale:D}=En(Object.assign(Object.assign({},e),{dispatcher:p,htmlLayout:u.current})),{tooltipPinned:H,togglePinTooltip:T,unpinTooltip:I}=function(e){var t,a;const{dispatcher:i,tooltip:r}=e,[s,l]=n.useState(!1),o=null==r?void 0:r.enabled,c=null===(t=null==r?void 0:r.pin)||void 0===t?void 0:t.enabled,d=null===(a=null==r?void 0:r.pin)||void 0===a?void 0:a.modifierKey,u=n.useCallback(((e,t)=>{let a=e;if(e&&d)switch(d){case"altKey":a=t.altKey;break;case"metaKey":a="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform)?t.metaKey:t.ctrlKey}l(a)}),[d]),h=n.useCallback((()=>{l(!1),i.call(N,{},void 0)}),[i]);return{tooltipPinned:s,togglePinTooltip:o&&c?u:void 0,unpinTooltip:o&&c?h:void 0}}({dispatcher:p,tooltip:C}),{handleChartClick:P,handleMouseLeave:B,throttledHandleMouseMove:$,throttledHandleTouchMove:F}=function(e){const{boundsHeight:t,boundsOffsetLeft:a,boundsOffsetTop:r,boundsWidth:s,dispatcher:l,shapesData:o,svgContainer:c,togglePinTooltip:d,tooltipPinned:u,unpinTooltip:h,xAxis:p,yAxis:m}=e,g=n.useCallback(((e,a)=>e<0||e>s||a<0||a>t),[t,s]),f=([e,n],i)=>{if(u)return;const c=e-a,d=n-r;if(g(c,d))return l.call(N,{},void 0),void l.call(j,{},void 0,i);const h=zt({position:[c,d],shapesData:o,boundsHeight:t,boundsWidth:s});l.call(N,i.target,h,[e,n]),l.call(j,{},{hovered:h,xAxis:p,yAxis:m[0]},i)},y=St?void 0:kt()((e=>{const[t,a]=(0,i.WnM)(e,c);f([t,a],e)}),50),v=St?kt()((e=>{const t=e.touches[0],[a,n]=(0,i.WnM)(t,c);f([a,n],e)}),50):void 0;return{handleChartClick:e=>{const[n,f]=(0,i.WnM)(e,c),y=n-a,v=f-r;if(g(y,v))return;const b=zt({position:[y,v],shapesData:o,boundsHeight:t,boundsWidth:s}),x=null==b?void 0:b.find((e=>e.closest));if(!x)return void(u&&(null==h||h()));l.call(_,void 0,{point:x.data,series:x.series},e);const w=!u;w||(l.call(N,e.target,b,[n,f]),l.call(j,{},{hovered:b,xAxis:p,yAxis:m[0]},e)),null==d||d(w,e)},handleMouseLeave:e=>{u||(null==y||y.cancel(),l.call(N,{},void 0),l.call(j,{},void 0,e))},throttledHandleMouseMove:y,throttledHandleTouchMove:v}}({boundsHeight:m,boundsOffsetLeft:g,boundsOffsetTop:f,boundsWidth:y,dispatcher:p,shapesData:M,svgContainer:d.current,togglePinTooltip:T,tooltipPinned:H,unpinTooltip:I,xAxis:R,yAxis:W}),Y=null===(a=null===(t=c.chart)||void 0===t?void 0:t.events)||void 0===a?void 0:a.click,K=null===(s=null===(r=c.chart)||void 0===r?void 0:r.events)||void 0===s?void 0:s.pointermove;return n.useEffect((()=>(Y&&p.on(_,Y),K&&p.on(j,((...e)=>{const[t,a]=e;K(t,a)})),()=>{p.on(_,null),p.on(j,null)})),[p,Y,K]),n.useEffect((()=>{A===l&&L===o||!H||null==I||I()}),[A,l,L,o,H,I]),n.createElement(n.Fragment,null,n.createElement("svg",{ref:d,className:Mn(),width:l,height:o,onMouseMove:$,onMouseLeave:B,onTouchStart:F,onTouchMove:F,onClick:P},z&&n.createElement(ot,Object.assign({},z,{chartWidth:l})),n.createElement("g",{transform:`translate(0, ${f})`},k.plots.map(((e,t)=>n.createElement(st,{key:`plot-${t}`,title:e.title})))),n.createElement("g",{width:y,height:m,transform:`translate(${[g,f].join(",")})`,ref:h},O&&(null==D?void 0:D.length)&&n.createElement(n.Fragment,null,n.createElement(Pe,{axes:W,width:y,height:m,scale:D,split:k,plotRef:h}),n.createElement("g",{transform:`translate(0, ${m})`},n.createElement(Ke,{axis:R,width:y,height:m,scale:O,split:k}))),E),S.enabled&&n.createElement(it,{chartSeries:w,boundsWidth:y,legend:S,items:x,config:b,onItemClick:v,onUpdate:I})),n.createElement("div",{className:Mn("html-layer"),ref:u,style:{transform:`translate(${g}px, ${f}px)`}}),n.createElement(xt,{dispatcher:p,tooltip:C,svgContainer:d.current,xAxis:R,yAxis:W[0],onOutsideClick:I,tooltipPinned:H}))},Cn=n.forwardRef((function(e,t){const{data:a,lang:r,onResize:l}=e,o=n.useRef(),c=n.useRef(null),p=n.useRef(),[m,g]=n.useState();o.current!==a&&((e=>{if(f()(e)||f()(e.series)||f()(e.series.data))throw new C({code:"ERR.CK.NO_DATA",message:u("error","label_no-data")});if(e.series.data.some((e=>f()(e.data))))throw new C({code:z,message:"You should specify data for all series"});if((e=>{const{series:t,type:a}=e;let n=0;return t.forEach((e=>{e.type===a&&(n+=1)})),n})({series:e.series.data,type:y.Treemap})>1)throw new C({code:z,message:'It looks like you are trying to define more than one "treemap" series.'});e.series.data.forEach((t=>{(e=>{const{series:t,xAxis:a,yAxis:n}=e;if(!R.includes(t.type))throw new C({code:z,message:u("error","label_invalid-series-type",{types:R.join(", ")})});switch(t.type){case"area":case"bar-y":case"bar-x":O({series:t,xAxis:a,yAxis:n}),(({series:e})=>{const t=["normal","percent"];if(e.stacking&&!t.includes(e.stacking))throw new C({code:z,message:u("error","label_invalid-series-property",{key:"stacking",values:t})})})({series:t});break;case"line":case"scatter":O({series:t,xAxis:a,yAxis:n});break;case"pie":(({series:e})=>{e.data.forEach((({value:e})=>{if("number"!=typeof e)throw new C({code:z,message:u("error","label_invalid-pie-data-value")})}))})({series:t});break;case"treemap":(({series:e})=>{const t={};e.data.forEach((e=>{e.parentId&&!t[e.parentId]&&(t[e.parentId]=!0)})),e.data.forEach((e=>{let a=e.id;if(a||(a=Array.isArray(e.name)?e.name.join():e.name),t[a]&&"number"==typeof e.value)throw new C({code:z,message:u("error","label_invalid-treemap-redundant-value",{id:e.id,name:e.name})});if(!t[a]&&"number"!=typeof e.value)throw new C({code:z,message:u("error","label_invalid-treemap-missing-value",{id:e.id,name:e.name})})}))})({series:t})}})({series:t,yAxis:e.yAxis,xAxis:e.xAxis})}))})(a),o.current=a);const v=n.useCallback((()=>{var e;const t=null===(e=c.current)||void 0===e?void 0:e.parentElement;if(t){const{width:e,height:a}=t.getBoundingClientRect();g({width:e,height:a})}}),[]),b=n.useMemo((()=>{var e;return null===(e=p.current)||void 0===e||e.cancel(),p.current=s()(v,200),p.current}),[v]);return n.useImperativeHandle(t,(()=>({reflow(){b()}})),[b]),n.useEffect((()=>{b()}),[b]),n.useEffect((()=>{const e=(0,i.Ltv)(window),t=`resize.${h()}`;return e.on(t,b),()=>{e.on(t,null)}}),[b]),n.useEffect((()=>{"function"==typeof l&&l({dimensions:m})}),[m,l]),n.useEffect((()=>{r&&d.lang!==r&&d.setLang(r)}),[r]),n.createElement("div",{ref:c,style:{width:(null==m?void 0:m.width)||"100%",height:(null==m?void 0:m.height)||"100%",position:"relative"}},(null==m?void 0:m.height)&&(null==m?void 0:m.width)&&n.createElement(zn,{height:null==m?void 0:m.height,width:null==m?void 0:m.width,data:a}))}));var Rn=[],On=new MessageChannel,Wn=function(){this.postMessage(void 0)}.bind(On.port2);On.port1.onmessage=function(){var e=Rn;Rn=[];for(var t=performance.now(),a=0;a<e.length;a++)e[a](t)},On=null;var Dn=a(52789);function _n(){const e=performance.now();return{end:()=>performance.now()-e}}var Nn=a(56911),jn=a(50823),Hn=a(96464);const Tn="horizontal",In="vertical";var Pn=a(67901);class Bn extends n.PureComponent{render(){const{children:e,className:t,split:a,style:i,size:r,eleRef:s}=this.props,l=["Pane",a,t];let o={flex:1,position:"relative",outline:"none"};return void 0!==r&&("vertical"===a?o.width=r:(o.height=r,o.display="flex"),o.flex="none"),o=Object.assign({},o,i||{}),n.createElement("div",{ref:s,className:l.join(" "),style:o},e)}}const $n="Resizer";class Fn extends n.Component{render(){const{className:e,onClick:t,onDoubleClick:a,onMouseDown:i,onTouchEnd:r,onTouchStart:s,resizerClassName:l=$n,split:o,style:c}=this.props,d=[l,o,e];return n.createElement("span",{role:"presentation",className:d.join(" "),style:c,onMouseDown:e=>i(e),onTouchStart:e=>{s(e)},onTouchEnd:e=>{e.preventDefault(),r(e)},onClick:e=>{t&&(e.preventDefault(),t(e))},onDoubleClick:e=>{a&&(e.preventDefault(),a(e))}})}}function Yn(){var e;null===(e=window.getSelection())||void 0===e||e.removeAllRanges()}function Kn(e,t,a,n){if("number"==typeof n){const e="number"==typeof t?t:0,i="number"==typeof a&&a>=0?a:1/0;return Math.max(e,Math.min(i,n))}return void 0!==e?e:t}class Un extends n.Component{static getDerivedStateFromProps(e,t){return Un.getSizeUpdate(e,t)}static getSizeUpdate(e,t){const a={},{instanceProps:n}=t;if(n.size===e.size&&void 0!==e.size)return{};const i=void 0===e.size?Kn(e.defaultSize,e.minSize,e.maxSize,t.draggedSize):e.size;void 0!==e.size&&(a.draggedSize=i);const r="first"===e.primary;return a[r?"pane1Size":"pane2Size"]=i,a[r?"pane2Size":"pane1Size"]=void 0,a.instanceProps={size:e.size},a}constructor(e){super(e),this.splitPane=null,this.pane1=null,this.pane2=null,this.onMouseDown=e=>{const t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchStart(t)},this.onTouchStart=e=>{const{allowResize:t,onDragStarted:a,split:n}=this.props;if(t){Yn();const t="vertical"===n?e.touches[0].clientX:e.touches[0].clientY;"function"==typeof a&&a(),this.setState({active:!0,position:t})}},this.onMouseMove=e=>{const t=Object.assign({},e,{touches:[{clientX:e.clientX,clientY:e.clientY}]});this.onTouchMove(t)},this.onTouchMove=e=>{const{allowResize:t,maxSize:a,minSize:n,onChange:i,split:r,step:s}=this.props,{active:l,position:o}=this.state;if(t&&l){Yn();const t="first"===this.props.primary,l=t?this.pane1:this.pane2,c=t?this.pane2:this.pane1;if(l){const d=l,u=c;if(d.getBoundingClientRect){const l=d.getBoundingClientRect().width,c=d.getBoundingClientRect().height,h="vertical"===r?l:c;let p=o-("vertical"===r?e.touches[0].clientX:e.touches[0].clientY);if(s){if(Math.abs(p)<s)return;p=~~(p/s)*s}let m=t?p:-p;parseInt(window.getComputedStyle(d).order)>parseInt(window.getComputedStyle(u).order)&&(m=-m);let g=a;if(void 0!==a&&a<=0){const e=this.splitPane;g="vertical"===r?e.getBoundingClientRect().width+a:e.getBoundingClientRect().height+a}let f=h-m;const y=o-p;f<n?f=n:void 0!==a&&f>g?f=g:this.setState({position:y,resized:!0}),i&&i(f),this.setState({draggedSize:f,[t?"pane1Size":"pane2Size"]:f})}}}},this.onMouseUp=()=>{const{allowResize:e,onDragFinished:t}=this.props,{active:a,draggedSize:n}=this.state;e&&a&&("function"==typeof t&&t(n),this.setState({active:!1}))};const{size:t,defaultSize:a,minSize:n,maxSize:i,primary:r}=e,s=void 0===t?Kn(a,n,i):t;this.state={active:!1,resized:!1,position:0,draggedSize:0,pane1Size:"first"===r?s:void 0,pane2Size:"second"===r?s:void 0,instanceProps:{size:t}}}componentDidMount(){document.addEventListener("mouseup",this.onMouseUp),document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("touchmove",this.onTouchMove),this.setState(Un.getSizeUpdate(this.props,this.state))}componentWillUnmount(){document.removeEventListener("mouseup",this.onMouseUp),document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("touchmove",this.onTouchMove)}render(){const{allowResize:e,children:t,className:a,onResizerClick:i,onResizerDoubleClick:r,paneClassName:s,pane1ClassName:l,pane2ClassName:o,paneStyle:c,pane1Style:d,pane2Style:u,resizerClassName:h,resizerStyle:p,split:m,style:g}=this.props,{pane1Size:f,pane2Size:y}=this.state,v=e?"":"disabled",b=h?`${h} ${$n}`:h,x=function(e){return n.Children.toArray(e).filter((e=>e))}(t),w=Object.assign({display:"flex",flex:1,height:"100%",position:"absolute",outline:"none",overflow:"hidden",MozUserSelect:"text",WebkitUserSelect:"text",msUserSelect:"text",userSelect:"text"},g);"vertical"===m?Object.assign(w,{flexDirection:"row",left:0,right:0}):Object.assign(w,{bottom:0,flexDirection:"column",minHeight:"100%",top:0,width:"100%"});const k=["SplitPane",a,m,v],S=Object.assign(Object.assign({},c),d),L=Object.assign(Object.assign({},c),u),A=["Pane1",s,l].join(" "),E=["Pane2",s,o].join(" ");return n.createElement("div",{className:k.join(" "),ref:e=>{this.splitPane=e},style:w},n.createElement(Bn,{className:A,key:"pane1",eleRef:e=>{this.pane1=e},size:f,split:m,style:S},x[0]),n.createElement(Fn,{className:v,onClick:i,onDoubleClick:r,onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onTouchEnd:this.onMouseUp,key:"resizer",resizerClassName:b,split:m,style:p||{}}),n.createElement(Bn,{className:E,key:"pane2",eleRef:e=>{this.pane2=e},size:y,split:m,style:L},x[1]))}}Un.defaultProps={allowResize:!0,minSize:50,primary:"first",split:"vertical",paneClassName:"",pane1ClassName:"",pane2ClassName:""};const Jn=(0,Pn.cn)("styled-split-pane"),Xn=Jn("pane-resizer"),qn=e=>{var{paneOneRender:t,paneTwoRender:a}=e,i=(0,Nn.Tt)(e,["paneOneRender","paneTwoRender"]);const r=n.useRef(null);return n.useEffect((()=>{var e,t;const a=null===(t=null===(e=r.current)||void 0===e?void 0:e.splitPane)||void 0===t?void 0:t.getElementsByClassName(Xn)[0],n=`${Xn}_hovered`,i=()=>{null==a||a.classList.add(n)},s=()=>{null==a||a.classList.remove(n)};return null==a||a.addEventListener("touchstart",i),null==a||a.addEventListener("touchend",s),function(){null==a||a.removeEventListener("touchstart",i),null==a||a.removeEventListener("touchend",s)}}),[]),n.createElement(Un,Object.assign({},i,{ref:r,className:Jn(),resizerClassName:Xn}),n.createElement(Bn,null,t()),n.createElement(Bn,null,a()))},Vn="object"==typeof window,Gn=Vn&&"function"==typeof window.ScreenOrientation&&"function"==typeof screen.orientation.addEventListener&&"string"==typeof screen.orientation.type,Zn=Object.values({PORTRAIT_PRIMARY:"portrait-primary",PORTRAIT_SECONDARY:"portrait-secondary",LANDSCAPE_PRIMARY:"landscape-primary",LANDSCAPE_SECONDARY:"landscape-secondary"});function Qn(e){const t=n.useRef();return n.useEffect((()=>{t.current=e}),[e]),t.current}const ei=n.forwardRef((function(e,t){const{renderer:a}=e,[i,r]=n.useState();return n.useImperativeHandle(t,(()=>({redraw(e){r(e)}})),[]),n.createElement(vt,Object.assign({},i,{renderer:a}))})),ti=.6;function ai(){return window.innerWidth*ti}const ni={overflow:"auto"},ii=function(e){const t=(0,jn.x)(e),a=n.forwardRef((function(t,a){var i;const{data:r}=t,s=(0,Nn.Tt)(t,["data"]),l=n.useRef(null),o=n.useRef(null),c=n.useRef(null),d=n.useRef(null),{allowResize:u,minSize:h,maxSize:p,tooltipHeight:m,split:g,size:f,setTooltipHeight:y,setSplit:v,setSize:b}=function(e){const{container:t}=e,[a,i]=n.useState(0),[r,s]=n.useState(Vn&&window.innerWidth>window.innerHeight?In:Tn),[l,o]=n.useState(function(e){return Vn&&e===In?ai():"calc(100% - 24px)"}(r)),c=r===Tn;let d,u;if(Vn&&t&&r===Tn){const e=t.getBoundingClientRect().height;d=e-24-a,u=e/3}return{allowResize:c,maxSize:d,minSize:u,tooltipHeight:a,setTooltipHeight:i,split:r,setSplit:s,size:l,setSize:o}}({container:l.current}),x=Qn(m),w=Qn(g);if(w&&g!==w&&g===In)b(ai());else if(g===Tn&&l.current&&0===x&&m!==x){const e=l.current.getBoundingClientRect().height;e-24===f&&(b(e-24-m),null===(i=c.current)||void 0===i||i.reflow())}const k=n.useCallback((()=>{if(!o.current)return;const e=o.current.getBoundingClientRect().height;y(e)}),[y]);(0,Hn.w)({ref:o,onResize:k});const S=n.useMemo((()=>{var e,t,a;const n=null===(t=null===(e=r.chart)||void 0===e?void 0:e.events)||void 0===t?void 0:t.pointermove;return Object.assign(Object.assign({},r),{chart:Object.assign(Object.assign({},r.chart),{events:Object.assign(Object.assign({},null===(a=r.chart)||void 0===a?void 0:a.events),{pointermove:(e,t)=>{var a;null===(a=d.current)||void 0===a||a.redraw(e),null==n||n(e,t)}})}),tooltip:Object.assign(Object.assign({},r.tooltip),{enabled:!1})})}),[r]),L=n.useCallback((()=>{const e=window.innerWidth>window.innerHeight?In:Tn;v(e)}),[v]),A=n.useCallback((e=>{const t=e.target&&"type"in e.target&&e.target.type;(function(e){return"string"==typeof e&&Zn.includes(e)})(t)&&v(function(e){switch(e){case"landscape-primary":case"landscape-secondary":return"vertical";default:return"horizontal"}}(t))}),[v]),E=n.useCallback((e=>{var t;null===(t=c.current)||void 0===t||t.reflow(),g===Tn&&b(e)}),[g,b]);return n.useLayoutEffect((()=>(Gn?screen.orientation.addEventListener("change",A):Vn&&window.addEventListener("orientationchange",L),()=>{Gn?screen.orientation.removeEventListener("change",A):Vn&&window.removeEventListener("orientationchange",L)})),[L,A]),n.createElement("div",{ref:l,style:{position:"relative",height:"100%"}},n.createElement(qn,{allowResize:u,maxSize:p,minSize:h,size:f,split:g,onChange:E,paneOneRender:()=>n.createElement(e,Object.assign({},s,{ref:c,data:S})),paneTwoRender:()=>n.createElement("div",{ref:o},n.createElement(ei,{ref:d,renderer:S.tooltip.renderer})),pane2Style:ni}))}));return a.displayName=`withSplitPane(${t})`,a}(Cn),ri=n.forwardRef((function(e,t){const{data:a,tooltip:i,onLoad:r,onRender:s,onChartLoad:l}=e,o=Dn.W.get("lang"),c=n.useRef(_n()),d=n.useRef(null),u=(null==i?void 0:i.splitted)?ii:Cn,h=n.useCallback((({dimensions:e})=>{e&&(c.current||(c.current=_n()),function(e){1===Rn.push(e)&&requestAnimationFrame(Wn)}((()=>{var e;const t=null===(e=c.current)||void 0===e?void 0:e.end();null==s||s({renderTime:t}),null==r||r({widgetRendering:t}),c.current=null})))}),[s,r]);return n.useImperativeHandle(t,(()=>({reflow(){var e;null===(e=d.current)||void 0===e||e.reflow()}})),[]),n.useLayoutEffect((()=>{l&&l({})}),[l]),n.createElement(u,{ref:d,data:a,lang:o,onResize:h})}))},44304:(e,t,a)=>{a.d(t,{m:()=>r});var n=a(77810);const i={top:0,right:0,bottom:0,left:0};function r(e={}){const{rect:t,contextElement:a}=e,r=n.useRef(i),s=n.useRef({contextElement:a,getBoundingClientRect(){const{top:e,right:t,bottom:a,left:n}=r.current;return{top:e,right:t,bottom:a,left:n,width:t-n,height:a-e}}});if(s.current.contextElement=a,t){const{top:e=0,left:a=0,right:n=a,bottom:i=e}=t;r.current={top:e,right:n,bottom:i,left:a}}else r.current=i;return s}},96464:(e,t,a)=>{a.d(t,{w:()=>i});var n=a(77810);function i({ref:e,onResize:t,box:a}){n.useEffect((()=>{const n=null==e?void 0:e.current;if(!n)return;if(void 0===window.ResizeObserver)return window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)};const i=new ResizeObserver((e=>{e.length&&t()}));return i.observe(n,{box:a}),()=>{i.disconnect()}}),[e,t,a])}}}]);
2
+ //# sourceMappingURL=3792.1af8dc36.chunk.js.map