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