Skip to main content
Glama

Spec Workflow MCP

main.js144 kB
var ba=Object.defineProperty;var Sa=(e,t,n)=>t in e?ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var cn=(e,t,n)=>Sa(e,typeof t!="symbol"?t+"":t,n);import{r as i,j as s,R as xe,u as Z,c as lt,a as Fo,g as Ca,b as Na,d as O,S as Ea,e as Ra,f as se,h as $o,i as Ma,k as Pa,B as oe,C as Te,l as yt,m as bt,n as Ie,o as St,p as ja}from"./i18n.js";function I(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Oe(e,t=[]){let n=[];function o(a,l){const c=i.createContext(l),d=n.length;n=[...n,l];const u=f=>{const{scope:g,children:h,...v}=f,m=g?.[e]?.[d]||c,x=i.useMemo(()=>v,Object.values(v));return s.jsx(m.Provider,{value:x,children:h})};u.displayName=a+"Provider";function p(f,g){const h=g?.[e]?.[d]||c,v=i.useContext(h);if(v)return v;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,p]}const r=()=>{const a=n.map(l=>i.createContext(l));return function(c){const d=c?.[e]||a;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return r.scopeName=e,[o,Aa(r,...t)]}function Aa(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const l=o.reduce((c,{useScope:d,scopeName:u})=>{const f=d(a)[`__scope${u}`];return{...c,...f}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Tn(e){const t=e+"CollectionProvider",[n,o]=Oe(t),[r,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:x,children:y}=m,b=xe.useRef(null),C=xe.useRef(new Map).current;return s.jsx(r,{scope:x,itemMap:C,collectionRef:b,children:y})};l.displayName=t;const c=e+"CollectionSlot",d=lt(c),u=xe.forwardRef((m,x)=>{const{scope:y,children:b}=m,C=a(c,y),N=Z(x,C.collectionRef);return s.jsx(d,{ref:N,children:b})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",g=lt(p),h=xe.forwardRef((m,x)=>{const{scope:y,children:b,...C}=m,N=xe.useRef(null),R=Z(x,N),k=a(p,y);return xe.useEffect(()=>(k.itemMap.set(N,{ref:N,...C}),()=>void k.itemMap.delete(N))),s.jsx(g,{[f]:"",ref:R,children:b})});h.displayName=p;function v(m){const x=a(e+"CollectionConsumer",m);return xe.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const C=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((k,E)=>C.indexOf(k.ref.current)-C.indexOf(E.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},v,o]}var re=globalThis?.document?i.useLayoutEffect:()=>{},Ta=Fo[" useId ".trim().toString()]||(()=>{}),Ia=0;function Be(e){const[t,n]=i.useState(Ta());return re(()=>{n(o=>o??String(Ia++))},[e]),t?`radix-${t}`:""}var ht=Na();const ka=Ca(ht);var _a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=_a.reduce((e,t)=>{const n=lt(`Primitive.${t}`),o=i.forwardRef((r,a)=>{const{asChild:l,...c}=r,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Bo(e,t){e&&ht.flushSync(()=>e.dispatchEvent(t))}function Re(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}var Da=Fo[" useInsertionEffect ".trim().toString()]||re;function dt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,l]=Oa({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:r;{const p=i.useRef(e!==void 0);i.useEffect(()=>{const f=p.current;f!==c&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,o])}const u=i.useCallback(p=>{if(c){const f=La(p)?p(e):p;f!==e&&l.current?.(f)}else a(p)},[c,e,a,l]);return[d,u]}function Oa({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),a=i.useRef(t);return Da(()=>{a.current=t},[t]),i.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function La(e){return typeof e=="function"}var Fa=i.createContext(void 0);function Wt(e){const t=i.useContext(Fa);return e||t||"ltr"}var ln="rovingFocusGroup.onEntryFocus",$a={bubbles:!1,cancelable:!0},gt="RovingFocusGroup",[wn,Vo,Ba]=Tn(gt),[Va,Kt]=Oe(gt,[Ba]),[Ua,Ha]=Va(gt),Uo=i.forwardRef((e,t)=>s.jsx(wn.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(wn.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(za,{...e,ref:t})})}));Uo.displayName=gt;var za=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,g=i.useRef(null),h=Z(t,g),v=Wt(a),[m,x]=dt({prop:l,defaultProp:c??null,onChange:d,caller:gt}),[y,b]=i.useState(!1),C=Re(u),N=Vo(n),R=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect(()=>{const j=g.current;if(j)return j.addEventListener(ln,C),()=>j.removeEventListener(ln,C)},[C]),s.jsx(Ua,{scope:n,orientation:o,dir:v,loop:r,currentTabStopId:m,onItemFocus:i.useCallback(j=>x(j),[x]),onItemShiftTab:i.useCallback(()=>b(!0),[]),onFocusableItemAdd:i.useCallback(()=>E(j=>j+1),[]),onFocusableItemRemove:i.useCallback(()=>E(j=>j-1),[]),children:s.jsx(K.div,{tabIndex:y||k===0?-1:0,"data-orientation":o,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:I(e.onMouseDown,()=>{R.current=!0}),onFocus:I(e.onFocus,j=>{const B=!R.current;if(j.target===j.currentTarget&&B&&!y){const D=new CustomEvent(ln,$a);if(j.currentTarget.dispatchEvent(D),!D.defaultPrevented){const z=N().filter(_=>_.focusable),V=z.find(_=>_.active),F=z.find(_=>_.id===m),G=[V,F,...z].filter(Boolean).map(_=>_.ref.current);Wo(G,p)}}R.current=!1}),onBlur:I(e.onBlur,()=>b(!1))})})}),Ho="RovingFocusGroupItem",zo=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:a,children:l,...c}=e,d=Be(),u=a||d,p=Ha(Ho,n),f=p.currentTabStopId===u,g=Vo(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:m}=p;return i.useEffect(()=>{if(o)return h(),()=>v()},[o,h,v]),s.jsx(wn.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:s.jsx(K.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:I(e.onMouseDown,x=>{o?p.onItemFocus(u):x.preventDefault()}),onFocus:I(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:I(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Ga(x,p.orientation,p.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let C=g().filter(N=>N.focusable).map(N=>N.ref.current);if(y==="last")C.reverse();else if(y==="prev"||y==="next"){y==="prev"&&C.reverse();const N=C.indexOf(x.currentTarget);C=p.loop?qa(C,N+1):C.slice(N+1)}setTimeout(()=>Wo(C))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:m!=null}):l})})});zo.displayName=Ho;var Wa={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ka(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Ga(e,t,n){const o=Ka(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Wa[o]}function Wo(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function qa(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ko=Uo,Go=zo;function Ya(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var Qe=e=>{const{present:t,children:n}=e,o=Xa(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),a=Z(o.ref,Za(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:a}):null};Qe.displayName="Presence";function Xa(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),a=i.useRef("none"),l=e?"mounted":"unmounted",[c,d]=Ya(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=Ct(o.current);a.current=c==="mounted"?u:"none"},[c]),re(()=>{const u=o.current,p=r.current;if(p!==e){const g=a.current,h=Ct(u);e?d("MOUNT"):h==="none"||u?.display==="none"?d("UNMOUNT"):d(p&&g!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),re(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=h=>{const m=Ct(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(d("ANIMATION_END"),!r.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=h=>{h.target===t&&(a.current=Ct(o.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function Ct(e){return e?.animationName||"none"}function Za(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Gt="Tabs",[Qa,Ju]=Oe(Gt,[Kt]),qo=Kt(),[Ja,In]=Qa(Gt),Yo=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:a,orientation:l="horizontal",dir:c,activationMode:d="automatic",...u}=e,p=Wt(c),[f,g]=dt({prop:o,onChange:r,defaultProp:a??"",caller:Gt});return s.jsx(Ja,{scope:n,baseId:Be(),value:f,onValueChange:g,orientation:l,dir:p,activationMode:d,children:s.jsx(K.div,{dir:p,"data-orientation":l,...u,ref:t})})});Yo.displayName=Gt;var Xo="TabsList",Zo=i.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,a=In(Xo,n),l=qo(n);return s.jsx(Ko,{asChild:!0,...l,orientation:a.orientation,dir:a.dir,loop:o,children:s.jsx(K.div,{role:"tablist","aria-orientation":a.orientation,...r,ref:t})})});Zo.displayName=Xo;var Qo="TabsTrigger",Jo=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...a}=e,l=In(Qo,n),c=qo(n),d=nr(l.baseId,o),u=or(l.baseId,o),p=o===l.value;return s.jsx(Go,{asChild:!0,...c,focusable:!r,active:p,children:s.jsx(K.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:d,...a,ref:t,onMouseDown:I(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?l.onValueChange(o):f.preventDefault()}),onKeyDown:I(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(o)}),onFocus:I(e.onFocus,()=>{const f=l.activationMode!=="manual";!p&&!r&&f&&l.onValueChange(o)})})})});Jo.displayName=Qo;var er="TabsContent",tr=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:a,...l}=e,c=In(er,n),d=nr(c.baseId,o),u=or(c.baseId,o),p=o===c.value,f=i.useRef(p);return i.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Qe,{present:r||p,children:({present:g})=>s.jsx(K.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:u,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:g&&a})})});tr.displayName=er;function nr(e,t){return`${e}-trigger-${t}`}function or(e,t){return`${e}-content-${t}`}var ei=Yo,ti=Zo,ni=Jo,oi=tr;function ri({className:e,...t}){return s.jsx(ei,{"data-slot":"tabs",className:O("flex flex-col gap-2",e),...t})}function si({className:e,...t}){return s.jsx(ti,{"data-slot":"tabs-list",className:O("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]","[body.vscode-light_&]:border [body.vscode-light_&]:border-border/20 [body.vscode-light_&]:shadow-sm",e),...t})}function st({className:e,...t}){return s.jsx(ni,{"data-slot":"tabs-trigger",className:O("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function at({className:e,...t}){return s.jsx(oi,{"data-slot":"tabs-content",className:O("flex-1 outline-none",e),...t})}const ai=Ra("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Nt({className:e,variant:t,asChild:n=!1,...o}){const r=n?Ea:"span";return s.jsx(r,{"data-slot":"badge",className:O(ai({variant:t}),e),...o})}var kn="Progress",_n=100,[ii,ef]=Oe(kn),[ci,li]=ii(kn),rr=i.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:a=di,...l}=e;(r||r===0)&&!io(r)&&console.error(ui(`${r}`,"Progress"));const c=io(r)?r:_n;o!==null&&!co(o,c)&&console.error(fi(`${o}`,"Progress"));const d=co(o,c)?o:null,u=Lt(d)?a(d,c):void 0;return s.jsx(ci,{scope:n,value:d,max:c,children:s.jsx(K.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Lt(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":ir(d,c),"data-value":d??void 0,"data-max":c,...l,ref:t})})});rr.displayName=kn;var sr="ProgressIndicator",ar=i.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=li(sr,n);return s.jsx(K.div,{"data-state":ir(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});ar.displayName=sr;function di(e,t){return`${Math.round(e/t*100)}%`}function ir(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Lt(e){return typeof e=="number"}function io(e){return Lt(e)&&!isNaN(e)&&e>0}function co(e,t){return Lt(e)&&!isNaN(e)&&e<=t&&e>=0}function ui(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${_n}\`.`}function fi(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${_n} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var pi=rr,mi=ar;function lo({className:e,value:t,...n}){return s.jsx(pi,{"data-slot":"progress",className:O("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:s.jsx(mi,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function uo(e,[t,n]){return Math.min(n,Math.max(t,e))}function hi(e,t=globalThis?.document){const n=Re(e);i.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var gi="DismissableLayer",yn="dismissableLayer.update",vi="dismissableLayer.pointerDownOutside",xi="dismissableLayer.focusOutside",fo,cr=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dn=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...d}=e,u=i.useContext(cr),[p,f]=i.useState(null),g=p?.ownerDocument??globalThis?.document,[,h]=i.useState({}),v=Z(t,E=>f(E)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=p?m.indexOf(p):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,N=b>=y,R=bi(E=>{const j=E.target,B=[...u.branches].some(D=>D.contains(j));!N||B||(r?.(E),l?.(E),E.defaultPrevented||c?.())},g),k=Si(E=>{const j=E.target;[...u.branches].some(D=>D.contains(j))||(a?.(E),l?.(E),E.defaultPrevented||c?.())},g);return hi(E=>{b===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},g),i.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fo=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),po(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=fo)}},[p,g,n,u]),i.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),po())},[p,u]),i.useEffect(()=>{const E=()=>h({});return document.addEventListener(yn,E),()=>document.removeEventListener(yn,E)},[]),s.jsx(K.div,{...d,ref:v,style:{pointerEvents:C?N?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,k.onFocusCapture),onBlurCapture:I(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,R.onPointerDownCapture)})});Dn.displayName=gi;var wi="DismissableLayerBranch",yi=i.forwardRef((e,t)=>{const n=i.useContext(cr),o=i.useRef(null),r=Z(t,o);return i.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(K.div,{...e,ref:r})});yi.displayName=wi;function bi(e,t=globalThis?.document){const n=Re(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let d=function(){lr(vi,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=d,t.addEventListener("click",r.current,{once:!0})):d()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Si(e,t=globalThis?.document){const n=Re(e),o=i.useRef(!1);return i.useEffect(()=>{const r=a=>{a.target&&!o.current&&lr(xi,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function po(){const e=new CustomEvent(yn);document.dispatchEvent(e)}function lr(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Bo(r,a):r.dispatchEvent(a)}var dn=0;function dr(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mo()),document.body.insertAdjacentElement("beforeend",e[1]??mo()),dn++,()=>{dn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),dn--}},[])}function mo(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var un="focusScope.autoFocusOnMount",fn="focusScope.autoFocusOnUnmount",ho={bubbles:!1,cancelable:!0},Ci="FocusScope",On=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...l}=e,[c,d]=i.useState(null),u=Re(r),p=Re(a),f=i.useRef(null),g=Z(t,m=>d(m)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let m=function(C){if(h.paused||!c)return;const N=C.target;c.contains(N)?f.current=N:ke(f.current,{select:!0})},x=function(C){if(h.paused||!c)return;const N=C.relatedTarget;N!==null&&(c.contains(N)||ke(f.current,{select:!0}))},y=function(C){if(document.activeElement===document.body)for(const R of C)R.removedNodes.length>0&&ke(c)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const b=new MutationObserver(y);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),b.disconnect()}}},[o,c,h.paused]),i.useEffect(()=>{if(c){vo.add(h);const m=document.activeElement;if(!c.contains(m)){const y=new CustomEvent(un,ho);c.addEventListener(un,u),c.dispatchEvent(y),y.defaultPrevented||(Ni(ji(ur(c)),{select:!0}),document.activeElement===m&&ke(c))}return()=>{c.removeEventListener(un,u),setTimeout(()=>{const y=new CustomEvent(fn,ho);c.addEventListener(fn,p),c.dispatchEvent(y),y.defaultPrevented||ke(m??document.body,{select:!0}),c.removeEventListener(fn,p),vo.remove(h)},0)}}},[c,u,p,h]);const v=i.useCallback(m=>{if(!n&&!o||h.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[C,N]=Ei(b);C&&N?!m.shiftKey&&y===N?(m.preventDefault(),n&&ke(C,{select:!0})):m.shiftKey&&y===C&&(m.preventDefault(),n&&ke(N,{select:!0})):y===b&&m.preventDefault()}},[n,o,h.paused]);return s.jsx(K.div,{tabIndex:-1,...l,ref:g,onKeyDown:v})});On.displayName=Ci;function Ni(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ke(o,{select:t}),document.activeElement!==n)return}function Ei(e){const t=ur(e),n=go(t,e),o=go(t.reverse(),e);return[n,o]}function ur(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function go(e,t){for(const n of e)if(!Ri(n,{upTo:t}))return n}function Ri(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Mi(e){return e instanceof HTMLInputElement&&"select"in e}function ke(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mi(e)&&t&&e.select()}}var vo=Pi();function Pi(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xo(e,t),e.unshift(t)},remove(t){e=xo(e,t),e[0]?.resume()}}}function xo(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function ji(e){return e.filter(t=>t.tagName!=="A")}const Ai=["top","right","bottom","left"],_e=Math.min,le=Math.max,Ft=Math.round,Et=Math.floor,Ee=e=>({x:e,y:e}),Ti={left:"right",right:"left",bottom:"top",top:"bottom"},Ii={start:"end",end:"start"};function bn(e,t,n){return le(e,_e(t,n))}function je(e,t){return typeof e=="function"?e(t):e}function Ae(e){return e.split("-")[0]}function Je(e){return e.split("-")[1]}function Ln(e){return e==="x"?"y":"x"}function Fn(e){return e==="y"?"height":"width"}const ki=new Set(["top","bottom"]);function Ne(e){return ki.has(Ae(e))?"y":"x"}function $n(e){return Ln(Ne(e))}function _i(e,t,n){n===void 0&&(n=!1);const o=Je(e),r=$n(e),a=Fn(r);let l=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=$t(l)),[l,$t(l)]}function Di(e){const t=$t(e);return[Sn(e),t,Sn(t)]}function Sn(e){return e.replace(/start|end/g,t=>Ii[t])}const wo=["left","right"],yo=["right","left"],Oi=["top","bottom"],Li=["bottom","top"];function Fi(e,t,n){switch(e){case"top":case"bottom":return n?t?yo:wo:t?wo:yo;case"left":case"right":return t?Oi:Li;default:return[]}}function $i(e,t,n,o){const r=Je(e);let a=Fi(Ae(e),n==="start",o);return r&&(a=a.map(l=>l+"-"+r),t&&(a=a.concat(a.map(Sn)))),a}function $t(e){return e.replace(/left|right|bottom|top/g,t=>Ti[t])}function Bi(e){return{top:0,right:0,bottom:0,left:0,...e}}function fr(e){return typeof e!="number"?Bi(e):{top:e,right:e,bottom:e,left:e}}function Bt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function bo(e,t,n){let{reference:o,floating:r}=e;const a=Ne(t),l=$n(t),c=Fn(l),d=Ae(t),u=a==="y",p=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[c]/2-r[c]/2;let h;switch(d){case"top":h={x:p,y:o.y-r.height};break;case"bottom":h={x:p,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(Je(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const Vi=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:a=[],platform:l}=n,c=a.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:f}=bo(u,o,d),g=o,h={},v=0;for(let m=0;m<c.length;m++){const{name:x,fn:y}=c[m],{x:b,y:C,data:N,reset:R}=await y({x:p,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});p=b??p,f=C??f,h={...h,[x]:{...h[x],...N}},R&&v<=50&&(v++,typeof R=="object"&&(R.placement&&(g=R.placement),R.rects&&(u=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:p,y:f}=bo(u,g,d)),m=-1)}return{x:p,y:f,placement:g,strategy:r,middlewareData:h}};async function ut(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:a,rects:l,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:h=0}=je(t,e),v=fr(h),x=c[g?f==="floating"?"reference":"floating":f],y=Bt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(x)))==null||n?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:u,rootBoundary:p,strategy:d})),b=f==="floating"?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),N=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},R=Bt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:C,strategy:d}):b);return{top:(y.top-R.top+v.top)/N.y,bottom:(R.bottom-y.bottom+v.bottom)/N.y,left:(y.left-R.left+v.left)/N.x,right:(R.right-y.right+v.right)/N.x}}const Ui=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:a,platform:l,elements:c,middlewareData:d}=t,{element:u,padding:p=0}=je(e,t)||{};if(u==null)return{};const f=fr(p),g={x:n,y:o},h=$n(r),v=Fn(h),m=await l.getDimensions(u),x=h==="y",y=x?"top":"left",b=x?"bottom":"right",C=x?"clientHeight":"clientWidth",N=a.reference[v]+a.reference[h]-g[h]-a.floating[v],R=g[h]-a.reference[h],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let E=k?k[C]:0;(!E||!await(l.isElement==null?void 0:l.isElement(k)))&&(E=c.floating[C]||a.floating[v]);const j=N/2-R/2,B=E/2-m[v]/2-1,D=_e(f[y],B),z=_e(f[b],B),V=D,F=E-m[v]-z,$=E/2-m[v]/2+j,G=bn(V,$,F),_=!d.arrow&&Je(r)!=null&&$!==G&&a.reference[v]/2-($<V?D:z)-m[v]/2<0,H=_?$<V?$-V:$-F:0;return{[h]:g[h]+H,data:{[h]:G,centerOffset:$-G-H,..._&&{alignmentOffset:H}},reset:_}}}),Hi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:a,rects:l,initialPlacement:c,platform:d,elements:u}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...x}=je(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const y=Ae(r),b=Ne(c),C=Ae(c)===c,N=await(d.isRTL==null?void 0:d.isRTL(u.floating)),R=g||(C||!m?[$t(c)]:Di(c)),k=v!=="none";!g&&k&&R.push(...$i(c,m,v,N));const E=[c,...R],j=await ut(t,x),B=[];let D=((o=a.flip)==null?void 0:o.overflows)||[];if(p&&B.push(j[y]),f){const $=_i(r,l,N);B.push(j[$[0]],j[$[1]])}if(D=[...D,{placement:r,overflows:B}],!B.every($=>$<=0)){var z,V;const $=(((z=a.flip)==null?void 0:z.index)||0)+1,G=E[$];if(G&&(!(f==="alignment"?b!==Ne(G):!1)||D.every(A=>Ne(A.placement)===b?A.overflows[0]>0:!0)))return{data:{index:$,overflows:D},reset:{placement:G}};let _=(V=D.filter(H=>H.overflows[0]<=0).sort((H,A)=>H.overflows[1]-A.overflows[1])[0])==null?void 0:V.placement;if(!_)switch(h){case"bestFit":{var F;const H=(F=D.filter(A=>{if(k){const M=Ne(A.placement);return M===b||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,Q)=>M+Q,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:F[0];H&&(_=H);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};function So(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Co(e){return Ai.some(t=>e[t]>=0)}const zi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=je(e,t);switch(o){case"referenceHidden":{const a=await ut(t,{...r,elementContext:"reference"}),l=So(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Co(l)}}}case"escaped":{const a=await ut(t,{...r,altBoundary:!0}),l=So(a,n.floating);return{data:{escapedOffsets:l,escaped:Co(l)}}}default:return{}}}}},pr=new Set(["left","top"]);async function Wi(e,t){const{placement:n,platform:o,elements:r}=e,a=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=Ae(n),c=Je(n),d=Ne(n)==="y",u=pr.has(l)?-1:1,p=a&&d?-1:1,f=je(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof v=="number"&&(h=c==="end"?v*-1:v),d?{x:h*p,y:g*u}:{x:g*u,y:h*p}}const Ki=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:a,placement:l,middlewareData:c}=t,d=await Wi(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:a+d.y,data:{...d,placement:l}}}}},Gi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...d}=je(e,t),u={x:n,y:o},p=await ut(t,d),f=Ne(Ae(r)),g=Ln(f);let h=u[g],v=u[f];if(a){const x=g==="y"?"top":"left",y=g==="y"?"bottom":"right",b=h+p[x],C=h-p[y];h=bn(b,h,C)}if(l){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=v+p[x],C=v-p[y];v=bn(b,v,C)}const m=c.fn({...t,[g]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[g]:a,[f]:l}}}}}},qi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=je(e,t),p={x:n,y:o},f=Ne(r),g=Ln(f);let h=p[g],v=p[f];const m=je(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(d){const C=g==="y"?"height":"width",N=a.reference[g]-a.floating[C]+x.mainAxis,R=a.reference[g]+a.reference[C]-x.mainAxis;h<N?h=N:h>R&&(h=R)}if(u){var y,b;const C=g==="y"?"width":"height",N=pr.has(Ae(r)),R=a.reference[f]-a.floating[C]+(N&&((y=l.offset)==null?void 0:y[f])||0)+(N?0:x.crossAxis),k=a.reference[f]+a.reference[C]+(N?0:((b=l.offset)==null?void 0:b[f])||0)-(N?x.crossAxis:0);v<R?v=R:v>k&&(v=k)}return{[g]:h,[f]:v}}}},Yi=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:a,platform:l,elements:c}=t,{apply:d=()=>{},...u}=je(e,t),p=await ut(t,u),f=Ae(r),g=Je(r),h=Ne(r)==="y",{width:v,height:m}=a.floating;let x,y;f==="top"||f==="bottom"?(x=f,y=g===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(y=f,x=g==="end"?"top":"bottom");const b=m-p.top-p.bottom,C=v-p.left-p.right,N=_e(m-p[x],b),R=_e(v-p[y],C),k=!t.middlewareData.shift;let E=N,j=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=b),k&&!g){const D=le(p.left,0),z=le(p.right,0),V=le(p.top,0),F=le(p.bottom,0);h?j=v-2*(D!==0||z!==0?D+z:le(p.left,p.right)):E=m-2*(V!==0||F!==0?V+F:le(p.top,p.bottom))}await d({...t,availableWidth:j,availableHeight:E});const B=await l.getDimensions(c.floating);return v!==B.width||m!==B.height?{reset:{rects:!0}}:{}}}};function qt(){return typeof window<"u"}function et(e){return mr(e)?(e.nodeName||"").toLowerCase():"#document"}function de(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Pe(e){var t;return(t=(mr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mr(e){return qt()?e instanceof Node||e instanceof de(e).Node:!1}function we(e){return qt()?e instanceof Element||e instanceof de(e).Element:!1}function Me(e){return qt()?e instanceof HTMLElement||e instanceof de(e).HTMLElement:!1}function No(e){return!qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof de(e).ShadowRoot}const Xi=new Set(["inline","contents"]);function vt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Xi.has(r)}const Zi=new Set(["table","td","th"]);function Qi(e){return Zi.has(et(e))}const Ji=[":popover-open",":modal"];function Yt(e){return Ji.some(t=>{try{return e.matches(t)}catch{return!1}})}const ec=["transform","translate","scale","rotate","perspective"],tc=["transform","translate","scale","rotate","perspective","filter"],nc=["paint","layout","strict","content"];function Bn(e){const t=Vn(),n=we(e)?ye(e):e;return ec.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||tc.some(o=>(n.willChange||"").includes(o))||nc.some(o=>(n.contain||"").includes(o))}function oc(e){let t=De(e);for(;Me(t)&&!Ze(t);){if(Bn(t))return t;if(Yt(t))return null;t=De(t)}return null}function Vn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const rc=new Set(["html","body","#document"]);function Ze(e){return rc.has(et(e))}function ye(e){return de(e).getComputedStyle(e)}function Xt(e){return we(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(et(e)==="html")return e;const t=e.assignedSlot||e.parentNode||No(e)&&e.host||Pe(e);return No(t)?t.host:t}function hr(e){const t=De(e);return Ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:Me(t)&&vt(t)?t:hr(t)}function ft(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=hr(e),a=r===((o=e.ownerDocument)==null?void 0:o.body),l=de(r);if(a){const c=Cn(l);return t.concat(l,l.visualViewport||[],vt(r)?r:[],c&&n?ft(c):[])}return t.concat(r,ft(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gr(e){const t=ye(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Me(e),a=r?e.offsetWidth:n,l=r?e.offsetHeight:o,c=Ft(n)!==a||Ft(o)!==l;return c&&(n=a,o=l),{width:n,height:o,$:c}}function Un(e){return we(e)?e:e.contextElement}function Ye(e){const t=Un(e);if(!Me(t))return Ee(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:a}=gr(t);let l=(a?Ft(n.width):n.width)/o,c=(a?Ft(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const sc=Ee(0);function vr(e){const t=de(e);return!Vn()||!t.visualViewport?sc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ac(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==de(e)?!1:t}function Ve(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=Un(e);let l=Ee(1);t&&(o?we(o)&&(l=Ye(o)):l=Ye(e));const c=ac(a,n,o)?vr(a):Ee(0);let d=(r.left+c.x)/l.x,u=(r.top+c.y)/l.y,p=r.width/l.x,f=r.height/l.y;if(a){const g=de(a),h=o&&we(o)?de(o):o;let v=g,m=Cn(v);for(;m&&o&&h!==v;){const x=Ye(m),y=m.getBoundingClientRect(),b=ye(m),C=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,N=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;d*=x.x,u*=x.y,p*=x.x,f*=x.y,d+=C,u+=N,v=de(m),m=Cn(v)}}return Bt({width:p,height:f,x:d,y:u})}function Zt(e,t){const n=Xt(e).scrollLeft;return t?t.left+n:Ve(Pe(e)).left+n}function xr(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Zt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ic(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const a=r==="fixed",l=Pe(o),c=t?Yt(t.floating):!1;if(o===l||c&&a)return n;let d={scrollLeft:0,scrollTop:0},u=Ee(1);const p=Ee(0),f=Me(o);if((f||!f&&!a)&&((et(o)!=="body"||vt(l))&&(d=Xt(o)),Me(o))){const h=Ve(o);u=Ye(o),p.x=h.x+o.clientLeft,p.y=h.y+o.clientTop}const g=l&&!f&&!a?xr(l,d):Ee(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-d.scrollLeft*u.x+p.x+g.x,y:n.y*u.y-d.scrollTop*u.y+p.y+g.y}}function cc(e){return Array.from(e.getClientRects())}function lc(e){const t=Pe(e),n=Xt(e),o=e.ownerDocument.body,r=le(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=le(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Zt(e);const c=-n.scrollTop;return ye(o).direction==="rtl"&&(l+=le(t.clientWidth,o.clientWidth)-r),{width:r,height:a,x:l,y:c}}const Eo=25;function dc(e,t){const n=de(e),o=Pe(e),r=n.visualViewport;let a=o.clientWidth,l=o.clientHeight,c=0,d=0;if(r){a=r.width,l=r.height;const p=Vn();(!p||p&&t==="fixed")&&(c=r.offsetLeft,d=r.offsetTop)}const u=Zt(o);if(u<=0){const p=o.ownerDocument,f=p.body,g=getComputedStyle(f),h=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(o.clientWidth-f.clientWidth-h);v<=Eo&&(a-=v)}else u<=Eo&&(a+=u);return{width:a,height:l,x:c,y:d}}const uc=new Set(["absolute","fixed"]);function fc(e,t){const n=Ve(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,a=Me(e)?Ye(e):Ee(1),l=e.clientWidth*a.x,c=e.clientHeight*a.y,d=r*a.x,u=o*a.y;return{width:l,height:c,x:d,y:u}}function Ro(e,t,n){let o;if(t==="viewport")o=dc(e,n);else if(t==="document")o=lc(Pe(e));else if(we(t))o=fc(t,n);else{const r=vr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Bt(o)}function wr(e,t){const n=De(e);return n===t||!we(n)||Ze(n)?!1:ye(n).position==="fixed"||wr(n,t)}function pc(e,t){const n=t.get(e);if(n)return n;let o=ft(e,[],!1).filter(c=>we(c)&&et(c)!=="body"),r=null;const a=ye(e).position==="fixed";let l=a?De(e):e;for(;we(l)&&!Ze(l);){const c=ye(l),d=Bn(l);!d&&c.position==="fixed"&&(r=null),(a?!d&&!r:!d&&c.position==="static"&&!!r&&uc.has(r.position)||vt(l)&&!d&&wr(e,l))?o=o.filter(p=>p!==l):r=c,l=De(l)}return t.set(e,o),o}function mc(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const l=[...n==="clippingAncestors"?Yt(t)?[]:pc(t,this._c):[].concat(n),o],c=l[0],d=l.reduce((u,p)=>{const f=Ro(t,p,r);return u.top=le(f.top,u.top),u.right=_e(f.right,u.right),u.bottom=_e(f.bottom,u.bottom),u.left=le(f.left,u.left),u},Ro(t,c,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function hc(e){const{width:t,height:n}=gr(e);return{width:t,height:n}}function gc(e,t,n){const o=Me(t),r=Pe(t),a=n==="fixed",l=Ve(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const d=Ee(0);function u(){d.x=Zt(r)}if(o||!o&&!a)if((et(t)!=="body"||vt(r))&&(c=Xt(t)),o){const h=Ve(t,!0,a,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else r&&u();a&&!o&&r&&u();const p=r&&!o&&!a?xr(r,c):Ee(0),f=l.left+c.scrollLeft-d.x-p.x,g=l.top+c.scrollTop-d.y-p.y;return{x:f,y:g,width:l.width,height:l.height}}function pn(e){return ye(e).position==="static"}function Mo(e,t){if(!Me(e)||ye(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Pe(e)===n&&(n=n.ownerDocument.body),n}function yr(e,t){const n=de(e);if(Yt(e))return n;if(!Me(e)){let r=De(e);for(;r&&!Ze(r);){if(we(r)&&!pn(r))return r;r=De(r)}return n}let o=Mo(e,t);for(;o&&Qi(o)&&pn(o);)o=Mo(o,t);return o&&Ze(o)&&pn(o)&&!Bn(o)?n:o||oc(e)||n}const vc=async function(e){const t=this.getOffsetParent||yr,n=this.getDimensions,o=await n(e.floating);return{reference:gc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function xc(e){return ye(e).direction==="rtl"}const wc={convertOffsetParentRelativeRectToViewportRelativeRect:ic,getDocumentElement:Pe,getClippingRect:mc,getOffsetParent:yr,getElementRects:vc,getClientRects:cc,getDimensions:hc,getScale:Ye,isElement:we,isRTL:xc};function br(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function yc(e,t){let n=null,o;const r=Pe(e);function a(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),a();const u=e.getBoundingClientRect(),{left:p,top:f,width:g,height:h}=u;if(c||t(),!g||!h)return;const v=Et(f),m=Et(r.clientWidth-(p+g)),x=Et(r.clientHeight-(f+h)),y=Et(p),C={rootMargin:-v+"px "+-m+"px "+-x+"px "+-y+"px",threshold:le(0,_e(1,d))||1};let N=!0;function R(k){const E=k[0].intersectionRatio;if(E!==d){if(!N)return l();E?l(!1,E):o=setTimeout(()=>{l(!1,1e-7)},1e3)}E===1&&!br(u,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(R,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,C)}n.observe(e)}return l(!0),a}function bc(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,u=Un(e),p=r||a?[...u?ft(u):[],...ft(t)]:[];p.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),a&&y.addEventListener("resize",n)});const f=u&&c?yc(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),u&&!d&&h.observe(u),h.observe(t));let v,m=d?Ve(e):null;d&&x();function x(){const y=Ve(e);m&&!br(m,y)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;p.forEach(b=>{r&&b.removeEventListener("scroll",n),a&&b.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,d&&cancelAnimationFrame(v)}}const Sc=Ki,Cc=Gi,Nc=Hi,Ec=Yi,Rc=zi,Po=Ui,Mc=qi,Pc=(e,t,n)=>{const o=new Map,r={platform:wc,...n},a={...r.platform,_c:o};return Vi(e,t,{...r,platform:a})};var jc=typeof document<"u",Ac=function(){},_t=jc?i.useLayoutEffect:Ac;function Vt(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Vt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const a=r[o];if(!(a==="_owner"&&e.$$typeof)&&!Vt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Sr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jo(e,t){const n=Sr(e);return Math.round(t*n)/n}function mn(e){const t=i.useRef(e);return _t(()=>{t.current=e}),t}function Tc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=i.useState(o);Vt(g,o)||h(o);const[v,m]=i.useState(null),[x,y]=i.useState(null),b=i.useCallback(A=>{A!==k.current&&(k.current=A,m(A))},[]),C=i.useCallback(A=>{A!==E.current&&(E.current=A,y(A))},[]),N=a||v,R=l||x,k=i.useRef(null),E=i.useRef(null),j=i.useRef(p),B=d!=null,D=mn(d),z=mn(r),V=mn(u),F=i.useCallback(()=>{if(!k.current||!E.current)return;const A={placement:t,strategy:n,middleware:g};z.current&&(A.platform=z.current),Pc(k.current,E.current,A).then(M=>{const Q={...M,isPositioned:V.current!==!1};$.current&&!Vt(j.current,Q)&&(j.current=Q,ht.flushSync(()=>{f(Q)}))})},[g,t,n,z,V]);_t(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const $=i.useRef(!1);_t(()=>($.current=!0,()=>{$.current=!1}),[]),_t(()=>{if(N&&(k.current=N),R&&(E.current=R),N&&R){if(D.current)return D.current(N,R,F);F()}},[N,R,F,D,B]);const G=i.useMemo(()=>({reference:k,floating:E,setReference:b,setFloating:C}),[b,C]),_=i.useMemo(()=>({reference:N,floating:R}),[N,R]),H=i.useMemo(()=>{const A={position:n,left:0,top:0};if(!_.floating)return A;const M=jo(_.floating,p.x),Q=jo(_.floating,p.y);return c?{...A,transform:"translate("+M+"px, "+Q+"px)",...Sr(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:Q}},[n,c,_.floating,p.x,p.y]);return i.useMemo(()=>({...p,update:F,refs:G,elements:_,floatingStyles:H}),[p,F,G,_,H])}const Ic=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Po({element:o.current,padding:r}).fn(n):{}:o?Po({element:o,padding:r}).fn(n):{}}}},kc=(e,t)=>({...Sc(e),options:[e,t]}),_c=(e,t)=>({...Cc(e),options:[e,t]}),Dc=(e,t)=>({...Mc(e),options:[e,t]}),Oc=(e,t)=>({...Nc(e),options:[e,t]}),Lc=(e,t)=>({...Ec(e),options:[e,t]}),Fc=(e,t)=>({...Rc(e),options:[e,t]}),$c=(e,t)=>({...Ic(e),options:[e,t]});var Bc="Arrow",Cr=i.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...a}=e;return s.jsx(K.svg,{...a,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Cr.displayName=Bc;var Vc=Cr;function Uc(e){const[t,n]=i.useState(void 0);return re(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const a=r[0];let l,c;if("borderBoxSize"in a){const d=a.borderBoxSize,u=Array.isArray(d)?d[0]:d;l=u.inlineSize,c=u.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Hn="Popper",[Nr,Qt]=Oe(Hn),[Hc,Er]=Nr(Hn),Rr=e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null);return s.jsx(Hc,{scope:t,anchor:o,onAnchorChange:r,children:n})};Rr.displayName=Hn;var Mr="PopperAnchor",Pr=i.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,a=Er(Mr,n),l=i.useRef(null),c=Z(t,l),d=i.useRef(null);return i.useEffect(()=>{const u=d.current;d.current=o?.current||l.current,u!==d.current&&a.onAnchorChange(d.current)}),o?null:s.jsx(K.div,{...r,ref:c})});Pr.displayName=Mr;var zn="PopperContent",[zc,Wc]=Nr(zn),jr=i.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:g=!1,updatePositionStrategy:h="optimized",onPlaced:v,...m}=e,x=Er(zn,n),[y,b]=i.useState(null),C=Z(t,P=>b(P)),[N,R]=i.useState(null),k=Uc(N),E=k?.width??0,j=k?.height??0,B=o+(a!=="center"?"-"+a:""),D=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},z=Array.isArray(u)?u:[u],V=z.length>0,F={padding:D,boundary:z.filter(Gc),altBoundary:V},{refs:$,floatingStyles:G,placement:_,isPositioned:H,middlewareData:A}=Tc({strategy:"fixed",placement:B,whileElementsMounted:(...P)=>bc(...P,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[kc({mainAxis:r+j,alignmentAxis:l}),d&&_c({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Dc():void 0,...F}),d&&Oc({...F}),Lc({...F,apply:({elements:P,rects:W,availableWidth:ee,availableHeight:U})=>{const{width:Y,height:X}=W.reference,ne=P.floating.style;ne.setProperty("--radix-popper-available-width",`${ee}px`),ne.setProperty("--radix-popper-available-height",`${U}px`),ne.setProperty("--radix-popper-anchor-width",`${Y}px`),ne.setProperty("--radix-popper-anchor-height",`${X}px`)}}),N&&$c({element:N,padding:c}),qc({arrowWidth:E,arrowHeight:j}),g&&Fc({strategy:"referenceHidden",...F})]}),[M,Q]=Ir(_),te=Re(v);re(()=>{H&&te?.()},[H,te]);const J=A.arrow?.x,me=A.arrow?.y,ie=A.arrow?.centerOffset!==0,[he,q]=i.useState();return re(()=>{y&&q(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:H?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[A.transformOrigin?.x,A.transformOrigin?.y].join(" "),...A.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(zc,{scope:n,placedSide:M,onArrowChange:R,arrowX:J,arrowY:me,shouldHideArrow:ie,children:s.jsx(K.div,{"data-side":M,"data-align":Q,...m,ref:C,style:{...m.style,animation:H?void 0:"none"}})})})});jr.displayName=zn;var Ar="PopperArrow",Kc={top:"bottom",right:"left",bottom:"top",left:"right"},Tr=i.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,a=Wc(Ar,o),l=Kc[a.placedSide];return s.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:s.jsx(Vc,{...r,ref:n,style:{...r.style,display:"block"}})})});Tr.displayName=Ar;function Gc(e){return e!==null}var qc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,l=r.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,p]=Ir(n),f={start:"0%",center:"50%",end:"100%"}[p],g=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+d/2;let v="",m="";return u==="bottom"?(v=l?f:`${g}px`,m=`${-d}px`):u==="top"?(v=l?f:`${g}px`,m=`${o.floating.height+d}px`):u==="right"?(v=`${-d}px`,m=l?f:`${h}px`):u==="left"&&(v=`${o.floating.width+d}px`,m=l?f:`${h}px`),{data:{x:v,y:m}}}});function Ir(e){const[t,n="center"]=e.split("-");return[t,n]}var kr=Rr,_r=Pr,Dr=jr,Or=Tr,Yc="Portal",Wn=i.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=i.useState(!1);re(()=>a(!0),[]);const l=n||r&&globalThis?.document?.body;return l?ka.createPortal(s.jsx(K.div,{...o,ref:t}),l):null});Wn.displayName=Yc;function Xc(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Lr=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"}),Zc="VisuallyHidden",Qc=i.forwardRef((e,t)=>s.jsx(K.span,{...e,ref:t,style:{...Lr,...e.style}}));Qc.displayName=Zc;var Jc=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ke=new WeakMap,Rt=new WeakMap,Mt={},hn=0,Fr=function(e){return e&&(e.host||Fr(e.parentNode))},el=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Fr(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},tl=function(e,t,n,o){var r=el(t,Array.isArray(e)?e:[e]);Mt[n]||(Mt[n]=new WeakMap);var a=Mt[n],l=[],c=new Set,d=new Set(r),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};r.forEach(u);var p=function(f){!f||d.has(f)||Array.prototype.forEach.call(f.children,function(g){if(c.has(g))p(g);else try{var h=g.getAttribute(o),v=h!==null&&h!=="false",m=(Ke.get(g)||0)+1,x=(a.get(g)||0)+1;Ke.set(g,m),a.set(g,x),l.push(g),m===1&&v&&Rt.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return p(t),c.clear(),hn++,function(){l.forEach(function(f){var g=Ke.get(f)-1,h=a.get(f)-1;Ke.set(f,g),a.set(f,h),g||(Rt.has(f)||f.removeAttribute(o),Rt.delete(f)),h||f.removeAttribute(n)}),hn--,hn||(Ke=new WeakMap,Ke=new WeakMap,Rt=new WeakMap,Mt={})}},$r=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Jc(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),tl(o,r,n,"aria-hidden")):function(){return null}},Ce=function(){return Ce=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ce.apply(this,arguments)};function Br(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function nl(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,a;o<r;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}var Dt="right-scroll-bar-position",Ot="width-before-scroll-bar",ol="with-scroll-bars-hidden",rl="--removed-body-scroll-bar-size";function gn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sl(e,t){var n=i.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var al=typeof window<"u"?i.useLayoutEffect:i.useEffect,Ao=new WeakMap;function il(e,t){var n=sl(null,function(o){return e.forEach(function(r){return gn(r,o)})});return al(function(){var o=Ao.get(n);if(o){var r=new Set(o),a=new Set(e),l=n.current;r.forEach(function(c){a.has(c)||gn(c,null)}),a.forEach(function(c){r.has(c)||gn(c,l)})}Ao.set(n,e)},[e]),n}function cl(e){return e}function ll(e,t){t===void 0&&(t=cl);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,o);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(o=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){o=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},u=function(){return Promise.resolve().then(d)};u(),n={push:function(p){l.push(p),u()},filter:function(p){return l=l.filter(p),n}}}};return r}function dl(e){e===void 0&&(e={});var t=ll(null);return t.options=Ce({async:!0,ssr:!1},e),t}var Vr=function(e){var t=e.sideCar,n=Br(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return i.createElement(o,Ce({},n))};Vr.isSideCarExport=!0;function ul(e,t){return e.useMedium(t),Vr}var Ur=dl(),vn=function(){},Jt=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:vn,onWheelCapture:vn,onTouchMoveCapture:vn}),r=o[0],a=o[1],l=e.forwardProps,c=e.children,d=e.className,u=e.removeScrollBar,p=e.enabled,f=e.shards,g=e.sideCar,h=e.noRelative,v=e.noIsolation,m=e.inert,x=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,C=e.gapMode,N=Br(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=g,k=il([n,t]),E=Ce(Ce({},N),r);return i.createElement(i.Fragment,null,p&&i.createElement(R,{sideCar:Ur,removeScrollBar:u,shards:f,noRelative:h,noIsolation:v,inert:m,setCallbacks:a,allowPinchZoom:!!x,lockRef:n,gapMode:C}),l?i.cloneElement(i.Children.only(c),Ce(Ce({},E),{ref:k})):i.createElement(b,Ce({},E,{className:d,ref:k}),c))});Jt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jt.classNames={fullWidth:Ot,zeroRight:Dt};var fl=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pl(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fl();return t&&e.setAttribute("nonce",t),e}function ml(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pl())&&(ml(t,n),hl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vl=function(){var e=gl();return function(t,n){i.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Hr=function(){var e=vl(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},xl={left:0,top:0,right:0,gap:0},xn=function(e){return parseInt(e||"",10)||0},wl=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[xn(n),xn(o),xn(r)]},yl=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xl;var t=wl(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},bl=Hr(),Xe="data-scroll-locked",Sl=function(e,t,n,o){var r=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),` .`.concat(ol,` { overflow: hidden `).concat(o,`; padding-right: `).concat(c,"px ").concat(o,`; } body[`).concat(Xe,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` padding-left: `.concat(r,`px; padding-top: `).concat(a,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(c,"px ").concat(o,`; `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(Dt,` { right: `).concat(c,"px ").concat(o,`; } .`).concat(Ot,` { margin-right: `).concat(c,"px ").concat(o,`; } .`).concat(Dt," .").concat(Dt,` { right: 0 `).concat(o,`; } .`).concat(Ot," .").concat(Ot,` { margin-right: 0 `).concat(o,`; } body[`).concat(Xe,`] { `).concat(rl,": ").concat(c,`px; } `)},To=function(){var e=parseInt(document.body.getAttribute(Xe)||"0",10);return isFinite(e)?e:0},Cl=function(){i.useEffect(function(){return document.body.setAttribute(Xe,(To()+1).toString()),function(){var e=To()-1;e<=0?document.body.removeAttribute(Xe):document.body.setAttribute(Xe,e.toString())}},[])},Nl=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Cl();var a=i.useMemo(function(){return yl(r)},[r]);return i.createElement(bl,{styles:Sl(a,!t,r,n?"":"!important")})},Nn=!1;if(typeof window<"u")try{var Pt=Object.defineProperty({},"passive",{get:function(){return Nn=!0,!0}});window.addEventListener("test",Pt,Pt),window.removeEventListener("test",Pt,Pt)}catch{Nn=!1}var Ge=Nn?{passive:!1}:!1,El=function(e){return e.tagName==="TEXTAREA"},zr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!El(e)&&n[t]==="visible")},Rl=function(e){return zr(e,"overflowY")},Ml=function(e){return zr(e,"overflowX")},Io=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Wr(e,o);if(r){var a=Kr(e,o),l=a[1],c=a[2];if(l>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Pl=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},jl=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Wr=function(e,t){return e==="v"?Rl(t):Ml(t)},Kr=function(e,t){return e==="v"?Pl(t):jl(t)},Al=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tl=function(e,t,n,o,r){var a=Al(e,window.getComputedStyle(t).direction),l=a*o,c=n.target,d=t.contains(c),u=!1,p=l>0,f=0,g=0;do{if(!c)break;var h=Kr(e,c),v=h[0],m=h[1],x=h[2],y=m-x-a*v;(v||y)&&Wr(e,c)&&(f+=y,g+=v);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(f)<1||!p&&Math.abs(g)<1)&&(u=!0),u},jt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ko=function(e){return[e.deltaX,e.deltaY]},_o=function(e){return e&&"current"in e?e.current:e},Il=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kl=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},_l=0,qe=[];function Dl(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(_l++)[0],a=i.useState(Hr)[0],l=i.useRef(e);i.useEffect(function(){l.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=nl([e.lockRef.current],(e.shards||[]).map(_o),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!l.current.allowPinchZoom;var y=jt(m),b=n.current,C="deltaX"in m?m.deltaX:b[0]-y[0],N="deltaY"in m?m.deltaY:b[1]-y[1],R,k=m.target,E=Math.abs(C)>Math.abs(N)?"h":"v";if("touches"in m&&E==="h"&&k.type==="range")return!1;var j=Io(E,k);if(!j)return!0;if(j?R=E:(R=E==="v"?"h":"v",j=Io(E,k)),!j)return!1;if(!o.current&&"changedTouches"in m&&(C||N)&&(o.current=R),!R)return!0;var B=o.current||R;return Tl(B,x,m,B==="h"?C:N)},[]),d=i.useCallback(function(m){var x=m;if(!(!qe.length||qe[qe.length-1]!==a)){var y="deltaY"in x?ko(x):jt(x),b=t.current.filter(function(R){return R.name===x.type&&(R.target===x.target||x.target===R.shadowParent)&&Il(R.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var C=(l.current.shards||[]).map(_o).filter(Boolean).filter(function(R){return R.contains(x.target)}),N=C.length>0?c(x,C[0]):!l.current.noIsolation;N&&x.cancelable&&x.preventDefault()}}},[]),u=i.useCallback(function(m,x,y,b){var C={name:m,delta:x,target:y,should:b,shadowParent:Ol(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(N){return N!==C})},1)},[]),p=i.useCallback(function(m){n.current=jt(m),o.current=void 0},[]),f=i.useCallback(function(m){u(m.type,ko(m),m.target,c(m,e.lockRef.current))},[]),g=i.useCallback(function(m){u(m.type,jt(m),m.target,c(m,e.lockRef.current))},[]);i.useEffect(function(){return qe.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ge),document.addEventListener("touchmove",d,Ge),document.addEventListener("touchstart",p,Ge),function(){qe=qe.filter(function(m){return m!==a}),document.removeEventListener("wheel",d,Ge),document.removeEventListener("touchmove",d,Ge),document.removeEventListener("touchstart",p,Ge)}},[]);var h=e.removeScrollBar,v=e.inert;return i.createElement(i.Fragment,null,v?i.createElement(a,{styles:kl(r)}):null,h?i.createElement(Nl,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ol(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ll=ul(Ur,Dl);var Kn=i.forwardRef(function(e,t){return i.createElement(Jt,Ce({},e,{ref:t,sideCar:Ll}))});Kn.classNames=Jt.classNames;var Fl=[" ","Enter","ArrowUp","ArrowDown"],$l=[" ","Enter"],Ue="Select",[en,tn,Bl]=Tn(Ue),[tt,tf]=Oe(Ue,[Bl,Qt]),nn=Qt(),[Vl,Le]=tt(Ue),[Ul,Hl]=tt(Ue),Gr=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:a,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:g,required:h,form:v}=e,m=nn(t),[x,y]=i.useState(null),[b,C]=i.useState(null),[N,R]=i.useState(!1),k=Wt(u),[E,j]=dt({prop:o,defaultProp:r??!1,onChange:a,caller:Ue}),[B,D]=dt({prop:l,defaultProp:c,onChange:d,caller:Ue}),z=i.useRef(null),V=x?v||!!x.closest("form"):!0,[F,$]=i.useState(new Set),G=Array.from(F).map(_=>_.props.value).join(";");return s.jsx(kr,{...m,children:s.jsxs(Vl,{required:h,scope:t,trigger:x,onTriggerChange:y,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:N,onValueNodeHasChildrenChange:R,contentId:Be(),value:B,onValueChange:D,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:z,disabled:g,children:[s.jsx(en.Provider,{scope:t,children:s.jsx(Ul,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(_=>{$(H=>new Set(H).add(_))},[]),onNativeOptionRemove:i.useCallback(_=>{$(H=>{const A=new Set(H);return A.delete(_),A})},[]),children:n})}),V?s.jsxs(hs,{"aria-hidden":!0,required:h,tabIndex:-1,name:p,autoComplete:f,value:B,onChange:_=>D(_.target.value),disabled:g,form:v,children:[B===void 0?s.jsx("option",{value:""}):null,Array.from(F)]},G):null]})})};Gr.displayName=Ue;var qr="SelectTrigger",Yr=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,a=nn(n),l=Le(qr,n),c=l.disabled||o,d=Z(t,l.onTriggerChange),u=tn(n),p=i.useRef("touch"),[f,g,h]=vs(m=>{const x=u().filter(C=>!C.disabled),y=x.find(C=>C.value===l.value),b=xs(x,m,y);b!==void 0&&l.onValueChange(b.value)}),v=m=>{c||(l.onOpenChange(!0),h()),m&&(l.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return s.jsx(_r,{asChild:!0,...a,children:s.jsx(K.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":gs(l.value)?"":void 0,...r,ref:d,onClick:I(r.onClick,m=>{m.currentTarget.focus(),p.current!=="mouse"&&v(m)}),onPointerDown:I(r.onPointerDown,m=>{p.current=m.pointerType;const x=m.target;x.hasPointerCapture(m.pointerId)&&x.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:I(r.onKeyDown,m=>{const x=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(x&&m.key===" ")&&Fl.includes(m.key)&&(v(),m.preventDefault())})})})});Yr.displayName=qr;var Xr="SelectValue",Zr=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:a,placeholder:l="",...c}=e,d=Le(Xr,n),{onValueNodeHasChildrenChange:u}=d,p=a!==void 0,f=Z(t,d.onValueNodeChange);return re(()=>{u(p)},[u,p]),s.jsx(K.span,{...c,ref:f,style:{pointerEvents:"none"},children:gs(d.value)?s.jsx(s.Fragment,{children:l}):a})});Zr.displayName=Xr;var zl="SelectIcon",Qr=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return s.jsx(K.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});Qr.displayName=zl;var Wl="SelectPortal",Jr=e=>s.jsx(Wn,{asChild:!0,...e});Jr.displayName=Wl;var He="SelectContent",es=i.forwardRef((e,t)=>{const n=Le(He,e.__scopeSelect),[o,r]=i.useState();if(re(()=>{r(new DocumentFragment)},[]),!n.open){const a=o;return a?ht.createPortal(s.jsx(ts,{scope:e.__scopeSelect,children:s.jsx(en.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(ns,{...e,ref:t})});es.displayName=He;var ve=10,[ts,Fe]=tt(He),Kl="SelectContentImpl",Gl=lt("SelectContent.RemoveScroll"),ns=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:m,avoidCollisions:x,...y}=e,b=Le(He,n),[C,N]=i.useState(null),[R,k]=i.useState(null),E=Z(t,P=>N(P)),[j,B]=i.useState(null),[D,z]=i.useState(null),V=tn(n),[F,$]=i.useState(!1),G=i.useRef(!1);i.useEffect(()=>{if(C)return $r(C)},[C]),dr();const _=i.useCallback(P=>{const[W,...ee]=V().map(X=>X.ref.current),[U]=ee.slice(-1),Y=document.activeElement;for(const X of P)if(X===Y||(X?.scrollIntoView({block:"nearest"}),X===W&&R&&(R.scrollTop=0),X===U&&R&&(R.scrollTop=R.scrollHeight),X?.focus(),document.activeElement!==Y))return},[V,R]),H=i.useCallback(()=>_([j,C]),[_,j,C]);i.useEffect(()=>{F&&H()},[F,H]);const{onOpenChange:A,triggerPointerDownPosRef:M}=b;i.useEffect(()=>{if(C){let P={x:0,y:0};const W=U=>{P={x:Math.abs(Math.round(U.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(U.pageY)-(M.current?.y??0))}},ee=U=>{P.x<=10&&P.y<=10?U.preventDefault():C.contains(U.target)||A(!1),document.removeEventListener("pointermove",W),M.current=null};return M.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",ee,{capture:!0})}}},[C,A,M]),i.useEffect(()=>{const P=()=>A(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[A]);const[Q,te]=vs(P=>{const W=V().filter(Y=>!Y.disabled),ee=W.find(Y=>Y.ref.current===document.activeElement),U=xs(W,P,ee);U&&setTimeout(()=>U.ref.current.focus())}),J=i.useCallback((P,W,ee)=>{const U=!G.current&&!ee;(b.value!==void 0&&b.value===W||U)&&(B(P),U&&(G.current=!0))},[b.value]),me=i.useCallback(()=>C?.focus(),[C]),ie=i.useCallback((P,W,ee)=>{const U=!G.current&&!ee;(b.value!==void 0&&b.value===W||U)&&z(P)},[b.value]),he=o==="popper"?En:os,q=he===En?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return s.jsx(ts,{scope:n,content:C,viewport:R,onViewportChange:k,itemRefCallback:J,selectedItem:j,onItemLeave:me,itemTextRefCallback:ie,focusSelectedItem:H,selectedItemText:D,position:o,isPositioned:F,searchRef:Q,children:s.jsx(Kn,{as:Gl,allowPinchZoom:!0,children:s.jsx(On,{asChild:!0,trapped:b.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:I(r,P=>{b.trigger?.focus({preventScroll:!0}),P.preventDefault()}),children:s.jsx(Dn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:s.jsx(he,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:P=>P.preventDefault(),...y,...q,onPlaced:()=>$(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:I(y.onKeyDown,P=>{const W=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!W&&P.key.length===1&&te(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let U=V().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(P.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const Y=P.target,X=U.indexOf(Y);U=U.slice(X+1)}setTimeout(()=>_(U)),P.preventDefault()}})})})})})})});ns.displayName=Kl;var ql="SelectItemAlignedPosition",os=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,a=Le(He,n),l=Fe(He,n),[c,d]=i.useState(null),[u,p]=i.useState(null),f=Z(t,E=>p(E)),g=tn(n),h=i.useRef(!1),v=i.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,C=i.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&u&&m&&x&&y){const E=a.trigger.getBoundingClientRect(),j=u.getBoundingClientRect(),B=a.valueNode.getBoundingClientRect(),D=y.getBoundingClientRect();if(a.dir!=="rtl"){const Y=D.left-j.left,X=B.left-Y,ne=E.left-X,ue=E.width+ne,be=Math.max(ue,j.width),nt=window.innerWidth-ve,ot=uo(X,[ve,Math.max(ve,nt-be)]);c.style.minWidth=ue+"px",c.style.left=ot+"px"}else{const Y=j.right-D.right,X=window.innerWidth-B.right-Y,ne=window.innerWidth-E.right-X,ue=E.width+ne,be=Math.max(ue,j.width),nt=window.innerWidth-ve,ot=uo(X,[ve,Math.max(ve,nt-be)]);c.style.minWidth=ue+"px",c.style.right=ot+"px"}const z=g(),V=window.innerHeight-ve*2,F=m.scrollHeight,$=window.getComputedStyle(u),G=parseInt($.borderTopWidth,10),_=parseInt($.paddingTop,10),H=parseInt($.borderBottomWidth,10),A=parseInt($.paddingBottom,10),M=G+_+F+A+H,Q=Math.min(x.offsetHeight*5,M),te=window.getComputedStyle(m),J=parseInt(te.paddingTop,10),me=parseInt(te.paddingBottom,10),ie=E.top+E.height/2-ve,he=V-ie,q=x.offsetHeight/2,P=x.offsetTop+q,W=G+_+P,ee=M-W;if(W<=ie){const Y=z.length>0&&x===z[z.length-1].ref.current;c.style.bottom="0px";const X=u.clientHeight-m.offsetTop-m.offsetHeight,ne=Math.max(he,q+(Y?me:0)+X+H),ue=W+ne;c.style.height=ue+"px"}else{const Y=z.length>0&&x===z[0].ref.current;c.style.top="0px";const ne=Math.max(ie,G+m.offsetTop+(Y?J:0)+q)+ee;c.style.height=ne+"px",m.scrollTop=W-ie+m.offsetTop}c.style.margin=`${ve}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=V+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[g,a.trigger,a.valueNode,c,u,m,x,y,a.dir,o]);re(()=>C(),[C]);const[N,R]=i.useState();re(()=>{u&&R(window.getComputedStyle(u).zIndex)},[u]);const k=i.useCallback(E=>{E&&v.current===!0&&(C(),b?.(),v.current=!1)},[C,b]);return s.jsx(Xl,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:s.jsx(K.div,{...r,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});os.displayName=ql;var Yl="SelectPopperPosition",En=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ve,...a}=e,l=nn(n);return s.jsx(Dr,{...l,...a,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...a.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)"}})});En.displayName=Yl;var[Xl,Gn]=tt(He,{}),Rn="SelectViewport",rs=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,a=Fe(Rn,n),l=Gn(Rn,n),c=Z(t,a.onViewportChange),d=i.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:o}),s.jsx(en.Slot,{scope:n,children:s.jsx(K.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:I(r.onScroll,u=>{const p=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:g}=l;if(g?.current&&f){const h=Math.abs(d.current-p.scrollTop);if(h>0){const v=window.innerHeight-ve*2,m=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),y=Math.max(m,x);if(y<v){const b=y+h,C=Math.min(v,b),N=b-C;f.style.height=C+"px",f.style.bottom==="0px"&&(p.scrollTop=N>0?N:0,f.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});rs.displayName=Rn;var ss="SelectGroup",[Zl,Ql]=tt(ss),Jl=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Be();return s.jsx(Zl,{scope:n,id:r,children:s.jsx(K.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Jl.displayName=ss;var as="SelectLabel",ed=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ql(as,n);return s.jsx(K.div,{id:r.id,...o,ref:t})});ed.displayName=as;var Ut="SelectItem",[td,is]=tt(Ut),cs=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:a,...l}=e,c=Le(Ut,n),d=Fe(Ut,n),u=c.value===o,[p,f]=i.useState(a??""),[g,h]=i.useState(!1),v=Z(t,b=>d.itemRefCallback?.(b,o,r)),m=Be(),x=i.useRef("touch"),y=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")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 s.jsx(td,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:i.useCallback(b=>{f(C=>C||(b?.textContent??"").trim())},[]),children:s.jsx(en.ItemSlot,{scope:n,value:o,disabled:r,textValue:p,children:s.jsx(K.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:v,onFocus:I(l.onFocus,()=>h(!0)),onBlur:I(l.onBlur,()=>h(!1)),onClick:I(l.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:I(l.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:I(l.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:I(l.onPointerMove,b=>{x.current=b.pointerType,r?d.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:I(l.onPointerLeave,b=>{b.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:I(l.onKeyDown,b=>{d.searchRef?.current!==""&&b.key===" "||($l.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});cs.displayName=Ut;var it="SelectItemText",ls=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...a}=e,l=Le(it,n),c=Fe(it,n),d=is(it,n),u=Hl(it,n),[p,f]=i.useState(null),g=Z(t,y=>f(y),d.onItemTextChange,y=>c.itemTextRefCallback?.(y,d.value,d.disabled)),h=p?.textContent,v=i.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:h},d.value),[d.disabled,d.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return re(()=>(m(v),()=>x(v)),[m,x,v]),s.jsxs(s.Fragment,{children:[s.jsx(K.span,{id:d.textId,...a,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?ht.createPortal(a.children,l.valueNode):null]})});ls.displayName=it;var ds="SelectItemIndicator",us=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return is(ds,n).isSelected?s.jsx(K.span,{"aria-hidden":!0,...o,ref:t}):null});us.displayName=ds;var Mn="SelectScrollUpButton",fs=i.forwardRef((e,t)=>{const n=Fe(Mn,e.__scopeSelect),o=Gn(Mn,e.__scopeSelect),[r,a]=i.useState(!1),l=Z(t,o.onScrollButtonChange);return re(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;a(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(ms,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});fs.displayName=Mn;var Pn="SelectScrollDownButton",ps=i.forwardRef((e,t)=>{const n=Fe(Pn,e.__scopeSelect),o=Gn(Pn,e.__scopeSelect),[r,a]=i.useState(!1),l=Z(t,o.onScrollButtonChange);return re(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<u;a(p)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?s.jsx(ms,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});ps.displayName=Pn;var ms=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,a=Fe("SelectScrollButton",n),l=i.useRef(null),c=tn(n),d=i.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return i.useEffect(()=>()=>d(),[d]),re(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(K.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:I(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:I(r.onPointerMove,()=>{a.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:I(r.onPointerLeave,()=>{d()})})}),nd="SelectSeparator",od=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return s.jsx(K.div,{"aria-hidden":!0,...o,ref:t})});od.displayName=nd;var jn="SelectArrow",rd=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=nn(n),a=Le(jn,n),l=Fe(jn,n);return a.open&&l.position==="popper"?s.jsx(Or,{...r,...o,ref:t}):null});rd.displayName=jn;var sd="SelectBubbleInput",hs=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),a=Z(o,r),l=Xc(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&p){const f=new Event("change",{bubbles:!0});p.call(c,t),c.dispatchEvent(f)}},[l,t]),s.jsx(K.select,{...n,style:{...Lr,...n.style},ref:a,defaultValue:t})});hs.displayName=sd;function gs(e){return e===""||e===void 0}function vs(e){const t=Re(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(l=>{const c=n.current+l;t(c),(function d(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),a=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function xs(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=ad(e,Math.max(a,0));r.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function ad(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var id=Gr,cd=Yr,ld=Zr,dd=Qr,ud=Jr,fd=es,pd=rs,md=cs,hd=ls,gd=us,vd=fs,xd=ps;/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wd=se("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yd=se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bd=se("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ws=se("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qn=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ys=se("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bs=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sd=se("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cd=se("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Do=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nd=se("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ed=se("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rd=se("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Md=se("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.468.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pd=se("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);function At({...e}){return s.jsx(id,{"data-slot":"select",...e})}function Tt({...e}){return s.jsx(ld,{"data-slot":"select-value",...e})}function It({className:e,size:t="default",children:n,...o}){return s.jsxs(cd,{"data-slot":"select-trigger","data-size":t,className:O("border-gray-300 dark:border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-foreground dark:[&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 hover:border-gray-400 dark:hover:border-gray-500 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow,border-color] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[n,s.jsx(dd,{asChild:!0,children:s.jsx(qn,{className:"size-4 opacity-70"})})]})}function kt({className:e,children:t,position:n="popper",...o}){return s.jsx(ud,{children:s.jsxs(fd,{"data-slot":"select-content",className:O("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",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,...o,children:[s.jsx(jd,{}),s.jsx(pd,{className:O("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx(Ad,{})]})})}function $e({className:e,children:t,...n}){return s.jsxs(md,{"data-slot":"select-item",className:O("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(gd,{children:s.jsx(ws,{className:"size-4"})})}),s.jsx(hd,{children:t})]})}function jd({className:e,...t}){return s.jsx(vd,{"data-slot":"select-scroll-up-button",className:O("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(bs,{className:"size-4"})})}function Ad({className:e,...t}){return s.jsx(xd,{"data-slot":"select-scroll-down-button",className:O("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(qn,{className:"size-4"})})}var An=["Enter"," "],Td=["ArrowDown","PageUp","Home"],Ss=["ArrowUp","PageDown","End"],Id=[...Td,...Ss],kd={ltr:[...An,"ArrowRight"],rtl:[...An,"ArrowLeft"]},_d={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xt="Menu",[pt,Dd,Od]=Tn(xt),[ze,Cs]=Oe(xt,[Od,Qt,Kt]),on=Qt(),Ns=Kt(),[Ld,We]=ze(xt),[Fd,wt]=ze(xt),Es=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:a,modal:l=!0}=e,c=on(t),[d,u]=i.useState(null),p=i.useRef(!1),f=Re(a),g=Wt(r);return i.useEffect(()=>{const h=()=>{p.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>p.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),s.jsx(kr,{...c,children:s.jsx(Ld,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:u,children:s.jsx(Fd,{scope:t,onClose:i.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:g,modal:l,children:o})})})};Es.displayName=xt;var $d="MenuAnchor",Yn=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=on(n);return s.jsx(_r,{...r,...o,ref:t})});Yn.displayName=$d;var Xn="MenuPortal",[Bd,Rs]=ze(Xn,{forceMount:void 0}),Ms=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,a=We(Xn,t);return s.jsx(Bd,{scope:t,forceMount:n,children:s.jsx(Qe,{present:n||a.open,children:s.jsx(Wn,{asChild:!0,container:r,children:o})})})};Ms.displayName=Xn;var pe="MenuContent",[Vd,Zn]=ze(pe),Ps=i.forwardRef((e,t)=>{const n=Rs(pe,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=We(pe,e.__scopeMenu),l=wt(pe,e.__scopeMenu);return s.jsx(pt.Provider,{scope:e.__scopeMenu,children:s.jsx(Qe,{present:o||a.open,children:s.jsx(pt.Slot,{scope:e.__scopeMenu,children:l.modal?s.jsx(Ud,{...r,ref:t}):s.jsx(Hd,{...r,ref:t})})})})}),Ud=i.forwardRef((e,t)=>{const n=We(pe,e.__scopeMenu),o=i.useRef(null),r=Z(t,o);return i.useEffect(()=>{const a=o.current;if(a)return $r(a)},[]),s.jsx(Qn,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:I(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Hd=i.forwardRef((e,t)=>{const n=We(pe,e.__scopeMenu);return s.jsx(Qn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zd=lt("MenuContent.ScrollLock"),Qn=i.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,disableOutsideScroll:v,...m}=e,x=We(pe,n),y=wt(pe,n),b=on(n),C=Ns(n),N=Dd(n),[R,k]=i.useState(null),E=i.useRef(null),j=Z(t,E,x.onContentChange),B=i.useRef(0),D=i.useRef(""),z=i.useRef(0),V=i.useRef(null),F=i.useRef("right"),$=i.useRef(0),G=v?Kn:i.Fragment,_=v?{as:zd,allowPinchZoom:!0}:void 0,H=M=>{const Q=D.current+M,te=N().filter(P=>!P.disabled),J=document.activeElement,me=te.find(P=>P.ref.current===J)?.textValue,ie=te.map(P=>P.textValue),he=nu(ie,Q,me),q=te.find(P=>P.textValue===he)?.ref.current;(function P(W){D.current=W,window.clearTimeout(B.current),W!==""&&(B.current=window.setTimeout(()=>P(""),1e3))})(Q),q&&setTimeout(()=>q.focus())};i.useEffect(()=>()=>window.clearTimeout(B.current),[]),dr();const A=i.useCallback(M=>F.current===V.current?.side&&ru(M,V.current?.area),[]);return s.jsx(Vd,{scope:n,searchRef:D,onItemEnter:i.useCallback(M=>{A(M)&&M.preventDefault()},[A]),onItemLeave:i.useCallback(M=>{A(M)||(E.current?.focus(),k(null))},[A]),onTriggerLeave:i.useCallback(M=>{A(M)&&M.preventDefault()},[A]),pointerGraceTimerRef:z,onPointerGraceIntentChange:i.useCallback(M=>{V.current=M},[]),children:s.jsx(G,{..._,children:s.jsx(On,{asChild:!0,trapped:r,onMountAutoFocus:I(a,M=>{M.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:s.jsx(Dn,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,children:s.jsx(Ko,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:k,onEntryFocus:I(d,M=>{y.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Dr,{role:"menu","aria-orientation":"vertical","data-state":zs(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:j,style:{outline:"none",...m.style},onKeyDown:I(m.onKeyDown,M=>{const te=M.target.closest("[data-radix-menu-content]")===M.currentTarget,J=M.ctrlKey||M.altKey||M.metaKey,me=M.key.length===1;te&&(M.key==="Tab"&&M.preventDefault(),!J&&me&&H(M.key));const ie=E.current;if(M.target!==ie||!Id.includes(M.key))return;M.preventDefault();const q=N().filter(P=>!P.disabled).map(P=>P.ref.current);Ss.includes(M.key)&&q.reverse(),eu(q)}),onBlur:I(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(B.current),D.current="")}),onPointerMove:I(e.onPointerMove,mt(M=>{const Q=M.target,te=$.current!==M.clientX;if(M.currentTarget.contains(Q)&&te){const J=M.clientX>$.current?"right":"left";F.current=J,$.current=M.clientX}}))})})})})})})});Ps.displayName=pe;var Wd="MenuGroup",Jn=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return s.jsx(K.div,{role:"group",...o,ref:t})});Jn.displayName=Wd;var Kd="MenuLabel",js=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return s.jsx(K.div,{...o,ref:t})});js.displayName=Kd;var Ht="MenuItem",Oo="menu.itemSelect",rn=i.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,a=i.useRef(null),l=wt(Ht,e.__scopeMenu),c=Zn(Ht,e.__scopeMenu),d=Z(t,a),u=i.useRef(!1),p=()=>{const f=a.current;if(!n&&f){const g=new CustomEvent(Oo,{bubbles:!0,cancelable:!0});f.addEventListener(Oo,h=>o?.(h),{once:!0}),Bo(f,g),g.defaultPrevented?u.current=!1:l.onClose()}};return s.jsx(As,{...r,ref:d,disabled:n,onClick:I(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),u.current=!0},onPointerUp:I(e.onPointerUp,f=>{u.current||f.currentTarget?.click()}),onKeyDown:I(e.onKeyDown,f=>{const g=c.searchRef.current!=="";n||g&&f.key===" "||An.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});rn.displayName=Ht;var As=i.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...a}=e,l=Zn(Ht,n),c=Ns(n),d=i.useRef(null),u=Z(t,d),[p,f]=i.useState(!1),[g,h]=i.useState("");return i.useEffect(()=>{const v=d.current;v&&h((v.textContent??"").trim())},[a.children]),s.jsx(pt.ItemSlot,{scope:n,disabled:o,textValue:r??g,children:s.jsx(Go,{asChild:!0,...c,focusable:!o,children:s.jsx(K.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:u,onPointerMove:I(e.onPointerMove,mt(v=>{o?l.onItemLeave(v):(l.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:I(e.onPointerLeave,mt(v=>l.onItemLeave(v))),onFocus:I(e.onFocus,()=>f(!0)),onBlur:I(e.onBlur,()=>f(!1))})})})}),Gd="MenuCheckboxItem",Ts=i.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return s.jsx(Os,{scope:e.__scopeMenu,checked:n,children:s.jsx(rn,{role:"menuitemcheckbox","aria-checked":zt(n)?"mixed":n,...r,ref:t,"data-state":to(n),onSelect:I(r.onSelect,()=>o?.(zt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ts.displayName=Gd;var Is="MenuRadioGroup",[qd,Yd]=ze(Is,{value:void 0,onValueChange:()=>{}}),ks=i.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,a=Re(o);return s.jsx(qd,{scope:e.__scopeMenu,value:n,onValueChange:a,children:s.jsx(Jn,{...r,ref:t})})});ks.displayName=Is;var _s="MenuRadioItem",Ds=i.forwardRef((e,t)=>{const{value:n,...o}=e,r=Yd(_s,e.__scopeMenu),a=n===r.value;return s.jsx(Os,{scope:e.__scopeMenu,checked:a,children:s.jsx(rn,{role:"menuitemradio","aria-checked":a,...o,ref:t,"data-state":to(a),onSelect:I(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ds.displayName=_s;var eo="MenuItemIndicator",[Os,Xd]=ze(eo,{checked:!1}),Ls=i.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,a=Xd(eo,n);return s.jsx(Qe,{present:o||zt(a.checked)||a.checked===!0,children:s.jsx(K.span,{...r,ref:t,"data-state":to(a.checked)})})});Ls.displayName=eo;var Zd="MenuSeparator",Fs=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return s.jsx(K.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});Fs.displayName=Zd;var Qd="MenuArrow",$s=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=on(n);return s.jsx(Or,{...r,...o,ref:t})});$s.displayName=Qd;var Jd="MenuSub",[nf,Bs]=ze(Jd),ct="MenuSubTrigger",Vs=i.forwardRef((e,t)=>{const n=We(ct,e.__scopeMenu),o=wt(ct,e.__scopeMenu),r=Bs(ct,e.__scopeMenu),a=Zn(ct,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=a,u={__scopeMenu:e.__scopeMenu},p=i.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return i.useEffect(()=>p,[p]),i.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),d(null)}},[c,d]),s.jsx(Yn,{asChild:!0,...u,children:s.jsx(As,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":zs(n.open),...e,ref:$o(t,r.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:I(e.onPointerMove,mt(f=>{a.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(a.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:I(e.onPointerLeave,mt(f=>{p();const g=n.content?.getBoundingClientRect();if(g){const h=n.content?.dataset.side,v=h==="right",m=v?-5:5,x=g[v?"left":"right"],y=g[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:f.clientX+m,y:f.clientY},{x,y:g.top},{x:y,y:g.top},{x:y,y:g.bottom},{x,y:g.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(f),f.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:I(e.onKeyDown,f=>{const g=a.searchRef.current!=="";e.disabled||g&&f.key===" "||kd[o.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});Vs.displayName=ct;var Us="MenuSubContent",Hs=i.forwardRef((e,t)=>{const n=Rs(pe,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,a=We(pe,e.__scopeMenu),l=wt(pe,e.__scopeMenu),c=Bs(Us,e.__scopeMenu),d=i.useRef(null),u=Z(t,d);return s.jsx(pt.Provider,{scope:e.__scopeMenu,children:s.jsx(Qe,{present:o||a.open,children:s.jsx(pt.Slot,{scope:e.__scopeMenu,children:s.jsx(Qn,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:u,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:I(e.onFocusOutside,p=>{p.target!==c.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:I(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:I(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),g=_d[l.dir].includes(p.key);f&&g&&(a.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});Hs.displayName=Us;function zs(e){return e?"open":"closed"}function zt(e){return e==="indeterminate"}function to(e){return zt(e)?"indeterminate":e?"checked":"unchecked"}function eu(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function tu(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function nu(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=tu(e,Math.max(a,0));r.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return d!==n?d:void 0}function ou(e,t){const{x:n,y:o}=e;let r=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const c=t[a],d=t[l],u=c.x,p=c.y,f=d.x,g=d.y;p>o!=g>o&&n<(f-u)*(o-p)/(g-p)+u&&(r=!r)}return r}function ru(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ou(n,t)}function mt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var su=Es,au=Yn,iu=Ms,cu=Ps,lu=Jn,du=js,uu=rn,fu=Ts,pu=ks,mu=Ds,hu=Ls,gu=Fs,vu=$s,xu=Vs,wu=Hs,sn="DropdownMenu",[yu,of]=Oe(sn,[Cs]),ae=Cs(),[bu,Ws]=yu(sn),Ks=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,d=ae(t),u=i.useRef(null),[p,f]=dt({prop:r,defaultProp:a??!1,onChange:l,caller:sn});return s.jsx(bu,{scope:t,triggerId:Be(),triggerRef:u,contentId:Be(),open:p,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(g=>!g),[f]),modal:c,children:s.jsx(su,{...d,open:p,onOpenChange:f,dir:o,modal:c,children:n})})};Ks.displayName=sn;var Gs="DropdownMenuTrigger",qs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,a=Ws(Gs,n),l=ae(n);return s.jsx(au,{asChild:!0,...l,children:s.jsx(K.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:$o(t,a.triggerRef),onPointerDown:I(e.onPointerDown,c=>{!o&&c.button===0&&c.ctrlKey===!1&&(a.onOpenToggle(),a.open||c.preventDefault())}),onKeyDown:I(e.onKeyDown,c=>{o||(["Enter"," "].includes(c.key)&&a.onOpenToggle(),c.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});qs.displayName=Gs;var Su="DropdownMenuPortal",Ys=e=>{const{__scopeDropdownMenu:t,...n}=e,o=ae(t);return s.jsx(iu,{...o,...n})};Ys.displayName=Su;var Xs="DropdownMenuContent",Zs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Ws(Xs,n),a=ae(n),l=i.useRef(!1);return s.jsx(cu,{id:r.contentId,"aria-labelledby":r.triggerId,...a,...o,ref:t,onCloseAutoFocus:I(e.onCloseAutoFocus,c=>{l.current||r.triggerRef.current?.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:I(e.onInteractOutside,c=>{const d=c.detail.originalEvent,u=d.button===0&&d.ctrlKey===!0,p=d.button===2||u;(!r.modal||p)&&(l.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)"}})});Zs.displayName=Xs;var Cu="DropdownMenuGroup",Nu=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(lu,{...r,...o,ref:t})});Nu.displayName=Cu;var Eu="DropdownMenuLabel",Qs=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(du,{...r,...o,ref:t})});Qs.displayName=Eu;var Ru="DropdownMenuItem",Js=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(uu,{...r,...o,ref:t})});Js.displayName=Ru;var Mu="DropdownMenuCheckboxItem",ea=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(fu,{...r,...o,ref:t})});ea.displayName=Mu;var Pu="DropdownMenuRadioGroup",ju=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(pu,{...r,...o,ref:t})});ju.displayName=Pu;var Au="DropdownMenuRadioItem",ta=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(mu,{...r,...o,ref:t})});ta.displayName=Au;var Tu="DropdownMenuItemIndicator",na=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(hu,{...r,...o,ref:t})});na.displayName=Tu;var Iu="DropdownMenuSeparator",oa=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(gu,{...r,...o,ref:t})});oa.displayName=Iu;var ku="DropdownMenuArrow",_u=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(vu,{...r,...o,ref:t})});_u.displayName=ku;var Du="DropdownMenuSubTrigger",ra=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(xu,{...r,...o,ref:t})});ra.displayName=Du;var Ou="DropdownMenuSubContent",sa=i.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ae(n);return s.jsx(wu,{...r,...o,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)"}})});sa.displayName=Ou;var Lu=Ks,Fu=qs,$u=Ys,aa=Zs,ia=Qs,ca=Js,la=ea,da=ta,ua=na,fa=oa,pa=ra,ma=sa;const Bu=Lu,Vu=Fu,Uu=i.forwardRef(({className:e,inset:t,children:n,...o},r)=>s.jsxs(pa,{ref:r,className:O("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...o,children:[n,s.jsx(ys,{className:"ml-auto h-4 w-4"})]}));Uu.displayName=pa.displayName;const Hu=i.forwardRef(({className:e,...t},n)=>s.jsx(ma,{ref:n,className:O("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}));Hu.displayName=ma.displayName;const ha=i.forwardRef(({className:e,sideOffset:t=4,...n},o)=>s.jsx($u,{children:s.jsx(aa,{ref:o,sideOffset:t,className:O("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})}));ha.displayName=aa.displayName;const ce=i.forwardRef(({className:e,inset:t,...n},o)=>s.jsx(ca,{ref:o,className:O("relative flex cursor-default select-none items-center 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",t&&"pl-8",e),...n}));ce.displayName=ca.displayName;const zu=i.forwardRef(({className:e,children:t,checked:n,...o},r)=>s.jsxs(la,{ref:r,className:O("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,...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(ua,{children:s.jsx(ws,{className:"h-4 w-4"})})}),t]}));zu.displayName=la.displayName;const Wu=i.forwardRef(({className:e,children:t,...n},o)=>s.jsxs(da,{ref:o,className:O("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:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(ua,{children:s.jsx(Nd,{className:"h-4 w-4 fill-current"})})}),t]}));Wu.displayName=da.displayName;const Ku=i.forwardRef(({className:e,inset:t,...n},o)=>s.jsx(ia,{ref:o,className:O("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ku.displayName=ia.displayName;const Gu=i.forwardRef(({className:e,...t},n)=>s.jsx(fa,{ref:n,className:O("-mx-1 my-1 h-px bg-muted",e),...t}));Gu.displayName=fa.displayName;class qu{constructor(){cn(this,"api",null);cn(this,"messageListeners",new Map);window.acquireVsCodeApi&&(this.api=window.acquireVsCodeApi()),window.addEventListener("message",t=>{const n=t.data;this.notifyListeners(n.type,n)})}postMessage(t){this.api?this.api.postMessage(t):console.warn("VSCode API not available, message not sent:",t)}onMessage(t,n){return this.messageListeners.has(t)||this.messageListeners.set(t,new Set),this.messageListeners.get(t).add(n),()=>{this.messageListeners.get(t)?.delete(n)}}notifyListeners(t,n){const o=this.messageListeners.get(t);o&&o.forEach(r=>r(n))}setState(t){this.api&&this.api.setState(t)}getState(){return this.api?this.api.getState():null}refreshAll(){this.postMessage({type:"refresh-all"})}getSpecs(){this.postMessage({type:"get-specs"})}getTasks(t){this.postMessage({type:"get-tasks",specName:t})}updateTaskStatus(t,n,o){this.postMessage({type:"update-task-status",specName:t,taskId:n,status:o})}saveDocument(t,n,o){this.postMessage({type:"save-document",specName:t,docType:n,content:o})}getApprovals(){this.postMessage({type:"get-approvals"})}getApprovalCategories(){this.postMessage({type:"get-approval-categories"})}approveRequest(t,n){this.postMessage({type:"approve-request",id:t,response:n})}rejectRequest(t,n){this.postMessage({type:"reject-request",id:t,response:n})}requestRevisionRequest(t,n,o,r){this.postMessage({type:"request-revision-request",id:t,response:n,annotations:o,comments:r})}getApprovalContent(t){this.postMessage({type:"get-approval-content",id:t})}getSteering(){this.postMessage({type:"get-steering"})}getSpecDocuments(t){this.postMessage({type:"get-spec-documents",specName:t})}getSteeringDocuments(){this.postMessage({type:"get-steering-documents"})}openDocument(t,n){this.postMessage({type:"open-document",specName:t,docType:n})}openSteeringDocument(t){this.postMessage({type:"open-steering-document",docType:t})}getSelectedSpec(){this.postMessage({type:"get-selected-spec"})}setSelectedSpec(t){this.postMessage({type:"set-selected-spec",specName:t})}getConfig(){this.postMessage({type:"get-config"})}getArchivedSpecs(){this.postMessage({type:"get-archived-specs"})}archiveSpec(t){this.postMessage({type:"archive-spec",specName:t})}unarchiveSpec(t){this.postMessage({type:"unarchive-spec",specName:t})}openExternalUrl(t){this.postMessage({type:"open-external-url",url:t})}getLanguagePreference(){this.postMessage({type:"get-language-preference"})}setLanguagePreference(t){this.postMessage({type:"set-language-preference",language:t})}}const L=new qu;function Yu(e={}){const{enabled:t=!0,volume:n=.3,soundUris:o=null}=e,r=i.useRef(new Map),a=i.useRef(!1);i.useEffect(()=>{const h=()=>{a.current=!0,console.log("User interaction detected - audio playback now allowed"),document.removeEventListener("click",h),document.removeEventListener("keydown",h),document.removeEventListener("touchstart",h)};return document.addEventListener("click",h,{passive:!0}),document.addEventListener("keydown",h,{passive:!0}),document.addEventListener("touchstart",h,{passive:!0}),()=>{document.removeEventListener("click",h),document.removeEventListener("keydown",h),document.removeEventListener("touchstart",h)}},[]);const l=i.useCallback(h=>{if(o&&o[h])return console.log("Found sound URI via PostMessage:",o[h]),o[h];const v=window.soundURIs;if(v&&v[h])return console.log("Found sound URI via window.soundURIs:",v[h]),v[h];const m=document.getElementById("root");if(m){const x=h==="approval-pending"?m.getAttribute("data-approval-sound-uri"):m.getAttribute("data-task-completed-sound-uri");if(x)return console.log("Found sound URI via data attribute:",x),x}return console.warn(`Sound URI not found for: ${h}`,{postMessageUris:o,windowSoundURIs:v,requestedSound:h,soundURIsReady:window.soundURIsReady}),null},[o]),c=i.useCallback(h=>{if(!t)return null;let v=r.current.get(h);if(!v)try{v=new Audio;const m=l(h);if(!m)return null;v.src=m,console.log("Set audio source to:",v.src),v.volume=n,v.preload="auto",v.addEventListener("error",x=>{console.warn(`Failed to load sound: ${h}`,x),r.current.delete(h)}),r.current.set(h,v)}catch(m){return console.warn(`Failed to create audio element for ${h}:`,m),null}return v&&(v.volume=n),v},[t,n,l]),d=i.useCallback(async h=>{if(console.log("playNotification called with:",{sound:h,enabled:t,userHasInteracted:a.current}),!t){console.log("Sound notifications disabled");return}if(!a.current){console.warn("Cannot play sound - user has not interacted with page yet (browser autoplay restriction)");return}try{const v=c(h);if(!v){console.warn("No audio element available for sound:",h);return}console.log("Playing sound:",h,"with audio element:",v),v.currentTime=0;const m=v.play();m?(console.log("Awaiting audio playback..."),await m,console.log("Audio playback completed successfully")):console.log("Audio play() did not return promise (legacy browser)")}catch(v){console.warn(`Sound notification blocked or failed for ${h}:`,v)}},[t,c]),u=i.useCallback(()=>d("approval-pending"),[d]),p=i.useCallback(()=>d("task-completed"),[d]),f=i.useCallback(h=>d(h),[d]),g=i.useCallback(()=>{r.current.forEach(h=>{h.pause(),h.removeAttribute("src"),h.load()}),r.current.clear()},[]);return{playApprovalPending:u,playTaskCompleted:p,testSound:f,cleanup:g,isEnabled:t}}function Xu(){const{t:e,i18n:t}=Ma();console.log("=== WEBVIEW APP.TSX STARTING ===");const n=Pa();console.log("Current VS Code theme:",n);const[o,r]=i.useState([]),[a,l]=i.useState([]),[c,d]=i.useState(null),[u,p]=i.useState(null),[f,g]=i.useState([]),[h,v]=i.useState([]),[m,x]=i.useState("all"),[y,b]=i.useState([]),[C,N]=i.useState([]),[,R]=i.useState(null),[k,E]=i.useState(!1),[j,B]=i.useState("overview"),[D,z]=i.useState(null),[V,F]=i.useState(null),[$,G]=i.useState(null),[_,H]=i.useState(!1),[A,M]=i.useState(new Set),[Q,te]=i.useState(!1),[J,me]=i.useState({enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0}),[ie,he]=i.useState(null),[q,P]=i.useState("active"),[W,ee]=i.useState(null),[U,Y]=i.useState("auto"),X=xe.useRef(null),ne=Yu({enabled:J.enabled,volume:J.volume,soundUris:ie}),ue=i.useRef([]),be=i.useRef(null),nt=w=>{M(S=>{const T=new Set(S);return T.has(w)?T.delete(w):T.add(w),T})},ot=w=>{if(!c)return;const S=w.prompt||e("task.copyPrompt",'Please work on task {{taskId}} for spec "{{specName}}"',{taskId:w.id,specName:c});navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(S).then(()=>{G(w.id),setTimeout(()=>G(null),2e3)}).catch(()=>{no(S,w.id)}):no(S,w.id)},no=(w,S)=>{const T=document.createElement("textarea");T.value=w,T.style.position="fixed",T.style.left="-999999px",T.style.top="-999999px",document.body.appendChild(T),T.focus(),T.select();try{document.execCommand("copy")&&(G(S),setTimeout(()=>G(null),2e3))}catch(rt){console.error("Failed to copy text: ",rt)}document.body.removeChild(T)},fe=w=>{Y(w),w==="auto"?(localStorage.removeItem("spec-workflow-language"),t.changeLanguage(void 0)):(localStorage.setItem("spec-workflow-language",w),t.changeLanguage(w)),L.setLanguagePreference(w),z({message:e("language.changed"),level:"success"})},ga=()=>{const w=`Please help me create or update the steering documents for my project. The steering documents include: - product.md: Define the product vision, target users, key features, and business objectives - tech.md: Document technical architecture decisions, technology stack, and development principles - structure.md: Describe the codebase organization, directory structure, and module architecture Review the existing steering documents (if any) and help me improve or complete them based on my project requirements.`;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(w).then(()=>{H(!0),setTimeout(()=>H(!1),2e3)}).catch(()=>{oo(w)}):oo(w)},oo=w=>{const S=document.createElement("textarea");S.value=w,S.style.position="fixed",S.style.left="-999999px",S.style.top="-999999px",document.body.appendChild(S),S.focus(),S.select();try{document.execCommand("copy")&&(H(!0),setTimeout(()=>H(!1),2e3))}catch(T){console.error("Failed to copy text: ",T)}document.body.removeChild(S)},va=()=>{X.current?.scrollTo({top:0,behavior:"smooth"})};i.useEffect(()=>{const w=[L.onMessage("specs-updated",S=>{r(S.data||[]),E(!1)}),L.onMessage("tasks-updated",S=>{console.log("=== App.tsx tasks-updated message ==="),console.log("Message data:",S.data),console.log("Selected spec:",c),console.log("Message spec:",S.data?.specName),S.data&&(console.log("Setting taskData with taskList count:",S.data.taskList?.length),console.log("Sample task (2.2) from message:",S.data.taskList?.find(T=>T.id==="2.2")),console.log("Tasks with metadata:",S.data.taskList?.filter(T=>T.requirements?.length||T.implementationDetails?.length||T.files?.length||T.purposes?.length||T.leverage).map(T=>({id:T.id,requirements:T.requirements,implementationDetails:T.implementationDetails}))),p(S.data),!c&&S.data.specName&&(console.log("Setting selected spec from task data:",S.data.specName),d(S.data.specName)))}),L.onMessage("approvals-updated",S=>{console.log("=== Received approvals-updated message ==="),console.log("Current tab:",j),console.log("Approvals count:",S.data?.length||0),console.log("Pending approvals:",S.data?.filter(T=>T.status==="pending").length||0),console.log("About to setApprovals - this should trigger badge counter update"),g(S.data||[]),L.getApprovalCategories()}),L.onMessage("approval-categories-updated",S=>{console.log("=== Received approval-categories-updated message ==="),console.log("Categories:",S.data),v(S.data||[])}),L.onMessage("steering-updated",S=>{R(S.data)}),L.onMessage("spec-documents-updated",S=>{b(S.data||[])}),L.onMessage("steering-documents-updated",S=>{N(S.data||[])}),L.onMessage("selected-spec-updated",S=>{d(S.data||null)}),L.onMessage("error",S=>{console.error("Extension error:",S.message),E(!1)}),L.onMessage("notification",S=>{z({message:S.message,level:S.level}),setTimeout(()=>z(null),3e3)}),L.onMessage("config-updated",S=>{me(S.data||{enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0})}),L.onMessage("sound-uris-updated",S=>{console.log("Received sound URIs from extension:",S.data),he(S.data||null)}),L.onMessage("navigate-to-approvals",S=>{console.log("Navigating to approvals from native notification:",S.data);const{specName:T,approvalId:rt}=S.data;B("approvals"),d(T),console.log("Switched to approvals tab, selected spec:",T)}),L.onMessage("archived-specs-updated",S=>{console.log("=== Received archived-specs-updated message ==="),console.log("Archived specs count:",S.data?.length||0),l(S.data||[])}),L.onMessage("language-preference-updated",S=>{console.log("=== Received language-preference-updated message ==="),console.log("Language preference:",S.data);const T=S.data||"auto";Y(T),T==="auto"?(localStorage.removeItem("spec-workflow-language"),t.changeLanguage(void 0)):(localStorage.setItem("spec-workflow-language",T),t.changeLanguage(T))})];return ro(),L.getApprovals(),L.getLanguagePreference(),()=>{w.forEach(S=>S())}},[]),i.useEffect(()=>{c&&(L.getTasks(c),L.getSpecDocuments(c))},[c]),i.useEffect(()=>{W&&L.getSpecDocuments(W)},[W]),i.useEffect(()=>{L.getSteeringDocuments()},[]),i.useEffect(()=>{const w=X.current;if(!w)return;const S=()=>{te(w.scrollTop>200)};return w.addEventListener("scroll",S),()=>w.removeEventListener("scroll",S)},[]),i.useEffect(()=>{if(f.length===0){ue.current=f;return}const w=f.filter(T=>T.status==="pending").length,S=ue.current.filter(T=>T.status==="pending").length;w>S&&ue.current.length>0&&J.approvalSound&&(console.log(`New pending approval detected: ${w} vs ${S}`),ne.playApprovalPending()),ue.current=f},[f,ne,J.approvalSound]),i.useEffect(()=>{if(!u||!u.taskList){be.current=u;return}if(!be.current||!be.current.taskList){be.current=u;return}const w=u.taskList.filter(T=>T.status==="completed").length,S=be.current.taskList.filter(T=>T.status==="completed").length;w>S&&J.taskCompletionSound&&(console.log(`Task completion detected: ${w} vs ${S}`),ne.playTaskCompleted()),be.current=u},[u,ne,J.taskCompletionSound]),i.useEffect(()=>{j==="approvals"?(L.getApprovals(),L.getApprovalCategories()):j==="archives"&&L.getArchivedSpecs()},[j]);const ro=()=>{E(!0),L.refreshAll(),L.getSelectedSpec(),L.getConfig(),L.getArchivedSpecs()},so=w=>{L.setSelectedSpec(w)},xa=(w,S)=>{c&&L.updateTaskStatus(c,w,S)},ge=xe.useMemo(()=>{const w=o.filter(Se=>!Se.isArchived).length,S=a.length,T=w+S,rt=o.filter(Se=>Se.taskProgress&&Se.taskProgress.completed===Se.taskProgress.total&&Se.taskProgress.total>0).length,wa=o.reduce((Se,an)=>Se+(an.taskProgress?.total||0),0),ya=o.reduce((Se,an)=>Se+(an.taskProgress?.completed||0),0);return{activeSpecs:w,archivedSpecs:S,totalSpecs:T,completedSpecs:rt,totalTasks:wa,completedTasks:ya}},[o,a]),ao=xe.useMemo(()=>{const w=f.filter(S=>S.status==="pending").length;return console.log("Badge counter recalculated:",w,"from",f.length,"total approvals"),w},[f]);return s.jsx("div",{className:O("sidebar-root",`vscode-${n}`),children:s.jsxs(ri,{value:j,onValueChange:B,className:"w-full h-full flex flex-col",children:[s.jsxs("div",{className:"sidebar-sticky-header space-y-3",children:[D&&s.jsx("div",{className:O("p-2 rounded text-xs font-medium",D.level==="success"&&"bg-green-100 text-green-800 border border-green-200",D.level==="error"&&"bg-red-100 text-red-800 border border-red-200",D.level==="warning"&&"bg-yellow-100 text-yellow-800 border border-yellow-200",D.level==="info"&&"bg-blue-100 text-blue-800 border border-blue-200"),children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:D.message}),s.jsx("button",{type:"button",onClick:()=>z(null),className:"ml-2 hover:opacity-70",children:"×"})]})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h1",{className:"text-lg font-semibold",children:e("header.title")}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs(Bu,{children:[s.jsx(Vu,{asChild:!0,children:s.jsx(oe,{variant:"ghost",size:"sm",className:"flex items-center space-x-1",title:e("language.selector"),children:s.jsx(Ed,{className:"h-4 w-4"})})}),s.jsxs(ha,{align:"end",children:[s.jsx(ce,{onClick:()=>fe("auto"),className:O(U==="auto"&&"bg-accent"),children:e("language.auto")}),s.jsx(ce,{onClick:()=>fe("en"),className:O(U==="en"&&"bg-accent"),children:e("language.english")}),s.jsx(ce,{onClick:()=>fe("ja"),className:O(U==="ja"&&"bg-accent"),children:e("language.japanese")}),s.jsx(ce,{onClick:()=>fe("zh"),className:O(U==="zh"&&"bg-accent"),children:e("language.chinese")}),s.jsx(ce,{onClick:()=>fe("es"),className:O(U==="es"&&"bg-accent"),children:e("language.spanish")}),s.jsx(ce,{onClick:()=>fe("pt"),className:O(U==="pt"&&"bg-accent"),children:e("language.portuguese")}),s.jsx(ce,{onClick:()=>fe("de"),className:O(U==="de"&&"bg-accent"),children:e("language.german")}),s.jsx(ce,{onClick:()=>fe("fr"),className:O(U==="fr"&&"bg-accent"),children:e("language.french")}),s.jsx(ce,{onClick:()=>fe("ru"),className:O(U==="ru"&&"bg-accent"),children:e("language.russian")}),s.jsx(ce,{onClick:()=>fe("it"),className:O(U==="it"&&"bg-accent"),children:e("language.italian")}),s.jsx(ce,{onClick:()=>fe("ko"),className:O(U==="ko"&&"bg-accent"),children:e("language.korean")}),s.jsx(ce,{onClick:()=>fe("ar"),className:O(U==="ar"&&"bg-accent"),children:e("language.arabic")})]})]}),s.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>L.openExternalUrl("https://buymeacoffee.com/pimzino"),title:e("header.support"),className:"text-orange-600 hover:text-orange-700 hover:bg-orange-50",children:s.jsx(Cd,{className:"h-4 w-4"})}),s.jsx(oe,{variant:"ghost",size:"sm",onClick:ro,disabled:k,children:s.jsx(Rd,{className:O("h-4 w-4",k&&"animate-spin")})})]})]}),s.jsxs(si,{className:"grid w-full grid-cols-5",children:[s.jsx(st,{value:"overview",className:"text-xs",title:e("tabs.overview"),children:s.jsx(wd,{className:"h-3 w-3"})}),s.jsx(st,{value:"steering",className:"text-xs",title:e("tabs.steering"),children:s.jsx(Md,{className:"h-3 w-3"})}),s.jsx(st,{value:"specs",className:"text-xs",title:e("tabs.specs"),children:s.jsx(yd,{className:"h-3 w-3"})}),s.jsx(st,{value:"tasks",className:"text-xs",title:e("tabs.tasks"),children:s.jsx(Pd,{className:"h-3 w-3"})}),s.jsxs(st,{value:"approvals",className:"text-xs relative",title:e("tabs.approvals"),children:[s.jsx(Sd,{className:"h-3 w-3"}),ao>0&&s.jsx(Nt,{variant:"destructive",className:"absolute -top-1 -right-1 h-4 w-4 p-0 text-xs flex items-center justify-center rounded-full min-w-[16px]",children:ao})]})]})]}),s.jsxs("div",{className:"sidebar-scrollable-content",ref:X,children:[s.jsxs(at,{value:"overview",className:"space-y-3",children:[s.jsxs(Te,{children:[s.jsx(yt,{className:"pb-2",children:s.jsx(bt,{className:"text-sm",children:e("overview.projectTitle")})}),s.jsxs(Ie,{className:"space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.activeSpecs")}),s.jsxs("div",{className:"font-medium",children:[ge.completedSpecs," / ",ge.activeSpecs]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.archivedSpecs")}),s.jsx("div",{className:"font-medium",children:ge.archivedSpecs})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.totalSpecs")}),s.jsx("div",{className:"font-medium",children:ge.totalSpecs})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-muted-foreground",children:e("overview.tasks")}),s.jsxs("div",{className:"font-medium",children:[ge.completedTasks," / ",ge.totalTasks]})]})]}),ge.totalTasks>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{children:e("overview.overallProgress")}),s.jsxs("span",{children:[Math.round(ge.completedTasks/ge.totalTasks*100),"%"]})]}),s.jsx(lo,{value:ge.completedTasks/ge.totalTasks*100,className:"h-2"})]})]})]}),s.jsxs(Te,{children:[s.jsx(yt,{className:"pb-2",children:s.jsx(bt,{className:"text-sm",children:e("overview.recentActivity")})}),s.jsx(Ie,{children:s.jsxs("div",{className:"space-y-2",children:[o.slice(0,3).map(w=>s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:O("w-2 h-2 rounded-full",w.taskProgress&&w.taskProgress.completed===w.taskProgress.total&&w.taskProgress.total>0?"bg-green-500":"bg-blue-500")}),s.jsx("span",{className:"truncate",children:w.displayName})]}),s.jsx("span",{className:"text-muted-foreground",children:e("overview.modified",{time:St(w.lastModified)})})]},w.name)),o.length===0&&s.jsx("div",{className:"text-muted-foreground text-xs text-center py-2",children:e("overview.noSpecs")})]})})]})]}),s.jsxs(at,{value:"tasks",className:"space-y-3",children:[s.jsx("div",{className:"space-y-3",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("tasks.specLabel"),":"]}),s.jsxs(At,{value:c||"",onValueChange:so,children:[s.jsx(It,{className:"w-full",children:s.jsx(Tt,{placeholder:e("tasks.specPlaceholder")})}),s.jsx(kt,{children:o.map(w=>s.jsx($e,{value:w.name,children:w.displayName},w.name))})]})]})}),c?u?s.jsxs(s.Fragment,{children:[s.jsx(Te,{children:s.jsx(Ie,{className:"p-4",children:s.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg",children:u.total}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.total")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg text-green-600",children:u.completed}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.done")})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-medium text-lg text-amber-600",children:u.total-u.completed}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.left")})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"font-medium text-lg text-blue-600",children:[Math.round(u.progress),"%"]}),s.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.progress")})]})]})})}),s.jsx(Te,{children:s.jsxs(Ie,{className:"p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium",children:e("tasks.overallProgress")}),s.jsxs("span",{className:"text-sm",children:[Math.round(u.progress),"%"]})]}),s.jsx(lo,{value:u.progress,className:"h-2"})]})}),s.jsx("div",{className:"space-y-2",children:u.taskList?.map(w=>(console.log(`🔍 TASK DEBUG [${w.id}]:`,{id:w.id,status:w.status,completed:w.completed,inProgress:w.inProgress,hasInProgress:"inProgress"in w,allProps:Object.keys(w)}),s.jsx(Te,{className:O("transition-colors",w.isHeader&&"border-purple-200 dark:border-slate-600 bg-purple-50 dark:bg-slate-800/60",w.status==="in-progress"&&"border-orange-500",w.completed&&"border-green-500"),children:s.jsx(Ie,{className:"p-3",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:O("text-sm flex-1",w.isHeader?"font-semibold text-purple-900 dark:text-purple-100":"font-medium"),children:[w.isHeader?e("tasks.section","Section"):e("tasks.task","Task")," ",w.id]}),!w.isHeader&&s.jsxs(s.Fragment,{children:[s.jsx(oe,{variant:"ghost",size:"sm",className:O("h-6 w-6 p-0",$===w.id&&"text-green-600"),onClick:S=>{S.stopPropagation(),ot(w)},title:$===w.id?e("tasks.copied"):e("tasks.copyPromptTitle"),disabled:$===w.id,children:s.jsx(Do,{className:"h-3 w-3"})}),s.jsxs(At,{value:w.completed?"completed":w.status||"pending",onValueChange:S=>xa(w.id,S),children:[s.jsx(It,{className:O("w-auto h-6 px-2 text-xs border-0 focus:ring-0 focus:ring-offset-0",w.completed?"bg-green-500 text-white [&_svg]:!text-white [&_svg]:opacity-100":w.status==="in-progress"?"bg-orange-500 text-white [&_svg]:!text-white [&_svg]:opacity-100":"bg-transparent border border-border text-foreground [&_svg]:text-foreground"),children:s.jsx(Tt,{})}),s.jsxs(kt,{children:[s.jsx($e,{value:"pending",children:e("tasks.status.pending")}),s.jsx($e,{value:"in-progress",children:e("tasks.status.inProgress")}),s.jsx($e,{value:"completed",children:e("tasks.status.completed")})]})]})]}),w.isHeader&&s.jsx(Nt,{variant:"secondary",className:"text-xs bg-purple-100 dark:bg-slate-700 text-purple-700 dark:text-slate-200 border-purple-300 dark:border-slate-500",children:e("tasks.taskGroup")})]}),s.jsx("p",{className:O("text-xs",w.isHeader?"text-slate-600 dark:text-slate-300":"text-muted-foreground"),children:w.description}),s.jsxs("div",{className:"space-y-2 border-t border-gray-100 dark:border-gray-700 pt-2",children:[w.files&&w.files.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-purple-600 dark:text-purple-400 flex items-center gap-1",children:[e("tasks.meta.files"),":"]}),s.jsx("div",{className:"task-files-container",children:s.jsx("div",{className:"task-files-list",children:w.files.map((S,T)=>s.jsx("span",{className:"px-2 py-1 bg-purple-50 dark:bg-purple-950/30 text-purple-700 dark:text-purple-300 text-xs rounded border border-purple-200 dark:border-purple-800 font-mono whitespace-nowrap flex-shrink-0",children:S},T))})})]}),w.implementationDetails&&w.implementationDetails.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 flex items-center gap-1",children:[e("tasks.meta.implementation"),":"]}),s.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:w.implementationDetails.map((S,T)=>s.jsx("li",{className:"leading-relaxed",children:S},T))})]}),w.purposes&&w.purposes.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 flex items-center gap-1",children:[e("tasks.meta.purposes"),":"]}),s.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:w.purposes.map((S,T)=>s.jsx("li",{className:"leading-relaxed",children:S},T))})]}),w.requirements&&w.requirements.length>0&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-orange-600 dark:text-orange-400 flex items-center gap-1",children:[e("tasks.meta.requirements"),":"]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:w.requirements.join(", ")})]}),w.leverage&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xs font-medium text-cyan-600 dark:text-cyan-400 flex items-center gap-1",children:[e("tasks.meta.leverage"),":"]}),s.jsx("div",{className:"text-xs text-cyan-900 dark:text-cyan-100 bg-cyan-50 dark:bg-cyan-950/30 border border-cyan-200 dark:border-cyan-800 rounded px-2 py-1 font-mono",children:w.leverage})]}),w.prompt&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"text-xs font-medium text-indigo-600 dark:text-indigo-400 flex items-center gap-1",children:[s.jsx(bd,{className:"w-3 h-3"}),e("tasks.meta.prompt","AI Prompt"),":"]}),s.jsx("button",{onClick:()=>nt(w.id),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200 transition-colors",title:A.has(w.id)?"Collapse prompt":"Expand prompt",children:A.has(w.id)?s.jsx(qn,{className:"w-3 h-3"}):s.jsx(ys,{className:"w-3 h-3"})})]}),A.has(w.id)&&s.jsx("div",{className:"text-xs text-indigo-900 dark:text-indigo-100 bg-indigo-50 dark:bg-indigo-950/30 border border-indigo-200 dark:border-indigo-800 rounded px-2 py-1.5 whitespace-pre-wrap break-words",children:w.prompt})]})," "]})]})})},w.id)))})]}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("tasks.loading")}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:o.length===0?e("tasks.noSpecs"):e("tasks.selectSpec")})]}),s.jsxs(at,{value:"approvals",className:"space-y-3",children:[s.jsx("div",{className:"space-y-3",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("approvals.docLabel"),":"]}),s.jsxs(At,{value:m,onValueChange:x,children:[s.jsx(It,{className:"w-full",children:s.jsx(Tt,{placeholder:e("approvals.categoryPlaceholder")})}),s.jsx(kt,{children:h.map(w=>s.jsx($e,{value:w.value,children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{children:w.label}),w.count>0&&s.jsx(Nt,{variant:"secondary",className:"ml-2 h-4 w-4 p-0 text-xs flex items-center justify-center rounded-full min-w-[16px]",children:w.count})]})},w.value))})]})]})}),m?(()=>{const w=m==="all"?f.filter(S=>S.status==="pending"):f.filter(S=>S.status==="pending"&&S.categoryName===m);return w.length>0?s.jsx("div",{className:"space-y-2",children:w.map(S=>s.jsx(Te,{children:s.jsx(Ie,{className:"p-3",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"font-medium text-sm",children:S.title}),s.jsx(Nt,{variant:"secondary",className:"text-xs",children:e("approvals.status.pending")})]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:S.description}),S.filePath&&s.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:S.filePath}),s.jsx("div",{className:"text-xs text-muted-foreground",children:e("approvals.created",{time:St(S.createdAt)})}),s.jsxs("div",{className:"flex gap-1 flex-wrap",children:[s.jsx(oe,{size:"sm",className:"h-6 px-2 text-xs",disabled:V===S.id,onClick:()=>{F(S.id),L.approveRequest(S.id,e("approvals.response.approved")),setTimeout(()=>F(null),2e3)},children:V===S.id?e("approvals.processing"):e("approvals.approve")}),s.jsx(oe,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:V===S.id,onClick:()=>{F(S.id),L.rejectRequest(S.id,e("approvals.response.rejected")),setTimeout(()=>F(null),2e3)},children:V===S.id?e("approvals.processing"):e("approvals.reject")}),s.jsx(oe,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:V===S.id,onClick:()=>{F(S.id),L.requestRevisionRequest(S.id,e("approvals.response.needsRevision")),setTimeout(()=>F(null),2e3)},children:V===S.id?e("approvals.processing"):e("approvals.requestRevision")}),S.filePath&&s.jsx(oe,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L.getApprovalContent(S.id),children:e("approvals.openInEditor")})]})]})})},S.id))}):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("approvals.noPending")})})():s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:h.length<=1?e("approvals.noPendingDocuments"):e("approvals.selectCategory")})]}),s.jsxs(at,{value:"specs",className:"space-y-3",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs("div",{className:"inline-flex items-center space-x-1 p-1 bg-muted rounded-md",children:[s.jsx(oe,{variant:q==="active"?"default":"ghost",size:"sm",className:O("h-7 px-3 text-xs font-medium transition-all",q==="active"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-muted-foreground/10"),onClick:()=>{P("active"),ee(null)},children:e("specs.active")}),s.jsx(oe,{variant:q==="archived"?"default":"ghost",size:"sm",className:O("h-7 px-3 text-xs font-medium transition-all",q==="archived"?"bg-primary text-primary-foreground shadow-sm":"hover:bg-muted-foreground/10"),onClick:()=>{P("archived"),d(null)},children:e("specs.archived")})]})}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsxs("label",{className:"text-sm font-medium",children:[e("specs.specLabel"),":"]}),s.jsxs(At,{value:q==="active"?c||"":W||"",onValueChange:q==="active"?so:ee,children:[s.jsx(It,{className:"w-full",children:s.jsx(Tt,{placeholder:e("specs.specPlaceholder")})}),s.jsx(kt,{children:q==="active"?o.filter(w=>!w.isArchived).map(w=>s.jsx($e,{value:w.name,children:w.displayName},w.name)):a.map(w=>s.jsx($e,{value:w.name,children:w.displayName},w.name))})]}),q==="active"&&c&&s.jsx(oe,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>L.archiveSpec(c),children:e("specs.archive")}),q==="archived"&&W&&s.jsx(oe,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>L.unarchiveSpec(W),children:e("specs.unarchive")})]})]}),s.jsxs(Te,{children:[s.jsx(yt,{className:"pb-2",children:s.jsx(bt,{className:"text-sm",children:e("specs.docsTitle")})}),s.jsxs(Ie,{children:[(q==="active"?c:W)&&s.jsx("div",{className:"space-y-2",children:y.length>0?y.map(w=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:[s.jsx("span",{className:"capitalize",children:w.name}),".md"]}),w.exists&&w.lastModified&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.modified",{time:St(w.lastModified)})}),!w.exists&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.fileNotFound")})]}),s.jsx(oe,{size:"sm",className:"h-6 px-2 text-xs",disabled:!w.exists,onClick:()=>L.openDocument(q==="active"?c:W,w.name),children:e("specs.open")})]},w.name)):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("specs.noDocs")})}),!(q==="active"?c:W)&&s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:q==="active"?o.filter(w=>!w.isArchived).length===0?e("specs.noActiveSpecs"):e("specs.selectSpec"):a.length===0?e("specs.noArchivedSpecs"):e("specs.selectSpec")})]})]})]}),s.jsx(at,{value:"steering",className:"space-y-3",children:s.jsxs(Te,{children:[s.jsx(yt,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(bt,{className:"text-sm",children:e("steering.title")}),s.jsxs(oe,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:ga,title:e(_?"steering.copied":"steering.copyInstructions"),children:[s.jsx(Do,{className:"h-3 w-3 mr-1"}),e(_?"steering.copied":"steering.copyInstructions")]})]})}),s.jsx(Ie,{children:s.jsx("div",{className:"space-y-2",children:C.length>0?C.map(w=>s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsxs("div",{className:"font-medium text-sm",children:[s.jsx("span",{className:"capitalize",children:w.name}),".md"]}),w.exists&&w.lastModified&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.modified",{time:St(w.lastModified)})}),!w.exists&&s.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.fileNotFound")})]}),s.jsx(oe,{size:"sm",className:"h-6 px-2 text-xs",disabled:!w.exists,onClick:()=>L.openSteeringDocument(w.name),children:e("steering.open")})]},w.name)):s.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("steering.noDocs")})})})]})})]}),Q&&s.jsx(oe,{className:"fixed bottom-4 right-4 z-20 rounded-full w-10 h-10 p-0 shadow-lg",onClick:va,title:e("common.scrollToTop"),children:s.jsx(bs,{className:"h-4 w-4"})})]})})}const Lo=document.getElementById("root");Lo&&(ja.createRoot(Lo).render(s.jsx(xe.StrictMode,{children:s.jsx(i.Suspense,{fallback:"Loading...",children:s.jsx(Xu,{})})})),document.body.classList.add("loaded"));

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pimzino/spec-workflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server