maestro-flow 0.4.8 → 0.4.9

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.
Files changed (94) hide show
  1. package/dashboard/dist/assets/{ArtifactsPage-CVh0Z2I2.js → ArtifactsPage-BLvAqQlQ.js} +1 -1
  2. package/dashboard/dist/assets/{ChatInput-CBI3qHQQ.js → ChatInput-DU9YGZKX.js} +1 -1
  3. package/dashboard/dist/assets/{ChatPage-BjJ9CYox.js → ChatPage-DYHfheXC.js} +1 -1
  4. package/dashboard/dist/assets/{CollabPage-CprGGO9y.js → CollabPage-CSlmvEa-.js} +1 -1
  5. package/dashboard/dist/assets/{ExecutionPanel-CClxD7cH.js → ExecutionPanel-RYWf0dYC.js} +1 -1
  6. package/dashboard/dist/assets/{KanbanPage-copqjdPg.js → KanbanPage-N55Iv0-X.js} +1 -1
  7. package/dashboard/dist/assets/{MaestroCoordinatePage-CioZjQ9N.js → MaestroCoordinatePage-BxwZ6yy5.js} +1 -1
  8. package/dashboard/dist/assets/{MarkdownRenderer-CtUhoxCT.js → MarkdownRenderer-ZGtOY7Ti.js} +1 -1
  9. package/dashboard/dist/assets/{McpPage-BcPPcJpr.js → McpPage-Im6s4pGR.js} +1 -1
  10. package/dashboard/dist/assets/{MeetingRoomPage-BgmAKxU-.js → MeetingRoomPage-CxHRn1xx.js} +1 -1
  11. package/dashboard/dist/assets/{OutputPanel-DgT3gMyp.js → OutputPanel-DaL8c1i5.js} +1 -1
  12. package/dashboard/dist/assets/{ProblemsPanel-BmG7rxoG.js → ProblemsPanel-BQTd5812.js} +1 -1
  13. package/dashboard/dist/assets/{RequirementBoardPage-k8YoeQ0r.js → RequirementBoardPage-22y9u1qh.js} +1 -1
  14. package/dashboard/dist/assets/{RequirementPage-Da2354px.js → RequirementPage-_mO743Xm.js} +1 -1
  15. package/dashboard/dist/assets/{RoomsPage-BtqDiYaU.js → RoomsPage-CExTbOGr.js} +1 -1
  16. package/dashboard/dist/assets/{SpecsPage-ByPVH_M3.js → SpecsPage-gr4KX51-.js} +1 -1
  17. package/dashboard/dist/assets/{TeamsPage-sFDLN30L.js → TeamsPage-BxEXLb5g.js} +1 -1
  18. package/dashboard/dist/assets/{TreeBrowser-oEx8YJXV.js → TreeBrowser-CVtPF5C9.js} +1 -1
  19. package/dashboard/dist/assets/{WorkflowPage-JrX7CVHh.js → WorkflowPage-BoN18Lhs.js} +1 -1
  20. package/dashboard/dist/assets/{arrow-left-DYvgSdIH.js → arrow-left-C5ROg97G.js} +1 -1
  21. package/dashboard/dist/assets/{check-jcgYBWVR.js → check-Bs8PM0tQ.js} +1 -1
  22. package/dashboard/dist/assets/{chevron-right-DvZ5sMOg.js → chevron-right-SmErd_1F.js} +1 -1
  23. package/dashboard/dist/assets/{circle-DYT-zoRZ.js → circle-CjpslL_D.js} +1 -1
  24. package/dashboard/dist/assets/{circle-alert-Bfbv3gt4.js → circle-alert-CuzAg2fd.js} +1 -1
  25. package/dashboard/dist/assets/{circle-check-D82WnpbI.js → circle-check-BIkDU5D5.js} +1 -1
  26. package/dashboard/dist/assets/{circle-check-big-CPVD1GKF.js → circle-check-big-CYctV8bK.js} +1 -1
  27. package/dashboard/dist/assets/{code-B3bKFGI4.js → code-DoB7rfxt.js} +1 -1
  28. package/dashboard/dist/assets/{columns-3-BeMAQCix.js → columns-3-Ch5KIyRa.js} +1 -1
  29. package/dashboard/dist/assets/{download-BCtpoWYB.js → download-DadtG2Nr.js} +1 -1
  30. package/dashboard/dist/assets/{folder-CTj6SNNu.js → folder-B8ODoZfb.js} +1 -1
  31. package/dashboard/dist/assets/{index-BxR_3IbJ.js → index-BL4h1OKY.js} +1 -1
  32. package/dashboard/dist/assets/{index-DpcPd-UG.js → index-DQIlX2w_.js} +4 -4
  33. package/dashboard/dist/assets/{index-CWBJLu42.js → index-DaFwSmVJ.js} +10 -10
  34. package/dashboard/dist/assets/{list-BMv8pIQn.js → list-CI-XIPZh.js} +1 -1
  35. package/dashboard/dist/assets/{loader-DdM4VOgF.js → loader-DpdMoQvh.js} +1 -1
  36. package/dashboard/dist/assets/{minus-D15s2E__.js → minus-BVbfXGrC.js} +1 -1
  37. package/dashboard/dist/assets/{pen-line-DO6o4xWz.js → pen-line-CR8GaHt-.js} +1 -1
  38. package/dashboard/dist/assets/{pencil-qGxg9jOe.js → pencil-I7GE0y29.js} +1 -1
  39. package/dashboard/dist/assets/{proxy-DOffTzwA.js → proxy-CcYyZZWI.js} +1 -1
  40. package/dashboard/dist/assets/{refresh-cw-C9UNdLCy.js → refresh-cw-BG9V_T4R.js} +1 -1
  41. package/dashboard/dist/assets/{rows-2-CifAA5SL.js → rows-2-DP6NjQFk.js} +1 -1
  42. package/dashboard/dist/assets/{search-pe7pU1YN.js → search-b78eLlw2.js} +1 -1
  43. package/dashboard/dist/assets/{shallow-r7YynQYA.js → shallow-CJEesgtu.js} +1 -1
  44. package/dashboard/dist/assets/{table-Bh772iIw.js → table-B_lk-a1d.js} +1 -1
  45. package/dashboard/dist/assets/{team-types-C_HqX2p2.js → team-types-Se7f9LfJ.js} +1 -1
  46. package/dashboard/dist/assets/{terminal-EpmtGBlw.js → terminal-DXx4tvzq.js} +1 -1
  47. package/dashboard/dist/assets/{trash-2-Xen46iNQ.js → trash-2-CVh9mnRj.js} +1 -1
  48. package/dashboard/dist/assets/{users-BLueDPxF.js → users-Da9zGME5.js} +1 -1
  49. package/dashboard/dist/assets/{zap-DsQCPF61.js → zap-C0zaC7gJ.js} +1 -1
  50. package/dashboard/dist/index.html +1 -1
  51. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js +4 -0
  52. package/dashboard/dist-server/dashboard/src/server/agents/adapter-factory.js.map +1 -1
  53. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.d.ts +39 -0
  54. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js +423 -0
  55. package/dashboard/dist-server/dashboard/src/server/agents/agy-adapter.js.map +1 -0
  56. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.d.ts +6 -0
  57. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +109 -0
  58. package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
  59. package/dashboard/dist-server/dashboard/src/shared/constants.js +2 -0
  60. package/dashboard/dist-server/dashboard/src/shared/constants.js.map +1 -1
  61. package/dashboard/dist-server/shared/agent-types.d.ts +1 -1
  62. package/dist/shared/agent-types.d.ts +1 -1
  63. package/dist/shared/agent-types.d.ts.map +1 -1
  64. package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
  65. package/dist/src/agents/cli-agent-runner.js +3 -0
  66. package/dist/src/agents/cli-agent-runner.js.map +1 -1
  67. package/dist/src/commands/hooks.d.ts +64 -0
  68. package/dist/src/commands/hooks.d.ts.map +1 -1
  69. package/dist/src/commands/hooks.js +107 -0
  70. package/dist/src/commands/hooks.js.map +1 -1
  71. package/dist/src/commands/install.d.ts.map +1 -1
  72. package/dist/src/commands/install.js +17 -3
  73. package/dist/src/commands/install.js.map +1 -1
  74. package/dist/src/commands/update.d.ts.map +1 -1
  75. package/dist/src/commands/update.js +53 -0
  76. package/dist/src/commands/update.js.map +1 -1
  77. package/dist/src/config/cli-tools-config.d.ts +19 -5
  78. package/dist/src/config/cli-tools-config.d.ts.map +1 -1
  79. package/dist/src/config/cli-tools-config.js +77 -32
  80. package/dist/src/config/cli-tools-config.js.map +1 -1
  81. package/dist/src/config/cli-tools-defaults.json +2 -1
  82. package/dist/src/core/component-defs.d.ts.map +1 -1
  83. package/dist/src/core/component-defs.js +53 -0
  84. package/dist/src/core/component-defs.js.map +1 -1
  85. package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
  86. package/dist/src/tui/install-ui/InstallExecution.js +5 -3
  87. package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
  88. package/dist/src/utils/update-notices.d.ts +62 -0
  89. package/dist/src/utils/update-notices.d.ts.map +1 -0
  90. package/dist/src/utils/update-notices.js +178 -0
  91. package/dist/src/utils/update-notices.js.map +1 -0
  92. package/package.json +82 -82
  93. package/shared/agent-types.ts +1 -1
  94. package/workflows/agy-instructions.md +124 -0
@@ -1,4 +1,4 @@
1
- import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-DpcPd-UG.js";import{C as me}from"./code-B3bKFGI4.js";import{S as X}from"./search-pe7pU1YN.js";import{u as Q}from"./shallow-r7YynQYA.js";import{F as M,T as ge}from"./TreeBrowser-oEx8YJXV.js";import{M as ve}from"./MarkdownRenderer-CtUhoxCT.js";import{C as ee}from"./chevron-right-DvZ5sMOg.js";import{D as te}from"./folder-CTj6SNNu.js";import{C as re}from"./circle-DYT-zoRZ.js";import{C as $}from"./circle-check-D82WnpbI.js";import{A as be}from"./index-BxR_3IbJ.js";import{m as N}from"./proxy-DOffTzwA.js";/**
1
+ import{d as W,r as d,A as J,j as e,F as C,o as xe,W as j,p as pe,V as ue,X as fe,n as Z,B as he}from"./index-DQIlX2w_.js";import{C as me}from"./code-DoB7rfxt.js";import{S as X}from"./search-b78eLlw2.js";import{u as Q}from"./shallow-CJEesgtu.js";import{F as M,T as ge}from"./TreeBrowser-CVtPF5C9.js";import{M as ve}from"./MarkdownRenderer-ZGtOY7Ti.js";import{C as ee}from"./chevron-right-SmErd_1F.js";import{D as te}from"./folder-B8ODoZfb.js";import{C as re}from"./circle-CjpslL_D.js";import{C as $}from"./circle-check-BIkDU5D5.js";import{A as be}from"./index-BL4h1OKY.js";import{m as N}from"./proxy-CcYyZZWI.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{z as L,j as d,r as M,a2 as fn,i as Ne,c as mn,R as hn,P as pn,O as gn,f as xn,T as vn,h as so,k as tt,s as jt,w as io,a3 as lo,a4 as yn}from"./index-DpcPd-UG.js";import{A as bt,E as bn}from"./index-CWBJLu42.js";import{Z as Cn}from"./zap-DsQCPF61.js";const It=0,Oe=1,Ye=2,zo=4;function ao(e){return()=>e}function Tn(e){e()}function Eo(e,t){return o=>e(t(o))}function co(e,t){return()=>e(t)}function In(e,t){return o=>e(t,o)}function _t(e){return e!==void 0}function wn(...e){return()=>{e.map(Tn)}}function Xe(){}function wt(e,t){return t(e),e}function Sn(e,t){return t(e)}function oe(...e){return e}function Q(e,t){return e(Oe,t)}function G(e,t){e(It,t)}function Ft(e){e(Ye)}function se(e){return e(zo)}function N(e,t){return Q(e,In(t,It))}function ke(e,t){const o=e(Oe,n=>{o(),t(n)});return o}function uo(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout(()=>{n(t)},e)}}function Bo(e,t){return e===t}function te(e=Bo){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function P(e){return t=>o=>{e(o)&&t(o)}}function H(e){return t=>Eo(t,e)}function He(e){return t=>()=>{t(e)}}function I(e,...t){const o=kn(...t);return((n,r)=>{switch(n){case Ye:Ft(e);return;case Oe:return Q(e,o(r))}})}function ze(e,t){return o=>n=>{o(t=e(t,n))}}function _e(e){return t=>o=>{e>0?e--:t(o)}}function Be(e){let t=null,o;return n=>r=>{t=r,!o&&(o=setTimeout(()=>{o=void 0,n(t)},e))}}function $(...e){const t=new Array(e.length);let o=0,n=null;const r=2**e.length-1;return e.forEach((s,i)=>{const a=2**i;Q(s,l=>{const u=o;o|=a,t[i]=l,u!==r&&o===r&&n&&(n(),n=null)})}),s=>i=>{const a=()=>{s([i].concat(t))};o===r?a():n=a}}function kn(...e){return t=>e.reduceRight(Sn,t)}function Rn(e){let t,o;const n=()=>t==null?void 0:t();return function(r,s){switch(r){case Oe:return s?o===s?void 0:(n(),o=s,t=Q(e,s),t):(n(),Xe);case Ye:n(),o=null;return}}}function S(e){let t=e;const o=K();return((n,r)=>{switch(n){case It:t=r;break;case Oe:{r(t);break}case zo:return t}return o(n,r)})}function ve(e,t){return wt(S(t),o=>N(e,o))}function K(){const e=[];return((t,o)=>{switch(t){case It:e.slice().forEach(n=>{n(o)});return;case Ye:e.splice(0,e.length);return;case Oe:return e.push(o),()=>{const n=e.indexOf(o);n>-1&&e.splice(n,1)}}})}function Ie(e){return wt(K(),t=>N(e,t))}function Y(e,t=[],{singleton:o}={singleton:!0}){return{constructor:e,dependencies:t,id:jn(),singleton:o}}const jn=()=>Symbol();function Hn(e){const t=new Map,o=({constructor:n,dependencies:r,id:s,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=n(r.map(l=>o(l)));return i&&t.set(s,a),a};return o(e)}function ue(...e){const t=K(),o=new Array(e.length);let n=0;const r=2**e.length-1;return e.forEach((s,i)=>{const a=2**i;Q(s,l=>{o[i]=l,n|=a,n===r&&G(t,o)})}),function(s,i){switch(s){case Ye:{Ft(t);return}case Oe:return n===r&&i(o),Q(t,i)}}}function W(e,t=Bo){return I(e,te(t))}function Mt(...e){return function(t,o){switch(t){case Ye:return;case Oe:return wn(...e.map(n=>Q(n,o)))}}}const he={DEBUG:0,INFO:1,WARN:2,ERROR:3},zn={[he.DEBUG]:"debug",[he.ERROR]:"error",[he.INFO]:"log",[he.WARN]:"warn"},En=()=>typeof globalThis>"u"?window:globalThis,Ae=Y(()=>{const e=S(he.ERROR);return{log:S((t,o,n=he.INFO)=>{const r=En().VIRTUOSO_LOG_LEVEL??se(e);n>=r&&console[zn[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)}),logLevel:e}},[],{singleton:!0});function Fe(e,t,o){return Vt(e,t,o).callbackRef}function Vt(e,t,o){const n=L.useRef(null);let r=i=>{};const s=L.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const a=()=>{const l=i[0].target;l.offsetParent!==null&&e(l)};o?a():requestAnimationFrame(a)}):null,[e,o]);return r=i=>{i&&t?(s==null||s.observe(i),n.current=i):(n.current&&(s==null||s.unobserve(n.current)),n.current=null)},{callbackRef:r,ref:n}}function Bn(e,t,o,n,r,s,i,a,l){const u=L.useCallback(h=>{const v=Ln(h.children,t,a?"offsetWidth":"offsetHeight",r);let g=h.parentElement;for(;g.dataset.virtuosoScroller===void 0;)g=g.parentElement;const p=g.lastElementChild.dataset.viewportType==="window";let T;p&&(T=g.ownerDocument.defaultView);const y=i?a?i.scrollLeft:i.scrollTop:p?a?T.scrollX||T.document.documentElement.scrollLeft:T.scrollY||T.document.documentElement.scrollTop:a?g.scrollLeft:g.scrollTop,x=i?a?i.scrollWidth:i.scrollHeight:p?a?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight:a?g.scrollWidth:g.scrollHeight,m=i?a?i.offsetWidth:i.offsetHeight:p?a?T.innerWidth:T.innerHeight:a?g.offsetWidth:g.offsetHeight;n({scrollHeight:x,scrollTop:Math.max(y,0),viewportHeight:m}),s==null||s(a?fo("column-gap",getComputedStyle(h).columnGap,r):fo("row-gap",getComputedStyle(h).rowGap,r)),v!==null&&e(v)},[e,t,r,s,i,n,a]);return Vt(u,o,l)}function Ln(e,t,o,n){const r=e.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const a=e.item(i);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),u=parseFloat(a.dataset.knownSize),h=t(a,o);if(h===0&&n("Zero-sized element, this should not happen",{child:a},he.ERROR),h===u)continue;const v=s[s.length-1];s.length===0||v.size!==h||v.endIndex!==l-1?s.push({endIndex:l,size:h,startIndex:l}):s[s.length-1].endIndex++}return s}function fo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}function Lo(e,t,o){const n=L.useRef(null),r=L.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const u=l.getBoundingClientRect(),h=u.width;let v,g;if(t){const p=t.getBoundingClientRect(),T=u.top-p.top;g=p.height-Math.max(0,T),v=T+t.scrollTop}else{const p=i.current.ownerDocument.defaultView;g=p.innerHeight-Math.max(0,u.top),v=u.top+p.scrollY}n.current={listHeight:u.height,offsetTop:v,visibleHeight:g,visibleWidth:h},e(n.current)},[e,t]),{callbackRef:s,ref:i}=Vt(r,!0,o),a=L.useCallback(()=>{r(i.current)},[r,i]);return L.useEffect(()=>{var u;if(t){t.addEventListener("scroll",a);const h=new ResizeObserver(()=>{requestAnimationFrame(a)});return h.observe(t),()=>{t.removeEventListener("scroll",a),h.unobserve(t)}}const l=(u=i.current)==null?void 0:u.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,t,i]),s}const be=Y(()=>{const e=K(),t=K(),o=S(0),n=K(),r=S(0),s=K(),i=K(),a=S(0),l=S(0),u=S(0),h=S(0),v=K(),g=K(),p=S(!1),T=S(!1),y=S(!1);return N(I(e,H(({scrollTop:x})=>x)),t),N(I(e,H(({scrollHeight:x})=>x)),i),N(t,r),{deviation:o,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:h,headerHeight:a,horizontalDirection:T,scrollBy:g,scrollContainerState:e,scrollHeight:i,scrollingInProgress:p,scrollTo:v,scrollTop:t,skipAnimationFrameInResizeObserver:y,smoothScrollTargetReached:n,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),ot={lvl:0};function No(e,t){const o=e.length;if(o===0)return[];let{index:n,value:r}=t(e[0]);const s=[];for(let i=1;i<o;i++){const{index:a,value:l}=t(e[i]);s.push({end:a-1,start:n,value:r}),n=a,r=l}return s.push({end:1/0,start:n,value:r}),s}function Z(e){return e===ot}function nt(e,t){if(!Z(e))return t===e.k?e.v:t<e.k?nt(e.l,t):nt(e.r,t)}function Re(e,t,o="k"){if(Z(e))return[-1/0,void 0];if(Number(e[o])===t)return[e.k,e.v];if(Number(e[o])<t){const n=Re(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return Re(e.l,t,o)}function Te(e,t,o){return Z(e)?Ao(t,o,1):t===e.k?me(e,{k:t,v:o}):t<e.k?mo(me(e,{l:Te(e.l,t,o)})):mo(me(e,{r:Te(e.r,t,o)}))}function Ue(){return ot}function Ke(e,t,o){if(Z(e))return[];const n=Re(e,t)[0];return Nn(At(e,n,o))}function Ot(e,t){if(Z(e))return ot;const{k:o,l:n,r}=e;if(t===o){if(Z(n))return r;if(Z(r))return n;const[s,i]=Oo(n);return vt(me(e,{k:s,l:Mo(n),v:i}))}return t<o?vt(me(e,{l:Ot(n,t)})):vt(me(e,{r:Ot(r,t)}))}function Pe(e){return Z(e)?[]:[...Pe(e.l),{k:e.k,v:e.v},...Pe(e.r)]}function At(e,t,o){if(Z(e))return[];const{k:n,l:r,r:s,v:i}=e;let a=[];return n>t&&(a=a.concat(At(r,t,o))),n>=t&&n<=o&&a.push({k:n,v:i}),n<=o&&(a=a.concat(At(s,t,o))),a}function vt(e){const{l:t,lvl:o,r:n}=e;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(Ht(t))return Do(me(e,{lvl:o-1}));if(!Z(t)&&!Z(t.r))return me(t.r,{l:me(t,{r:t.r.l}),lvl:o,r:me(e,{l:t.r.r,lvl:o-1})});throw new Error("Unexpected empty nodes")}if(Ht(e))return Dt(me(e,{lvl:o-1}));if(!Z(n)&&!Z(n.l)){const r=n.l,s=Ht(r)?n.lvl-1:n.lvl;return me(r,{l:me(e,{lvl:o-1,r:r.l}),lvl:r.lvl+1,r:Dt(me(n,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function me(e,t){return Ao(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 Mo(e){return Z(e.r)?e.l:vt(me(e,{r:Mo(e.r)}))}function Ht(e){return Z(e)||e.lvl>e.r.lvl}function Oo(e){return Z(e.r)?[e.k,e.v]:Oo(e.r)}function Ao(e,t,o,n=ot,r=ot){return{k:e,l:n,lvl:o,r,v:t}}function mo(e){return Dt(Do(e))}function Do(e){const{l:t}=e;return!Z(t)&&t.lvl===e.lvl?me(t,{r:me(e,{l:t.r})}):e}function Dt(e){const{lvl:t,r:o}=e;return!Z(o)&&!Z(o.r)&&o.lvl===t&&o.r.lvl===t?me(o,{l:me(e,{r:o.l}),lvl:t+1}):e}function Nn(e){return No(e,({k:t,v:o})=>({index:t,value:o}))}function Wo(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function rt(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Gt=Y(()=>({recalcInProgress:S(!1)}),[],{singleton:!0});function Po(e,t,o){return e[Ct(e,t,o)]}function Ct(e,t,o,n=0){let r=e.length-1;for(;n<=r;){const s=Math.floor((n+r)/2),i=e[s],a=o(i,t);if(a===0)return s;if(a===-1){if(r-n<2)return s-1;r=s-1}else{if(r===n)return s;n=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Mn(e,t,o,n){const r=Ct(e,t,n),s=Ct(e,o,n,r);return e.slice(r,s+1)}function Me(e,t){return Math.round(e.getBoundingClientRect()[t])}function St(e){return!Z(e.groupOffsetTree)}function $t({index:e},t){return t===e?0:t<e?-1:1}function On(){return{groupIndices:[],groupOffsetTree:Ue(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ue()}}function An(e,t){let o=Z(e)?0:1/0;for(const n of t){const{endIndex:r,size:s,startIndex:i}=n;if(o=Math.min(o,i),Z(e)){e=Te(e,0,s);continue}const a=Ke(e,i-1,r+1);if(a.some(Gn(n)))continue;let l=!1,u=!1;for(const{end:h,start:v,value:g}of a)l?(r>=v||s===g)&&(e=Ot(e,v)):(u=g!==s,l=!0),h>r&&r>=v&&g!==s&&(e=Te(e,r+1,g));u&&(e=Te(e,i,s))}return[e,o]}function Dn(e){return typeof e.groupIndex<"u"}function Wn({offset:e},t){return t===e?0:t<e?-1:1}function st(e,t,o){if(t.length===0)return 0;const{index:n,offset:r,size:s}=Po(t,e,$t),i=e-n,a=s*i+(i-1)*o+r;return a>0?a+o:a}function _o(e,t){if(!St(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function Fo(e,t,o){if(Dn(e))return t.groupIndices[e.groupIndex]+1;const n=e.index==="LAST"?o:e.index;let r=_o(n,t);return r=Math.max(0,r,Math.min(o,r)),r}function Pn(e,t,o,n=0){return n>0&&(t=Math.max(t,Po(e,n,$t).offset)),No(Mn(e,t,o,Wn),Vn)}function _n(e,[t,o,n,r]){t.length>0&&n("received item sizes",t,he.DEBUG);const s=e.sizeTree;let i=s,a=0;if(o.length>0&&Z(s)&&t.length===2){const g=t[0].size,p=t[1].size;i=o.reduce((T,y)=>Te(Te(T,y,g),y+1,p),i)}else[i,a]=An(i,t);if(i===s)return e;const{lastIndex:l,lastOffset:u,lastSize:h,offsetTree:v}=Wt(e.offsetTree,a,i,r);return{groupIndices:o,groupOffsetTree:o.reduce((g,p)=>Te(g,p,st(p,v,r)),Ue()),lastIndex:l,lastOffset:u,lastSize:h,offsetTree:v,sizeTree:i}}function Fn(e){return Pe(e).map(({k:t,v:o},n,r)=>{const s=r[n+1];return{endIndex:s!==void 0?s.k-1:1/0,size:o,startIndex:t}})}function ho(e,t){let o=0,n=0;for(;o<e;)o+=t[n+1]-t[n]-1,n++;return n-(o===e?0:1)}function Wt(e,t,o,n){let r=e,s=0,i=0,a=0,l=0;if(t!==0){l=Ct(r,t-1,$t),a=r[l].offset;const u=Re(o,t-1);s=u[0],i=u[1],r.length&&r[l].size===Re(o,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:u,value:h}of Ke(o,t,1/0)){const v=u-s,g=v*i+a+v*n;r.push({index:u,offset:g,size:h}),s=u,a=g,i=h}return{lastIndex:s,lastOffset:a,lastSize:i,offsetTree:r}}function Vn(e){return{index:e.index,value:e}}function Gn(e){const{endIndex:t,size:o,startIndex:n}=e;return r=>r.start===n&&(r.end===t||r.end===1/0)&&r.value===o}const $n={offsetHeight:"height",offsetWidth:"width"},Ee=Y(([{log:e},{recalcInProgress:t}])=>{const o=K(),n=K(),r=ve(n,0),s=K(),i=K(),a=S(0),l=S([]),u=S(void 0),h=S(void 0),v=S(void 0),g=S(void 0),p=S((c,b)=>Me(c,$n[b])),T=S(void 0),y=S(0),x=On(),m=ve(I(o,$(l,e,y),ze(_n,x),te()),x),f=ve(I(l,te(),ze((c,b)=>({current:b,prev:c.current}),{current:[],prev:[]}),H(({prev:c})=>c)),[]);N(I(l,P(c=>c.length>0),$(m,y),H(([c,b,k])=>{const B=c.reduce((E,F,V)=>Te(E,F,st(F,b.offsetTree,k)||V),Ue());return{...b,groupIndices:c,groupOffsetTree:B}})),m),N(I(n,$(m),P(([c,{lastIndex:b}])=>c<b),H(([c,{lastIndex:b,lastSize:k}])=>[{endIndex:b,size:k,startIndex:c}])),o),N(u,h);const w=ve(I(u,H(c=>c===void 0)),!0);N(I(h,P(c=>c!==void 0&&Z(se(m).sizeTree)),H(c=>{const b=se(v),k=se(l).length>0;return b!==void 0&&b!==0?k?[{endIndex:0,size:b,startIndex:0},{endIndex:1,size:c,startIndex:1}]:[]:[{endIndex:0,size:c,startIndex:0}]})),o),N(I(g,P(c=>c!==void 0&&c.length>0&&Z(se(m).sizeTree)),H(c=>{const b=[];let k=c[0],B=0;for(let E=1;E<c.length;E++){const F=c[E];F!==k&&(b.push({endIndex:E-1,size:k,startIndex:B}),k=F,B=E)}return b.push({endIndex:c.length-1,size:k,startIndex:B}),b})),o),N(I(l,$(v,h),P(([,c,b])=>c!==void 0&&b!==void 0),H(([c,b,k])=>{const B=[];for(let E=0;E<c.length;E++){const F=c[E],V=c[E+1];B.push({startIndex:F,endIndex:F,size:b}),V!==void 0&&B.push({startIndex:F+1,endIndex:V-1,size:k})}return B})),o);const z=Ie(I(o,$(m),ze(({sizes:c},[b,k])=>({changed:k!==c,sizes:k}),{changed:!1,sizes:x}),H(c=>c.changed)));Q(I(a,ze((c,b)=>({diff:c.prev-b,prev:b}),{diff:0,prev:0}),H(c=>c.diff)),c=>{const{groupIndices:b}=se(m);if(c>0)G(t,!0),G(s,c+ho(c,b));else if(c<0){const k=se(f);k.length>0&&(c-=ho(-c,k)),G(i,c)}}),Q(I(a,$(e)),([c,b])=>{c<0&&b("`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},he.ERROR)});const R=Ie(s);N(I(s,$(m),H(([c,b])=>{const k=b.groupIndices.length>0,B=[],E=b.lastSize;if(k){const F=nt(b.sizeTree,0);let V=0,D=0;for(;V<c;){const C=b.groupIndices[D],O=b.groupIndices.length===D+1?1/0:b.groupIndices[D+1]-C-1;B.push({endIndex:C,size:F,startIndex:C}),B.push({endIndex:C+1+O-1,size:E,startIndex:C+1}),D++,V+=O+1}const U=Pe(b.sizeTree);return V!==c&&U.shift(),U.reduce((C,{k:O,v:q})=>{let pe=C.ranges;return C.prevSize!==0&&(pe=[...C.ranges,{endIndex:O+c-1,size:C.prevSize,startIndex:C.prevIndex}]),{prevIndex:O+c,prevSize:q,ranges:pe}},{prevIndex:c,prevSize:0,ranges:B}).ranges}return Pe(b.sizeTree).reduce((F,{k:V,v:D})=>({prevIndex:V+c,prevSize:D,ranges:[...F.ranges,{endIndex:V+c-1,size:F.prevSize,startIndex:F.prevIndex}]}),{prevIndex:0,prevSize:E,ranges:[]}).ranges})),o);const A=Ie(I(i,$(m,y),H(([c,{offsetTree:b},k])=>{const B=-c;return st(B,b,k)})));return N(I(i,$(m,y),H(([c,b,k])=>{if(b.groupIndices.length>0){if(Z(b.sizeTree))return b;let E=Ue();const F=se(f);let V=0,D=0,U=0;for(;V<-c;){U=F[D];const C=F[D+1]-U-1;D++,V+=C+1}if(E=Pe(b.sizeTree).reduce((C,{k:O,v:q})=>Te(C,Math.max(0,O+c),q),E),V!==-c){const C=nt(b.sizeTree,U);E=Te(E,0,C);const O=Re(b.sizeTree,-c+1)[1];E=Te(E,1,O)}return{...b,sizeTree:E,...Wt(b.offsetTree,0,E,k)}}const B=Pe(b.sizeTree).reduce((E,{k:F,v:V})=>Te(E,Math.max(0,F+c),V),Ue());return{...b,sizeTree:B,...Wt(b.offsetTree,0,B,k)}})),m),{beforeUnshiftWith:R,data:T,defaultItemSize:h,firstItemIndex:a,fixedItemSize:u,fixedGroupSize:v,gap:y,groupIndices:l,heightEstimates:g,itemSize:p,listRefresh:z,shiftWith:i,shiftWithOffset:A,sizeRanges:o,sizes:m,statefulTotalCount:r,totalCount:n,trackItemSizes:w,unshiftWith:s}},oe(Ae,Gt),{singleton:!0});function Un(e){return e.reduce((t,o)=>(t.groupIndices.push(t.totalCount),t.totalCount+=o+1,t),{groupIndices:[],totalCount:0})}const Vo=Y(([{groupIndices:e,sizes:t,totalCount:o},{headerHeight:n,scrollTop:r}])=>{const s=K(),i=K(),a=Ie(I(s,H(Un)));return N(I(a,H(l=>l.totalCount)),o),N(I(a,H(l=>l.groupIndices)),e),N(I(ue(r,t,n),P(([l,u])=>St(u)),H(([l,u,h])=>Re(u.groupOffsetTree,Math.max(l-h,0),"v")[0]),te(),H(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},oe(Ee,be)),De=Y(([{log:e}])=>{const t=S(!1),o=Ie(I(t,P(n=>n),te()));return Q(t,n=>{n&&se(e)("props updated",{},he.DEBUG)}),{didMount:o,propsReady:t}},oe(Ae),{singleton:!0}),Kn=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Go(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Kn)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const ct=Y(([{gap:e,listRefresh:t,sizes:o,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:a,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:h,viewportHeight:v},{log:g}])=>{const p=K(),T=K(),y=S(0);let x=null,m=null,f=null;function w(){x!==null&&(x(),x=null),f!==null&&(f(),f=null),m&&(clearTimeout(m),m=null),G(l,!1)}return N(I(p,$(o,v,n,y,a,i,g),$(e,s,r),H(([[z,R,A,c,b,k,B,E],F,V,D])=>{const U=Go(z),{align:C,behavior:O,offset:q}=U,pe=c-1,le=Fo(U,R,pe);let Ce=st(le,R.offsetTree,F)+k;C==="end"?(Ce+=V+Re(R.sizeTree,le)[1]-A+D,le===pe&&(Ce+=B)):C==="center"?Ce+=(V+Re(R.sizeTree,le)[1]-A+D)/2:Ce-=b,q!==void 0&&q!==0&&(Ce+=q);const Le=ge=>{w(),ge?(E("retrying to scroll to",{location:z},he.DEBUG),G(p,z)):(G(T,!0),E("list did not change, scroll successful",{},he.DEBUG))};if(w(),O==="smooth"){let ge=!1;f=Q(t,Ge=>{ge=ge||Ge}),x=ke(h,()=>{Le(ge)})}else x=ke(I(t,Yn(150)),Le);return m=setTimeout(()=>{w()},1200),G(l,!0),E("scrolling from index to",{behavior:O,index:le,top:Ce},he.DEBUG),{behavior:O,top:Ce}})),u),{scrollTargetReached:T,scrollToIndex:p,topListHeight:y}},oe(Ee,be,Ae),{singleton:!0});function Yn(e){return t=>{const o=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(o))}}}function Ut(e,t){e===0?t():requestAnimationFrame(()=>{Ut(e-1,t)})}function Kt(e,t){const o=t-1;return typeof e=="number"?e:e.index==="LAST"?o:e.index}const ut=Y(([{defaultItemSize:e,listRefresh:t,sizes:o},{scrollTop:n},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const a=S(!0),l=S(0),u=S(!0);return N(I(i,$(l),P(([h,v])=>v!==0),He(!1)),a),N(I(i,$(l),P(([h,v])=>v!==0),He(!1)),u),Q(I(ue(t,i),$(a,o,e,u),P(([[,h],v,{sizeTree:g},p,T])=>h&&(!Z(g)||_t(p))&&!v&&!T),$(l)),([,h])=>{ke(r,()=>{G(u,!0)}),Ut(4,()=>{ke(n,()=>{G(a,!0)}),G(s,h)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:a}},oe(Ee,be,ct,De),{singleton:!0});function $o(e,t){return Math.abs(e-t)<1.01}const it="up",qe="down",Xn="none",Qn={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Zn=0,dt=Y(([{footerHeight:e,headerHeight:t,scrollBy:o,scrollContainerState:n,scrollTop:r,viewportHeight:s}])=>{const i=S(!1),a=S(!0),l=K(),u=K(),h=S(4),v=S(Zn),g=ve(I(Mt(I(W(r),_e(1),He(!0)),I(W(r),_e(1),He(!1),uo(100))),te()),!1),p=ve(I(Mt(I(o,He(!0)),I(o,He(!1),uo(200))),te()),!1);N(I(ue(W(r),W(v)),H(([f,w])=>f<=w),te()),a),N(I(a,Be(50)),u);const T=Ie(I(ue(n,W(s),W(t),W(e),W(h)),ze((f,[{scrollHeight:w,scrollTop:z},R,A,c,b])=>{const k=z+R-w>-b,B={scrollHeight:w,scrollTop:z,viewportHeight:R};if(k){let F,V;return z>f.state.scrollTop?(F="SCROLLED_DOWN",V=f.state.scrollTop-z):(F="SIZE_DECREASED",V=f.state.scrollTop-z||f.scrollTopDelta),{atBottom:!0,atBottomBecause:F,scrollTopDelta:V,state:B}}let E;return B.scrollHeight>f.state.scrollHeight?E="SIZE_INCREASED":R<f.state.viewportHeight?E="VIEWPORT_HEIGHT_DECREASING":z<f.state.scrollTop?E="SCROLLING_UPWARDS":E="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:E,state:B}},Qn),te((f,w)=>f!==void 0&&f.atBottom===w.atBottom))),y=ve(I(n,ze((f,{scrollHeight:w,scrollTop:z,viewportHeight:R})=>{if(!$o(f.scrollHeight,w)){const A=w-(z+R)<1;return f.scrollTop!==z&&A?{changed:!0,jump:f.scrollTop-z,scrollHeight:w,scrollTop:z}:{changed:!0,jump:0,scrollHeight:w,scrollTop:z}}return{changed:!1,jump:0,scrollHeight:w,scrollTop:z}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(f=>f.changed),H(f=>f.jump)),0);N(I(T,H(f=>f.atBottom)),i),N(I(i,Be(50)),l);const x=S(qe);N(I(n,H(({scrollTop:f})=>f),te(),ze((f,w)=>se(p)?{direction:f.direction,prevScrollTop:w}:{direction:w<f.prevScrollTop?it:qe,prevScrollTop:w},{direction:qe,prevScrollTop:0}),H(f=>f.direction)),x),N(I(n,Be(50),He(Xn)),x);const m=S(0);return N(I(g,P(f=>!f),He(0)),m),N(I(r,Be(100),$(g),P(([f,w])=>w),ze(([f,w],[z])=>[w,z],[0,0]),H(([f,w])=>w-f)),m),{atBottomState:T,atBottomStateChange:l,atBottomThreshold:h,atTopStateChange:u,atTopThreshold:v,isAtBottom:i,isAtTop:a,isScrolling:g,lastJumpDueToItemResize:y,scrollDirection:x,scrollVelocity:m}},oe(be)),lt="top",at="bottom",po="none";function go(e,t,o){return typeof e=="number"?o===it&&t===lt||o===qe&&t===at?e:0:o===it?t===lt?e.main:e.reverse:t===at?e.main:e.reverse}function xo(e,t){return typeof e=="number"?e:e[t]??0}const Yt=Y(([{deviation:e,fixedHeaderHeight:t,headerHeight:o,scrollTop:n,viewportHeight:r}])=>{const s=K(),i=S(0),a=S(0),l=S(0),u=ve(I(ue(W(n),W(r),W(o),W(s,rt),W(l),W(i),W(t),W(e),W(a)),H(([h,v,g,[p,T],y,x,m,f,w])=>{const z=h-f,R=x+m,A=Math.max(g-z,0);let c=po;const b=xo(w,lt),k=xo(w,at);return p-=f,p+=g+m,T+=g+m,T-=f,p>h+R-b&&(c=it),T<h-A+v+k&&(c=qe),c!==po?[Math.max(z-g-go(y,lt,c)-b,0),z-A-m+v+go(y,at,c)+k]:null}),P(h=>h!==null),te(rt)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:i,visibleRange:u}},oe(be),{singleton:!0});function Jn(e,t,o){if(St(t)){const n=_o(e,t);return[{index:Re(t.groupOffsetTree,n)[0],offset:0,size:0},{data:o==null?void 0:o[0],index:n,offset:0,size:0}]}return[{data:o==null?void 0:o[0],index:e,offset:0,size:0}]}const zt={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function yt(e,t,o,n,r,s){const{lastIndex:i,lastOffset:a,lastSize:l}=r;let u=0,h=0;if(e.length>0){u=e[0].offset;const y=e[e.length-1];h=y.offset+y.size}const v=o-i,g=a+v*l+(v-1)*n,p=u,T=g-h;return{bottom:h,firstItemIndex:s,items:vo(e,r,s),offsetBottom:T,offsetTop:u,top:p,topItems:vo(t,r,s),topListHeight:t.reduce((y,x)=>x.size+y,0),totalCount:o}}function Uo(e,t,o,n,r,s){let i=0;if(o.groupIndices.length>0)for(const h of o.groupIndices){if(h-i>=e)break;i++}const a=e+i,l=Kt(t,a),u=Array.from({length:a}).map((h,v)=>({data:s[v+l],index:v+l,offset:0,size:0}));return yt(u,[],a,r,o,n)}function vo(e,t,o){if(e.length===0)return[];if(!St(t))return e.map(u=>({...u,index:u.index+o,originalIndex:u.index}));const n=e[0].index,r=e[e.length-1].index,s=[],i=Ke(t.groupOffsetTree,n,r);let a,l=0;for(const u of e){(!a||a.end<u.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let h;u.index===a.start?h={index:l,type:"group"}:h={groupIndex:l,index:u.index-(l+1)+o},s.push({...h,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return s}function yo(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const Ve=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n,totalCount:r},s,{listBoundary:i,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:h},{topListHeight:v},g,{didMount:p},{recalcInProgress:T}])=>{const y=S([]),x=S(0),m=K(),f=S(0);N(s.topItemsIndexes,y);const w=ve(I(ue(p,T,W(l,rt),W(r),W(n),W(u),h,W(y),W(t),W(o),W(f),e),P(([c,b,,k,,,,,,,,B])=>{const E=B!==void 0&&B.length!==k;return c&&!b&&!E}),H(([,,[c,b],k,B,E,F,V,D,U,C,O])=>{var X,de;const q=B,{offsetTree:pe,sizeTree:le}=q,Ce=se(x);if(k===0)return{...zt,totalCount:k};if(c===0&&b===0)return Ce===0?{...zt,totalCount:k}:Uo(Ce,E,B,D,U,O||[]);if(Z(le))return Ce>0?null:yt(Jn(Kt(E,k),q,O),[],k,U,q,D);const Le=[];if(V.length>0){const ee=V[0],ne=V[V.length-1];let fe=0;for(const ae of Ke(le,ee,ne)){const J=ae.value,ie=Math.max(ae.start,ee),ye=Math.min(ae.end,ne);for(let ce=ie;ce<=ye;ce++)Le.push({data:O==null?void 0:O[ce],index:ce,offset:fe,size:J}),fe+=J}}if(!F)return yt([],Le,k,U,q,D);const ge=V.length>0?V[V.length-1]+1:0,Ge=Pn(pe,c,b,ge);if(Ge.length===0)return null;const Qe=k-1,je=wt([],ee=>{for(const ne of Ge){const fe=ne.value;let ae=fe.offset,J=ne.start;const ie=fe.size;if(fe.offset<c){J+=Math.floor((c-fe.offset+U)/(ie+U));const ce=J-ne.start;ae+=ce*ie+ce*U}J<ge&&(ae+=(ge-J)*ie,J=ge);const ye=Math.min(ne.end,Qe);for(let ce=J;ce<=ye&&!(ae>=b);ce++)ee.push({data:O==null?void 0:O[ce],index:ce,offset:ae,size:ie}),ae+=ie+U}}),Ze=yo(C,lt),j=yo(C,at);if(je.length>0&&(Ze>0||j>0)){const ee=je[0],ne=je[je.length-1];if(Ze>0&&ee.index>ge){const fe=Math.min(Ze,ee.index-ge),ae=[];let J=ee.offset;for(let ie=ee.index-1;ie>=ee.index-fe;ie--){const ye=((X=Ke(le,ie,ie)[0])==null?void 0:X.value)??ee.size;J-=ye+U,ae.unshift({data:O==null?void 0:O[ie],index:ie,offset:J,size:ye})}je.unshift(...ae)}if(j>0&&ne.index<Qe){const fe=Math.min(j,Qe-ne.index);let ae=ne.offset+ne.size+U;for(let J=ne.index+1;J<=ne.index+fe;J++){const ie=((de=Ke(le,J,J)[0])==null?void 0:de.value)??ne.size;je.push({data:O==null?void 0:O[J],index:J,offset:ae,size:ie}),ae+=ie+U}}}return yt(je,Le,k,U,q,D)}),P(c=>c!==null),te()),zt);N(I(e,P(_t),H(c=>c==null?void 0:c.length)),r),N(I(w,H(c=>c.topListHeight)),v),N(v,a),N(I(w,H(c=>[c.top,c.bottom])),i),N(I(w,H(c=>c.items)),m);const z=Ie(I(w,P(({items:c})=>c.length>0),$(r,e),P(([{items:c},b])=>c[c.length-1].originalIndex===b-1),H(([,c,b])=>[c-1,b]),te(rt),H(([c])=>c))),R=Ie(I(w,Be(200),P(({items:c,topItems:b})=>c.length>0&&c[0].originalIndex===b.length),H(({items:c})=>c[0].index),te())),A=Ie(I(w,P(({items:c})=>c.length>0),H(({items:c})=>{let b=0,k=c.length-1;for(;c[b].type==="group"&&b<k;)b++;for(;c[k].type==="group"&&k>b;)k--;return{endIndex:c[k].index,startIndex:c[b].index}}),te(Wo)));return{endReached:z,initialItemCount:x,itemsRendered:m,listState:w,minOverscanItemCount:f,rangeChanged:A,startReached:R,topItemsIndexes:y,...g}},oe(Ee,Vo,Yt,ut,ct,dt,De,Gt),{singleton:!0}),Ko=Y(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:o,headerHeight:n},{listState:r}])=>{const s=K(),i=ve(I(ue(o,e,n,t,r),H(([a,l,u,h,v])=>a+l+u+h+v.offsetBottom+v.bottom)),0);return N(W(i),s),{totalListHeight:i,totalListHeightChanged:s}},oe(be,Ve),{singleton:!0}),qn=Y(([{viewportHeight:e},{totalListHeight:t}])=>{const o=S(!1),n=ve(I(ue(o,e,t),P(([r])=>r),H(([,r,s])=>Math.max(0,r-s)),Be(0),te()),0);return{alignToBottom:o,paddingTopAddition:n}},oe(be,Ko),{singleton:!0}),Yo=Y(()=>({context:S(null)})),er=({itemBottom:e,itemTop:t,locationParams:{align:o,behavior:n,...r},viewportBottom:s,viewportTop:i})=>t<i?{...r,align:o??"start",...n!==void 0?{behavior:n}:{}}:e>s?{...r,align:o??"end",...n!==void 0?{behavior:n}:{}}:null,Xo=Y(([{gap:e,sizes:t,totalCount:o},{fixedFooterHeight:n,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:a,viewportHeight:l},{scrollToIndex:u}])=>{const h=K();return N(I(h,$(t,l,o,s,r,n,a),$(e),H(([[v,g,p,T,y,x,m,f],w])=>{const{calculateViewLocation:z=er,done:R,...A}=v,c=Fo(v,g,T-1),b=st(c,g.offsetTree,w)+y+x,k=b+Re(g.sizeTree,c)[1],B=f+x,E=f+p-m,F=z({itemBottom:k,itemTop:b,locationParams:A,viewportBottom:E,viewportTop:B});return F!==null?R&&ke(I(i,P(V=>!V),_e(se(i)?1:2)),R):R==null||R(),F}),P(v=>v!==null)),u),{scrollIntoView:h}},oe(Ee,be,ct,Ve,Ae),{singleton:!0});function bo(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const tr=(e,t)=>typeof e=="function"?bo(e(t)):t&&bo(e),or=Y(([{listRefresh:e,totalCount:t,fixedItemSize:o,data:n},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:l,propsReady:u},{log:h},{scrollingInProgress:v},{context:g},{scrollIntoView:p}])=>{const T=S(!1),y=K();let x=null;function m(R){G(i,{align:"end",behavior:R,index:"LAST"})}Q(I(ue(I(W(t),_e(1)),l),$(W(T),s,a,v),H(([[R,A],c,b,k,B])=>{let E=A&&k,F="auto";return E&&(F=tr(c,b||B),E=E&&F!==!1),{followOutputBehavior:F,shouldFollow:E,totalCount:R}}),P(({shouldFollow:R})=>R)),({followOutputBehavior:R,totalCount:A})=>{x!==null&&(x(),x=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("following output to ",{totalCount:A},he.DEBUG),m(R)}):x=ke(e,()=>{se(h)("following output to ",{totalCount:A},he.DEBUG),m(R),x=null})});function f(R){const A=ke(r,c=>{R&&!c.atBottom&&c.notAtBottomBecause==="SIZE_INCREASED"&&x===null&&(se(h)("scrolling to bottom due to increased size",{},he.DEBUG),m("auto"))});setTimeout(A,100)}Q(I(ue(W(T),t,u),P(([R,,A])=>R!==!1&&A),ze(({value:R},[,A])=>({refreshed:R===A,value:A}),{refreshed:!1,value:0}),P(({refreshed:R})=>R),$(T,t)),([,R])=>{se(a)&&f(R!==!1)}),Q(y,()=>{f(se(T)!==!1)}),Q(ue(W(T),r),([R,A])=>{R!==!1&&!A.atBottom&&A.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&m("auto")});const w=S(null),z=K();return N(Mt(I(W(n),H(R=>(R==null?void 0:R.length)??0)),I(W(t))),z),Q(I(ue(I(z,_e(1)),l),$(W(w),a,v,g),H(([[R,A],c,b,k,B])=>A&&b&&(c==null?void 0:c({context:B,totalCount:R,scrollingInProgress:k}))),P(R=>!!R),Be(0)),R=>{x!==null&&(x(),x=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("scrolling into view",{}),G(p,R)}):x=ke(e,()=>{se(h)("scrolling into view",{}),G(p,R),x=null})}),{autoscrollToBottom:y,followOutput:T,scrollIntoViewOnChange:w}},oe(Ee,dt,ct,ut,De,Ae,be,Yo,Xo)),nr=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:a}])=>(N(I(a,$(s),P(([,l])=>l!==0),$(r,n,t,o,e),H(([[,l],u,h,v,g,p=[]])=>Uo(l,u,h,v,g,p))),i),{}),oe(Ee,ut,Ve,De),{singleton:!0}),rr=Y(([{didMount:e},{scrollTo:t},{listState:o}])=>{const n=S(0);return Q(I(e,$(n),P(([,r])=>r!==0),H(([,r])=>({top:r}))),r=>{ke(I(o,_e(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{G(t,r)})})}),{initialScrollTop:n}},oe(De,be,Ve),{singleton:!0}),Qo=Y(([{scrollVelocity:e}])=>{const t=S(!1),o=K(),n=S(!1);return N(I(e,$(n,t,o),P(([r,s])=>s!==!1&&s!==void 0),H(([r,s,i,a])=>{const{enter:l,exit:u}=s;if(i){if(u(r,a))return!1}else if(l(r,a))return!0;return i}),te()),t),Q(I(ue(t,e,o),$(n)),([[r,s,i],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(s,i)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:o,scrollVelocity:e}},oe(dt),{singleton:!0}),Xt=Y(([{scrollContainerState:e,scrollTo:t}])=>{const o=K(),n=K(),r=K(),s=S(!1),i=S(void 0);return N(I(ue(o,n),H(([{scrollTop:a,viewportHeight:l},{offsetTop:u,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,a-u),viewportHeight:l}))),e),N(I(t,$(n),H(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:o,windowScrollTo:r,windowViewportRect:n}},oe(be)),sr=Y(([{sizeRanges:e,sizes:t},{headerHeight:o,scrollTop:n},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const u=K(),h=S(void 0),v=S(null),g=S(null);return N(a,v),N(l,g),Q(I(u,$(t,n,i,v,g,o)),([p,T,y,x,m,f,w])=>{const z=Fn(T.sizeTree);x&&m!==null&&f!==null&&(y=m.scrollTop-f.offsetTop),y-=w,p({ranges:z,scrollTop:y})}),N(I(h,P(_t),H(ir)),r),N(I(s,$(h),P(([,p])=>p!==void 0),te(),H(([,p])=>p.ranges)),e),{getState:u,restoreStateFrom:h}},oe(Ee,be,ut,De,Xt));function ir(e){return{align:"start",index:0,offset:e.scrollTop}}const lr=Y(([{topItemsIndexes:e}])=>{const t=S(0);return N(I(t,P(o=>o>=0),H(o=>Array.from({length:o}).map((n,r)=>r))),e),{topItemCount:t}},oe(Ve));function Zo(e){let t=!1,o;return(()=>(t||(t=!0,o=e()),o))}const ar=Zo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),cr=Y(([{deviation:e,scrollBy:t,scrollingInProgress:o,scrollTop:n},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:a},{listState:l},{beforeUnshiftWith:u,gap:h,shiftWithOffset:v,sizes:g},{log:p},{recalcInProgress:T}])=>{const y=Ie(I(l,$(i),ze(([,m,f,w],[{bottom:z,items:R,offsetBottom:A,totalCount:c},b])=>{const k=z+A;let B=0;return f===c&&m.length>0&&R.length>0&&(R[0].originalIndex===0&&m[0].originalIndex===0||(B=k-w,B!==0&&(B+=b))),[B,R,c,k]},[0,[],0,0]),P(([m])=>m!==0),$(n,a,o,r,p,T),P(([,m,f,w,,,z])=>!z&&!w&&m!==0&&f===it),H(([[m],,,,,f])=>(f("Upward scrolling compensation",{amount:m},he.DEBUG),m))));function x(m){m>0?(G(t,{behavior:"auto",top:-m}),G(e,0)):(G(e,0),G(t,{behavior:"auto",top:-m}))}return Q(I(y,$(e,s)),([m,f,w])=>{w&&ar()?G(e,f-m):x(-m)}),Q(I(ue(ve(s,!1),e,T),P(([m,f,w])=>!m&&!w&&f!==0),H(([m,f])=>f),Be(1)),x),N(I(v,H(m=>({top:-m}))),t),Q(I(u,$(g,h),H(([m,{groupIndices:f,lastSize:w,sizeTree:z},R])=>{function A(E){return E*(w+R)}if(f.length===0)return A(m);let c=0;const b=nt(z,0);let k=0,B=0;for(;k<m;){k++,c+=b;let E=f.length===B+1?1/0:f[B+1]-f[B]-1;k+E>m&&(c-=b,E=m-k+1),k+=E,c+=A(E),B++}return c})),m=>{G(e,m),requestAnimationFrame(()=>{G(t,{top:m}),requestAnimationFrame(()=>{G(e,0),G(T,!1)})})}),{deviation:e}},oe(be,dt,Ve,Ee,Ae,Gt)),ur=Y(([e,t,o,n,r,s,i,a,l,u,h])=>({...e,...t,...o,...n,...r,...s,...i,...a,...l,...u,...h}),oe(Yt,nr,De,Qo,Ko,rr,qn,Xt,Xo,Ae,Yo)),Jo=Y(([{data:e,defaultItemSize:t,firstItemIndex:o,fixedItemSize:n,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:a,itemSize:l,sizeRanges:u,sizes:h,statefulTotalCount:v,totalCount:g,trackItemSizes:p},{initialItemFinalLocationReached:T,initialTopMostItemIndex:y,scrolledToInitialItem:x},m,f,w,z,{scrollToIndex:R},A,{topItemCount:c},{groupCounts:b},k])=>{const{listState:B,minOverscanItemCount:E,topItemsIndexes:F,rangeChanged:V,...D}=z;return N(V,k.scrollSeekRangeChanged),N(I(k.windowViewportRect,H(U=>U.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:o,fixedItemHeight:n,fixedGroupHeight:r,gap:s,groupCounts:b,heightEstimates:a,initialItemFinalLocationReached:T,initialTopMostItemIndex:y,scrolledToInitialItem:x,sizeRanges:u,topItemCount:c,topItemsIndexes:F,totalCount:g,...w,groupIndices:i,itemSize:l,listState:B,minOverscanItemCount:E,scrollToIndex:R,statefulTotalCount:v,trackItemSizes:p,rangeChanged:V,...D,...k,...m,sizes:h,...f}},oe(Ee,ut,be,sr,or,Ve,ct,cr,lr,Vo,ur));function dr(e,t){const o={},n={};let r=0;const s=e.length;for(;r<s;)n[e[r]]=1,r+=1;for(const i in t)Object.hasOwn(n,i)||(o[i]=t[i]);return o}const ht=typeof document<"u"?L.useLayoutEffect:L.useEffect;function qo(e,t,o){const n=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=L.createContext({});function l(x,m){x.propsReady!==void 0&&G(x.propsReady,!1);for(const f of n){const w=x[t.required[f]];G(w,m[f])}for(const f of r)if(f in m){const w=x[t.optional[f]];G(w,m[f])}x.propsReady!==void 0&&G(x.propsReady,!0)}function u(x){return s.reduce((m,f)=>(m[f]=w=>{const z=x[t.methods[f]];G(z,w)},m),{})}function h(x){return i.reduce((m,f)=>(m[f]=Rn(x[t.events[f]]),m),{})}const v=L.forwardRef(function(x,m){const{children:f,...w}=x,[z]=L.useState(()=>wt(Hn(e),c=>{l(c,w)})),[R]=L.useState(co(h,z));ht(()=>{for(const c of i)c in w&&Q(R[c],w[c]);return()=>{Object.values(R).map(Ft)}},[w,R,z]),ht(()=>{l(z,w)}),L.useImperativeHandle(m,ao(u(z)));const A=o;return d.jsx(a.Provider,{value:z,children:o!==void 0?d.jsx(A,{...dr([...n,...r,...i],w),children:f}):f})}),g=x=>{const m=L.useContext(a);return L.useCallback(f=>{G(m[x],f)},[m,x])},p=x=>{const m=L.useContext(a)[x],f=L.useCallback(w=>Q(m,w),[m]);return L.useSyncExternalStore(f,()=>se(m),()=>se(m))},T=x=>{const m=L.useContext(a)[x],[f,w]=L.useState(co(se,m));return ht(()=>Q(m,z=>{z!==f&&w(ao(z))}),[m,f]),f},y=L.version.startsWith("18")?p:T;return{Component:v,useEmitter:(x,m)=>{const f=L.useContext(a)[x];ht(()=>Q(f,m),[m,f])},useEmitterValue:y,usePublisher:g}}const en=L.createContext(void 0),tn=L.createContext(void 0),Et="-webkit-sticky",Co="sticky",Qt=Zo(()=>{if(typeof document>"u")return Co;const e=document.createElement("div");return e.style.position=Et,e.style.position===Et?Et:Co}),on=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Bt(e){return"self"in e}function fr(e){return"body"in e}function nn(e,t,o,n=Xe,r,s){const i=L.useRef(null),a=L.useRef(null),l=L.useRef(null),u=L.useCallback(g=>{let p,T,y;const x=g.target;if(fr(x)||Bt(x)){const f=Bt(x)?x:x.defaultView;y=s===!0?f.scrollX:f.scrollY,p=s===!0?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight,T=s===!0?f.innerWidth:f.innerHeight}else y=s===!0?x.scrollLeft:x.scrollTop,p=s===!0?x.scrollWidth:x.scrollHeight,T=s===!0?x.offsetWidth:x.offsetHeight;const m=()=>{e({scrollHeight:p,scrollTop:Math.max(y,0),viewportHeight:T})};g.suppressFlushSync===!0?m():fn.flushSync(m),a.current!==null&&(y===a.current||y<=0||y===p-T)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,s]);L.useEffect(()=>{const g=r||i.current;return n(r||i.current),u({suppressFlushSync:!0,target:g}),g.addEventListener("scroll",u,{passive:!0}),()=>{n(null),g.removeEventListener("scroll",u)}},[i,u,o,n,r]);function h(g){const p=i.current;if(!p||(s===!0?"offsetWidth"in p&&p.offsetWidth===0:"offsetHeight"in p&&p.offsetHeight===0))return;const T=g.behavior==="smooth";let y,x,m;Bt(p)?(x=Math.max(Me(p.document.documentElement,s===!0?"width":"height"),s===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight),y=s===!0?p.innerWidth:p.innerHeight,m=s===!0?window.scrollX:window.scrollY):(x=p[s===!0?"scrollWidth":"scrollHeight"],y=Me(p,s===!0?"width":"height"),m=p[s===!0?"scrollLeft":"scrollTop"]);const f=x-y;if(g.top=Math.ceil(Math.max(Math.min(f,g.top),0)),$o(y,x)||g.top===m){e({scrollHeight:x,scrollTop:m,viewportHeight:y}),T&&t(!0);return}T?(a.current=g.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,s===!0&&(g={...g.behavior!==void 0?{behavior:g.behavior}:{},left:g.top}),p.scrollTo(g)}function v(g){s===!0&&(g={...g.behavior!==void 0?{behavior:g.behavior}:{},...g.top!==void 0?{left:g.top}:{}}),i.current.scrollBy(g)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:h}}function Zt(e){return e}const mr=Y(()=>{const e=S(a=>`Item ${a}`),t=S(a=>`Group ${a}`),o=S({}),n=S(Zt),r=S("div"),s=S(Xe),i=(a,l=null)=>ve(I(o,H(u=>u[a]),te()),l);return{components:o,computeItemKey:n,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),hr=Y(([e,t])=>({...e,...t}),oe(Jo,mr)),pr=({height:e})=>d.jsx("div",{style:{height:e}}),gr={overflowAnchor:"none",position:Qt(),zIndex:1},rn={overflowAnchor:"none"},xr={...rn,display:"inline-block",height:"100%"},To=L.memo(function({showTopList:e=!1}){const t=_("listState"),o=we("sizeRanges"),n=_("useWindowScroll"),r=_("customScrollParent"),s=we("windowScrollContainerState"),i=we("scrollContainerState"),a=r||n?s:i,l=_("itemContent"),u=_("context"),h=_("groupContent"),v=_("trackItemSizes"),g=_("itemSize"),p=_("log"),T=we("gap"),y=_("horizontalDirection"),{callbackRef:x}=Bn(o,g,v,e?Xe:a,p,T,r,y,_("skipAnimationFrameInResizeObserver")),[m,f]=L.useState(0);Jt("deviation",D=>{m!==D&&f(D)});const w=_("EmptyPlaceholder"),z=_("ScrollSeekPlaceholder")??pr,R=_("ListComponent"),A=_("ItemComponent"),c=_("GroupComponent"),b=_("computeItemKey"),k=_("isSeeking"),B=_("groupIndices").length>0,E=_("alignToBottom"),F=_("initialItemFinalLocationReached"),V=e?{}:{boxSizing:"border-box",...y?{display:"inline-block",height:"100%",marginLeft:m!==0?m:E?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:m!==0?m:E?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...F?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&w!==null&&w!==void 0?d.jsx(w,{...xe(w,u)}):d.jsx(R,{...xe(R,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:x,style:V,children:(e?t.topItems:t.items).map(D=>{const U=D.originalIndex,C=b(U+t.firstItemIndex,D.data,u);return k?M.createElement(z,{...xe(z,u),height:D.size,index:D.index,key:C,type:D.type||"item",...D.type==="group"?{}:{groupIndex:D.groupIndex}}):D.type==="group"?M.createElement(c,{...xe(c,u),"data-index":U,"data-item-index":D.index,"data-known-size":D.size,key:C,style:gr},h(D.index,u)):M.createElement(A,{...xe(A,u),...Cr(A,D.data),"data-index":U,"data-item-group-index":D.groupIndex,"data-item-index":D.index,"data-known-size":D.size,key:C,style:y?xr:rn},B?l(D.index,D.groupIndex,D.data,u):l(D.index,D.data,u))})})}),vr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},yr={outline:"none",overflowX:"auto",position:"relative"},kt=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),br={position:Qt(),top:0,width:"100%",zIndex:1};function xe(e,t){if(typeof e!="string")return{context:t}}function Cr(e,t){return{item:typeof e=="string"?void 0:t}}const Tr=L.memo(function(){const e=_("HeaderComponent"),t=we("headerHeight"),o=_("HeaderFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,_("skipAnimationFrameInResizeObserver")),r=_("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),Ir=L.memo(function(){const e=_("FooterComponent"),t=we("footerHeight"),o=_("HeaderFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,_("skipAnimationFrameInResizeObserver")),r=_("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null});function sn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return L.memo(function({children:n,style:r,context:s,...i}){const a=o("scrollContainerState"),l=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("scrollerRef"),v=t("horizontalDirection")||!1,{scrollByCallback:g,scrollerRef:p,scrollToCallback:T}=nn(a,u,l,h,void 0,v);return e("scrollTo",T),e("scrollBy",g),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...v?yr:vr,...r},tabIndex:0,...i,...xe(l,s),children:n})})}function ln({useEmitter:e,useEmitterValue:t,usePublisher:o}){return L.memo(function({children:n,style:r,context:s,...i}){const a=o("windowScrollContainerState"),l=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("totalListHeight"),v=t("deviation"),g=t("customScrollParent"),p=L.useRef(null),T=t("scrollerRef"),{scrollByCallback:y,scrollerRef:x,scrollToCallback:m}=nn(a,u,l,T,g);return on(()=>{var f;return x.current=g||((f=p.current)==null?void 0:f.ownerDocument.defaultView),()=>{x.current=null}},[x,g]),e("windowScrollTo",m),e("scrollBy",y),d.jsx(l,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...h!==0?{height:h+v}:void 0},...i,...xe(l,s),children:n})})}const wr=({children:e})=>{const t=L.useContext(en),o=we("viewportHeight"),n=we("fixedItemHeight"),r=_("alignToBottom"),s=_("horizontalDirection"),i=L.useMemo(()=>Eo(o,l=>Me(l,s?"width":"height")),[o,s]),a=Fe(i,!0,_("skipAnimationFrameInResizeObserver"));return L.useEffect(()=>{t&&(o(t.viewportHeight),n(t.itemHeight))},[t,o,n]),d.jsx("div",{"data-viewport-type":"element",ref:a,style:kt(r),children:e})},Sr=({children:e})=>{const t=L.useContext(en),o=we("windowViewportRect"),n=we("fixedItemHeight"),r=_("customScrollParent"),s=Lo(o,r,_("skipAnimationFrameInResizeObserver")),i=_("alignToBottom");return L.useEffect(()=>{t&&(n(t.itemHeight),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,o,n]),d.jsx("div",{"data-viewport-type":"window",ref:s,style:kt(i),children:e})},kr=({children:e})=>{const t=_("TopItemListComponent")??"div",o=_("headerHeight"),n={...br,marginTop:`${o}px`},r=_("context");return d.jsx(t,{style:n,...xe(t,r),children:e})},Rr=L.memo(function(e){const t=_("useWindowScroll"),o=_("topItemsIndexes").length>0,n=_("customScrollParent"),r=_("context");return d.jsxs(n||t?zr:Hr,{...e,context:r,children:[o&&d.jsx(kr,{children:d.jsx(To,{showTopList:!0})}),d.jsxs(n||t?Sr:wr,{children:[d.jsx(Tr,{}),d.jsx(To,{}),d.jsx(Ir,{})]})]})}),{Component:jr,useEmitter:Jt,useEmitterValue:_,usePublisher:we}=qo(hr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",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"}},Rr),Hr=sn({useEmitter:Jt,useEmitterValue:_,usePublisher:we}),zr=ln({useEmitter:Jt,useEmitterValue:_,usePublisher:we}),Er=jr,Br=Y(()=>{const e=S(u=>d.jsxs("td",{children:["Item $",u]})),t=S(null),o=S(u=>d.jsxs("td",{colSpan:1e3,children:["Group ",u]})),n=S(null),r=S(null),s=S({}),i=S(Zt),a=S(Xe),l=(u,h=null)=>ve(I(s,H(v=>v[u]),te()),h);return{components:s,computeItemKey:i,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:n,itemContent:e,groupContent:o,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")}});oe(Jo,Br);Qt();const Io={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Lr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:wo,floor:Tt,max:et,min:Lt,round:So}=Math;function ko(e,t,o){return Array.from({length:t-e+1}).map((n,r)=>({data:o===null?null:o[r+e],index:r+e}))}function Nr(e){return{...Lr,items:e}}function pt(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function Mr(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const Or=Y(([{increaseViewportBy:e,listBoundary:t,overscan:o,visibleRange:n},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:a,scrollTo:l,scrollTop:u,smoothScrollTargetReached:h,viewportHeight:v},g,p,{didMount:T,propsReady:y},{customScrollParent:x,useWindowScroll:m,windowScrollContainerState:f,windowScrollTo:w,windowViewportRect:z},R])=>{const A=S(0),c=S(0),b=S(Io),k=S({height:0,width:0}),B=S({height:0,width:0}),E=K(),F=K(),V=S(0),D=S(null),U=S({column:0,row:0}),C=K(),O=K(),q=S(!1),pe=S(0),le=S(!0),Ce=S(!1),Le=S(!1);Q(I(T,$(pe),P(([j,X])=>X!==0)),()=>{G(le,!1)}),Q(I(ue(T,le,B,k,pe,Ce),P(([j,X,de,ee,,ne])=>j&&!X&&de.height!==0&&ee.height!==0&&!ne)),([,,,,j])=>{G(Ce,!0),Ut(1,()=>{G(E,j)}),ke(I(u),()=>{G(t,[0,0]),G(le,!0)})}),N(I(O,P(j=>j!=null&&j.scrollTop>0),He(0)),c),Q(I(T,$(O),P(([,j])=>j!=null)),([,j])=>{j&&(G(k,j.viewport),G(B,j.item),G(U,j.gap),j.scrollTop>0&&(G(q,!0),ke(I(u,_e(1)),X=>{G(q,!1)}),G(l,{top:j.scrollTop})))}),N(I(k,H(({height:j})=>j)),v),N(I(ue(W(k,pt),W(B,pt),W(U,(j,X)=>j!==void 0&&j.column===X.column&&j.row===X.row),W(u)),H(([j,X,de,ee])=>({gap:de,item:X,scrollTop:ee,viewport:j}))),C),N(I(ue(W(A),n,W(U,Mr),W(B,pt),W(k,pt),W(D),W(c),W(q),W(le),W(pe)),P(([,,,,,,,j])=>!j),H(([j,[X,de],ee,ne,fe,ae,J,,ie,ye])=>{const{column:ce,row:Je}=ee,{height:ft,width:Rt}=ne,{width:qt}=fe;if(J===0&&(j===0||qt===0))return Io;if(Rt===0){const ro=Kt(ye,j),dn=ro+Math.max(J-1,0);return Nr(ko(ro,dn,ae))}const mt=an(qt,Rt,ce);let $e,We;ie?X===0&&de===0&&J>0?($e=0,We=J-1):($e=mt*Tt((X+Je)/(ft+Je)),We=mt*wo((de+Je)/(ft+Je))-1,We=Lt(j-1,et(We,mt-1)),$e=Lt(We,et(0,$e))):($e=0,We=-1);const eo=ko($e,We,ae),{bottom:to,top:oo}=Ro(fe,ee,ne,eo),no=wo(j/mt),un=no*ft+(no-1)*Je-to;return{bottom:to,itemHeight:ft,items:eo,itemWidth:Rt,offsetBottom:un,offsetTop:oo,top:oo}})),b),N(I(D,P(j=>j!==null),H(j=>j.length)),A),N(I(ue(k,B,b,U),P(([j,X,{items:de}])=>de.length>0&&X.height!==0&&j.height!==0),H(([j,X,{items:de},ee])=>{const{bottom:ne,top:fe}=Ro(j,ee,X,de);return[fe,ne]}),te(rt)),t);const ge=S(!1);N(I(u,$(ge),H(([j,X])=>X||j!==0)),ge);const Ge=Ie(I(ue(b,A),P(([{items:j}])=>j.length>0),$(ge),P(([[j,X],de])=>{const ee=j.items[j.items.length-1].index===X-1;return(de||j.bottom>0&&j.itemHeight>0&&j.offsetBottom===0&&j.items.length===X)&&ee}),H(([[,j]])=>j-1),te())),Qe=Ie(I(W(b),P(({items:j})=>j.length>0&&j[0].index===0),He(0),te())),je=Ie(I(W(b),$(q),P(([{items:j},X])=>j.length>0&&!X),H(([{items:j}])=>({endIndex:j[j.length-1].index,startIndex:j[0].index})),te(Wo),Be(0)));N(je,p.scrollSeekRangeChanged),N(I(E,$(k,B,A,U),H(([j,X,de,ee,ne])=>{const fe=Go(j),{align:ae,behavior:J,offset:ie}=fe;let ye=fe.index;ye==="LAST"&&(ye=ee-1),ye=et(0,ye,Lt(ee-1,ye));let ce=Pt(X,ne,de,ye);return ae==="end"?ce=So(ce-X.height+de.height):ae==="center"&&(ce=So(ce-X.height/2+de.height/2)),ie!==void 0&&ie!==0&&(ce+=ie),{behavior:J,top:ce}})),l);const Ze=ve(I(b,H(j=>j.offsetBottom+j.bottom)),0);return N(I(z,H(j=>({height:j.visibleHeight,width:j.visibleWidth}))),k),{customScrollParent:x,data:D,deviation:V,footerHeight:r,gap:U,headerHeight:s,increaseViewportBy:e,initialItemCount:c,itemDimensions:B,overscan:o,restoreStateFrom:O,scrollBy:i,scrollContainerState:a,scrollHeight:F,scrollTo:l,scrollToIndex:E,scrollTop:u,smoothScrollTargetReached:h,totalCount:A,useWindowScroll:m,viewportDimensions:k,windowScrollContainerState:f,windowScrollTo:w,windowViewportRect:z,...p,gridState:b,horizontalDirection:Le,initialTopMostItemIndex:pe,totalListHeight:Ze,...g,endReached:Ge,propsReady:y,rangeChanged:je,startReached:Qe,stateChanged:C,stateRestoreInProgress:q,...R}},oe(Yt,be,dt,Qo,De,Xt,Ae));function an(e,t,o){return et(1,Tt((e+o)/(Tt(t)+o)))}function Ro(e,t,o,n){const{height:r}=o;if(r===void 0||n.length===0)return{bottom:0,top:0};const s=Pt(e,t,o,n[0].index);return{bottom:Pt(e,t,o,n[n.length-1].index)+r,top:s}}function Pt(e,t,o,n){const r=an(e.width,o.width,t.column),s=Tt(n/r),i=s*o.height+et(0,s-1)*t.row;return i>0?i+t.row:i}const Ar=Y(()=>{const e=S(v=>`Item ${v}`),t=S({}),o=S(null),n=S("virtuoso-grid-item"),r=S("virtuoso-grid-list"),s=S(Zt),i=S("div"),a=S(Xe),l=(v,g=null)=>ve(I(t,H(p=>p[v]),te()),g),u=S(!1),h=S(!1);return N(W(h),u),{components:t,computeItemKey:s,context:o,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:i,itemClassName:n,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:h,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),Dr=Y(([e,t])=>({...e,...t}),oe(Or,Ar)),Wr=L.memo(function(){const e=re("gridState"),t=re("listClassName"),o=re("itemClassName"),n=re("itemContent"),r=re("computeItemKey"),s=re("isSeeking"),i=Se("scrollHeight"),a=re("ItemComponent"),l=re("ListComponent"),u=re("ScrollSeekPlaceholder"),h=re("context"),v=Se("itemDimensions"),g=Se("gap"),p=re("log"),T=re("stateRestoreInProgress"),y=Se("reportReadyState"),x=Fe(L.useMemo(()=>m=>{const f=m.parentElement.parentElement.scrollHeight;i(f);const w=m.firstChild;if(w!==null){const{height:z,width:R}=w.getBoundingClientRect();v({height:z,width:R})}g({column:jo("column-gap",getComputedStyle(m).columnGap,p),row:jo("row-gap",getComputedStyle(m).rowGap,p)})},[i,v,g,p]),!0,!1);return on(()=>{e.itemHeight>0&&e.itemWidth>0&&y(!0)},[e]),T?null:d.jsx(l,{className:t,ref:x,...xe(l,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(m=>{const f=r(m.index,m.data,h);return s?d.jsx(u,{...xe(u,h),height:e.itemHeight,index:m.index,width:e.itemWidth},f):M.createElement(a,{...xe(a,h),className:o,"data-index":m.index,key:f},n(m.index,m.data,h))})})}),Pr=L.memo(function(){const e=re("HeaderComponent"),t=Se("headerHeight"),o=re("headerFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,!1),r=re("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),_r=L.memo(function(){const e=re("FooterComponent"),t=Se("footerHeight"),o=re("headerFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,!1),r=re("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),Fr=({children:e})=>{const t=L.useContext(tn),o=Se("itemDimensions"),n=Se("viewportDimensions"),r=Fe(L.useMemo(()=>s=>{n(s.getBoundingClientRect())},[n]),!0,!1);return L.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),o({height:t.itemHeight,width:t.itemWidth}))},[t,n,o]),d.jsx("div",{ref:r,style:kt(!1),children:e})},Vr=({children:e})=>{const t=L.useContext(tn),o=Se("windowViewportRect"),n=Se("itemDimensions"),r=re("customScrollParent"),s=Lo(o,r,!1);return L.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,o,n]),d.jsx("div",{ref:s,style:kt(!1),children:e})},Gr=L.memo(function({...e}){const t=re("useWindowScroll"),o=re("customScrollParent"),n=o||t?Ur:$r,r=o||t?Vr:Fr,s=re("context");return d.jsx(n,{...e,...xe(n,s),children:d.jsxs(r,{children:[d.jsx(Pr,{}),d.jsx(Wr,{}),d.jsx(_r,{})]})})}),{useEmitter:cn,useEmitterValue:re,usePublisher:Se}=qo(Dr,{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"}},Gr),$r=sn({useEmitter:cn,useEmitterValue:re,usePublisher:Se}),Ur=ln({useEmitter:cn,useEmitterValue:re,usePublisher:Se});function jo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}const Kr=150;function Yr({entries:e,itemCount:t}){const o=M.useRef(null),[n,r]=M.useState(!1),s=M.useRef(!1),i=M.useRef(0),a=M.useRef(e.length),l=M.useRef(0),u=M.useCallback((p="smooth")=>{o.current&&(l.current=Date.now(),o.current.scrollToIndex({index:t-1,behavior:p,align:"end"}))},[t]),h=M.useCallback(p=>s.current||!p?!1:"auto",[]),v=M.useCallback(p=>{r(!p),p&&(s.current=!1)},[]),g=M.useCallback(p=>{const y=p.target.scrollTop;if(Date.now()-l.current<Kr){i.current=y;return}y-i.current<-10&&(s.current=!0),i.current=y},[]);return M.useEffect(()=>{const p=e.length,T=a.current,y=p>T;if(a.current=p,!y)return;const x=e[e.length-1];(x==null?void 0:x.type)==="user_message"&&(s.current=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.current&&(l.current=Date.now(),o.current.scrollToIndex({index:"LAST",behavior:"auto",align:"end"}))})}))},[e]),{virtuosoRef:o,handleScroll:g,handleAtBottomStateChange:v,handleFollowOutput:h,showScrollButton:n,scrollToBottom:u}}const Xr=new Set(["assistant_message","error","command_exec","tool_use"]);function Qr(e){const t={source_entry_id:e.id,source_process_id:e.processId};switch(e.type){case"assistant_message":return{...t,title:"Issue from assistant message",description:e.content.slice(0,2e3)};case"error":return{...t,title:`Error: ${e.message.slice(0,100)}`,description:e.message+(e.code?`
1
+ import{z as L,j as d,r as M,a2 as fn,i as Ne,c as mn,R as hn,P as pn,O as gn,f as xn,T as vn,h as so,k as tt,s as jt,w as io,a3 as lo,a4 as yn}from"./index-DQIlX2w_.js";import{A as bt,E as bn}from"./index-DaFwSmVJ.js";import{Z as Cn}from"./zap-C0zaC7gJ.js";const It=0,Oe=1,Ye=2,zo=4;function ao(e){return()=>e}function Tn(e){e()}function Eo(e,t){return o=>e(t(o))}function co(e,t){return()=>e(t)}function In(e,t){return o=>e(t,o)}function _t(e){return e!==void 0}function wn(...e){return()=>{e.map(Tn)}}function Xe(){}function wt(e,t){return t(e),e}function Sn(e,t){return t(e)}function oe(...e){return e}function Q(e,t){return e(Oe,t)}function G(e,t){e(It,t)}function Ft(e){e(Ye)}function se(e){return e(zo)}function N(e,t){return Q(e,In(t,It))}function ke(e,t){const o=e(Oe,n=>{o(),t(n)});return o}function uo(e){let t,o;return n=>r=>{t=r,o&&clearTimeout(o),o=setTimeout(()=>{n(t)},e)}}function Bo(e,t){return e===t}function te(e=Bo){let t;return o=>n=>{e(t,n)||(t=n,o(n))}}function P(e){return t=>o=>{e(o)&&t(o)}}function H(e){return t=>Eo(t,e)}function He(e){return t=>()=>{t(e)}}function I(e,...t){const o=kn(...t);return((n,r)=>{switch(n){case Ye:Ft(e);return;case Oe:return Q(e,o(r))}})}function ze(e,t){return o=>n=>{o(t=e(t,n))}}function _e(e){return t=>o=>{e>0?e--:t(o)}}function Be(e){let t=null,o;return n=>r=>{t=r,!o&&(o=setTimeout(()=>{o=void 0,n(t)},e))}}function $(...e){const t=new Array(e.length);let o=0,n=null;const r=2**e.length-1;return e.forEach((s,i)=>{const a=2**i;Q(s,l=>{const u=o;o|=a,t[i]=l,u!==r&&o===r&&n&&(n(),n=null)})}),s=>i=>{const a=()=>{s([i].concat(t))};o===r?a():n=a}}function kn(...e){return t=>e.reduceRight(Sn,t)}function Rn(e){let t,o;const n=()=>t==null?void 0:t();return function(r,s){switch(r){case Oe:return s?o===s?void 0:(n(),o=s,t=Q(e,s),t):(n(),Xe);case Ye:n(),o=null;return}}}function S(e){let t=e;const o=K();return((n,r)=>{switch(n){case It:t=r;break;case Oe:{r(t);break}case zo:return t}return o(n,r)})}function ve(e,t){return wt(S(t),o=>N(e,o))}function K(){const e=[];return((t,o)=>{switch(t){case It:e.slice().forEach(n=>{n(o)});return;case Ye:e.splice(0,e.length);return;case Oe:return e.push(o),()=>{const n=e.indexOf(o);n>-1&&e.splice(n,1)}}})}function Ie(e){return wt(K(),t=>N(e,t))}function Y(e,t=[],{singleton:o}={singleton:!0}){return{constructor:e,dependencies:t,id:jn(),singleton:o}}const jn=()=>Symbol();function Hn(e){const t=new Map,o=({constructor:n,dependencies:r,id:s,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=n(r.map(l=>o(l)));return i&&t.set(s,a),a};return o(e)}function ue(...e){const t=K(),o=new Array(e.length);let n=0;const r=2**e.length-1;return e.forEach((s,i)=>{const a=2**i;Q(s,l=>{o[i]=l,n|=a,n===r&&G(t,o)})}),function(s,i){switch(s){case Ye:{Ft(t);return}case Oe:return n===r&&i(o),Q(t,i)}}}function W(e,t=Bo){return I(e,te(t))}function Mt(...e){return function(t,o){switch(t){case Ye:return;case Oe:return wn(...e.map(n=>Q(n,o)))}}}const he={DEBUG:0,INFO:1,WARN:2,ERROR:3},zn={[he.DEBUG]:"debug",[he.ERROR]:"error",[he.INFO]:"log",[he.WARN]:"warn"},En=()=>typeof globalThis>"u"?window:globalThis,Ae=Y(()=>{const e=S(he.ERROR);return{log:S((t,o,n=he.INFO)=>{const r=En().VIRTUOSO_LOG_LEVEL??se(e);n>=r&&console[zn[n]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,o)}),logLevel:e}},[],{singleton:!0});function Fe(e,t,o){return Vt(e,t,o).callbackRef}function Vt(e,t,o){const n=L.useRef(null);let r=i=>{};const s=L.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(i=>{const a=()=>{const l=i[0].target;l.offsetParent!==null&&e(l)};o?a():requestAnimationFrame(a)}):null,[e,o]);return r=i=>{i&&t?(s==null||s.observe(i),n.current=i):(n.current&&(s==null||s.unobserve(n.current)),n.current=null)},{callbackRef:r,ref:n}}function Bn(e,t,o,n,r,s,i,a,l){const u=L.useCallback(h=>{const v=Ln(h.children,t,a?"offsetWidth":"offsetHeight",r);let g=h.parentElement;for(;g.dataset.virtuosoScroller===void 0;)g=g.parentElement;const p=g.lastElementChild.dataset.viewportType==="window";let T;p&&(T=g.ownerDocument.defaultView);const y=i?a?i.scrollLeft:i.scrollTop:p?a?T.scrollX||T.document.documentElement.scrollLeft:T.scrollY||T.document.documentElement.scrollTop:a?g.scrollLeft:g.scrollTop,x=i?a?i.scrollWidth:i.scrollHeight:p?a?T.document.documentElement.scrollWidth:T.document.documentElement.scrollHeight:a?g.scrollWidth:g.scrollHeight,m=i?a?i.offsetWidth:i.offsetHeight:p?a?T.innerWidth:T.innerHeight:a?g.offsetWidth:g.offsetHeight;n({scrollHeight:x,scrollTop:Math.max(y,0),viewportHeight:m}),s==null||s(a?fo("column-gap",getComputedStyle(h).columnGap,r):fo("row-gap",getComputedStyle(h).rowGap,r)),v!==null&&e(v)},[e,t,r,s,i,n,a]);return Vt(u,o,l)}function Ln(e,t,o,n){const r=e.length;if(r===0)return null;const s=[];for(let i=0;i<r;i++){const a=e.item(i);if(a.dataset.index===void 0)continue;const l=parseInt(a.dataset.index),u=parseFloat(a.dataset.knownSize),h=t(a,o);if(h===0&&n("Zero-sized element, this should not happen",{child:a},he.ERROR),h===u)continue;const v=s[s.length-1];s.length===0||v.size!==h||v.endIndex!==l-1?s.push({endIndex:l,size:h,startIndex:l}):s[s.length-1].endIndex++}return s}function fo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}function Lo(e,t,o){const n=L.useRef(null),r=L.useCallback(l=>{if(!(l!=null&&l.offsetParent))return;const u=l.getBoundingClientRect(),h=u.width;let v,g;if(t){const p=t.getBoundingClientRect(),T=u.top-p.top;g=p.height-Math.max(0,T),v=T+t.scrollTop}else{const p=i.current.ownerDocument.defaultView;g=p.innerHeight-Math.max(0,u.top),v=u.top+p.scrollY}n.current={listHeight:u.height,offsetTop:v,visibleHeight:g,visibleWidth:h},e(n.current)},[e,t]),{callbackRef:s,ref:i}=Vt(r,!0,o),a=L.useCallback(()=>{r(i.current)},[r,i]);return L.useEffect(()=>{var u;if(t){t.addEventListener("scroll",a);const h=new ResizeObserver(()=>{requestAnimationFrame(a)});return h.observe(t),()=>{t.removeEventListener("scroll",a),h.unobserve(t)}}const l=(u=i.current)==null?void 0:u.ownerDocument.defaultView;return l==null||l.addEventListener("scroll",a),l==null||l.addEventListener("resize",a),()=>{l==null||l.removeEventListener("scroll",a),l==null||l.removeEventListener("resize",a)}},[a,t,i]),s}const be=Y(()=>{const e=K(),t=K(),o=S(0),n=K(),r=S(0),s=K(),i=K(),a=S(0),l=S(0),u=S(0),h=S(0),v=K(),g=K(),p=S(!1),T=S(!1),y=S(!1);return N(I(e,H(({scrollTop:x})=>x)),t),N(I(e,H(({scrollHeight:x})=>x)),i),N(t,r),{deviation:o,fixedFooterHeight:u,fixedHeaderHeight:l,footerHeight:h,headerHeight:a,horizontalDirection:T,scrollBy:g,scrollContainerState:e,scrollHeight:i,scrollingInProgress:p,scrollTo:v,scrollTop:t,skipAnimationFrameInResizeObserver:y,smoothScrollTargetReached:n,statefulScrollTop:r,viewportHeight:s}},[],{singleton:!0}),ot={lvl:0};function No(e,t){const o=e.length;if(o===0)return[];let{index:n,value:r}=t(e[0]);const s=[];for(let i=1;i<o;i++){const{index:a,value:l}=t(e[i]);s.push({end:a-1,start:n,value:r}),n=a,r=l}return s.push({end:1/0,start:n,value:r}),s}function Z(e){return e===ot}function nt(e,t){if(!Z(e))return t===e.k?e.v:t<e.k?nt(e.l,t):nt(e.r,t)}function Re(e,t,o="k"){if(Z(e))return[-1/0,void 0];if(Number(e[o])===t)return[e.k,e.v];if(Number(e[o])<t){const n=Re(e.r,t,o);return n[0]===-1/0?[e.k,e.v]:n}return Re(e.l,t,o)}function Te(e,t,o){return Z(e)?Ao(t,o,1):t===e.k?me(e,{k:t,v:o}):t<e.k?mo(me(e,{l:Te(e.l,t,o)})):mo(me(e,{r:Te(e.r,t,o)}))}function Ue(){return ot}function Ke(e,t,o){if(Z(e))return[];const n=Re(e,t)[0];return Nn(At(e,n,o))}function Ot(e,t){if(Z(e))return ot;const{k:o,l:n,r}=e;if(t===o){if(Z(n))return r;if(Z(r))return n;const[s,i]=Oo(n);return vt(me(e,{k:s,l:Mo(n),v:i}))}return t<o?vt(me(e,{l:Ot(n,t)})):vt(me(e,{r:Ot(r,t)}))}function Pe(e){return Z(e)?[]:[...Pe(e.l),{k:e.k,v:e.v},...Pe(e.r)]}function At(e,t,o){if(Z(e))return[];const{k:n,l:r,r:s,v:i}=e;let a=[];return n>t&&(a=a.concat(At(r,t,o))),n>=t&&n<=o&&a.push({k:n,v:i}),n<=o&&(a=a.concat(At(s,t,o))),a}function vt(e){const{l:t,lvl:o,r:n}=e;if(n.lvl>=o-1&&t.lvl>=o-1)return e;if(o>n.lvl+1){if(Ht(t))return Do(me(e,{lvl:o-1}));if(!Z(t)&&!Z(t.r))return me(t.r,{l:me(t,{r:t.r.l}),lvl:o,r:me(e,{l:t.r.r,lvl:o-1})});throw new Error("Unexpected empty nodes")}if(Ht(e))return Dt(me(e,{lvl:o-1}));if(!Z(n)&&!Z(n.l)){const r=n.l,s=Ht(r)?n.lvl-1:n.lvl;return me(r,{l:me(e,{lvl:o-1,r:r.l}),lvl:r.lvl+1,r:Dt(me(n,{l:r.r,lvl:s}))})}throw new Error("Unexpected empty nodes")}function me(e,t){return Ao(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 Mo(e){return Z(e.r)?e.l:vt(me(e,{r:Mo(e.r)}))}function Ht(e){return Z(e)||e.lvl>e.r.lvl}function Oo(e){return Z(e.r)?[e.k,e.v]:Oo(e.r)}function Ao(e,t,o,n=ot,r=ot){return{k:e,l:n,lvl:o,r,v:t}}function mo(e){return Dt(Do(e))}function Do(e){const{l:t}=e;return!Z(t)&&t.lvl===e.lvl?me(t,{r:me(e,{l:t.r})}):e}function Dt(e){const{lvl:t,r:o}=e;return!Z(o)&&!Z(o.r)&&o.lvl===t&&o.r.lvl===t?me(o,{l:me(e,{r:o.l}),lvl:t+1}):e}function Nn(e){return No(e,({k:t,v:o})=>({index:t,value:o}))}function Wo(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}function rt(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}const Gt=Y(()=>({recalcInProgress:S(!1)}),[],{singleton:!0});function Po(e,t,o){return e[Ct(e,t,o)]}function Ct(e,t,o,n=0){let r=e.length-1;for(;n<=r;){const s=Math.floor((n+r)/2),i=e[s],a=o(i,t);if(a===0)return s;if(a===-1){if(r-n<2)return s-1;r=s-1}else{if(r===n)return s;n=s+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function Mn(e,t,o,n){const r=Ct(e,t,n),s=Ct(e,o,n,r);return e.slice(r,s+1)}function Me(e,t){return Math.round(e.getBoundingClientRect()[t])}function St(e){return!Z(e.groupOffsetTree)}function $t({index:e},t){return t===e?0:t<e?-1:1}function On(){return{groupIndices:[],groupOffsetTree:Ue(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Ue()}}function An(e,t){let o=Z(e)?0:1/0;for(const n of t){const{endIndex:r,size:s,startIndex:i}=n;if(o=Math.min(o,i),Z(e)){e=Te(e,0,s);continue}const a=Ke(e,i-1,r+1);if(a.some(Gn(n)))continue;let l=!1,u=!1;for(const{end:h,start:v,value:g}of a)l?(r>=v||s===g)&&(e=Ot(e,v)):(u=g!==s,l=!0),h>r&&r>=v&&g!==s&&(e=Te(e,r+1,g));u&&(e=Te(e,i,s))}return[e,o]}function Dn(e){return typeof e.groupIndex<"u"}function Wn({offset:e},t){return t===e?0:t<e?-1:1}function st(e,t,o){if(t.length===0)return 0;const{index:n,offset:r,size:s}=Po(t,e,$t),i=e-n,a=s*i+(i-1)*o+r;return a>0?a+o:a}function _o(e,t){if(!St(t))return e;let o=0;for(;t.groupIndices[o]<=e+o;)o++;return e+o}function Fo(e,t,o){if(Dn(e))return t.groupIndices[e.groupIndex]+1;const n=e.index==="LAST"?o:e.index;let r=_o(n,t);return r=Math.max(0,r,Math.min(o,r)),r}function Pn(e,t,o,n=0){return n>0&&(t=Math.max(t,Po(e,n,$t).offset)),No(Mn(e,t,o,Wn),Vn)}function _n(e,[t,o,n,r]){t.length>0&&n("received item sizes",t,he.DEBUG);const s=e.sizeTree;let i=s,a=0;if(o.length>0&&Z(s)&&t.length===2){const g=t[0].size,p=t[1].size;i=o.reduce((T,y)=>Te(Te(T,y,g),y+1,p),i)}else[i,a]=An(i,t);if(i===s)return e;const{lastIndex:l,lastOffset:u,lastSize:h,offsetTree:v}=Wt(e.offsetTree,a,i,r);return{groupIndices:o,groupOffsetTree:o.reduce((g,p)=>Te(g,p,st(p,v,r)),Ue()),lastIndex:l,lastOffset:u,lastSize:h,offsetTree:v,sizeTree:i}}function Fn(e){return Pe(e).map(({k:t,v:o},n,r)=>{const s=r[n+1];return{endIndex:s!==void 0?s.k-1:1/0,size:o,startIndex:t}})}function ho(e,t){let o=0,n=0;for(;o<e;)o+=t[n+1]-t[n]-1,n++;return n-(o===e?0:1)}function Wt(e,t,o,n){let r=e,s=0,i=0,a=0,l=0;if(t!==0){l=Ct(r,t-1,$t),a=r[l].offset;const u=Re(o,t-1);s=u[0],i=u[1],r.length&&r[l].size===Re(o,t)[1]&&(l-=1),r=r.slice(0,l+1)}else r=[];for(const{start:u,value:h}of Ke(o,t,1/0)){const v=u-s,g=v*i+a+v*n;r.push({index:u,offset:g,size:h}),s=u,a=g,i=h}return{lastIndex:s,lastOffset:a,lastSize:i,offsetTree:r}}function Vn(e){return{index:e.index,value:e}}function Gn(e){const{endIndex:t,size:o,startIndex:n}=e;return r=>r.start===n&&(r.end===t||r.end===1/0)&&r.value===o}const $n={offsetHeight:"height",offsetWidth:"width"},Ee=Y(([{log:e},{recalcInProgress:t}])=>{const o=K(),n=K(),r=ve(n,0),s=K(),i=K(),a=S(0),l=S([]),u=S(void 0),h=S(void 0),v=S(void 0),g=S(void 0),p=S((c,b)=>Me(c,$n[b])),T=S(void 0),y=S(0),x=On(),m=ve(I(o,$(l,e,y),ze(_n,x),te()),x),f=ve(I(l,te(),ze((c,b)=>({current:b,prev:c.current}),{current:[],prev:[]}),H(({prev:c})=>c)),[]);N(I(l,P(c=>c.length>0),$(m,y),H(([c,b,k])=>{const B=c.reduce((E,F,V)=>Te(E,F,st(F,b.offsetTree,k)||V),Ue());return{...b,groupIndices:c,groupOffsetTree:B}})),m),N(I(n,$(m),P(([c,{lastIndex:b}])=>c<b),H(([c,{lastIndex:b,lastSize:k}])=>[{endIndex:b,size:k,startIndex:c}])),o),N(u,h);const w=ve(I(u,H(c=>c===void 0)),!0);N(I(h,P(c=>c!==void 0&&Z(se(m).sizeTree)),H(c=>{const b=se(v),k=se(l).length>0;return b!==void 0&&b!==0?k?[{endIndex:0,size:b,startIndex:0},{endIndex:1,size:c,startIndex:1}]:[]:[{endIndex:0,size:c,startIndex:0}]})),o),N(I(g,P(c=>c!==void 0&&c.length>0&&Z(se(m).sizeTree)),H(c=>{const b=[];let k=c[0],B=0;for(let E=1;E<c.length;E++){const F=c[E];F!==k&&(b.push({endIndex:E-1,size:k,startIndex:B}),k=F,B=E)}return b.push({endIndex:c.length-1,size:k,startIndex:B}),b})),o),N(I(l,$(v,h),P(([,c,b])=>c!==void 0&&b!==void 0),H(([c,b,k])=>{const B=[];for(let E=0;E<c.length;E++){const F=c[E],V=c[E+1];B.push({startIndex:F,endIndex:F,size:b}),V!==void 0&&B.push({startIndex:F+1,endIndex:V-1,size:k})}return B})),o);const z=Ie(I(o,$(m),ze(({sizes:c},[b,k])=>({changed:k!==c,sizes:k}),{changed:!1,sizes:x}),H(c=>c.changed)));Q(I(a,ze((c,b)=>({diff:c.prev-b,prev:b}),{diff:0,prev:0}),H(c=>c.diff)),c=>{const{groupIndices:b}=se(m);if(c>0)G(t,!0),G(s,c+ho(c,b));else if(c<0){const k=se(f);k.length>0&&(c-=ho(-c,k)),G(i,c)}}),Q(I(a,$(e)),([c,b])=>{c<0&&b("`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},he.ERROR)});const R=Ie(s);N(I(s,$(m),H(([c,b])=>{const k=b.groupIndices.length>0,B=[],E=b.lastSize;if(k){const F=nt(b.sizeTree,0);let V=0,D=0;for(;V<c;){const C=b.groupIndices[D],O=b.groupIndices.length===D+1?1/0:b.groupIndices[D+1]-C-1;B.push({endIndex:C,size:F,startIndex:C}),B.push({endIndex:C+1+O-1,size:E,startIndex:C+1}),D++,V+=O+1}const U=Pe(b.sizeTree);return V!==c&&U.shift(),U.reduce((C,{k:O,v:q})=>{let pe=C.ranges;return C.prevSize!==0&&(pe=[...C.ranges,{endIndex:O+c-1,size:C.prevSize,startIndex:C.prevIndex}]),{prevIndex:O+c,prevSize:q,ranges:pe}},{prevIndex:c,prevSize:0,ranges:B}).ranges}return Pe(b.sizeTree).reduce((F,{k:V,v:D})=>({prevIndex:V+c,prevSize:D,ranges:[...F.ranges,{endIndex:V+c-1,size:F.prevSize,startIndex:F.prevIndex}]}),{prevIndex:0,prevSize:E,ranges:[]}).ranges})),o);const A=Ie(I(i,$(m,y),H(([c,{offsetTree:b},k])=>{const B=-c;return st(B,b,k)})));return N(I(i,$(m,y),H(([c,b,k])=>{if(b.groupIndices.length>0){if(Z(b.sizeTree))return b;let E=Ue();const F=se(f);let V=0,D=0,U=0;for(;V<-c;){U=F[D];const C=F[D+1]-U-1;D++,V+=C+1}if(E=Pe(b.sizeTree).reduce((C,{k:O,v:q})=>Te(C,Math.max(0,O+c),q),E),V!==-c){const C=nt(b.sizeTree,U);E=Te(E,0,C);const O=Re(b.sizeTree,-c+1)[1];E=Te(E,1,O)}return{...b,sizeTree:E,...Wt(b.offsetTree,0,E,k)}}const B=Pe(b.sizeTree).reduce((E,{k:F,v:V})=>Te(E,Math.max(0,F+c),V),Ue());return{...b,sizeTree:B,...Wt(b.offsetTree,0,B,k)}})),m),{beforeUnshiftWith:R,data:T,defaultItemSize:h,firstItemIndex:a,fixedItemSize:u,fixedGroupSize:v,gap:y,groupIndices:l,heightEstimates:g,itemSize:p,listRefresh:z,shiftWith:i,shiftWithOffset:A,sizeRanges:o,sizes:m,statefulTotalCount:r,totalCount:n,trackItemSizes:w,unshiftWith:s}},oe(Ae,Gt),{singleton:!0});function Un(e){return e.reduce((t,o)=>(t.groupIndices.push(t.totalCount),t.totalCount+=o+1,t),{groupIndices:[],totalCount:0})}const Vo=Y(([{groupIndices:e,sizes:t,totalCount:o},{headerHeight:n,scrollTop:r}])=>{const s=K(),i=K(),a=Ie(I(s,H(Un)));return N(I(a,H(l=>l.totalCount)),o),N(I(a,H(l=>l.groupIndices)),e),N(I(ue(r,t,n),P(([l,u])=>St(u)),H(([l,u,h])=>Re(u.groupOffsetTree,Math.max(l-h,0),"v")[0]),te(),H(l=>[l])),i),{groupCounts:s,topItemsIndexes:i}},oe(Ee,be)),De=Y(([{log:e}])=>{const t=S(!1),o=Ie(I(t,P(n=>n),te()));return Q(t,n=>{n&&se(e)("props updated",{},he.DEBUG)}),{didMount:o,propsReady:t}},oe(Ae),{singleton:!0}),Kn=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Go(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Kn)&&(t.behavior="auto"),t.offset===void 0&&(t.offset=0),t}const ct=Y(([{gap:e,listRefresh:t,sizes:o,totalCount:n},{fixedFooterHeight:r,fixedHeaderHeight:s,footerHeight:i,headerHeight:a,scrollingInProgress:l,scrollTo:u,smoothScrollTargetReached:h,viewportHeight:v},{log:g}])=>{const p=K(),T=K(),y=S(0);let x=null,m=null,f=null;function w(){x!==null&&(x(),x=null),f!==null&&(f(),f=null),m&&(clearTimeout(m),m=null),G(l,!1)}return N(I(p,$(o,v,n,y,a,i,g),$(e,s,r),H(([[z,R,A,c,b,k,B,E],F,V,D])=>{const U=Go(z),{align:C,behavior:O,offset:q}=U,pe=c-1,le=Fo(U,R,pe);let Ce=st(le,R.offsetTree,F)+k;C==="end"?(Ce+=V+Re(R.sizeTree,le)[1]-A+D,le===pe&&(Ce+=B)):C==="center"?Ce+=(V+Re(R.sizeTree,le)[1]-A+D)/2:Ce-=b,q!==void 0&&q!==0&&(Ce+=q);const Le=ge=>{w(),ge?(E("retrying to scroll to",{location:z},he.DEBUG),G(p,z)):(G(T,!0),E("list did not change, scroll successful",{},he.DEBUG))};if(w(),O==="smooth"){let ge=!1;f=Q(t,Ge=>{ge=ge||Ge}),x=ke(h,()=>{Le(ge)})}else x=ke(I(t,Yn(150)),Le);return m=setTimeout(()=>{w()},1200),G(l,!0),E("scrolling from index to",{behavior:O,index:le,top:Ce},he.DEBUG),{behavior:O,top:Ce}})),u),{scrollTargetReached:T,scrollToIndex:p,topListHeight:y}},oe(Ee,be,Ae),{singleton:!0});function Yn(e){return t=>{const o=setTimeout(()=>{t(!1)},e);return n=>{n&&(t(!0),clearTimeout(o))}}}function Ut(e,t){e===0?t():requestAnimationFrame(()=>{Ut(e-1,t)})}function Kt(e,t){const o=t-1;return typeof e=="number"?e:e.index==="LAST"?o:e.index}const ut=Y(([{defaultItemSize:e,listRefresh:t,sizes:o},{scrollTop:n},{scrollTargetReached:r,scrollToIndex:s},{didMount:i}])=>{const a=S(!0),l=S(0),u=S(!0);return N(I(i,$(l),P(([h,v])=>v!==0),He(!1)),a),N(I(i,$(l),P(([h,v])=>v!==0),He(!1)),u),Q(I(ue(t,i),$(a,o,e,u),P(([[,h],v,{sizeTree:g},p,T])=>h&&(!Z(g)||_t(p))&&!v&&!T),$(l)),([,h])=>{ke(r,()=>{G(u,!0)}),Ut(4,()=>{ke(n,()=>{G(a,!0)}),G(s,h)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:l,scrolledToInitialItem:a}},oe(Ee,be,ct,De),{singleton:!0});function $o(e,t){return Math.abs(e-t)<1.01}const it="up",qe="down",Xn="none",Qn={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Zn=0,dt=Y(([{footerHeight:e,headerHeight:t,scrollBy:o,scrollContainerState:n,scrollTop:r,viewportHeight:s}])=>{const i=S(!1),a=S(!0),l=K(),u=K(),h=S(4),v=S(Zn),g=ve(I(Mt(I(W(r),_e(1),He(!0)),I(W(r),_e(1),He(!1),uo(100))),te()),!1),p=ve(I(Mt(I(o,He(!0)),I(o,He(!1),uo(200))),te()),!1);N(I(ue(W(r),W(v)),H(([f,w])=>f<=w),te()),a),N(I(a,Be(50)),u);const T=Ie(I(ue(n,W(s),W(t),W(e),W(h)),ze((f,[{scrollHeight:w,scrollTop:z},R,A,c,b])=>{const k=z+R-w>-b,B={scrollHeight:w,scrollTop:z,viewportHeight:R};if(k){let F,V;return z>f.state.scrollTop?(F="SCROLLED_DOWN",V=f.state.scrollTop-z):(F="SIZE_DECREASED",V=f.state.scrollTop-z||f.scrollTopDelta),{atBottom:!0,atBottomBecause:F,scrollTopDelta:V,state:B}}let E;return B.scrollHeight>f.state.scrollHeight?E="SIZE_INCREASED":R<f.state.viewportHeight?E="VIEWPORT_HEIGHT_DECREASING":z<f.state.scrollTop?E="SCROLLING_UPWARDS":E="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:E,state:B}},Qn),te((f,w)=>f!==void 0&&f.atBottom===w.atBottom))),y=ve(I(n,ze((f,{scrollHeight:w,scrollTop:z,viewportHeight:R})=>{if(!$o(f.scrollHeight,w)){const A=w-(z+R)<1;return f.scrollTop!==z&&A?{changed:!0,jump:f.scrollTop-z,scrollHeight:w,scrollTop:z}:{changed:!0,jump:0,scrollHeight:w,scrollTop:z}}return{changed:!1,jump:0,scrollHeight:w,scrollTop:z}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),P(f=>f.changed),H(f=>f.jump)),0);N(I(T,H(f=>f.atBottom)),i),N(I(i,Be(50)),l);const x=S(qe);N(I(n,H(({scrollTop:f})=>f),te(),ze((f,w)=>se(p)?{direction:f.direction,prevScrollTop:w}:{direction:w<f.prevScrollTop?it:qe,prevScrollTop:w},{direction:qe,prevScrollTop:0}),H(f=>f.direction)),x),N(I(n,Be(50),He(Xn)),x);const m=S(0);return N(I(g,P(f=>!f),He(0)),m),N(I(r,Be(100),$(g),P(([f,w])=>w),ze(([f,w],[z])=>[w,z],[0,0]),H(([f,w])=>w-f)),m),{atBottomState:T,atBottomStateChange:l,atBottomThreshold:h,atTopStateChange:u,atTopThreshold:v,isAtBottom:i,isAtTop:a,isScrolling:g,lastJumpDueToItemResize:y,scrollDirection:x,scrollVelocity:m}},oe(be)),lt="top",at="bottom",po="none";function go(e,t,o){return typeof e=="number"?o===it&&t===lt||o===qe&&t===at?e:0:o===it?t===lt?e.main:e.reverse:t===at?e.main:e.reverse}function xo(e,t){return typeof e=="number"?e:e[t]??0}const Yt=Y(([{deviation:e,fixedHeaderHeight:t,headerHeight:o,scrollTop:n,viewportHeight:r}])=>{const s=K(),i=S(0),a=S(0),l=S(0),u=ve(I(ue(W(n),W(r),W(o),W(s,rt),W(l),W(i),W(t),W(e),W(a)),H(([h,v,g,[p,T],y,x,m,f,w])=>{const z=h-f,R=x+m,A=Math.max(g-z,0);let c=po;const b=xo(w,lt),k=xo(w,at);return p-=f,p+=g+m,T+=g+m,T-=f,p>h+R-b&&(c=it),T<h-A+v+k&&(c=qe),c!==po?[Math.max(z-g-go(y,lt,c)-b,0),z-A-m+v+go(y,at,c)+k]:null}),P(h=>h!==null),te(rt)),[0,0]);return{increaseViewportBy:a,listBoundary:s,overscan:l,topListHeight:i,visibleRange:u}},oe(be),{singleton:!0});function Jn(e,t,o){if(St(t)){const n=_o(e,t);return[{index:Re(t.groupOffsetTree,n)[0],offset:0,size:0},{data:o==null?void 0:o[0],index:n,offset:0,size:0}]}return[{data:o==null?void 0:o[0],index:e,offset:0,size:0}]}const zt={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function yt(e,t,o,n,r,s){const{lastIndex:i,lastOffset:a,lastSize:l}=r;let u=0,h=0;if(e.length>0){u=e[0].offset;const y=e[e.length-1];h=y.offset+y.size}const v=o-i,g=a+v*l+(v-1)*n,p=u,T=g-h;return{bottom:h,firstItemIndex:s,items:vo(e,r,s),offsetBottom:T,offsetTop:u,top:p,topItems:vo(t,r,s),topListHeight:t.reduce((y,x)=>x.size+y,0),totalCount:o}}function Uo(e,t,o,n,r,s){let i=0;if(o.groupIndices.length>0)for(const h of o.groupIndices){if(h-i>=e)break;i++}const a=e+i,l=Kt(t,a),u=Array.from({length:a}).map((h,v)=>({data:s[v+l],index:v+l,offset:0,size:0}));return yt(u,[],a,r,o,n)}function vo(e,t,o){if(e.length===0)return[];if(!St(t))return e.map(u=>({...u,index:u.index+o,originalIndex:u.index}));const n=e[0].index,r=e[e.length-1].index,s=[],i=Ke(t.groupOffsetTree,n,r);let a,l=0;for(const u of e){(!a||a.end<u.index)&&(a=i.shift(),l=t.groupIndices.indexOf(a.start));let h;u.index===a.start?h={index:l,type:"group"}:h={groupIndex:l,index:u.index-(l+1)+o},s.push({...h,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return s}function yo(e,t){return e===void 0?0:typeof e=="number"?e:e[t]??0}const Ve=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n,totalCount:r},s,{listBoundary:i,topListHeight:a,visibleRange:l},{initialTopMostItemIndex:u,scrolledToInitialItem:h},{topListHeight:v},g,{didMount:p},{recalcInProgress:T}])=>{const y=S([]),x=S(0),m=K(),f=S(0);N(s.topItemsIndexes,y);const w=ve(I(ue(p,T,W(l,rt),W(r),W(n),W(u),h,W(y),W(t),W(o),W(f),e),P(([c,b,,k,,,,,,,,B])=>{const E=B!==void 0&&B.length!==k;return c&&!b&&!E}),H(([,,[c,b],k,B,E,F,V,D,U,C,O])=>{var X,de;const q=B,{offsetTree:pe,sizeTree:le}=q,Ce=se(x);if(k===0)return{...zt,totalCount:k};if(c===0&&b===0)return Ce===0?{...zt,totalCount:k}:Uo(Ce,E,B,D,U,O||[]);if(Z(le))return Ce>0?null:yt(Jn(Kt(E,k),q,O),[],k,U,q,D);const Le=[];if(V.length>0){const ee=V[0],ne=V[V.length-1];let fe=0;for(const ae of Ke(le,ee,ne)){const J=ae.value,ie=Math.max(ae.start,ee),ye=Math.min(ae.end,ne);for(let ce=ie;ce<=ye;ce++)Le.push({data:O==null?void 0:O[ce],index:ce,offset:fe,size:J}),fe+=J}}if(!F)return yt([],Le,k,U,q,D);const ge=V.length>0?V[V.length-1]+1:0,Ge=Pn(pe,c,b,ge);if(Ge.length===0)return null;const Qe=k-1,je=wt([],ee=>{for(const ne of Ge){const fe=ne.value;let ae=fe.offset,J=ne.start;const ie=fe.size;if(fe.offset<c){J+=Math.floor((c-fe.offset+U)/(ie+U));const ce=J-ne.start;ae+=ce*ie+ce*U}J<ge&&(ae+=(ge-J)*ie,J=ge);const ye=Math.min(ne.end,Qe);for(let ce=J;ce<=ye&&!(ae>=b);ce++)ee.push({data:O==null?void 0:O[ce],index:ce,offset:ae,size:ie}),ae+=ie+U}}),Ze=yo(C,lt),j=yo(C,at);if(je.length>0&&(Ze>0||j>0)){const ee=je[0],ne=je[je.length-1];if(Ze>0&&ee.index>ge){const fe=Math.min(Ze,ee.index-ge),ae=[];let J=ee.offset;for(let ie=ee.index-1;ie>=ee.index-fe;ie--){const ye=((X=Ke(le,ie,ie)[0])==null?void 0:X.value)??ee.size;J-=ye+U,ae.unshift({data:O==null?void 0:O[ie],index:ie,offset:J,size:ye})}je.unshift(...ae)}if(j>0&&ne.index<Qe){const fe=Math.min(j,Qe-ne.index);let ae=ne.offset+ne.size+U;for(let J=ne.index+1;J<=ne.index+fe;J++){const ie=((de=Ke(le,J,J)[0])==null?void 0:de.value)??ne.size;je.push({data:O==null?void 0:O[J],index:J,offset:ae,size:ie}),ae+=ie+U}}}return yt(je,Le,k,U,q,D)}),P(c=>c!==null),te()),zt);N(I(e,P(_t),H(c=>c==null?void 0:c.length)),r),N(I(w,H(c=>c.topListHeight)),v),N(v,a),N(I(w,H(c=>[c.top,c.bottom])),i),N(I(w,H(c=>c.items)),m);const z=Ie(I(w,P(({items:c})=>c.length>0),$(r,e),P(([{items:c},b])=>c[c.length-1].originalIndex===b-1),H(([,c,b])=>[c-1,b]),te(rt),H(([c])=>c))),R=Ie(I(w,Be(200),P(({items:c,topItems:b})=>c.length>0&&c[0].originalIndex===b.length),H(({items:c})=>c[0].index),te())),A=Ie(I(w,P(({items:c})=>c.length>0),H(({items:c})=>{let b=0,k=c.length-1;for(;c[b].type==="group"&&b<k;)b++;for(;c[k].type==="group"&&k>b;)k--;return{endIndex:c[k].index,startIndex:c[b].index}}),te(Wo)));return{endReached:z,initialItemCount:x,itemsRendered:m,listState:w,minOverscanItemCount:f,rangeChanged:A,startReached:R,topItemsIndexes:y,...g}},oe(Ee,Vo,Yt,ut,ct,dt,De,Gt),{singleton:!0}),Ko=Y(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:o,headerHeight:n},{listState:r}])=>{const s=K(),i=ve(I(ue(o,e,n,t,r),H(([a,l,u,h,v])=>a+l+u+h+v.offsetBottom+v.bottom)),0);return N(W(i),s),{totalListHeight:i,totalListHeightChanged:s}},oe(be,Ve),{singleton:!0}),qn=Y(([{viewportHeight:e},{totalListHeight:t}])=>{const o=S(!1),n=ve(I(ue(o,e,t),P(([r])=>r),H(([,r,s])=>Math.max(0,r-s)),Be(0),te()),0);return{alignToBottom:o,paddingTopAddition:n}},oe(be,Ko),{singleton:!0}),Yo=Y(()=>({context:S(null)})),er=({itemBottom:e,itemTop:t,locationParams:{align:o,behavior:n,...r},viewportBottom:s,viewportTop:i})=>t<i?{...r,align:o??"start",...n!==void 0?{behavior:n}:{}}:e>s?{...r,align:o??"end",...n!==void 0?{behavior:n}:{}}:null,Xo=Y(([{gap:e,sizes:t,totalCount:o},{fixedFooterHeight:n,fixedHeaderHeight:r,headerHeight:s,scrollingInProgress:i,scrollTop:a,viewportHeight:l},{scrollToIndex:u}])=>{const h=K();return N(I(h,$(t,l,o,s,r,n,a),$(e),H(([[v,g,p,T,y,x,m,f],w])=>{const{calculateViewLocation:z=er,done:R,...A}=v,c=Fo(v,g,T-1),b=st(c,g.offsetTree,w)+y+x,k=b+Re(g.sizeTree,c)[1],B=f+x,E=f+p-m,F=z({itemBottom:k,itemTop:b,locationParams:A,viewportBottom:E,viewportTop:B});return F!==null?R&&ke(I(i,P(V=>!V),_e(se(i)?1:2)),R):R==null||R(),F}),P(v=>v!==null)),u),{scrollIntoView:h}},oe(Ee,be,ct,Ve,Ae),{singleton:!0});function bo(e){return e===!1?!1:e==="smooth"?"smooth":"auto"}const tr=(e,t)=>typeof e=="function"?bo(e(t)):t&&bo(e),or=Y(([{listRefresh:e,totalCount:t,fixedItemSize:o,data:n},{atBottomState:r,isAtBottom:s},{scrollToIndex:i},{scrolledToInitialItem:a},{didMount:l,propsReady:u},{log:h},{scrollingInProgress:v},{context:g},{scrollIntoView:p}])=>{const T=S(!1),y=K();let x=null;function m(R){G(i,{align:"end",behavior:R,index:"LAST"})}Q(I(ue(I(W(t),_e(1)),l),$(W(T),s,a,v),H(([[R,A],c,b,k,B])=>{let E=A&&k,F="auto";return E&&(F=tr(c,b||B),E=E&&F!==!1),{followOutputBehavior:F,shouldFollow:E,totalCount:R}}),P(({shouldFollow:R})=>R)),({followOutputBehavior:R,totalCount:A})=>{x!==null&&(x(),x=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("following output to ",{totalCount:A},he.DEBUG),m(R)}):x=ke(e,()=>{se(h)("following output to ",{totalCount:A},he.DEBUG),m(R),x=null})});function f(R){const A=ke(r,c=>{R&&!c.atBottom&&c.notAtBottomBecause==="SIZE_INCREASED"&&x===null&&(se(h)("scrolling to bottom due to increased size",{},he.DEBUG),m("auto"))});setTimeout(A,100)}Q(I(ue(W(T),t,u),P(([R,,A])=>R!==!1&&A),ze(({value:R},[,A])=>({refreshed:R===A,value:A}),{refreshed:!1,value:0}),P(({refreshed:R})=>R),$(T,t)),([,R])=>{se(a)&&f(R!==!1)}),Q(y,()=>{f(se(T)!==!1)}),Q(ue(W(T),r),([R,A])=>{R!==!1&&!A.atBottom&&A.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&m("auto")});const w=S(null),z=K();return N(Mt(I(W(n),H(R=>(R==null?void 0:R.length)??0)),I(W(t))),z),Q(I(ue(I(z,_e(1)),l),$(W(w),a,v,g),H(([[R,A],c,b,k,B])=>A&&b&&(c==null?void 0:c({context:B,totalCount:R,scrollingInProgress:k}))),P(R=>!!R),Be(0)),R=>{x!==null&&(x(),x=null),se(o)!==void 0?requestAnimationFrame(()=>{se(h)("scrolling into view",{}),G(p,R)}):x=ke(e,()=>{se(h)("scrolling into view",{}),G(p,R),x=null})}),{autoscrollToBottom:y,followOutput:T,scrollIntoViewOnChange:w}},oe(Ee,dt,ct,ut,De,Ae,be,Yo,Xo)),nr=Y(([{data:e,firstItemIndex:t,gap:o,sizes:n},{initialTopMostItemIndex:r},{initialItemCount:s,listState:i},{didMount:a}])=>(N(I(a,$(s),P(([,l])=>l!==0),$(r,n,t,o,e),H(([[,l],u,h,v,g,p=[]])=>Uo(l,u,h,v,g,p))),i),{}),oe(Ee,ut,Ve,De),{singleton:!0}),rr=Y(([{didMount:e},{scrollTo:t},{listState:o}])=>{const n=S(0);return Q(I(e,$(n),P(([,r])=>r!==0),H(([,r])=>({top:r}))),r=>{ke(I(o,_e(1),P(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{G(t,r)})})}),{initialScrollTop:n}},oe(De,be,Ve),{singleton:!0}),Qo=Y(([{scrollVelocity:e}])=>{const t=S(!1),o=K(),n=S(!1);return N(I(e,$(n,t,o),P(([r,s])=>s!==!1&&s!==void 0),H(([r,s,i,a])=>{const{enter:l,exit:u}=s;if(i){if(u(r,a))return!1}else if(l(r,a))return!0;return i}),te()),t),Q(I(ue(t,e,o),$(n)),([[r,s,i],a])=>{r&&a!==!1&&a!==void 0&&a.change&&a.change(s,i)}),{isSeeking:t,scrollSeekConfiguration:n,scrollSeekRangeChanged:o,scrollVelocity:e}},oe(dt),{singleton:!0}),Xt=Y(([{scrollContainerState:e,scrollTo:t}])=>{const o=K(),n=K(),r=K(),s=S(!1),i=S(void 0);return N(I(ue(o,n),H(([{scrollTop:a,viewportHeight:l},{offsetTop:u,listHeight:h}])=>({scrollHeight:h,scrollTop:Math.max(0,a-u),viewportHeight:l}))),e),N(I(t,$(n),H(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{customScrollParent:i,useWindowScroll:s,windowScrollContainerState:o,windowScrollTo:r,windowViewportRect:n}},oe(be)),sr=Y(([{sizeRanges:e,sizes:t},{headerHeight:o,scrollTop:n},{initialTopMostItemIndex:r},{didMount:s},{useWindowScroll:i,windowScrollContainerState:a,windowViewportRect:l}])=>{const u=K(),h=S(void 0),v=S(null),g=S(null);return N(a,v),N(l,g),Q(I(u,$(t,n,i,v,g,o)),([p,T,y,x,m,f,w])=>{const z=Fn(T.sizeTree);x&&m!==null&&f!==null&&(y=m.scrollTop-f.offsetTop),y-=w,p({ranges:z,scrollTop:y})}),N(I(h,P(_t),H(ir)),r),N(I(s,$(h),P(([,p])=>p!==void 0),te(),H(([,p])=>p.ranges)),e),{getState:u,restoreStateFrom:h}},oe(Ee,be,ut,De,Xt));function ir(e){return{align:"start",index:0,offset:e.scrollTop}}const lr=Y(([{topItemsIndexes:e}])=>{const t=S(0);return N(I(t,P(o=>o>=0),H(o=>Array.from({length:o}).map((n,r)=>r))),e),{topItemCount:t}},oe(Ve));function Zo(e){let t=!1,o;return(()=>(t||(t=!0,o=e()),o))}const ar=Zo(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),cr=Y(([{deviation:e,scrollBy:t,scrollingInProgress:o,scrollTop:n},{isAtBottom:r,isScrolling:s,lastJumpDueToItemResize:i,scrollDirection:a},{listState:l},{beforeUnshiftWith:u,gap:h,shiftWithOffset:v,sizes:g},{log:p},{recalcInProgress:T}])=>{const y=Ie(I(l,$(i),ze(([,m,f,w],[{bottom:z,items:R,offsetBottom:A,totalCount:c},b])=>{const k=z+A;let B=0;return f===c&&m.length>0&&R.length>0&&(R[0].originalIndex===0&&m[0].originalIndex===0||(B=k-w,B!==0&&(B+=b))),[B,R,c,k]},[0,[],0,0]),P(([m])=>m!==0),$(n,a,o,r,p,T),P(([,m,f,w,,,z])=>!z&&!w&&m!==0&&f===it),H(([[m],,,,,f])=>(f("Upward scrolling compensation",{amount:m},he.DEBUG),m))));function x(m){m>0?(G(t,{behavior:"auto",top:-m}),G(e,0)):(G(e,0),G(t,{behavior:"auto",top:-m}))}return Q(I(y,$(e,s)),([m,f,w])=>{w&&ar()?G(e,f-m):x(-m)}),Q(I(ue(ve(s,!1),e,T),P(([m,f,w])=>!m&&!w&&f!==0),H(([m,f])=>f),Be(1)),x),N(I(v,H(m=>({top:-m}))),t),Q(I(u,$(g,h),H(([m,{groupIndices:f,lastSize:w,sizeTree:z},R])=>{function A(E){return E*(w+R)}if(f.length===0)return A(m);let c=0;const b=nt(z,0);let k=0,B=0;for(;k<m;){k++,c+=b;let E=f.length===B+1?1/0:f[B+1]-f[B]-1;k+E>m&&(c-=b,E=m-k+1),k+=E,c+=A(E),B++}return c})),m=>{G(e,m),requestAnimationFrame(()=>{G(t,{top:m}),requestAnimationFrame(()=>{G(e,0),G(T,!1)})})}),{deviation:e}},oe(be,dt,Ve,Ee,Ae,Gt)),ur=Y(([e,t,o,n,r,s,i,a,l,u,h])=>({...e,...t,...o,...n,...r,...s,...i,...a,...l,...u,...h}),oe(Yt,nr,De,Qo,Ko,rr,qn,Xt,Xo,Ae,Yo)),Jo=Y(([{data:e,defaultItemSize:t,firstItemIndex:o,fixedItemSize:n,fixedGroupSize:r,gap:s,groupIndices:i,heightEstimates:a,itemSize:l,sizeRanges:u,sizes:h,statefulTotalCount:v,totalCount:g,trackItemSizes:p},{initialItemFinalLocationReached:T,initialTopMostItemIndex:y,scrolledToInitialItem:x},m,f,w,z,{scrollToIndex:R},A,{topItemCount:c},{groupCounts:b},k])=>{const{listState:B,minOverscanItemCount:E,topItemsIndexes:F,rangeChanged:V,...D}=z;return N(V,k.scrollSeekRangeChanged),N(I(k.windowViewportRect,H(U=>U.visibleHeight)),m.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:o,fixedItemHeight:n,fixedGroupHeight:r,gap:s,groupCounts:b,heightEstimates:a,initialItemFinalLocationReached:T,initialTopMostItemIndex:y,scrolledToInitialItem:x,sizeRanges:u,topItemCount:c,topItemsIndexes:F,totalCount:g,...w,groupIndices:i,itemSize:l,listState:B,minOverscanItemCount:E,scrollToIndex:R,statefulTotalCount:v,trackItemSizes:p,rangeChanged:V,...D,...k,...m,sizes:h,...f}},oe(Ee,ut,be,sr,or,Ve,ct,cr,lr,Vo,ur));function dr(e,t){const o={},n={};let r=0;const s=e.length;for(;r<s;)n[e[r]]=1,r+=1;for(const i in t)Object.hasOwn(n,i)||(o[i]=t[i]);return o}const ht=typeof document<"u"?L.useLayoutEffect:L.useEffect;function qo(e,t,o){const n=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),s=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=L.createContext({});function l(x,m){x.propsReady!==void 0&&G(x.propsReady,!1);for(const f of n){const w=x[t.required[f]];G(w,m[f])}for(const f of r)if(f in m){const w=x[t.optional[f]];G(w,m[f])}x.propsReady!==void 0&&G(x.propsReady,!0)}function u(x){return s.reduce((m,f)=>(m[f]=w=>{const z=x[t.methods[f]];G(z,w)},m),{})}function h(x){return i.reduce((m,f)=>(m[f]=Rn(x[t.events[f]]),m),{})}const v=L.forwardRef(function(x,m){const{children:f,...w}=x,[z]=L.useState(()=>wt(Hn(e),c=>{l(c,w)})),[R]=L.useState(co(h,z));ht(()=>{for(const c of i)c in w&&Q(R[c],w[c]);return()=>{Object.values(R).map(Ft)}},[w,R,z]),ht(()=>{l(z,w)}),L.useImperativeHandle(m,ao(u(z)));const A=o;return d.jsx(a.Provider,{value:z,children:o!==void 0?d.jsx(A,{...dr([...n,...r,...i],w),children:f}):f})}),g=x=>{const m=L.useContext(a);return L.useCallback(f=>{G(m[x],f)},[m,x])},p=x=>{const m=L.useContext(a)[x],f=L.useCallback(w=>Q(m,w),[m]);return L.useSyncExternalStore(f,()=>se(m),()=>se(m))},T=x=>{const m=L.useContext(a)[x],[f,w]=L.useState(co(se,m));return ht(()=>Q(m,z=>{z!==f&&w(ao(z))}),[m,f]),f},y=L.version.startsWith("18")?p:T;return{Component:v,useEmitter:(x,m)=>{const f=L.useContext(a)[x];ht(()=>Q(f,m),[m,f])},useEmitterValue:y,usePublisher:g}}const en=L.createContext(void 0),tn=L.createContext(void 0),Et="-webkit-sticky",Co="sticky",Qt=Zo(()=>{if(typeof document>"u")return Co;const e=document.createElement("div");return e.style.position=Et,e.style.position===Et?Et:Co}),on=typeof document<"u"?L.useLayoutEffect:L.useEffect;function Bt(e){return"self"in e}function fr(e){return"body"in e}function nn(e,t,o,n=Xe,r,s){const i=L.useRef(null),a=L.useRef(null),l=L.useRef(null),u=L.useCallback(g=>{let p,T,y;const x=g.target;if(fr(x)||Bt(x)){const f=Bt(x)?x:x.defaultView;y=s===!0?f.scrollX:f.scrollY,p=s===!0?f.document.documentElement.scrollWidth:f.document.documentElement.scrollHeight,T=s===!0?f.innerWidth:f.innerHeight}else y=s===!0?x.scrollLeft:x.scrollTop,p=s===!0?x.scrollWidth:x.scrollHeight,T=s===!0?x.offsetWidth:x.offsetHeight;const m=()=>{e({scrollHeight:p,scrollTop:Math.max(y,0),viewportHeight:T})};g.suppressFlushSync===!0?m():fn.flushSync(m),a.current!==null&&(y===a.current||y<=0||y===p-T)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t,s]);L.useEffect(()=>{const g=r||i.current;return n(r||i.current),u({suppressFlushSync:!0,target:g}),g.addEventListener("scroll",u,{passive:!0}),()=>{n(null),g.removeEventListener("scroll",u)}},[i,u,o,n,r]);function h(g){const p=i.current;if(!p||(s===!0?"offsetWidth"in p&&p.offsetWidth===0:"offsetHeight"in p&&p.offsetHeight===0))return;const T=g.behavior==="smooth";let y,x,m;Bt(p)?(x=Math.max(Me(p.document.documentElement,s===!0?"width":"height"),s===!0?p.document.documentElement.scrollWidth:p.document.documentElement.scrollHeight),y=s===!0?p.innerWidth:p.innerHeight,m=s===!0?window.scrollX:window.scrollY):(x=p[s===!0?"scrollWidth":"scrollHeight"],y=Me(p,s===!0?"width":"height"),m=p[s===!0?"scrollLeft":"scrollTop"]);const f=x-y;if(g.top=Math.ceil(Math.max(Math.min(f,g.top),0)),$o(y,x)||g.top===m){e({scrollHeight:x,scrollTop:m,viewportHeight:y}),T&&t(!0);return}T?(a.current=g.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,s===!0&&(g={...g.behavior!==void 0?{behavior:g.behavior}:{},left:g.top}),p.scrollTo(g)}function v(g){s===!0&&(g={...g.behavior!==void 0?{behavior:g.behavior}:{},...g.top!==void 0?{left:g.top}:{}}),i.current.scrollBy(g)}return{scrollByCallback:v,scrollerRef:i,scrollToCallback:h}}function Zt(e){return e}const mr=Y(()=>{const e=S(a=>`Item ${a}`),t=S(a=>`Group ${a}`),o=S({}),n=S(Zt),r=S("div"),s=S(Xe),i=(a,l=null)=>ve(I(o,H(u=>u[a]),te()),l);return{components:o,computeItemKey:n,EmptyPlaceholder:i("EmptyPlaceholder"),FooterComponent:i("Footer"),GroupComponent:i("Group","div"),groupContent:t,HeaderComponent:i("Header"),HeaderFooterTag:r,ItemComponent:i("Item","div"),itemContent:e,ListComponent:i("List","div"),ScrollerComponent:i("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:i("ScrollSeekPlaceholder"),TopItemListComponent:i("TopItemList")}}),hr=Y(([e,t])=>({...e,...t}),oe(Jo,mr)),pr=({height:e})=>d.jsx("div",{style:{height:e}}),gr={overflowAnchor:"none",position:Qt(),zIndex:1},rn={overflowAnchor:"none"},xr={...rn,display:"inline-block",height:"100%"},To=L.memo(function({showTopList:e=!1}){const t=_("listState"),o=we("sizeRanges"),n=_("useWindowScroll"),r=_("customScrollParent"),s=we("windowScrollContainerState"),i=we("scrollContainerState"),a=r||n?s:i,l=_("itemContent"),u=_("context"),h=_("groupContent"),v=_("trackItemSizes"),g=_("itemSize"),p=_("log"),T=we("gap"),y=_("horizontalDirection"),{callbackRef:x}=Bn(o,g,v,e?Xe:a,p,T,r,y,_("skipAnimationFrameInResizeObserver")),[m,f]=L.useState(0);Jt("deviation",D=>{m!==D&&f(D)});const w=_("EmptyPlaceholder"),z=_("ScrollSeekPlaceholder")??pr,R=_("ListComponent"),A=_("ItemComponent"),c=_("GroupComponent"),b=_("computeItemKey"),k=_("isSeeking"),B=_("groupIndices").length>0,E=_("alignToBottom"),F=_("initialItemFinalLocationReached"),V=e?{}:{boxSizing:"border-box",...y?{display:"inline-block",height:"100%",marginLeft:m!==0?m:E?"auto":0,paddingLeft:t.offsetTop,paddingRight:t.offsetBottom,whiteSpace:"nowrap"}:{marginTop:m!==0?m:E?"auto":0,paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},...F?{}:{visibility:"hidden"}};return!e&&t.totalCount===0&&w!==null&&w!==void 0?d.jsx(w,{...xe(w,u)}):d.jsx(R,{...xe(R,u),"data-testid":e?"virtuoso-top-item-list":"virtuoso-item-list",ref:x,style:V,children:(e?t.topItems:t.items).map(D=>{const U=D.originalIndex,C=b(U+t.firstItemIndex,D.data,u);return k?M.createElement(z,{...xe(z,u),height:D.size,index:D.index,key:C,type:D.type||"item",...D.type==="group"?{}:{groupIndex:D.groupIndex}}):D.type==="group"?M.createElement(c,{...xe(c,u),"data-index":U,"data-item-index":D.index,"data-known-size":D.size,key:C,style:gr},h(D.index,u)):M.createElement(A,{...xe(A,u),...Cr(A,D.data),"data-index":U,"data-item-group-index":D.groupIndex,"data-item-index":D.index,"data-known-size":D.size,key:C,style:y?xr:rn},B?l(D.index,D.groupIndex,D.data,u):l(D.index,D.data,u))})})}),vr={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},yr={outline:"none",overflowX:"auto",position:"relative"},kt=e=>({height:"100%",position:"absolute",top:0,width:"100%",...e?{display:"flex",flexDirection:"column"}:void 0}),br={position:Qt(),top:0,width:"100%",zIndex:1};function xe(e,t){if(typeof e!="string")return{context:t}}function Cr(e,t){return{item:typeof e=="string"?void 0:t}}const Tr=L.memo(function(){const e=_("HeaderComponent"),t=we("headerHeight"),o=_("HeaderFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,_("skipAnimationFrameInResizeObserver")),r=_("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),Ir=L.memo(function(){const e=_("FooterComponent"),t=we("footerHeight"),o=_("HeaderFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,_("skipAnimationFrameInResizeObserver")),r=_("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null});function sn({useEmitter:e,useEmitterValue:t,usePublisher:o}){return L.memo(function({children:n,style:r,context:s,...i}){const a=o("scrollContainerState"),l=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("scrollerRef"),v=t("horizontalDirection")||!1,{scrollByCallback:g,scrollerRef:p,scrollToCallback:T}=nn(a,u,l,h,void 0,v);return e("scrollTo",T),e("scrollBy",g),d.jsx(l,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...v?yr:vr,...r},tabIndex:0,...i,...xe(l,s),children:n})})}function ln({useEmitter:e,useEmitterValue:t,usePublisher:o}){return L.memo(function({children:n,style:r,context:s,...i}){const a=o("windowScrollContainerState"),l=t("ScrollerComponent"),u=o("smoothScrollTargetReached"),h=t("totalListHeight"),v=t("deviation"),g=t("customScrollParent"),p=L.useRef(null),T=t("scrollerRef"),{scrollByCallback:y,scrollerRef:x,scrollToCallback:m}=nn(a,u,l,T,g);return on(()=>{var f;return x.current=g||((f=p.current)==null?void 0:f.ownerDocument.defaultView),()=>{x.current=null}},[x,g]),e("windowScrollTo",m),e("scrollBy",y),d.jsx(l,{ref:p,"data-virtuoso-scroller":!0,style:{position:"relative",...r,...h!==0?{height:h+v}:void 0},...i,...xe(l,s),children:n})})}const wr=({children:e})=>{const t=L.useContext(en),o=we("viewportHeight"),n=we("fixedItemHeight"),r=_("alignToBottom"),s=_("horizontalDirection"),i=L.useMemo(()=>Eo(o,l=>Me(l,s?"width":"height")),[o,s]),a=Fe(i,!0,_("skipAnimationFrameInResizeObserver"));return L.useEffect(()=>{t&&(o(t.viewportHeight),n(t.itemHeight))},[t,o,n]),d.jsx("div",{"data-viewport-type":"element",ref:a,style:kt(r),children:e})},Sr=({children:e})=>{const t=L.useContext(en),o=we("windowViewportRect"),n=we("fixedItemHeight"),r=_("customScrollParent"),s=Lo(o,r,_("skipAnimationFrameInResizeObserver")),i=_("alignToBottom");return L.useEffect(()=>{t&&(n(t.itemHeight),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:100}))},[t,o,n]),d.jsx("div",{"data-viewport-type":"window",ref:s,style:kt(i),children:e})},kr=({children:e})=>{const t=_("TopItemListComponent")??"div",o=_("headerHeight"),n={...br,marginTop:`${o}px`},r=_("context");return d.jsx(t,{style:n,...xe(t,r),children:e})},Rr=L.memo(function(e){const t=_("useWindowScroll"),o=_("topItemsIndexes").length>0,n=_("customScrollParent"),r=_("context");return d.jsxs(n||t?zr:Hr,{...e,context:r,children:[o&&d.jsx(kr,{children:d.jsx(To,{showTopList:!0})}),d.jsxs(n||t?Sr:wr,{children:[d.jsx(Tr,{}),d.jsx(To,{}),d.jsx(Ir,{})]})]})}),{Component:jr,useEmitter:Jt,useEmitterValue:_,usePublisher:we}=qo(hr,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",heightEstimates:"heightEstimates",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"}},Rr),Hr=sn({useEmitter:Jt,useEmitterValue:_,usePublisher:we}),zr=ln({useEmitter:Jt,useEmitterValue:_,usePublisher:we}),Er=jr,Br=Y(()=>{const e=S(u=>d.jsxs("td",{children:["Item $",u]})),t=S(null),o=S(u=>d.jsxs("td",{colSpan:1e3,children:["Group ",u]})),n=S(null),r=S(null),s=S({}),i=S(Zt),a=S(Xe),l=(u,h=null)=>ve(I(s,H(v=>v[u]),te()),h);return{components:s,computeItemKey:i,context:t,EmptyPlaceholder:l("EmptyPlaceholder"),FillerRow:l("FillerRow"),fixedFooterContent:r,fixedHeaderContent:n,itemContent:e,groupContent:o,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")}});oe(Jo,Br);Qt();const Io={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},Lr={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:wo,floor:Tt,max:et,min:Lt,round:So}=Math;function ko(e,t,o){return Array.from({length:t-e+1}).map((n,r)=>({data:o===null?null:o[r+e],index:r+e}))}function Nr(e){return{...Lr,items:e}}function pt(e,t){return e!==void 0&&e.width===t.width&&e.height===t.height}function Mr(e,t){return e!==void 0&&e.column===t.column&&e.row===t.row}const Or=Y(([{increaseViewportBy:e,listBoundary:t,overscan:o,visibleRange:n},{footerHeight:r,headerHeight:s,scrollBy:i,scrollContainerState:a,scrollTo:l,scrollTop:u,smoothScrollTargetReached:h,viewportHeight:v},g,p,{didMount:T,propsReady:y},{customScrollParent:x,useWindowScroll:m,windowScrollContainerState:f,windowScrollTo:w,windowViewportRect:z},R])=>{const A=S(0),c=S(0),b=S(Io),k=S({height:0,width:0}),B=S({height:0,width:0}),E=K(),F=K(),V=S(0),D=S(null),U=S({column:0,row:0}),C=K(),O=K(),q=S(!1),pe=S(0),le=S(!0),Ce=S(!1),Le=S(!1);Q(I(T,$(pe),P(([j,X])=>X!==0)),()=>{G(le,!1)}),Q(I(ue(T,le,B,k,pe,Ce),P(([j,X,de,ee,,ne])=>j&&!X&&de.height!==0&&ee.height!==0&&!ne)),([,,,,j])=>{G(Ce,!0),Ut(1,()=>{G(E,j)}),ke(I(u),()=>{G(t,[0,0]),G(le,!0)})}),N(I(O,P(j=>j!=null&&j.scrollTop>0),He(0)),c),Q(I(T,$(O),P(([,j])=>j!=null)),([,j])=>{j&&(G(k,j.viewport),G(B,j.item),G(U,j.gap),j.scrollTop>0&&(G(q,!0),ke(I(u,_e(1)),X=>{G(q,!1)}),G(l,{top:j.scrollTop})))}),N(I(k,H(({height:j})=>j)),v),N(I(ue(W(k,pt),W(B,pt),W(U,(j,X)=>j!==void 0&&j.column===X.column&&j.row===X.row),W(u)),H(([j,X,de,ee])=>({gap:de,item:X,scrollTop:ee,viewport:j}))),C),N(I(ue(W(A),n,W(U,Mr),W(B,pt),W(k,pt),W(D),W(c),W(q),W(le),W(pe)),P(([,,,,,,,j])=>!j),H(([j,[X,de],ee,ne,fe,ae,J,,ie,ye])=>{const{column:ce,row:Je}=ee,{height:ft,width:Rt}=ne,{width:qt}=fe;if(J===0&&(j===0||qt===0))return Io;if(Rt===0){const ro=Kt(ye,j),dn=ro+Math.max(J-1,0);return Nr(ko(ro,dn,ae))}const mt=an(qt,Rt,ce);let $e,We;ie?X===0&&de===0&&J>0?($e=0,We=J-1):($e=mt*Tt((X+Je)/(ft+Je)),We=mt*wo((de+Je)/(ft+Je))-1,We=Lt(j-1,et(We,mt-1)),$e=Lt(We,et(0,$e))):($e=0,We=-1);const eo=ko($e,We,ae),{bottom:to,top:oo}=Ro(fe,ee,ne,eo),no=wo(j/mt),un=no*ft+(no-1)*Je-to;return{bottom:to,itemHeight:ft,items:eo,itemWidth:Rt,offsetBottom:un,offsetTop:oo,top:oo}})),b),N(I(D,P(j=>j!==null),H(j=>j.length)),A),N(I(ue(k,B,b,U),P(([j,X,{items:de}])=>de.length>0&&X.height!==0&&j.height!==0),H(([j,X,{items:de},ee])=>{const{bottom:ne,top:fe}=Ro(j,ee,X,de);return[fe,ne]}),te(rt)),t);const ge=S(!1);N(I(u,$(ge),H(([j,X])=>X||j!==0)),ge);const Ge=Ie(I(ue(b,A),P(([{items:j}])=>j.length>0),$(ge),P(([[j,X],de])=>{const ee=j.items[j.items.length-1].index===X-1;return(de||j.bottom>0&&j.itemHeight>0&&j.offsetBottom===0&&j.items.length===X)&&ee}),H(([[,j]])=>j-1),te())),Qe=Ie(I(W(b),P(({items:j})=>j.length>0&&j[0].index===0),He(0),te())),je=Ie(I(W(b),$(q),P(([{items:j},X])=>j.length>0&&!X),H(([{items:j}])=>({endIndex:j[j.length-1].index,startIndex:j[0].index})),te(Wo),Be(0)));N(je,p.scrollSeekRangeChanged),N(I(E,$(k,B,A,U),H(([j,X,de,ee,ne])=>{const fe=Go(j),{align:ae,behavior:J,offset:ie}=fe;let ye=fe.index;ye==="LAST"&&(ye=ee-1),ye=et(0,ye,Lt(ee-1,ye));let ce=Pt(X,ne,de,ye);return ae==="end"?ce=So(ce-X.height+de.height):ae==="center"&&(ce=So(ce-X.height/2+de.height/2)),ie!==void 0&&ie!==0&&(ce+=ie),{behavior:J,top:ce}})),l);const Ze=ve(I(b,H(j=>j.offsetBottom+j.bottom)),0);return N(I(z,H(j=>({height:j.visibleHeight,width:j.visibleWidth}))),k),{customScrollParent:x,data:D,deviation:V,footerHeight:r,gap:U,headerHeight:s,increaseViewportBy:e,initialItemCount:c,itemDimensions:B,overscan:o,restoreStateFrom:O,scrollBy:i,scrollContainerState:a,scrollHeight:F,scrollTo:l,scrollToIndex:E,scrollTop:u,smoothScrollTargetReached:h,totalCount:A,useWindowScroll:m,viewportDimensions:k,windowScrollContainerState:f,windowScrollTo:w,windowViewportRect:z,...p,gridState:b,horizontalDirection:Le,initialTopMostItemIndex:pe,totalListHeight:Ze,...g,endReached:Ge,propsReady:y,rangeChanged:je,startReached:Qe,stateChanged:C,stateRestoreInProgress:q,...R}},oe(Yt,be,dt,Qo,De,Xt,Ae));function an(e,t,o){return et(1,Tt((e+o)/(Tt(t)+o)))}function Ro(e,t,o,n){const{height:r}=o;if(r===void 0||n.length===0)return{bottom:0,top:0};const s=Pt(e,t,o,n[0].index);return{bottom:Pt(e,t,o,n[n.length-1].index)+r,top:s}}function Pt(e,t,o,n){const r=an(e.width,o.width,t.column),s=Tt(n/r),i=s*o.height+et(0,s-1)*t.row;return i>0?i+t.row:i}const Ar=Y(()=>{const e=S(v=>`Item ${v}`),t=S({}),o=S(null),n=S("virtuoso-grid-item"),r=S("virtuoso-grid-list"),s=S(Zt),i=S("div"),a=S(Xe),l=(v,g=null)=>ve(I(t,H(p=>p[v]),te()),g),u=S(!1),h=S(!1);return N(W(h),u),{components:t,computeItemKey:s,context:o,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:i,itemClassName:n,ItemComponent:l("Item","div"),itemContent:e,listClassName:r,ListComponent:l("List","div"),readyStateChanged:u,reportReadyState:h,ScrollerComponent:l("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),Dr=Y(([e,t])=>({...e,...t}),oe(Or,Ar)),Wr=L.memo(function(){const e=re("gridState"),t=re("listClassName"),o=re("itemClassName"),n=re("itemContent"),r=re("computeItemKey"),s=re("isSeeking"),i=Se("scrollHeight"),a=re("ItemComponent"),l=re("ListComponent"),u=re("ScrollSeekPlaceholder"),h=re("context"),v=Se("itemDimensions"),g=Se("gap"),p=re("log"),T=re("stateRestoreInProgress"),y=Se("reportReadyState"),x=Fe(L.useMemo(()=>m=>{const f=m.parentElement.parentElement.scrollHeight;i(f);const w=m.firstChild;if(w!==null){const{height:z,width:R}=w.getBoundingClientRect();v({height:z,width:R})}g({column:jo("column-gap",getComputedStyle(m).columnGap,p),row:jo("row-gap",getComputedStyle(m).rowGap,p)})},[i,v,g,p]),!0,!1);return on(()=>{e.itemHeight>0&&e.itemWidth>0&&y(!0)},[e]),T?null:d.jsx(l,{className:t,ref:x,...xe(l,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},children:e.items.map(m=>{const f=r(m.index,m.data,h);return s?d.jsx(u,{...xe(u,h),height:e.itemHeight,index:m.index,width:e.itemWidth},f):M.createElement(a,{...xe(a,h),className:o,"data-index":m.index,key:f},n(m.index,m.data,h))})})}),Pr=L.memo(function(){const e=re("HeaderComponent"),t=Se("headerHeight"),o=re("headerFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,!1),r=re("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),_r=L.memo(function(){const e=re("FooterComponent"),t=Se("footerHeight"),o=re("headerFooterTag"),n=Fe(L.useMemo(()=>s=>{t(Me(s,"height"))},[t]),!0,!1),r=re("context");return e!=null?d.jsx(o,{ref:n,children:d.jsx(e,{...xe(e,r)})}):null}),Fr=({children:e})=>{const t=L.useContext(tn),o=Se("itemDimensions"),n=Se("viewportDimensions"),r=Fe(L.useMemo(()=>s=>{n(s.getBoundingClientRect())},[n]),!0,!1);return L.useEffect(()=>{t&&(n({height:t.viewportHeight,width:t.viewportWidth}),o({height:t.itemHeight,width:t.itemWidth}))},[t,n,o]),d.jsx("div",{ref:r,style:kt(!1),children:e})},Vr=({children:e})=>{const t=L.useContext(tn),o=Se("windowViewportRect"),n=Se("itemDimensions"),r=re("customScrollParent"),s=Lo(o,r,!1);return L.useEffect(()=>{t&&(n({height:t.itemHeight,width:t.itemWidth}),o({listHeight:0,offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,o,n]),d.jsx("div",{ref:s,style:kt(!1),children:e})},Gr=L.memo(function({...e}){const t=re("useWindowScroll"),o=re("customScrollParent"),n=o||t?Ur:$r,r=o||t?Vr:Fr,s=re("context");return d.jsx(n,{...e,...xe(n,s),children:d.jsxs(r,{children:[d.jsx(Pr,{}),d.jsx(Wr,{}),d.jsx(_r,{})]})})}),{useEmitter:cn,useEmitterValue:re,usePublisher:Se}=qo(Dr,{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"}},Gr),$r=sn({useEmitter:cn,useEmitterValue:re,usePublisher:Se}),Ur=ln({useEmitter:cn,useEmitterValue:re,usePublisher:Se});function jo(e,t,o){return t!=="normal"&&(t==null?void 0:t.endsWith("px"))!==!0&&o(`${e} was not resolved to pixel value correctly`,t,he.WARN),t==="normal"?0:parseInt(t??"0",10)}const Kr=150;function Yr({entries:e,itemCount:t}){const o=M.useRef(null),[n,r]=M.useState(!1),s=M.useRef(!1),i=M.useRef(0),a=M.useRef(e.length),l=M.useRef(0),u=M.useCallback((p="smooth")=>{o.current&&(l.current=Date.now(),o.current.scrollToIndex({index:t-1,behavior:p,align:"end"}))},[t]),h=M.useCallback(p=>s.current||!p?!1:"auto",[]),v=M.useCallback(p=>{r(!p),p&&(s.current=!1)},[]),g=M.useCallback(p=>{const y=p.target.scrollTop;if(Date.now()-l.current<Kr){i.current=y;return}y-i.current<-10&&(s.current=!0),i.current=y},[]);return M.useEffect(()=>{const p=e.length,T=a.current,y=p>T;if(a.current=p,!y)return;const x=e[e.length-1];(x==null?void 0:x.type)==="user_message"&&(s.current=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.current&&(l.current=Date.now(),o.current.scrollToIndex({index:"LAST",behavior:"auto",align:"end"}))})}))},[e]),{virtuosoRef:o,handleScroll:g,handleAtBottomStateChange:v,handleFollowOutput:h,showScrollButton:n,scrollToBottom:u}}const Xr=new Set(["assistant_message","error","command_exec","tool_use"]);function Qr(e){const t={source_entry_id:e.id,source_process_id:e.processId};switch(e.type){case"assistant_message":return{...t,title:"Issue from assistant message",description:e.content.slice(0,2e3)};case"error":return{...t,title:`Error: ${e.message.slice(0,100)}`,description:e.message+(e.code?`
2
2
  Code: ${e.code}`:""),type:"bug",priority:"high"};case"command_exec":return{...t,title:`Issue from command: ${e.command.slice(0,80)}`,description:[`Command: ${e.command}`,e.exitCode!==void 0?`Exit code: ${e.exitCode}`:"",e.output?`Output:
3
3
  ${e.output.slice(0,1500)}`:""].filter(Boolean).join(`
4
4
  `),type:e.exitCode!==0?"bug":"task"};case"tool_use":return{...t,title:`Issue from tool: ${e.name}`,description:[`Tool: ${e.name}`,`Status: ${e.status}`,`Input: ${JSON.stringify(e.input,null,2).slice(0,500)}`,e.result?`Result: ${e.result.slice(0,1e3)}`:""].filter(Boolean).join(`
@@ -1,4 +1,4 @@
1
- var En=e=>{throw TypeError(e)};var Pn=(e,t,n)=>t.has(e)||En("Cannot "+n);var We=(e,t,n)=>(Pn(e,t,"read from private field"),n?n.call(e):t.get(e)),Tn=(e,t,n)=>t.has(e)?En("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),An=(e,t,n,r)=>(Pn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{d as Sr,k as $,r as p,s as dt,j as i,X as jr,q as fe,t as Rr,F as Nn,v as Xe,w as Zt,M as as,x as qt,y as et,z as be,D as ae,E as te,G as _t,H as tt,J as cs,K as F,N as ls,Q as wt,U as us,Y as ds,Z as fs,_ as ps,$ as hs,a0 as xs,a1 as ms}from"./index-DpcPd-UG.js";import{C as In,M as gs}from"./ChatInput-CBI3qHQQ.js";import{R as vs}from"./rows-2-CifAA5SL.js";import{T as ys}from"./TreeBrowser-oEx8YJXV.js";import{P as bs}from"./pencil-qGxg9jOe.js";import{T as kr}from"./trash-2-Xen46iNQ.js";import"./index-CWBJLu42.js";import"./zap-DsQCPF61.js";import"./MarkdownRenderer-CtUhoxCT.js";import"./chevron-right-DvZ5sMOg.js";import"./terminal-EpmtGBlw.js";import"./circle-alert-Bfbv3gt4.js";import"./search-pe7pU1YN.js";import"./folder-CTj6SNNu.js";/**
1
+ var En=e=>{throw TypeError(e)};var Pn=(e,t,n)=>t.has(e)||En("Cannot "+n);var We=(e,t,n)=>(Pn(e,t,"read from private field"),n?n.call(e):t.get(e)),Tn=(e,t,n)=>t.has(e)?En("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),An=(e,t,n,r)=>(Pn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);import{d as Sr,k as $,r as p,s as dt,j as i,X as jr,q as fe,t as Rr,F as Nn,v as Xe,w as Zt,M as as,x as qt,y as et,z as be,D as ae,E as te,G as _t,H as tt,J as cs,K as F,N as ls,Q as wt,U as us,Y as ds,Z as fs,_ as ps,$ as hs,a0 as xs,a1 as ms}from"./index-DQIlX2w_.js";import{C as In,M as gs}from"./ChatInput-DU9YGZKX.js";import{R as vs}from"./rows-2-DP6NjQFk.js";import{T as ys}from"./TreeBrowser-CVtPF5C9.js";import{P as bs}from"./pencil-I7GE0y29.js";import{T as kr}from"./trash-2-CVh9mnRj.js";import"./index-DaFwSmVJ.js";import"./zap-C0zaC7gJ.js";import"./MarkdownRenderer-ZGtOY7Ti.js";import"./chevron-right-SmErd_1F.js";import"./terminal-DXx4tvzq.js";import"./circle-alert-CuzAg2fd.js";import"./search-b78eLlw2.js";import"./folder-B8ODoZfb.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,ai as L,aj as c,ak as w,r as d,V as z}from"./index-DpcPd-UG.js";import{A as M}from"./index-BxR_3IbJ.js";import{m as T}from"./proxy-DOffTzwA.js";function $(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function D({member:t}){return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-[var(--radius-md)] border border-border bg-bg-secondary hover:shadow-sm transition-shadow",children:[e.jsxs("div",{className:"relative flex-shrink-0 rounded-full flex items-center justify-center",style:{width:40,height:40,backgroundColor:"var(--color-accent-gray)"},children:[e.jsx("span",{className:"text-white text-[length:14px] font-semibold select-none",children:t.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-bg-secondary",style:{backgroundColor:L[t.status]}})]}),e.jsxs("div",{className:"flex flex-col min-w-0 gap-0.5",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary truncate",children:t.name}),(t.currentPhase||t.currentTask)&&e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary truncate",children:[t.currentPhase,t.currentTask].filter(Boolean).join(" / ")}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:$(t.lastSeen)})]})]})}function R(){const t=c(a=>a.filteredMembers());return t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[e.jsx("span",{className:"text-text-secondary text-[length:var(--font-size-sm)]",children:"No team members found"}),e.jsxs("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:["Run ",e.jsx("code",{className:"px-1 py-0.5 bg-bg-hover rounded text-[10px]",children:"maestro team join"})," to join the team"]})]}):e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:t.map(a=>e.jsx(D,{member:a},a.uid))})}function O(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function E({entry:t}){const a=w[t.action]??"#9ca3af";return e.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-[length:var(--font-size-xs)]",style:{borderLeft:`3px solid ${a}`},children:[e.jsx("span",{className:"text-text-tertiary flex-shrink-0 tabular-nums w-12",children:O(t.ts)}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary flex-shrink-0",children:t.user}),e.jsxs("span",{className:"text-text-secondary truncate",children:[t.action,t.target?` → ${t.target}`:""]})]})}function _(){const t=c(s=>s.activity),a=d.useRef(null),r=t.slice(-100);return d.useEffect(()=>{const s=a.current;s&&(s.scrollTop=s.scrollHeight)},[r.length]),r.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity yet"})}):e.jsx("div",{ref:a,className:"flex flex-col gap-1 overflow-y-auto h-full pr-1",children:r.map(s=>e.jsx(E,{entry:s},`${s.ts}-${s.user}-${s.action}`))})}const k={high:{label:"High",color:"#dc2626",bg:"rgba(239,68,68,0.08)",border:"rgba(239,68,68,0.2)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(234,179,8,0.08)",border:"rgba(234,179,8,0.2)"},low:{label:"Low",color:"#16a34a",bg:"rgba(34,197,94,0.08)",border:"rgba(34,197,94,0.2)"},none:{label:"None",color:"var(--color-text-tertiary, #9ca3af)",bg:"var(--color-bg-secondary)",border:"var(--color-border)"}};function A(t){return k[t]??k.none}function I(){const t=c(i=>i.aggregated),a=c(i=>i.members);if(c(i=>i.loading)&&t.length===0)return e.jsxs("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2 text-text-secondary",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading analysis data..."]});if(t.length===0)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M9 21V9"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity data available for analysis"}),e.jsx("span",{className:"text-text-quaternary text-[length:var(--font-size-xs)]",children:"Activity will appear here as team members work on phases and tasks"})]});const s=t.reduce((i,m)=>i+m.count,0),o=new Set(t.flatMap(i=>i.members)).size,h=t.filter(i=>i.risk==="high").length,p=t.filter(i=>i.risk==="medium").length,x=[...t].sort((i,m)=>{const g={high:0,medium:1,low:2,none:3},v=g[i.risk]??3,u=g[m.risk]??3;return v!==u?v-u:m.count-i.count});return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(N,{label:"Total Activity",value:s}),e.jsx(N,{label:"Active Members",value:o,total:a.length}),e.jsx(N,{label:"High Risk",value:h,color:h>0?"#dc2626":void 0}),e.jsx(N,{label:"Medium Risk",value:p,color:p>0?"#ca8a04":void 0})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsx("span",{children:"Risk levels:"}),["none","low","medium","high"].map(i=>{const m=A(i);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m.color,opacity:.7}}),e.jsx("span",{children:m.label}),e.jsxs("span",{className:"text-text-quaternary",children:["(",i==="none"?"1":i==="low"?"2":i==="medium"?"3":"4+",i==="none"?" member":" members",")"]})]},i)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-secondary uppercase tracking-wider",children:"Activity Concentration"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:x.map((i,m)=>e.jsx(q,{entry:i},`${i.phase}::${i.task}::${m}`))})]})]})}function N({label:t,value:a,total:r,color:s}){return e.jsxs("div",{className:"rounded-[var(--radius-md,6px)] border border-border bg-bg-secondary px-4 py-3",children:[e.jsx("div",{className:"text-[10px] text-text-tertiary uppercase tracking-wider mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold",style:{color:s??"var(--color-text-primary)"},children:[a,r!=null&&e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-normal text-text-quaternary",children:[" / ",r]})]})]})}function q({entry:t}){const a=A(t.risk),r=t.phase||"(no phase)",s=t.task||"(general)";return e.jsxs("div",{className:"flex items-center gap-4 rounded-[var(--radius-md,6px)] px-4 py-3 border transition-colors",style:{backgroundColor:a.bg,borderColor:a.border},children:[e.jsx("div",{className:"flex flex-col items-center gap-1 shrink-0 w-[52px]",children:e.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full",style:{color:a.color,backgroundColor:`${a.color}15`},children:a.label})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-medium text-text-primary truncate",children:r}),t.task&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-quaternary",children:"/"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] text-text-secondary truncate",children:s})]})]})}),e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary",children:t.count}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:"actions"})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t.members.slice(0,5).map(o=>e.jsx("span",{className:"w-6 h-6 rounded-full bg-bg-secondary border border-border flex items-center justify-center text-[10px] font-medium text-text-secondary uppercase",title:o,children:o.charAt(0)},o)),t.members.length>5&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:["+",t.members.length-5]})]})]})}const B={init:"⚡",join:"→",leave:"←",phase_change:"◆",task_update:"●",message:"✉",sync:"↻",report:"📋",discussion:"💬"},P=[{value:"all",label:"All types"},{value:"init",label:"Init"},{value:"join",label:"Join"},{value:"phase_change",label:"Phase changes"},{value:"task_update",label:"Task updates"},{value:"message",label:"Messages"},{value:"sync",label:"Sync"}];function F(t){const a=new Date(t),r=new Date,s=new Date(r);return s.setDate(s.getDate()-1),a.toDateString()===r.toDateString()?"Today":a.toDateString()===s.toDateString()?"Yesterday":a.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}function H(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function W(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function V(t){return new Date(t).toDateString()}function U(t){switch(t){case"init":return"Initialized collaboration";case"join":return"Joined the team";case"leave":return"Left the team";case"phase_change":return"Changed phase";case"task_update":return"Updated task";case"message":return"Sent a message";case"sync":return"Synced activity";case"report":return"Generated report";case"discussion":return"Started discussion";default:return t}}function K(t){return`${w[t]??"#9ca3af"}12`}function G(){const t=c(n=>n.filteredActivity()),a=c(n=>n.members),r=c(n=>n.memberFilter),s=c(n=>n.typeFilter),o=c(n=>n.setMemberFilter),h=c(n=>n.setTypeFilter),p=c(n=>n.fetchActivity),x=c(n=>n.loading),[i,m]=d.useState(200);d.useEffect(()=>{p(i)},[p,i]);const g=d.useMemo(()=>{const n=[];let f="";for(const y of t){const j=V(y.ts);j!==f&&(f=j,n.push({day:j,label:F(y.ts),entries:[]})),n[n.length-1].entries.push(y)}return n},[t]),v=new Set(t.map(n=>n.user)).size,u=new Set(t.map(n=>n.action)).size;return x&&t.length===0?e.jsx("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading history..."}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0 pb-4",children:[e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:[e.jsx("option",{value:"all",children:"All members"}),a.map(n=>e.jsx("option",{value:n.uid,children:n.name},n.uid))]}),e.jsx("select",{value:s,onChange:n=>h(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:P.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),(r!=="all"||s!=="all")&&e.jsx("button",{type:"button",onClick:()=>{o("all"),h("all")},className:"text-[11px] text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsxs("div",{className:"ml-auto flex items-center gap-4 text-[11px] text-text-quaternary",children:[e.jsxs("span",{children:[t.length," events"]}),e.jsxs("span",{children:[v," users"]}),e.jsxs("span",{children:[u," types"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-48 gap-2",children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No events match filters"})]}):e.jsx("div",{className:"flex flex-col gap-5",children:g.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3 sticky top-0 bg-bg-primary z-10 py-1",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-primary",children:n.label}),e.jsx("div",{className:"flex-1 h-px bg-border"}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[n.entries.length," events"]})]}),e.jsx("div",{className:"relative ml-5 pl-5 border-l-2 border-border",children:e.jsx("div",{className:"flex flex-col gap-1",children:n.entries.map((f,y)=>e.jsx(J,{entry:f},`${f.ts}-${f.user}-${f.action}-${y}`))})})]},n.day))}),t.length>=i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx("button",{type:"button",onClick:()=>m(n=>n+200),className:"px-3 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all border border-border",children:"Load more"})})]})]})}function J({entry:t}){const a=w[t.action]??"#9ca3af",r=B[t.action]??"•",s=t.user.charAt(0).toUpperCase();return e.jsxs("div",{className:"relative flex items-start gap-3 py-2 group hover:bg-bg-secondary/50 rounded-r-[var(--radius-md,6px)] px-3 -ml-[21px] transition-colors",children:[e.jsx("div",{className:"absolute -left-[8px] top-[14px] w-[14px] h-[14px] rounded-full border-2 flex items-center justify-center",style:{borderColor:a,backgroundColor:"var(--color-bg-primary)"},children:e.jsx("span",{style:{fontSize:"7px",lineHeight:1,color:a},children:r})}),e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-semibold shrink-0 ml-2",style:{backgroundColor:K(t.action),color:a},children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.user}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:U(t.action)})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[t.phase_id&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:["Phase ",t.phase_id]}),t.task_id&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:t.task_id}),t.target&&e.jsx("span",{className:"text-[10px] text-text-tertiary truncate max-w-[200px]",title:t.target,children:t.target}),t.host&&e.jsxs("span",{className:"text-[10px] text-text-quaternary flex items-center gap-1",children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),t.host]})]})]}),e.jsxs("div",{className:"flex flex-col items-end shrink-0 gap-0.5",children:[e.jsx("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:H(t.ts)}),e.jsx("span",{className:"text-[10px] text-text-quaternary",children:W(t.ts)})]})]})}const Y=[{label:"Overview",key:"overview",shortcut:"1"},{label:"Analysis",key:"analysis",shortcut:"2"},{label:"History",key:"history",shortcut:"3"}],C=["overview","analysis","history"],Q={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function ae(){const t=c(l=>l.members);c(l=>l.loading);const a=c(l=>l.error),r=c(l=>l.activeTab),s=c(l=>l.fetchMembers),o=c(l=>l.fetchActivity),h=c(l=>l.fetchPresence),p=c(l=>l.fetchAggregated),x=c(l=>l.fetchPreflight),i=c(l=>l.setActiveTab),m=c(l=>l.clearAll),[g,v]=d.useState(null),[u,n]=d.useState(!0),{register:f,unregister:y}=d.useContext(z),j=d.useCallback(l=>i(C[l]),[i]);return d.useEffect(()=>{f({items:Y.map(l=>({label:l.label,icon:null,shortcut:l.shortcut})),activeIndex:C.indexOf(r),onSwitch:j})},[r,f,j]),d.useEffect(()=>()=>y(),[y]),d.useEffect(()=>{function l(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||(b.key==="1"?i("overview"):b.key==="2"?i("analysis"):b.key==="3"&&i("history"))}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),d.useEffect(()=>{let l=!1;return(async()=>{n(!0);const b=await x();l||(v(b),n(!1),b!=null&&b.exists&&(s(),o(),h(),p()))})(),()=>{l=!0,m()}},[]),u?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading..."}):g!=null&&g.exists?a&&t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-accent-red text-[length:var(--font-size-sm)]",children:"Failed to load collaboration data"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:a}),e.jsx("button",{type:"button",onClick:()=>{s(),o(),h()},className:"px-3 py-1.5 rounded-[var(--radius-md)] text-[11px] font-semibold bg-bg-secondary border border-border text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(M,{mode:"popLayout",children:e.jsxs(T.div,{className:"h-full flex flex-col overflow-hidden",variants:Q,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.15},children:[r==="overview"&&e.jsx(Z,{}),r==="analysis"&&e.jsx("div",{className:"p-4 h-full overflow-y-auto",children:e.jsx(I,{})}),r==="history"&&e.jsx("div",{className:"px-4 pt-4 pb-0 h-full flex flex-col overflow-visible",children:e.jsx(G,{})})]},r)})})}):e.jsx(X,{onRefresh:async()=>{const l=await x();v(l),l!=null&&l.exists&&(s(),o(),h(),p())}})}function X({onRefresh:t}){const a=c(x=>x.initCollab),[r,s]=d.useState(!1),[o,h]=d.useState(null);async function p(){s(!0),h(null);const x=await a();x.success?t():(h(x.error??"Unknown error"),s(!1))}return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"max-w-[480px] w-full px-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-[12px] bg-bg-secondary border border-border flex items-center justify-center mx-auto mb-4",children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-secondary",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}),e.jsx("h2",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary mb-2",children:"Team Collaboration"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-relaxed",children:"Track team activity, detect file conflicts, and coordinate phase assignments across multiple developers."})]}),e.jsx("div",{className:"border border-border rounded-[var(--radius-md,6px)] bg-bg-secondary p-4 mb-6",children:e.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:[{label:"Member presence",desc:"Online/away/offline status"},{label:"Activity feed",desc:"Real-time team actions"},{label:"Conflict detection",desc:"Overlapping file edits"},{label:"Phase coordination",desc:"Who works on what"},{label:"Activity heatmap",desc:"Concentration analysis"},{label:"Collaboration timeline",desc:"Historical view"}].map(x=>e.jsxs("div",{className:"flex items-start gap-2 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent-green mt-[7px] shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-primary font-medium",children:x.label}),e.jsx("div",{className:"text-[10px] text-text-tertiary",children:x.desc})]})]},x.label))})}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{type:"button",onClick:p,disabled:r,className:"px-5 py-2.5 rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-50",children:r?"Initializing...":"Enable Team Collaboration"}),o&&e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-accent-red mt-2",children:o}),e.jsx("p",{className:"text-[10px] text-text-quaternary mt-2",children:"Creates .workflow/collab/ and registers you as the team owner"})]})]})})}function Z(){const t=c(o=>o.members),a=c(o=>o.presence),r=a.filter(o=>o.status==="online").length,s=a.filter(o=>o.status==="away").length;return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-[length:var(--font-size-xs)]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#22c55e]"}),e.jsxs("span",{className:"text-text-secondary",children:[r," online"]})]}),s>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#eab308]"}),e.jsxs("span",{className:"text-text-secondary",children:[s," away"]})]}),e.jsxs("span",{className:"text-text-quaternary",children:[t.length," members total"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx(ee,{}),e.jsx(S,{label:"Sync Activity",command:"maestro team sync",icon:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("polyline",{points:"1 20 1 14 7 14"}),e.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),e.jsx(S,{label:"Team Status",command:"maestro team status",icon:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})})})]}),e.jsx(R,{})]}),e.jsxs("div",{className:"w-[320px] shrink-0 border-l border-border flex flex-col h-full bg-bg-primary",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"Activity"})}),e.jsx("div",{className:"flex-1 overflow-hidden px-4 py-2",children:e.jsx(_,{})})]})]})}function ee(){const t=c(u=>u.addMember),[a,r]=d.useState(!1),[s,o]=d.useState(""),[h,p]=d.useState("member"),[x,i]=d.useState(!1),[m,g]=d.useState(null);async function v(u){u.preventDefault();const n=s.trim();if(!n)return;i(!0),g(null);const f=await t(n,"",h);i(!1),f.success?(o(""),p("member"),r(!1)):g(f.error??"Failed to add member")}return a?e.jsxs("form",{onSubmit:v,className:"flex items-center gap-1.5",children:[e.jsx("input",{autoFocus:!0,value:s,onChange:u=>o(u.target.value),placeholder:"Name",className:"w-[120px] px-2 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-primary placeholder:text-text-quaternary outline-none focus:border-text-tertiary"}),e.jsxs("select",{value:h,onChange:u=>p(u.target.value),className:"px-1.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-secondary outline-none",children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"viewer",children:"Viewer"})]}),e.jsx("button",{type:"submit",disabled:x||!s.trim(),className:"px-2.5 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-40",children:x?"...":"Add"}),e.jsx("button",{type:"button",onClick:()=>{r(!1),g(null)},className:"px-1.5 py-1.5 text-[11px] text-text-tertiary hover:text-text-primary",children:"Cancel"}),m&&e.jsx("span",{className:"text-[10px] text-accent-red",children:m})]}):e.jsxs("button",{type:"button",onClick:()=>r(!0),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"8.5",cy:"7",r:"4"}),e.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"14"}),e.jsx("line",{x1:"23",y1:"11",x2:"17",y2:"11"})]})}),e.jsx("span",{children:"Add Member"})]})}function S({label:t,command:a,icon:r}){const[s,o]=d.useState(!1);return e.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),1500)},title:`Copy: ${a}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:r}),e.jsx("span",{children:s?"Copied!":t})]})}export{ae as CollabPage};
1
+ import{j as e,ai as L,aj as c,ak as w,r as d,V as z}from"./index-DQIlX2w_.js";import{A as M}from"./index-BL4h1OKY.js";import{m as T}from"./proxy-CcYyZZWI.js";function $(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function D({member:t}){return e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-[var(--radius-md)] border border-border bg-bg-secondary hover:shadow-sm transition-shadow",children:[e.jsxs("div",{className:"relative flex-shrink-0 rounded-full flex items-center justify-center",style:{width:40,height:40,backgroundColor:"var(--color-accent-gray)"},children:[e.jsx("span",{className:"text-white text-[length:14px] font-semibold select-none",children:t.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-bg-secondary",style:{backgroundColor:L[t.status]}})]}),e.jsxs("div",{className:"flex flex-col min-w-0 gap-0.5",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-[var(--font-weight-medium)] text-text-primary truncate",children:t.name}),(t.currentPhase||t.currentTask)&&e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-tertiary truncate",children:[t.currentPhase,t.currentTask].filter(Boolean).join(" / ")}),e.jsx("span",{className:"text-[length:10px] text-text-tertiary",children:$(t.lastSeen)})]})]})}function R(){const t=c(a=>a.filteredMembers());return t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[e.jsx("span",{className:"text-text-secondary text-[length:var(--font-size-sm)]",children:"No team members found"}),e.jsxs("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:["Run ",e.jsx("code",{className:"px-1 py-0.5 bg-bg-hover rounded text-[10px]",children:"maestro team join"})," to join the team"]})]}):e.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))"},children:t.map(a=>e.jsx(D,{member:a},a.uid))})}function O(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function E({entry:t}){const a=w[t.action]??"#9ca3af";return e.jsxs("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-[length:var(--font-size-xs)]",style:{borderLeft:`3px solid ${a}`},children:[e.jsx("span",{className:"text-text-tertiary flex-shrink-0 tabular-nums w-12",children:O(t.ts)}),e.jsx("span",{className:"font-[var(--font-weight-medium)] text-text-primary flex-shrink-0",children:t.user}),e.jsxs("span",{className:"text-text-secondary truncate",children:[t.action,t.target?` → ${t.target}`:""]})]})}function _(){const t=c(s=>s.activity),a=d.useRef(null),r=t.slice(-100);return d.useEffect(()=>{const s=a.current;s&&(s.scrollTop=s.scrollHeight)},[r.length]),r.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity yet"})}):e.jsx("div",{ref:a,className:"flex flex-col gap-1 overflow-y-auto h-full pr-1",children:r.map(s=>e.jsx(E,{entry:s},`${s.ts}-${s.user}-${s.action}`))})}const k={high:{label:"High",color:"#dc2626",bg:"rgba(239,68,68,0.08)",border:"rgba(239,68,68,0.2)"},medium:{label:"Medium",color:"#ca8a04",bg:"rgba(234,179,8,0.08)",border:"rgba(234,179,8,0.2)"},low:{label:"Low",color:"#16a34a",bg:"rgba(34,197,94,0.08)",border:"rgba(34,197,94,0.2)"},none:{label:"None",color:"var(--color-text-tertiary, #9ca3af)",bg:"var(--color-bg-secondary)",border:"var(--color-border)"}};function A(t){return k[t]??k.none}function I(){const t=c(i=>i.aggregated),a=c(i=>i.members);if(c(i=>i.loading)&&t.length===0)return e.jsxs("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:[e.jsxs("svg",{className:"animate-spin h-5 w-5 mr-2 text-text-secondary",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading analysis data..."]});if(t.length===0)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-3",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18"}),e.jsx("path",{d:"M9 21V9"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No activity data available for analysis"}),e.jsx("span",{className:"text-text-quaternary text-[length:var(--font-size-xs)]",children:"Activity will appear here as team members work on phases and tasks"})]});const s=t.reduce((i,m)=>i+m.count,0),o=new Set(t.flatMap(i=>i.members)).size,h=t.filter(i=>i.risk==="high").length,p=t.filter(i=>i.risk==="medium").length,x=[...t].sort((i,m)=>{const g={high:0,medium:1,low:2,none:3},v=g[i.risk]??3,u=g[m.risk]??3;return v!==u?v-u:m.count-i.count});return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsx(N,{label:"Total Activity",value:s}),e.jsx(N,{label:"Active Members",value:o,total:a.length}),e.jsx(N,{label:"High Risk",value:h,color:h>0?"#dc2626":void 0}),e.jsx(N,{label:"Medium Risk",value:p,color:p>0?"#ca8a04":void 0})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[length:var(--font-size-xs)] text-text-tertiary",children:[e.jsx("span",{children:"Risk levels:"}),["none","low","medium","high"].map(i=>{const m=A(i);return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-sm",style:{backgroundColor:m.color,opacity:.7}}),e.jsx("span",{children:m.label}),e.jsxs("span",{className:"text-text-quaternary",children:["(",i==="none"?"1":i==="low"?"2":i==="medium"?"3":"4+",i==="none"?" member":" members",")"]})]},i)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h3",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-secondary uppercase tracking-wider",children:"Activity Concentration"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:x.map((i,m)=>e.jsx(q,{entry:i},`${i.phase}::${i.task}::${m}`))})]})]})}function N({label:t,value:a,total:r,color:s}){return e.jsxs("div",{className:"rounded-[var(--radius-md,6px)] border border-border bg-bg-secondary px-4 py-3",children:[e.jsx("div",{className:"text-[10px] text-text-tertiary uppercase tracking-wider mb-1",children:t}),e.jsxs("div",{className:"text-[length:var(--font-size-xl)] font-bold",style:{color:s??"var(--color-text-primary)"},children:[a,r!=null&&e.jsxs("span",{className:"text-[length:var(--font-size-sm)] font-normal text-text-quaternary",children:[" / ",r]})]})]})}function q({entry:t}){const a=A(t.risk),r=t.phase||"(no phase)",s=t.task||"(general)";return e.jsxs("div",{className:"flex items-center gap-4 rounded-[var(--radius-md,6px)] px-4 py-3 border transition-colors",style:{backgroundColor:a.bg,borderColor:a.border},children:[e.jsx("div",{className:"flex flex-col items-center gap-1 shrink-0 w-[52px]",children:e.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full",style:{color:a.color,backgroundColor:`${a.color}15`},children:a.label})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-medium text-text-primary truncate",children:r}),t.task&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-quaternary",children:"/"}),e.jsx("span",{className:"text-[length:var(--font-size-sm)] text-text-secondary truncate",children:s})]})]})}),e.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-bold text-text-primary",children:t.count}),e.jsx("span",{className:"text-[10px] text-text-tertiary",children:"actions"})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[t.members.slice(0,5).map(o=>e.jsx("span",{className:"w-6 h-6 rounded-full bg-bg-secondary border border-border flex items-center justify-center text-[10px] font-medium text-text-secondary uppercase",title:o,children:o.charAt(0)},o)),t.members.length>5&&e.jsxs("span",{className:"text-[10px] text-text-tertiary",children:["+",t.members.length-5]})]})]})}const B={init:"⚡",join:"→",leave:"←",phase_change:"◆",task_update:"●",message:"✉",sync:"↻",report:"📋",discussion:"💬"},P=[{value:"all",label:"All types"},{value:"init",label:"Init"},{value:"join",label:"Join"},{value:"phase_change",label:"Phase changes"},{value:"task_update",label:"Task updates"},{value:"message",label:"Messages"},{value:"sync",label:"Sync"}];function F(t){const a=new Date(t),r=new Date,s=new Date(r);return s.setDate(s.getDate()-1),a.toDateString()===r.toDateString()?"Today":a.toDateString()===s.toDateString()?"Yesterday":a.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"})}function H(t){return new Date(t).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function W(t){const a=Date.now()-new Date(t).getTime(),r=Math.floor(a/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function V(t){return new Date(t).toDateString()}function U(t){switch(t){case"init":return"Initialized collaboration";case"join":return"Joined the team";case"leave":return"Left the team";case"phase_change":return"Changed phase";case"task_update":return"Updated task";case"message":return"Sent a message";case"sync":return"Synced activity";case"report":return"Generated report";case"discussion":return"Started discussion";default:return t}}function K(t){return`${w[t]??"#9ca3af"}12`}function G(){const t=c(n=>n.filteredActivity()),a=c(n=>n.members),r=c(n=>n.memberFilter),s=c(n=>n.typeFilter),o=c(n=>n.setMemberFilter),h=c(n=>n.setTypeFilter),p=c(n=>n.fetchActivity),x=c(n=>n.loading),[i,m]=d.useState(200);d.useEffect(()=>{p(i)},[p,i]);const g=d.useMemo(()=>{const n=[];let f="";for(const y of t){const j=V(y.ts);j!==f&&(f=j,n.push({day:j,label:F(y.ts),entries:[]})),n[n.length-1].entries.push(y)}return n},[t]),v=new Set(t.map(n=>n.user)).size,u=new Set(t.map(n=>n.action)).size;return x&&t.length===0?e.jsx("div",{className:"flex items-center justify-center h-64 text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading history..."}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0 pb-4",children:[e.jsxs("select",{value:r,onChange:n=>o(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:[e.jsx("option",{value:"all",children:"All members"}),a.map(n=>e.jsx("option",{value:n.uid,children:n.name},n.uid))]}),e.jsx("select",{value:s,onChange:n=>h(n.target.value),className:"text-[length:var(--font-size-xs)] px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-text-primary outline-none focus:border-text-tertiary",children:P.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),(r!=="all"||s!=="all")&&e.jsx("button",{type:"button",onClick:()=>{o("all"),h("all")},className:"text-[11px] text-text-tertiary hover:text-text-primary transition-colors",children:"Clear"}),e.jsxs("div",{className:"ml-auto flex items-center gap-4 text-[11px] text-text-quaternary",children:[e.jsxs("span",{children:[t.length," events"]}),e.jsxs("span",{children:[v," users"]}),e.jsxs("span",{children:[u," types"]})]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-48 gap-2",children:[e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-quaternary",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("polyline",{points:"12 6 12 12 16 14"})]}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-sm)]",children:"No events match filters"})]}):e.jsx("div",{className:"flex flex-col gap-5",children:g.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3 sticky top-0 bg-bg-primary z-10 py-1",children:[e.jsx("span",{className:"text-[length:var(--font-size-xs)] font-semibold text-text-primary",children:n.label}),e.jsx("div",{className:"flex-1 h-px bg-border"}),e.jsxs("span",{className:"text-[10px] text-text-quaternary",children:[n.entries.length," events"]})]}),e.jsx("div",{className:"relative ml-5 pl-5 border-l-2 border-border",children:e.jsx("div",{className:"flex flex-col gap-1",children:n.entries.map((f,y)=>e.jsx(J,{entry:f},`${f.ts}-${f.user}-${f.action}-${y}`))})})]},n.day))}),t.length>=i&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx("button",{type:"button",onClick:()=>m(n=>n+200),className:"px-3 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold text-text-secondary hover:text-text-primary transition-all border border-border",children:"Load more"})})]})]})}function J({entry:t}){const a=w[t.action]??"#9ca3af",r=B[t.action]??"•",s=t.user.charAt(0).toUpperCase();return e.jsxs("div",{className:"relative flex items-start gap-3 py-2 group hover:bg-bg-secondary/50 rounded-r-[var(--radius-md,6px)] px-3 -ml-[21px] transition-colors",children:[e.jsx("div",{className:"absolute -left-[8px] top-[14px] w-[14px] h-[14px] rounded-full border-2 flex items-center justify-center",style:{borderColor:a,backgroundColor:"var(--color-bg-primary)"},children:e.jsx("span",{style:{fontSize:"7px",lineHeight:1,color:a},children:r})}),e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-[11px] font-semibold shrink-0 ml-2",style:{backgroundColor:K(t.action),color:a},children:s}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:t.user}),e.jsx("span",{className:"text-[length:var(--font-size-xs)] text-text-secondary",children:U(t.action)})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-0.5",children:[t.phase_id&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:["Phase ",t.phase_id]}),t.task_id&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-secondary border border-border text-text-tertiary",children:t.task_id}),t.target&&e.jsx("span",{className:"text-[10px] text-text-tertiary truncate max-w-[200px]",title:t.target,children:t.target}),t.host&&e.jsxs("span",{className:"text-[10px] text-text-quaternary flex items-center gap-1",children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]}),t.host]})]})]}),e.jsxs("div",{className:"flex flex-col items-end shrink-0 gap-0.5",children:[e.jsx("span",{className:"text-[11px] text-text-tertiary tabular-nums",children:H(t.ts)}),e.jsx("span",{className:"text-[10px] text-text-quaternary",children:W(t.ts)})]})]})}const Y=[{label:"Overview",key:"overview",shortcut:"1"},{label:"Analysis",key:"analysis",shortcut:"2"},{label:"History",key:"history",shortcut:"3"}],C=["overview","analysis","history"],Q={initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8}};function ae(){const t=c(l=>l.members);c(l=>l.loading);const a=c(l=>l.error),r=c(l=>l.activeTab),s=c(l=>l.fetchMembers),o=c(l=>l.fetchActivity),h=c(l=>l.fetchPresence),p=c(l=>l.fetchAggregated),x=c(l=>l.fetchPreflight),i=c(l=>l.setActiveTab),m=c(l=>l.clearAll),[g,v]=d.useState(null),[u,n]=d.useState(!0),{register:f,unregister:y}=d.useContext(z),j=d.useCallback(l=>i(C[l]),[i]);return d.useEffect(()=>{f({items:Y.map(l=>({label:l.label,icon:null,shortcut:l.shortcut})),activeIndex:C.indexOf(r),onSwitch:j})},[r,f,j]),d.useEffect(()=>()=>y(),[y]),d.useEffect(()=>{function l(b){b.target instanceof HTMLInputElement||b.target instanceof HTMLTextAreaElement||(b.key==="1"?i("overview"):b.key==="2"?i("analysis"):b.key==="3"&&i("history"))}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),d.useEffect(()=>{let l=!1;return(async()=>{n(!0);const b=await x();l||(v(b),n(!1),b!=null&&b.exists&&(s(),o(),h(),p()))})(),()=>{l=!0,m()}},[]),u?e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-sm)]",children:"Loading..."}):g!=null&&g.exists?a&&t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[e.jsx("span",{className:"text-accent-red text-[length:var(--font-size-sm)]",children:"Failed to load collaboration data"}),e.jsx("span",{className:"text-text-tertiary text-[length:var(--font-size-xs)]",children:a}),e.jsx("button",{type:"button",onClick:()=>{s(),o(),h()},className:"px-3 py-1.5 rounded-[var(--radius-md)] text-[11px] font-semibold bg-bg-secondary border border-border text-text-secondary hover:text-text-primary transition-all",children:"Retry"})]}):e.jsx("div",{className:"flex flex-col h-full overflow-hidden",children:e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(M,{mode:"popLayout",children:e.jsxs(T.div,{className:"h-full flex flex-col overflow-hidden",variants:Q,initial:"initial",animate:"animate",exit:"exit",transition:{duration:.15},children:[r==="overview"&&e.jsx(Z,{}),r==="analysis"&&e.jsx("div",{className:"p-4 h-full overflow-y-auto",children:e.jsx(I,{})}),r==="history"&&e.jsx("div",{className:"px-4 pt-4 pb-0 h-full flex flex-col overflow-visible",children:e.jsx(G,{})})]},r)})})}):e.jsx(X,{onRefresh:async()=>{const l=await x();v(l),l!=null&&l.exists&&(s(),o(),h(),p())}})}function X({onRefresh:t}){const a=c(x=>x.initCollab),[r,s]=d.useState(!1),[o,h]=d.useState(null);async function p(){s(!0),h(null);const x=await a();x.success?t():(h(x.error??"Unknown error"),s(!1))}return e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"max-w-[480px] w-full px-6",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-[12px] bg-bg-secondary border border-border flex items-center justify-center mx-auto mb-4",children:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-text-secondary",children:[e.jsx("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"9",cy:"7",r:"4"}),e.jsx("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),e.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})}),e.jsx("h2",{className:"text-[length:var(--font-size-xl)] font-bold text-text-primary mb-2",children:"Team Collaboration"}),e.jsx("p",{className:"text-[length:var(--font-size-sm)] text-text-secondary leading-relaxed",children:"Track team activity, detect file conflicts, and coordinate phase assignments across multiple developers."})]}),e.jsx("div",{className:"border border-border rounded-[var(--radius-md,6px)] bg-bg-secondary p-4 mb-6",children:e.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:[{label:"Member presence",desc:"Online/away/offline status"},{label:"Activity feed",desc:"Real-time team actions"},{label:"Conflict detection",desc:"Overlapping file edits"},{label:"Phase coordination",desc:"Who works on what"},{label:"Activity heatmap",desc:"Concentration analysis"},{label:"Collaboration timeline",desc:"Historical view"}].map(x=>e.jsxs("div",{className:"flex items-start gap-2 py-1",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-accent-green mt-[7px] shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[length:var(--font-size-xs)] text-text-primary font-medium",children:x.label}),e.jsx("div",{className:"text-[10px] text-text-tertiary",children:x.desc})]})]},x.label))})}),e.jsxs("div",{className:"text-center",children:[e.jsx("button",{type:"button",onClick:p,disabled:r,className:"px-5 py-2.5 rounded-[var(--radius-md,6px)] text-[length:var(--font-size-sm)] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-50",children:r?"Initializing...":"Enable Team Collaboration"}),o&&e.jsx("p",{className:"text-[length:var(--font-size-xs)] text-accent-red mt-2",children:o}),e.jsx("p",{className:"text-[10px] text-text-quaternary mt-2",children:"Creates .workflow/collab/ and registers you as the team owner"})]})]})})}function Z(){const t=c(o=>o.members),a=c(o=>o.presence),r=a.filter(o=>o.status==="online").length,s=a.filter(o=>o.status==="away").length;return e.jsxs("div",{className:"flex h-full overflow-hidden",children:[e.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto p-4",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 text-[length:var(--font-size-xs)]",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#22c55e]"}),e.jsxs("span",{className:"text-text-secondary",children:[r," online"]})]}),s>0&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-[#eab308]"}),e.jsxs("span",{className:"text-text-secondary",children:[s," away"]})]}),e.jsxs("span",{className:"text-text-quaternary",children:[t.length," members total"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[e.jsx(ee,{}),e.jsx(S,{label:"Sync Activity",command:"maestro team sync",icon:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("polyline",{points:"1 20 1 14 7 14"}),e.jsx("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),e.jsx(S,{label:"Team Status",command:"maestro team status",icon:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 12h-4l-3 9L9 3l-3 9H2"})})})]}),e.jsx(R,{})]}),e.jsxs("div",{className:"w-[320px] shrink-0 border-l border-border flex flex-col h-full bg-bg-primary",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-[length:var(--font-size-sm)] font-semibold text-text-primary",children:"Activity"})}),e.jsx("div",{className:"flex-1 overflow-hidden px-4 py-2",children:e.jsx(_,{})})]})]})}function ee(){const t=c(u=>u.addMember),[a,r]=d.useState(!1),[s,o]=d.useState(""),[h,p]=d.useState("member"),[x,i]=d.useState(!1),[m,g]=d.useState(null);async function v(u){u.preventDefault();const n=s.trim();if(!n)return;i(!0),g(null);const f=await t(n,"",h);i(!1),f.success?(o(""),p("member"),r(!1)):g(f.error??"Failed to add member")}return a?e.jsxs("form",{onSubmit:v,className:"flex items-center gap-1.5",children:[e.jsx("input",{autoFocus:!0,value:s,onChange:u=>o(u.target.value),placeholder:"Name",className:"w-[120px] px-2 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-primary placeholder:text-text-quaternary outline-none focus:border-text-tertiary"}),e.jsxs("select",{value:h,onChange:u=>p(u.target.value),className:"px-1.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] text-text-secondary outline-none",children:[e.jsx("option",{value:"member",children:"Member"}),e.jsx("option",{value:"admin",children:"Admin"}),e.jsx("option",{value:"viewer",children:"Viewer"})]}),e.jsx("button",{type:"submit",disabled:x||!s.trim(),className:"px-2.5 py-1.5 rounded-[var(--radius-md,6px)] text-[11px] font-semibold bg-text-primary text-bg-primary hover:opacity-90 transition-opacity disabled:opacity-40",children:x?"...":"Add"}),e.jsx("button",{type:"button",onClick:()=>{r(!1),g(null)},className:"px-1.5 py-1.5 text-[11px] text-text-tertiary hover:text-text-primary",children:"Cancel"}),m&&e.jsx("span",{className:"text-[10px] text-accent-red",children:m})]}):e.jsxs("button",{type:"button",onClick:()=>r(!0),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),e.jsx("circle",{cx:"8.5",cy:"7",r:"4"}),e.jsx("line",{x1:"20",y1:"8",x2:"20",y2:"14"}),e.jsx("line",{x1:"23",y1:"11",x2:"17",y2:"11"})]})}),e.jsx("span",{children:"Add Member"})]})}function S({label:t,command:a,icon:r}){const[s,o]=d.useState(!1);return e.jsxs("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(a),o(!0),setTimeout(()=>o(!1),1500)},title:`Copy: ${a}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-[var(--radius-md,6px)] border border-border bg-bg-primary text-[11px] font-medium text-text-secondary hover:text-text-primary hover:bg-bg-secondary transition-all",children:[e.jsx("span",{className:"text-text-tertiary",children:r}),e.jsx("span",{children:s?"Copied!":t})]})}export{ae as CollabPage};
@@ -1 +1 @@
1
- import{b as c,k as l,j as e}from"./index-DpcPd-UG.js";function d(){const i=c(s=>s.slots),a=c(s=>s.supervisorStatus),t=l(s=>s.processes),n=Object.values(i),r=Object.values(t).filter(s=>s.status==="running");return e.jsxs("div",{className:"h-full overflow-y-auto p-[var(--spacing-2)] text-[11px]",children:[a&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsx("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:"Supervisor"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary",children:[e.jsx("span",{className:["w-[6px] h-[6px] rounded-full shrink-0",a.enabled?"bg-status-completed":"bg-text-secondary/40"].join(" ")}),e.jsx("span",{children:a.enabled?"Active":"Paused"}),a.lastTickAt&&e.jsxs("span",{className:"ml-auto text-text-secondary/60",children:["Last tick: ",x(a.lastTickAt)]})]})]}),a&&a.running.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Running (",a.running.length,")"]}),a.running.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsxs("span",{className:"ml-auto",children:["Turn ",s.turnNumber,"/",s.maxTurns]})]},s.processId))]}),n.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Execution Slots (",n.length,")"]}),n.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsx("span",{className:"ml-auto",children:s.executor})]},s.processId))]}),r.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Active Agents (",r.length,")"]}),r.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.type}),e.jsx("span",{className:"ml-auto",children:s.status})]},s.id))]}),n.length===0&&r.length===0&&!a&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-xs)]",children:"No active executions."})]})}function x(i){const a=new Date(i).getTime(),t=Date.now()-a;return isNaN(t)?"":t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(a).toLocaleTimeString("en-US",{hour12:!1})}export{d as ExecutionPanel};
1
+ import{b as c,k as l,j as e}from"./index-DQIlX2w_.js";function d(){const i=c(s=>s.slots),a=c(s=>s.supervisorStatus),t=l(s=>s.processes),n=Object.values(i),r=Object.values(t).filter(s=>s.status==="running");return e.jsxs("div",{className:"h-full overflow-y-auto p-[var(--spacing-2)] text-[11px]",children:[a&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsx("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:"Supervisor"}),e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary",children:[e.jsx("span",{className:["w-[6px] h-[6px] rounded-full shrink-0",a.enabled?"bg-status-completed":"bg-text-secondary/40"].join(" ")}),e.jsx("span",{children:a.enabled?"Active":"Paused"}),a.lastTickAt&&e.jsxs("span",{className:"ml-auto text-text-secondary/60",children:["Last tick: ",x(a.lastTickAt)]})]})]}),a&&a.running.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Running (",a.running.length,")"]}),a.running.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsxs("span",{className:"ml-auto",children:["Turn ",s.turnNumber,"/",s.maxTurns]})]},s.processId))]}),n.length>0&&e.jsxs("div",{className:"mb-[var(--spacing-2)] pb-[var(--spacing-2)] border-b border-border",children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Execution Slots (",n.length,")"]}),n.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.issueId}),e.jsx("span",{className:"ml-auto",children:s.executor})]},s.processId))]}),r.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"font-medium text-text-primary mb-[var(--spacing-1)]",children:["Active Agents (",r.length,")"]}),r.map(s=>e.jsxs("div",{className:"flex items-center gap-[var(--spacing-2)] text-text-secondary py-[var(--spacing-0-5)]",children:[e.jsx("span",{className:"w-[6px] h-[6px] rounded-full shrink-0 bg-status-exploring animate-pulse"}),e.jsx("span",{className:"truncate",children:s.type}),e.jsx("span",{className:"ml-auto",children:s.status})]},s.id))]}),n.length===0&&r.length===0&&!a&&e.jsx("div",{className:"flex items-center justify-center h-full text-text-secondary text-[length:var(--font-size-xs)]",children:"No active executions."})]})}function x(i){const a=new Date(i).getTime(),t=Date.now()-a;return isNaN(t)?"":t<1e3?"just now":t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:new Date(a).toLocaleTimeString("en-US",{hour12:!1})}export{d as ExecutionPanel};