"use strict";const B=require("react/jsx-runtime"),e=require("react"),g=require("../tools/tools.cjs"),R=(y,l,t)=>{const[s,h]=e.useState(y),[f,d]=e.useState(!1),[a,E]=e.useState(!1),[H,p]=e.useState(!1),[b,n]=e.useState(0),v=e.useRef(null),u=e.useRef(null);return e.useEffect(()=>{h(y)},[y]),e.useEffect(()=>{if(!l){t==null||t(s);return}const o=v.current,c=u.current;if(o&&c){const i=()=>{p(!1),E(!0),d(s),t==null||t(s)},r=c.offsetHeight+"",m=c.dataset.lastHeight;return(!m||r!=="0"&&m!==r)&&(c.dataset.lastHeight=r),o.addEventListener("transitionend",i),E(!1),()=>o.removeEventListener("transitionend",i)}},[s,l,t]),e.useEffect(()=>{l&&(a||d(!1))},[a,l]),e.useEffect(()=>{if(l&&!a&&!f){const o=u.current;if(o){const c=o.offsetHeight,i=o.dataset.lastHeight,r=s?i?Number(i):c:0;n(r),p(!0)}}},[a,f,s,l]),{bodyElement:u,collapse:a,collapseElement:v,collapseHeight:b,collapsing:H,show:s,visible:f}},S=function(l){const{as:t="div",children:s,className:h,collapsing:f=!0,dropOldClass:d,onChange:a,show:E=!0,style:H,variables:p,...b}=l,n=f===void 0||f,{bodyElement:v,collapse:u,collapseElement:o,collapseHeight:c,collapsing:i,show:r,visible:m}=R(E,n,a),w=e.useMemo(()=>{const x=g.classx(!d&&"accordion-collapse",i&&"collapsing",n&&u&&"collapse",n&&m&&"show",!n&&(r?"collapse show":"collapse"),h),A=g.stylex((j,N)=>({tKey:g.convertBsKeyToVar(N)}),{height:n&&c},p,H);return{className:x,style:A}},[h,u,c,i,d,n,r,H,p,m]);return B.jsx(t,{...b,...w,ref:o,children:B.jsx("div",{className:"accordion-body",ref:v,children:s})})};S.displayName="BRL.AccordionBody";exports.AccordionBody=S;
//# sourceMappingURL=accordion-body.cjs.map
