coder-config 0.41.33 → 0.42.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.41.33';
5
+ const VERSION = '0.42.2';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.41.33",
3
+ "version": "0.42.2",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",
@@ -557,7 +557,7 @@ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHid
557
557
  For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},KL="DialogDescriptionWarning",qL=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$S(KL).contentName}}.`;return C.useEffect(()=>{var u;const o=(u=e.current)==null?void 0:u.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},zS=jS,YL=ES,lg=AS,hd=TS,fd=RS,md=DS,pd=IS,cg=BS;const Et=zS,XL=lg,HS=C.forwardRef(({className:e,...t},n)=>r.jsx(hd,{ref:n,className:Ee("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));HS.displayName=hd.displayName;const Ct=C.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(XL,{children:[r.jsx(HS,{}),r.jsxs(fd,{ref:s,className:Ee("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,r.jsxs(cg,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[r.jsx(ri,{className:"h-4 w-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ct.displayName=fd.displayName;const St=({className:e,...t})=>r.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});St.displayName="DialogHeader";const Rt=({className:e,...t})=>r.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rt.displayName="DialogFooter";const kt=C.forwardRef(({className:e,...t},n)=>r.jsx(md,{ref:n,className:Ee("text-lg font-semibold leading-none tracking-tight",e),...t}));kt.displayName=md.displayName;const ir=C.forwardRef(({className:e,...t},n)=>r.jsx(pd,{ref:n,className:Ee("text-sm text-muted-foreground",e),...t}));ir.displayName=pd.displayName;function ug(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function dg(e){const[t,n]=C.useState(void 0);return Cr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const u=o[0];let d,l;if("borderBoxSize"in u){const c=u.borderBoxSize,f=Array.isArray(c)?c[0]:c;d=f.inlineSize,l=f.blockSize}else d=e.offsetWidth,l=e.offsetHeight;n({width:d,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}var gd="Checkbox",[JL]=tn(gd),[QL,hg]=JL(gd);function ZL(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:o,disabled:u,form:d,name:l,onCheckedChange:c,required:f,value:m="on",internal_do_not_use_render:h}=e,[x,w]=ls({prop:n,defaultProp:o??!1,onChange:c,caller:gd}),[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useRef(!1),y=k?!!d||!!k.closest("form"):!0,j={checked:x,disabled:u,setChecked:w,control:k,setControl:_,name:l,form:d,value:m,hasConsumerStoppedPropagationRef:g,required:f,defaultChecked:ni(o)?!1:o,isFormControl:y,bubbleInput:v,setBubbleInput:b};return r.jsx(QL,{scope:t,...j,children:eI(h)?h(j):s})}var WS="CheckboxTrigger",VS=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...s},o)=>{const{control:u,value:d,disabled:l,checked:c,required:f,setControl:m,setChecked:h,hasConsumerStoppedPropagationRef:x,isFormControl:w,bubbleInput:k}=hg(WS,e),_=ct(o,m),v=C.useRef(c);return C.useEffect(()=>{const b=u==null?void 0:u.form;if(b){const g=()=>h(v.current);return b.addEventListener("reset",g),()=>b.removeEventListener("reset",g)}},[u,h]),r.jsx(et.button,{type:"button",role:"checkbox","aria-checked":ni(c)?"mixed":c,"aria-required":f,"data-state":YS(c),"data-disabled":l?"":void 0,disabled:l,value:d,...s,ref:_,onKeyDown:Le(t,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:Le(n,b=>{h(g=>ni(g)?!0:!g),k&&w&&(x.current=b.isPropagationStopped(),x.current||b.stopPropagation())})})});VS.displayName=WS;var fg=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c,onCheckedChange:f,form:m,...h}=e;return r.jsx(ZL,{__scopeCheckbox:n,checked:o,defaultChecked:u,disabled:l,required:d,onCheckedChange:f,name:s,form:m,value:c,internal_do_not_use_render:({isFormControl:x})=>r.jsxs(r.Fragment,{children:[r.jsx(VS,{...h,ref:t,__scopeCheckbox:n}),x&&r.jsx(qS,{__scopeCheckbox:n})]})})});fg.displayName=gd;var US="CheckboxIndicator",GS=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:s,...o}=e,u=hg(US,n);return r.jsx(Tr,{present:s||ni(u.checked)||u.checked===!0,children:r.jsx(et.span,{"data-state":YS(u.checked),"data-disabled":u.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});GS.displayName=US;var KS="CheckboxBubbleInput",qS=C.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:s,hasConsumerStoppedPropagationRef:o,checked:u,defaultChecked:d,required:l,disabled:c,name:f,value:m,form:h,bubbleInput:x,setBubbleInput:w}=hg(KS,e),k=ct(n,w),_=ug(u),v=dg(s);C.useEffect(()=>{const g=x;if(!g)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set,P=!o.current;if(_!==u&&E){const A=new Event("click",{bubbles:P});g.indeterminate=ni(u),E.call(g,ni(u)?!1:u),g.dispatchEvent(A)}},[x,_,u,o]);const b=C.useRef(ni(u)?!1:u);return r.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??b.current,required:l,disabled:c,name:f,value:m,form:h,...t,tabIndex:-1,ref:k,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});qS.displayName=KS;function eI(e){return typeof e=="function"}function ni(e){return e==="indeterminate"}function YS(e){return ni(e)?"indeterminate":e?"checked":"unchecked"}const Hi=C.forwardRef(({className:e,...t},n)=>r.jsx(fg,{ref:n,className:Ee("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:r.jsx(GS,{className:Ee("flex items-center justify-center text-current"),children:r.jsx(Jt,{className:"h-4 w-4"})})}));Hi.displayName=fg.displayName;function Mb(e){const t=tI(e),n=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(nI);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return r.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return r.jsx(t,{...d,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function tI(e){const t=C.forwardRef((n,s)=>{const{children:o,...u}=n;if(C.isValidElement(o)){const d=iI(o),l=sI(u,o.props);return o.type!==C.Fragment&&(l.ref=s?Ts(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var rI=Symbol("radix.slottable");function nI(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===rI}function sI(e,t){const n={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function iI(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mg(e){const t=e+"CollectionProvider",[n,s]=tn(t),[o,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=_=>{const{scope:v,children:b}=_,g=Re.useRef(null),y=Re.useRef(new Map).current;return r.jsx(o,{scope:v,itemMap:y,collectionRef:g,children:b})};d.displayName=t;const l=e+"CollectionSlot",c=Mb(l),f=Re.forwardRef((_,v)=>{const{scope:b,children:g}=_,y=u(l,b),j=ct(v,y.collectionRef);return r.jsx(c,{ref:j,children:g})});f.displayName=l;const m=e+"CollectionItemSlot",h="data-radix-collection-item",x=Mb(m),w=Re.forwardRef((_,v)=>{const{scope:b,children:g,...y}=_,j=Re.useRef(null),E=ct(v,j),P=u(m,b);return Re.useEffect(()=>(P.itemMap.set(j,{ref:j,...y}),()=>void P.itemMap.delete(j))),r.jsx(x,{[h]:"",ref:E,children:g})});w.displayName=m;function k(_){const v=u(e+"CollectionConsumer",_);return Re.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((P,A)=>y.indexOf(P.ref.current)-y.indexOf(A.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:d,Slot:f,ItemSlot:w},k,s]}const oI=["top","right","bottom","left"],ai=Math.min,un=Math.max,Bu=Math.round,lu=Math.floor,os=e=>({x:e,y:e}),aI={left:"right",right:"left",bottom:"top",top:"bottom"},lI={start:"end",end:"start"};function $m(e,t,n){return un(e,ai(t,n))}function Es(e,t){return typeof e=="function"?e(t):e}function Ps(e){return e.split("-")[0]}function Yo(e){return e.split("-")[1]}function pg(e){return e==="x"?"y":"x"}function gg(e){return e==="y"?"height":"width"}const cI=new Set(["top","bottom"]);function ns(e){return cI.has(Ps(e))?"y":"x"}function xg(e){return pg(ns(e))}function uI(e,t,n){n===void 0&&(n=!1);const s=Yo(e),o=xg(e),u=gg(o);let d=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(d=Fu(d)),[d,Fu(d)]}function dI(e){const t=Fu(e);return[zm(e),t,zm(t)]}function zm(e){return e.replace(/start|end/g,t=>lI[t])}const Db=["left","right"],Lb=["right","left"],hI=["top","bottom"],fI=["bottom","top"];function mI(e,t,n){switch(e){case"top":case"bottom":return n?t?Lb:Db:t?Db:Lb;case"left":case"right":return t?hI:fI;default:return[]}}function pI(e,t,n,s){const o=Yo(e);let u=mI(Ps(e),n==="start",s);return o&&(u=u.map(d=>d+"-"+o),t&&(u=u.concat(u.map(zm)))),u}function Fu(e){return e.replace(/left|right|bottom|top/g,t=>aI[t])}function gI(e){return{top:0,right:0,bottom:0,left:0,...e}}function XS(e){return typeof e!="number"?gI(e):{top:e,right:e,bottom:e,left:e}}function $u(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}function Ib(e,t,n){let{reference:s,floating:o}=e;const u=ns(t),d=xg(t),l=gg(d),c=Ps(t),f=u==="y",m=s.x+s.width/2-o.width/2,h=s.y+s.height/2-o.height/2,x=s[l]/2-o[l]/2;let w;switch(c){case"top":w={x:m,y:s.y-o.height};break;case"bottom":w={x:m,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:h};break;case"left":w={x:s.x-o.width,y:h};break;default:w={x:s.x,y:s.y}}switch(Yo(t)){case"start":w[d]-=x*(n&&f?-1:1);break;case"end":w[d]+=x*(n&&f?-1:1);break}return w}const xI=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:d}=n,l=u.filter(Boolean),c=await(d.isRTL==null?void 0:d.isRTL(t));let f=await d.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:h}=Ib(f,s,c),x=s,w={},k=0;for(let _=0;_<l.length;_++){const{name:v,fn:b}=l[_],{x:g,y,data:j,reset:E}=await b({x:m,y:h,initialPlacement:s,placement:x,strategy:o,middlewareData:w,rects:f,platform:d,elements:{reference:e,floating:t}});m=g??m,h=y??h,w={...w,[v]:{...w[v],...j}},E&&k<=50&&(k++,typeof E=="object"&&(E.placement&&(x=E.placement),E.rects&&(f=E.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:m,y:h}=Ib(f,x,c)),_=-1)}return{x:m,y:h,placement:x,strategy:o,middlewareData:w}};async function ul(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:d,elements:l,strategy:c}=e,{boundary:f="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:x=!1,padding:w=0}=Es(t,e),k=XS(w),v=l[x?h==="floating"?"reference":"floating":h],b=$u(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(v)))==null||n?v:v.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(l.floating)),boundary:f,rootBoundary:m,strategy:c})),g=h==="floating"?{x:s,y:o,width:d.floating.width,height:d.floating.height}:d.reference,y=await(u.getOffsetParent==null?void 0:u.getOffsetParent(l.floating)),j=await(u.isElement==null?void 0:u.isElement(y))?await(u.getScale==null?void 0:u.getScale(y))||{x:1,y:1}:{x:1,y:1},E=$u(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:c}):g);return{top:(b.top-E.top+k.top)/j.y,bottom:(E.bottom-b.bottom+k.bottom)/j.y,left:(b.left-E.left+k.left)/j.x,right:(E.right-b.right+k.right)/j.x}}const vI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:o,rects:u,platform:d,elements:l,middlewareData:c}=t,{element:f,padding:m=0}=Es(e,t)||{};if(f==null)return{};const h=XS(m),x={x:n,y:s},w=xg(o),k=gg(w),_=await d.getDimensions(f),v=w==="y",b=v?"top":"left",g=v?"bottom":"right",y=v?"clientHeight":"clientWidth",j=u.reference[k]+u.reference[w]-x[w]-u.floating[k],E=x[w]-u.reference[w],P=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f));let A=P?P[y]:0;(!A||!await(d.isElement==null?void 0:d.isElement(P)))&&(A=l.floating[y]||u.floating[k]);const N=j/2-E/2,R=A/2-_[k]/2-1,I=ai(h[b],R),O=ai(h[g],R),B=I,$=A-_[k]-O,Y=A/2-_[k]/2+N,z=$m(B,Y,$),K=!c.arrow&&Yo(o)!=null&&Y!==z&&u.reference[k]/2-(Y<B?I:O)-_[k]/2<0,G=K?Y<B?Y-B:Y-$:0;return{[w]:x[w]+G,data:{[w]:z,centerOffset:Y-z-G,...K&&{alignmentOffset:G}},reset:K}}}),yI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:u,rects:d,initialPlacement:l,platform:c,elements:f}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:_=!0,...v}=Es(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const b=Ps(o),g=ns(l),y=Ps(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(f.floating)),E=x||(y||!_?[Fu(l)]:dI(l)),P=k!=="none";!x&&P&&E.push(...pI(l,_,k,j));const A=[l,...E],N=await ul(t,v),R=[];let I=((s=u.flip)==null?void 0:s.overflows)||[];if(m&&R.push(N[b]),h){const Y=uI(o,d,j);R.push(N[Y[0]],N[Y[1]])}if(I=[...I,{placement:o,overflows:R}],!R.every(Y=>Y<=0)){var O,B;const Y=(((O=u.flip)==null?void 0:O.index)||0)+1,z=A[Y];if(z&&(!(h==="alignment"?g!==ns(z):!1)||I.every(U=>ns(U.placement)===g?U.overflows[0]>0:!0)))return{data:{index:Y,overflows:I},reset:{placement:z}};let K=(B=I.filter(G=>G.overflows[0]<=0).sort((G,U)=>G.overflows[1]-U.overflows[1])[0])==null?void 0:B.placement;if(!K)switch(w){case"bestFit":{var $;const G=($=I.filter(U=>{if(P){const L=ns(U.placement);return L===g||L==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(L=>L>0).reduce((L,M)=>L+M,0)]).sort((U,L)=>U[1]-L[1])[0])==null?void 0:$[0];G&&(K=G);break}case"initialPlacement":K=l;break}if(o!==K)return{reset:{placement:K}}}return{}}}};function Ob(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bb(e){return oI.some(t=>e[t]>=0)}const bI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:s="referenceHidden",...o}=Es(e,t);switch(s){case"referenceHidden":{const u=await ul(t,{...o,elementContext:"reference"}),d=Ob(u,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Bb(d)}}}case"escaped":{const u=await ul(t,{...o,altBoundary:!0}),d=Ob(u,n.floating);return{data:{escapedOffsets:d,escaped:Bb(d)}}}default:return{}}}}},JS=new Set(["left","top"]);async function wI(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),d=Ps(n),l=Yo(n),c=ns(n)==="y",f=JS.has(d)?-1:1,m=u&&c?-1:1,h=Es(t,e);let{mainAxis:x,crossAxis:w,alignmentAxis:k}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof k=="number"&&(w=l==="end"?k*-1:k),c?{x:w*m,y:x*f}:{x:x*f,y:w*m}}const _I=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:u,placement:d,middlewareData:l}=t,c=await wI(t,e);return d===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:o+c.x,y:u+c.y,data:{...c,placement:d}}}}},CI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:l={fn:v=>{let{x:b,y:g}=v;return{x:b,y:g}}},...c}=Es(e,t),f={x:n,y:s},m=await ul(t,c),h=ns(Ps(o)),x=pg(h);let w=f[x],k=f[h];if(u){const v=x==="y"?"top":"left",b=x==="y"?"bottom":"right",g=w+m[v],y=w-m[b];w=$m(g,w,y)}if(d){const v=h==="y"?"top":"left",b=h==="y"?"bottom":"right",g=k+m[v],y=k-m[b];k=$m(g,k,y)}const _=l.fn({...t,[x]:w,[h]:k});return{..._,data:{x:_.x-n,y:_.y-s,enabled:{[x]:u,[h]:d}}}}}},SI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:o,rects:u,middlewareData:d}=t,{offset:l=0,mainAxis:c=!0,crossAxis:f=!0}=Es(e,t),m={x:n,y:s},h=ns(o),x=pg(h);let w=m[x],k=m[h];const _=Es(l,t),v=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const y=x==="y"?"height":"width",j=u.reference[x]-u.floating[y]+v.mainAxis,E=u.reference[x]+u.reference[y]-v.mainAxis;w<j?w=j:w>E&&(w=E)}if(f){var b,g;const y=x==="y"?"width":"height",j=JS.has(Ps(o)),E=u.reference[h]-u.floating[y]+(j&&((b=d.offset)==null?void 0:b[h])||0)+(j?0:v.crossAxis),P=u.reference[h]+u.reference[y]+(j?0:((g=d.offset)==null?void 0:g[h])||0)-(j?v.crossAxis:0);k<E?k=E:k>P&&(k=P)}return{[x]:w,[h]:k}}}},kI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:o,rects:u,platform:d,elements:l}=t,{apply:c=()=>{},...f}=Es(e,t),m=await ul(t,f),h=Ps(o),x=Yo(o),w=ns(o)==="y",{width:k,height:_}=u.floating;let v,b;h==="top"||h==="bottom"?(v=h,b=x===(await(d.isRTL==null?void 0:d.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,v=x==="end"?"top":"bottom");const g=_-m.top-m.bottom,y=k-m.left-m.right,j=ai(_-m[v],g),E=ai(k-m[b],y),P=!t.middlewareData.shift;let A=j,N=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=y),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(A=g),P&&!x){const I=un(m.left,0),O=un(m.right,0),B=un(m.top,0),$=un(m.bottom,0);w?N=k-2*(I!==0||O!==0?I+O:un(m.left,m.right)):A=_-2*(B!==0||$!==0?B+$:un(m.top,m.bottom))}await c({...t,availableWidth:N,availableHeight:A});const R=await d.getDimensions(l.floating);return k!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function xd(){return typeof window<"u"}function Xo(e){return QS(e)?(e.nodeName||"").toLowerCase():"#document"}function fn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fs(e){var t;return(t=(QS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function QS(e){return xd()?e instanceof Node||e instanceof fn(e).Node:!1}function Wn(e){return xd()?e instanceof Element||e instanceof fn(e).Element:!1}function cs(e){return xd()?e instanceof HTMLElement||e instanceof fn(e).HTMLElement:!1}function Fb(e){return!xd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fn(e).ShadowRoot}const jI=new Set(["inline","contents"]);function Rl(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=Vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!jI.has(o)}const NI=new Set(["table","td","th"]);function EI(e){return NI.has(Xo(e))}const PI=[":popover-open",":modal"];function vd(e){return PI.some(t=>{try{return e.matches(t)}catch{return!1}})}const AI=["transform","translate","scale","rotate","perspective"],TI=["transform","translate","scale","rotate","perspective","filter"],RI=["paint","layout","strict","content"];function vg(e){const t=yg(),n=Wn(e)?Vn(e):e;return AI.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||TI.some(s=>(n.willChange||"").includes(s))||RI.some(s=>(n.contain||"").includes(s))}function MI(e){let t=li(e);for(;cs(t)&&!zo(t);){if(vg(t))return t;if(vd(t))return null;t=li(t)}return null}function yg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const DI=new Set(["html","body","#document"]);function zo(e){return DI.has(Xo(e))}function Vn(e){return fn(e).getComputedStyle(e)}function yd(e){return Wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function li(e){if(Xo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fb(e)&&e.host||fs(e);return Fb(t)?t.host:t}function ZS(e){const t=li(e);return zo(t)?e.ownerDocument?e.ownerDocument.body:e.body:cs(t)&&Rl(t)?t:ZS(t)}function dl(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ZS(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),d=fn(o);if(u){const l=Hm(d);return t.concat(d,d.visualViewport||[],Rl(o)?o:[],l&&n?dl(l):[])}return t.concat(o,dl(o,[],n))}function Hm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function e1(e){const t=Vn(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=cs(e),u=o?e.offsetWidth:n,d=o?e.offsetHeight:s,l=Bu(n)!==u||Bu(s)!==d;return l&&(n=u,s=d),{width:n,height:s,$:l}}function bg(e){return Wn(e)?e:e.contextElement}function Ro(e){const t=bg(e);if(!cs(t))return os(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=e1(t);let d=(u?Bu(n.width):n.width)/s,l=(u?Bu(n.height):n.height)/o;return(!d||!Number.isFinite(d))&&(d=1),(!l||!Number.isFinite(l))&&(l=1),{x:d,y:l}}const LI=os(0);function t1(e){const t=fn(e);return!yg()||!t.visualViewport?LI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function II(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==fn(e)?!1:t}function Wi(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=bg(e);let d=os(1);t&&(s?Wn(s)&&(d=Ro(s)):d=Ro(e));const l=II(u,n,s)?t1(u):os(0);let c=(o.left+l.x)/d.x,f=(o.top+l.y)/d.y,m=o.width/d.x,h=o.height/d.y;if(u){const x=fn(u),w=s&&Wn(s)?fn(s):s;let k=x,_=Hm(k);for(;_&&s&&w!==k;){const v=Ro(_),b=_.getBoundingClientRect(),g=Vn(_),y=b.left+(_.clientLeft+parseFloat(g.paddingLeft))*v.x,j=b.top+(_.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,f*=v.y,m*=v.x,h*=v.y,c+=y,f+=j,k=fn(_),_=Hm(k)}}return $u({width:m,height:h,x:c,y:f})}function bd(e,t){const n=yd(e).scrollLeft;return t?t.left+n:Wi(fs(e)).left+n}function r1(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-bd(e,n),o=n.top+t.scrollTop;return{x:s,y:o}}function OI(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",d=fs(s),l=t?vd(t.floating):!1;if(s===d||l&&u)return n;let c={scrollLeft:0,scrollTop:0},f=os(1);const m=os(0),h=cs(s);if((h||!h&&!u)&&((Xo(s)!=="body"||Rl(d))&&(c=yd(s)),cs(s))){const w=Wi(s);f=Ro(s),m.x=w.x+s.clientLeft,m.y=w.y+s.clientTop}const x=d&&!h&&!u?r1(d,c):os(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+m.x+x.x,y:n.y*f.y-c.scrollTop*f.y+m.y+x.y}}function BI(e){return Array.from(e.getClientRects())}function FI(e){const t=fs(e),n=yd(e),s=e.ownerDocument.body,o=un(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=un(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let d=-n.scrollLeft+bd(e);const l=-n.scrollTop;return Vn(s).direction==="rtl"&&(d+=un(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:d,y:l}}const $b=25;function $I(e,t){const n=fn(e),s=fs(e),o=n.visualViewport;let u=s.clientWidth,d=s.clientHeight,l=0,c=0;if(o){u=o.width,d=o.height;const m=yg();(!m||m&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const f=bd(s);if(f<=0){const m=s.ownerDocument,h=m.body,x=getComputedStyle(h),w=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,k=Math.abs(s.clientWidth-h.clientWidth-w);k<=$b&&(u-=k)}else f<=$b&&(u+=f);return{width:u,height:d,x:l,y:c}}const zI=new Set(["absolute","fixed"]);function HI(e,t){const n=Wi(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=cs(e)?Ro(e):os(1),d=e.clientWidth*u.x,l=e.clientHeight*u.y,c=o*u.x,f=s*u.y;return{width:d,height:l,x:c,y:f}}function zb(e,t,n){let s;if(t==="viewport")s=$I(e,n);else if(t==="document")s=FI(fs(e));else if(Wn(t))s=HI(t,n);else{const o=t1(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return $u(s)}function n1(e,t){const n=li(e);return n===t||!Wn(n)||zo(n)?!1:Vn(n).position==="fixed"||n1(n,t)}function WI(e,t){const n=t.get(e);if(n)return n;let s=dl(e,[],!1).filter(l=>Wn(l)&&Xo(l)!=="body"),o=null;const u=Vn(e).position==="fixed";let d=u?li(e):e;for(;Wn(d)&&!zo(d);){const l=Vn(d),c=vg(d);!c&&l.position==="fixed"&&(o=null),(u?!c&&!o:!c&&l.position==="static"&&!!o&&zI.has(o.position)||Rl(d)&&!c&&n1(e,d))?s=s.filter(m=>m!==d):o=l,d=li(d)}return t.set(e,s),s}function VI(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const d=[...n==="clippingAncestors"?vd(t)?[]:WI(t,this._c):[].concat(n),s],l=d[0],c=d.reduce((f,m)=>{const h=zb(t,m,o);return f.top=un(h.top,f.top),f.right=ai(h.right,f.right),f.bottom=ai(h.bottom,f.bottom),f.left=un(h.left,f.left),f},zb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function UI(e){const{width:t,height:n}=e1(e);return{width:t,height:n}}function GI(e,t,n){const s=cs(t),o=fs(t),u=n==="fixed",d=Wi(e,!0,u,t);let l={scrollLeft:0,scrollTop:0};const c=os(0);function f(){c.x=bd(o)}if(s||!s&&!u)if((Xo(t)!=="body"||Rl(o))&&(l=yd(t)),s){const w=Wi(t,!0,u,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else o&&f();u&&!s&&o&&f();const m=o&&!s&&!u?r1(o,l):os(0),h=d.left+l.scrollLeft-c.x-m.x,x=d.top+l.scrollTop-c.y-m.y;return{x:h,y:x,width:d.width,height:d.height}}function qf(e){return Vn(e).position==="static"}function Hb(e,t){if(!cs(e)||Vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fs(e)===n&&(n=n.ownerDocument.body),n}function s1(e,t){const n=fn(e);if(vd(e))return n;if(!cs(e)){let o=li(e);for(;o&&!zo(o);){if(Wn(o)&&!qf(o))return o;o=li(o)}return n}let s=Hb(e,t);for(;s&&EI(s)&&qf(s);)s=Hb(s,t);return s&&zo(s)&&qf(s)&&!vg(s)?n:s||MI(e)||n}const KI=async function(e){const t=this.getOffsetParent||s1,n=this.getDimensions,s=await n(e.floating);return{reference:GI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function qI(e){return Vn(e).direction==="rtl"}const YI={convertOffsetParentRelativeRectToViewportRelativeRect:OI,getDocumentElement:fs,getClippingRect:VI,getOffsetParent:s1,getElementRects:KI,getClientRects:BI,getDimensions:UI,getScale:Ro,isElement:Wn,isRTL:qI};function i1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XI(e,t){let n=null,s;const o=fs(e);function u(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function d(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),u();const f=e.getBoundingClientRect(),{left:m,top:h,width:x,height:w}=f;if(l||t(),!x||!w)return;const k=lu(h),_=lu(o.clientWidth-(m+x)),v=lu(o.clientHeight-(h+w)),b=lu(m),y={rootMargin:-k+"px "+-_+"px "+-v+"px "+-b+"px",threshold:un(0,ai(1,c))||1};let j=!0;function E(P){const A=P[0].intersectionRatio;if(A!==c){if(!j)return d();A?d(!1,A):s=setTimeout(()=>{d(!1,1e-7)},1e3)}A===1&&!i1(f,e.getBoundingClientRect())&&d(),j=!1}try{n=new IntersectionObserver(E,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(e)}return d(!0),u}function JI(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,f=bg(e),m=o||u?[...f?dl(f):[],...dl(t)]:[];m.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),u&&b.addEventListener("resize",n)});const h=f&&l?XI(f,n):null;let x=-1,w=null;d&&(w=new ResizeObserver(b=>{let[g]=b;g&&g.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var y;(y=w)==null||y.observe(t)})),n()}),f&&!c&&w.observe(f),w.observe(t));let k,_=c?Wi(e):null;c&&v();function v(){const b=Wi(e);_&&!i1(_,b)&&n(),_=b,k=requestAnimationFrame(v)}return n(),()=>{var b;m.forEach(g=>{o&&g.removeEventListener("scroll",n),u&&g.removeEventListener("resize",n)}),h==null||h(),(b=w)==null||b.disconnect(),w=null,c&&cancelAnimationFrame(k)}}const QI=_I,ZI=CI,eO=yI,tO=kI,rO=bI,Wb=vI,nO=SI,sO=(e,t,n)=>{const s=new Map,o={platform:YI,...n},u={...o.platform,_c:s};return xI(e,t,{...o,platform:u})};var iO=typeof document<"u",oO=function(){},bu=iO?C.useLayoutEffect:oO;function zu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!zu(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!zu(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function o1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vb(e,t){const n=o1(e);return Math.round(t*n)/n}function Yf(e){const t=C.useRef(e);return bu(()=>{t.current=e}),t}function aO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:d}={},transform:l=!0,whileElementsMounted:c,open:f}=e,[m,h]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,w]=C.useState(s);zu(x,s)||w(s);const[k,_]=C.useState(null),[v,b]=C.useState(null),g=C.useCallback(U=>{U!==P.current&&(P.current=U,_(U))},[]),y=C.useCallback(U=>{U!==A.current&&(A.current=U,b(U))},[]),j=u||k,E=d||v,P=C.useRef(null),A=C.useRef(null),N=C.useRef(m),R=c!=null,I=Yf(c),O=Yf(o),B=Yf(f),$=C.useCallback(()=>{if(!P.current||!A.current)return;const U={placement:t,strategy:n,middleware:x};O.current&&(U.platform=O.current),sO(P.current,A.current,U).then(L=>{const M={...L,isPositioned:B.current!==!1};Y.current&&!zu(N.current,M)&&(N.current=M,bl.flushSync(()=>{h(M)}))})},[x,t,n,O,B]);bu(()=>{f===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const Y=C.useRef(!1);bu(()=>(Y.current=!0,()=>{Y.current=!1}),[]),bu(()=>{if(j&&(P.current=j),E&&(A.current=E),j&&E){if(I.current)return I.current(j,E,$);$()}},[j,E,$,I,R]);const z=C.useMemo(()=>({reference:P,floating:A,setReference:g,setFloating:y}),[g,y]),K=C.useMemo(()=>({reference:j,floating:E}),[j,E]),G=C.useMemo(()=>{const U={position:n,left:0,top:0};if(!K.floating)return U;const L=Vb(K.floating,m.x),M=Vb(K.floating,m.y);return l?{...U,transform:"translate("+L+"px, "+M+"px)",...o1(K.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:M}},[n,l,K.floating,m.x,m.y]);return C.useMemo(()=>({...m,update:$,refs:z,elements:K,floatingStyles:G}),[m,$,z,K,G])}const lO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:s,padding:o}=typeof e=="function"?e(n):e;return s&&t(s)?s.current!=null?Wb({element:s.current,padding:o}).fn(n):{}:s?Wb({element:s,padding:o}).fn(n):{}}}},cO=(e,t)=>({...QI(e),options:[e,t]}),uO=(e,t)=>({...ZI(e),options:[e,t]}),dO=(e,t)=>({...nO(e),options:[e,t]}),hO=(e,t)=>({...eO(e),options:[e,t]}),fO=(e,t)=>({...tO(e),options:[e,t]}),mO=(e,t)=>({...rO(e),options:[e,t]}),pO=(e,t)=>({...lO(e),options:[e,t]});var gO="Arrow",a1=C.forwardRef((e,t)=>{const{children:n,width:s=10,height:o=5,...u}=e;return r.jsx(et.svg,{...u,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:r.jsx("polygon",{points:"0,0 30,0 15,10"})})});a1.displayName=gO;var xO=a1,wg="Popper",[l1,Jo]=tn(wg),[vO,c1]=l1(wg),u1=e=>{const{__scopePopper:t,children:n}=e,[s,o]=C.useState(null);return r.jsx(vO,{scope:t,anchor:s,onAnchorChange:o,children:n})};u1.displayName=wg;var d1="PopperAnchor",h1=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:s,...o}=e,u=c1(d1,n),d=C.useRef(null),l=ct(t,d),c=C.useRef(null);return C.useEffect(()=>{const f=c.current;c.current=(s==null?void 0:s.current)||d.current,f!==c.current&&u.onAnchorChange(c.current)}),s?null:r.jsx(et.div,{...o,ref:l})});h1.displayName=d1;var _g="PopperContent",[yO,bO]=l1(_g),f1=C.forwardRef((e,t)=>{var X,W,le,re,Q,se;const{__scopePopper:n,side:s="bottom",sideOffset:o=0,align:u="center",alignOffset:d=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:f=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:x=!1,updatePositionStrategy:w="optimized",onPlaced:k,..._}=e,v=c1(_g,n),[b,g]=C.useState(null),y=ct(t,ye=>g(ye)),[j,E]=C.useState(null),P=dg(j),A=(P==null?void 0:P.width)??0,N=(P==null?void 0:P.height)??0,R=s+(u!=="center"?"-"+u:""),I=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},O=Array.isArray(f)?f:[f],B=O.length>0,$={padding:I,boundary:O.filter(_O),altBoundary:B},{refs:Y,floatingStyles:z,placement:K,isPositioned:G,middlewareData:U}=aO({strategy:"fixed",placement:R,whileElementsMounted:(...ye)=>JI(...ye,{animationFrame:w==="always"}),elements:{reference:v.anchor},middleware:[cO({mainAxis:o+N,alignmentAxis:d}),c&&uO({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?dO():void 0,...$}),c&&hO({...$}),fO({...$,apply:({elements:ye,rects:Be,availableWidth:Ke,availableHeight:ee})=>{const{width:de,height:je}=Be.reference,De=ye.floating.style;De.setProperty("--radix-popper-available-width",`${Ke}px`),De.setProperty("--radix-popper-available-height",`${ee}px`),De.setProperty("--radix-popper-anchor-width",`${de}px`),De.setProperty("--radix-popper-anchor-height",`${je}px`)}}),j&&pO({element:j,padding:l}),CO({arrowWidth:A,arrowHeight:N}),x&&mO({strategy:"referenceHidden",...$})]}),[L,M]=g1(K),F=Pr(k);Cr(()=>{G&&(F==null||F())},[G,F]);const q=(X=U.arrow)==null?void 0:X.x,H=(W=U.arrow)==null?void 0:W.y,oe=((le=U.arrow)==null?void 0:le.centerOffset)!==0,[fe,me]=C.useState();return Cr(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),r.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:G?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(re=U.transformOrigin)==null?void 0:re.x,(Q=U.transformOrigin)==null?void 0:Q.y].join(" "),...((se=U.hide)==null?void 0:se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:r.jsx(yO,{scope:n,placedSide:L,onArrowChange:E,arrowX:q,arrowY:H,shouldHideArrow:oe,children:r.jsx(et.div,{"data-side":L,"data-align":M,..._,ref:y,style:{..._.style,animation:G?void 0:"none"}})})})});f1.displayName=_g;var m1="PopperArrow",wO={top:"bottom",right:"left",bottom:"top",left:"right"},p1=C.forwardRef(function(t,n){const{__scopePopper:s,...o}=t,u=bO(m1,s),d=wO[u.placedSide];return r.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:r.jsx(xO,{...o,ref:n,style:{...o.style,display:"block"}})})});p1.displayName=m1;function _O(e){return e!==null}var CO=e=>({name:"transformOrigin",options:e,fn(t){var v,b,g;const{placement:n,rects:s,middlewareData:o}=t,d=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=d?0:e.arrowWidth,c=d?0:e.arrowHeight,[f,m]=g1(n),h={start:"0%",center:"50%",end:"100%"}[m],x=(((b=o.arrow)==null?void 0:b.x)??0)+l/2,w=(((g=o.arrow)==null?void 0:g.y)??0)+c/2;let k="",_="";return f==="bottom"?(k=d?h:`${x}px`,_=`${-c}px`):f==="top"?(k=d?h:`${x}px`,_=`${s.floating.height+c}px`):f==="right"?(k=`${-c}px`,_=d?h:`${w}px`):f==="left"&&(k=`${s.floating.width+c}px`,_=d?h:`${w}px`),{data:{x:k,y:_}}}});function g1(e){const[t,n="center"]=e.split("-");return[t,n]}var Cg=u1,Sg=h1,kg=f1,jg=p1;function SO(e){const t=kO(e),n=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(NO);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return r.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return r.jsx(t,{...d,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function kO(e){const t=C.forwardRef((n,s)=>{const{children:o,...u}=n;if(C.isValidElement(o)){const d=PO(o),l=EO(u,o.props);return o.type!==C.Fragment&&(l.ref=s?Ts(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var jO=Symbol("radix.slottable");function NO(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===jO}function EO(e,t){const n={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function PO(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var x1=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),AO="VisuallyHidden",v1=C.forwardRef((e,t)=>r.jsx(et.span,{...e,ref:t,style:{...x1,...e.style}}));v1.displayName=AO;var TO=v1,RO=[" ","Enter","ArrowUp","ArrowDown"],MO=[" ","Enter"],Vi="Select",[wd,_d,DO]=mg(Vi),[Qo]=tn(Vi,[DO,Jo]),Cd=Jo(),[LO,fi]=Qo(Vi),[IO,OO]=Qo(Vi),y1=e=>{const{__scopeSelect:t,children:n,open:s,defaultOpen:o,onOpenChange:u,value:d,defaultValue:l,onValueChange:c,dir:f,name:m,autoComplete:h,disabled:x,required:w,form:k}=e,_=Cd(t),[v,b]=C.useState(null),[g,y]=C.useState(null),[j,E]=C.useState(!1),P=Pl(f),[A,N]=ls({prop:s,defaultProp:o??!1,onChange:u,caller:Vi}),[R,I]=ls({prop:d,defaultProp:l,onChange:c,caller:Vi}),O=C.useRef(null),B=v?k||!!v.closest("form"):!0,[$,Y]=C.useState(new Set),z=Array.from($).map(K=>K.props.value).join(";");return r.jsx(Cg,{..._,children:r.jsxs(LO,{required:w,scope:t,trigger:v,onTriggerChange:b,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:j,onValueNodeHasChildrenChange:E,contentId:Nn(),value:R,onValueChange:I,open:A,onOpenChange:N,dir:P,triggerPointerDownPosRef:O,disabled:x,children:[r.jsx(wd.Provider,{scope:t,children:r.jsx(IO,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(K=>{Y(G=>new Set(G).add(K))},[]),onNativeOptionRemove:C.useCallback(K=>{Y(G=>{const U=new Set(G);return U.delete(K),U})},[]),children:n})}),B?r.jsxs(W1,{"aria-hidden":!0,required:w,tabIndex:-1,name:m,autoComplete:h,value:R,onChange:K=>I(K.target.value),disabled:x,form:k,children:[R===void 0?r.jsx("option",{value:""}):null,Array.from($)]},z):null]})})};y1.displayName=Vi;var b1="SelectTrigger",w1=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:s=!1,...o}=e,u=Cd(n),d=fi(b1,n),l=d.disabled||s,c=ct(t,d.onTriggerChange),f=_d(n),m=C.useRef("touch"),[h,x,w]=U1(_=>{const v=f().filter(y=>!y.disabled),b=v.find(y=>y.value===d.value),g=G1(v,_,b);g!==void 0&&d.onValueChange(g.value)}),k=_=>{l||(d.onOpenChange(!0),w()),_&&(d.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return r.jsx(Sg,{asChild:!0,...u,children:r.jsx(et.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":V1(d.value)?"":void 0,...o,ref:c,onClick:Le(o.onClick,_=>{_.currentTarget.focus(),m.current!=="mouse"&&k(_)}),onPointerDown:Le(o.onPointerDown,_=>{m.current=_.pointerType;const v=_.target;v.hasPointerCapture(_.pointerId)&&v.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(k(_),_.preventDefault())}),onKeyDown:Le(o.onKeyDown,_=>{const v=h.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&x(_.key),!(v&&_.key===" ")&&RO.includes(_.key)&&(k(),_.preventDefault())})})})});w1.displayName=b1;var _1="SelectValue",C1=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:o,children:u,placeholder:d="",...l}=e,c=fi(_1,n),{onValueNodeHasChildrenChange:f}=c,m=u!==void 0,h=ct(t,c.onValueNodeChange);return Cr(()=>{f(m)},[f,m]),r.jsx(et.span,{...l,ref:h,style:{pointerEvents:"none"},children:V1(c.value)?r.jsx(r.Fragment,{children:d}):u})});C1.displayName=_1;var BO="SelectIcon",S1=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:s,...o}=e;return r.jsx(et.span,{"aria-hidden":!0,...o,ref:t,children:s||"▼"})});S1.displayName=BO;var FO="SelectPortal",k1=e=>r.jsx(Tl,{asChild:!0,...e});k1.displayName=FO;var Ui="SelectContent",j1=C.forwardRef((e,t)=>{const n=fi(Ui,e.__scopeSelect),[s,o]=C.useState();if(Cr(()=>{o(new DocumentFragment)},[]),!n.open){const u=s;return u?bl.createPortal(r.jsx(N1,{scope:e.__scopeSelect,children:r.jsx(wd.Slot,{scope:e.__scopeSelect,children:r.jsx("div",{children:e.children})})}),u):null}return r.jsx(E1,{...e,ref:t})});j1.displayName=Ui;var zn=10,[N1,mi]=Qo(Ui),$O="SelectContentImpl",zO=SO("SelectContent.RemoveScroll"),E1=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:u,onPointerDownOutside:d,side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v,...b}=e,g=fi(Ui,n),[y,j]=C.useState(null),[E,P]=C.useState(null),A=ct(t,X=>j(X)),[N,R]=C.useState(null),[I,O]=C.useState(null),B=_d(n),[$,Y]=C.useState(!1),z=C.useRef(!1);C.useEffect(()=>{if(y)return sg(y)},[y]),ng();const K=C.useCallback(X=>{const[W,...le]=B().map(se=>se.ref.current),[re]=le.slice(-1),Q=document.activeElement;for(const se of X)if(se===Q||(se==null||se.scrollIntoView({block:"nearest"}),se===W&&E&&(E.scrollTop=0),se===re&&E&&(E.scrollTop=E.scrollHeight),se==null||se.focus(),document.activeElement!==Q))return},[B,E]),G=C.useCallback(()=>K([N,y]),[K,N,y]);C.useEffect(()=>{$&&G()},[$,G]);const{onOpenChange:U,triggerPointerDownPosRef:L}=g;C.useEffect(()=>{if(y){let X={x:0,y:0};const W=re=>{var Q,se;X={x:Math.abs(Math.round(re.pageX)-(((Q=L.current)==null?void 0:Q.x)??0)),y:Math.abs(Math.round(re.pageY)-(((se=L.current)==null?void 0:se.y)??0))}},le=re=>{X.x<=10&&X.y<=10?re.preventDefault():y.contains(re.target)||U(!1),document.removeEventListener("pointermove",W),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",le,{capture:!0})}}},[y,U,L]),C.useEffect(()=>{const X=()=>U(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[U]);const[M,F]=U1(X=>{const W=B().filter(Q=>!Q.disabled),le=W.find(Q=>Q.ref.current===document.activeElement),re=G1(W,X,le);re&&setTimeout(()=>re.ref.current.focus())}),q=C.useCallback((X,W,le)=>{const re=!z.current&&!le;(g.value!==void 0&&g.value===W||re)&&(R(X),re&&(z.current=!0))},[g.value]),H=C.useCallback(()=>y==null?void 0:y.focus(),[y]),oe=C.useCallback((X,W,le)=>{const re=!z.current&&!le;(g.value!==void 0&&g.value===W||re)&&O(X)},[g.value]),fe=s==="popper"?Wm:P1,me=fe===Wm?{side:l,sideOffset:c,align:f,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:w,sticky:k,hideWhenDetached:_,avoidCollisions:v}:{};return r.jsx(N1,{scope:n,content:y,viewport:E,onViewportChange:P,itemRefCallback:q,selectedItem:N,onItemLeave:H,itemTextRefCallback:oe,focusSelectedItem:G,selectedItemText:I,position:s,isPositioned:$,searchRef:M,children:r.jsx(ud,{as:zO,allowPinchZoom:!0,children:r.jsx(ld,{asChild:!0,trapped:g.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Le(o,X=>{var W;(W=g.trigger)==null||W.focus({preventScroll:!0}),X.preventDefault()}),children:r.jsx(Al,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:r.jsx(fe,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:X=>X.preventDefault(),...b,...me,onPlaced:()=>Y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Le(b.onKeyDown,X=>{const W=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!W&&X.key.length===1&&F(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let re=B().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(X.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const Q=X.target,se=re.indexOf(Q);re=re.slice(se+1)}setTimeout(()=>K(re)),X.preventDefault()}})})})})})})});E1.displayName=$O;var HO="SelectItemAlignedPosition",P1=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:s,...o}=e,u=fi(Ui,n),d=mi(Ui,n),[l,c]=C.useState(null),[f,m]=C.useState(null),h=ct(t,A=>m(A)),x=_d(n),w=C.useRef(!1),k=C.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:g}=d,y=C.useCallback(()=>{if(u.trigger&&u.valueNode&&l&&f&&_&&v&&b){const A=u.trigger.getBoundingClientRect(),N=f.getBoundingClientRect(),R=u.valueNode.getBoundingClientRect(),I=b.getBoundingClientRect();if(u.dir!=="rtl"){const Q=I.left-N.left,se=R.left-Q,ye=A.left-se,Be=A.width+ye,Ke=Math.max(Be,N.width),ee=window.innerWidth-zn,de=Om(se,[zn,Math.max(zn,ee-Ke)]);l.style.minWidth=Be+"px",l.style.left=de+"px"}else{const Q=N.right-I.right,se=window.innerWidth-R.right-Q,ye=window.innerWidth-A.right-se,Be=A.width+ye,Ke=Math.max(Be,N.width),ee=window.innerWidth-zn,de=Om(se,[zn,Math.max(zn,ee-Ke)]);l.style.minWidth=Be+"px",l.style.right=de+"px"}const O=x(),B=window.innerHeight-zn*2,$=_.scrollHeight,Y=window.getComputedStyle(f),z=parseInt(Y.borderTopWidth,10),K=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),U=parseInt(Y.paddingBottom,10),L=z+K+$+U+G,M=Math.min(v.offsetHeight*5,L),F=window.getComputedStyle(_),q=parseInt(F.paddingTop,10),H=parseInt(F.paddingBottom,10),oe=A.top+A.height/2-zn,fe=B-oe,me=v.offsetHeight/2,X=v.offsetTop+me,W=z+K+X,le=L-W;if(W<=oe){const Q=O.length>0&&v===O[O.length-1].ref.current;l.style.bottom="0px";const se=f.clientHeight-_.offsetTop-_.offsetHeight,ye=Math.max(fe,me+(Q?H:0)+se+G),Be=W+ye;l.style.height=Be+"px"}else{const Q=O.length>0&&v===O[0].ref.current;l.style.top="0px";const ye=Math.max(oe,z+_.offsetTop+(Q?q:0)+me)+le;l.style.height=ye+"px",_.scrollTop=W-oe+_.offsetTop}l.style.margin=`${zn}px 0`,l.style.minHeight=M+"px",l.style.maxHeight=B+"px",s==null||s(),requestAnimationFrame(()=>w.current=!0)}},[x,u.trigger,u.valueNode,l,f,_,v,b,u.dir,s]);Cr(()=>y(),[y]);const[j,E]=C.useState();Cr(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const P=C.useCallback(A=>{A&&k.current===!0&&(y(),g==null||g(),k.current=!1)},[y,g]);return r.jsx(VO,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:P,children:r.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:r.jsx(et.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});P1.displayName=HO;var WO="SelectPopperPosition",Wm=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:s="start",collisionPadding:o=zn,...u}=e,d=Cd(n);return r.jsx(kg,{...d,...u,ref:t,align:s,collisionPadding:o,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Wm.displayName=WO;var[VO,Ng]=Qo(Ui,{}),Vm="SelectViewport",A1=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:s,...o}=e,u=mi(Vm,n),d=Ng(Vm,n),l=ct(t,u.onViewportChange),c=C.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),r.jsx(wd.Slot,{scope:n,children:r.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Le(o.onScroll,f=>{const m=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:x}=d;if(x!=null&&x.current&&h){const w=Math.abs(c.current-m.scrollTop);if(w>0){const k=window.innerHeight-zn*2,_=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),b=Math.max(_,v);if(b<k){const g=b+w,y=Math.min(k,g),j=g-y;h.style.height=y+"px",h.style.bottom==="0px"&&(m.scrollTop=j>0?j:0,h.style.justifyContent="flex-end")}}}c.current=m.scrollTop})})})]})});A1.displayName=Vm;var T1="SelectGroup",[UO,GO]=Qo(T1),KO=C.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,o=Nn();return r.jsx(UO,{scope:n,id:o,children:r.jsx(et.div,{role:"group","aria-labelledby":o,...s,ref:t})})});KO.displayName=T1;var R1="SelectLabel",M1=C.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,o=GO(R1,n);return r.jsx(et.div,{id:o.id,...s,ref:t})});M1.displayName=R1;var Hu="SelectItem",[qO,D1]=Qo(Hu),L1=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:s,disabled:o=!1,textValue:u,...d}=e,l=fi(Hu,n),c=mi(Hu,n),f=l.value===s,[m,h]=C.useState(u??""),[x,w]=C.useState(!1),k=ct(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,s,o)}),_=Nn(),v=C.useRef("touch"),b=()=>{o||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(qO,{scope:n,value:s,disabled:o,textId:_,isSelected:f,onItemTextChange:C.useCallback(g=>{h(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:r.jsx(wd.ItemSlot,{scope:n,value:s,disabled:o,textValue:m,children:r.jsx(et.div,{role:"option","aria-labelledby":_,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...d,ref:k,onFocus:Le(d.onFocus,()=>w(!0)),onBlur:Le(d.onBlur,()=>w(!1)),onClick:Le(d.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Le(d.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Le(d.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:Le(d.onPointerMove,g=>{var y;v.current=g.pointerType,o?(y=c.onItemLeave)==null||y.call(c):v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Le(d.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:Le(d.onKeyDown,g=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&g.key===" "||(MO.includes(g.key)&&b(),g.key===" "&&g.preventDefault())})})})})});L1.displayName=Hu;var Ka="SelectItemText",I1=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:s,style:o,...u}=e,d=fi(Ka,n),l=mi(Ka,n),c=D1(Ka,n),f=OO(Ka,n),[m,h]=C.useState(null),x=ct(t,b=>h(b),c.onItemTextChange,b=>{var g;return(g=l.itemTextRefCallback)==null?void 0:g.call(l,b,c.value,c.disabled)}),w=m==null?void 0:m.textContent,k=C.useMemo(()=>r.jsx("option",{value:c.value,disabled:c.disabled,children:w},c.value),[c.disabled,c.value,w]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=f;return Cr(()=>(_(k),()=>v(k)),[_,v,k]),r.jsxs(r.Fragment,{children:[r.jsx(et.span,{id:c.textId,...u,ref:x}),c.isSelected&&d.valueNode&&!d.valueNodeHasChildren?bl.createPortal(u.children,d.valueNode):null]})});I1.displayName=Ka;var O1="SelectItemIndicator",B1=C.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return D1(O1,n).isSelected?r.jsx(et.span,{"aria-hidden":!0,...s,ref:t}):null});B1.displayName=O1;var Um="SelectScrollUpButton",F1=C.forwardRef((e,t)=>{const n=mi(Um,e.__scopeSelect),s=Ng(Um,e.__scopeSelect),[o,u]=C.useState(!1),d=ct(t,s.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollTop>0;u(f)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?r.jsx(z1,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});F1.displayName=Um;var Gm="SelectScrollDownButton",$1=C.forwardRef((e,t)=>{const n=mi(Gm,e.__scopeSelect),s=Ng(Gm,e.__scopeSelect),[o,u]=C.useState(!1),d=ct(t,s.onScrollButtonChange);return Cr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=c.scrollHeight-c.clientHeight,m=Math.ceil(c.scrollTop)<f;u(m)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?r.jsx(z1,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});$1.displayName=Gm;var z1=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:s,...o}=e,u=mi("SelectScrollButton",n),d=C.useRef(null),l=_d(n),c=C.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),Cr(()=>{var m;const f=l().find(h=>h.ref.current===document.activeElement);(m=f==null?void 0:f.ref.current)==null||m.scrollIntoView({block:"nearest"})},[l]),r.jsx(et.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Le(o.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Le(o.onPointerMove,()=>{var f;(f=u.onItemLeave)==null||f.call(u),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Le(o.onPointerLeave,()=>{c()})})}),YO="SelectSeparator",H1=C.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e;return r.jsx(et.div,{"aria-hidden":!0,...s,ref:t})});H1.displayName=YO;var Km="SelectArrow",XO=C.forwardRef((e,t)=>{const{__scopeSelect:n,...s}=e,o=Cd(n),u=fi(Km,n),d=mi(Km,n);return u.open&&d.position==="popper"?r.jsx(jg,{...o,...s,ref:t}):null});XO.displayName=Km;var JO="SelectBubbleInput",W1=C.forwardRef(({__scopeSelect:e,value:t,...n},s)=>{const o=C.useRef(null),u=ct(s,o),d=ug(t);return C.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(c,"value").set;if(d!==t&&m){const h=new Event("change",{bubbles:!0});m.call(l,t),l.dispatchEvent(h)}},[d,t]),r.jsx(et.select,{...n,style:{...x1,...n.style},ref:u,defaultValue:t})});W1.displayName=JO;function V1(e){return e===""||e===void 0}function U1(e){const t=Pr(e),n=C.useRef(""),s=C.useRef(0),o=C.useCallback(d=>{const l=n.current+d;t(l),(function c(f){n.current=f,window.clearTimeout(s.current),f!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),u=C.useCallback(()=>{n.current="",window.clearTimeout(s.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(s.current),[]),[n,o,u]}function G1(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=n?e.indexOf(n):-1;let d=QO(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==n));const c=d.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function QO(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var ZO=y1,K1=w1,e6=C1,t6=S1,r6=k1,q1=j1,n6=A1,Y1=M1,X1=L1,s6=I1,i6=B1,J1=F1,Q1=$1,Z1=H1;const yr=ZO,br=e6,mr=C.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(K1,{ref:s,className:Ee("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,r.jsx(t6,{asChild:!0,children:r.jsx(wr,{className:"h-4 w-4 opacity-50"})})]}));mr.displayName=K1.displayName;const ek=C.forwardRef(({className:e,...t},n)=>r.jsx(J1,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(yM,{className:"h-4 w-4"})}));ek.displayName=J1.displayName;const tk=C.forwardRef(({className:e,...t},n)=>r.jsx(Q1,{ref:n,className:Ee("flex cursor-default items-center justify-center py-1",e),...t,children:r.jsx(wr,{className:"h-4 w-4"})}));tk.displayName=Q1.displayName;const pr=C.forwardRef(({className:e,children:t,position:n="popper",...s},o)=>r.jsx(r6,{children:r.jsxs(q1,{ref:o,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:[r.jsx(ek,{}),r.jsx(n6,{className:Ee("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),r.jsx(tk,{})]})}));pr.displayName=q1.displayName;const o6=C.forwardRef(({className:e,...t},n)=>r.jsx(Y1,{ref:n,className:Ee("px-2 py-1.5 text-sm font-semibold",e),...t}));o6.displayName=Y1.displayName;const jt=C.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(X1,{ref:s,className:Ee("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(i6,{children:r.jsx(Jt,{className:"h-4 w-4"})})}),r.jsx(s6,{children:t})]}));jt.displayName=X1.displayName;const a6=C.forwardRef(({className:e,...t},n)=>r.jsx(Z1,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));a6.displayName=Z1.displayName;const Xf={claude:{name:"Claude Code",folder:".claude",color:"text-orange-600",bg:"bg-orange-50",darkBg:"dark:bg-orange-950/30"},gemini:{name:"Gemini CLI",folder:".gemini",color:"text-blue-600",bg:"bg-blue-50",darkBg:"dark:bg-blue-950/30"},antigravity:{name:"Antigravity",folder:".agent",color:"text-purple-600",bg:"bg-purple-50",darkBg:"dark:bg-purple-950/30"}};function l6({open:e,onOpenChange:t,projectDir:n,onSynced:s}){var N,R,I;const[o,u]=C.useState("claude"),[d,l]=C.useState("antigravity"),[c,f]=C.useState(null),[m,h]=C.useState(!1),[x,w]=C.useState(!1),[k,_]=C.useState(new Set);C.useEffect(()=>{e&&n&&v()},[e,o,d,n]),C.useEffect(()=>{e&&_(new Set)},[e]);const v=async()=>{var O;h(!0);try{const B=await ve.getSyncPreview(n,o,d);f(B);const $=new Set(((O=B.files)==null?void 0:O.filter(Y=>Y.status==="new"||Y.status==="different").map(Y=>Y.name))||[]);_($)}catch(B){J.error("Failed to load sync preview: "+B.message),f(null)}finally{h(!1)}},b=()=>{u(d),l(o)},g=O=>{const B=new Set(k);B.has(O)?B.delete(O):B.add(O),_(B)},y=()=>{var O,B;k.size===((O=c==null?void 0:c.files)==null?void 0:O.length)?_(new Set):_(new Set(((B=c==null?void 0:c.files)==null?void 0:B.map($=>$.name))||[]))},j=async()=>{if(k.size===0){J.error("Please select at least one file to sync");return}w(!0);try{const O=await ve.syncRules(n,o,d,Array.from(k));O.success?(J.success(`Synced ${O.synced.length} file(s) to ${Xf[d].name}`),s==null||s(),t(!1)):J.error(O.error||"Sync failed")}catch(O){J.error("Sync failed: "+O.message)}finally{w(!1)}},E=O=>{switch(O){case"new":return r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-green-100 text-green-700",children:"New"});case"different":return r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-yellow-100 text-yellow-700",children:"Modified"});case"identical":return r.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded bg-gray-100 dark:bg-slate-700 text-gray-500 dark:text-slate-400",children:"Same"});default:return null}},P=Xf[o],A=Xf[d];return r.jsx(Et,{open:e,onOpenChange:t,children:r.jsxs(Ct,{className:"sm:max-w-lg",children:[r.jsxs(St,{children:[r.jsxs(kt,{className:"flex items-center gap-2",children:[r.jsx(_r,{className:"w-5 h-5 text-indigo-500"}),"Sync Rules Between Tools"]}),r.jsx(ir,{children:"Copy rules from one AI tool's configuration to another."})]}),r.jsxs("div",{className:"space-y-4 py-4",children:[r.jsxs("div",{className:"flex items-center gap-3 p-3 bg-muted/50 rounded-lg",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),r.jsxs(yr,{value:o,onValueChange:u,children:[r.jsx(mr,{className:"w-full",children:r.jsx(br,{})}),r.jsxs(pr,{children:[r.jsx(jt,{value:"claude",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),r.jsx(jt,{value:"gemini",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),r.jsx(jt,{value:"antigravity",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]}),r.jsx(ae,{variant:"ghost",size:"icon",onClick:b,className:"mt-5",title:"Swap direction",children:r.jsx(Up,{className:"w-4 h-4"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("label",{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),r.jsxs(yr,{value:d,onValueChange:l,children:[r.jsx(mr,{className:"w-full",children:r.jsx(br,{})}),r.jsxs(pr,{children:[r.jsx(jt,{value:"claude",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-orange-500"}),"Claude Code"]})}),r.jsx(jt,{value:"gemini",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-blue-500"}),"Gemini CLI"]})}),r.jsx(jt,{value:"antigravity",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3 h-3 text-purple-500"}),"Antigravity"]})})]})]})]})]}),r.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[r.jsxs("div",{children:["Source: ",r.jsxs("code",{className:"bg-muted px-1 rounded",children:[P.folder,"/rules/"]})]}),r.jsxs("div",{children:["Target: ",r.jsxs("code",{className:"bg-muted px-1 rounded",children:[A.folder,"/rules/"]})]})]}),r.jsxs("div",{className:"border rounded-lg",children:[r.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b bg-muted/30",children:[r.jsx("span",{className:"text-sm font-medium",children:"Rules to Sync"}),((N=c==null?void 0:c.files)==null?void 0:N.length)>0&&r.jsx(ae,{variant:"ghost",size:"sm",onClick:y,className:"h-6 text-xs",children:k.size===c.files.length?"Deselect All":"Select All"})]}),r.jsx("div",{className:"max-h-64 overflow-auto",children:m?r.jsx("div",{className:"flex items-center justify-center py-8",children:r.jsx(at,{className:"w-5 h-5 animate-spin text-muted-foreground"})}):c!=null&&c.error?r.jsxs("div",{className:"flex items-center gap-2 p-4 text-sm text-amber-600",children:[r.jsx(Ns,{className:"w-4 h-4"}),c.error]}):((R=c==null?void 0:c.files)==null?void 0:R.length)===0?r.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"No rules found in source folder"}):r.jsx("div",{className:"divide-y",children:(I=c==null?void 0:c.files)==null?void 0:I.map(O=>r.jsxs("label",{className:Ee("flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-muted/30",k.has(O.name)&&"bg-primary/5"),children:[r.jsx(Hi,{checked:k.has(O.name),onCheckedChange:()=>g(O.name)}),r.jsx(Ar,{className:"w-4 h-4 text-purple-500"}),r.jsx("span",{className:"flex-1 text-sm",children:O.name}),E(O.status)]},O.name))})})]}),(c==null?void 0:c.files)&&k.size>0&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:[k.size," file(s) selected for sync"]})]}),r.jsxs(Rt,{children:[r.jsx(ae,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r.jsx(ae,{onClick:j,disabled:x||m||k.size===0,children:x?r.jsxs(r.Fragment,{children:[r.jsx(at,{className:"w-4 h-4 mr-2 animate-spin"}),"Syncing..."]}):r.jsxs(r.Fragment,{children:[r.jsx(Jt,{className:"w-4 h-4 mr-2"}),"Sync ",k.size," File(s)"]})})]})]})})}const lt=C.forwardRef(({className:e,type:t,...n},s)=>r.jsx("input",{type:t,className:Ee("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...n}));lt.displayName="Input";function Eg({open:e,onOpenChange:t,onSelect:n,type:s="directory",initialPath:o="~",title:u="Select Path"}){const[d,l]=C.useState(""),[c,f]=C.useState([]),[m,h]=C.useState(!1),[x,w]=C.useState(null),[k,_]=C.useState(""),[v,b]=C.useState("");C.useEffect(()=>{e&&g(o)},[e,o]);const g=async A=>{h(!0),w(null);try{const N=await ve.browse(A,s);N.error?(w(N.error),N.path&&(l(N.path),b(N.path))):(l(N.path),b(N.path),f(N.items||[]),N.home&&_(N.home))}catch(N){w(N.message)}finally{h(!1)}},y=A=>{A.type==="directory"?g(A.path):s==="file"&&(n(A.path),t(!1))},j=()=>{n(d),t(!1)},E=()=>{v&&g(v)},P=A=>{A.key==="Enter"&&E()};return r.jsx(Et,{open:e,onOpenChange:t,children:r.jsxs(Ct,{className:"max-w-lg",children:[r.jsx(St,{children:r.jsxs(kt,{className:"flex items-center gap-2",children:[s==="directory"?r.jsx(Er,{className:"w-5 h-5"}):r.jsx(Mm,{className:"w-5 h-5"}),u]})}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex gap-2",children:[r.jsx(lt,{value:v,onChange:A=>b(A.target.value),onKeyDown:P,placeholder:"Enter path...",className:"font-mono text-sm flex-1"}),r.jsx(ae,{variant:"outline",size:"icon",onClick:()=>g(k||"~"),title:"Go to home",children:r.jsx(Yp,{className:"w-4 h-4"})}),r.jsx(ae,{onClick:E,disabled:m,children:"Go"})]}),r.jsx("div",{className:"text-xs text-gray-500 font-mono truncate px-1",children:d}),x&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 p-2 rounded",children:x}),r.jsx(Tn,{className:"h-64 border rounded-lg",children:m?r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx(at,{className:"w-6 h-6 animate-spin text-gray-400"})}):r.jsx("div",{className:"p-1",children:c.length===0?r.jsx("div",{className:"text-sm text-gray-500 p-4 text-center",children:s==="directory"?"No subdirectories":"No files found"}):c.map((A,N)=>r.jsxs("button",{onClick:()=>y(A),className:"w-full flex items-center gap-2 px-3 py-2 text-sm hover:bg-gray-100 rounded transition-colors text-left",children:[A.type==="directory"?r.jsx(Er,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):r.jsx(Mm,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),r.jsx("span",{className:`flex-1 truncate ${A.isParent?"text-gray-500":""}`,children:A.name}),A.type==="directory"&&!A.isParent&&r.jsx(Vr,{className:"w-4 h-4 text-gray-400"})]},N))})})]}),r.jsxs(Rt,{children:[r.jsx(ae,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),r.jsx(ae,{onClick:j,disabled:!d,children:s==="directory"?"Select Folder":"Select"})]})]})})}var Sd="Switch",[c6]=tn(Sd),[u6,d6]=c6(Sd),rk=C.forwardRef((e,t)=>{const{__scopeSwitch:n,name:s,checked:o,defaultChecked:u,required:d,disabled:l,value:c="on",onCheckedChange:f,form:m,...h}=e,[x,w]=C.useState(null),k=ct(t,y=>w(y)),_=C.useRef(!1),v=x?m||!!x.closest("form"):!0,[b,g]=ls({prop:o,defaultProp:u??!1,onChange:f,caller:Sd});return r.jsxs(u6,{scope:n,checked:b,disabled:l,children:[r.jsx(et.button,{type:"button",role:"switch","aria-checked":b,"aria-required":d,"data-state":ok(b),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:k,onClick:Le(e.onClick,y=>{g(j=>!j),v&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})}),v&&r.jsx(ik,{control:x,bubbles:!_.current,name:s,value:c,checked:b,required:d,disabled:l,form:m,style:{transform:"translateX(-100%)"}})]})});rk.displayName=Sd;var nk="SwitchThumb",sk=C.forwardRef((e,t)=>{const{__scopeSwitch:n,...s}=e,o=d6(nk,n);return r.jsx(et.span,{"data-state":ok(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})});sk.displayName=nk;var h6="SwitchBubbleInput",ik=C.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:s=!0,...o},u)=>{const d=C.useRef(null),l=ct(d,u),c=ug(n),f=dg(t);return C.useEffect(()=>{const m=d.current;if(!m)return;const h=window.HTMLInputElement.prototype,w=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&w){const k=new Event("click",{bubbles:s});w.call(m,n),m.dispatchEvent(k)}},[c,n,s]),r.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:l,style:{...o.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ik.displayName=h6;function ok(e){return e?"checked":"unchecked"}var ak=rk,f6=sk;const ft=C.forwardRef(({className:e,...t},n)=>r.jsx(ak,{className:Ee("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:r.jsx(f6,{className:Ee("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ft.displayName=ak.displayName;var Jf="rovingFocusGroup.onEntryFocus",m6={bubbles:!1,cancelable:!0},Ml="RovingFocusGroup",[qm,lk,p6]=mg(Ml),[g6,kd]=tn(Ml,[p6]),[x6,v6]=g6(Ml),ck=C.forwardRef((e,t)=>r.jsx(qm.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(qm.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(y6,{...e,ref:t})})}));ck.displayName=Ml;var y6=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:o=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,x=C.useRef(null),w=ct(t,x),k=Pl(u),[_,v]=ls({prop:d,defaultProp:l??null,onChange:c,caller:Ml}),[b,g]=C.useState(!1),y=Pr(f),j=lk(n),E=C.useRef(!1),[P,A]=C.useState(0);return C.useEffect(()=>{const N=x.current;if(N)return N.addEventListener(Jf,y),()=>N.removeEventListener(Jf,y)},[y]),r.jsx(x6,{scope:n,orientation:s,dir:k,loop:o,currentTabStopId:_,onItemFocus:C.useCallback(N=>v(N),[v]),onItemShiftTab:C.useCallback(()=>g(!0),[]),onFocusableItemAdd:C.useCallback(()=>A(N=>N+1),[]),onFocusableItemRemove:C.useCallback(()=>A(N=>N-1),[]),children:r.jsx(et.div,{tabIndex:b||P===0?-1:0,"data-orientation":s,...h,ref:w,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{E.current=!0}),onFocus:Le(e.onFocus,N=>{const R=!E.current;if(N.target===N.currentTarget&&R&&!b){const I=new CustomEvent(Jf,m6);if(N.currentTarget.dispatchEvent(I),!I.defaultPrevented){const O=j().filter(K=>K.focusable),B=O.find(K=>K.active),$=O.find(K=>K.id===_),z=[B,$,...O].filter(Boolean).map(K=>K.ref.current);hk(z,m)}}E.current=!1}),onBlur:Le(e.onBlur,()=>g(!1))})})}),uk="RovingFocusGroupItem",dk=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:o=!1,tabStopId:u,children:d,...l}=e,c=Nn(),f=u||c,m=v6(uk,n),h=m.currentTabStopId===f,x=lk(n),{onFocusableItemAdd:w,onFocusableItemRemove:k,currentTabStopId:_}=m;return C.useEffect(()=>{if(s)return w(),()=>k()},[s,w,k]),r.jsx(qm.ItemSlot,{scope:n,id:f,focusable:s,active:o,children:r.jsx(et.span,{tabIndex:h?0:-1,"data-orientation":m.orientation,...l,ref:t,onMouseDown:Le(e.onMouseDown,v=>{s?m.onItemFocus(f):v.preventDefault()}),onFocus:Le(e.onFocus,()=>m.onItemFocus(f)),onKeyDown:Le(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){m.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=_6(v,m.orientation,m.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let y=x().filter(j=>j.focusable).map(j=>j.ref.current);if(b==="last")y.reverse();else if(b==="prev"||b==="next"){b==="prev"&&y.reverse();const j=y.indexOf(v.currentTarget);y=m.loop?C6(y,j+1):y.slice(j+1)}setTimeout(()=>hk(y))}}),children:typeof d=="function"?d({isCurrentTabStop:h,hasTabStop:_!=null}):d})})});dk.displayName=uk;var b6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function w6(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _6(e,t,n){const s=w6(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return b6[s]}function hk(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}function C6(e,t){return e.map((n,s)=>e[(t+s)%e.length])}var fk=ck,mk=dk;function S6(e){const t=k6(e),n=C.forwardRef((s,o)=>{const{children:u,...d}=s,l=C.Children.toArray(u),c=l.find(N6);if(c){const f=c.props.children,m=l.map(h=>h===c?C.Children.count(f)>1?C.Children.only(null):C.isValidElement(f)?f.props.children:null:h);return r.jsx(t,{...d,ref:o,children:C.isValidElement(f)?C.cloneElement(f,void 0,m):null})}return r.jsx(t,{...d,ref:o,children:u})});return n.displayName=`${e}.Slot`,n}function k6(e){const t=C.forwardRef((n,s)=>{const{children:o,...u}=n;if(C.isValidElement(o)){const d=P6(o),l=E6(u,o.props);return o.type!==C.Fragment&&(l.ref=s?Ts(s,d):d),C.cloneElement(o,l)}return C.Children.count(o)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j6=Symbol("radix.slottable");function N6(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j6}function E6(e,t){const n={...t};for(const s in t){const o=e[s],u=t[s];/^on[A-Z]/.test(s)?o&&u?n[s]=(...l)=>{const c=u(...l);return o(...l),c}:o&&(n[s]=o):s==="style"?n[s]={...o,...u}:s==="className"&&(n[s]=[o,u].filter(Boolean).join(" "))}return{...e,...n}}function P6(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ym=["Enter"," "],A6=["ArrowDown","PageUp","Home"],pk=["ArrowUp","PageDown","End"],T6=[...A6,...pk],R6={ltr:[...Ym,"ArrowRight"],rtl:[...Ym,"ArrowLeft"]},M6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Dl="Menu",[hl,D6,L6]=mg(Dl),[Ki,gk]=tn(Dl,[L6,Jo,kd]),jd=Jo(),xk=kd(),[I6,qi]=Ki(Dl),[O6,Ll]=Ki(Dl),vk=e=>{const{__scopeMenu:t,open:n=!1,children:s,dir:o,onOpenChange:u,modal:d=!0}=e,l=jd(t),[c,f]=C.useState(null),m=C.useRef(!1),h=Pr(u),x=Pl(o);return C.useEffect(()=>{const w=()=>{m.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},k=()=>m.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),r.jsx(Cg,{...l,children:r.jsx(I6,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:f,children:r.jsx(O6,{scope:t,onClose:C.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:m,dir:x,modal:d,children:s})})})};vk.displayName=Dl;var B6="MenuAnchor",Pg=C.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,o=jd(n);return r.jsx(Sg,{...o,...s,ref:t})});Pg.displayName=B6;var Ag="MenuPortal",[F6,yk]=Ki(Ag,{forceMount:void 0}),bk=e=>{const{__scopeMenu:t,forceMount:n,children:s,container:o}=e,u=qi(Ag,t);return r.jsx(F6,{scope:t,forceMount:n,children:r.jsx(Tr,{present:n||u.open,children:r.jsx(Tl,{asChild:!0,container:o,children:s})})})};bk.displayName=Ag;var En="MenuContent",[$6,Tg]=Ki(En),wk=C.forwardRef((e,t)=>{const n=yk(En,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=qi(En,e.__scopeMenu),d=Ll(En,e.__scopeMenu);return r.jsx(hl.Provider,{scope:e.__scopeMenu,children:r.jsx(Tr,{present:s||u.open,children:r.jsx(hl.Slot,{scope:e.__scopeMenu,children:d.modal?r.jsx(z6,{...o,ref:t}):r.jsx(H6,{...o,ref:t})})})})}),z6=C.forwardRef((e,t)=>{const n=qi(En,e.__scopeMenu),s=C.useRef(null),o=ct(t,s);return C.useEffect(()=>{const u=s.current;if(u)return sg(u)},[]),r.jsx(Rg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Le(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),H6=C.forwardRef((e,t)=>{const n=qi(En,e.__scopeMenu);return r.jsx(Rg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),W6=S6("MenuContent.ScrollLock"),Rg=C.forwardRef((e,t)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:o,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,disableOutsideScroll:k,..._}=e,v=qi(En,n),b=Ll(En,n),g=jd(n),y=xk(n),j=D6(n),[E,P]=C.useState(null),A=C.useRef(null),N=ct(t,A,v.onContentChange),R=C.useRef(0),I=C.useRef(""),O=C.useRef(0),B=C.useRef(null),$=C.useRef("right"),Y=C.useRef(0),z=k?ud:C.Fragment,K=k?{as:W6,allowPinchZoom:!0}:void 0,G=L=>{var X,W;const M=I.current+L,F=j().filter(le=>!le.disabled),q=document.activeElement,H=(X=F.find(le=>le.ref.current===q))==null?void 0:X.textValue,oe=F.map(le=>le.textValue),fe=tB(oe,M,H),me=(W=F.find(le=>le.textValue===fe))==null?void 0:W.ref.current;(function le(re){I.current=re,window.clearTimeout(R.current),re!==""&&(R.current=window.setTimeout(()=>le(""),1e3))})(M),me&&setTimeout(()=>me.focus())};C.useEffect(()=>()=>window.clearTimeout(R.current),[]),ng();const U=C.useCallback(L=>{var F,q;return $.current===((F=B.current)==null?void 0:F.side)&&nB(L,(q=B.current)==null?void 0:q.area)},[]);return r.jsx($6,{scope:n,searchRef:I,onItemEnter:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),onItemLeave:C.useCallback(L=>{var M;U(L)||((M=A.current)==null||M.focus(),P(null))},[U]),onTriggerLeave:C.useCallback(L=>{U(L)&&L.preventDefault()},[U]),pointerGraceTimerRef:O,onPointerGraceIntentChange:C.useCallback(L=>{B.current=L},[]),children:r.jsx(z,{...K,children:r.jsx(ld,{asChild:!0,trapped:o,onMountAutoFocus:Le(u,L=>{var M;L.preventDefault(),(M=A.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:r.jsx(Al,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:h,onInteractOutside:x,onDismiss:w,children:r.jsx(fk,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:E,onCurrentTabStopIdChange:P,onEntryFocus:Le(c,L=>{b.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(kg,{role:"menu","aria-orientation":"vertical","data-state":Ok(v.open),"data-radix-menu-content":"",dir:b.dir,...g,..._,ref:N,style:{outline:"none",..._.style},onKeyDown:Le(_.onKeyDown,L=>{const F=L.target.closest("[data-radix-menu-content]")===L.currentTarget,q=L.ctrlKey||L.altKey||L.metaKey,H=L.key.length===1;F&&(L.key==="Tab"&&L.preventDefault(),!q&&H&&G(L.key));const oe=A.current;if(L.target!==oe||!T6.includes(L.key))return;L.preventDefault();const me=j().filter(X=>!X.disabled).map(X=>X.ref.current);pk.includes(L.key)&&me.reverse(),Z6(me)}),onBlur:Le(e.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(R.current),I.current="")}),onPointerMove:Le(e.onPointerMove,fl(L=>{const M=L.target,F=Y.current!==L.clientX;if(L.currentTarget.contains(M)&&F){const q=L.clientX>Y.current?"right":"left";$.current=q,Y.current=L.clientX}}))})})})})})})});wk.displayName=En;var V6="MenuGroup",Mg=C.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(et.div,{role:"group",...s,ref:t})});Mg.displayName=V6;var U6="MenuLabel",_k=C.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(et.div,{...s,ref:t})});_k.displayName=U6;var Wu="MenuItem",Ub="menu.itemSelect",Nd=C.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:s,...o}=e,u=C.useRef(null),d=Ll(Wu,e.__scopeMenu),l=Tg(Wu,e.__scopeMenu),c=ct(t,u),f=C.useRef(!1),m=()=>{const h=u.current;if(!n&&h){const x=new CustomEvent(Ub,{bubbles:!0,cancelable:!0});h.addEventListener(Ub,w=>s==null?void 0:s(w),{once:!0}),QC(h,x),x.defaultPrevented?f.current=!1:d.onClose()}};return r.jsx(Ck,{...o,ref:c,disabled:n,onClick:Le(e.onClick,m),onPointerDown:h=>{var x;(x=e.onPointerDown)==null||x.call(e,h),f.current=!0},onPointerUp:Le(e.onPointerUp,h=>{var x;f.current||(x=h.currentTarget)==null||x.click()}),onKeyDown:Le(e.onKeyDown,h=>{const x=l.searchRef.current!=="";n||x&&h.key===" "||Ym.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});Nd.displayName=Wu;var Ck=C.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:s=!1,textValue:o,...u}=e,d=Tg(Wu,n),l=xk(n),c=C.useRef(null),f=ct(t,c),[m,h]=C.useState(!1),[x,w]=C.useState("");return C.useEffect(()=>{const k=c.current;k&&w((k.textContent??"").trim())},[u.children]),r.jsx(hl.ItemSlot,{scope:n,disabled:s,textValue:o??x,children:r.jsx(mk,{asChild:!0,...l,focusable:!s,children:r.jsx(et.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...u,ref:f,onPointerMove:Le(e.onPointerMove,fl(k=>{s?d.onItemLeave(k):(d.onItemEnter(k),k.defaultPrevented||k.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Le(e.onPointerLeave,fl(k=>d.onItemLeave(k))),onFocus:Le(e.onFocus,()=>h(!0)),onBlur:Le(e.onBlur,()=>h(!1))})})})}),G6="MenuCheckboxItem",Sk=C.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:s,...o}=e;return r.jsx(Pk,{scope:e.__scopeMenu,checked:n,children:r.jsx(Nd,{role:"menuitemcheckbox","aria-checked":Vu(n)?"mixed":n,...o,ref:t,"data-state":Lg(n),onSelect:Le(o.onSelect,()=>s==null?void 0:s(Vu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Sk.displayName=G6;var kk="MenuRadioGroup",[K6,q6]=Ki(kk,{value:void 0,onValueChange:()=>{}}),jk=C.forwardRef((e,t)=>{const{value:n,onValueChange:s,...o}=e,u=Pr(s);return r.jsx(K6,{scope:e.__scopeMenu,value:n,onValueChange:u,children:r.jsx(Mg,{...o,ref:t})})});jk.displayName=kk;var Nk="MenuRadioItem",Ek=C.forwardRef((e,t)=>{const{value:n,...s}=e,o=q6(Nk,e.__scopeMenu),u=n===o.value;return r.jsx(Pk,{scope:e.__scopeMenu,checked:u,children:r.jsx(Nd,{role:"menuitemradio","aria-checked":u,...s,ref:t,"data-state":Lg(u),onSelect:Le(s.onSelect,()=>{var d;return(d=o.onValueChange)==null?void 0:d.call(o,n)},{checkForDefaultPrevented:!1})})})});Ek.displayName=Nk;var Dg="MenuItemIndicator",[Pk,Y6]=Ki(Dg,{checked:!1}),Ak=C.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:s,...o}=e,u=Y6(Dg,n);return r.jsx(Tr,{present:s||Vu(u.checked)||u.checked===!0,children:r.jsx(et.span,{...o,ref:t,"data-state":Lg(u.checked)})})});Ak.displayName=Dg;var X6="MenuSeparator",Tk=C.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e;return r.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});Tk.displayName=X6;var J6="MenuArrow",Rk=C.forwardRef((e,t)=>{const{__scopeMenu:n,...s}=e,o=jd(n);return r.jsx(jg,{...o,...s,ref:t})});Rk.displayName=J6;var Q6="MenuSub",[bW,Mk]=Ki(Q6),qa="MenuSubTrigger",Dk=C.forwardRef((e,t)=>{const n=qi(qa,e.__scopeMenu),s=Ll(qa,e.__scopeMenu),o=Mk(qa,e.__scopeMenu),u=Tg(qa,e.__scopeMenu),d=C.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=u,f={__scopeMenu:e.__scopeMenu},m=C.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return C.useEffect(()=>m,[m]),C.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),r.jsx(Pg,{asChild:!0,...f,children:r.jsx(Ck,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Ok(n.open),...e,ref:Ts(t,o.onTriggerChange),onClick:h=>{var x;(x=e.onClick)==null||x.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Le(e.onPointerMove,fl(h=>{u.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Le(e.onPointerLeave,fl(h=>{var w,k;m();const x=(w=n.content)==null?void 0:w.getBoundingClientRect();if(x){const _=(k=n.content)==null?void 0:k.dataset.side,v=_==="right",b=v?-5:5,g=x[v?"left":"right"],y=x[v?"right":"left"];u.onPointerGraceIntentChange({area:[{x:h.clientX+b,y:h.clientY},{x:g,y:x.top},{x:y,y:x.top},{x:y,y:x.bottom},{x:g,y:x.bottom}],side:_}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(h),h.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:Le(e.onKeyDown,h=>{var w;const x=u.searchRef.current!=="";e.disabled||x&&h.key===" "||R6[s.dir].includes(h.key)&&(n.onOpenChange(!0),(w=n.content)==null||w.focus(),h.preventDefault())})})})});Dk.displayName=qa;var Lk="MenuSubContent",Ik=C.forwardRef((e,t)=>{const n=yk(En,e.__scopeMenu),{forceMount:s=n.forceMount,...o}=e,u=qi(En,e.__scopeMenu),d=Ll(En,e.__scopeMenu),l=Mk(Lk,e.__scopeMenu),c=C.useRef(null),f=ct(t,c);return r.jsx(hl.Provider,{scope:e.__scopeMenu,children:r.jsx(Tr,{present:s||u.open,children:r.jsx(hl.Slot,{scope:e.__scopeMenu,children:r.jsx(Rg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:f,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var h;d.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Le(e.onFocusOutside,m=>{m.target!==l.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Le(e.onEscapeKeyDown,m=>{d.onClose(),m.preventDefault()}),onKeyDown:Le(e.onKeyDown,m=>{var w;const h=m.currentTarget.contains(m.target),x=M6[d.dir].includes(m.key);h&&x&&(u.onOpenChange(!1),(w=l.trigger)==null||w.focus(),m.preventDefault())})})})})})});Ik.displayName=Lk;function Ok(e){return e?"open":"closed"}function Vu(e){return e==="indeterminate"}function Lg(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}function Z6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function eB(e,t){return e.map((n,s)=>e[(t+s)%e.length])}function tB(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,u=n?e.indexOf(n):-1;let d=eB(e,Math.max(u,0));o.length===1&&(d=d.filter(f=>f!==n));const c=d.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function rB(e,t){const{x:n,y:s}=e;let o=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const l=t[u],c=t[d],f=l.x,m=l.y,h=c.x,x=c.y;m>s!=x>s&&n<(h-f)*(s-m)/(x-m)+f&&(o=!o)}return o}function nB(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return rB(n,t)}function fl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var sB=vk,iB=Pg,oB=bk,aB=wk,lB=Mg,cB=_k,uB=Nd,dB=Sk,hB=jk,fB=Ek,mB=Ak,pB=Tk,gB=Rk,xB=Dk,vB=Ik,Ed="DropdownMenu",[yB]=tn(Ed,[gk]),Ur=gk(),[bB,Bk]=yB(Ed),Fk=e=>{const{__scopeDropdownMenu:t,children:n,dir:s,open:o,defaultOpen:u,onOpenChange:d,modal:l=!0}=e,c=Ur(t),f=C.useRef(null),[m,h]=ls({prop:o,defaultProp:u??!1,onChange:d,caller:Ed});return r.jsx(bB,{scope:t,triggerId:Nn(),triggerRef:f,contentId:Nn(),open:m,onOpenChange:h,onOpenToggle:C.useCallback(()=>h(x=>!x),[h]),modal:l,children:r.jsx(sB,{...c,open:m,onOpenChange:h,dir:s,modal:l,children:n})})};Fk.displayName=Ed;var $k="DropdownMenuTrigger",zk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...o}=e,u=Bk($k,n),d=Ur(n);return r.jsx(iB,{asChild:!0,...d,children:r.jsx(et.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:Ts(t,u.triggerRef),onPointerDown:Le(e.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(u.onOpenToggle(),u.open||l.preventDefault())}),onKeyDown:Le(e.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&u.onOpenToggle(),l.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});zk.displayName=$k;var wB="DropdownMenuPortal",Hk=e=>{const{__scopeDropdownMenu:t,...n}=e,s=Ur(t);return r.jsx(oB,{...s,...n})};Hk.displayName=wB;var Wk="DropdownMenuContent",Vk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Bk(Wk,n),u=Ur(n),d=C.useRef(!1);return r.jsx(aB,{id:o.contentId,"aria-labelledby":o.triggerId,...u,...s,ref:t,onCloseAutoFocus:Le(e.onCloseAutoFocus,l=>{var c;d.current||(c=o.triggerRef.current)==null||c.focus(),d.current=!1,l.preventDefault()}),onInteractOutside:Le(e.onInteractOutside,l=>{const c=l.detail.originalEvent,f=c.button===0&&c.ctrlKey===!0,m=c.button===2||f;(!o.modal||m)&&(d.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Vk.displayName=Wk;var _B="DropdownMenuGroup",CB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(lB,{...o,...s,ref:t})});CB.displayName=_B;var SB="DropdownMenuLabel",Uk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(cB,{...o,...s,ref:t})});Uk.displayName=SB;var kB="DropdownMenuItem",Gk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(uB,{...o,...s,ref:t})});Gk.displayName=kB;var jB="DropdownMenuCheckboxItem",Kk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(dB,{...o,...s,ref:t})});Kk.displayName=jB;var NB="DropdownMenuRadioGroup",EB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(hB,{...o,...s,ref:t})});EB.displayName=NB;var PB="DropdownMenuRadioItem",qk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(fB,{...o,...s,ref:t})});qk.displayName=PB;var AB="DropdownMenuItemIndicator",Yk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(mB,{...o,...s,ref:t})});Yk.displayName=AB;var TB="DropdownMenuSeparator",Xk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(pB,{...o,...s,ref:t})});Xk.displayName=TB;var RB="DropdownMenuArrow",MB=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(gB,{...o,...s,ref:t})});MB.displayName=RB;var DB="DropdownMenuSubTrigger",Jk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(xB,{...o,...s,ref:t})});Jk.displayName=DB;var LB="DropdownMenuSubContent",Qk=C.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...s}=e,o=Ur(n);return r.jsx(vB,{...o,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qk.displayName=LB;var IB=Fk,OB=zk,BB=Hk,Zk=Vk,ej=Uk,tj=Gk,rj=Kk,nj=qk,sj=Yk,ij=Xk,oj=Jk,aj=Qk;const ci=IB,ui=OB,FB=C.forwardRef(({className:e,inset:t,children:n,...s},o)=>r.jsxs(oj,{ref:o,className:Ee("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[n,r.jsx(Vr,{className:"ml-auto"})]}));FB.displayName=oj.displayName;const $B=C.forwardRef(({className:e,...t},n)=>r.jsx(aj,{ref:n,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));$B.displayName=aj.displayName;const As=C.forwardRef(({className:e,sideOffset:t=4,...n},s)=>r.jsx(BB,{children:r.jsx(Zk,{ref:s,sideOffset:t,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));As.displayName=Zk.displayName;const It=C.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(tj,{ref:s,className:Ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));It.displayName=tj.displayName;const ml=C.forwardRef(({className:e,children:t,checked:n,...s},o)=>r.jsxs(rj,{ref:o,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(sj,{children:r.jsx(Jt,{className:"h-4 w-4"})})}),t]}));ml.displayName=rj.displayName;const zB=C.forwardRef(({className:e,children:t,...n},s)=>r.jsxs(nj,{ref:s,className:Ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(sj,{children:r.jsx(kM,{className:"h-2 w-2 fill-current"})})}),t]}));zB.displayName=nj.displayName;const pl=C.forwardRef(({className:e,inset:t,...n},s)=>r.jsx(ej,{ref:s,className:Ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));pl.displayName=ej.displayName;const Wr=C.forwardRef(({className:e,...t},n)=>r.jsx(ij,{ref:n,className:Ee("-mx-1 my-1 h-px bg-muted",e),...t}));Wr.displayName=ij.displayName;const Gb={development:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",productivity:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",integration:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",external:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",lsp:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",default:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"};function HB({plugin:e,onToggle:t,isToggling:n,projectDir:s}){const o=Gb[e.category]||Gb.default;return e.mcpServers||e.lspServers||e.commands,r.jsxs(Ao.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:`
558
558
  relative p-3 rounded-lg border transition-all
559
559
  ${e.installed?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-white border-gray-200 dark:bg-slate-900 dark:border-slate-700 hover:border-indigo-300 dark:hover:border-indigo-700"}
560
- `,children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("h4",{className:"font-medium text-gray-900 dark:text-white truncate",children:e.name}),e.sourceType==="external"&&r.jsx(Fi,{className:"w-3 h-3 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),r.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400 line-clamp-2 mb-2",children:e.description||"No description"}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.category&&r.jsx(rt,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${o}`,children:e.category}),e.lspServers&&r.jsxs(rt,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",children:[r.jsx(as,{className:"w-2.5 h-2.5 mr-0.5"}),"LSP"]}),e.mcpServers&&r.jsxs(rt,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[r.jsx(Pn,{className:"w-2.5 h-2.5 mr-0.5"}),"MCP"]}),e.version&&r.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",e.version]})]})]}),r.jsx("div",{className:"flex-shrink-0",children:r.jsx(ft,{checked:e.installed,onCheckedChange:()=>t(e),disabled:n===e.name,className:"data-[state=checked]:bg-green-600"})})]}),n===e.name&&r.jsx("div",{className:"absolute inset-0 bg-white/80 dark:bg-slate-900/80 rounded-lg flex items-center justify-center",children:r.jsx(at,{className:"w-5 h-5 animate-spin text-indigo-600"})})]})}function WB({open:e,onOpenChange:t,projectDir:n,projectName:s}){const[o,u]=C.useState(!0),[d,l]=C.useState({allPlugins:[],categories:[]}),[c,f]=C.useState(""),[m,h]=C.useState("project"),[x,w]=C.useState([]),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState(null),j=async()=>{u(!0);try{const I=await ve.getPlugins();l(I)}catch(I){J.error("Failed to load plugins: "+I.message)}finally{u(!1)}};C.useEffect(()=>{e&&(j(),f(""))},[e]);const E=C.useMemo(()=>{let I=d.allPlugins||[];if(c){const O=c.toLowerCase();I=I.filter(B=>{var $,Y;return(($=B.name)==null?void 0:$.toLowerCase().includes(O))||((Y=B.description)==null?void 0:Y.toLowerCase().includes(O))})}return I=I.filter(O=>!(O.sourceType==="external"&&!k||O.sourceType==="internal"&&!v)),x.length>0&&(I=I.filter(O=>x.includes(O.category))),I.sort((O,B)=>O.installed&&!B.installed?-1:!O.installed&&B.installed?1:O.name.localeCompare(B.name)),I},[d.allPlugins,c,k,v,x]),P=I=>{w(O=>O.includes(I)?O.filter(B=>B!==I):[...O,I])},A=async I=>{y(I.name);try{if(I.installed){const O=await ve.uninstallPlugin(`${I.name}@${I.marketplace}`);O.success?J.success(`Uninstalled ${I.name}`):J.error(O.error||"Failed to uninstall")}else{const O=await ve.installPlugin(I.name,I.marketplace,m,n);O.success?J.success(`Installed ${I.name} (${m})`):J.error(O.error||"Failed to install")}await j()}catch(O){J.error("Operation failed: "+O.message)}finally{y(null)}},N=E.filter(I=>I.installed).length,R=E.filter(I=>!I.installed).length;return r.jsx(Et,{open:e,onOpenChange:t,children:r.jsxs(Ct,{className:"max-w-2xl max-h-[85vh] flex flex-col p-0",children:[r.jsxs(St,{className:"px-6 pt-6 pb-4 border-b dark:border-slate-800",children:[r.jsxs(kt,{className:"flex items-center gap-2",children:[r.jsx($i,{className:"w-5 h-5 text-indigo-600"}),"Install Plugins",s&&r.jsx(rt,{variant:"outline",className:"ml-2 font-normal",children:s})]}),r.jsx(ir,{children:"Enable plugins for enhanced Claude Code capabilities"})]}),r.jsxs("div",{className:"px-6 py-3 border-b dark:border-slate-800 space-y-3 bg-gray-50 dark:bg-slate-900/50",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Nl,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx(lt,{value:c,onChange:I=>f(I.target.value),placeholder:"Search plugins...",className:"pl-9 h-9 bg-white dark:bg-slate-800"})]}),r.jsxs(yr,{value:m,onValueChange:h,children:[r.jsx(mr,{className:"w-36 h-9 bg-white dark:bg-slate-800",children:r.jsx(br,{})}),r.jsxs(pr,{children:[r.jsx(jt,{value:"project",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(jC,{className:"w-3.5 h-3.5"}),"Project"]})}),r.jsx(jt,{value:"user",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Fi,{className:"w-3.5 h-3.5"}),"Global"]})}),r.jsx(jt,{value:"local",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3.5 h-3.5"}),"Local"]})})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs(ci,{children:[r.jsx(ui,{asChild:!0,children:r.jsxs(ae,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",children:[r.jsx(qp,{className:"w-3 h-3"}),"Category",x.length>0&&r.jsx(rt,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:x.length}),r.jsx(wr,{className:"w-3 h-3 ml-1"})]})}),r.jsxs(As,{align:"start",className:"w-48",children:[r.jsx(pl,{className:"text-xs",children:"Categories"}),r.jsx(Wr,{}),(d.categories||[]).map(I=>r.jsx(ml,{checked:x.includes(I),onCheckedChange:()=>P(I),children:I},I)),x.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(Wr,{}),r.jsx(ml,{checked:!1,onCheckedChange:()=>w([]),children:"Clear all"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-3 ml-auto text-xs",children:[r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[r.jsx(ft,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Anthropic"})]}),r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[r.jsx(ft,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Community"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 dark:text-slate-500",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Jt,{className:"w-3 h-3 text-green-600"}),N," installed"]}),r.jsxs("span",{children:[R," available"]}),r.jsxs("span",{className:"ml-auto",children:[E.length," shown"]})]})]}),r.jsx(Tn,{className:"flex-1 px-6 py-4",children:o?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(at,{className:"w-6 h-6 animate-spin text-indigo-600"})}):E.length===0?r.jsxs("div",{className:"text-center py-12 text-gray-500 dark:text-slate-400",children:[r.jsx($i,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),r.jsx("p",{children:"No plugins found"}),c&&r.jsx(ae,{variant:"link",size:"sm",onClick:()=>f(""),className:"mt-2",children:"Clear search"})]}):r.jsx("div",{className:"grid grid-cols-1 gap-3",children:r.jsx(Jw,{mode:"popLayout",children:E.map(I=>r.jsx(HB,{plugin:I,onToggle:A,isToggling:g,projectDir:n},`${I.name}@${I.marketplace}`))})})}),r.jsxs("div",{className:"px-6 py-3 border-t dark:border-slate-800 flex items-center justify-between bg-gray-50 dark:bg-slate-900/50",children:[r.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-500",children:"Plugins extend Claude Code with LSP servers, MCP tools, and commands"}),r.jsx(ae,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Done"})]})]})})}var Qf={exports:{}},Kb;function VB(){return Kb||(Kb=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,A=arguments.length,N=A<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(A<3?P(N):A>3?P(y,j,N):P(y,j))||N);return A>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),x=c(9924),w=c(844),k=c(4725),_=c(2585),v=c(3656);let b=l.AccessibilityManager=class extends w.Disposable{constructor(g,y,j,E){super(),this._terminal=g,this._coreBrowserService=j,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let P=0;P<this._terminal.rows;P++)this._rowElements[P]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[P]);if(this._topBoundaryFocusListener=P=>this._handleBoundaryFocus(P,0),this._bottomBoundaryFocusListener=P=>this._handleBoundaryFocus(P,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new x.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((P=>this._handleResize(P.rows)))),this.register(this._terminal.onRender((P=>this._refreshRows(P.start,P.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((P=>this._handleChar(P)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
560
+ `,children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[r.jsx("h4",{className:"font-medium text-gray-900 dark:text-white truncate",children:e.name}),e.sourceType==="external"&&r.jsx(Fi,{className:"w-3 h-3 text-orange-500 flex-shrink-0",title:"Community plugin"})]}),r.jsx("p",{className:"text-xs text-gray-600 dark:text-slate-400 line-clamp-2 mb-2",children:e.description||"No description"}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.category&&r.jsx(rt,{variant:"outline",className:`text-[10px] px-1.5 py-0 ${o}`,children:e.category}),e.lspServers&&r.jsxs(rt,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-cyan-50 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",children:[r.jsx(as,{className:"w-2.5 h-2.5 mr-0.5"}),"LSP"]}),e.mcpServers&&r.jsxs(rt,{variant:"outline",className:"text-[10px] px-1.5 py-0 bg-blue-50 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:[r.jsx(Pn,{className:"w-2.5 h-2.5 mr-0.5"}),"MCP"]}),e.version&&r.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-slate-500",children:["v",e.version]})]})]}),r.jsx("div",{className:"flex-shrink-0",children:r.jsx(ft,{checked:e.installed,onCheckedChange:()=>t(e),disabled:n===e.name,className:"data-[state=checked]:bg-green-600"})})]}),n===e.name&&r.jsx("div",{className:"absolute inset-0 bg-white/80 dark:bg-slate-900/80 rounded-lg flex items-center justify-center",children:r.jsx(at,{className:"w-5 h-5 animate-spin text-indigo-600"})})]})}function WB({open:e,onOpenChange:t,projectDir:n,projectName:s}){const[o,u]=C.useState(!0),[d,l]=C.useState({allPlugins:[],categories:[]}),[c,f]=C.useState(""),[m,h]=C.useState("project"),[x,w]=C.useState([]),[k,_]=C.useState(!0),[v,b]=C.useState(!0),[g,y]=C.useState(null),j=async()=>{u(!0);try{const I=await ve.getPlugins();l(I)}catch(I){J.error("Failed to load plugins: "+I.message)}finally{u(!1)}};C.useEffect(()=>{e&&(j(),f(""))},[e]);const E=C.useMemo(()=>{let I=d.allPlugins||[];if(c){const O=c.toLowerCase();I=I.filter(B=>{var $,Y;return(($=B.name)==null?void 0:$.toLowerCase().includes(O))||((Y=B.description)==null?void 0:Y.toLowerCase().includes(O))})}return I=I.filter(O=>!(O.sourceType==="external"&&!k||O.sourceType==="internal"&&!v)),x.length>0&&(I=I.filter(O=>x.includes(O.category))),I.sort((O,B)=>O.installed&&!B.installed?-1:!O.installed&&B.installed?1:O.name.localeCompare(B.name)),I},[d.allPlugins,c,k,v,x]),P=I=>{w(O=>O.includes(I)?O.filter(B=>B!==I):[...O,I])},A=async I=>{y(I.name);try{if(I.installed){const O=await ve.uninstallPlugin(`${I.name}@${I.marketplace}`);O.success?J.success(`Uninstalled ${I.name}`):J.error(O.error||"Failed to uninstall")}else{const O=await ve.installPlugin(I.name,I.marketplace,m,n);O.success?J.success(`Installed ${I.name} (${m})`):J.error(O.error||"Failed to install")}await j()}catch(O){J.error("Operation failed: "+O.message)}finally{y(null)}},N=E.filter(I=>I.installed).length,R=E.filter(I=>!I.installed).length;return r.jsx(Et,{open:e,onOpenChange:t,children:r.jsxs(Ct,{className:"max-w-2xl max-h-[85vh] flex flex-col p-0 overflow-hidden",children:[r.jsxs(St,{className:"px-6 pt-6 pb-4 border-b dark:border-slate-800",children:[r.jsxs(kt,{className:"flex items-center gap-2",children:[r.jsx($i,{className:"w-5 h-5 text-indigo-600"}),"Install Plugins",s&&r.jsx(rt,{variant:"outline",className:"ml-2 font-normal",children:s})]}),r.jsx(ir,{children:"Enable plugins for enhanced Claude Code capabilities"})]}),r.jsxs("div",{className:"px-6 py-3 border-b dark:border-slate-800 space-y-3 bg-gray-50 dark:bg-slate-900/50",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Nl,{className:"w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),r.jsx(lt,{value:c,onChange:I=>f(I.target.value),placeholder:"Search plugins...",className:"pl-9 h-9 bg-white dark:bg-slate-800"})]}),r.jsxs(yr,{value:m,onValueChange:h,children:[r.jsx(mr,{className:"w-36 h-9 bg-white dark:bg-slate-800",children:r.jsx(br,{})}),r.jsxs(pr,{children:[r.jsx(jt,{value:"project",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(jC,{className:"w-3.5 h-3.5"}),"Project"]})}),r.jsx(jt,{value:"user",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Fi,{className:"w-3.5 h-3.5"}),"Global"]})}),r.jsx(jt,{value:"local",children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(Ut,{className:"w-3.5 h-3.5"}),"Local"]})})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs(ci,{children:[r.jsx(ui,{asChild:!0,children:r.jsxs(ae,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",children:[r.jsx(qp,{className:"w-3 h-3"}),"Category",x.length>0&&r.jsx(rt,{variant:"secondary",className:"ml-1 h-4 px-1 text-[10px]",children:x.length}),r.jsx(wr,{className:"w-3 h-3 ml-1"})]})}),r.jsxs(As,{align:"start",className:"w-48",children:[r.jsx(pl,{className:"text-xs",children:"Categories"}),r.jsx(Wr,{}),(d.categories||[]).map(I=>r.jsx(ml,{checked:x.includes(I),onCheckedChange:()=>P(I),children:I},I)),x.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(Wr,{}),r.jsx(ml,{checked:!1,onCheckedChange:()=>w([]),children:"Clear all"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-3 ml-auto text-xs",children:[r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[r.jsx(ft,{checked:v,onCheckedChange:b,className:"h-4 w-7 data-[state=checked]:bg-blue-600"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Anthropic"})]}),r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer",children:[r.jsx(ft,{checked:k,onCheckedChange:_,className:"h-4 w-7 data-[state=checked]:bg-orange-600"}),r.jsx("span",{className:"text-gray-600 dark:text-slate-400",children:"Community"})]})]})]}),r.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 dark:text-slate-500",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Jt,{className:"w-3 h-3 text-green-600"}),N," installed"]}),r.jsxs("span",{children:[R," available"]}),r.jsxs("span",{className:"ml-auto",children:[E.length," shown"]})]})]}),r.jsx(Tn,{className:"flex-1 min-h-0 px-6 py-4",children:o?r.jsx("div",{className:"flex items-center justify-center py-12",children:r.jsx(at,{className:"w-6 h-6 animate-spin text-indigo-600"})}):E.length===0?r.jsxs("div",{className:"text-center py-12 text-gray-500 dark:text-slate-400",children:[r.jsx($i,{className:"w-10 h-10 mx-auto mb-3 opacity-30"}),r.jsx("p",{children:"No plugins found"}),c&&r.jsx(ae,{variant:"link",size:"sm",onClick:()=>f(""),className:"mt-2",children:"Clear search"})]}):r.jsx("div",{className:"grid grid-cols-1 gap-3",children:r.jsx(Jw,{mode:"popLayout",children:E.map(I=>r.jsx(HB,{plugin:I,onToggle:A,isToggling:g,projectDir:n},`${I.name}@${I.marketplace}`))})})}),r.jsxs("div",{className:"px-6 py-3 border-t dark:border-slate-800 flex items-center justify-between bg-gray-50 dark:bg-slate-900/50",children:[r.jsx("p",{className:"text-xs text-gray-500 dark:text-slate-500",children:"Plugins extend Claude Code with LSP servers, MCP tools, and commands"}),r.jsx(ae,{variant:"outline",size:"sm",onClick:()=>t(!1),children:"Done"})]})]})})}var Qf={exports:{}},Kb;function VB(){return Kb||(Kb=1,(function(e,t){(function(n,s){e.exports=s()})(globalThis,(()=>(()=>{var n={4567:function(d,l,c){var f=this&&this.__decorate||function(g,y,j,E){var P,A=arguments.length,N=A<3?y:E===null?E=Object.getOwnPropertyDescriptor(y,j):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,y,j,E);else for(var R=g.length-1;R>=0;R--)(P=g[R])&&(N=(A<3?P(N):A>3?P(y,j,N):P(y,j))||N);return A>3&&N&&Object.defineProperty(y,j,N),N},m=this&&this.__param||function(g,y){return function(j,E){y(j,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),x=c(9924),w=c(844),k=c(4725),_=c(2585),v=c(3656);let b=l.AccessibilityManager=class extends w.Disposable{constructor(g,y,j,E){super(),this._terminal=g,this._coreBrowserService=j,this._renderService=E,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let P=0;P<this._terminal.rows;P++)this._rowElements[P]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[P]);if(this._topBoundaryFocusListener=P=>this._handleBoundaryFocus(P,0),this._bottomBoundaryFocusListener=P=>this._handleBoundaryFocus(P,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new x.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((P=>this._handleResize(P.rows)))),this.register(this._terminal.onRender((P=>this._refreshRows(P.start,P.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((P=>this._handleChar(P)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
561
561
  `)))),this.register(this._terminal.onA11yTab((P=>this._handleTab(P)))),this.register(this._terminal.onKey((P=>this._handleKey(P.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let y=0;y<g;y++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
562
562
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,y){this._liveRegionDebouncer.refresh(g,y,this._terminal.rows)}_renderRows(g,y){const j=this._terminal.buffer,E=j.lines.length.toString();for(let P=g;P<=y;P++){const A=j.lines.get(j.ydisp+P),N=[],R=(A==null?void 0:A.translateToString(!0,void 0,void 0,N))||"",I=(j.ydisp+P+1).toString(),O=this._rowElements[P];O&&(R.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=R,this._rowColumns.set(O,N)),O.setAttribute("aria-posinset",I),O.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,y){const j=g.target,E=this._rowElements[y===0?1:this._rowElements.length-2];if(j.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==E)return;let P,A;if(y===0?(P=j,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(P=this._rowElements.shift(),A=j,this._rowContainer.removeChild(P)),P.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:g.anchorNode,offset:g.anchorOffset},j={node:g.focusNode,offset:g.focusOffset};if((y.node.compareDocumentPosition(j.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===j.node&&y.offset>j.offset)&&([y,j]=[j,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const E=this._rowElements.slice(-1)[0];if(j.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(j={node:E,offset:((R=E.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(j.node))return;const P=({node:I,offset:O})=>{const B=I instanceof Text?I.parentNode:I;let $=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN($))return console.warn("row is invalid. Race condition?"),null;const Y=this._rowColumns.get(B);if(!Y)return console.warn("columns is null. Race condition?"),null;let z=O<Y.length?Y[O]:Y.slice(-1)[0]+1;return z>=this._terminal.cols&&(++$,z=0),{row:$,column:z}},A=P(y),N=P(j);if(A&&N){if(A.row>N.row||A.row===N.row&&A.column>=N.column)throw new Error("invalid range");this._terminal.select(A.column,A.row,(N.row-A.row)*this._terminal.cols-A.column+N.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=b=f([m(1,_.IInstantiationService),m(2,k.ICoreBrowserService),m(3,k.IRenderService)],b)},3614:(d,l)=>{function c(x){return x.replace(/\r?\n/g,"\r")}function f(x,w){return w?"\x1B[200~"+x+"\x1B[201~":x}function m(x,w,k,_){x=f(x=c(x),k.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(x,!0),w.value=""}function h(x,w,k){const _=k.getBoundingClientRect(),v=x.clientX-_.left-10,b=x.clientY-_.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${v}px`,w.style.top=`${b}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=f,l.copyHandler=function(x,w){x.clipboardData&&x.clipboardData.setData("text/plain",w.selectionText),x.preventDefault()},l.handlePasteEvent=function(x,w,k,_){x.stopPropagation(),x.clipboardData&&m(x.clipboardData.getData("text/plain"),w,k,_)},l.paste=m,l.moveTextAreaUnderMouseCursor=h,l.rightClickHandler=function(x,w,k,_,v){h(x,w,k),v&&_.rightClickSelect(x),w.value=_.selectionText,w.select()}},7239:(d,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=c(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(m,h,x){this._css.set(m,h,x)}getCss(m,h){return this._css.get(m,h)}setColor(m,h,x){this._color.set(m,h,x)}getColor(m,h){return this._color.get(m,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,f,m,h){c.addEventListener(f,m,h);let x=!1;return{dispose:()=>{x||(x=!0,c.removeEventListener(f,m,h))}}}},3551:function(d,l,c){var f=this&&this.__decorate||function(b,g,y,j){var E,P=arguments.length,A=P<3?g:j===null?j=Object.getOwnPropertyDescriptor(g,y):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,g,y,j);else for(var N=b.length-1;N>=0;N--)(E=b[N])&&(A=(P<3?E(A):P>3?E(g,y,A):E(g,y))||A);return P>3&&A&&Object.defineProperty(g,y,A),A},m=this&&this.__param||function(b,g){return function(y,j){g(y,j,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const h=c(3656),x=c(8460),w=c(844),k=c(2585),_=c(4725);let v=l.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(b,g,y,j,E){super(),this._element=b,this._mouseService=g,this._renderService=y,this._bufferService=j,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var P;this._lastMouseEvent=void 0,(P=this._activeProviderReplies)==null||P.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const g=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const y=b.composedPath();for(let j=0;j<y.length;j++){const E=y[j];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,g){var j,E;this._activeProviderReplies&&g||((j=this._activeProviderReplies)==null||j.forEach((P=>{P==null||P.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[P,A]of this._linkProviderService.linkProviders.entries())g?(E=this._activeProviderReplies)!=null&&E.get(P)&&(y=this._checkLinkProviderResult(P,b,y)):A.provideLinks(b.y,(N=>{var I,O;if(this._isMouseOut)return;const R=N==null?void 0:N.map((B=>({link:B})));(I=this._activeProviderReplies)==null||I.set(P,R),y=this._checkLinkProviderResult(P,b,y),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,g){const y=new Set;for(let j=0;j<g.size;j++){const E=g.get(j);if(E)for(let P=0;P<E.length;P++){const A=E[P],N=A.link.range.start.y<b?0:A.link.range.start.x,R=A.link.range.end.y>b?this._bufferService.cols:A.link.range.end.x;for(let I=N;I<=R;I++){if(y.has(I)){E.splice(P--,1);break}y.add(I)}}}}_checkLinkProviderResult(b,g,y){var P;if(!this._activeProviderReplies)return y;const j=this._activeProviderReplies.get(b);let E=!1;for(let A=0;A<b;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(E=!0);if(!E&&j){const A=j.find((N=>this._linkAtPosition(N.link,g)));A&&(y=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let A=0;A<this._activeProviderReplies.size;A++){const N=(P=this._activeProviderReplies.get(A))==null?void 0:P.find((R=>this._linkAtPosition(R.link,g)));if(N){y=!0,this._handleNewLink(N);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const g=this._positionFromMouseEvent(b,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,g){this._currentLink&&this._lastMouseEvent&&(!b||!g||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(b.link,g)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,j;return(j=(y=this._currentLink)==null?void 0:y.state)==null?void 0:j.decorations.pointerCursor},set:y=>{var j;(j=this._currentLink)!=null&&j.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,j;return(j=(y=this._currentLink)==null?void 0:y.state)==null?void 0:j.decorations.underline},set:y=>{var j,E,P;(j=this._currentLink)!=null&&j.state&&((P=(E=this._currentLink)==null?void 0:E.state)==null?void 0:P.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const j=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=j&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(j,E),this._lastMouseEvent)){const P=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);P&&this._askForLink(P,!1)}}))))}_linkHover(b,g,y){var j;(j=this._currentLink)!=null&&j.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(y,g.text)}_fireUnderlineEvent(b,g){const y=b.range,j=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-j-1,y.end.x,y.end.y-j-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(b,g,y){var j;(j=this._currentLink)!=null&&j.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(y,g.text)}_linkAtPosition(b,g){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,j=b.range.end.y*this._bufferService.cols+b.range.end.x,E=g.y*this._bufferService.cols+g.x;return y<=E&&E<=j}_positionFromMouseEvent(b,g,y){const j=y.getCoords(b,g,this._bufferService.cols,this._bufferService.rows);if(j)return{x:j[0],y:j[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,g,y,j,E){return{x1:b,y1:g,x2:y,y2:j,cols:this._bufferService.cols,fg:E}}};l.Linkifier=v=f([m(1,_.IMouseService),m(2,_.IRenderService),m(3,k.IBufferService),m(4,_.ILinkProviderService)],v)},9042:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,l,c){var f=this&&this.__decorate||function(_,v,b,g){var y,j=arguments.length,E=j<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,b):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,v,b,g);else for(var P=_.length-1;P>=0;P--)(y=_[P])&&(E=(j<3?y(E):j>3?y(v,b,E):y(v,b))||E);return j>3&&E&&Object.defineProperty(v,b,E),E},m=this&&this.__param||function(_,v){return function(b,g){v(b,g,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const h=c(511),x=c(2585);let w=l.OscLinkProvider=class{constructor(_,v,b){this._bufferService=_,this._optionsService=v,this._oscLinkService=b}provideLinks(_,v){var R;const b=this._bufferService.buffer.lines.get(_-1);if(!b)return void v(void 0);const g=[],y=this._optionsService.rawOptions.linkHandler,j=new h.CellData,E=b.getTrimmedLength();let P=-1,A=-1,N=!1;for(let I=0;I<E;I++)if(A!==-1||b.hasContent(I)){if(b.loadCell(I,j),j.hasExtendedAttrs()&&j.extended.urlId){if(A===-1){A=I,P=j.extended.urlId;continue}N=j.extended.urlId!==P}else A!==-1&&(N=!0);if(N||A!==-1&&I===E-1){const O=(R=this._oscLinkService.getLinkData(P))==null?void 0:R.uri;if(O){const B={start:{x:A+1,y:_},end:{x:I+(N||I!==E-1?0:1),y:_}};let $=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const Y=new URL(O);["http:","https:"].includes(Y.protocol)||($=!0)}catch{$=!0}$||g.push({text:O,range:B,activate:(Y,z)=>y?y.activate(Y,z,B):k(0,z),hover:(Y,z)=>{var K;return(K=y==null?void 0:y.hover)==null?void 0:K.call(y,Y,z,B)},leave:(Y,z)=>{var K;return(K=y==null?void 0:y.leave)==null?void 0:K.call(y,Y,z,B)}})}N=!1,j.hasExtendedAttrs()&&j.extended.urlId?(A=I,P=j.extended.urlId):(A=-1,P=-1)}}v(g)}};function k(_,v){if(confirm(`Do you want to navigate to ${v}?
563
563
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  <!-- PWA Manifest -->
21
21
  <link rel="manifest" href="/manifest.json">
22
- <script type="module" crossorigin src="/assets/index-Hb0G88jh.js"></script>
22
+ <script type="module" crossorigin src="/assets/index-Ci3xOSgX.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="/assets/index-X0dVhMey.css">
24
24
  </head>
25
25
  <body>