main.js•164 kB
var Ea=Object.defineProperty;var Ra=(e,t,n)=>t in e?Ea(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var dn=(e,t,n)=>Ra(e,typeof t!="symbol"?t+"":t,n);import{r as a,j as o,R as ye,u as Z,c as mt,a as $r,g as Ma,b as Pa,d as B,S as Aa,e as Ta,f as se,h as Br,i as yt,C as le,k as de,l as Ia,B as re,m as Et,n as Rt,o as Mt,p as ka}from"./i18n.js";function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function Le(e,t=[]){let n=[];function r(i,l){const c=a.createContext(l),d=n.length;n=[...n,l];const u=f=>{const{scope:g,children:h,...v}=f,m=g?.[e]?.[d]||c,x=a.useMemo(()=>v,Object.values(v));return o.jsx(m.Provider,{value:x,children:h})};u.displayName=i+"Provider";function p(f,g){const h=g?.[e]?.[d]||c,v=a.useContext(h);if(v)return v;if(l!==void 0)return l;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,p]}const s=()=>{const i=n.map(l=>a.createContext(l));return function(c){const d=c?.[e]||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return s.scopeName=e,[r,_a(s,...t)]}function _a(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const l=r.reduce((c,{useScope:d,scopeName:u})=>{const f=d(i)[`__scope${u}`];return{...c,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function kn(e){const t=e+"CollectionProvider",[n,r]=Le(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=m=>{const{scope:x,children:y}=m,b=ye.useRef(null),S=ye.useRef(new Map).current;return o.jsx(s,{scope:x,itemMap:S,collectionRef:b,children:y})};l.displayName=t;const c=e+"CollectionSlot",d=mt(c),u=ye.forwardRef((m,x)=>{const{scope:y,children:b}=m,S=i(c,y),j=Z(x,S.collectionRef);return o.jsx(d,{ref:j,children:b})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",g=mt(p),h=ye.forwardRef((m,x)=>{const{scope:y,children:b,...S}=m,j=ye.useRef(null),E=Z(x,j),A=i(p,y);return ye.useEffect(()=>(A.itemMap.set(j,{ref:j,...S}),()=>void A.itemMap.delete(j))),o.jsx(g,{[f]:"",ref:E,children:b})});h.displayName=p;function v(m){const x=i(e+"CollectionConsumer",m);return ye.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const S=Array.from(b.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((A,N)=>S.indexOf(A.ref.current)-S.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:u,ItemSlot:h},v,r]}var oe=globalThis?.document?a.useLayoutEffect:()=>{},Da=$r[" useId ".trim().toString()]||(()=>{}),Oa=0;function Be(e){const[t,n]=a.useState(Da());return oe(()=>{n(r=>r??String(Oa++))},[e]),t?`radix-${t}`:""}var bt=Pa();const La=Ma(bt);var Fa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=Fa.reduce((e,t)=>{const n=mt(`Primitive.${t}`),r=a.forwardRef((s,i)=>{const{asChild:l,...c}=s,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Vr(e,t){e&&bt.flushSync(()=>e.dispatchEvent(t))}function Me(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}var $a=$r[" useInsertionEffect ".trim().toString()]||oe;function ht({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,l]=Ba({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:s;{const p=a.useRef(e!==void 0);a.useEffect(()=>{const f=p.current;f!==c&&console.warn(`${r} 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,r])}const u=a.useCallback(p=>{if(c){const f=Va(p)?p(e):p;f!==e&&l.current?.(f)}else i(p)},[c,e,i,l]);return[d,u]}function Ba({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),s=a.useRef(n),i=a.useRef(t);return $a(()=>{i.current=t},[t]),a.useEffect(()=>{s.current!==n&&(i.current?.(n),s.current=n)},[n,s]),[n,r,i]}function Va(e){return typeof e=="function"}var Ua=a.createContext(void 0);function Gt(e){const t=a.useContext(Ua);return e||t||"ltr"}var un="rovingFocusGroup.onEntryFocus",Ha={bubbles:!1,cancelable:!0},St="RovingFocusGroup",[bn,Ur,za]=kn(St),[Wa,qt]=Le(St,[za]),[Ka,Ga]=Wa(St),Hr=a.forwardRef((e,t)=>o.jsx(bn.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(bn.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(qa,{...e,ref:t})})}));Hr.displayName=St;var qa=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,g=a.useRef(null),h=Z(t,g),v=Gt(i),[m,x]=ht({prop:l,defaultProp:c??null,onChange:d,caller:St}),[y,b]=a.useState(!1),S=Me(u),j=Ur(n),E=a.useRef(!1),[A,N]=a.useState(0);return a.useEffect(()=>{const R=g.current;if(R)return R.addEventListener(un,S),()=>R.removeEventListener(un,S)},[S]),o.jsx(Ka,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:m,onItemFocus:a.useCallback(R=>x(R),[x]),onItemShiftTab:a.useCallback(()=>b(!0),[]),onFocusableItemAdd:a.useCallback(()=>N(R=>R+1),[]),onFocusableItemRemove:a.useCallback(()=>N(R=>R-1),[]),children:o.jsx(K.div,{tabIndex:y||A===0?-1:0,"data-orientation":r,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:k(e.onMouseDown,()=>{E.current=!0}),onFocus:k(e.onFocus,R=>{const V=!E.current;if(R.target===R.currentTarget&&V&&!y){const _=new CustomEvent(un,Ha);if(R.currentTarget.dispatchEvent(_),!_.defaultPrevented){const U=j().filter(O=>O.focusable),F=U.find(O=>O.active),$=U.find(O=>O.id===m),G=[F,$,...U].filter(Boolean).map(O=>O.ref.current);Kr(G,p)}}E.current=!1}),onBlur:k(e.onBlur,()=>b(!1))})})}),zr="RovingFocusGroupItem",Wr=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:l,...c}=e,d=Be(),u=i||d,p=Ga(zr,n),f=p.currentTabStopId===u,g=Ur(n),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:m}=p;return a.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),o.jsx(bn.ItemSlot,{scope:n,id:u,focusable:r,active:s,children:o.jsx(K.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:t,onMouseDown:k(e.onMouseDown,x=>{r?p.onItemFocus(u):x.preventDefault()}),onFocus:k(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:k(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){p.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const y=Za(x,p.orientation,p.dir);if(y!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=g().filter(j=>j.focusable).map(j=>j.ref.current);if(y==="last")S.reverse();else if(y==="prev"||y==="next"){y==="prev"&&S.reverse();const j=S.indexOf(x.currentTarget);S=p.loop?Qa(S,j+1):S.slice(j+1)}setTimeout(()=>Kr(S))}}),children:typeof l=="function"?l({isCurrentTabStop:f,hasTabStop:m!=null}):l})})});Wr.displayName=zr;var Ya={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Xa(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Za(e,t,n){const r=Xa(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ya[r]}function Kr(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Qa(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gr=Hr,qr=Wr;function Ja(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var et=e=>{const{present:t,children:n}=e,r=ei(t),s=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=Z(r.ref,ti(s));return typeof n=="function"||r.isPresent?a.cloneElement(s,{ref:i}):null};et.displayName="Presence";function ei(e){const[t,n]=a.useState(),r=a.useRef(null),s=a.useRef(e),i=a.useRef("none"),l=e?"mounted":"unmounted",[c,d]=Ja(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=Pt(r.current);i.current=c==="mounted"?u:"none"},[c]),oe(()=>{const u=r.current,p=s.current;if(p!==e){const g=i.current,h=Pt(u);e?d("MOUNT"):h==="none"||u?.display==="none"?d("UNMOUNT"):d(p&&g!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,d]),oe(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=h=>{const m=Pt(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(d("ANIMATION_END"),!s.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&&(i.current=Pt(r.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:a.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function Pt(e){return e?.animationName||"none"}function ti(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 Yt="Tabs",[ni,Rf]=Le(Yt,[qt]),Yr=qt(),[ri,_n]=ni(Yt),Xr=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:l="horizontal",dir:c,activationMode:d="automatic",...u}=e,p=Gt(c),[f,g]=ht({prop:r,onChange:s,defaultProp:i??"",caller:Yt});return o.jsx(ri,{scope:n,baseId:Be(),value:f,onValueChange:g,orientation:l,dir:p,activationMode:d,children:o.jsx(K.div,{dir:p,"data-orientation":l,...u,ref:t})})});Xr.displayName=Yt;var Zr="TabsList",Qr=a.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=_n(Zr,n),l=Yr(n);return o.jsx(Gr,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(K.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});Qr.displayName=Zr;var Jr="TabsTrigger",eo=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,l=_n(Jr,n),c=Yr(n),d=ro(l.baseId,r),u=oo(l.baseId,r),p=r===l.value;return o.jsx(qr,{asChild:!0,...c,focusable:!s,active:p,children:o.jsx(K.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":u,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...i,ref:t,onMouseDown:k(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?l.onValueChange(r):f.preventDefault()}),onKeyDown:k(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&l.onValueChange(r)}),onFocus:k(e.onFocus,()=>{const f=l.activationMode!=="manual";!p&&!s&&f&&l.onValueChange(r)})})})});eo.displayName=Jr;var to="TabsContent",no=a.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...l}=e,c=_n(to,n),d=ro(c.baseId,r),u=oo(c.baseId,r),p=r===c.value,f=a.useRef(p);return a.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),o.jsx(et,{present:s||p,children:({present:g})=>o.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&&i})})});no.displayName=to;function ro(e,t){return`${e}-trigger-${t}`}function oo(e,t){return`${e}-content-${t}`}var oi=Xr,si=Qr,ai=eo,ii=no;function ci({className:e,...t}){return o.jsx(oi,{"data-slot":"tabs",className:B("flex flex-col gap-2",e),...t})}function li({className:e,...t}){return o.jsx(si,{"data-slot":"tabs-list",className:B("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 Ke({className:e,...t}){return o.jsx(ai,{"data-slot":"tabs-trigger",className:B("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 Ge({className:e,...t}){return o.jsx(ii,{"data-slot":"tabs-content",className:B("flex-1 outline-none",e),...t})}const di=Ta("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 At({className:e,variant:t,asChild:n=!1,...r}){const s=n?Aa:"span";return o.jsx(s,{"data-slot":"badge",className:B(di({variant:t}),e),...r})}var Dn="Progress",On=100,[ui,Mf]=Le(Dn),[fi,pi]=ui(Dn),so=a.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=mi,...l}=e;(s||s===0)&&!lr(s)&&console.error(hi(`${s}`,"Progress"));const c=lr(s)?s:On;r!==null&&!dr(r,c)&&console.error(gi(`${r}`,"Progress"));const d=dr(r,c)?r:null,u=$t(d)?i(d,c):void 0;return o.jsx(fi,{scope:n,value:d,max:c,children:o.jsx(K.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":$t(d)?d:void 0,"aria-valuetext":u,role:"progressbar","data-state":co(d,c),"data-value":d??void 0,"data-max":c,...l,ref:t})})});so.displayName=Dn;var ao="ProgressIndicator",io=a.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=pi(ao,n);return o.jsx(K.div,{"data-state":co(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});io.displayName=ao;function mi(e,t){return`${Math.round(e/t*100)}%`}function co(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function $t(e){return typeof e=="number"}function lr(e){return $t(e)&&!isNaN(e)&&e>0}function dr(e,t){return $t(e)&&!isNaN(e)&&e<=t&&e>=0}function hi(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${On}\`.`}function gi(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 ${On} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`}var vi=so,xi=io;function ur({className:e,value:t,...n}){return o.jsx(vi,{"data-slot":"progress",className:B("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:o.jsx(xi,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function fr(e,[t,n]){return Math.min(n,Math.max(t,e))}function wi(e,t=globalThis?.document){const n=Me(e);a.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var yi="DismissableLayer",Sn="dismissableLayer.update",bi="dismissableLayer.pointerDownOutside",Si="dismissableLayer.focusOutside",pr,lo=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ln=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...d}=e,u=a.useContext(lo),[p,f]=a.useState(null),g=p?.ownerDocument??globalThis?.document,[,h]=a.useState({}),v=Z(t,N=>f(N)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(x),b=p?m.indexOf(p):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,j=b>=y,E=ji(N=>{const R=N.target,V=[...u.branches].some(_=>_.contains(R));!j||V||(s?.(N),l?.(N),N.defaultPrevented||c?.())},g),A=Ei(N=>{const R=N.target;[...u.branches].some(_=>_.contains(R))||(i?.(N),l?.(N),N.defaultPrevented||c?.())},g);return wi(N=>{b===u.layers.size-1&&(r?.(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},g),a.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(pr=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),mr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=pr)}},[p,g,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),mr())},[p,u]),a.useEffect(()=>{const N=()=>h({});return document.addEventListener(Sn,N),()=>document.removeEventListener(Sn,N)},[]),o.jsx(K.div,{...d,ref:v,style:{pointerEvents:S?j?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,A.onFocusCapture),onBlurCapture:k(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,E.onPointerDownCapture)})});Ln.displayName=yi;var Ci="DismissableLayerBranch",Ni=a.forwardRef((e,t)=>{const n=a.useContext(lo),r=a.useRef(null),s=Z(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsx(K.div,{...e,ref:s})});Ni.displayName=Ci;function ji(e,t=globalThis?.document){const n=Me(e),r=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){uo(bi,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ei(e,t=globalThis?.document){const n=Me(e),r=a.useRef(!1);return a.useEffect(()=>{const s=i=>{i.target&&!r.current&&uo(Si,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function mr(){const e=new CustomEvent(Sn);document.dispatchEvent(e)}function uo(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Vr(s,i):s.dispatchEvent(i)}var fn=0;function fo(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hr()),document.body.insertAdjacentElement("beforeend",e[1]??hr()),fn++,()=>{fn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fn--}},[])}function hr(){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 pn="focusScope.autoFocusOnMount",mn="focusScope.autoFocusOnUnmount",gr={bubbles:!1,cancelable:!0},Ri="FocusScope",Fn=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...l}=e,[c,d]=a.useState(null),u=Me(s),p=Me(i),f=a.useRef(null),g=Z(t,m=>d(m)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(S){if(h.paused||!c)return;const j=S.target;c.contains(j)?f.current=j:ke(f.current,{select:!0})},x=function(S){if(h.paused||!c)return;const j=S.relatedTarget;j!==null&&(c.contains(j)||ke(f.current,{select:!0}))},y=function(S){if(document.activeElement===document.body)for(const E of S)E.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()}}},[r,c,h.paused]),a.useEffect(()=>{if(c){xr.add(h);const m=document.activeElement;if(!c.contains(m)){const y=new CustomEvent(pn,gr);c.addEventListener(pn,u),c.dispatchEvent(y),y.defaultPrevented||(Mi(ki(po(c)),{select:!0}),document.activeElement===m&&ke(c))}return()=>{c.removeEventListener(pn,u),setTimeout(()=>{const y=new CustomEvent(mn,gr);c.addEventListener(mn,p),c.dispatchEvent(y),y.defaultPrevented||ke(m??document.body,{select:!0}),c.removeEventListener(mn,p),xr.remove(h)},0)}}},[c,u,p,h]);const v=a.useCallback(m=>{if(!n&&!r||h.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(x&&y){const b=m.currentTarget,[S,j]=Pi(b);S&&j?!m.shiftKey&&y===j?(m.preventDefault(),n&&ke(S,{select:!0})):m.shiftKey&&y===S&&(m.preventDefault(),n&&ke(j,{select:!0})):y===b&&m.preventDefault()}},[n,r,h.paused]);return o.jsx(K.div,{tabIndex:-1,...l,ref:g,onKeyDown:v})});Fn.displayName=Ri;function Mi(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ke(r,{select:t}),document.activeElement!==n)return}function Pi(e){const t=po(e),n=vr(t,e),r=vr(t.reverse(),e);return[n,r]}function po(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vr(e,t){for(const n of e)if(!Ai(n,{upTo:t}))return n}function Ai(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 Ti(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&&Ti(e)&&t&&e.select()}}var xr=Ii();function Ii(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wr(e,t),e.unshift(t)},remove(t){e=wr(e,t),e[0]?.resume()}}}function wr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ki(e){return e.filter(t=>t.tagName!=="A")}const _i=["top","right","bottom","left"],De=Math.min,ue=Math.max,Bt=Math.round,Tt=Math.floor,Re=e=>({x:e,y:e}),Di={left:"right",right:"left",bottom:"top",top:"bottom"},Oi={start:"end",end:"start"};function Cn(e,t,n){return ue(e,De(t,n))}function Te(e,t){return typeof e=="function"?e(t):e}function Ie(e){return e.split("-")[0]}function tt(e){return e.split("-")[1]}function $n(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}const Li=new Set(["top","bottom"]);function Ee(e){return Li.has(Ie(e))?"y":"x"}function Vn(e){return $n(Ee(e))}function Fi(e,t,n){n===void 0&&(n=!1);const r=tt(e),s=Vn(e),i=Bn(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Vt(l)),[l,Vt(l)]}function $i(e){const t=Vt(e);return[Nn(e),t,Nn(t)]}function Nn(e){return e.replace(/start|end/g,t=>Oi[t])}const yr=["left","right"],br=["right","left"],Bi=["top","bottom"],Vi=["bottom","top"];function Ui(e,t,n){switch(e){case"top":case"bottom":return n?t?br:yr:t?yr:br;case"left":case"right":return t?Bi:Vi;default:return[]}}function Hi(e,t,n,r){const s=tt(e);let i=Ui(Ie(e),n==="start",r);return s&&(i=i.map(l=>l+"-"+s),t&&(i=i.concat(i.map(Nn)))),i}function Vt(e){return e.replace(/left|right|bottom|top/g,t=>Di[t])}function zi(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?zi(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Sr(e,t,n){let{reference:r,floating:s}=e;const i=Ee(t),l=Vn(t),c=Bn(l),d=Ie(t),u=i==="y",p=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,g=r[c]/2-s[c]/2;let h;switch(d){case"top":h={x:p,y:r.y-s.height};break;case"bottom":h={x:p,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-s.width,y:f};break;default:h={x:r.x,y:r.y}}switch(tt(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const Wi=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:f}=Sr(u,r,d),g=r,h={},v=0;for(let m=0;m<c.length;m++){const{name:x,fn:y}=c[m],{x:b,y:S,data:j,reset:E}=await y({x:p,y:f,initialPlacement:r,placement:g,strategy:s,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});p=b??p,f=S??f,h={...h,[x]:{...h[x],...j}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(u=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:p,y:f}=Sr(u,g,d)),m=-1)}return{x:p,y:f,placement:g,strategy:s,middlewareData:h}};async function gt(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:l,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:g=!1,padding:h=0}=Te(t,e),v=mo(h),x=c[g?f==="floating"?"reference":"floating":f],y=Ut(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:p,strategy:d})),b=f==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),j=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Ut(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:S,strategy:d}):b);return{top:(y.top-E.top+v.top)/j.y,bottom:(E.bottom-y.bottom+v.bottom)/j.y,left:(y.left-E.left+v.left)/j.x,right:(E.right-y.right+v.right)/j.x}}const Ki=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:l,elements:c,middlewareData:d}=t,{element:u,padding:p=0}=Te(e,t)||{};if(u==null)return{};const f=mo(p),g={x:n,y:r},h=Vn(s),v=Bn(h),m=await l.getDimensions(u),x=h==="y",y=x?"top":"left",b=x?"bottom":"right",S=x?"clientHeight":"clientWidth",j=i.reference[v]+i.reference[h]-g[h]-i.floating[v],E=g[h]-i.reference[h],A=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=A?A[S]:0;(!N||!await(l.isElement==null?void 0:l.isElement(A)))&&(N=c.floating[S]||i.floating[v]);const R=j/2-E/2,V=N/2-m[v]/2-1,_=De(f[y],V),U=De(f[b],V),F=_,$=N-m[v]-U,D=N/2-m[v]/2+R,G=Cn(F,D,$),O=!d.arrow&&tt(s)!=null&&D!==G&&i.reference[v]/2-(D<F?_:U)-m[v]/2<0,z=O?D<F?D-F:D-$:0;return{[h]:g[h]+z,data:{[h]:G,centerOffset:D-G-z,...O&&{alignmentOffset:z}},reset:O}}}),Gi=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,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}=Te(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ie(s),b=Ee(c),S=Ie(c)===c,j=await(d.isRTL==null?void 0:d.isRTL(u.floating)),E=g||(S||!m?[Vt(c)]:$i(c)),A=v!=="none";!g&&A&&E.push(...Hi(c,m,v,j));const N=[c,...E],R=await gt(t,x),V=[];let _=((r=i.flip)==null?void 0:r.overflows)||[];if(p&&V.push(R[y]),f){const D=Fi(s,l,j);V.push(R[D[0]],R[D[1]])}if(_=[..._,{placement:s,overflows:V}],!V.every(D=>D<=0)){var U,F;const D=(((U=i.flip)==null?void 0:U.index)||0)+1,G=N[D];if(G&&(!(f==="alignment"?b!==Ee(G):!1)||_.every(T=>Ee(T.placement)===b?T.overflows[0]>0:!0)))return{data:{index:D,overflows:_},reset:{placement:G}};let O=(F=_.filter(z=>z.overflows[0]<=0).sort((z,T)=>z.overflows[1]-T.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(h){case"bestFit":{var $;const z=($=_.filter(T=>{if(A){const M=Ee(T.placement);return M===b||M==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(M=>M>0).reduce((M,Q)=>M+Q,0)]).sort((T,M)=>T[1]-M[1])[0])==null?void 0:$[0];z&&(O=z);break}case"initialPlacement":O=c;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function Cr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Nr(e){return _i.some(t=>e[t]>=0)}const qi=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Te(e,t);switch(r){case"referenceHidden":{const i=await gt(t,{...s,elementContext:"reference"}),l=Cr(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Nr(l)}}}case"escaped":{const i=await gt(t,{...s,altBoundary:!0}),l=Cr(i,n.floating);return{data:{escapedOffsets:l,escaped:Nr(l)}}}default:return{}}}}},ho=new Set(["left","top"]);async function Yi(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=Ie(n),c=tt(n),d=Ee(n)==="y",u=ho.has(l)?-1:1,p=i&&d?-1:1,f=Te(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 Xi=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:l,middlewareData:c}=t,d=await Yi(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+d.x,y:i+d.y,data:{...d,placement:l}}}}},Zi=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...d}=Te(e,t),u={x:n,y:r},p=await gt(t,d),f=Ee(Ie(s)),g=$n(f);let h=u[g],v=u[f];if(i){const x=g==="y"?"top":"left",y=g==="y"?"bottom":"right",b=h+p[x],S=h-p[y];h=Cn(b,h,S)}if(l){const x=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=v+p[x],S=v-p[y];v=Cn(b,v,S)}const m=c.fn({...t,[g]:h,[f]:v});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[g]:i,[f]:l}}}}}},Qi=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:l}=t,{offset:c=0,mainAxis:d=!0,crossAxis:u=!0}=Te(e,t),p={x:n,y:r},f=Ee(s),g=$n(f);let h=p[g],v=p[f];const m=Te(c,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(d){const S=g==="y"?"height":"width",j=i.reference[g]-i.floating[S]+x.mainAxis,E=i.reference[g]+i.reference[S]-x.mainAxis;h<j?h=j:h>E&&(h=E)}if(u){var y,b;const S=g==="y"?"width":"height",j=ho.has(Ie(s)),E=i.reference[f]-i.floating[S]+(j&&((y=l.offset)==null?void 0:y[f])||0)+(j?0:x.crossAxis),A=i.reference[f]+i.reference[S]+(j?0:((b=l.offset)==null?void 0:b[f])||0)-(j?x.crossAxis:0);v<E?v=E:v>A&&(v=A)}return{[g]:h,[f]:v}}}},Ji=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:l,elements:c}=t,{apply:d=()=>{},...u}=Te(e,t),p=await gt(t,u),f=Ie(s),g=tt(s),h=Ee(s)==="y",{width:v,height:m}=i.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,S=v-p.left-p.right,j=De(m-p[x],b),E=De(v-p[y],S),A=!t.middlewareData.shift;let N=j,R=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=b),A&&!g){const _=ue(p.left,0),U=ue(p.right,0),F=ue(p.top,0),$=ue(p.bottom,0);h?R=v-2*(_!==0||U!==0?_+U:ue(p.left,p.right)):N=m-2*(F!==0||$!==0?F+$:ue(p.top,p.bottom))}await d({...t,availableWidth:R,availableHeight:N});const V=await l.getDimensions(c.floating);return v!==V.width||m!==V.height?{reset:{rects:!0}}:{}}}};function Xt(){return typeof window<"u"}function nt(e){return go(e)?(e.nodeName||"").toLowerCase():"#document"}function fe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(go(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function go(e){return Xt()?e instanceof Node||e instanceof fe(e).Node:!1}function be(e){return Xt()?e instanceof Element||e instanceof fe(e).Element:!1}function Pe(e){return Xt()?e instanceof HTMLElement||e instanceof fe(e).HTMLElement:!1}function jr(e){return!Xt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof fe(e).ShadowRoot}const ec=new Set(["inline","contents"]);function Ct(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ec.has(s)}const tc=new Set(["table","td","th"]);function nc(e){return tc.has(nt(e))}const rc=[":popover-open",":modal"];function Zt(e){return rc.some(t=>{try{return e.matches(t)}catch{return!1}})}const oc=["transform","translate","scale","rotate","perspective"],sc=["transform","translate","scale","rotate","perspective","filter"],ac=["paint","layout","strict","content"];function Un(e){const t=Hn(),n=be(e)?Se(e):e;return oc.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||sc.some(r=>(n.willChange||"").includes(r))||ac.some(r=>(n.contain||"").includes(r))}function ic(e){let t=Oe(e);for(;Pe(t)&&!Je(t);){if(Un(t))return t;if(Zt(t))return null;t=Oe(t)}return null}function Hn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cc=new Set(["html","body","#document"]);function Je(e){return cc.has(nt(e))}function Se(e){return fe(e).getComputedStyle(e)}function Qt(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Oe(e){if(nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jr(e)&&e.host||Ae(e);return jr(t)?t.host:t}function vo(e){const t=Oe(e);return Je(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&Ct(t)?t:vo(t)}function vt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=vo(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),l=fe(s);if(i){const c=jn(l);return t.concat(l,l.visualViewport||[],Ct(s)?s:[],c&&n?vt(c):[])}return t.concat(s,vt(s,[],n))}function jn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xo(e){const t=Se(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Pe(e),i=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=Bt(n)!==i||Bt(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function zn(e){return be(e)?e:e.contextElement}function Ze(e){const t=zn(e);if(!Pe(t))return Re(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=xo(t);let l=(i?Bt(n.width):n.width)/r,c=(i?Bt(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const lc=Re(0);function wo(e){const t=fe(e);return!Hn()||!t.visualViewport?lc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dc(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==fe(e)?!1:t}function Ve(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=zn(e);let l=Re(1);t&&(r?be(r)&&(l=Ze(r)):l=Ze(e));const c=dc(i,n,r)?wo(i):Re(0);let d=(s.left+c.x)/l.x,u=(s.top+c.y)/l.y,p=s.width/l.x,f=s.height/l.y;if(i){const g=fe(i),h=r&&be(r)?fe(r):r;let v=g,m=jn(v);for(;m&&r&&h!==v;){const x=Ze(m),y=m.getBoundingClientRect(),b=Se(m),S=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*x.x,j=y.top+(m.clientTop+parseFloat(b.paddingTop))*x.y;d*=x.x,u*=x.y,p*=x.x,f*=x.y,d+=S,u+=j,v=fe(m),m=jn(v)}}return Ut({width:p,height:f,x:d,y:u})}function Jt(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:Ve(Ae(e)).left+n}function yo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jt(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function uc(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",l=Ae(r),c=t?Zt(t.floating):!1;if(r===l||c&&i)return n;let d={scrollLeft:0,scrollTop:0},u=Re(1);const p=Re(0),f=Pe(r);if((f||!f&&!i)&&((nt(r)!=="body"||Ct(l))&&(d=Qt(r)),Pe(r))){const h=Ve(r);u=Ze(r),p.x=h.x+r.clientLeft,p.y=h.y+r.clientTop}const g=l&&!f&&!i?yo(l,d):Re(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 fc(e){return Array.from(e.getClientRects())}function pc(e){const t=Ae(e),n=Qt(e),r=e.ownerDocument.body,s=ue(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ue(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Jt(e);const c=-n.scrollTop;return Se(r).direction==="rtl"&&(l+=ue(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:l,y:c}}const Er=25;function mc(e,t){const n=fe(e),r=Ae(e),s=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,d=0;if(s){i=s.width,l=s.height;const p=Hn();(!p||p&&t==="fixed")&&(c=s.offsetLeft,d=s.offsetTop)}const u=Jt(r);if(u<=0){const p=r.ownerDocument,f=p.body,g=getComputedStyle(f),h=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-h);v<=Er&&(i-=v)}else u<=Er&&(i+=u);return{width:i,height:l,x:c,y:d}}const hc=new Set(["absolute","fixed"]);function gc(e,t){const n=Ve(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=Pe(e)?Ze(e):Re(1),l=e.clientWidth*i.x,c=e.clientHeight*i.y,d=s*i.x,u=r*i.y;return{width:l,height:c,x:d,y:u}}function Rr(e,t,n){let r;if(t==="viewport")r=mc(e,n);else if(t==="document")r=pc(Ae(e));else if(be(t))r=gc(t,n);else{const s=wo(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Ut(r)}function bo(e,t){const n=Oe(e);return n===t||!be(n)||Je(n)?!1:Se(n).position==="fixed"||bo(n,t)}function vc(e,t){const n=t.get(e);if(n)return n;let r=vt(e,[],!1).filter(c=>be(c)&&nt(c)!=="body"),s=null;const i=Se(e).position==="fixed";let l=i?Oe(e):e;for(;be(l)&&!Je(l);){const c=Se(l),d=Un(l);!d&&c.position==="fixed"&&(s=null),(i?!d&&!s:!d&&c.position==="static"&&!!s&&hc.has(s.position)||Ct(l)&&!d&&bo(e,l))?r=r.filter(p=>p!==l):s=c,l=Oe(l)}return t.set(e,r),r}function xc(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Zt(t)?[]:vc(t,this._c):[].concat(n),r],c=l[0],d=l.reduce((u,p)=>{const f=Rr(t,p,s);return u.top=ue(f.top,u.top),u.right=De(f.right,u.right),u.bottom=De(f.bottom,u.bottom),u.left=ue(f.left,u.left),u},Rr(t,c,s));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function wc(e){const{width:t,height:n}=xo(e);return{width:t,height:n}}function yc(e,t,n){const r=Pe(t),s=Ae(t),i=n==="fixed",l=Ve(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=Re(0);function u(){d.x=Jt(s)}if(r||!r&&!i)if((nt(t)!=="body"||Ct(s))&&(c=Qt(t)),r){const h=Ve(t,!0,i,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else s&&u();i&&!r&&s&&u();const p=s&&!r&&!i?yo(s,c):Re(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 hn(e){return Se(e).position==="static"}function Mr(e,t){if(!Pe(e)||Se(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ae(e)===n&&(n=n.ownerDocument.body),n}function So(e,t){const n=fe(e);if(Zt(e))return n;if(!Pe(e)){let s=Oe(e);for(;s&&!Je(s);){if(be(s)&&!hn(s))return s;s=Oe(s)}return n}let r=Mr(e,t);for(;r&&nc(r)&&hn(r);)r=Mr(r,t);return r&&Je(r)&&hn(r)&&!Un(r)?n:r||ic(e)||n}const bc=async function(e){const t=this.getOffsetParent||So,n=this.getDimensions,r=await n(e.floating);return{reference:yc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sc(e){return Se(e).direction==="rtl"}const Cc={convertOffsetParentRelativeRectToViewportRelativeRect:uc,getDocumentElement:Ae,getClippingRect:xc,getOffsetParent:So,getElementRects:bc,getClientRects:fc,getDimensions:wc,getScale:Ze,isElement:be,isRTL:Sc};function Co(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nc(e,t){let n=null,r;const s=Ae(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const u=e.getBoundingClientRect(),{left:p,top:f,width:g,height:h}=u;if(c||t(),!g||!h)return;const v=Tt(f),m=Tt(s.clientWidth-(p+g)),x=Tt(s.clientHeight-(f+h)),y=Tt(p),S={rootMargin:-v+"px "+-m+"px "+-x+"px "+-y+"px",threshold:ue(0,De(1,d))||1};let j=!0;function E(A){const N=A[0].intersectionRatio;if(N!==d){if(!j)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!Co(u,e.getBoundingClientRect())&&l(),j=!1}try{n=new IntersectionObserver(E,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,S)}n.observe(e)}return l(!0),i}function jc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,u=zn(e),p=s||i?[...u?vt(u):[],...vt(t)]:[];p.forEach(y=>{s&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&c?Nc(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 S;(S=h)==null||S.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&&!Co(m,y)&&n(),m=y,v=requestAnimationFrame(x)}return n(),()=>{var y;p.forEach(b=>{s&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f?.(),(y=h)==null||y.disconnect(),h=null,d&&cancelAnimationFrame(v)}}const Ec=Xi,Rc=Zi,Mc=Gi,Pc=Ji,Ac=qi,Pr=Ki,Tc=Qi,Ic=(e,t,n)=>{const r=new Map,s={platform:Cc,...n},i={...s.platform,_c:r};return Wi(e,t,{...s,platform:i})};var kc=typeof document<"u",_c=function(){},Ot=kc?a.useLayoutEffect:_c;function Ht(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,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ht(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Ht(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function No(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ar(e,t){const n=No(e);return Math.round(t*n)/n}function gn(e){const t=a.useRef(e);return Ot(()=>{t.current=e}),t}function Dc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:l}={},transform:c=!0,whileElementsMounted:d,open:u}=e,[p,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,h]=a.useState(r);Ht(g,r)||h(r);const[v,m]=a.useState(null),[x,y]=a.useState(null),b=a.useCallback(T=>{T!==A.current&&(A.current=T,m(T))},[]),S=a.useCallback(T=>{T!==N.current&&(N.current=T,y(T))},[]),j=i||v,E=l||x,A=a.useRef(null),N=a.useRef(null),R=a.useRef(p),V=d!=null,_=gn(d),U=gn(s),F=gn(u),$=a.useCallback(()=>{if(!A.current||!N.current)return;const T={placement:t,strategy:n,middleware:g};U.current&&(T.platform=U.current),Ic(A.current,N.current,T).then(M=>{const Q={...M,isPositioned:F.current!==!1};D.current&&!Ht(R.current,Q)&&(R.current=Q,bt.flushSync(()=>{f(Q)}))})},[g,t,n,U,F]);Ot(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[u]);const D=a.useRef(!1);Ot(()=>(D.current=!0,()=>{D.current=!1}),[]),Ot(()=>{if(j&&(A.current=j),E&&(N.current=E),j&&E){if(_.current)return _.current(j,E,$);$()}},[j,E,$,_,V]);const G=a.useMemo(()=>({reference:A,floating:N,setReference:b,setFloating:S}),[b,S]),O=a.useMemo(()=>({reference:j,floating:E}),[j,E]),z=a.useMemo(()=>{const T={position:n,left:0,top:0};if(!O.floating)return T;const M=Ar(O.floating,p.x),Q=Ar(O.floating,p.y);return c?{...T,transform:"translate("+M+"px, "+Q+"px)",...No(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:Q}},[n,c,O.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:$,refs:G,elements:O,floatingStyles:z}),[p,$,G,O,z])}const Oc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Pr({element:r.current,padding:s}).fn(n):{}:r?Pr({element:r,padding:s}).fn(n):{}}}},Lc=(e,t)=>({...Ec(e),options:[e,t]}),Fc=(e,t)=>({...Rc(e),options:[e,t]}),$c=(e,t)=>({...Tc(e),options:[e,t]}),Bc=(e,t)=>({...Mc(e),options:[e,t]}),Vc=(e,t)=>({...Pc(e),options:[e,t]}),Uc=(e,t)=>({...Ac(e),options:[e,t]}),Hc=(e,t)=>({...Oc(e),options:[e,t]});var zc="Arrow",jo=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsx(K.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});jo.displayName=zc;var Wc=jo;function Kc(e){const[t,n]=a.useState(void 0);return oe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let l,c;if("borderBoxSize"in i){const d=i.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 r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Wn="Popper",[Eo,en]=Le(Wn),[Gc,Ro]=Eo(Wn),Mo=e=>{const{__scopePopper:t,children:n}=e,[r,s]=a.useState(null);return o.jsx(Gc,{scope:t,anchor:r,onAnchorChange:s,children:n})};Mo.displayName=Wn;var Po="PopperAnchor",Ao=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=Ro(Po,n),l=a.useRef(null),c=Z(t,l),d=a.useRef(null);return a.useEffect(()=>{const u=d.current;d.current=r?.current||l.current,u!==d.current&&i.onAnchorChange(d.current)}),r?null:o.jsx(K.div,{...s,ref:c})});Ao.displayName=Po;var Kn="PopperContent",[qc,Yc]=Eo(Kn),To=a.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="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=Ro(Kn,n),[y,b]=a.useState(null),S=Z(t,P=>b(P)),[j,E]=a.useState(null),A=Kc(j),N=A?.width??0,R=A?.height??0,V=r+(i!=="center"?"-"+i:""),_=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},U=Array.isArray(u)?u:[u],F=U.length>0,$={padding:_,boundary:U.filter(Zc),altBoundary:F},{refs:D,floatingStyles:G,placement:O,isPositioned:z,middlewareData:T}=Dc({strategy:"fixed",placement:V,whileElementsMounted:(...P)=>jc(...P,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[Lc({mainAxis:s+R,alignmentAxis:l}),d&&Fc({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?$c():void 0,...$}),d&&Bc({...$}),Vc({...$,apply:({elements:P,rects:W,availableWidth:ee,availableHeight:H})=>{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",`${H}px`),ne.setProperty("--radix-popper-anchor-width",`${Y}px`),ne.setProperty("--radix-popper-anchor-height",`${X}px`)}}),j&&Hc({element:j,padding:c}),Qc({arrowWidth:N,arrowHeight:R}),g&&Uc({strategy:"referenceHidden",...$})]}),[M,Q]=_o(O),te=Me(v);oe(()=>{z&&te?.()},[z,te]);const J=T.arrow?.x,ge=T.arrow?.y,ie=T.arrow?.centerOffset!==0,[ve,q]=a.useState();return oe(()=>{y&&q(window.getComputedStyle(y).zIndex)},[y]),o.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:z?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[T.transformOrigin?.x,T.transformOrigin?.y].join(" "),...T.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(qc,{scope:n,placedSide:M,onArrowChange:E,arrowX:J,arrowY:ge,shouldHideArrow:ie,children:o.jsx(K.div,{"data-side":M,"data-align":Q,...m,ref:S,style:{...m.style,animation:z?void 0:"none"}})})})});To.displayName=Kn;var Io="PopperArrow",Xc={top:"bottom",right:"left",bottom:"top",left:"right"},ko=a.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=Yc(Io,r),l=Xc[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(Wc,{...s,ref:n,style:{...s.style,display:"block"}})})});ko.displayName=Io;function Zc(e){return e!==null}var Qc=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[u,p]=_o(n),f={start:"0%",center:"50%",end:"100%"}[p],g=(s.arrow?.x??0)+c/2,h=(s.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=`${r.floating.height+d}px`):u==="right"?(v=`${-d}px`,m=l?f:`${h}px`):u==="left"&&(v=`${r.floating.width+d}px`,m=l?f:`${h}px`),{data:{x:v,y:m}}}});function _o(e){const[t,n="center"]=e.split("-");return[t,n]}var Do=Mo,Oo=Ao,Lo=To,Fo=ko,Jc="Portal",Gn=a.forwardRef((e,t)=>{const{container:n,...r}=e,[s,i]=a.useState(!1);oe(()=>i(!0),[]);const l=n||s&&globalThis?.document?.body;return l?La.createPortal(o.jsx(K.div,{...r,ref:t}),l):null});Gn.displayName=Jc;function el(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $o=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"}),tl="VisuallyHidden",nl=a.forwardRef((e,t)=>o.jsx(K.span,{...e,ref:t,style:{...$o,...e.style}}));nl.displayName=tl;var rl=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qe=new WeakMap,It=new WeakMap,kt={},vn=0,Bo=function(e){return e&&(e.host||Bo(e.parentNode))},ol=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Bo(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},sl=function(e,t,n,r){var s=ol(t,Array.isArray(e)?e:[e]);kt[n]||(kt[n]=new WeakMap);var i=kt[n],l=[],c=new Set,d=new Set(s),u=function(f){!f||c.has(f)||(c.add(f),u(f.parentNode))};s.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(r),v=h!==null&&h!=="false",m=(qe.get(g)||0)+1,x=(i.get(g)||0)+1;qe.set(g,m),i.set(g,x),l.push(g),m===1&&v&&It.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",g,y)}})};return p(t),c.clear(),vn++,function(){l.forEach(function(f){var g=qe.get(f)-1,h=i.get(f)-1;qe.set(f,g),i.set(f,h),g||(It.has(f)||f.removeAttribute(r),It.delete(f)),h||f.removeAttribute(n)}),vn--,vn||(qe=new WeakMap,qe=new WeakMap,It=new WeakMap,kt={})}},Vo=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=rl(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),sl(r,s,n,"aria-hidden")):function(){return null}},je=function(){return je=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},je.apply(this,arguments)};function Uo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function al(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Lt="right-scroll-bar-position",Ft="width-before-scroll-bar",il="with-scroll-bars-hidden",cl="--removed-body-scroll-bar-size";function xn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ll(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var dl=typeof window<"u"?a.useLayoutEffect:a.useEffect,Tr=new WeakMap;function ul(e,t){var n=ll(null,function(r){return e.forEach(function(s){return xn(s,r)})});return dl(function(){var r=Tr.get(n);if(r){var s=new Set(r),i=new Set(e),l=n.current;s.forEach(function(c){i.has(c)||xn(c,null)}),i.forEach(function(c){s.has(c)||xn(c,l)})}Tr.set(n,e)},[e]),n}function fl(e){return e}function pl(e,t){t===void 0&&(t=fl);var n=[],r=!1,s={read:function(){if(r)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(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(i),l=n}var d=function(){var p=l;l=[],p.forEach(i)},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 s}function ml(e){e===void 0&&(e={});var t=pl(null);return t.options=je({async:!0,ssr:!1},e),t}var Ho=function(e){var t=e.sideCar,n=Uo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,je({},n))};Ho.isSideCarExport=!0;function hl(e,t){return e.useMedium(t),Ho}var zo=ml(),wn=function(){},tn=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:wn,onWheelCapture:wn,onTouchMoveCapture:wn}),s=r[0],i=r[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,S=e.gapMode,j=Uo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,A=ul([n,t]),N=je(je({},j),s);return a.createElement(a.Fragment,null,p&&a.createElement(E,{sideCar:zo,removeScrollBar:u,shards:f,noRelative:h,noIsolation:v,inert:m,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:S}),l?a.cloneElement(a.Children.only(c),je(je({},N),{ref:A})):a.createElement(b,je({},N,{className:d,ref:A}),c))});tn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tn.classNames={fullWidth:Ft,zeroRight:Lt};var gl=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vl(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gl();return t&&e.setAttribute("nonce",t),e}function xl(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wl(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yl=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vl())&&(xl(t,n),wl(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bl=function(){var e=yl();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Wo=function(){var e=bl(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},Sl={left:0,top:0,right:0,gap:0},yn=function(e){return parseInt(e||"",10)||0},Cl=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[yn(n),yn(r),yn(s)]},Nl=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Sl;var t=Cl(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jl=Wo(),Qe="data-scroll-locked",El=function(e,t,n,r){var s=e.left,i=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
.`.concat(il,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(c,"px ").concat(r,`;
}
body[`).concat(Qe,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(s,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(l,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(c,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Lt,` {
right: `).concat(c,"px ").concat(r,`;
}
.`).concat(Ft,` {
margin-right: `).concat(c,"px ").concat(r,`;
}
.`).concat(Lt," .").concat(Lt,` {
right: 0 `).concat(r,`;
}
.`).concat(Ft," .").concat(Ft,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(Qe,`] {
`).concat(cl,": ").concat(c,`px;
}
`)},Ir=function(){var e=parseInt(document.body.getAttribute(Qe)||"0",10);return isFinite(e)?e:0},Rl=function(){a.useEffect(function(){return document.body.setAttribute(Qe,(Ir()+1).toString()),function(){var e=Ir()-1;e<=0?document.body.removeAttribute(Qe):document.body.setAttribute(Qe,e.toString())}},[])},Ml=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;Rl();var i=a.useMemo(function(){return Nl(s)},[s]);return a.createElement(jl,{styles:El(i,!t,s,n?"":"!important")})},En=!1;if(typeof window<"u")try{var _t=Object.defineProperty({},"passive",{get:function(){return En=!0,!0}});window.addEventListener("test",_t,_t),window.removeEventListener("test",_t,_t)}catch{En=!1}var Ye=En?{passive:!1}:!1,Pl=function(e){return e.tagName==="TEXTAREA"},Ko=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Pl(e)&&n[t]==="visible")},Al=function(e){return Ko(e,"overflowY")},Tl=function(e){return Ko(e,"overflowX")},kr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Go(e,r);if(s){var i=qo(e,r),l=i[1],c=i[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Il=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},kl=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Go=function(e,t){return e==="v"?Al(t):Tl(t)},qo=function(e,t){return e==="v"?Il(t):kl(t)},_l=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dl=function(e,t,n,r,s){var i=_l(e,window.getComputedStyle(t).direction),l=i*r,c=n.target,d=t.contains(c),u=!1,p=l>0,f=0,g=0;do{if(!c)break;var h=qo(e,c),v=h[0],m=h[1],x=h[2],y=m-x-i*v;(v||y)&&Go(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},Dt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_r=function(e){return[e.deltaX,e.deltaY]},Dr=function(e){return e&&"current"in e?e.current:e},Ol=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ll=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Fl=0,Xe=[];function $l(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),s=a.useState(Fl++)[0],i=a.useState(Wo)[0],l=a.useRef(e);a.useEffect(function(){l.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=al([e.lockRef.current],(e.shards||[]).map(Dr),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!l.current.allowPinchZoom;var y=Dt(m),b=n.current,S="deltaX"in m?m.deltaX:b[0]-y[0],j="deltaY"in m?m.deltaY:b[1]-y[1],E,A=m.target,N=Math.abs(S)>Math.abs(j)?"h":"v";if("touches"in m&&N==="h"&&A.type==="range")return!1;var R=kr(N,A);if(!R)return!0;if(R?E=N:(E=N==="v"?"h":"v",R=kr(N,A)),!R)return!1;if(!r.current&&"changedTouches"in m&&(S||j)&&(r.current=E),!E)return!0;var V=r.current||E;return Dl(V,x,m,V==="h"?S:j)},[]),d=a.useCallback(function(m){var x=m;if(!(!Xe.length||Xe[Xe.length-1]!==i)){var y="deltaY"in x?_r(x):Dt(x),b=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&Ol(E.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var S=(l.current.shards||[]).map(Dr).filter(Boolean).filter(function(E){return E.contains(x.target)}),j=S.length>0?c(x,S[0]):!l.current.noIsolation;j&&x.cancelable&&x.preventDefault()}}},[]),u=a.useCallback(function(m,x,y,b){var S={name:m,delta:x,target:y,should:b,shadowParent:Bl(y)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(j){return j!==S})},1)},[]),p=a.useCallback(function(m){n.current=Dt(m),r.current=void 0},[]),f=a.useCallback(function(m){u(m.type,_r(m),m.target,c(m,e.lockRef.current))},[]),g=a.useCallback(function(m){u(m.type,Dt(m),m.target,c(m,e.lockRef.current))},[]);a.useEffect(function(){return Xe.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ye),document.addEventListener("touchmove",d,Ye),document.addEventListener("touchstart",p,Ye),function(){Xe=Xe.filter(function(m){return m!==i}),document.removeEventListener("wheel",d,Ye),document.removeEventListener("touchmove",d,Ye),document.removeEventListener("touchstart",p,Ye)}},[]);var h=e.removeScrollBar,v=e.inert;return a.createElement(a.Fragment,null,v?a.createElement(i,{styles:Ll(s)}):null,h?a.createElement(Ml,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Bl(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Vl=hl(zo,$l);var qn=a.forwardRef(function(e,t){return a.createElement(tn,je({},e,{ref:t,sideCar:Vl}))});qn.classNames=tn.classNames;var Ul=[" ","Enter","ArrowUp","ArrowDown"],Hl=[" ","Enter"],Ue="Select",[nn,rn,zl]=kn(Ue),[rt,Pf]=Le(Ue,[zl,en]),on=en(),[Wl,Fe]=rt(Ue),[Kl,Gl]=rt(Ue),Yo=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:g,required:h,form:v}=e,m=on(t),[x,y]=a.useState(null),[b,S]=a.useState(null),[j,E]=a.useState(!1),A=Gt(u),[N,R]=ht({prop:r,defaultProp:s??!1,onChange:i,caller:Ue}),[V,_]=ht({prop:l,defaultProp:c,onChange:d,caller:Ue}),U=a.useRef(null),F=x?v||!!x.closest("form"):!0,[$,D]=a.useState(new Set),G=Array.from($).map(O=>O.props.value).join(";");return o.jsx(Do,{...m,children:o.jsxs(Wl,{required:h,scope:t,trigger:x,onTriggerChange:y,valueNode:b,onValueNodeChange:S,valueNodeHasChildren:j,onValueNodeHasChildrenChange:E,contentId:Be(),value:V,onValueChange:_,open:N,onOpenChange:R,dir:A,triggerPointerDownPosRef:U,disabled:g,children:[o.jsx(nn.Provider,{scope:t,children:o.jsx(Kl,{scope:e.__scopeSelect,onNativeOptionAdd:a.useCallback(O=>{D(z=>new Set(z).add(O))},[]),onNativeOptionRemove:a.useCallback(O=>{D(z=>{const T=new Set(z);return T.delete(O),T})},[]),children:n})}),F?o.jsxs(vs,{"aria-hidden":!0,required:h,tabIndex:-1,name:p,autoComplete:f,value:V,onChange:O=>_(O.target.value),disabled:g,form:v,children:[V===void 0?o.jsx("option",{value:""}):null,Array.from($)]},G):null]})})};Yo.displayName=Ue;var Xo="SelectTrigger",Zo=a.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=on(n),l=Fe(Xo,n),c=l.disabled||r,d=Z(t,l.onTriggerChange),u=rn(n),p=a.useRef("touch"),[f,g,h]=ws(m=>{const x=u().filter(S=>!S.disabled),y=x.find(S=>S.value===l.value),b=ys(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 o.jsx(Oo,{asChild:!0,...i,children:o.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":xs(l.value)?"":void 0,...s,ref:d,onClick:k(s.onClick,m=>{m.currentTarget.focus(),p.current!=="mouse"&&v(m)}),onPointerDown:k(s.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:k(s.onKeyDown,m=>{const x=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&g(m.key),!(x&&m.key===" ")&&Ul.includes(m.key)&&(v(),m.preventDefault())})})})});Zo.displayName=Xo;var Qo="SelectValue",Jo=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:l="",...c}=e,d=Fe(Qo,n),{onValueNodeHasChildrenChange:u}=d,p=i!==void 0,f=Z(t,d.onValueNodeChange);return oe(()=>{u(p)},[u,p]),o.jsx(K.span,{...c,ref:f,style:{pointerEvents:"none"},children:xs(d.value)?o.jsx(o.Fragment,{children:l}):i})});Jo.displayName=Qo;var ql="SelectIcon",es=a.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(K.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});es.displayName=ql;var Yl="SelectPortal",ts=e=>o.jsx(Gn,{asChild:!0,...e});ts.displayName=Yl;var He="SelectContent",ns=a.forwardRef((e,t)=>{const n=Fe(He,e.__scopeSelect),[r,s]=a.useState();if(oe(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?bt.createPortal(o.jsx(rs,{scope:e.__scopeSelect,children:o.jsx(nn.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),i):null}return o.jsx(os,{...e,ref:t})});ns.displayName=He;var we=10,[rs,$e]=rt(He),Xl="SelectContentImpl",Zl=mt("SelectContent.RemoveScroll"),os=a.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,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=Fe(He,n),[S,j]=a.useState(null),[E,A]=a.useState(null),N=Z(t,P=>j(P)),[R,V]=a.useState(null),[_,U]=a.useState(null),F=rn(n),[$,D]=a.useState(!1),G=a.useRef(!1);a.useEffect(()=>{if(S)return Vo(S)},[S]),fo();const O=a.useCallback(P=>{const[W,...ee]=F().map(X=>X.ref.current),[H]=ee.slice(-1),Y=document.activeElement;for(const X of P)if(X===Y||(X?.scrollIntoView({block:"nearest"}),X===W&&E&&(E.scrollTop=0),X===H&&E&&(E.scrollTop=E.scrollHeight),X?.focus(),document.activeElement!==Y))return},[F,E]),z=a.useCallback(()=>O([R,S]),[O,R,S]);a.useEffect(()=>{$&&z()},[$,z]);const{onOpenChange:T,triggerPointerDownPosRef:M}=b;a.useEffect(()=>{if(S){let P={x:0,y:0};const W=H=>{P={x:Math.abs(Math.round(H.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(M.current?.y??0))}},ee=H=>{P.x<=10&&P.y<=10?H.preventDefault():S.contains(H.target)||T(!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})}}},[S,T,M]),a.useEffect(()=>{const P=()=>T(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[T]);const[Q,te]=ws(P=>{const W=F().filter(Y=>!Y.disabled),ee=W.find(Y=>Y.ref.current===document.activeElement),H=ys(W,P,ee);H&&setTimeout(()=>H.ref.current.focus())}),J=a.useCallback((P,W,ee)=>{const H=!G.current&&!ee;(b.value!==void 0&&b.value===W||H)&&(V(P),H&&(G.current=!0))},[b.value]),ge=a.useCallback(()=>S?.focus(),[S]),ie=a.useCallback((P,W,ee)=>{const H=!G.current&&!ee;(b.value!==void 0&&b.value===W||H)&&U(P)},[b.value]),ve=r==="popper"?Rn:ss,q=ve===Rn?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:g,collisionPadding:h,sticky:v,hideWhenDetached:m,avoidCollisions:x}:{};return o.jsx(rs,{scope:n,content:S,viewport:E,onViewportChange:A,itemRefCallback:J,selectedItem:R,onItemLeave:ge,itemTextRefCallback:ie,focusSelectedItem:z,selectedItemText:_,position:r,isPositioned:$,searchRef:Q,children:o.jsx(qn,{as:Zl,allowPinchZoom:!0,children:o.jsx(Fn,{asChild:!0,trapped:b.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:k(s,P=>{b.trigger?.focus({preventScroll:!0}),P.preventDefault()}),children:o.jsx(Ln,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:o.jsx(ve,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:P=>P.preventDefault(),...y,...q,onPlaced:()=>D(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:k(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 H=F().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(P.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const Y=P.target,X=H.indexOf(Y);H=H.slice(X+1)}setTimeout(()=>O(H)),P.preventDefault()}})})})})})})});os.displayName=Xl;var Ql="SelectItemAlignedPosition",ss=a.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Fe(He,n),l=$e(He,n),[c,d]=a.useState(null),[u,p]=a.useState(null),f=Z(t,N=>p(N)),g=rn(n),h=a.useRef(!1),v=a.useRef(!0),{viewport:m,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,S=a.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&m&&x&&y){const N=i.trigger.getBoundingClientRect(),R=u.getBoundingClientRect(),V=i.valueNode.getBoundingClientRect(),_=y.getBoundingClientRect();if(i.dir!=="rtl"){const Y=_.left-R.left,X=V.left-Y,ne=N.left-X,pe=N.width+ne,Ce=Math.max(pe,R.width),ot=window.innerWidth-we,st=fr(X,[we,Math.max(we,ot-Ce)]);c.style.minWidth=pe+"px",c.style.left=st+"px"}else{const Y=R.right-_.right,X=window.innerWidth-V.right-Y,ne=window.innerWidth-N.right-X,pe=N.width+ne,Ce=Math.max(pe,R.width),ot=window.innerWidth-we,st=fr(X,[we,Math.max(we,ot-Ce)]);c.style.minWidth=pe+"px",c.style.right=st+"px"}const U=g(),F=window.innerHeight-we*2,$=m.scrollHeight,D=window.getComputedStyle(u),G=parseInt(D.borderTopWidth,10),O=parseInt(D.paddingTop,10),z=parseInt(D.borderBottomWidth,10),T=parseInt(D.paddingBottom,10),M=G+O+$+T+z,Q=Math.min(x.offsetHeight*5,M),te=window.getComputedStyle(m),J=parseInt(te.paddingTop,10),ge=parseInt(te.paddingBottom,10),ie=N.top+N.height/2-we,ve=F-ie,q=x.offsetHeight/2,P=x.offsetTop+q,W=G+O+P,ee=M-W;if(W<=ie){const Y=U.length>0&&x===U[U.length-1].ref.current;c.style.bottom="0px";const X=u.clientHeight-m.offsetTop-m.offsetHeight,ne=Math.max(ve,q+(Y?ge:0)+X+z),pe=W+ne;c.style.height=pe+"px"}else{const Y=U.length>0&&x===U[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=`${we}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=F+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,c,u,m,x,y,i.dir,r]);oe(()=>S(),[S]);const[j,E]=a.useState();oe(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const A=a.useCallback(N=>{N&&v.current===!0&&(S(),b?.(),v.current=!1)},[S,b]);return o.jsx(ed,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:o.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:o.jsx(K.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});ss.displayName=Ql;var Jl="SelectPopperPosition",Rn=a.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=we,...i}=e,l=on(n);return o.jsx(Lo,{...l,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.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)"}})});Rn.displayName=Jl;var[ed,Yn]=rt(He,{}),Mn="SelectViewport",as=a.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=$e(Mn,n),l=Yn(Mn,n),c=Z(t,i.onViewportChange),d=a.useRef(0);return o.jsxs(o.Fragment,{children:[o.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:r}),o.jsx(nn.Slot,{scope:n,children:o.jsx(K.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:k(s.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-we*2,m=parseFloat(f.style.minHeight),x=parseFloat(f.style.height),y=Math.max(m,x);if(y<v){const b=y+h,S=Math.min(v,b),j=b-S;f.style.height=S+"px",f.style.bottom==="0px"&&(p.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});as.displayName=Mn;var is="SelectGroup",[td,nd]=rt(is),rd=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Be();return o.jsx(td,{scope:n,id:s,children:o.jsx(K.div,{role:"group","aria-labelledby":s,...r,ref:t})})});rd.displayName=is;var cs="SelectLabel",od=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=nd(cs,n);return o.jsx(K.div,{id:s.id,...r,ref:t})});od.displayName=cs;var zt="SelectItem",[sd,ls]=rt(zt),ds=a.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...l}=e,c=Fe(zt,n),d=$e(zt,n),u=c.value===r,[p,f]=a.useState(i??""),[g,h]=a.useState(!1),v=Z(t,b=>d.itemRefCallback?.(b,r,s)),m=Be(),x=a.useRef("touch"),y=()=>{s||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")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 o.jsx(sd,{scope:n,value:r,disabled:s,textId:m,isSelected:u,onItemTextChange:a.useCallback(b=>{f(S=>S||(b?.textContent??"").trim())},[]),children:o.jsx(nn.ItemSlot,{scope:n,value:r,disabled:s,textValue:p,children:o.jsx(K.div,{role:"option","aria-labelledby":m,"data-highlighted":g?"":void 0,"aria-selected":u&&g,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:v,onFocus:k(l.onFocus,()=>h(!0)),onBlur:k(l.onBlur,()=>h(!1)),onClick:k(l.onClick,()=>{x.current!=="mouse"&&y()}),onPointerUp:k(l.onPointerUp,()=>{x.current==="mouse"&&y()}),onPointerDown:k(l.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:k(l.onPointerMove,b=>{x.current=b.pointerType,s?d.onItemLeave?.():x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:k(l.onPointerLeave,b=>{b.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:k(l.onKeyDown,b=>{d.searchRef?.current!==""&&b.key===" "||(Hl.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})})})})});ds.displayName=zt;var ct="SelectItemText",us=a.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,l=Fe(ct,n),c=$e(ct,n),d=ls(ct,n),u=Gl(ct,n),[p,f]=a.useState(null),g=Z(t,y=>f(y),d.onItemTextChange,y=>c.itemTextRefCallback?.(y,d.value,d.disabled)),h=p?.textContent,v=a.useMemo(()=>o.jsx("option",{value:d.value,disabled:d.disabled,children:h},d.value),[d.disabled,d.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:x}=u;return oe(()=>(m(v),()=>x(v)),[m,x,v]),o.jsxs(o.Fragment,{children:[o.jsx(K.span,{id:d.textId,...i,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?bt.createPortal(i.children,l.valueNode):null]})});us.displayName=ct;var fs="SelectItemIndicator",ps=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ls(fs,n).isSelected?o.jsx(K.span,{"aria-hidden":!0,...r,ref:t}):null});ps.displayName=fs;var Pn="SelectScrollUpButton",ms=a.forwardRef((e,t)=>{const n=$e(Pn,e.__scopeSelect),r=Yn(Pn,e.__scopeSelect),[s,i]=a.useState(!1),l=Z(t,r.onScrollButtonChange);return oe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollTop>0;i(u)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(gs,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});ms.displayName=Pn;var An="SelectScrollDownButton",hs=a.forwardRef((e,t)=>{const n=$e(An,e.__scopeSelect),r=Yn(An,e.__scopeSelect),[s,i]=a.useState(!1),l=Z(t,r.onScrollButtonChange);return oe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)<u;i(p)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?o.jsx(gs,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});hs.displayName=An;var gs=a.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=$e("SelectScrollButton",n),l=a.useRef(null),c=rn(n),d=a.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),oe(()=>{c().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),o.jsx(K.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:k(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:k(s.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:k(s.onPointerLeave,()=>{d()})})}),ad="SelectSeparator",id=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(K.div,{"aria-hidden":!0,...r,ref:t})});id.displayName=ad;var Tn="SelectArrow",cd=a.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=on(n),i=Fe(Tn,n),l=$e(Tn,n);return i.open&&l.position==="popper"?o.jsx(Fo,{...s,...r,ref:t}):null});cd.displayName=Tn;var ld="SelectBubbleInput",vs=a.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=a.useRef(null),i=Z(r,s),l=el(t);return a.useEffect(()=>{const c=s.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]),o.jsx(K.select,{...n,style:{...$o,...n.style},ref:i,defaultValue:t})});vs.displayName=ld;function xs(e){return e===""||e===void 0}function ws(e){const t=Me(e),n=a.useRef(""),r=a.useRef(0),s=a.useCallback(l=>{const c=n.current+l;t(c),(function d(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=a.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function ys(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=dd(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function dd(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ud=Yo,fd=Zo,pd=Jo,md=es,hd=ts,gd=ns,vd=as,xd=ds,wd=us,yd=ps,bd=ms,Sd=hs;/**
* @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("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 Nd=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 jd=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 bs=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 Xn=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 Ss=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 Cs=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 Ed=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 Rd=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 Or=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 Md=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 Pd=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @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 Ad=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 Td=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 Id=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 kd=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 lt({...e}){return o.jsx(ud,{"data-slot":"select",...e})}function dt({...e}){return o.jsx(pd,{"data-slot":"select-value",...e})}function ut({className:e,size:t="default",children:n,...r}){return o.jsxs(fd,{"data-slot":"select-trigger","data-size":t,className:B("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),...r,children:[n,o.jsx(md,{asChild:!0,children:o.jsx(Xn,{className:"size-4 opacity-70"})})]})}function ft({className:e,children:t,position:n="popper",...r}){return o.jsx(hd,{children:o.jsxs(gd,{"data-slot":"select-content",className:B("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,...r,children:[o.jsx(_d,{}),o.jsx(vd,{className:B("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(Dd,{})]})})}function _e({className:e,children:t,...n}){return o.jsxs(xd,{"data-slot":"select-item",className:B("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:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(yd,{children:o.jsx(bs,{className:"size-4"})})}),o.jsx(wd,{children:t})]})}function _d({className:e,...t}){return o.jsx(bd,{"data-slot":"select-scroll-up-button",className:B("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Cs,{className:"size-4"})})}function Dd({className:e,...t}){return o.jsx(Sd,{"data-slot":"select-scroll-down-button",className:B("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Xn,{className:"size-4"})})}var In=["Enter"," "],Od=["ArrowDown","PageUp","Home"],Ns=["ArrowUp","PageDown","End"],Ld=[...Od,...Ns],Fd={ltr:[...In,"ArrowRight"],rtl:[...In,"ArrowLeft"]},$d={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Nt="Menu",[xt,Bd,Vd]=kn(Nt),[ze,js]=Le(Nt,[Vd,en,qt]),sn=en(),Es=qt(),[Ud,We]=ze(Nt),[Hd,jt]=ze(Nt),Rs=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:l=!0}=e,c=sn(t),[d,u]=a.useState(null),p=a.useRef(!1),f=Me(i),g=Gt(s);return a.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})}},[]),o.jsx(Do,{...c,children:o.jsx(Ud,{scope:t,open:n,onOpenChange:f,content:d,onContentChange:u,children:o.jsx(Hd,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:g,modal:l,children:r})})})};Rs.displayName=Nt;var zd="MenuAnchor",Zn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=sn(n);return o.jsx(Oo,{...s,...r,ref:t})});Zn.displayName=zd;var Qn="MenuPortal",[Wd,Ms]=ze(Qn,{forceMount:void 0}),Ps=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=We(Qn,t);return o.jsx(Wd,{scope:t,forceMount:n,children:o.jsx(et,{present:n||i.open,children:o.jsx(Gn,{asChild:!0,container:s,children:r})})})};Ps.displayName=Qn;var he="MenuContent",[Kd,Jn]=ze(he),As=a.forwardRef((e,t)=>{const n=Ms(he,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=We(he,e.__scopeMenu),l=jt(he,e.__scopeMenu);return o.jsx(xt.Provider,{scope:e.__scopeMenu,children:o.jsx(et,{present:r||i.open,children:o.jsx(xt.Slot,{scope:e.__scopeMenu,children:l.modal?o.jsx(Gd,{...s,ref:t}):o.jsx(qd,{...s,ref:t})})})})}),Gd=a.forwardRef((e,t)=>{const n=We(he,e.__scopeMenu),r=a.useRef(null),s=Z(t,r);return a.useEffect(()=>{const i=r.current;if(i)return Vo(i)},[]),o.jsx(er,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:k(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),qd=a.forwardRef((e,t)=>{const n=We(he,e.__scopeMenu);return o.jsx(er,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Yd=mt("MenuContent.ScrollLock"),er=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,disableOutsideScroll:v,...m}=e,x=We(he,n),y=jt(he,n),b=sn(n),S=Es(n),j=Bd(n),[E,A]=a.useState(null),N=a.useRef(null),R=Z(t,N,x.onContentChange),V=a.useRef(0),_=a.useRef(""),U=a.useRef(0),F=a.useRef(null),$=a.useRef("right"),D=a.useRef(0),G=v?qn:a.Fragment,O=v?{as:Yd,allowPinchZoom:!0}:void 0,z=M=>{const Q=_.current+M,te=j().filter(P=>!P.disabled),J=document.activeElement,ge=te.find(P=>P.ref.current===J)?.textValue,ie=te.map(P=>P.textValue),ve=iu(ie,Q,ge),q=te.find(P=>P.textValue===ve)?.ref.current;(function P(W){_.current=W,window.clearTimeout(V.current),W!==""&&(V.current=window.setTimeout(()=>P(""),1e3))})(Q),q&&setTimeout(()=>q.focus())};a.useEffect(()=>()=>window.clearTimeout(V.current),[]),fo();const T=a.useCallback(M=>$.current===F.current?.side&&lu(M,F.current?.area),[]);return o.jsx(Kd,{scope:n,searchRef:_,onItemEnter:a.useCallback(M=>{T(M)&&M.preventDefault()},[T]),onItemLeave:a.useCallback(M=>{T(M)||(N.current?.focus(),A(null))},[T]),onTriggerLeave:a.useCallback(M=>{T(M)&&M.preventDefault()},[T]),pointerGraceTimerRef:U,onPointerGraceIntentChange:a.useCallback(M=>{F.current=M},[]),children:o.jsx(G,{...O,children:o.jsx(Fn,{asChild:!0,trapped:s,onMountAutoFocus:k(i,M=>{M.preventDefault(),N.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:o.jsx(Ln,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:g,onDismiss:h,children:o.jsx(Gr,{asChild:!0,...S,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:A,onEntryFocus:k(d,M=>{y.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Lo,{role:"menu","aria-orientation":"vertical","data-state":Ks(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...m,ref:R,style:{outline:"none",...m.style},onKeyDown:k(m.onKeyDown,M=>{const te=M.target.closest("[data-radix-menu-content]")===M.currentTarget,J=M.ctrlKey||M.altKey||M.metaKey,ge=M.key.length===1;te&&(M.key==="Tab"&&M.preventDefault(),!J&&ge&&z(M.key));const ie=N.current;if(M.target!==ie||!Ld.includes(M.key))return;M.preventDefault();const q=j().filter(P=>!P.disabled).map(P=>P.ref.current);Ns.includes(M.key)&&q.reverse(),su(q)}),onBlur:k(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(V.current),_.current="")}),onPointerMove:k(e.onPointerMove,wt(M=>{const Q=M.target,te=D.current!==M.clientX;if(M.currentTarget.contains(Q)&&te){const J=M.clientX>D.current?"right":"left";$.current=J,D.current=M.clientX}}))})})})})})})});As.displayName=he;var Xd="MenuGroup",tr=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(K.div,{role:"group",...r,ref:t})});tr.displayName=Xd;var Zd="MenuLabel",Ts=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(K.div,{...r,ref:t})});Ts.displayName=Zd;var Wt="MenuItem",Lr="menu.itemSelect",an=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=a.useRef(null),l=jt(Wt,e.__scopeMenu),c=Jn(Wt,e.__scopeMenu),d=Z(t,i),u=a.useRef(!1),p=()=>{const f=i.current;if(!n&&f){const g=new CustomEvent(Lr,{bubbles:!0,cancelable:!0});f.addEventListener(Lr,h=>r?.(h),{once:!0}),Vr(f,g),g.defaultPrevented?u.current=!1:l.onClose()}};return o.jsx(Is,{...s,ref:d,disabled:n,onClick:k(e.onClick,p),onPointerDown:f=>{e.onPointerDown?.(f),u.current=!0},onPointerUp:k(e.onPointerUp,f=>{u.current||f.currentTarget?.click()}),onKeyDown:k(e.onKeyDown,f=>{const g=c.searchRef.current!=="";n||g&&f.key===" "||In.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});an.displayName=Wt;var Is=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,l=Jn(Wt,n),c=Es(n),d=a.useRef(null),u=Z(t,d),[p,f]=a.useState(!1),[g,h]=a.useState("");return a.useEffect(()=>{const v=d.current;v&&h((v.textContent??"").trim())},[i.children]),o.jsx(xt.ItemSlot,{scope:n,disabled:r,textValue:s??g,children:o.jsx(qr,{asChild:!0,...c,focusable:!r,children:o.jsx(K.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:k(e.onPointerMove,wt(v=>{r?l.onItemLeave(v):(l.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:k(e.onPointerLeave,wt(v=>l.onItemLeave(v))),onFocus:k(e.onFocus,()=>f(!0)),onBlur:k(e.onBlur,()=>f(!1))})})})}),Qd="MenuCheckboxItem",ks=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(Fs,{scope:e.__scopeMenu,checked:n,children:o.jsx(an,{role:"menuitemcheckbox","aria-checked":Kt(n)?"mixed":n,...s,ref:t,"data-state":rr(n),onSelect:k(s.onSelect,()=>r?.(Kt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ks.displayName=Qd;var _s="MenuRadioGroup",[Jd,eu]=ze(_s,{value:void 0,onValueChange:()=>{}}),Ds=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=Me(r);return o.jsx(Jd,{scope:e.__scopeMenu,value:n,onValueChange:i,children:o.jsx(tr,{...s,ref:t})})});Ds.displayName=_s;var Os="MenuRadioItem",Ls=a.forwardRef((e,t)=>{const{value:n,...r}=e,s=eu(Os,e.__scopeMenu),i=n===s.value;return o.jsx(Fs,{scope:e.__scopeMenu,checked:i,children:o.jsx(an,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":rr(i),onSelect:k(r.onSelect,()=>s.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ls.displayName=Os;var nr="MenuItemIndicator",[Fs,tu]=ze(nr,{checked:!1}),$s=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=tu(nr,n);return o.jsx(et,{present:r||Kt(i.checked)||i.checked===!0,children:o.jsx(K.span,{...s,ref:t,"data-state":rr(i.checked)})})});$s.displayName=nr;var nu="MenuSeparator",Bs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(K.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Bs.displayName=nu;var ru="MenuArrow",Vs=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=sn(n);return o.jsx(Fo,{...s,...r,ref:t})});Vs.displayName=ru;var ou="MenuSub",[Af,Us]=ze(ou),pt="MenuSubTrigger",Hs=a.forwardRef((e,t)=>{const n=We(pt,e.__scopeMenu),r=jt(pt,e.__scopeMenu),s=Us(pt,e.__scopeMenu),i=Jn(pt,e.__scopeMenu),l=a.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,u={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const f=c.current;return()=>{window.clearTimeout(f),d(null)}},[c,d]),o.jsx(Zn,{asChild:!0,...u,children:o.jsx(Is,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":Ks(n.open),...e,ref:Br(t,s.onTriggerChange),onClick:f=>{e.onClick?.(f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:k(e.onPointerMove,wt(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:k(e.onPointerLeave,wt(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"];i.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(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:k(e.onKeyDown,f=>{const g=i.searchRef.current!=="";e.disabled||g&&f.key===" "||Fd[r.dir].includes(f.key)&&(n.onOpenChange(!0),n.content?.focus(),f.preventDefault())})})})});Hs.displayName=pt;var zs="MenuSubContent",Ws=a.forwardRef((e,t)=>{const n=Ms(he,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=We(he,e.__scopeMenu),l=jt(he,e.__scopeMenu),c=Us(zs,e.__scopeMenu),d=a.useRef(null),u=Z(t,d);return o.jsx(xt.Provider,{scope:e.__scopeMenu,children:o.jsx(et,{present:r||i.open,children:o.jsx(xt.Slot,{scope:e.__scopeMenu,children:o.jsx(er,{id:c.contentId,"aria-labelledby":c.triggerId,...s,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:k(e.onFocusOutside,p=>{p.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:k(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:k(e.onKeyDown,p=>{const f=p.currentTarget.contains(p.target),g=$d[l.dir].includes(p.key);f&&g&&(i.onOpenChange(!1),c.trigger?.focus(),p.preventDefault())})})})})})});Ws.displayName=zs;function Ks(e){return e?"open":"closed"}function Kt(e){return e==="indeterminate"}function rr(e){return Kt(e)?"indeterminate":e?"checked":"unchecked"}function su(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function au(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function iu(e,t,n){const s=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let l=au(e,Math.max(i,0));s.length===1&&(l=l.filter(u=>u!==n));const d=l.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return d!==n?d:void 0}function cu(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,l=t.length-1;i<t.length;l=i++){const c=t[i],d=t[l],u=c.x,p=c.y,f=d.x,g=d.y;p>r!=g>r&&n<(f-u)*(r-p)/(g-p)+u&&(s=!s)}return s}function lu(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cu(n,t)}function wt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var du=Rs,uu=Zn,fu=Ps,pu=As,mu=tr,hu=Ts,gu=an,vu=ks,xu=Ds,wu=Ls,yu=$s,bu=Bs,Su=Vs,Cu=Hs,Nu=Ws,cn="DropdownMenu",[ju,Tf]=Le(cn,[js]),ae=js(),[Eu,Gs]=ju(cn),qs=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,d=ae(t),u=a.useRef(null),[p,f]=ht({prop:s,defaultProp:i??!1,onChange:l,caller:cn});return o.jsx(Eu,{scope:t,triggerId:Be(),triggerRef:u,contentId:Be(),open:p,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(g=>!g),[f]),modal:c,children:o.jsx(du,{...d,open:p,onOpenChange:f,dir:r,modal:c,children:n})})};qs.displayName=cn;var Ys="DropdownMenuTrigger",Xs=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=Gs(Ys,n),l=ae(n);return o.jsx(uu,{asChild:!0,...l,children:o.jsx(K.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Br(t,i.triggerRef),onPointerDown:k(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:k(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});Xs.displayName=Ys;var Ru="DropdownMenuPortal",Zs=e=>{const{__scopeDropdownMenu:t,...n}=e,r=ae(t);return o.jsx(fu,{...r,...n})};Zs.displayName=Ru;var Qs="DropdownMenuContent",Js=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Gs(Qs,n),i=ae(n),l=a.useRef(!1);return o.jsx(pu,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:k(e.onCloseAutoFocus,c=>{l.current||s.triggerRef.current?.focus(),l.current=!1,c.preventDefault()}),onInteractOutside:k(e.onInteractOutside,c=>{const d=c.detail.originalEvent,u=d.button===0&&d.ctrlKey===!0,p=d.button===2||u;(!s.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)"}})});Js.displayName=Qs;var Mu="DropdownMenuGroup",Pu=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(mu,{...s,...r,ref:t})});Pu.displayName=Mu;var Au="DropdownMenuLabel",ea=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(hu,{...s,...r,ref:t})});ea.displayName=Au;var Tu="DropdownMenuItem",ta=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(gu,{...s,...r,ref:t})});ta.displayName=Tu;var Iu="DropdownMenuCheckboxItem",na=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(vu,{...s,...r,ref:t})});na.displayName=Iu;var ku="DropdownMenuRadioGroup",_u=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(xu,{...s,...r,ref:t})});_u.displayName=ku;var Du="DropdownMenuRadioItem",ra=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(wu,{...s,...r,ref:t})});ra.displayName=Du;var Ou="DropdownMenuItemIndicator",oa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(yu,{...s,...r,ref:t})});oa.displayName=Ou;var Lu="DropdownMenuSeparator",sa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(bu,{...s,...r,ref:t})});sa.displayName=Lu;var Fu="DropdownMenuArrow",$u=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(Su,{...s,...r,ref:t})});$u.displayName=Fu;var Bu="DropdownMenuSubTrigger",aa=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(Cu,{...s,...r,ref:t})});aa.displayName=Bu;var Vu="DropdownMenuSubContent",ia=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=ae(n);return o.jsx(Nu,{...s,...r,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)"}})});ia.displayName=Vu;var Uu=qs,Hu=Xs,zu=Zs,ca=Js,la=ea,da=ta,ua=na,fa=ra,pa=oa,ma=sa,ha=aa,ga=ia;const Wu=Uu,Ku=Hu,Gu=a.forwardRef(({className:e,inset:t,children:n,...r},s)=>o.jsxs(ha,{ref:s,className:B("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),...r,children:[n,o.jsx(Ss,{className:"ml-auto h-4 w-4"})]}));Gu.displayName=ha.displayName;const qu=a.forwardRef(({className:e,...t},n)=>o.jsx(ga,{ref:n,className:B("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}));qu.displayName=ga.displayName;const va=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(zu,{children:o.jsx(ca,{ref:r,sideOffset:t,className:B("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})}));va.displayName=ca.displayName;const ce=a.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(da,{ref:r,className:B("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=da.displayName;const Yu=a.forwardRef(({className:e,children:t,checked:n,...r},s)=>o.jsxs(ua,{ref:s,className:B("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,...r,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(pa,{children:o.jsx(bs,{className:"h-4 w-4"})})}),t]}));Yu.displayName=ua.displayName;const Xu=a.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(fa,{ref:r,className:B("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:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(pa,{children:o.jsx(Md,{className:"h-4 w-4 fill-current"})})}),t]}));Xu.displayName=fa.displayName;const Zu=a.forwardRef(({className:e,inset:t,...n},r)=>o.jsx(la,{ref:r,className:B("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Zu.displayName=la.displayName;const Qu=a.forwardRef(({className:e,...t},n)=>o.jsx(ma,{ref:n,className:B("-mx-1 my-1 h-px bg-muted",e),...t}));Qu.displayName=ma.displayName;class Ju{constructor(){dn(this,"api",null);dn(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 r=this.messageListeners.get(t);r&&r.forEach(s=>s(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,r){this.postMessage({type:"update-task-status",specName:t,taskId:n,status:r})}saveDocument(t,n,r){this.postMessage({type:"save-document",specName:t,docType:n,content:r})}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,r,s){this.postMessage({type:"request-revision-request",id:t,response:n,annotations:r,comments:s})}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})}getLogs(t){this.postMessage({type:"get-logs",specName:t})}searchLogs(t,n){this.postMessage({type:"search-logs",specName:t,query:n})}}const L=new Ju;function ef(e={}){const{enabled:t=!0,volume:n=.3,soundUris:r=null}=e,s=a.useRef(new Map),i=a.useRef(!1);a.useEffect(()=>{const h=()=>{i.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=a.useCallback(h=>{if(r&&r[h])return console.log("Found sound URI via PostMessage:",r[h]),r[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:r,windowSoundURIs:v,requestedSound:h,soundURIsReady:window.soundURIsReady}),null},[r]),c=a.useCallback(h=>{if(!t)return null;let v=s.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),s.current.delete(h)}),s.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=a.useCallback(async h=>{if(console.log("playNotification called with:",{sound:h,enabled:t,userHasInteracted:i.current}),!t){console.log("Sound notifications disabled");return}if(!i.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=a.useCallback(()=>d("approval-pending"),[d]),p=a.useCallback(()=>d("task-completed"),[d]),f=a.useCallback(h=>d(h),[d]),g=a.useCallback(()=>{s.current.forEach(h=>{h.pause(),h.removeAttribute("src"),h.load()}),s.current.clear()},[]);return{playApprovalPending:u,playTaskCompleted:p,testSound:f,cleanup:g,isEnabled:t}}const xa=a.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:B("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));xa.displayName="Input";function tf({stats:e}){const{t}=yt();return e?o.jsx(le,{className:"mb-6",children:o.jsx(de,{className:"p-4",children:o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold",children:e.totalEntries}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.totalEntries")})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-green-600",children:e.totalLinesAdded}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.linesAdded")})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-red-600",children:e.totalLinesRemoved}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.linesRemoved")})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"text-2xl font-bold text-purple-600",children:e.totalFilesChanged}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.stats.filesChanged")})]})]})})}):null}function nf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const wa=a.forwardRef(nf);function rf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const ya=a.forwardRef(rf);function of({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M21 6.375c0 2.692-4.03 4.875-9 4.875S3 9.067 3 6.375 7.03 1.5 12 1.5s9 2.183 9 4.875Z"}),a.createElement("path",{d:"M12 12.75c2.685 0 5.19-.586 7.078-1.609a8.283 8.283 0 0 0 1.897-1.384c.016.121.025.244.025.368C21 12.817 16.97 15 12 15s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.285 8.285 0 0 0 1.897 1.384C6.809 12.164 9.315 12.75 12 12.75Z"}),a.createElement("path",{d:"M12 16.5c2.685 0 5.19-.586 7.078-1.609a8.282 8.282 0 0 0 1.897-1.384c.016.121.025.244.025.368 0 2.692-4.03 4.875-9 4.875s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.284 8.284 0 0 0 1.897 1.384C6.809 15.914 9.315 16.5 12 16.5Z"}),a.createElement("path",{d:"M12 20.25c2.685 0 5.19-.586 7.078-1.609a8.282 8.282 0 0 0 1.897-1.384c.016.121.025.244.025.368 0 2.692-4.03 4.875-9 4.875s-9-2.183-9-4.875c0-.124.009-.247.025-.368a8.284 8.284 0 0 0 1.897 1.384C6.809 19.664 9.315 20.25 12 20.25Z"}))}const sf=a.forwardRef(of);function af({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6Zm14.25 6a.75.75 0 0 1-.22.53l-2.25 2.25a.75.75 0 1 1-1.06-1.06L15.44 12l-1.72-1.72a.75.75 0 1 1 1.06-1.06l2.25 2.25c.141.14.22.331.22.53Zm-10.28-.53a.75.75 0 0 0 0 1.06l2.25 2.25a.75.75 0 1 0 1.06-1.06L8.56 12l1.72-1.72a.75.75 0 1 0-1.06-1.06l-2.25 2.25Z",clipRule:"evenodd"}))}const cf=a.forwardRef(af);function lf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M12.378 1.602a.75.75 0 0 0-.756 0L3 6.632l9 5.25 9-5.25-8.622-5.03ZM21.75 7.93l-9 5.25v9l8.628-5.032a.75.75 0 0 0 .372-.648V7.93ZM11.25 22.18v-9l-9-5.25v8.57a.75.75 0 0 0 .372.648l8.628 5.033Z"}))}const df=a.forwardRef(lf);function uf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 0 0-.945-5.003 12.754 12.754 0 0 1-4.339 2.708 18.991 18.991 0 0 1-.214 4.772 17.165 17.165 0 0 0 5.498-2.477ZM14.634 15.55a17.324 17.324 0 0 0 .332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 0 0 .332 4.647 17.385 17.385 0 0 0 5.268 0ZM9.772 17.119a18.963 18.963 0 0 0 4.456 0A17.182 17.182 0 0 1 12 21.724a17.18 17.18 0 0 1-2.228-4.605ZM7.777 15.23a18.87 18.87 0 0 1-.214-4.774 12.753 12.753 0 0 1-4.34-2.708 9.711 9.711 0 0 0-.944 5.004 17.165 17.165 0 0 0 5.498 2.477ZM21.356 14.752a9.765 9.765 0 0 1-7.478 6.817 18.64 18.64 0 0 0 1.988-4.718 18.627 18.627 0 0 0 5.49-2.098ZM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 0 0 1.988 4.718 9.765 9.765 0 0 1-7.478-6.816ZM13.878 2.43a9.755 9.755 0 0 1 6.116 3.986 11.267 11.267 0 0 1-3.746 2.504 18.63 18.63 0 0 0-2.37-6.49ZM12 2.276a17.152 17.152 0 0 1 2.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0 1 12 2.276ZM10.122 2.43a18.629 18.629 0 0 0-2.37 6.49 11.266 11.266 0 0 1-3.746-2.504 9.754 9.754 0 0 1 6.116-3.985Z"}))}const ff=a.forwardRef(uf);function pf({title:e,titleId:t,...n},r){return a.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?a.createElement("title",{id:t},e):null,a.createElement("path",{fillRule:"evenodd",d:"M19.902 4.098a3.75 3.75 0 0 0-5.304 0l-4.5 4.5a3.75 3.75 0 0 0 1.035 6.037.75.75 0 0 1-.646 1.353 5.25 5.25 0 0 1-1.449-8.45l4.5-4.5a5.25 5.25 0 1 1 7.424 7.424l-1.757 1.757a.75.75 0 1 1-1.06-1.06l1.757-1.757a3.75 3.75 0 0 0 0-5.304Zm-7.389 4.267a.75.75 0 0 1 1-.353 5.25 5.25 0 0 1 1.449 8.45l-4.5 4.5a5.25 5.25 0 1 1-7.424-7.424l1.757-1.757a.75.75 0 1 1 1.06 1.06l-1.757 1.757a3.75 3.75 0 1 0 5.304 5.304l4.5-4.5a3.75 3.75 0 0 0-1.035-6.037.75.75 0 0 1-.354-1Z",clipRule:"evenodd"}))}const mf=a.forwardRef(pf),hf={apiEndpoints:ff,components:df,functions:cf,classes:sf,integrations:mf},gf={apiEndpoints:"text-blue-500",components:"text-purple-500",functions:"text-green-500",classes:"text-orange-500",integrations:"text-indigo-500"};function it({type:e,artifacts:t,className:n=""}){const{t:r}=yt(),[s,i]=a.useState(!1);if(!t||t.length===0)return null;const l={apiEndpoints:r("logs.artifacts.apiEndpoints"),components:r("logs.artifacts.components"),functions:r("logs.artifacts.functions"),classes:r("logs.artifacts.classes"),integrations:r("logs.artifacts.integrations")},c=hf[e],d=l[e],u=gf[e];return o.jsxs("div",{className:`mb-6 ${n}`,children:[o.jsxs("button",{onClick:()=>i(!s),className:"w-full flex items-center justify-between hover:opacity-80 transition-opacity py-2 px-3 rounded hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(c,{className:`w-5 h-5 ${u}`}),o.jsxs("h3",{className:`text-sm font-semibold ${u}`,children:[d," (",t.length,")"]})]}),s?o.jsx(wa,{className:`w-4 h-4 ${u}`}):o.jsx(ya,{className:`w-4 h-4 ${u}`})]}),s&&o.jsxs("div",{className:"space-y-3 pl-7 mt-3 pt-3 border-t border-muted",children:[e==="apiEndpoints"&&vf(t,r),e==="components"&&xf(t,r),e==="functions"&&wf(t,r),e==="classes"&&yf(t,r),e==="integrations"&&bf(t,r)]})]})}function vf(e,t){return e.map((n,r)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("div",{className:"font-mono font-semibold text-blue-600",children:[n.method," ",n.path]}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.requestFormat&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.request")," ",n.requestFormat]}),n.responseFormat&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.response")," ",n.responseFormat]}),o.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function xf(e,t){return e.map((n,r)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("div",{className:"font-semibold",children:[n.name," ",o.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",n.type,")"]})]}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.props&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.props")," ",n.props]}),n.exports&&n.exports.length>0&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.exports")," ",n.exports.join(", ")]}),o.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function wf(e,t){return e.map((n,r)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("div",{className:"font-semibold",children:[n.name," ",n.isExported&&o.jsx("span",{className:"text-xs text-green-600",children:t("logs.artifacts.exported")})]}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.signature&&o.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[t("logs.artifacts.signature")," ",n.signature]}),o.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function yf(e,t){return e.map((n,r)=>o.jsxs("div",{className:"text-sm",children:[o.jsxs("div",{className:"font-semibold",children:[n.name," ",n.isExported&&o.jsx("span",{className:"text-xs text-green-600",children:t("logs.artifacts.exported")})]}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:n.purpose}),n.methods&&n.methods.length>0&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.methods")," ",n.methods.join(", ")]}),o.jsx("div",{className:"text-xs text-gray-500 mt-1 font-mono",children:n.location})]},r))}function bf(e,t){return e.map((n,r)=>o.jsxs("div",{className:"text-sm",children:[o.jsx("div",{className:"font-semibold",children:n.description}),o.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:[t("logs.artifacts.frontend")," ",n.frontendComponent]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.backend")," ",n.backendEndpoint]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[t("logs.artifacts.dataFlow")," ",n.dataFlow]})]},r))}function Sf({entry:e}){const{t}=yt(),[n,r]=a.useState(!1),s=i=>new Date(i).toLocaleString();return o.jsx(le,{className:"mb-4 hover:shadow-md transition-shadow cursor-pointer",children:o.jsxs(de,{className:"p-4",children:[o.jsxs("div",{className:"flex items-start gap-4 hover:bg-muted/50 p-2 rounded -m-2",onClick:()=>r(!n),children:[o.jsx("div",{className:"mt-0.5 flex-shrink-0",children:n?o.jsx(wa,{className:"w-5 h-5"}):o.jsx(ya,{className:"w-5 h-5"})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-100 text-xs font-mono rounded",children:e.taskId}),o.jsx("span",{className:"text-sm text-muted-foreground",children:s(e.timestamp)})]}),o.jsx("p",{className:"text-sm font-medium mt-1",children:e.summary})]})]}),n&&o.jsxs("div",{className:"mt-4 pl-9 space-y-4 border-l-2 border-muted pl-4",children:[o.jsxs("div",{className:"grid grid-cols-4 gap-2 text-center",children:[o.jsxs("div",{className:"p-2 bg-muted rounded",children:[o.jsxs("div",{className:"text-lg font-bold text-green-600",children:["+",e.statistics.linesAdded]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.added")})]}),o.jsxs("div",{className:"p-2 bg-muted rounded",children:[o.jsxs("div",{className:"text-lg font-bold text-red-600",children:["-",e.statistics.linesRemoved]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.removed")})]}),o.jsxs("div",{className:"p-2 bg-muted rounded",children:[o.jsx("div",{className:"text-lg font-bold text-blue-600",children:e.statistics.filesChanged}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.filesChanged")})]}),o.jsxs("div",{className:"p-2 bg-muted rounded",children:[o.jsx("div",{className:"text-lg font-bold text-purple-600",children:e.statistics.linesAdded-e.statistics.linesRemoved}),o.jsx("div",{className:"text-xs text-muted-foreground",children:t("logs.entry.netChange")})]})]}),e.filesModified&&e.filesModified.length>0&&o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold mb-2",children:t("logs.entry.filesModified")}),o.jsx("ul",{className:"space-y-1",children:e.filesModified.map((i,l)=>o.jsxs("li",{className:"text-xs text-muted-foreground font-mono",children:["• ",i]},l))})]}),e.filesCreated&&e.filesCreated.length>0&&o.jsxs("div",{children:[o.jsx("h4",{className:"text-sm font-semibold mb-2",children:t("logs.entry.filesCreated")}),o.jsx("ul",{className:"space-y-1",children:e.filesCreated.map((i,l)=>o.jsxs("li",{className:"text-xs text-muted-foreground font-mono",children:["• ",i]},l))})]}),e.artifacts&&o.jsxs("div",{className:"space-y-4 pt-2",children:[o.jsx(it,{type:"apiEndpoints",artifacts:e.artifacts.apiEndpoints||[]}),o.jsx(it,{type:"components",artifacts:e.artifacts.components||[]}),o.jsx(it,{type:"functions",artifacts:e.artifacts.functions||[]}),o.jsx(it,{type:"classes",artifacts:e.artifacts.classes||[]}),o.jsx(it,{type:"integrations",artifacts:e.artifacts.integrations||[]})]})]})]})})}function Cf({specs:e,selectedSpec:t,onSpecChange:n}){const{t:r}=yt(),[s,i]=a.useState(null),[l,c]=a.useState(""),[d,u]=a.useState([]),[p,f]=a.useState(new Set),[g,h]=a.useState("timestamp"),[v,m]=a.useState("desc"),[x,y]=a.useState(!1),b=a.useRef(void 0);a.useEffect(()=>L.onMessage("logs-updated",R=>{R.data&&(i(R.data),f(new Set),c(""))}),[]),a.useEffect(()=>L.onMessage("logs-search-results",R=>{if(R.data){const{entries:V}=R.data;S(V,new Set,g,v),y(!1)}}),[g,v]),a.useEffect(()=>{t&&(y(!0),L.getLogs(t))},[t]),a.useEffect(()=>{s&&y(!1)},[s]),a.useEffect(()=>{s&&S(s.entries,p,g,v)},[s,p,g,v]),a.useEffect(()=>{if(b.current&&clearTimeout(b.current),!t||!l.trim()){s&&S(s.entries,p,g,v);return}return y(!0),b.current=setTimeout(()=>{L.searchLogs(t,l)},300),()=>{b.current&&clearTimeout(b.current)}},[l,t,s]);const S=(N,R,V,_)=>{let U=[...N];R.size>0&&(U=U.filter(F=>R.has(F.taskId))),U.sort((F,$)=>{let D=0;switch(V){case"timestamp":D=new Date(F.timestamp).getTime()-new Date($.timestamp).getTime();break;case"taskId":D=F.taskId.localeCompare($.taskId);break;case"linesAdded":D=F.statistics.linesAdded-$.statistics.linesAdded;break;case"filesChanged":D=F.statistics.filesChanged-$.statistics.filesChanged;break}return _==="desc"?-D:D}),u(U)},j=s?Array.from(new Set(s.entries.map(N=>N.taskId))).sort():[],E=N=>{const R=new Set(p);R.has(N)?R.delete(N):R.add(N),f(R)},A=N=>{g===N?m(v==="asc"?"desc":"asc"):(h(N),m("desc"))};return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{children:[o.jsx("h2",{className:"text-2xl font-bold",children:r("logs.title")}),o.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r("logs.subtitle")})]}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs(lt,{value:t||"",onValueChange:n,children:[o.jsx(ut,{className:"w-full",children:o.jsx(dt,{placeholder:r("logs.selectSpec")})}),o.jsx(ft,{children:e.map(N=>o.jsx(_e,{value:N.name,children:N.displayName||N.name},N.name))})]}),o.jsx(xa,{placeholder:r("logs.searchPlaceholder"),value:l,onChange:N=>c(N.target.value),disabled:!t}),s&&j.length>0&&o.jsx("div",{className:"flex flex-wrap gap-2",children:j.map(N=>o.jsx("button",{onClick:()=>E(N),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${p.has(N)?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:N},N))}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs("button",{onClick:()=>A("timestamp"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="timestamp"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.timestamp")," ",g==="timestamp"&&(v==="asc"?"↑":"↓")]}),o.jsxs("button",{onClick:()=>A("taskId"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="taskId"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.taskId")," ",g==="taskId"&&(v==="asc"?"↑":"↓")]}),o.jsxs("button",{onClick:()=>A("linesAdded"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="linesAdded"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.linesAdded")," ",g==="linesAdded"&&(v==="asc"?"↑":"↓")]}),o.jsxs("button",{onClick:()=>A("filesChanged"),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${g==="filesChanged"?"bg-blue-500 text-white":"bg-muted text-muted-foreground hover:bg-muted-foreground/20"}`,children:[r("logs.sort.filesChanged")," ",g==="filesChanged"&&(v==="asc"?"↑":"↓")]})]})]}),s&&o.jsx(tf,{stats:s.stats}),x&&o.jsx(le,{children:o.jsx(de,{className:"p-8 text-center text-muted-foreground",children:r("logs.loading")})}),!x&&!t&&o.jsx(le,{children:o.jsx(de,{className:"p-8 text-center text-muted-foreground",children:r("logs.selectSpecMessage")})}),!x&&t&&d.length===0&&o.jsx(le,{children:o.jsx(de,{className:"p-8 text-center text-muted-foreground",children:r(l?"logs.noSearchResults":"logs.noLogs")})}),!x&&d.length>0&&o.jsx("div",{className:"space-y-2",children:d.map(N=>o.jsx(Sf,{entry:N},N.id))})]})}function Nf(){const{t:e,i18n:t}=yt();console.log("=== WEBVIEW APP.TSX STARTING ===");const n=Ia();console.log("Current VS Code theme:",n);const[r,s]=a.useState([]),[i,l]=a.useState([]),[c,d]=a.useState(null),[u,p]=a.useState(null),[f,g]=a.useState([]),[h,v]=a.useState([]),[m,x]=a.useState("all"),[y,b]=a.useState([]),[S,j]=a.useState([]),[,E]=a.useState(null),[A,N]=a.useState(!1),[R,V]=a.useState("overview"),[_,U]=a.useState(null),[F,$]=a.useState(null),[D,G]=a.useState(null),[O,z]=a.useState(!1),[T,M]=a.useState(new Set),[Q,te]=a.useState(!1),[J,ge]=a.useState({enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0}),[ie,ve]=a.useState(null),[q,P]=a.useState("active"),[W,ee]=a.useState(null),[H,Y]=a.useState("auto"),X=ye.useRef(null),ne=ef({enabled:J.enabled,volume:J.volume,soundUris:ie}),pe=a.useRef([]),Ce=a.useRef(null),ot=w=>{M(C=>{const I=new Set(C);return I.has(w)?I.delete(w):I.add(w),I})},st=w=>{if(!c)return;const C=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(C).then(()=>{G(w.id),setTimeout(()=>G(null),2e3)}).catch(()=>{or(C,w.id)}):or(C,w.id)},or=(w,C)=>{const I=document.createElement("textarea");I.value=w,I.style.position="fixed",I.style.left="-999999px",I.style.top="-999999px",document.body.appendChild(I),I.focus(),I.select();try{document.execCommand("copy")&&(G(C),setTimeout(()=>G(null),2e3))}catch(at){console.error("Failed to copy text: ",at)}document.body.removeChild(I)},me=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),U({message:e("language.changed"),level:"success"})},ba=()=>{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(()=>{z(!0),setTimeout(()=>z(!1),2e3)}).catch(()=>{sr(w)}):sr(w)},sr=w=>{const C=document.createElement("textarea");C.value=w,C.style.position="fixed",C.style.left="-999999px",C.style.top="-999999px",document.body.appendChild(C),C.focus(),C.select();try{document.execCommand("copy")&&(z(!0),setTimeout(()=>z(!1),2e3))}catch(I){console.error("Failed to copy text: ",I)}document.body.removeChild(C)},Sa=()=>{X.current?.scrollTo({top:0,behavior:"smooth"})};a.useEffect(()=>{const w=[L.onMessage("specs-updated",C=>{s(C.data||[]),N(!1)}),L.onMessage("tasks-updated",C=>{console.log("=== App.tsx tasks-updated message ==="),console.log("Message data:",C.data),console.log("Selected spec:",c),console.log("Message spec:",C.data?.specName),C.data&&(console.log("Setting taskData with taskList count:",C.data.taskList?.length),console.log("Sample task (2.2) from message:",C.data.taskList?.find(I=>I.id==="2.2")),console.log("Tasks with metadata:",C.data.taskList?.filter(I=>I.requirements?.length||I.implementationDetails?.length||I.files?.length||I.purposes?.length||I.leverage).map(I=>({id:I.id,requirements:I.requirements,implementationDetails:I.implementationDetails}))),p(C.data),!c&&C.data.specName&&(console.log("Setting selected spec from task data:",C.data.specName),d(C.data.specName)))}),L.onMessage("approvals-updated",C=>{console.log("=== Received approvals-updated message ==="),console.log("Current tab:",R),console.log("Approvals count:",C.data?.length||0),console.log("Pending approvals:",C.data?.filter(I=>I.status==="pending").length||0),console.log("About to setApprovals - this should trigger badge counter update"),g(C.data||[]),L.getApprovalCategories()}),L.onMessage("approval-categories-updated",C=>{console.log("=== Received approval-categories-updated message ==="),console.log("Categories:",C.data),v(C.data||[])}),L.onMessage("steering-updated",C=>{E(C.data)}),L.onMessage("spec-documents-updated",C=>{b(C.data||[])}),L.onMessage("steering-documents-updated",C=>{j(C.data||[])}),L.onMessage("selected-spec-updated",C=>{d(C.data||null)}),L.onMessage("error",C=>{console.error("Extension error:",C.message),N(!1)}),L.onMessage("notification",C=>{U({message:C.message,level:C.level}),setTimeout(()=>U(null),3e3)}),L.onMessage("config-updated",C=>{ge(C.data||{enabled:!0,volume:.3,approvalSound:!0,taskCompletionSound:!0})}),L.onMessage("sound-uris-updated",C=>{console.log("Received sound URIs from extension:",C.data),ve(C.data||null)}),L.onMessage("navigate-to-approvals",C=>{console.log("Navigating to approvals from native notification:",C.data);const{specName:I,approvalId:at}=C.data;V("approvals"),d(I),console.log("Switched to approvals tab, selected spec:",I)}),L.onMessage("archived-specs-updated",C=>{console.log("=== Received archived-specs-updated message ==="),console.log("Archived specs count:",C.data?.length||0),l(C.data||[])}),L.onMessage("language-preference-updated",C=>{console.log("=== Received language-preference-updated message ==="),console.log("Language preference:",C.data);const I=C.data||"auto";Y(I),I==="auto"?(localStorage.removeItem("spec-workflow-language"),t.changeLanguage(void 0)):(localStorage.setItem("spec-workflow-language",I),t.changeLanguage(I))})];return ar(),L.getApprovals(),L.getLanguagePreference(),()=>{w.forEach(C=>C())}},[]),a.useEffect(()=>{c&&(L.getTasks(c),L.getSpecDocuments(c))},[c]),a.useEffect(()=>{W&&L.getSpecDocuments(W)},[W]),a.useEffect(()=>{L.getSteeringDocuments()},[]),a.useEffect(()=>{const w=X.current;if(!w)return;const C=()=>{te(w.scrollTop>200)};return w.addEventListener("scroll",C),()=>w.removeEventListener("scroll",C)},[]),a.useEffect(()=>{if(f.length===0){pe.current=f;return}const w=f.filter(I=>I.status==="pending").length,C=pe.current.filter(I=>I.status==="pending").length;w>C&&pe.current.length>0&&J.approvalSound&&(console.log(`New pending approval detected: ${w} vs ${C}`),ne.playApprovalPending()),pe.current=f},[f,ne,J.approvalSound]),a.useEffect(()=>{if(!u||!u.taskList){Ce.current=u;return}if(!Ce.current||!Ce.current.taskList){Ce.current=u;return}const w=u.taskList.filter(I=>I.status==="completed").length,C=Ce.current.taskList.filter(I=>I.status==="completed").length;w>C&&J.taskCompletionSound&&(console.log(`Task completion detected: ${w} vs ${C}`),ne.playTaskCompleted()),Ce.current=u},[u,ne,J.taskCompletionSound]),a.useEffect(()=>{R==="approvals"?(L.getApprovals(),L.getApprovalCategories()):R==="archives"&&L.getArchivedSpecs()},[R]);const ar=()=>{N(!0),L.refreshAll(),L.getSelectedSpec(),L.getConfig(),L.getArchivedSpecs()},ir=w=>{L.setSelectedSpec(w)},Ca=(w,C)=>{c&&L.updateTaskStatus(c,w,C)},xe=ye.useMemo(()=>{const w=r.filter(Ne=>!Ne.isArchived).length,C=i.length,I=w+C,at=r.filter(Ne=>Ne.taskProgress&&Ne.taskProgress.completed===Ne.taskProgress.total&&Ne.taskProgress.total>0).length,Na=r.reduce((Ne,ln)=>Ne+(ln.taskProgress?.total||0),0),ja=r.reduce((Ne,ln)=>Ne+(ln.taskProgress?.completed||0),0);return{activeSpecs:w,archivedSpecs:C,totalSpecs:I,completedSpecs:at,totalTasks:Na,completedTasks:ja}},[r,i]),cr=ye.useMemo(()=>{const w=f.filter(C=>C.status==="pending").length;return console.log("Badge counter recalculated:",w,"from",f.length,"total approvals"),w},[f]);return o.jsx("div",{className:B("sidebar-root",`vscode-${n}`),children:o.jsxs(ci,{value:R,onValueChange:V,className:"w-full h-full flex flex-col",children:[o.jsxs("div",{className:"sidebar-sticky-header space-y-3",children:[_&&o.jsx("div",{className:B("p-2 rounded text-xs font-medium",_.level==="success"&&"bg-green-100 text-green-800 border border-green-200",_.level==="error"&&"bg-red-100 text-red-800 border border-red-200",_.level==="warning"&&"bg-yellow-100 text-yellow-800 border border-yellow-200",_.level==="info"&&"bg-blue-100 text-blue-800 border border-blue-200"),children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{children:_.message}),o.jsx("button",{type:"button",onClick:()=>U(null),className:"ml-2 hover:opacity-70",children:"×"})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h1",{className:"text-lg font-semibold",children:e("header.title")}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs(Wu,{children:[o.jsx(Ku,{asChild:!0,children:o.jsx(re,{variant:"ghost",size:"sm",className:"flex items-center space-x-1",title:e("language.selector"),children:o.jsx(Ad,{className:"h-4 w-4"})})}),o.jsxs(va,{align:"end",children:[o.jsx(ce,{onClick:()=>me("auto"),className:B(H==="auto"&&"bg-accent"),children:e("language.auto")}),o.jsx(ce,{onClick:()=>me("en"),className:B(H==="en"&&"bg-accent"),children:e("language.english")}),o.jsx(ce,{onClick:()=>me("ja"),className:B(H==="ja"&&"bg-accent"),children:e("language.japanese")}),o.jsx(ce,{onClick:()=>me("zh"),className:B(H==="zh"&&"bg-accent"),children:e("language.chinese")}),o.jsx(ce,{onClick:()=>me("es"),className:B(H==="es"&&"bg-accent"),children:e("language.spanish")}),o.jsx(ce,{onClick:()=>me("pt"),className:B(H==="pt"&&"bg-accent"),children:e("language.portuguese")}),o.jsx(ce,{onClick:()=>me("de"),className:B(H==="de"&&"bg-accent"),children:e("language.german")}),o.jsx(ce,{onClick:()=>me("fr"),className:B(H==="fr"&&"bg-accent"),children:e("language.french")}),o.jsx(ce,{onClick:()=>me("ru"),className:B(H==="ru"&&"bg-accent"),children:e("language.russian")}),o.jsx(ce,{onClick:()=>me("it"),className:B(H==="it"&&"bg-accent"),children:e("language.italian")}),o.jsx(ce,{onClick:()=>me("ko"),className:B(H==="ko"&&"bg-accent"),children:e("language.korean")}),o.jsx(ce,{onClick:()=>me("ar"),className:B(H==="ar"&&"bg-accent"),children:e("language.arabic")})]})]}),o.jsx(re,{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:o.jsx(Rd,{className:"h-4 w-4"})}),o.jsx(re,{variant:"ghost",size:"sm",onClick:ar,disabled:A,children:o.jsx(Td,{className:B("h-4 w-4",A&&"animate-spin")})})]})]}),o.jsxs(li,{className:"grid w-full grid-cols-6",children:[o.jsx(Ke,{value:"overview",className:"text-xs",title:e("tabs.overview"),children:o.jsx(Cd,{className:"h-3 w-3"})}),o.jsx(Ke,{value:"steering",className:"text-xs",title:e("tabs.steering"),children:o.jsx(Id,{className:"h-3 w-3"})}),o.jsx(Ke,{value:"specs",className:"text-xs",title:e("tabs.specs"),children:o.jsx(Nd,{className:"h-3 w-3"})}),o.jsx(Ke,{value:"tasks",className:"text-xs",title:e("tabs.tasks"),children:o.jsx(kd,{className:"h-3 w-3"})}),o.jsx(Ke,{value:"logs",className:"text-xs",title:e("tabs.logs"),children:o.jsx(Pd,{className:"h-3 w-3"})}),o.jsxs(Ke,{value:"approvals",className:"text-xs relative",title:e("tabs.approvals"),children:[o.jsx(Ed,{className:"h-3 w-3"}),cr>0&&o.jsx(At,{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:cr})]})]})]}),o.jsxs("div",{className:"sidebar-scrollable-content",ref:X,children:[o.jsxs(Ge,{value:"overview",className:"space-y-3",children:[o.jsxs(le,{children:[o.jsx(Et,{className:"pb-2",children:o.jsx(Rt,{className:"text-sm",children:e("overview.projectTitle")})}),o.jsxs(de,{className:"space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-muted-foreground",children:e("overview.activeSpecs")}),o.jsxs("div",{className:"font-medium",children:[xe.completedSpecs," / ",xe.activeSpecs]})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-muted-foreground",children:e("overview.archivedSpecs")}),o.jsx("div",{className:"font-medium",children:xe.archivedSpecs})]})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-muted-foreground",children:e("overview.totalSpecs")}),o.jsx("div",{className:"font-medium",children:xe.totalSpecs})]}),o.jsxs("div",{className:"space-y-1",children:[o.jsx("div",{className:"text-muted-foreground",children:e("overview.tasks")}),o.jsxs("div",{className:"font-medium",children:[xe.completedTasks," / ",xe.totalTasks]})]})]}),xe.totalTasks>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex justify-between text-xs",children:[o.jsx("span",{children:e("overview.overallProgress")}),o.jsxs("span",{children:[Math.round(xe.completedTasks/xe.totalTasks*100),"%"]})]}),o.jsx(ur,{value:xe.completedTasks/xe.totalTasks*100,className:"h-2"})]})]})]}),o.jsxs(le,{children:[o.jsx(Et,{className:"pb-2",children:o.jsx(Rt,{className:"text-sm",children:e("overview.recentActivity")})}),o.jsx(de,{children:o.jsxs("div",{className:"space-y-2",children:[r.slice(0,3).map(w=>o.jsxs("div",{className:"flex items-center justify-between text-xs",children:[o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx("div",{className:B("w-2 h-2 rounded-full",w.taskProgress&&w.taskProgress.completed===w.taskProgress.total&&w.taskProgress.total>0?"bg-green-500":"bg-blue-500")}),o.jsx("span",{className:"truncate",children:w.displayName})]}),o.jsx("span",{className:"text-muted-foreground",children:e("overview.modified",{time:Mt(w.lastModified)})})]},w.name)),r.length===0&&o.jsx("div",{className:"text-muted-foreground text-xs text-center py-2",children:e("overview.noSpecs")})]})})]})]}),o.jsxs(Ge,{value:"tasks",className:"space-y-3",children:[o.jsx("div",{className:"space-y-3",children:o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("label",{className:"text-sm font-medium",children:[e("tasks.specLabel"),":"]}),o.jsxs(lt,{value:c||"",onValueChange:ir,children:[o.jsx(ut,{className:"w-full",children:o.jsx(dt,{placeholder:e("tasks.specPlaceholder")})}),o.jsx(ft,{children:r.map(w=>o.jsx(_e,{value:w.name,children:w.displayName},w.name))})]})]})}),c?u?o.jsxs(o.Fragment,{children:[o.jsx(le,{children:o.jsx(de,{className:"p-4",children:o.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"font-medium text-lg",children:u.total}),o.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.total")})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"font-medium text-lg text-green-600",children:u.completed}),o.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.done")})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"font-medium text-lg text-amber-600",children:u.total-u.completed}),o.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.left")})]}),o.jsxs("div",{className:"text-center",children:[o.jsxs("div",{className:"font-medium text-lg text-blue-600",children:[Math.round(u.progress),"%"]}),o.jsx("div",{className:"text-muted-foreground text-xs",children:e("tasks.stats.progress")})]})]})})}),o.jsx(le,{children:o.jsxs(de,{className:"p-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("span",{className:"text-sm font-medium",children:e("tasks.overallProgress")}),o.jsxs("span",{className:"text-sm",children:[Math.round(u.progress),"%"]})]}),o.jsx(ur,{value:u.progress,className:"h-2"})]})}),o.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)}),o.jsx(le,{className:B("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:o.jsx(de,{className:"p-3",children:o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:B("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&&o.jsxs(o.Fragment,{children:[o.jsx(re,{variant:"ghost",size:"sm",className:B("h-6 w-6 p-0",D===w.id&&"text-green-600"),onClick:C=>{C.stopPropagation(),st(w)},title:D===w.id?e("tasks.copied"):e("tasks.copyPromptTitle"),disabled:D===w.id,children:o.jsx(Or,{className:"h-3 w-3"})}),o.jsxs(lt,{value:w.completed?"completed":w.status||"pending",onValueChange:C=>Ca(w.id,C),children:[o.jsx(ut,{className:B("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:o.jsx(dt,{})}),o.jsxs(ft,{children:[o.jsx(_e,{value:"pending",children:e("tasks.status.pending")}),o.jsx(_e,{value:"in-progress",children:e("tasks.status.inProgress")}),o.jsx(_e,{value:"completed",children:e("tasks.status.completed")})]})]})]}),w.isHeader&&o.jsx(At,{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")})]}),o.jsx("p",{className:B("text-xs",w.isHeader?"text-slate-600 dark:text-slate-300":"text-muted-foreground"),children:w.description}),o.jsxs("div",{className:"space-y-2 border-t border-gray-100 dark:border-gray-700 pt-2",children:[w.files&&w.files.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"text-xs font-medium text-purple-600 dark:text-purple-400 flex items-center gap-1",children:[e("tasks.meta.files"),":"]}),o.jsx("div",{className:"task-files-container",children:o.jsx("div",{className:"task-files-list",children:w.files.map((C,I)=>o.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:C},I))})})]}),w.implementationDetails&&w.implementationDetails.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"text-xs font-medium text-blue-600 dark:text-blue-400 flex items-center gap-1",children:[e("tasks.meta.implementation"),":"]}),o.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:w.implementationDetails.map((C,I)=>o.jsx("li",{className:"leading-relaxed",children:C},I))})]}),w.purposes&&w.purposes.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"text-xs font-medium text-green-600 dark:text-green-400 flex items-center gap-1",children:[e("tasks.meta.purposes"),":"]}),o.jsx("ul",{className:"text-xs text-muted-foreground list-disc list-inside space-y-0.5 ml-2",children:w.purposes.map((C,I)=>o.jsx("li",{className:"leading-relaxed",children:C},I))})]}),w.requirements&&w.requirements.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"text-xs font-medium text-orange-600 dark:text-orange-400 flex items-center gap-1",children:[e("tasks.meta.requirements"),":"]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:w.requirements.join(", ")})]}),w.leverage&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"text-xs font-medium text-cyan-600 dark:text-cyan-400 flex items-center gap-1",children:[e("tasks.meta.leverage"),":"]}),o.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&&o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"text-xs font-medium text-indigo-600 dark:text-indigo-400 flex items-center gap-1",children:[o.jsx(jd,{className:"w-3 h-3"}),e("tasks.meta.prompt","AI Prompt"),":"]}),o.jsx("button",{onClick:()=>ot(w.id),className:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-800 dark:hover:text-indigo-200 transition-colors",title:T.has(w.id)?"Collapse prompt":"Expand prompt",children:T.has(w.id)?o.jsx(Xn,{className:"w-3 h-3"}):o.jsx(Ss,{className:"w-3 h-3"})})]}),T.has(w.id)&&o.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)))})]}):o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("tasks.loading")}):o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:r.length===0?e("tasks.noSpecs"):e("tasks.selectSpec")})]}),o.jsx(Ge,{value:"logs",className:"space-y-3",children:o.jsx(Cf,{specs:r,selectedSpec:c,onSpecChange:w=>{d(w),L.setSelectedSpec(w)}})}),o.jsxs(Ge,{value:"approvals",className:"space-y-3",children:[o.jsx("div",{className:"space-y-3",children:o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("label",{className:"text-sm font-medium",children:[e("approvals.docLabel"),":"]}),o.jsxs(lt,{value:m,onValueChange:x,children:[o.jsx(ut,{className:"w-full",children:o.jsx(dt,{placeholder:e("approvals.categoryPlaceholder")})}),o.jsx(ft,{children:h.map(w=>o.jsx(_e,{value:w.value,children:o.jsxs("div",{className:"flex items-center justify-between w-full",children:[o.jsx("span",{children:w.label}),w.count>0&&o.jsx(At,{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(C=>C.status==="pending"):f.filter(C=>C.status==="pending"&&C.categoryName===m);return w.length>0?o.jsx("div",{className:"space-y-2",children:w.map(C=>o.jsx(le,{children:o.jsx(de,{className:"p-3",children:o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"font-medium text-sm",children:C.title}),o.jsx(At,{variant:"secondary",className:"text-xs",children:e("approvals.status.pending")})]}),C.description&&o.jsx("p",{className:"text-xs text-muted-foreground",children:C.description}),C.filePath&&o.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:C.filePath}),o.jsx("div",{className:"text-xs text-muted-foreground",children:e("approvals.created",{time:Mt(C.createdAt)})}),o.jsxs("div",{className:"flex gap-1 flex-wrap",children:[o.jsx(re,{size:"sm",className:"h-6 px-2 text-xs",disabled:F===C.id,onClick:()=>{$(C.id),L.approveRequest(C.id,e("approvals.response.approved")),setTimeout(()=>$(null),2e3)},children:F===C.id?e("approvals.processing"):e("approvals.approve")}),o.jsx(re,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:F===C.id,onClick:()=>{$(C.id),L.rejectRequest(C.id,e("approvals.response.rejected")),setTimeout(()=>$(null),2e3)},children:F===C.id?e("approvals.processing"):e("approvals.reject")}),o.jsx(re,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",disabled:F===C.id,onClick:()=>{$(C.id),L.requestRevisionRequest(C.id,e("approvals.response.needsRevision")),setTimeout(()=>$(null),2e3)},children:F===C.id?e("approvals.processing"):e("approvals.requestRevision")}),C.filePath&&o.jsx(re,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>L.getApprovalContent(C.id),children:e("approvals.openInEditor")})]})]})})},C.id))}):o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("approvals.noPending")})})():o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:h.length<=1?e("approvals.noPendingDocuments"):e("approvals.selectCategory")})]}),o.jsxs(Ge,{value:"specs",className:"space-y-3",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center justify-center",children:o.jsxs("div",{className:"inline-flex items-center space-x-1 p-1 bg-muted rounded-md",children:[o.jsx(re,{variant:q==="active"?"default":"ghost",size:"sm",className:B("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")}),o.jsx(re,{variant:q==="archived"?"default":"ghost",size:"sm",className:B("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")})]})}),o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsxs("label",{className:"text-sm font-medium",children:[e("specs.specLabel"),":"]}),o.jsxs(lt,{value:q==="active"?c||"":W||"",onValueChange:q==="active"?ir:ee,children:[o.jsx(ut,{className:"w-full",children:o.jsx(dt,{placeholder:e("specs.specPlaceholder")})}),o.jsx(ft,{children:q==="active"?r.filter(w=>!w.isArchived).map(w=>o.jsx(_e,{value:w.name,children:w.displayName},w.name)):i.map(w=>o.jsx(_e,{value:w.name,children:w.displayName},w.name))})]}),q==="active"&&c&&o.jsx(re,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>L.archiveSpec(c),children:e("specs.archive")}),q==="archived"&&W&&o.jsx(re,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs whitespace-nowrap",onClick:()=>L.unarchiveSpec(W),children:e("specs.unarchive")})]})]}),o.jsxs(le,{children:[o.jsx(Et,{className:"pb-2",children:o.jsx(Rt,{className:"text-sm",children:e("specs.docsTitle")})}),o.jsxs(de,{children:[(q==="active"?c:W)&&o.jsx("div",{className:"space-y-2",children:y.length>0?y.map(w=>o.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsxs("div",{className:"font-medium text-sm",children:[o.jsx("span",{className:"capitalize",children:w.name}),".md"]}),w.exists&&w.lastModified&&o.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.modified",{time:Mt(w.lastModified)})}),!w.exists&&o.jsx("div",{className:"text-xs text-muted-foreground",children:e("specs.fileNotFound")})]}),o.jsx(re,{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)):o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("specs.noDocs")})}),!(q==="active"?c:W)&&o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:q==="active"?r.filter(w=>!w.isArchived).length===0?e("specs.noActiveSpecs"):e("specs.selectSpec"):i.length===0?e("specs.noArchivedSpecs"):e("specs.selectSpec")})]})]})]}),o.jsx(Ge,{value:"steering",className:"space-y-3",children:o.jsxs(le,{children:[o.jsx(Et,{className:"pb-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Rt,{className:"text-sm",children:e("steering.title")}),o.jsxs(re,{variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:ba,title:e(O?"steering.copied":"steering.copyInstructions"),children:[o.jsx(Or,{className:"h-3 w-3 mr-1"}),e(O?"steering.copied":"steering.copyInstructions")]})]})}),o.jsx(de,{children:o.jsx("div",{className:"space-y-2",children:S.length>0?S.map(w=>o.jsxs("div",{className:"flex items-center justify-between p-2 border rounded",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsxs("div",{className:"font-medium text-sm",children:[o.jsx("span",{className:"capitalize",children:w.name}),".md"]}),w.exists&&w.lastModified&&o.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.modified",{time:Mt(w.lastModified)})}),!w.exists&&o.jsx("div",{className:"text-xs text-muted-foreground",children:e("steering.fileNotFound")})]}),o.jsx(re,{size:"sm",className:"h-6 px-2 text-xs",disabled:!w.exists,onClick:()=>L.openSteeringDocument(w.name),children:e("steering.open")})]},w.name)):o.jsx("div",{className:"text-center text-muted-foreground text-sm py-8",children:e("steering.noDocs")})})})]})})]}),Q&&o.jsx(re,{className:"fixed bottom-4 right-4 z-20 rounded-full w-10 h-10 p-0 shadow-lg",onClick:Sa,title:e("common.scrollToTop"),children:o.jsx(Cs,{className:"h-4 w-4"})})]})})}const Fr=document.getElementById("root");Fr&&(ka.createRoot(Fr).render(o.jsx(ye.StrictMode,{children:o.jsx(a.Suspense,{fallback:"Loading...",children:o.jsx(Nf,{})})})),document.body.classList.add("loaded"));