import r from"@babel/runtime/helpers/defineProperty";import e from"@babel/runtime/helpers/slicedToArray";import{useImperativeHandle as t}from"react";import{ClusterConfig as o}from"../constants.js";function n(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 i(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var c=function(r,n,c,f){t(r,(function(){return{flyToWell:function(r){var t,p=n.current;if(p&&f){var l=c.find((function(e){return e.id===r}));if(null!=l&&null!==(t=l.topHole)&&void 0!==t&&t.coordinates){var u=e(l.topHole.coordinates,2),a=u[0],s=u[1],b=p.getZoom()<o.flyToZoom;p.easeTo(i(i({center:[s,a]},b&&{zoom:o.flyToZoom}),{},{duration:300}))}}}}}),[n,f,c])};export{c as useFlyToWell};
//# sourceMappingURL=useFlyToWell.js.map
