import r from"@babel/runtime/helpers/defineProperty";import{makeStyles as e}from"@material-ui/core";import{isEmpty as o}from"lodash";import{useEffect as t}from"react";import{updateAxisStyles as n}from"../formations.js";function i(r,e){var o=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.push.apply(o,t)}return o}function s(e){for(var o=1;o<arguments.length;o++){var t=null!=arguments[o]?arguments[o]:{};o%2?i(Object(t),!0).forEach((function(o){r(e,o,t[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var a=function(r,e,o){var t,n,i;return(null===(t=window.Highcharts)||void 0===t||null===(n=t.version)||void 0===n?void 0:n.startsWith("10"))?{zooming:{type:o||!e?"none":r.zoomType,panning:{enabled:!e,type:(null===(i=r.panning)||void 0===i?void 0:i.type)||"xy"},panKey:""}}:{zoomType:o||!e?"none":r.zoomType}},c=e({axisGrab:{cursor:"grab"},axisCrosshair:{cursor:"crosshair"}}),l=function(r){var e=r.chart,i=r.chartOptions,l=r.isZoomEnabled,p=r.isMinHeightChart,u=r.handleChartSelection,f=r.onZoomChangeCallback,h=r.isAxesCoordinatesShown,g=c();t((function(){if(!o(e)){var r={zIndex:1,color:"#ffffff",dashStyle:"dash"};e.plotBackground.element.style.cursor=p||!l?"grab":"crosshair",e.series.forEach((function(r){var e;return null==r||null===(e=r.group)||void 0===e?void 0:e.css({cursor:p||!l?"grab":"crosshair"})})),e.update({chart:s(s({},i),{},{plotBackgroundColor:"transparent"},a(i,l,p)),xAxis:{crosshair:h?r:null,className:l?g.axisCrosshair:g.axisGrab,events:{afterSetExtremes:function(r){var o,t;"zoom"!==r.trigger&&"navigator"!==r.trigger||u(),null!==(o=e.xAxis)&&void 0!==o&&null!==(t=o[0].userOptions.plotLines)&&void 0!==t&&t.length&&n({chart:e}),f(r)}}},yAxis:{crosshair:h?r:null,className:l?g.axisCrosshair:g.axisGrab,events:{afterSetExtremes:function(r){"zoom"!==r.trigger&&"navigator"!==r.trigger||u(),f(r)}}},plotOptions:{series:{cursor:p||!l?"grab":"crosshair"}}})}}),[l,u,h])};export{l as useChartModifier};
//# sourceMappingURL=useChartModifier.js.map
