@kubit-ui-web/react-charts 1.3.0 → 1.5.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 (157) hide show
  1. package/dist/cjs/charts/barChart/fragments/barChartPath.d.ts.map +1 -1
  2. package/dist/cjs/charts/barChart/fragments/barChartPath.js +12 -7
  3. package/dist/cjs/charts/barChart/fragments/barChartSeparator.d.ts.map +1 -1
  4. package/dist/cjs/charts/barChart/fragments/barChartSeparator.js +20 -8
  5. package/dist/cjs/charts/constants/chartDefaults.d.ts +20 -0
  6. package/dist/cjs/charts/constants/chartDefaults.d.ts.map +1 -1
  7. package/dist/cjs/charts/constants/chartDefaults.js +20 -0
  8. package/dist/cjs/charts/lineChart/fragments/lineChartPath.d.ts.map +1 -1
  9. package/dist/cjs/charts/lineChart/fragments/lineChartPath.js +15 -8
  10. package/dist/cjs/charts/lineChart/fragments/lineChartProjection.d.ts.map +1 -1
  11. package/dist/cjs/charts/lineChart/fragments/lineChartProjection.js +10 -7
  12. package/dist/cjs/charts/lineChart/fragments/lineChartSeparator.d.ts.map +1 -1
  13. package/dist/cjs/charts/lineChart/fragments/lineChartSeparator.js +20 -8
  14. package/dist/cjs/charts/pieChart/context/buildPieContextValue.d.ts +3 -1
  15. package/dist/cjs/charts/pieChart/context/buildPieContextValue.d.ts.map +1 -1
  16. package/dist/cjs/charts/pieChart/context/buildPieContextValue.js +15 -3
  17. package/dist/cjs/charts/pieChart/fragments/pieChartPath.d.ts.map +1 -1
  18. package/dist/cjs/charts/pieChart/fragments/pieChartPath.js +31 -3
  19. package/dist/cjs/charts/pieChart/fragments/pieChartSegment.d.ts.map +1 -1
  20. package/dist/cjs/charts/pieChart/fragments/pieChartSegment.js +58 -1
  21. package/dist/cjs/charts/pieChart/pieChart.type.d.ts +7 -0
  22. package/dist/cjs/charts/pieChart/pieChart.type.d.ts.map +1 -1
  23. package/dist/cjs/charts/pieChart/pieChartStructure.d.ts.map +1 -1
  24. package/dist/cjs/charts/pieChart/pieChartStructure.js +12 -2
  25. package/dist/cjs/types/errors.type.d.ts +3 -0
  26. package/dist/cjs/types/errors.type.d.ts.map +1 -1
  27. package/dist/cjs/types/errors.type.js +4 -0
  28. package/dist/cjs/utils/buildErrors/buildErrors.d.ts +11 -0
  29. package/dist/cjs/utils/buildErrors/buildErrors.d.ts.map +1 -1
  30. package/dist/cjs/utils/buildErrors/buildErrors.js +5 -0
  31. package/dist/cjs/utils/buildErrors/charts/buildPieChartErrors.d.ts +37 -0
  32. package/dist/cjs/utils/buildErrors/charts/buildPieChartErrors.d.ts.map +1 -0
  33. package/dist/cjs/utils/buildErrors/charts/buildPieChartErrors.js +36 -0
  34. package/dist/cjs/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts +13 -0
  35. package/dist/cjs/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts.map +1 -0
  36. package/dist/cjs/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.js +20 -0
  37. package/dist/cjs/utils/buildErrors/constants/errors/pieChartErrors.d.ts +14 -0
  38. package/dist/cjs/utils/buildErrors/constants/errors/pieChartErrors.d.ts.map +1 -0
  39. package/dist/cjs/utils/buildErrors/constants/errors/pieChartErrors.js +25 -0
  40. package/dist/esm/charts/barChart/fragments/barChartPath.d.ts.map +1 -1
  41. package/dist/esm/charts/barChart/fragments/barChartPath.js +12 -7
  42. package/dist/esm/charts/barChart/fragments/barChartSeparator.d.ts.map +1 -1
  43. package/dist/esm/charts/barChart/fragments/barChartSeparator.js +20 -8
  44. package/dist/esm/charts/constants/chartDefaults.d.ts +20 -0
  45. package/dist/esm/charts/constants/chartDefaults.d.ts.map +1 -1
  46. package/dist/esm/charts/constants/chartDefaults.js +20 -0
  47. package/dist/esm/charts/lineChart/fragments/lineChartPath.d.ts.map +1 -1
  48. package/dist/esm/charts/lineChart/fragments/lineChartPath.js +15 -8
  49. package/dist/esm/charts/lineChart/fragments/lineChartProjection.d.ts.map +1 -1
  50. package/dist/esm/charts/lineChart/fragments/lineChartProjection.js +10 -7
  51. package/dist/esm/charts/lineChart/fragments/lineChartSeparator.d.ts.map +1 -1
  52. package/dist/esm/charts/lineChart/fragments/lineChartSeparator.js +20 -8
  53. package/dist/esm/charts/pieChart/context/buildPieContextValue.d.ts +3 -1
  54. package/dist/esm/charts/pieChart/context/buildPieContextValue.d.ts.map +1 -1
  55. package/dist/esm/charts/pieChart/context/buildPieContextValue.js +15 -3
  56. package/dist/esm/charts/pieChart/fragments/pieChartPath.d.ts.map +1 -1
  57. package/dist/esm/charts/pieChart/fragments/pieChartPath.js +31 -3
  58. package/dist/esm/charts/pieChart/fragments/pieChartSegment.d.ts.map +1 -1
  59. package/dist/esm/charts/pieChart/fragments/pieChartSegment.js +58 -1
  60. package/dist/esm/charts/pieChart/pieChart.type.d.ts +7 -0
  61. package/dist/esm/charts/pieChart/pieChart.type.d.ts.map +1 -1
  62. package/dist/esm/charts/pieChart/pieChartStructure.d.ts.map +1 -1
  63. package/dist/esm/charts/pieChart/pieChartStructure.js +12 -2
  64. package/dist/esm/types/errors.type.d.ts +3 -0
  65. package/dist/esm/types/errors.type.d.ts.map +1 -1
  66. package/dist/esm/types/errors.type.js +4 -0
  67. package/dist/esm/utils/buildErrors/buildErrors.d.ts +11 -0
  68. package/dist/esm/utils/buildErrors/buildErrors.d.ts.map +1 -1
  69. package/dist/esm/utils/buildErrors/buildErrors.js +5 -0
  70. package/dist/esm/utils/buildErrors/charts/buildPieChartErrors.d.ts +37 -0
  71. package/dist/esm/utils/buildErrors/charts/buildPieChartErrors.d.ts.map +1 -0
  72. package/dist/esm/utils/buildErrors/charts/buildPieChartErrors.js +36 -0
  73. package/dist/esm/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts +13 -0
  74. package/dist/esm/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts.map +1 -0
  75. package/dist/esm/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.js +20 -0
  76. package/dist/esm/utils/buildErrors/constants/errors/pieChartErrors.d.ts +14 -0
  77. package/dist/esm/utils/buildErrors/constants/errors/pieChartErrors.d.ts.map +1 -0
  78. package/dist/esm/utils/buildErrors/constants/errors/pieChartErrors.js +25 -0
  79. package/dist/kubit-ui-web-react-charts.cjs.js +1 -1
  80. package/dist/kubit-ui-web-react-charts.es.js +1 -1
  81. package/dist/kubit-ui-web-react-charts.umd.js +1 -1
  82. package/dist/types/charts/barChart/barChart.d.ts +5 -5
  83. package/dist/types/charts/barChart/barChart.type.d.ts +1 -1
  84. package/dist/types/charts/barChart/context/barChartContext.d.ts +1 -1
  85. package/dist/types/charts/barChart/fragments/barChartPath.d.ts.map +1 -1
  86. package/dist/types/charts/barChart/fragments/barChartSeparator.d.ts +1 -1
  87. package/dist/types/charts/barChart/fragments/barChartSeparator.d.ts.map +1 -1
  88. package/dist/types/charts/barChart/fragments/barChartXAxis.d.ts +1 -1
  89. package/dist/types/charts/barChart/fragments/barChartYAxis.d.ts +1 -1
  90. package/dist/types/charts/constants/chartDefaults.d.ts +20 -0
  91. package/dist/types/charts/constants/chartDefaults.d.ts.map +1 -1
  92. package/dist/types/charts/lineChart/context/lineChartContext.d.ts +1 -1
  93. package/dist/types/charts/lineChart/fragments/lineChartPath.d.ts +1 -1
  94. package/dist/types/charts/lineChart/fragments/lineChartPath.d.ts.map +1 -1
  95. package/dist/types/charts/lineChart/fragments/lineChartProjection.d.ts +1 -1
  96. package/dist/types/charts/lineChart/fragments/lineChartProjection.d.ts.map +1 -1
  97. package/dist/types/charts/lineChart/fragments/lineChartSeparator.d.ts +1 -1
  98. package/dist/types/charts/lineChart/fragments/lineChartSeparator.d.ts.map +1 -1
  99. package/dist/types/charts/lineChart/fragments/lineChartXAxis.d.ts +1 -1
  100. package/dist/types/charts/lineChart/lineChart.d.ts +5 -5
  101. package/dist/types/charts/lineChart/lineChart.type.d.ts +1 -1
  102. package/dist/types/charts/lineChart/lineChartStructure.d.ts +1 -1
  103. package/dist/types/charts/pieChart/context/buildPieContextValue.d.ts +3 -1
  104. package/dist/types/charts/pieChart/context/buildPieContextValue.d.ts.map +1 -1
  105. package/dist/types/charts/pieChart/context/pieChartContext.d.ts +1 -1
  106. package/dist/types/charts/pieChart/fragments/pieChartForeign.d.ts +1 -1
  107. package/dist/types/charts/pieChart/fragments/pieChartPath.d.ts +1 -1
  108. package/dist/types/charts/pieChart/fragments/pieChartPath.d.ts.map +1 -1
  109. package/dist/types/charts/pieChart/fragments/pieChartSegment.d.ts.map +1 -1
  110. package/dist/types/charts/pieChart/pieChart.d.ts +3 -3
  111. package/dist/types/charts/pieChart/pieChart.type.d.ts +8 -1
  112. package/dist/types/charts/pieChart/pieChart.type.d.ts.map +1 -1
  113. package/dist/types/charts/pieChart/pieChartStructure.d.ts +1 -1
  114. package/dist/types/charts/pieChart/pieChartStructure.d.ts.map +1 -1
  115. package/dist/types/components/axisChart/xAxis/xAxis.d.ts +1 -1
  116. package/dist/types/components/axisChart/yAxis/yAxis.d.ts +1 -1
  117. package/dist/types/components/bar/bar.d.ts +1 -1
  118. package/dist/types/components/bar/fragments/barChartSegment.d.ts +1 -1
  119. package/dist/types/components/chartText/chartText.d.ts +1 -1
  120. package/dist/types/components/foreignObject/foreignObject.d.ts +1 -1
  121. package/dist/types/components/foreignObject/foreignObject.types.d.ts +1 -1
  122. package/dist/types/components/line/line.d.ts +1 -1
  123. package/dist/types/components/node/components/circle/circle.d.ts +1 -1
  124. package/dist/types/components/node/components/hexagon/hexagon.d.ts +1 -1
  125. package/dist/types/components/node/components/pentagon/pentagon.d.ts +1 -1
  126. package/dist/types/components/node/components/square/square.d.ts +1 -1
  127. package/dist/types/components/node/components/star/star.d.ts +1 -1
  128. package/dist/types/components/node/components/straight/straight.d.ts +1 -1
  129. package/dist/types/components/node/components/triangle/triangle.d.ts +1 -1
  130. package/dist/types/components/node/node.d.ts +1 -1
  131. package/dist/types/components/path/components/nodePath/nodePath.d.ts +2 -2
  132. package/dist/types/components/path/path.d.ts +1 -1
  133. package/dist/types/components/path/path.types.d.ts +1 -1
  134. package/dist/types/components/plot/components/circle/circle.d.ts +1 -1
  135. package/dist/types/components/plot/components/square/square.d.ts +1 -1
  136. package/dist/types/components/plot/components/triangle/triangle.d.ts +1 -1
  137. package/dist/types/components/plot/plot.d.ts +1 -1
  138. package/dist/types/components/svgContainer/svgContainer.d.ts +1 -1
  139. package/dist/types/components/tick/tick.d.ts +1 -1
  140. package/dist/types/components/zoomArea/components/HandlerIcon.d.ts +1 -1
  141. package/dist/types/components/zoomArea/components/LineRenderer.d.ts +1 -1
  142. package/dist/types/components/zoomArea/components/SelectionArea.d.ts +1 -1
  143. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +1 -1
  144. package/dist/types/hooks/useFocus/useFocus.types.d.ts +1 -1
  145. package/dist/types/hooks/useHover/useHover.types.d.ts +1 -1
  146. package/dist/types/types/errors.type.d.ts +3 -0
  147. package/dist/types/types/errors.type.d.ts.map +1 -1
  148. package/dist/types/utils/buildErrors/buildErrors.d.ts +11 -0
  149. package/dist/types/utils/buildErrors/buildErrors.d.ts.map +1 -1
  150. package/dist/types/utils/buildErrors/charts/buildPieChartErrors.d.ts +37 -0
  151. package/dist/types/utils/buildErrors/charts/buildPieChartErrors.d.ts.map +1 -0
  152. package/dist/types/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts +13 -0
  153. package/dist/types/utils/buildErrors/constants/errorMessages/pieChartErrorMessages.d.ts.map +1 -0
  154. package/dist/types/utils/buildErrors/constants/errors/pieChartErrors.d.ts +14 -0
  155. package/dist/types/utils/buildErrors/constants/errors/pieChartErrors.d.ts.map +1 -0
  156. package/dist/types/utils/getChildrenAttr/getChildrenAttr.d.ts +1 -1
  157. package/package.json +6 -4
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,t,r,a,n={exports:{}},i={},o={exports:{}},s={};function c(){return t||(t=1,o.exports=function(){if(e)return s;e=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator,x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,R={};function g(e,t,r){this.props=e,this.context=t,this.refs=R,this.updater=r||x}function A(){}function _(e,t,r){this.props=e,this.context=t,this.refs=R,this.updater=r||x}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},A.prototype=g.prototype;var T=_.prototype=new A;T.constructor=_,f(T,g.prototype),T.isPureReactComponent=!0;var E=Array.isArray,y=Object.prototype.hasOwnProperty,v={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(e,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)y.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:t,type:e,key:o,ref:s,props:i,_owner:v.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var I=/\/+/g;function $(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function N(e,a,n,i,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0}}if(c)return o=o(c=e),e=""===i?"."+$(c,0):i,E(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),N(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(e,r){return{$$typeof:t,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),a.push(o)),1;if(c=0,i=""===i?".":i+":",E(e))for(var d=0;d<e.length;d++){var l=i+$(s=e[d],d);c+=N(s,a,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),d=0;!(s=e.next()).done;)c+=N(s=s.value,a,n,l=i+$(s,d++),o);else if("object"===s)throw a=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(e).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function k(e,t,r){if(null==e)return e;var a=[],n=0;return N(e,a,"","",function(e){return t.call(r,e,n++)}),a}function L(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var b={current:null},O={transition:null},H={ReactCurrentDispatcher:b,ReactCurrentBatchConfig:O,ReactCurrentOwner:v};function w(){throw Error("act(...) is not supported in production builds of React.")}return s.Children={map:k,forEach:function(e,t,r){k(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return k(e,function(){t++}),t},toArray:function(e){return k(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=g,s.Fragment=a,s.Profiler=i,s.PureComponent=_,s.StrictMode=n,s.Suspense=l,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,s.act=w,s.cloneElement=function(e,r,a){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=f({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=v.current),void 0!==r.key&&(i=""+r.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(d in r)y.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:t,type:e.type,key:i,ref:o,props:n,_owner:s}},s.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},s.createElement=C,s.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:d,render:e}},s.isValidElement=S,s.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},s.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},s.unstable_act=w,s.useCallback=function(e,t){return b.current.useCallback(e,t)},s.useContext=function(e){return b.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return b.current.useDeferredValue(e)},s.useEffect=function(e,t){return b.current.useEffect(e,t)},s.useId=function(){return b.current.useId()},s.useImperativeHandle=function(e,t,r){return b.current.useImperativeHandle(e,t,r)},s.useInsertionEffect=function(e,t){return b.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return b.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return b.current.useMemo(e,t)},s.useReducer=function(e,t,r){return b.current.useReducer(e,t,r)},s.useRef=function(e){return b.current.useRef(e)},s.useState=function(e){return b.current.useState(e)},s.useSyncExternalStore=function(e,t,r){return b.current.useSyncExternalStore(e,t,r)},s.useTransition=function(){return b.current.useTransition()},s.version="18.3.1",s}()),o.exports}var d=(a||(a=1,n.exports=function(){if(r)return i;r=1;var e=c(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,a){var i,c={},d=null,l=null;for(i in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,i)&&!s.hasOwnProperty(i)&&(c[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps)void 0===c[i]&&(c[i]=r[i]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:o.current}}return i.Fragment=a,i.jsx=d,i.jsxs=d,i}()),n.exports),l=c();const u=l.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:l,radius:u="0px",role:h,tabIndex:p,viewBox:x,width:f,...R},g)=>d.jsxs("svg",{ref:g,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:r,borderRadius:u,overflow:l},tabIndex:p,viewBox:x,width:f,onMouseDown:e=>e.preventDefault(),...R,children:[a&&d.jsx("title",{children:a}),c&&d.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),h=(e,t,r=0)=>`${-r} ${-r} ${e} ${t}`,p={extraSpace:0,height:80,width:100},x=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},f=e=>JSON.stringify(e),R="%",g="rem",A=/^(\d+(\.\d+)?)(px|rem|%)?$/,_=e=>{if("number"==typeof e)return e;const t=e.match(A);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===g?16*parseFloat(r):parseFloat(r)},T=l.createContext({}),E={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},y={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR"},v={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},m=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),C=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),S=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),I=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),$="INVALID_X_TICK",N="BAR_CHART_NO_DATA",k="LINE_CHART_NO_DATA",L="LINE_CHART_PATH_ALL_VALUES_NULL",b="LINE_CHART_PATH_INSUFFICIENT_POINTS",O="LINE_CHART_PATH_INVALID_DATAKEY",H="LINE_CHART_SEPARATOR_INVALID_COORDINATES",w="LINE_CHART_SINGLE_POINT",j="LINE_CHART_X_AXIS_IDENTICAL_VALUES",B="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",D="LINE_CHART_X_AXIS_ZERO_LENGTH",M="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",P="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",X="LINE_CHART_Y_AXIS_ZERO_LENGTH",F={...m,...C,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},W=e=>F[e],V=e=>new Error(`DataKey "${e}" not found in dataset`),Y=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),K=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),U=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),z=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),G=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),Z=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===v.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===v.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===v.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a},q=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===v.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===v.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===v.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a},J=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),l=i>o,u=l?e[a+1]:e[a-1],h=100*d/Math.abs(Number(u.value)-o),p=Math.abs(n.position-u.position)*h/100;return r?l?n.position+p:n.position-p:l?n.position-p:n.position+p}return n.position}),Q=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))},ee=({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))},te="0",re="1",ae="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const ne=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=r&&(e[t]=String(r)),e),{}):{},ie=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>d.jsx("defs",{children:d.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:d.jsx("feDropShadow",{...n.shadowSvgConfig})})}),oe=-1/0,se=l.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>d.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),ce=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},de=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=ce(t.x,t.y,6,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),le=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=ce(t.x,t.y,5,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),ue=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>d.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),he=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=ce(t.x,t.y,5,i,o);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),pe=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return d.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),xe=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),fe={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Re={[fe.Circle]:se,[fe.Hexagon]:de,[fe.Pentagon]:le,[fe.Square]:ue,[fe.Star]:he,[fe.Straight]:pe,[fe.Triangle]:xe},ge=l.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:u,position:h={x:0,y:0},size:p=1,type:x=fe.Circle,...f},R)=>{const[g,A]=(e=>{const t=l.useRef(!1),r=l.useRef(null);l.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return l.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(R),_={...f,className:`node ${f.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:h},A.current)},onDoubleClick:e=>{i?.(e,f.data)},onFocus:e=>{o?.(e,f.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,f.data)},onMouseEnter:e=>{c?.(e,f.data)},onMouseLeave:e=>{u?.(e)}},T={className:f.className,fill:t?.fill||f.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||f.stroke,strokeWidth:t?.strokeWidth||f.strokeWidth},E=Re[x];return d.jsxs(d.Fragment,{children:[r&&d.jsx(E,{...T,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:p+p/2,tabIndex:-1}),d.jsx(E,{..._,ref:g,dataTestId:e,position:h,size:p})]})}),Ae=l.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?ne(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return d.jsx(d.Fragment,{children:t&&d.jsx(ge,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),_e=l.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:u,handleFocus:h,isFocused:p}=((e,t)=>{const[r,a]=l.useState(!1),n=l.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:l.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:x,handleMouseLeave:f,isHovered:R}=((e,t)=>{const[r,a]=l.useState(!1);return{handleMouseEnter:l.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:l.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),g=l.useRef(null),A=l.useRef([]),_=l.useRef(null);l.useImperativeHandle(c,()=>({get main(){return _.current},get node(){return A.current},get path(){return g.current}}));const T=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return d.jsx(d.Fragment,{})}return d.jsx("defs",{children:d.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>d.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),E=ne(s),y={...{...s,classNames:`path ${e}`,fill:T?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...p&&n,...R&&i};return d.jsxs("g",{ref:_,tabIndex:-1,children:[T&&T,y.shadowSvgConfig&&d.jsx(ie,{id:"shadow",shadowSvgConfig:y.shadowSvgConfig}),d.jsxs("g",{"aria-label":y.ariaLabel,className:y.classNames,"data-draw":!0,filter:y.shadowSvgConfig&&y.filter,opacity:y.opacity,orientation:y.orientation,role:y.role,rotate:y.rotate,tabIndex:y.tabIndex,transform:y.transform,visibility:y.visibility,...E,onBlur:u,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:h,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:x,onMouseLeave:f,children:[d.jsx("path",{ref:g,d:y.d,"data-testid":y.dataTestId,fill:y.dFill?"transparent":y.fill,fillOpacity:y.fillOpacity,fillRule:y.fillRule,stroke:y.stroke,strokeDasharray:y.strokeDasharray,strokeDashoffset:y.strokeDashoffset,strokeLinecap:y.strokeLinecap,strokeLinejoin:y.strokeLinejoin,strokeMiterlimit:y.strokeMiterlimit,strokeOpacity:y.strokeOpacity,strokeWidth:y.strokeWidth,children:y.title&&d.jsx("title",{children:y.title})}),y.dFill&&d.jsx("path",{d:y.dFill,fill:y.fill,fillOpacity:y.fillOpacity,fillRule:y.fillRule})]}),y.points&&y.nodeConfig&&y.points.map(([e,t],r)=>{const a={dataKey:y.dataKey,dataValue:y.dataValue,index:r,xKey:y?.xKey};return d.jsx(Ae,{ref:e=>A.current[r]=e,data:a,nodeConfig:y.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Te=(e,t,r)=>e?t+r/2:t-r/2,Ee=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:l,y2:u})=>{const{barWidth:h,singleConfig:p}=e,x=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===E.HORIZONTAL,d=c?r:n,l=c?a:i,u={end:l<d,start:l>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,l-d),i=0===r?d:Te(u.start,e[r-1][1],o),c=r+1===s.length?l:Te(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:l,y2:u});return d.jsx("g",{children:p.map((e,f)=>{const[R,g]="HORIZONTAL"===i?x[f]:[s,c],[A,_]="VERTICAL"===i?x[f]:[l,u],T=(({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,p,x,f="Z";const R=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===E.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===E.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===E.HORIZONTAL){const t=s+o,a=c-r;o&&r?(u=`M ${t},${d+R}`,h=`L${a},${l+R}`,p=`Q${c+r} ${l+R-e/2}, ${a} ${l+R-e}`,x=`L${t},${d+R-e}`,f=`Q${s-o} ${d+R-e/2}, ${t} ${d+R}`):o?(u=`M ${t},${d+R}`,h=`L${c},${l+R}`,p=`L${c},${l+R-e}`,x=`L${t},${d+R-e}`,f=`Q${s-o} ${d+R-e/2}, ${t} ${d+R}`):r?(u=`M${s},${d+R}`,h=`L${a},${l+R}`,p=`Q${c+r} ${l+R-e/2}, ${a} ${l+R-e}`,x=`L${s},${d+R-e}`):(u=`M${s},${d+R}`,h=`L${c},${l+R}`,p=`L${c},${l+R-e}`,x=`L${s},${d+R-e}`)}else{const t=d-o,a=l+r;o&&r?(u=`M${s+R}, ${t}`,h=`L${c+R},${a}`,p=`Q${c+R-e/2} ${l-r}, ${c+R-e} ${a}`,x=`L${s+R-e},${t}`,f=`Q${s+R-e/2} ${d+o}, ${s+R} ${t}`):o?(u=`M${s+R}, ${t}`,h=`L${c+R},${l}`,p=`L${c+R-e},${l}`,x=`L${s+R-e},${t}`,f=`Q${s+R-e/2} ${d+o}, ${s+R} ${t}`):r?(u=`M${s+R},${d}`,h=`L${c+R},${a}`,p=`Q${c+R-e/2} ${l-r}, ${c+R-e} ${a}`,x=`L${c+R-e},${d}`):(u=`M${s+R},${d}`,h=`L${c+R},${l}`,p=`L${c+R-e},${l}`,x=`L${s+R-e},${d}`)}return`${u} ${h} ${p} ${x} ${f}`})({barWidth:h,currentBars:t,endRounded:f===p.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===f&&o?o:void 0,x1:R,x2:g,y1:A,y2:_});return d.jsx(_e,{d:T,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${f.toString()}`)})})},ye=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=l.useContext(T),{coordinates:u,tickValues:h}=o,{coordinates:p,tickValues:x}=s,f=c.orientation===E.VERTICAL,R=f?c.pKey:r,g=f?r:c.pKey,A=c.data[t],_=A?.[R],y=A?.[g];l.useEffect(()=>{if(c.data.length>0&&!Object.prototype.hasOwnProperty.call(c.data[0],r))return void i?.("BAR_CHART_PATH_ERROR",{error:V(r)});const e=Number(y);isNaN(e)?i?.("BAR_CHART_PATH_ERROR",{error:S(y,r)}):e<0&&i?.("BAR_CHART_PATH_ERROR",{error:I(e,r)})},[i,c.data,r,y]);const v=J(h,[String(_)],!0)[0],m=J(x,[String(y)])[0],C=f?{x1:v,x2:v,y1:u.y1,y2:m}:{x1:p.x1,x2:v,y1:m,y2:m};return d.jsx(Ee,{barConfig:e,currentBars:c.barChildrenCount,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,...C,...n})},ve=e=>{let t=0;return l.Children.toArray(e).forEach(e=>{l.isValidElement(e)&&e.type===ye&&e.props.order>t&&(t=e.props.order)}),t},me=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Se=()=>Ce()?document:void 0,Ie=e=>{const t=Se();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},$e=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!Ce()||!t.length)return 0;const o=Se();if(!o)return 0;const s=Ie("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=Ie("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},Ne=({ariaLabel:e="",className:t="line",dataTestId:r,tabIndex:a=-1,...n})=>d.jsx("line",{...n,"aria-label":e,className:t,"data-testid":r,tabIndex:a}),ke=({children:e,className:t="circle",tabIndex:r=-1,...a})=>d.jsx("text",{className:t,tabIndex:r,...a,children:e}),Le=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>d.jsxs("g",{children:[e&&d.jsx(Ne,{...r}),a&&d.jsx(ke,{...a,children:t.value})]}),be=(e,t,r=1)=>e>=t-r&&e<=t+r,Oe=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:p,transform:x,x1:f,x2:R,y1:g,y2:A}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:p,transform:x,x1:f,x2:R,y1:g,y2:A}},He=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=v.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:l=[],...u})=>{const h=ne(u);return d.jsxs("g",{...h,children:[d.jsx(Ne,{...Oe(u)}),l&&l.length>0&&l.map((e,t)=>{const a=be(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return d.jsx(Le,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},we=(e,t,r)=>e===v.RIGHT?t+r:t-r,je=(e,t,r,a)=>e===v.TOP?r:t+r+a,Be=({position:e=v.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(T),s=je(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,u=Number(o.canvasHeight)-o.extraSpaceBottomY;return d.jsx(He,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:u},tickText:{...r,y:s},tickValues:r?i:void 0})},De=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=v.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...l})=>{const u=ne(l);return d.jsxs("g",{...u,children:[d.jsx(Ne,{...Oe(l)}),c&&c.length>0&&c.map((e,r)=>{const a=be(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return d.jsx(Le,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},Me=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},Pe=({position:e=v.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(T),s=r?.textAnchor||"middle",c=(e===v.RIGHT?r?.right:r?.left)??0,u=Me(s,o.yAxisText,c),h=we(e,n.x1,u);return d.jsx(De,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:h},tickValues:r?i:void 0})},Xe=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Fe=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),We=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,p=l?Xe(l):t.map(e=>e[r]),x=$e({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>x?n:x;return{barChartXPosition:c||v.BOTTOM,extraSpaceBottomY:c===v.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===v.TOP?h+(d?.bottom??0):0,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:p}},Ve=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,p=l||me([...new Set(Fe(t,r))]),x=Xe(p),f=n>h?n:h,R=$e({bound:"width",data:x,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||v.LEFT,extraSpaceLeftX:c===v.LEFT?R+(d?.right??0):0,extraSpaceRightX:c===v.RIGHT?R+(d?.left??0):0,securityYSpace:f,yAxisText:R,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:x}},Ye=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u})=>{let h;if(!o||0===o.length){const t={error:W(N)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(n<=0||a<=0){const t={error:Y(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}const p=ve(i),x=20*p,f=(p-1)*s,R=c===E.VERTICAL?n:a;if(x+f>R){const t={error:(g=`Insufficient space: requires ${x+f}px but only ${R}px available`,new Error(`Invalid bar distribution for "all": ${g}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}var g;const A=o&&o.length>0?o:[{[ae]:0,[d]:te},{[ae]:0,[d]:re}],_=n>0?n:100,T=a>0?a:100,{barChartXPosition:m,barChartYPosition:C,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:k,extraSpaceTopY:L,securityXSpace:b,securityYSpace:O,xAxisText:H,xBreakAxis:w,xData:F,yAxisText:V,yBreakAxis:K,yData:U}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let u={barChartXPosition:v.BOTTOM,barChartYPosition:v.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},h=o;const p=[];return l.Children.forEach(n,n=>{if(l.isValidElement(n))if(n.type!==ye||p.includes(n.props.order)||(p.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===Be){const t=s===E.VERTICAL?h:0;u={...u,...We(n,i,c,e,t,d,r,a)}}else if(n.type===Pe){const e=s===E.HORIZONTAL?h:0;u={...u,...Ve(n,i,c,t,e,d,r,a)}}}),u})({ajustedX:t,ajustedY:r,canvasHeight:T,canvasWidth:_,children:i,data:A,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u}),z=m!==v.TOP&&m!==v.BOTTOM,G=Q({initPos:I,maxSpaceAvailable:_,otherAxisSpace:I+k,securitySpace:b,tickValues:F});if((G??[]).some(({position:e})=>isNaN(e))){const t={error:W($)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(G){const t=G.length<2,r=G.length>=2&&1===new Set(G.map(e=>e.value)).size;if(t){const t={error:W(B)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:W(j)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}}const ne=C!==v.LEFT&&C!==v.RIGHT,ie=ee({initPos:T-S,maxSpaceAvailable:T,needAjusted:c===E.HORIZONTAL,otherAxisSpace:L+S,securitySpace:O,tickValues:U});if(ie){const t=ie.length<2,r=ie.length>=2&&1===new Set(ie.map(e=>e.value)).size;if(t){const t={error:W(P)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:W(M)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}}const oe=z?J(ie||[],[String(w)])[0]:0,se=ne?J(G||[],[String(K)])[0]:0,ce=Z({canvasHeight:T,canvasWidth:_,customBreakAxis:Number(oe),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:k,extraSpaceTopY:L,position:m}),de=q({canvasHeight:T,canvasWidth:_,customBreakAxis:Number(se),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:k,extraSpaceTopY:L,position:C});if(ce.x1===ce.x2){const t={error:W(D)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(de.y1===de.y2){const t={error:W(X)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}const le={addError:e,crossXAxis:z,crossYAxis:ne,data:A,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:k,extraSpaceTopY:L,securityXSpace:b,securityYSpace:O,xAxisCoordinates:{coordinates:ce,tickValues:G||(h?[{position:0,value:te},{position:_,value:re}]:[])},xAxisText:H,yAxisCoordinates:{coordinates:de,tickValues:ie||(h?[{position:T,value:te},{position:0,value:re}]:[])},yAxisText:V};return h?{...le,error:{...h,type:y.BAR_CHART_CONTEXT_ERROR}}:le},Ke=Object.assign(({canvasConfig:e=p,caption:t,children:r,classNames:a,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:R,pKey:g,role:A,tabIndex:E,width:y="100%",...v})=>{const{extraSpace:m,height:C,width:S}=e,I=_(S),$=_(C),N=m?_(m):void 0,k=h(I,$,N),L=ve(r),b=2*o,O=[d.jsx(Be,{},"default-x-axis"),d.jsx(Pe,{},"default-y-axis")],H=l.Children.toArray(r)||[],w=O.concat(H),j=Math.max(I,$,N??0),B=I/j,D=$/j,M=l.useMemo(()=>x(c),[c]),P=f(n),X=l.useMemo(()=>(M.clearErrors(),Ye({addError:(e,t)=>{M.addError(e,t)},ajustedX:B,ajustedY:D,canvasHeight:$,canvasWidth:I,children:w,data:n,gapBetweenBars:b,orientation:R,pKey:g,viewBox:k})),[C,S,P,g,R,M.addError]);return d.jsx(u,{caption:t,className:a,dataTestId:i,height:s,role:A,tabIndex:E,viewBox:k,width:y,...v,children:d.jsx(T.Provider,{value:{...X,barChildrenCount:L,canvasExtraSpace:N,canvasHeight:$,canvasWidth:I,data:n,dataTestId:i,gapBetweenBars:o,orientation:R,pKey:g},children:r})})},{Path:ye,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(T);if(l.useEffect(()=>{if(void 0!==n){const e=u.tickValues.map(e=>e.value),t="string"==typeof n?parseFloat(n):n;if(isNaN(t))o?.("BAR_CHART_SEPARATOR_ERROR",{error:K(n)});else{const r=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),a=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(t<r||t>a)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:z(t,r,a)})}}if(void 0!==i){const e=h.tickValues.map(e=>e.value),t="string"==typeof i?parseFloat(i):i;if(isNaN(t))o?.("BAR_CHART_SEPARATOR_ERROR",{error:U(i)});else{const r=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),a=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(t<r||t>a)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:G(t,r,a)})}}},[n,i,u.tickValues,h.tickValues,o]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const p=n&&J(u.tickValues,[n],!0)[0],x=i&&J(h.tickValues,[i])[0],f=c?h.coordinates.x1:u.coordinates.x2,R=s?u.coordinates.y1:h.coordinates.y1,g=u.coordinates.x1,A=p??f,_=h.coordinates.y2,E=x??R;l.useEffect(()=>{g===A&&_===E&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:W(H)})},[g,A,_,E,o]);const y=`M${g} ${_} H ${A} V ${E} H ${g} Z`,v=`M${g} ${E} H ${A}`,m=`M${A} ${_} V ${E}`;return d.jsxs("g",{children:[d.jsx("path",{d:y,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:v,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:m,"data-testid":`${t}Right`,...r})]})},XAxis:Be,YAxis:Pe}),Ue=l.createContext({}),ze=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],l=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${l[0]} ${l[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},Ge=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),Ze=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),qe=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),Je=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},Qe=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},et=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=l.useContext(Ue),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:u,...h}=s||{},{xProjection:p,yProjection:x,...f}=i||{},R=c||u?{x:c,y:u}:void 0,g=p||x?{x:p,y:x}:void 0;l.useEffect(()=>{if(R&&g){const e=R.y||0,t=g.y||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:Ge(e,t)})}if(R){const{x:e,y:t}=R;void 0!==e&&(e<0||e>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:Ze(e,!0)}),void 0!==t&&(t<0||t>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:qe(t,a,!0)})}if(g){const{x:e,y:t}=g;void 0!==e&&(e<0||e>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:Ze(e,!1)}),void 0!==t&&(t<0||t>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:qe(t,a,!1)})}},[R,g,a,n]);const{downPath:A,shapePath:_,upPath:T}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],p=[];s.forEach(([e,r])=>{const i=n?[Je(e,n.x),Qe(r,a,n.y)]:[e,r],o=t?[Je(e,-(t.x??0)),Qe(r,a,-(t.y??0))]:[e,r];h.push(i),p.push(o)});const x=n&&t?[...h,s.at(-1),...p.reverse(),o]:[...h,...p.reverse(),o];return e?(d+=x.reduce((e,t,r)=>{const a=0===r?o:x[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""),l&&(l+=h.reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},"")),u&&(u+=p.reverse().reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""))):(d+=x.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=p.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:g,points:r,svgHeight:a,upperProjection:R});return d.jsxs("g",{className:"pointer-events-none",children:[d.jsx("path",{d:_,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",T&&d.jsx("path",{d:T,...h}),A&&d.jsx("path",{d:A,...f})]})},tt=(e,t)=>e.map(e=>e[t]),rt={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},at=({ariaLabel:e,position:t=v.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...u}=l.useContext(Ue),h=je(t,o.y1,Number(a?.fontSize),a?.top??0),p=u.extraSpaceTopY,x=Number(u.canvasHeight)-u.extraSpaceBottomY,f=a?rt.formatTicksValues(s,n):void 0,R=ne(i),g=e||i["aria-label"],A={...i,...R,...g&&{"aria-label":g}};return d.jsx(He,{...o,...A,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}xAxis`,extraSpace:{left:u.extraSpaceLeftX,right:u.extraSpaceRightX},tickLine:{...r,y1:p,y2:x},tickText:{...a,y:h},tickValues:f})},nt=({ariaLabel:e,position:t=v.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...u}=l.useContext(Ue),h=a?.textAnchor||"middle",p=(t===v.RIGHT?a?.right:a?.left)??0,x=Me(h,u.yAxisText,p),f=we(t,o.x1,x),R=a?rt.formatTicksValues(s,n):void 0,g=ne(i),A=e||i["aria-label"],_={...i,...g,...A&&{"aria-label":A}};return d.jsx(De,{...o,..._,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}yAxis`,tickLine:{...r,x1:u.extraSpaceLeftX,x2:Number(u.canvasWidth)-u.extraSpaceRightX},tickText:{...a,x:f},tickValues:R})},it={[R]:R,[g]:g},ot="WIDTH",st=/^(\d+(\.\d+)?)(px|rem|%)?$/,ct=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(st);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:it[a],value:r}},dt=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===ot?a.clientWidth:a.clientHeight):0},lt=e=>{const t=Se();if(!t)return 16*e;const r=(e=>{const t=Ce()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},ut=({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=ct(t),i=a===R?dt(n,ot,r):a===g?lt(n):n,{unit:o,value:s}=ct(e);return{parsedCanvasHeight:o===R?dt(s,"HEIGHT",r):o===g?lt(s):s,parsedCanvasWidth:i}},ht=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},pt=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),xt=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??0,h=u*a,p=d?ht(d):t.map(e=>e[r]),x=l?p.map(l):p,f=$e({bound:"width",data:x,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),R=s===v.TOP;return{extraSpaceBottomY:s===v.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:R?h+(c?.bottom??0):0,lineChartXPosition:s||v.BOTTOM,securityXSpace:f,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:p}},ft=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??"0",h=u*a,p=d||me([...new Set(pt(t,r))]),x=ht(p),f=l?x.map(l):x,R=$e({bound:"width",data:f,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),g=h,A=s===v.RIGHT;return{extraSpaceLeftX:s===v.LEFT?R+(c?.right??0):0,extraSpaceRightX:A?R+(c?.left??0):0,lineChartYPosition:s||v.LEFT,securityYSpace:g,yAxisText:R,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:x}},Rt=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,viewBox:s,xKey:c})=>{let d;if(!o||0===o.length){const t={error:W(k)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(o&&1===o.length){const t={error:W(w)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(n<=0||a<=0){const t={error:Y(n,a)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}const u=o&&o.length>0?o:[{[c]:"0",y:0},{[c]:"1",y:1}],h=n>0?n:100,p=a>0?a:100,{extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:g,lineChartXPosition:A,lineChartYPosition:_,securityXSpace:T,securityYSpace:E,xAxisText:m,xBreakAxis:C,xData:S,yAxisText:I,yBreakAxis:N,yData:L}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:v.BOTTOM,lineChartYPosition:v.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return l.Children.forEach(n,n=>{l.isValidElement(n)&&(n.type===at?c={...c,...xt(n,i,s,e,o,r,a)}:n.type===nt&&(c={...c,...ft(n,i,s,t,o,r,a)}))}),c})({ajustedX:t,ajustedY:r,canvasHeight:p,canvasWidth:h,children:i,data:u,viewBox:s,xKey:c}),b=A!==v.TOP&&A!==v.BOTTOM,O=Q({initPos:f,maxSpaceAvailable:h,otherAxisSpace:f+R,securitySpace:T,tickValues:S});if((O??[]).some(({position:e})=>isNaN(e))){const t={error:W($)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(O){const t=O.length<2,r=O.length>=2&&1===new Set(O.map(e=>e.value)).size;if(t){const t={error:W(B)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:W(j)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}}const H=_!==v.LEFT&&_!==v.RIGHT,F=ee({initPos:p-x,maxSpaceAvailable:p,otherAxisSpace:g+x,securitySpace:E,tickValues:L});if(F){const t=F.length<2,r=F.length>=2&&1===new Set(F.map(e=>e.value)).size;if(t){const t={error:W(P)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:W(M)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}}const V=b?J(F||[],[String(C)])[0]:0,K=H?J(O||[],[String(N)])[0]:0,U=Z({canvasHeight:p,canvasWidth:h,customBreakAxis:Number(V),extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:g,position:A}),z=q({canvasHeight:p,canvasWidth:h,customBreakAxis:Number(K),extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:g,position:_});if(U.x1===U.x2){const t={error:W(D)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(z.y1===z.y2){const t={error:W(X)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}const G={addError:e,crossXAxis:b,crossYAxis:H,extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:g,securityXSpace:T,securityYSpace:E,xAxisCoordinates:{coordinates:U,tickValues:O||(d?[{position:0,value:"0"},{position:h,value:"1"}]:[])},xAxisText:m,yAxisCoordinates:{coordinates:z,tickValues:F||(d?[{position:p,value:te},{position:0,value:re}]:[])},yAxisText:I};return d?{...G,error:{...d,type:y.LINE_CHART_CONTEXT_ERROR}}:G},gt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:R="100%",onErrors:g,role:A,tabIndex:T,width:E="100%",xKey:y,...v})=>{const{extraSpace:m,height:C,width:S}=r,[I,$]=l.useState(""),[N,k]=l.useState({height:0,width:0}),L=m?_(m):void 0,b=h(N.width,N.height,L),O=[d.jsx(at,{},"default-x-axis"),d.jsx(nt,{},"default-y-axis")],H=l.Children.toArray(n)||[],w=O.concat(H),j=Math.max(N.width,N.height,L??0),B=isNaN(N.width/j)?0:N.width/j,D=isNaN(N.height/j)?0:N.height/j;(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";l.Children.toArray(t).forEach(t=>{if(l.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:w,originalValue:I,updateValue:$});const M=l.useMemo(()=>x(g),[g]),P=f(o),X=l.useMemo(()=>(M.clearErrors(),Rt({addError:(e,t)=>{M.addError(e,t)},ajustedX:B,ajustedY:D,canvasHeight:N.height,canvasWidth:N.width,children:w,data:o,viewBox:b,xKey:y})),[N.width,N.height,P,y,I,M.addError]),{svgRef:F,xCursor:W,yCursor:V}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=l.useState([oe,oe]),i=l.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,l=r.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:l.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:N.height,canvasWidth:N.width});return l.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:r}=ut({canvasHeight:C,canvasWidth:S,svgElement:e});k({height:t,width:r})},[S,C]),l.useEffect(()=>{c?.({x1:X.extraSpaceLeftX,x2:N.width-X.extraSpaceRightX,y1:X.extraSpaceTopY,y2:N.height-X.extraSpaceBottomY})},[N.width,N.height]),d.jsx(u,{ref:F,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:s,height:R,role:A,tabIndex:T,viewBox:b,width:E,...v,children:d.jsx(Ue.Provider,{value:{...X,canvasExtraSpace:L,canvasHeight:N.height,canvasWidth:N.width,data:o,dataTestId:s,xCursor:W,xKey:y,yCursor:V},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:u,xAxisCoordinates:h,yAxisCoordinates:p,...x}=l.useContext(Ue);l.useEffect(()=>{if(!c.dataKey||"string"!=typeof c.dataKey)return void u?.("LINE_CHART_PATH_ERROR",{error:W(O)});if(x.data.length>0&&!Object.prototype.hasOwnProperty.call(x.data[0],c.dataKey))return void u?.("LINE_CHART_PATH_ERROR",{error:V(c.dataKey)});if(r&&x.data.length<2)return void u?.("LINE_CHART_PATH_ERROR",{error:W(b)});const e=tt(x.data,c.dataKey);e.length>0&&e.every(e=>null==e)&&u?.("LINE_CHART_PATH_ERROR",{error:W(L)})},[c.dataKey,r,x.data,u]);const{indicatorRef:f,pathRef:R}=((e,t)=>{const r=l.useRef(null),a=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const l=n.getPointAtLength(d);i.setAttribute("transform",`translate(${l.x}, ${l.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(x.xCursor,!!i),g=!!i&&x.xCursor!==-1/0,A=l.useRef(null),_=l.useRef(null),{autoClick:T,lineIndicator:E,...y}=i||{},v=x.extraSpaceTopY,m=Number(x.canvasHeight)-x.extraSpaceBottomY,{tickValues:C}=h,{tickValues:S}=p,I=tt(x.data,x.xKey),$=tt(x.data,c.dataKey),N=J(C,I,!0),k=J(S,$),H=N.map((e,t)=>[e,k[t]]),w=ze({curved:r,extendToBottom:!1,points:H,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),j=ze({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:H,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY});l.useEffect(()=>{if(!A.current?.path)return;R.current=A.current.path;const e=A.current.main,t=A.current.node,r=I.map((e,t)=>({x:e,y:$[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n,i=!1;const o=a.querySelector("[data-draw]"),s=a=>{i&&("ArrowRight"===a.key?(n=void 0===n||n===r.length-1?0:n+1,r[n].focus(),t?.(e[n])):"ArrowLeft"===a.key&&(n=void 0===n||0===n?r.length-1:n-1,r[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},l=()=>{n=void 0};return{mount:()=>{a.addEventListener("focusin",c),a.addEventListener("focusout",d),o?.addEventListener("focus",l),window.addEventListener("keydown",e=>s(e))},unmount:()=>{a.removeEventListener("focusin",c),a.removeEventListener("focusout",d),o?.removeEventListener("focus",l),window.removeEventListener("keydown",e=>s(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),l.useEffect(()=>{if(c.nodeConfig&&g&&T){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(N,x.xCursor);if(t&&e!==_.current){_.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,A.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else _.current=null}},[x.xCursor]),l.useEffect(()=>{n?.(H)},[H]);const B=ne(c),D={...c,...B,...e&&{"aria-label":e}};return d.jsxs(d.Fragment,{children:[d.jsx(_e,{ref:A,d:w,dFill:j,dataTestId:`${x.dataTestId}path`,dataValue:x.data,points:H,xKey:x.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(N,x.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,A.current?.node?.[e]?.dispatchEvent(t)}},...D}),o&&d.jsx(et,{curved:r,dataKey:c.dataKey,lineProjection:o,points:H,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),g&&d.jsxs(d.Fragment,{children:[!!E&&d.jsx(Ne,{...E,className:"pointer-events-none",x1:x.xCursor,x2:x.xCursor,y1:v,y2:m}),d.jsx("g",{ref:f,className:"pointer-events-none",children:d.jsx(ge,{...y})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(Ue);if(l.useEffect(()=>{if(void 0!==n){const e=u.tickValues.map(e=>e.value),t="string"==typeof n?parseFloat(n):n;if(isNaN(t))o?.("LINE_CHART_SEPARATOR_ERROR",{error:K(n)});else{const r=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),a=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(t<r||t>a)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:z(t,r,a)})}}if(void 0!==i){const e=h.tickValues.map(e=>e.value),t="string"==typeof i?parseFloat(i):i;if(isNaN(t))o?.("LINE_CHART_SEPARATOR_ERROR",{error:U(i)});else{const r=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),a=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(t<r||t>a)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:G(t,r,a)})}}},[n,i,u.tickValues,h.tickValues,o]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const p=n&&J(u.tickValues,[n],!0)[0],x=i&&J(h.tickValues,[i])[0],f=c?h.coordinates.x1:u.coordinates.x2,R=s?u.coordinates.y1:h.coordinates.y1,g=u.coordinates.x1,A=p??f,_=h.coordinates.y2,T=x??R;l.useEffect(()=>{g===A&&_===T&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:W(H)})},[g,A,_,T,o]);const E=`M${g} ${_} H ${A} V ${T} H ${g} Z`,y=`M${g} ${T} H ${A}`,v=`M${A} ${_} V ${T}`;return d.jsxs("g",{children:[d.jsx("path",{d:E,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:y,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:v,"data-testid":`${t}Right`,...r})]})},XAxis:at,YAxis:nt}),At=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>d.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),_t=l.createContext({}),Tt=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),Et=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},yt="CLOCKWISE",vt=({canvasHeight:e,canvasWidth:t,color:r="blue",gap:a,halfChart:n,innerRadius:i,radius:o,singleStroke:s,startAngle:c,total:l,value:u,...h})=>{const p=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:l})=>{const u=n?2*e:e,h=Math.min(t,u)/2,p=r&&r<h?r:h,x=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},R=s?2*d:d,g=100*l/R*x/100,A=a/p,{carryAngle:_,finalAngle:T,initialAngle:E}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===yt;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:g,direction:o,gapAngle:A,startAngle:c.current});c.current=_;const y=x*l/R-A<=Math.PI?"0":"1",v=Tt(f,i,E),m=Tt(f,i,T),C=Tt(f,p,E);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,p,x,f,R,g,A,_;return c===yt?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=Et({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),p=d?`M ${t.x},${t.y}`:void 0,x=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,g=`M ${t.x},${t.y}`,R=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,_=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=Et({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),p=d?`M ${t.x},${t.y}`:void 0,x=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,g=`M ${t.x},${t.y}`,R=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,A=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,_=d?void 0:"Z"),[l,u,h,p,x,_].concat(d?[f,R,g,A]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:m,innerRadius:i,innerStart:v,largeArcFlag:y,outerEnd:Tt(f,p,T),outerStart:C,radius:p,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:o,gap:a,halfChart:n,innerRadius:i,singleStroke:s,startAngle:c,total:l,value:u});return d.jsx(_e,{...h,d:p,dataValue:u,fill:r})},mt=({dataKey:e,fill:t,gap:r,innerRadius:a,radius:n,...i})=>{const o=String(e),{canvasHeight:s,canvasWidth:c,data:u,dataTestId:h,halfChart:p}=l.useContext(_t),x=p?0:-Math.PI/2,f=l.useRef(x),R=u[o]?.reduce((e,t)=>e+t.value,0),g=1===u[o]?.length,A=a?_(a):void 0,T=n?_(n):void 0;return u[o]?.length?d.jsx("g",{children:u[o].map((e,a)=>l.createElement(vt,{...i,...e,key:`${a.toString()}`,canvasHeight:s,canvasWidth:c,color:e.color||t,dataTestId:`${h}path-${a}`,gap:r,halfChart:p,innerRadius:A,radius:T,singleStroke:g,startAngle:f,total:R}))}):d.jsx(d.Fragment,{})},Ct=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:x="100%",radius:f="50%",role:R,tabIndex:g,width:A="100%",...T})=>{const{extraSpace:E,height:y,width:v}=r,m=_(v),C=_(y),S=E?_(E):void 0,I=h(m,C,S),$=l.useMemo(()=>(({canvasHeight:e,canvasWidth:t,children:r,halfChart:a})=>{let n,i;l.Children.forEach(r,e=>{if(l.isValidElement(e)&&e.type===mt){const{innerRadius:t}=e.props;if(!t)return;const r=_(t);(!n||r<n)&&(n=r)}}),n&&(i=2*n);const o=i??0,s=a?o/2:o,c=a?e:e/2;return{foreignObject:{height:s,width:o,x:t/2-o/2,y:a?c-s:c-s/2}}})({canvasHeight:C,canvasWidth:m,children:n,halfChart:c}),[y,v,c]);return d.jsx(u,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:s,height:x,radius:f,role:R,tabIndex:g,viewBox:I,width:A,...T,children:d.jsx(_t.Provider,{value:{...$,canvasHeight:C,canvasWidth:m,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=l.useContext(_t),u=!a&&c?.width?c.width:a,h=!r&&c?.height?c.height:r,p=!n&&c?.x?c.x:n,x=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return d.jsx(At,{...o,dataTestId:f,height:h,width:u,x:p,y:x,children:e})},Path:mt}),St=({fill:e="#8f8f8f",x:t,y:r})=>d.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[d.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),d.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),d.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),It=({linesData:e})=>d.jsx(d.Fragment,{children:e.map((e,t)=>d.jsxs("g",{children:[e.config.fill&&e.fillPath&&d.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),d.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),$t={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0},Nt=({elementHeight:e,elementPosition:t,elementStrokeWidth:r=0,elementType:a,elementWidth:n,gap:i=0,innerStrokeWidth:o=2,outlineStrokeWidth:s=2})=>{if("circle"===a){const e=n/2+r/2+o/2+i,a=e+o/2+s/2;return{inner:{cx:t.x,cy:t.y,r:e},outer:{cx:t.x,cy:t.y,r:a},type:"circle"}}const c=n+r+o+2*i,d=e+r+o+2*i,l=c+o+s,u=d+o+s;return{inner:{height:d,width:c,x:t.x-c/2,y:t.y-d/2},outer:{height:u,width:l,x:t.x-l/2,y:t.y-u/2},type:"rectangle"}},kt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Lt=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},bt=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},Ot=e=>({end:Math.max(0,e-1),start:0}),Ht=(e,t)=>0===e.start&&e.end===t-1,wt=({endX:e,focusConfig:t,height:r,isFocused:a,startX:n})=>{if(!a)return null;const i=e-n,o=Nt({elementHeight:r,elementPosition:{x:n+i/2,y:r/2},elementStrokeWidth:0,elementType:"rectangle",elementWidth:i,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth}),s=t.outlineColor,c=t.innerColor,l=t.outlineStrokeWidth,u=t.innerStrokeWidth;return"rectangle"!==o.type?null:d.jsxs("g",{pointerEvents:"none",children:[d.jsx("rect",{fill:"none",height:o.outer.height,stroke:s,strokeWidth:l,width:o.outer.width,x:o.outer.x,y:o.outer.y}),d.jsx("rect",{fill:"none",height:o.inner.height,stroke:c,strokeWidth:u,width:o.inner.width,x:o.inner.x,y:o.inner.y})]})},jt=({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l,screenReaderText:u,selectionConfig:h,startX:p})=>{const x=h.hideOverlayOnFullRange&&Ht(e,t);return d.jsx(d.Fragment,{children:d.jsx("rect",{"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":r,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:x?"hidden":"visible"},tabIndex:0,width:a-p,x:p,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l})})},Bt="#8f8f8f",Dt=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h,screenReaderText:p,x:x})=>{const f=a/2,R=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||Bt,radius:e?.radius||17,stroke:e?.stroke||Bt,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||Bt,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r),g=Nt({elementHeight:2*R.radius,elementPosition:{x:x,y:f},elementStrokeWidth:"number"==typeof R.strokeWidth?R.strokeWidth:parseFloat(R.strokeWidth.toString()),elementType:"circle",elementWidth:2*R.radius,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return d.jsxs("g",{"data-testid":`${e}-group`,children:[d.jsx("line",{pointerEvents:"none",stroke:R.verticalLineStroke,strokeWidth:R.verticalLineStrokeWidth,x1:x,x2:x,y1:0,y2:a}),d.jsx("circle",{"aria-label":p,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":p,cursor:"ew-resize",cx:x,cy:f,"data-testid":e,fill:R.fill,r:R.radius,role:"slider",stroke:R.stroke,strokeWidth:R.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h}),d.jsx(St,{fill:R.iconColor,x:x,y:f}),n&&"circle"===g.type&&d.jsxs("g",{pointerEvents:"none",children:[d.jsx("circle",{cx:g.outer.cx,cy:g.outer.cy,fill:"none",r:g.outer.r,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth}),d.jsx("circle",{cx:g.inner.cx,cy:g.inner.cy,fill:"none",r:g.inner.r,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth})]})]})},Mt={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},Pt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=l.useRef(null),[s,c]=l.useState(null),d=l.useCallback(e=>()=>{c(e)},[]),u=l.useCallback(e=>()=>{c(e)},[]),h=l.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=Lt(d,i,r),u=((e,t,r,a,n)=>{const i={...t};if(e===Mt.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===Mt.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===Mt.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,l,r,a),h=bt(u,r,a.minHandlerDistance);n(h)},[s,i,r,t,n,a]),p=l.useCallback(e=>{h(e.clientX)},[h]),x=l.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),f=l.useCallback(()=>{c(null)},[]),R=l.useCallback(()=>{c(null)},[]);return l.useEffect(()=>{if(s)return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",R),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",R)}},[s,p,f,x,R]),{groupRef:o,handleMouseDown:d,handleTouchStart:u,isDragging:s}},Xt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:l.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===Mt.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===Mt.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===Mt.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===Mt.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===Mt.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===Mt.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===Mt.START_HANDLER)a.start=0;else if(e===Mt.END_HANDLER)a.end=r-1;else if(e===Mt.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===Mt.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===Mt.END_HANDLER)n.end=r-1;else if(e===Mt.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=bt(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},Ft=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=l.useState({height:0,width:0}),s=l.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:u}=s,p=c?_(c):void 0;l.useEffect(()=>{if(!Ce())return;const e=(e=>{const t=Se();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=ut({canvasHeight:d,canvasWidth:u,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[u,d,t]);const x=l.useMemo(()=>h(i.width,i.height,p),[i.width,i.height,p]);return{parsedCanvas:i,viewBox:x}},Wt=()=>{const[e,t]=l.useState(null),r=l.useCallback(e=>()=>t(e),[]);return{handleBlur:l.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:l.useCallback(t=>e===t,[e])}},Vt=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},Yt=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},Kt=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:Yt(e.end,r),startIndex:Vt(e.start,r)}},Ut=({data:e,initialRange:t,onDataChange:r})=>{const a=t||Ot(e.length),[n,i]=l.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=Kt(t,e.length),i=e.slice(n,a+1);r(i)};return l.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},zt=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),Gt=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];a+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),a},Zt=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?Gt(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${Gt(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:l,linePath:d}})},qt=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,Jt=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};exports.Bar=Ee,exports.BarChart=Ke,exports.BarOrientation=E,exports.ChartText=ke,exports.DefaultCanvasConfig=p,exports.ErrorType=y,exports.FOCUS_DEFAULT=$t,exports.ForeignObject=At,exports.HandlerIcon=St,exports.Line=Ne,exports.LineChart=gt,exports.LineRenderer=It,exports.Node=ge,exports.NodeType=fe,exports.Path=_e,exports.PieChart=Ct,exports.Positions=v,exports.SelectionArea=jt,exports.SelectionAreaFocusRing=wt,exports.SvgContainer=u,exports.Tick=Le,exports.TickDataUtils=rt,exports.XAxis=He,exports.YAxis=De,exports.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:h="40px",initialRange:p,interactionConfig:x,lines:R,onDataChange:g,role:A,screenReaderTextConfig:_,selectionConfig:T,width:E="100%",xKey:y,...v})=>{const m="zoom-area",C=zt(x),S=(I=T,{fill:I?.fill??"#0078d4",fillOpacity:I?.fillOpacity??.5,hideOverlayOnFullRange:I?.hideOverlayOnFullRange??true,stroke:I?.stroke??"#0078d4",strokeWidth:I?.strokeWidth??0});var I;const $=(e=>({gap:e?.gap??$t.OUTLINES_GAP,innerColor:e?.innerColor??$t.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??$t.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??$t.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??$t.OUTER_FOCUS_STROKE_WIDTH}))(s),{currentRange:N,handleRangeChange:k}=Ut({data:o,initialRange:p,onDataChange:g}),{parsedCanvas:L,viewBox:b}=Ft({canvasConfig:a,dataTestId:m,height:h,width:E}),O=f(o),H=JSON.stringify(R),w=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=Kt(r,e.length),o=qt(e,t,i),s=qt(e,t,n),c=Jt(a?.startHandler,o,s)??o;return{endHandler:Jt(a?.endHandler,o,s)??s,selectionArea:Jt(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,y,N,_),j=l.useMemo(()=>Zt(o,R,L.width,L.height),[O,H,L.width,L.height]),{endX:B,startX:D}=l.useMemo(()=>kt(N,o.length,L.width),[N,O,L.width]),{handleBlur:M,handleFocus:P,isFocused:X}=Wt(),{handleKeyDown:F}=Xt({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:k}),{groupRef:W,handleMouseDown:V,handleTouchStart:Y}=Pt({currentRange:N,dataLength:o.length,interactionConfig:C,onRangeChange:k,width:L.width});return d.jsxs(u,{ref:W,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":m,height:h,overflow:"visible",role:A,viewBox:b,width:E,...v,children:[d.jsx(It,{linesData:j}),d.jsx(jt,{currentRange:N,dataLength:o.length,dataTestId:`${m}-selection-area`,endX:B,height:L.height,screenReaderText:w.selectionArea,selectionConfig:S,startX:D,onBlur:M,onFocus:P(Mt.SELECTION_AREA),onKeyDown:F(Mt.SELECTION_AREA),onMouseDown:V(Mt.SELECTION_AREA),onTouchStart:Y(Mt.SELECTION_AREA)}),d.jsx(Dt,{dataTestId:`${m}-start-handler`,focusConfig:$,handlerConfig:c,height:L.height,isFocused:X(Mt.START_HANDLER),max:N.end-C.minHandlerDistance,min:0,screenReaderText:w.startHandler,type:Mt.START_HANDLER,value:N.start,x:D,onBlur:M,onFocus:P(Mt.START_HANDLER),onKeyDown:F(Mt.START_HANDLER),onMouseDown:V(Mt.START_HANDLER),onTouchStart:Y(Mt.START_HANDLER)}),d.jsx(Dt,{dataTestId:`${m}-end-handler`,focusConfig:$,handlerConfig:c,height:L.height,isFocused:X(Mt.END_HANDLER),max:o.length-1,min:N.start+C.minHandlerDistance,screenReaderText:w.endHandler,type:Mt.END_HANDLER,value:N.end,x:B,onBlur:M,onFocus:P(Mt.END_HANDLER),onKeyDown:F(Mt.END_HANDLER),onMouseDown:V(Mt.END_HANDLER),onTouchStart:Y(Mt.END_HANDLER)}),d.jsx(wt,{endX:B,focusConfig:$,height:L.height,isFocused:X(Mt.SELECTION_AREA),startX:D})]})},exports.ZoomAreaElements=Mt,exports.ZoomHandler=Dt,exports.calculateHandlerPositions=kt,exports.calculateLinesPathData=Zt,exports.clampRange=bt,exports.createDefaultRange=Ot,exports.generateCurvedPath=Gt,exports.getInteractionConfig=zt,exports.isFullRange=Ht,exports.mouseToDataIndex=Lt,exports.normalizeToArray=e=>Array.isArray(e)?e:[e],exports.useDragInteraction=Pt,exports.useKeyboardNavigation=Xt,exports.useResponsiveCanvas=Ft,exports.useZoomAreaFocus=Wt,exports.useZoomData=Ut;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e,t,r,a,n={exports:{}},i={},o={exports:{}},s={};function c(){return t||(t=1,o.exports=function(){if(e)return s;e=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator,x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,R={};function _(e,t,r){this.props=e,this.context=t,this.refs=R,this.updater=r||x}function g(){}function A(e,t,r){this.props=e,this.context=t,this.refs=R,this.updater=r||x}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=_.prototype;var E=A.prototype=new g;E.constructor=A,f(E,_.prototype),E.isPureReactComponent=!0;var T=Array.isArray,v=Object.prototype.hasOwnProperty,y={current:null},m={key:!0,ref:!0,__self:!0,__source:!0};function C(e,r,a){var n,i={},o=null,s=null;if(null!=r)for(n in void 0!==r.ref&&(s=r.ref),void 0!==r.key&&(o=""+r.key),r)v.call(r,n)&&!m.hasOwnProperty(n)&&(i[n]=r[n]);var c=arguments.length-2;if(1===c)i.children=a;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(e&&e.defaultProps)for(n in c=e.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:t,type:e,key:o,ref:s,props:i,_owner:y.current}}function S(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}var I=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function $(e,a,n,i,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var c=!1;if(null===e)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case t:case r:c=!0}}if(c)return o=o(c=e),e=""===i?"."+N(c,0):i,T(o)?(n="",null!=e&&(n=e.replace(I,"$&/")+"/"),$(o,a,n,"",function(e){return e})):null!=o&&(S(o)&&(o=function(e,r){return{$$typeof:t,type:e.type,key:r,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),a.push(o)),1;if(c=0,i=""===i?".":i+":",T(e))for(var d=0;d<e.length;d++){var l=i+N(s=e[d],d);c+=$(s,a,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),d=0;!(s=e.next()).done;)c+=$(s=s.value,a,n,l=i+N(s,d++),o);else if("object"===s)throw a=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(e).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");return c}function L(e,t,r){if(null==e)return e;var a=[],n=0;return $(e,a,"","",function(e){return t.call(r,e,n++)}),a}function b(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k={current:null},O={transition:null},H={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:O,ReactCurrentOwner:y};function w(){throw Error("act(...) is not supported in production builds of React.")}return s.Children={map:L,forEach:function(e,t,r){L(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return L(e,function(){t++}),t},toArray:function(e){return L(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},s.Component=_,s.Fragment=a,s.Profiler=i,s.PureComponent=A,s.StrictMode=n,s.Suspense=l,s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,s.act=w,s.cloneElement=function(e,r,a){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=f({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=r){if(void 0!==r.ref&&(o=r.ref,s=y.current),void 0!==r.key&&(i=""+r.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(d in r)v.call(r,d)&&!m.hasOwnProperty(d)&&(n[d]=void 0===r[d]&&void 0!==c?c[d]:r[d])}var d=arguments.length-2;if(1===d)n.children=a;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:t,type:e.type,key:i,ref:o,props:n,_owner:s}},s.createContext=function(e){return(e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},s.createElement=C,s.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},s.createRef=function(){return{current:null}},s.forwardRef=function(e){return{$$typeof:d,render:e}},s.isValidElement=S,s.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:b}},s.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},s.startTransition=function(e){var t=O.transition;O.transition={};try{e()}finally{O.transition=t}},s.unstable_act=w,s.useCallback=function(e,t){return k.current.useCallback(e,t)},s.useContext=function(e){return k.current.useContext(e)},s.useDebugValue=function(){},s.useDeferredValue=function(e){return k.current.useDeferredValue(e)},s.useEffect=function(e,t){return k.current.useEffect(e,t)},s.useId=function(){return k.current.useId()},s.useImperativeHandle=function(e,t,r){return k.current.useImperativeHandle(e,t,r)},s.useInsertionEffect=function(e,t){return k.current.useInsertionEffect(e,t)},s.useLayoutEffect=function(e,t){return k.current.useLayoutEffect(e,t)},s.useMemo=function(e,t){return k.current.useMemo(e,t)},s.useReducer=function(e,t,r){return k.current.useReducer(e,t,r)},s.useRef=function(e){return k.current.useRef(e)},s.useState=function(e){return k.current.useState(e)},s.useSyncExternalStore=function(e,t,r){return k.current.useSyncExternalStore(e,t,r)},s.useTransition=function(){return k.current.useTransition()},s.version="18.3.1",s}()),o.exports}var d=(a||(a=1,n.exports=function(){if(r)return i;r=1;var e=c(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,a){var i,c={},d=null,l=null;for(i in void 0!==a&&(d=""+a),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(l=r.ref),r)n.call(r,i)&&!s.hasOwnProperty(i)&&(c[i]=r[i]);if(e&&e.defaultProps)for(i in r=e.defaultProps)void 0===c[i]&&(c[i]=r[i]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:o.current}}return i.Fragment=a,i.jsx=d,i.jsxs=d,i}()),n.exports),l=c();const u=l.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:a,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:l,radius:u="0px",role:h,tabIndex:p,viewBox:x,width:f,...R},_)=>d.jsxs("svg",{ref:_,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:r,borderRadius:u,overflow:l},tabIndex:p,viewBox:x,width:f,onMouseDown:e=>e.preventDefault(),...R,children:[a&&d.jsx("title",{children:a}),c&&d.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),h=(e,t,r=0)=>`${-r} ${-r} ${e} ${t}`,p={extraSpace:0,height:80,width:100},x=e=>{const t=new Map,r=()=>{const e={};return t.forEach((t,r)=>{e[r]=t}),e};return{addError:(a,n)=>{if(!n)return;const i={...n,type:a},o=t.get(a)||[];if(o.push(i),t.set(a,o),e){const t=r(),a={};Object.entries(t).forEach(([e,t])=>{const r=e;Array.isArray(t)&&t.length,a[r]=t}),e(a)}},clearErrors:()=>{t.clear(),e&&e({})},getAccumulatedErrors:r}},f=e=>JSON.stringify(e),R="%",_="rem",g=/^(\d+(\.\d+)?)(px|rem|%)?$/,A=e=>{if("number"==typeof e)return e;const t=e.match(g);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=t[1];return t[3]===_?16*parseFloat(r):parseFloat(r)},E=l.createContext({}),T={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},v={BAR_CHART_CONTEXT_ERROR:"BAR_CHART_CONTEXT_ERROR",BAR_CHART_PATH_ERROR:"BAR_CHART_PATH_ERROR",BAR_CHART_SEPARATOR_ERROR:"BAR_CHART_SEPARATOR_ERROR",BAR_CHART_X_AXIS_ERROR:"BAR_CHART_X_AXIS_ERROR",BAR_CHART_Y_AXIS_ERROR:"BAR_CHART_Y_AXIS_ERROR",GENERIC:"GENERIC",LINE_CHART_CONTEXT_ERROR:"LINE_CHART_CONTEXT_ERROR",LINE_CHART_PATH_ERROR:"LINE_CHART_PATH_ERROR",LINE_CHART_PROJECTION_ERROR:"LINE_CHART_PROJECTION_ERROR",LINE_CHART_SEPARATOR_ERROR:"LINE_CHART_SEPARATOR_ERROR",LINE_CHART_X_AXIS_ERROR:"LINE_CHART_X_AXIS_ERROR",LINE_CHART_Y_AXIS_ERROR:"LINE_CHART_Y_AXIS_ERROR",PIE_CHART_CONTEXT_ERROR:"PIE_CHART_CONTEXT_ERROR",PIE_CHART_PATH_ERROR:"PIE_CHART_PATH_ERROR",PIE_CHART_SEGMENT_ERROR:"PIE_CHART_SEGMENT_ERROR"},y={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},m=Object.entries({BAR_CHART_AXIS_INSUFFICIENT_TICKS:"Axis requires at least two ticks for proper bar scaling",BAR_CHART_AXIS_INVALID_SCALE:"Invalid axis scale for current bar values",BAR_CHART_DISTRIBUTION_INSUFFICIENT_SPACE:"Insufficient space for bar distribution with current configuration",BAR_CHART_DISTRIBUTION_INVALID_GAP:"Invalid gap between bars - must be >= 0 and allow bar rendering",BAR_CHART_DISTRIBUTION_OVERLAP:"Bar distribution results in overlapping bars",BAR_CHART_EMPTY_DATA:"No valid data entries found for bar chart rendering",BAR_CHART_INSUFFICIENT_SPACE_HEIGHT:"Insufficient height to render bars. Consider reducing bar count or increasing chart height",BAR_CHART_INSUFFICIENT_SPACE_WIDTH:"Insufficient width to render bars. Consider reducing bar width or increasing chart width",BAR_CHART_INVALID_VALUE:"Bar value must be a valid number for rendering",BAR_CHART_NEGATIVE_VALUE:"Negative values are not supported in this bar configuration",BAR_CHART_NO_DATA:"Data validation failed: no data provided for bar chart rendering",BAR_CHART_OVERLAP:"Bars are overlapping due to insufficient spacing",BAR_CHART_SEPARATOR_X_OUT_OF_RANGE:"Separator X position is outside valid bar range",BAR_CHART_SEPARATOR_Y_OUT_OF_RANGE:"Separator Y position is outside valid bar range",BAR_CHART_STACK_INVALID:"Invalid stacking configuration - all bars in stack must have consistent configuration",BAR_CHART_STACK_MISSING_VALUES:"Stack is incomplete - all bars in stack must have valid values"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),C=Object.entries({LINE_CHART_INVALID_CANVAS:"Canvas dimensions validation failed: both width and height must be > 0",LINE_CHART_NO_DATA:"Data validation failed: no data provided for chart rendering",LINE_CHART_PATH_ALL_VALUES_NULL:"Path data cannot be generated - all Y values are null or undefined",LINE_CHART_PATH_INSUFFICIENT_POINTS:"Unable to calculate curved path with insufficient points (minimum 2 required)",LINE_CHART_PATH_INVALID_DATAKEY:"DataKey must be a valid string",LINE_CHART_PROJECTION_INVALID_BOUNDS:"Invalid projection bounds - upper projection must be below lower projection",LINE_CHART_PROJECTION_LOWER_X_OUT_OF_RANGE:"Lower projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_LOWER_Y_OUT_OF_RANGE:"Lower projection Y coordinate is outside chart area",LINE_CHART_PROJECTION_UPPER_X_OUT_OF_RANGE:"Upper projection X coordinate is outside valid range (0-100)",LINE_CHART_PROJECTION_UPPER_Y_OUT_OF_RANGE:"Upper projection Y coordinate is outside chart area",LINE_CHART_SEPARATOR_INVALID_COORDINATES:"Invalid separator position - coordinates overlap, cannot render separator",LINE_CHART_SEPARATOR_INVALID_X_BREAK_AXIS:"Invalid xBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_INVALID_Y_BREAK_AXIS:"Invalid yBreakAxis value: cannot be parsed as number",LINE_CHART_SEPARATOR_X_OUT_OF_RANGE:"xBreakAxis value is outside data range",LINE_CHART_SEPARATOR_Y_OUT_OF_RANGE:"yBreakAxis value is outside data range",LINE_CHART_SINGLE_POINT:"Data validation failed: single data point provided, minimum 2 required for line chart",LINE_CHART_X_AXIS_IDENTICAL_VALUES:"X-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_X_AXIS_INSUFFICIENT_TICKS:"X-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_X_AXIS_ZERO_LENGTH:"X-axis geometry validation failed: start and end X coordinates are identical (x1=x2), axis has zero length",LINE_CHART_Y_AXIS_IDENTICAL_VALUES:"Y-axis range validation failed: minimum and maximum values are identical, cannot render chart line",LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS:"Y-axis tick calculation: insufficient data points (1/2 minimum required)",LINE_CHART_Y_AXIS_ZERO_LENGTH:"Y-axis geometry validation failed: start and end Y coordinates are identical (y1=y2), axis has zero length"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),S=Object.entries({PIE_CHART_EMPTY_DATA:"PieChart data is empty or undefined",PIE_CHART_INNER_RADIUS_OUT_OF_RANGE:"Inner radius must be less than radius",PIE_CHART_INVALID_CANVAS_DIMENSIONS:"Invalid canvas dimensions for PieChart",PIE_CHART_INVALID_DATA_KEY:"Invalid or missing dataKey in PieChart data",PIE_CHART_INVALID_INNER_RADIUS:"Invalid innerRadius value",PIE_CHART_INVALID_RADIUS:"Invalid radius value",PIE_CHART_INVALID_SEGMENT_VALUE:"Invalid segment value (non-numeric)",PIE_CHART_INVALID_TOTAL:"PieChart total value is zero or invalid",PIE_CHART_MISSING_SEGMENT_NAME:"Segment is missing required name property",PIE_CHART_NEGATIVE_SEGMENT_VALUE:"Segment value cannot be negative"}).reduce((e,[t,r])=>(e[t]=new Error(r),e),{}),I=(e,t)=>new Error(`Invalid value "${e}" for bar with dataKey "${t}". Must be a valid number.`),N=(e,t)=>new Error(`Negative value ${e} not allowed for bar with dataKey "${t}" in current configuration`),$=(e,t)=>new Error(`Invalid segment value for "${t}": "${e}" is not a valid number`),L=(e,t)=>new Error(`Negative segment value for "${t}": ${e} (values must be >= 0)`),b=e=>new Error(`DataKey "${e}" not found in PieChart dataset`),k=e=>new Error(`Data array for key "${e}" is empty`),O=(e,t)=>new Error(`Invalid total value for "${e}": ${t} (must be > 0)`),H=(e,t,r)=>new Error(`Invalid group at index ${t} in "${e}": missing required property "${r}"`),w=e=>new Error(`Invalid radius value: "${e}" (must be a positive number)`),P=e=>new Error(`Invalid innerRadius value: "${e}" (must be a positive number or zero)`),j=(e,t)=>new Error(`innerRadius (${e}) must be less than radius (${t}) for donut chart rendering`),D="INVALID_X_TICK",B="BAR_CHART_NO_DATA",M="LINE_CHART_NO_DATA",X="LINE_CHART_PATH_ALL_VALUES_NULL",F="LINE_CHART_PATH_INSUFFICIENT_POINTS",V="LINE_CHART_PATH_INVALID_DATAKEY",W="LINE_CHART_SEPARATOR_INVALID_COORDINATES",Y="LINE_CHART_SINGLE_POINT",K="LINE_CHART_X_AXIS_IDENTICAL_VALUES",U="LINE_CHART_X_AXIS_INSUFFICIENT_TICKS",G="LINE_CHART_X_AXIS_ZERO_LENGTH",z="LINE_CHART_Y_AXIS_IDENTICAL_VALUES",Z="LINE_CHART_Y_AXIS_INSUFFICIENT_TICKS",q="LINE_CHART_Y_AXIS_ZERO_LENGTH",J={...m,...C,...S,INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},Q=e=>J[e],ee=e=>new Error(`DataKey "${e}" not found in dataset`),te=(e,t)=>new Error(`Canvas dimensions validation failed: width=${e}, height=${t} (both must be > 0)`),re=e=>new Error(`Invalid xBreakAxis value: '${e}' cannot be parsed as number`),ae=e=>new Error(`Invalid yBreakAxis value: '${e}' cannot be parsed as number`),ne=(e,t,r)=>new Error(`xBreakAxis value ${e} is outside data range (${t} - ${r})`),ie=(e,t,r)=>new Error(`yBreakAxis value ${e} is outside data range (${t} - ${r})`),oe=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===y.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===y.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===y.CUSTOM?{x1:n,x2:t-i,y1:r,y2:r}:{x1:n,x2:t-i,y1:e-a,y2:e-a},se=({canvasHeight:e,canvasWidth:t,customBreakAxis:r,extraSpaceBottomY:a,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===y.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-a}:s===y.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-a}:s===y.CUSTOM?{x1:r,x2:r,y1:o,y2:e-a}:{x1:n,x2:n,y1:o,y2:e-a},ce=(e,t,r)=>t.map(t=>{if(isNaN(Number(t))){const r=e.find(e=>String(e.value)===String(t));return r?r.position:0}const{index:a,tick:n}=e.reduce((e,r,a)=>Math.abs(Number(r.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:a,tick:r}:e,{index:0,tick:e[0]}),i=Number(t),o=Number(n.value);if(i!==o){const t=e.map(e=>Number(e.value)),s=Math.min(...t),c=Math.max(...t);if(i<s)return e.at(0)?.position;if(i>c)return e.at(-1)?.position;const d=Math.abs(o-i),l=i>o,u=l?e[a+1]:e[a-1],h=100*d/Math.abs(Number(u.value)-o),p=Math.abs(n.position-u.position)*h/100;return r?l?n.position+p:n.position-p:l?n.position-p:n.position+p}return n.position}),de=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:r,securitySpace:a,tickValues:n})=>{const i=n.length-1,o=(t-r-a)/i;return n.map((t,r)=>({position:e+r*o+a/2,value:t}))},le=({initPos:e,maxSpaceAvailable:t,needAjusted:r,otherAxisSpace:a,securitySpace:n,tickValues:i})=>{const o=(t-a-n)/(i.length-1),s=r?n/2:0;return i.map((t,r)=>({position:e-r*o-s,value:t}))},ue="0",he="1",pe="fallbackData";(()=>{if("undefined"!=typeof globalThis&&"process"in globalThis){const e=globalThis.process;return"production"===e?.env?.NODE_ENV}})();const xe=e=>e?Object.entries(e).reduce((e,[t,r])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=r&&(e[t]=String(r)),e),{}):{},fe=({height:e="140%",width:t="140%",x:r="-20%",y:a="-20%",...n})=>d.jsx("defs",{children:d.jsx("filter",{height:e,id:n.id,width:t,x:r,y:a,children:d.jsx("feDropShadow",{...n.shadowSvgConfig})})}),Re=-1/0,_e=l.forwardRef(({dataTestId:e,position:t,size:r=1,...a},n)=>d.jsx("circle",{...a,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:r/2})),ge=(e,t,r,a,n)=>{let i="";const o=a===n,s=o?r:2*r;for(let r=0;r<s;r++){const c=o||r%2==0?a:n,d=2*Math.PI/s*r-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},Ae=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=ge(t.x,t.y,6,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-hexagon`,points:i})}),Ee=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=ge(t.x,t.y,5,r/2,r/2);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-pentagon`,points:i})}),Te=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>d.jsx("rect",{...a,ref:n,"data-testid":`${e}-square`,height:r,width:r,x:t.x-r/2,y:t.y-r/2})),ve=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=r/2,o=i/2,s=ge(t.x,t.y,5,i,o);return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-star`,points:s})}),ye=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=`M ${t.x-r/2} ${t.y} H ${t.x+r/2} M ${t.x} ${t.y-r/2} V ${t.y+r/2}`;return d.jsx("path",{...a,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),me=l.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:r=1,...a},n)=>{const i=[`${t.x},${t.y-r/2}`,`${t.x-r/2},${t.y+r/2}`,`${t.x+r/2},${t.y+r/2}`].join(" ");return d.jsx("polygon",{...a,ref:n,"data-testid":`${e}-triangle`,points:i})}),Ce={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},Se={[Ce.Circle]:_e,[Ce.Hexagon]:Ae,[Ce.Pentagon]:Ee,[Ce.Square]:Te,[Ce.Star]:ve,[Ce.Straight]:ye,[Ce.Triangle]:me},Ie=l.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:r=!1,onBlur:a,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:u,position:h={x:0,y:0},size:p=1,type:x=Ce.Circle,...f},R)=>{const[_,g]=(e=>{const t=l.useRef(!1),r=l.useRef(null);l.useImperativeHandle(e,()=>r.current,[]);const a=e=>{t.current=!!e.autoClick};return l.useEffect(()=>{if(!r.current)return;const e=r.current;return e.addEventListener("click",a),()=>e.removeEventListener("click",a)},[]),[r,t]})(R),A={...f,className:`node ${f.className}`,onBlur:e=>{a?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:h},g.current)},onDoubleClick:e=>{i?.(e,f.data)},onFocus:e=>{o?.(e,f.data)},onKeyDown:e=>{"Enter"===e.key&&s?.(e,f.data)},onMouseEnter:e=>{c?.(e,f.data)},onMouseLeave:e=>{u?.(e)}},E={className:f.className,fill:t?.fill||f.fill,fillOpacity:t?.fillOpacity||.25,opacity:t?.opacity||.3,stroke:t?.stroke||f.stroke,strokeWidth:t?.strokeWidth||f.strokeWidth},T=Se[x];return d.jsxs(d.Fragment,{children:[r&&d.jsx(T,{...E,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:p+p/2,tabIndex:-1}),d.jsx(T,{...A,ref:_,dataTestId:e,position:h,size:p})]})}),Ne=l.forwardRef(({data:e,nodeConfig:t,tabIndex:r=0,x:a,y:n},i)=>{const o=t?xe(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const r=((e,t,r)=>{if(!e)return;const a=r??t.dataValue,n=Array.isArray(a)?a[t.index]:void 0,{xValue:i,yValue:o}=((e,t)=>({xValue:e&&t.xKey?e[t.xKey]?.toString()??"":"",yValue:e&&t.dataKey?e[t.dataKey]?.toString()??"":""}))(n,t);return((e,t,r,a)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),r),n=n.replace(new RegExp("{{yValue}}","g"),a),void 0!==t.index&&(n=n.replace(new RegExp("{{index}}","g"),(t.index+1).toString())),n})(e,t,i,o)})(t,{dataKey:e.dataKey,dataValue:e.dataValue,index:e.index??0,xKey:e.xKey},e.dataValue);r&&(o["aria-label"]=r)}}return d.jsx(d.Fragment,{children:t&&d.jsx(Ie,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:a,y:n},tabIndex:r})})}),$e=l.forwardRef(({classNames:e="",fill:t="transparent",stroke:r="#0000FF",strokeWidth:a="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:u,handleFocus:h,isFocused:p}=((e,t)=>{const[r,a]=l.useState(!1),n=l.useCallback(t=>{a(!0),e?.(t)},[e]);return{handleBlur:l.useCallback(e=>{a(!1),t?.(e)},[t]),handleFocus:n,isFocused:r}})(s.onFocus,s.onBlur),{handleMouseEnter:x,handleMouseLeave:f,isHovered:R}=((e,t)=>{const[r,a]=l.useState(!1);return{handleMouseEnter:l.useCallback(t=>{a(!0),e?.(t)},[e]),handleMouseLeave:l.useCallback(e=>{a(!1),t?.(e)},[t]),isHovered:r}})(s.onMouseEnter,s.onMouseLeave),_=l.useRef(null),g=l.useRef([]),A=l.useRef(null);l.useImperativeHandle(c,()=>({get main(){return A.current},get node(){return g.current},get path(){return _.current}}));const E=s.gradient&&((e,t="gradientePath")=>{const r=e.split(",").map(e=>e.trim()),a=parseInt(r[0],10),n=r.slice(1).map(e=>{const[t,r]=e.split(" ");return{color:t,offset:r}});let i="0%",o="0%",s="0%";switch(a){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return d.jsx(d.Fragment,{})}return d.jsx("defs",{children:d.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>d.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),T=xe(s),v={...{...s,classNames:`path ${e}`,fill:E?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:r,strokeWidth:a},...p&&n,...R&&i};return d.jsxs("g",{ref:A,tabIndex:-1,children:[E&&E,v.shadowSvgConfig&&d.jsx(fe,{id:"shadow",shadowSvgConfig:v.shadowSvgConfig}),d.jsxs("g",{"aria-label":v.ariaLabel,className:v.classNames,"data-draw":!0,filter:v.shadowSvgConfig&&v.filter,opacity:v.opacity,orientation:v.orientation,role:v.role,rotate:v.rotate,tabIndex:v.tabIndex,transform:v.transform,visibility:v.visibility,...T,onBlur:u,onClick:()=>{s.onClick?.(s.dataValue)},onDoubleClick:e=>{s.onDoubleClick?.(e,s.dataValue)},onFocus:h,onKeyDown:e=>{"Enter"===e.key&&s.onKeyDown?.(s.dataValue)},onMouseDown:e=>{e.preventDefault()},onMouseEnter:x,onMouseLeave:f,children:[d.jsx("path",{ref:_,d:v.d,"data-testid":v.dataTestId,fill:v.dFill?"transparent":v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule,stroke:v.stroke,strokeDasharray:v.strokeDasharray,strokeDashoffset:v.strokeDashoffset,strokeLinecap:v.strokeLinecap,strokeLinejoin:v.strokeLinejoin,strokeMiterlimit:v.strokeMiterlimit,strokeOpacity:v.strokeOpacity,strokeWidth:v.strokeWidth,children:v.title&&d.jsx("title",{children:v.title})}),v.dFill&&d.jsx("path",{d:v.dFill,fill:v.fill,fillOpacity:v.fillOpacity,fillRule:v.fillRule})]}),v.points&&v.nodeConfig&&v.points.map(([e,t],r)=>{const a={dataKey:v.dataKey,dataValue:v.dataValue,index:r,xKey:v?.xKey};return d.jsx(Ne,{ref:e=>g.current[r]=e,data:a,nodeConfig:v.nodeConfig,tabIndex:-1,x:e,y:t},`${r.toString()}`)})]})}),Le=(e,t,r)=>e?t+r/2:t-r/2,be=({barConfig:e,currentBars:t,endRounded:r,extraSpacing:a=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:l,y2:u})=>{const{barWidth:h,singleConfig:p}=e,x=(({barConfig:e,orientation:t,x1:r,x2:a,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===T.HORIZONTAL,d=c?r:n,l=c?a:i,u={end:l<d,start:l>d};return s.reduce((e,t,r)=>{const{coverage:a}=t,n=((e,t)=>e/100*t)(a,l-d),i=0===r?d:Le(u.start,e[r-1][1],o),c=r+1===s.length?l:Le(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:l,y2:u});return d.jsx("g",{children:p.map((e,f)=>{const[R,_]="HORIZONTAL"===i?x[f]:[s,c],[g,A]="VERTICAL"===i?x[f]:[l,u],E=(({barWidth:e,currentBars:t,endRounded:r=0,extraSpacing:a,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,p,x,f="Z";const R=(({barWidth:e,currentBars:t,extraSpacing:r,order:a,orientation:n})=>{const i=e/2,o=r/2,s=t%2==0,c=s?o:o+i,d=a-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===T.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===T.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:a,order:n,orientation:i});if(i===T.HORIZONTAL){const t=s+o,a=c-r;o&&r?(u=`M ${t},${d+R}`,h=`L${a},${l+R}`,p=`Q${c+r} ${l+R-e/2}, ${a} ${l+R-e}`,x=`L${t},${d+R-e}`,f=`Q${s-o} ${d+R-e/2}, ${t} ${d+R}`):o?(u=`M ${t},${d+R}`,h=`L${c},${l+R}`,p=`L${c},${l+R-e}`,x=`L${t},${d+R-e}`,f=`Q${s-o} ${d+R-e/2}, ${t} ${d+R}`):r?(u=`M${s},${d+R}`,h=`L${a},${l+R}`,p=`Q${c+r} ${l+R-e/2}, ${a} ${l+R-e}`,x=`L${s},${d+R-e}`):(u=`M${s},${d+R}`,h=`L${c},${l+R}`,p=`L${c},${l+R-e}`,x=`L${s},${d+R-e}`)}else{const t=d-o,a=l+r;o&&r?(u=`M${s+R}, ${t}`,h=`L${c+R},${a}`,p=`Q${c+R-e/2} ${l-r}, ${c+R-e} ${a}`,x=`L${s+R-e},${t}`,f=`Q${s+R-e/2} ${d+o}, ${s+R} ${t}`):o?(u=`M${s+R}, ${t}`,h=`L${c+R},${l}`,p=`L${c+R-e},${l}`,x=`L${s+R-e},${t}`,f=`Q${s+R-e/2} ${d+o}, ${s+R} ${t}`):r?(u=`M${s+R},${d}`,h=`L${c+R},${a}`,p=`Q${c+R-e/2} ${l-r}, ${c+R-e} ${a}`,x=`L${c+R-e},${d}`):(u=`M${s+R},${d}`,h=`L${c+R},${l}`,p=`L${c+R-e},${l}`,x=`L${s+R-e},${d}`)}return`${u} ${h} ${p} ${x} ${f}`})({barWidth:h,currentBars:t,endRounded:f===p.length-1&&r?r:void 0,extraSpacing:a,order:n,orientation:i,startRounded:0===f&&o?o:void 0,x1:R,x2:_,y1:g,y2:A});return d.jsx($e,{d:E,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${f.toString()}`)})})},ke=({barConfig:e,dataIdx:t,dataKey:r,order:a,...n})=>{const{addError:i,xAxisCoordinates:o,yAxisCoordinates:s,...c}=l.useContext(E),{coordinates:u,tickValues:h}=o,{coordinates:p,tickValues:x}=s,f=c.orientation===T.VERTICAL,R=f?c.pKey:r,_=f?r:c.pKey,g=c.data[t],A=g?.[R],v=g?.[_],y=c.data[0],m=!!y&&Object.prototype.hasOwnProperty.call(y,r),C=c.data.length>0,S=Number(v);l.useEffect(()=>{!C||m?isNaN(S)?i?.("BAR_CHART_PATH_ERROR",{error:I(v,r)}):S<0&&i?.("BAR_CHART_PATH_ERROR",{error:N(S,r)}):i?.("BAR_CHART_PATH_ERROR",{error:ee(r)})},[r,C,m,S,v]);const $=ce(h,[String(A)],!0)[0],L=ce(x,[String(v)])[0],b=f?{x1:$,x2:$,y1:u.y1,y2:L}:{x1:p.x1,x2:$,y1:L,y2:L};return d.jsx(be,{barConfig:e,currentBars:c.barChildrenCount,extraSpacing:c.gapBetweenBars,order:a,orientation:c.orientation,...b,...n})},Oe=e=>{let t=0;return l.Children.toArray(e).forEach(e=>{l.isValidElement(e)&&e.type===ke&&e.props.order>t&&(t=e.props.order)}),t},He=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),r=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:r,min:t,step:Math.abs(r-t)/2}}},we=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Pe=()=>we()?document:void 0,je=e=>{const t=Pe();if(t)return t.createElementNS("http://www.w3.org/2000/svg",e)},De=({bound:e,data:t,fontSize:r,svgHeight:a,svgWidth:n,viewBox:i})=>{if(!we()||!t.length)return 0;const o=Pe();if(!o)return 0;const s=je("svg");if(!s)return 0;s.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),s.setAttribute("viewBox",i),s.setAttribute("width",n),s.setAttribute("height",a),o.body.appendChild(s);const c=t.map(t=>{const a=je("text");if(!a)return 0;a.setAttribute("font-size",r),a.textContent=t,s.appendChild(a);const n=a.getBBox()[e];return a.remove(),n});return s.remove(),Math.max(...c,0)},Be=({ariaLabel:e="",className:t="line",dataTestId:r,tabIndex:a=-1,...n})=>d.jsx("line",{...n,"aria-label":e,className:t,"data-testid":r,tabIndex:a}),Me=({children:e,className:t="circle",tabIndex:r=-1,...a})=>d.jsx("text",{className:t,tabIndex:r,...a,children:e}),Xe=({showTickLines:e,tick:t,tickLine:r,tickText:a})=>d.jsxs("g",{children:[e&&d.jsx(Be,{...r}),a&&d.jsx(Me,{...a,children:t.value})]}),Fe=(e,t,r=1)=>e>=t-r&&e<=t+r,Ve=e=>{const{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:p,transform:x,x1:f,x2:R,y1:_,y2:g}=e;return{ariaLabel:t,className:r,dataTestId:a,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:p,transform:x,x1:f,x2:R,y1:_,y2:g}},We=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:r=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:n=y.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:l=[],...u})=>{const h=xe(u);return d.jsxs("g",{...h,children:[d.jsx(Be,{...Ve(u)}),l&&l.length>0&&l.map((e,t)=>{const a=Fe(r,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return d.jsx(Xe,{showTickLines:i,tick:e,tickLine:{...a,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},Ye=(e,t,r)=>e===y.RIGHT?t+r:t-r,Ke=(e,t,r,a)=>e===y.TOP?r:t+r+a,Ue=({position:e=y.BOTTOM,tickLine:t,tickText:r,...a})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(E),s=Ke(e,n.y1,Number(r?.fontSize),r?.top??0),c=o.extraSpaceTopY,u=Number(o.canvasHeight)-o.extraSpaceBottomY;return d.jsx(We,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:u},tickText:{...r,y:s},tickValues:r?i:void 0})},Ge=({canvasWidth:e,cursor:t=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:a=y.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...l})=>{const u=xe(l);return d.jsxs("g",{...u,children:[d.jsx(Be,{...Ve(l)}),c&&c.length>0&&c.map((e,r)=>{const a=Fe(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return d.jsx(Xe,{showTickLines:n,tick:e,tickLine:{...a,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${r.toString()}`)})]})},ze=(e,t,r)=>{let a=0;switch(e){case"middle":a=t/2+r;break;case"end":a=t+r;break;default:a=0}return a},Ze=({position:e=y.LEFT,tickLine:t,tickText:r,...a})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=l.useContext(E),s=r?.textAnchor||"middle",c=(e===y.RIGHT?r?.right:r?.left)??0,u=ze(s,o.yAxisText,c),h=Ye(e,n.x1,u);return d.jsx(Ge,{...n,...a,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...r,x:h},tickValues:r?i:void 0})},qe=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},Je=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>Number(e[t]))),Qe=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,p=l?qe(l):t.map(e=>e[r]),x=De({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>x?n:x;return{barChartXPosition:c||y.BOTTOM,extraSpaceBottomY:c===y.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===y.TOP?h+(d?.bottom??0):0,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:p}},et=(e,t,r,a,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*a,p=l||He([...new Set(Je(t,r))]),x=qe(p),f=n>h?n:h,R=De({bound:"width",data:x,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||y.LEFT,extraSpaceLeftX:c===y.LEFT?R+(d?.right??0):0,extraSpaceRightX:c===y.RIGHT?R+(d?.left??0):0,securityYSpace:f,yAxisText:R,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:x}},tt=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u})=>{let h;if(!o||0===o.length){const t={error:Q(B)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(n<=0||a<=0){const t={error:te(n,a)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}const p=Oe(i),x=20*p,f=(p-1)*s,R=c===T.VERTICAL?n:a;if(x+f>R){const t={error:(_=`Insufficient space: requires ${x+f}px but only ${R}px available`,new Error(`Invalid bar distribution for "all": ${_}`))};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}var _;const g=o&&o.length>0?o:[{[pe]:0,[d]:ue},{[pe]:0,[d]:he}],A=n>0?n:100,E=a>0?a:100,{barChartXPosition:m,barChartYPosition:C,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:L,securityYSpace:b,xAxisText:k,xBreakAxis:O,xData:H,yAxisText:w,yBreakAxis:P,yData:j}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let u={barChartXPosition:y.BOTTOM,barChartYPosition:y.LEFT,extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]},h=o;const p=[];return l.Children.forEach(n,n=>{if(l.isValidElement(n))if(n.type!==ke||p.includes(n.props.order)||(p.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===Ue){const t=s===T.VERTICAL?h:0;u={...u,...Qe(n,i,c,e,t,d,r,a)}}else if(n.type===Ze){const e=s===T.HORIZONTAL?h:0;u={...u,...et(n,i,c,t,e,d,r,a)}}}),u})({ajustedX:t,ajustedY:r,canvasHeight:E,canvasWidth:A,children:i,data:g,gapBetweenBars:s,orientation:c,pKey:d,viewBox:u}),M=m!==y.TOP&&m!==y.BOTTOM,X=de({initPos:I,maxSpaceAvailable:A,otherAxisSpace:I+N,securitySpace:L,tickValues:H});if((X??[]).some(({position:e})=>isNaN(e))){const t={error:Q(D)};e?.("BAR_CHART_CONTEXT_ERROR",t),h=t}if(X){const t=X.length<2,r=X.length>=2&&1===new Set(X.map(e=>e.value)).size;if(t){const t={error:Q(U)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:Q(K)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}}const F=C!==y.LEFT&&C!==y.RIGHT,V=le({initPos:E-S,maxSpaceAvailable:E,needAjusted:c===T.HORIZONTAL,otherAxisSpace:$+S,securitySpace:b,tickValues:j});if(V){const t=V.length<2,r=V.length>=2&&1===new Set(V.map(e=>e.value)).size;if(t){const t={error:Q(Z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}if(r){const t={error:Q(z)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}}const W=M?ce(V||[],[String(O)])[0]:0,Y=F?ce(X||[],[String(P)])[0]:0,J=oe({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(W),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:m}),ee=se({canvasHeight:E,canvasWidth:A,customBreakAxis:Number(Y),extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,position:C});if(J.x1===J.x2){const t={error:Q(G)};e?.("BAR_CHART_X_AXIS_ERROR",t),h||(h=t)}if(ee.y1===ee.y2){const t={error:Q(q)};e?.("BAR_CHART_Y_AXIS_ERROR",t),h||(h=t)}const re={addError:e,crossXAxis:M,crossYAxis:F,data:g,extraSpaceBottomY:S,extraSpaceLeftX:I,extraSpaceRightX:N,extraSpaceTopY:$,securityXSpace:L,securityYSpace:b,xAxisCoordinates:{coordinates:J,tickValues:X||(h?[{position:0,value:ue},{position:A,value:he}]:[])},xAxisText:k,yAxisCoordinates:{coordinates:ee,tickValues:V||(h?[{position:E,value:ue},{position:0,value:he}]:[])},yAxisText:w};return h?{...re,error:{...h,type:v.BAR_CHART_CONTEXT_ERROR}}:re},rt=Object.assign(({canvasConfig:e=p,caption:t,children:r,classNames:a,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",onErrors:c,orientation:R,pKey:_,role:g,tabIndex:T,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=e,I=A(S),N=A(C),$=m?A(m):void 0,L=h(I,N,$),b=Oe(r),k=2*o,O=[d.jsx(Ue,{},"default-x-axis"),d.jsx(Ze,{},"default-y-axis")],H=l.Children.toArray(r)||[],w=O.concat(H),P=Math.max(I,N,$??0),j=I/P,D=N/P,B=l.useMemo(()=>x(c),[c]),M=f(n),X=l.useMemo(()=>(B.clearErrors(),tt({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:N,canvasWidth:I,children:w,data:n,gapBetweenBars:k,orientation:R,pKey:_,viewBox:L})),[C,S,M,_,R,B.addError]);return d.jsx(u,{caption:t,className:a,dataTestId:i,height:s,role:g,tabIndex:T,viewBox:L,width:v,...y,children:d.jsx(E.Provider,{value:{...X,barChildrenCount:b,canvasExtraSpace:$,canvasHeight:N,canvasWidth:I,data:n,dataTestId:i,gapBetweenBars:o,orientation:R,pKey:_},children:r})})},{Path:ke,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(E),p=u.tickValues,x=h.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,R=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=p.map(e=>e.value);if(void 0===f||isNaN(f))o?.("BAR_CHART_SEPARATOR_ERROR",{error:re(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ne(f,t,r)})}}if(void 0!==i){const e=x.map(e=>e.value);if(void 0===R||isNaN(R))o?.("BAR_CHART_SEPARATOR_ERROR",{error:ae(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}},[n,f,p,i,R,x]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const _=n&&ce(u.tickValues,[n],!0)[0],g=i&&ce(h.tickValues,[i])[0],A=c?h.coordinates.x1:u.coordinates.x2,T=s?u.coordinates.y1:h.coordinates.y1,v=u.coordinates.x1,y=_??A,m=h.coordinates.y2,C=g??T;l.useEffect(()=>{v===y&&m===C&&o?.("BAR_CHART_SEPARATOR_ERROR",{error:Q(W)})},[v,y,m,C]);const S=`M${v} ${m} H ${y} V ${C} H ${v} Z`,I=`M${v} ${C} H ${y}`,N=`M${y} ${m} V ${C}`;return d.jsxs("g",{children:[d.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:I,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:N,"data-testid":`${t}Right`,...r})]})},XAxis:Ue,YAxis:Ze}),at=l.createContext({}),nt=({curved:e=!1,extendToBottom:t=!1,points:r,svgHeight:a})=>{if(0===r.length)return"";const[n,...i]=r;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,a)=>{const[n,i]=r[a],[o,s]=t,c=.3*(o-n),d=[n+c,i],l=[o-c,s];return`${e} C ${d[0]} ${d[1]}, ${l[0]} ${l[1]}, ${o} ${s}`},""):i.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""),t&&(o+=` L ${i[i.length-1][0]} ${a} L ${n[0]} ${a} Z`),o},it=(e,t)=>new Error(`Invalid projection bounds - upper projection (${e}) must be below lower projection (${t})`),ot=(e,t)=>new Error(`${t?"Upper":"Lower"} projection X coordinate (${e}) is outside valid range (0-100)`),st=(e,t,r)=>new Error(`${r?"Upper":"Lower"} projection Y coordinate (${e}) is outside chart area (0-${t})`),ct=(e,t)=>{if(!t)return e;const r=t<0,a=e*Math.abs(t)/100;return r?e-a:e+a},dt=(e,t,r)=>{if(!r)return e;const a=r<0,n=(0===e?t:e)*Math.abs(r)/100;return a?e+n:e-n},lt=({curved:e,lineProjection:t,points:r,svgHeight:a})=>{const{addError:n}=l.useContext(at),{lower:i,shapeColor:o,upper:s}=t,{xProjection:c,yProjection:u,...h}=s||{},{xProjection:p,yProjection:x,...f}=i||{},R=c||u?{x:c,y:u}:void 0,_=p||x?{x:p,y:x}:void 0,g=R?.y,A=_?.y,E=R?.x,T=_?.x;l.useEffect(()=>{if(R&&_){const e=g||0,t=A||0;e>=t&&n?.("LINE_CHART_PROJECTION_ERROR",{error:it(e,t)})}R&&(void 0!==E&&(E<0||E>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ot(E,!0)}),void 0!==g&&(g<0||g>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(g,a,!0)})),_&&(void 0!==T&&(T<0||T>100)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:ot(T,!1)}),void 0!==A&&(A<0||A>a)&&n?.("LINE_CHART_PROJECTION_ERROR",{error:st(A,a,!1)}))},[_,T,A,a,R,E,g]);const{downPath:v,shapePath:y,upPath:m}=(({curved:e,lowerProjection:t,points:r,svgHeight:a,upperProjection:n})=>{const i=n||t;if(0===r.length&&!i)return{shapePath:""};const[o,...s]=r,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],p=[];s.forEach(([e,r])=>{const i=n?[ct(e,n.x),dt(r,a,n.y)]:[e,r],o=t?[ct(e,-(t.x??0)),dt(r,a,-(t.y??0))]:[e,r];h.push(i),p.push(o)});const x=n&&t?[...h,s.at(-1),...p.reverse(),o]:[...h,...p.reverse(),o];return e?(d+=x.reduce((e,t,r)=>{const a=0===r?o:x[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""),l&&(l+=h.reduce((e,t,r)=>{const a=0===r?o:h[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},"")),u&&(u+=p.reverse().reduce((e,t,r)=>{const a=0===r?o:p[r-1],[n,i]=a,[s,c]=t,d=.3*(s-n),l=[n+d,i],u=[s-d,c];return`${e} C ${l[0]} ${l[1]}, ${u[0]} ${u[1]}, ${s} ${c}`},""))):(d+=x.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=p.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:_,points:r,svgHeight:a,upperProjection:R});return d.jsxs("g",{className:"pointer-events-none",children:[d.jsx("path",{d:y,fill:o,stroke:"transparent",strokeWidth:"0.1"}),";",m&&d.jsx("path",{d:m,...h}),v&&d.jsx("path",{d:v,...f})]})},ut=(e,t)=>e.map(e=>e[t]),ht={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},pt=({ariaLabel:e,position:t=y.BOTTOM,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...u}=l.useContext(at),h=Ke(t,o.y1,Number(a?.fontSize),a?.top??0),p=u.extraSpaceTopY,x=Number(u.canvasHeight)-u.extraSpaceBottomY,f=a?ht.formatTicksValues(s,n):void 0,R=xe(i),_=e||i["aria-label"],g={...i,...R,..._&&{"aria-label":_}};return d.jsx(We,{...o,...g,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}xAxis`,extraSpace:{left:u.extraSpaceLeftX,right:u.extraSpaceRightX},tickLine:{...r,y1:p,y2:x},tickText:{...a,y:h},tickValues:f})},xt=({ariaLabel:e,position:t=y.LEFT,tickLine:r,tickText:a,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...u}=l.useContext(at),h=a?.textAnchor||"middle",p=(t===y.RIGHT?a?.right:a?.left)??0,x=ze(h,u.yAxisText,p),f=Ye(t,o.x1,x),R=a?ht.formatTicksValues(s,n):void 0,_=xe(i),g=e||i["aria-label"],A={...i,..._,...g&&{"aria-label":g}};return d.jsx(Ge,{...o,...A,canvasHeight:Number(u.canvasHeight),canvasWidth:Number(u.canvasWidth),cursor:c,dataTestId:`${u.dataTestId}yAxis`,tickLine:{...r,x1:u.extraSpaceLeftX,x2:Number(u.canvasWidth)-u.extraSpaceRightX},tickText:{...a,x:f},tickValues:R})},ft={[R]:R,[_]:_},Rt="WIDTH",_t=/^(\d+(\.\d+)?)(px|rem|%)?$/,gt=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(_t);if(!t)throw new Error(`Invalid string format: "${e}"`);const r=parseFloat(t[1]),a=t[3];return{unit:ft[a],value:r}},At=(e,t,r)=>{const a=r.parentElement;return a?e/100*(t===Rt?a.clientWidth:a.clientHeight):0},Et=e=>{const t=Pe();if(!t)return 16*e;const r=(e=>{const t=we()?window:void 0;if(t)return t.getComputedStyle(e)})(t.documentElement);return r?e*(parseFloat(r.fontSize)||16):16*e},Tt=({canvasHeight:e,canvasWidth:t,svgElement:r})=>{const{unit:a,value:n}=gt(t),i=a===R?At(n,Rt,r):a===_?Et(n):n,{unit:o,value:s}=gt(e);return{parsedCanvasHeight:o===R?At(s,"HEIGHT",r):o===_?Et(s):s,parsedCanvasWidth:i}},vt=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:r=0,step:a}=e.numeric;if(a>=Math.abs(t-r)||a<=0)return[r.toString(),t.toString()];const n=[];for(let e=r;e<=t;e+=a)n.push(e.toString());return n}},yt=(e,t)=>e.flatMap(e=>Object.keys(e).filter(r=>r!==t&&"number"==typeof e[r]).map(t=>e[t])),mt=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??0,h=u*a,p=d?vt(d):t.map(e=>e[r]),x=l?p.map(l):p,f=De({bound:"width",data:x,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),R=s===y.TOP;return{extraSpaceBottomY:s===y.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:R?h+(c?.bottom??0):0,lineChartXPosition:s||y.BOTTOM,securityXSpace:f,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:p}},Ct=(e,t,r,a,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??"0",h=u*a,p=d||He([...new Set(yt(t,r))]),x=vt(p),f=l?x.map(l):x,R=De({bound:"width",data:f,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),_=h,g=s===y.RIGHT;return{extraSpaceLeftX:s===y.LEFT?R+(c?.right??0):0,extraSpaceRightX:g?R+(c?.left??0):0,lineChartYPosition:s||y.LEFT,securityYSpace:_,yAxisText:R,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:x}},St=({addError:e,ajustedX:t,ajustedY:r,canvasHeight:a,canvasWidth:n,children:i,data:o,viewBox:s,xKey:c})=>{let d;if(!o||0===o.length){const t={error:Q(M)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(o&&1===o.length){const t={error:Q(Y)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(n<=0||a<=0){const t={error:te(n,a)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}const u=o&&o.length>0?o:[{[c]:"0",y:0},{[c]:"1",y:1}],h=n>0?n:100,p=a>0?a:100,{extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:_,lineChartXPosition:g,lineChartYPosition:A,securityXSpace:E,securityYSpace:T,xAxisText:m,xBreakAxis:C,xData:S,yAxisText:I,yBreakAxis:N,yData:$}=(({ajustedX:e,ajustedY:t,canvasHeight:r,canvasWidth:a,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:y.BOTTOM,lineChartYPosition:y.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return l.Children.forEach(n,n=>{l.isValidElement(n)&&(n.type===pt?c={...c,...mt(n,i,s,e,o,r,a)}:n.type===xt&&(c={...c,...Ct(n,i,s,t,o,r,a)}))}),c})({ajustedX:t,ajustedY:r,canvasHeight:p,canvasWidth:h,children:i,data:u,viewBox:s,xKey:c}),L=g!==y.TOP&&g!==y.BOTTOM,b=de({initPos:f,maxSpaceAvailable:h,otherAxisSpace:f+R,securitySpace:E,tickValues:S});if((b??[]).some(({position:e})=>isNaN(e))){const t={error:Q(D)};e?.("LINE_CHART_CONTEXT_ERROR",t),d=t}if(b){const t=b.length<2,r=b.length>=2&&1===new Set(b.map(e=>e.value)).size;if(t){const t={error:Q(U)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:Q(K)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}}const k=A!==y.LEFT&&A!==y.RIGHT,O=le({initPos:p-x,maxSpaceAvailable:p,otherAxisSpace:_+x,securitySpace:T,tickValues:$});if(O){const t=O.length<2,r=O.length>=2&&1===new Set(O.map(e=>e.value)).size;if(t){const t={error:Q(Z)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}if(r){const t={error:Q(z)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}}const H=L?ce(O||[],[String(C)])[0]:0,w=k?ce(b||[],[String(N)])[0]:0,P=oe({canvasHeight:p,canvasWidth:h,customBreakAxis:Number(H),extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:_,position:g}),j=se({canvasHeight:p,canvasWidth:h,customBreakAxis:Number(w),extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:_,position:A});if(P.x1===P.x2){const t={error:Q(G)};e?.("LINE_CHART_X_AXIS_ERROR",t),d||(d=t)}if(j.y1===j.y2){const t={error:Q(q)};e?.("LINE_CHART_Y_AXIS_ERROR",t),d||(d=t)}const B={addError:e,crossXAxis:L,crossYAxis:k,extraSpaceBottomY:x,extraSpaceLeftX:f,extraSpaceRightX:R,extraSpaceTopY:_,securityXSpace:E,securityYSpace:T,xAxisCoordinates:{coordinates:P,tickValues:b||(d?[{position:0,value:"0"},{position:h,value:"1"}]:[])},xAxisText:m,yAxisCoordinates:{coordinates:j,tickValues:O||(d?[{position:p,value:ue},{position:0,value:he}]:[])},yAxisText:I};return d?{...B,error:{...d,type:v.LINE_CHART_CONTEXT_ERROR}}:B},It=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:R="100%",onErrors:_,role:g,tabIndex:E,width:T="100%",xKey:v,...y})=>{const{extraSpace:m,height:C,width:S}=r,[I,N]=l.useState(""),[$,L]=l.useState({height:0,width:0}),b=m?A(m):void 0,k=h($.width,$.height,b),O=[d.jsx(pt,{},"default-x-axis"),d.jsx(xt,{},"default-y-axis")],H=l.Children.toArray(n)||[],w=O.concat(H),P=Math.max($.width,$.height,b??0),j=isNaN($.width/P)?0:$.width/P,D=isNaN($.height/P)?0:$.height/P;(({attrName:e,children:t,originalValue:r,updateValue:a})=>{let n="";l.Children.toArray(t).forEach(t=>{if(l.isValidElement(t)){const r=t.props[e];r&&(n+=r)}}),n!==r&&a(n)})({attrName:"dataKey",children:w,originalValue:I,updateValue:N});const B=l.useMemo(()=>x(_),[_]),M=f(o),X=l.useMemo(()=>(B.clearErrors(),St({addError:(e,t)=>{B.addError(e,t)},ajustedX:j,ajustedY:D,canvasHeight:$.height,canvasWidth:$.width,children:w,data:o,viewBox:k,xKey:v})),[$.width,$.height,M,v,I,B.addError]),{svgRef:F,xCursor:V,yCursor:W}=(({canvasHeight:e,canvasWidth:t})=>{const[[r,a],n]=l.useState([Re,Re]),i=l.useCallback((r,a)=>{const{height:i,left:o,top:s,width:c}=a.getBoundingClientRect(),d=r.clientX-o,l=r.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:l.useCallback(e=>{e&&(e.addEventListener("touchstart",o),e.addEventListener("touchmove",t=>i(t.touches[0],e)),e.addEventListener("mousemove",t=>i(t,e))),e?.removeEventListener("touchstart",o),e?.removeEventListener("touchmove",t=>i(t.touches[0],e)),e?.removeEventListener("mousemove",t=>i(t,e))},[e,t]),xCursor:r,yCursor:a}})({canvasHeight:$.height,canvasWidth:$.width});return l.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:r}=Tt({canvasHeight:C,canvasWidth:S,svgElement:e});L({height:t,width:r})},[S,C]),l.useEffect(()=>{c?.({x1:X.extraSpaceLeftX,x2:$.width-X.extraSpaceRightX,y1:X.extraSpaceTopY,y2:$.height-X.extraSpaceBottomY})},[$.width,$.height]),d.jsx(u,{ref:F,ariaHidden:e,ariaLabel:t,caption:a,className:i,"data-kbt-svg":!0,dataTestId:s,height:R,role:g,tabIndex:E,viewBox:k,width:T,...y,children:d.jsx(at.Provider,{value:{...X,canvasExtraSpace:b,canvasHeight:$.height,canvasWidth:$.width,data:o,dataTestId:s,xCursor:V,xKey:v,yCursor:W},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:r,getNodeFocusInfo:a,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{addError:u,xAxisCoordinates:h,yAxisCoordinates:p,...x}=l.useContext(at),f=c.dataKey,R=x.data.length>0,_=x.data[0],g=!!_&&Object.prototype.hasOwnProperty.call(_,f),A=x.data.length;l.useEffect(()=>{if(!f||"string"!=typeof f)return void u?.("LINE_CHART_PATH_ERROR",{error:Q(V)});if(R&&!g)return void u?.("LINE_CHART_PATH_ERROR",{error:ee(f)});if(r&&A<2)return void u?.("LINE_CHART_PATH_ERROR",{error:Q(F)});const e=ut(x.data,f);e.length>0&&e.every(e=>null==e)&&u?.("LINE_CHART_PATH_ERROR",{error:Q(X)})},[u,r,f,A,R,g,x.data]);const{indicatorRef:E,pathRef:T}=((e,t)=>{const r=l.useRef(null),a=l.useRef(null);return l.useEffect(()=>{if(!t||!r.current||!a.current)return;const n=r.current,i=a.current;let o,s,c=0,d=n.getTotalLength();for(;d-c>.01;)o=(c+d)/2,s=n.getPointAtLength(o),s.x<e?c=o:d=o;const l=n.getPointAtLength(d);i.setAttribute("transform",`translate(${l.x}, ${l.y})`),i.setAttribute("pointer-events","none")},[e]),{indicatorRef:a,pathRef:r}})(x.xCursor,!!i),v=!!i&&x.xCursor!==-1/0,y=l.useRef(null),m=l.useRef(null),{autoClick:C,lineIndicator:S,...I}=i||{},N=x.extraSpaceTopY,$=Number(x.canvasHeight)-x.extraSpaceBottomY,{tickValues:L}=h,{tickValues:b}=p,k=ut(x.data,x.xKey),O=ut(x.data,f),H=ce(L,k,!0),w=ce(b,O),P=H.map((e,t)=>[e,w[t]]),j=nt({curved:r,extendToBottom:!1,points:P,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),D=nt({curved:r,extendToBottom:!!c.fill||!!c.gradient,points:P,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY});l.useEffect(()=>{if(!y.current?.path)return;T.current=y.current.path;const e=y.current.main,t=y.current.node,r=k.map((e,t)=>({x:e,y:O[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:r,ref:a})=>{let n,i=!1;const o=a.querySelector("[data-draw]"),s=a=>{i&&("ArrowRight"===a.key?(n=void 0===n||n===r.length-1?0:n+1,r[n].focus(),t?.(e[n])):"ArrowLeft"===a.key&&(n=void 0===n||0===n?r.length-1:n-1,r[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},l=()=>{n=void 0};return{mount:()=>{a.addEventListener("focusin",c),a.addEventListener("focusout",d),o?.addEventListener("focus",l),window.addEventListener("keydown",e=>s(e))},unmount:()=>{a.removeEventListener("focusin",c),a.removeEventListener("focusout",d),o?.removeEventListener("focus",l),window.removeEventListener("keydown",e=>s(e))}}})({data:r,getNodeFocusInfo:a,nodes:t,ref:e});return n(),()=>i()},[]),l.useEffect(()=>{if(c.nodeConfig&&v&&C){const{idx:e,match:t}=((e,t)=>{let r=0,a=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){a=!0,r=n;break}return{idx:r,match:a}})(H,x.xCursor);if(t&&e!==m.current){m.current=e;const t=new MouseEvent("click",{bubbles:!0});t.autoClick=!0,y.current?.node?.[e]?.dispatchEvent(t),navigator?.vibrate?.(200)}else m.current=null}},[x.xCursor]),l.useEffect(()=>{n?.(P)},[P]);const B=xe(c),M={...c,...B,...e&&{"aria-label":e}};return d.jsxs(d.Fragment,{children:[d.jsx($e,{ref:y,d:j,dFill:D,dataTestId:`${x.dataTestId}path`,dataValue:x.data,points:P,xKey:x.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let r=0,a=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<a&&(r=n,a=i)}return r})(H,x.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,y.current?.node?.[e]?.dispatchEvent(t)}},...M}),o&&d.jsx(lt,{curved:r,dataKey:c.dataKey,lineProjection:o,points:P,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),v&&d.jsxs(d.Fragment,{children:[!!S&&d.jsx(Be,{...S,className:"pointer-events-none",x1:x.xCursor,x2:x.xCursor,y1:N,y2:$}),d.jsx("g",{ref:E,className:"pointer-events-none",children:d.jsx(Ie,{...I})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:r,topSeparator:a,xBreakAxis:n,yBreakAxis:i})=>{const{addError:o,crossXAxis:s,crossYAxis:c,xAxisCoordinates:u,yAxisCoordinates:h}=l.useContext(at),p=u.tickValues,x=h.tickValues,f=void 0!==n?"string"==typeof n?parseFloat(n):n:void 0,R=void 0!==i?"string"==typeof i?parseFloat(i):i:void 0;if(l.useEffect(()=>{if(void 0!==n){const e=p.map(e=>e.value);if(void 0===f||isNaN(f))o?.("LINE_CHART_SEPARATOR_ERROR",{error:re(n)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(f<t||f>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ne(f,t,r)})}}if(void 0!==i){const e=x.map(e=>e.value);if(void 0===R||isNaN(R))o?.("LINE_CHART_SEPARATOR_ERROR",{error:ae(i)});else{const t=Math.min(...e.map(e=>"string"==typeof e?parseFloat(e):e)),r=Math.max(...e.map(e=>"string"==typeof e?parseFloat(e):e));(R<t||R>r)&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:ie(R,t,r)})}}},[n,f,p,i,R,x]),!a&&!r&&!e)return d.jsx(d.Fragment,{});const _=n&&ce(u.tickValues,[n],!0)[0],g=i&&ce(h.tickValues,[i])[0],A=c?h.coordinates.x1:u.coordinates.x2,E=s?u.coordinates.y1:h.coordinates.y1,T=u.coordinates.x1,v=_??A,y=h.coordinates.y2,m=g??E;l.useEffect(()=>{T===v&&y===m&&o?.("LINE_CHART_SEPARATOR_ERROR",{error:Q(W)})},[T,v,y,m]);const C=`M${T} ${y} H ${v} V ${m} H ${T} Z`,S=`M${T} ${m} H ${v}`,I=`M${v} ${y} V ${m}`;return d.jsxs("g",{children:[d.jsx("path",{d:C,"data-testid":`${t}Area`,...e}),d.jsx("path",{d:S,"data-testid":`${t}Top`,...a}),d.jsx("path",{d:I,"data-testid":`${t}Right`,...r})]})},XAxis:pt,YAxis:xt}),Nt=({children:e,dataTestId:t,height:r,width:a,x:n,y:i})=>d.jsx("foreignObject",{"data-testid":t,height:r,width:a,x:n,y:i,children:e}),$t=l.createContext({}),Lt=(e,t,r)=>({x:e.x+t*Math.cos(r),y:e.y+t*Math.sin(r)}),bt=({center:e,innerEnd:t,innerRadius:r,singleStroke:a})=>{if(!a)return r>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},kt="CLOCKWISE",Ot=({canvasHeight:e,canvasWidth:t,color:r="blue",dataKey:a,gap:n,halfChart:i,index:o,innerRadius:s,name:c,radius:u,singleStroke:h,startAngle:p,total:x,value:f,...R})=>{const{addError:_}=l.useContext($t),g=Number(f),A=void 0!==u?Number(u):void 0,E=void 0!==s?Number(s):void 0,T=c?.trim()||"";l.useEffect(()=>{T||_?.("PIE_CHART_SEGMENT_ERROR",{error:H(a||"unknown",o||0,"name")}),isNaN(g)?_?.("PIE_CHART_SEGMENT_ERROR",{error:$(f,T||`segment-${o}`)}):(g<0&&_?.("PIE_CHART_SEGMENT_ERROR",{error:L(g,T||`segment-${o}`)}),void 0!==A&&(isNaN(A)||A<=0)&&_?.("PIE_CHART_SEGMENT_ERROR",{error:w(u)}),void 0!==E&&((isNaN(E)||E<0)&&_?.("PIE_CHART_SEGMENT_ERROR",{error:P(s)}),void 0!==A&&(isNaN(A)||isNaN(E)||E>=A&&_?.("PIE_CHART_SEGMENT_ERROR",{error:j(E,A)}))))},[a,o,E,A,g,T]);const v=(({canvasHeight:e,canvasWidth:t,customRadius:r,gap:a,halfChart:n,innerRadius:i,rotateDirection:o,singleStroke:s,startAngle:c,total:d,value:l})=>{const u=n?2*e:e,h=Math.min(t,u)/2,p=r&&r<h?r:h,x=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},R=s?2*d:d,_=100*l/R*x/100,g=a/p,{carryAngle:A,finalAngle:E,initialAngle:T}=(({angleEquivalent:e,direction:t,gapAngle:r,startAngle:a})=>{const n=t===kt;return{carryAngle:n?a+e:a-e,finalAngle:n?a+e-r/2:a-e+r/2,initialAngle:n?a+r/2:a-r/2}})({angleEquivalent:_,direction:o,gapAngle:g,startAngle:c.current});c.current=A;const v=x*l/R-g<=Math.PI?"0":"1",y=Lt(f,i,T),m=Lt(f,i,E),C=Lt(f,p,T);return(({center:e,innerEnd:t,innerRadius:r,innerStart:a,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,p,x,f,R,_,g,A;return c===kt?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=bt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),p=d?`M ${t.x},${t.y}`:void 0,x=r>0?`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,_=`M ${t.x},${t.y}`,R=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,g=`A ${r},${r} 0 ${n} 1 ${a.x},${a.y}`,A=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=bt({center:e,innerEnd:t,innerRadius:r,singleStroke:d}),p=d?`M ${t.x},${t.y}`:void 0,x=r>0?`A ${r}, ${r} 0 ${n},1 ${a.x},${a.y}`:void 0,f=`M ${o.x},${o.y}`,_=`M ${t.x},${t.y}`,R=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,g=`A ${r},${r} 0 ${n} 0 ${a.x},${a.y}`,A=d?void 0:"Z"),[l,u,h,p,x,A].concat(d?[f,R,_,g]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:m,innerRadius:i,innerStart:y,largeArcFlag:v,outerEnd:Lt(f,p,E),outerStart:C,radius:p,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:u,gap:n,halfChart:i,innerRadius:s,singleStroke:h,startAngle:p,total:x,value:f});return d.jsx($e,{...R,d:v,dataValue:f,fill:r})},Ht=({dataKey:e,fill:t,gap:r,innerRadius:a,radius:n,...i})=>{const o=String(e),{addError:s,canvasHeight:c,canvasWidth:u,data:h,dataTestId:p,halfChart:x}=l.useContext($t),f=x?0:-Math.PI/2,R=l.useRef(f),_=h[o],g=Object.prototype.hasOwnProperty.call(h,o);l.useEffect(()=>{if(!g)return void s?.("PIE_CHART_PATH_ERROR",{error:b(o)});if(!_||0===_.length)return void s?.("PIE_CHART_PATH_ERROR",{error:k(o)});const e=_.reduce((e,t)=>e+t.value,0);(e<=0||isNaN(e))&&s?.("PIE_CHART_PATH_ERROR",{error:O(o,e)})},[_,g,o]);const E=h[o]?.reduce((e,t)=>e+t.value,0),T=1===h[o]?.length,v=a?A(a):void 0,y=n?A(n):void 0;return h[o]?.length?d.jsx("g",{children:h[o].map((e,a)=>l.createElement(Ot,{...i,...e,key:`${a.toString()}`,canvasHeight:c,canvasWidth:u,color:e.color||t,dataKey:o,dataTestId:`${p}path-${a}`,gap:r,halfChart:x,index:a,innerRadius:v,radius:y,singleStroke:T,startAngle:R,total:E}))}):d.jsx(d.Fragment,{})},wt=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:r=p,caption:a,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:R="100%",onErrors:_,radius:g="50%",role:E,tabIndex:T,width:v="100%",...y})=>{const{extraSpace:m,height:C,width:S}=r,I=A(S),N=A(C),$=m?A(m):void 0,L=h(I,N,$),b=l.useMemo(()=>x(_),[_]),k=f(o),O=l.useMemo(()=>(b.clearErrors(),(({addError:e,canvasHeight:t,canvasWidth:r,children:a,halfChart:n})=>{(r<=0||t<=0)&&e?.("PIE_CHART_CONTEXT_ERROR",{error:te(r,t)});const i=r>0?r:100,o=t>0?t:100;let s,c;l.Children.forEach(a,e=>{if(l.isValidElement(e)&&e.type===Ht){const{innerRadius:t}=e.props;if(!t)return;const r=A(t);(!s||r<s)&&(s=r)}}),s&&(c=2*s);const d=c??0,u=n?d/2:d,h=n?o:o/2;return{addError:e,foreignObject:{height:u,width:d,x:i/2-d/2,y:n?h-u:h-u/2}}})({addError:(e,t)=>{b.addError(e,t)},canvasHeight:N,canvasWidth:I,children:n,halfChart:c})),[C,S,c,k,b]);return d.jsx(u,{ariaHidden:e,ariaLabel:t,caption:a,className:i,dataTestId:s,height:R,radius:g,role:E,tabIndex:T,viewBox:L,width:v,...y,children:d.jsx($t.Provider,{value:{...O,canvasHeight:N,canvasWidth:I,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:r,width:a,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=l.useContext($t),u=!a&&c?.width?c.width:a,h=!r&&c?.height?c.height:r,p=!n&&c?.x?c.x:n,x=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return d.jsx(Nt,{...o,dataTestId:f,height:h,width:u,x:p,y:x,children:e})},Path:Ht}),Pt=({fill:e="#8f8f8f",x:t,y:r})=>d.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${r-5})`,children:[d.jsx("path",{d:"M4.99948 9.99802C4.47168 9.99802 4.04419 9.64335 4.04419 9.20547V0.79255C4.04419 0.354666 4.47168 0 4.99948 0C5.52728 0 5.95477 0.354666 5.95477 0.79255V9.20745C5.95477 9.64533 5.52728 10 4.99948 10V9.99802Z"}),d.jsx("path",{d:"M0.955289 8.78839C0.427492 8.78839 0 8.43372 0 7.99584V2.00416C0 1.56628 0.427492 1.21161 0.955289 1.21161C1.48309 1.21161 1.91058 1.56628 1.91058 2.00416V7.99584C1.91058 8.43372 1.48309 8.78839 0.955289 8.78839Z"}),d.jsx("path",{d:"M8.08936 7.99584C8.08936 8.43372 8.51685 8.78839 9.04464 8.78839C9.57244 8.78839 9.99993 8.43372 9.99993 7.99584V2.00416C9.99993 1.56628 9.57244 1.21161 9.04464 1.21161C8.51685 1.21161 8.08936 1.56628 8.08936 2.00416V7.99584Z"})]}),jt=({linesData:e})=>d.jsx(d.Fragment,{children:e.map((e,t)=>d.jsxs("g",{children:[e.config.fill&&e.fillPath&&d.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),d.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Dt={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0},Bt=({elementHeight:e,elementPosition:t,elementStrokeWidth:r=0,elementType:a,elementWidth:n,gap:i=0,innerStrokeWidth:o=2,outlineStrokeWidth:s=2})=>{if("circle"===a){const e=n/2+r/2+o/2+i,a=e+o/2+s/2;return{inner:{cx:t.x,cy:t.y,r:e},outer:{cx:t.x,cy:t.y,r:a},type:"circle"}}const c=n+r+o+2*i,d=e+r+o+2*i,l=c+o+s,u=d+o+s;return{inner:{height:d,width:c,x:t.x-c/2,y:t.y-d/2},outer:{height:u,width:l,x:t.x-l/2,y:t.y-u/2},type:"rectangle"}},Mt=(e,t,r)=>{const a=e.start/Math.max(1,t-1)*r;return{endX:e.end/Math.max(1,t-1)*r,startX:a}},Xt=(e,t,r)=>{const a=Math.max(0,Math.min(t,e))/t;return Math.round(a*(r-1))},Ft=(e,t,r=.1)=>{const a=Math.max(0,Math.min(e.start,t-1-r));return{end:Math.min(t-1,Math.max(e.end,a+r)),start:a}},Vt=e=>({end:Math.max(0,e-1),start:0}),Wt=(e,t)=>0===e.start&&e.end===t-1,Yt=({endX:e,focusConfig:t,height:r,isFocused:a,startX:n})=>{if(!a)return null;const i=e-n,o=Bt({elementHeight:r,elementPosition:{x:n+i/2,y:r/2},elementStrokeWidth:0,elementType:"rectangle",elementWidth:i,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth}),s=t.outlineColor,c=t.innerColor,l=t.outlineStrokeWidth,u=t.innerStrokeWidth;return"rectangle"!==o.type?null:d.jsxs("g",{pointerEvents:"none",children:[d.jsx("rect",{fill:"none",height:o.outer.height,stroke:s,strokeWidth:l,width:o.outer.width,x:o.outer.x,y:o.outer.y}),d.jsx("rect",{fill:"none",height:o.inner.height,stroke:c,strokeWidth:u,width:o.inner.width,x:o.inner.x,y:o.inner.y})]})},Kt=({currentRange:e,dataLength:t,dataTestId:r,endX:a,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l,screenReaderText:u,selectionConfig:h,startX:p})=>{const x=h.hideOverlayOnFullRange&&Wt(e,t);return d.jsx(d.Fragment,{children:d.jsx("rect",{"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":r,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:x?"hidden":"visible"},tabIndex:0,width:a-p,x:p,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:l})})},Ut="#8f8f8f",Gt=({dataTestId:e,focusConfig:t,handlerConfig:r,height:a,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h,screenReaderText:p,x:x})=>{const f=a/2,R=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||Ut,radius:e?.radius||17,stroke:e?.stroke||Ut,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||Ut,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(r),_=Bt({elementHeight:2*R.radius,elementPosition:{x:x,y:f},elementStrokeWidth:"number"==typeof R.strokeWidth?R.strokeWidth:parseFloat(R.strokeWidth.toString()),elementType:"circle",elementWidth:2*R.radius,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return d.jsxs("g",{"data-testid":`${e}-group`,children:[d.jsx("line",{pointerEvents:"none",stroke:R.verticalLineStroke,strokeWidth:R.verticalLineStrokeWidth,x1:x,x2:x,y1:0,y2:a}),d.jsx("circle",{"aria-label":p,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":p,cursor:"ew-resize",cx:x,cy:f,"data-testid":e,fill:R.fill,r:R.radius,role:"slider",stroke:R.stroke,strokeWidth:R.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:l,onMouseDown:u,onTouchStart:h}),d.jsx(Pt,{fill:R.iconColor,x:x,y:f}),n&&"circle"===_.type&&d.jsxs("g",{pointerEvents:"none",children:[d.jsx("circle",{cx:_.outer.cx,cy:_.outer.cy,fill:"none",r:_.outer.r,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth}),d.jsx("circle",{cx:_.inner.cx,cy:_.inner.cy,fill:"none",r:_.inner.r,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth})]})]})},zt={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},Zt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n,width:i}=e,o=l.useRef(null),[s,c]=l.useState(null),d=l.useCallback(e=>()=>{c(e)},[]),u=l.useCallback(e=>()=>{c(e)},[]),h=l.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=Xt(d,i,r),u=((e,t,r,a,n)=>{const i={...t};if(e===zt.START_HANDLER)i.start=Math.max(0,Math.min(r,t.end-n.minHandlerDistance));else if(e===zt.END_HANDLER)i.end=Math.min(a-1,Math.max(r,t.start+n.minHandlerDistance));else if(e===zt.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(a-1-e,r-e/2));i.start=n,i.end=n+e}return i})(s,t,l,r,a),h=Ft(u,r,a.minHandlerDistance);n(h)},[s,i,r,t,n,a]),p=l.useCallback(e=>{h(e.clientX)},[h]),x=l.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),f=l.useCallback(()=>{c(null)},[]),R=l.useCallback(()=>{c(null)},[]);return l.useEffect(()=>{if(s)return document.addEventListener("mousemove",p),document.addEventListener("mouseup",f),document.addEventListener("touchmove",x,{passive:!1}),document.addEventListener("touchend",R),()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",x),document.removeEventListener("touchend",R)}},[s,p,f,x,R]),{groupRef:o,handleMouseDown:d,handleTouchStart:u,isDragging:s}},qt=e=>{const{currentRange:t,dataLength:r,interactionConfig:a,onRangeChange:n}=e;return{handleKeyDown:l.useCallback(e=>i=>{const o=i.shiftKey?a.keyboardFastStep:a.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===zt.START_HANDLER)n.start=Math.max(0,t.start-r);else if(e===zt.END_HANDLER)n.end=Math.max(t.start+a.minHandlerDistance,t.end-r);else if(e===zt.SELECTION_AREA){const e=t.end-t.start,a=Math.max(0,t.start-r);n.start=a,n.end=a+e}return n})(e,t,o,a);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,r,a,n)=>{const i={...t};if(e===zt.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+r);else if(e===zt.END_HANDLER)i.end=Math.min(a-1,t.end+r);else if(e===zt.SELECTION_AREA){const e=t.end-t.start,n=Math.min(a-1-e,t.start+r);i.start=n,i.end=n+e}return i})(e,t,o,r,a);break;case"Home":i.preventDefault(),s=((e,t,r)=>{const a={...t};if(e===zt.START_HANDLER)a.start=0;else if(e===zt.END_HANDLER)a.end=r-1;else if(e===zt.SELECTION_AREA){const e=t.end-t.start;a.start=0,a.end=e}return a})(e,t,r);break;case"End":i.preventDefault(),s=((e,t,r,a)=>{const n={...t};if(e===zt.START_HANDLER)n.start=t.end-a.minHandlerDistance;else if(e===zt.END_HANDLER)n.end=r-1;else if(e===zt.SELECTION_AREA){const e=t.end-t.start;n.start=r-1-e,n.end=r-1}return n})(e,t,r,a);break;default:return}const c=Ft(s,r,a.minHandlerDistance);n(c)},[t,r,n,a])}},Jt=({canvasConfig:e,dataTestId:t,extraSpace:r=0,height:a,width:n})=>{const[i,o]=l.useState({height:0,width:0}),s=l.useMemo(()=>e||{extraSpace:r,height:a,width:n},[e,n,a,r]),{extraSpace:c,height:d,width:u}=s,p=c?A(c):void 0;l.useEffect(()=>{if(!we())return;const e=(e=>{const t=Pe();return t?t.querySelector(e):null})(`[data-testid="${t}"]`);if(!e)return;const r=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:r}=Tt({canvasHeight:d,canvasWidth:u,svgElement:e});o({height:t,width:r})};r();const a=new ResizeObserver(()=>{r()});return a.observe(e),()=>{a.disconnect()}},[u,d,t]);const x=l.useMemo(()=>h(i.width,i.height,p),[i.width,i.height,p]);return{parsedCanvas:i,viewBox:x}},Qt=()=>{const[e,t]=l.useState(null),r=l.useCallback(e=>()=>t(e),[]);return{handleBlur:l.useCallback(()=>{t(null)},[]),handleFocus:r,isFocused:l.useCallback(t=>e===t,[e])}},er=(e,t)=>{const r=Math.floor(e);return Math.max(0,Math.min(t,r))},tr=(e,t)=>{const r=Math.ceil(e);return Math.max(0,Math.min(t,r))},rr=(e,t)=>{const r=Math.max(0,t-1);return{endIndex:tr(e.end,r),startIndex:er(e.start,r)}},ar=({data:e,initialRange:t,onDataChange:r})=>{const a=t||Vt(e.length),[n,i]=l.useState(a),o=t=>{if(!r||0===e.length)return;const{endIndex:a,startIndex:n}=rr(t,e.length),i=e.slice(n,a+1);r(i)};return l.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},nr=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),ir=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...r]=e;let a=`M ${t[0]} ${t[1]}`;return r.forEach((e,n)=>{const i=0===n?t:r[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];a+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),a},or=(e,t,r,a)=>{if(0===e.length||0===t.length)return[];const n=.05*a,i=a-2*n,o=t.flatMap(t=>e.map(e=>Number(e[t.yKey]))),s=Math.min(...o),c=Math.max(...o)-s||1;return t.map(t=>{const o=e.map((a,o)=>[o/Math.max(1,e.length-1)*r,n+i-(Number(a[t.yKey])-s)/c*i]),d=t.curved?ir(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${ir(o)} L ${r} ${a} L 0 ${a} Z`:`${d} L ${r},${a} L 0,${a} Z`),{config:t,fillPath:l,linePath:d}})},sr=(e,t,r)=>e[r]?.[t]?.toString()||`${r}`,cr=(e,t,r)=>{if(!e)return e;const a=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(a,t).replace(n,r)};exports.Bar=be,exports.BarChart=rt,exports.BarOrientation=T,exports.ChartText=Me,exports.DefaultCanvasConfig=p,exports.ErrorType=v,exports.FOCUS_DEFAULT=Dt,exports.ForeignObject=Nt,exports.HandlerIcon=Pt,exports.Line=Be,exports.LineChart=It,exports.LineRenderer=jt,exports.Node=Ie,exports.NodeType=Ce,exports.Path=$e,exports.PieChart=wt,exports.Positions=y,exports.SelectionArea=Kt,exports.SelectionAreaFocusRing=Yt,exports.SvgContainer=u,exports.Tick=Xe,exports.TickDataUtils=ht,exports.XAxis=We,exports.YAxis=Ge,exports.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:r,canvasConfig:a,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:h="40px",initialRange:p,interactionConfig:x,lines:R,onDataChange:_,role:g,screenReaderTextConfig:A,selectionConfig:E,width:T="100%",xKey:v,...y})=>{const m="zoom-area",C=nr(x),S=(I=E,{fill:I?.fill??"#0078d4",fillOpacity:I?.fillOpacity??.5,hideOverlayOnFullRange:I?.hideOverlayOnFullRange??true,stroke:I?.stroke??"#0078d4",strokeWidth:I?.strokeWidth??0});var I;const N=(e=>({gap:e?.gap??Dt.OUTLINES_GAP,innerColor:e?.innerColor??Dt.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??Dt.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??Dt.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??Dt.OUTER_FOCUS_STROKE_WIDTH}))(s),{currentRange:$,handleRangeChange:L}=ar({data:o,initialRange:p,onDataChange:_}),{parsedCanvas:b,viewBox:k}=Jt({canvasConfig:a,dataTestId:m,height:h,width:T}),O=f(o),H=JSON.stringify(R),w=((e,t,r,a)=>{const{endIndex:n,startIndex:i}=rr(r,e.length),o=sr(e,t,i),s=sr(e,t,n),c=cr(a?.startHandler,o,s)??o;return{endHandler:cr(a?.endHandler,o,s)??s,selectionArea:cr(a?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,v,$,A),P=l.useMemo(()=>or(o,R,b.width,b.height),[O,H,b.width,b.height]),{endX:j,startX:D}=l.useMemo(()=>Mt($,o.length,b.width),[$,O,b.width]),{handleBlur:B,handleFocus:M,isFocused:X}=Qt(),{handleKeyDown:F}=qt({currentRange:$,dataLength:o.length,interactionConfig:C,onRangeChange:L}),{groupRef:V,handleMouseDown:W,handleTouchStart:Y}=Zt({currentRange:$,dataLength:o.length,interactionConfig:C,onRangeChange:L,width:b.width});return d.jsxs(u,{ref:V,ariaHidden:e,ariaLabel:t,backgroundColor:r,caption:n,className:i,"data-testid":m,height:h,overflow:"visible",role:g,viewBox:k,width:T,...y,children:[d.jsx(jt,{linesData:P}),d.jsx(Kt,{currentRange:$,dataLength:o.length,dataTestId:`${m}-selection-area`,endX:j,height:b.height,screenReaderText:w.selectionArea,selectionConfig:S,startX:D,onBlur:B,onFocus:M(zt.SELECTION_AREA),onKeyDown:F(zt.SELECTION_AREA),onMouseDown:W(zt.SELECTION_AREA),onTouchStart:Y(zt.SELECTION_AREA)}),d.jsx(Gt,{dataTestId:`${m}-start-handler`,focusConfig:N,handlerConfig:c,height:b.height,isFocused:X(zt.START_HANDLER),max:$.end-C.minHandlerDistance,min:0,screenReaderText:w.startHandler,type:zt.START_HANDLER,value:$.start,x:D,onBlur:B,onFocus:M(zt.START_HANDLER),onKeyDown:F(zt.START_HANDLER),onMouseDown:W(zt.START_HANDLER),onTouchStart:Y(zt.START_HANDLER)}),d.jsx(Gt,{dataTestId:`${m}-end-handler`,focusConfig:N,handlerConfig:c,height:b.height,isFocused:X(zt.END_HANDLER),max:o.length-1,min:$.start+C.minHandlerDistance,screenReaderText:w.endHandler,type:zt.END_HANDLER,value:$.end,x:j,onBlur:B,onFocus:M(zt.END_HANDLER),onKeyDown:F(zt.END_HANDLER),onMouseDown:W(zt.END_HANDLER),onTouchStart:Y(zt.END_HANDLER)}),d.jsx(Yt,{endX:j,focusConfig:N,height:b.height,isFocused:X(zt.SELECTION_AREA),startX:D})]})},exports.ZoomAreaElements=zt,exports.ZoomHandler=Gt,exports.calculateHandlerPositions=Mt,exports.calculateLinesPathData=or,exports.clampRange=Ft,exports.createDefaultRange=Vt,exports.generateCurvedPath=ir,exports.getInteractionConfig=nr,exports.isFullRange=Wt,exports.mouseToDataIndex=Xt,exports.normalizeToArray=e=>Array.isArray(e)?e:[e],exports.useDragInteraction=Zt,exports.useKeyboardNavigation=qt,exports.useResponsiveCanvas=Jt,exports.useZoomAreaFocus=Qt,exports.useZoomData=ar;