@wjarka/cezarion 0.18.0-dev.7405 → 0.18.0-dev.7412

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 (85) hide show
  1. package/package.json +2 -2
  2. package/web/dist/assets/activity-motion-CjiZJB7H.js +2 -0
  3. package/web/dist/assets/activity-route-1W0U2NqM.js +1 -0
  4. package/web/dist/assets/{agent-accounts-0EKsrgdJ.js → agent-accounts-DJbSC2sB.js} +1 -1
  5. package/web/dist/assets/attention-BdI3xSwD.js +1 -0
  6. package/web/dist/assets/button-RJMdCnZw.js +3 -0
  7. package/web/dist/assets/centered-state-dmABwupF.js +1 -0
  8. package/web/dist/assets/{cez-idle-DreV5r0B.js → cez-idle-CKE0WtrH.js} +1 -1
  9. package/web/dist/assets/commit-diff-panel-DkvsBvlr.js +1 -0
  10. package/web/dist/assets/dialog-7Mg2IZCP.js +1 -0
  11. package/web/dist/assets/diff-BCSgE1l6.js +3 -0
  12. package/web/dist/assets/diff-controls-BpQyN23g.js +1 -0
  13. package/web/dist/assets/{diff-view-Ch_cdfcV.js → diff-view-B3eMq9Uw.js} +5 -5
  14. package/web/dist/assets/{dist-CwBtGUlU.js → dist-FHKv_Ysh.js} +1 -1
  15. package/web/dist/assets/dropdown-menu-Cr9RsmWG.js +1 -0
  16. package/web/dist/assets/es2015-VrVcR1vD.js +41 -0
  17. package/web/dist/assets/file-preview-BIHQ0YTn.js +2 -0
  18. package/web/dist/assets/git-toolbar-BtU7xtmD.js +1 -0
  19. package/web/dist/assets/github-INQcTy36.js +1 -0
  20. package/web/dist/assets/{global-activity-route-DVSxx-ha.js → global-activity-route-B3-2eIFG.js} +1 -1
  21. package/web/dist/assets/{image-preview-cn57tA1m.js → image-preview-BmcpjY75.js} +1 -1
  22. package/web/dist/assets/index-DUuc-42H.js +14 -0
  23. package/web/dist/assets/{live-protocol-kUxhOnN1.js → live-protocol-B5jzpJgG.js} +1 -1
  24. package/web/dist/assets/markdown-DcRzCfVU.js +4 -0
  25. package/web/dist/assets/{nav-row-styles-DSBuSnEE.js → nav-row-styles-D4xk5Osn.js} +1 -1
  26. package/web/dist/assets/picker-pill-x0hXGTLP.js +15 -0
  27. package/web/dist/assets/preview-pane-connected-CCHDk6rz.js +3 -0
  28. package/web/dist/assets/project-router-_V9XDi3p.js +1 -0
  29. package/web/dist/assets/project-scope-context-VENshCVj.js +4 -0
  30. package/web/dist/assets/{prompt-template-menu-i7FXpDOj.js → prompt-template-menu-C60uqznw.js} +1 -1
  31. package/web/dist/assets/{queries-B4jd0jVr.js → queries-r1Fc1fWN.js} +1 -1
  32. package/web/dist/assets/reference-chip-GElOouoU.js +1 -0
  33. package/web/dist/assets/repo-git-B09hWAxY.js +1 -0
  34. package/web/dist/assets/{report-reader-B1yQJCNt.js → report-reader-y4t2Prir.js} +1 -1
  35. package/web/dist/assets/reports-BU3a_4kU.js +1 -0
  36. package/web/dist/assets/run-header-BZukpHEK.js +2 -0
  37. package/web/dist/assets/skills-C6V0Yo95.js +1 -0
  38. package/web/dist/assets/{tab-link-Bc-CvRBn.js → tab-link-CuL027Wh.js} +1 -1
  39. package/web/dist/assets/{task-changes-DIU2Co-H.js → task-changes-Dx9OTRkk.js} +1 -1
  40. package/web/dist/assets/{task-commits-Cccn7xrR.js → task-commits-ClWR4wQR.js} +1 -1
  41. package/web/dist/assets/{task-files-C-66-xPc.js → task-files-DCkrdsrz.js} +1 -1
  42. package/web/dist/assets/{task-github-item-5mF5DxKm.js → task-github-item-C3D4vDw7.js} +1 -1
  43. package/web/dist/assets/task-thread-D0sTMg9h.js +9 -0
  44. package/web/dist/assets/thread-state-BHSYtS79.js +4 -0
  45. package/web/dist/assets/{toaster-CoMJoQvk.js → toaster-BWMQArHJ.js} +1 -1
  46. package/web/dist/assets/use-desktop-BnWAyH1e.js +1 -0
  47. package/web/dist/assets/use-hand-to-agent-state-VmvgZIh6.js +1 -0
  48. package/web/dist/assets/{useInfiniteQuery-DBV7oz3w.js → useInfiniteQuery-DbCUWSLK.js} +1 -1
  49. package/web/dist/assets/useQuery-CxWGWuW4.js +1 -0
  50. package/web/dist/assets/{workflows-C1kx7nsU.js → workflows-B_HWC2FT.js} +3 -3
  51. package/web/dist/assets/{ws-D6M4b5Tw.js → ws-jytXIi1s.js} +1 -1
  52. package/web/dist/assets/zoomable-image-DefjK4q5.js +1 -0
  53. package/web/dist/index.html +23 -23
  54. package/web/dist/live-worker.js +1 -1
  55. package/web/dist/assets/activity-motion-W7LQQzqR.js +0 -2
  56. package/web/dist/assets/activity-route-b-zH6KX6.js +0 -1
  57. package/web/dist/assets/attention-CvRtkmnP.js +0 -1
  58. package/web/dist/assets/button-DGwhwRuD.js +0 -3
  59. package/web/dist/assets/centered-state-B5QmAy2y.js +0 -1
  60. package/web/dist/assets/commit-diff-panel-BBZZbVgE.js +0 -1
  61. package/web/dist/assets/dialog-tMSuX5a7.js +0 -1
  62. package/web/dist/assets/diff-CkqVFsT7.js +0 -3
  63. package/web/dist/assets/diff-controls-fOOHkbPK.js +0 -1
  64. package/web/dist/assets/dropdown-menu-CzUYjvx4.js +0 -1
  65. package/web/dist/assets/es2015-DTn4s5Lh.js +0 -41
  66. package/web/dist/assets/file-preview-0T9fzXJY.js +0 -2
  67. package/web/dist/assets/git-toolbar-Ccpg_TKe.js +0 -1
  68. package/web/dist/assets/github-CPJXTYE-.js +0 -1
  69. package/web/dist/assets/index-FZIxXka9.js +0 -14
  70. package/web/dist/assets/markdown-BldkAL5N.js +0 -4
  71. package/web/dist/assets/picker-pill-DN0WFWoS.js +0 -15
  72. package/web/dist/assets/preview-pane-connected-xrHDiOdF.js +0 -3
  73. package/web/dist/assets/project-router-BVp1TVVP.js +0 -1
  74. package/web/dist/assets/project-scope-context-DSlnqjT3.js +0 -4
  75. package/web/dist/assets/reference-chip-DeYsiLdM.js +0 -1
  76. package/web/dist/assets/repo-git-BzPaI8dr.js +0 -1
  77. package/web/dist/assets/reports-DeRPb5Oo.js +0 -1
  78. package/web/dist/assets/run-header-DGZHSrbt.js +0 -2
  79. package/web/dist/assets/skills-2ng-kCCS.js +0 -1
  80. package/web/dist/assets/task-thread-B_AnobAW.js +0 -9
  81. package/web/dist/assets/thread-state-DQJxLYUo.js +0 -4
  82. package/web/dist/assets/use-desktop-CPzO9ufG.js +0 -1
  83. package/web/dist/assets/use-hand-to-agent-state-ClzuNnhO.js +0 -1
  84. package/web/dist/assets/useQuery-DqWzagrg.js +0 -1
  85. package/web/dist/assets/zoomable-image-C7mEDZaS.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i,l as a,s as o,u as s}from"./button-RJMdCnZw.js";import{c,m as l,u}from"./design-icons-B6-0w7Aw.js";import{a as d,c as f,d as p,f as m,g as h,h as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,t as w,u as T}from"./es2015-VrVcR1vD.js";var E=e(t(),1),D=r();function O(e){let t=e+`CollectionProvider`,[n,r]=y(t),[a,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=E.useRef(null),i=E.useRef(new Map).current;return(0,D.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=t;let l=e+`CollectionSlot`,u=i(l),d=E.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(t,s(l,n).collectionRef);return(0,D.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=i(f),h=E.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=E.useRef(null),c=o(t,a),l=s(f,n);return E.useEffect(()=>(l.itemMap.set(a,{ref:a,...i}),()=>void l.itemMap.delete(a))),(0,D.jsx)(m,{[p]:``,ref:c,children:r})});h.displayName=f;function g(t){let n=s(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:c,Slot:d,ItemSlot:h},g,r]}var k=E.createContext(void 0);function A(e){let t=E.useContext(k);return e||t||`ltr`}var j=e(n(),1);function M(e){let[t,n]=E.useState(void 0);return m(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var N=[`top`,`right`,`bottom`,`left`],P=Math.min,F=Math.max,I=Math.round,L=Math.floor,R=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z(e,t,n){return F(e,P(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function H(e){return e.split(`-`)[1]}function te(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return te(U(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=H(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=H(e),a=de(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=V(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=re(t),s=ne(o),c=V(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=H(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=B(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=B(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=P(d[_],T),D=P(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=z(E,k,O),j=!c.arrow&&H(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=U(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==U(t))||T.every(e=>U(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=U(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return N.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=B(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=H(n),c=U(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=B(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=B(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(i),p=te(f),m=u[p],h=u[f],g=(e,t)=>z(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=B(e,t),u={x:n,y:r},d=U(i),f=te(d),p=u[f],m=u[d],h=B(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(V(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=B(e,t),c=await i.detectOverflow(t,s),l=V(n),u=H(n),d=U(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=P(p-c[m],g),y=P(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*F(c.left,c.right):S=p-2*F(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return Me()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return Me()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,J=e=>!!e&&e!==`none`,Ve;function He(e){let t=K(e)?Y(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!We()&&(J(t.backdropFilter)||J(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=qe(e);for(;q(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=qe(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function Y(e){return W(e).getComputedStyle(e)}function Ke(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||G(e);return Fe(t)?t.host:t}function Je(e){let t=qe(e);return Ge(t)?(e.ownerDocument||e).body:q(t)&&Ie(t)?t:Je(t)}function Ye(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Je(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Xe(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Ye(e):[])}else return t.concat(r,Ye(r,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ze(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=I(n)!==a||I(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qe(e){return K(e)?e:e.contextElement}function $e(e){let t=Qe(e);if(!q(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ze(t),o=(a?I(n.width):n.width)/r,s=(a?I(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var et=R(0);function tt(e){let t=W(e);return!We()||!t.visualViewport?et:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===W(e)}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qe(e),o=R(1);t&&(r?K(r)&&(o=$e(r)):o=$e(e));let s=nt(a,n,r)?tt(a):R(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=W(a),t=K(r)?W(r):r,n=e,i=Xe(n);for(;i&&t!==n;){let e=$e(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=Xe(n)}}return ge({width:u,height:d,x:c,y:l})}function it(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:rt(G(e)).left+n}function at(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-it(e,n),y:n.top+t.scrollTop}}function ot(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=q(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=rt(r);l=$e(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?at(o,c):R(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function st(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ct(e){let t=Ke(e),n=e.ownerDocument.body,r=F(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=F(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+it(e),o=-t.scrollTop;return Y(n).direction===`rtl`&&(a+=F(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var lt=25;function ut(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=W(e),a=G(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(it(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=lt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function dt(e,t){let n=rt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=$e(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ft(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ut(e,n,t);else if(t===`document`)r=ct(G(e));else if(K(t))r=dt(t,n);else{let n=tt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function pt(e,t){let n=t.get(e);if(n)return n;let r=Ye(e,[],!1).filter(e=>K(e)&&Ne(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?qe(e):e;for(;K(o)&&!Ge(o);){let e=Y(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=qe(o)}return t.set(e,r),r}function mt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:pt(t,this._c):[].concat(n),r],o=ft(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ft(t,a[e],i);s=F(n.top,s),c=P(n.right,c),l=P(n.bottom,l),u=F(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ht(e){let{width:t,height:n}=Ze(e);return{width:t,height:n}}function gt(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=rt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=rt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=it(i));let l=i&&!r&&!a?at(i,s):R(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function _t(e){return Y(e).position===`static`}function vt(e,t){if(!q(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){let n=W(e);if(Re(e))return n;if(!q(e)){let t=qe(e);for(;t&&!Ge(t);){if(K(t)&&!_t(t))return t;t=qe(t)}return n}let r=vt(e,t);for(;r&&Le(r)&&_t(r);)r=vt(r,t);return r&&Ge(r)&&_t(r)&&!He(r)?n:r||Ue(e)||n}var bt=async function(e){let t=this.getOffsetParent||yt,n=this.getDimensions,r=await n(e.floating);return{reference:gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xt(e){return Y(e).direction===`rtl`}var St={convertOffsetParentRelativeRectToViewportRelativeRect:ot,getDocumentElement:G,getClippingRect:mt,getOffsetParent:yt,getElementRects:bt,getClientRects:st,getDimensions:ht,getScale:$e,isElement:K,isRTL:xt};function Ct(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wt(e,t,n){let r=null,i,a=G(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=L(d),h=L(a.clientWidth-(u+f)),g=L(a.clientHeight-(d+p)),_=L(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:F(0,P(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ct(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=W(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Tt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Qe(e),u=i||a?[...l?Ye(l):[],...t?Ye(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?wt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?rt(e):null;c&&g();function g(){let t=rt(e);h&&!Ct(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Et=Oe,Dt=ke,Ot=Se,kt=je,At=Te,jt=xe,Mt=Ae,Nt=(e,t,n)=>{let r=new Map,i=n??{},a={...St,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Pt=typeof document<`u`?E.useLayoutEffect:function(){};function Ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ft(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function It(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lt(e,t){let n=It(e);return Math.round(t*n)/n}function Rt(e){let t=E.useRef(e);return Pt(()=>{t.current=e}),t}function zt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);Ft(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,D=Rt(c),O=Rt(i),k=Rt(l),A=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Nt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Ft(w.current,t)&&(w.current=t,j.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Pt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=E.useRef(!1);Pt(()=>(M.current=!0,()=>{M.current=!1}),[]),Pt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,T]);let N=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=E.useMemo(()=>({reference:b,floating:x}),[b,x]),F=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Lt(P.floating,u.x),r=Lt(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...It(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:A,refs:N,elements:P,floatingStyles:F}),[u,A,N,P,F])}var Bt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:jt({element:r.current,padding:i}).fn(n):r?jt({element:r,padding:i}).fn(n):{}}}},Vt=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ht=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>({fn:Mt(e).fn,options:[e,t]}),Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>{let n=At(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=`Arrow`,Yt=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(g.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Yt.displayName=Jt;var Xt=Yt,Zt=`Popper`,[Qt,$t]=y(Zt),[en,tn]=Qt(Zt),nn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(en,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};nn.displayName=Zt;var rn=`PopperAnchor`,an=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=tn(rn,n),s=E.useRef(null),c=a.onAnchorChange,l=o(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&hn(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,D.jsx)(g.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})});an.displayName=rn;var on=`PopperContent`,[sn,cn]=Qt(on),ln=E.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:_=`optimized`,onPlaced:v,...y}=e,b=tn(on,n),[x,S]=E.useState(null),C=o(t,S),[w,T]=E.useState(null),O=M(w),k=O?.width??0,A=O?.height??0,j=r+(a===`center`?``:`-`+a),N=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],F=P.length>0,I={padding:N,boundary:P.filter(pn),altBoundary:F},{refs:L,floatingStyles:R,placement:ee,isPositioned:z,middlewareData:B}=zt({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>Tt(...e,{animationFrame:_===`always`}),elements:{reference:b.anchor},middleware:[Vt({mainAxis:i+A,alignmentAxis:s}),l&&Ht({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Ut():void 0,...I}),l&&Wt({...I}),Gt({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),w&&qt({element:w,padding:c}),mn({arrowWidth:k,arrowHeight:A}),h&&Kt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),V=b.setPlacementState;m(()=>(V(ee),()=>{V(void 0)}),[ee,V]);let[H,te]=hn(ee),ne=f(v);m(()=>{z&&ne?.()},[z,ne]);let U=B.arrow?.x,re=B.arrow?.y,ie=B.arrow?.centerOffset!==0,[ae,oe]=E.useState();return m(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),(0,D.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:z?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(sn,{scope:n,placedSide:H,placedAlign:te,onArrowChange:T,arrowX:U,arrowY:re,shouldHideArrow:ie,children:(0,D.jsx)(g.div,{"data-side":H,"data-align":te,...y,ref:C,style:{...y.style,animation:z?void 0:`none`}})})})});ln.displayName=on;var un=`PopperArrow`,dn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},fn=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=cn(un,n),a=dn[i.placedSide];return(0,D.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,D.jsx)(Xt,{...r,ref:t,style:{...r.style,display:`block`}})})});fn.displayName=un;function pn(e){return e!==null}var mn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=hn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function hn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var gn=nn,_n=an,vn=ln,yn=fn,bn=!1;function xn(){let[e,t]=E.useState(bn);return E.useEffect(()=>{bn||(bn=!0,t(!0))},[]),e}var Sn=E.useSyncExternalStore;function Cn(){return()=>{}}function wn(){return Sn(Cn,()=>!0,()=>!1)}var Tn=typeof Sn==`function`?wn:xn,En=`rovingFocusGroup.onEntryFocus`,Dn={bubbles:!1,cancelable:!0},On=`RovingFocusGroup`,[kn,An,jn]=O(On),[Mn,Nn]=y(On,[jn]),[Pn,Fn]=Mn(On),In=E.forwardRef((e,t)=>(0,D.jsx)(kn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Ln,{...e,ref:t})})}));In.displayName=On;var Ln=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...m}=e,h=E.useRef(null),_=o(t,h),v=A(a),[y,b]=p({prop:s,defaultProp:c??null,onChange:l,caller:On}),[x,C]=E.useState(!1),w=f(u),T=An(n),O=E.useRef(!1),[k,j]=E.useState(0);return E.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(En,w),()=>e.removeEventListener(En,w)},[w]),(0,D.jsx)(Pn,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:y,onItemFocus:E.useCallback(e=>b(e),[b]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>j(e=>e-1),[]),children:(0,D.jsx)(g.div,{tabIndex:x||k===0?-1:0,"data-orientation":r,...m,ref:_,style:{outline:`none`,...e.style},onMouseDown:S(e.onMouseDown,()=>{O.current=!0}),onFocus:S(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(En,Dn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Un([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),d)}}O.current=!1}),onBlur:S(e.onBlur,()=>C(!1))})})}),Rn=`RovingFocusGroupItem`,zn=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=v(),l=a||c,u=Fn(Rn,n),d=u.currentTabStopId===l,f=An(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:_}=u,y=Tn();return m(()=>{if(!(!y||!r))return p(),()=>h()},[y,r,p,h]),E.useEffect(()=>{if(!(y||!r))return p(),()=>h()},[y,r,p,h]),(0,D.jsx)(kn.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(g.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:S(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:S(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:S(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Wn(n,r+1):n.slice(r+1)}setTimeout(()=>Un(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})});zn.displayName=Rn;var Bn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Hn(e,t,n){let r=Vn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bn[r]}function Un(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gn=In,Kn=zn,qn=[`Enter`,` `],Jn=[`ArrowDown`,`PageUp`,`Home`],Yn=[`ArrowUp`,`PageDown`,`End`],Xn=[...Jn,...Yn],Zn={ltr:[...qn,`ArrowRight`],rtl:[...qn,`ArrowLeft`]},Qn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},$n=`Menu`,[er,tr,nr]=O($n),[X,rr]=y($n,[nr,$t,Nn]),ir=$t(),ar=Nn(),[or,Z]=X($n),[sr,cr]=X($n),lr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ir(t),[c,l]=E.useState(null),u=E.useRef(!1),d=f(a),p=A(i);return E.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),E.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,D.jsx)(gn,{...s,children:(0,D.jsx)(or,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,D.jsx)(sr,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})};lr.displayName=$n;var ur=`MenuAnchor`,dr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(_n,{...i,...r,ref:t})});dr.displayName=ur;var fr=`MenuPortal`,[pr,mr]=X(fr,{forceMount:void 0}),hr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(fr,t);return(0,D.jsx)(pr,{scope:t,forceMount:n,children:(0,D.jsx)(T,{present:n||a.open,children:(0,D.jsx)(_,{asChild:!0,container:i,children:r})})})};hr.displayName=fr;var Q=`MenuContent`,[gr,_r]=X(Q),vr=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=cr(Q,e.__scopeMenu);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(T,{present:r||a.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(yr,{...i,ref:t}):(0,D.jsx)(br,{...i,ref:t})})})})}),yr=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=E.useRef(null),i=o(t,r);return E.useEffect(()=>{let e=r.current;if(e)return w(e)},[]),(0,D.jsx)(Sr,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),br=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,D.jsx)(Sr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xr=i(`MenuContent.ScrollLock`),Sr=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Z(Q,n),y=cr(Q,n),w=ir(n),T=ar(n),O=tr(n),[k,A]=E.useState(null),j=E.useRef(null),M=o(t,j,v.onContentChange),N=E.useRef(0),P=E.useRef(``),F=E.useRef(0),I=E.useRef(null),L=E.useRef(`right`),R=E.useRef(0),ee=g?b:E.Fragment,z=g?{as:xr,allowPinchZoom:!0}:void 0,B=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=oi(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(N.current),[]),C();let V=E.useCallback(e=>L.current===I.current?.side&&ci(e,I.current?.area),[]);return(0,D.jsx)(gr,{scope:n,searchRef:P,onItemEnter:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:E.useCallback(e=>{V(e)||(j.current?.focus(),A(null))},[V]),onTriggerLeave:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:F,onPointerGraceIntentChange:E.useCallback(e=>{I.current=e},[]),children:(0,D.jsx)(ee,{...z,children:(0,D.jsx)(d,{asChild:!0,trapped:i,onMountAutoFocus:S(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(x,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gn,{asChild:!0,...T,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:S(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(vn,{role:`menu`,"aria-orientation":`vertical`,"data-state":ti(v.open),"data-radix-menu-content":``,dir:y.dir,...w,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:S(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&B(e.key));let i=j.current;if(e.target!==i||!Xn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);Yn.includes(e.key)&&a.reverse(),ii(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:S(e.onPointerMove,li(e=>{let t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>R.current?`right`:`left`;L.current=t,R.current=e.clientX}}))})})})})})})});vr.displayName=Q;var Cr=`MenuGroup`,wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{role:`group`,...r,ref:t})});wr.displayName=Cr;var Tr=`MenuLabel`,Er=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{...r,ref:t})});Er.displayName=Tr;var Dr=`MenuItem`,Or=`menu.itemSelect`,kr=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=E.useRef(null),s=cr(Dr,e.__scopeMenu),c=_r(Dr,e.__scopeMenu),l=o(t,a),u=E.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Or,{bubbles:!0,cancelable:!0});e.addEventListener(Or,e=>r?.(e),{once:!0}),h(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,D.jsx)(Ar,{...i,ref:l,disabled:n,onClick:S(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:S(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||qn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});kr.displayName=Dr;var Ar=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,s=_r(Dr,n),c=ar(n),l=E.useRef(null),u=o(t,l),[d,f]=E.useState(!1),[p,m]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[a.children]),(0,D.jsx)(er.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,D.jsx)(Kn,{asChild:!0,...c,focusable:!r,children:(0,D.jsx)(g.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:u,onPointerMove:S(e.onPointerMove,li(e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,li(e=>s.onItemLeave(e))),onFocus:S(e.onFocus,()=>f(!0)),onBlur:S(e.onBlur,()=>f(!1))})})})}),jr=`MenuCheckboxItem`,Mr=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(kr,{role:`menuitemcheckbox`,"aria-checked":ni(n)?`mixed`:n,...i,ref:t,"data-state":ri(n),onSelect:S(i.onSelect,()=>r?.(ni(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Mr.displayName=jr;var Nr=`MenuRadioGroup`,[Pr,Fr]=X(Nr,{value:void 0,onValueChange:()=>{}}),Ir=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=f(r);return(0,D.jsx)(Pr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(wr,{...i,ref:t})})});Ir.displayName=Nr;var Lr=`MenuRadioItem`,Rr=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=Fr(Lr,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(kr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ri(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Rr.displayName=Lr;var zr=`MenuItemIndicator`,[Br,Vr]=X(zr,{checked:!1}),Hr=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vr(zr,n);return(0,D.jsx)(T,{present:r||ni(a.checked)||a.checked===!0,children:(0,D.jsx)(g.span,{...i,ref:t,"data-state":ri(a.checked)})})});Hr.displayName=zr;var Ur=`MenuSeparator`,Wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuArrow`,Kr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(yn,{...i,...r,ref:t})});Kr.displayName=Gr;var qr=`MenuSub`,[Jr,Yr]=X(qr),Xr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(qr,t),o=ir(t),[s,c]=E.useState(null),[l,u]=E.useState(null),d=f(i);return E.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,D.jsx)(gn,{...o,children:(0,D.jsx)(or,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,D.jsx)(Jr,{scope:t,contentId:v(),triggerId:v(),trigger:s,onTriggerChange:c,children:n})})})};Xr.displayName=qr;var Zr=`MenuSubTrigger`,Qr=E.forwardRef((e,t)=>{let n=Z(Zr,e.__scopeMenu),r=cr(Zr,e.__scopeMenu),i=Yr(Zr,e.__scopeMenu),a=_r(Zr,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=a,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=o(t,i.onTriggerChange);return(0,D.jsx)(dr,{asChild:!0,...u,children:(0,D.jsx)(Ar,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":ti(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,li(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(a.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:S(e.onPointerLeave,li(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Zn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Qr.displayName=Zr;var $r=`MenuSubContent`,ei=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,s=Z(Q,e.__scopeMenu),c=cr(Q,e.__scopeMenu),l=Yr($r,e.__scopeMenu),u=E.useRef(null),d=o(t,u);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(T,{present:r||s.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Sr,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:d,align:i,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:S(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Qn[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});ei.displayName=$r;function ti(e){return e?`open`:`closed`}function ni(e){return e===`indeterminate`}function ri(e){return ni(e)?`indeterminate`:e?`checked`:`unchecked`}function ii(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ai(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function oi(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ai(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function si(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ci(e,t){return t?si({x:e.clientX,y:e.clientY},t):!1}function li(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ui=lr,di=dr,fi=hr,pi=vr,mi=wr,hi=Er,gi=kr,_i=Mr,vi=Ir,yi=Rr,bi=Hr,xi=Wr,Si=Kr,Ci=Xr,wi=Qr,Ti=ei,Ei=`DropdownMenu`,[Di,Oi]=y(Ei,[rr]),$=rr(),[ki,Ai]=Di(Ei),ji=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=E.useRef(null),[u,d]=p({prop:i,defaultProp:a??!1,onChange:o,caller:Ei});return(0,D.jsx)(ki,{scope:t,triggerId:v(),triggerRef:l,contentId:v(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,D.jsx)(ui,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ji.displayName=Ei;var Mi=`DropdownMenuTrigger`,Ni=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Ai(Mi,n),s=$(n),c=o(t,a.triggerRef);return(0,D.jsx)(di,{asChild:!0,...s,children:(0,D.jsx)(g.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:c,onPointerDown:S(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ni.displayName=Mi;var Pi=`DropdownMenuPortal`,Fi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,D.jsx)(fi,{...r,...n})};Fi.displayName=Pi;var Ii=`DropdownMenuContent`,Li=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ai(Ii,n),a=$(n),o=E.useRef(!1);return(0,D.jsx)(pi,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Li.displayName=Ii;var Ri=`DropdownMenuGroup`,zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(mi,{...i,...r,ref:t})});zi.displayName=Ri;var Bi=`DropdownMenuLabel`,Vi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(hi,{...i,...r,ref:t})});Vi.displayName=Bi;var Hi=`DropdownMenuItem`,Ui=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(gi,{...i,...r,ref:t})});Ui.displayName=Hi;var Wi=`DropdownMenuCheckboxItem`,Gi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(_i,{...i,...r,ref:t})});Gi.displayName=Wi;var Ki=`DropdownMenuRadioGroup`,qi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(vi,{...i,...r,ref:t})});qi.displayName=Ki;var Ji=`DropdownMenuRadioItem`,Yi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(yi,{...i,...r,ref:t})});Yi.displayName=Ji;var Xi=`DropdownMenuItemIndicator`,Zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(bi,{...i,...r,ref:t})});Zi.displayName=Xi;var Qi=`DropdownMenuSeparator`,$i=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(xi,{...i,...r,ref:t})});$i.displayName=Qi;var ea=`DropdownMenuArrow`,ta=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Si,{...i,...r,ref:t})});ta.displayName=ea;var na=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=p({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(Ci,{...o,open:s,onOpenChange:c,children:n})},ra=`DropdownMenuSubTrigger`,ia=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(wi,{...i,...r,ref:t})});ia.displayName=ra;var aa=`DropdownMenuSubContent`,oa=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Ti,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});oa.displayName=aa;var sa=ji,ca=Ni,la=Fi,ua=Li,da=Vi,fa=Ui,pa=Gi,ma=qi,ha=Yi,ga=Zi,_a=$i,va=na,ya=ia,ba=oa;function xa({...e}){return(0,D.jsx)(sa,{"data-slot":`dropdown-menu`,...e})}function Sa({...e}){return(0,D.jsx)(la,{"data-slot":`dropdown-menu-portal`,...e})}function Ca({...e}){return(0,D.jsx)(ca,{"data-slot":`dropdown-menu-trigger`,...e})}function wa({className:e,sideOffset:t=4,...n}){return(0,D.jsx)(la,{children:(0,D.jsx)(ua,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:s(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Ta({className:e,inset:t,variant:n=`default`,...r}){return(0,D.jsx)(fa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:s(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Ea({className:e,children:t,checked:n,...r}){return(0,D.jsxs)(pa,{"data-slot":`dropdown-menu-checkbox-item`,className:s(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...a({checked:n}),...r,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(c,{className:`size-4`})})}),t]})}function Da({...e}){return(0,D.jsx)(ma,{"data-slot":`dropdown-menu-radio-group`,...e})}function Oa({className:e,children:t,...n}){return(0,D.jsxs)(ha,{"data-slot":`dropdown-menu-radio-item`,className:s(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(l,{className:`size-2 fill-current`})})}),t]})}function ka({className:e,inset:t,...n}){return(0,D.jsx)(da,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:s(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Aa({className:e,...t}){return(0,D.jsx)(_a,{"data-slot":`dropdown-menu-separator`,className:s(`-mx-1 my-1 h-px bg-border`,e),...t})}function ja({...e}){return(0,D.jsx)(va,{"data-slot":`dropdown-menu-sub`,...e})}function Ma({className:e,inset:t,children:n,...r}){return(0,D.jsxs)(ya,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:s(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,D.jsx)(u,{className:`ms-auto size-4`})]})}function Na({className:e,...t}){return(0,D.jsx)(ba,{"data-slot":`dropdown-menu-sub-content`,className:s(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{A as C,M as S,_n as _,ka as a,gn as b,Oa as c,Na as d,Ma as f,Nn as g,Gn as h,Ta as i,Aa as l,Kn as m,Ea as n,Sa as o,Ca as p,wa as r,Da as s,xa as t,ja as u,yn as v,O as w,$t as x,vn as y};
@@ -0,0 +1,41 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i,s as a}from"./button-RJMdCnZw.js";var o=e(t(),1),s=e(n(),1),c=r(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var m=globalThis?.document?o.useLayoutEffect:()=>{},h=o.useInsertionEffect||m;function g({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=_({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=v(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function _({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return h(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function v(e){return typeof e==`function`}function y(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var b=e=>{let{present:t,children:n}=e,r=x(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=C(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};b.displayName=`Presence`;function x(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=y(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??w(r.current),s.current=void 0):a.current=`none`},[c]),m(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=w(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),m(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=w(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=w(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=w(t)}else r.current=null;n(e)},[])}}function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():S(n[e],null)}}},[])}function w(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T=o.useId||(()=>void 0),E=0;function te(e){let[t,n]=o.useState(T());return m(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ne=`DismissableLayer`,O=`dismissableLayer.update`,k=`dismissableLayer.pointerDownOutside`,A=`dismissableLayer.focusOutside`,re,j=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ie=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,h=o.useContext(j),[g,_]=o.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=o.useState({}),b=a(t,_),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,w=g?x.indexOf(g):-1,ee=h.layersWithOutsidePointerEventsDisabled.size>0,T=w>=C,E=o.useRef(!1),te=le(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return T&&!t},[h.branches,T])}),ne=ue(e=>{if(r&&E.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},v),k=g?w===x.length-1:!1,A=D(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return o.useEffect(()=>{if(k)return v.addEventListener(`keydown`,A,{capture:!0}),()=>v.removeEventListener(`keydown`,A,{capture:!0})},[v,k,A]),o.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(re=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),de(),()=>{n&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=re))}},[g,v,n,h]),o.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),de())},[g,h]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,c.jsx)(l.div,{...m,ref:b,style:{pointerEvents:ee?T?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:p(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,te.onPointerDownCapture)})});ie.displayName=ne;var ae=`DismissableLayerBranch`,oe=o.forwardRef((e,t)=>{let n=o.useContext(j),r=o.useRef(null),i=a(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(l.div,{...e,ref:i})});oe.displayName=ae;function se(){let e=o.useContext(j),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ce=()=>!0;function le(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ce}=t,c=D(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||fe(k,c,p,{discrete:!0})};if(!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function ue(e,t=globalThis?.document){let n=D(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&fe(A,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){let e=new CustomEvent(O);document.dispatchEvent(e)}function fe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u(i,a):i.dispatchEvent(a)}var M=`focusScope.autoFocusOnMount`,N=`focusScope.autoFocusOnUnmount`,pe={bubbles:!1,cancelable:!0},me=`FocusScope`,he=o.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...u}=e,[d,f]=o.useState(null),p=D(i),m=D(s),h=o.useRef(null),g=a(t,f),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,d,_.paused]),o.useEffect(()=>{if(d){Se.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(M,pe);d.addEventListener(M,p),d.dispatchEvent(t),t.defaultPrevented||(ge(Te(ve(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(M,p),setTimeout(()=>{let t=new CustomEvent(N,pe);d.addEventListener(N,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(N,m),Se.remove(_)},0)}}},[d,p,m,_]);let v=o.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=_e(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&P(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&P(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,c.jsx)(l.div,{tabIndex:-1,...u,ref:g,onKeyDown:v})});he.displayName=me;function ge(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}function _e(e){let t=ve(e);return[ye(t,e),ye(t.reverse(),e)]}function ve(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):be(r,{upTo:t})))return r}function be(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function xe(e){return e instanceof HTMLInputElement&&`select`in e}function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xe(e)&&t&&e.select()}}var Se=Ce();function Ce(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=we(e,t),e.unshift(t)},remove(t){e=we(e,t),e[0]?.resume()}}}function we(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);m(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});De.displayName=Ee;var F=0,I=null;function Oe(){o.useEffect(()=>{I||={start:ke(),end:ke()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Me=`with-scroll-bars-hidden`,Ne=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pe(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ie=new WeakMap;function Le(e,t){var n=Pe(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Fe(function(){var t=Ie.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}Ie.set(n,e)},[e]),n}function Re(e){return e}function ze(e,t){t===void 0&&(t=Re);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Be(e){e===void 0&&(e={});var t=ze(null);return t.options=L({async:!0,ssr:!1},e),t}var Ve=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,L({},n))};Ve.isSideCarExport=!0;function He(e,t){return e.useMedium(t),Ve}var Ue=Be(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Le([n,t]),w=L(L({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Ue,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),L(L({},w),{ref:C})):o.createElement(y,L({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:z,zeroRight:R};var We,Ge=function(){if(We)return We;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ke(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ge();return t&&e.setAttribute(`nonce`,t),e}function qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Je(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ke())&&(qe(t,n),Je(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xe=function(){var e=Ye();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ze=function(){var e=Xe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qe={left:0,top:0,right:0,gap:0},U=function(e){return parseInt(e||``,10)||0},$e=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[U(n),U(r),U(i)]},et=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qe;var t=$e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tt=Ze(),W=`data-scroll-locked`,nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${Me} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${W}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${R} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${z} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${R} .${R} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${z} .${z} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${W}] {
36
+ ${Ne}: ${s}px;
37
+ }
38
+ `},rt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},it=function(){o.useEffect(function(){return document.body.setAttribute(W,(rt()+1).toString()),function(){var e=rt()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},at=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;it();var a=o.useMemo(function(){return et(i)},[i]);return o.createElement(tt,{styles:nt(a,!t,i,n?``:`!important`)})},G=!1;if(typeof window<`u`)try{var K=Object.defineProperty({},"passive",{get:function(){return G=!0,!0}});window.addEventListener(`test`,K,K),window.removeEventListener(`test`,K,K)}catch{G=!1}var q=G?{passive:!1}:!1,ot=function(e){return e.tagName===`TEXTAREA`},st=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ot(e)&&n[t]===`visible`)},ct=function(e){return st(e,`overflowY`)},lt=function(e){return st(e,`overflowX`)},ut=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),pt(e,r)){var i=mt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ft=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pt=function(e,t){return e===`v`?ct(t):lt(t)},mt=function(e,t){return e===`v`?dt(t):ft(t)},ht=function(e,t){return e===`h`&&t===`rtl`?-1:1},gt=function(e,t,n,r,i){var a=ht(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=mt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&pt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_t=function(e){return[e.deltaX,e.deltaY]},vt=function(e){return e&&`current`in e?e.current:e},yt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bt=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},xt=0,Y=[];function St(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(xt++)[0],a=o.useState(Ze)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=je([e.lockRef.current],(e.shards||[]).map(vt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=J(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ut(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ut(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return gt(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?_t(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&yt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(vt).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ct(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,_t(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,J(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,q),document.addEventListener(`touchmove`,l,q),document.addEventListener(`touchstart`,d,q),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,q),document.removeEventListener(`touchmove`,l,q),document.removeEventListener(`touchstart`,d,q)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:bt(i)}):null,m?o.createElement(at,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wt=He(Ue,St),Tt=o.forwardRef(function(e,t){return o.createElement(H,L({},e,{ref:t,sideCar:wt}))});Tt.classNames=H.classNames;var Et=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,Dt=function(e){return e&&(e.host||Dt(e.parentNode))},Ot=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Dt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},kt=function(e,t,n,r){var i=Ot(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},At=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Et(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),kt(r,i,n,`aria-hidden`)):function(){return null}};export{he as a,D as c,g as d,m as f,u as g,l as h,De as i,te as l,d as m,Tt as n,ie as o,p,Oe as r,se as s,At as t,b as u};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,u as i,w as a}from"./button-RJMdCnZw.js";import{cn as o,i as s}from"./project-scope-context-VENshCVj.js";import{_t as c}from"./queries-r1Fc1fWN.js";import{ot as l,w as u}from"./design-icons-B6-0w7Aw.js";import{t as d}from"./createLucideIcon-BHp8sXmF.js";import{t as f}from"./centered-state-dmABwupF.js";import{G as p,U as m,W as h}from"./index-DUuc-42H.js";import{a as g,c as _,d as v,l as y,n as b,o as x,s as S,t as C,u as w}from"./markdown-DcRzCfVU.js";var T=d(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),E=d(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),D=d(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),O=e(t(),1),k=n(),A=[[`scripts`,`remote script`,`remote scripts`],[`remote`,`remote resource`,`remote resources`],[`relative`,`linked file next to the report`,`linked files next to the report`],[`forms`,`form`,`forms`],[`embeds`,`embedded frame or object`,`embedded frames or objects`]];function j(e){let t=A.filter(([t])=>e[t]>0).map(([t,n,r])=>`${e[t]} ${e[t]===1?n:r}`);return t.length?t.join(`, `):null}var M={};function N(e){let t=(0,O.useMemo)(()=>w(e),[e]).join(` `),[n,r]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(!t)return;let e=!0;return v(t.split(` `)).then(n=>{e&&r({key:t,libraries:n})}),()=>{e=!1}},[t]),t?n?.key===t?n.libraries:null:M}function P({html:e,title:t,fragment:n,className:r}){let a=N(e);return a?(0,k.jsx)(F,{html:e,title:t,fragment:n,className:r,libraries:a}):(0,k.jsx)(`div`,{"data-slot":`html-report`,"aria-busy":`true`,className:i(`flex min-h-0 flex-col`,r)})}function F({html:e,title:t,fragment:n,className:r,libraries:a}){let{srcdoc:o,blocked:s}=(0,O.useMemo)(()=>{let n=_(e,a);return{srcdoc:y(n.srcdoc,t),blocked:n.blocked}},[e,a,t]),c=e=>{n&&/^#\S+$/.test(n)&&e.currentTarget.contentWindow?.frames[0]?.location.replace(`about:srcdoc${n}`)},l=j(s);return(0,k.jsxs)(`div`,{"data-slot":`html-report`,className:i(`flex min-h-0 flex-col`,r),children:[l?(0,k.jsxs)(`p`,{"data-slot":`html-report-blocked`,role:`note`,className:`border-b border-border bg-muted/40 px-4 py-2 text-xs text-foreground`,children:[`Blocked for your safety: `,l,`. Reports show only what they carry inside the file.`]}):null,(0,k.jsx)(`iframe`,{"data-slot":`html-report-frame`,title:t,sandbox:x,allow:g,srcDoc:o,referrerPolicy:`no-referrer`,onLoad:c,className:`block min-h-0 w-full flex-1 border-0 bg-report-canvas`})]})}var I=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`bmp`,`ico`,`avif`]);function L(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?!1:I.has(t.slice(n+1).toLowerCase())}function R(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return L(e)||n>0&&t.slice(n+1).toLowerCase()===`svg`}function z(e){return e.tooLarge?`too-large`:R(e.path)?`image`:e.binary?`binary`:`text`}function B(e){return e>=1024**2?`${(e/1024**2).toFixed(1)} MB`:e>=1024?`${(e/1024).toFixed(1)} kB`:`${e} B`}function V({runId:e,path:t,className:n}){let r=c(e,t??void 0);if(t===null)return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(u,{size:16}),tone:`neutral`,heading:`h2`,title:`Select a file`,subtitle:`Pick a file from this task’s worktree to inspect its contents.`,className:`[&_[data-slot=centered-state-tile]]:size-10 [&_[data-slot=centered-state-tile]]:border-0 [&_[data-slot=centered-state-tile]]:bg-transparent [&_[data-slot=centered-state-tile]]:text-accent-text [&_[data-slot=centered-state-tile]]:shadow-none [&_h2]:text-xl`})});if(r.isPending)return(0,k.jsx)(K,{className:n,children:(0,k.jsxs)(`p`,{"data-slot":`file-preview-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground`,children:[`Loading `,t,`…`]})});if(r.isError){let e=r.error instanceof s&&r.error.status===409;return(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:e?(0,k.jsx)(D,{}):(0,k.jsx)(l,{size:16}),tone:e?`neutral`:`danger`,heading:`h2`,title:e?`Cannot preview this file`:`Could not load this file`,subtitle:r.error.message})})}return r.data.type===`file`?(0,k.jsx)(H,{runId:e,entry:r.data,className:n}):(0,k.jsx)(K,{className:n,children:(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Choose a file inside this directory`,subtitle:`Expand the folder in the tree, or enter the full path to a file.`})})}function H({runId:e,entry:t,className:n,imageUrl:r,downloadUrl:i,snapshot:a,readerHref:o,documentPreview:s=!1}){let[c,l]=(0,O.useState)(!1),u=s&&/\.(?:md|markdown)$/i.test(t.path),d=s&&S(t.path),f=/\.(?:png|jpe?g|gif|webp|bmp|ico|avif)$/i.test(t.path),p=s&&f&&t.size<=10*1024*1024?`image`:z(t),m=(u||d)&&p===`text`;return(0,k.jsxs)(K,{className:n,children:[(0,k.jsxs)(`header`,{"data-slot":`file-preview-head`,className:`flex items-center gap-2 border-b border-border bg-muted/40 px-4 py-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono font-medium`,children:t.path}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 tabular-nums text-soft-foreground`,children:B(t.size)})]}),a||i||m?(0,k.jsx)(W,{snapshot:a,downloadUrl:i,source:m?c:null,onSource:()=>l(e=>!e),readerHref:d&&p===`text`?o:void 0}):null,(0,k.jsx)(U,{runId:e,entry:t,kind:p,showImage:p===`image`&&(!s||f),rendered:c?null:u?`markdown`:d?`html`:null,imageUrl:r})]})}function U({runId:e,entry:t,kind:n,showImage:r,rendered:i,imageUrl:a}){return r?(0,k.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,k.jsx)(`img`,{"data-slot":`file-preview-image`,src:a??o(e,t.path),alt:t.path,className:`max-h-[70vh] max-w-full rounded-sm`})}):n===`too-large`?(0,k.jsx)(f,{icon:(0,k.jsx)(T,{}),tone:`neutral`,heading:`h2`,title:`Too large to preview`,subtitle:`${B(t.size)} — past the preview cap. Open it in your editor instead.`}):n===`binary`?(0,k.jsx)(f,{icon:(0,k.jsx)(E,{}),tone:`neutral`,heading:`h2`,title:`Binary file`,subtitle:`${B(t.size)} of binary data — no text preview.`}):i===`markdown`?(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(C,{document:!0,children:t.content??``})}):i===`html`?(0,k.jsx)(P,{html:t.content??``,title:`Report: ${t.path}`,className:`h-[70vh]`}):(0,k.jsx)(Y,{path:t.path,text:t.content??``})}function W({snapshot:e,downloadUrl:t,source:n,onSource:r,readerHref:i}){return(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-border px-4 py-2 text-xs`,children:[e?(0,k.jsxs)(`span`,{children:[`Published snapshot · `,e]}):null,t?(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center text-accent-text underline`,href:t,children:`Download`}):null,n===null?null:(0,k.jsx)(`button`,{className:`min-h-11 rounded px-2 text-accent-text underline focus-visible:ring-2`,onClick:r,children:n?`Preview`:`View source`}),i?(0,k.jsx)(G,{href:i}):null]})}function G({href:e}){let t=a(),n=r();return(0,k.jsx)(`a`,{className:`inline-flex min-h-11 items-center px-2 text-accent-text underline focus-visible:ring-2`,href:e,onClick:r=>b(r,t,e,n),children:`Open reader`})}function K({className:e,children:t}){return(0,k.jsx)(`section`,{"data-slot":`file-preview`,className:i(`flex flex-col overflow-hidden rounded-lg border border-border bg-card`,e),children:t})}var q=1500;function J(e,t){let n=(0,O.useMemo)(()=>t.split(`
2
+ `).map(e=>[{content:e}]),[t]),r=(0,O.useMemo)(()=>p(e),[e]),i=n.length>q,[a,o]=(0,O.useState)(null);return(0,O.useEffect)(()=>{if(r===null||i)return;let n=!1;return m(t,r).then(r=>{n||o({key:`${e}\0${t}`,tokens:r.tokens})}),()=>{n=!0}},[e,t,r,i]),r===null||i?n:a?.key===`${e}\0${t}`?a.tokens:h(t,r)?.tokens??n}function Y({path:e,text:t}){let n=J(e,t);return(0,k.jsx)(`div`,{"data-slot":`file-preview-code`,"data-lang":p(e)??`plaintext`,className:`overflow-x-auto py-2 font-mono text-xs leading-[1.7]`,children:n.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex px-4`,children:[(0,k.jsx)(`span`,{className:`w-10 shrink-0 select-none pr-3 text-right tabular-nums text-soft-foreground`,children:t+1}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 whitespace-pre pr-4`,children:e.map((e,t)=>(0,k.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))})]},t))})}export{R as a,E as c,B as i,T as l,H as n,P as o,V as r,D as s,Y as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{d as r,t as i,u as a}from"./button-RJMdCnZw.js";import{tt as o}from"./use-desktop-BnWAyH1e.js";import{F as s,T as c,j as l,st as u,u as d}from"./design-icons-B6-0w7Aw.js";import{t as f}from"./createLucideIcon-BHp8sXmF.js";import{n as p,r as m,t as h}from"./diff-controls-BpQyN23g.js";import{i as g,p as _,r as v,t as y}from"./dropdown-menu-Cr9RsmWG.js";import{At as b,tn as x}from"./index-DUuc-42H.js";var S=f(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),C=f(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),w=e(t(),1),T=n();function E({root:e,selected:t,onSelect:n}){return(0,T.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function D({adds:e,dels:t}){return(0,T.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,T.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,T.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function O({dir:e,depth:t,selected:n,onSelect:r}){let[i,o]=(0,w.useState)(!0);return(0,T.jsxs)(`li`,{children:[(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":i?`open`:`closed`,"aria-expanded":i,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,T.jsx)(d,{size:16,"aria-hidden":`true`,className:a(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,i&&`rotate-90`)}),(0,T.jsx)(c,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]}),i?(0,T.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,T.jsx)(O,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,T.jsx)(A,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var k={added:`text-success`,deleted:`text-danger`};function A({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,T.jsx)(`li`,{children:(0,T.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:a(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,T.jsx)(C,{"aria-hidden":`true`,className:a(`size-3.5 shrink-0`,k[e.status])}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,T.jsx)(D,{adds:e.adds,dels:e.dels})]})})}function j(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function M(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(M)}}var N=(e,t)=>e.name.localeCompare(t.name);function P(e){let t=j(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=j(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(N),e.files.sort(N)};return i(t),{...t,dirs:t.dirs.map(M)}}function F({bar:e,healthReady:t,branch:n,stat:r,mode:o,wrap:s,preview:c=!1,onModeChange:l,onWrapChange:u,onPreviewChange:d,onAction:f}){return(0,T.jsxs)(`div`,{"data-slot":`git-toolbar`,"data-health-ready":t,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[n?(0,T.jsx)(h,{branch:n}):null,r?(0,T.jsx)(R,{stat:r}):null,d?(0,T.jsx)(`span`,{className:`ml-auto flex items-center`,children:(0,T.jsx)(m,{preview:c,onPreviewChange:d})}):null,(0,T.jsxs)(`span`,{className:a(`flex items-center gap-1`,d?`max-md:ml-auto`:`ml-auto`),children:[(0,T.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,T.jsx)(p,{mode:o,wrap:s,onModeChange:l,onWrapChange:u})}),e.secondary.map(e=>(0,T.jsx)(L,{action:e,variant:`outline`,onAction:f},e.id)),(0,T.jsx)(L,{action:e.primary,variant:`primary`,onAction:f}),e.menu.length>0?(0,T.jsxs)(y,{children:[(0,T.jsx)(_,{asChild:!0,children:(0,T.jsx)(i,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,T.jsx)(S,{"aria-hidden":`true`})})}),(0,T.jsx)(v,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,T.jsxs)(g,{disabled:!e.enabled,title:e.reason,onSelect:()=>f(e.id),children:[I[e.id],e.label]},e.id))})]}):null]})]})}var I={commit:(0,T.jsx)(l,{size:16,"aria-hidden":`true`}),push:(0,T.jsx)(u,{size:16,"aria-hidden":`true`}),"create-pr":(0,T.jsx)(s,{size:16,"aria-hidden":`true`}),"view-pr":(0,T.jsx)(o,{"aria-hidden":`true`}),"open-terminal":(0,T.jsx)(x,{"aria-hidden":`true`})};function L({action:e,variant:t,onAction:n}){return e.id===`view-pr`?r(e.href)?(0,T.jsx)(i,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,T.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[I[e.id],e.label]})}):(0,T.jsxs)(i,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[I[e.id],e.label]}):(0,T.jsxs)(i,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[I[e.id],e.label]})}function R({stat:e}){return(0,T.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,T.jsx)(b,{stat:{adds:z(e.adds),dels:z(e.dels),files:e.files}})})}function z(e){let[t,n]=(0,w.useState)(e),r=(0,w.useRef)(e);return(0,w.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{E as i,F as n,P as r,R as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{E as r,M as i,t as a,u as o}from"./button-RJMdCnZw.js";import{$ as s,Kr as c,Lr as l,Q as u,Y as d,Yt as f,Z as p,jn as m}from"./project-scope-context-VENshCVj.js";import{A as h,E as g,K as _,M as v,O as y,T as b,Yt as x,c as S,kt as ee,n as C}from"./queries-r1Fc1fWN.js";import{G as w,a as T,n as te,o as E,r as D,z as O}from"./use-desktop-BnWAyH1e.js";import{n as k}from"./toaster-BWMQArHJ.js";import{F as A,I as j,X as M,Y as N,c as P,l as F,ot as I,p as L,r as ne}from"./design-icons-B6-0w7Aw.js";import{l as re,n as ie}from"./nav-row-styles-D4xk5Osn.js";import{a as R,i as z}from"./format-BNCkW110.js";import{_ as ae,a as oe,d as B,f as se,h as ce,i as le,m as ue,n as de,o as fe,p as pe,r as me,v as he}from"./prompt-template-menu-C60uqznw.js";import{r as ge,t as V}from"./project-router-_V9XDi3p.js";import"./attention-BdI3xSwD.js";import{_ as _e,b as H,h as ve,x as ye,y as be}from"./picker-pill-x0hXGTLP.js";import{t as U}from"./centered-state-dmABwupF.js";import{C as xe,Ft as Se,J as Ce,Yt as we,mn as Te,pn as Ee,q as De,s as Oe,z as ke}from"./index-DUuc-42H.js";import{a as Ae,d as je,f as Me,i as Ne,l as Pe,n as Fe,o as Ie,r as Le,s as Re,t as ze,u as W}from"./use-hand-to-agent-state-VmvgZIh6.js";import{t as G}from"./tab-link-CuL027Wh.js";var K=e(t(),1),q=`cez-github-list-width`;function J(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Be(){try{let e=localStorage.getItem(q);return e===null?360:J(e)}catch{return 360}}function Ve(e){try{localStorage.setItem(q,String(J(e)))}catch{}}var Y=n();function He({number:e,repo:t}){let n=i();return(0,Y.jsx)(Ue,{number:e,repo:t,scope:n},JSON.stringify([n,t,e]))}function Ue({number:e,repo:t,scope:n}){let r=(0,K.useId)(),i=(0,K.useId)(),[o,s]=(0,K.useState)(!1),c=o?Te:Ee,l=_(n,!0,n==="default"),u=S(`#${e}`,!0),d=(0,K.useMemo)(()=>ue(w(l.data??[],u.data?.pages.flatMap(e=>e.runs)??[]),e,t,n),[l.data,u.data,e,t,n]);return(0,Y.jsxs)(`section`,{"aria-labelledby":r,className:`mt-4 min-w-0 rounded-lg border border-border p-3`,children:[(0,Y.jsx)(`h3`,{id:r,className:`text-xs font-semibold text-muted-foreground`,children:(0,Y.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":i,onClick:()=>s(e=>!e),className:`flex min-h-11 w-full items-center gap-2 rounded-md px-2 text-left hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(c,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Y.jsxs)(`span`,{children:[`Linked tasks`,l.data?` (${d.length}${u.hasNextPage||u.isError?`+`:``})`:``]})]})}),(0,Y.jsx)(`div`,{id:i,children:o?(0,Y.jsxs)(Y.Fragment,{children:[l.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-muted-foreground`,children:`Loading linked tasks…`}):null,l.isError?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(`p`,{role:`status`,children:`Couldn’t load linked tasks. Check your connection and try again.`}),(0,Y.jsx)(a,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void l.refetch(),disabled:l.isFetching,children:`Retry linked tasks`})]}):null,l.data&&d.length===0&&!l.isError?(0,Y.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No linked tasks yet.`}):null,d.length>0?(0,Y.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1`,children:d.map(e=>{let t=m(e);return(0,Y.jsx)(`li`,{children:(0,Y.jsxs)(V,{to:`/tasks/${encodeURIComponent(e.id)}`,className:`flex min-h-11 min-w-0 flex-col justify-center gap-1 rounded-md px-2 py-2 hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium break-words [overflow-wrap:anywhere]`,children:O(e)}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:[(0,Y.jsx)(we,{tone:t.tone,shape:t.shape,pulse:t.pulse,role:`img`,"aria-label":t.label,title:t.label}),e.archived?(0,Y.jsx)(`span`,{className:`rounded border border-border px-1`,children:`Archived`}):null,(0,Y.jsx)(`time`,{dateTime:e.createdAt,children:new Date(e.createdAt).toLocaleDateString()})]})]})},e.id)})}):null,u.isError?(0,Y.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(`p`,{role:`status`,children:`Couldn’t load older archived linked tasks.`}),(0,Y.jsx)(a,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.refetch(),disabled:u.isFetching,children:`Retry older linked tasks`})]}):u.hasNextPage?(0,Y.jsx)(a,{variant:`outline`,className:`mt-2 min-h-11`,onClick:()=>void u.fetchNextPage(),disabled:u.isFetchingNextPage,children:u.isFetchingNextPage?`Loading older linked tasks…`:`Show older linked tasks`}):null]}):null})]})}var X=`w-44 max-w-full`,Z=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function We(e,t){let n=new Map;for(let t of e)for(let e of t.assignees??[])n.set(e.toLowerCase(),e);for(let e of t)n.set(e.toLowerCase(),e);return[...n.values()].sort((e,t)=>e.localeCompare(t))}function Ge(e,t){return!!e&&t.length===1&&t[0]?.toLowerCase()===e.toLowerCase()}function Ke(e){let t=` Previous memberships are shown; issues with unknown membership remain visible.`;return e.projectsState===`refreshing`&&e.projects?`Refreshing project boards.${t}`:e.projectsState===`unavailable`&&e.projects?`${e.projectsReason}${t}`:e.projects?``:e.projectsReason??(e.projectsState===`refreshing`?`Project memberships pending.`:`Project boards unavailable.`)}function qe(e){return[e.viewerLogin?``:`GitHub login unavailable.`,Ke(e)].filter(Boolean).join(` `)}function Je({options:e,assignees:t,onAssigneesChange:n}){return(0,Y.jsxs)(D,{children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,className:Z,disabled:e.length===0,children:[`Assignee`,t.length?` · ${t.length}`:``,(0,Y.jsx)(F,{size:12,"aria-hidden":`true`,className:`ml-1 inline size-3 shrink-0 align-[-1px] text-soft-foreground`})]})}),(0,Y.jsx)(T,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,Y.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,Y.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),e.map(e=>{let r=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,Y.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>n(r?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,Y.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]})}function Ye({data:e,projectId:t,onProjectChange:n,pickerRef:r}){return e.projects?.length?(0,Y.jsxs)(`select`,{ref:r,"aria-label":`Project board`,className:`${Z} ${X}`,value:t,onChange:e=>n(e.target.value),children:[(0,Y.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects||e.projectsState?(0,Y.jsx)(`select`,{ref:r,"aria-label":`Project board`,className:`${Z} ${X}`,disabled:!0,value:``,children:(0,Y.jsx)(`option`,{value:``,children:e.projects?`No boards`:e.projectsState===`refreshing`?`Loading boards…`:`Boards unavailable`})}):null}function Xe({data:e,message:t,lastMessage:n,hasMessage:r,statusOpen:i,setStatusOpen:a,triggerRef:o,contentRef:s}){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{role:`status`,className:`sr-only`,children:t}),(0,Y.jsxs)(D,{open:i,onOpenChange:a,children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsx)(`button`,{ref:o,type:`button`,className:`${Z} inline-flex items-center justify-center ${t?``:`invisible`}`,"aria-label":`Project board status`,tabIndex:t?void 0:-1,children:e.projectsState===`refreshing`?(0,Y.jsx)(N,{size:14,"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):(0,Y.jsx)(I,{size:14,"aria-hidden":`true`,className:`size-3.5`})})}),(0,Y.jsx)(T,{ref:s,align:`start`,"data-slot":`gh-issue-status`,onCloseAutoFocus:e=>{r||e.preventDefault()},className:`w-72 max-w-[calc(100vw-2rem)] p-3 text-xs text-muted-foreground`,children:t||n.current})]})]})}function Ze({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let[a,o]=(0,K.useState)(!1),s=(0,K.useRef)(null),c=(0,K.useRef)(null),l=(0,K.useRef)(null),u=(0,K.useRef)(null),d=We(e.issues,t),f=Ge(e.viewerLogin,t),p=qe(e),m=p!==``,h=(0,K.useRef)(p);m&&(h.current=p);let g=(0,K.useRef)(!m);g.current=!m;let _=()=>(l.current&&!l.current.disabled?l.current:u.current)?.focus();return(0,K.useEffect)(()=>{let e=s.current;if(!e)return;let t=e=>{g.current&&!e.relatedTarget&&requestAnimationFrame(()=>{(!document.activeElement||document.activeElement===document.body)&&_()})};return e.addEventListener(`blur`,t),()=>e.removeEventListener(`blur`,t)},[]),(0,K.useEffect)(()=>{if(m)return;let e=document.activeElement,t=!!e&&(e===s.current||!!c.current?.contains(e));o(!1),t&&_()},[m]),(0,Y.jsxs)(`div`,{className:`contents`,"data-slot":`gh-issue-filters`,children:[(0,Y.jsx)(Je,{options:d,assignees:t,onAssigneesChange:r}),(0,Y.jsx)(`button`,{ref:u,type:`button`,className:`${Z} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":f,onClick:()=>r(f?[]:[e.viewerLogin]),children:`Assigned to me`}),(0,Y.jsx)(Ye,{data:e,projectId:n,onProjectChange:i,pickerRef:l}),(0,Y.jsx)(Xe,{data:e,message:p,lastMessage:h,hasMessage:m,statusOpen:a,setStatusOpen:o,triggerRef:s,contentRef:c})]})}function Qe({onRefresh:e,refreshing:t}){let n=De(i());return(0,Y.jsxs)(`div`,{"data-route":`github`,"data-slot":`github-filter-screen`,className:ie,children:[(0,Y.jsxs)(`div`,{className:`mb-[16px] flex items-center gap-[8px]`,children:[(0,Y.jsx)(`h1`,{className:o(re,`min-w-0 flex-1`),children:`GitHub`}),(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-screen-refresh`,"aria-label":`Refresh from GitHub`,title:`Refresh from GitHub`,disabled:t,onClick:e,className:`-my-2 -mr-[10px] flex size-11 shrink-0 items-center justify-center rounded-md text-soft-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60`,children:(0,Y.jsx)(N,{size:17,"aria-hidden":`true`,className:o(`size-[17px]`,t&&`motion-safe:animate-spin`)})})]}),(0,Y.jsx)(Ce,{model:n,variant:`screen`})]})}function $e(e){let t=getComputedStyle(e).overflowY;return t===`auto`||t===`scroll`?e:e.closest(`[data-slot="main"]`)??e}function et(e){let[t,n]=(0,K.useState)(null);return(0,K.useLayoutEffect)(()=>{if(!e){n(null);return}let t=()=>n($e(e));t();let r=typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 768px)`):null;r?.addEventListener(`change`,t);let i=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return i?.observe(e),()=>{r?.removeEventListener(`change`,t),i?.disconnect()}},[e]),t}function tt(e,t){let[n,r]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{let n=()=>{!e||!t||r(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return n(),window.addEventListener(`resize`,n),()=>window.removeEventListener(`resize`,n)},[e,t]),n}function nt(e,t,n){let[r,i]=(0,K.useState)(null),a=(0,K.useRef)(n);return(0,K.useEffect)(()=>{a.current=n}),(0,K.useEffect)(()=>{if(!e||!r||!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&a.current()},{root:t.getAttribute(`data-slot`)===`main`?null:t,rootMargin:`0px 0px 600px 0px`});return n.observe(r),()=>n.disconnect()},[e,r,t]),i}function rt(e,t,n,r,i){let[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=et(a),u=(0,K.useRef)(null);u.current=l;let d=tt(s,l),f=e===`issues`?n?.issues.length??0:n?.prs.length??0,p=t.hasNextPage&&r===null&&f>0;return{listEl:a,setListEl:o,setRowsEl:c,scrollOwner:l,scrollOwnerRef:u,startMargin:d,pagingAvailable:p,manualPaging:p&&i,loadMoreRef:nt(p&&!i&&!t.isFetchingNextPage&&!t.isFetchNextPageError,l,()=>void t.fetchNextPage())}}var it=100;function at(e,t,n,r,i){if(!e?.available||t!==`prs`)return[];let a=new Set;n!==null&&Number.isInteger(n)&&a.add(n);for(let t of[...r,...i,...e.prs]){if(a.size>=it)break;a.add(t.number)}return[...a]}function ot(e,t,n,r,i,a){let o=at(n,e,r,i,a),s=b(o,e===`prs`),c=s.data?.available?s.data.checks:void 0,l=g(e===`issues`?`issue`:`pr`,(0,K.useMemo)(()=>(t.data?.pages??[]).map(t=>(e===`issues`?t.issues:t.prs).map(e=>e.number)),[t.data,e]),n?.available===!0&&n.commentsDeferred===!0),u=(0,K.useMemo)(()=>new Set(n?.commentsDeferred?(e===`issues`?n.issues:n.prs).map(e=>e.number):[]),[n,e]);return{checkPrNumbers:o,checksMap:c,commentsOf:e=>l[e.number]??(u.has(e.number)?void 0:e.comments)}}function st(e){let[t,n]=xe(),r=t.get(`filter`),i=ce(e,r);return{rawFilterParam:r,filter:i,activeFilter:i??`all`,setFilterParam:e=>n(t=>{let n=new URLSearchParams(t);return e===null?n.delete(`filter`):n.set(`filter`,e),n})}}function ct(e,t,{filter:n,activeFilter:r,setFilterParam:i}){let[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)([]),[l,u]=(0,K.useState)([]),{setProjectFilter:d,activeProject:f}=lt(t),p=e===`issues`&&r===`assigned`,m=p?t?.viewerLogin?[t.viewerLogin]:[]:l;return{query:a,setQuery:o,labelFilter:s,setLabelFilter:c,setProjectFilter:d,activeProject:f,isAssignedFilter:p,effectiveAssignees:m,changeAssignees:e=>{u(e),p&&i(`all`)},clearFilters:()=>{o(``),c([]),u([]),d(``),n!==null&&n!==`all`&&i(`all`)},filtering:a.trim()!==``||s.length>0||e===`issues`&&(m.length>0||f!==``)||n!==null&&n!==`all`,narrowing:a.trim()!==``||s.length>0||e===`issues`&&(!p&&l.length>0||f!==``)}}function lt(e){let[t,n]=(0,K.useState)(``),r=e?.projectsState===`refreshing`||e?.projectsState===`unavailable`,i=r||e?.projects?.some(e=>e.id===t)?t:``;return(0,K.useEffect)(()=>{e&&!r&&t&&!i&&n(``)},[e,t,i,r]),{setProjectFilter:n,activeProject:i}}function ut(e,t,{filter:n,activeFilter:r},a){let o=i(),s=e===`issues`&&(r===`no-task`||r===`has-task`),c=_(o,s,o==="default"),l=(0,K.useMemo)(()=>c.data?pe(c.data,t?.repo,o):null,[c.data,t?.repo,o]),u=se(e,n)?he(n):null,d=v(`pr`,u??``,u!==null&&t?.available===!0),f=u!==null&&d.data?.available?d.data.items:null,p=(0,K.useMemo)(()=>t?.available?e===`issues`?t.issues:t.prs:[],[t,e]),m=(0,K.useMemo)(()=>f?ae(f,p):null,[f,p]),h=dt({view:e,gh:t,activeFilter:r,isAssignedFilter:a,taskFilter:s,taskNumbers:l,runsQuery:c,backedQuery:u,filterHits:f,filterSearch:d});return{backedQuery:u,filterSearch:d,fullList:p,filterRows:m,filterGate:h,openItems:(0,K.useMemo)(()=>h?[]:m??p,[h,m,p]),narrow:(0,K.useMemo)(()=>e===`issues`?r===`no-task`&&l?{excludeNumbers:l}:r===`has-task`&&l?{includeNumbers:l}:{}:r===`mine`&&t?.viewerLogin?{author:t.viewerLogin}:f?{includeNumbers:new Set(f.map(e=>e.number))}:{},[e,r,l,t?.viewerLogin,f])}}function dt({view:e,gh:t,activeFilter:n,isAssignedFilter:r,taskFilter:i,taskNumbers:a,runsQuery:o,backedQuery:s,filterHits:c,filterSearch:l}){return t?.available?(r||e===`prs`&&n===`mine`)&&!t.viewerLogin?{kind:`blocked`,message:`GitHub login unavailable, so this filter cannot be applied.`}:i&&!a?o.isError?{kind:`blocked`,message:`The task list is unavailable, so this filter cannot be applied.`}:{kind:`loading`,message:`Loading tasks…`}:s!==null&&!c?l.data?.available===!1?{kind:`blocked`,message:`GitHub could not be searched: ${l.data.reason??`unknown reason`}.`}:l.isError?{kind:`blocked`,message:`GitHub could not be searched: ${l.error instanceof Error?l.error.message:`the search request failed`}.`}:{kind:`loading`,message:`Searching GitHub…`}:null:null}function Q(e,t){return t?s(t.kind,t.number,{refresh:!0}).then(n=>(e.setQueryData(t.key,n),!0)).catch(()=>!1):Promise.resolve(!0)}function ft(e,t,n,{filterGate:r,filterRows:i,fullList:a}){let o=C.github()[0],s=t===void 0?null:Number.parseInt(t,10),c=!r&&n.data?.available?n.data.items.find(e=>e.number===s):void 0,l=i&&s!==null&&!a.some(e=>e.number===s)?i.find(e=>e.number===s):void 0,u=c??l,[d,f]=(0,K.useState)(null);return(0,K.useEffect)(()=>{u&&f({scope:o,view:e,item:u})},[o,e,u]),{selectedNumber:s,remoteDetail:u??(d?.scope===o&&d.view===e&&d.item.number===s?d.item:null)}}function pt(e,t,n,{fullList:r,filterRows:i},a){let o=l(),s=(0,K.useRef)(null),c=e===`issues`?`issue`:`pr`,u=t?.available===!0&&n!==null&&Number.isSafeInteger(n)&&n>0&&!r.some(e=>e.number===n)&&!i?.some(e=>e.number===n)&&a===null,d=y(c,n??0,u),f=u&&d.data?.available&&d.data.item?.kind===c?d.data.item:null;s.current=u&&n!==null?{kind:c,number:n,key:C.githubItem(c,n)}:null;let[p,m]=(0,K.useState)(!1);return{exactWanted:u,exactItem:d,exactDetail:f,exactTargetRef:s,retryingExact:p,retryExact:()=>{m(!0),Q(o,s.current).then(e=>{m(!1),e||k(`Could not reach GitHub for #${n}`,{tone:`danger`})})}}}function mt(e,t,n){let r=l(),i=(0,K.useRef)(null);return{refresh:x({mutationFn:e=>(Q(r,e),d({refresh:!0,limit:50})),onSuccess:async a=>{await r.cancelQueries({queryKey:C.githubPages(50),exact:!0}),r.setQueryData(C.githubPages(50),{pages:[a],pageParams:[{}]}),r.invalidateQueries({queryKey:C.githubChecks(t)});let o=e===`issues`?`issue`:`pr`,s=(e===`issues`?a.issues:a.prs).map(e=>e.number),l=C.githubCommentCounts(o,s);r.removeQueries({queryKey:C.githubCommentCounts(o,[]).slice(0,4),predicate:e=>e.queryHash!==c(l)}),a.available&&a.commentsDeferred&&s.length>0&&p(o,s,{refresh:!0}).then(e=>r.setQueryData(l,e)).catch(()=>{}),r.invalidateQueries({queryKey:C.githubSearch(e===`issues`?`issue`:`pr`,n)}),r.invalidateQueries({queryKey:C.githubSearch(`pr`,fe)}),r.invalidateQueries({queryKey:C.githubSearch(`pr`,me)});let d=i.current;if(!d){r.removeQueries({queryKey:[`github`,`comments`]});return}let f=C.githubComments(d.kind,d.number);u(d.kind,d.number,{refresh:!0}).then(e=>r.setQueryData(f,e)).catch(()=>{}),r.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==c(f)})},onError:e=>k(e.message,{tone:`danger`})}),openThreadRef:i}}var ht=350;function gt(e,t){let[n,r]=(0,K.useState)(e);return(0,K.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function _t(e,t,{query:n,labelFilter:r,effectiveAssignees:i,activeProject:a},{openItems:o,narrow:s,filterGate:c}){let l=gt(n,ht),u=(0,K.useMemo)(()=>W(o,{query:l,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),[o,l,r,e,i,a,s]),d=n.trim()===l.trim(),f=t?.available===!0&&!c&&d&&Me(l,u),p=v(e===`issues`?`issue`:`pr`,l,f),m=W(o,{query:n,labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}),h=f&&p.data?.available?p.data:null,g=new Set(m.map(e=>e.number)),_=vt(e,h,a,i);return{debouncedQuery:l,searchWanted:f,forgeSearch:p,items:m,searchPayload:h,metadataFailure:_,searchHits:h&&!_?W(h.items,{labels:r,...s,...e===`issues`?{assignees:i,projectId:a}:{}}).filter(e=>!g.has(e.number)):[],...yt(n,d,f,p)}}function vt(e,t,n,r){return e===`issues`&&t?n&&t.items.some(e=>e.projectIds===void 0)?t.projectsReason??`Project board data is incomplete. Refresh to try again.`:r.length&&t.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null}function yt(e,t,n,r){return{searching:e.trim()!==``&&!t||n&&r.isPending,searchFailed:n&&(r.data?.available===!1||r.isError),searchFailureReason:r.data?.available===!1?r.data.reason??`unknown reason`:r.error instanceof Error?r.error.message:`the search request failed`}}function bt({width:e,onWidthChange:t}){let n=(0,K.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(J(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,Y.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(J(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function xt({view:e,changes:t=!1,index:n=!1}){let{n:i}=r(),a=st(e),{rawFilterParam:o,activeFilter:s}=a,c=te(),{pages:l,data:u}=h(50),d=Se(),f=Ct(),p=ze(),m=St({index:n,isDesktop:c,rawFilterParam:o,n:i,rememberedView:ee().data?.githubView}),g=wt(u?.available===!0&&!m.filterScreen),[_,v]=(0,K.useState)(!1),y=ct(e,u,a),b=ut(e,u,a,y.isAssignedFilter),x=_t(e,u,y,b),S=ft(e,i,x.forgeSearch,b),C=pt(e,u,S.selectedNumber,b,S.remoteDetail),w=ot(e,l,u,S.selectedNumber,x.searchHits,b.openItems),{refresh:T,openThreadRef:E}=mt(e,w.checkPrNumbers,x.debouncedQuery),D=rt(e,l,u,b.backedQuery,y.narrowing);if(m.restorePrs)return(0,Y.jsx)(ge,{to:`/github/prs`,replace:!0});if(!u)return l.isError?(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(I,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:l.error.message})}):(0,Y.jsx)(ke,{});E.current=null;let O=()=>T.mutate(C.exactTargetRef.current);if(m.filterScreen&&u.available)return(0,Y.jsx)(Qe,{onRefresh:O,refreshing:T.isPending});if(!u.available)return(0,Y.jsx)(kt,{reason:u.reason,refreshing:T.isPending,onRetry:O});let{labelColors:k,labelOptions:A}=Tt(u,x.searchPayload,b.openItems,b.fullList),j=Et({number:S.selectedNumber,items:x.items,searchHits:x.searchHits,fullList:b.fullList,filterRows:b.filterRows,remoteDetail:S.remoteDetail,exactDetail:C.exactDetail});E.current=j?{kind:j.kind,number:j.number}:null;let{linkFilter:M,listPath:N}=Dt(e,o,s,c),P={view:e,filter:M,colors:k,selected:j,queued:p.queued,checksMap:w.checksMap,commentsOf:w.commentsOf},F=Ot(e,y,b.filterGate,x);return(0,Y.jsxs)(`div`,{ref:g.routeRef,"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:px-7 md:pt-4 md:pb-4`,children:[(0,Y.jsx)(At,{view:e,activeFilter:s,isDesktop:c,rawFilterParam:o,n:i,gh:u}),(0,Y.jsxs)(`div`,{ref:g.workspaceRef,"data-slot":`gh-workspace`,"data-stacked":g.panesStacked,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 md:h-[calc(var(--gh-workspace-height,calc(100dvh-4rem))-1rem)] md:flex-none md:gap-[22px]`,children:[(0,Y.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 bg-background md:gap-[22px]`,children:[(0,Y.jsx)(jt,{view:e,isDesktop:c,gh:u,automationsAvailable:d,onSaveView:f,refreshing:T.isPending,onRefresh:O}),(0,Y.jsx)(Mt,{view:e,gh:u,filters:y,labelOptions:A,labelColors:k,searchPayload:x.searchPayload})]}),(0,Y.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row md:items-stretch md:overflow-hidden`,children:[(0,Y.jsx)(Pt,{view:e,n:i,rows:P,verdict:F,search:x,sidebar:b,list:l,paging:D,width:g.githubListWidth,onWidthChange:g.changeGithubListWidth,expanded:_,onExpandedChange:v}),(0,Y.jsx)(Bt,{view:e,n:i,selected:j,selectedNumber:S.selectedNumber,exact:C,repo:u.repo,rows:P,listPath:N,changes:t,handToAgent:p})]})]})]})}function St({index:e,isDesktop:t,rawFilterParam:n,n:r,rememberedView:i}){return{filterScreen:e&&!t&&n===null&&r===void 0,restorePrs:e&&t&&n===null&&i===`prs`}}function Ct(){let e=l();return t=>{e.setQueryData(C.uiState,e=>({...e,githubView:t})),f({githubView:t}).then(t=>e.setQueryData(C.uiState,t)).catch(t=>{k(t instanceof Error?t.message:String(t),{tone:`danger`}),e.invalidateQueries({queryKey:C.uiState})})}}function wt(e){let[t,n]=(0,K.useState)(Be),[r,i]=(0,K.useState)(!0),a=(0,K.useRef)(null),o=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(!e)return;let n=a.current,r=o.current,s=n?.closest(`[data-slot="main"]`);if(!n||!r||!s)return;let c=window.matchMedia(`(min-width: 768px)`),l=!1,u=()=>{if(l=c.matches&&r.clientWidth>=t+22+360,i(!l),!l||s.clientHeight<1){n.style.removeProperty(`--gh-workspace-height`);return}n.style.setProperty(`--gh-workspace-height`,`${Math.round(s.clientHeight)}px`)};u();let d=new ResizeObserver(u);d.observe(s),d.observe(r);let f=e=>{if(!l||e.ctrlKey||!e.deltaY||Math.abs(e.deltaX)>Math.abs(e.deltaY)||r.getBoundingClientRect().top<=s.getBoundingClientRect().top+1||!(e.target instanceof Element)||!e.target.closest(`[data-slot="gh-panes"]`))return;e.preventDefault();let t=e.deltaMode===1?16:e.deltaMode===2?s.clientHeight:1;s.scrollTop+=e.deltaY*t};return r.addEventListener(`wheel`,f,{passive:!1}),c.addEventListener(`change`,u),()=>{r.removeEventListener(`wheel`,f),d.disconnect(),c.removeEventListener(`change`,u)}},[e,t]),{githubListWidth:t,changeGithubListWidth:e=>{let t=J(e);n(t),Ve(t)},panesStacked:r,routeRef:a,workspaceRef:o}}function Tt(e,t,n,r){return{labelColors:{...t?.labelColors,...e.labelColors},labelOptions:Pe([...n,...r,...t?.items??[]])}}function Et({number:e,items:t,searchHits:n,fullList:r,filterRows:i,remoteDetail:a,exactDetail:o}){return e===null?t[0]??n[0]??null:r.find(t=>t.number===e)??i?.find(t=>t.number===e)??a??o??null}function Dt(e,t,n,r){let i=t===null?null:n;return{linkFilter:i,listPath:B(e,i??(e===`issues`&&!r?`all`:null))}}function Ot(e,{query:t,filtering:n},r,{searching:i,searchFailed:a,searchFailureReason:o,metadataFailure:s,searchHits:c,searchPayload:l,items:u}){let d=e===`issues`?`issues`:`pull requests`;return r?(0,Y.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5`,"data-slot":`gh-filter-gate`,"data-kind":r.kind,children:[r.kind===`loading`?(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}):null,r.message]}):n?i?(0,Y.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,t.trim(),`”…`]}):a?c.length>0?(0,Y.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,o,`. Use Refresh to try again.`]}):u.length>0?(0,Y.jsxs)(`p`,{children:[`GitHub could not be searched: `,o,`.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,` match your filter, and GitHub could not be searched: `,o,`.`]}):s?(0,Y.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,s]}):c.length>0?null:l?.truncated?(0,Y.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):l&&u.length>0?(0,Y.jsxs)(`p`,{children:[`No additional `,d,` match your filter on GitHub.`]}):l?(0,Y.jsxs)(`p`,{children:[`No `,d,` match your filter — open, closed or merged.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,` match your filter.`]}):(0,Y.jsxs)(`p`,{children:[`No open `,d,`.`]})}function kt({reason:e,refreshing:t,onRetry:n}){return(0,Y.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(j,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:e??`unknown reason`,actions:(0,Y.jsx)(a,{variant:`outline`,"data-action":`gh-retry`,disabled:t,onClick:n,children:`Try again`}),children:(0,Y.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Y.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in Squawk works without it.`]})})})}function At({view:e,activeFilter:t,isDesktop:n,rawFilterParam:r,n:i,gh:a}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-masthead`,className:`flex min-w-0 shrink-0 flex-col gap-1 md:flex-row md:items-baseline md:gap-3`,children:[(0,Y.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[15px] md:tracking-normal`,children:n?`${e===`issues`?`Issues`:`Pull requests`} · ${de[t]}`:`GitHub`}),r!==null&&i===void 0?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-context`,className:`flex min-w-0 items-center gap-3 md:hidden`,children:[(0,Y.jsxs)(V,{to:`/github`,"data-slot":`gh-back-filters`,className:`inline-flex min-h-11 items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Y.jsx)(ne,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to filters`]}),t===`all`?null:(0,Y.jsx)(`span`,{"data-slot":`gh-active-filter`,className:`truncate text-xs text-soft-foreground`,children:[...le,...oe].find(e=>e.id===t)?.label})]}):null,a.repo?(0,Y.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground md:text-[11px] md:text-soft-foreground`,children:[(0,Y.jsx)(`span`,{"data-slot":`gh-repo`,children:a.repo}),(0,Y.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,a.syncedAt?`Synced ${z(a.syncedAt)} ago`:`Not synced yet`]})]}):null]})}function jt({view:e,isDesktop:t,gh:n,automationsAvailable:r,onSaveView:i,refreshing:a,onRefresh:s}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Y.jsxs)(G,{to:t?`/github`:`/github?filter=all`,active:e===`issues`,onClick:()=>i(`issues`),children:[`Issues · `,n.issuesTotal??n.issues.length]}),(0,Y.jsxs)(G,{to:`/github/prs`,active:e===`prs`,onClick:()=>i(`prs`),children:[`Pull requests · `,n.prsTotal??n.prs.length]}),r?(0,Y.jsx)(V,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:a,onClick:s,className:`gh-utility`,children:[(0,Y.jsx)(N,{size:16,"aria-hidden":`true`,className:o(`size-3.5`,a&&`motion-safe:animate-spin`)}),`Refresh`]})]})}function Mt({view:e,gh:t,filters:n,labelOptions:r,labelColors:i,searchPayload:a}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Y.jsx)(M,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Y.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:e===`issues`?`Filter issues…`:`Filter pull requests…`,value:n.query,onChange:e=>n.setQuery(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Y.jsx)(Kt,{options:r,colors:i,selected:n.labelFilter,onChange:n.setLabelFilter}),e===`issues`?(0,Y.jsx)(Ze,{data:{...t,issues:[...t.issues,...a?.items??[]]},assignees:n.effectiveAssignees,projectId:n.activeProject,onAssigneesChange:n.changeAssignees,onProjectChange:n.setProjectFilter}):null,(0,Y.jsx)(`button`,{type:`button`,disabled:!n.filtering,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:n.clearFilters,children:`Clear filters`})]})}function $(e,t){return e.kind===`pr`?t?.[e.number]??e.checks:e.checks}function Nt(e,t){return(0,Y.jsx)(Gt,{item:e,view:t.view,filter:t.filter,colors:t.colors,active:t.selected?.url===e.url,queued:t.queued.has(e.url),checks:$(e,t.checksMap),comments:t.commentsOf(e)})}function Pt({view:e,n:t,rows:n,verdict:r,search:i,sidebar:a,list:o,paging:s,width:c,onWidthChange:l,expanded:u,onExpandedChange:d}){let{items:f,searchHits:p}=i,m=e===`issues`&&t!==void 0&&!u;return(0,Y.jsxs)(`section`,{ref:s.setListEl,"data-slot":`gh-list`,"data-mobile-preview":m||void 0,style:{"--github-list-width":`${c}px`},className:`relative flex w-full min-h-0 min-w-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0 md:overflow-x-hidden md:overflow-y-auto`,children:[f.length===0?r&&(0,Y.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):(0,Y.jsx)(Ft,{items:f,rows:n,compactPreview:m,paging:s}),s.pagingAvailable?(0,Y.jsx)(It,{view:e,list:o,paging:s}):null,(0,Y.jsx)(Lt,{backedQuery:a.backedQuery,filterSearch:a.filterSearch}),(0,Y.jsx)(Rt,{view:e,n:t,count:f.length,expanded:u,onExpandedChange:d}),f.length>0&&i.searchWanted&&r?(0,Y.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:r}):null,p.length>0?(0,Y.jsx)(zt,{hits:p,searchPayload:i.searchPayload,rows:n}):null,(0,Y.jsx)(bt,{width:c,onWidthChange:l})]})}function Ft({items:e,rows:t,compactPreview:n,paging:r}){let{setRowsEl:i,scrollOwner:a,listEl:o,scrollOwnerRef:s,startMargin:c}=r,l=e.map((e,r)=>(0,Y.jsx)(`div`,{role:`listitem`,"data-slot":`gh-row-item`,"data-divided":r>0||void 0,"data-compact-hidden":n&&r>=2&&t.selected?.url!==e.url||void 0,children:Nt(e,t)},e.url));return(0,Y.jsx)(`div`,{ref:i,"data-slot":`gh-rows`,"data-virtualized":a?`true`:void 0,role:`list`,children:a?(0,Y.jsx)(Oe,{scrollRef:s,startMargin:c,children:l},a===o?`list`:`main`):l})}function It({view:e,list:t,paging:n}){return(0,Y.jsx)(`div`,{ref:n.loadMoreRef,"data-slot":`gh-load-more`,className:`flex min-h-6 items-center justify-center gap-1.5 px-4 pb-3 text-xs text-soft-foreground`,children:t.isFetchingNextPage?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(R,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Loading more…`]}):t.isFetchNextPageError?(0,Y.jsxs)(Y.Fragment,{children:[`Could not load more.`,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-retry`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Retry`})]}):n.manualPaging?(0,Y.jsxs)(Y.Fragment,{children:[`Filters cover the loaded `,e===`issues`?`issues`:`pull requests`,`.`,(0,Y.jsx)(`button`,{type:`button`,"data-slot":`gh-load-more-manual`,onClick:()=>void t.fetchNextPage(),className:`font-medium text-accent-text hover:underline`,children:`Load more`})]}):null})}function Lt({backedQuery:e,filterSearch:t}){return e!==null&&t.data?.available&&t.data.truncated?(0,Y.jsxs)(`div`,{"data-slot":`gh-filter-note`,role:`status`,className:`px-4 py-3 text-xs text-soft-foreground`,children:[`Showing the first `,t.data.items.length,` matches from GitHub search; more may exist.`]}):null}function Rt({view:e,n:t,count:n,expanded:r,onExpandedChange:i}){return e===`issues`&&t!==void 0&&n>2?(0,Y.jsx)(a,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":r,onClick:()=>i(e=>!e),children:r?`Show fewer issues`:`View all ${n} issues`}):null}function zt({hits:e,searchPayload:t,rows:n}){return(0,Y.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Y.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,t?.truncated?` (first matches)`:``]}),(0,Y.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:e.map(e=>(0,Y.jsx)(`li`,{children:Nt(e,n)},e.url))})]})}function Bt({view:e,n:t,selected:n,selectedNumber:r,exact:i,repo:a,rows:s,listPath:c,changes:l,handToAgent:u}){let{exactWanted:d,exactItem:f}=i;return(0,Y.jsx)(`section`,{"data-slot":`gh-detail`,className:o(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card md:overflow-y-auto`,t===void 0?`hidden md:flex`:`flex`),children:n?(0,Y.jsx)(Vt,{item:n,n:t,repo:a,rows:s,listPath:c,changes:l,handToAgent:u}):d&&f.isPending?(0,Y.jsx)(`div`,{"data-slot":`gh-detail-loading`,className:`flex min-h-full flex-1 flex-col`,children:(0,Y.jsx)(U,{icon:(0,Y.jsx)(R,{className:`motion-safe:animate-spin`}),tone:`neutral`,heading:`h2`,title:`Loading #${r}…`,subtitle:`It is not among the open items, so the tab is asking GitHub for it.`})}):d&&(f.isError||f.data?.available===!1)?(0,Y.jsx)(Ht,{number:r,exact:i}):(0,Y.jsx)(Ut,{view:e,number:r})})}function Vt({item:e,n:t,repo:n,rows:r,listPath:i,changes:a,handToAgent:o}){let{workflows:s,skillList:c,workflow:l,setWorkflow:u,selectedSkills:d,setSelectedSkills:f,engine:p,setEngine:m,queued:h,onQueued:g}=o;return(0,Y.jsx)(Ie,{item:e,comments:r.commentsOf(e),afterHeading:e.kind===`issue`?(0,Y.jsx)(He,{number:e.number,repo:n},t??`list`):void 0,backLink:{to:i},subNav:{filter:r.filter,changes:a},onRunAgent:Wt,colors:r.colors,checks:$(e,r.checksMap),children:(0,Y.jsx)(Fe,{item:e,workflows:s.data?.workflows??[],skills:c,workflow:l,onWorkflowChange:u,selectedSkills:d,onSkillsChange:f,engine:p,onEngineChange:m,queuedRunId:h.get(e.url)??null,onQueued:g},e.url)})}function Ht({number:e,exact:t}){let{exactItem:n,retryingExact:r,retryExact:i}=t;return(0,Y.jsx)(U,{icon:(0,Y.jsx)(I,{size:16}),tone:n.isError?`danger`:`neutral`,heading:`h2`,title:`Could not load #${e}`,subtitle:n.data?.available===!1?n.data.reason:n.error instanceof Error?n.error.message:`The request failed.`,actions:(0,Y.jsx)(a,{variant:`outline`,disabled:r,onClick:i,children:`Retry`})})}function Ut({view:e,number:t}){return(0,Y.jsx)(U,{icon:e===`issues`?(0,Y.jsx)(L,{size:16}):(0,Y.jsx)(A,{size:16}),tone:`neutral`,heading:`h2`,title:t===null?`Nothing selected`:`Not found`,subtitle:t===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${t} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${t} above to look it up on GitHub, closed and merged included.`})}function Wt(){let e=document.querySelector(`[data-slot="gh-detail-inner"] [data-slot="gh-custom-prompt"]`);e?.scrollIntoView({block:`center`}),e?.focus({preventScroll:!0})}function Gt({item:e,view:t,filter:n,colors:r,active:i,queued:a,checks:s,comments:c}){let d=e.kind===`issue`?L:A,f=l(),p=()=>{f.prefetchQuery({queryKey:C.githubComments(e.kind,e.number),queryFn:({signal:t})=>u(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Y.jsxs)(V,{to:B(t,n,e.number),draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Le(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:p,onFocus:p,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":i?`page`:void 0,title:`Drag into the composer to prefill a task`,className:o(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,i&&`bg-accent-strong/10 text-accent-text`),children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`,"data-slot":`gh-row-icon`,className:o(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-title`,className:o(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,i&&`font-semibold`),children:e.title})]}),(0,Y.jsxs)(`span`,{"data-slot":`gh-row-meta`,className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[11px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Y.jsxs)(`span`,{children:[`#`,e.number]}),(0,Y.jsx)(`span`,{"data-slot":`gh-row-author`,className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Y.jsx)(`span`,{children:z(e.createdAt)}),(0,Y.jsx)(Ae,{count:c}),s?(0,Y.jsx)(Ne,{checks:s}):null,a?(0,Y.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Y.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Y.jsx)(Re,{label:e,color:r[e],plain:!0},e))}):null]})}function Kt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,K.useState)(!1),s=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Y.jsxs)(D,{open:i,onOpenChange:a,children:[(0,Y.jsx)(E,{asChild:!0,children:(0,Y.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:o(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[n.length>0?`Labels · ${n.length}`:`Labels`,(0,Y.jsx)(F,{size:12,"aria-hidden":`true`,className:`size-3 shrink-0 text-soft-foreground`})]})}),(0,Y.jsx)(T,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Y.jsxs)(ve,{children:[(0,Y.jsx)(be,{placeholder:`Filter labels…`}),(0,Y.jsxs)(ye,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Y.jsx)(_e,{children:`No labels.`}),n.length>0?(0,Y.jsxs)(H,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Y.jsxs)(H,{value:e,onSelect:()=>s(e),className:`min-h-11`,children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:je(t[e])}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Y.jsx)(P,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}export{xt as GithubRoute};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{C as t,p as n,t as r,u as i}from"./button-DGwhwRuD.js";import{i as a,t as o}from"./react-runtime-CCIEwYL0.js";import{N as s,Y as c}from"./queries-B4jd0jVr.js";import{A as l,B as u,D as d,F as f,I as p,J as m,K as h,M as g,O as _,P as v,Q as ee,R as te,S as ne,V as y,W as b,X as x,Z as S,_ as re,a as ie,b as ae,d as C,f as oe,h as se,i as w,j as T,k as E,l as D,n as O,o as k,p as A,q as j,r as M,t as N,u as P,v as F,x as I,y as L,z as R}from"./activity-motion-W7LQQzqR.js";import{Mt as z,jt as B}from"./index-FZIxXka9.js";var V=e(a(),1);function H(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function U(e){let t=[],n=[];for(let r of e)y(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function W(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function G(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function K(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>j(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function ce(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=o(),le={w:104,h:20};function ue(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,ae(r.getBoundingClientRect(),t))}return n}function de(e,t,n=[]){let r=ue(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...F(e),kind:`wait`}))],o=I(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...L(t,n,i,o.get(e.requestId))})}let c=ne(s.map(e=>({id:e.id,at:e.label})),le,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-[10.5px] whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function pe({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:i(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,x(S(t.since,n))]})}function me({arc:e,request:t,now:n,motion:r}){let a=oe(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:i(J,a?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[a?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,x(S(t.createdAt,n))]})}var he=[],ge=new Set;function _e({arcs:e,waits:t=he,active:n=ge,layoutKey:r,now:a,motion:o=f,paused:s=!1}){let c=V.useRef(null),l=se(c,V.useCallback(n=>de(n,e,t),[e,t]),fe,`[data-activity-pill]`,r),u=V.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=re(o.comets,u,s),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e])),h=V.useId().replace(/[^a-zA-Z0-9_-]/g,``),g=`activity-arrow-arc-${h}`,_=`activity-ring-arc-${h}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:g,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(D,{id:_})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${_})`,className:i(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,A(o,e.id))},e.id)}let t=C(o,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${g})`,className:i(`stroke-message-peer-accent`,P(t,e.id in o.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,q.jsx)(pe,{arc:e,wait:t,now:a,motion:o},e.id);let n=p.get(e.id);return n?(0,q.jsx)(me,{arc:e,request:n,now:a,motion:o},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,ve=[],ye=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function be({task:e}){let t=e.workers.filter(e=>j(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(g,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function xe({projectId:e,task:t,requests:r,waits:a=ve,index:o,ctx:s,motion:c=f,linked:u=!1,onHover:p}){let h=m(t,s);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":h.action,"data-linked":u?`true`:void 0,...E(t.runId,p),className:i(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,h.action?`border-pending`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in c.entering&&`activity-card-enter`),children:[(0,q.jsx)(d,{task:t,motion:c,glow:h.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(g,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(n,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(l,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`mt-[3px] ml-[19px] truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,q.jsx)(v,{"data-slot":`activity-verb`,tone:h.tone,className:`font-semibold`,children:h.verb}),` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:i(h.mono&&`font-mono text-[11px]`),children:h.main})]}),(0,q.jsx)(_,{texts:te(t.runId,r,o,a)}),(0,q.jsx)(be,{task:t}),(0,q.jsx)(T,{runId:t.runId,requests:r,waits:a,index:o,link:n,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:ye})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Se=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-border bg-card px-4 pt-3.5 pb-4`,Ce=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function Q({project:e,headingId:t,detail:r,to:i,label:a}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:r}),(0,q.jsx)(n,{to:i,className:Ce,children:a})]})}function $({project:e,notice:t}){let n=V.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)(Q,{project:e,headingId:n,detail:t,to:Se(e.projectId),label:`Open project →`})})}function we(e,t){return V.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return W({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Te({project:e,now:t,motion:n=f,paused:r=!1}){let a=V.useId(),o=V.useMemo(()=>b(e),[e]),s=we(e,n),c=V.useMemo(()=>u(e.tasks),[e.tasks]),l=V.useMemo(()=>G(e.tasks,[...c,...p(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=k(c),m={now:t,titleOf:e=>R(o,e)},h=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${l.map(e=>e.id).join(`,`)}`,g=s.length>0||l.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":a,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)(Q,{project:e,headingId:a,detail:K(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:i(`relative mt-3`,g&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:i(`grid grid-cols-[repeat(auto-fill,minmax(min(100%,220px),1fr))] items-start gap-3.5`,g&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(xe,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:o,ctx:m,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),g?(0,q.jsx)(_e,{arcs:s,waits:l,active:d.active,layoutKey:h,now:t,motion:n,paused:r}):null]})]})}function Ee(e){let t=y(e.project);return t===void 0?(0,q.jsx)(Te,{...e}):(0,q.jsx)($,{project:e.project,notice:t})}function De({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[ce(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(V.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(n,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Oe={kind:`workspace`};function ke(){let e=c().data?.projects,{order:t}=B();return V.useMemo(()=>e?z(e,t).map(e=>e.id):void 0,[e,t])}function Ae(){let e=ee(Oe),n=c(),i=s(),a=t().state?.activityProjectId,o=ke(),l=N(e.data?.generatedAt,e.dataUpdatedAt),u=n.data?.bootProject??i.data?.bootProject??null,d=typeof a==`string`&&n.data?.projects.some(e=>e.id===a&&e.status!==`missing`)?a:u,f=e.data?.projects,p=V.useMemo(()=>U(H(f??[],o)),[f,o]),{motion:m,paused:g,reduced:_}=O(e.data,`workspace`);return(0,q.jsxs)(`div`,{"data-route":`activity-global`,"data-activity-paused":g?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,q.jsx)(M,{name:`All projects`,now:e.data?l:void 0,stale:e.isError,children:(0,q.jsx)(w,{scope:`all`,projectId:d})}),f?(0,q.jsx)(ie,{summary:h(f),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!f?(0,q.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(r,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,f&&p.panels.length===0&&p.idle.length===0?(0,q.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No projects to show.`}):null,(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3.5`,children:p.panels.map(e=>(0,q.jsx)(Ee,{project:e,now:l,motion:m,paused:g||_},e.projectId))}),(0,q.jsx)(De,{projects:p.idle,belowPanels:p.panels.length>0})]})}export{Ae as GlobalActivityRoute};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{C as r,p as i,t as a,u as o}from"./button-RJMdCnZw.js";import{N as s,Y as c}from"./queries-r1Fc1fWN.js";import{A as l,B as u,D as d,F as f,I as p,J as m,K as h,M as g,O as _,P as v,Q as ee,R as te,S as ne,V as y,W as b,X as x,Z as S,_ as re,a as ie,b as ae,d as C,f as oe,h as se,i as w,j as T,k as E,l as D,n as O,o as k,p as A,q as j,r as M,t as N,u as P,v as F,x as I,y as L,z as R}from"./activity-motion-CjiZJB7H.js";import{Mt as z,Nt as B}from"./index-DUuc-42H.js";var V=e(t(),1);function H(e,t){if(!t||t.length===0)return[...e];let n=new Map(t.map((e,t)=>[e,t])),r=e.filter(e=>n.has(e.projectId)),i=e.filter(e=>!n.has(e.projectId));return r.sort((e,t)=>(n.get(e.projectId)??0)-(n.get(t.projectId)??0)),[...r,...i]}function U(e){let t=[],n=[];for(let r of e)y(r)===void 0&&r.tasks.length===0?n.push(r):t.push(r);return{panels:t,idle:n}}function W(e){let t=new Set(e.tasks.map(e=>e.runId));return e.requests.filter(e=>e.relationship===`peer`&&t.has(e.senderRunId)&&t.has(e.recipientRunId))}function G(e,t){let n=new Set(e.map(e=>e.runId));return t.filter(e=>n.has(e.waiterRunId)&&n.has(e.peerRunId))}function K(e){let t=e.tasks.length,n=e.tasks.reduce((e,t)=>e+t.workers.filter(e=>j(e.status)).length,0),r=[`${t} active task${t===1?``:`s`}`];return n>0&&r.push(`${n} worker${n===1?``:`s`}`),r.join(` · `)}function ce(e,t){let n=t?`more `:``;return e===1?`1 ${n}project has no active work:`:`${e} ${n}projects have no active work:`}var q=n(),le={w:104,h:20};function ue(e){let t=e.getBoundingClientRect(),n=new Map;for(let r of e.querySelectorAll(`[data-activity-pill]`)){let e=r.getAttribute(`data-activity-pill`);e&&n.set(e,ae(r.getBoundingClientRect(),t))}return n}function de(e,t,n=[]){let r=ue(e),i=[...r.values()],a=[...t.map(e=>({requestId:e.requestId,senderRunId:e.senderRunId,recipientRunId:e.recipientRunId,kind:`peer`})),...n.map(e=>({...F(e),kind:`wait`}))],o=I(a),s=[];for(let e of a){let t=r.get(e.senderRunId),n=r.get(e.recipientRunId);t&&n&&s.push({id:e.requestId,kind:e.kind,...L(t,n,i,o.get(e.requestId))})}let c=ne(s.map(e=>({id:e.id,at:e.label})),le,`x`);return s.map(e=>({...e,label:c.get(e.id)??e.label}))}function fe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.d===t[n]?.d&&e.label.x===t[n]?.label.x&&e.label.y===t[n]?.label.y)}var J=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-md border bg-background px-1.5 py-px text-[10.5px] whitespace-nowrap text-foreground tabular-nums max-md:hidden`;function pe({arc:e,wait:t,now:n,motion:r}){return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:o(J,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Waiting`}),` · `,x(S(t.since,n))]})}function me({arc:e,request:t,now:n,motion:r}){let i=oe(r,e.id);return(0,q.jsxs)(`span`,{"data-slot":`activity-arc-label`,"data-request":e.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y},className:o(J,i?`border-success`:`border-message-peer-accent`,C(r,e.id)===`fade`&&`activity-line-out`),children:[i?(0,q.jsx)(`span`,{className:`font-semibold text-success`,children:`Replied`}):(0,q.jsx)(`span`,{className:`font-semibold text-message-peer-accent`,children:`Request`}),` · `,x(S(t.createdAt,n))]})}var he=[],ge=new Set;function _e({arcs:e,waits:t=he,active:n=ge,layoutKey:r,now:i,motion:a=f,paused:s=!1}){let c=V.useRef(null),l=se(c,V.useCallback(n=>de(n,e,t),[e,t]),fe,`[data-activity-pill]`,r),u=V.useMemo(()=>new Set(l.map(e=>e.id)),[l]),d=re(a.comets,u,s),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e])),h=V.useId().replace(/[^a-zA-Z0-9_-]/g,``),g=`activity-arrow-arc-${h}`,_=`activity-ring-arc-${h}`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`svg`,{ref:c,"data-slot":`activity-arcs`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible max-md:hidden`,children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsx)(`marker`,{id:g,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,q.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,q.jsx)(D,{id:_})]}),l.map(e=>{if(e.kind===`wait`){let t=n.has(e.id);return(0,q.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":t?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:t?3:2.2,markerEnd:`url(#${_})`,className:o(`stroke-message-peer-accent`,t?`opacity-100`:`opacity-80`,A(a,e.id))},e.id)}let t=C(a,e.id);return(0,q.jsx)(`path`,{"data-request":e.id,"data-kind":`peer`,"data-phase":t,d:e.d,fill:`none`,strokeDasharray:t===`replied`?void 0:`6 5`,strokeWidth:2,markerEnd:`url(#${g})`,className:o(`stroke-message-peer-accent`,P(t,e.id in a.opening))},e.id)}),(0,q.jsx)(`g`,{ref:d,"data-slot":`activity-comets`})]}),l.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,q.jsx)(pe,{arc:e,wait:t,now:i,motion:a},e.id);let n=p.get(e.id);return n?(0,q.jsx)(me,{arc:e,request:n,now:i,motion:a},e.id):null})]})}var Y=(e,t)=>`/p/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}`,ve=[],ye=`relative z-[1] inline-flex min-h-11 items-center text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring`;function be({task:e}){let t=e.workers.filter(e=>j(e.status));return t.length===0?null:(0,q.jsxs)(`div`,{"data-slot":`activity-pill-workers`,className:`mt-1.5 ml-[19px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[t.map(e=>(0,q.jsx)(g,{run:e,role:`worker`},e.runId)),(0,q.jsxs)(`span`,{className:`ml-0.5`,children:[t.length,` worker`,t.length===1?``:`s`]})]})}function xe({projectId:e,task:t,requests:n,waits:r=ve,index:a,ctx:s,motion:c=f,linked:u=!1,onHover:p}){let h=m(t,s);return(0,q.jsxs)(`li`,{"data-activity-pill":t.runId,"data-rung":t.rung,"data-action":h.action,"data-linked":u?`true`:void 0,...E(t.runId,p),className:o(`relative min-w-0 rounded-[10px] border bg-card-2 px-2.5 py-2`,h.action?`border-pending`:`border-border`,u&&`outline-2 outline-offset-2 outline-message-peer-accent`,t.runId in c.entering&&`activity-card-enter`),children:[(0,q.jsx)(d,{task:t,motion:c,glow:h.action!==void 0}),(0,q.jsxs)(`div`,{className:`flex items-center gap-[7px]`,children:[(0,q.jsx)(g,{run:t,role:`root`}),(0,q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[12.5px] font-medium`,children:(0,q.jsx)(i,{to:Y(e,t.runId),className:`after:absolute after:inset-0 after:rounded-[10px] after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:t.title})}),(0,q.jsx)(l,{rate:t.rate,className:`h-3 w-10`})]}),(0,q.jsxs)(`p`,{"data-slot":`activity-pill-line`,className:`mt-[3px] ml-[19px] truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,q.jsx)(v,{"data-slot":`activity-verb`,tone:h.tone,className:`font-semibold`,children:h.verb}),` · `,(0,q.jsx)(`span`,{"data-slot":`activity-main`,className:o(h.mono&&`font-mono text-[11px]`),children:h.main})]}),(0,q.jsx)(_,{texts:te(t.runId,n,a,r)}),(0,q.jsx)(be,{task:t}),(0,q.jsx)(T,{runId:t.runId,requests:n,waits:r,index:a,link:i,pathOf:t=>Y(e,t),className:`mt-1 ml-[19px] flex flex-col md:hidden`,linkClassName:ye})]})}var X=e=>`/p/${encodeURIComponent(e)}/activity`,Se=e=>`/p/${encodeURIComponent(e)}/`,Z=`rounded-xl border border-border bg-card px-4 pt-3.5 pb-4`,Ce=`ml-auto inline-flex items-center text-[12px] text-accent-text hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`;function Q({project:e,headingId:t,detail:n,to:r,label:a}){return(0,q.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,q.jsx)(`h2`,{id:t,className:`min-w-0 truncate text-[14px] font-semibold`,children:e.name}),(0,q.jsx)(`span`,{"data-slot":`activity-panel-detail`,className:`text-[12px] text-muted-foreground`,children:n}),(0,q.jsx)(i,{to:r,className:Ce,children:a})]})}function $({project:e,notice:t}){let n=V.useId();return(0,q.jsx)(`section`,{"aria-labelledby":n,"data-slot":`activity-panel`,"data-project":e.projectId,"data-notice":`true`,className:Z,children:(0,q.jsx)(Q,{project:e,headingId:n,detail:t,to:Se(e.projectId),label:`Open project →`})})}function we(e,t){return V.useMemo(()=>{let n=new Set(e.requests.map(e=>e.requestId)),r=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!n.has(t.request.requestId)).map(e=>e.request);return W({tasks:e.tasks,requests:[...e.requests,...r]})},[e,t.closing])}function Te({project:e,now:t,motion:n=f,paused:r=!1}){let i=V.useId(),a=V.useMemo(()=>b(e),[e]),s=we(e,n),c=V.useMemo(()=>u(e.tasks),[e.tasks]),l=V.useMemo(()=>G(e.tasks,[...c,...p(e.projectId,c,n)]),[e.tasks,e.projectId,c,n]),d=k(c),m={now:t,titleOf:e=>R(a,e)},h=`${e.tasks.map(e=>e.runId).join(`,`)}:${s.map(e=>e.requestId).join(`,`)}:${l.map(e=>e.id).join(`,`)}`,g=s.length>0||l.length>0;return(0,q.jsxs)(`section`,{"aria-labelledby":i,"data-slot":`activity-panel`,"data-project":e.projectId,className:Z,children:[(0,q.jsx)(Q,{project:e,headingId:i,detail:K(e),to:X(e.projectId),label:`Open project activity →`}),(0,q.jsxs)(`div`,{className:o(`relative mt-3`,g&&`md:mt-1 md:pt-10`),children:[(0,q.jsx)(`ul`,{"data-slot":`activity-pills`,"aria-label":`${e.name} tasks`,className:o(`grid grid-cols-[repeat(auto-fill,minmax(min(100%,220px),1fr))] items-start gap-3.5`,g&&`md:gap-y-11`),children:e.tasks.map(t=>(0,q.jsx)(xe,{projectId:e.projectId,task:t,requests:e.requests,waits:c,index:a,ctx:m,motion:n,linked:d.linked.has(t.runId),onHover:d.onHover},t.runId))}),g?(0,q.jsx)(_e,{arcs:s,waits:l,active:d.active,layoutKey:h,now:t,motion:n,paused:r}):null]})]})}function Ee(e){let t=y(e.project);return t===void 0?(0,q.jsx)(Te,{...e}):(0,q.jsx)($,{project:e.project,notice:t})}function De({projects:e,belowPanels:t}){return e.length===0?null:(0,q.jsxs)(`p`,{"data-slot":`activity-idle`,className:`text-[12.5px] text-muted-foreground`,children:[ce(e.length,t),` `,e.map((e,t)=>(0,q.jsxs)(V.Fragment,{children:[t>0?`, `:null,(0,q.jsx)(i,{to:X(e.projectId),"data-project":e.projectId,className:`text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.name})]},e.projectId))]})}var Oe={kind:`workspace`};function ke(){let e=c().data?.projects,{order:t}=z();return V.useMemo(()=>e?B(e,t).map(e=>e.id):void 0,[e,t])}function Ae(){let e=ee(Oe),t=c(),n=s(),i=r().state?.activityProjectId,o=ke(),l=N(e.data?.generatedAt,e.dataUpdatedAt),u=t.data?.bootProject??n.data?.bootProject??null,d=typeof i==`string`&&t.data?.projects.some(e=>e.id===i&&e.status!==`missing`)?i:u,f=e.data?.projects,p=V.useMemo(()=>U(H(f??[],o)),[f,o]),{motion:m,paused:g,reduced:_}=O(e.data,`workspace`);return(0,q.jsxs)(`div`,{"data-route":`activity-global`,"data-activity-paused":g?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,q.jsx)(M,{name:`All projects`,now:e.data?l:void 0,stale:e.isError,children:(0,q.jsx)(w,{scope:`all`,projectId:d})}),f?(0,q.jsx)(ie,{summary:h(f),tasksTo:`/tasks`,bumps:m.bumps}):null,e.isPending?(0,q.jsx)(`p`,{"data-slot":`activity-loading`,role:`status`,className:`text-xs text-muted-foreground`,children:`Loading activity…`}):null,e.isError&&!f?(0,q.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-3 text-[13px] text-muted-foreground`,children:[`Could not load activity: `,e.error.message,(0,q.jsx)(a,{size:`sm`,variant:`outline`,onClick:()=>void e.refetch(),className:`max-md:min-h-11`,children:`Retry`})]}):null,f&&p.panels.length===0&&p.idle.length===0?(0,q.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No projects to show.`}):null,(0,q.jsx)(`div`,{"data-slot":`activity-panels`,className:`flex flex-col gap-3.5`,children:p.panels.map(e=>(0,q.jsx)(Ee,{project:e,now:l,motion:m,paused:g||_},e.projectId))}),(0,q.jsx)(De,{projects:p.idle,belowPanels:p.panels.length>0})]})}export{Ae as GlobalActivityRoute};
@@ -1 +1 @@
1
- import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./zoomable-image-C7mEDZaS.js";var n=e();function r(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function i({file:e,imageSrc:r,onOpenInApp:i}){return e.status===`deleted`?(0,n.jsx)(a,{children:`Image deleted — only the new side can be previewed.`}):r?(0,n.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,n.jsx)(t,{src:r(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,n.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-[11px] font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,n.jsx)(a,{children:`Binary file — no text diff.`})}function a({children:e}){return(0,n.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}export{r as n,i as t};
1
+ import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./zoomable-image-DefjK4q5.js";var n=e();function r(e){return e.image===!0&&(e.binary===!0||e.patch===``)}function i({file:e,imageSrc:r,onOpenInApp:i}){return e.status===`deleted`?(0,n.jsx)(a,{children:`Image deleted — only the new side can be previewed.`}):r?(0,n.jsxs)(`div`,{"data-slot":`diff-image-preview`,className:`flex flex-col items-center gap-2 p-4`,children:[(0,n.jsx)(t,{src:r(e.path),alt:e.path,className:`max-h-[60vh] max-w-full rounded-sm`}),i?(0,n.jsx)(`button`,{type:`button`,"data-slot":`diff-image-open`,onClick:()=>i(e.path),className:`text-[11px] font-medium text-soft-foreground hover:text-foreground hover:underline`,children:`Open in default app`}):null]}):(0,n.jsx)(a,{children:`Binary file — no text diff.`})}function a({children:e}){return(0,n.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:e})}export{r as n,i as t};