"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),r=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);exports.useContainerMaxHeight=function(e){var t=r.useState(1/0),a=n.default(t,2),i=a[0],u=a[1];return r.useLayoutEffect((function(){var r;if(e){var t=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)}(e))};t();var n=new ResizeObserver(t);return e.parentElement&&n.observe(e.parentElement),null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",t),function(){var e;n.disconnect(),null===(e=window.visualViewport)||void 0===e||e.removeEventListener("resize",t)}}}),[e]),i};
//# sourceMappingURL=useContainerMaxHeight.js.map
