import{r as n}from"./react-vendor-0bvDbF03.js";import{as as I,aA as O,b0 as S,ad as m,au as D,av as M,at as L,aG as k}from"./index-DMdfL0Ih.js";import{j as c}from"./query-vendor-CZu0EHPe.js";var v="Collapsible",[F,z]=I(v),[G,g]=F(v),A=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,open:a,defaultOpen:t,disabled:l,onOpenChange:i,...f}=e,[p=!1,d]=O({prop:a,defaultProp:t,onChange:i});return c.jsx(G,{scope:r,disabled:l,contentId:S(),open:p,onOpenToggle:n.useCallback(()=>d(C=>!C),[d]),children:c.jsx(m.div,{"data-state":R(p),"data-disabled":l?"":void 0,...f,ref:s})})});A.displayName=v;var T="CollapsibleTrigger",j=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,...a}=e,t=g(T,r);return c.jsx(m.button,{type:"button","aria-controls":t.contentId,"aria-expanded":t.open||!1,"data-state":R(t.open),"data-disabled":t.disabled?"":void 0,disabled:t.disabled,...a,ref:s,onClick:D(e.onClick,t.onOpenToggle)})});j.displayName=T;var x="CollapsibleContent",w=n.forwardRef((e,s)=>{const{forceMount:r,...a}=e,t=g(x,e.__scopeCollapsible);return c.jsx(M,{present:r||t.open,children:({present:l})=>c.jsx(B,{...a,ref:s,present:l})})});w.displayName=x;var B=n.forwardRef((e,s)=>{const{__scopeCollapsible:r,present:a,children:t,...l}=e,i=g(x,r),[f,p]=n.useState(a),d=n.useRef(null),C=L(s,d),h=n.useRef(0),y=h.current,N=n.useRef(0),P=N.current,b=i.open||f,E=n.useRef(b),u=n.useRef();return n.useEffect(()=>{const o=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(o)},[]),k(()=>{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();h.current=_.height,N.current=_.width,E.current||(o.style.transitionDuration=u.current.transitionDuration,o.style.animationName=u.current.animationName),p(a)}},[i.open,a]),c.jsx(m.div,{"data-state":R(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!b,...l,ref:C,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":P?`${P}px`:void 0,...e.style},children:b&&t})});function R(e){return e?"open":"closed"}var J=A,K=j,Q=w;export{Q as C,J as R,K as T,j as a,w as b,z as c};
//# sourceMappingURL=index-FXm5YYBt.js.map