"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),o=require("classnames"),n=require("../Button/components/Button/index.js");require("moment-timezone"),require("@material-ui/core");var c=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"),require("../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../Button/components/LiveButton/styles.js");var r=require("../Typography.js"),i=require("../Popper/Popper.js"),t=require("../IconButton/index.js"),u=require("./styles.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(o);exports.Hint=function(o){var l=u.useStyles(),m=s.useRef(),d=s.useState(),j=d[0],q=d[1],p=s.useState(),h=p[0],I=p[1];if(s.useEffect((function(){setTimeout((function(){return I(o.open?o.anchorEl||m.current:void 0)}),100)})),!o.anchorEl&&s.Children.count(o.children)>1)throw new Error("Hint expects a single reffable element as a child");var f=o.anchorEl?o.children:s.Children.map(o.children,(function(e){return s.isValidElement(e)?s.cloneElement(e,{ref:m}):e}));return e.jsxs(e.Fragment,{children:[f,e.jsxs(i.Popper,{className:a.default(l.popper,o.className),transition:!0,open:!!h,anchorEl:h,placement:o.placement,modifiers:{flip:{enabled:!0},arrow:{enabled:!!j,element:j}},children:[e.jsx("div",{ref:q,className:l.arrow}),e.jsxs("div",{className:l.tooltip,children:[o.title&&e.jsx("span",{className:a.default(l.title,o.onClose&&l.hasClose),children:o.title}),o.onClose&&e.jsx(t,{onClick:o.onClose,className:l.close,size:"small",children:e.jsx(c.CloseIcon,{})}),o.content&&e.jsx(r.Regular14,{className:l.content,children:o.content}),o.onConfirm&&e.jsx(n,{color:"inherit",className:l.button,onClick:o.onConfirm,children:o.confirmText||"Got It"})]})]})]})};
