@kubit-ui-web/react-charts 0.1.0 → 1.1.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.
- package/README.md +31 -36
- package/dist/cjs/charts/barChart/barChart.js +12 -29
- package/dist/cjs/charts/barChart/barChart.type.js +1 -2
- package/dist/cjs/charts/barChart/barChartStructure.js +25 -29
- package/dist/cjs/charts/barChart/context/barChartContext.js +2 -5
- package/dist/cjs/charts/barChart/context/buildBarContextValues.js +17 -21
- package/dist/cjs/charts/barChart/fragments/barChartPath.js +12 -16
- package/dist/cjs/charts/barChart/fragments/barChartSeparator.js +10 -14
- package/dist/cjs/charts/barChart/fragments/barChartXAxis.js +10 -14
- package/dist/cjs/charts/barChart/fragments/barChartYAxis.js +13 -17
- package/dist/cjs/charts/barChart/fragments/fixture/barContextData.js +3 -6
- package/dist/cjs/charts/barChart/fragments/fixture/index.js +1 -5
- package/dist/cjs/charts/barChart/index.js +1 -17
- package/dist/cjs/charts/barChart/utils/countBarChildren.js +5 -9
- package/dist/cjs/charts/barChart/utils/getAxisExtraSpacing.js +31 -35
- package/dist/cjs/charts/barChart/utils/getBarDataValue.js +1 -5
- package/dist/cjs/charts/barChart/utils/getRoundedBarMaxValue.js +1 -5
- package/dist/cjs/charts/index.js +3 -19
- package/dist/cjs/charts/lineChart/context/buildLineContextValue.js +17 -21
- package/dist/cjs/charts/lineChart/context/index.js +2 -7
- package/dist/cjs/charts/lineChart/context/lineChartContext.js +2 -5
- package/dist/cjs/charts/lineChart/fragments/fixture/contextData.js +1 -4
- package/dist/cjs/charts/lineChart/fragments/fixture/index.js +1 -5
- package/dist/cjs/charts/lineChart/fragments/index.js +4 -11
- package/dist/cjs/charts/lineChart/fragments/lineChartPath.js +31 -35
- package/dist/cjs/charts/lineChart/fragments/lineChartProjection.js +6 -10
- package/dist/cjs/charts/lineChart/fragments/lineChartSeparator.js +10 -14
- package/dist/cjs/charts/lineChart/fragments/lineChartXAxis.js +14 -18
- package/dist/cjs/charts/lineChart/fragments/lineChartYAxis.js +17 -21
- package/dist/cjs/charts/lineChart/hook/index.js +3 -9
- package/dist/cjs/charts/lineChart/hook/useAutoClick.js +6 -10
- package/dist/cjs/charts/lineChart/hook/useHover.js +5 -9
- package/dist/cjs/charts/lineChart/hook/useIndicator.js +5 -9
- package/dist/cjs/charts/lineChart/index.js +1 -17
- package/dist/cjs/charts/lineChart/lineChart.js +12 -29
- package/dist/cjs/charts/lineChart/lineChart.type.js +1 -2
- package/dist/cjs/charts/lineChart/lineChartStructure.js +34 -38
- package/dist/cjs/charts/lineChart/utils/accessibilityTemplateProcessor.js +6 -10
- package/dist/cjs/charts/lineChart/utils/findSurroundingNumber.js +2 -7
- package/dist/cjs/charts/lineChart/utils/getDataValues.js +1 -5
- package/dist/cjs/charts/lineChart/utils/getExtraSpacing.js +26 -30
- package/dist/cjs/charts/lineChart/utils/getPathData.js +1 -5
- package/dist/cjs/charts/lineChart/utils/getProjection.js +1 -5
- package/dist/cjs/charts/lineChart/utils/getRoundedMaxValue.js +2 -7
- package/dist/cjs/charts/lineChart/utils/handleNodesFocus.js +1 -5
- package/dist/cjs/charts/lineChart/utils/index.js +6 -17
- package/dist/cjs/charts/pieChart/context/buildPieContextValue.js +8 -12
- package/dist/cjs/charts/pieChart/context/index.js +2 -7
- package/dist/cjs/charts/pieChart/context/pieChartContext.js +2 -5
- package/dist/cjs/charts/pieChart/fragments/index.js +2 -7
- package/dist/cjs/charts/pieChart/fragments/pieChartForeign.js +7 -11
- package/dist/cjs/charts/pieChart/fragments/pieChartPath.js +12 -16
- package/dist/cjs/charts/pieChart/fragments/pieChartSegment.js +6 -10
- package/dist/cjs/charts/pieChart/index.js +1 -17
- package/dist/cjs/charts/pieChart/pieChart.js +8 -25
- package/dist/cjs/charts/pieChart/pieChart.type.js +1 -2
- package/dist/cjs/charts/pieChart/pieChartStructure.js +16 -20
- package/dist/cjs/charts/pieChart/utils/buildL.js +1 -5
- package/dist/cjs/charts/pieChart/utils/calculatePoint.js +1 -5
- package/dist/cjs/charts/pieChart/utils/calculateSegmentPath.js +10 -14
- package/dist/cjs/charts/pieChart/utils/drawSegmentPath.js +6 -10
- package/dist/cjs/charts/pieChart/utils/index.js +2 -7
- package/dist/cjs/charts/pieChart/utils/rotationDirection.js +3 -7
- package/dist/cjs/components/axisChart/index.js +2 -18
- package/dist/cjs/components/axisChart/utils/filterLineProps/filterLineProps.js +1 -5
- package/dist/cjs/components/axisChart/utils/index.js +1 -17
- package/dist/cjs/components/axisChart/xAxis/index.js +2 -18
- package/dist/cjs/components/axisChart/xAxis/xAxis.js +14 -18
- package/dist/cjs/components/axisChart/xAxis/xAxis.types.js +1 -2
- package/dist/cjs/components/axisChart/yAxis/index.js +2 -18
- package/dist/cjs/components/axisChart/yAxis/yAxis.js +13 -17
- package/dist/cjs/components/axisChart/yAxis/yAxis.types.js +1 -2
- package/dist/cjs/components/bar/bar.js +9 -13
- package/dist/cjs/components/bar/bar.type.js +1 -4
- package/dist/cjs/components/bar/fragments/barChartSegment.js +3 -7
- package/dist/cjs/components/bar/index.js +2 -18
- package/dist/cjs/components/bar/utils/buildD.js +5 -9
- package/dist/cjs/components/bar/utils/getSegments.js +3 -7
- package/dist/cjs/components/chartText/chartText.js +3 -7
- package/dist/cjs/components/chartText/chartText.types.js +1 -2
- package/dist/cjs/components/chartText/index.js +2 -18
- package/dist/cjs/components/foreignObject/foreignObject.js +3 -7
- package/dist/cjs/components/foreignObject/foreignObject.types.js +1 -2
- package/dist/cjs/components/foreignObject/index.js +2 -18
- package/dist/cjs/components/index.js +10 -26
- package/dist/cjs/components/line/index.js +2 -18
- package/dist/cjs/components/line/line.js +3 -7
- package/dist/cjs/components/line/line.types.js +1 -2
- package/dist/cjs/components/node/components/circle/circle.js +4 -7
- package/dist/cjs/components/node/components/hexagon/hexagon.js +6 -9
- package/dist/cjs/components/node/components/pentagon/pentagon.js +6 -9
- package/dist/cjs/components/node/components/square/square.js +4 -7
- package/dist/cjs/components/node/components/star/star.js +6 -9
- package/dist/cjs/components/node/components/straight/straight.js +4 -7
- package/dist/cjs/components/node/components/triangle/triangle.js +4 -7
- package/dist/cjs/components/node/index.js +2 -18
- package/dist/cjs/components/node/node.js +22 -25
- package/dist/cjs/components/node/node.types.js +1 -4
- package/dist/cjs/components/node/utils/calculateShapePoints/calculateShapePoints.js +1 -5
- package/dist/cjs/components/path/components/nodePath/nodePath.js +9 -12
- package/dist/cjs/components/path/index.js +2 -18
- package/dist/cjs/components/path/path.js +20 -23
- package/dist/cjs/components/path/path.types.js +1 -2
- package/dist/cjs/components/plot/components/circle/circle.js +4 -7
- package/dist/cjs/components/plot/components/index.js +3 -19
- package/dist/cjs/components/plot/components/square/square.js +4 -7
- package/dist/cjs/components/plot/components/triangle/triangle.js +4 -7
- package/dist/cjs/components/plot/index.js +2 -18
- package/dist/cjs/components/plot/plot.js +21 -24
- package/dist/cjs/components/plot/plot.types.js +8 -11
- package/dist/cjs/components/svgContainer/index.js +1 -17
- package/dist/cjs/components/svgContainer/svgContainer.js +5 -8
- package/dist/cjs/components/svgContainer/svgContainer.types.js +1 -2
- package/dist/cjs/components/svgContainer/utils/buildViewBox/buildViewBox.js +1 -5
- package/dist/cjs/components/svgContainer/utils/index.js +1 -17
- package/dist/cjs/components/tick/index.js +2 -18
- package/dist/cjs/components/tick/tick.js +4 -8
- package/dist/cjs/components/tick/tick.types.js +1 -4
- package/dist/cjs/components/zoomArea/components/HandlerIcon.js +3 -7
- package/dist/cjs/components/zoomArea/components/LineRenderer.js +3 -7
- package/dist/cjs/components/zoomArea/components/SelectionArea.js +9 -14
- package/dist/cjs/components/zoomArea/components/ZoomHandler.js +6 -10
- package/dist/cjs/components/zoomArea/components/index.js +4 -12
- package/dist/cjs/components/zoomArea/hooks/index.js +5 -13
- package/dist/cjs/components/zoomArea/hooks/useDragInteraction.js +19 -23
- package/dist/cjs/components/zoomArea/hooks/useKeyboardNavigation.js +18 -22
- package/dist/cjs/components/zoomArea/hooks/useResponsiveCanvas.js +12 -16
- package/dist/cjs/components/zoomArea/hooks/useZoomAreaFocus.js +6 -10
- package/dist/cjs/components/zoomArea/hooks/useZoomData.js +8 -12
- package/dist/cjs/components/zoomArea/index.js +5 -21
- package/dist/cjs/components/zoomArea/utils/accessibilityLabels.js +6 -11
- package/dist/cjs/components/zoomArea/utils/index.js +3 -14
- package/dist/cjs/components/zoomArea/utils/indexRounding.js +5 -11
- package/dist/cjs/components/zoomArea/utils/interactionConfig.js +1 -5
- package/dist/cjs/components/zoomArea/utils/pathGeneration.js +4 -9
- package/dist/cjs/components/zoomArea/utils/rangeAndPositions.js +5 -13
- package/dist/cjs/components/zoomArea/utils/selectionConfig.js +1 -5
- package/dist/cjs/components/zoomArea/zoomArea.js +35 -39
- package/dist/cjs/components/zoomArea/zoomArea.type.js +1 -4
- package/dist/cjs/hooks/index.js +2 -18
- package/dist/cjs/hooks/useFocus/useFocus.js +5 -9
- package/dist/cjs/hooks/useFocus/useFocus.types.js +1 -2
- package/dist/cjs/hooks/useHover/useHover.js +5 -9
- package/dist/cjs/hooks/useHover/useHover.types.js +1 -2
- package/dist/cjs/index.js +3 -19
- package/dist/cjs/types/canvas.type.js +1 -4
- package/dist/cjs/types/errors.type.js +1 -4
- package/dist/cjs/types/focusConfig.type.js +1 -4
- package/dist/cjs/types/index.js +4 -20
- package/dist/cjs/types/position.enum.js +1 -4
- package/dist/cjs/types/unit.enum.js +1 -4
- package/dist/cjs/types/valueFormatter.type.js +1 -2
- package/dist/cjs/utils/ajustedTextSpace/ajustedTextSpace.js +1 -5
- package/dist/cjs/utils/buildErrors/buildErrors.js +3 -7
- package/dist/cjs/utils/buildTickValues/buildTickValues.js +2 -7
- package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.js +8 -13
- package/dist/cjs/utils/classNames/classNames.js +1 -5
- package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.js +4 -8
- package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.types.js +1 -2
- package/dist/cjs/utils/cursorNear/isNear.js +1 -5
- package/dist/cjs/utils/getAxisData/getAxisData.js +1 -5
- package/dist/cjs/utils/getCanvasDimensions/getCanvasDimensions.js +8 -12
- package/dist/cjs/utils/getChildrenAttr/getChildrenAttr.js +4 -8
- package/dist/cjs/utils/getCoordinates/getCoordinates.js +9 -14
- package/dist/cjs/utils/getDataFingerprint/getDataFingerprint.js +1 -5
- package/dist/cjs/utils/getPoints/getPoints.js +1 -5
- package/dist/cjs/utils/getTickTextCoordinate/getTickTextCoordinates.js +5 -10
- package/dist/cjs/utils/getTicks/getTicks.js +2 -7
- package/dist/cjs/utils/index.js +8 -24
- package/dist/cjs/utils/parseStringToNumberPx.ts/parseStringToNumberPx.js +3 -7
- package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.js +1 -5
- package/dist/cjs/utils/shadowSvg/shadowSvg.js +3 -7
- package/dist/cjs/utils/shadowSvg/shadowSvg.types.js +1 -2
- package/dist/cjs/utils/textBound/textBound.js +1 -5
- package/dist/kubit-ui-web-react-charts.cjs.js +1 -10
- package/dist/kubit-ui-web-react-charts.es.js +1 -10
- package/dist/kubit-ui-web-react-charts.umd.js +1 -10
- package/dist/types/charts/barChart/barChart.d.ts +5 -5
- package/dist/types/charts/barChart/barChart.type.d.ts +1 -1
- package/dist/types/charts/barChart/context/barChartContext.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartSeparator.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartXAxis.d.ts +1 -1
- package/dist/types/charts/barChart/fragments/barChartYAxis.d.ts +1 -1
- package/dist/types/charts/lineChart/context/lineChartContext.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartPath.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartProjection.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartSeparator.d.ts +1 -1
- package/dist/types/charts/lineChart/fragments/lineChartXAxis.d.ts +1 -1
- package/dist/types/charts/lineChart/lineChart.d.ts +5 -5
- package/dist/types/charts/lineChart/lineChart.type.d.ts +1 -1
- package/dist/types/charts/lineChart/lineChartStructure.d.ts +1 -1
- package/dist/types/charts/pieChart/context/pieChartContext.d.ts +1 -1
- package/dist/types/charts/pieChart/fragments/pieChartForeign.d.ts +1 -1
- package/dist/types/charts/pieChart/fragments/pieChartPath.d.ts +1 -1
- package/dist/types/charts/pieChart/pieChart.d.ts +3 -3
- package/dist/types/charts/pieChart/pieChart.type.d.ts +1 -1
- package/dist/types/charts/pieChart/pieChartStructure.d.ts +1 -1
- package/dist/types/components/axisChart/xAxis/xAxis.d.ts +1 -1
- package/dist/types/components/axisChart/yAxis/yAxis.d.ts +1 -1
- package/dist/types/components/bar/bar.d.ts +1 -1
- package/dist/types/components/bar/fragments/barChartSegment.d.ts +1 -1
- package/dist/types/components/chartText/chartText.d.ts +1 -1
- package/dist/types/components/foreignObject/foreignObject.d.ts +1 -1
- package/dist/types/components/foreignObject/foreignObject.types.d.ts +1 -1
- package/dist/types/components/line/line.d.ts +1 -1
- package/dist/types/components/node/components/circle/circle.d.ts +1 -1
- package/dist/types/components/node/components/hexagon/hexagon.d.ts +1 -1
- package/dist/types/components/node/components/pentagon/pentagon.d.ts +1 -1
- package/dist/types/components/node/components/square/square.d.ts +1 -1
- package/dist/types/components/node/components/star/star.d.ts +1 -1
- package/dist/types/components/node/components/straight/straight.d.ts +1 -1
- package/dist/types/components/node/components/triangle/triangle.d.ts +1 -1
- package/dist/types/components/node/node.d.ts +1 -1
- package/dist/types/components/path/components/nodePath/nodePath.d.ts +2 -2
- package/dist/types/components/path/path.d.ts +1 -1
- package/dist/types/components/path/path.types.d.ts +1 -1
- package/dist/types/components/plot/components/circle/circle.d.ts +1 -1
- package/dist/types/components/plot/components/square/square.d.ts +1 -1
- package/dist/types/components/plot/components/triangle/triangle.d.ts +1 -1
- package/dist/types/components/plot/plot.d.ts +1 -1
- package/dist/types/components/svgContainer/svgContainer.d.ts +1 -1
- package/dist/types/components/tick/tick.d.ts +1 -1
- package/dist/types/components/zoomArea/components/HandlerIcon.d.ts +1 -1
- package/dist/types/components/zoomArea/components/LineRenderer.d.ts +1 -1
- package/dist/types/components/zoomArea/components/SelectionArea.d.ts +1 -1
- package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +1 -1
- package/dist/types/hooks/useFocus/useFocus.types.d.ts +1 -1
- package/dist/types/hooks/useHover/useHover.types.d.ts +1 -1
- package/dist/types/utils/getChildrenAttr/getChildrenAttr.d.ts +1 -1
- package/package.json +44 -47
|
@@ -1,10 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KubitCharts={})}(this,function(e){"use strict";var t,a,r,n,i={exports:{}},o={},s={exports:{}},c={};function d(){return a||(a=1,s.exports=function(){if(t)return c;t=1;var e=Symbol.for("react.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=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"),x=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function y(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||p}function m(){}function v(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||p}y.prototype.isReactComponent={},y.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")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=y.prototype;var S=v.prototype=new m;S.constructor=v,f(S,y.prototype),S.isPureReactComponent=!0;var $=Array.isArray,k=Object.prototype.hasOwnProperty,C={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function b(t,a,r){var n,i={},o=null,s=null;if(null!=a)for(n in void 0!==a.ref&&(s=a.ref),void 0!==a.key&&(o=""+a.key),a)k.call(a,n)&&!T.hasOwnProperty(n)&&(i[n]=a[n]);var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(t&&t.defaultProps)for(n in c=t.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:e,type:t,key:o,ref:s,props:i,_owner:C.current}}function A(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var E=/\/+/g;function R(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 L(t,r,n,i,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case e:case a:c=!0}}if(c)return o=o(c=t),t=""===i?"."+R(c,0):i,$(o)?(n="",null!=t&&(n=t.replace(E,"$&/")+"/"),L(o,r,n,"",function(e){return e})):null!=o&&(A(o)&&(o=function(t,a){return{$$typeof:e,type:t.type,key:a,ref:t.ref,props:t.props,_owner:t._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(E,"$&/")+"/")+t)),r.push(o)),1;if(c=0,i=""===i?".":i+":",$(t))for(var d=0;d<t.length;d++){var l=i+R(s=t[d],d);c+=L(s,r,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=x&&e[x]||e["@@iterator"])?e:null}(t),"function"==typeof l)for(t=l.call(t),d=0;!(s=t.next()).done;)c+=L(s=s.value,r,n,l=i+R(s,d++),o);else if("object"===s)throw r=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return c}function w(e,t,a){if(null==e)return e;var r=[],n=0;return L(e,r,"","",function(e){return t.call(a,e,n++)}),r}function j(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 I={current:null},N={transition:null},H={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function M(){throw Error("act(...) is not supported in production builds of React.")}return c.Children={map:w,forEach:function(e,t,a){w(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return w(e,function(){t++}),t},toArray:function(e){return w(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},c.Component=y,c.Fragment=r,c.Profiler=i,c.PureComponent=v,c.StrictMode=n,c.Suspense=l,c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,c.act=M,c.cloneElement=function(t,a,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=f({},t.props),i=t.key,o=t.ref,s=t._owner;if(null!=a){if(void 0!==a.ref&&(o=a.ref,s=C.current),void 0!==a.key&&(i=""+a.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(d in a)k.call(a,d)&&!T.hasOwnProperty(d)&&(n[d]=void 0===a[d]&&void 0!==c?c[d]:a[d])}var d=arguments.length-2;if(1===d)n.children=r;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:e,type:t.type,key:i,ref:o,props:n,_owner:s}},c.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},c.createElement=b,c.createFactory=function(e){var t=b.bind(null,e);return t.type=e,t},c.createRef=function(){return{current:null}},c.forwardRef=function(e){return{$$typeof:d,render:e}},c.isValidElement=A,c.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:j}},c.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},c.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},c.unstable_act=M,c.useCallback=function(e,t){return I.current.useCallback(e,t)},c.useContext=function(e){return I.current.useContext(e)},c.useDebugValue=function(){},c.useDeferredValue=function(e){return I.current.useDeferredValue(e)},c.useEffect=function(e,t){return I.current.useEffect(e,t)},c.useId=function(){return I.current.useId()},c.useImperativeHandle=function(e,t,a){return I.current.useImperativeHandle(e,t,a)},c.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},c.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},c.useMemo=function(e,t){return I.current.useMemo(e,t)},c.useReducer=function(e,t,a){return I.current.useReducer(e,t,a)},c.useRef=function(e){return I.current.useRef(e)},c.useState=function(e){return I.current.useState(e)},c.useSyncExternalStore=function(e,t,a){return I.current.useSyncExternalStore(e,t,a)},c.useTransition=function(){return I.current.useTransition()},c.version="18.3.1",c}()),s.exports}
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.min.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var l=(n||(n=1,i.exports=function(){if(r)return o;r=1;var e=d(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,a,r){var o,c={},d=null,l=null;for(o in void 0!==r&&(d=""+r),void 0!==a.key&&(d=""+a.key),void 0!==a.ref&&(l=a.ref),a)n.call(a,o)&&!s.hasOwnProperty(o)&&(c[o]=a[o]);if(e&&e.defaultProps)for(o in a=e.defaultProps)void 0===c[o]&&(c[o]=a[o]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:i.current}}return o.Fragment=a,o.jsx=c,o.jsxs=c,o}()),i.exports),u=d();const h=u.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:a,caption:r,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:d,radius:u="0px",role:h,tabIndex:x,viewBox:p,width:f,...g},y)=>l.jsxs("svg",{ref:y,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:a,borderRadius:u,overflow:d},tabIndex:x,viewBox:p,width:f,onMouseDown:e=>e.preventDefault(),...g,children:[r&&l.jsx("title",{children:r}),c&&l.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),x=(e,t,a=0)=>`${-a} ${-a} ${e} ${t}`,p={extraSpace:0,height:80,width:100},f=e=>JSON.stringify(e),g="%",y="rem",m=/^(\d+(\.\d+)?)(px|rem|%)?$/,v=e=>{if("number"==typeof e)return e;const t=e.match(m);if(!t)throw new Error(`Invalid string format: "${e}"`);const a=t[1];return t[3]===y?16*parseFloat(a):parseFloat(a)},S=u.createContext({}),$={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},k={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},C=({canvasHeight:e,canvasWidth:t,customBreakAxis:a,extraSpaceBottomY:r,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===k.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===k.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===k.CUSTOM?{x1:n,x2:t-i,y1:a,y2:a}:{x1:n,x2:t-i,y1:e-r,y2:e-r},T=({canvasHeight:e,canvasWidth:t,customBreakAxis:a,extraSpaceBottomY:r,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===k.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-r}:s===k.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-r}:s===k.CUSTOM?{x1:a,x2:a,y1:o,y2:e-r}:{x1:n,x2:n,y1:o,y2:e-r},b=(e,t,a)=>t.map(t=>{if(isNaN(Number(t))){const a=e.find(e=>String(e.value)===String(t));return a?a.position:0}const{index:r,tick:n}=e.reduce((e,a,r)=>Math.abs(Number(a.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:r,tick:a}: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[r+1]:e[r-1],h=100*d/Math.abs(Number(u.value)-o),x=Math.abs(n.position-u.position)*h/100;return a?l?n.position+x:n.position-x:l?n.position-x:n.position+x}return n.position}),A=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:a,securitySpace:r,tickValues:n})=>{const i=n.length-1,o=(t-a-r)/i;return n.map((t,a)=>({position:e+a*o+r/2,value:t}))},E=({initPos:e,maxSpaceAvailable:t,needAjusted:a,otherAxisSpace:r,securitySpace:n,tickValues:i})=>{const o=(t-r-n)/(i.length-1),s=a?n/2:0;return i.map((t,a)=>({position:e-a*o-s,value:t}))},R=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),a=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:a,min:t,step:Math.abs(a-t)/2}}},L=({bound:e,data:t,fontSize:a,svgHeight:r,svgWidth:n,viewBox:i})=>{if(!window||!document||!t.length)return 0;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),o.setAttribute("viewBox",i),o.setAttribute("width",n),o.setAttribute("height",r),document.body.appendChild(o);const s=t.map(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("font-size",a),r.textContent=t,o.appendChild(r);const n=r.getBBox()[e];return r.remove(),n});return o.remove(),Math.max(...s)},w=e=>e?Object.entries(e).reduce((e,[t,a])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=a&&(e[t]=String(a)),e),{}):{},j=({height:e="140%",width:t="140%",x:a="-20%",y:r="-20%",...n})=>l.jsx("defs",{children:l.jsx("filter",{height:e,id:n.id,width:t,x:a,y:r,children:l.jsx("feDropShadow",{...n.shadowSvgConfig})})}),I=-1/0,N=u.forwardRef(({dataTestId:e,position:t,size:a=1,...r},n)=>l.jsx("circle",{...r,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:a/2})),H=(e,t,a,r,n)=>{let i="";const o=r===n,s=o?a:2*a;for(let a=0;a<s;a++){const c=o||a%2==0?r:n,d=2*Math.PI/s*a-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},M=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=H(t.x,t.y,6,a/2,a/2);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-hexagon`,points:i})}),O=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=H(t.x,t.y,5,a/2,a/2);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-pentagon`,points:i})}),D=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>l.jsx("rect",{...r,ref:n,"data-testid":`${e}-square`,height:a,width:a,x:t.x-a/2,y:t.y-a/2})),B=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=a/2,o=i/2,s=H(t.x,t.y,5,i,o);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-star`,points:s})}),_=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=`M ${t.x-a/2} ${t.y} H ${t.x+a/2} M ${t.x} ${t.y-a/2} V ${t.y+a/2}`;return l.jsx("path",{...r,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),W=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=[`${t.x},${t.y-a/2}`,`${t.x-a/2},${t.y+a/2}`,`${t.x+a/2},${t.y+a/2}`].join(" ");return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-triangle`,points:i})}),F={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},P={[F.Circle]:N,[F.Hexagon]:M,[F.Pentagon]:O,[F.Square]:D,[F.Star]:B,[F.Straight]:_,[F.Triangle]:W},V=u.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:a=!1,onBlur:r,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:d,position:h={x:0,y:0},size:x=1,type:p=F.Circle,...f},g)=>{const[y,m]=(e=>{const t=u.useRef(!1),a=u.useRef(null);u.useImperativeHandle(e,()=>a.current,[]);const r=e=>{t.current=!!e.autoClick};return u.useEffect(()=>{if(!a.current)return;const e=a.current;return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},[]),[a,t]})(g),v={...f,className:`node ${f.className}`,onBlur:e=>{r?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:h},m.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=>{d?.(e)}},S={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},$=P[p];return l.jsxs(l.Fragment,{children:[a&&l.jsx($,{...S,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:x+x/2,tabIndex:-1}),l.jsx($,{...v,ref:y,dataTestId:e,position:h,size:x})]})}),X=u.forwardRef(({data:e,nodeConfig:t,tabIndex:a=0,x:r,y:n},i)=>{const o=t?w(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const a=((e,t,a)=>{if(!e)return;const r=a??t.dataValue,n=Array.isArray(r)?r[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,a,r)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),a),n=n.replace(new RegExp("{{yValue}}","g"),r),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);a&&(o["aria-label"]=a)}}return l.jsx(l.Fragment,{children:t&&l.jsx(V,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:r,y:n},tabIndex:a})})}),Y=u.forwardRef(({classNames:e="",fill:t="transparent",stroke:a="#0000FF",strokeWidth:r="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:d,handleFocus:h,isFocused:x}=((e,t)=>{const[a,r]=u.useState(!1),n=u.useCallback(t=>{r(!0),e?.(t)},[e]);return{handleBlur:u.useCallback(e=>{r(!1),t?.(e)},[t]),handleFocus:n,isFocused:a}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:f,isHovered:g}=((e,t)=>{const[a,r]=u.useState(!1);return{handleMouseEnter:u.useCallback(t=>{r(!0),e?.(t)},[e]),handleMouseLeave:u.useCallback(e=>{r(!1),t?.(e)},[t]),isHovered:a}})(s.onMouseEnter,s.onMouseLeave),y=u.useRef(null),m=u.useRef([]),v=u.useRef(null);u.useImperativeHandle(c,()=>({get main(){return v.current},get node(){return m.current},get path(){return y.current}}));const S=s.gradient&&((e,t="gradientePath")=>{const a=e.split(",").map(e=>e.trim()),r=parseInt(a[0],10),n=a.slice(1).map(e=>{const[t,a]=e.split(" ");return{color:t,offset:a}});let i="0%",o="0%",s="0%";switch(r){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return l.jsx(l.Fragment,{})}return l.jsx("defs",{children:l.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>l.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),$=w(s),k={...{...s,classNames:`path ${e}`,fill:S?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:a,strokeWidth:r},...x&&n,...g&&i};return l.jsxs("g",{ref:v,tabIndex:-1,children:[S&&S,k.shadowSvgConfig&&l.jsx(j,{id:"shadow",shadowSvgConfig:k.shadowSvgConfig}),l.jsxs("g",{"aria-label":k.ariaLabel,className:k.classNames,"data-draw":!0,filter:k.shadowSvgConfig&&k.filter,opacity:k.opacity,orientation:k.orientation,role:k.role,rotate:k.rotate,tabIndex:k.tabIndex,transform:k.transform,visibility:k.visibility,...$,onBlur:d,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:p,onMouseLeave:f,children:[l.jsx("path",{ref:y,d:k.d,"data-testid":k.dataTestId,fill:k.dFill?"transparent":k.fill,fillOpacity:k.fillOpacity,fillRule:k.fillRule,stroke:k.stroke,strokeDasharray:k.strokeDasharray,strokeDashoffset:k.strokeDashoffset,strokeLinecap:k.strokeLinecap,strokeLinejoin:k.strokeLinejoin,strokeMiterlimit:k.strokeMiterlimit,strokeOpacity:k.strokeOpacity,strokeWidth:k.strokeWidth,children:k.title&&l.jsx("title",{children:k.title})}),k.dFill&&l.jsx("path",{d:k.dFill,fill:k.fill,fillOpacity:k.fillOpacity,fillRule:k.fillRule})]}),k.points&&k.nodeConfig&&k.points.map(([e,t],a)=>{const r={dataKey:k.dataKey,dataValue:k.dataValue,index:a,xKey:k?.xKey};return l.jsx(X,{ref:e=>m.current[a]=e,data:r,nodeConfig:k.nodeConfig,tabIndex:-1,x:e,y:t},`${a.toString()}`)})]})}),K=(e,t,a)=>e?t+a/2:t-a/2,z=({barConfig:e,currentBars:t,endRounded:a,extraSpacing:r=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:d,y2:u})=>{const{barWidth:h,singleConfig:x}=e,p=(({barConfig:e,orientation:t,x1:a,x2:r,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===$.HORIZONTAL,d=c?a:n,l=c?r:i,u={end:l<d,start:l>d};return s.reduce((e,t,a)=>{const{coverage:r}=t,n=((e,t)=>e/100*t)(r,l-d),i=0===a?d:K(u.start,e[a-1][1],o),c=a+1===s.length?l:K(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:d,y2:u});return l.jsx("g",{children:x.map((e,f)=>{const[g,y]="HORIZONTAL"===i?p[f]:[s,c],[m,v]="VERTICAL"===i?p[f]:[d,u],S=(({barWidth:e,currentBars:t,endRounded:a=0,extraSpacing:r,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,x,p,f="Z";const g=(({barWidth:e,currentBars:t,extraSpacing:a,order:r,orientation:n})=>{const i=e/2,o=a/2,s=t%2==0,c=s?o:o+i,d=r-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===$.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===$.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:r,order:n,orientation:i});if(i===$.HORIZONTAL){const t=s+o,r=c-a;o&&a?(u=`M ${t},${d+g}`,h=`L${r},${l+g}`,x=`Q${c+a} ${l+g-e/2}, ${r} ${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):o?(u=`M ${t},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):a?(u=`M${s},${d+g}`,h=`L${r},${l+g}`,x=`Q${c+a} ${l+g-e/2}, ${r} ${l+g-e}`,p=`L${s},${d+g-e}`):(u=`M${s},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${s},${d+g-e}`)}else{const t=d-o,r=l+a;o&&a?(u=`M${s+g}, ${t}`,h=`L${c+g},${r}`,x=`Q${c+g-e/2} ${l-a}, ${c+g-e} ${r}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):o?(u=`M${s+g}, ${t}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):a?(u=`M${s+g},${d}`,h=`L${c+g},${r}`,x=`Q${c+g-e/2} ${l-a}, ${c+g-e} ${r}`,p=`L${c+g-e},${d}`):(u=`M${s+g},${d}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${d}`)}return`${u} ${h} ${x} ${p} ${f}`})({barWidth:h,currentBars:t,endRounded:f===x.length-1&&a?a:void 0,extraSpacing:r,order:n,orientation:i,startRounded:0===f&&o?o:void 0,x1:g,x2:y,y1:m,y2:v});return l.jsx(Y,{d:S,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${f.toString()}`)})})},U=({barConfig:e,dataIdx:t,dataKey:a,order:r,...n})=>{const{xAxisCoordinates:i,yAxisCoordinates:o,...s}=u.useContext(S),{coordinates:c,tickValues:d}=i,{coordinates:h,tickValues:x}=o,p=s.orientation===$.VERTICAL,f=p?s.pKey:a,g=p?a:s.pKey,y=s.data[t][f],m=s.data[t][g],v=b(d,[String(y)],!0)[0],k=b(x,[String(m)])[0],C=p?{x1:v,x2:v,y1:c.y1,y2:k}:{x1:h.x1,x2:v,y1:k,y2:k};return l.jsx(z,{barConfig:e,currentBars:s.barChildrenCount,extraSpacing:s.gapBetweenBars,order:r,orientation:s.orientation,...C,...n})},Z=({ariaLabel:e="",className:t="line",dataTestId:a,tabIndex:r=-1,...n})=>l.jsx("line",{...n,"aria-label":e,className:t,"data-testid":a,tabIndex:r}),G=({children:e,className:t="circle",tabIndex:a=-1,...r})=>l.jsx("text",{className:t,tabIndex:a,...r,children:e}),q=({showTickLines:e,tick:t,tickLine:a,tickText:r})=>l.jsxs("g",{children:[e&&l.jsx(Z,{...a}),r&&l.jsx(G,{...r,children:t.value})]}),Q=(e,t,a=1)=>e>=t-a&&e<=t+a,J=e=>{const{ariaLabel:t,className:a,dataTestId:r,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:y,y2:m}=e;return{ariaLabel:t,className:a,dataTestId:r,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:y,y2:m}},ee=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:a=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:n=k.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:d=[],...u})=>{const h=w(u);return l.jsxs("g",{...h,children:[l.jsx(Z,{...J(u)}),d&&d.length>0&&d.map((e,t)=>{const r=Q(a,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return l.jsx(q,{showTickLines:i,tick:e,tickLine:{...r,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},te=(e,t,a)=>e===k.RIGHT?t+a:t-a,ae=(e,t,a,r)=>e===k.TOP?a:t+a+r,re=({position:e=k.BOTTOM,tickLine:t,tickText:a,...r})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(S),s=ae(e,n.y1,Number(a?.fontSize),a?.top??0),c=o.extraSpaceTopY,d=Number(o.canvasHeight)-o.extraSpaceBottomY;return l.jsx(ee,{...n,...r,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:d},tickText:{...a,y:s},tickValues:a?i:void 0})},ne=({canvasWidth:e,cursor:t=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:r=k.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...d})=>{const u=w(d);return l.jsxs("g",{...u,children:[l.jsx(Z,{...J(d)}),c&&c.length>0&&c.map((e,a)=>{const r=Q(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return l.jsx(q,{showTickLines:n,tick:e,tickLine:{...r,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${a.toString()}`)})]})},ie=(e,t,a)=>{let r=0;switch(e){case"middle":r=t/2+a;break;case"end":r=t+a;break;default:r=0}return r},oe=({position:e=k.LEFT,tickLine:t,tickText:a,...r})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(S),s=a?.textAnchor||"middle",c=(e===k.RIGHT?a?.right:a?.left)??0,d=ie(s,o.yAxisText,c),h=te(e,n.x1,d);return l.jsx(ne,{...n,...r,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...a,x:h},tickValues:a?i:void 0})},se=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:a=0,step:r}=e.numeric,n=[];for(let e=a;e<=t;e+=r)n.push(e.toString());return n}},ce=(e,t)=>e.flatMap(e=>Object.keys(e).filter(a=>a!==t&&"number"==typeof e[a]).map(t=>Number(e[t]))),de=(e,t,a,r,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*r,x=l?se(l):t.map(e=>e[a]),p=L({bound:"width",data:x,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>p?n:p;return{barChartXPosition:c||k.BOTTOM,extraSpaceBottomY:c===k.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===k.TOP?h+(d?.bottom??0):0,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:x}},le=(e,t,a,r,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*r,x=l||R([...new Set(ce(t,a))]),p=se(x),f=n>h?n:h,g=L({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||k.LEFT,extraSpaceLeftX:c===k.LEFT?g+(d?.right??0):0,extraSpaceRightX:c===k.RIGHT?g+(d?.left??0):0,securityYSpace:f,yAxisText:g,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},ue=({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{const{barChartXPosition:l,barChartYPosition:h,extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,securityXSpace:y,securityYSpace:m,xAxisText:v,xBreakAxis:S,xData:R,yAxisText:L,yBreakAxis:w,yData:j}=(({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let l={barChartXPosition:k.BOTTOM,barChartYPosition:k.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 x=[];return u.Children.forEach(n,n=>{if(u.isValidElement(n))if(n.type!==U||x.includes(n.props.order)||(x.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===re){const t=s===$.VERTICAL?h:0;l={...l,...de(n,i,c,e,t,d,a,r)}}else if(n.type===oe){const e=s===$.HORIZONTAL?h:0;l={...l,...le(n,i,c,t,e,d,a,r)}}}),l})({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d}),I=l!==k.TOP&&l!==k.BOTTOM,N=A({initPos:p,maxSpaceAvailable:r,otherAxisSpace:p+f,securitySpace:y,tickValues:R}),H=h!==k.LEFT&&h!==k.RIGHT,M=E({initPos:a-x,maxSpaceAvailable:a,needAjusted:s===$.HORIZONTAL,otherAxisSpace:g+x,securitySpace:m,tickValues:j}),O=I?b(M||[],[String(S)])[0]:0,D=H?b(N||[],[String(w)])[0]:0;return{crossXAxis:I,crossYAxis:H,extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,securityXSpace:y,securityYSpace:m,xAxisCoordinates:{coordinates:C({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(O),extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,position:l}),tickValues:N},xAxisText:v,yAxisCoordinates:{coordinates:T({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(D),extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,position:h}),tickValues:M},yAxisText:L}},he=Object.assign(({canvasConfig:e=p,caption:t,children:a,classNames:r,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",orientation:c,pKey:d,role:g,tabIndex:y,width:m="100%",...$})=>{const{extraSpace:k,height:C,width:T}=e,b=v(T),A=v(C),E=k?v(k):void 0,R=x(b,A,E),L=(e=>{let t=0;return u.Children.toArray(e).forEach(e=>{u.isValidElement(e)&&e.type===U&&e.props.order>t&&(t=e.props.order)}),t})(a),w=2*o,j=[l.jsx(re,{},"default-x-axis"),l.jsx(oe,{},"default-y-axis")],I=u.Children.toArray(a)||[],N=j.concat(I),H=Math.max(b,A,E??0),M=b/H,O=A/H,D=f(n),B=u.useMemo(()=>ue({ajustedX:M,ajustedY:O,canvasHeight:A,canvasWidth:b,children:N,data:n,gapBetweenBars:w,orientation:c,pKey:d,viewBox:R}),[C,T,D,d,c]);return l.jsx(h,{caption:t,className:r,dataTestId:i,height:s,role:g,tabIndex:y,viewBox:R,width:m,...$,children:l.jsx(S.Provider,{value:{...B,barChildrenCount:L,canvasExtraSpace:E,canvasHeight:A,canvasWidth:b,data:n,dataTestId:i,gapBetweenBars:o,orientation:c,pKey:d},children:a})})},{Path:U,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:a,topSeparator:r,xBreakAxis:n,yBreakAxis:i})=>{const{crossXAxis:o,crossYAxis:s,xAxisCoordinates:c,yAxisCoordinates:d}=u.useContext(S);if(!r&&!a&&!e)return l.jsx(l.Fragment,{});const h=n&&b(c.tickValues,[n],!0)[0],x=i&&b(d.tickValues,[i])[0],p=s?d.coordinates.x1:c.coordinates.x2,f=o?c.coordinates.y1:d.coordinates.y1,g=c.coordinates.x1,y=h??p,m=d.coordinates.y2,v=x??f,$=`M${g} ${m} H ${y} V ${v} H ${g} Z`,k=`M${g} ${v} H ${y}`,C=`M${y} ${m} V ${v}`;return l.jsxs("g",{children:[l.jsx("path",{d:$,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:k,"data-testid":`${t}Top`,...r}),l.jsx("path",{d:C,"data-testid":`${t}Right`,...a})]})},XAxis:re,YAxis:oe}),xe=u.createContext({}),pe=({curved:e=!1,extendToBottom:t=!1,points:a,svgHeight:r})=>{if(0===a.length)return"";const[n,...i]=a;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,r)=>{const[n,i]=a[r],[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]} ${r} L ${n[0]} ${r} Z`),o},fe=(e,t)=>{if(!t)return e;const a=t<0,r=e*Math.abs(t)/100;return a?e-r:e+r},ge=(e,t,a)=>{if(!a)return e;const r=a<0,n=(0===e?t:e)*Math.abs(a)/100;return r?e+n:e-n},ye=({curved:e,lineProjection:t,points:a,svgHeight:r})=>{const{lower:n,shapeColor:i,upper:o}=t,{xProjection:s,yProjection:c,...d}=o||{},{xProjection:u,yProjection:h,...x}=n||{},p=s||c?{x:s,y:c}:void 0,f=u||h?{x:u,y:h}:void 0,{downPath:g,shapePath:y,upPath:m}=(({curved:e,lowerProjection:t,points:a,svgHeight:r,upperProjection:n})=>{const i=n||t;if(0===a.length&&!i)return{shapePath:""};const[o,...s]=a,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],x=[];s.forEach(([e,a])=>{const i=n?[fe(e,n.x),ge(a,r,n.y)]:[e,a],o=t?[fe(e,-(t.x??0)),ge(a,r,-(t.y??0))]:[e,a];h.push(i),x.push(o)});const p=n&&t?[...h,s.at(-1),...x.reverse(),o]:[...h,...x.reverse(),o];return e?(d+=p.reduce((e,t,a)=>{const r=0===a?o:p[a-1],[n,i]=r,[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,a)=>{const r=0===a?o:h[a-1],[n,i]=r,[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+=x.reverse().reduce((e,t,a)=>{const r=0===a?o:x[a-1],[n,i]=r,[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+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=x.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:f,points:a,svgHeight:r,upperProjection:p});return l.jsxs("g",{className:"pointer-events-none",children:[l.jsx("path",{d:y,fill:i,stroke:"transparent",strokeWidth:"0.1"}),";",m&&l.jsx("path",{d:m,...d}),g&&l.jsx("path",{d:g,...x})]})},me=(e,t)=>e.map(e=>e[t]),ve={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},Se=({ariaLabel:e,position:t=k.BOTTOM,tickLine:a,tickText:r,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...d}=u.useContext(xe),h=ae(t,o.y1,Number(r?.fontSize),r?.top??0),x=d.extraSpaceTopY,p=Number(d.canvasHeight)-d.extraSpaceBottomY,f=r?ve.formatTicksValues(s,n):void 0,g=w(i),y=e||i["aria-label"],m={...i,...g,...y&&{"aria-label":y}};return l.jsx(ee,{...o,...m,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}xAxis`,extraSpace:{left:d.extraSpaceLeftX,right:d.extraSpaceRightX},tickLine:{...a,y1:x,y2:p},tickText:{...r,y:h},tickValues:f})},$e=({ariaLabel:e,position:t=k.LEFT,tickLine:a,tickText:r,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...d}=u.useContext(xe),h=r?.textAnchor||"middle",x=(t===k.RIGHT?r?.right:r?.left)??0,p=ie(h,d.yAxisText,x),f=te(t,o.x1,p),g=r?ve.formatTicksValues(s,n):void 0,y=w(i),m=e||i["aria-label"],v={...i,...y,...m&&{"aria-label":m}};return l.jsx(ne,{...o,...v,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}yAxis`,tickLine:{...a,x1:d.extraSpaceLeftX,x2:Number(d.canvasWidth)-d.extraSpaceRightX},tickText:{...r,x:f},tickValues:g})},ke={GENERIC:"GENERIC"},Ce={[g]:g,[y]:y},Te="WIDTH",be=/^(\d+(\.\d+)?)(px|rem|%)?$/,Ae=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(be);if(!t)throw new Error(`Invalid string format: "${e}"`);const a=parseFloat(t[1]),r=t[3];return{unit:Ce[r],value:a}},Ee=(e,t,a)=>{const r=a.parentElement;return r?e/100*(t===Te?r.clientWidth:r.clientHeight):0},Re=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Le=({canvasHeight:e,canvasWidth:t,svgElement:a})=>{const{unit:r,value:n}=Ae(t),i=r===g?Ee(n,Te,a):r===y?Re(n):n,{unit:o,value:s}=Ae(e);return{parsedCanvasHeight:o===g?Ee(s,"HEIGHT",a):o===y?Re(s):s,parsedCanvasWidth:i}},we={INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},je=e=>we[e],Ie=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:a=0,step:r}=e.numeric;if(r>=Math.abs(t-a)||r<=0)return[a.toString(),t.toString()];const n=[];for(let e=a;e<=t;e+=r)n.push(e.toString());return n}},Ne=(e,t)=>e.flatMap(e=>Object.keys(e).filter(a=>a!==t&&"number"==typeof e[a]).map(t=>e[t])),He=(e,t,a,r,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??0,h=u*r,x=d?Ie(d):t.map(e=>e[a]),p=l?x.map(l):x,f=L({bound:"width",data:p,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),g=s===k.TOP;return{extraSpaceBottomY:s===k.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:g?h+(c?.bottom??0):0,lineChartXPosition:s||k.BOTTOM,securityXSpace:f,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:x}},Me=(e,t,a,r,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??"0",h=u*r,x=d||R([...new Set(Ne(t,a))]),p=Ie(x),f=l?p.map(l):p,g=L({bound:"width",data:f,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),y=h,m=s===k.RIGHT;return{extraSpaceLeftX:s===k.LEFT?g+(c?.right??0):0,extraSpaceRightX:m?g+(c?.left??0):0,lineChartYPosition:s||k.LEFT,securityYSpace:y,yAxisText:g,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:p}},Oe=({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s})=>{let c;const{extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,lineChartXPosition:p,lineChartYPosition:f,securityXSpace:g,securityYSpace:y,xAxisText:m,xBreakAxis:v,xData:S,yAxisText:$,yBreakAxis:R,yData:L}=(({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:k.BOTTOM,lineChartYPosition:k.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return u.Children.forEach(n,n=>{u.isValidElement(n)&&(n.type===Se?c={...c,...He(n,i,s,e,o,a,r)}:n.type===$e&&(c={...c,...Me(n,i,s,t,o,a,r)}))}),c})({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s}),w=p!==k.TOP&&p!==k.BOTTOM,j=A({initPos:l,maxSpaceAvailable:r,otherAxisSpace:l+h,securitySpace:g,tickValues:S});(j??[]).some(({position:e})=>isNaN(e))&&(c={error:je("INVALID_X_TICK")});const I=f!==k.LEFT&&f!==k.RIGHT,N=E({initPos:a-d,maxSpaceAvailable:a,otherAxisSpace:x+d,securitySpace:y,tickValues:L}),H=w?b(N||[],[String(v)])[0]:0,M=I?b(j||[],[String(R)])[0]:0,O=C({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(H),extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,position:p}),D=T({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(M),extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,position:f});return c?{crossXAxis:w,crossYAxis:I,error:c,extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,securityXSpace:g,securityYSpace:y,xAxisCoordinates:{coordinates:O,tickValues:[{position:0,value:"0"},{position:r,value:"1"}]},xAxisText:m,yAxisCoordinates:{coordinates:D,tickValues:[{position:a,value:"0"},{position:0,value:"1"}]},yAxisText:$}:{crossXAxis:w,crossYAxis:I,extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,securityXSpace:g,securityYSpace:y,xAxisCoordinates:{coordinates:O,tickValues:j},xAxisText:m,yAxisCoordinates:{coordinates:D,tickValues:N},yAxisText:$}},De=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:a=p,caption:r,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:d="100%",onErrors:g,role:y,tabIndex:m,width:S="100%",xKey:$,...k})=>{const{extraSpace:C,height:T,width:b}=a,[A,E]=u.useState(""),[R,L]=u.useState({height:0,width:0}),w=C?v(C):void 0,j=x(R.width,R.height,w),N=[l.jsx(Se,{},"default-x-axis"),l.jsx($e,{},"default-y-axis")],H=u.Children.toArray(n)||[],M=N.concat(H),O=Math.max(R.width,R.height,w??0),D=isNaN(R.width/O)?0:R.width/O,B=isNaN(R.height/O)?0:R.height/O;(({attrName:e,children:t,originalValue:a,updateValue:r})=>{let n="";u.Children.toArray(t).forEach(t=>{if(u.isValidElement(t)){const a=t.props[e];a&&(n+=a)}}),n!==a&&r(n)})({attrName:"dataKey",children:M,originalValue:A,updateValue:E});const _=f(o),W=u.useMemo(()=>Oe({ajustedX:D,ajustedY:B,canvasHeight:R.height,canvasWidth:R.width,children:M,data:o,viewBox:j,xKey:$}),[R.width,R.height,_,$,A]);u.useEffect(()=>{W.error&&g&&g({[ke.GENERIC]:W.error})},[W.error,g]);const{svgRef:F,xCursor:P,yCursor:V}=(({canvasHeight:e,canvasWidth:t})=>{const[[a,r],n]=u.useState([I,I]),i=u.useCallback((a,r)=>{const{height:i,left:o,top:s,width:c}=r.getBoundingClientRect(),d=a.clientX-o,l=a.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:u.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:a,yCursor:r}})({canvasHeight:R.height,canvasWidth:R.width});return u.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:a}=Le({canvasHeight:T,canvasWidth:b,svgElement:e});L({height:t,width:a})},[b,T]),u.useEffect(()=>{c?.({x1:W.extraSpaceLeftX,x2:R.width-W.extraSpaceRightX,y1:W.extraSpaceTopY,y2:R.height-W.extraSpaceBottomY})},[R.width,R.height]),l.jsx(h,{ref:F,ariaHidden:e,ariaLabel:t,caption:r,className:i,"data-kbt-svg":!0,dataTestId:s,height:d,role:y,tabIndex:m,viewBox:j,width:S,...k,children:l.jsx(xe.Provider,{value:{...W,canvasExtraSpace:w,canvasHeight:R.height,canvasWidth:R.width,data:o,dataTestId:s,xCursor:P,xKey:$,yCursor:V},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:a,getNodeFocusInfo:r,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{xAxisCoordinates:d,yAxisCoordinates:h,...x}=u.useContext(xe),{indicatorRef:p,pathRef:f}=((e,t)=>{const a=u.useRef(null),r=u.useRef(null);return u.useEffect(()=>{if(!t||!a.current||!r.current)return;const n=a.current,i=r.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:r,pathRef:a}})(x.xCursor,!!i),g=!!i&&x.xCursor!==-1/0,y=u.useRef(null),m=u.useRef(null),{autoClick:v,lineIndicator:S,...$}=i||{},k=x.extraSpaceTopY,C=Number(x.canvasHeight)-x.extraSpaceBottomY,{tickValues:T}=d,{tickValues:A}=h,E=me(x.data,x.xKey),R=me(x.data,c.dataKey),L=b(T,E,!0),j=b(A,R),I=L.map((e,t)=>[e,j[t]]),N=pe({curved:a,extendToBottom:!1,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),H=pe({curved:a,extendToBottom:!!c.fill||!!c.gradient,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY});u.useEffect(()=>{if(!y.current?.path)return;f.current=y.current.path;const e=y.current.main,t=y.current.node,a=E.map((e,t)=>({x:e,y:R[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:a,ref:r})=>{let n,i=!1;const o=r.querySelector("[data-draw]"),s=r=>{i&&("ArrowRight"===r.key?(n=void 0===n||n===a.length-1?0:n+1,a[n].focus(),t?.(e[n])):"ArrowLeft"===r.key&&(n=void 0===n||0===n?a.length-1:n-1,a[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},l=()=>{n=void 0};return{mount:()=>{r.addEventListener("focusin",c),r.addEventListener("focusout",d),o?.addEventListener("focus",l),window.addEventListener("keydown",e=>s(e))},unmount:()=>{r.removeEventListener("focusin",c),r.removeEventListener("focusout",d),o?.removeEventListener("focus",l),window.removeEventListener("keydown",e=>s(e))}}})({data:a,getNodeFocusInfo:r,nodes:t,ref:e});return n(),()=>i()},[]),u.useEffect(()=>{if(c.nodeConfig&&g&&v){const{idx:e,match:t}=((e,t)=>{let a=0,r=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){r=!0,a=n;break}return{idx:a,match:r}})(L,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]),u.useEffect(()=>{n?.(I)},[I]);const M=w(c),O={...c,...M,...e&&{"aria-label":e}};return l.jsxs(l.Fragment,{children:[l.jsx(Y,{ref:y,d:N,dFill:H,dataTestId:`${x.dataTestId}path`,dataValue:x.data,points:I,xKey:x.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let a=0,r=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<r&&(a=n,r=i)}return a})(L,x.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,y.current?.node?.[e]?.dispatchEvent(t)}},...O}),o&&l.jsx(ye,{curved:a,dataKey:c.dataKey,lineProjection:o,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),g&&l.jsxs(l.Fragment,{children:[!!S&&l.jsx(Z,{...S,className:"pointer-events-none",x1:x.xCursor,x2:x.xCursor,y1:k,y2:C}),l.jsx("g",{ref:p,className:"pointer-events-none",children:l.jsx(V,{...$})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:a,topSeparator:r,xBreakAxis:n,yBreakAxis:i})=>{const{crossXAxis:o,crossYAxis:s,xAxisCoordinates:c,yAxisCoordinates:d}=u.useContext(xe);if(!r&&!a&&!e)return l.jsx(l.Fragment,{});const h=n&&b(c.tickValues,[n],!0)[0],x=i&&b(d.tickValues,[i])[0],p=s?d.coordinates.x1:c.coordinates.x2,f=o?c.coordinates.y1:d.coordinates.y1,g=c.coordinates.x1,y=h??p,m=d.coordinates.y2,v=x??f,S=`M${g} ${m} H ${y} V ${v} H ${g} Z`,$=`M${g} ${v} H ${y}`,k=`M${y} ${m} V ${v}`;return l.jsxs("g",{children:[l.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:$,"data-testid":`${t}Top`,...r}),l.jsx("path",{d:k,"data-testid":`${t}Right`,...a})]})},XAxis:Se,YAxis:$e}),Be=({children:e,dataTestId:t,height:a,width:r,x:n,y:i})=>l.jsx("foreignObject",{"data-testid":t,height:a,width:r,x:n,y:i,children:e}),_e=u.createContext({}),We=(e,t,a)=>({x:e.x+t*Math.cos(a),y:e.y+t*Math.sin(a)}),Fe=({center:e,innerEnd:t,innerRadius:a,singleStroke:r})=>{if(!r)return a>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Pe="CLOCKWISE",Ve=({canvasHeight:e,canvasWidth:t,color:a="blue",gap:r,halfChart:n,innerRadius:i,radius:o,singleStroke:s,startAngle:c,total:d,value:u,...h})=>{const x=(({canvasHeight:e,canvasWidth:t,customRadius:a,gap:r,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,x=a&&a<h?a:h,p=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},g=s?2*d:d,y=100*l/g*p/100,m=r/x,{carryAngle:v,finalAngle:S,initialAngle:$}=(({angleEquivalent:e,direction:t,gapAngle:a,startAngle:r})=>{const n=t===Pe;return{carryAngle:n?r+e:r-e,finalAngle:n?r+e-a/2:r-e+a/2,initialAngle:n?r+a/2:r-a/2}})({angleEquivalent:y,direction:o,gapAngle:m,startAngle:c.current});c.current=v;const k=p*l/g-m<=Math.PI?"0":"1",C=We(f,i,$),T=We(f,i,S),b=We(f,x,$);return(({center:e,innerEnd:t,innerRadius:a,innerStart:r,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,x,p,f,g,y,m,v;return c===Pe?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=Fe({center:e,innerEnd:t,innerRadius:a,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=a>0?`A ${a},${a} 0 ${n} 0 ${r.x},${r.y}`:void 0,f=`M ${o.x},${o.y}`,y=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,m=`A ${a},${a} 0 ${n} 1 ${r.x},${r.y}`,v=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=Fe({center:e,innerEnd:t,innerRadius:a,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=a>0?`A ${a}, ${a} 0 ${n},1 ${r.x},${r.y}`:void 0,f=`M ${o.x},${o.y}`,y=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,m=`A ${a},${a} 0 ${n} 0 ${r.x},${r.y}`,v=d?void 0:"Z"),[l,u,h,x,p,v].concat(d?[f,g,y,m]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:T,innerRadius:i,innerStart:C,largeArcFlag:k,outerEnd:We(f,x,S),outerStart:b,radius:x,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:o,gap:r,halfChart:n,innerRadius:i,singleStroke:s,startAngle:c,total:d,value:u});return l.jsx(Y,{...h,d:x,dataValue:u,fill:a})},Xe=({dataKey:e,fill:t,gap:a,innerRadius:r,radius:n,...i})=>{const o=String(e),{canvasHeight:s,canvasWidth:c,data:d,dataTestId:h,halfChart:x}=u.useContext(_e),p=x?0:-Math.PI/2,f=u.useRef(p),g=d[o]?.reduce((e,t)=>e+t.value,0),y=1===d[o]?.length,m=r?v(r):void 0,S=n?v(n):void 0;return d[o]?.length?l.jsx("g",{children:d[o].map((e,r)=>u.createElement(Ve,{...i,...e,key:`${r.toString()}`,canvasHeight:s,canvasWidth:c,color:e.color||t,dataTestId:`${h}path-${r}`,gap:a,halfChart:x,innerRadius:m,radius:S,singleStroke:y,startAngle:f,total:g}))}):l.jsx(l.Fragment,{})},Ye=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:a=p,caption:r,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:d="100%",radius:f="50%",role:g,tabIndex:y,width:m="100%",...S})=>{const{extraSpace:$,height:k,width:C}=a,T=v(C),b=v(k),A=$?v($):void 0,E=x(T,b,A),R=u.useMemo(()=>(({canvasHeight:e,canvasWidth:t,children:a,halfChart:r})=>{let n,i;u.Children.forEach(a,e=>{if(u.isValidElement(e)&&e.type===Xe){const{innerRadius:t}=e.props;if(!t)return;const a=v(t);(!n||a<n)&&(n=a)}}),n&&(i=2*n);const o=i??0,s=r?o/2:o,c=r?e:e/2;return{foreignObject:{height:s,width:o,x:t/2-o/2,y:r?c-s:c-s/2}}})({canvasHeight:b,canvasWidth:T,children:n,halfChart:c}),[k,C,c]);return l.jsx(h,{ariaHidden:e,ariaLabel:t,caption:r,className:i,dataTestId:s,height:d,radius:f,role:g,tabIndex:y,viewBox:E,width:m,...S,children:l.jsx(_e.Provider,{value:{...R,canvasHeight:b,canvasWidth:T,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:a,width:r,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=u.useContext(_e),d=!r&&c?.width?c.width:r,h=!a&&c?.height?c.height:a,x=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return l.jsx(Be,{...o,dataTestId:f,height:h,width:d,x:x,y:p,children:e})},Path:Xe}),Ke=({fill:e="#8f8f8f",x:t,y:a})=>l.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${a-5})`,children:[l.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"}),l.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"}),l.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"})]}),ze=({linesData:e})=>l.jsx(l.Fragment,{children:e.map((e,t)=>l.jsxs("g",{children:[e.config.fill&&e.fillPath&&l.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),l.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Ue={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0},Ze=({elementHeight:e,elementPosition:t,elementStrokeWidth:a=0,elementType:r,elementWidth:n,gap:i=0,innerStrokeWidth:o=2,outlineStrokeWidth:s=2})=>{if("circle"===r){const e=n/2+a/2+o/2+i,r=e+o/2+s/2;return{inner:{cx:t.x,cy:t.y,r:e},outer:{cx:t.x,cy:t.y,r:r},type:"circle"}}const c=n+a+o+2*i,d=e+a+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"}},Ge=(e,t,a)=>{const r=e.start/Math.max(1,t-1)*a;return{endX:e.end/Math.max(1,t-1)*a,startX:r}},qe=(e,t,a)=>{const r=Math.max(0,Math.min(t,e))/t;return Math.round(r*(a-1))},Qe=(e,t,a=.1)=>{const r=Math.max(0,Math.min(e.start,t-1-a));return{end:Math.min(t-1,Math.max(e.end,r+a)),start:r}},Je=e=>({end:Math.max(0,e-1),start:0}),et=(e,t)=>0===e.start&&e.end===t-1,tt=({endX:e,focusConfig:t,height:a,isFocused:r,startX:n})=>{if(!r)return null;const i=e-n,o=Ze({elementHeight:a,elementPosition:{x:n+i/2,y:a/2},elementStrokeWidth:0,elementType:"rectangle",elementWidth:i,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth}),s=t.outlineColor,c=t.innerColor,d=t.outlineStrokeWidth,u=t.innerStrokeWidth;return"rectangle"!==o.type?null:l.jsxs("g",{pointerEvents:"none",children:[l.jsx("rect",{fill:"none",height:o.outer.height,stroke:s,strokeWidth:d,width:o.outer.width,x:o.outer.x,y:o.outer.y}),l.jsx("rect",{fill:"none",height:o.inner.height,stroke:c,strokeWidth:u,width:o.inner.width,x:o.inner.x,y:o.inner.y})]})},at=({currentRange:e,dataLength:t,dataTestId:a,endX:r,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d,screenReaderText:u,selectionConfig:h,startX:x})=>{const p=h.hideOverlayOnFullRange&&et(e,t);return l.jsx(l.Fragment,{children:l.jsx("rect",{"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":a,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:p?"hidden":"visible"},tabIndex:0,width:r-x,x:x,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d})})},rt="#8f8f8f",nt=({dataTestId:e,focusConfig:t,handlerConfig:a,height:r,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h,screenReaderText:x,x:p})=>{const f=r/2,g=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||rt,radius:e?.radius||17,stroke:e?.stroke||rt,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||rt,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(a),y=Ze({elementHeight:2*g.radius,elementPosition:{x:p,y:f},elementStrokeWidth:"number"==typeof g.strokeWidth?g.strokeWidth:parseFloat(g.strokeWidth.toString()),elementType:"circle",elementWidth:2*g.radius,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return l.jsxs("g",{"data-testid":`${e}-group`,children:[l.jsx("line",{pointerEvents:"none",stroke:g.verticalLineStroke,strokeWidth:g.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:r}),l.jsx("circle",{"aria-label":x,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":x,cursor:"ew-resize",cx:p,cy:f,"data-testid":e,fill:g.fill,r:g.radius,role:"slider",stroke:g.stroke,strokeWidth:g.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h}),l.jsx(Ke,{fill:g.iconColor,x:p,y:f}),n&&"circle"===y.type&&l.jsxs("g",{pointerEvents:"none",children:[l.jsx("circle",{cx:y.outer.cx,cy:y.outer.cy,fill:"none",r:y.outer.r,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth}),l.jsx("circle",{cx:y.inner.cx,cy:y.inner.cy,fill:"none",r:y.inner.r,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth})]})]})},it={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},ot=e=>{const{currentRange:t,dataLength:a,interactionConfig:r,onRangeChange:n,width:i}=e,o=u.useRef(null),[s,c]=u.useState(null),d=u.useCallback(e=>()=>{c(e)},[]),l=u.useCallback(e=>()=>{c(e)},[]),h=u.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=qe(d,i,a),u=((e,t,a,r,n)=>{const i={...t};if(e===it.START_HANDLER)i.start=Math.max(0,Math.min(a,t.end-n.minHandlerDistance));else if(e===it.END_HANDLER)i.end=Math.min(r-1,Math.max(a,t.start+n.minHandlerDistance));else if(e===it.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(r-1-e,a-e/2));i.start=n,i.end=n+e}return i})(s,t,l,a,r),h=Qe(u,a,r.minHandlerDistance);n(h)},[s,i,a,t,n,r]),x=u.useCallback(e=>{h(e.clientX)},[h]),p=u.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),f=u.useCallback(()=>{c(null)},[]),g=u.useCallback(()=>{c(null)},[]);return u.useEffect(()=>{if(s)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",g),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g)}},[s,x,f,p,g]),{groupRef:o,handleMouseDown:d,handleTouchStart:l,isDragging:s}},st=e=>{const{currentRange:t,dataLength:a,interactionConfig:r,onRangeChange:n}=e;return{handleKeyDown:u.useCallback(e=>i=>{const o=i.shiftKey?r.keyboardFastStep:r.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,a,r)=>{const n={...t};if(e===it.START_HANDLER)n.start=Math.max(0,t.start-a);else if(e===it.END_HANDLER)n.end=Math.max(t.start+r.minHandlerDistance,t.end-a);else if(e===it.SELECTION_AREA){const e=t.end-t.start,r=Math.max(0,t.start-a);n.start=r,n.end=r+e}return n})(e,t,o,r);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,a,r,n)=>{const i={...t};if(e===it.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+a);else if(e===it.END_HANDLER)i.end=Math.min(r-1,t.end+a);else if(e===it.SELECTION_AREA){const e=t.end-t.start,n=Math.min(r-1-e,t.start+a);i.start=n,i.end=n+e}return i})(e,t,o,a,r);break;case"Home":i.preventDefault(),s=((e,t,a)=>{const r={...t};if(e===it.START_HANDLER)r.start=0;else if(e===it.END_HANDLER)r.end=a-1;else if(e===it.SELECTION_AREA){const e=t.end-t.start;r.start=0,r.end=e}return r})(e,t,a);break;case"End":i.preventDefault(),s=((e,t,a,r)=>{const n={...t};if(e===it.START_HANDLER)n.start=t.end-r.minHandlerDistance;else if(e===it.END_HANDLER)n.end=a-1;else if(e===it.SELECTION_AREA){const e=t.end-t.start;n.start=a-1-e,n.end=a-1}return n})(e,t,a,r);break;default:return}const c=Qe(s,a,r.minHandlerDistance);n(c)},[t,a,n,r])}},ct=({canvasConfig:e,dataTestId:t,extraSpace:a=0,height:r,width:n})=>{const[i,o]=u.useState({height:0,width:0}),s=u.useMemo(()=>e||{extraSpace:a,height:r,width:n},[e,n,r,a]),{extraSpace:c,height:d,width:l}=s,h=c?v(c):void 0;u.useEffect(()=>{const e=document.querySelector(`[data-testid="${t}"]`);if(!e)return;const a=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:a}=Le({canvasHeight:d,canvasWidth:l,svgElement:e});o({height:t,width:a})};a();const r=new ResizeObserver(()=>{a()});return r.observe(e),()=>{r.disconnect()}},[l,d,t]);const p=u.useMemo(()=>x(i.width,i.height,h),[i.width,i.height,h]);return{parsedCanvas:i,viewBox:p}},dt=()=>{const[e,t]=u.useState(null),a=u.useCallback(e=>()=>t(e),[]);return{handleBlur:u.useCallback(()=>{t(null)},[]),handleFocus:a,isFocused:u.useCallback(t=>e===t,[e])}},lt=(e,t)=>{const a=Math.floor(e);return Math.max(0,Math.min(t,a))},ut=(e,t)=>{const a=Math.ceil(e);return Math.max(0,Math.min(t,a))},ht=(e,t)=>{const a=Math.max(0,t-1);return{endIndex:ut(e.end,a),startIndex:lt(e.start,a)}},xt=({data:e,initialRange:t,onDataChange:a})=>{const r=t||Je(e.length),[n,i]=u.useState(r),o=t=>{if(!a||0===e.length)return;const{endIndex:r,startIndex:n}=ht(t,e.length),i=e.slice(n,r+1);a(i)};return u.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},pt=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),ft=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...a]=e;let r=`M ${t[0]} ${t[1]}`;return a.forEach((e,n)=>{const i=0===n?t:a[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];r+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),r},gt=(e,t,a,r)=>{if(0===e.length||0===t.length)return[];const n=.05*r,i=r-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((r,o)=>[o/Math.max(1,e.length-1)*a,n+i-(Number(r[t.yKey])-s)/c*i]),d=t.curved?ft(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${ft(o)} L ${a} ${r} L 0 ${r} Z`:`${d} L ${a},${r} L 0,${r} Z`),{config:t,fillPath:l,linePath:d}})},yt=(e,t,a)=>e[a]?.[t]?.toString()||`${a}`,mt=(e,t,a)=>{if(!e)return e;const r=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(r,t).replace(n,a)};e.Bar=z,e.BarChart=he,e.BarOrientation=$,e.ChartText=G,e.DefaultCanvasConfig=p,e.ErrorType=ke,e.FOCUS_DEFAULT=Ue,e.ForeignObject=Be,e.HandlerIcon=Ke,e.Line=Z,e.LineChart=De,e.LineRenderer=ze,e.Node=V,e.NodeType=F,e.Path=Y,e.PieChart=Ye,e.Positions=k,e.SelectionArea=at,e.SelectionAreaFocusRing=tt,e.SvgContainer=h,e.Tick=q,e.TickDataUtils=ve,e.XAxis=ee,e.YAxis=ne,e.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:a,canvasConfig:r,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:d="40px",initialRange:x,interactionConfig:p,lines:g,onDataChange:y,role:m,screenReaderTextConfig:v,selectionConfig:S,width:$="100%",xKey:k,...C})=>{const T="zoom-area",b=pt(p),A=(E=S,{fill:E?.fill??"#0078d4",fillOpacity:E?.fillOpacity??.5,hideOverlayOnFullRange:E?.hideOverlayOnFullRange??true,stroke:E?.stroke??"#0078d4",strokeWidth:E?.strokeWidth??0});var E;const R=(e=>({gap:e?.gap??Ue.OUTLINES_GAP,innerColor:e?.innerColor??Ue.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??Ue.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??Ue.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??Ue.OUTER_FOCUS_STROKE_WIDTH}))(s),{currentRange:L,handleRangeChange:w}=xt({data:o,initialRange:x,onDataChange:y}),{parsedCanvas:j,viewBox:I}=ct({canvasConfig:r,dataTestId:T,height:d,width:$}),N=f(o),H=JSON.stringify(g),M=((e,t,a,r)=>{const{endIndex:n,startIndex:i}=ht(a,e.length),o=yt(e,t,i),s=yt(e,t,n),c=mt(r?.startHandler,o,s)??o;return{endHandler:mt(r?.endHandler,o,s)??s,selectionArea:mt(r?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,k,L,v),O=u.useMemo(()=>gt(o,g,j.width,j.height),[N,H,j.width,j.height]),{endX:D,startX:B}=u.useMemo(()=>Ge(L,o.length,j.width),[L,N,j.width]),{handleBlur:_,handleFocus:W,isFocused:F}=dt(),{handleKeyDown:P}=st({currentRange:L,dataLength:o.length,interactionConfig:b,onRangeChange:w}),{groupRef:V,handleMouseDown:X,handleTouchStart:Y}=ot({currentRange:L,dataLength:o.length,interactionConfig:b,onRangeChange:w,width:j.width});return l.jsxs(h,{ref:V,ariaHidden:e,ariaLabel:t,backgroundColor:a,caption:n,className:i,"data-testid":T,height:d,overflow:"visible",role:m,viewBox:I,width:$,...C,children:[l.jsx(ze,{linesData:O}),l.jsx(at,{currentRange:L,dataLength:o.length,dataTestId:`${T}-selection-area`,endX:D,height:j.height,screenReaderText:M.selectionArea,selectionConfig:A,startX:B,onBlur:_,onFocus:W(it.SELECTION_AREA),onKeyDown:P(it.SELECTION_AREA),onMouseDown:X(it.SELECTION_AREA),onTouchStart:Y(it.SELECTION_AREA)}),l.jsx(nt,{dataTestId:`${T}-start-handler`,focusConfig:R,handlerConfig:c,height:j.height,isFocused:F(it.START_HANDLER),max:L.end-b.minHandlerDistance,min:0,screenReaderText:M.startHandler,type:it.START_HANDLER,value:L.start,x:B,onBlur:_,onFocus:W(it.START_HANDLER),onKeyDown:P(it.START_HANDLER),onMouseDown:X(it.START_HANDLER),onTouchStart:Y(it.START_HANDLER)}),l.jsx(nt,{dataTestId:`${T}-end-handler`,focusConfig:R,handlerConfig:c,height:j.height,isFocused:F(it.END_HANDLER),max:o.length-1,min:L.start+b.minHandlerDistance,screenReaderText:M.endHandler,type:it.END_HANDLER,value:L.end,x:D,onBlur:_,onFocus:W(it.END_HANDLER),onKeyDown:P(it.END_HANDLER),onMouseDown:X(it.END_HANDLER),onTouchStart:Y(it.END_HANDLER)}),l.jsx(tt,{endX:D,focusConfig:R,height:j.height,isFocused:F(it.SELECTION_AREA),startX:B})]})},e.ZoomAreaElements=it,e.ZoomHandler=nt,e.calculateHandlerPositions=Ge,e.calculateLinesPathData=gt,e.clampRange=Qe,e.createDefaultRange=Je,e.generateCurvedPath=ft,e.getInteractionConfig=pt,e.isFullRange=et,e.mouseToDataIndex=qe,e.useDragInteraction=ot,e.useKeyboardNavigation=st,e.useResponsiveCanvas=ct,e.useZoomAreaFocus=dt,e.useZoomData=xt,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KubitCharts={})}(this,function(e){"use strict";var t,a,r,n,i={exports:{}},o={},s={exports:{}},c={};function d(){return a||(a=1,s.exports=function(){if(t)return c;t=1;var e=Symbol.for("react.element"),a=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=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"),x=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function y(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||p}function m(){}function v(e,t,a){this.props=e,this.context=t,this.refs=g,this.updater=a||p}y.prototype.isReactComponent={},y.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")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=y.prototype;var S=v.prototype=new m;S.constructor=v,f(S,y.prototype),S.isPureReactComponent=!0;var $=Array.isArray,k=Object.prototype.hasOwnProperty,C={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function b(t,a,r){var n,i={},o=null,s=null;if(null!=a)for(n in void 0!==a.ref&&(s=a.ref),void 0!==a.key&&(o=""+a.key),a)k.call(a,n)&&!T.hasOwnProperty(n)&&(i[n]=a[n]);var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){for(var d=Array(c),l=0;l<c;l++)d[l]=arguments[l+2];i.children=d}if(t&&t.defaultProps)for(n in c=t.defaultProps)void 0===i[n]&&(i[n]=c[n]);return{$$typeof:e,type:t,key:o,ref:s,props:i,_owner:C.current}}function A(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var E=/\/+/g;function R(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 L(t,r,n,i,o){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case e:case a:c=!0}}if(c)return o=o(c=t),t=""===i?"."+R(c,0):i,$(o)?(n="",null!=t&&(n=t.replace(E,"$&/")+"/"),L(o,r,n,"",function(e){return e})):null!=o&&(A(o)&&(o=function(t,a){return{$$typeof:e,type:t.type,key:a,ref:t.ref,props:t.props,_owner:t._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(E,"$&/")+"/")+t)),r.push(o)),1;if(c=0,i=""===i?".":i+":",$(t))for(var d=0;d<t.length;d++){var l=i+R(s=t[d],d);c+=L(s,r,n,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=x&&e[x]||e["@@iterator"])?e:null}(t),"function"==typeof l)for(t=l.call(t),d=0;!(s=t.next()).done;)c+=L(s=s.value,r,n,l=i+R(s,d++),o);else if("object"===s)throw r=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return c}function w(e,t,a){if(null==e)return e;var r=[],n=0;return L(e,r,"","",function(e){return t.call(a,e,n++)}),r}function j(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 I={current:null},N={transition:null},H={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:N,ReactCurrentOwner:C};function M(){throw Error("act(...) is not supported in production builds of React.")}return c.Children={map:w,forEach:function(e,t,a){w(e,function(){t.apply(this,arguments)},a)},count:function(e){var t=0;return w(e,function(){t++}),t},toArray:function(e){return w(e,function(e){return e})||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},c.Component=y,c.Fragment=r,c.Profiler=i,c.PureComponent=v,c.StrictMode=n,c.Suspense=l,c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,c.act=M,c.cloneElement=function(t,a,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=f({},t.props),i=t.key,o=t.ref,s=t._owner;if(null!=a){if(void 0!==a.ref&&(o=a.ref,s=C.current),void 0!==a.key&&(i=""+a.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(d in a)k.call(a,d)&&!T.hasOwnProperty(d)&&(n[d]=void 0===a[d]&&void 0!==c?c[d]:a[d])}var d=arguments.length-2;if(1===d)n.children=r;else if(1<d){c=Array(d);for(var l=0;l<d;l++)c[l]=arguments[l+2];n.children=c}return{$$typeof:e,type:t.type,key:i,ref:o,props:n,_owner:s}},c.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},c.createElement=b,c.createFactory=function(e){var t=b.bind(null,e);return t.type=e,t},c.createRef=function(){return{current:null}},c.forwardRef=function(e){return{$$typeof:d,render:e}},c.isValidElement=A,c.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:j}},c.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},c.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},c.unstable_act=M,c.useCallback=function(e,t){return I.current.useCallback(e,t)},c.useContext=function(e){return I.current.useContext(e)},c.useDebugValue=function(){},c.useDeferredValue=function(e){return I.current.useDeferredValue(e)},c.useEffect=function(e,t){return I.current.useEffect(e,t)},c.useId=function(){return I.current.useId()},c.useImperativeHandle=function(e,t,a){return I.current.useImperativeHandle(e,t,a)},c.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},c.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},c.useMemo=function(e,t){return I.current.useMemo(e,t)},c.useReducer=function(e,t,a){return I.current.useReducer(e,t,a)},c.useRef=function(e){return I.current.useRef(e)},c.useState=function(e){return I.current.useState(e)},c.useSyncExternalStore=function(e,t,a){return I.current.useSyncExternalStore(e,t,a)},c.useTransition=function(){return I.current.useTransition()},c.version="18.3.1",c}()),s.exports}var l=(n||(n=1,i.exports=function(){if(r)return o;r=1;var e=d(),t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,a,r){var o,c={},d=null,l=null;for(o in void 0!==r&&(d=""+r),void 0!==a.key&&(d=""+a.key),void 0!==a.ref&&(l=a.ref),a)n.call(a,o)&&!s.hasOwnProperty(o)&&(c[o]=a[o]);if(e&&e.defaultProps)for(o in a=e.defaultProps)void 0===c[o]&&(c[o]=a[o]);return{$$typeof:t,type:e,key:d,ref:l,props:c,_owner:i.current}}return o.Fragment=a,o.jsx=c,o.jsxs=c,o}()),i.exports),u=d();const h=u.forwardRef(({ariaHidden:e,ariaLabel:t,backgroundColor:a,caption:r,children:n,className:i,dataTestId:o,height:s,imageSrc:c,overflow:d,radius:u="0px",role:h,tabIndex:x,viewBox:p,width:f,...g},y)=>l.jsxs("svg",{ref:y,"aria-hidden":e,"aria-label":t,className:i,"data-testid":o,height:s,role:h,style:{backgroundColor:a,borderRadius:u,overflow:d},tabIndex:x,viewBox:p,width:f,onMouseDown:e=>e.preventDefault(),...g,children:[r&&l.jsx("title",{children:r}),c&&l.jsx("image",{height:s,href:c,width:f,x:"0",y:"0"}),n]})),x=(e,t,a=0)=>`${-a} ${-a} ${e} ${t}`,p={extraSpace:0,height:80,width:100},f=e=>JSON.stringify(e),g="%",y="rem",m=/^(\d+(\.\d+)?)(px|rem|%)?$/,v=e=>{if("number"==typeof e)return e;const t=e.match(m);if(!t)throw new Error(`Invalid string format: "${e}"`);const a=t[1];return t[3]===y?16*parseFloat(a):parseFloat(a)},S=u.createContext({}),$={HORIZONTAL:"HORIZONTAL",VERTICAL:"VERTICAL"},k={BOTTOM:"BOTTOM",CENTER:"CENTER",CUSTOM:"CUSTOM",LEFT:"LEFT",RIGHT:"RIGHT",TOP:"TOP"},C=({canvasHeight:e,canvasWidth:t,customBreakAxis:a,extraSpaceBottomY:r,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===k.TOP?{x1:n,x2:t-i,y1:o,y2:o}:s===k.CENTER?{x1:n,x2:t-i,y1:e/2,y2:e/2}:s===k.CUSTOM?{x1:n,x2:t-i,y1:a,y2:a}:{x1:n,x2:t-i,y1:e-r,y2:e-r},T=({canvasHeight:e,canvasWidth:t,customBreakAxis:a,extraSpaceBottomY:r,extraSpaceLeftX:n,extraSpaceRightX:i,extraSpaceTopY:o,position:s})=>s===k.RIGHT?{x1:t-i,x2:t-i,y1:o,y2:e-r}:s===k.CENTER?{x1:t/2,x2:t/2,y1:o,y2:e-r}:s===k.CUSTOM?{x1:a,x2:a,y1:o,y2:e-r}:{x1:n,x2:n,y1:o,y2:e-r},b=(e,t,a)=>t.map(t=>{if(isNaN(Number(t))){const a=e.find(e=>String(e.value)===String(t));return a?a.position:0}const{index:r,tick:n}=e.reduce((e,a,r)=>Math.abs(Number(a.value)-Number(t))<=Math.abs(Number(e.tick.value)-Number(t))?{index:r,tick:a}: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[r+1]:e[r-1],h=100*d/Math.abs(Number(u.value)-o),x=Math.abs(n.position-u.position)*h/100;return a?l?n.position+x:n.position-x:l?n.position-x:n.position+x}return n.position}),A=({initPos:e,maxSpaceAvailable:t,otherAxisSpace:a,securitySpace:r,tickValues:n})=>{const i=n.length-1,o=(t-a-r)/i;return n.map((t,a)=>({position:e+a*o+r/2,value:t}))},E=({initPos:e,maxSpaceAvailable:t,needAjusted:a,otherAxisSpace:r,securitySpace:n,tickValues:i})=>{const o=(t-r-n)/(i.length-1),s=a?n/2:0;return i.map((t,a)=>({position:e-a*o-s,value:t}))},R=e=>{if(0===e.length)return{numeric:{max:2,min:0,step:1}};const t=Math.min(...e.map(e=>parseFloat(e))),a=Math.max(...e.map(e=>parseFloat(e)));return{numeric:{max:a,min:t,step:Math.abs(a-t)/2}}},L=({bound:e,data:t,fontSize:a,svgHeight:r,svgWidth:n,viewBox:i})=>{if(!window||!document||!t.length)return 0;const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("style","position: absolute; visibility: hidden; top: -9999px; left: -9999px;"),o.setAttribute("viewBox",i),o.setAttribute("width",n),o.setAttribute("height",r),document.body.appendChild(o);const s=t.map(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("font-size",a),r.textContent=t,o.appendChild(r);const n=r.getBBox()[e];return r.remove(),n});return o.remove(),Math.max(...s)},w=e=>e?Object.entries(e).reduce((e,[t,a])=>((t.startsWith("aria-")||t.startsWith("data-"))&&null!=a&&(e[t]=String(a)),e),{}):{},j=({height:e="140%",width:t="140%",x:a="-20%",y:r="-20%",...n})=>l.jsx("defs",{children:l.jsx("filter",{height:e,id:n.id,width:t,x:a,y:r,children:l.jsx("feDropShadow",{...n.shadowSvgConfig})})}),I=-1/0,N=u.forwardRef(({dataTestId:e,position:t,size:a=1,...r},n)=>l.jsx("circle",{...r,ref:n,cx:t?.x,cy:t?.y,"data-testid":`${e}-circle`,r:a/2})),H=(e,t,a,r,n)=>{let i="";const o=r===n,s=o?a:2*a;for(let a=0;a<s;a++){const c=o||a%2==0?r:n,d=2*Math.PI/s*a-Math.PI/2;i+=`${e+Math.cos(d)*c},${t+Math.sin(d)*c} `}return i.trim()},M=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=H(t.x,t.y,6,a/2,a/2);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-hexagon`,points:i})}),O=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=H(t.x,t.y,5,a/2,a/2);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-pentagon`,points:i})}),D=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>l.jsx("rect",{...r,ref:n,"data-testid":`${e}-square`,height:a,width:a,x:t.x-a/2,y:t.y-a/2})),B=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=a/2,o=i/2,s=H(t.x,t.y,5,i,o);return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-star`,points:s})}),_=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=`M ${t.x-a/2} ${t.y} H ${t.x+a/2} M ${t.x} ${t.y-a/2} V ${t.y+a/2}`;return l.jsx("path",{...r,ref:n,d:i,"data-testid":`${e}-straight`,strokeWidth:2})}),W=u.forwardRef(({dataTestId:e,position:t={x:0,y:0},size:a=1,...r},n)=>{const i=[`${t.x},${t.y-a/2}`,`${t.x-a/2},${t.y+a/2}`,`${t.x+a/2},${t.y+a/2}`].join(" ");return l.jsx("polygon",{...r,ref:n,"data-testid":`${e}-triangle`,points:i})}),F={Circle:"circle",Hexagon:"hexagon",Pentagon:"pentagon",Square:"square",Star:"star",Straight:"straight",Triangle:"triangle"},P={[F.Circle]:N,[F.Hexagon]:M,[F.Pentagon]:O,[F.Square]:D,[F.Star]:B,[F.Straight]:_,[F.Triangle]:W},V=u.forwardRef(({dataTestId:e="node",haloConfig:t,hasHalo:a=!1,onBlur:r,onClick:n,onDoubleClick:i,onFocus:o,onKeyDown:s,onMouseEnter:c,onMouseLeave:d,position:h={x:0,y:0},size:x=1,type:p=F.Circle,...f},g)=>{const[y,m]=(e=>{const t=u.useRef(!1),a=u.useRef(null);u.useImperativeHandle(e,()=>a.current,[]);const r=e=>{t.current=!!e.autoClick};return u.useEffect(()=>{if(!a.current)return;const e=a.current;return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},[]),[a,t]})(g),v={...f,className:`node ${f.className}`,onBlur:e=>{r?.(e)},onClick:e=>{n?.(e,{...f.data,nodePosition:h},m.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=>{d?.(e)}},S={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},$=P[p];return l.jsxs(l.Fragment,{children:[a&&l.jsx($,{...S,"aria-hidden":"true",dataTestId:`${e}-halo`,position:h,size:x+x/2,tabIndex:-1}),l.jsx($,{...v,ref:y,dataTestId:e,position:h,size:x})]})}),X=u.forwardRef(({data:e,nodeConfig:t,tabIndex:a=0,x:r,y:n},i)=>{const o=t?w(t):{};if(o["aria-label"]&&e&&"string"==typeof o["aria-label"]){const t=o["aria-label"];if(t.includes("{{")){const a=((e,t,a)=>{if(!e)return;const r=a??t.dataValue,n=Array.isArray(r)?r[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,a,r)=>{let n=e;return void 0!==t.dataKey&&(n=n.replace(new RegExp("{{dataKey}}","g"),t.dataKey)),n=n.replace(new RegExp("{{xValue}}","g"),a),n=n.replace(new RegExp("{{yValue}}","g"),r),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);a&&(o["aria-label"]=a)}}return l.jsx(l.Fragment,{children:t&&l.jsx(V,{...t,ref:i,...o,className:"node-path-focus-border",data:e,hasHalo:t.hasHalo,position:{x:r,y:n},tabIndex:a})})}),Y=u.forwardRef(({classNames:e="",fill:t="transparent",stroke:a="#0000FF",strokeWidth:r="1",focusConfig:n={stroke:"#0000FF",strokeWidth:"0.5"},hoverConfig:i={stroke:"#0000FF",strokeWidth:"0.5"},role:o="img",...s},c)=>{const{handleBlur:d,handleFocus:h,isFocused:x}=((e,t)=>{const[a,r]=u.useState(!1),n=u.useCallback(t=>{r(!0),e?.(t)},[e]);return{handleBlur:u.useCallback(e=>{r(!1),t?.(e)},[t]),handleFocus:n,isFocused:a}})(s.onFocus,s.onBlur),{handleMouseEnter:p,handleMouseLeave:f,isHovered:g}=((e,t)=>{const[a,r]=u.useState(!1);return{handleMouseEnter:u.useCallback(t=>{r(!0),e?.(t)},[e]),handleMouseLeave:u.useCallback(e=>{r(!1),t?.(e)},[t]),isHovered:a}})(s.onMouseEnter,s.onMouseLeave),y=u.useRef(null),m=u.useRef([]),v=u.useRef(null);u.useImperativeHandle(c,()=>({get main(){return v.current},get node(){return m.current},get path(){return y.current}}));const S=s.gradient&&((e,t="gradientePath")=>{const a=e.split(",").map(e=>e.trim()),r=parseInt(a[0],10),n=a.slice(1).map(e=>{const[t,a]=e.split(" ");return{color:t,offset:a}});let i="0%",o="0%",s="0%";switch(r){case 180:s="100%";break;case 90:o="100%";break;case 270:i="100%";break;default:return l.jsx(l.Fragment,{})}return l.jsx("defs",{children:l.jsx("linearGradient",{id:t,x1:i,x2:o,y1:"0%",y2:s,children:n.map((e,t)=>l.jsx("stop",{offset:e.offset,stopColor:e.color},`${t}-${e.offset}`.toString()))})})})(s.gradient),$=w(s),k={...{...s,classNames:`path ${e}`,fill:S?"url(#gradientePath)":t,filter:"url(#shadow)",role:o,stroke:a,strokeWidth:r},...x&&n,...g&&i};return l.jsxs("g",{ref:v,tabIndex:-1,children:[S&&S,k.shadowSvgConfig&&l.jsx(j,{id:"shadow",shadowSvgConfig:k.shadowSvgConfig}),l.jsxs("g",{"aria-label":k.ariaLabel,className:k.classNames,"data-draw":!0,filter:k.shadowSvgConfig&&k.filter,opacity:k.opacity,orientation:k.orientation,role:k.role,rotate:k.rotate,tabIndex:k.tabIndex,transform:k.transform,visibility:k.visibility,...$,onBlur:d,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:p,onMouseLeave:f,children:[l.jsx("path",{ref:y,d:k.d,"data-testid":k.dataTestId,fill:k.dFill?"transparent":k.fill,fillOpacity:k.fillOpacity,fillRule:k.fillRule,stroke:k.stroke,strokeDasharray:k.strokeDasharray,strokeDashoffset:k.strokeDashoffset,strokeLinecap:k.strokeLinecap,strokeLinejoin:k.strokeLinejoin,strokeMiterlimit:k.strokeMiterlimit,strokeOpacity:k.strokeOpacity,strokeWidth:k.strokeWidth,children:k.title&&l.jsx("title",{children:k.title})}),k.dFill&&l.jsx("path",{d:k.dFill,fill:k.fill,fillOpacity:k.fillOpacity,fillRule:k.fillRule})]}),k.points&&k.nodeConfig&&k.points.map(([e,t],a)=>{const r={dataKey:k.dataKey,dataValue:k.dataValue,index:a,xKey:k?.xKey};return l.jsx(X,{ref:e=>m.current[a]=e,data:r,nodeConfig:k.nodeConfig,tabIndex:-1,x:e,y:t},`${a.toString()}`)})]})}),K=(e,t,a)=>e?t+a/2:t-a/2,z=({barConfig:e,currentBars:t,endRounded:a,extraSpacing:r=0,order:n=1,orientation:i,startRounded:o,x1:s,x2:c,y1:d,y2:u})=>{const{barWidth:h,singleConfig:x}=e,p=(({barConfig:e,orientation:t,x1:a,x2:r,y1:n,y2:i})=>{const{gap:o=0,singleConfig:s}=e,c=t===$.HORIZONTAL,d=c?a:n,l=c?r:i,u={end:l<d,start:l>d};return s.reduce((e,t,a)=>{const{coverage:r}=t,n=((e,t)=>e/100*t)(r,l-d),i=0===a?d:K(u.start,e[a-1][1],o),c=a+1===s.length?l:K(u.end,i+n,o);return e.push([i,c]),e},[])})({barConfig:e,orientation:i,x1:s,x2:c,y1:d,y2:u});return l.jsx("g",{children:x.map((e,f)=>{const[g,y]="HORIZONTAL"===i?p[f]:[s,c],[m,v]="VERTICAL"===i?p[f]:[d,u],S=(({barWidth:e,currentBars:t,endRounded:a=0,extraSpacing:r,order:n,orientation:i,startRounded:o=0,x1:s,x2:c,y1:d,y2:l})=>{let u,h,x,p,f="Z";const g=(({barWidth:e,currentBars:t,extraSpacing:a,order:r,orientation:n})=>{const i=e/2,o=a/2,s=t%2==0,c=s?o:o+i,d=r-Math.ceil(t/2);let l=0;return 0===d?l=s?-o:i:d<0?l=n===$.HORIZONTAL?d*-c+e:d*c:d>0&&(l=n===$.HORIZONTAL?d*-c:d*c+e),l})({barWidth:e,currentBars:t,extraSpacing:r,order:n,orientation:i});if(i===$.HORIZONTAL){const t=s+o,r=c-a;o&&a?(u=`M ${t},${d+g}`,h=`L${r},${l+g}`,x=`Q${c+a} ${l+g-e/2}, ${r} ${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):o?(u=`M ${t},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${t},${d+g-e}`,f=`Q${s-o} ${d+g-e/2}, ${t} ${d+g}`):a?(u=`M${s},${d+g}`,h=`L${r},${l+g}`,x=`Q${c+a} ${l+g-e/2}, ${r} ${l+g-e}`,p=`L${s},${d+g-e}`):(u=`M${s},${d+g}`,h=`L${c},${l+g}`,x=`L${c},${l+g-e}`,p=`L${s},${d+g-e}`)}else{const t=d-o,r=l+a;o&&a?(u=`M${s+g}, ${t}`,h=`L${c+g},${r}`,x=`Q${c+g-e/2} ${l-a}, ${c+g-e} ${r}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):o?(u=`M${s+g}, ${t}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${t}`,f=`Q${s+g-e/2} ${d+o}, ${s+g} ${t}`):a?(u=`M${s+g},${d}`,h=`L${c+g},${r}`,x=`Q${c+g-e/2} ${l-a}, ${c+g-e} ${r}`,p=`L${c+g-e},${d}`):(u=`M${s+g},${d}`,h=`L${c+g},${l}`,x=`L${c+g-e},${l}`,p=`L${s+g-e},${d}`)}return`${u} ${h} ${x} ${p} ${f}`})({barWidth:h,currentBars:t,endRounded:f===x.length-1&&a?a:void 0,extraSpacing:r,order:n,orientation:i,startRounded:0===f&&o?o:void 0,x1:g,x2:y,y1:m,y2:v});return l.jsx(Y,{d:S,fill:e.color,hoverConfig:{stroke:"transparent",strokeWidth:"0"},stroke:"transparent",tabIndex:0,title:e.title},`${e.title}-${f.toString()}`)})})},U=({barConfig:e,dataIdx:t,dataKey:a,order:r,...n})=>{const{xAxisCoordinates:i,yAxisCoordinates:o,...s}=u.useContext(S),{coordinates:c,tickValues:d}=i,{coordinates:h,tickValues:x}=o,p=s.orientation===$.VERTICAL,f=p?s.pKey:a,g=p?a:s.pKey,y=s.data[t][f],m=s.data[t][g],v=b(d,[String(y)],!0)[0],k=b(x,[String(m)])[0],C=p?{x1:v,x2:v,y1:c.y1,y2:k}:{x1:h.x1,x2:v,y1:k,y2:k};return l.jsx(z,{barConfig:e,currentBars:s.barChildrenCount,extraSpacing:s.gapBetweenBars,order:r,orientation:s.orientation,...C,...n})},Z=({ariaLabel:e="",className:t="line",dataTestId:a,tabIndex:r=-1,...n})=>l.jsx("line",{...n,"aria-label":e,className:t,"data-testid":a,tabIndex:r}),G=({children:e,className:t="circle",tabIndex:a=-1,...r})=>l.jsx("text",{className:t,tabIndex:a,...r,children:e}),q=({showTickLines:e,tick:t,tickLine:a,tickText:r})=>l.jsxs("g",{children:[e&&l.jsx(Z,{...a}),r&&l.jsx(G,{...r,children:t.value})]}),Q=(e,t,a=1)=>e>=t-a&&e<=t+a,J=e=>{const{ariaLabel:t,className:a,dataTestId:r,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:y,y2:m}=e;return{ariaLabel:t,className:a,dataTestId:r,opacity:n,stroke:i,strokeDasharray:o,strokeDashoffset:s,strokeLinecap:c,strokeLinejoin:d,strokeOpacity:l,strokeWidth:u,style:h,tabIndex:x,transform:p,x1:f,x2:g,y1:y,y2:m}},ee=({canvasHeight:e=p.height,canvasWidth:t=p.width,cursor:a=0,extraSpace:r={bottom:0,left:0,right:0,top:0},position:n=k.BOTTOM,showTickLines:i=!1,tickLine:o,tickLineHover:s,tickText:c,tickValues:d=[],...u})=>{const h=w(u);return l.jsxs("g",{...h,children:[l.jsx(Z,{...J(u)}),d&&d.length>0&&d.map((e,t)=>{const r=Q(a,e.position)&&s?{...o,...s}:o,n="rotate"===c?.transform?`rotate(-30, ${e.position}, ${c.y})`:void 0;return l.jsx(q,{showTickLines:i,tick:e,tickLine:{...r,x1:e.position,x2:e.position},tickText:{...c,transform:n,x:e.position}},`${t.toString()}`)})]})},te=(e,t,a)=>e===k.RIGHT?t+a:t-a,ae=(e,t,a,r)=>e===k.TOP?a:t+a+r,re=({position:e=k.BOTTOM,tickLine:t,tickText:a,...r})=>{const{xAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(S),s=ae(e,n.y1,Number(a?.fontSize),a?.top??0),c=o.extraSpaceTopY,d=Number(o.canvasHeight)-o.extraSpaceBottomY;return l.jsx(ee,{...n,...r,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}xAxis`,extraSpace:{left:o.extraSpaceLeftX,right:o.extraSpaceRightX},tickLine:{...t,y1:c,y2:d},tickText:{...a,y:s},tickValues:a?i:void 0})},ne=({canvasWidth:e,cursor:t=0,extraSpace:a={bottom:0,left:0,right:0,top:0},position:r=k.LEFT,showTickLines:n=!0,tickLine:i,tickLineHover:o,tickText:s,tickValues:c=[],...d})=>{const u=w(d);return l.jsxs("g",{...u,children:[l.jsx(Z,{...J(d)}),c&&c.length>0&&c.map((e,a)=>{const r=Q(t,e.position)&&o?{...i,...o}:i,c="rotate"===s?.transform?`rotate(-30, ${s.x}, ${e.position})`:void 0;return l.jsx(q,{showTickLines:n,tick:e,tickLine:{...r,y1:e.position,y2:e.position},tickText:{...s,transform:c,y:e.position}},`${a.toString()}`)})]})},ie=(e,t,a)=>{let r=0;switch(e){case"middle":r=t/2+a;break;case"end":r=t+a;break;default:r=0}return r},oe=({position:e=k.LEFT,tickLine:t,tickText:a,...r})=>{const{yAxisCoordinates:{coordinates:n,tickValues:i},...o}=u.useContext(S),s=a?.textAnchor||"middle",c=(e===k.RIGHT?a?.right:a?.left)??0,d=ie(s,o.yAxisText,c),h=te(e,n.x1,d);return l.jsx(ne,{...n,...r,canvasHeight:Number(o.canvasHeight),canvasWidth:Number(o.canvasWidth),dataTestId:`${o.dataTestId}yAxis`,tickLine:{...t,x1:o.extraSpaceLeftX,x2:Number(o.canvasWidth)-o.extraSpaceRightX},tickText:{...a,x:h},tickValues:a?i:void 0})},se=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:a=0,step:r}=e.numeric,n=[];for(let e=a;e<=t;e+=r)n.push(e.toString());return n}},ce=(e,t)=>e.flatMap(e=>Object.keys(e).filter(a=>a!==t&&"number"==typeof e[a]).map(t=>Number(e[t]))),de=(e,t,a,r,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*r,x=l?se(l):t.map(e=>e[a]),p=L({bound:"width",data:x,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i}),f=n>p?n:p;return{barChartXPosition:c||k.BOTTOM,extraSpaceBottomY:c===k.BOTTOM?h+(d?.top??0):0,extraSpaceTopY:c===k.TOP?h+(d?.bottom??0):0,securityXSpace:f,xBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,xData:x}},le=(e,t,a,r,n,i,o,s)=>{const{position:c,tickText:d,tickValues:l}=e.props,u=d?.fontSize??0,h=u*r,x=l||R([...new Set(ce(t,a))]),p=se(x),f=n>h?n:h,g=L({bound:"width",data:p,fontSize:u,svgHeight:`${o}`,svgWidth:`${s}`,viewBox:i});return{barChartYPosition:c||k.LEFT,extraSpaceLeftX:c===k.LEFT?g+(d?.right??0):0,extraSpaceRightX:c===k.RIGHT?g+(d?.left??0):0,securityYSpace:f,yAxisText:g,yBreakAxis:l?.numeric?l.numeric.breakAxis??0:d?.custom?.breakAxis??0,yData:p}},ue=({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{const{barChartXPosition:l,barChartYPosition:h,extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,securityXSpace:y,securityYSpace:m,xAxisText:v,xBreakAxis:S,xData:R,yAxisText:L,yBreakAxis:w,yData:j}=(({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d})=>{let l={barChartXPosition:k.BOTTOM,barChartYPosition:k.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 x=[];return u.Children.forEach(n,n=>{if(u.isValidElement(n))if(n.type!==U||x.includes(n.props.order)||(x.push(n.props.order),h+=n.props.barConfig.barWidth??0),n.type===re){const t=s===$.VERTICAL?h:0;l={...l,...de(n,i,c,e,t,d,a,r)}}else if(n.type===oe){const e=s===$.HORIZONTAL?h:0;l={...l,...le(n,i,c,t,e,d,a,r)}}}),l})({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,gapBetweenBars:o,orientation:s,pKey:c,viewBox:d}),I=l!==k.TOP&&l!==k.BOTTOM,N=A({initPos:p,maxSpaceAvailable:r,otherAxisSpace:p+f,securitySpace:y,tickValues:R}),H=h!==k.LEFT&&h!==k.RIGHT,M=E({initPos:a-x,maxSpaceAvailable:a,needAjusted:s===$.HORIZONTAL,otherAxisSpace:g+x,securitySpace:m,tickValues:j}),O=I?b(M||[],[String(S)])[0]:0,D=H?b(N||[],[String(w)])[0]:0;return{crossXAxis:I,crossYAxis:H,extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,securityXSpace:y,securityYSpace:m,xAxisCoordinates:{coordinates:C({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(O),extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,position:l}),tickValues:N},xAxisText:v,yAxisCoordinates:{coordinates:T({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(D),extraSpaceBottomY:x,extraSpaceLeftX:p,extraSpaceRightX:f,extraSpaceTopY:g,position:h}),tickValues:M},yAxisText:L}},he=Object.assign(({canvasConfig:e=p,caption:t,children:a,classNames:r,data:n,dataTestId:i,gapBetweenBars:o=0,height:s="100%",orientation:c,pKey:d,role:g,tabIndex:y,width:m="100%",...$})=>{const{extraSpace:k,height:C,width:T}=e,b=v(T),A=v(C),E=k?v(k):void 0,R=x(b,A,E),L=(e=>{let t=0;return u.Children.toArray(e).forEach(e=>{u.isValidElement(e)&&e.type===U&&e.props.order>t&&(t=e.props.order)}),t})(a),w=2*o,j=[l.jsx(re,{},"default-x-axis"),l.jsx(oe,{},"default-y-axis")],I=u.Children.toArray(a)||[],N=j.concat(I),H=Math.max(b,A,E??0),M=b/H,O=A/H,D=f(n),B=u.useMemo(()=>ue({ajustedX:M,ajustedY:O,canvasHeight:A,canvasWidth:b,children:N,data:n,gapBetweenBars:w,orientation:c,pKey:d,viewBox:R}),[C,T,D,d,c]);return l.jsx(h,{caption:t,className:r,dataTestId:i,height:s,role:g,tabIndex:y,viewBox:R,width:m,...$,children:l.jsx(S.Provider,{value:{...B,barChildrenCount:L,canvasExtraSpace:E,canvasHeight:A,canvasWidth:b,data:n,dataTestId:i,gapBetweenBars:o,orientation:c,pKey:d},children:a})})},{Path:U,Separator:({areaSeparator:e,dataTestId:t,rightSeparator:a,topSeparator:r,xBreakAxis:n,yBreakAxis:i})=>{const{crossXAxis:o,crossYAxis:s,xAxisCoordinates:c,yAxisCoordinates:d}=u.useContext(S);if(!r&&!a&&!e)return l.jsx(l.Fragment,{});const h=n&&b(c.tickValues,[n],!0)[0],x=i&&b(d.tickValues,[i])[0],p=s?d.coordinates.x1:c.coordinates.x2,f=o?c.coordinates.y1:d.coordinates.y1,g=c.coordinates.x1,y=h??p,m=d.coordinates.y2,v=x??f,$=`M${g} ${m} H ${y} V ${v} H ${g} Z`,k=`M${g} ${v} H ${y}`,C=`M${y} ${m} V ${v}`;return l.jsxs("g",{children:[l.jsx("path",{d:$,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:k,"data-testid":`${t}Top`,...r}),l.jsx("path",{d:C,"data-testid":`${t}Right`,...a})]})},XAxis:re,YAxis:oe}),xe=u.createContext({}),pe=({curved:e=!1,extendToBottom:t=!1,points:a,svgHeight:r})=>{if(0===a.length)return"";const[n,...i]=a;let o=`M ${n[0]} ${n[1]}`;return o+=e?i.reduce((e,t,r)=>{const[n,i]=a[r],[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]} ${r} L ${n[0]} ${r} Z`),o},fe=(e,t)=>{if(!t)return e;const a=t<0,r=e*Math.abs(t)/100;return a?e-r:e+r},ge=(e,t,a)=>{if(!a)return e;const r=a<0,n=(0===e?t:e)*Math.abs(a)/100;return r?e+n:e-n},ye=({curved:e,lineProjection:t,points:a,svgHeight:r})=>{const{lower:n,shapeColor:i,upper:o}=t,{xProjection:s,yProjection:c,...d}=o||{},{xProjection:u,yProjection:h,...x}=n||{},p=s||c?{x:s,y:c}:void 0,f=u||h?{x:u,y:h}:void 0,{downPath:g,shapePath:y,upPath:m}=(({curved:e,lowerProjection:t,points:a,svgHeight:r,upperProjection:n})=>{const i=n||t;if(0===a.length&&!i)return{shapePath:""};const[o,...s]=a,c=`M ${o[0]} ${o[1]}`;let d=c,l=n?c:void 0,u=t?c:void 0;const h=[],x=[];s.forEach(([e,a])=>{const i=n?[fe(e,n.x),ge(a,r,n.y)]:[e,a],o=t?[fe(e,-(t.x??0)),ge(a,r,-(t.y??0))]:[e,a];h.push(i),x.push(o)});const p=n&&t?[...h,s.at(-1),...x.reverse(),o]:[...h,...x.reverse(),o];return e?(d+=p.reduce((e,t,a)=>{const r=0===a?o:p[a-1],[n,i]=r,[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,a)=>{const r=0===a?o:h[a-1],[n,i]=r,[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+=x.reverse().reduce((e,t,a)=>{const r=0===a?o:x[a-1],[n,i]=r,[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+=p.reduce((e,t)=>`${e} L ${t?.[0]} ${t?.[1]}`,""),l&&(l+=h.reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,"")),u&&(u+=x.reverse().reduce((e,t)=>`${e} L ${t[0]} ${t[1]}`,""))),{downPath:u,shapePath:d,upPath:l}})({curved:e,lowerProjection:f,points:a,svgHeight:r,upperProjection:p});return l.jsxs("g",{className:"pointer-events-none",children:[l.jsx("path",{d:y,fill:i,stroke:"transparent",strokeWidth:"0.1"}),";",m&&l.jsx("path",{d:m,...d}),g&&l.jsx("path",{d:g,...x})]})},me=(e,t)=>e.map(e=>e[t]),ve={formatTicksValues:(e,t)=>e.map(e=>({...e,value:t(e.value)}))},Se=({ariaLabel:e,position:t=k.BOTTOM,tickLine:a,tickText:r,valueFormatter:n=e=>e,...i})=>{const{xAxisCoordinates:{coordinates:o,tickValues:s},xCursor:c,...d}=u.useContext(xe),h=ae(t,o.y1,Number(r?.fontSize),r?.top??0),x=d.extraSpaceTopY,p=Number(d.canvasHeight)-d.extraSpaceBottomY,f=r?ve.formatTicksValues(s,n):void 0,g=w(i),y=e||i["aria-label"],m={...i,...g,...y&&{"aria-label":y}};return l.jsx(ee,{...o,...m,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}xAxis`,extraSpace:{left:d.extraSpaceLeftX,right:d.extraSpaceRightX},tickLine:{...a,y1:x,y2:p},tickText:{...r,y:h},tickValues:f})},$e=({ariaLabel:e,position:t=k.LEFT,tickLine:a,tickText:r,valueFormatter:n=e=>e,...i})=>{const{yAxisCoordinates:{coordinates:o,tickValues:s},yCursor:c,...d}=u.useContext(xe),h=r?.textAnchor||"middle",x=(t===k.RIGHT?r?.right:r?.left)??0,p=ie(h,d.yAxisText,x),f=te(t,o.x1,p),g=r?ve.formatTicksValues(s,n):void 0,y=w(i),m=e||i["aria-label"],v={...i,...y,...m&&{"aria-label":m}};return l.jsx(ne,{...o,...v,canvasHeight:Number(d.canvasHeight),canvasWidth:Number(d.canvasWidth),cursor:c,dataTestId:`${d.dataTestId}yAxis`,tickLine:{...a,x1:d.extraSpaceLeftX,x2:Number(d.canvasWidth)-d.extraSpaceRightX},tickText:{...r,x:f},tickValues:g})},ke={GENERIC:"GENERIC"},Ce={[g]:g,[y]:y},Te="WIDTH",be=/^(\d+(\.\d+)?)(px|rem|%)?$/,Ae=e=>{if("number"==typeof e)return{unit:void 0,value:e};const t=e.match(be);if(!t)throw new Error(`Invalid string format: "${e}"`);const a=parseFloat(t[1]),r=t[3];return{unit:Ce[r],value:a}},Ee=(e,t,a)=>{const r=a.parentElement;return r?e/100*(t===Te?r.clientWidth:r.clientHeight):0},Re=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Le=({canvasHeight:e,canvasWidth:t,svgElement:a})=>{const{unit:r,value:n}=Ae(t),i=r===g?Ee(n,Te,a):r===y?Re(n):n,{unit:o,value:s}=Ae(e);return{parsedCanvasHeight:o===g?Ee(s,"HEIGHT",a):o===y?Re(s):s,parsedCanvasWidth:i}},we={INVALID_X_TICK:new Error("[getXTicks] Invalid X tick values calculated")},je=e=>we[e],Ie=e=>{if(e.custom)return e.custom?.values;if(e.numeric){const{max:t,min:a=0,step:r}=e.numeric;if(r>=Math.abs(t-a)||r<=0)return[a.toString(),t.toString()];const n=[];for(let e=a;e<=t;e+=r)n.push(e.toString());return n}},Ne=(e,t)=>e.flatMap(e=>Object.keys(e).filter(a=>a!==t&&"number"==typeof e[a]).map(t=>e[t])),He=(e,t,a,r,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??0,h=u*r,x=d?Ie(d):t.map(e=>e[a]),p=l?x.map(l):x,f=L({bound:"width",data:p,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),g=s===k.TOP;return{extraSpaceBottomY:s===k.BOTTOM?h+(c?.top??0):0,extraSpaceTopY:g?h+(c?.bottom??0):0,lineChartXPosition:s||k.BOTTOM,securityXSpace:f,xBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,xData:x}},Me=(e,t,a,r,n,i,o)=>{const{position:s,tickText:c,tickValues:d,valueFormatter:l}=e.props,u=c?.fontSize??"0",h=u*r,x=d||R([...new Set(Ne(t,a))]),p=Ie(x),f=l?p.map(l):p,g=L({bound:"width",data:f,fontSize:u,svgHeight:`${i}`,svgWidth:`${o}`,viewBox:n}),y=h,m=s===k.RIGHT;return{extraSpaceLeftX:s===k.LEFT?g+(c?.right??0):0,extraSpaceRightX:m?g+(c?.left??0):0,lineChartYPosition:s||k.LEFT,securityYSpace:y,yAxisText:g,yBreakAxis:d?.numeric?d.numeric.breakAxis??0:c?.custom?.breakAxis??0,yData:p}},Oe=({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s})=>{let c;const{extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,lineChartXPosition:p,lineChartYPosition:f,securityXSpace:g,securityYSpace:y,xAxisText:m,xBreakAxis:v,xData:S,yAxisText:$,yBreakAxis:R,yData:L}=(({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s})=>{let c={extraSpaceBottomY:0,extraSpaceLeftX:0,extraSpaceRightX:0,extraSpaceTopY:0,lineChartXPosition:k.BOTTOM,lineChartYPosition:k.LEFT,securityXSpace:0,securityYSpace:0,xAxisText:0,xBreakAxis:0,xData:[],yAxisText:0,yBreakAxis:0,yData:[]};return u.Children.forEach(n,n=>{u.isValidElement(n)&&(n.type===Se?c={...c,...He(n,i,s,e,o,a,r)}:n.type===$e&&(c={...c,...Me(n,i,s,t,o,a,r)}))}),c})({ajustedX:e,ajustedY:t,canvasHeight:a,canvasWidth:r,children:n,data:i,viewBox:o,xKey:s}),w=p!==k.TOP&&p!==k.BOTTOM,j=A({initPos:l,maxSpaceAvailable:r,otherAxisSpace:l+h,securitySpace:g,tickValues:S});(j??[]).some(({position:e})=>isNaN(e))&&(c={error:je("INVALID_X_TICK")});const I=f!==k.LEFT&&f!==k.RIGHT,N=E({initPos:a-d,maxSpaceAvailable:a,otherAxisSpace:x+d,securitySpace:y,tickValues:L}),H=w?b(N||[],[String(v)])[0]:0,M=I?b(j||[],[String(R)])[0]:0,O=C({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(H),extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,position:p}),D=T({canvasHeight:a,canvasWidth:r,customBreakAxis:Number(M),extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,position:f});return c?{crossXAxis:w,crossYAxis:I,error:c,extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,securityXSpace:g,securityYSpace:y,xAxisCoordinates:{coordinates:O,tickValues:[{position:0,value:"0"},{position:r,value:"1"}]},xAxisText:m,yAxisCoordinates:{coordinates:D,tickValues:[{position:a,value:"0"},{position:0,value:"1"}]},yAxisText:$}:{crossXAxis:w,crossYAxis:I,extraSpaceBottomY:d,extraSpaceLeftX:l,extraSpaceRightX:h,extraSpaceTopY:x,securityXSpace:g,securityYSpace:y,xAxisCoordinates:{coordinates:O,tickValues:j},xAxisText:m,yAxisCoordinates:{coordinates:D,tickValues:N},yAxisText:$}},De=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:a=p,caption:r,children:n,classNames:i,data:o,dataTestId:s="line-chart",getPathArea:c,height:d="100%",onErrors:g,role:y,tabIndex:m,width:S="100%",xKey:$,...k})=>{const{extraSpace:C,height:T,width:b}=a,[A,E]=u.useState(""),[R,L]=u.useState({height:0,width:0}),w=C?v(C):void 0,j=x(R.width,R.height,w),N=[l.jsx(Se,{},"default-x-axis"),l.jsx($e,{},"default-y-axis")],H=u.Children.toArray(n)||[],M=N.concat(H),O=Math.max(R.width,R.height,w??0),D=isNaN(R.width/O)?0:R.width/O,B=isNaN(R.height/O)?0:R.height/O;(({attrName:e,children:t,originalValue:a,updateValue:r})=>{let n="";u.Children.toArray(t).forEach(t=>{if(u.isValidElement(t)){const a=t.props[e];a&&(n+=a)}}),n!==a&&r(n)})({attrName:"dataKey",children:M,originalValue:A,updateValue:E});const _=f(o),W=u.useMemo(()=>Oe({ajustedX:D,ajustedY:B,canvasHeight:R.height,canvasWidth:R.width,children:M,data:o,viewBox:j,xKey:$}),[R.width,R.height,_,$,A]);u.useEffect(()=>{W.error&&g&&g({[ke.GENERIC]:W.error})},[W.error,g]);const{svgRef:F,xCursor:P,yCursor:V}=(({canvasHeight:e,canvasWidth:t})=>{const[[a,r],n]=u.useState([I,I]),i=u.useCallback((a,r)=>{const{height:i,left:o,top:s,width:c}=r.getBoundingClientRect(),d=a.clientX-o,l=a.clientY-s;n([d*t/c,l*e/i])},[t,e]),o=e=>{e.preventDefault()};return{svgRef:u.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:a,yCursor:r}})({canvasHeight:R.height,canvasWidth:R.width});return u.useEffect(()=>{const e=document.querySelector("[data-kbt-svg]");if(!e)return;const{parsedCanvasHeight:t,parsedCanvasWidth:a}=Le({canvasHeight:T,canvasWidth:b,svgElement:e});L({height:t,width:a})},[b,T]),u.useEffect(()=>{c?.({x1:W.extraSpaceLeftX,x2:R.width-W.extraSpaceRightX,y1:W.extraSpaceTopY,y2:R.height-W.extraSpaceBottomY})},[R.width,R.height]),l.jsx(h,{ref:F,ariaHidden:e,ariaLabel:t,caption:r,className:i,"data-kbt-svg":!0,dataTestId:s,height:d,role:y,tabIndex:m,viewBox:j,width:S,...k,children:l.jsx(xe.Provider,{value:{...W,canvasExtraSpace:w,canvasHeight:R.height,canvasWidth:R.width,data:o,dataTestId:s,xCursor:P,xKey:$,yCursor:V},children:n})})},{Path:({ariaLabel:e,closestClick:t,curved:a,getNodeFocusInfo:r,getNodesCoords:n,indicatorConfig:i,lineProjection:o,onClick:s,...c})=>{const{xAxisCoordinates:d,yAxisCoordinates:h,...x}=u.useContext(xe),{indicatorRef:p,pathRef:f}=((e,t)=>{const a=u.useRef(null),r=u.useRef(null);return u.useEffect(()=>{if(!t||!a.current||!r.current)return;const n=a.current,i=r.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:r,pathRef:a}})(x.xCursor,!!i),g=!!i&&x.xCursor!==-1/0,y=u.useRef(null),m=u.useRef(null),{autoClick:v,lineIndicator:S,...$}=i||{},k=x.extraSpaceTopY,C=Number(x.canvasHeight)-x.extraSpaceBottomY,{tickValues:T}=d,{tickValues:A}=h,E=me(x.data,x.xKey),R=me(x.data,c.dataKey),L=b(T,E,!0),j=b(A,R),I=L.map((e,t)=>[e,j[t]]),N=pe({curved:a,extendToBottom:!1,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),H=pe({curved:a,extendToBottom:!!c.fill||!!c.gradient,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY});u.useEffect(()=>{if(!y.current?.path)return;f.current=y.current.path;const e=y.current.main,t=y.current.node,a=E.map((e,t)=>({x:e,y:R[t]})),{mount:n,unmount:i}=(({data:e,getNodeFocusInfo:t,nodes:a,ref:r})=>{let n,i=!1;const o=r.querySelector("[data-draw]"),s=r=>{i&&("ArrowRight"===r.key?(n=void 0===n||n===a.length-1?0:n+1,a[n].focus(),t?.(e[n])):"ArrowLeft"===r.key&&(n=void 0===n||0===n?a.length-1:n-1,a[n].focus(),t?.(e[n])))},c=()=>{i=!0},d=()=>{i=!1},l=()=>{n=void 0};return{mount:()=>{r.addEventListener("focusin",c),r.addEventListener("focusout",d),o?.addEventListener("focus",l),window.addEventListener("keydown",e=>s(e))},unmount:()=>{r.removeEventListener("focusin",c),r.removeEventListener("focusout",d),o?.removeEventListener("focus",l),window.removeEventListener("keydown",e=>s(e))}}})({data:a,getNodeFocusInfo:r,nodes:t,ref:e});return n(),()=>i()},[]),u.useEffect(()=>{if(c.nodeConfig&&g&&v){const{idx:e,match:t}=((e,t)=>{let a=0,r=!1;for(let n=0;n<e.length;n++)if(Math.round(e[n])===Math.round(t)){r=!0,a=n;break}return{idx:a,match:r}})(L,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]),u.useEffect(()=>{n?.(I)},[I]);const M=w(c),O={...c,...M,...e&&{"aria-label":e}};return l.jsxs(l.Fragment,{children:[l.jsx(Y,{ref:y,d:N,dFill:H,dataTestId:`${x.dataTestId}path`,dataValue:x.data,points:I,xKey:x.xKey,onClick:e=>{if(s?.(e),t){const e=((e,t)=>{let a=0,r=Math.abs(e[0]-t);for(let n=1;n<e.length;n++){const i=Math.abs(e[n]-t);i<r&&(a=n,r=i)}return a})(L,x.xCursor),t=new MouseEvent("click",{bubbles:!0});t.autoClick=!1,y.current?.node?.[e]?.dispatchEvent(t)}},...O}),o&&l.jsx(ye,{curved:a,dataKey:c.dataKey,lineProjection:o,points:I,svgHeight:Number(x.canvasHeight)-x.extraSpaceBottomY}),g&&l.jsxs(l.Fragment,{children:[!!S&&l.jsx(Z,{...S,className:"pointer-events-none",x1:x.xCursor,x2:x.xCursor,y1:k,y2:C}),l.jsx("g",{ref:p,className:"pointer-events-none",children:l.jsx(V,{...$})})]})]})},Separator:({areaSeparator:e,dataTestId:t,rightSeparator:a,topSeparator:r,xBreakAxis:n,yBreakAxis:i})=>{const{crossXAxis:o,crossYAxis:s,xAxisCoordinates:c,yAxisCoordinates:d}=u.useContext(xe);if(!r&&!a&&!e)return l.jsx(l.Fragment,{});const h=n&&b(c.tickValues,[n],!0)[0],x=i&&b(d.tickValues,[i])[0],p=s?d.coordinates.x1:c.coordinates.x2,f=o?c.coordinates.y1:d.coordinates.y1,g=c.coordinates.x1,y=h??p,m=d.coordinates.y2,v=x??f,S=`M${g} ${m} H ${y} V ${v} H ${g} Z`,$=`M${g} ${v} H ${y}`,k=`M${y} ${m} V ${v}`;return l.jsxs("g",{children:[l.jsx("path",{d:S,"data-testid":`${t}Area`,...e}),l.jsx("path",{d:$,"data-testid":`${t}Top`,...r}),l.jsx("path",{d:k,"data-testid":`${t}Right`,...a})]})},XAxis:Se,YAxis:$e}),Be=({children:e,dataTestId:t,height:a,width:r,x:n,y:i})=>l.jsx("foreignObject",{"data-testid":t,height:a,width:r,x:n,y:i,children:e}),_e=u.createContext({}),We=(e,t,a)=>({x:e.x+t*Math.cos(a),y:e.y+t*Math.sin(a)}),Fe=({center:e,innerEnd:t,innerRadius:a,singleStroke:r})=>{if(!r)return a>0?`L ${t.x},${t.y}`:`L ${e.x},${e.y}`},Pe="CLOCKWISE",Ve=({canvasHeight:e,canvasWidth:t,color:a="blue",gap:r,halfChart:n,innerRadius:i,radius:o,singleStroke:s,startAngle:c,total:d,value:u,...h})=>{const x=(({canvasHeight:e,canvasWidth:t,customRadius:a,gap:r,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,x=a&&a<h?a:h,p=n?Math.PI:2*Math.PI,f={x:t/2,y:n?e:e/2},g=s?2*d:d,y=100*l/g*p/100,m=r/x,{carryAngle:v,finalAngle:S,initialAngle:$}=(({angleEquivalent:e,direction:t,gapAngle:a,startAngle:r})=>{const n=t===Pe;return{carryAngle:n?r+e:r-e,finalAngle:n?r+e-a/2:r-e+a/2,initialAngle:n?r+a/2:r-a/2}})({angleEquivalent:y,direction:o,gapAngle:m,startAngle:c.current});c.current=v;const k=p*l/g-m<=Math.PI?"0":"1",C=We(f,i,$),T=We(f,i,S),b=We(f,x,$);return(({center:e,innerEnd:t,innerRadius:a,innerStart:r,largeArcFlag:n,outerEnd:i,outerStart:o,radius:s,rotateDirection:c,singleStroke:d})=>{let l,u,h,x,p,f,g,y,m,v;return c===Pe?(l=`M ${o.x},${o.y}`,u=`A ${s},${s} 0 ${n} 1 ${i.x}, ${i.y}`,h=Fe({center:e,innerEnd:t,innerRadius:a,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=a>0?`A ${a},${a} 0 ${n} 0 ${r.x},${r.y}`:void 0,f=`M ${o.x},${o.y}`,y=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 0 ${i.x},${i.y}`,m=`A ${a},${a} 0 ${n} 1 ${r.x},${r.y}`,v=d?void 0:"Z"):(l=`M ${o.x} ${o.y}`,u=`A ${s},${s} 0 ${n},0 ${i.x}, ${i.y}`,h=Fe({center:e,innerEnd:t,innerRadius:a,singleStroke:d}),x=d?`M ${t.x},${t.y}`:void 0,p=a>0?`A ${a}, ${a} 0 ${n},1 ${r.x},${r.y}`:void 0,f=`M ${o.x},${o.y}`,y=`M ${t.x},${t.y}`,g=`A ${s},${s} 0 ${n} 1 ${i.x},${i.y}`,m=`A ${a},${a} 0 ${n} 0 ${r.x},${r.y}`,v=d?void 0:"Z"),[l,u,h,x,p,v].concat(d?[f,g,y,m]:[]).filter(Boolean).join(" ")})({center:f,innerEnd:T,innerRadius:i,innerStart:C,largeArcFlag:k,outerEnd:We(f,x,S),outerStart:b,radius:x,rotateDirection:o,singleStroke:s})})({canvasHeight:e,canvasWidth:t,customRadius:o,gap:r,halfChart:n,innerRadius:i,singleStroke:s,startAngle:c,total:d,value:u});return l.jsx(Y,{...h,d:x,dataValue:u,fill:a})},Xe=({dataKey:e,fill:t,gap:a,innerRadius:r,radius:n,...i})=>{const o=String(e),{canvasHeight:s,canvasWidth:c,data:d,dataTestId:h,halfChart:x}=u.useContext(_e),p=x?0:-Math.PI/2,f=u.useRef(p),g=d[o]?.reduce((e,t)=>e+t.value,0),y=1===d[o]?.length,m=r?v(r):void 0,S=n?v(n):void 0;return d[o]?.length?l.jsx("g",{children:d[o].map((e,r)=>u.createElement(Ve,{...i,...e,key:`${r.toString()}`,canvasHeight:s,canvasWidth:c,color:e.color||t,dataTestId:`${h}path-${r}`,gap:a,halfChart:x,innerRadius:m,radius:S,singleStroke:y,startAngle:f,total:g}))}):l.jsx(l.Fragment,{})},Ye=Object.assign(({ariaHidden:e,ariaLabel:t,canvasConfig:a=p,caption:r,children:n,classNames:i,data:o,dataTestId:s="pie-chart",halfChart:c,height:d="100%",radius:f="50%",role:g,tabIndex:y,width:m="100%",...S})=>{const{extraSpace:$,height:k,width:C}=a,T=v(C),b=v(k),A=$?v($):void 0,E=x(T,b,A),R=u.useMemo(()=>(({canvasHeight:e,canvasWidth:t,children:a,halfChart:r})=>{let n,i;u.Children.forEach(a,e=>{if(u.isValidElement(e)&&e.type===Xe){const{innerRadius:t}=e.props;if(!t)return;const a=v(t);(!n||a<n)&&(n=a)}}),n&&(i=2*n);const o=i??0,s=r?o/2:o,c=r?e:e/2;return{foreignObject:{height:s,width:o,x:t/2-o/2,y:r?c-s:c-s/2}}})({canvasHeight:b,canvasWidth:T,children:n,halfChart:c}),[k,C,c]);return l.jsx(h,{ariaHidden:e,ariaLabel:t,caption:r,className:i,dataTestId:s,height:d,radius:f,role:g,tabIndex:y,viewBox:E,width:m,...S,children:l.jsx(_e.Provider,{value:{...R,canvasHeight:b,canvasWidth:T,data:o,dataTestId:s,halfChart:c},children:n})})},{Foreign:({children:e,dataTestId:t,height:a,width:r,x:n,y:i,...o})=>{const{dataTestId:s,foreignObject:c}=u.useContext(_e),d=!r&&c?.width?c.width:r,h=!a&&c?.height?c.height:a,x=!n&&c?.x?c.x:n,p=!i&&c?.y?c.y:i,f=!t&&s?`${s}-foreign-object`:t;return l.jsx(Be,{...o,dataTestId:f,height:h,width:d,x:x,y:p,children:e})},Path:Xe}),Ke=({fill:e="#8f8f8f",x:t,y:a})=>l.jsxs("g",{fill:e,pointerEvents:"none",transform:`translate(${t-5}, ${a-5})`,children:[l.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"}),l.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"}),l.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"})]}),ze=({linesData:e})=>l.jsx(l.Fragment,{children:e.map((e,t)=>l.jsxs("g",{children:[e.config.fill&&e.fillPath&&l.jsx("path",{d:e.fillPath,fill:e.config.fill,fillOpacity:e.config.fillOpacity||.2,stroke:"none"}),l.jsx("path",{d:e.linePath,fill:"none",stroke:e.config.stroke||"#0078D4",strokeWidth:e.config.strokeWidth||1})]},e.config.dataKey||e.config.yKey||t))}),Ue={FOCUS_COLOR:"#0078D4",FOCUS_INNER:"#ffffff",INNER_FOCUS_STROKE_WIDTH:2,OUTER_FOCUS_STROKE_WIDTH:2,OUTLINES_GAP:0},Ze=({elementHeight:e,elementPosition:t,elementStrokeWidth:a=0,elementType:r,elementWidth:n,gap:i=0,innerStrokeWidth:o=2,outlineStrokeWidth:s=2})=>{if("circle"===r){const e=n/2+a/2+o/2+i,r=e+o/2+s/2;return{inner:{cx:t.x,cy:t.y,r:e},outer:{cx:t.x,cy:t.y,r:r},type:"circle"}}const c=n+a+o+2*i,d=e+a+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"}},Ge=(e,t,a)=>{const r=e.start/Math.max(1,t-1)*a;return{endX:e.end/Math.max(1,t-1)*a,startX:r}},qe=(e,t,a)=>{const r=Math.max(0,Math.min(t,e))/t;return Math.round(r*(a-1))},Qe=(e,t,a=.1)=>{const r=Math.max(0,Math.min(e.start,t-1-a));return{end:Math.min(t-1,Math.max(e.end,r+a)),start:r}},Je=e=>({end:Math.max(0,e-1),start:0}),et=(e,t)=>0===e.start&&e.end===t-1,tt=({endX:e,focusConfig:t,height:a,isFocused:r,startX:n})=>{if(!r)return null;const i=e-n,o=Ze({elementHeight:a,elementPosition:{x:n+i/2,y:a/2},elementStrokeWidth:0,elementType:"rectangle",elementWidth:i,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth}),s=t.outlineColor,c=t.innerColor,d=t.outlineStrokeWidth,u=t.innerStrokeWidth;return"rectangle"!==o.type?null:l.jsxs("g",{pointerEvents:"none",children:[l.jsx("rect",{fill:"none",height:o.outer.height,stroke:s,strokeWidth:d,width:o.outer.width,x:o.outer.x,y:o.outer.y}),l.jsx("rect",{fill:"none",height:o.inner.height,stroke:c,strokeWidth:u,width:o.inner.width,x:o.inner.x,y:o.inner.y})]})},at=({currentRange:e,dataLength:t,dataTestId:a,endX:r,height:n,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d,screenReaderText:u,selectionConfig:h,startX:x})=>{const p=h.hideOverlayOnFullRange&&et(e,t);return l.jsx(l.Fragment,{children:l.jsx("rect",{"aria-label":u,"aria-valuemax":t-1,"aria-valuemin":0,"aria-valuetext":u,cursor:"grab","data-testid":a,fill:h.fill,fillOpacity:h.fillOpacity,height:n,role:"slider",stroke:h.stroke,strokeWidth:h.strokeWidth,style:{outline:"none",visibility:p?"hidden":"visible"},tabIndex:0,width:r-x,x:x,y:0,onBlur:i,onFocus:o,onKeyDown:s,onMouseDown:c,onTouchStart:d})})},rt="#8f8f8f",nt=({dataTestId:e,focusConfig:t,handlerConfig:a,height:r,isFocused:n,max:i,min:o,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h,screenReaderText:x,x:p})=>{const f=r/2,g=(e=>({fill:e?.fill||"#ffffff",iconColor:e?.iconColor||rt,radius:e?.radius||17,stroke:e?.stroke||rt,strokeWidth:e?.strokeWidth||1,verticalLineStroke:e?.verticalLineStroke||rt,verticalLineStrokeWidth:e?.verticalLineStrokeWidth||2}))(a),y=Ze({elementHeight:2*g.radius,elementPosition:{x:p,y:f},elementStrokeWidth:"number"==typeof g.strokeWidth?g.strokeWidth:parseFloat(g.strokeWidth.toString()),elementType:"circle",elementWidth:2*g.radius,gap:t.gap,innerStrokeWidth:t.innerStrokeWidth,outlineStrokeWidth:t.outlineStrokeWidth});return l.jsxs("g",{"data-testid":`${e}-group`,children:[l.jsx("line",{pointerEvents:"none",stroke:g.verticalLineStroke,strokeWidth:g.verticalLineStrokeWidth,x1:p,x2:p,y1:0,y2:r}),l.jsx("circle",{"aria-label":x,"aria-valuemax":i,"aria-valuemin":o,"aria-valuetext":x,cursor:"ew-resize",cx:p,cy:f,"data-testid":e,fill:g.fill,r:g.radius,role:"slider",stroke:g.stroke,strokeWidth:g.strokeWidth,style:{outline:"none"},tabIndex:0,onBlur:s,onFocus:c,onKeyDown:d,onMouseDown:u,onTouchStart:h}),l.jsx(Ke,{fill:g.iconColor,x:p,y:f}),n&&"circle"===y.type&&l.jsxs("g",{pointerEvents:"none",children:[l.jsx("circle",{cx:y.outer.cx,cy:y.outer.cy,fill:"none",r:y.outer.r,stroke:t.outlineColor,strokeWidth:t.outlineStrokeWidth}),l.jsx("circle",{cx:y.inner.cx,cy:y.inner.cy,fill:"none",r:y.inner.r,stroke:t.innerColor,strokeWidth:t.innerStrokeWidth})]})]})},it={END_HANDLER:"END_HANDLER",SELECTION_AREA:"SELECTION_AREA",START_HANDLER:"START_HANDLER"},ot=e=>{const{currentRange:t,dataLength:a,interactionConfig:r,onRangeChange:n,width:i}=e,o=u.useRef(null),[s,c]=u.useState(null),d=u.useCallback(e=>()=>{c(e)},[]),l=u.useCallback(e=>()=>{c(e)},[]),h=u.useCallback(e=>{if(!s||!o.current)return;const c=o.current;if(!c)return;const d=e-c.getBoundingClientRect().left,l=qe(d,i,a),u=((e,t,a,r,n)=>{const i={...t};if(e===it.START_HANDLER)i.start=Math.max(0,Math.min(a,t.end-n.minHandlerDistance));else if(e===it.END_HANDLER)i.end=Math.min(r-1,Math.max(a,t.start+n.minHandlerDistance));else if(e===it.SELECTION_AREA){const e=t.end-t.start,n=Math.max(0,Math.min(r-1-e,a-e/2));i.start=n,i.end=n+e}return i})(s,t,l,a,r),h=Qe(u,a,r.minHandlerDistance);n(h)},[s,i,a,t,n,r]),x=u.useCallback(e=>{h(e.clientX)},[h]),p=u.useCallback(e=>{0!==e.touches.length&&(e.preventDefault(),h(e.touches[0].clientX))},[h]),f=u.useCallback(()=>{c(null)},[]),g=u.useCallback(()=>{c(null)},[]);return u.useEffect(()=>{if(s)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",f),document.addEventListener("touchmove",p,{passive:!1}),document.addEventListener("touchend",g),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",f),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",g)}},[s,x,f,p,g]),{groupRef:o,handleMouseDown:d,handleTouchStart:l,isDragging:s}},st=e=>{const{currentRange:t,dataLength:a,interactionConfig:r,onRangeChange:n}=e;return{handleKeyDown:u.useCallback(e=>i=>{const o=i.shiftKey?r.keyboardFastStep:r.keyboardStep;let s={...t};switch(i.key){case"ArrowLeft":case"ArrowDown":i.preventDefault(),s=((e,t,a,r)=>{const n={...t};if(e===it.START_HANDLER)n.start=Math.max(0,t.start-a);else if(e===it.END_HANDLER)n.end=Math.max(t.start+r.minHandlerDistance,t.end-a);else if(e===it.SELECTION_AREA){const e=t.end-t.start,r=Math.max(0,t.start-a);n.start=r,n.end=r+e}return n})(e,t,o,r);break;case"ArrowRight":case"ArrowUp":i.preventDefault(),s=((e,t,a,r,n)=>{const i={...t};if(e===it.START_HANDLER)i.start=Math.min(t.end-n.minHandlerDistance,t.start+a);else if(e===it.END_HANDLER)i.end=Math.min(r-1,t.end+a);else if(e===it.SELECTION_AREA){const e=t.end-t.start,n=Math.min(r-1-e,t.start+a);i.start=n,i.end=n+e}return i})(e,t,o,a,r);break;case"Home":i.preventDefault(),s=((e,t,a)=>{const r={...t};if(e===it.START_HANDLER)r.start=0;else if(e===it.END_HANDLER)r.end=a-1;else if(e===it.SELECTION_AREA){const e=t.end-t.start;r.start=0,r.end=e}return r})(e,t,a);break;case"End":i.preventDefault(),s=((e,t,a,r)=>{const n={...t};if(e===it.START_HANDLER)n.start=t.end-r.minHandlerDistance;else if(e===it.END_HANDLER)n.end=a-1;else if(e===it.SELECTION_AREA){const e=t.end-t.start;n.start=a-1-e,n.end=a-1}return n})(e,t,a,r);break;default:return}const c=Qe(s,a,r.minHandlerDistance);n(c)},[t,a,n,r])}},ct=({canvasConfig:e,dataTestId:t,extraSpace:a=0,height:r,width:n})=>{const[i,o]=u.useState({height:0,width:0}),s=u.useMemo(()=>e||{extraSpace:a,height:r,width:n},[e,n,r,a]),{extraSpace:c,height:d,width:l}=s,h=c?v(c):void 0;u.useEffect(()=>{const e=document.querySelector(`[data-testid="${t}"]`);if(!e)return;const a=()=>{const{parsedCanvasHeight:t,parsedCanvasWidth:a}=Le({canvasHeight:d,canvasWidth:l,svgElement:e});o({height:t,width:a})};a();const r=new ResizeObserver(()=>{a()});return r.observe(e),()=>{r.disconnect()}},[l,d,t]);const p=u.useMemo(()=>x(i.width,i.height,h),[i.width,i.height,h]);return{parsedCanvas:i,viewBox:p}},dt=()=>{const[e,t]=u.useState(null),a=u.useCallback(e=>()=>t(e),[]);return{handleBlur:u.useCallback(()=>{t(null)},[]),handleFocus:a,isFocused:u.useCallback(t=>e===t,[e])}},lt=(e,t)=>{const a=Math.floor(e);return Math.max(0,Math.min(t,a))},ut=(e,t)=>{const a=Math.ceil(e);return Math.max(0,Math.min(t,a))},ht=(e,t)=>{const a=Math.max(0,t-1);return{endIndex:ut(e.end,a),startIndex:lt(e.start,a)}},xt=({data:e,initialRange:t,onDataChange:a})=>{const r=t||Je(e.length),[n,i]=u.useState(r),o=t=>{if(!a||0===e.length)return;const{endIndex:r,startIndex:n}=ht(t,e.length),i=e.slice(n,r+1);a(i)};return u.useEffect(()=>{o(n)},[]),{currentRange:n,handleRangeChange:e=>{i(e),o(e)}}},pt=e=>({keyboardFastStep:e?.keyboardFastStep??2,keyboardStep:e?.keyboardStep??1,minHandlerDistance:e?.minHandlerDistance??1}),ft=e=>{if(0===e.length)return"";if(1===e.length)return`M ${e[0][0]} ${e[0][1]}`;const[t,...a]=e;let r=`M ${t[0]} ${t[1]}`;return a.forEach((e,n)=>{const i=0===n?t:a[n-1],[o,s]=i,[c,d]=e,l=.3*(c-o),u=[o+l,s],h=[c-l,d];r+=` C ${u[0]} ${u[1]}, ${h[0]} ${h[1]}, ${c} ${d}`}),r},gt=(e,t,a,r)=>{if(0===e.length||0===t.length)return[];const n=.05*r,i=r-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((r,o)=>[o/Math.max(1,e.length-1)*a,n+i-(Number(r[t.yKey])-s)/c*i]),d=t.curved?ft(o):`M ${o.map(([e,t])=>`${e},${t}`).join(" L ")}`;let l="";return t.fill&&(l=t.curved?`${ft(o)} L ${a} ${r} L 0 ${r} Z`:`${d} L ${a},${r} L 0,${r} Z`),{config:t,fillPath:l,linePath:d}})},yt=(e,t,a)=>e[a]?.[t]?.toString()||`${a}`,mt=(e,t,a)=>{if(!e)return e;const r=new RegExp("{{startValue}}","g"),n=new RegExp("{{endValue}}","g");return e.replace(r,t).replace(n,a)};e.Bar=z,e.BarChart=he,e.BarOrientation=$,e.ChartText=G,e.DefaultCanvasConfig=p,e.ErrorType=ke,e.FOCUS_DEFAULT=Ue,e.ForeignObject=Be,e.HandlerIcon=Ke,e.Line=Z,e.LineChart=De,e.LineRenderer=ze,e.Node=V,e.NodeType=F,e.Path=Y,e.PieChart=Ye,e.Positions=k,e.SelectionArea=at,e.SelectionAreaFocusRing=tt,e.SvgContainer=h,e.Tick=q,e.TickDataUtils=ve,e.XAxis=ee,e.YAxis=ne,e.ZoomArea=({ariaHidden:e,ariaLabel:t,backgroundColor:a,canvasConfig:r,caption:n,classNames:i,data:o,focusConfig:s,handlerConfig:c,height:d="40px",initialRange:x,interactionConfig:p,lines:g,onDataChange:y,role:m,screenReaderTextConfig:v,selectionConfig:S,width:$="100%",xKey:k,...C})=>{const T="zoom-area",b=pt(p),A=(E=S,{fill:E?.fill??"#0078d4",fillOpacity:E?.fillOpacity??.5,hideOverlayOnFullRange:E?.hideOverlayOnFullRange??true,stroke:E?.stroke??"#0078d4",strokeWidth:E?.strokeWidth??0});var E;const R=(e=>({gap:e?.gap??Ue.OUTLINES_GAP,innerColor:e?.innerColor??Ue.FOCUS_INNER,innerStrokeWidth:e?.innerStrokeWidth??Ue.INNER_FOCUS_STROKE_WIDTH,outlineColor:e?.outlineColor??Ue.FOCUS_COLOR,outlineStrokeWidth:e?.outlineStrokeWidth??Ue.OUTER_FOCUS_STROKE_WIDTH}))(s),{currentRange:L,handleRangeChange:w}=xt({data:o,initialRange:x,onDataChange:y}),{parsedCanvas:j,viewBox:I}=ct({canvasConfig:r,dataTestId:T,height:d,width:$}),N=f(o),H=JSON.stringify(g),M=((e,t,a,r)=>{const{endIndex:n,startIndex:i}=ht(a,e.length),o=yt(e,t,i),s=yt(e,t,n),c=mt(r?.startHandler,o,s)??o;return{endHandler:mt(r?.endHandler,o,s)??s,selectionArea:mt(r?.selectionArea,o,s)??`${o} - ${s}`,startHandler:c}})(o,k,L,v),O=u.useMemo(()=>gt(o,g,j.width,j.height),[N,H,j.width,j.height]),{endX:D,startX:B}=u.useMemo(()=>Ge(L,o.length,j.width),[L,N,j.width]),{handleBlur:_,handleFocus:W,isFocused:F}=dt(),{handleKeyDown:P}=st({currentRange:L,dataLength:o.length,interactionConfig:b,onRangeChange:w}),{groupRef:V,handleMouseDown:X,handleTouchStart:Y}=ot({currentRange:L,dataLength:o.length,interactionConfig:b,onRangeChange:w,width:j.width});return l.jsxs(h,{ref:V,ariaHidden:e,ariaLabel:t,backgroundColor:a,caption:n,className:i,"data-testid":T,height:d,overflow:"visible",role:m,viewBox:I,width:$,...C,children:[l.jsx(ze,{linesData:O}),l.jsx(at,{currentRange:L,dataLength:o.length,dataTestId:`${T}-selection-area`,endX:D,height:j.height,screenReaderText:M.selectionArea,selectionConfig:A,startX:B,onBlur:_,onFocus:W(it.SELECTION_AREA),onKeyDown:P(it.SELECTION_AREA),onMouseDown:X(it.SELECTION_AREA),onTouchStart:Y(it.SELECTION_AREA)}),l.jsx(nt,{dataTestId:`${T}-start-handler`,focusConfig:R,handlerConfig:c,height:j.height,isFocused:F(it.START_HANDLER),max:L.end-b.minHandlerDistance,min:0,screenReaderText:M.startHandler,type:it.START_HANDLER,value:L.start,x:B,onBlur:_,onFocus:W(it.START_HANDLER),onKeyDown:P(it.START_HANDLER),onMouseDown:X(it.START_HANDLER),onTouchStart:Y(it.START_HANDLER)}),l.jsx(nt,{dataTestId:`${T}-end-handler`,focusConfig:R,handlerConfig:c,height:j.height,isFocused:F(it.END_HANDLER),max:o.length-1,min:L.start+b.minHandlerDistance,screenReaderText:M.endHandler,type:it.END_HANDLER,value:L.end,x:D,onBlur:_,onFocus:W(it.END_HANDLER),onKeyDown:P(it.END_HANDLER),onMouseDown:X(it.END_HANDLER),onTouchStart:Y(it.END_HANDLER)}),l.jsx(tt,{endX:D,focusConfig:R,height:j.height,isFocused:F(it.SELECTION_AREA),startX:B})]})},e.ZoomAreaElements=it,e.ZoomHandler=nt,e.calculateHandlerPositions=Ge,e.calculateLinesPathData=gt,e.clampRange=Qe,e.createDefaultRange=Je,e.generateCurvedPath=ft,e.getInteractionConfig=pt,e.isFullRange=et,e.mouseToDataIndex=qe,e.useDragInteraction=ot,e.useKeyboardNavigation=st,e.useResponsiveCanvas=ct,e.useZoomAreaFocus=dt,e.useZoomData=xt,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const BarChart: import('
|
|
2
|
-
Path: import('
|
|
3
|
-
Separator: import('
|
|
4
|
-
XAxis: import('
|
|
5
|
-
YAxis: import('
|
|
1
|
+
declare const BarChart: import('react').FC<import('./barChart.type').BarChartProps> & {
|
|
2
|
+
Path: import('react').FC<import('./barChart.type').BarChartPathProps>;
|
|
3
|
+
Separator: import('react').FC<import('./barChart.type').BarChartSeparatorProps>;
|
|
4
|
+
XAxis: import('react').FC<import('./barChart.type').BarChartXAxisProps>;
|
|
5
|
+
YAxis: import('react').FC<import('./barChart.type').BarChartYAxisProps>;
|
|
6
6
|
};
|
|
7
7
|
export { BarChart };
|
|
8
8
|
export * from './barChart.type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from '
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { XAxisProps } from '../../components/axisChart/xAxis/xAxis.types';
|
|
3
3
|
import { YAxisProps } from '../../components/axisChart/yAxis/yAxis.types';
|
|
4
4
|
import { BarChartStyles, BarOrientation } from '../../components/bar/bar.type';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BarChartContextType } from '../barChart.type';
|
|
2
|
-
export declare const BarChartContext: import('
|
|
2
|
+
export declare const BarChartContext: import('react').Context<BarChartContextType>;
|
|
3
3
|
//# sourceMappingURL=barChartContext.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LineChartContextType } from '../lineChart.type';
|
|
2
|
-
export declare const LineChartContext: import('
|
|
2
|
+
export declare const LineChartContext: import('react').Context<LineChartContextType>;
|
|
3
3
|
//# sourceMappingURL=lineChartContext.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { LineChartProjectionProps } from '../lineChart.type';
|
|
3
3
|
export declare const LineChartProjection: FC<LineChartProjectionProps>;
|
|
4
4
|
//# sourceMappingURL=lineChartProjection.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare const LineChart: import('
|
|
2
|
-
Path: import('
|
|
3
|
-
Separator: import('
|
|
4
|
-
XAxis: import('
|
|
5
|
-
YAxis: import('
|
|
1
|
+
declare const LineChart: import('react').FC<import('./lineChart.type').LineChartProps> & {
|
|
2
|
+
Path: import('react').FC<import('./lineChart.type').LineChartPathProps>;
|
|
3
|
+
Separator: import('react').FC<import('./lineChart.type').LineChartSeparatorProps>;
|
|
4
|
+
XAxis: import('react').FC<import('./lineChart.type').LineChartXAxisProps>;
|
|
5
|
+
YAxis: import('react').FC<import('./lineChart.type').LineChartYAxisProps>;
|
|
6
6
|
};
|
|
7
7
|
export { LineChart };
|
|
8
8
|
export * from './lineChart.type';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from '
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { XAxisProps } from '../../components/axisChart/xAxis/xAxis.types';
|
|
3
3
|
import { YAxisProps } from '../../components/axisChart/yAxis/yAxis.types';
|
|
4
4
|
import { LineProps } from '../../components/line/line.types';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PieChartContextType } from '../pieChart.type';
|
|
2
|
-
export declare const PieChartContext: import('
|
|
2
|
+
export declare const PieChartContext: import('react').Context<PieChartContextType>;
|
|
3
3
|
//# sourceMappingURL=pieChartContext.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from '
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { ForeignObjectProps } from '../../../components/foreignObject/foreignObject.types';
|
|
3
3
|
export declare const PieChartForeign: FC<ForeignObjectProps>;
|
|
4
4
|
//# sourceMappingURL=pieChartForeign.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const PieChart: import('
|
|
2
|
-
Foreign: import('
|
|
3
|
-
Path: import('
|
|
1
|
+
declare const PieChart: import('react').FC<import('./pieChart.type').PieChartProps> & {
|
|
2
|
+
Foreign: import('react').FC<import('../..').ForeignObjectProps>;
|
|
3
|
+
Path: import('react').FC<import('../..').PathProps>;
|
|
4
4
|
};
|
|
5
5
|
export { PieChart };
|
|
6
6
|
export * from './pieChart.type';
|