"use strict";var o=require("react/jsx-runtime"),e=require("react"),s=require("classnames"),c=require("@material-ui/core"),i=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 r=require("../../utils/main.js");function n(o){return o&&"object"==typeof o&&"default"in o?o:{default:o}}var t=n(s),u=c.makeStyles((function(o){return{iconWrapper:{color:o.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:o.palette.primary.contrastText}},tooltip:{color:o.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}}));module.exports=function(s){var n=s.children,a=s.classes,l=void 0===a?{}:a,p=s.dataTestId,m=s.IconComponent,d=void 0===m?function(){return o.jsx(i.CopyIcon,{size:16})}:m,j=s.tooltipProps,q=void 0===j?{title:"Copied",placement:"bottom",delay:1500}:j,I=e.useState(!1),f=I[0],C=I[1],x=u();return e.useEffect((function(){var o=setTimeout((function(){C(!1)}),q.delay);return function(){return clearTimeout(o)}}),[f]),o.jsx(c.Tooltip,{classes:{tooltip:t.default(x.tooltip,l.tooltip),popper:l.tooltipPopper},title:q.title,open:f,disableFocusListener:!0,disableHoverListener:!0,placement:q.placement,children:o.jsx("span",{className:t.default(x.iconWrapper,l.iconWrapper),onClick:function(){C(!0),r.copyToClipboard(n)},children:o.jsx(d,{className:l.icon,"data-testid":p})})})};
