import{r as n,j as c}from"./markdown-9_JKOUHQ.js";import{n as O,P as g,o as T,p as S,q as D,h as M,r as $,g as L}from"./index-Z_QI94Zg.js";var f="Collapsible",[k]=L(f),[F,v]=k(f),j=n.forwardRef((e,a)=>{const{__scopeCollapsible:r,open:s,defaultOpen:t,disabled:l,onOpenChange:i,...C}=e,[p,d]=O({prop:s,defaultProp:t??!1,onChange:i,caller:f});return c.jsx(F,{scope:r,disabled:l,contentId:T(),open:p,onOpenToggle:n.useCallback(()=>d(b=>!b),[d]),children:c.jsx(g.div,{"data-state":h(p),"data-disabled":l?"":void 0,...C,ref:a})})});j.displayName=f;var w="CollapsibleTrigger",A=n.forwardRef((e,a)=>{const{__scopeCollapsible:r,...s}=e,t=v(w,r);return c.jsx(g.button,{type:"button","aria-controls":t.contentId,"aria-expanded":t.open||!1,"data-state":h(t.open),"data-disabled":t.disabled?"":void 0,disabled:t.disabled,...s,ref:a,onClick:S(e.onClick,t.onOpenToggle)})});A.displayName=w;var x="CollapsibleContent",I=n.forwardRef((e,a)=>{const{forceMount:r,...s}=e,t=v(x,e.__scopeCollapsible);return c.jsx(D,{present:r||t.open,children:({present:l})=>c.jsx(q,{...s,ref:a,present:l})})});I.displayName=x;var q=n.forwardRef((e,a)=>{const{__scopeCollapsible:r,present:s,children:t,...l}=e,i=v(x,r),[C,p]=n.useState(s),d=n.useRef(null),b=M(a,d),R=n.useRef(0),y=R.current,P=n.useRef(0),N=P.current,m=i.open||C,E=n.useRef(m),u=n.useRef(void 0);return n.useEffect(()=>{const o=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(o)},[]),$(()=>{const o=d.current;if(o){u.current=u.current||{transitionDuration:o.style.transitionDuration,animationName:o.style.animationName},o.style.transitionDuration="0s",o.style.animationName="none";const _=o.getBoundingClientRect();R.current=_.height,P.current=_.width,E.current||(o.style.transitionDuration=u.current.transitionDuration,o.style.animationName=u.current.animationName),p(s)}},[i.open,s]),c.jsx(g.div,{"data-state":h(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...l,ref:b,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":N?`${N}px`:void 0,...e.style},children:m&&t})});function h(e){return e?"open":"closed"}var B=j;const z=B,J=A,K=I;export{z as C,J as a,K as b};
