import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useLayoutEffect as t}from"react";var n=function(n){var a=r(1/0),i=e(a,2),o=i[0],u=i[1];return t((function(){var e;if(n){var r=function(){return u(function(e){var r=e.parentElement;if(!r)return 1/0;var t=getComputedStyle(r),n=Number.parseFloat(t.maxHeight);if(!Number.isFinite(n))return 1/0;var a=getComputedStyle(e);return Math.max(n-(Number.parseFloat(t.paddingTop)||0)-(Number.parseFloat(t.paddingBottom)||0)-(Number.parseFloat(a.paddingTop)||0)-(Number.parseFloat(a.paddingBottom)||0),0)}(n))};r();var t=new ResizeObserver(r);return n.parentElement&&t.observe(n.parentElement),null===(e=window.visualViewport)||void 0===e||e.addEventListener("resize",r),function(){var e;t.disconnect(),null===(e=window.visualViewport)||void 0===e||e.removeEventListener("resize",r)}}}),[n]),o};export{n as useContainerMaxHeight};
//# sourceMappingURL=useContainerMaxHeight.js.map
