Liferay.Loader.define("change-tracking-web@2.0.87/publications/js/components/form/hooks/useHeightTransition",["module","exports","require","liferay!frontend-js-react-web$react"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function useHeightTransition(e,t,r){const[c,i]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{c&&(setCollapseHeight(r),e&&removeCollapseHeight(r))}),[r,c,e]),[c,n=>{n.target===r.current&&c&&!e?(t(!0),i(!1),removeCollapseHeight(r)):n.target===r.current&&(t(!1),i(!1))},t=>{t.preventDefault(),e&&!c&&setCollapseHeight(r),c||i(!0)}]};var n=r("liferay!frontend-js-react-web$react");const removeCollapseHeight=e=>{e&&e.current&&e.current.style.removeProperty("height")},setCollapseHeight=e=>{if(e&&e.current){const t=Array.prototype.slice.call(e.current.children).reduce(((e,t)=>e+t.clientHeight),0);e.current.setAttribute("style","height: ".concat(t,"px"))}}}}));
//# sourceMappingURL=useHeightTransition.js.map