"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@babel/runtime/helpers/defineProperty"),e=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),a=require("classnames"),i=require("@material-ui/core"),l=require("react/jsx-runtime");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var c=n(t),s=n(e),u=n(o),b=n(a),p=["stickyHeader","className","stickyColumn","classes"];function d(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),o.push.apply(o,r)}return o}var g="top",f="right",h="bottom",y="left",m="both",P=i.makeStyles((function(t){return{root:function(e){return{borderTop:e.isStickyHeader?"1px solid ".concat(t.palette.primary.text9):"none","& .MuiTable-root .MuiTableHead-root .MuiTableRow-head":{position:(e.top||e.bothVertical)&&"sticky",zIndex:2,top:0,boxShadow:(e.top||e.bothVertical)&&"0px 16px 10px ".concat(t.palette.background.b4)},"& .MuiTable-root .MuiTableFooter-root":{"&:before":{content:(e.bottom||e.bothVertical)&&"no-open-quote",position:"absolute",bottom:-1,width:"inherit",height:"16px",background:"linear-gradient(360deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)"),transform:"matrix(1, 0, 0, -1, 0, 0)"}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyCell":{"&:after":{content:(e.left||e.bothHorizontal)&&"no-open-quote",position:"absolute",top:0,right:"-16px",width:"16px",height:"100%",background:"linear-gradient(270deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)")}},"& .MuiTable-root .MuiTableHead-root .MuiTableRow-head .stickyEmptyCell, & .MuiTable-root .MuiTableBody-root .MuiTableRow-root .stickyEmptyCell":{background:(e.right||e.bothHorizontal)&&"linear-gradient(90deg, rgba(44, 44, 44, 0) 0%, ".concat(t.palette.background.b4," 100%)")}}}}})),T=r.forwardRef((function(t,e){var o=t.stickyHeader,a=t.className,n=t.stickyColumn,T=t.classes,k=u.default(t,p),M=r.useState(o?h:""),O=s.default(M,2),j=O[0],w=O[1],x=r.useState(n?f:""),H=s.default(x,2),S=H[0],v=H[1],q=P({top:j===g,bottom:j===h,bothVertical:j===m,left:S===y,right:S===f,bothHorizontal:S===m,isStickyHeader:o}),C=function(t){var e=t.scroll,o=t.clientParam,r=t.scrollParam,a=t.setScrollPosition,i=t.gradientPositions;0===e?a(i[0]):Math.ceil(e)+o===r?a(i[1]):a(m)};return l.jsx(i.TableContainer,function(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?d(Object(o),!0).forEach((function(e){c.default(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):d(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}({onScroll:function(t){o?C({scroll:t.target.scrollTop,clientParam:t.target.clientHeight,scrollParam:t.target.scrollHeight,setScrollPosition:w,gradientPositions:[h,g]}):n&&C({scroll:t.target.scrollLeft,clientParam:t.target.clientWidth,scrollParam:t.target.scrollWidth,setScrollPosition:v,gradientPositions:[f,y]})},className:b.default(q.root,a,null==T?void 0:T.root),ref:e},k))}));exports.TableContainer=T;
