"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require('./../../../ext-esm/tslib/tslib.es6.js'),e=require("react/jsx-runtime"),o=require("react"),r=require("classnames"),a=require("@material-ui/core");function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l=i(r),n="top",c="right",s="bottom",u="left",b="both",d=a.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%)")}}}}})),g=o.forwardRef((function(r,i){var g=r.stickyHeader,p=r.className,h=r.stickyColumn,T=r.classes,m=t.__rest(r,["stickyHeader","className","stickyColumn","classes"]),f=o.useState(g?s:""),k=f[0],y=f[1],M=o.useState(h?c:""),x=M[0],P=M[1],H=d({top:k===n,bottom:k===s,bothVertical:k===b,left:x===u,right:x===c,bothHorizontal:x===b,isStickyHeader:g}),S=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(b)};return e.jsx(a.TableContainer,t.__assign({onScroll:function(t){g?S({scroll:t.currentTarget.scrollTop,clientParam:t.currentTarget.clientHeight,scrollParam:t.currentTarget.scrollHeight,setScrollPosition:y,gradientPositions:[s,n]}):h&&S({scroll:t.currentTarget.scrollLeft,clientParam:t.currentTarget.clientWidth,scrollParam:t.currentTarget.scrollWidth,setScrollPosition:P,gradientPositions:[c,u]})},className:l.default(H.root,p,null==T?void 0:T.root),ref:i},m))}));exports.TableContainer=g;
