"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),o=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),i=require("classnames"),n=require("@material-ui/core"),a=require("lodash"),l=require("../context/index.js"),c=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(e),d=u(t),p=u(o),b=u(i),f=["children"];function h(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,r)}return o}function g(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?h(Object(o),!0).forEach((function(t){s.default(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):h(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var m=n.makeStyles((function(e){var t=e.palette,o=e.spacing;return{list:{height:"100%",padding:o(1,0),fontSize:16,"& .MuiAutocomplete-option":{display:"block",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}},'& .MuiAutocomplete-option[aria-selected="true"]':{backgroundColor:"initial"},"& .MuiAutocomplete-option:active":{backgroundColor:"initial"}},noTopPadding:{paddingTop:0,"& $topShadow::before":{top:0}},shadow:{position:"sticky",display:"none",width:"100%",zIndex:1,"&::before":{content:"''",position:"absolute",width:"100%",height:o(1),zIndex:1}},bottomShadow:{bottom:0,"&::before":{bottom:o(-1),backgroundImage:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(t.background.b9," 100%)")}},topShadow:{top:0,"&::before":{top:o(-1),backgroundImage:"linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ".concat(t.background.b9," 100%)")}},visibleShadow:{display:"block"}}})),v=r.memo((function(e){var t=e.children,o=p.default(e,f),i=r.useState(!1),u=d.default(i,2),s=u[0],h=u[1],v=r.useState(!1),w=d.default(v,2),y=w[0],j=w[1],O=r.useRef(),S=m(),k=l.default().AllSelectComponent;return r.useEffect((function(){var e=O.current,t=a.throttle((function(){h((null==e?void 0:e.scrollTop)>0),j((null==e?void 0:e.clientHeight)+(null==e?void 0:e.scrollTop)<(null==e?void 0:e.scrollHeight))}),100,{leading:!0});return t(),null==e||e.addEventListener("scroll",t),function(){null==e||e.removeEventListener("scroll",t)}})),c.jsxs(n.List,g(g({},o),{},{className:b.default(o.className,S.list,!!k&&S.noTopPadding),ref:O,role:"listbox",children:[c.jsx("div",{className:b.default(S.shadow,S.topShadow,s&&S.visibleShadow)}),t,c.jsx("div",{className:b.default(S.shadow,S.bottomShadow,y&&S.visibleShadow)})]}))}));module.exports=v;
//# sourceMappingURL=Listbox.js.map
