"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require('./../../../../ext-esm/tslib/tslib.es6.js'),i=require("react/jsx-runtime"),s=require("classnames"),e=require("react"),n=require("@material-ui/core"),t=require("../../../../icons/iconParkIcons.js");require("../../../../icons/customIcons/icons/AddMessage.js"),require("../../../../icons/customIcons/icons/Attention.js"),require("../../../../icons/customIcons/icons/Collapse.js"),require("../../../../icons/customIcons/icons/Dashboard.js"),require("../../../../icons/customIcons/icons/Expand.js"),require("../../../../icons/customIcons/icons/FolderClosed.js"),require("../../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../../icons/customIcons/icons/FolderOpened.js"),require("../../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../../icons/customIcons/icons/Search.js"),require("../../../../icons/customIcons/icons/Wellhub.js"),require("../../../../icons/customIcons/icons/MultiRuler.js"),require("../../../../icons/customIcons/icons/Checkbox.js"),require("../../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../../icons/customIcons/icons/Radio.js"),require("../../../../icons/customIcons/icons/RadioChecked.js"),require("../../../../icons/customIcons/icons/SimulFrac.js"),require("../../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../../icons/customIcons/icons/CautionFilled.js"),require("../../../../icons/customIcons/icons/MoreApp.js");var l=require("./ToolboxButton.js");function c(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}var u=c(s),r=n.makeStyles((function(o){var i=o.palette;return{toolboxContainer:{position:"absolute",zIndex:1,right:function(o){var i=o.right;return i+7},bottom:function(o){var i=o.bottom;return i+8},width:30,height:"fit-content",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"4px 0"},activeIcon:{color:"".concat(i.primary.main," !important")},tooltipButton:{width:30,height:30,backgroundColor:i.background.b6,minWidth:0},disabledButton:{cursor:"not-allowed",color:"".concat(i.primary.text6," !important"),backgroundColor:"".concat(i.background.b6," !important")}}}));exports.Toolbox=function(s){var n,c,d,a,m,b,v,j,I,h,x,p,q,g,f,C=s.isPaneEnabled,B=s.handleTogglePane,k=s.handleToggleBrush,T=s.isBrushEnabled,Z=s.isZoomed,z=s.chart,O=s.customToolboxContainerClass,F=s.handleZoomReset,N=s.handleZoomOut,y=s.handleZoomIn,E=s.controls,M=e.useState({bottom:0,right:0}),P=M[0],R=M[1],_=r({bottom:P.bottom,right:P.right}),S=e.useCallback((function(){var o,i,s,e,n,t,l=null===(s=null===(i=null===(o=null==z?void 0:z.getOption())||void 0===o?void 0:o.grid)||void 0===i?void 0:i[0])||void 0===s?void 0:s.bottom,c=null===(t=null===(n=null===(e=null==z?void 0:z.getOption())||void 0===e?void 0:e.grid)||void 0===n?void 0:n[0])||void 0===t?void 0:t.right;l===P.bottom&&c===P.right||R({bottom:+l,right:+c})}),[P,z]);e.useEffect((function(){!z||P.bottom||P.right||z.on("rendered",S)}),[z]);return i.jsxs("div",o.__assign({className:u.default(_.toolboxContainer,O)},{children:[Z&&i.jsx(l.ToolboxButton,{icon:i.jsx(t.UndoIcon,{size:"small"}),title:"Reset Zoom",onClick:F,disabled:null===(b=null==E?void 0:E.resetZoom)||void 0===b?void 0:b.disabled,className:u.default(_.tooltipButton,(n={},n[_.disabledButton]=null===(v=null==E?void 0:E.resetZoom)||void 0===v?void 0:v.disabled,n))}),i.jsx(l.ToolboxButton,{icon:i.jsx(t.FiveIcon,{className:u.default(C&&_.activeIcon),size:"small"}),onClick:function(){B(!C),k(!1)},title:"Pan",disabled:!Z||(null===(j=null==E?void 0:E.pane)||void 0===j?void 0:j.disabled),className:u.default(_.tooltipButton,(c={},c[_.disabledButton]=!Z||(null===(I=null==E?void 0:E.pane)||void 0===I?void 0:I.disabled),c))}),i.jsx(l.ToolboxButton,{icon:i.jsx(t.MoveInIcon,{className:u.default(T&&_.activeIcon),size:"small"}),onClick:function(){k(!T),B(!1)},title:"Drag To Zoom",disabled:null===(h=null==E?void 0:E.brush)||void 0===h?void 0:h.disabled,className:u.default(_.tooltipButton,(d={},d[_.disabledButton]=null===(x=null==E?void 0:E.brush)||void 0===x?void 0:x.disabled,d))}),i.jsx(l.ToolboxButton,{icon:i.jsx(t.PlusIcon,{size:"small"}),onClick:y,title:"Zoom In",disabled:null===(p=null==E?void 0:E.zoomIn)||void 0===p?void 0:p.disabled,className:u.default(_.tooltipButton,(a={},a[_.disabledButton]=null===(q=null==E?void 0:E.zoomIn)||void 0===q?void 0:q.disabled,a))}),i.jsx(l.ToolboxButton,{icon:i.jsx(t.MinusIcon,{size:"small"}),onClick:N,title:"Zoom Out",disabled:!Z||(null===(g=null==E?void 0:E.zoomOut)||void 0===g?void 0:g.disabled),className:u.default(_.tooltipButton,(m={},m[_.disabledButton]=!Z||(null===(f=null==E?void 0:E.zoomOut)||void 0===f?void 0:f.disabled),m))})]}))};
