teodor-new-chat-ui 4.3.525 → 4.3.526
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -8721,7 +8721,7 @@ function eT({
|
|
|
8721
8721
|
size: "icon",
|
|
8722
8722
|
className: `shrink-0 ${v ?? ""}`,
|
|
8723
8723
|
title: t ? "Save changes" : "Send message",
|
|
8724
|
-
disabled: o || !C.trim() && !f || y,
|
|
8724
|
+
disabled: o || !C.trim() && !f || y || r,
|
|
8725
8725
|
children: /* @__PURE__ */ u.jsx(Ug, { size: 16 })
|
|
8726
8726
|
}
|
|
8727
8727
|
) })
|
package/dist/index.umd.js
CHANGED
|
@@ -76,7 +76,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
76
76
|
`)},Qd=function(){var e=parseInt(document.body.getAttribute(_r)||"0",10);return isFinite(e)?e:0},t0=function(){h.useEffect(function(){return document.body.setAttribute(_r,(Qd()+1).toString()),function(){var e=Qd()-1;e<=0?document.body.removeAttribute(_r):document.body.setAttribute(_r,e.toString())}},[])},n0=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;t0();var s=h.useMemo(function(){return Zy(o)},[o]);return h.createElement(Qy,{styles:e0(s,!t,o,n?"":"!important")})},Sa=!1;if(typeof window<"u")try{var xs=Object.defineProperty({},"passive",{get:function(){return Sa=!0,!0}});window.addEventListener("test",xs,xs),window.removeEventListener("test",xs,xs)}catch{Sa=!1}var Rr=Sa?{passive:!1}:!1,r0=function(e){return e.tagName==="TEXTAREA"},ef=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!r0(e)&&n[t]==="visible")},o0=function(e){return ef(e,"overflowY")},s0=function(e){return ef(e,"overflowX")},tf=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=nf(e,r);if(o){var s=rf(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},i0=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},a0=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},nf=function(e,t){return e==="v"?o0(t):s0(t)},rf=function(e,t){return e==="v"?i0(t):a0(t)},l0=function(e,t){return e==="h"&&t==="rtl"?-1:1},c0=function(e,t,n,r,o){var s=l0(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,d=i>0,p=0,m=0;do{if(!a)break;var f=rf(e,a),v=f[0],g=f[1],x=f[2],y=g-x-s*v;(v||y)&&nf(e,a)&&(p+=y,m+=v);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(p)<1||!d&&Math.abs(m)<1)&&(c=!0),c},vs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},of=function(e){return[e.deltaX,e.deltaY]},sf=function(e){return e&&"current"in e?e.current:e},u0=function(e,t){return e[0]===t[0]&&e[1]===t[1]},d0=function(e){return`
|
|
77
77
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
78
78
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
79
|
-
`)},f0=0,Mr=[];function p0(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(f0++)[0],s=h.useState(Zd)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=My([e.lockRef.current],(e.shards||[]).map(sf),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var y=vs(g),b=n.current,C="deltaX"in g?g.deltaX:b[0]-y[0],k="deltaY"in g?g.deltaY:b[1]-y[1],S,T=g.target,E=Math.abs(C)>Math.abs(k)?"h":"v";if("touches"in g&&E==="h"&&T.type==="range")return!1;var P=tf(E,T);if(!P)return!0;if(P?S=E:(S=E==="v"?"h":"v",P=tf(E,T)),!P)return!1;if(!r.current&&"changedTouches"in g&&(C||k)&&(r.current=S),!S)return!0;var _=r.current||S;return c0(_,x,g,_==="h"?C:k)},[]),l=h.useCallback(function(g){var x=g;if(!(!Mr.length||Mr[Mr.length-1]!==s)){var y="deltaY"in x?of(x):vs(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&u0(S.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(sf).filter(Boolean).filter(function(S){return S.contains(x.target)}),k=C.length>0?a(x,C[0]):!i.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),c=h.useCallback(function(g,x,y,b){var C={name:g,delta:x,target:y,should:b,shadowParent:h0(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(k){return k!==C})},1)},[]),d=h.useCallback(function(g){n.current=vs(g),r.current=void 0},[]),p=h.useCallback(function(g){c(g.type,of(g),g.target,a(g,e.lockRef.current))},[]),m=h.useCallback(function(g){c(g.type,vs(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Mr.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Rr),document.addEventListener("touchmove",l,Rr),document.addEventListener("touchstart",d,Rr),function(){Mr=Mr.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Rr),document.removeEventListener("touchmove",l,Rr),document.removeEventListener("touchstart",d,Rr)}},[]);var f=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:d0(o)}):null,f?h.createElement(n0,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const m0=Uy(Jd,p0);var ws=h.forwardRef(function(e,t){return h.createElement(gs,Cn({},e,{ref:t,sideCar:m0}))});ws.classNames=gs.classNames;var Ca=["Enter"," "],g0=["ArrowDown","PageUp","Home"],af=["ArrowUp","PageDown","End"],x0=[...g0,...af],v0={ltr:[...Ca,"ArrowRight"],rtl:[...Ca,"ArrowLeft"]},w0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},co="Menu",[uo,b0,y0]=Zo(co),[rr,lf]=cn(co,[y0,Pr,Hd]),bs=Pr(),cf=Hd(),[S0,or]=rr(co),[C0,fo]=rr(co),uf=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=bs(t),[l,c]=h.useState(null),d=h.useRef(!1),p=pt(s),m=Qo(o);return h.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),u.jsx(da,{...a,children:u.jsx(S0,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:c,children:u.jsx(C0,{scope:t,onClose:h.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:i,children:r})})})};uf.displayName=co;var T0="MenuAnchor",Ta=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=bs(n);return u.jsx(fa,{...o,...r,ref:t})});Ta.displayName=T0;var ka="MenuPortal",[k0,df]=rr(ka,{forceMount:void 0}),ff=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=or(ka,t);return u.jsx(k0,{scope:t,forceMount:n,children:u.jsx(Ut,{present:n||s.open,children:u.jsx(ao,{asChild:!0,container:o,children:r})})})};ff.displayName=ka;var nn="MenuContent",[E0,Ea]=rr(nn),pf=h.forwardRef((e,t)=>{const n=df(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=or(nn,e.__scopeMenu),i=fo(nn,e.__scopeMenu);return u.jsx(uo.Provider,{scope:e.__scopeMenu,children:u.jsx(Ut,{present:r||s.open,children:u.jsx(uo.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(I0,{...o,ref:t}):u.jsx(N0,{...o,ref:t})})})})}),I0=h.forwardRef((e,t)=>{const n=or(nn,e.__scopeMenu),r=h.useRef(null),o=De(t,r);return h.useEffect(()=>{const s=r.current;if(s)return va(s)},[]),u.jsx(Ia,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ie(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),N0=h.forwardRef((e,t)=>{const n=or(nn,e.__scopeMenu);return u.jsx(Ia,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),A0=Yt.createSlot("MenuContent.ScrollLock"),Ia=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:f,disableOutsideScroll:v,...g}=e,x=or(nn,n),y=fo(nn,n),b=bs(n),C=cf(n),k=b0(n),[S,T]=h.useState(null),E=h.useRef(null),P=De(t,E,x.onContentChange),_=h.useRef(0),$=h.useRef(""),L=h.useRef(0),F=h.useRef(null),G=h.useRef("right"),O=h.useRef(0),K=v?ws:h.Fragment,q=v?{as:A0,allowPinchZoom:!0}:void 0,H=I=>{var N,M;const Y=$.current+I,J=k().filter(U=>!U.disabled),D=document.activeElement,V=(N=J.find(U=>U.ref.current===D))==null?void 0:N.textValue,R=J.map(U=>U.textValue),B=z0(R,Y,V),X=(M=J.find(U=>U.textValue===B))==null?void 0:M.ref.current;(function U(Z){$.current=Z,window.clearTimeout(_.current),Z!==""&&(_.current=window.setTimeout(()=>U(""),1e3))})(Y),X&&setTimeout(()=>X.focus())};h.useEffect(()=>()=>window.clearTimeout(_.current),[]),Yi();const j=h.useCallback(I=>{var J,D;return G.current===((J=F.current)==null?void 0:J.side)&&U0(I,(D=F.current)==null?void 0:D.area)},[]);return u.jsx(E0,{scope:n,searchRef:$,onItemEnter:h.useCallback(I=>{j(I)&&I.preventDefault()},[j]),onItemLeave:h.useCallback(I=>{var Y;j(I)||((Y=E.current)==null||Y.focus(),T(null))},[j]),onTriggerLeave:h.useCallback(I=>{j(I)&&I.preventDefault()},[j]),pointerGraceTimerRef:L,onPointerGraceIntentChange:h.useCallback(I=>{F.current=I},[]),children:u.jsx(K,{...q,children:u.jsx(es,{asChild:!0,trapped:o,onMountAutoFocus:ie(s,I=>{var Y;I.preventDefault(),(Y=E.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(kr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:f,children:u.jsx(Ay,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:T,onEntryFocus:ie(l,I=>{y.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(pa,{role:"menu","aria-orientation":"vertical","data-state":Pf(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:ie(g.onKeyDown,I=>{const J=I.target.closest("[data-radix-menu-content]")===I.currentTarget,D=I.ctrlKey||I.altKey||I.metaKey,V=I.key.length===1;J&&(I.key==="Tab"&&I.preventDefault(),!D&&V&&H(I.key));const R=E.current;if(I.target!==R||!x0.includes(I.key))return;I.preventDefault();const X=k().filter(N=>!N.disabled).map(N=>N.ref.current);af.includes(I.key)&&X.reverse(),F0(X)}),onBlur:ie(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),$.current="")}),onPointerMove:ie(e.onPointerMove,ho(I=>{const Y=I.target,J=O.current!==I.clientX;if(I.currentTarget.contains(Y)&&J){const D=I.clientX>O.current?"right":"left";G.current=D,O.current=I.clientX}}))})})})})})})});pf.displayName=nn;var P0="MenuGroup",Na=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{role:"group",...r,ref:t})});Na.displayName=P0;var j0="MenuLabel",hf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{...r,ref:t})});hf.displayName=j0;var ys="MenuItem",mf="menu.itemSelect",Ss=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=h.useRef(null),i=fo(ys,e.__scopeMenu),a=Ea(ys,e.__scopeMenu),l=De(t,s),c=h.useRef(!1),d=()=>{const p=s.current;if(!n&&p){const m=new CustomEvent(mf,{bubbles:!0,cancelable:!0});p.addEventListener(mf,f=>r==null?void 0:r(f),{once:!0}),Ki(p,m),m.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(gf,{...o,ref:l,disabled:n,onClick:ie(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)==null||m.call(e,p),c.current=!0},onPointerUp:ie(e.onPointerUp,p=>{var m;c.current||(m=p.currentTarget)==null||m.click()}),onKeyDown:ie(e.onKeyDown,p=>{const m=a.searchRef.current!=="";n||m&&p.key===" "||Ca.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ss.displayName=ys;var gf=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ea(ys,n),a=cf(n),l=h.useRef(null),c=De(t,l),[d,p]=h.useState(!1),[m,f]=h.useState("");return h.useEffect(()=>{const v=l.current;v&&f((v.textContent??"").trim())},[s.children]),u.jsx(uo.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:u.jsx(Py,{asChild:!0,...a,focusable:!r,children:u.jsx(fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ie(e.onPointerMove,ho(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(e.onPointerLeave,ho(v=>i.onItemLeave(v))),onFocus:ie(e.onFocus,()=>p(!0)),onBlur:ie(e.onBlur,()=>p(!1))})})})}),_0="MenuCheckboxItem",xf=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return u.jsx(Sf,{scope:e.__scopeMenu,checked:n,children:u.jsx(Ss,{role:"menuitemcheckbox","aria-checked":Cs(n)?"mixed":n,...o,ref:t,"data-state":Pa(n),onSelect:ie(o.onSelect,()=>r==null?void 0:r(Cs(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xf.displayName=_0;var vf="MenuRadioGroup",[R0,M0]=rr(vf,{value:void 0,onValueChange:()=>{}}),wf=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=pt(r);return u.jsx(R0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(Na,{...o,ref:t})})});wf.displayName=vf;var bf="MenuRadioItem",yf=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=M0(bf,e.__scopeMenu),s=n===o.value;return u.jsx(Sf,{scope:e.__scopeMenu,checked:s,children:u.jsx(Ss,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Pa(s),onSelect:ie(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});yf.displayName=bf;var Aa="MenuItemIndicator",[Sf,O0]=rr(Aa,{checked:!1}),Cf=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=O0(Aa,n);return u.jsx(Ut,{present:r||Cs(s.checked)||s.checked===!0,children:u.jsx(fe.span,{...o,ref:t,"data-state":Pa(s.checked)})})});Cf.displayName=Aa;var D0="MenuSeparator",Tf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Tf.displayName=D0;var L0="MenuArrow",kf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=bs(n);return u.jsx(ha,{...o,...r,ref:t})});kf.displayName=L0;var $0="MenuSub",[RN,Ef]=rr($0),po="MenuSubTrigger",If=h.forwardRef((e,t)=>{const n=or(po,e.__scopeMenu),r=fo(po,e.__scopeMenu),o=Ef(po,e.__scopeMenu),s=Ea(po,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),l(null)}},[a,l]),u.jsx(Ta,{asChild:!0,...c,children:u.jsx(gf,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Pf(n.open),...e,ref:Mn(t,o.onTriggerChange),onClick:p=>{var m;(m=e.onClick)==null||m.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ie(e.onPointerMove,ho(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ie(e.onPointerLeave,ho(p=>{var f,v;d();const m=(f=n.content)==null?void 0:f.getBoundingClientRect();if(m){const g=(v=n.content)==null?void 0:v.dataset.side,x=g==="right",y=x?-5:5,b=m[x?"left":"right"],C=m[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+y,y:p.clientY},{x:b,y:m.top},{x:C,y:m.top},{x:C,y:m.bottom},{x:b,y:m.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ie(e.onKeyDown,p=>{var f;const m=s.searchRef.current!=="";e.disabled||m&&p.key===" "||v0[r.dir].includes(p.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),p.preventDefault())})})})});If.displayName=po;var Nf="MenuSubContent",Af=h.forwardRef((e,t)=>{const n=df(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=or(nn,e.__scopeMenu),i=fo(nn,e.__scopeMenu),a=Ef(Nf,e.__scopeMenu),l=h.useRef(null),c=De(t,l);return u.jsx(uo.Provider,{scope:e.__scopeMenu,children:u.jsx(Ut,{present:r||s.open,children:u.jsx(uo.Slot,{scope:e.__scopeMenu,children:u.jsx(Ia,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;i.isUsingKeyboardRef.current&&((p=l.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ie(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ie(e.onKeyDown,d=>{var f;const p=d.currentTarget.contains(d.target),m=w0[i.dir].includes(d.key);p&&m&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),d.preventDefault())})})})})})});Af.displayName=Nf;function Pf(e){return e?"open":"closed"}function Cs(e){return e==="indeterminate"}function Pa(e){return Cs(e)?"indeterminate":e?"checked":"unchecked"}function F0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function B0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function z0(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=B0(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function H0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,p=l.x,m=l.y;d>r!=m>r&&n<(p-c)*(r-d)/(m-d)+c&&(o=!o)}return o}function U0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return H0(n,t)}function ho(e){return t=>t.pointerType==="mouse"?e(t):void 0}var W0=uf,V0=Ta,K0=ff,q0=pf,G0=Na,Y0=hf,X0=Ss,J0=xf,Z0=wf,Q0=yf,eS=Cf,tS=Tf,nS=kf,rS=If,oS=Af,Ts="DropdownMenu",[sS,MN]=cn(Ts,[lf]),$t=lf(),[iS,jf]=sS(Ts),_f=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=$t(t),c=h.useRef(null),[d,p]=On({prop:o,defaultProp:s??!1,onChange:i,caller:Ts});return u.jsx(iS,{scope:t,triggerId:_t(),triggerRef:c,contentId:_t(),open:d,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(m=>!m),[p]),modal:a,children:u.jsx(W0,{...l,open:d,onOpenChange:p,dir:r,modal:a,children:n})})};_f.displayName=Ts;var Rf="DropdownMenuTrigger",Mf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=jf(Rf,n),i=$t(n);return u.jsx(V0,{asChild:!0,...i,children:u.jsx(fe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Mn(t,s.triggerRef),onPointerDown:ie(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ie(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Mf.displayName=Rf;var aS="DropdownMenuPortal",Of=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$t(t);return u.jsx(K0,{...r,...n})};Of.displayName=aS;var Df="DropdownMenuContent",Lf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jf(Df,n),s=$t(n),i=h.useRef(!1);return u.jsx(q0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ie(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(i.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)"}})});Lf.displayName=Df;var lS="DropdownMenuGroup",cS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(G0,{...o,...r,ref:t})});cS.displayName=lS;var uS="DropdownMenuLabel",$f=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Y0,{...o,...r,ref:t})});$f.displayName=uS;var dS="DropdownMenuItem",Ff=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(X0,{...o,...r,ref:t})});Ff.displayName=dS;var fS="DropdownMenuCheckboxItem",Bf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(J0,{...o,...r,ref:t})});Bf.displayName=fS;var pS="DropdownMenuRadioGroup",hS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Z0,{...o,...r,ref:t})});hS.displayName=pS;var mS="DropdownMenuRadioItem",zf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Q0,{...o,...r,ref:t})});zf.displayName=mS;var gS="DropdownMenuItemIndicator",Hf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(eS,{...o,...r,ref:t})});Hf.displayName=gS;var xS="DropdownMenuSeparator",Uf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(tS,{...o,...r,ref:t})});Uf.displayName=xS;var vS="DropdownMenuArrow",wS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(nS,{...o,...r,ref:t})});wS.displayName=vS;var bS="DropdownMenuSubTrigger",Wf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(rS,{...o,...r,ref:t})});Wf.displayName=bS;var yS="DropdownMenuSubContent",Vf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(oS,{...o,...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)"}})});Vf.displayName=yS;var SS=_f,CS=Mf,TS=Of,Kf=Lf,qf=$f,Gf=Ff,Yf=Bf,Xf=zf,Jf=Hf,Zf=Uf,Qf=Wf,ep=Vf;const ks=SS,Es=CS,kS=h.forwardRef(({className:e,inset:t,children:n,...r},o)=>u.jsxs(Qf,{ref:o,className:re("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,u.jsx(ce.ChevronRight,{className:"ml-auto h-4 w-4"})]}));kS.displayName=Qf.displayName;const ES=h.forwardRef(({className:e,...t},n)=>u.jsx(ep,{ref:n,className:re("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}));ES.displayName=ep.displayName;const mo=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(TS,{children:u.jsx(Kf,{ref:r,sideOffset:t,className:re("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})}));mo.displayName=Kf.displayName;const Fn=h.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(Gf,{ref:r,className:re("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}));Fn.displayName=Gf.displayName;const IS=h.forwardRef(({className:e,children:t,checked:n,...r},o)=>u.jsxs(Yf,{ref:o,className:re("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Jf,{children:u.jsx(ce.Check,{className:"h-4 w-4"})})}),t]}));IS.displayName=Yf.displayName;const NS=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Xf,{ref:r,className:re("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Jf,{children:u.jsx(ce.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));NS.displayName=Xf.displayName;const AS=h.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(qf,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));AS.displayName=qf.displayName;const PS=h.forwardRef(({className:e,...t},n)=>u.jsx(Zf,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));PS.displayName=Zf.displayName;const ja=h.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));ja.displayName="Textarea";const jS=1e4;function tp({initialValue:e="",editingMessageId:t=null,placeholder:n="Type your message...",isStreaming:r=!1,disabled:o=!1,maxLength:s=jS,value:i,onValueChange:a,onSend:l,onCancelEdit:c,onStop:d,className:p="",textareaClassName:m="",allowEmptySend:f=!1,sendButtonClassName:v,validate:g,onValidationError:x}){const y=i!==void 0,[b,C]=w.useState(e),k=(y?i:b)??"",[S,T]=w.useTransition(),E=w.useRef(null),P=w.useRef(0),_=w.useRef(null),$=w.useRef("");w.useEffect(()=>{y||(C(e??""),_.current=null,E.current&&(E.current.style.height="auto",E.current.style.height=`${E.current.scrollHeight}px`))},[e,t,y]);const[L,F]=w.useState(null),G=w.useCallback(R=>R.length>s?`Message too long (${R.length}/${s} characters)`:null,[s]),O=w.useMemo(()=>g??G,[g,G]),K=w.useCallback(R=>{const B=O(R);return F(B),x==null||x(B),$.current=R,B},[O,x]),q=w.useCallback(()=>{const R=E.current;R&&(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[]);w.useEffect(()=>{q()},[q,k]),w.useEffect(()=>{if(!L)return;const R=(k??"").trim();$.current!==R&&K(R)},[k,L,K]);const H=w.useCallback((R,{fromUser:B})=>{y||C(R),B&&(a==null||a(R))},[y,a]),j=w.useCallback(async R=>{R&&R.preventDefault();const B=(k??"").trim();if(!B&&!f||K(B))return;const X=++P.current;_.current={id:X,shouldClear:!0},T(()=>{var N,M,U;try{const Z=l(B);Z&&typeof Z.then=="function"?Z.then(()=>{var se,ae;((se=_.current)==null?void 0:se.id)===X&&_.current.shouldClear&&(y||(C(""),E.current&&(E.current.style.height="auto"),a==null||a(""))),((ae=_.current)==null?void 0:ae.id)===X&&(_.current=null)}).catch(()=>{var se;((se=_.current)==null?void 0:se.id)===X&&(_.current=null)}):(((N=_.current)==null?void 0:N.id)===X&&_.current.shouldClear&&(y||(C(""),E.current&&(E.current.style.height="auto"),a==null||a(""))),((M=_.current)==null?void 0:M.id)===X&&(_.current=null))}catch{((U=_.current)==null?void 0:U.id)===X&&(_.current=null)}})},[k,l,f,y,a,K]),I=w.useCallback(R=>{const B=R.target.value;H(B,{fromUser:!0}),_.current&&(_.current.shouldClear=!1),E.current&&(E.current.style.height="auto",E.current.style.height=`${E.current.scrollHeight}px`),L&&K(B.trim())},[H,K,L]),Y=w.useCallback(R=>{R.key==="Enter"&&!R.shiftKey?(R.preventDefault(),j()):R.key==="Escape"&&t&&(R.preventDefault(),c==null||c())},[j,t,c]),V=`resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t?"border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]":""} ${m}`;return u.jsx("form",{onSubmit:R=>void j(R),className:`w-full ${p}`,children:u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(ja,{ref:E,value:k,onChange:I,onKeyDown:Y,placeholder:t?"Edit your message...":n,className:V,disabled:o,maxLength:s,rows:1,spellCheck:!1,autoCorrect:"off"}),L&&u.jsx("p",{className:"mt-1 text-xs text-destructive font-medium",children:L})]}),u.jsx("div",{children:r?u.jsx(Je,{type:"button",onClick:()=>{d==null||d()},size:"icon",variant:"outline",className:"shrink-0",title:"Stop generating",disabled:o||!d,children:u.jsx(ce.Square,{size:16})}):u.jsx(Je,{type:"submit",size:"icon",className:`shrink-0 ${v??""}`,title:t?"Save changes":"Send message",disabled:o||!k.trim()&&!f||S,children:u.jsx(ce.Send,{size:16})})})]})})}const _S=w.memo(tp);function np({composerValue:e,onComposerChange:t,onSend:n,onCancelEdit:r,onStop:o,editingMessageId:s=null,editingInitialValue:i="",placeholder:a="Type your message...",isStreaming:l=!1,disabled:c=!1,textareaClassName:d="",customStyles:p={},enableFileUpload:m=!1,enableExcelUpload:f=!1,onExcelUpload:v,onError:g,allowEmptySend:x=!1,inputError:y=null}){const[b,C]=w.useState([]),k=w.useRef(null),S=w.useRef(null),[T,E]=w.useState(0),[P,_]=w.useState(0),[$,L]=w.useState(!1),[F,G]=w.useState(null),[O,K]=w.useState(null),q=w.useCallback(()=>{k.current&&(k.current.value=""),S.current&&(S.current.value=""),E(R=>R+1),_(R=>R+1)},[]),H=w.useCallback(R=>{C(B=>[...B,...R])},[]),j=w.useCallback(R=>{const B=Array.from(R.target.files||[]);H(B),R.target.value=""},[H]),I=w.useCallback(R=>{C(B=>{const X=B.filter((N,M)=>M!==R);return X.length===0&&q(),X})},[q]),Y=w.useCallback(async R=>{const B=(R.target.files||[])[0];if(B&&(G(null),K(null),!!v)){L(!0);try{await v(B),G(`Uploaded ${B.name} - processing through chat stream`)}catch(X){const N=X instanceof Error?X.message:"Failed to upload Excel file";K(N),g==null||g(N)}finally{L(!1),R.target.value="",q()}}},[v,g,q]),J=w.useMemo(()=>x||b.length>0,[x,b]),D=w.useCallback(async R=>{const X=await n(R,b);return b.length>0&&(C([]),q()),X},[n,q,b]),V=`resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${s?"border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50":""} ${y?"border-red-400":""} ${p.textarea||""} ${d}`;return u.jsxs(u.Fragment,{children:[(m||f)&&u.jsxs("div",{className:"mb-3 space-y-3",children:[m&&u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",multiple:!0,onChange:j,className:"hidden"},T),b.length>0&&u.jsx("div",{className:"flex flex-wrap gap-2",children:b.map((R,B)=>u.jsxs("div",{className:"flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100",children:[u.jsx(ce.Paperclip,{size:14}),u.jsx("span",{className:"truncate max-w-[150px]",children:R.name}),u.jsx(Je,{variant:"ghost",size:"sm",onClick:()=>I(B),className:"h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400","aria-label":`Remove ${R.name}`,children:u.jsx(ce.X,{size:12})})]},B))})]}),f&&u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:S,type:"file",accept:".xls,.xlsx,.xlsm",onChange:Y,className:"hidden"},P),$&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(ce.Loader2,{className:"h-4 w-4 animate-spin"})," Uploading Excel file..."]}),F&&!$&&u.jsx("div",{className:"text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700",children:F}),O&&!$&&u.jsx("div",{className:"text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600",children:O})]})]}),u.jsxs("div",{className:"flex items-end gap-2",children:[(m||f)&&u.jsxs(ks,{children:[u.jsx(Es,{asChild:!0,children:u.jsx(Je,{type:"button",size:"icon",variant:"outline",disabled:l||c,title:"More input actions",className:p.moreButton||"",children:u.jsx(ce.Plus,{size:16})})}),u.jsxs(mo,{align:"start",sideOffset:6,className:"w-52",children:[m&&u.jsxs(Fn,{onClick:()=>{var R;return(R=k.current)==null?void 0:R.click()},className:"cursor-pointer",children:[u.jsx(ce.Paperclip,{className:"h-4 w-4 mr-2"})," Attach files or images"]}),f&&u.jsxs(Fn,{onClick:()=>{var R;$||(R=S.current)==null||R.click()},className:`cursor-pointer ${$?"opacity-60 pointer-events-none":""}`,children:[u.jsx(ce.FileSpreadsheet,{className:"h-4 w-4 mr-2"})," Upload Excel file"]})]})]}),u.jsx("div",{className:"flex-1",children:u.jsx(_S,{initialValue:i,editingMessageId:s,value:e,onValueChange:t,placeholder:s?"Edit your message...":a,isStreaming:l,disabled:c,onSend:D,onCancelEdit:r,onStop:o,allowEmptySend:J,textareaClassName:V,sendButtonClassName:p.sendButton})})]})]})}const RS=w.memo(np),Is=0,Bn=1,Or=2,rp=4;function op(e){return()=>e}function MS(e){e()}function sp(e,t){return n=>e(t(n))}function ip(e,t){return()=>e(t)}function OS(e,t){return n=>e(t,n)}function _a(e){return e!==void 0}function DS(...e){return()=>{e.map(MS)}}function Dr(){}function Ns(e,t){return t(e),e}function LS(e,t){return t(e)}function ot(...e){return e}function Ze(e,t){return e(Bn,t)}function Me(e,t){e(Is,t)}function Ra(e){e(Or)}function ht(e){return e(rp)}function pe(e,t){return Ze(e,OS(t,Is))}function fn(e,t){const n=e(Bn,r=>{n(),t(r)});return n}function ap(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function lp(e,t){return e===t}function st(e=lp){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Se(e){return t=>n=>{e(n)&&t(n)}}function ue(e){return t=>sp(t,e)}function Tn(e){return t=>()=>{t(e)}}function te(e,...t){const n=$S(...t);return(r,o)=>{switch(r){case Or:Ra(e);return;case Bn:return Ze(e,n(o))}}}function kn(e,t){return n=>r=>{n(t=e(t,r))}}function sr(e){return t=>n=>{e>0?e--:t(n)}}function jn(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Le(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);Ze(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>{s([i].concat(t))};n===o?a():r=a}}function $S(...e){return t=>e.reduceRight(LS,t)}function FS(e){let t,n;const r=()=>t==null?void 0:t();return function(o,s){switch(o){case Bn:return s?n===s?void 0:(r(),n=s,t=Ze(e,s),t):(r(),Dr);case Or:r(),n=null;return}}}function oe(e){let t=e;const n=ze();return(r,o)=>{switch(r){case Is:t=o;break;case Bn:{o(t);break}case rp:return t}return n(r,o)}}function Rt(e,t){return Ns(oe(t),n=>pe(e,n))}function ze(){const e=[];return(t,n)=>{switch(t){case Is:e.slice().forEach(r=>{r(n)});return;case Or:e.splice(0,e.length);return;case Bn:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function en(e){return Ns(ze(),t=>pe(e,t))}function Ge(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:BS(),singleton:n}}const BS=()=>Symbol();function zS(e){const t=new Map,n=({constructor:r,dependencies:o,id:s,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=r(o.map(l=>n(l)));return i&&t.set(s,a),a};return n(e)}function xt(...e){const t=ze(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);Ze(s,l=>{n[i]=l,r=r|a,r===o&&Me(t,n)})}),function(s,i){switch(s){case Or:{Ra(t);return}case Bn:return r===o&&i(n),Ze(t,i)}}}function ye(e,t=lp){return te(e,st(t))}function Ma(...e){return function(t,n){switch(t){case Or:return;case Bn:return DS(...e.map(r=>Ze(r,n)))}}}var Wt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Wt||{});const HS={0:"debug",3:"error",1:"log",2:"warn"},US=()=>typeof globalThis>"u"?window:globalThis,zn=Ge(()=>{const e=oe(3);return{log:oe((t,n,r=1)=>{var o;const s=(o=US().VIRTUOSO_LOG_LEVEL)!=null?o:ht(e);r>=s&&console[HS[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function ir(e,t,n){return Oa(e,t,n).callbackRef}function Oa(e,t,n){const r=w.useRef(null);let o=i=>{};const s=w.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const a=()=>{const l=i[0].target;l.offsetParent!==null&&e(l)};n?a():requestAnimationFrame(a)}):null,[e,n]);return o=i=>{i&&t?(s==null||s.observe(i),r.current=i):(r.current&&(s==null||s.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function WS(e,t,n,r,o,s,i,a,l){const c=w.useCallback(d=>{const p=VS(d.children,t,a?"offsetWidth":"offsetHeight",o);let m=d.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const f=m.lastElementChild.dataset.viewportType==="window";let v;f&&(v=m.ownerDocument.defaultView);const g=i?a?i.scrollLeft:i.scrollTop:f?a?v.scrollX||v.document.documentElement.scrollLeft:v.scrollY||v.document.documentElement.scrollTop:a?m.scrollLeft:m.scrollTop,x=i?a?i.scrollWidth:i.scrollHeight:f?a?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:a?m.scrollWidth:m.scrollHeight,y=i?a?i.offsetWidth:i.offsetHeight:f?a?v.innerWidth:v.innerHeight:a?m.offsetWidth:m.offsetHeight;r({scrollHeight:x,scrollTop:Math.max(g,0),viewportHeight:y}),s==null||s(a?cp("column-gap",getComputedStyle(d).columnGap,o):cp("row-gap",getComputedStyle(d).rowGap,o)),p!==null&&e(p)},[e,t,o,s,i,r,a]);return Oa(c,n,l)}function VS(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),d=t(a,n);if(d===0&&r("Zero-sized element, this should not happen",{child:a},Wt.ERROR),d===c)continue;const p=s[s.length-1];s.length===0||p.size!==d||p.endIndex!==l-1?s.push({endIndex:l,size:d,startIndex:l}):s[s.length-1].endIndex++}return s}function cp(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Wt.WARN),t==="normal"?0:parseInt(t??"0",10)}function up(e,t,n){const r=w.useRef(null),o=w.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),d=c.width;let p,m;if(t){const f=t.getBoundingClientRect(),v=c.top-f.top;m=f.height-Math.max(0,v),p=v+t.scrollTop}else{const f=i.current.ownerDocument.defaultView;m=f.innerHeight-Math.max(0,c.top),p=c.top+f.scrollY}r.current={offsetTop:p,visibleHeight:m,visibleWidth:d},e(r.current)},[e,t]),{callbackRef:s,ref:i}=Oa(o,!0,n),a=w.useCallback(()=>{o(i.current)},[o,i]);return w.useEffect(()=>{var l;if(t){t.addEventListener("scroll",a);const c=new ResizeObserver(()=>{requestAnimationFrame(a)});return c.observe(t),()=>{t.removeEventListener("scroll",a),c.unobserve(t)}}else{const c=(l=i.current)==null?void 0:l.ownerDocument.defaultView;return c==null||c.addEventListener("scroll",a),c==null||c.addEventListener("resize",a),()=>{c==null||c.removeEventListener("scroll",a),c==null||c.removeEventListener("resize",a)}}},[a,t,i]),s}const Ft=Ge(()=>{const e=ze(),t=ze(),n=oe(0),r=ze(),o=oe(0),s=ze(),i=ze(),a=oe(0),l=oe(0),c=oe(0),d=oe(0),p=ze(),m=ze(),f=oe(!1),v=oe(!1),g=oe(!1);return pe(te(e,ue(({scrollTop:x})=>x)),t),pe(te(e,ue(({scrollHeight:x})=>x)),i),pe(t,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:d,headerHeight:a,horizontalDirection:v,scrollBy:m,scrollContainerState:e,scrollHeight:i,scrollingInProgress:f,scrollTo:p,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:s}},[],{singleton:!0}),go={lvl:0};function dp(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({end:a-1,start:r,value:o}),r=a,o=l}return s.push({end:1/0,start:r,value:o}),s}function nt(e){return e===go}function xo(e,t){if(!nt(e))return t===e.k?e.v:t<e.k?xo(e.l,t):xo(e.r,t)}function pn(e,t,n="k"){if(nt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=pn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return pn(e.l,t,n)}function tn(e,t,n){return nt(e)?hp(t,n,1):t===e.k?St(e,{k:t,v:n}):t<e.k?mp(St(e,{l:tn(e.l,t,n)})):mp(St(e,{r:tn(e.r,t,n)}))}function Lr(){return go}function As(e,t,n){if(nt(e))return[];const r=pn(e,t)[0];return KS(La(e,r,n))}function Da(e,t){if(nt(e))return go;const{k:n,l:r,r:o}=e;if(t===n){if(nt(r))return o;if(nt(o))return r;{const[s,i]=pp(r);return Ps(St(e,{k:s,l:fp(r),v:i}))}}else return t<n?Ps(St(e,{l:Da(r,t)})):Ps(St(e,{r:Da(o,t)}))}function ar(e){return nt(e)?[]:[...ar(e.l),{k:e.k,v:e.v},...ar(e.r)]}function La(e,t,n){if(nt(e))return[];const{k:r,l:o,r:s,v:i}=e;let a=[];return r>t&&(a=a.concat(La(o,t,n))),r>=t&&r<=n&&a.push({k:r,v:i}),r<=n&&(a=a.concat(La(s,t,n))),a}function Ps(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if($a(t))return gp(St(e,{lvl:n-1}));if(!nt(t)&&!nt(t.r))return St(t.r,{l:St(t,{r:t.r.l}),lvl:n,r:St(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if($a(e))return Fa(St(e,{lvl:n-1}));if(!nt(r)&&!nt(r.l)){const o=r.l,s=$a(o)?r.lvl-1:r.lvl;return St(o,{l:St(e,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:Fa(St(r,{l:o.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function St(e,t){return hp(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function fp(e){return nt(e.r)?e.l:Ps(St(e,{r:fp(e.r)}))}function $a(e){return nt(e)||e.lvl>e.r.lvl}function pp(e){return nt(e.r)?[e.k,e.v]:pp(e.r)}function hp(e,t,n,r=go,o=go){return{k:e,l:r,lvl:n,r:o,v:t}}function mp(e){return Fa(gp(e))}function gp(e){const{l:t}=e;return!nt(t)&&t.lvl===e.lvl?St(t,{r:St(e,{l:t.r})}):e}function Fa(e){const{lvl:t,r:n}=e;return!nt(n)&&!nt(n.r)&&n.lvl===t&&n.r.lvl===t?St(n,{l:St(e,{r:n.l}),lvl:t+1}):e}function KS(e){return dp(e,({k:t,v:n})=>({index:t,value:n}))}function xp(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function vo(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Ba=Ge(()=>({recalcInProgress:oe(!1)}),[],{singleton:!0});function vp(e,t,n){return e[js(e,t,n)]}function js(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function qS(e,t,n,r){const o=js(e,t,r),s=js(e,n,r,o);return e.slice(o,s+1)}function Hn(e,t){return Math.round(e.getBoundingClientRect()[t])}function _s(e){return!nt(e.groupOffsetTree)}function za({index:e},t){return t===e?0:t<e?-1:1}function GS(){return{groupIndices:[],groupOffsetTree:Lr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Lr()}}function YS(e,t){let n=nt(e)?0:1/0;for(const r of t){const{endIndex:o,size:s,startIndex:i}=r;if(n=Math.min(n,i),nt(e)){e=tn(e,0,s);continue}const a=As(e,i-1,o+1);if(a.some(nC(r)))continue;let l=!1,c=!1;for(const{end:d,start:p,value:m}of a)l?(o>=p||s===m)&&(e=Da(e,p)):(c=m!==s,l=!0),d>o&&o>=p&&m!==s&&(e=tn(e,o+1,m));c&&(e=tn(e,i,s))}return[e,n]}function XS(e){return typeof e.groupIndex<"u"}function JS({offset:e},t){return t===e?0:t<e?-1:1}function wo(e,t,n){if(t.length===0)return 0;const{index:r,offset:o,size:s}=vp(t,e,za),i=e-r,a=s*i+(i-1)*n+o;return a>0?a+n:a}function wp(e,t){if(!_s(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function bp(e,t,n){if(XS(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=wp(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function ZS(e,t,n,r=0){return r>0&&(t=Math.max(t,vp(e,r,za).offset)),dp(qS(e,t,n,JS),tC)}function QS(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Wt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&nt(s)&&t.length===2){const m=t[0].size,f=t[1].size;i=n.reduce((v,g)=>tn(tn(v,g,m),g+1,f),i)}else[i,a]=YS(i,t);if(i===s)return e;const{lastIndex:l,lastOffset:c,lastSize:d,offsetTree:p}=Ha(e.offsetTree,a,i,o);return{groupIndices:n,groupOffsetTree:n.reduce((m,f)=>tn(m,f,wo(f,p,o)),Lr()),lastIndex:l,lastOffset:c,lastSize:d,offsetTree:p,sizeTree:i}}function eC(e){return ar(e).map(({k:t,v:n},r,o)=>{const s=o[r+1];return{endIndex:s?s.k-1:1/0,size:n,startIndex:t}})}function yp(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ha(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=js(o,t-1,za),a=o[l].offset;const c=pn(n,t-1);s=c[0],i=c[1],o.length&&o[l].size===pn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:d}of As(n,t,1/0)){const p=c-s,m=p*i+a+p*r;o.push({index:c,offset:m,size:d}),s=c,a=m,i=d}return{lastIndex:s,lastOffset:a,lastSize:i,offsetTree:o}}function tC(e){return{index:e.index,value:e}}function nC(e){const{endIndex:t,size:n,startIndex:r}=e;return o=>o.start===r&&(o.end===t||o.end===1/0)&&o.value===n}const rC={offsetHeight:"height",offsetWidth:"width"},En=Ge(([{log:e},{recalcInProgress:t}])=>{const n=ze(),r=ze(),o=Rt(r,0),s=ze(),i=ze(),a=oe(0),l=oe([]),c=oe(void 0),d=oe(void 0),p=oe((S,T)=>Hn(S,rC[T])),m=oe(void 0),f=oe(0),v=GS(),g=Rt(te(n,Le(l,e,f),kn(QS,v),st()),v),x=Rt(te(l,st(),kn((S,T)=>({current:T,prev:S.current}),{current:[],prev:[]}),ue(({prev:S})=>S)),[]);pe(te(l,Se(S=>S.length>0),Le(g,f),ue(([S,T,E])=>{const P=S.reduce((_,$,L)=>tn(_,$,wo($,T.offsetTree,E)||L),Lr());return{...T,groupIndices:S,groupOffsetTree:P}})),g),pe(te(r,Le(g),Se(([S,{lastIndex:T}])=>S<T),ue(([S,{lastIndex:T,lastSize:E}])=>[{endIndex:T,size:E,startIndex:S}])),n),pe(c,d);const y=Rt(te(c,ue(S=>S===void 0)),!0);pe(te(d,Se(S=>S!==void 0&&nt(ht(g).sizeTree)),ue(S=>[{endIndex:0,size:S,startIndex:0}])),n);const b=en(te(n,Le(g),kn(({sizes:S},[T,E])=>({changed:E!==S,sizes:E}),{changed:!1,sizes:v}),ue(S=>S.changed)));Ze(te(a,kn((S,T)=>({diff:S.prev-T,prev:T}),{diff:0,prev:0}),ue(S=>S.diff)),S=>{const{groupIndices:T}=ht(g);if(S>0)Me(t,!0),Me(s,S+yp(S,T));else if(S<0){const E=ht(x);E.length>0&&(S-=yp(-S,E)),Me(i,S)}}),Ze(te(a,Le(e)),([S,T])=>{S<0&&T("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Wt.ERROR)});const C=en(s);pe(te(s,Le(g),ue(([S,T])=>{const E=T.groupIndices.length>0,P=[],_=T.lastSize;if(E){const $=xo(T.sizeTree,0);let L=0,F=0;for(;L<S;){const O=T.groupIndices[F],K=T.groupIndices.length===F+1?1/0:T.groupIndices[F+1]-O-1;P.push({endIndex:O,size:$,startIndex:O}),P.push({endIndex:O+1+K-1,size:_,startIndex:O+1}),F++,L+=K+1}const G=ar(T.sizeTree);return L!==S&&G.shift(),G.reduce((O,{k:K,v:q})=>{let H=O.ranges;return O.prevSize!==0&&(H=[...O.ranges,{endIndex:K+S-1,size:O.prevSize,startIndex:O.prevIndex}]),{prevIndex:K+S,prevSize:q,ranges:H}},{prevIndex:S,prevSize:0,ranges:P}).ranges}return ar(T.sizeTree).reduce(($,{k:L,v:F})=>({prevIndex:L+S,prevSize:F,ranges:[...$.ranges,{endIndex:L+S-1,size:$.prevSize,startIndex:$.prevIndex}]}),{prevIndex:0,prevSize:_,ranges:[]}).ranges})),n);const k=en(te(i,Le(g,f),ue(([S,{offsetTree:T},E])=>{const P=-S;return wo(P,T,E)})));return pe(te(i,Le(g,f),ue(([S,T,E])=>{if(T.groupIndices.length>0){if(nt(T.sizeTree))return T;let P=Lr();const _=ht(x);let $=0,L=0,F=0;for(;$<-S;){F=_[L];const G=_[L+1]-F-1;L++,$+=G+1}if(P=ar(T.sizeTree).reduce((G,{k:O,v:K})=>tn(G,Math.max(0,O+S),K),P),$!==-S){const G=xo(T.sizeTree,F);P=tn(P,0,G);const O=pn(T.sizeTree,-S+1)[1];P=tn(P,1,O)}return{...T,sizeTree:P,...Ha(T.offsetTree,0,P,E)}}else{const P=ar(T.sizeTree).reduce((_,{k:$,v:L})=>tn(_,Math.max(0,$+S),L),Lr());return{...T,sizeTree:P,...Ha(T.offsetTree,0,P,E)}}})),g),{beforeUnshiftWith:C,data:m,defaultItemSize:d,firstItemIndex:a,fixedItemSize:c,gap:f,groupIndices:l,itemSize:p,listRefresh:b,shiftWith:i,shiftWithOffset:k,sizeRanges:n,sizes:g,statefulTotalCount:o,totalCount:r,trackItemSizes:y,unshiftWith:s}},ot(zn,Ba),{singleton:!0});function oC(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const Sp=Ge(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const s=ze(),i=ze(),a=en(te(s,ue(oC)));return pe(te(a,ue(l=>l.totalCount)),n),pe(te(a,ue(l=>l.groupIndices)),e),pe(te(xt(o,t,r),Se(([l,c])=>_s(c)),ue(([l,c,d])=>pn(c.groupOffsetTree,Math.max(l-d,0),"v")[0]),st(),ue(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},ot(En,Ft)),Un=Ge(([{log:e}])=>{const t=oe(!1),n=en(te(t,Se(r=>r),st()));return Ze(t,r=>{r&&ht(e)("props updated",{},Wt.DEBUG)}),{didMount:n,propsReady:t}},ot(zn),{singleton:!0}),sC=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Cp(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!sC)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const bo=Ge(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:s,footerHeight:i,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:p},{log:m}])=>{const f=ze(),v=ze(),g=oe(0);let x=null,y=null,b=null;function C(){x&&(x(),x=null),b&&(b(),b=null),y&&(clearTimeout(y),y=null),Me(l,!1)}return pe(te(f,Le(n,p,r,g,a,i,m),Le(e,s,o),ue(([[k,S,T,E,P,_,$,L],F,G,O])=>{const K=Cp(k),{align:q,behavior:H,offset:j}=K,I=E-1,Y=bp(K,S,I);let J=wo(Y,S.offsetTree,F)+_;q==="end"?(J+=G+pn(S.sizeTree,Y)[1]-T+O,Y===I&&(J+=$)):q==="center"?J+=(G+pn(S.sizeTree,Y)[1]-T+O)/2:J-=P,j&&(J+=j);const D=V=>{C(),V?(L("retrying to scroll to",{location:k},Wt.DEBUG),Me(f,k)):(Me(v,!0),L("list did not change, scroll successful",{},Wt.DEBUG))};if(C(),H==="smooth"){let V=!1;b=Ze(t,R=>{V=V||R}),x=fn(d,()=>{D(V)})}else x=fn(te(t,iC(150)),D);return y=setTimeout(()=>{C()},1200),Me(l,!0),L("scrolling from index to",{behavior:H,index:Y,top:J},Wt.DEBUG),{behavior:H,top:J}})),c),{scrollTargetReached:v,scrollToIndex:f,topListHeight:g}},ot(En,Ft,zn),{singleton:!0});function iC(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function Ua(e,t){e==0?t():requestAnimationFrame(()=>{Ua(e-1,t)})}function Wa(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const yo=Ge(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:s},{didMount:i}])=>{const a=oe(!0),l=oe(0),c=oe(!0);return pe(te(i,Le(l),Se(([d,p])=>!!p),Tn(!1)),a),pe(te(i,Le(l),Se(([d,p])=>!!p),Tn(!1)),c),Ze(te(xt(t,i),Le(a,n,e,c),Se(([[,d],p,{sizeTree:m},f,v])=>d&&(!nt(m)||_a(f))&&!p&&!v),Le(l)),([,d])=>{fn(o,()=>{Me(c,!0)}),Ua(4,()=>{fn(r,()=>{Me(a,!0)}),Me(s,d)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},ot(En,Ft,bo,Un),{singleton:!0});function Tp(e,t){return Math.abs(e-t)<1.01}const So="up",Co="down",aC="none",lC={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},cC=0,To=Ge(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:s}])=>{const i=oe(!1),a=oe(!0),l=ze(),c=ze(),d=oe(4),p=oe(cC),m=Rt(te(Ma(te(ye(o),sr(1),Tn(!0)),te(ye(o),sr(1),Tn(!1),ap(100))),st()),!1),f=Rt(te(Ma(te(n,Tn(!0)),te(n,Tn(!1),ap(200))),st()),!1);pe(te(xt(ye(o),ye(p)),ue(([b,C])=>b<=C),st()),a),pe(te(a,jn(50)),c);const v=en(te(xt(r,ye(s),ye(t),ye(e),ye(d)),kn((b,[{scrollHeight:C,scrollTop:k},S,T,E,P])=>{const _=k+S-C>-P,$={scrollHeight:C,scrollTop:k,viewportHeight:S};if(_){let F,G;return k>b.state.scrollTop?(F="SCROLLED_DOWN",G=b.state.scrollTop-k):(F="SIZE_DECREASED",G=b.state.scrollTop-k||b.scrollTopDelta),{atBottom:!0,atBottomBecause:F,scrollTopDelta:G,state:$}}let L;return $.scrollHeight>b.state.scrollHeight?L="SIZE_INCREASED":S<b.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":k<b.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:$}},lC),st((b,C)=>b&&b.atBottom===C.atBottom))),g=Rt(te(r,kn((b,{scrollHeight:C,scrollTop:k,viewportHeight:S})=>{if(Tp(b.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:k};{const T=C-(k+S)<1;return b.scrollTop!==k&&T?{changed:!0,jump:b.scrollTop-k,scrollHeight:C,scrollTop:k}:{changed:!0,jump:0,scrollHeight:C,scrollTop:k}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Se(b=>b.changed),ue(b=>b.jump)),0);pe(te(v,ue(b=>b.atBottom)),i),pe(te(i,jn(50)),l);const x=oe(Co);pe(te(r,ue(({scrollTop:b})=>b),st(),kn((b,C)=>ht(f)?{direction:b.direction,prevScrollTop:C}:{direction:C<b.prevScrollTop?So:Co,prevScrollTop:C},{direction:Co,prevScrollTop:0}),ue(b=>b.direction)),x),pe(te(r,jn(50),Tn(aC)),x);const y=oe(0);return pe(te(m,Se(b=>!b),Tn(0)),y),pe(te(o,jn(100),Le(m),Se(([b,C])=>!!C),kn(([b,C],[k])=>[C,k],[0,0]),ue(([b,C])=>C-b)),y),{atBottomState:v,atBottomStateChange:l,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:p,isAtBottom:i,isAtTop:a,isScrolling:m,lastJumpDueToItemResize:g,scrollDirection:x,scrollVelocity:y}},ot(Ft)),Rs="top",Ms="bottom",kp="none";function Ep(e,t,n){return typeof e=="number"?n===So&&t===Rs||n===Co&&t===Ms?e:0:n===So?t===Rs?e.main:e.reverse:t===Ms?e.main:e.reverse}function Ip(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const Va=Ge(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const s=ze(),i=oe(0),a=oe(0),l=oe(0),c=Rt(te(xt(ye(r),ye(o),ye(n),ye(s,vo),ye(l),ye(i),ye(t),ye(e),ye(a)),ue(([d,p,m,[f,v],g,x,y,b,C])=>{const k=d-b,S=x+y,T=Math.max(m-k,0);let E=kp;const P=Ip(C,Rs),_=Ip(C,Ms);return f-=b,f+=m+y,v+=m+y,v-=b,f>d+S-P&&(E=So),v<d-T+p+_&&(E=Co),E!==kp?[Math.max(k-m-Ep(g,Rs,E)-P,0),k-T-y+p+Ep(g,Ms,E)+_]:null}),Se(d=>d!=null),st(vo)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:i,visibleRange:c}},ot(Ft),{singleton:!0});function uC(e,t,n){if(_s(t)){const r=wp(e,t);return[{index:pn(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:r,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const Ka={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Os(e,t,n,r,o,s){const{lastIndex:i,lastOffset:a,lastSize:l}=o;let c=0,d=0;if(e.length>0){c=e[0].offset;const g=e[e.length-1];d=g.offset+g.size}const p=n-i,m=a+p*l+(p-1)*r,f=c,v=m-d;return{bottom:d,firstItemIndex:s,items:Ap(e,o,s),offsetBottom:v,offsetTop:c,top:f,topItems:Ap(t,o,s),topListHeight:t.reduce((g,x)=>x.size+g,0),totalCount:n}}function Np(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const d of n.groupIndices){if(d-i>=e)break;i++}const a=e+i,l=Wa(t,a),c=Array.from({length:a}).map((d,p)=>({data:s[p+l],index:p+l,offset:0,size:0}));return Os(c,[],a,o,n,r)}function Ap(e,t,n){if(e.length===0)return[];if(!_s(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=As(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let d;c.index===a.start?d={index:l,type:"group"}:d={groupIndex:l,index:c.index-(l+1)+n},s.push({...d,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return s}const lr=Ge(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:o},s,{listBoundary:i,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:p},m,{didMount:f},{recalcInProgress:v}])=>{const g=oe([]),x=oe(0),y=ze();pe(s.topItemsIndexes,g);const b=Rt(te(xt(f,v,ye(l,vo),ye(o),ye(r),ye(c),d,ye(g),ye(t),ye(n),e),Se(([T,E,,P,,,,,,,_])=>{const $=_&&_.length!==P;return T&&!E&&!$}),ue(([,,[T,E],P,_,$,L,F,G,O,K])=>{const q=_,{offsetTree:H,sizeTree:j}=q,I=ht(x);if(P===0)return{...Ka,totalCount:P};if(T===0&&E===0)return I===0?{...Ka,totalCount:P}:Np(I,$,_,G,O,K||[]);if(nt(j))return I>0?null:Os(uC(Wa($,P),q,K),[],P,O,q,G);const Y=[];if(F.length>0){const B=F[0],X=F[F.length-1];let N=0;for(const M of As(j,B,X)){const U=M.value,Z=Math.max(M.start,B),se=Math.min(M.end,X);for(let ae=Z;ae<=se;ae++)Y.push({data:K==null?void 0:K[ae],index:ae,offset:N,size:U}),N+=U}}if(!L)return Os([],Y,P,O,q,G);const J=F.length>0?F[F.length-1]+1:0,D=ZS(H,T,E,J);if(D.length===0)return null;const V=P-1,R=Ns([],B=>{for(const X of D){const N=X.value;let M=N.offset,U=X.start;const Z=N.size;if(N.offset<T){U+=Math.floor((T-N.offset+O)/(Z+O));const ae=U-X.start;M+=ae*Z+ae*O}U<J&&(M+=(J-U)*Z,U=J);const se=Math.min(X.end,V);for(let ae=U;ae<=se&&!(M>=E);ae++)B.push({data:K==null?void 0:K[ae],index:ae,offset:M,size:Z}),M+=Z+O}});return Os(R,Y,P,O,q,G)}),Se(T=>T!==null),st()),Ka);pe(te(e,Se(_a),ue(T=>T==null?void 0:T.length)),o),pe(te(b,ue(T=>T.topListHeight)),p),pe(p,a),pe(te(b,ue(T=>[T.top,T.bottom])),i),pe(te(b,ue(T=>T.items)),y);const C=en(te(b,Se(({items:T})=>T.length>0),Le(o,e),Se(([{items:T},E])=>T[T.length-1].originalIndex===E-1),ue(([,T,E])=>[T-1,E]),st(vo),ue(([T])=>T))),k=en(te(b,jn(200),Se(({items:T,topItems:E})=>T.length>0&&T[0].originalIndex===E.length),ue(({items:T})=>T[0].index),st())),S=en(te(b,Se(({items:T})=>T.length>0),ue(({items:T})=>{let E=0,P=T.length-1;for(;T[E].type==="group"&&E<P;)E++;for(;T[P].type==="group"&&P>E;)P--;return{endIndex:T[P].index,startIndex:T[E].index}}),st(xp)));return{endReached:C,initialItemCount:x,itemsRendered:y,listState:b,rangeChanged:S,startReached:k,topItemsIndexes:g,...m}},ot(En,Sp,Va,yo,bo,To,Un,Ba),{singleton:!0}),Pp=Ge(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:o}])=>{const s=ze(),i=Rt(te(xt(n,e,r,t,o),ue(([a,l,c,d,p])=>a+l+c+d+p.offsetBottom+p.bottom)),0);return pe(ye(i),s),{totalListHeight:i,totalListHeightChanged:s}},ot(Ft,lr),{singleton:!0}),dC=Ge(([{viewportHeight:e},{totalListHeight:t}])=>{const n=oe(!1),r=Rt(te(xt(n,e,t),Se(([o])=>o),ue(([,o,s])=>Math.max(0,o-s)),jn(0),st()),0);return{alignToBottom:n,paddingTopAddition:r}},ot(Ft,Pp),{singleton:!0}),jp=Ge(()=>({context:oe(null)})),fC=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...o},viewportBottom:s,viewportTop:i})=>t<i?{...o,align:n??"start",behavior:r}:e>s?{...o,align:n??"end",behavior:r}:null,_p=Ge(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:s,scrollingInProgress:i,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const d=ze();return pe(te(d,Le(t,l,n,s,o,r,a),Le(e),ue(([[p,m,f,v,g,x,y,b],C])=>{const{align:k,behavior:S,calculateViewLocation:T=fC,done:E,...P}=p,_=bp(p,m,v-1),$=wo(_,m.offsetTree,C)+g+x,L=$+pn(m.sizeTree,_)[1],F=b+x,G=b+f-y,O=T({itemBottom:L,itemTop:$,locationParams:{align:k,behavior:S,...P},viewportBottom:G,viewportTop:F});return O?E&&fn(te(i,Se(K=>!K),sr(ht(i)?1:2)),E):E&&E(),O}),Se(p=>p!==null)),c),{scrollIntoView:d}},ot(En,Ft,bo,lr,zn),{singleton:!0});function Rp(e){return e?e==="smooth"?"smooth":"auto":!1}const pC=(e,t)=>typeof e=="function"?Rp(e(t)):t&&Rp(e),hC=Ge(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:o,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:d},{scrollingInProgress:p},{context:m},{scrollIntoView:f}])=>{const v=oe(!1),g=ze();let x=null;function y(S){Me(i,{align:"end",behavior:S,index:"LAST"})}Ze(te(xt(te(ye(t),sr(1)),l),Le(ye(v),s,a,p),ue(([[S,T],E,P,_,$])=>{let L=T&&_,F="auto";return L&&(F=pC(E,P||$),L=L&&!!F),{followOutputBehavior:F,shouldFollow:L,totalCount:S}}),Se(({shouldFollow:S})=>S)),({followOutputBehavior:S,totalCount:T})=>{x&&(x(),x=null),ht(n)?requestAnimationFrame(()=>{ht(d)("following output to ",{totalCount:T},Wt.DEBUG),y(S)}):x=fn(e,()=>{ht(d)("following output to ",{totalCount:T},Wt.DEBUG),y(S),x=null})});function b(S){const T=fn(o,E=>{S&&!E.atBottom&&E.notAtBottomBecause==="SIZE_INCREASED"&&!x&&(ht(d)("scrolling to bottom due to increased size",{},Wt.DEBUG),y("auto"))});setTimeout(T,100)}Ze(te(xt(ye(v),t,c),Se(([S,,T])=>S&&T),kn(({value:S},[,T])=>({refreshed:S===T,value:T}),{refreshed:!1,value:0}),Se(({refreshed:S})=>S),Le(v,t)),([,S])=>{ht(a)&&b(S!==!1)}),Ze(g,()=>{b(ht(v)!==!1)}),Ze(xt(ye(v),o),([S,T])=>{S&&!T.atBottom&&T.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&y("auto")});const C=oe(null),k=ze();return pe(Ma(te(ye(r),ue(S=>{var T;return(T=S==null?void 0:S.length)!=null?T:0})),te(ye(t))),k),Ze(te(xt(te(k,sr(1)),l),Le(ye(C),a,p,m),ue(([[S,T],E,P,_,$])=>T&&P&&(E==null?void 0:E({context:$,totalCount:S,scrollingInProgress:_}))),Se(S=>!!S),jn(0)),S=>{x&&(x(),x=null),ht(n)?requestAnimationFrame(()=>{ht(d)("scrolling into view",{}),Me(f,S)}):x=fn(e,()=>{ht(d)("scrolling into view",{}),Me(f,S),x=null})}),{autoscrollToBottom:g,followOutput:v,scrollIntoViewOnChange:C}},ot(En,To,bo,yo,Un,zn,Ft,jp,_p)),mC=Ge(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(pe(te(a,Le(s),Se(([,l])=>l!==0),Le(o,r,t,n,e),ue(([[,l],c,d,p,m,f=[]])=>Np(l,c,d,p,m,f))),i),{}),ot(En,yo,lr,Un),{singleton:!0}),gC=Ge(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=oe(0);return Ze(te(e,Le(r),Se(([,o])=>o!==0),ue(([,o])=>({top:o}))),o=>{fn(te(n,sr(1),Se(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Me(t,o)})})}),{initialScrollTop:r}},ot(Un,Ft,lr),{singleton:!0}),Mp=Ge(([{scrollVelocity:e}])=>{const t=oe(!1),n=ze(),r=oe(!1);return pe(te(e,Le(r,t,n),Se(([o,s])=>!!s),ue(([o,s,i,a])=>{const{enter:l,exit:c}=s;if(i){if(c(o,a))return!1}else if(l(o,a))return!0;return i}),st()),t),Ze(te(xt(t,e,n),Le(r)),([[o,s,i],a])=>{o&&a&&a.change&&a.change(s,i)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},ot(To),{singleton:!0}),qa=Ge(([{scrollContainerState:e,scrollTo:t}])=>{const n=ze(),r=ze(),o=ze(),s=oe(!1),i=oe(void 0);return pe(te(xt(n,r),ue(([{scrollHeight:a,scrollTop:l,viewportHeight:c},{offsetTop:d}])=>({scrollHeight:a,scrollTop:Math.max(0,l-d),viewportHeight:c}))),e),pe(te(t,Le(r),ue(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},ot(Ft)),xC=Ge(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=ze(),d=oe(void 0),p=oe(null),m=oe(null);return pe(a,p),pe(l,m),Ze(te(c,Le(t,r,i,p,m,n)),([f,v,g,x,y,b,C])=>{const k=eC(v.sizeTree);x&&y!==null&&b!==null&&(g=y.scrollTop-b.offsetTop),g-=C,f({ranges:k,scrollTop:g})}),pe(te(d,Se(_a),ue(vC)),o),pe(te(s,Le(d),Se(([,f])=>f!==void 0),st(),ue(([,f])=>f.ranges)),e),{getState:c,restoreStateFrom:d}},ot(En,Ft,yo,Un,qa));function vC(e){return{align:"start",index:0,offset:e.scrollTop}}const wC=Ge(([{topItemsIndexes:e}])=>{const t=oe(0);return pe(te(t,Se(n=>n>=0),ue(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},ot(lr));function Op(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const bC=Op(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),yC=Ge(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:d,shiftWithOffset:p,sizes:m},{log:f},{recalcInProgress:v}])=>{const g=en(te(l,Le(i),kn(([,y,b,C],[{bottom:k,items:S,offsetBottom:T,totalCount:E},P])=>{const _=k+T;let $=0;return b===E&&y.length>0&&S.length>0&&(S[0].originalIndex===0&&y[0].originalIndex===0||($=_-C,$!==0&&($+=P))),[$,S,E,_]},[0,[],0,0]),Se(([y])=>y!==0),Le(r,a,n,o,f,v),Se(([,y,b,C,,,k])=>!k&&!C&&y!==0&&b===So),ue(([[y],,,,,b])=>(b("Upward scrolling compensation",{amount:y},Wt.DEBUG),y))));function x(y){y>0?(Me(t,{behavior:"auto",top:-y}),Me(e,0)):(Me(e,0),Me(t,{behavior:"auto",top:-y}))}return Ze(te(g,Le(e,s)),([y,b,C])=>{C&&bC()?Me(e,b-y):x(-y)}),Ze(te(xt(Rt(s,!1),e,v),Se(([y,b,C])=>!y&&!C&&b!==0),ue(([y,b])=>b),jn(1)),x),pe(te(p,ue(y=>({top:-y}))),t),Ze(te(c,Le(m,d),ue(([y,{groupIndices:b,lastSize:C,sizeTree:k},S])=>{function T(E){return E*(C+S)}if(b.length===0)return T(y);{let E=0;const P=xo(k,0);let _=0,$=0;for(;_<y;){_++,E+=P;let L=b.length===$+1?1/0:b[$+1]-b[$]-1;_+L>y&&(E-=P,L=y-_+1),_+=L,E+=T(L),$++}return E}})),y=>{Me(e,y),requestAnimationFrame(()=>{Me(t,{top:y}),requestAnimationFrame(()=>{Me(e,0),Me(v,!1)})})}),{deviation:e}},ot(Ft,To,lr,En,zn,Ba)),SC=Ge(([e,t,n,r,o,s,i,a,l,c,d])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c,...d}),ot(Va,mC,Un,Mp,Pp,gC,dC,qa,_p,zn,jp)),Dp=Ge(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:s,itemSize:i,sizeRanges:a,sizes:l,statefulTotalCount:c,totalCount:d,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:f,scrolledToInitialItem:v},g,x,y,{listState:b,topItemsIndexes:C,...k},{scrollToIndex:S},T,{topItemCount:E},{groupCounts:P},_])=>(pe(k.rangeChanged,_.scrollSeekRangeChanged),pe(te(_.windowViewportRect,ue($=>$.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:P,initialItemFinalLocationReached:m,initialTopMostItemIndex:f,scrolledToInitialItem:v,sizeRanges:a,topItemCount:E,topItemsIndexes:C,totalCount:d,...y,groupIndices:s,itemSize:i,listState:b,scrollToIndex:S,statefulTotalCount:c,trackItemSizes:p,...k,..._,...g,sizes:l,...x}),ot(En,yo,Ft,xC,hC,lr,bo,yC,wC,Sp,SC));function CC(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)Object.hasOwn(r,i)||(n[i]=t[i]);return n}const Ds=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Lp(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=w.createContext({});function l(x,y){x.propsReady&&Me(x.propsReady,!1);for(const b of r){const C=x[t.required[b]];Me(C,y[b])}for(const b of o)if(b in y){const C=x[t.optional[b]];Me(C,y[b])}x.propsReady&&Me(x.propsReady,!0)}function c(x){return s.reduce((y,b)=>(y[b]=C=>{const k=x[t.methods[b]];Me(k,C)},y),{})}function d(x){return i.reduce((y,b)=>(y[b]=FS(x[t.events[b]]),y),{})}const p=w.forwardRef((x,y)=>{const{children:b,...C}=x,[k]=w.useState(()=>Ns(zS(e),E=>{l(E,C)})),[S]=w.useState(ip(d,k));Ds(()=>{for(const E of i)E in C&&Ze(S[E],C[E]);return()=>{Object.values(S).map(Ra)}},[C,S,k]),Ds(()=>{l(k,C)}),w.useImperativeHandle(y,op(c(k)));const T=n;return u.jsx(a.Provider,{value:k,children:n?u.jsx(T,{...CC([...r,...o,...i],C),children:b}):b})}),m=x=>{const y=w.useContext(a);return w.useCallback(b=>{Me(y[x],b)},[y,x])},f=x=>{const y=w.useContext(a)[x],b=w.useCallback(C=>Ze(y,C),[y]);return w.useSyncExternalStore(b,()=>ht(y),()=>ht(y))},v=x=>{const y=w.useContext(a)[x],[b,C]=w.useState(ip(ht,y));return Ds(()=>Ze(y,k=>{k!==b&&C(op(k))}),[y,b]),b},g=w.version.startsWith("18")?f:v;return{Component:p,useEmitter:(x,y)=>{const b=w.useContext(a)[x];Ds(()=>Ze(b,y),[y,b])},useEmitterValue:g,usePublisher:m}}const $p=w.createContext(void 0),Fp=w.createContext(void 0),Bp=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ga(e){return"self"in e}function TC(e){return"body"in e}function zp(e,t,n,r=Dr,o,s){const i=w.useRef(null),a=w.useRef(null),l=w.useRef(null),c=w.useCallback(m=>{let f,v,g;const x=m.target;if(TC(x)||Ga(x)){const b=Ga(x)?x:x.defaultView;g=s?b.scrollX:b.scrollY,f=s?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight,v=s?b.innerWidth:b.innerHeight}else g=s?x.scrollLeft:x.scrollTop,f=s?x.scrollWidth:x.scrollHeight,v=s?x.offsetWidth:x.offsetHeight;const y=()=>{e({scrollHeight:f,scrollTop:Math.max(g,0),viewportHeight:v})};m.suppressFlushSync?y():Oo.flushSync(y),a.current!==null&&(g===a.current||g<=0||g===f-v)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,s]);w.useEffect(()=>{const m=o||i.current;return r(o||i.current),c({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",c,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",c)}},[i,c,n,r,o]);function d(m){const f=i.current;if(!f||(s?"offsetWidth"in f&&f.offsetWidth===0:"offsetHeight"in f&&f.offsetHeight===0))return;const v=m.behavior==="smooth";let g,x,y;Ga(f)?(x=Math.max(Hn(f.document.documentElement,s?"width":"height"),s?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight),g=s?f.innerWidth:f.innerHeight,y=s?window.scrollX:window.scrollY):(x=f[s?"scrollWidth":"scrollHeight"],g=Hn(f,s?"width":"height"),y=f[s?"scrollLeft":"scrollTop"]);const b=x-g;if(m.top=Math.ceil(Math.max(Math.min(b,m.top),0)),Tp(g,x)||m.top===y){e({scrollHeight:x,scrollTop:y,viewportHeight:g}),v&&t(!0);return}v?(a.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,s&&(m={behavior:m.behavior,left:m.top}),f.scrollTo(m)}function p(m){s&&(m={behavior:m.behavior,left:m.top}),i.current.scrollBy(m)}return{scrollByCallback:p,scrollerRef:i,scrollToCallback:d}}const Ya="-webkit-sticky",Hp="sticky",Xa=Op(()=>{if(typeof document>"u")return Hp;const e=document.createElement("div");return e.style.position=Ya,e.style.position===Ya?Ya:Hp});function Ja(e){return e}const kC=Ge(()=>{const e=oe(a=>`Item ${a}`),t=oe(a=>`Group ${a}`),n=oe({}),r=oe(Ja),o=oe("div"),s=oe(Dr),i=(a,l=null)=>Rt(te(n,ue(c=>c[a]),st()),l);return{components:n,computeItemKey:r,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:o,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),EC=Ge(([e,t])=>({...e,...t}),ot(Dp,kC)),IC=({height:e})=>u.jsx("div",{style:{height:e}}),NC={overflowAnchor:"none",position:Xa(),zIndex:1},Up={overflowAnchor:"none"},AC={...Up,display:"inline-block",height:"100%"},Wp=w.memo(function({showTopList:e=!1}){const t=Ne("listState"),n=rn("sizeRanges"),r=Ne("useWindowScroll"),o=Ne("customScrollParent"),s=rn("windowScrollContainerState"),i=rn("scrollContainerState"),a=o||r?s:i,l=Ne("itemContent"),c=Ne("context"),d=Ne("groupContent"),p=Ne("trackItemSizes"),m=Ne("itemSize"),f=Ne("log"),v=rn("gap"),g=Ne("horizontalDirection"),{callbackRef:x}=WS(n,m,p,e?Dr:a,f,v,o,g,Ne("skipAnimationFrameInResizeObserver")),[y,b]=w.useState(0);Za("deviation",O=>{y!==O&&b(O)});const C=Ne("EmptyPlaceholder"),k=Ne("ScrollSeekPlaceholder")||IC,S=Ne("ListComponent"),T=Ne("ItemComponent"),E=Ne("GroupComponent"),P=Ne("computeItemKey"),_=Ne("isSeeking"),$=Ne("groupIndices").length>0,L=Ne("alignToBottom"),F=Ne("initialItemFinalLocationReached"),G=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:y!==0?y:L?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:y!==0?y:L?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...F?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&C?u.jsx(C,{...Mt(C,c)}):u.jsx(S,{...Mt(S,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:x,style:G,children:(e?t.topItems:t.items).map(O=>{const K=O.originalIndex,q=P(K+t.firstItemIndex,O.data,c);return _?w.createElement(k,{...Mt(k,c),height:O.size,index:O.index,key:q,type:O.type||"item",...O.type==="group"?{}:{groupIndex:O.groupIndex}}):O.type==="group"?w.createElement(E,{...Mt(E,c),"data-index":K,"data-item-index":O.index,"data-known-size":O.size,key:q,style:NC},d(O.index,c)):w.createElement(T,{...Mt(T,c),...RC(T,O.data),"data-index":K,"data-item-group-index":O.groupIndex,"data-item-index":O.index,"data-known-size":O.size,key:q,style:g?AC:Up},$?l(O.index,O.groupIndex,O.data,c):l(O.index,O.data,c))})})}),PC={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},jC={outline:"none",overflowX:"auto",position:"relative"},Ls=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),_C={position:Xa(),top:0,width:"100%",zIndex:1};function Mt(e,t){if(typeof e!="string")return{context:t}}function RC(e,t){return{item:typeof e=="string"?void 0:t}}const MC=w.memo(function(){const e=Ne("HeaderComponent"),t=rn("headerHeight"),n=Ne("HeaderFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,Ne("skipAnimationFrameInResizeObserver")),o=Ne("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),OC=w.memo(function(){const e=Ne("FooterComponent"),t=rn("footerHeight"),n=Ne("HeaderFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,Ne("skipAnimationFrameInResizeObserver")),o=Ne("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null});function Vp({useEmitter:e,useEmitterValue:t,usePublisher:n}){return w.memo(function({children:r,style:o,context:s,...i}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=t("scrollerRef"),p=t("horizontalDirection")||!1,{scrollByCallback:m,scrollerRef:f,scrollToCallback:v}=zp(a,c,l,d,void 0,p);return e("scrollTo",v),e("scrollBy",m),u.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...p?jC:PC,...o},tabIndex:0,...i,...Mt(l,s),children:r})})}function Kp({useEmitter:e,useEmitterValue:t,usePublisher:n}){return w.memo(function({children:r,style:o,context:s,...i}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=t("totalListHeight"),p=t("deviation"),m=t("customScrollParent"),f=w.useRef(null),v=t("scrollerRef"),{scrollByCallback:g,scrollerRef:x,scrollToCallback:y}=zp(a,c,l,v,m);return Bp(()=>{var b;return x.current=m||((b=f.current)==null?void 0:b.ownerDocument.defaultView),()=>{x.current=null}},[x,m]),e("windowScrollTo",y),e("scrollBy",g),u.jsx(l,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...d!==0?{height:d+p}:{}},...i,...Mt(l,s),children:r})})}const DC=({children:e})=>{const t=w.useContext($p),n=rn("viewportHeight"),r=rn("fixedItemHeight"),o=Ne("alignToBottom"),s=Ne("horizontalDirection"),i=w.useMemo(()=>sp(n,l=>Hn(l,s?"width":"height")),[n,s]),a=ir(i,!0,Ne("skipAnimationFrameInResizeObserver"));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),u.jsx("div",{"data-viewport-type":"element",ref:a,style:Ls(o),children:e})},LC=({children:e})=>{const t=w.useContext($p),n=rn("windowViewportRect"),r=rn("fixedItemHeight"),o=Ne("customScrollParent"),s=up(n,o,Ne("skipAnimationFrameInResizeObserver")),i=Ne("alignToBottom");return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),u.jsx("div",{"data-viewport-type":"window",ref:s,style:Ls(i),children:e})},$C=({children:e})=>{const t=Ne("TopItemListComponent")||"div",n=Ne("headerHeight"),r={..._C,marginTop:`${n}px`},o=Ne("context");return u.jsx(t,{style:r,...Mt(t,o),children:e})},FC=w.memo(function(e){const t=Ne("useWindowScroll"),n=Ne("topItemsIndexes").length>0,r=Ne("customScrollParent"),o=Ne("context");return u.jsxs(r||t?HC:zC,{...e,context:o,children:[n&&u.jsx($C,{children:u.jsx(Wp,{showTopList:!0})}),u.jsxs(r||t?LC:DC,{children:[u.jsx(MC,{}),u.jsx(Wp,{}),u.jsx(OC,{})]})]})}),{Component:BC,useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}=Lp(EC,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},FC),zC=Vp({useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}),HC=Kp({useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}),UC=BC;ot(Dp,Ge(()=>{const e=oe(c=>u.jsxs("td",{children:["Item $",c]})),t=oe(null),n=oe(c=>u.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=oe(null),o=oe(null),s=oe({}),i=oe(Ja),a=oe(Dr),l=(c,d=null)=>Rt(te(s,ue(p=>p[c]),st()),d);return{components:s,computeItemKey:i,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}})),Xa();const qp={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},WC={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Gp,floor:$s,max:ko,min:Qa,round:Yp}=Math;function Xp(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({data:n===null?null:n[o+e],index:o+e}))}function VC(e){return{...WC,items:e}}function Fs(e,t){return e&&e.width===t.width&&e.height===t.height}function KC(e,t){return e&&e.column===t.column&&e.row===t.row}const qC=Ge(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:s,scrollBy:i,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:p},m,f,{didMount:v,propsReady:g},{customScrollParent:x,useWindowScroll:y,windowScrollContainerState:b,windowScrollTo:C,windowViewportRect:k},S])=>{const T=oe(0),E=oe(0),P=oe(qp),_=oe({height:0,width:0}),$=oe({height:0,width:0}),L=ze(),F=ze(),G=oe(0),O=oe(null),K=oe({column:0,row:0}),q=ze(),H=ze(),j=oe(!1),I=oe(0),Y=oe(!0),J=oe(!1),D=oe(!1);Ze(te(v,Le(I),Se(([M,U])=>!!U)),()=>{Me(Y,!1)}),Ze(te(xt(v,Y,$,_,I,J),Se(([M,U,Z,se,,ae])=>M&&!U&&Z.height!==0&&se.height!==0&&!ae)),([,,,,M])=>{Me(J,!0),Ua(1,()=>{Me(L,M)}),fn(te(c),()=>{Me(t,[0,0]),Me(Y,!0)})}),pe(te(H,Se(M=>M!=null&&M.scrollTop>0),Tn(0)),E),Ze(te(v,Le(H),Se(([,M])=>M!=null)),([,M])=>{M&&(Me(_,M.viewport),Me($,M.item),Me(K,M.gap),M.scrollTop>0&&(Me(j,!0),fn(te(c,sr(1)),U=>{Me(j,!1)}),Me(l,{top:M.scrollTop})))}),pe(te(_,ue(({height:M})=>M)),p),pe(te(xt(ye(_,Fs),ye($,Fs),ye(K,(M,U)=>M&&M.column===U.column&&M.row===U.row),ye(c)),ue(([M,U,Z,se])=>({gap:Z,item:U,scrollTop:se,viewport:M}))),q),pe(te(xt(ye(T),r,ye(K,KC),ye($,Fs),ye(_,Fs),ye(O),ye(E),ye(j),ye(Y),ye(I)),Se(([,,,,,,,M])=>!M),ue(([M,[U,Z],se,ae,Ce,we,je,,We,Fe])=>{const{column:Ye,row:He}=se,{height:vt,width:wt}=ae,{width:dt}=Ce;if(je===0&&(M===0||dt===0))return qp;if(wt===0){const bt=Wa(Fe,M),mt=bt+Math.max(je-1,0);return VC(Xp(bt,mt,we))}const Ve=Jp(dt,wt,Ye);let Ae,Ke;We?U===0&&Z===0&&je>0?(Ae=0,Ke=je-1):(Ae=Ve*$s((U+He)/(vt+He)),Ke=Ve*Gp((Z+He)/(vt+He))-1,Ke=Qa(M-1,ko(Ke,Ve-1)),Ae=Qa(Ke,ko(0,Ae))):(Ae=0,Ke=-1);const _e=Xp(Ae,Ke,we),{bottom:Be,top:Qe}=Zp(Ce,se,ae,_e),Nt=Gp(M/Ve),et=Nt*vt+(Nt-1)*He-Be;return{bottom:Be,itemHeight:vt,items:_e,itemWidth:wt,offsetBottom:et,offsetTop:Qe,top:Qe}})),P),pe(te(O,Se(M=>M!==null),ue(M=>M.length)),T),pe(te(xt(_,$,P,K),Se(([M,U,{items:Z}])=>Z.length>0&&U.height!==0&&M.height!==0),ue(([M,U,{items:Z},se])=>{const{bottom:ae,top:Ce}=Zp(M,se,U,Z);return[Ce,ae]}),st(vo)),t);const V=oe(!1);pe(te(c,Le(V),ue(([M,U])=>U||M!==0)),V);const R=en(te(xt(P,T),Se(([{items:M}])=>M.length>0),Le(V),Se(([[M,U],Z])=>{const se=M.items[M.items.length-1].index===U-1;return(Z||M.bottom>0&&M.itemHeight>0&&M.offsetBottom===0&&M.items.length===U)&&se}),ue(([[,M]])=>M-1),st())),B=en(te(ye(P),Se(({items:M})=>M.length>0&&M[0].index===0),Tn(0),st())),X=en(te(ye(P),Le(j),Se(([{items:M},U])=>M.length>0&&!U),ue(([{items:M}])=>({endIndex:M[M.length-1].index,startIndex:M[0].index})),st(xp),jn(0)));pe(X,f.scrollSeekRangeChanged),pe(te(L,Le(_,$,T,K),ue(([M,U,Z,se,ae])=>{const Ce=Cp(M),{align:we,behavior:je,offset:We}=Ce;let Fe=Ce.index;Fe==="LAST"&&(Fe=se-1),Fe=ko(0,Fe,Qa(se-1,Fe));let Ye=el(U,ae,Z,Fe);return we==="end"?Ye=Yp(Ye-U.height+Z.height):we==="center"&&(Ye=Yp(Ye-U.height/2+Z.height/2)),We&&(Ye+=We),{behavior:je,top:Ye}})),l);const N=Rt(te(P,ue(M=>M.offsetBottom+M.bottom)),0);return pe(te(k,ue(M=>({height:M.visibleHeight,width:M.visibleWidth}))),_),{customScrollParent:x,data:O,deviation:G,footerHeight:o,gap:K,headerHeight:s,increaseViewportBy:e,initialItemCount:E,itemDimensions:$,overscan:n,restoreStateFrom:H,scrollBy:i,scrollContainerState:a,scrollHeight:F,scrollTo:l,scrollToIndex:L,scrollTop:c,smoothScrollTargetReached:d,totalCount:T,useWindowScroll:y,viewportDimensions:_,windowScrollContainerState:b,windowScrollTo:C,windowViewportRect:k,...f,gridState:P,horizontalDirection:D,initialTopMostItemIndex:I,totalListHeight:N,...m,endReached:R,propsReady:g,rangeChanged:X,startReached:B,stateChanged:q,stateRestoreInProgress:j,...S}},ot(Va,Ft,To,Mp,Un,qa,zn));function Jp(e,t,n){return ko(1,$s((e+n)/($s(t)+n)))}function Zp(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const s=el(e,t,n,r[0].index);return{bottom:el(e,t,n,r[r.length-1].index)+o,top:s}}function el(e,t,n,r){const o=Jp(e.width,n.width,t.column),s=$s(r/o),i=s*n.height+ko(0,s-1)*t.row;return i>0?i+t.row:i}const GC=Ge(()=>{const e=oe(p=>`Item ${p}`),t=oe({}),n=oe(null),r=oe("virtuoso-grid-item"),o=oe("virtuoso-grid-list"),s=oe(Ja),i=oe("div"),a=oe(Dr),l=(p,m=null)=>Rt(te(t,ue(f=>f[p]),st()),m),c=oe(!1),d=oe(!1);return pe(ye(d),c),{components:t,computeItemKey:s,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:i,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),YC=Ge(([e,t])=>({...e,...t}),ot(qC,GC)),XC=w.memo(function(){const e=it("gridState"),t=it("listClassName"),n=it("itemClassName"),r=it("itemContent"),o=it("computeItemKey"),s=it("isSeeking"),i=on("scrollHeight"),a=it("ItemComponent"),l=it("ListComponent"),c=it("ScrollSeekPlaceholder"),d=it("context"),p=on("itemDimensions"),m=on("gap"),f=it("log"),v=it("stateRestoreInProgress"),g=on("reportReadyState"),x=ir(w.useMemo(()=>y=>{const b=y.parentElement.parentElement.scrollHeight;i(b);const C=y.firstChild;if(C){const{height:k,width:S}=C.getBoundingClientRect();p({height:k,width:S})}m({column:eh("column-gap",getComputedStyle(y).columnGap,f),row:eh("row-gap",getComputedStyle(y).rowGap,f)})},[i,p,m,f]),!0,!1);return Bp(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),v?null:u.jsx(l,{className:t,ref:x,...Mt(l,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(y=>{const b=o(y.index,y.data,d);return s?u.jsx(c,{...Mt(c,d),height:e.itemHeight,index:y.index,width:e.itemWidth},b):w.createElement(a,{...Mt(a,d),className:n,"data-index":y.index,key:b},r(y.index,y.data,d))})})}),JC=w.memo(function(){const e=it("HeaderComponent"),t=on("headerHeight"),n=it("headerFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,!1),o=it("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),ZC=w.memo(function(){const e=it("FooterComponent"),t=on("footerHeight"),n=it("headerFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,!1),o=it("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),QC=({children:e})=>{const t=w.useContext(Fp),n=on("itemDimensions"),r=on("viewportDimensions"),o=ir(w.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return w.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),u.jsx("div",{ref:o,style:Ls(!1),children:e})},eT=({children:e})=>{const t=w.useContext(Fp),n=on("windowViewportRect"),r=on("itemDimensions"),o=it("customScrollParent"),s=up(n,o,!1);return w.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),u.jsx("div",{ref:s,style:Ls(!1),children:e})},tT=w.memo(function({...e}){const t=it("useWindowScroll"),n=it("customScrollParent"),r=n||t?rT:nT,o=n||t?eT:QC,s=it("context");return u.jsx(r,{...e,...Mt(r,s),children:u.jsxs(o,{children:[u.jsx(JC,{}),u.jsx(XC,{}),u.jsx(ZC,{})]})})}),{useEmitter:Qp,useEmitterValue:it,usePublisher:on}=Lp(YC,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},tT),nT=Vp({useEmitter:Qp,useEmitterValue:it,usePublisher:on}),rT=Kp({useEmitter:Qp,useEmitterValue:it,usePublisher:on});function eh(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Wt.WARN),t==="normal"?0:parseInt(t??"0",10)}var Bs="Dialog",[th,DN]=cn(Bs),[oT,hn]=th(Bs),nh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c,d]=On({prop:r,defaultProp:o??!1,onChange:s,caller:Bs});return u.jsx(oT,{scope:t,triggerRef:a,contentRef:l,contentId:_t(),titleId:_t(),descriptionId:_t(),open:c,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(p=>!p),[d]),modal:i,children:n})};nh.displayName=Bs;var rh="DialogTrigger",oh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(rh,n),s=De(t,o.triggerRef);return u.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rl(o.open),...r,ref:s,onClick:ie(e.onClick,o.onOpenToggle)})});oh.displayName=rh;var tl="DialogPortal",[sT,sh]=th(tl,{forceMount:void 0}),ih=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=hn(tl,t);return u.jsx(sT,{scope:t,forceMount:n,children:h.Children.map(r,i=>u.jsx(Ut,{present:n||s.open,children:u.jsx(ao,{asChild:!0,container:o,children:i})}))})};ih.displayName=tl;var zs="DialogOverlay",ah=h.forwardRef((e,t)=>{const n=sh(zs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=hn(zs,e.__scopeDialog);return s.modal?u.jsx(Ut,{present:r||s.open,children:u.jsx(aT,{...o,ref:t})}):null});ah.displayName=zs;var iT=Yt.createSlot("DialogOverlay.RemoveScroll"),aT=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(zs,n);return u.jsx(ws,{as:iT,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(fe.div,{"data-state":rl(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cr="DialogContent",lh=h.forwardRef((e,t)=>{const n=sh(cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=hn(cr,e.__scopeDialog);return u.jsx(Ut,{present:r||s.open,children:s.modal?u.jsx(lT,{...o,ref:t}):u.jsx(cT,{...o,ref:t})})});lh.displayName=cr;var lT=h.forwardRef((e,t)=>{const n=hn(cr,e.__scopeDialog),r=h.useRef(null),o=De(t,n.contentRef,r);return h.useEffect(()=>{const s=r.current;if(s)return va(s)},[]),u.jsx(ch,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,s=>s.preventDefault())})}),cT=h.forwardRef((e,t)=>{const n=hn(cr,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return u.jsx(ch,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ch=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=hn(cr,n),l=h.useRef(null),c=De(t,l);return Yi(),u.jsxs(u.Fragment,{children:[u.jsx(es,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(kr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":rl(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(uT,{titleId:a.titleId}),u.jsx(fT,{contentRef:l,descriptionId:a.descriptionId})]})]})}),nl="DialogTitle",uh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(nl,n);return u.jsx(fe.h2,{id:o.titleId,...r,ref:t})});uh.displayName=nl;var dh="DialogDescription",fh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(dh,n);return u.jsx(fe.p,{id:o.descriptionId,...r,ref:t})});fh.displayName=dh;var ph="DialogClose",hh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(ph,n);return u.jsx(fe.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>o.onOpenChange(!1))})});hh.displayName=ph;function rl(e){return e?"open":"closed"}var mh="DialogTitleWarning",[LN,gh]=Ew(mh,{contentName:cr,titleName:nl,docsSlug:"dialog"}),uT=({titleId:e})=>{const t=gh(mh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
79
|
+
`)},f0=0,Mr=[];function p0(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(f0++)[0],s=h.useState(Zd)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=My([e.lockRef.current],(e.shards||[]).map(sf),!0).filter(Boolean);return g.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,x){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var y=vs(g),b=n.current,C="deltaX"in g?g.deltaX:b[0]-y[0],k="deltaY"in g?g.deltaY:b[1]-y[1],S,T=g.target,E=Math.abs(C)>Math.abs(k)?"h":"v";if("touches"in g&&E==="h"&&T.type==="range")return!1;var P=tf(E,T);if(!P)return!0;if(P?S=E:(S=E==="v"?"h":"v",P=tf(E,T)),!P)return!1;if(!r.current&&"changedTouches"in g&&(C||k)&&(r.current=S),!S)return!0;var _=r.current||S;return c0(_,x,g,_==="h"?C:k)},[]),l=h.useCallback(function(g){var x=g;if(!(!Mr.length||Mr[Mr.length-1]!==s)){var y="deltaY"in x?of(x):vs(x),b=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&u0(S.delta,y)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var C=(i.current.shards||[]).map(sf).filter(Boolean).filter(function(S){return S.contains(x.target)}),k=C.length>0?a(x,C[0]):!i.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),c=h.useCallback(function(g,x,y,b){var C={name:g,delta:x,target:y,should:b,shadowParent:h0(y)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(k){return k!==C})},1)},[]),d=h.useCallback(function(g){n.current=vs(g),r.current=void 0},[]),p=h.useCallback(function(g){c(g.type,of(g),g.target,a(g,e.lockRef.current))},[]),m=h.useCallback(function(g){c(g.type,vs(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Mr.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Rr),document.addEventListener("touchmove",l,Rr),document.addEventListener("touchstart",d,Rr),function(){Mr=Mr.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Rr),document.removeEventListener("touchmove",l,Rr),document.removeEventListener("touchstart",d,Rr)}},[]);var f=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:d0(o)}):null,f?h.createElement(n0,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function h0(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const m0=Uy(Jd,p0);var ws=h.forwardRef(function(e,t){return h.createElement(gs,Cn({},e,{ref:t,sideCar:m0}))});ws.classNames=gs.classNames;var Ca=["Enter"," "],g0=["ArrowDown","PageUp","Home"],af=["ArrowUp","PageDown","End"],x0=[...g0,...af],v0={ltr:[...Ca,"ArrowRight"],rtl:[...Ca,"ArrowLeft"]},w0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},co="Menu",[uo,b0,y0]=Zo(co),[rr,lf]=cn(co,[y0,Pr,Hd]),bs=Pr(),cf=Hd(),[S0,or]=rr(co),[C0,fo]=rr(co),uf=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=bs(t),[l,c]=h.useState(null),d=h.useRef(!1),p=pt(s),m=Qo(o);return h.useEffect(()=>{const f=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",f,{capture:!0}),()=>{document.removeEventListener("keydown",f,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),u.jsx(da,{...a,children:u.jsx(S0,{scope:t,open:n,onOpenChange:p,content:l,onContentChange:c,children:u.jsx(C0,{scope:t,onClose:h.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:d,dir:m,modal:i,children:r})})})};uf.displayName=co;var T0="MenuAnchor",Ta=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=bs(n);return u.jsx(fa,{...o,...r,ref:t})});Ta.displayName=T0;var ka="MenuPortal",[k0,df]=rr(ka,{forceMount:void 0}),ff=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=or(ka,t);return u.jsx(k0,{scope:t,forceMount:n,children:u.jsx(Ut,{present:n||s.open,children:u.jsx(ao,{asChild:!0,container:o,children:r})})})};ff.displayName=ka;var nn="MenuContent",[E0,Ea]=rr(nn),pf=h.forwardRef((e,t)=>{const n=df(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=or(nn,e.__scopeMenu),i=fo(nn,e.__scopeMenu);return u.jsx(uo.Provider,{scope:e.__scopeMenu,children:u.jsx(Ut,{present:r||s.open,children:u.jsx(uo.Slot,{scope:e.__scopeMenu,children:i.modal?u.jsx(I0,{...o,ref:t}):u.jsx(N0,{...o,ref:t})})})})}),I0=h.forwardRef((e,t)=>{const n=or(nn,e.__scopeMenu),r=h.useRef(null),o=De(t,r);return h.useEffect(()=>{const s=r.current;if(s)return va(s)},[]),u.jsx(Ia,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ie(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),N0=h.forwardRef((e,t)=>{const n=or(nn,e.__scopeMenu);return u.jsx(Ia,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),A0=Yt.createSlot("MenuContent.ScrollLock"),Ia=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:f,disableOutsideScroll:v,...g}=e,x=or(nn,n),y=fo(nn,n),b=bs(n),C=cf(n),k=b0(n),[S,T]=h.useState(null),E=h.useRef(null),P=De(t,E,x.onContentChange),_=h.useRef(0),$=h.useRef(""),L=h.useRef(0),F=h.useRef(null),G=h.useRef("right"),O=h.useRef(0),K=v?ws:h.Fragment,q=v?{as:A0,allowPinchZoom:!0}:void 0,H=I=>{var N,M;const Y=$.current+I,J=k().filter(U=>!U.disabled),D=document.activeElement,V=(N=J.find(U=>U.ref.current===D))==null?void 0:N.textValue,R=J.map(U=>U.textValue),B=z0(R,Y,V),X=(M=J.find(U=>U.textValue===B))==null?void 0:M.ref.current;(function U(Z){$.current=Z,window.clearTimeout(_.current),Z!==""&&(_.current=window.setTimeout(()=>U(""),1e3))})(Y),X&&setTimeout(()=>X.focus())};h.useEffect(()=>()=>window.clearTimeout(_.current),[]),Yi();const j=h.useCallback(I=>{var J,D;return G.current===((J=F.current)==null?void 0:J.side)&&U0(I,(D=F.current)==null?void 0:D.area)},[]);return u.jsx(E0,{scope:n,searchRef:$,onItemEnter:h.useCallback(I=>{j(I)&&I.preventDefault()},[j]),onItemLeave:h.useCallback(I=>{var Y;j(I)||((Y=E.current)==null||Y.focus(),T(null))},[j]),onTriggerLeave:h.useCallback(I=>{j(I)&&I.preventDefault()},[j]),pointerGraceTimerRef:L,onPointerGraceIntentChange:h.useCallback(I=>{F.current=I},[]),children:u.jsx(K,{...q,children:u.jsx(es,{asChild:!0,trapped:o,onMountAutoFocus:ie(s,I=>{var Y;I.preventDefault(),(Y=E.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:u.jsx(kr,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:f,children:u.jsx(Ay,{asChild:!0,...C,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:T,onEntryFocus:ie(l,I=>{y.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(pa,{role:"menu","aria-orientation":"vertical","data-state":Pf(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:P,style:{outline:"none",...g.style},onKeyDown:ie(g.onKeyDown,I=>{const J=I.target.closest("[data-radix-menu-content]")===I.currentTarget,D=I.ctrlKey||I.altKey||I.metaKey,V=I.key.length===1;J&&(I.key==="Tab"&&I.preventDefault(),!D&&V&&H(I.key));const R=E.current;if(I.target!==R||!x0.includes(I.key))return;I.preventDefault();const X=k().filter(N=>!N.disabled).map(N=>N.ref.current);af.includes(I.key)&&X.reverse(),F0(X)}),onBlur:ie(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),$.current="")}),onPointerMove:ie(e.onPointerMove,ho(I=>{const Y=I.target,J=O.current!==I.clientX;if(I.currentTarget.contains(Y)&&J){const D=I.clientX>O.current?"right":"left";G.current=D,O.current=I.clientX}}))})})})})})})});pf.displayName=nn;var P0="MenuGroup",Na=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{role:"group",...r,ref:t})});Na.displayName=P0;var j0="MenuLabel",hf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{...r,ref:t})});hf.displayName=j0;var ys="MenuItem",mf="menu.itemSelect",Ss=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=h.useRef(null),i=fo(ys,e.__scopeMenu),a=Ea(ys,e.__scopeMenu),l=De(t,s),c=h.useRef(!1),d=()=>{const p=s.current;if(!n&&p){const m=new CustomEvent(mf,{bubbles:!0,cancelable:!0});p.addEventListener(mf,f=>r==null?void 0:r(f),{once:!0}),Ki(p,m),m.defaultPrevented?c.current=!1:i.onClose()}};return u.jsx(gf,{...o,ref:l,disabled:n,onClick:ie(e.onClick,d),onPointerDown:p=>{var m;(m=e.onPointerDown)==null||m.call(e,p),c.current=!0},onPointerUp:ie(e.onPointerUp,p=>{var m;c.current||(m=p.currentTarget)==null||m.click()}),onKeyDown:ie(e.onKeyDown,p=>{const m=a.searchRef.current!=="";n||m&&p.key===" "||Ca.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Ss.displayName=ys;var gf=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Ea(ys,n),a=cf(n),l=h.useRef(null),c=De(t,l),[d,p]=h.useState(!1),[m,f]=h.useState("");return h.useEffect(()=>{const v=l.current;v&&f((v.textContent??"").trim())},[s.children]),u.jsx(uo.ItemSlot,{scope:n,disabled:r,textValue:o??m,children:u.jsx(Py,{asChild:!0,...a,focusable:!r,children:u.jsx(fe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:ie(e.onPointerMove,ho(v=>{r?i.onItemLeave(v):(i.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(e.onPointerLeave,ho(v=>i.onItemLeave(v))),onFocus:ie(e.onFocus,()=>p(!0)),onBlur:ie(e.onBlur,()=>p(!1))})})})}),_0="MenuCheckboxItem",xf=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return u.jsx(Sf,{scope:e.__scopeMenu,checked:n,children:u.jsx(Ss,{role:"menuitemcheckbox","aria-checked":Cs(n)?"mixed":n,...o,ref:t,"data-state":Pa(n),onSelect:ie(o.onSelect,()=>r==null?void 0:r(Cs(n)?!0:!n),{checkForDefaultPrevented:!1})})})});xf.displayName=_0;var vf="MenuRadioGroup",[R0,M0]=rr(vf,{value:void 0,onValueChange:()=>{}}),wf=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=pt(r);return u.jsx(R0,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(Na,{...o,ref:t})})});wf.displayName=vf;var bf="MenuRadioItem",yf=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=M0(bf,e.__scopeMenu),s=n===o.value;return u.jsx(Sf,{scope:e.__scopeMenu,checked:s,children:u.jsx(Ss,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Pa(s),onSelect:ie(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});yf.displayName=bf;var Aa="MenuItemIndicator",[Sf,O0]=rr(Aa,{checked:!1}),Cf=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=O0(Aa,n);return u.jsx(Ut,{present:r||Cs(s.checked)||s.checked===!0,children:u.jsx(fe.span,{...o,ref:t,"data-state":Pa(s.checked)})})});Cf.displayName=Aa;var D0="MenuSeparator",Tf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Tf.displayName=D0;var L0="MenuArrow",kf=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=bs(n);return u.jsx(ha,{...o,...r,ref:t})});kf.displayName=L0;var $0="MenuSub",[RN,Ef]=rr($0),po="MenuSubTrigger",If=h.forwardRef((e,t)=>{const n=or(po,e.__scopeMenu),r=fo(po,e.__scopeMenu),o=Ef(po,e.__scopeMenu),s=Ea(po,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const p=a.current;return()=>{window.clearTimeout(p),l(null)}},[a,l]),u.jsx(Ta,{asChild:!0,...c,children:u.jsx(gf,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":Pf(n.open),...e,ref:Mn(t,o.onTriggerChange),onClick:p=>{var m;(m=e.onClick)==null||m.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ie(e.onPointerMove,ho(p=>{s.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ie(e.onPointerLeave,ho(p=>{var f,v;d();const m=(f=n.content)==null?void 0:f.getBoundingClientRect();if(m){const g=(v=n.content)==null?void 0:v.dataset.side,x=g==="right",y=x?-5:5,b=m[x?"left":"right"],C=m[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:p.clientX+y,y:p.clientY},{x:b,y:m.top},{x:C,y:m.top},{x:C,y:m.bottom},{x:b,y:m.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(p),p.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ie(e.onKeyDown,p=>{var f;const m=s.searchRef.current!=="";e.disabled||m&&p.key===" "||v0[r.dir].includes(p.key)&&(n.onOpenChange(!0),(f=n.content)==null||f.focus(),p.preventDefault())})})})});If.displayName=po;var Nf="MenuSubContent",Af=h.forwardRef((e,t)=>{const n=df(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=or(nn,e.__scopeMenu),i=fo(nn,e.__scopeMenu),a=Ef(Nf,e.__scopeMenu),l=h.useRef(null),c=De(t,l);return u.jsx(uo.Provider,{scope:e.__scopeMenu,children:u.jsx(Ut,{present:r||s.open,children:u.jsx(uo.Slot,{scope:e.__scopeMenu,children:u.jsx(Ia,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var p;i.isUsingKeyboardRef.current&&((p=l.current)==null||p.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ie(e.onEscapeKeyDown,d=>{i.onClose(),d.preventDefault()}),onKeyDown:ie(e.onKeyDown,d=>{var f;const p=d.currentTarget.contains(d.target),m=w0[i.dir].includes(d.key);p&&m&&(s.onOpenChange(!1),(f=a.trigger)==null||f.focus(),d.preventDefault())})})})})})});Af.displayName=Nf;function Pf(e){return e?"open":"closed"}function Cs(e){return e==="indeterminate"}function Pa(e){return Cs(e)?"indeterminate":e?"checked":"unchecked"}function F0(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function B0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function z0(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=B0(e,Math.max(s,0));o.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function H0(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],l=t[i],c=a.x,d=a.y,p=l.x,m=l.y;d>r!=m>r&&n<(p-c)*(r-d)/(m-d)+c&&(o=!o)}return o}function U0(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return H0(n,t)}function ho(e){return t=>t.pointerType==="mouse"?e(t):void 0}var W0=uf,V0=Ta,K0=ff,q0=pf,G0=Na,Y0=hf,X0=Ss,J0=xf,Z0=wf,Q0=yf,eS=Cf,tS=Tf,nS=kf,rS=If,oS=Af,Ts="DropdownMenu",[sS,MN]=cn(Ts,[lf]),$t=lf(),[iS,jf]=sS(Ts),_f=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,l=$t(t),c=h.useRef(null),[d,p]=On({prop:o,defaultProp:s??!1,onChange:i,caller:Ts});return u.jsx(iS,{scope:t,triggerId:_t(),triggerRef:c,contentId:_t(),open:d,onOpenChange:p,onOpenToggle:h.useCallback(()=>p(m=>!m),[p]),modal:a,children:u.jsx(W0,{...l,open:d,onOpenChange:p,dir:r,modal:a,children:n})})};_f.displayName=Ts;var Rf="DropdownMenuTrigger",Mf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=jf(Rf,n),i=$t(n);return u.jsx(V0,{asChild:!0,...i,children:u.jsx(fe.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Mn(t,s.triggerRef),onPointerDown:ie(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ie(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Mf.displayName=Rf;var aS="DropdownMenuPortal",Of=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$t(t);return u.jsx(K0,{...r,...n})};Of.displayName=aS;var Df="DropdownMenuContent",Lf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=jf(Df,n),s=$t(n),i=h.useRef(!1);return u.jsx(q0,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var l;i.current||(l=o.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:ie(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!o.modal||d)&&(i.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)"}})});Lf.displayName=Df;var lS="DropdownMenuGroup",cS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(G0,{...o,...r,ref:t})});cS.displayName=lS;var uS="DropdownMenuLabel",$f=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Y0,{...o,...r,ref:t})});$f.displayName=uS;var dS="DropdownMenuItem",Ff=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(X0,{...o,...r,ref:t})});Ff.displayName=dS;var fS="DropdownMenuCheckboxItem",Bf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(J0,{...o,...r,ref:t})});Bf.displayName=fS;var pS="DropdownMenuRadioGroup",hS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Z0,{...o,...r,ref:t})});hS.displayName=pS;var mS="DropdownMenuRadioItem",zf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(Q0,{...o,...r,ref:t})});zf.displayName=mS;var gS="DropdownMenuItemIndicator",Hf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(eS,{...o,...r,ref:t})});Hf.displayName=gS;var xS="DropdownMenuSeparator",Uf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(tS,{...o,...r,ref:t})});Uf.displayName=xS;var vS="DropdownMenuArrow",wS=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(nS,{...o,...r,ref:t})});wS.displayName=vS;var bS="DropdownMenuSubTrigger",Wf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(rS,{...o,...r,ref:t})});Wf.displayName=bS;var yS="DropdownMenuSubContent",Vf=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$t(n);return u.jsx(oS,{...o,...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)"}})});Vf.displayName=yS;var SS=_f,CS=Mf,TS=Of,Kf=Lf,qf=$f,Gf=Ff,Yf=Bf,Xf=zf,Jf=Hf,Zf=Uf,Qf=Wf,ep=Vf;const ks=SS,Es=CS,kS=h.forwardRef(({className:e,inset:t,children:n,...r},o)=>u.jsxs(Qf,{ref:o,className:re("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,u.jsx(ce.ChevronRight,{className:"ml-auto h-4 w-4"})]}));kS.displayName=Qf.displayName;const ES=h.forwardRef(({className:e,...t},n)=>u.jsx(ep,{ref:n,className:re("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}));ES.displayName=ep.displayName;const mo=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(TS,{children:u.jsx(Kf,{ref:r,sideOffset:t,className:re("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})}));mo.displayName=Kf.displayName;const Fn=h.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(Gf,{ref:r,className:re("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}));Fn.displayName=Gf.displayName;const IS=h.forwardRef(({className:e,children:t,checked:n,...r},o)=>u.jsxs(Yf,{ref:o,className:re("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Jf,{children:u.jsx(ce.Check,{className:"h-4 w-4"})})}),t]}));IS.displayName=Yf.displayName;const NS=h.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(Xf,{ref:r,className:re("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Jf,{children:u.jsx(ce.Circle,{className:"h-2 w-2 fill-current"})})}),t]}));NS.displayName=Xf.displayName;const AS=h.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(qf,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));AS.displayName=qf.displayName;const PS=h.forwardRef(({className:e,...t},n)=>u.jsx(Zf,{ref:n,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));PS.displayName=Zf.displayName;const ja=h.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));ja.displayName="Textarea";const jS=1e4;function tp({initialValue:e="",editingMessageId:t=null,placeholder:n="Type your message...",isStreaming:r=!1,disabled:o=!1,maxLength:s=jS,value:i,onValueChange:a,onSend:l,onCancelEdit:c,onStop:d,className:p="",textareaClassName:m="",allowEmptySend:f=!1,sendButtonClassName:v,validate:g,onValidationError:x}){const y=i!==void 0,[b,C]=w.useState(e),k=(y?i:b)??"",[S,T]=w.useTransition(),E=w.useRef(null),P=w.useRef(0),_=w.useRef(null),$=w.useRef("");w.useEffect(()=>{y||(C(e??""),_.current=null,E.current&&(E.current.style.height="auto",E.current.style.height=`${E.current.scrollHeight}px`))},[e,t,y]);const[L,F]=w.useState(null),G=w.useCallback(R=>R.length>s?`Message too long (${R.length}/${s} characters)`:null,[s]),O=w.useMemo(()=>g??G,[g,G]),K=w.useCallback(R=>{const B=O(R);return F(B),x==null||x(B),$.current=R,B},[O,x]),q=w.useCallback(()=>{const R=E.current;R&&(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[]);w.useEffect(()=>{q()},[q,k]),w.useEffect(()=>{if(!L)return;const R=(k??"").trim();$.current!==R&&K(R)},[k,L,K]);const H=w.useCallback((R,{fromUser:B})=>{y||C(R),B&&(a==null||a(R))},[y,a]),j=w.useCallback(async R=>{R&&R.preventDefault();const B=(k??"").trim();if(!B&&!f||K(B))return;const X=++P.current;_.current={id:X,shouldClear:!0},T(()=>{var N,M,U;try{const Z=l(B);Z&&typeof Z.then=="function"?Z.then(()=>{var se,ae;((se=_.current)==null?void 0:se.id)===X&&_.current.shouldClear&&(y||(C(""),E.current&&(E.current.style.height="auto"),a==null||a(""))),((ae=_.current)==null?void 0:ae.id)===X&&(_.current=null)}).catch(()=>{var se;((se=_.current)==null?void 0:se.id)===X&&(_.current=null)}):(((N=_.current)==null?void 0:N.id)===X&&_.current.shouldClear&&(y||(C(""),E.current&&(E.current.style.height="auto"),a==null||a(""))),((M=_.current)==null?void 0:M.id)===X&&(_.current=null))}catch{((U=_.current)==null?void 0:U.id)===X&&(_.current=null)}})},[k,l,f,y,a,K]),I=w.useCallback(R=>{const B=R.target.value;H(B,{fromUser:!0}),_.current&&(_.current.shouldClear=!1),E.current&&(E.current.style.height="auto",E.current.style.height=`${E.current.scrollHeight}px`),L&&K(B.trim())},[H,K,L]),Y=w.useCallback(R=>{R.key==="Enter"&&!R.shiftKey?(R.preventDefault(),j()):R.key==="Escape"&&t&&(R.preventDefault(),c==null||c())},[j,t,c]),V=`resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${t?"border-[hsl(var(--ring))] bg-[hsl(var(--card))] text-[hsl(var(--card-foreground))] dark:bg-[hsl(var(--card))] dark:text-[hsl(var(--card-foreground))]":""} ${m}`;return u.jsx("form",{onSubmit:R=>void j(R),className:`w-full ${p}`,children:u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx(ja,{ref:E,value:k,onChange:I,onKeyDown:Y,placeholder:t?"Edit your message...":n,className:V,disabled:o,maxLength:s,rows:1,spellCheck:!1,autoCorrect:"off"}),L&&u.jsx("p",{className:"mt-1 text-xs text-destructive font-medium",children:L})]}),u.jsx("div",{children:r?u.jsx(Je,{type:"button",onClick:()=>{d==null||d()},size:"icon",variant:"outline",className:"shrink-0",title:"Stop generating",disabled:o||!d,children:u.jsx(ce.Square,{size:16})}):u.jsx(Je,{type:"submit",size:"icon",className:`shrink-0 ${v??""}`,title:t?"Save changes":"Send message",disabled:o||!k.trim()&&!f||S||r,children:u.jsx(ce.Send,{size:16})})})]})})}const _S=w.memo(tp);function np({composerValue:e,onComposerChange:t,onSend:n,onCancelEdit:r,onStop:o,editingMessageId:s=null,editingInitialValue:i="",placeholder:a="Type your message...",isStreaming:l=!1,disabled:c=!1,textareaClassName:d="",customStyles:p={},enableFileUpload:m=!1,enableExcelUpload:f=!1,onExcelUpload:v,onError:g,allowEmptySend:x=!1,inputError:y=null}){const[b,C]=w.useState([]),k=w.useRef(null),S=w.useRef(null),[T,E]=w.useState(0),[P,_]=w.useState(0),[$,L]=w.useState(!1),[F,G]=w.useState(null),[O,K]=w.useState(null),q=w.useCallback(()=>{k.current&&(k.current.value=""),S.current&&(S.current.value=""),E(R=>R+1),_(R=>R+1)},[]),H=w.useCallback(R=>{C(B=>[...B,...R])},[]),j=w.useCallback(R=>{const B=Array.from(R.target.files||[]);H(B),R.target.value=""},[H]),I=w.useCallback(R=>{C(B=>{const X=B.filter((N,M)=>M!==R);return X.length===0&&q(),X})},[q]),Y=w.useCallback(async R=>{const B=(R.target.files||[])[0];if(B&&(G(null),K(null),!!v)){L(!0);try{await v(B),G(`Uploaded ${B.name} - processing through chat stream`)}catch(X){const N=X instanceof Error?X.message:"Failed to upload Excel file";K(N),g==null||g(N)}finally{L(!1),R.target.value="",q()}}},[v,g,q]),J=w.useMemo(()=>x||b.length>0,[x,b]),D=w.useCallback(async R=>{const X=await n(R,b);return b.length>0&&(C([]),q()),X},[n,q,b]),V=`resize-none min-h-[44px] max-h-[20rem] w-full transition-colors ${s?"border-blue-400 bg-blue-50 text-blue-900 dark:border-blue-500 dark:bg-blue-950/60 dark:text-blue-50":""} ${y?"border-red-400":""} ${p.textarea||""} ${d}`;return u.jsxs(u.Fragment,{children:[(m||f)&&u.jsxs("div",{className:"mb-3 space-y-3",children:[m&&u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:k,type:"file",multiple:!0,onChange:j,className:"hidden"},T),b.length>0&&u.jsx("div",{className:"flex flex-wrap gap-2",children:b.map((R,B)=>u.jsxs("div",{className:"flex items-center gap-2 bg-gray-100 dark:bg-gray-800 rounded-lg px-3 py-2 text-sm text-gray-900 dark:text-gray-100",children:[u.jsx(ce.Paperclip,{size:14}),u.jsx("span",{className:"truncate max-w-[150px]",children:R.name}),u.jsx(Je,{variant:"ghost",size:"sm",onClick:()=>I(B),className:"h-4 w-4 p-0 text-gray-500 dark:text-gray-400 hover:text-red-500 dark:hover:text-red-400","aria-label":`Remove ${R.name}`,children:u.jsx(ce.X,{size:12})})]},B))})]}),f&&u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:S,type:"file",accept:".xls,.xlsx,.xlsm",onChange:Y,className:"hidden"},P),$&&u.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[u.jsx(ce.Loader2,{className:"h-4 w-4 animate-spin"})," Uploading Excel file..."]}),F&&!$&&u.jsx("div",{className:"text-sm rounded border border-emerald-200 bg-emerald-50 px-3 py-2 text-emerald-700",children:F}),O&&!$&&u.jsx("div",{className:"text-sm rounded border border-red-200 bg-red-50 px-3 py-2 text-red-600",children:O})]})]}),u.jsxs("div",{className:"flex items-end gap-2",children:[(m||f)&&u.jsxs(ks,{children:[u.jsx(Es,{asChild:!0,children:u.jsx(Je,{type:"button",size:"icon",variant:"outline",disabled:l||c,title:"More input actions",className:p.moreButton||"",children:u.jsx(ce.Plus,{size:16})})}),u.jsxs(mo,{align:"start",sideOffset:6,className:"w-52",children:[m&&u.jsxs(Fn,{onClick:()=>{var R;return(R=k.current)==null?void 0:R.click()},className:"cursor-pointer",children:[u.jsx(ce.Paperclip,{className:"h-4 w-4 mr-2"})," Attach files or images"]}),f&&u.jsxs(Fn,{onClick:()=>{var R;$||(R=S.current)==null||R.click()},className:`cursor-pointer ${$?"opacity-60 pointer-events-none":""}`,children:[u.jsx(ce.FileSpreadsheet,{className:"h-4 w-4 mr-2"})," Upload Excel file"]})]})]}),u.jsx("div",{className:"flex-1",children:u.jsx(_S,{initialValue:i,editingMessageId:s,value:e,onValueChange:t,placeholder:s?"Edit your message...":a,isStreaming:l,disabled:c,onSend:D,onCancelEdit:r,onStop:o,allowEmptySend:J,textareaClassName:V,sendButtonClassName:p.sendButton})})]})]})}const RS=w.memo(np),Is=0,Bn=1,Or=2,rp=4;function op(e){return()=>e}function MS(e){e()}function sp(e,t){return n=>e(t(n))}function ip(e,t){return()=>e(t)}function OS(e,t){return n=>e(t,n)}function _a(e){return e!==void 0}function DS(...e){return()=>{e.map(MS)}}function Dr(){}function Ns(e,t){return t(e),e}function LS(e,t){return t(e)}function ot(...e){return e}function Ze(e,t){return e(Bn,t)}function Me(e,t){e(Is,t)}function Ra(e){e(Or)}function ht(e){return e(rp)}function pe(e,t){return Ze(e,OS(t,Is))}function fn(e,t){const n=e(Bn,r=>{n(),t(r)});return n}function ap(e){let t,n;return r=>o=>{t=o,n&&clearTimeout(n),n=setTimeout(()=>{r(t)},e)}}function lp(e,t){return e===t}function st(e=lp){let t;return n=>r=>{e(t,r)||(t=r,n(r))}}function Se(e){return t=>n=>{e(n)&&t(n)}}function ue(e){return t=>sp(t,e)}function Tn(e){return t=>()=>{t(e)}}function te(e,...t){const n=$S(...t);return(r,o)=>{switch(r){case Or:Ra(e);return;case Bn:return Ze(e,n(o))}}}function kn(e,t){return n=>r=>{n(t=e(t,r))}}function sr(e){return t=>n=>{e>0?e--:t(n)}}function jn(e){let t=null,n;return r=>o=>{t=o,!n&&(n=setTimeout(()=>{n=void 0,r(t)},e))}}function Le(...e){const t=new Array(e.length);let n=0,r=null;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);Ze(s,l=>{const c=n;n=n|a,t[i]=l,c!==o&&n===o&&r&&(r(),r=null)})}),s=>i=>{const a=()=>{s([i].concat(t))};n===o?a():r=a}}function $S(...e){return t=>e.reduceRight(LS,t)}function FS(e){let t,n;const r=()=>t==null?void 0:t();return function(o,s){switch(o){case Bn:return s?n===s?void 0:(r(),n=s,t=Ze(e,s),t):(r(),Dr);case Or:r(),n=null;return}}}function oe(e){let t=e;const n=ze();return(r,o)=>{switch(r){case Is:t=o;break;case Bn:{o(t);break}case rp:return t}return n(r,o)}}function Rt(e,t){return Ns(oe(t),n=>pe(e,n))}function ze(){const e=[];return(t,n)=>{switch(t){case Is:e.slice().forEach(r=>{r(n)});return;case Or:e.splice(0,e.length);return;case Bn:return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}}}function en(e){return Ns(ze(),t=>pe(e,t))}function Ge(e,t=[],{singleton:n}={singleton:!0}){return{constructor:e,dependencies:t,id:BS(),singleton:n}}const BS=()=>Symbol();function zS(e){const t=new Map,n=({constructor:r,dependencies:o,id:s,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=r(o.map(l=>n(l)));return i&&t.set(s,a),a};return n(e)}function xt(...e){const t=ze(),n=new Array(e.length);let r=0;const o=Math.pow(2,e.length)-1;return e.forEach((s,i)=>{const a=Math.pow(2,i);Ze(s,l=>{n[i]=l,r=r|a,r===o&&Me(t,n)})}),function(s,i){switch(s){case Or:{Ra(t);return}case Bn:return r===o&&i(n),Ze(t,i)}}}function ye(e,t=lp){return te(e,st(t))}function Ma(...e){return function(t,n){switch(t){case Or:return;case Bn:return DS(...e.map(r=>Ze(r,n)))}}}var Wt=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Wt||{});const HS={0:"debug",3:"error",1:"log",2:"warn"},US=()=>typeof globalThis>"u"?window:globalThis,zn=Ge(()=>{const e=oe(3);return{log:oe((t,n,r=1)=>{var o;const s=(o=US().VIRTUOSO_LOG_LEVEL)!=null?o:ht(e);r>=s&&console[HS[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,n)}),logLevel:e}},[],{singleton:!0});function ir(e,t,n){return Oa(e,t,n).callbackRef}function Oa(e,t,n){const r=w.useRef(null);let o=i=>{};const s=w.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const a=()=>{const l=i[0].target;l.offsetParent!==null&&e(l)};n?a():requestAnimationFrame(a)}):null,[e,n]);return o=i=>{i&&t?(s==null||s.observe(i),r.current=i):(r.current&&(s==null||s.unobserve(r.current)),r.current=null)},{callbackRef:o,ref:r}}function WS(e,t,n,r,o,s,i,a,l){const c=w.useCallback(d=>{const p=VS(d.children,t,a?"offsetWidth":"offsetHeight",o);let m=d.parentElement;for(;!m.dataset.virtuosoScroller;)m=m.parentElement;const f=m.lastElementChild.dataset.viewportType==="window";let v;f&&(v=m.ownerDocument.defaultView);const g=i?a?i.scrollLeft:i.scrollTop:f?a?v.scrollX||v.document.documentElement.scrollLeft:v.scrollY||v.document.documentElement.scrollTop:a?m.scrollLeft:m.scrollTop,x=i?a?i.scrollWidth:i.scrollHeight:f?a?v.document.documentElement.scrollWidth:v.document.documentElement.scrollHeight:a?m.scrollWidth:m.scrollHeight,y=i?a?i.offsetWidth:i.offsetHeight:f?a?v.innerWidth:v.innerHeight:a?m.offsetWidth:m.offsetHeight;r({scrollHeight:x,scrollTop:Math.max(g,0),viewportHeight:y}),s==null||s(a?cp("column-gap",getComputedStyle(d).columnGap,o):cp("row-gap",getComputedStyle(d).rowGap,o)),p!==null&&e(p)},[e,t,o,s,i,r,a]);return Oa(c,n,l)}function VS(e,t,n,r){const o=e.length;if(o===0)return null;const s=[];for(let i=0;i<o;i++){const a=e.item(i);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),c=parseFloat(a.dataset.knownSize),d=t(a,n);if(d===0&&r("Zero-sized element, this should not happen",{child:a},Wt.ERROR),d===c)continue;const p=s[s.length-1];s.length===0||p.size!==d||p.endIndex!==l-1?s.push({endIndex:l,size:d,startIndex:l}):s[s.length-1].endIndex++}return s}function cp(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Wt.WARN),t==="normal"?0:parseInt(t??"0",10)}function up(e,t,n){const r=w.useRef(null),o=w.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const c=l.getBoundingClientRect(),d=c.width;let p,m;if(t){const f=t.getBoundingClientRect(),v=c.top-f.top;m=f.height-Math.max(0,v),p=v+t.scrollTop}else{const f=i.current.ownerDocument.defaultView;m=f.innerHeight-Math.max(0,c.top),p=c.top+f.scrollY}r.current={offsetTop:p,visibleHeight:m,visibleWidth:d},e(r.current)},[e,t]),{callbackRef:s,ref:i}=Oa(o,!0,n),a=w.useCallback(()=>{o(i.current)},[o,i]);return w.useEffect(()=>{var l;if(t){t.addEventListener("scroll",a);const c=new ResizeObserver(()=>{requestAnimationFrame(a)});return c.observe(t),()=>{t.removeEventListener("scroll",a),c.unobserve(t)}}else{const c=(l=i.current)==null?void 0:l.ownerDocument.defaultView;return c==null||c.addEventListener("scroll",a),c==null||c.addEventListener("resize",a),()=>{c==null||c.removeEventListener("scroll",a),c==null||c.removeEventListener("resize",a)}}},[a,t,i]),s}const Ft=Ge(()=>{const e=ze(),t=ze(),n=oe(0),r=ze(),o=oe(0),s=ze(),i=ze(),a=oe(0),l=oe(0),c=oe(0),d=oe(0),p=ze(),m=ze(),f=oe(!1),v=oe(!1),g=oe(!1);return pe(te(e,ue(({scrollTop:x})=>x)),t),pe(te(e,ue(({scrollHeight:x})=>x)),i),pe(t,o),{deviation:n,fixedFooterHeight:c,fixedHeaderHeight:l,footerHeight:d,headerHeight:a,horizontalDirection:v,scrollBy:m,scrollContainerState:e,scrollHeight:i,scrollingInProgress:f,scrollTo:p,scrollTop:t,skipAnimationFrameInResizeObserver:g,smoothScrollTargetReached:r,statefulScrollTop:o,viewportHeight:s}},[],{singleton:!0}),go={lvl:0};function dp(e,t){const n=e.length;if(n===0)return[];let{index:r,value:o}=t(e[0]);const s=[];for(let i=1;i<n;i++){const{index:a,value:l}=t(e[i]);s.push({end:a-1,start:r,value:o}),r=a,o=l}return s.push({end:1/0,start:r,value:o}),s}function nt(e){return e===go}function xo(e,t){if(!nt(e))return t===e.k?e.v:t<e.k?xo(e.l,t):xo(e.r,t)}function pn(e,t,n="k"){if(nt(e))return[-1/0,void 0];if(Number(e[n])===t)return[e.k,e.v];if(Number(e[n])<t){const r=pn(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return pn(e.l,t,n)}function tn(e,t,n){return nt(e)?hp(t,n,1):t===e.k?St(e,{k:t,v:n}):t<e.k?mp(St(e,{l:tn(e.l,t,n)})):mp(St(e,{r:tn(e.r,t,n)}))}function Lr(){return go}function As(e,t,n){if(nt(e))return[];const r=pn(e,t)[0];return KS(La(e,r,n))}function Da(e,t){if(nt(e))return go;const{k:n,l:r,r:o}=e;if(t===n){if(nt(r))return o;if(nt(o))return r;{const[s,i]=pp(r);return Ps(St(e,{k:s,l:fp(r),v:i}))}}else return t<n?Ps(St(e,{l:Da(r,t)})):Ps(St(e,{r:Da(o,t)}))}function ar(e){return nt(e)?[]:[...ar(e.l),{k:e.k,v:e.v},...ar(e.r)]}function La(e,t,n){if(nt(e))return[];const{k:r,l:o,r:s,v:i}=e;let a=[];return r>t&&(a=a.concat(La(o,t,n))),r>=t&&r<=n&&a.push({k:r,v:i}),r<=n&&(a=a.concat(La(s,t,n))),a}function Ps(e){const{l:t,lvl:n,r}=e;if(r.lvl>=n-1&&t.lvl>=n-1)return e;if(n>r.lvl+1){if($a(t))return gp(St(e,{lvl:n-1}));if(!nt(t)&&!nt(t.r))return St(t.r,{l:St(t,{r:t.r.l}),lvl:n,r:St(e,{l:t.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if($a(e))return Fa(St(e,{lvl:n-1}));if(!nt(r)&&!nt(r.l)){const o=r.l,s=$a(o)?r.lvl-1:r.lvl;return St(o,{l:St(e,{lvl:n-1,r:o.l}),lvl:o.lvl+1,r:Fa(St(r,{l:o.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function St(e,t){return hp(t.k!==void 0?t.k:e.k,t.v!==void 0?t.v:e.v,t.lvl!==void 0?t.lvl:e.lvl,t.l!==void 0?t.l:e.l,t.r!==void 0?t.r:e.r)}function fp(e){return nt(e.r)?e.l:Ps(St(e,{r:fp(e.r)}))}function $a(e){return nt(e)||e.lvl>e.r.lvl}function pp(e){return nt(e.r)?[e.k,e.v]:pp(e.r)}function hp(e,t,n,r=go,o=go){return{k:e,l:r,lvl:n,r:o,v:t}}function mp(e){return Fa(gp(e))}function gp(e){const{l:t}=e;return!nt(t)&&t.lvl===e.lvl?St(t,{r:St(e,{l:t.r})}):e}function Fa(e){const{lvl:t,r:n}=e;return!nt(n)&&!nt(n.r)&&n.lvl===t&&n.r.lvl===t?St(n,{l:St(e,{r:n.l}),lvl:t+1}):e}function KS(e){return dp(e,({k:t,v:n})=>({index:t,value:n}))}function xp(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function vo(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Ba=Ge(()=>({recalcInProgress:oe(!1)}),[],{singleton:!0});function vp(e,t,n){return e[js(e,t,n)]}function js(e,t,n,r=0){let o=e.length-1;for(;r<=o;){const s=Math.floor((r+o)/2),i=e[s],a=n(i,t);if(a===0)return s;if(a===-1){if(o-r<2)return s-1;o=s-1}else{if(o===r)return s;r=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function qS(e,t,n,r){const o=js(e,t,r),s=js(e,n,r,o);return e.slice(o,s+1)}function Hn(e,t){return Math.round(e.getBoundingClientRect()[t])}function _s(e){return!nt(e.groupOffsetTree)}function za({index:e},t){return t===e?0:t<e?-1:1}function GS(){return{groupIndices:[],groupOffsetTree:Lr(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Lr()}}function YS(e,t){let n=nt(e)?0:1/0;for(const r of t){const{endIndex:o,size:s,startIndex:i}=r;if(n=Math.min(n,i),nt(e)){e=tn(e,0,s);continue}const a=As(e,i-1,o+1);if(a.some(nC(r)))continue;let l=!1,c=!1;for(const{end:d,start:p,value:m}of a)l?(o>=p||s===m)&&(e=Da(e,p)):(c=m!==s,l=!0),d>o&&o>=p&&m!==s&&(e=tn(e,o+1,m));c&&(e=tn(e,i,s))}return[e,n]}function XS(e){return typeof e.groupIndex<"u"}function JS({offset:e},t){return t===e?0:t<e?-1:1}function wo(e,t,n){if(t.length===0)return 0;const{index:r,offset:o,size:s}=vp(t,e,za),i=e-r,a=s*i+(i-1)*n+o;return a>0?a+n:a}function wp(e,t){if(!_s(t))return e;let n=0;for(;t.groupIndices[n]<=e+n;)n++;return e+n}function bp(e,t,n){if(XS(e))return t.groupIndices[e.groupIndex]+1;{const r=e.index==="LAST"?n:e.index;let o=wp(r,t);return o=Math.max(0,o,Math.min(n,o)),o}}function ZS(e,t,n,r=0){return r>0&&(t=Math.max(t,vp(e,r,za).offset)),dp(qS(e,t,n,JS),tC)}function QS(e,[t,n,r,o]){t.length>0&&r("received item sizes",t,Wt.DEBUG);const s=e.sizeTree;let i=s,a=0;if(n.length>0&&nt(s)&&t.length===2){const m=t[0].size,f=t[1].size;i=n.reduce((v,g)=>tn(tn(v,g,m),g+1,f),i)}else[i,a]=YS(i,t);if(i===s)return e;const{lastIndex:l,lastOffset:c,lastSize:d,offsetTree:p}=Ha(e.offsetTree,a,i,o);return{groupIndices:n,groupOffsetTree:n.reduce((m,f)=>tn(m,f,wo(f,p,o)),Lr()),lastIndex:l,lastOffset:c,lastSize:d,offsetTree:p,sizeTree:i}}function eC(e){return ar(e).map(({k:t,v:n},r,o)=>{const s=o[r+1];return{endIndex:s?s.k-1:1/0,size:n,startIndex:t}})}function yp(e,t){let n=0,r=0;for(;n<e;)n+=t[r+1]-t[r]-1,r++;return r-(n===e?0:1)}function Ha(e,t,n,r){let o=e,s=0,i=0,a=0,l=0;if(t!==0){l=js(o,t-1,za),a=o[l].offset;const c=pn(n,t-1);s=c[0],i=c[1],o.length&&o[l].size===pn(n,t)[1]&&(l-=1),o=o.slice(0,l+1)}else o=[];for(const{start:c,value:d}of As(n,t,1/0)){const p=c-s,m=p*i+a+p*r;o.push({index:c,offset:m,size:d}),s=c,a=m,i=d}return{lastIndex:s,lastOffset:a,lastSize:i,offsetTree:o}}function tC(e){return{index:e.index,value:e}}function nC(e){const{endIndex:t,size:n,startIndex:r}=e;return o=>o.start===r&&(o.end===t||o.end===1/0)&&o.value===n}const rC={offsetHeight:"height",offsetWidth:"width"},En=Ge(([{log:e},{recalcInProgress:t}])=>{const n=ze(),r=ze(),o=Rt(r,0),s=ze(),i=ze(),a=oe(0),l=oe([]),c=oe(void 0),d=oe(void 0),p=oe((S,T)=>Hn(S,rC[T])),m=oe(void 0),f=oe(0),v=GS(),g=Rt(te(n,Le(l,e,f),kn(QS,v),st()),v),x=Rt(te(l,st(),kn((S,T)=>({current:T,prev:S.current}),{current:[],prev:[]}),ue(({prev:S})=>S)),[]);pe(te(l,Se(S=>S.length>0),Le(g,f),ue(([S,T,E])=>{const P=S.reduce((_,$,L)=>tn(_,$,wo($,T.offsetTree,E)||L),Lr());return{...T,groupIndices:S,groupOffsetTree:P}})),g),pe(te(r,Le(g),Se(([S,{lastIndex:T}])=>S<T),ue(([S,{lastIndex:T,lastSize:E}])=>[{endIndex:T,size:E,startIndex:S}])),n),pe(c,d);const y=Rt(te(c,ue(S=>S===void 0)),!0);pe(te(d,Se(S=>S!==void 0&&nt(ht(g).sizeTree)),ue(S=>[{endIndex:0,size:S,startIndex:0}])),n);const b=en(te(n,Le(g),kn(({sizes:S},[T,E])=>({changed:E!==S,sizes:E}),{changed:!1,sizes:v}),ue(S=>S.changed)));Ze(te(a,kn((S,T)=>({diff:S.prev-T,prev:T}),{diff:0,prev:0}),ue(S=>S.diff)),S=>{const{groupIndices:T}=ht(g);if(S>0)Me(t,!0),Me(s,S+yp(S,T));else if(S<0){const E=ht(x);E.length>0&&(S-=yp(-S,E)),Me(i,S)}}),Ze(te(a,Le(e)),([S,T])=>{S<0&&T("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:a},Wt.ERROR)});const C=en(s);pe(te(s,Le(g),ue(([S,T])=>{const E=T.groupIndices.length>0,P=[],_=T.lastSize;if(E){const $=xo(T.sizeTree,0);let L=0,F=0;for(;L<S;){const O=T.groupIndices[F],K=T.groupIndices.length===F+1?1/0:T.groupIndices[F+1]-O-1;P.push({endIndex:O,size:$,startIndex:O}),P.push({endIndex:O+1+K-1,size:_,startIndex:O+1}),F++,L+=K+1}const G=ar(T.sizeTree);return L!==S&&G.shift(),G.reduce((O,{k:K,v:q})=>{let H=O.ranges;return O.prevSize!==0&&(H=[...O.ranges,{endIndex:K+S-1,size:O.prevSize,startIndex:O.prevIndex}]),{prevIndex:K+S,prevSize:q,ranges:H}},{prevIndex:S,prevSize:0,ranges:P}).ranges}return ar(T.sizeTree).reduce(($,{k:L,v:F})=>({prevIndex:L+S,prevSize:F,ranges:[...$.ranges,{endIndex:L+S-1,size:$.prevSize,startIndex:$.prevIndex}]}),{prevIndex:0,prevSize:_,ranges:[]}).ranges})),n);const k=en(te(i,Le(g,f),ue(([S,{offsetTree:T},E])=>{const P=-S;return wo(P,T,E)})));return pe(te(i,Le(g,f),ue(([S,T,E])=>{if(T.groupIndices.length>0){if(nt(T.sizeTree))return T;let P=Lr();const _=ht(x);let $=0,L=0,F=0;for(;$<-S;){F=_[L];const G=_[L+1]-F-1;L++,$+=G+1}if(P=ar(T.sizeTree).reduce((G,{k:O,v:K})=>tn(G,Math.max(0,O+S),K),P),$!==-S){const G=xo(T.sizeTree,F);P=tn(P,0,G);const O=pn(T.sizeTree,-S+1)[1];P=tn(P,1,O)}return{...T,sizeTree:P,...Ha(T.offsetTree,0,P,E)}}else{const P=ar(T.sizeTree).reduce((_,{k:$,v:L})=>tn(_,Math.max(0,$+S),L),Lr());return{...T,sizeTree:P,...Ha(T.offsetTree,0,P,E)}}})),g),{beforeUnshiftWith:C,data:m,defaultItemSize:d,firstItemIndex:a,fixedItemSize:c,gap:f,groupIndices:l,itemSize:p,listRefresh:b,shiftWith:i,shiftWithOffset:k,sizeRanges:n,sizes:g,statefulTotalCount:o,totalCount:r,trackItemSizes:y,unshiftWith:s}},ot(zn,Ba),{singleton:!0});function oC(e){return e.reduce((t,n)=>(t.groupIndices.push(t.totalCount),t.totalCount+=n+1,t),{groupIndices:[],totalCount:0})}const Sp=Ge(([{groupIndices:e,sizes:t,totalCount:n},{headerHeight:r,scrollTop:o}])=>{const s=ze(),i=ze(),a=en(te(s,ue(oC)));return pe(te(a,ue(l=>l.totalCount)),n),pe(te(a,ue(l=>l.groupIndices)),e),pe(te(xt(o,t,r),Se(([l,c])=>_s(c)),ue(([l,c,d])=>pn(c.groupOffsetTree,Math.max(l-d,0),"v")[0]),st(),ue(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},ot(En,Ft)),Un=Ge(([{log:e}])=>{const t=oe(!1),n=en(te(t,Se(r=>r),st()));return Ze(t,r=>{r&&ht(e)("props updated",{},Wt.DEBUG)}),{didMount:n,propsReady:t}},ot(zn),{singleton:!0}),sC=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Cp(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!sC)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const bo=Ge(([{gap:e,listRefresh:t,sizes:n,totalCount:r},{fixedFooterHeight:o,fixedHeaderHeight:s,footerHeight:i,headerHeight:a,scrollingInProgress:l,scrollTo:c,smoothScrollTargetReached:d,viewportHeight:p},{log:m}])=>{const f=ze(),v=ze(),g=oe(0);let x=null,y=null,b=null;function C(){x&&(x(),x=null),b&&(b(),b=null),y&&(clearTimeout(y),y=null),Me(l,!1)}return pe(te(f,Le(n,p,r,g,a,i,m),Le(e,s,o),ue(([[k,S,T,E,P,_,$,L],F,G,O])=>{const K=Cp(k),{align:q,behavior:H,offset:j}=K,I=E-1,Y=bp(K,S,I);let J=wo(Y,S.offsetTree,F)+_;q==="end"?(J+=G+pn(S.sizeTree,Y)[1]-T+O,Y===I&&(J+=$)):q==="center"?J+=(G+pn(S.sizeTree,Y)[1]-T+O)/2:J-=P,j&&(J+=j);const D=V=>{C(),V?(L("retrying to scroll to",{location:k},Wt.DEBUG),Me(f,k)):(Me(v,!0),L("list did not change, scroll successful",{},Wt.DEBUG))};if(C(),H==="smooth"){let V=!1;b=Ze(t,R=>{V=V||R}),x=fn(d,()=>{D(V)})}else x=fn(te(t,iC(150)),D);return y=setTimeout(()=>{C()},1200),Me(l,!0),L("scrolling from index to",{behavior:H,index:Y,top:J},Wt.DEBUG),{behavior:H,top:J}})),c),{scrollTargetReached:v,scrollToIndex:f,topListHeight:g}},ot(En,Ft,zn),{singleton:!0});function iC(e){return t=>{const n=setTimeout(()=>{t(!1)},e);return r=>{r&&(t(!0),clearTimeout(n))}}}function Ua(e,t){e==0?t():requestAnimationFrame(()=>{Ua(e-1,t)})}function Wa(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}const yo=Ge(([{defaultItemSize:e,listRefresh:t,sizes:n},{scrollTop:r},{scrollTargetReached:o,scrollToIndex:s},{didMount:i}])=>{const a=oe(!0),l=oe(0),c=oe(!0);return pe(te(i,Le(l),Se(([d,p])=>!!p),Tn(!1)),a),pe(te(i,Le(l),Se(([d,p])=>!!p),Tn(!1)),c),Ze(te(xt(t,i),Le(a,n,e,c),Se(([[,d],p,{sizeTree:m},f,v])=>d&&(!nt(m)||_a(f))&&!p&&!v),Le(l)),([,d])=>{fn(o,()=>{Me(c,!0)}),Ua(4,()=>{fn(r,()=>{Me(a,!0)}),Me(s,d)})}),{initialItemFinalLocationReached:c,initialTopMostItemIndex:l,scrolledToInitialItem:a}},ot(En,Ft,bo,Un),{singleton:!0});function Tp(e,t){return Math.abs(e-t)<1.01}const So="up",Co="down",aC="none",lC={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},cC=0,To=Ge(([{footerHeight:e,headerHeight:t,scrollBy:n,scrollContainerState:r,scrollTop:o,viewportHeight:s}])=>{const i=oe(!1),a=oe(!0),l=ze(),c=ze(),d=oe(4),p=oe(cC),m=Rt(te(Ma(te(ye(o),sr(1),Tn(!0)),te(ye(o),sr(1),Tn(!1),ap(100))),st()),!1),f=Rt(te(Ma(te(n,Tn(!0)),te(n,Tn(!1),ap(200))),st()),!1);pe(te(xt(ye(o),ye(p)),ue(([b,C])=>b<=C),st()),a),pe(te(a,jn(50)),c);const v=en(te(xt(r,ye(s),ye(t),ye(e),ye(d)),kn((b,[{scrollHeight:C,scrollTop:k},S,T,E,P])=>{const _=k+S-C>-P,$={scrollHeight:C,scrollTop:k,viewportHeight:S};if(_){let F,G;return k>b.state.scrollTop?(F="SCROLLED_DOWN",G=b.state.scrollTop-k):(F="SIZE_DECREASED",G=b.state.scrollTop-k||b.scrollTopDelta),{atBottom:!0,atBottomBecause:F,scrollTopDelta:G,state:$}}let L;return $.scrollHeight>b.state.scrollHeight?L="SIZE_INCREASED":S<b.state.viewportHeight?L="VIEWPORT_HEIGHT_DECREASING":k<b.state.scrollTop?L="SCROLLING_UPWARDS":L="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:L,state:$}},lC),st((b,C)=>b&&b.atBottom===C.atBottom))),g=Rt(te(r,kn((b,{scrollHeight:C,scrollTop:k,viewportHeight:S})=>{if(Tp(b.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:k};{const T=C-(k+S)<1;return b.scrollTop!==k&&T?{changed:!0,jump:b.scrollTop-k,scrollHeight:C,scrollTop:k}:{changed:!0,jump:0,scrollHeight:C,scrollTop:k}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),Se(b=>b.changed),ue(b=>b.jump)),0);pe(te(v,ue(b=>b.atBottom)),i),pe(te(i,jn(50)),l);const x=oe(Co);pe(te(r,ue(({scrollTop:b})=>b),st(),kn((b,C)=>ht(f)?{direction:b.direction,prevScrollTop:C}:{direction:C<b.prevScrollTop?So:Co,prevScrollTop:C},{direction:Co,prevScrollTop:0}),ue(b=>b.direction)),x),pe(te(r,jn(50),Tn(aC)),x);const y=oe(0);return pe(te(m,Se(b=>!b),Tn(0)),y),pe(te(o,jn(100),Le(m),Se(([b,C])=>!!C),kn(([b,C],[k])=>[C,k],[0,0]),ue(([b,C])=>C-b)),y),{atBottomState:v,atBottomStateChange:l,atBottomThreshold:d,atTopStateChange:c,atTopThreshold:p,isAtBottom:i,isAtTop:a,isScrolling:m,lastJumpDueToItemResize:g,scrollDirection:x,scrollVelocity:y}},ot(Ft)),Rs="top",Ms="bottom",kp="none";function Ep(e,t,n){return typeof e=="number"?n===So&&t===Rs||n===Co&&t===Ms?e:0:n===So?t===Rs?e.main:e.reverse:t===Ms?e.main:e.reverse}function Ip(e,t){var n;return typeof e=="number"?e:(n=e[t])!=null?n:0}const Va=Ge(([{deviation:e,fixedHeaderHeight:t,headerHeight:n,scrollTop:r,viewportHeight:o}])=>{const s=ze(),i=oe(0),a=oe(0),l=oe(0),c=Rt(te(xt(ye(r),ye(o),ye(n),ye(s,vo),ye(l),ye(i),ye(t),ye(e),ye(a)),ue(([d,p,m,[f,v],g,x,y,b,C])=>{const k=d-b,S=x+y,T=Math.max(m-k,0);let E=kp;const P=Ip(C,Rs),_=Ip(C,Ms);return f-=b,f+=m+y,v+=m+y,v-=b,f>d+S-P&&(E=So),v<d-T+p+_&&(E=Co),E!==kp?[Math.max(k-m-Ep(g,Rs,E)-P,0),k-T-y+p+Ep(g,Ms,E)+_]:null}),Se(d=>d!=null),st(vo)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:i,visibleRange:c}},ot(Ft),{singleton:!0});function uC(e,t,n){if(_s(t)){const r=wp(e,t);return[{index:pn(t.groupOffsetTree,r)[0],offset:0,size:0},{data:n==null?void 0:n[0],index:r,offset:0,size:0}]}return[{data:n==null?void 0:n[0],index:e,offset:0,size:0}]}const Ka={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Os(e,t,n,r,o,s){const{lastIndex:i,lastOffset:a,lastSize:l}=o;let c=0,d=0;if(e.length>0){c=e[0].offset;const g=e[e.length-1];d=g.offset+g.size}const p=n-i,m=a+p*l+(p-1)*r,f=c,v=m-d;return{bottom:d,firstItemIndex:s,items:Ap(e,o,s),offsetBottom:v,offsetTop:c,top:f,topItems:Ap(t,o,s),topListHeight:t.reduce((g,x)=>x.size+g,0),totalCount:n}}function Np(e,t,n,r,o,s){let i=0;if(n.groupIndices.length>0)for(const d of n.groupIndices){if(d-i>=e)break;i++}const a=e+i,l=Wa(t,a),c=Array.from({length:a}).map((d,p)=>({data:s[p+l],index:p+l,offset:0,size:0}));return Os(c,[],a,o,n,r)}function Ap(e,t,n){if(e.length===0)return[];if(!_s(t))return e.map(c=>({...c,index:c.index+n,originalIndex:c.index}));const r=e[0].index,o=e[e.length-1].index,s=[],i=As(t.groupOffsetTree,r,o);let a,l=0;for(const c of e){(!a||a.end<c.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let d;c.index===a.start?d={index:l,type:"group"}:d={groupIndex:l,index:c.index-(l+1)+n},s.push({...d,data:c.data,offset:c.offset,originalIndex:c.index,size:c.size})}return s}const lr=Ge(([{data:e,firstItemIndex:t,gap:n,sizes:r,totalCount:o},s,{listBoundary:i,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:c,scrolledToInitialItem:d},{topListHeight:p},m,{didMount:f},{recalcInProgress:v}])=>{const g=oe([]),x=oe(0),y=ze();pe(s.topItemsIndexes,g);const b=Rt(te(xt(f,v,ye(l,vo),ye(o),ye(r),ye(c),d,ye(g),ye(t),ye(n),e),Se(([T,E,,P,,,,,,,_])=>{const $=_&&_.length!==P;return T&&!E&&!$}),ue(([,,[T,E],P,_,$,L,F,G,O,K])=>{const q=_,{offsetTree:H,sizeTree:j}=q,I=ht(x);if(P===0)return{...Ka,totalCount:P};if(T===0&&E===0)return I===0?{...Ka,totalCount:P}:Np(I,$,_,G,O,K||[]);if(nt(j))return I>0?null:Os(uC(Wa($,P),q,K),[],P,O,q,G);const Y=[];if(F.length>0){const B=F[0],X=F[F.length-1];let N=0;for(const M of As(j,B,X)){const U=M.value,Z=Math.max(M.start,B),se=Math.min(M.end,X);for(let ae=Z;ae<=se;ae++)Y.push({data:K==null?void 0:K[ae],index:ae,offset:N,size:U}),N+=U}}if(!L)return Os([],Y,P,O,q,G);const J=F.length>0?F[F.length-1]+1:0,D=ZS(H,T,E,J);if(D.length===0)return null;const V=P-1,R=Ns([],B=>{for(const X of D){const N=X.value;let M=N.offset,U=X.start;const Z=N.size;if(N.offset<T){U+=Math.floor((T-N.offset+O)/(Z+O));const ae=U-X.start;M+=ae*Z+ae*O}U<J&&(M+=(J-U)*Z,U=J);const se=Math.min(X.end,V);for(let ae=U;ae<=se&&!(M>=E);ae++)B.push({data:K==null?void 0:K[ae],index:ae,offset:M,size:Z}),M+=Z+O}});return Os(R,Y,P,O,q,G)}),Se(T=>T!==null),st()),Ka);pe(te(e,Se(_a),ue(T=>T==null?void 0:T.length)),o),pe(te(b,ue(T=>T.topListHeight)),p),pe(p,a),pe(te(b,ue(T=>[T.top,T.bottom])),i),pe(te(b,ue(T=>T.items)),y);const C=en(te(b,Se(({items:T})=>T.length>0),Le(o,e),Se(([{items:T},E])=>T[T.length-1].originalIndex===E-1),ue(([,T,E])=>[T-1,E]),st(vo),ue(([T])=>T))),k=en(te(b,jn(200),Se(({items:T,topItems:E})=>T.length>0&&T[0].originalIndex===E.length),ue(({items:T})=>T[0].index),st())),S=en(te(b,Se(({items:T})=>T.length>0),ue(({items:T})=>{let E=0,P=T.length-1;for(;T[E].type==="group"&&E<P;)E++;for(;T[P].type==="group"&&P>E;)P--;return{endIndex:T[P].index,startIndex:T[E].index}}),st(xp)));return{endReached:C,initialItemCount:x,itemsRendered:y,listState:b,rangeChanged:S,startReached:k,topItemsIndexes:g,...m}},ot(En,Sp,Va,yo,bo,To,Un,Ba),{singleton:!0}),Pp=Ge(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:n,headerHeight:r},{listState:o}])=>{const s=ze(),i=Rt(te(xt(n,e,r,t,o),ue(([a,l,c,d,p])=>a+l+c+d+p.offsetBottom+p.bottom)),0);return pe(ye(i),s),{totalListHeight:i,totalListHeightChanged:s}},ot(Ft,lr),{singleton:!0}),dC=Ge(([{viewportHeight:e},{totalListHeight:t}])=>{const n=oe(!1),r=Rt(te(xt(n,e,t),Se(([o])=>o),ue(([,o,s])=>Math.max(0,o-s)),jn(0),st()),0);return{alignToBottom:n,paddingTopAddition:r}},ot(Ft,Pp),{singleton:!0}),jp=Ge(()=>({context:oe(null)})),fC=({itemBottom:e,itemTop:t,locationParams:{align:n,behavior:r,...o},viewportBottom:s,viewportTop:i})=>t<i?{...o,align:n??"start",behavior:r}:e>s?{...o,align:n??"end",behavior:r}:null,_p=Ge(([{gap:e,sizes:t,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:o,headerHeight:s,scrollingInProgress:i,scrollTop:a,viewportHeight:l},{scrollToIndex:c}])=>{const d=ze();return pe(te(d,Le(t,l,n,s,o,r,a),Le(e),ue(([[p,m,f,v,g,x,y,b],C])=>{const{align:k,behavior:S,calculateViewLocation:T=fC,done:E,...P}=p,_=bp(p,m,v-1),$=wo(_,m.offsetTree,C)+g+x,L=$+pn(m.sizeTree,_)[1],F=b+x,G=b+f-y,O=T({itemBottom:L,itemTop:$,locationParams:{align:k,behavior:S,...P},viewportBottom:G,viewportTop:F});return O?E&&fn(te(i,Se(K=>!K),sr(ht(i)?1:2)),E):E&&E(),O}),Se(p=>p!==null)),c),{scrollIntoView:d}},ot(En,Ft,bo,lr,zn),{singleton:!0});function Rp(e){return e?e==="smooth"?"smooth":"auto":!1}const pC=(e,t)=>typeof e=="function"?Rp(e(t)):t&&Rp(e),hC=Ge(([{listRefresh:e,totalCount:t,fixedItemSize:n,data:r},{atBottomState:o,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:l,propsReady:c},{log:d},{scrollingInProgress:p},{context:m},{scrollIntoView:f}])=>{const v=oe(!1),g=ze();let x=null;function y(S){Me(i,{align:"end",behavior:S,index:"LAST"})}Ze(te(xt(te(ye(t),sr(1)),l),Le(ye(v),s,a,p),ue(([[S,T],E,P,_,$])=>{let L=T&&_,F="auto";return L&&(F=pC(E,P||$),L=L&&!!F),{followOutputBehavior:F,shouldFollow:L,totalCount:S}}),Se(({shouldFollow:S})=>S)),({followOutputBehavior:S,totalCount:T})=>{x&&(x(),x=null),ht(n)?requestAnimationFrame(()=>{ht(d)("following output to ",{totalCount:T},Wt.DEBUG),y(S)}):x=fn(e,()=>{ht(d)("following output to ",{totalCount:T},Wt.DEBUG),y(S),x=null})});function b(S){const T=fn(o,E=>{S&&!E.atBottom&&E.notAtBottomBecause==="SIZE_INCREASED"&&!x&&(ht(d)("scrolling to bottom due to increased size",{},Wt.DEBUG),y("auto"))});setTimeout(T,100)}Ze(te(xt(ye(v),t,c),Se(([S,,T])=>S&&T),kn(({value:S},[,T])=>({refreshed:S===T,value:T}),{refreshed:!1,value:0}),Se(({refreshed:S})=>S),Le(v,t)),([,S])=>{ht(a)&&b(S!==!1)}),Ze(g,()=>{b(ht(v)!==!1)}),Ze(xt(ye(v),o),([S,T])=>{S&&!T.atBottom&&T.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&y("auto")});const C=oe(null),k=ze();return pe(Ma(te(ye(r),ue(S=>{var T;return(T=S==null?void 0:S.length)!=null?T:0})),te(ye(t))),k),Ze(te(xt(te(k,sr(1)),l),Le(ye(C),a,p,m),ue(([[S,T],E,P,_,$])=>T&&P&&(E==null?void 0:E({context:$,totalCount:S,scrollingInProgress:_}))),Se(S=>!!S),jn(0)),S=>{x&&(x(),x=null),ht(n)?requestAnimationFrame(()=>{ht(d)("scrolling into view",{}),Me(f,S)}):x=fn(e,()=>{ht(d)("scrolling into view",{}),Me(f,S),x=null})}),{autoscrollToBottom:g,followOutput:v,scrollIntoViewOnChange:C}},ot(En,To,bo,yo,Un,zn,Ft,jp,_p)),mC=Ge(([{data:e,firstItemIndex:t,gap:n,sizes:r},{initialTopMostItemIndex:o},{initialItemCount:s,listState:i},{didMount:a}])=>(pe(te(a,Le(s),Se(([,l])=>l!==0),Le(o,r,t,n,e),ue(([[,l],c,d,p,m,f=[]])=>Np(l,c,d,p,m,f))),i),{}),ot(En,yo,lr,Un),{singleton:!0}),gC=Ge(([{didMount:e},{scrollTo:t},{listState:n}])=>{const r=oe(0);return Ze(te(e,Le(r),Se(([,o])=>o!==0),ue(([,o])=>({top:o}))),o=>{fn(te(n,sr(1),Se(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Me(t,o)})})}),{initialScrollTop:r}},ot(Un,Ft,lr),{singleton:!0}),Mp=Ge(([{scrollVelocity:e}])=>{const t=oe(!1),n=ze(),r=oe(!1);return pe(te(e,Le(r,t,n),Se(([o,s])=>!!s),ue(([o,s,i,a])=>{const{enter:l,exit:c}=s;if(i){if(c(o,a))return!1}else if(l(o,a))return!0;return i}),st()),t),Ze(te(xt(t,e,n),Le(r)),([[o,s,i],a])=>{o&&a&&a.change&&a.change(s,i)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:n,scrollVelocity:e}},ot(To),{singleton:!0}),qa=Ge(([{scrollContainerState:e,scrollTo:t}])=>{const n=ze(),r=ze(),o=ze(),s=oe(!1),i=oe(void 0);return pe(te(xt(n,r),ue(([{scrollHeight:a,scrollTop:l,viewportHeight:c},{offsetTop:d}])=>({scrollHeight:a,scrollTop:Math.max(0,l-d),viewportHeight:c}))),e),pe(te(t,Le(r),ue(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),o),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:o,windowViewportRect:r}},ot(Ft)),xC=Ge(([{sizeRanges:e,sizes:t},{headerHeight:n,scrollTop:r},{initialTopMostItemIndex:o},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const c=ze(),d=oe(void 0),p=oe(null),m=oe(null);return pe(a,p),pe(l,m),Ze(te(c,Le(t,r,i,p,m,n)),([f,v,g,x,y,b,C])=>{const k=eC(v.sizeTree);x&&y!==null&&b!==null&&(g=y.scrollTop-b.offsetTop),g-=C,f({ranges:k,scrollTop:g})}),pe(te(d,Se(_a),ue(vC)),o),pe(te(s,Le(d),Se(([,f])=>f!==void 0),st(),ue(([,f])=>f.ranges)),e),{getState:c,restoreStateFrom:d}},ot(En,Ft,yo,Un,qa));function vC(e){return{align:"start",index:0,offset:e.scrollTop}}const wC=Ge(([{topItemsIndexes:e}])=>{const t=oe(0);return pe(te(t,Se(n=>n>=0),ue(n=>Array.from({length:n}).map((r,o)=>o))),e),{topItemCount:t}},ot(lr));function Op(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const bC=Op(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),yC=Ge(([{deviation:e,scrollBy:t,scrollingInProgress:n,scrollTop:r},{isAtBottom:o,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:a},{listState:l},{beforeUnshiftWith:c,gap:d,shiftWithOffset:p,sizes:m},{log:f},{recalcInProgress:v}])=>{const g=en(te(l,Le(i),kn(([,y,b,C],[{bottom:k,items:S,offsetBottom:T,totalCount:E},P])=>{const _=k+T;let $=0;return b===E&&y.length>0&&S.length>0&&(S[0].originalIndex===0&&y[0].originalIndex===0||($=_-C,$!==0&&($+=P))),[$,S,E,_]},[0,[],0,0]),Se(([y])=>y!==0),Le(r,a,n,o,f,v),Se(([,y,b,C,,,k])=>!k&&!C&&y!==0&&b===So),ue(([[y],,,,,b])=>(b("Upward scrolling compensation",{amount:y},Wt.DEBUG),y))));function x(y){y>0?(Me(t,{behavior:"auto",top:-y}),Me(e,0)):(Me(e,0),Me(t,{behavior:"auto",top:-y}))}return Ze(te(g,Le(e,s)),([y,b,C])=>{C&&bC()?Me(e,b-y):x(-y)}),Ze(te(xt(Rt(s,!1),e,v),Se(([y,b,C])=>!y&&!C&&b!==0),ue(([y,b])=>b),jn(1)),x),pe(te(p,ue(y=>({top:-y}))),t),Ze(te(c,Le(m,d),ue(([y,{groupIndices:b,lastSize:C,sizeTree:k},S])=>{function T(E){return E*(C+S)}if(b.length===0)return T(y);{let E=0;const P=xo(k,0);let _=0,$=0;for(;_<y;){_++,E+=P;let L=b.length===$+1?1/0:b[$+1]-b[$]-1;_+L>y&&(E-=P,L=y-_+1),_+=L,E+=T(L),$++}return E}})),y=>{Me(e,y),requestAnimationFrame(()=>{Me(t,{top:y}),requestAnimationFrame(()=>{Me(e,0),Me(v,!1)})})}),{deviation:e}},ot(Ft,To,lr,En,zn,Ba)),SC=Ge(([e,t,n,r,o,s,i,a,l,c,d])=>({...e,...t,...n,...r,...o,...s,...i,...a,...l,...c,...d}),ot(Va,mC,Un,Mp,Pp,gC,dC,qa,_p,zn,jp)),Dp=Ge(([{data:e,defaultItemSize:t,firstItemIndex:n,fixedItemSize:r,gap:o,groupIndices:s,itemSize:i,sizeRanges:a,sizes:l,statefulTotalCount:c,totalCount:d,trackItemSizes:p},{initialItemFinalLocationReached:m,initialTopMostItemIndex:f,scrolledToInitialItem:v},g,x,y,{listState:b,topItemsIndexes:C,...k},{scrollToIndex:S},T,{topItemCount:E},{groupCounts:P},_])=>(pe(k.rangeChanged,_.scrollSeekRangeChanged),pe(te(_.windowViewportRect,ue($=>$.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:n,fixedItemHeight:r,gap:o,groupCounts:P,initialItemFinalLocationReached:m,initialTopMostItemIndex:f,scrolledToInitialItem:v,sizeRanges:a,topItemCount:E,topItemsIndexes:C,totalCount:d,...y,groupIndices:s,itemSize:i,listState:b,scrollToIndex:S,statefulTotalCount:c,trackItemSizes:p,...k,..._,...g,sizes:l,...x}),ot(En,yo,Ft,xC,hC,lr,bo,yC,wC,Sp,SC));function CC(e,t){const n={},r={};let o=0;const s=e.length;for(;o<s;)r[e[o]]=1,o+=1;for(const i in t)Object.hasOwn(r,i)||(n[i]=t[i]);return n}const Ds=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Lp(e,t,n){const r=Object.keys(t.required||{}),o=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=w.createContext({});function l(x,y){x.propsReady&&Me(x.propsReady,!1);for(const b of r){const C=x[t.required[b]];Me(C,y[b])}for(const b of o)if(b in y){const C=x[t.optional[b]];Me(C,y[b])}x.propsReady&&Me(x.propsReady,!0)}function c(x){return s.reduce((y,b)=>(y[b]=C=>{const k=x[t.methods[b]];Me(k,C)},y),{})}function d(x){return i.reduce((y,b)=>(y[b]=FS(x[t.events[b]]),y),{})}const p=w.forwardRef((x,y)=>{const{children:b,...C}=x,[k]=w.useState(()=>Ns(zS(e),E=>{l(E,C)})),[S]=w.useState(ip(d,k));Ds(()=>{for(const E of i)E in C&&Ze(S[E],C[E]);return()=>{Object.values(S).map(Ra)}},[C,S,k]),Ds(()=>{l(k,C)}),w.useImperativeHandle(y,op(c(k)));const T=n;return u.jsx(a.Provider,{value:k,children:n?u.jsx(T,{...CC([...r,...o,...i],C),children:b}):b})}),m=x=>{const y=w.useContext(a);return w.useCallback(b=>{Me(y[x],b)},[y,x])},f=x=>{const y=w.useContext(a)[x],b=w.useCallback(C=>Ze(y,C),[y]);return w.useSyncExternalStore(b,()=>ht(y),()=>ht(y))},v=x=>{const y=w.useContext(a)[x],[b,C]=w.useState(ip(ht,y));return Ds(()=>Ze(y,k=>{k!==b&&C(op(k))}),[y,b]),b},g=w.version.startsWith("18")?f:v;return{Component:p,useEmitter:(x,y)=>{const b=w.useContext(a)[x];Ds(()=>Ze(b,y),[y,b])},useEmitterValue:g,usePublisher:m}}const $p=w.createContext(void 0),Fp=w.createContext(void 0),Bp=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ga(e){return"self"in e}function TC(e){return"body"in e}function zp(e,t,n,r=Dr,o,s){const i=w.useRef(null),a=w.useRef(null),l=w.useRef(null),c=w.useCallback(m=>{let f,v,g;const x=m.target;if(TC(x)||Ga(x)){const b=Ga(x)?x:x.defaultView;g=s?b.scrollX:b.scrollY,f=s?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight,v=s?b.innerWidth:b.innerHeight}else g=s?x.scrollLeft:x.scrollTop,f=s?x.scrollWidth:x.scrollHeight,v=s?x.offsetWidth:x.offsetHeight;const y=()=>{e({scrollHeight:f,scrollTop:Math.max(g,0),viewportHeight:v})};m.suppressFlushSync?y():Oo.flushSync(y),a.current!==null&&(g===a.current||g<=0||g===f-v)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,s]);w.useEffect(()=>{const m=o||i.current;return r(o||i.current),c({suppressFlushSync:!0,target:m}),m.addEventListener("scroll",c,{passive:!0}),()=>{r(null),m.removeEventListener("scroll",c)}},[i,c,n,r,o]);function d(m){const f=i.current;if(!f||(s?"offsetWidth"in f&&f.offsetWidth===0:"offsetHeight"in f&&f.offsetHeight===0))return;const v=m.behavior==="smooth";let g,x,y;Ga(f)?(x=Math.max(Hn(f.document.documentElement,s?"width":"height"),s?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight),g=s?f.innerWidth:f.innerHeight,y=s?window.scrollX:window.scrollY):(x=f[s?"scrollWidth":"scrollHeight"],g=Hn(f,s?"width":"height"),y=f[s?"scrollLeft":"scrollTop"]);const b=x-g;if(m.top=Math.ceil(Math.max(Math.min(b,m.top),0)),Tp(g,x)||m.top===y){e({scrollHeight:x,scrollTop:y,viewportHeight:g}),v&&t(!0);return}v?(a.current=m.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,s&&(m={behavior:m.behavior,left:m.top}),f.scrollTo(m)}function p(m){s&&(m={behavior:m.behavior,left:m.top}),i.current.scrollBy(m)}return{scrollByCallback:p,scrollerRef:i,scrollToCallback:d}}const Ya="-webkit-sticky",Hp="sticky",Xa=Op(()=>{if(typeof document>"u")return Hp;const e=document.createElement("div");return e.style.position=Ya,e.style.position===Ya?Ya:Hp});function Ja(e){return e}const kC=Ge(()=>{const e=oe(a=>`Item ${a}`),t=oe(a=>`Group ${a}`),n=oe({}),r=oe(Ja),o=oe("div"),s=oe(Dr),i=(a,l=null)=>Rt(te(n,ue(c=>c[a]),st()),l);return{components:n,computeItemKey:r,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:o,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),EC=Ge(([e,t])=>({...e,...t}),ot(Dp,kC)),IC=({height:e})=>u.jsx("div",{style:{height:e}}),NC={overflowAnchor:"none",position:Xa(),zIndex:1},Up={overflowAnchor:"none"},AC={...Up,display:"inline-block",height:"100%"},Wp=w.memo(function({showTopList:e=!1}){const t=Ne("listState"),n=rn("sizeRanges"),r=Ne("useWindowScroll"),o=Ne("customScrollParent"),s=rn("windowScrollContainerState"),i=rn("scrollContainerState"),a=o||r?s:i,l=Ne("itemContent"),c=Ne("context"),d=Ne("groupContent"),p=Ne("trackItemSizes"),m=Ne("itemSize"),f=Ne("log"),v=rn("gap"),g=Ne("horizontalDirection"),{callbackRef:x}=WS(n,m,p,e?Dr:a,f,v,o,g,Ne("skipAnimationFrameInResizeObserver")),[y,b]=w.useState(0);Za("deviation",O=>{y!==O&&b(O)});const C=Ne("EmptyPlaceholder"),k=Ne("ScrollSeekPlaceholder")||IC,S=Ne("ListComponent"),T=Ne("ItemComponent"),E=Ne("GroupComponent"),P=Ne("computeItemKey"),_=Ne("isSeeking"),$=Ne("groupIndices").length>0,L=Ne("alignToBottom"),F=Ne("initialItemFinalLocationReached"),G=e?{}:{boxSizing:"border-box",...g?{display:"inline-block",height:"100%",marginLeft:y!==0?y:L?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:y!==0?y:L?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...F?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&C?u.jsx(C,{...Mt(C,c)}):u.jsx(S,{...Mt(S,c),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:x,style:G,children:(e?t.topItems:t.items).map(O=>{const K=O.originalIndex,q=P(K+t.firstItemIndex,O.data,c);return _?w.createElement(k,{...Mt(k,c),height:O.size,index:O.index,key:q,type:O.type||"item",...O.type==="group"?{}:{groupIndex:O.groupIndex}}):O.type==="group"?w.createElement(E,{...Mt(E,c),"data-index":K,"data-item-index":O.index,"data-known-size":O.size,key:q,style:NC},d(O.index,c)):w.createElement(T,{...Mt(T,c),...RC(T,O.data),"data-index":K,"data-item-group-index":O.groupIndex,"data-item-index":O.index,"data-known-size":O.size,key:q,style:g?AC:Up},$?l(O.index,O.groupIndex,O.data,c):l(O.index,O.data,c))})})}),PC={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},jC={outline:"none",overflowX:"auto",position:"relative"},Ls=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:{}}),_C={position:Xa(),top:0,width:"100%",zIndex:1};function Mt(e,t){if(typeof e!="string")return{context:t}}function RC(e,t){return{item:typeof e=="string"?void 0:t}}const MC=w.memo(function(){const e=Ne("HeaderComponent"),t=rn("headerHeight"),n=Ne("HeaderFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,Ne("skipAnimationFrameInResizeObserver")),o=Ne("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),OC=w.memo(function(){const e=Ne("FooterComponent"),t=rn("footerHeight"),n=Ne("HeaderFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,Ne("skipAnimationFrameInResizeObserver")),o=Ne("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null});function Vp({useEmitter:e,useEmitterValue:t,usePublisher:n}){return w.memo(function({children:r,style:o,context:s,...i}){const a=n("scrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=t("scrollerRef"),p=t("horizontalDirection")||!1,{scrollByCallback:m,scrollerRef:f,scrollToCallback:v}=zp(a,c,l,d,void 0,p);return e("scrollTo",v),e("scrollBy",m),u.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:f,style:{...p?jC:PC,...o},tabIndex:0,...i,...Mt(l,s),children:r})})}function Kp({useEmitter:e,useEmitterValue:t,usePublisher:n}){return w.memo(function({children:r,style:o,context:s,...i}){const a=n("windowScrollContainerState"),l=t("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=t("totalListHeight"),p=t("deviation"),m=t("customScrollParent"),f=w.useRef(null),v=t("scrollerRef"),{scrollByCallback:g,scrollerRef:x,scrollToCallback:y}=zp(a,c,l,v,m);return Bp(()=>{var b;return x.current=m||((b=f.current)==null?void 0:b.ownerDocument.defaultView),()=>{x.current=null}},[x,m]),e("windowScrollTo",y),e("scrollBy",g),u.jsx(l,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...o,...d!==0?{height:d+p}:{}},...i,...Mt(l,s),children:r})})}const DC=({children:e})=>{const t=w.useContext($p),n=rn("viewportHeight"),r=rn("fixedItemHeight"),o=Ne("alignToBottom"),s=Ne("horizontalDirection"),i=w.useMemo(()=>sp(n,l=>Hn(l,s?"width":"height")),[n,s]),a=ir(i,!0,Ne("skipAnimationFrameInResizeObserver"));return w.useEffect(()=>{t&&(n(t.viewportHeight),r(t.itemHeight))},[t,n,r]),u.jsx("div",{"data-viewport-type":"element",ref:a,style:Ls(o),children:e})},LC=({children:e})=>{const t=w.useContext($p),n=rn("windowViewportRect"),r=rn("fixedItemHeight"),o=Ne("customScrollParent"),s=up(n,o,Ne("skipAnimationFrameInResizeObserver")),i=Ne("alignToBottom");return w.useEffect(()=>{t&&(r(t.itemHeight),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,n,r]),u.jsx("div",{"data-viewport-type":"window",ref:s,style:Ls(i),children:e})},$C=({children:e})=>{const t=Ne("TopItemListComponent")||"div",n=Ne("headerHeight"),r={..._C,marginTop:`${n}px`},o=Ne("context");return u.jsx(t,{style:r,...Mt(t,o),children:e})},FC=w.memo(function(e){const t=Ne("useWindowScroll"),n=Ne("topItemsIndexes").length>0,r=Ne("customScrollParent"),o=Ne("context");return u.jsxs(r||t?HC:zC,{...e,context:o,children:[n&&u.jsx($C,{children:u.jsx(Wp,{showTopList:!0})}),u.jsxs(r||t?LC:DC,{children:[u.jsx(MC,{}),u.jsx(Wp,{}),u.jsx(OC,{})]})]})}),{Component:BC,useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}=Lp(EC,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},FC),zC=Vp({useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}),HC=Kp({useEmitter:Za,useEmitterValue:Ne,usePublisher:rn}),UC=BC;ot(Dp,Ge(()=>{const e=oe(c=>u.jsxs("td",{children:["Item $",c]})),t=oe(null),n=oe(c=>u.jsxs("td",{colSpan:1e3,children:["Group ",c]})),r=oe(null),o=oe(null),s=oe({}),i=oe(Ja),a=oe(Dr),l=(c,d=null)=>Rt(te(s,ue(p=>p[c]),st()),d);return{components:s,computeItemKey:i,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:o,fixedHeaderContent:r,itemContent:e,groupContent:n,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder"),TableBodyComponent:l("TableBody","tbody"),TableComponent:l("Table","table"),TableFooterComponent:l("TableFoot","tfoot"),TableHeadComponent:l("TableHead","thead"),TableRowComponent:l("TableRow","tr"),GroupComponent:l("Group","tr")}})),Xa();const qp={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},WC={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:Gp,floor:$s,max:ko,min:Qa,round:Yp}=Math;function Xp(e,t,n){return Array.from({length:t-e+1}).map((r,o)=>({data:n===null?null:n[o+e],index:o+e}))}function VC(e){return{...WC,items:e}}function Fs(e,t){return e&&e.width===t.width&&e.height===t.height}function KC(e,t){return e&&e.column===t.column&&e.row===t.row}const qC=Ge(([{increaseViewportBy:e,listBoundary:t,overscan:n,visibleRange:r},{footerHeight:o,headerHeight:s,scrollBy:i,scrollContainerState:a,scrollTo:l,scrollTop:c,smoothScrollTargetReached:d,viewportHeight:p},m,f,{didMount:v,propsReady:g},{customScrollParent:x,useWindowScroll:y,windowScrollContainerState:b,windowScrollTo:C,windowViewportRect:k},S])=>{const T=oe(0),E=oe(0),P=oe(qp),_=oe({height:0,width:0}),$=oe({height:0,width:0}),L=ze(),F=ze(),G=oe(0),O=oe(null),K=oe({column:0,row:0}),q=ze(),H=ze(),j=oe(!1),I=oe(0),Y=oe(!0),J=oe(!1),D=oe(!1);Ze(te(v,Le(I),Se(([M,U])=>!!U)),()=>{Me(Y,!1)}),Ze(te(xt(v,Y,$,_,I,J),Se(([M,U,Z,se,,ae])=>M&&!U&&Z.height!==0&&se.height!==0&&!ae)),([,,,,M])=>{Me(J,!0),Ua(1,()=>{Me(L,M)}),fn(te(c),()=>{Me(t,[0,0]),Me(Y,!0)})}),pe(te(H,Se(M=>M!=null&&M.scrollTop>0),Tn(0)),E),Ze(te(v,Le(H),Se(([,M])=>M!=null)),([,M])=>{M&&(Me(_,M.viewport),Me($,M.item),Me(K,M.gap),M.scrollTop>0&&(Me(j,!0),fn(te(c,sr(1)),U=>{Me(j,!1)}),Me(l,{top:M.scrollTop})))}),pe(te(_,ue(({height:M})=>M)),p),pe(te(xt(ye(_,Fs),ye($,Fs),ye(K,(M,U)=>M&&M.column===U.column&&M.row===U.row),ye(c)),ue(([M,U,Z,se])=>({gap:Z,item:U,scrollTop:se,viewport:M}))),q),pe(te(xt(ye(T),r,ye(K,KC),ye($,Fs),ye(_,Fs),ye(O),ye(E),ye(j),ye(Y),ye(I)),Se(([,,,,,,,M])=>!M),ue(([M,[U,Z],se,ae,Ce,we,je,,We,Fe])=>{const{column:Ye,row:He}=se,{height:vt,width:wt}=ae,{width:dt}=Ce;if(je===0&&(M===0||dt===0))return qp;if(wt===0){const bt=Wa(Fe,M),mt=bt+Math.max(je-1,0);return VC(Xp(bt,mt,we))}const Ve=Jp(dt,wt,Ye);let Ae,Ke;We?U===0&&Z===0&&je>0?(Ae=0,Ke=je-1):(Ae=Ve*$s((U+He)/(vt+He)),Ke=Ve*Gp((Z+He)/(vt+He))-1,Ke=Qa(M-1,ko(Ke,Ve-1)),Ae=Qa(Ke,ko(0,Ae))):(Ae=0,Ke=-1);const _e=Xp(Ae,Ke,we),{bottom:Be,top:Qe}=Zp(Ce,se,ae,_e),Nt=Gp(M/Ve),et=Nt*vt+(Nt-1)*He-Be;return{bottom:Be,itemHeight:vt,items:_e,itemWidth:wt,offsetBottom:et,offsetTop:Qe,top:Qe}})),P),pe(te(O,Se(M=>M!==null),ue(M=>M.length)),T),pe(te(xt(_,$,P,K),Se(([M,U,{items:Z}])=>Z.length>0&&U.height!==0&&M.height!==0),ue(([M,U,{items:Z},se])=>{const{bottom:ae,top:Ce}=Zp(M,se,U,Z);return[Ce,ae]}),st(vo)),t);const V=oe(!1);pe(te(c,Le(V),ue(([M,U])=>U||M!==0)),V);const R=en(te(xt(P,T),Se(([{items:M}])=>M.length>0),Le(V),Se(([[M,U],Z])=>{const se=M.items[M.items.length-1].index===U-1;return(Z||M.bottom>0&&M.itemHeight>0&&M.offsetBottom===0&&M.items.length===U)&&se}),ue(([[,M]])=>M-1),st())),B=en(te(ye(P),Se(({items:M})=>M.length>0&&M[0].index===0),Tn(0),st())),X=en(te(ye(P),Le(j),Se(([{items:M},U])=>M.length>0&&!U),ue(([{items:M}])=>({endIndex:M[M.length-1].index,startIndex:M[0].index})),st(xp),jn(0)));pe(X,f.scrollSeekRangeChanged),pe(te(L,Le(_,$,T,K),ue(([M,U,Z,se,ae])=>{const Ce=Cp(M),{align:we,behavior:je,offset:We}=Ce;let Fe=Ce.index;Fe==="LAST"&&(Fe=se-1),Fe=ko(0,Fe,Qa(se-1,Fe));let Ye=el(U,ae,Z,Fe);return we==="end"?Ye=Yp(Ye-U.height+Z.height):we==="center"&&(Ye=Yp(Ye-U.height/2+Z.height/2)),We&&(Ye+=We),{behavior:je,top:Ye}})),l);const N=Rt(te(P,ue(M=>M.offsetBottom+M.bottom)),0);return pe(te(k,ue(M=>({height:M.visibleHeight,width:M.visibleWidth}))),_),{customScrollParent:x,data:O,deviation:G,footerHeight:o,gap:K,headerHeight:s,increaseViewportBy:e,initialItemCount:E,itemDimensions:$,overscan:n,restoreStateFrom:H,scrollBy:i,scrollContainerState:a,scrollHeight:F,scrollTo:l,scrollToIndex:L,scrollTop:c,smoothScrollTargetReached:d,totalCount:T,useWindowScroll:y,viewportDimensions:_,windowScrollContainerState:b,windowScrollTo:C,windowViewportRect:k,...f,gridState:P,horizontalDirection:D,initialTopMostItemIndex:I,totalListHeight:N,...m,endReached:R,propsReady:g,rangeChanged:X,startReached:B,stateChanged:q,stateRestoreInProgress:j,...S}},ot(Va,Ft,To,Mp,Un,qa,zn));function Jp(e,t,n){return ko(1,$s((e+n)/($s(t)+n)))}function Zp(e,t,n,r){const{height:o}=n;if(o===void 0||r.length===0)return{bottom:0,top:0};const s=el(e,t,n,r[0].index);return{bottom:el(e,t,n,r[r.length-1].index)+o,top:s}}function el(e,t,n,r){const o=Jp(e.width,n.width,t.column),s=$s(r/o),i=s*n.height+ko(0,s-1)*t.row;return i>0?i+t.row:i}const GC=Ge(()=>{const e=oe(p=>`Item ${p}`),t=oe({}),n=oe(null),r=oe("virtuoso-grid-item"),o=oe("virtuoso-grid-list"),s=oe(Ja),i=oe("div"),a=oe(Dr),l=(p,m=null)=>Rt(te(t,ue(f=>f[p]),st()),m),c=oe(!1),d=oe(!1);return pe(ye(d),c),{components:t,computeItemKey:s,context:n,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:i,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:o,ListComponent:l("List","div"),readyStateChanged:c,reportReadyState:d,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),YC=Ge(([e,t])=>({...e,...t}),ot(qC,GC)),XC=w.memo(function(){const e=it("gridState"),t=it("listClassName"),n=it("itemClassName"),r=it("itemContent"),o=it("computeItemKey"),s=it("isSeeking"),i=on("scrollHeight"),a=it("ItemComponent"),l=it("ListComponent"),c=it("ScrollSeekPlaceholder"),d=it("context"),p=on("itemDimensions"),m=on("gap"),f=it("log"),v=it("stateRestoreInProgress"),g=on("reportReadyState"),x=ir(w.useMemo(()=>y=>{const b=y.parentElement.parentElement.scrollHeight;i(b);const C=y.firstChild;if(C){const{height:k,width:S}=C.getBoundingClientRect();p({height:k,width:S})}m({column:eh("column-gap",getComputedStyle(y).columnGap,f),row:eh("row-gap",getComputedStyle(y).rowGap,f)})},[i,p,m,f]),!0,!1);return Bp(()=>{e.itemHeight>0&&e.itemWidth>0&&g(!0)},[e]),v?null:u.jsx(l,{className:t,ref:x,...Mt(l,d),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(y=>{const b=o(y.index,y.data,d);return s?u.jsx(c,{...Mt(c,d),height:e.itemHeight,index:y.index,width:e.itemWidth},b):w.createElement(a,{...Mt(a,d),className:n,"data-index":y.index,key:b},r(y.index,y.data,d))})})}),JC=w.memo(function(){const e=it("HeaderComponent"),t=on("headerHeight"),n=it("headerFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,!1),o=it("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),ZC=w.memo(function(){const e=it("FooterComponent"),t=on("footerHeight"),n=it("headerFooterTag"),r=ir(w.useMemo(()=>s=>{t(Hn(s,"height"))},[t]),!0,!1),o=it("context");return e?u.jsx(n,{ref:r,children:u.jsx(e,{...Mt(e,o)})}):null}),QC=({children:e})=>{const t=w.useContext(Fp),n=on("itemDimensions"),r=on("viewportDimensions"),o=ir(w.useMemo(()=>s=>{r(s.getBoundingClientRect())},[r]),!0,!1);return w.useEffect(()=>{t&&(r({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,r,n]),u.jsx("div",{ref:o,style:Ls(!1),children:e})},eT=({children:e})=>{const t=w.useContext(Fp),n=on("windowViewportRect"),r=on("itemDimensions"),o=it("customScrollParent"),s=up(n,o,!1);return w.useEffect(()=>{t&&(r({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,r]),u.jsx("div",{ref:s,style:Ls(!1),children:e})},tT=w.memo(function({...e}){const t=it("useWindowScroll"),n=it("customScrollParent"),r=n||t?rT:nT,o=n||t?eT:QC,s=it("context");return u.jsx(r,{...e,...Mt(r,s),children:u.jsxs(o,{children:[u.jsx(JC,{}),u.jsx(XC,{}),u.jsx(ZC,{})]})})}),{useEmitter:Qp,useEmitterValue:it,usePublisher:on}=Lp(YC,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},tT),nT=Vp({useEmitter:Qp,useEmitterValue:it,usePublisher:on}),rT=Kp({useEmitter:Qp,useEmitterValue:it,usePublisher:on});function eh(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Wt.WARN),t==="normal"?0:parseInt(t??"0",10)}var Bs="Dialog",[th,DN]=cn(Bs),[oT,hn]=th(Bs),nh=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c,d]=On({prop:r,defaultProp:o??!1,onChange:s,caller:Bs});return u.jsx(oT,{scope:t,triggerRef:a,contentRef:l,contentId:_t(),titleId:_t(),descriptionId:_t(),open:c,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(p=>!p),[d]),modal:i,children:n})};nh.displayName=Bs;var rh="DialogTrigger",oh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(rh,n),s=De(t,o.triggerRef);return u.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":rl(o.open),...r,ref:s,onClick:ie(e.onClick,o.onOpenToggle)})});oh.displayName=rh;var tl="DialogPortal",[sT,sh]=th(tl,{forceMount:void 0}),ih=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=hn(tl,t);return u.jsx(sT,{scope:t,forceMount:n,children:h.Children.map(r,i=>u.jsx(Ut,{present:n||s.open,children:u.jsx(ao,{asChild:!0,container:o,children:i})}))})};ih.displayName=tl;var zs="DialogOverlay",ah=h.forwardRef((e,t)=>{const n=sh(zs,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=hn(zs,e.__scopeDialog);return s.modal?u.jsx(Ut,{present:r||s.open,children:u.jsx(aT,{...o,ref:t})}):null});ah.displayName=zs;var iT=Yt.createSlot("DialogOverlay.RemoveScroll"),aT=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(zs,n);return u.jsx(ws,{as:iT,allowPinchZoom:!0,shards:[o.contentRef],children:u.jsx(fe.div,{"data-state":rl(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cr="DialogContent",lh=h.forwardRef((e,t)=>{const n=sh(cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=hn(cr,e.__scopeDialog);return u.jsx(Ut,{present:r||s.open,children:s.modal?u.jsx(lT,{...o,ref:t}):u.jsx(cT,{...o,ref:t})})});lh.displayName=cr;var lT=h.forwardRef((e,t)=>{const n=hn(cr,e.__scopeDialog),r=h.useRef(null),o=De(t,n.contentRef,r);return h.useEffect(()=>{const s=r.current;if(s)return va(s)},[]),u.jsx(ch,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,s=>s.preventDefault())})}),cT=h.forwardRef((e,t)=>{const n=hn(cr,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return u.jsx(ch,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,s),s.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),ch=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=hn(cr,n),l=h.useRef(null),c=De(t,l);return Yi(),u.jsxs(u.Fragment,{children:[u.jsx(es,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:u.jsx(kr,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":rl(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(uT,{titleId:a.titleId}),u.jsx(fT,{contentRef:l,descriptionId:a.descriptionId})]})]})}),nl="DialogTitle",uh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(nl,n);return u.jsx(fe.h2,{id:o.titleId,...r,ref:t})});uh.displayName=nl;var dh="DialogDescription",fh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(dh,n);return u.jsx(fe.p,{id:o.descriptionId,...r,ref:t})});fh.displayName=dh;var ph="DialogClose",hh=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=hn(ph,n);return u.jsx(fe.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>o.onOpenChange(!1))})});hh.displayName=ph;function rl(e){return e?"open":"closed"}var mh="DialogTitleWarning",[LN,gh]=Ew(mh,{contentName:cr,titleName:nl,docsSlug:"dialog"}),uT=({titleId:e})=>{const t=gh(mh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
80
80
|
|
|
81
81
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
82
82
|
|
package/package.json
CHANGED