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