import{b as u,aF as B,R as p,j as s,n as fe}from"./admin-PjhPIC32.js";import{g as k,j as $,k as y,l as z,P,n as Y,o as pe,q as L}from"./index-B9H2J4vJ.js";var me=B[" useId ".trim().toString()]||(()=>{}),ve=0;function J(e){const[t,o]=u.useState(me());return k(()=>{o(r=>r??String(ve++))},[e]),t?`radix-${t}`:""}var Ce=B[" useInsertionEffect ".trim().toString()]||k;function V({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){const[c,n,l]=xe({defaultProp:t,onChange:o}),a=e!==void 0,m=a?e:c;{const d=u.useRef(e!==void 0);u.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const v=u.useCallback(d=>{if(a){const f=ge(d)?d(e):d;f!==e&&l.current?.(f)}else n(d)},[a,e,n,l]);return[m,v]}function xe({defaultProp:e,onChange:t}){const[o,r]=u.useState(e),c=u.useRef(o),n=u.useRef(t);return Ce(()=>{n.current=t},[t]),u.useEffect(()=>{c.current!==o&&(n.current?.(o),c.current=o)},[o,c]),[o,r,n]}function ge(e){return typeof e=="function"}function be(e){const t=e+"CollectionProvider",[o,r]=$(t),[c,n]=o(t,{collectionRef:{current:null},itemMap:new Map}),l=x=>{const{scope:C,children:b}=x,i=p.useRef(null),g=p.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:g,collectionRef:i,children:b})};l.displayName=t;const a=e+"CollectionSlot",m=z(a),v=p.forwardRef((x,C)=>{const{scope:b,children:i}=x,g=n(a,b),h=y(C,g.collectionRef);return s.jsx(m,{ref:h,children:i})});v.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",I=z(d),A=p.forwardRef((x,C)=>{const{scope:b,children:i,...g}=x,h=p.useRef(null),N=y(C,h),_=n(d,b);return p.useEffect(()=>(_.itemMap.set(h,{ref:h,...g}),()=>void _.itemMap.delete(h))),s.jsx(I,{[f]:"",ref:N,children:i})});A.displayName=d;function w(x){const C=n(e+"CollectionConsumer",x);return p.useCallback(()=>{const i=C.collectionRef.current;if(!i)return[];const g=Array.from(i.querySelectorAll(`[${f}]`));return Array.from(C.itemMap.values()).sort((_,O)=>g.indexOf(_.ref.current)-g.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:v,ItemSlot:A},w,r]}var S="Collapsible",[Ae,Q]=$(S),[he,H]=Ae(S),W=u.forwardRef((e,t)=>{const{__scopeCollapsible:o,open:r,defaultOpen:c,disabled:n,onOpenChange:l,...a}=e,[m,v]=V({prop:r,defaultProp:c??!1,onChange:l,caller:S});return s.jsx(he,{scope:o,disabled:n,contentId:J(),open:m,onOpenToggle:u.useCallback(()=>v(d=>!d),[v]),children:s.jsx(P.div,{"data-state":G(m),"data-disabled":n?"":void 0,...a,ref:t})})});W.displayName=S;var X="CollapsibleTrigger",Z=u.forwardRef((e,t)=>{const{__scopeCollapsible:o,...r}=e,c=H(X,o);return s.jsx(P.button,{type:"button","aria-controls":c.contentId,"aria-expanded":c.open||!1,"data-state":G(c.open),"data-disabled":c.disabled?"":void 0,disabled:c.disabled,...r,ref:t,onClick:Y(e.onClick,c.onOpenToggle)})});Z.displayName=X;var F="CollapsibleContent",ee=u.forwardRef((e,t)=>{const{forceMount:o,...r}=e,c=H(F,e.__scopeCollapsible);return s.jsx(pe,{present:o||c.open,children:({present:n})=>s.jsx(Re,{...r,ref:t,present:n})})});ee.displayName=F;var Re=u.forwardRef((e,t)=>{const{__scopeCollapsible:o,present:r,children:c,...n}=e,l=H(F,o),[a,m]=u.useState(r),v=u.useRef(null),d=y(t,v),f=u.useRef(0),I=f.current,A=u.useRef(0),w=A.current,x=l.open||a,C=u.useRef(x),b=u.useRef(void 0);return u.useEffect(()=>{const i=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(i)},[]),k(()=>{const i=v.current;if(i){b.current=b.current||{transitionDuration:i.style.transitionDuration,animationName:i.style.animationName},i.style.transitionDuration="0s",i.style.animationName="none";const g=i.getBoundingClientRect();f.current=g.height,A.current=g.width,C.current||(i.style.transitionDuration=b.current.transitionDuration,i.style.animationName=b.current.animationName),m(r)}},[l.open,r]),s.jsx(P.div,{"data-state":G(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!x,...n,ref:d,style:{"--radix-collapsible-content-height":I?`${I}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:x&&c})});function G(e){return e?"open":"closed"}var Ie=W,_e=Z,we=ee,Ne=u.createContext(void 0);function Pe(e){const t=u.useContext(Ne);return e||t||"ltr"}var R="Accordion",ye=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[K,je,Se]=be(R),[E]=$(R,[Se,Q]),U=Q(),oe=p.forwardRef((e,t)=>{const{type:o,...r}=e,c=r,n=r;return s.jsx(K.Provider,{scope:e.__scopeAccordion,children:o==="multiple"?s.jsx(Te,{...n,ref:t}):s.jsx(Oe,{...c,ref:t})})});oe.displayName=R;var[te,Ee]=E(R),[ne,Me]=E(R,{collapsible:!1}),Oe=p.forwardRef((e,t)=>{const{value:o,defaultValue:r,onValueChange:c=()=>{},collapsible:n=!1,...l}=e,[a,m]=V({prop:o,defaultProp:r??"",onChange:c,caller:R});return s.jsx(te,{scope:e.__scopeAccordion,value:p.useMemo(()=>a?[a]:[],[a]),onItemOpen:m,onItemClose:p.useCallback(()=>n&&m(""),[n,m]),children:s.jsx(ne,{scope:e.__scopeAccordion,collapsible:n,children:s.jsx(re,{...l,ref:t})})})}),Te=p.forwardRef((e,t)=>{const{value:o,defaultValue:r,onValueChange:c=()=>{},...n}=e,[l,a]=V({prop:o,defaultProp:r??[],onChange:c,caller:R}),m=p.useCallback(d=>a((f=[])=>[...f,d]),[a]),v=p.useCallback(d=>a((f=[])=>f.filter(I=>I!==d)),[a]);return s.jsx(te,{scope:e.__scopeAccordion,value:l,onItemOpen:m,onItemClose:v,children:s.jsx(ne,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(re,{...n,ref:t})})})}),[De,M]=E(R),re=p.forwardRef((e,t)=>{const{__scopeAccordion:o,disabled:r,dir:c,orientation:n="vertical",...l}=e,a=p.useRef(null),m=y(a,t),v=je(o),f=Pe(c)==="ltr",I=Y(e.onKeyDown,A=>{if(!ye.includes(A.key))return;const w=A.target,x=v().filter(T=>!T.ref.current?.disabled),C=x.findIndex(T=>T.ref.current===w),b=x.length;if(C===-1)return;A.preventDefault();let i=C;const g=0,h=b-1,N=()=>{i=C+1,i>h&&(i=g)},_=()=>{i=C-1,i<g&&(i=h)};switch(A.key){case"Home":i=g;break;case"End":i=h;break;case"ArrowRight":n==="horizontal"&&(f?N():_());break;case"ArrowDown":n==="vertical"&&N();break;case"ArrowLeft":n==="horizontal"&&(f?_():N());break;case"ArrowUp":n==="vertical"&&_();break}const O=i%b;x[O].ref.current?.focus()});return s.jsx(De,{scope:o,disabled:r,direction:c,orientation:n,children:s.jsx(K.Slot,{scope:o,children:s.jsx(P.div,{...l,"data-orientation":n,ref:m,onKeyDown:r?void 0:I})})})}),j="AccordionItem",[ke,q]=E(j),ce=p.forwardRef((e,t)=>{const{__scopeAccordion:o,value:r,...c}=e,n=M(j,o),l=Ee(j,o),a=U(o),m=J(),v=r&&l.value.includes(r)||!1,d=n.disabled||e.disabled;return s.jsx(ke,{scope:o,open:v,disabled:d,triggerId:m,children:s.jsx(Ie,{"data-orientation":n.orientation,"data-state":ue(v),...a,...c,ref:t,disabled:d,open:v,onOpenChange:f=>{f?l.onItemOpen(r):l.onItemClose(r)}})})});ce.displayName=j;var se="AccordionHeader",ae=p.forwardRef((e,t)=>{const{__scopeAccordion:o,...r}=e,c=M(R,o),n=q(se,o);return s.jsx(P.h3,{"data-orientation":c.orientation,"data-state":ue(n.open),"data-disabled":n.disabled?"":void 0,...r,ref:t})});ae.displayName=se;var D="AccordionTrigger",ie=p.forwardRef((e,t)=>{const{__scopeAccordion:o,...r}=e,c=M(R,o),n=q(D,o),l=Me(D,o),a=U(o);return s.jsx(K.ItemSlot,{scope:o,children:s.jsx(_e,{"aria-disabled":n.open&&!l.collapsible||void 0,"data-orientation":c.orientation,id:n.triggerId,...a,...r,ref:t})})});ie.displayName=D;var le="AccordionContent",de=p.forwardRef((e,t)=>{const{__scopeAccordion:o,...r}=e,c=M(R,o),n=q(le,o),l=U(o);return s.jsx(we,{role:"region","aria-labelledby":n.triggerId,"data-orientation":c.orientation,...l,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});de.displayName=le;function ue(e){return e?"open":"closed"}var $e=oe,Le=ce,Ve=ae,He=ie,Fe=de;function Ue({...e}){return s.jsx($e,{"data-loc":"client/src/components/ui/accordion.tsx:10","data-slot":"accordion",...e})}function qe({className:e,...t}){return s.jsx(Le,{"data-loc":"client/src/components/ui/accordion.tsx:18","data-slot":"accordion-item",className:L("border-b last:border-b-0",e),...t})}function ze({className:e,children:t,...o}){return s.jsx(Ve,{"data-loc":"client/src/components/ui/accordion.tsx:32",className:"flex",children:s.jsxs(He,{"data-loc":"client/src/components/ui/accordion.tsx:33","data-slot":"accordion-trigger",className:L("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,s.jsx(fe,{"data-loc":"client/src/components/ui/accordion.tsx:42",className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Be({className:e,children:t,...o}){return s.jsx(Fe,{"data-loc":"client/src/components/ui/accordion.tsx:54","data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...o,children:s.jsx("div",{"data-loc":"client/src/components/ui/accordion.tsx:59",className:L("pt-0 pb-4",e),children:t})})}export{Ue as A,qe as a,ze as b,Be as c};