"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),r=require("@babel/runtime/helpers/objectWithoutProperties"),t=require("@babel/runtime/helpers/defineProperty"),i=require("react/jsx-runtime"),n=require("react"),o=require("@material-ui/core"),l=require("classnames");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(r),s=c(t),f=c(l),p=["children","className","maxLines","showTooltip"];function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){s.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var h=o.makeStyles({root:function(e){var r=e.maxLines;return d({overflow:"hidden"},r?{display:"-webkit-box","-webkit-line-clamp":r,"-webkit-box-orient":"vertical"}:{whiteSpace:"nowrap",textOverflow:"ellipsis"})}});module.exports=function(e){var r=e.children,t=e.className,l=void 0===t?"":t,c=e.maxLines,s=void 0===c?null:c,b=e.showTooltip,m=void 0===b||b,v=u.default(e,p),O=n.useState(!1),j=a.default(O,2),y=j[0],w=j[1],x=n.useRef(null),P=h({maxLines:s});n.useEffect((function(){if(x.current){var e=x.current,r=e.scrollWidth,t=e.clientWidth,i=e.scrollHeight,n=e.clientHeight;w(s?i>n:r>t)}}));var g=i.jsx("div",d(d({className:f.default(P.root,l),ref:x},v),{},{children:r}));return y&&m?i.jsx(o.Tooltip,{title:null!=r?r:"",children:g}):g};
//# sourceMappingURL=index.js.map
