1import{aQ as oe,P as re,R as l,j as n,U as M,Q as te,aV as ne,W as ae,V as H,ad as ce,r as y,$ as E}from"./index-CYq90Ixi.js";import{c as $,R as se,T as ie,b as le}from"./index-CKF2aMOp.js";import{C as de}from"./chevron-down-Cde1272n.js";var d="Accordion",pe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[S,fe,ue]=oe(d),[g,ye]=re(d,[ue,$]),k=$(),K=l.forwardRef((o,a)=>{const{type:e,...t}=o,c=t,r=t;return n.jsx(S.Provider,{scope:o.__scopeAccordion,children:e==="multiple"?n.jsx(Ae,{...r,ref:a}):n.jsx(ve,{...c,ref:a})})});K.displayName=d;var[L,me]=g(d),[U,xe]=g(d,{collapsible:!1}),ve=l.forwardRef((o,a)=>{const{value:e,defaultValue:t,onValueChange:c=()=>{},collapsible:r=!1,...i}=o,[s,p]=M({prop:e,defaultProp:t??"",onChange:c,caller:d});return n.jsx(L,{scope:o.__scopeAccordion,value:l.useMemo(()=>s?[s]:[],[s]),onItemOpen:p,onItemClose:l.useCallback(()=>r&&p(""),[r,p]),children:n.jsx(U,{scope:o.__scopeAccordion,collapsible:r,children:n.jsx(z,{...i,ref:a})})})}),Ae=l.forwardRef((o,a)=>{const{value:e,defaultValue:t,onValueChange:c=()=>{},...r}=o,[i,s]=M({prop:e,defaultProp:t??[],onChange:c,caller:d}),p=l.useCallback(x=>s((u=[])=>[...u,x]),[s]),m=l.useCallback(x=>s((u=[])=>u.filter(h=>h!==x)),[s]);return n.jsx(L,{scope:o.__scopeAccordion,value:i,onItemOpen:p,onItemClose:m,children:n.jsx(U,{scope:o.__scopeAccordion,collapsible:!0,children:n.jsx(z,{...r,ref:a})})})}),[Ce,b]=g(d),z=l.forwardRef((o,a)=>{const{__scopeAccordion:e,disabled:t,dir:c,orientation:r="vertical",...i}=o,s=l.useRef(null),p=te(s,a),m=fe(e),u=ne(c)==="ltr",h=ae(o.onKeyDown,v=>{var O;if(!pe.includes(v.key))return;const Z=v.target,I=m().filter(_=>{var V;return!((V=_.ref.current)!=null&&V.disabled)}),A=I.findIndex(_=>_.ref.current===Z),T=I.length;if(A===-1)return;v.preventDefault();let f=A;const w=0,R=T-1,j=()=>{f=A+1,f>R&&(f=w)},N=()=>{f=A-1,f<w&&(f=R)};switch(v.key){case"Home":f=w;break;case"End":f=R;break;case"ArrowRight":r==="horizontal"&&(u?j():N());break;case"ArrowDown":r==="vertical"&&j();break;case"ArrowLeft":r==="horizontal"&&(u?N():j());break;case"ArrowUp":r==="vertical"&&N();break}const ee=f%T;(O=I[ee].ref.current)==null||O.focus()});return n.jsx(Ce,{scope:e,disabled:t,direction:c,orientation:r,children:n.jsx(S.Slot,{scope:e,children:n.jsx(H.div,{...i,"data-orientation":r,ref:p,onKeyDown:t?void 0:h})})})}),C="AccordionItem",[ge,D]=g(C),G=l.forwardRef((o,a)=>{const{__scopeAccordion:e,value:t,...c}=o,r=b(C,e),i=me(C,e),s=k(e),p=ce(),m=t&&i.value.includes(t)||!1,x=r.disabled||o.disabled;return n.jsx(ge,{scope:e,open:m,disabled:x,triggerId:p,children:n.jsx(se,{"data-orientation":r.orientation,"data-state":F(m),...s,...c,ref:a,disabled:x,open:m,onOpenChange:u=>{u?i.onItemOpen(t):i.onItemClose(t)}})})});G.displayName=C;var Q="AccordionHeader",W=l.forwardRef((o,a)=>{const{__scopeAccordion:e,...t}=o,c=b(d,e),r=D(Q,e);return n.jsx(H.h3,{"data-orientation":c.orientation,"data-state":F(r.open),"data-disabled":r.disabled?"":void 0,...t,ref:a})});W.displayName=Q;var P="AccordionTrigger",Y=l.forwardRef((o,a)=>{const{__scopeAccordion:e,...t}=o,c=b(d,e),r=D(P,e),i=xe(P,e),s=k(e);return n.jsx(S.ItemSlot,{scope:e,children:n.jsx(ie,{"aria-disabled":r.open&&!i.collapsible||void 0,"data-orientation":c.orientation,id:r.triggerId,...s,...t,ref:a})})});Y.displayName=P;var q="AccordionContent",B=l.forwardRef((o,a)=>{const{__scopeAccordion:e,...t}=o,c=b(d,e),r=D(q,e),i=k(e);return n.jsx(le,{role:"region","aria-labelledby":r.triggerId,"data-orientation":c.orientation,...i,...t,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...o.style}})});B.displayName=q;function F(o){return o?"open":"closed"}var be=K,he=G,Ie=W,J=Y,X=B;const Ee=be,we=y.forwardRef(({className:o,...a},e)=>n.jsx(he,{ref:e,className:E("border-b",o),...a}));
1we.displayName="AccordionItem";const Re=y.forwardRef(({className:o,children:a,...e},t)=>n.jsx(Ie,{className:"flex",children:n.jsxs(J,{ref:t,className:E("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",o),...e,children:[a,n.jsx(de,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Re.displayName=J.displayName;const je=y.forwardRef(({className:o,children:a,...e},t)=>n.jsx(X,{ref:t,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...e,children:n.jsx("div",{className:E("pb-4 pt-0",o),children:a})}));je.displayName=X.displayName;export{Ee as A,we as a,Re as b,je as c};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.