@eliya-oss/agent-diff 0.1.0-alpha.219 → 0.1.0-alpha.220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/main.js +198 -113
- package/dist/web/nitro.json +1 -1
- package/dist/web/public/assets/{index-Drcgn18b.js → index-RB6aBuh0.js} +2 -2
- package/dist/web/public/assets/{review-n355efiY.js → review-DV4b3ziW.js} +1 -1
- package/dist/web/server/_ssr/{review-C9HjDh4D.mjs → review-CrJpbEai.mjs} +2 -2
- package/dist/web/server/_ssr/{router-D1afwNBo.mjs → router--oWwEEA0.mjs} +4 -4
- package/dist/web/server/_ssr/ssr.mjs +2 -2
- package/dist/web/server/{_tanstack-start-manifest_v-B_8y6kG9.mjs → _tanstack-start-manifest_v-Bp3WfTRd.mjs} +4 -4
- package/dist/web/server/index.mjs +14 -14
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +8 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,$n as t,$t as n,A as r,An as i,Ar as a,At as o,B as s,Bn as c,Bt as l,C as u,Cn as d,Cr as f,Ct as p,D as m,Dr as h,Dt as g,E as _,Er as v,Et as y,F as b,Fn as x,Ft as S,G as C,Gn as w,Gt as T,H as E,Hn as D,Ht as O,I as k,In as A,It as ee,J as j,Jn as M,Jt as N,K as P,Kn as F,Kt as te,L as I,Ln as ne,Lt as L,M as re,Mn as ie,Mt as ae,N as oe,Nn as se,O as R,Or as z,Ot as ce,P as le,Pn as ue,Pt as de,Q as B,Qn as V,Qt as fe,R as pe,Rn as H,Rt as me,S as he,Sn as ge,Sr as _e,St as ve,T as ye,Tn as be,Tr as xe,Tt as Se,U as Ce,Un as we,Ut as Te,V as Ee,Vn as De,Vt as Oe,W as ke,Wn as Ae,Wt as je,X as Me,Xn as Ne,Xt as Pe,Y as Fe,Yn as Ie,Yt as Le,Z as Re,Zn as ze,Zt as Be,_ as Ve,_r as He,_t as Ue,a as We,an as Ge,ar as Ke,at as qe,b as Je,bn as Ye,br as Xe,bt as Ze,c as Qe,cn as $e,cr as et,ct as tt,d as nt,dn as rt,dr as it,dt as at,en as ot,er as st,et as ct,f as lt,fn as ut,fr as dt,ft,g as pt,gn as mt,gr as U,gt as ht,h as gt,hr as W,ht as _t,i as vt,in as yt,ir as bt,it as xt,j as St,jt as Ct,k as wt,kr as Tt,kt as Et,l as Dt,lr as Ot,lt as kt,m as At,mn as jt,mr as Mt,mt as Nt,n as Pt,nn as Ft,nr as It,nt as Lt,o as Rt,on as zt,or as Bt,ot as Vt,p as Ht,pn as Ut,pr as Wt,pt as Gt,q as Kt,qn as qt,qt as Jt,r as Yt,rn as Xt,rr as Zt,rt as Qt,s as $t,sn as en,sr as tn,st as nn,t as rn,tn as an,tr as G,tt as on,u as sn,un as cn,ur as ln,ut as un,v as dn,vn as fn,vr as pn,vt as mn,w as hn,wn as gn,wr as _n,wt as vn,x as yn,xn as bn,xr as xn,xt as Sn,y as Cn,yn as wn,yr as Tn,yt as En,z as Dn,zn as On,zt as kn}from"./index-Drcgn18b.js";import{i as An,n as jn,r as Mn,t as Nn}from"./jsx-runtime-EIAPxkjE.js";var Pn={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};Pn.node;var Fn=v(Pn),In={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};In.node;var Ln=v(In),Rn={name:`arrow-up-to-line`,size:24,node:[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]};Rn.node;var zn=v(Rn),Bn={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Bn.node;var Vn=v(Bn),Hn={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};Hn.node;var Un=v(Hn),Wn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Wn.node;var Gn=v(Wn),Kn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Kn.node;var qn=v(Kn),Jn={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Jn.node;var Yn=v(Jn),Xn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Xn.node;var Zn=v(Xn),Qn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Qn.node;var $n=v(Qn),er={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};er.node;var tr=v(er),nr={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};nr.node;var rr=v(nr),ir={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};ir.node;var ar=v(ir),or={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};or.node;var sr=v(or),cr={name:`clipboard-copy`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]};cr.node;var lr=v(cr),ur={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};ur.node;var dr=v(ur),fr={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};fr.node;var pr=v(fr),mr={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};mr.node;var hr=v(mr),gr={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};gr.node;var _r=v(gr),vr={name:`file-text`,size:24,node:[[`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:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};vr.node;var yr=v(vr),br={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};br.node;var xr=v(br),Sr={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Sr.node;var Cr=v(Sr),wr={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};wr.node;var Tr=v(wr),Er={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Er.node;var Dr=v(Er),Or={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Or.node;var kr=v(Or),Ar={name:`layers-2`,size:24,node:[[`path`,{d:`M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z`,key:`15q6uc`}],[`path`,{d:`m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845`,key:`byia6g`}]]};Ar.node;var jr=v(Ar),Mr={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Mr.node;var Nr=v(Mr),Pr={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Pr.node;var Fr=v(Pr),Ir={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Ir.node;var Lr=v(Ir),Rr={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Rr.node;var zr=v(Rr),Br={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Br.node;var Vr=v(Br),Hr={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Hr.node;var Ur=v(Hr),Wr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Wr.node;var Gr=v(Wr),Kr={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Kr.node;var qr=v(Kr),Jr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Jr.node;var Yr=v(Jr),Xr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Xr.node;var Zr=v(Xr),Qr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Qr.node;var $r=v(Qr),ei={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ei.node;var ti=v(ei),ni={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};ni.node;var ri=v(ni),ii={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ii.node;var ai=v(ii),oi={name:`sparkle`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]};oi.node;var si=v(oi),ci={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};ci.node;var li=v(ci),ui={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};ui.node;var di=v(ui),fi={name:`square-dashed-text`,size:24,node:[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]],aliases:[`text-selection`,`text-select`]};fi.node;var pi=v(fi),mi={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};mi.node;var hi=v(mi),gi={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};gi.node;var _i=v(gi),vi={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};vi.node;var yi=v(vi),bi={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};bi.node;var xi=v(bi),Si={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Si.node;var Ci=v(Si),wi={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};wi.node;var Ti=v(wi),Ei={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ei.node;var Di=v(Ei),Oi=0;function ki(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Oi);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),tn;let o=requestAnimationFrame(a);return Oi=o,()=>{Oi===o&&(cancelAnimationFrame(o),Oi=0)}}var Ai={inert:new WeakMap,"aria-hidden":new WeakMap},ji=`data-base-ui-inert`,Mi={inert:new WeakSet,"aria-hidden":new WeakSet},Ni=new WeakMap,Pi=0;function Fi(e){return Mi[e]}function Ii(e){return e?xe(e)?e.host:Ii(e.parentNode):null}var Li=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ii(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ri=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zi=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{pn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bi(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Li(t,e),l=i?zi(t,Ri(c),new Set(c)):[],u=[],d=[];if(a){let e=Ai[a],n=Fi(a);s=n,o=e;let r=Li(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zi(t,Ri(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Ni.get(e)||0)+1;Ni.set(e,t),d.push(e),t===1&&e.setAttribute(ji,``)}),Pi+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Ni.get(e)||0)-1;Ni.set(e,t),t||e.removeAttribute(ji)}),--Pi,Pi||(Ai.inert=new WeakMap,Ai[`aria-hidden`]=new WeakMap,Mi.inert=new WeakSet,Mi[`aria-hidden`]=new WeakSet,Ni=new WeakMap)}}function Vi(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=it(e[0]).body;return Bi(e,a,n,r,{mark:i})}var K=An(a(),1),q=Nn();function Hi(e,t){let n=Xe(On(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ui=20,Wi=[];function Gi(){Wi=Wi.filter(e=>e.deref()?.isConnected)}function Ki(e){Gi(),e&&pn(e)!==`body`&&(Wi.push(new WeakRef(e)),Wi.length>Ui&&(Wi=Wi.slice(-20)))}function qi(){return Gi(),Wi[Wi.length-1]?.deref()}function Ji(e){return e?te(e)?e:Jt(e)[0]||e:null}function Yi(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=l(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return te(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Xi(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=U(()=>b.current.floatingContext?.nodeId),S=i===!1,C=bn(_)&&S,E=Xt(i),k=Xt(a),A=Xt(l),ee=Xt(g),j=Et(p),M=ae(),N=K.useRef(!1),P=K.useRef(!1),F=K.useRef(!1),I=K.useRef(null),re=K.useRef(``),ie=K.useRef(``),oe=K.useRef(null),se=K.useRef(null),R=et(oe,f,M?.beforeInsideRef),z=et(se,M?.afterInsideRef),ce=Ie(),le=Ie(),ue=Ft(),de=M!=null,B=Ye(v),V=U((e=B)=>e?Jt(e):[]),fe=U(()=>m?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&H(B,ne(it(B)))&&V().length===0&&!C&&we(e)}let t=it(B);return Ge(t,`keydown`,e)},[r,B,s,C,V]),K.useEffect(()=>{if(r||!g)return;let e=it(B);function t(){F.current=!1}function n(e){let t=On(e),n=fe(),r=H(v,t)||H(_,t)||H(M?.portalNode,t)||n.some(e=>e===t||H(e,t));F.current=!r,ie.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(P.current=!0,le.start(0,()=>{P.current=!1}))}function i(){ie.current=`keyboard`}return yt(Ge(e,`pointerdown`,n,!0),Ge(e,`pointerup`,t,!0),Ge(e,`pointercancel`,t,!0),Ge(e,`keydown`,i,!0),t)},[r,v,_,B,g,M,le,fe]),K.useEffect(()=>{if(r||!c)return;let e=it(B);function t(){P.current=!0,le.start(0,()=>{P.current=!1})}function n(e){let t=On(e);te(t)&&(I.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=On(t);s&&n==null&&i!=null&&H(v,i)&&Ki(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=fe(),f=n?.hasAttribute(L(`focus-guard`))&&[oe.current,se.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,vn(d),vn(u)].includes(n),p=!(H(_,n)||H(v,n)||H(n,v)||H(M?.portalNode,n)||l.some(e=>e===n||H(e,n))||c.hasMatchingElement(e=>H(e,n))||f||j&&(kn(j.nodesRef.current,a).find(e=>H(e.context?.elements.floating,n)||H(e.context?.elements.domReference,n))||me(j.nodesRef.current,a).find(e=>[e.context?.elements.floating,Ye(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&Yi(B),o&&r!==_&&!Be(i)&&ne(e)===e.body){if(_e(B)&&(B.focus(),o===`popup`)){ue.request(()=>{B.focus()});return}let e=V(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;_e(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!s)&&n&&p&&!P.current&&(C||n!==qi())&&(N.current=!0,h.setOpen(!1,zt(cn,t)))})}function a(){F.current||(b.current.insideReactTree=!0,ce.start(0,()=>{b.current.insideReactTree=!1}))}let l=_e(_)?_:null;if(v||l)return yt(l&&Ge(l,`focusout`,i),l&&Ge(l,`pointerdown`,t),v&&Ge(v,`focusin`,n),v&&Ge(v,`focusout`,i),v&&M&&Ge(v,`focusout`,a,!0))},[r,_,v,B,s,j,M,h,c,o,V,C,x,b,ce,le,ue,u,d,fe]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${L(`portal`)}]`)||[]),t=(j?me(j.nodesRef.current,x()):[]).find(e=>bn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Vi([v,...e,oe.current,se.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...fe(),t,vn(d),vn(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Vi([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,M,C,j,x,u,d,fe]),W(()=>{if(!g||r||!_e(B))return;re.current=``,ie.current=``;let e=it(B),t=ne(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(A.current||``):n;if(r===void 0||r===!1||H(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():vn(r),o||=a();let s=H(B,ne(e));ki(o,{preventScroll:o===B,shouldFocus(){if(!ee.current)return!1;if(s)return!0;let t=ne(e);return!(t!==o&&H(B,t))}})})},[r,g,B,V,E,A,ee]),W(()=>{if(r||!B)return;let e=it(B),t=ne(e),n=A.current==null;Ki(t);function i(e){if(e.open||(re.current=Hi(e.nativeEvent,ie.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(De(e.nativeEvent)||D(e.nativeEvent))N.current=!1;else{let e=!1;it(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}y.on(`openchange`,i);function a(e){let r=k.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&pn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=qi()||null,typeof i==`boolean`?s:vn(i)||s||null}return()=>{y.off(`openchange`,i);let t=ne(e),n=fe(),r=H(v,t)||n.some(e=>e===t||H(e,t))||j&&kn(j.nodesRef.current,x(),!1).some(e=>H(e.context?.elements.floating,t)),o=k.current,s=re.current,c=a(s);queueMicrotask(()=>{let n=Ji(c),i=typeof o!=`boolean`;if(o&&!N.current&&_e(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,v,B,k,A,y,j,_,x,fe]),W(()=>{if(!w||g||!v)return;let e=ne(it(v));_e(e)&&ge(e)&&H(v,e)&&e.blur()},[g,v]),W(()=>{if(!r&&M)return M.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,s,g,h,c,_]),W(()=>{if(!r&&B)return Yi(B),()=>{queueMicrotask(Gi)}},[r,B]);let pe=!r&&(!s||!C)&&(de||s);return(0,q.jsxs)(K.Fragment,{children:[pe&&(0,q.jsx)(ot,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=V();ki(e[e.length-1])}else M?.portalNode&&(N.current=!1,T(e,M.portalNode)?Oe(_)?.focus():vn(d??M.beforeOutsideRef)?.focus())}}),n,pe&&(0,q.jsx)(ot,{"data-type":`inside`,ref:z,onFocus:e=>{s?ki(V()[0]):M?.portalNode&&(c&&(N.current=!0),T(e,M.portalNode)?O(_)?.focus():vn(u??M.afterOutsideRef)?.focus())}})]})}function Zi(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:l=wn}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,f=K.useRef(void 0),p=Ft(),m=Ie(),h=K.useMemo(()=>{function e(e,t,n,r){let i=zt(l,t,n);e&&r===`touch`&&s>0?m.start(s,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=u.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){f.current=c(e.pointerType,!0)&&D(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,o=n.nativeEvent,s=u.select(`open`);if(n.button!==0||r===`click`||c(i,!0)&&a)return;let l=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),d=On(o);if(ge(d)){e(l,o,d,i);return}let m=n.currentTarget;p.request(()=>{e(l,o,m,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;r===`mousedown`&&i?f.current=void 0:c(i,!0)&&a||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,a,l,u,o,i,p,m,s]);return K.useMemo(()=>n?{reference:h}:Bt,[n,h])}function Qi(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function $i(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function ea(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push($i(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:Qi(r,i,a,o)}}function ta(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function na(e){return Qi(e.left,e.top,e.right,e.bottom)}function ra(e,t,n){let{lines:r}=ea(e.getClientRects());if(r.length<2)return;let i=ta(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function ia(e,t,n){let{lines:r,fallback:i}=ea(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return na(r[n.lineIndex]);if(a!=null&&o!=null){let e=ta(r,a,o);if(e!==-1)return na(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return Qi(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return Qi(l,f.top,u,p.bottom)}function aa(e){return`contextElement`in e&&e.contextElement?e.contextElement:xn(e)?e:void 0}function oa(e,t,n,r){let i=ra(t,n,r);return e.current=i,i}function sa(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=aa(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=ia(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var ca=`Escape`;function la(e){return w&&e.movementX===0&&e.movementY===0}function ua(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function da(e,t){return ua(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function fa(e,t,n){return ua(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function pa(e,t,n){return ua(t,n?e===ue:e===x,e===se)}function ma(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===ca:ua(t,n?e===x:e===ue,e===A)}function ha(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),O=C.context.dataRef,k=Ye(T),A=bn(E),ee=Xt(k),j=ce(),M=Et(b),P=K.useRef(f),F=K.useRef(o??-1),te=K.useRef(null),I=K.useRef(!0),L=U(e=>{i(F.current===-1?null:F.current,e)}),re=K.useRef(!!T),ie=K.useRef(w),ae=K.useRef(!1),oe=K.useRef(!1),se=K.useRef(null),R=Xt(h),z=Xt(w),le=Xt(o),ue=Xt(y),de=Ft(),B=Ft(),V=U(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):se.current=ki(e,{sync:ae.current,preventScroll:!0})}let t=n.current[F.current],r=oe.current;t&&e(t),(ae.current?e=>e():e=>de.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),ye&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});W(()=>{O.current.orientation=g},[O,g]),W(()=>{a&&(w&&T?(F.current=o??-1,P.current&&o!=null&&(oe.current=!0,L())):re.current&&(F.current=-1,L()))},[a,w,T,o,L]),W(()=>{if(a){if(!w)ae.current=!1;else if(T){if(r==null){if(ae.current=!1,le.current!=null)return;if(re.current&&(F.current=-1,V()),(!ie.current||!re.current)&&P.current&&(te.current!=null||P.current===!0&&te.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>B.request(e):queueMicrotask)(t),e+=1):(F.current=te.current==null||fa(te.current,g,u)||l?Pe(n):Le(n),te.current=null,L())};t()}}else fe(n.current,r)||(F.current=r,V(),oe.current=!1)}}},[a,w,T,r,le,l,n,g,u,L,V,B]),W(()=>{if(!a||T||!M||d||!re.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=ne(it(E??t??null)),r=e.some(e=>e.context&&H(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),W(()=>{ie.current=w,re.current=!!T}),W(()=>{w||(te.current=null,P.current=f)},[w,f]);let pe=r!=null,me=U(e=>{if(!z.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,L(e))}),he=U(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ge=U(()=>Pe(n,R.current)),ve=U(e=>{if(I.current=!1,ae.current=!0,e.which===229||!z.current&&e.currentTarget===ee.current)return;if(l&&ma(e.key,g,u,S)){da(e.key,he())||we(e),C.setOpen(!1,zt(Ut,e.nativeEvent)),_e(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=F.current,r=Pe(n,h),i=Le(n,h);if(A||(e.key===`Home`&&(we(e),F.current=r,L(e)),e.key===`End`&&(we(e),F.current=i,L(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,L(e)),g===`both`)return}if(da(e.key,g)){if(we(e),w&&!d&&ne(e.currentTarget.ownerDocument)===e.currentTarget){F.current=fa(e.key,g,u)?r:i,L(e);return}fa(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(ae.current=!1,F.current=r):F.current=N(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,N(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(ae.current=!1,F.current=i):F.current=N(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,N(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),fe(n.current,F.current)&&(F.current=-1),L(e)}}),ye=K.useMemo(()=>({onFocus(e){ae.current=!0,me(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){la(e)||(ae.current=!0,oe.current=!1,p&&me(e))},onPointerLeave(e){if(!z.current||!I.current||e.pointerType===`touch`)return;ae.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ue.current&&(se.current?.(),se.current=null,F.current=-1,L(e),!d)){let e=ee.current,t=ne(it(e));e&&H(e,t)&&e.focus({preventScroll:!0})}}}),[me,z,ee,p,n,L,ue,d]),be=K.useMemo(()=>d&&w&&pe&&{"aria-activedescendant":`${v}-${r}`},[d,w,pe,v,r]),xe=K.useMemo(()=>({...A?{}:be,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=On(e.nativeEvent);if(t&&!H(ee.current,t))return;we(e),C.setOpen(!1,zt(cn,e.nativeEvent)),_e(E)&&E.focus()}else ve(e)},onPointerMove(e){la(e)||(I.current=!0)}}),[be,ve,ee,A,C,w,d,E]),Se=K.useMemo(()=>{function e(e){C.setOpen(!0,zt(Ut,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&De(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&D(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=pa(t.key,he(),u),a=da(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ve(t);if(n||m||!r){if(o){let e=da(t.key,he());te.current=l&&e?null:t.key}l?i&&(we(t),n?(F.current=ge(),L(t)):e(t)):a&&(le.current!=null&&(F.current=le.current),we(t),!n&&m?e(t):ve(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ve,f,ge,l,L,C,m,g,he,u,le,d]),Ce=K.useMemo(()=>({...be,...Se}),[be,Se]);return K.useMemo(()=>a?{reference:Ce,floating:xe,item:ye,trigger:Se}:{},[a,Ce,xe,Se,ye])}function ga(e,t){let{listRef:r,elementsRef:i,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=Ie(),h=K.useRef(``),g=K.useRef(d??a??-1),_=K.useRef(null),v=U(e=>{function t(e){return i?.current[e]}function l(e){let r=t(e);return r&&!Be(r)||r?.matches(`:disabled`)?!1:s==null||!n(Ke,e,s)}function f(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&l(n))return n}return-1}let v=r.current;if(h.current.length>0&&e.key===` `&&(we(e),c?.(!0)),h.current.length>0&&h.current[0]!==` `&&f(v,h.current)===-1&&e.key!==` `&&c?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(we(e),c?.(!0));let y=h.current===``;y&&(g.current=d??a??-1),v.every((e,t)=>e&&l(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,c?.(!1)});let b=((y?d??a??-1:g.current)??0)+1,x=f(v,h.current,b);x===-1?e.key!==` `&&(h.current=``,c?.(!1)):(o?.(x),_.current=x)}),y=U(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);H(n,t)||H(r,t)||(m.clear(),h.current=``,g.current=_.current,c?.(!1))});W(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]);let b=K.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return K.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}var _a=e=>{let t={running:null,next:null},n=async()=>{let n=e();t.running=n;try{return await n}finally{t.running===n&&(t.running=null)}},r=async e=>{try{await e}catch{}return t.next=null,n()};return Object.assign(()=>t.running===null?n():(t.next??=r(t.running),t.next),{current:()=>t.running??n()})},va=h({method:`POST`}).handler(z(`d8312664c6aa9aecf245095d01a37077f92332e35727648e70895cf2ce8820df`)),ya=h({method:`POST`}).handler(z(`0f042f20f6465d3f1aef6d39f8a9bbc6d7a67f0c0095129fb5a12320572da6c5`)),ba=h({method:`GET`}).handler(z(`6eecb07d4b182f665117c88dc895f7eb8dc3a4bb4bc7444c3c7f5e39e45f1395`)),xa=h({method:`POST`}).handler(z(`6d9ad149a44e29ec90458d6687ea2c92d98859cbcc44d7521127c2c4cfaedc67`)),Sa=h({method:`GET`}).handler(z(`f3609bca9dbfd37554e557b01b4f2cde39e84e8d358a830730bfb93998f3f6dd`)),Ca=h({method:`GET`}).handler(z(`ec830af09bbd81cf8ccba41a6cf5c80ef59098d9272dcd133d7509d54d033a76`)),wa=h({method:`POST`}).handler(z(`1c122a1878638fa6877d8737799f71372951cf995210ada6f735b17d8dcdc6ec`)),Ta=h({method:`GET`}).handler(z(`ca81996f5cde62306b310948df2499c55b0d5c8df1bbf5c0da11478771b4afb0`)),Ea=h({method:`POST`}).handler(z(`acd41dcd63b04d512e76bc5182c86ad4235a95b99e5beba1de74832877815035`)),Da=h({method:`POST`}).handler(z(`95b2066779521c5ee2eb1562972665eef00a38622ad0864ef7d8b4672d82fd39`)),Oa=h({method:`POST`}).handler(z(`c7a57e967e7faf79ff4adba8db39dd62f1c9c7a9efdc2fd1c0ff9a8a75e89dc6`)),ka=h({method:`POST`}).handler(z(`e7a2c93fea99cc38405ad8aec216e26f886d619a7f8376f105cb1cfa7cceea95`)),Aa={pull:null,remarks:[],drafts:[]},ja=({place:e,branch:t})=>{let[n,r]=(0,K.useState)(Aa),i=(0,K.useMemo)(()=>_a(async()=>{r(await Sa({data:{place:e,branch:t,isFresh:!0}}))}),[e,t]);return(0,K.useEffect)(()=>{let n={isCurrent:!0};return(async()=>{let i=await Sa({data:{place:e,branch:t,isFresh:!1}});n.isCurrent&&r(i)})(),()=>{n.isCurrent=!1}},[e,t]),{extras:n,refresh:i}},Ma=`reconnected`,Na=15e3,Pa=(e,t)=>{let n=(0,K.useRef)(t);(0,K.useEffect)(()=>{n.current=t}),(0,K.useEffect)(()=>{let t={events:null,opens:0,hiddenAt:0},r=()=>{t.events?.close();let r=new EventSource(e);for(let e of Object.keys(n.current).filter(e=>e!==Ma))r.addEventListener(e,t=>{n.current[e]?.(t instanceof MessageEvent?String(t.data):``)});r.addEventListener(`open`,()=>{t.opens+=1,t.opens>1&&n.current[Ma]?.(``)}),t.events=r},i=e=>{if(document.visibilityState===`hidden`){t.hiddenAt=Date.now();return}let n=e instanceof PageTransitionEvent&&e.persisted,i=t.hiddenAt>0&&Date.now()-t.hiddenAt>Na;(n||i||t.events?.readyState===EventSource.CLOSED)&&r(),t.hiddenAt=0};return r(),document.addEventListener(`visibilitychange`,i),globalThis.addEventListener(`pageshow`,i),()=>{document.removeEventListener(`visibilitychange`,i),globalThis.removeEventListener(`pageshow`,i),t.events?.close()}},[e])},Fa=1500,Ia=e=>{let t=(0,K.useRef)([]),n=(0,K.useRef)(null),r=(0,K.useCallback)(async e=>{let r=t.current;t.current=[];let i=(async()=>{await e})();n.current=i,await i,n.current===i&&(n.current=null),r.forEach(e=>{e()})},[]);return{settle:r,awaitNext:(0,K.useCallback)(()=>{if(n.current!==null)return n.current;let{promise:i,resolve:a}=Promise.withResolvers();t.current.push(()=>{a(void 0)});let o=t.current.at(-1);return setTimeout(()=>{o!==void 0&&t.current.includes(o)&&r(e())},Fa),i},[r,e])}},La=St([`filed`,`waiting`,`answered`,`asked`,`settled`,`gone`]),Ra=wt({path:k(),added:R(),removed:R(),read:Je(),open:R(),stand:La}),za=wt({title:k(),note:r(k(),``),files:Cn(k()),spans:r(Cn(wt({path:k(),start:R(),end:R()})),[]),prose:r(Cn(wt({path:k(),line:R(),markdown:k(),after:Je()})),[]),read:r(Cn(k()),[]),vanished:r(Cn(k()),[]),added:R(),removed:R(),done:Je(),unclaimed:Je(),open:R(),stand:La,parts:Cn(Ra),address:r(k()),ticket:r(R()),sublayer:r(R())}),Ba=wt({number:R(),address:k(),title:k(),note:r(k(),``),layers:Cn(R()),sublayers:R(),sublayersDone:r(R(),0),files:Cn(k()),added:R(),removed:R(),done:r(Je(),!1),open:r(R(),0),stand:r(La,`gone`)}),Va=wt({stale:r(Je(),!1),summary:r(k(),``),layers:Cn(za),tickets:r(Cn(Ba),[]),topLevel:r(R())});wt({layers:Va});var Ha=wt({voice:St([`reviewer`,`agent`]),body:k(),at:k(),choices:r(Cn(k()))}),Ua=wt({id:k(),file:k(),side:St([`old`,`new`]),start:R(),end:R(),snippet:r(k(),``),body:k(),at:r(k(),``),state:k(),outdated:r(Je(),!1),settled:r(Je(),!1),unread:r(R(),0),taken:r(Je(),!1),doing:r(wt({body:k(),at:k()})),turns:Cn(Ha),stand:La,section:St([`asked`,`filed`,`with`,`answered`,`movedOn`,`settled`,`removed`]),movedPast:Je(),reworded:Je(),about:St([`branch`,`line`]),settleable:Je(),layers:Cn(R())}),Wa=wt({path:k(),open:R(),settled:R(),stand:La}),Ga=wt({path:k(),side:St([`old`,`new`]),line:R(),open:R(),settled:R(),stand:La}),Ka=wt({asked:R(),unread:R()});wt({comments:Cn(Ua),counts:r(Ka),files:Cn(Wa),lines:Cn(Ga)}),wt({layers:r(Va)});var qa=(e,t)=>e.map(e=>{let[n]=e.layers,r=n===void 0?null:t[n-1]?.address??String(n);return r===e.layerAddress?e:{...e,layerAddress:r}}),Ja=new Map,Ya=(e,t)=>{Ja.get(e)?.forEach(e=>{e(t)})},Xa=(e,t)=>{let n=Ja.get(e)??new Set;return n.add(t),Ja.set(e,n),()=>{n.delete(t)}},Za=()=>({started:0,shown:0}),Qa=async(e,t)=>{e.started+=1;let n=e.started,r=await t();return n<e.shown?null:(e.shown=n,r)},$a=h({method:`POST`}).handler(z(`bc42f104a022623469410d19573fe9714a7aed7a344f808479517ee6742bfaae`)),eo=h({method:`GET`}).handler(z(`9efdcbe2ace17d0836d7df7bc9aff104b4868682ca79516ddb6927a8ed223691`)),to=h({method:`GET`}).handler(z(`1e0b1bc8f9718ae1ef49c47aa55a9e44518eaa93e3b317cf1b521d87b3f6e983`)),no=h({method:`GET`}).handler(z(`e21610e432516c6914db00010e8bedfa8f3b53f243b609befdc905f0d0717d60`)),ro=new Map,io=({place:e,branch:t})=>`${e}|${t}`,ao=[`comments`,`state`,`layers`],oo=e=>{try{let t=JSON.parse(e);return typeof t==`object`&&t&&`what`in t&&Array.isArray(t.what)?t.what.map(String):[]}catch{return[]}},so=e=>ao.filter(t=>e.includes(t)),co=()=>{let e={isWhole:!1,parts:new Set,run:async e=>{}},t=_a(async()=>{let t={isWhole:e.isWhole,parts:[...e.parts]};e.isWhole=!1,e.parts.clear(),await e.run(t)});return{set:t=>{e.run=t},ask:async({isWhole:n,parts:r})=>{e.isWhole||=n,r.forEach(t=>{e.parts.add(t)}),await t()}}},lo=({place:e,branch:t},{show:n,merge:r})=>{let i=(0,K.useRef)(Za()),a=(0,K.useCallback)(n=>Qa(i.current,()=>eo({data:{place:e,branch:t,...n}})),[e,t]),o=(0,K.useRef)(null);return{read:a,reread:(0,K.useCallback)(async i=>{o.current??=co(),o.current.set(async({isWhole:i,parts:o})=>{if(i){let e=await a({isFresh:!0,isWhole:!0});e!==null&&n(e)}else o.length>0&&r(await ba({data:{place:e,branch:t,parts:[...o]}}))}),await o.current.ask(i)},[a,n,r,e,t])}},uo=(e,{read:t,show:n})=>{let{place:r,branch:i}=e;(0,K.useEffect)(()=>{let e={isCurrent:!0},a=async r=>{let i=await t({isFresh:r,isWhole:!0});e.isCurrent&&i!==null&&n(i)};return(async()=>{ro.get(io({place:r,branch:i}))===void 0&&await a(!1),await a(!0)})(),()=>{e.isCurrent=!1}},[r,i,t,n])},fo=(e,t)=>{let[n,r]=(0,K.useState)(()=>ro.get(e)??t);return{outline:n,show:(0,K.useCallback)(t=>{ro.set(e,t),r(t)},[e]),merge:(0,K.useCallback)(t=>{r(n=>{let r=n===null?n:{...n,...t};return r!==null&&ro.set(e,r),r})},[e])}},po={isWhole:!0,parts:[]},mo=({key:e,reread:t,settle:n,onChanged:r})=>({changed:e=>{let i=oo(e),a=so(i);a.length===0?r(i):n(Promise.all([t({isWhole:!1,parts:a}),r(i)]))},moved:()=>{n(t(po))},reconnected:()=>{n(Promise.all([t(po),r([`other`])]))},listener:t=>{Ya(e,t)}}),ho=(e,t)=>{let{place:n,branch:r}=e,i=io(e),{outline:a,show:o,merge:s}=fo(i,e.kept),{read:c,reread:l}=lo({place:n,branch:r},{show:o,merge:s}),{settle:u,awaitNext:d}=Ia(()=>Promise.all([l({isWhole:!1,parts:ao}),t([`other`])]));return uo({place:n,branch:r},{read:c,show:o}),Pa(`/review/events?${new URLSearchParams({place:n,branch:r})}`,mo({key:i,reread:l,settle:u,onChanged:t})),{outline:a,refresh:(0,K.useCallback)((e=!1)=>e?l(po):d(),[l,d])}},go=e=>{let[t,n]=(0,K.useState)(null),r=t?.on===e?t.told:e;return{layers:r.layers,tickets:r.tickets,threads:qa(e.threads,r.layers),handleLayers:t=>{t!==null&&n({on:e,told:t})}}},_o=e=>`${e.path}|${e.fingerprint}`,vo=(e,t)=>[...e].findLast(([e])=>e.startsWith(`${t}|`))?.[1],yo=200,bo=e=>{if(`requestIdleCallback`in globalThis){let t=requestIdleCallback(e);return()=>{cancelIdleCallback(t)}}let t=setTimeout(e,yo);return()=>{clearTimeout(t)}},xo=({place:e,branch:t,files:n,selected:r,order:i})=>{let[a,o]=(0,K.useState)(new Map),s=(0,K.useRef)(new Set),c=new Map(n.map(e=>[e.path,e])),l=(0,K.useCallback)(async n=>{if(n===void 0||n.rows.length>0||s.current.has(_o(n)))return;s.current.add(_o(n));let r=await to({data:{place:e,branch:t,path:n.path,fingerprint:n.fingerprint}}).catch(()=>null);o(e=>r===null?e:new Map([...e,[_o(n),r]])),r===null&&s.current.delete(_o(n))},[e,t]),u=c.get(r),d=i.indexOf(r),f=[i[d+1],i[d-1]].map(e=>c.get(e??``));return(0,K.useEffect)(()=>(l(u),bo(()=>{f.forEach(e=>{l(e)})}))),{fileFor:e=>{if(e.rows.length>0)return e;let t=a.get(_o(e))??vo(a,e.path);if(t!==void 0)return{...t,oldSha:e.oldSha,newSha:e.newSha}}}},So=(e,t)=>t===null||e.layers.includes(t+1),Co=(e,t)=>`${e.path}|${e.reviewed}|${t}`,wo=async e=>{try{return await no({data:e})}catch{return}},To=(e,t)=>e!==void 0&&e.kept&&!e.deleted&&So(e,t),Eo=({place:e,branch:t,since:n,selected:r,layer:i,current:a})=>{let[o,s]=(0,K.useState)(new Set),[c,l]=(0,K.useState)(new Map),u=(0,K.useRef)(new Set),d=n.find(e=>e.path===r),f=To(d,i)&&a!==void 0&&!o.has(r);(0,K.useEffect)(()=>{if(!f||u.current.has(Co(d,a.blob)))return;let n=Co(d,a.blob);u.current.add(n);let r={place:e,branch:t,path:d.path,reviewed:d.reviewed};(async()=>{let e=await wo({...r,blob:a.blob});e===void 0?u.current.delete(n):l(t=>new Map([...t,[n,e]]))})()});let p=e=>{let t=n.find(t=>t.path===e.path);return To(t,i)?c.has(Co(t,e.blob))?c.get(Co(t,e.blob)):vo(c,e.path):null},m=e=>!To(n.find(t=>t.path===e),i)||a?.path===e&&a.blob!==``&&p(a)===null?null:o.has(e)?`full`:`since`;return{modeOf:m,setMode:(e,t)=>{s(n=>new Set(t===`full`?[...n,e]:[...n].filter(t=>t!==e)))},swap:e=>e.path===r&&m(e.path)===`since`?p(e)??e:e,isWaiting:e=>e===r&&m(e)===`since`&&a!==void 0&&p(a)===void 0}},Do=({place:e,branch:t},{outline:n,selected:r,layer:i})=>{let a=xo({place:e,branch:t,files:n.files,selected:r,order:n.order}),o=n.files.find(e=>e.path===r),s=Eo({place:e,branch:t,since:n.since,selected:r,layer:i,current:o===void 0?void 0:a.fileFor(o)});return{files:n.files.map(e=>s.swap(a.fileFor(e)??e)),isFileLoaded:e=>{let t=n.files.find(t=>t.path===e);return t!==void 0&&a.fileFor(t)!==void 0&&!s.isWaiting(e)},sinceView:{modeOf:s.modeOf,setMode:s.setMode}}},Oo=2,ko=e=>e.split(`/`).at(-1)??e,Ao=e=>e.split(`/`).slice(0,-1).join(`/`),jo=e=>{let t={name:``,full:``,dirs:[],files:[]},n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t!==void 0)return t;let i={name:ko(e),full:e,dirs:[],files:[]};return n.set(e,i),r(Ao(e)).dirs.push(i),i};return e.forEach(e=>{r(Ao(e)).files.push(e)}),t},Mo=(e,t=e.name)=>{let[n]=e.dirs;return e.files.length===0&&e.dirs.length===1&&n!==void 0?Mo(n,t===``?n.name:`${t}/${n.name}`):{...e,name:t,dirs:e.dirs.map(e=>Mo(e))}},No=e=>{let t=e.split(`/`);return t.length>Oo?`…/${t.slice(-2).join(`/`)}`:e},Po=(e,t,{collapsed:n,rows:r})=>{e.dirs.forEach(e=>{r.push({kind:`dir`,key:`dir:${e.full}`,label:t===0?No(e.name):e.name,full:e.full,depth:t}),n.has(e.full)||Po(e,t+1,{collapsed:n,rows:r})}),e.files.forEach(e=>{r.push({kind:`file`,key:`file:${e}`,path:e,label:ko(e),depth:t})})},Fo=(e,t)=>{let n=[];return Po(e,0,{collapsed:t,rows:n}),n},Io=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Lo=new Set,Ro={paths:[],root:null,order:[]},zo=e=>{let t=jo(e);return{...t,dirs:t.dirs.map(e=>Mo(e))}},Bo=e=>Fo(e,Lo).flatMap(e=>e.kind===`file`?[e.path]:[]),Vo=e=>{if(Ro.root!==null&&Io(Ro.paths,e))return{root:Ro.root,order:Ro.order};let t=zo(e);return Ro.paths=e,Ro.root=t,Ro.order=Bo(t),{root:t,order:Ro.order}},Ho=(e,t)=>Fo(Vo(e).root,t),Uo=e=>Vo(e).order,Wo=e=>`layer:${String(e)}`,Go=e=>`ticket:${String(e)}`,Ko=(e,t)=>`${Wo(e)}:${t}`,qo=/^layer:(?<index>\d+)/u,Jo=/^ticket:(?<number>\d+)$/u,Yo=e=>{let t=qo.exec(e);return t?.groups?.index===void 0?null:Number(t.groups.index)},Xo=e=>{let t=Jo.exec(e);return t?.groups?.number===void 0?null:Number(t.groups.number)},Zo=e=>e.map(e=>`${e.title}:${String(e.files.length)}`).join(`|`),Qo=`layer:read`,$o=e=>Ao(e),es=3,ts=e=>{let t=e.split(`/`);return t.length<es?`${e}/`:`${t[0]??``}/…/${t.at(-1)??``}/`},ns=K.createContext(void 0);function rs(e){let t=K.useContext(ns);if(!e&&t===void 0)throw Error(Wt(27));return t}var is=K.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=rs(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return Zt(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:gn,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),as=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=rs(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ot({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,zt($e,e.nativeEvent))}return Zt(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),os=K.createContext(void 0);function ss(){let e=K.useContext(os);if(e===void 0)throw Error(Wt(26));return e}var cs=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),ls=`--nested-dialogs`,us=`data-nested-dialog-open`,ds={...d,...i,nestedDialogOpen(e){return e?{[us]:``}:null}},fs=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=rs(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);ss(),mn({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?un(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Zt(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Vt,hidden:!m,onKeyDown(e){cs.has(e.key)&&e.stopPropagation()},style:{[ls]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ds});return(0,q.jsx)(Xi,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ps=K.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),ms=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=rs(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,q.jsx)(os.Provider,{value:n,children:(0,q.jsxs)(Ct,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(ps,{ref:i.context.internalBackdropRef,inert:C(!s)}),e.children]})}):null}),hs={},gs={},_s=``;function vs(e,t){return _n(e)?e:t}function ys(e,t,n){return/hidden|clip/.test(e.getComputedStyle(vs(t,n)).overflowY)}function bs(e){if(typeof document>`u`)return!1;let t=it(e);return Xe(t).innerWidth-t.documentElement.clientWidth>0}function xs(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=it(e),n=t.documentElement,r=t.body,i=vs(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ss(e){let t=it(e),n=t.documentElement,r=t.body,i=vs(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Cs(e){let t=it(e),n=t.documentElement,r=t.body,i=Xe(n),a=0,o=0,s=!1,c=an.create();if(w&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,hs={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},_s=n.style.scrollBehavior,gs={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vs(n,r);s=xs(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,hs),Object.assign(r.style,gs),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=_s)}function d(){u(),c.request(l)}l();let f=Ge(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ws=new class{lockCount=0;restore=null;timeoutLock=M.create();timeoutUnlock=M.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=it(e),n=t.documentElement,r=t.body,i=Xe(n);if(ys(i,n,r)){let t=new i.MutationObserver(()=>{ys(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=F||!bs(e);this.restore=a?Ss(e):Cs(e)}};function Ts(e=!0,t=null){W(()=>{if(e)return ws.acquire(t)},[e,t])}function Es({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=K.useState(0),[u,d]=K.useState(0),f=c===0,m=p(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=On(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||H(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Ts(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),W(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),Nt(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var Ds={...xt,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Os=class extends ve{constructor(e,t,n){let r=new qe,i=ks(e,r,t,n);super(i,As(r),Ds)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(at(this.state,e,t.trigger)))}};function ks(e,t,n,r=!1){return{...Qt(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function As(e){return{popupRef:K.createRef(),backdropRef:K.createRef(),internalBackdropRef:K.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function js(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=rs(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=_t((e,t)=>new Os({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);ht(b,x),ft(b);let{forceUnmount:w}=Gt(x,b);K.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,zt(rt))}),[w,b]);let T=x||S;return(0,q.jsxs)(ns.Provider,{value:b,children:[u&&(0,q.jsx)(nn,{handle:u,store:b}),T&&(0,q.jsx)(Es,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var Ms=Ne(function(e){return js(`dialog`,e)}),Ns=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rs(),c=Re(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Zt(`h2`,e,{ref:t,props:[{id:c},o]})});function Ps(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Fs(e,t){let n=K.useRef(e),r=U(t);W(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Is(e,t){let{onClick:n,onPointerDown:r}=Ps(U((n,r)=>{(typeof e==`function`?e():e)||t(r||(F?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ls(e){let[t,n]=K.useState(null),r=Is(e,n);return Fs(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Rs=.25,zs=.11,Bs=6,Vs=2,Hs=`(max-width: 767px)`,Us=`translate 320ms var(--e-drawer)`,Ws=`translate 220ms var(--e-drawer)`,Gs=220,Ks=e=>e>=0?e:-Math.sqrt(-e)*Vs,qs=(e,t)=>{if(!(t instanceof Element)||!globalThis.matchMedia(Hs).matches)return!1;if(t.closest(`[data-slot="dialog-header"]`)!==null)return!0;let n=t.closest(`[data-slot="dialog-body"]`);return n===null?e.contains(t):n.scrollTop<=0},Js=e=>{if(!(e instanceof Element)||e.closest(`[data-slot="dialog-header"]`)!==null)return!0;let t=e.closest(`[data-slot="dialog-body"]`);return t===null||t.scrollHeight<=t.clientHeight},Ys=e=>{e.style.transition=Ws,e.style.translate=`0 calc(100% + 2rem)`,globalThis.setTimeout(()=>{e.querySelector(`[data-slot="dialog-header"] [aria-label="Close"]`)?.click()},Gs)},Xs=(e,t,n)=>{let r=n-t.startY,i=r/Math.max(1,Date.now()-t.startedAt);r>e.offsetHeight*Rs||i>zs?Ys(e):(e.style.transition=Us,e.style.translate=``)},Zs=e=>{let t={startY:0,startedAt:0,isDragging:!1,canDrag:!1,canStretch:!1};return{handleStart:n=>{let[r]=n.touches;t.canDrag=n.touches.length===1&&qs(e,n.target),t.canStretch=t.canDrag&&Js(n.target),t.isDragging=!1,t.startY=r?.clientY??0,t.startedAt=Date.now()},handleMove:n=>{let[r]=n.touches,i=(r?.clientY??t.startY)-t.startY,a=i>Bs||t.canStretch&&i<-6;t.canDrag&&(t.isDragging||a)&&(t.isDragging=!0,n.preventDefault(),e.style.transition=`none`,e.style.translate=`0 ${String(Ks(i))}px`)},handleEnd:n=>{let[r]=n.changedTouches;t.isDragging&&Xs(e,t,r?.clientY??t.startY),t.isDragging=!1}}},Qs=e=>{let{handleStart:t,handleMove:n,handleEnd:r}=Zs(e);return e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`touchmove`,n,{passive:!1}),e.addEventListener(`touchend`,r),e.addEventListener(`touchcancel`,r),()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchmove`,n),e.removeEventListener(`touchend`,r),e.removeEventListener(`touchcancel`,r)}};function $s({...e}){return(0,q.jsx)(Ms,{"data-slot":`dialog`,...e})}function ec({...e}){return(0,q.jsx)(as,{"data-slot":`dialog-close`,...e})}function tc({className:e,...t}){return(0,q.jsx)(Ns,{className:G(`sr-only`,e),"data-slot":`dialog-title`,...t})}var nc={fill:`fixed inset-0 transition-[opacity,scale] duration-200 ease-out data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100`,sheet:`dialog-sheet flex flex-col overflow-hidden text-sm text-popover-foreground md:rounded-xl md:border md:border-border md:bg-popover md:shadow-sheet`},rc=(e,t)=>n=>(typeof e==`function`?e(n):e!=null&&(e.current=n),t&&n!==null?Qs(n):void 0);function ic({className:e,variant:t=`fill`,ref:n,...r}){return(0,q.jsxs)(ms,{children:[(0,q.jsx)(is,{className:`fixed inset-0 z-30 bg-overlay transition-opacity duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,"data-slot":`dialog-overlay`,forceRender:t===`sheet`}),(0,q.jsx)(fs,{className:G(`z-30 outline-none`,nc[t],e),"data-slot":`dialog-content`,"data-variant":t,ref:rc(n,t===`sheet`),...r})]})}function ac({title:e}){return(0,q.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between gap-3 border-b border-border ps-4 pe-3 max-md:relative max-md:h-14 max-md:border-0 max-md:ps-6 max-md:pt-2`,"data-slot":`dialog-header`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-s-1/2 top-2 h-1.25 w-9 -translate-x-1/2 rounded-full bg-foreground/28 md:hidden`}),(0,q.jsx)(Ns,{className:`m-0 text-sm font-medium text-foreground max-md:text-lg max-md:font-semibold`,children:e}),(0,q.jsxs)(as,{"aria-label":`Close`,className:`flex press items-center gap-1.5 rounded-md px-1.5 py-1 text-xs text-subtle outline-none hover:bg-secondary hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring max-md:size-11 max-md:justify-center max-md:p-0`,children:[(0,q.jsx)(`span`,{className:`max-md:hidden`,children:(0,q.jsx)(V,{children:`Esc`})}),(0,q.jsx)(`span`,{className:`hidden size-8 place-items-center rounded-full bg-foreground/10 text-foreground max-md:grid`,children:(0,q.jsx)(Di,{"aria-hidden":!0,className:`size-4`,strokeWidth:2.25})})]})]})}function oc({children:e}){return(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain`,"data-slot":`dialog-body`,children:e})}function sc({children:e}){return(0,q.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border bg-wash px-4 py-2.5 text-xs text-muted-foreground`,"data-slot":`dialog-footer`,children:e})}var cc=(e,t)=>{let[n,r]=(0,K.useState)(null),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{i.current=e}),(0,K.useEffect)(()=>{let e={isCurrent:!0};return(async()=>{let n=await i.current();e.isCurrent&&r({key:t,value:n})})(),()=>{e.isCurrent=!1}},[t]),n?.key===t?n.value:null},lc={vscode:`VS Code`,cursor:`Cursor`,windsurf:`Windsurf`,zed:`Zed`,idea:`JetBrains`},uc=e=>e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`),dc={vscode:(e,t)=>`vscode://file${uc(e)}:${String(t)}:1`,cursor:(e,t)=>`cursor://file${uc(e)}:${String(t)}:1`,windsurf:(e,t)=>`windsurf://file${uc(e)}:${String(t)}:1`,zed:(e,t)=>`zed://file${uc(e)}:${String(t)}`,idea:(e,t)=>`idea://open?file=${encodeURIComponent(e)}&line=${String(t)}`},fc={vscode:e=>`vscode://file${uc(e)}`,cursor:e=>`cursor://file${uc(e)}`,windsurf:e=>`windsurf://file${uc(e)}`},pc=400,mc=e=>{let t=Array.from({length:e.length},()=>null),n=null;for(let r=e.length-1;r>=0;--r)n=e[r]?.new??n,t[r]=n;let r=null;return e.map((e,n)=>(r=e.new??r,e.op===`gap`?null:t[n]??r))},hc=(e,t)=>e.worktree===null||e.isDeleted||t===null?null:dc[e.editor](`${e.worktree}/${e.path}`,t),gc=(e,t)=>e===null?null:fc[t]?.(e)??null,_c=e=>{let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,t.dataset.editorLink=``,document.body.append(t),t.click(),t.remove()},vc=(e,t)=>{t===null?_c(e):(_c(t),globalThis.setTimeout(()=>{_c(e)},pc))},yc=e=>e.closest(`[data-editor-folder]`)?.dataset.editorFolder??null,bc=({worktree:e,file:t,editor:n})=>{if(t===void 0)return[];let r={worktree:e,path:t.path,isDeleted:t.status===`deleted`,editor:n};return mc(t.rows).map(e=>hc(r,e))},xc=({worktree:e,file:t,row:n})=>{let{editor:r}=nt(),i=bc({worktree:e,file:t,editor:r})[n]??null;i!==null&&vc(i,gc(e,r))},Sc=[{title:`Move`,rows:[[[`j`,`k`],`move`],[[`]`,`[`],`next and previous file`],[[`}`,`{`],`next and previous change`],[[`g`,`G`],`first and last line`],[[`n`,`N`],`next and previous comment`],[[`Tab`],`between the files and the diff`]]},{title:`Comment`,rows:[[[`v`,`V`],`select, select the change`],[[`c`],`comment`],[[`ctrl`,`s`],`send`],[[`C`],`send the notes you hold`],[[`a`],`review panel`],[[`T`],`every thread that needs you, or the diff`],[[`D`],`settle what is read`]]},{title:`Files`,rows:[[[`m`],`reviewed`],[[`M`],`reviewed, and the next file`],[[`f`],`hide read files`],[[`s`],`layers or file tree`],[[`h`,`l`],`close and open a layer`],[[`L`],`ask for a new order`]]},{title:`View`,rows:[[[`w`],`wrap`],[[`+`,`-`],`more or less context`],[[`F`],`whole file`],[[`r`],`since review or full diff`],[[`l`],`open the fold`],[[`h`],`fold another layer's lines back`],[[`S`],`scope above the diff`],[[`I`],`layer notes over the code`],[[`O`],`other layers' lines in place`],[[`e`],`open the line in your editor`]]},{title:`Branch`,rows:[[[`b`],`base to compare against`],[[`p`],`pull request`],[[`/`],`search this branch`],[[`?`],`keys`],[[`Esc`],`back`]]}],Cc=({keys:e,label:n,isScoped:r})=>(0,q.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,q.jsx)(`dt`,{className:`flex w-16 shrink-0 justify-end`,children:(0,q.jsx)(t,{children:e.map(e=>(0,q.jsx)(V,{children:e},e))})}),(0,q.jsxs)(`dd`,{className:`m-0 min-w-0 text-muted-foreground`,children:[n,e[0]===`S`?(0,q.jsx)(`span`,{className:`ms-1.5 text-xs text-subtle`,children:r?`on`:`off`}):null]})]}),wc=()=>{let{isScoped:e}=Qe();return(0,q.jsx)(`div`,{className:`grid gap-x-8 gap-y-4 px-4 py-3 sm:grid-cols-2`,children:Sc.map(t=>(0,q.jsxs)(`section`,{children:[(0,q.jsx)(`h3`,{className:`m-0 mb-1 ps-19 text-xs font-medium text-subtle`,children:t.title}),(0,q.jsx)(`dl`,{className:`m-0`,children:t.rows.map(([t,n])=>(0,q.jsx)(Cc,{isScoped:e,keys:t,label:n},t.join(` `)))})]},t.title))})},Tc=()=>{let{editor:e}=Qe();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`me-1`,children:`Open lines in`}),sn.map(t=>(0,q.jsx)(st,{"aria-pressed":e===t,"data-editor-choice":t,onClick:()=>{Ht({editor:t})},size:`xs`,variant:`ghost`,children:lc[t]},t))]})},Ec=()=>{let e=We();return(0,q.jsxs)(`span`,{className:`inline-flex items-center`,children:[(0,q.jsx)(`span`,{className:`me-2`,children:`Theme`}),(0,q.jsxs)(`fieldset`,{className:`relative m-0 grid grid-cols-3 rounded-md border-0 bg-muted p-0.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0.5 inset-s-0.5 segment-pill rounded-sm bg-secondary`,ref:t=>{t?.style.setProperty(`--at`,String(Pt.indexOf(e)))}}),Pt.map(t=>(0,q.jsx)(`button`,{"aria-pressed":e===t,className:`relative h-5 press px-2 text-xs text-muted-foreground hover:text-foreground aria-pressed:text-foreground`,"data-theme-choice":t,onClick:()=>{vt(t)},type:`button`,children:Yt[t]},t))]})]})},Dc=e=>`'${e.replaceAll(`'`,`'\\''`)}'`,Oc=e=>[`1. Run \`adiff comment take --worktree ${Dc(e)}\` once. It hands you every comment still owed an answer.`,`2. Run \`adiff comment take --worktree ${Dc(e)} --wait 6900\` in the background (in Claude Code: Bash with run_in_background and timeout 7200000). It returns when there is a comment you have not been handed. Never poll it on a timer, and keep only one running.`,`3. For each comment you are handed, do what it asks in ${e}, then answer it by id with \`adiff comment answer --worktree ${e} --id <id> --body "…"\`, saying what you changed. If the comment is unclear or asks for something you cannot do there, answer with your question instead.`,`4. When the background wait returns, start it again before you handle what it returned, and go back to step 3. An empty answer means only that the wait ran out: start it again and say nothing.`],kc=(e,t)=>[`I am reviewing ${t} in the adiff review page, and my comments reach you through adiff. The branch is checked out in ${e}.`,`Use the adiff skill if you have one. Listen to the review in a loop:`,...Oc(e),`Keep listening until I say the review is done. Do not push or open pull requests unless I ask.`].join(`
|
|
1
|
+
import{$ as e,$n as t,$t as n,A as r,An as i,Ar as a,At as o,B as s,Bn as c,Bt as l,C as u,Cn as d,Cr as f,Ct as p,D as m,Dr as h,Dt as g,E as _,Er as v,Et as y,F as b,Fn as x,Ft as S,G as C,Gn as w,Gt as T,H as E,Hn as D,Ht as O,I as k,In as A,It as ee,J as j,Jn as M,Jt as N,K as P,Kn as F,Kt as te,L as I,Ln as ne,Lt as L,M as re,Mn as ie,Mt as ae,N as oe,Nn as se,O as R,Or as z,Ot as ce,P as le,Pn as ue,Pt as de,Q as B,Qn as V,Qt as fe,R as pe,Rn as H,Rt as me,S as he,Sn as ge,Sr as _e,St as ve,T as ye,Tn as be,Tr as xe,Tt as Se,U as Ce,Un as we,Ut as Te,V as Ee,Vn as De,Vt as Oe,W as ke,Wn as Ae,Wt as je,X as Me,Xn as Ne,Xt as Pe,Y as Fe,Yn as Ie,Yt as Le,Z as Re,Zn as ze,Zt as Be,_ as Ve,_r as He,_t as Ue,a as We,an as Ge,ar as Ke,at as qe,b as Je,bn as Ye,br as Xe,bt as Ze,c as Qe,cn as $e,cr as et,ct as tt,d as nt,dn as rt,dr as it,dt as at,en as ot,er as st,et as ct,f as lt,fn as ut,fr as dt,ft,g as pt,gn as mt,gr as U,gt as ht,h as gt,hr as W,ht as _t,i as vt,in as yt,ir as bt,it as xt,j as St,jt as Ct,k as wt,kr as Tt,kt as Et,l as Dt,lr as Ot,lt as kt,m as At,mn as jt,mr as Mt,mt as Nt,n as Pt,nn as Ft,nr as It,nt as Lt,o as Rt,on as zt,or as Bt,ot as Vt,p as Ht,pn as Ut,pr as Wt,pt as Gt,q as Kt,qn as qt,qt as Jt,r as Yt,rn as Xt,rr as Zt,rt as Qt,s as $t,sn as en,sr as tn,st as nn,t as rn,tn as an,tr as G,tt as on,u as sn,un as cn,ur as ln,ut as un,v as dn,vn as fn,vr as pn,vt as mn,w as hn,wn as gn,wr as _n,wt as vn,x as yn,xn as bn,xr as xn,xt as Sn,y as Cn,yn as wn,yr as Tn,yt as En,z as Dn,zn as On,zt as kn}from"./index-RB6aBuh0.js";import{i as An,n as jn,r as Mn,t as Nn}from"./jsx-runtime-EIAPxkjE.js";var Pn={name:`arrow-down-to-line`,size:24,node:[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]};Pn.node;var Fn=v(Pn),In={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};In.node;var Ln=v(In),Rn={name:`arrow-up-to-line`,size:24,node:[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]};Rn.node;var zn=v(Rn),Bn={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Bn.node;var Vn=v(Bn),Hn={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};Hn.node;var Un=v(Hn),Wn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Wn.node;var Gn=v(Wn),Kn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Kn.node;var qn=v(Kn),Jn={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Jn.node;var Yn=v(Jn),Xn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Xn.node;var Zn=v(Xn),Qn={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Qn.node;var $n=v(Qn),er={name:`chevrons-down-up`,size:24,node:[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]};er.node;var tr=v(er),nr={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};nr.node;var rr=v(nr),ir={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};ir.node;var ar=v(ir),or={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};or.node;var sr=v(or),cr={name:`clipboard-copy`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]};cr.node;var lr=v(cr),ur={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};ur.node;var dr=v(ur),fr={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};fr.node;var pr=v(fr),mr={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};mr.node;var hr=v(mr),gr={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};gr.node;var _r=v(gr),vr={name:`file-text`,size:24,node:[[`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:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};vr.node;var yr=v(vr),br={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};br.node;var xr=v(br),Sr={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Sr.node;var Cr=v(Sr),wr={name:`git-compare`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]};wr.node;var Tr=v(wr),Er={name:`git-pull-request`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Er.node;var Dr=v(Er),Or={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Or.node;var kr=v(Or),Ar={name:`layers-2`,size:24,node:[[`path`,{d:`M13 13.74a2 2 0 0 1-2 0L2.5 8.87a1 1 0 0 1 0-1.74L11 2.26a2 2 0 0 1 2 0l8.5 4.87a1 1 0 0 1 0 1.74z`,key:`15q6uc`}],[`path`,{d:`m20 14.285 1.5.845a1 1 0 0 1 0 1.74L13 21.74a2 2 0 0 1-2 0l-8.5-4.87a1 1 0 0 1 0-1.74l1.5-.845`,key:`byia6g`}]]};Ar.node;var jr=v(Ar),Mr={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Mr.node;var Nr=v(Mr),Pr={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Pr.node;var Fr=v(Pr),Ir={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};Ir.node;var Lr=v(Ir),Rr={name:`locate-fixed`,size:24,node:[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Rr.node;var zr=v(Rr),Br={name:`message-square-plus`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};Br.node;var Vr=v(Br),Hr={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};Hr.node;var Ur=v(Hr),Wr={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Wr.node;var Gr=v(Wr),Kr={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Kr.node;var qr=v(Kr),Jr={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};Jr.node;var Yr=v(Jr),Xr={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Xr.node;var Zr=v(Xr),Qr={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Qr.node;var $r=v(Qr),ei={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ei.node;var ti=v(ei),ni={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};ni.node;var ri=v(ni),ii={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};ii.node;var ai=v(ii),oi={name:`sparkle`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]};oi.node;var si=v(oi),ci={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};ci.node;var li=v(ci),ui={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};ui.node;var di=v(ui),fi={name:`square-dashed-text`,size:24,node:[[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 14v1`,key:`169vum`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M9 3h1`,key:`1yesri`}]],aliases:[`text-selection`,`text-select`]};fi.node;var pi=v(fi),mi={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};mi.node;var hi=v(mi),gi={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};gi.node;var _i=v(gi),vi={name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]};vi.node;var yi=v(vi),bi={name:`text-wrap`,size:24,node:[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]],aliases:[`wrap-text`]};bi.node;var xi=v(bi),Si={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Si.node;var Ci=v(Si),wi={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};wi.node;var Ti=v(wi),Ei={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Ei.node;var Di=v(Ei),Oi=0;function ki(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Oi);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),tn;let o=requestAnimationFrame(a);return Oi=o,()=>{Oi===o&&(cancelAnimationFrame(o),Oi=0)}}var Ai={inert:new WeakMap,"aria-hidden":new WeakMap},ji=`data-base-ui-inert`,Mi={inert:new WeakSet,"aria-hidden":new WeakSet},Ni=new WeakMap,Pi=0;function Fi(e){return Mi[e]}function Ii(e){return e?xe(e)?e.host:Ii(e.parentNode):null}var Li=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ii(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ri=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},zi=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{pn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Bi(e,t,n,r,{mark:i=!0}){let a=null;r?a=`inert`:n&&(a=`aria-hidden`);let o=null,s=null,c=Li(t,e),l=i?zi(t,Ri(c),new Set(c)):[],u=[],d=[];if(a){let e=Ai[a],n=Fi(a);s=n,o=e;let r=Li(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=c.concat(r);zi(t,Ri(i),new Set(i)).forEach(t=>{let r=t.getAttribute(a),i=r!==null&&r!==`false`,o=(e.get(t)||0)+1;e.set(t,o),u.push(t),o===1&&i&&n.add(t),i||t.setAttribute(a,a===`inert`?``:`true`)})}return i&&l.forEach(e=>{let t=(Ni.get(e)||0)+1;Ni.set(e,t),d.push(e),t===1&&e.setAttribute(ji,``)}),Pi+=1,()=>{o&&u.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!s?.has(e)&&a&&e.removeAttribute(a),s?.delete(e))}),i&&d.forEach(e=>{let t=(Ni.get(e)||0)-1;Ni.set(e,t),t||e.removeAttribute(ji)}),--Pi,Pi||(Ai.inert=new WeakMap,Ai[`aria-hidden`]=new WeakMap,Mi.inert=new WeakSet,Mi[`aria-hidden`]=new WeakSet,Ni=new WeakMap)}}function Vi(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0}=t,a=it(e[0]).body;return Bi(e,a,n,r,{mark:i})}var K=An(a(),1),q=Nn();function Hi(e,t){let n=Xe(On(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ui=20,Wi=[];function Gi(){Wi=Wi.filter(e=>e.deref()?.isConnected)}function Ki(e){Gi(),e&&pn(e)!==`body`&&(Wi.push(new WeakRef(e)),Wi.length>Ui&&(Wi=Wi.slice(-20)))}function qi(){return Gi(),Wi[Wi.length-1]?.deref()}function Ji(e){return e?te(e)?e:Jt(e)[0]||e:null}function Yi(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=l(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return te(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Xi(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=U(()=>b.current.floatingContext?.nodeId),S=i===!1,C=bn(_)&&S,E=Xt(i),k=Xt(a),A=Xt(l),ee=Xt(g),j=Et(p),M=ae(),N=K.useRef(!1),P=K.useRef(!1),F=K.useRef(!1),I=K.useRef(null),re=K.useRef(``),ie=K.useRef(``),oe=K.useRef(null),se=K.useRef(null),R=et(oe,f,M?.beforeInsideRef),z=et(se,M?.afterInsideRef),ce=Ie(),le=Ie(),ue=Ft(),de=M!=null,B=Ye(v),V=U((e=B)=>e?Jt(e):[]),fe=U(()=>m?.().filter(e=>e!=null)??[]);K.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&H(B,ne(it(B)))&&V().length===0&&!C&&we(e)}let t=it(B);return Ge(t,`keydown`,e)},[r,B,s,C,V]),K.useEffect(()=>{if(r||!g)return;let e=it(B);function t(){F.current=!1}function n(e){let t=On(e),n=fe(),r=H(v,t)||H(_,t)||H(M?.portalNode,t)||n.some(e=>e===t||H(e,t));F.current=!r,ie.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(P.current=!0,le.start(0,()=>{P.current=!1}))}function i(){ie.current=`keyboard`}return yt(Ge(e,`pointerdown`,n,!0),Ge(e,`pointerup`,t,!0),Ge(e,`pointercancel`,t,!0),Ge(e,`keydown`,i,!0),t)},[r,v,_,B,g,M,le,fe]),K.useEffect(()=>{if(r||!c)return;let e=it(B);function t(){P.current=!0,le.start(0,()=>{P.current=!1})}function n(e){let t=On(e);te(t)&&(I.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=On(t);s&&n==null&&i!=null&&H(v,i)&&Ki(i),queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=fe(),f=n?.hasAttribute(L(`focus-guard`))&&[oe.current,se.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,vn(d),vn(u)].includes(n),p=!(H(_,n)||H(v,n)||H(n,v)||H(M?.portalNode,n)||l.some(e=>e===n||H(e,n))||c.hasMatchingElement(e=>H(e,n))||f||j&&(kn(j.nodesRef.current,a).find(e=>H(e.context?.elements.floating,n)||H(e.context?.elements.domReference,n))||me(j.nodesRef.current,a).find(e=>[e.context?.elements.floating,Ye(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&B&&Yi(B),o&&r!==_&&!Be(i)&&ne(e)===e.body){if(_e(B)&&(B.focus(),o===`popup`)){ue.request(()=>{B.focus()});return}let e=V(),t=I.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;_e(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!s)&&n&&p&&!P.current&&(C||n!==qi())&&(N.current=!0,h.setOpen(!1,zt(cn,t)))})}function a(){F.current||(b.current.insideReactTree=!0,ce.start(0,()=>{b.current.insideReactTree=!1}))}let l=_e(_)?_:null;if(v||l)return yt(l&&Ge(l,`focusout`,i),l&&Ge(l,`pointerdown`,t),v&&Ge(v,`focusin`,n),v&&Ge(v,`focusout`,i),v&&M&&Ge(v,`focusout`,a,!0))},[r,_,v,B,s,j,M,h,c,o,V,C,x,b,ce,le,ue,u,d,fe]),K.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${L(`portal`)}]`)||[]),t=(j?me(j.nodesRef.current,x()):[]).find(e=>bn(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Vi([v,...e,oe.current,se.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...fe(),t,vn(d),vn(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Vi([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,M,C,j,x,u,d,fe]),W(()=>{if(!g||r||!_e(B))return;re.current=``,ie.current=``;let e=it(B),t=ne(e);queueMicrotask(()=>{let n=E.current,r=typeof n==`function`?n(A.current||``):n;if(r===void 0||r===!1||H(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():vn(r),o||=a();let s=H(B,ne(e));ki(o,{preventScroll:o===B,shouldFocus(){if(!ee.current)return!1;if(s)return!0;let t=ne(e);return!(t!==o&&H(B,t))}})})},[r,g,B,V,E,A,ee]),W(()=>{if(r||!B)return;let e=it(B),t=ne(e),n=A.current==null;Ki(t);function i(e){if(e.open||(re.current=Hi(e.nativeEvent,ie.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(N.current=!0),e.reason===`outside-press`){if(e.nested)N.current=!1;else if(De(e.nativeEvent)||D(e.nativeEvent))N.current=!1;else{let e=!1;it(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?N.current=!1:N.current=!0}}}y.on(`openchange`,i);function a(e){let r=k.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&pn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=qi()||null,typeof i==`boolean`?s:vn(i)||s||null}return()=>{y.off(`openchange`,i);let t=ne(e),n=fe(),r=H(v,t)||n.some(e=>e===t||H(e,t))||j&&kn(j.nodesRef.current,x(),!1).some(e=>H(e.context?.elements.floating,t)),o=k.current,s=re.current,c=a(s);queueMicrotask(()=>{let n=Ji(c),i=typeof o!=`boolean`;if(o&&!N.current&&_e(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}N.current=!1})}},[r,v,B,k,A,y,j,_,x,fe]),W(()=>{if(!w||g||!v)return;let e=ne(it(v));_e(e)&&ge(e)&&H(v,e)&&e.blur()},[g,v]),W(()=>{if(!r&&M)return M.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{M.setFocusManagerState(null)}},[r,M,s,g,h,c,_]),W(()=>{if(!r&&B)return Yi(B),()=>{queueMicrotask(Gi)}},[r,B]);let pe=!r&&(!s||!C)&&(de||s);return(0,q.jsxs)(K.Fragment,{children:[pe&&(0,q.jsx)(ot,{"data-type":`inside`,ref:R,onFocus:e=>{if(s){let e=V();ki(e[e.length-1])}else M?.portalNode&&(N.current=!1,T(e,M.portalNode)?Oe(_)?.focus():vn(d??M.beforeOutsideRef)?.focus())}}),n,pe&&(0,q.jsx)(ot,{"data-type":`inside`,ref:z,onFocus:e=>{s?ki(V()[0]):M?.portalNode&&(c&&(N.current=!0),T(e,M.portalNode)?O(_)?.focus():vn(u??M.afterOutsideRef)?.focus())}})]})}function Zi(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:l=wn}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,f=K.useRef(void 0),p=Ft(),m=Ie(),h=K.useMemo(()=>{function e(e,t,n,r){let i=zt(l,t,n);e&&r===`touch`&&s>0?m.start(s,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=u.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){f.current=c(e.pointerType,!0)&&D(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(n){let i=f.current,o=n.nativeEvent,s=u.select(`open`);if(n.button!==0||r===`click`||c(i,!0)&&a)return;let l=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),d=On(o);if(ge(d)){e(l,o,d,i);return}let m=n.currentTarget;p.request(()=>{e(l,o,m,i)})},onClick(n){if(r===`mousedown-only`)return;let i=f.current;r===`mousedown`&&i?f.current=void 0:c(i,!0)&&a||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){f.current=void 0}}},[d,r,a,l,u,o,i,p,m,s]);return K.useMemo(()=>n?{reference:h}:Bt,[n,h])}function Qi(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function $i(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function ea(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push($i(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:Qi(r,i,a,o)}}function ta(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function na(e){return Qi(e.left,e.top,e.right,e.bottom)}function ra(e,t,n){let{lines:r}=ea(e.getClientRects());if(r.length<2)return;let i=ta(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function ia(e,t,n){let{lines:r,fallback:i}=ea(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return na(r[n.lineIndex]);if(a!=null&&o!=null){let e=ta(r,a,o);if(e!==-1)return na(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return Qi(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return Qi(l,f.top,u,p.bottom)}function aa(e){return`contextElement`in e&&e.contextElement?e.contextElement:xn(e)?e:void 0}function oa(e,t,n,r){let i=ra(t,n,r);return e.current=i,i}function sa(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=aa(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=ia(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var ca=`Escape`;function la(e){return w&&e.movementX===0&&e.movementY===0}function ua(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function da(e,t){return ua(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function fa(e,t,n){return ua(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function pa(e,t,n){return ua(t,n?e===ue:e===x,e===se)}function ma(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===ca:ua(t,n?e===x:e===ue,e===A)}function ha(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,parentOrientation:_,id:v,resetOnPointerLeave:y=!0,externalTree:b,grid:x}=t,S=x!=null,C=`rootStore`in e?e.rootStore:e,w=C.useState(`open`),T=C.useState(`floatingElement`),E=C.useState(`domReferenceElement`),O=C.context.dataRef,k=Ye(T),A=bn(E),ee=Xt(k),j=ce(),M=Et(b),P=K.useRef(f),F=K.useRef(o??-1),te=K.useRef(null),I=K.useRef(!0),L=U(e=>{i(F.current===-1?null:F.current,e)}),re=K.useRef(!!T),ie=K.useRef(w),ae=K.useRef(!1),oe=K.useRef(!1),se=K.useRef(null),R=Xt(h),z=Xt(w),le=Xt(o),ue=Xt(y),de=Ft(),B=Ft(),V=U(()=>{function e(e){d?M?.events.emit(`virtualfocus`,e):se.current=ki(e,{sync:ae.current,preventScroll:!0})}let t=n.current[F.current],r=oe.current;t&&e(t),(ae.current?e=>e():e=>de.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),ye&&(r||!I.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});W(()=>{O.current.orientation=g},[O,g]),W(()=>{a&&(w&&T?(F.current=o??-1,P.current&&o!=null&&(oe.current=!0,L())):re.current&&(F.current=-1,L()))},[a,w,T,o,L]),W(()=>{if(a){if(!w)ae.current=!1;else if(T){if(r==null){if(ae.current=!1,le.current!=null)return;if(re.current&&(F.current=-1,V()),(!ie.current||!re.current)&&P.current&&(te.current!=null||P.current===!0&&te.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>B.request(e):queueMicrotask)(t),e+=1):(F.current=te.current==null||fa(te.current,g,u)||l?Pe(n):Le(n),te.current=null,L())};t()}}else fe(n.current,r)||(F.current=r,V(),oe.current=!1)}}},[a,w,T,r,le,l,n,g,u,L,V,B]),W(()=>{if(!a||T||!M||d||!re.current)return;let e=M.nodesRef.current,t=e.find(e=>e.id===j)?.context?.elements.floating,n=ne(it(E??t??null)),r=e.some(e=>e.context&&H(e.context.elements.floating,n));t&&!r&&I.current&&t.focus({preventScroll:!0})},[a,T,E,M,j,d]),W(()=>{ie.current=w,re.current=!!T}),W(()=>{w||(te.current=null,P.current=f)},[w,f]);let pe=r!=null,me=U(e=>{if(!z.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,L(e))}),he=U(()=>_??M?.nodesRef.current.find(e=>e.id===j)?.context?.dataRef?.current.orientation),ge=U(()=>Pe(n,R.current)),ve=U(e=>{if(I.current=!1,ae.current=!0,e.which===229||!z.current&&e.currentTarget===ee.current)return;if(l&&ma(e.key,g,u,S)){da(e.key,he())||we(e),C.setOpen(!1,zt(Ut,e.nativeEvent)),_e(E)&&(d?M?.events.emit(`virtualfocus`,E):E.focus());return}let t=F.current,r=Pe(n,h),i=Le(n,h);if(A||(e.key===`Home`&&(we(e),F.current=r,L(e)),e.key===`End`&&(we(e),F.current=i,L(e))),x!=null){let t=x(e,F.current,n,g,c,u,h,r,i);if(t!=null&&(F.current=t,L(e)),g===`both`)return}if(da(e.key,g)){if(we(e),w&&!d&&ne(e.currentTarget.ownerDocument)===e.currentTarget){F.current=fa(e.key,g,u)?r:i,L(e);return}fa(e.key,g,u)?c?t>=i?s&&t!==n.current.length?F.current=-1:(ae.current=!1,F.current=r):F.current=N(n.current,{startingIndex:t,disabledIndices:h}):F.current=Math.min(i,N(n.current,{startingIndex:t,disabledIndices:h})):c?t<=r?s&&t!==-1?F.current=n.current.length:(ae.current=!1,F.current=i):F.current=N(n.current,{startingIndex:t,decrement:!0,disabledIndices:h}):F.current=Math.max(r,N(n.current,{startingIndex:t,decrement:!0,disabledIndices:h})),fe(n.current,F.current)&&(F.current=-1),L(e)}}),ye=K.useMemo(()=>({onFocus(e){ae.current=!0,me(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){la(e)||(ae.current=!0,oe.current=!1,p&&me(e))},onPointerLeave(e){if(!z.current||!I.current||e.pointerType===`touch`)return;ae.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ue.current&&(se.current?.(),se.current=null,F.current=-1,L(e),!d)){let e=ee.current,t=ne(it(e));e&&H(e,t)&&e.focus({preventScroll:!0})}}}),[me,z,ee,p,n,L,ue,d]),be=K.useMemo(()=>d&&w&&pe&&{"aria-activedescendant":`${v}-${r}`},[d,w,pe,v,r]),xe=K.useMemo(()=>({...A?{}:be,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&w&&!d){let t=On(e.nativeEvent);if(t&&!H(ee.current,t))return;we(e),C.setOpen(!1,zt(cn,e.nativeEvent)),_e(E)&&E.focus()}else ve(e)},onPointerMove(e){la(e)||(I.current=!0)}}),[be,ve,ee,A,C,w,d,E]),Se=K.useMemo(()=>{function e(e){C.setOpen(!0,zt(Ut,e.nativeEvent,e.currentTarget))}function t(e){f===`auto`&&De(e.nativeEvent)&&(P.current=!d)}function n(e){P.current=f,f===`auto`&&D(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(t){let n=C.select(`open`);I.current=!1;let r=t.key.startsWith(`Arrow`),i=pa(t.key,he(),u),a=da(t.key,g),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(d&&n)return ve(t);if(n||m||!r){if(o){let e=da(t.key,he());te.current=l&&e?null:t.key}l?i&&(we(t),n?(F.current=ge(),L(t)):e(t)):a&&(le.current!=null&&(F.current=le.current),we(t),!n&&m?e(t):ve(t),n&&L(t))}},onFocus(e){C.select(`open`)&&!d&&(F.current=-1,L(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ve,f,ge,l,L,C,m,g,he,u,le,d]),Ce=K.useMemo(()=>({...be,...Se}),[be,Se]);return K.useMemo(()=>a?{reference:Ce,floating:xe,item:ye,trigger:Se}:{},[a,Ce,xe,Se,ye])}function ga(e,t){let{listRef:r,elementsRef:i,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=`rootStore`in e?e.rootStore:e,p=f.useState(`open`),m=Ie(),h=K.useRef(``),g=K.useRef(d??a??-1),_=K.useRef(null),v=U(e=>{function t(e){return i?.current[e]}function l(e){let r=t(e);return r&&!Be(r)||r?.matches(`:disabled`)?!1:s==null||!n(Ke,e,s)}function f(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&l(n))return n}return-1}let v=r.current;if(h.current.length>0&&e.key===` `&&(we(e),c?.(!0)),h.current.length>0&&h.current[0]!==` `&&f(v,h.current)===-1&&e.key!==` `&&c?.(!1),v==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(we(e),c?.(!0));let y=h.current===``;y&&(g.current=d??a??-1),v.every((e,t)=>e&&l(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,c?.(!1)});let b=((y?d??a??-1:g.current)??0)+1,x=f(v,h.current,b);x===-1?e.key!==` `&&(h.current=``,c?.(!1)):(o?.(x),_.current=x)}),y=U(e=>{let t=e.relatedTarget,n=f.select(`domReferenceElement`),r=f.select(`floatingElement`);H(n,t)||H(r,t)||(m.clear(),h.current=``,g.current=_.current,c?.(!1))});W(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``))},[p,d,m]);let b=K.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return K.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}var _a=e=>{let t={running:null,next:null},n=async()=>{let n=e();t.running=n;try{return await n}finally{t.running===n&&(t.running=null)}},r=async e=>{try{await e}catch{}return t.next=null,n()};return Object.assign(()=>t.running===null?n():(t.next??=r(t.running),t.next),{current:()=>t.running??n()})},va=h({method:`POST`}).handler(z(`d8312664c6aa9aecf245095d01a37077f92332e35727648e70895cf2ce8820df`)),ya=h({method:`POST`}).handler(z(`0f042f20f6465d3f1aef6d39f8a9bbc6d7a67f0c0095129fb5a12320572da6c5`)),ba=h({method:`GET`}).handler(z(`6eecb07d4b182f665117c88dc895f7eb8dc3a4bb4bc7444c3c7f5e39e45f1395`)),xa=h({method:`POST`}).handler(z(`6d9ad149a44e29ec90458d6687ea2c92d98859cbcc44d7521127c2c4cfaedc67`)),Sa=h({method:`GET`}).handler(z(`f3609bca9dbfd37554e557b01b4f2cde39e84e8d358a830730bfb93998f3f6dd`)),Ca=h({method:`GET`}).handler(z(`ec830af09bbd81cf8ccba41a6cf5c80ef59098d9272dcd133d7509d54d033a76`)),wa=h({method:`POST`}).handler(z(`1c122a1878638fa6877d8737799f71372951cf995210ada6f735b17d8dcdc6ec`)),Ta=h({method:`GET`}).handler(z(`ca81996f5cde62306b310948df2499c55b0d5c8df1bbf5c0da11478771b4afb0`)),Ea=h({method:`POST`}).handler(z(`acd41dcd63b04d512e76bc5182c86ad4235a95b99e5beba1de74832877815035`)),Da=h({method:`POST`}).handler(z(`95b2066779521c5ee2eb1562972665eef00a38622ad0864ef7d8b4672d82fd39`)),Oa=h({method:`POST`}).handler(z(`c7a57e967e7faf79ff4adba8db39dd62f1c9c7a9efdc2fd1c0ff9a8a75e89dc6`)),ka=h({method:`POST`}).handler(z(`e7a2c93fea99cc38405ad8aec216e26f886d619a7f8376f105cb1cfa7cceea95`)),Aa={pull:null,remarks:[],drafts:[]},ja=({place:e,branch:t})=>{let[n,r]=(0,K.useState)(Aa),i=(0,K.useMemo)(()=>_a(async()=>{r(await Sa({data:{place:e,branch:t,isFresh:!0}}))}),[e,t]);return(0,K.useEffect)(()=>{let n={isCurrent:!0};return(async()=>{let i=await Sa({data:{place:e,branch:t,isFresh:!1}});n.isCurrent&&r(i)})(),()=>{n.isCurrent=!1}},[e,t]),{extras:n,refresh:i}},Ma=`reconnected`,Na=15e3,Pa=(e,t)=>{let n=(0,K.useRef)(t);(0,K.useEffect)(()=>{n.current=t}),(0,K.useEffect)(()=>{let t={events:null,opens:0,hiddenAt:0},r=()=>{t.events?.close();let r=new EventSource(e);for(let e of Object.keys(n.current).filter(e=>e!==Ma))r.addEventListener(e,t=>{n.current[e]?.(t instanceof MessageEvent?String(t.data):``)});r.addEventListener(`open`,()=>{t.opens+=1,t.opens>1&&n.current[Ma]?.(``)}),t.events=r},i=e=>{if(document.visibilityState===`hidden`){t.hiddenAt=Date.now();return}let n=e instanceof PageTransitionEvent&&e.persisted,i=t.hiddenAt>0&&Date.now()-t.hiddenAt>Na;(n||i||t.events?.readyState===EventSource.CLOSED)&&r(),t.hiddenAt=0};return r(),document.addEventListener(`visibilitychange`,i),globalThis.addEventListener(`pageshow`,i),()=>{document.removeEventListener(`visibilitychange`,i),globalThis.removeEventListener(`pageshow`,i),t.events?.close()}},[e])},Fa=1500,Ia=e=>{let t=(0,K.useRef)([]),n=(0,K.useRef)(null),r=(0,K.useCallback)(async e=>{let r=t.current;t.current=[];let i=(async()=>{await e})();n.current=i,await i,n.current===i&&(n.current=null),r.forEach(e=>{e()})},[]);return{settle:r,awaitNext:(0,K.useCallback)(()=>{if(n.current!==null)return n.current;let{promise:i,resolve:a}=Promise.withResolvers();t.current.push(()=>{a(void 0)});let o=t.current.at(-1);return setTimeout(()=>{o!==void 0&&t.current.includes(o)&&r(e())},Fa),i},[r,e])}},La=St([`filed`,`waiting`,`answered`,`asked`,`settled`,`gone`]),Ra=wt({path:k(),added:R(),removed:R(),read:Je(),open:R(),stand:La}),za=wt({title:k(),note:r(k(),``),files:Cn(k()),spans:r(Cn(wt({path:k(),start:R(),end:R()})),[]),prose:r(Cn(wt({path:k(),line:R(),markdown:k(),after:Je()})),[]),read:r(Cn(k()),[]),vanished:r(Cn(k()),[]),added:R(),removed:R(),done:Je(),unclaimed:Je(),open:R(),stand:La,parts:Cn(Ra),address:r(k()),ticket:r(R()),sublayer:r(R())}),Ba=wt({number:R(),address:k(),title:k(),note:r(k(),``),layers:Cn(R()),sublayers:R(),sublayersDone:r(R(),0),files:Cn(k()),added:R(),removed:R(),done:r(Je(),!1),open:r(R(),0),stand:r(La,`gone`)}),Va=wt({stale:r(Je(),!1),summary:r(k(),``),layers:Cn(za),tickets:r(Cn(Ba),[]),topLevel:r(R())});wt({layers:Va});var Ha=wt({voice:St([`reviewer`,`agent`]),body:k(),at:k(),choices:r(Cn(k()))}),Ua=wt({id:k(),file:k(),side:St([`old`,`new`]),start:R(),end:R(),snippet:r(k(),``),body:k(),at:r(k(),``),state:k(),outdated:r(Je(),!1),settled:r(Je(),!1),unread:r(R(),0),taken:r(Je(),!1),doing:r(wt({body:k(),at:k()})),turns:Cn(Ha),stand:La,section:St([`asked`,`filed`,`with`,`answered`,`movedOn`,`settled`,`removed`]),movedPast:Je(),reworded:Je(),about:St([`branch`,`line`]),settleable:Je(),layers:Cn(R())}),Wa=wt({path:k(),open:R(),settled:R(),stand:La}),Ga=wt({path:k(),side:St([`old`,`new`]),line:R(),open:R(),settled:R(),stand:La}),Ka=wt({asked:R(),unread:R()});wt({comments:Cn(Ua),counts:r(Ka),files:Cn(Wa),lines:Cn(Ga)}),wt({layers:r(Va)});var qa=(e,t)=>e.map(e=>{let[n]=e.layers,r=n===void 0?null:t[n-1]?.address??String(n);return r===e.layerAddress?e:{...e,layerAddress:r}}),Ja=new Map,Ya=(e,t)=>{Ja.get(e)?.forEach(e=>{e(t)})},Xa=(e,t)=>{let n=Ja.get(e)??new Set;return n.add(t),Ja.set(e,n),()=>{n.delete(t)}},Za=()=>({started:0,shown:0}),Qa=async(e,t)=>{e.started+=1;let n=e.started,r=await t();return n<e.shown?null:(e.shown=n,r)},$a=h({method:`POST`}).handler(z(`bc42f104a022623469410d19573fe9714a7aed7a344f808479517ee6742bfaae`)),eo=h({method:`GET`}).handler(z(`9efdcbe2ace17d0836d7df7bc9aff104b4868682ca79516ddb6927a8ed223691`)),to=h({method:`GET`}).handler(z(`1e0b1bc8f9718ae1ef49c47aa55a9e44518eaa93e3b317cf1b521d87b3f6e983`)),no=h({method:`GET`}).handler(z(`e21610e432516c6914db00010e8bedfa8f3b53f243b609befdc905f0d0717d60`)),ro=new Map,io=({place:e,branch:t})=>`${e}|${t}`,ao=[`comments`,`state`,`layers`],oo=e=>{try{let t=JSON.parse(e);return typeof t==`object`&&t&&`what`in t&&Array.isArray(t.what)?t.what.map(String):[]}catch{return[]}},so=e=>ao.filter(t=>e.includes(t)),co=()=>{let e={isWhole:!1,parts:new Set,run:async e=>{}},t=_a(async()=>{let t={isWhole:e.isWhole,parts:[...e.parts]};e.isWhole=!1,e.parts.clear(),await e.run(t)});return{set:t=>{e.run=t},ask:async({isWhole:n,parts:r})=>{e.isWhole||=n,r.forEach(t=>{e.parts.add(t)}),await t()}}},lo=({place:e,branch:t},{show:n,merge:r})=>{let i=(0,K.useRef)(Za()),a=(0,K.useCallback)(n=>Qa(i.current,()=>eo({data:{place:e,branch:t,...n}})),[e,t]),o=(0,K.useRef)(null);return{read:a,reread:(0,K.useCallback)(async i=>{o.current??=co(),o.current.set(async({isWhole:i,parts:o})=>{if(i){let e=await a({isFresh:!0,isWhole:!0});e!==null&&n(e)}else o.length>0&&r(await ba({data:{place:e,branch:t,parts:[...o]}}))}),await o.current.ask(i)},[a,n,r,e,t])}},uo=(e,{read:t,show:n})=>{let{place:r,branch:i}=e;(0,K.useEffect)(()=>{let e={isCurrent:!0},a=async r=>{let i=await t({isFresh:r,isWhole:!0});e.isCurrent&&i!==null&&n(i)};return(async()=>{ro.get(io({place:r,branch:i}))===void 0&&await a(!1),await a(!0)})(),()=>{e.isCurrent=!1}},[r,i,t,n])},fo=(e,t)=>{let[n,r]=(0,K.useState)(()=>ro.get(e)??t);return{outline:n,show:(0,K.useCallback)(t=>{ro.set(e,t),r(t)},[e]),merge:(0,K.useCallback)(t=>{r(n=>{let r=n===null?n:{...n,...t};return r!==null&&ro.set(e,r),r})},[e])}},po={isWhole:!0,parts:[]},mo=({key:e,reread:t,settle:n,onChanged:r})=>({changed:e=>{let i=oo(e),a=so(i);a.length===0?r(i):n(Promise.all([t({isWhole:!1,parts:a}),r(i)]))},moved:()=>{n(t(po))},reconnected:()=>{n(Promise.all([t(po),r([`other`])]))},listener:t=>{Ya(e,t)}}),ho=(e,t)=>{let{place:n,branch:r}=e,i=io(e),{outline:a,show:o,merge:s}=fo(i,e.kept),{read:c,reread:l}=lo({place:n,branch:r},{show:o,merge:s}),{settle:u,awaitNext:d}=Ia(()=>Promise.all([l({isWhole:!1,parts:ao}),t([`other`])]));return uo({place:n,branch:r},{read:c,show:o}),Pa(`/review/events?${new URLSearchParams({place:n,branch:r})}`,mo({key:i,reread:l,settle:u,onChanged:t})),{outline:a,refresh:(0,K.useCallback)((e=!1)=>e?l(po):d(),[l,d])}},go=e=>{let[t,n]=(0,K.useState)(null),r=t?.on===e?t.told:e;return{layers:r.layers,tickets:r.tickets,threads:qa(e.threads,r.layers),handleLayers:t=>{t!==null&&n({on:e,told:t})}}},_o=e=>`${e.path}|${e.fingerprint}`,vo=(e,t)=>[...e].findLast(([e])=>e.startsWith(`${t}|`))?.[1],yo=200,bo=e=>{if(`requestIdleCallback`in globalThis){let t=requestIdleCallback(e);return()=>{cancelIdleCallback(t)}}let t=setTimeout(e,yo);return()=>{clearTimeout(t)}},xo=({place:e,branch:t,files:n,selected:r,order:i})=>{let[a,o]=(0,K.useState)(new Map),s=(0,K.useRef)(new Set),c=new Map(n.map(e=>[e.path,e])),l=(0,K.useCallback)(async n=>{if(n===void 0||n.rows.length>0||s.current.has(_o(n)))return;s.current.add(_o(n));let r=await to({data:{place:e,branch:t,path:n.path,fingerprint:n.fingerprint}}).catch(()=>null);o(e=>r===null?e:new Map([...e,[_o(n),r]])),r===null&&s.current.delete(_o(n))},[e,t]),u=c.get(r),d=i.indexOf(r),f=[i[d+1],i[d-1]].map(e=>c.get(e??``));return(0,K.useEffect)(()=>(l(u),bo(()=>{f.forEach(e=>{l(e)})}))),{fileFor:e=>{if(e.rows.length>0)return e;let t=a.get(_o(e))??vo(a,e.path);if(t!==void 0)return{...t,oldSha:e.oldSha,newSha:e.newSha}}}},So=(e,t)=>t===null||e.layers.includes(t+1),Co=(e,t)=>`${e.path}|${e.reviewed}|${t}`,wo=async e=>{try{return await no({data:e})}catch{return}},To=(e,t)=>e!==void 0&&e.kept&&!e.deleted&&So(e,t),Eo=({place:e,branch:t,since:n,selected:r,layer:i,current:a})=>{let[o,s]=(0,K.useState)(new Set),[c,l]=(0,K.useState)(new Map),u=(0,K.useRef)(new Set),d=n.find(e=>e.path===r),f=To(d,i)&&a!==void 0&&!o.has(r);(0,K.useEffect)(()=>{if(!f||u.current.has(Co(d,a.blob)))return;let n=Co(d,a.blob);u.current.add(n);let r={place:e,branch:t,path:d.path,reviewed:d.reviewed};(async()=>{let e=await wo({...r,blob:a.blob});e===void 0?u.current.delete(n):l(t=>new Map([...t,[n,e]]))})()});let p=e=>{let t=n.find(t=>t.path===e.path);return To(t,i)?c.has(Co(t,e.blob))?c.get(Co(t,e.blob)):vo(c,e.path):null},m=e=>!To(n.find(t=>t.path===e),i)||a?.path===e&&a.blob!==``&&p(a)===null?null:o.has(e)?`full`:`since`;return{modeOf:m,setMode:(e,t)=>{s(n=>new Set(t===`full`?[...n,e]:[...n].filter(t=>t!==e)))},swap:e=>e.path===r&&m(e.path)===`since`?p(e)??e:e,isWaiting:e=>e===r&&m(e)===`since`&&a!==void 0&&p(a)===void 0}},Do=({place:e,branch:t},{outline:n,selected:r,layer:i})=>{let a=xo({place:e,branch:t,files:n.files,selected:r,order:n.order}),o=n.files.find(e=>e.path===r),s=Eo({place:e,branch:t,since:n.since,selected:r,layer:i,current:o===void 0?void 0:a.fileFor(o)});return{files:n.files.map(e=>s.swap(a.fileFor(e)??e)),isFileLoaded:e=>{let t=n.files.find(t=>t.path===e);return t!==void 0&&a.fileFor(t)!==void 0&&!s.isWaiting(e)},sinceView:{modeOf:s.modeOf,setMode:s.setMode}}},Oo=2,ko=e=>e.split(`/`).at(-1)??e,Ao=e=>e.split(`/`).slice(0,-1).join(`/`),jo=e=>{let t={name:``,full:``,dirs:[],files:[]},n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t!==void 0)return t;let i={name:ko(e),full:e,dirs:[],files:[]};return n.set(e,i),r(Ao(e)).dirs.push(i),i};return e.forEach(e=>{r(Ao(e)).files.push(e)}),t},Mo=(e,t=e.name)=>{let[n]=e.dirs;return e.files.length===0&&e.dirs.length===1&&n!==void 0?Mo(n,t===``?n.name:`${t}/${n.name}`):{...e,name:t,dirs:e.dirs.map(e=>Mo(e))}},No=e=>{let t=e.split(`/`);return t.length>Oo?`…/${t.slice(-2).join(`/`)}`:e},Po=(e,t,{collapsed:n,rows:r})=>{e.dirs.forEach(e=>{r.push({kind:`dir`,key:`dir:${e.full}`,label:t===0?No(e.name):e.name,full:e.full,depth:t}),n.has(e.full)||Po(e,t+1,{collapsed:n,rows:r})}),e.files.forEach(e=>{r.push({kind:`file`,key:`file:${e}`,path:e,label:ko(e),depth:t})})},Fo=(e,t)=>{let n=[];return Po(e,0,{collapsed:t,rows:n}),n},Io=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),Lo=new Set,Ro={paths:[],root:null,order:[]},zo=e=>{let t=jo(e);return{...t,dirs:t.dirs.map(e=>Mo(e))}},Bo=e=>Fo(e,Lo).flatMap(e=>e.kind===`file`?[e.path]:[]),Vo=e=>{if(Ro.root!==null&&Io(Ro.paths,e))return{root:Ro.root,order:Ro.order};let t=zo(e);return Ro.paths=e,Ro.root=t,Ro.order=Bo(t),{root:t,order:Ro.order}},Ho=(e,t)=>Fo(Vo(e).root,t),Uo=e=>Vo(e).order,Wo=e=>`layer:${String(e)}`,Go=e=>`ticket:${String(e)}`,Ko=(e,t)=>`${Wo(e)}:${t}`,qo=/^layer:(?<index>\d+)/u,Jo=/^ticket:(?<number>\d+)$/u,Yo=e=>{let t=qo.exec(e);return t?.groups?.index===void 0?null:Number(t.groups.index)},Xo=e=>{let t=Jo.exec(e);return t?.groups?.number===void 0?null:Number(t.groups.number)},Zo=e=>e.map(e=>`${e.title}:${String(e.files.length)}`).join(`|`),Qo=`layer:read`,$o=e=>Ao(e),es=3,ts=e=>{let t=e.split(`/`);return t.length<es?`${e}/`:`${t[0]??``}/…/${t.at(-1)??``}/`},ns=K.createContext(void 0);function rs(e){let t=K.useContext(ns);if(!e&&t===void 0)throw Error(Wt(27));return t}var is=K.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=rs(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return Zt(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:gn,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),as=K.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=rs(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ot({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,zt($e,e.nativeEvent))}return Zt(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),os=K.createContext(void 0);function ss(){let e=K.useContext(os);if(e===void 0)throw Error(Wt(26));return e}var cs=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),ls=`--nested-dialogs`,us=`data-nested-dialog-open`,ds={...d,...i,nestedDialogOpen(e){return e?{[us]:``}:null}},fs=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=rs(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);ss(),mn({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?un(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Zt(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Vt,hidden:!m,onKeyDown(e){cs.has(e.key)&&e.stopPropagation()},style:{[ls]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ds});return(0,q.jsx)(Xi,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),ps=K.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),ms=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=rs(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,q.jsx)(os.Provider,{value:n,children:(0,q.jsxs)(Ct,{ref:t,...r,children:[a&&o===!0&&(0,q.jsx)(ps,{ref:i.context.internalBackdropRef,inert:C(!s)}),e.children]})}):null}),hs={},gs={},_s=``;function vs(e,t){return _n(e)?e:t}function ys(e,t,n){return/hidden|clip/.test(e.getComputedStyle(vs(t,n)).overflowY)}function bs(e){if(typeof document>`u`)return!1;let t=it(e);return Xe(t).innerWidth-t.documentElement.clientWidth>0}function xs(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=it(e),n=t.documentElement,r=t.body,i=vs(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Ss(e){let t=it(e),n=t.documentElement,r=t.body,i=vs(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function Cs(e){let t=it(e),n=t.documentElement,r=t.body,i=Xe(n),a=0,o=0,s=!1,c=an.create();if(w&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,hs={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},_s=n.style.scrollBehavior,gs={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=vs(n,r);s=xs(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,hs),Object.assign(r.style,gs),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=_s)}function d(){u(),c.request(l)}l();let f=Ge(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ws=new class{lockCount=0;restore=null;timeoutLock=M.create();timeoutUnlock=M.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=it(e),n=t.documentElement,r=t.body,i=Xe(n);if(ys(i,n,r)){let t=new i.MutationObserver(()=>{ys(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=F||!bs(e);this.restore=a?Ss(e):Cs(e)}};function Ts(e=!0,t=null){W(()=>{if(e)return ws.acquire(t)},[e,t])}function Es({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`disablePointerDismissal`),a=e.useState(`modal`),o=e.useState(`popupElement`),s=e.useState(`floatingRootContext`),[c,l]=K.useState(0),[u,d]=K.useState(0),f=c===0,m=p(s,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:a===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=On(t);if(f&&!i){if(a){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||H(n,o)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:f});return Ts(r&&a===!0,o),e.useContextCallback(`onNestedDialogOpen`,(e,t)=>{l(e),d(t)}),W(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(c+1,u+ +!!n):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,c,u,t]),Nt(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:c,nestedOpenDrawerCount:u}),null}var Ds={...xt,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Os=class extends ve{constructor(e,t,n){let r=new qe,i=ks(e,r,t,n);super(i,As(r),Ds)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(at(this.state,e,t.trigger)))}};function ks(e,t,n,r=!1){return{...Qt(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function As(e){return{popupRef:K.createRef(),backdropRef:K.createRef(),internalBackdropRef:K.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function js(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=rs(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=_t((e,t)=>new Os({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);ht(b,x),ft(b);let{forceUnmount:w}=Gt(x,b);K.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,zt(rt))}),[w,b]);let T=x||S;return(0,q.jsxs)(ns.Provider,{value:b,children:[u&&(0,q.jsx)(nn,{handle:u,store:b}),T&&(0,q.jsx)(Es,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var Ms=Ne(function(e){return js(`dialog`,e)}),Ns=K.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=rs(),c=Re(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Zt(`h2`,e,{ref:t,props:[{id:c},o]})});function Ps(e){let t=K.useRef(``),n=K.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:K.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Fs(e,t){let n=K.useRef(e),r=U(t);W(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Is(e,t){let{onClick:n,onPointerDown:r}=Ps(U((n,r)=>{(typeof e==`function`?e():e)||t(r||(F?`touch`:``))}));return K.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ls(e){let[t,n]=K.useState(null),r=Is(e,n);return Fs(e,t=>{t&&!e&&n(null)}),K.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var Rs=.25,zs=.11,Bs=6,Vs=2,Hs=`(max-width: 767px)`,Us=`translate 320ms var(--e-drawer)`,Ws=`translate 220ms var(--e-drawer)`,Gs=220,Ks=e=>e>=0?e:-Math.sqrt(-e)*Vs,qs=(e,t)=>{if(!(t instanceof Element)||!globalThis.matchMedia(Hs).matches)return!1;if(t.closest(`[data-slot="dialog-header"]`)!==null)return!0;let n=t.closest(`[data-slot="dialog-body"]`);return n===null?e.contains(t):n.scrollTop<=0},Js=e=>{if(!(e instanceof Element)||e.closest(`[data-slot="dialog-header"]`)!==null)return!0;let t=e.closest(`[data-slot="dialog-body"]`);return t===null||t.scrollHeight<=t.clientHeight},Ys=e=>{e.style.transition=Ws,e.style.translate=`0 calc(100% + 2rem)`,globalThis.setTimeout(()=>{e.querySelector(`[data-slot="dialog-header"] [aria-label="Close"]`)?.click()},Gs)},Xs=(e,t,n)=>{let r=n-t.startY,i=r/Math.max(1,Date.now()-t.startedAt);r>e.offsetHeight*Rs||i>zs?Ys(e):(e.style.transition=Us,e.style.translate=``)},Zs=e=>{let t={startY:0,startedAt:0,isDragging:!1,canDrag:!1,canStretch:!1};return{handleStart:n=>{let[r]=n.touches;t.canDrag=n.touches.length===1&&qs(e,n.target),t.canStretch=t.canDrag&&Js(n.target),t.isDragging=!1,t.startY=r?.clientY??0,t.startedAt=Date.now()},handleMove:n=>{let[r]=n.touches,i=(r?.clientY??t.startY)-t.startY,a=i>Bs||t.canStretch&&i<-6;t.canDrag&&(t.isDragging||a)&&(t.isDragging=!0,n.preventDefault(),e.style.transition=`none`,e.style.translate=`0 ${String(Ks(i))}px`)},handleEnd:n=>{let[r]=n.changedTouches;t.isDragging&&Xs(e,t,r?.clientY??t.startY),t.isDragging=!1}}},Qs=e=>{let{handleStart:t,handleMove:n,handleEnd:r}=Zs(e);return e.addEventListener(`touchstart`,t,{passive:!0}),e.addEventListener(`touchmove`,n,{passive:!1}),e.addEventListener(`touchend`,r),e.addEventListener(`touchcancel`,r),()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchmove`,n),e.removeEventListener(`touchend`,r),e.removeEventListener(`touchcancel`,r)}};function $s({...e}){return(0,q.jsx)(Ms,{"data-slot":`dialog`,...e})}function ec({...e}){return(0,q.jsx)(as,{"data-slot":`dialog-close`,...e})}function tc({className:e,...t}){return(0,q.jsx)(Ns,{className:G(`sr-only`,e),"data-slot":`dialog-title`,...t})}var nc={fill:`fixed inset-0 transition-[opacity,scale] duration-200 ease-out data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100`,sheet:`dialog-sheet flex flex-col overflow-hidden text-sm text-popover-foreground md:rounded-xl md:border md:border-border md:bg-popover md:shadow-sheet`},rc=(e,t)=>n=>(typeof e==`function`?e(n):e!=null&&(e.current=n),t&&n!==null?Qs(n):void 0);function ic({className:e,variant:t=`fill`,ref:n,...r}){return(0,q.jsxs)(ms,{children:[(0,q.jsx)(is,{className:`fixed inset-0 z-30 bg-overlay transition-opacity duration-200 ease-out data-ending-style:opacity-0 data-starting-style:opacity-0`,"data-slot":`dialog-overlay`,forceRender:t===`sheet`}),(0,q.jsx)(fs,{className:G(`z-30 outline-none`,nc[t],e),"data-slot":`dialog-content`,"data-variant":t,ref:rc(n,t===`sheet`),...r})]})}function ac({title:e}){return(0,q.jsxs)(`div`,{className:`flex h-11 shrink-0 items-center justify-between gap-3 border-b border-border ps-4 pe-3 max-md:relative max-md:h-14 max-md:border-0 max-md:ps-6 max-md:pt-2`,"data-slot":`dialog-header`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-s-1/2 top-2 h-1.25 w-9 -translate-x-1/2 rounded-full bg-foreground/28 md:hidden`}),(0,q.jsx)(Ns,{className:`m-0 text-sm font-medium text-foreground max-md:text-lg max-md:font-semibold`,children:e}),(0,q.jsxs)(as,{"aria-label":`Close`,className:`flex press items-center gap-1.5 rounded-md px-1.5 py-1 text-xs text-subtle outline-none hover:bg-secondary hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring max-md:size-11 max-md:justify-center max-md:p-0`,children:[(0,q.jsx)(`span`,{className:`max-md:hidden`,children:(0,q.jsx)(V,{children:`Esc`})}),(0,q.jsx)(`span`,{className:`hidden size-8 place-items-center rounded-full bg-foreground/10 text-foreground max-md:grid`,children:(0,q.jsx)(Di,{"aria-hidden":!0,className:`size-4`,strokeWidth:2.25})})]})]})}function oc({children:e}){return(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain`,"data-slot":`dialog-body`,children:e})}function sc({children:e}){return(0,q.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-t border-border bg-wash px-4 py-2.5 text-xs text-muted-foreground`,"data-slot":`dialog-footer`,children:e})}var cc=(e,t)=>{let[n,r]=(0,K.useState)(null),i=(0,K.useRef)(e);return(0,K.useEffect)(()=>{i.current=e}),(0,K.useEffect)(()=>{let e={isCurrent:!0};return(async()=>{let n=await i.current();e.isCurrent&&r({key:t,value:n})})(),()=>{e.isCurrent=!1}},[t]),n?.key===t?n.value:null},lc={vscode:`VS Code`,cursor:`Cursor`,windsurf:`Windsurf`,zed:`Zed`,idea:`JetBrains`},uc=e=>e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`),dc={vscode:(e,t)=>`vscode://file${uc(e)}:${String(t)}:1`,cursor:(e,t)=>`cursor://file${uc(e)}:${String(t)}:1`,windsurf:(e,t)=>`windsurf://file${uc(e)}:${String(t)}:1`,zed:(e,t)=>`zed://file${uc(e)}:${String(t)}`,idea:(e,t)=>`idea://open?file=${encodeURIComponent(e)}&line=${String(t)}`},fc={vscode:e=>`vscode://file${uc(e)}`,cursor:e=>`cursor://file${uc(e)}`,windsurf:e=>`windsurf://file${uc(e)}`},pc=400,mc=e=>{let t=Array.from({length:e.length},()=>null),n=null;for(let r=e.length-1;r>=0;--r)n=e[r]?.new??n,t[r]=n;let r=null;return e.map((e,n)=>(r=e.new??r,e.op===`gap`?null:t[n]??r))},hc=(e,t)=>e.worktree===null||e.isDeleted||t===null?null:dc[e.editor](`${e.worktree}/${e.path}`,t),gc=(e,t)=>e===null?null:fc[t]?.(e)??null,_c=e=>{let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,t.dataset.editorLink=``,document.body.append(t),t.click(),t.remove()},vc=(e,t)=>{t===null?_c(e):(_c(t),globalThis.setTimeout(()=>{_c(e)},pc))},yc=e=>e.closest(`[data-editor-folder]`)?.dataset.editorFolder??null,bc=({worktree:e,file:t,editor:n})=>{if(t===void 0)return[];let r={worktree:e,path:t.path,isDeleted:t.status===`deleted`,editor:n};return mc(t.rows).map(e=>hc(r,e))},xc=({worktree:e,file:t,row:n})=>{let{editor:r}=nt(),i=bc({worktree:e,file:t,editor:r})[n]??null;i!==null&&vc(i,gc(e,r))},Sc=[{title:`Move`,rows:[[[`j`,`k`],`move`],[[`]`,`[`],`next and previous file`],[[`}`,`{`],`next and previous change`],[[`g`,`G`],`first and last line`],[[`n`,`N`],`next and previous comment`],[[`Tab`],`between the files and the diff`]]},{title:`Comment`,rows:[[[`v`,`V`],`select, select the change`],[[`c`],`comment`],[[`ctrl`,`s`],`send`],[[`C`],`send the notes you hold`],[[`a`],`review panel`],[[`T`],`every thread that needs you, or the diff`],[[`D`],`settle what is read`]]},{title:`Files`,rows:[[[`m`],`reviewed`],[[`M`],`reviewed, and the next file`],[[`f`],`hide read files`],[[`s`],`layers or file tree`],[[`h`,`l`],`close and open a layer`],[[`L`],`ask for a new order`]]},{title:`View`,rows:[[[`w`],`wrap`],[[`+`,`-`],`more or less context`],[[`F`],`whole file`],[[`r`],`since review or full diff`],[[`l`],`open the fold`],[[`h`],`fold another layer's lines back`],[[`S`],`scope above the diff`],[[`I`],`layer notes over the code`],[[`O`],`other layers' lines in place`],[[`e`],`open the line in your editor`]]},{title:`Branch`,rows:[[[`b`],`base to compare against`],[[`p`],`pull request`],[[`/`],`search this branch`],[[`?`],`keys`],[[`Esc`],`back`]]}],Cc=({keys:e,label:n,isScoped:r})=>(0,q.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,q.jsx)(`dt`,{className:`flex w-16 shrink-0 justify-end`,children:(0,q.jsx)(t,{children:e.map(e=>(0,q.jsx)(V,{children:e},e))})}),(0,q.jsxs)(`dd`,{className:`m-0 min-w-0 text-muted-foreground`,children:[n,e[0]===`S`?(0,q.jsx)(`span`,{className:`ms-1.5 text-xs text-subtle`,children:r?`on`:`off`}):null]})]}),wc=()=>{let{isScoped:e}=Qe();return(0,q.jsx)(`div`,{className:`grid gap-x-8 gap-y-4 px-4 py-3 sm:grid-cols-2`,children:Sc.map(t=>(0,q.jsxs)(`section`,{children:[(0,q.jsx)(`h3`,{className:`m-0 mb-1 ps-19 text-xs font-medium text-subtle`,children:t.title}),(0,q.jsx)(`dl`,{className:`m-0`,children:t.rows.map(([t,n])=>(0,q.jsx)(Cc,{isScoped:e,keys:t,label:n},t.join(` `)))})]},t.title))})},Tc=()=>{let{editor:e}=Qe();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`me-1`,children:`Open lines in`}),sn.map(t=>(0,q.jsx)(st,{"aria-pressed":e===t,"data-editor-choice":t,onClick:()=>{Ht({editor:t})},size:`xs`,variant:`ghost`,children:lc[t]},t))]})},Ec=()=>{let e=We();return(0,q.jsxs)(`span`,{className:`inline-flex items-center`,children:[(0,q.jsx)(`span`,{className:`me-2`,children:`Theme`}),(0,q.jsxs)(`fieldset`,{className:`relative m-0 grid grid-cols-3 rounded-md border-0 bg-muted p-0.5`,children:[(0,q.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-y-0.5 inset-s-0.5 segment-pill rounded-sm bg-secondary`,ref:t=>{t?.style.setProperty(`--at`,String(Pt.indexOf(e)))}}),Pt.map(t=>(0,q.jsx)(`button`,{"aria-pressed":e===t,className:`relative h-5 press px-2 text-xs text-muted-foreground hover:text-foreground aria-pressed:text-foreground`,"data-theme-choice":t,onClick:()=>{vt(t)},type:`button`,children:Yt[t]},t))]})]})},Dc=e=>`'${e.replaceAll(`'`,`'\\''`)}'`,Oc=e=>[`1. Run \`adiff comment take --worktree ${Dc(e)}\` once. It hands you every comment still owed an answer.`,`2. Run \`adiff comment take --worktree ${Dc(e)} --wait 6900\` in the background (in Claude Code: Bash with run_in_background and timeout 7200000). It returns when there is a comment you have not been handed. Never poll it on a timer, and keep only one running.`,`3. For each comment you are handed, do what it asks in ${e}, then answer it by id with \`adiff comment answer --worktree ${e} --id <id> --body "…"\`, saying what you changed. If the comment is unclear or asks for something you cannot do there, answer with your question instead.`,`4. When the background wait returns, start it again before you handle what it returned, and go back to step 3. An empty answer means only that the wait ran out: start it again and say nothing.`],kc=(e,t)=>[`I am reviewing ${t} in the adiff review page, and my comments reach you through adiff. The branch is checked out in ${e}.`,`Use the adiff skill if you have one. Listen to the review in a loop:`,...Oc(e),`Keep listening until I say the review is done. Do not push or open pull requests unless I ask.`].join(`
|
|
2
2
|
`),Ac=(e,t)=>[`I stopped your headless run and took this session over in my terminal. Carry on answering the review of ${t} in ${e}, as before:`,...Oc(e),`Keep listening until I say the review is done. Do not push or open pull requests unless I ask.`].join(`
|
|
3
3
|
`),jc=({resume:e,interactive:t,worktree:n,branch:r})=>e===null?Mc(t,n,r):`cd ${Dc(n)} && ${e} ${Dc(Ac(n,r))}`,Mc=(e,t,n)=>`cd ${Dc(t)} && ${e} ${Dc(kc(t,n))}`,Nc=K.createContext(void 0);function Pc(e){let t=K.useContext(Nc);if(t===void 0&&!e)throw Error(Wt(33));return t}var Fc=K.createContext(void 0);function Ic(e){let t=K.useContext(Fc);if(t===void 0&&!e)throw Error(Wt(36));return t}var Lc=K.createContext(void 0);function Rc(e=!0){let t=K.useContext(Lc);if(t===void 0&&!e)throw Error(Wt(25));return t}function zc({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=K.useRef(e!==void 0),[a,o]=K.useState(t);return[i&&e!==void 0?e:a,K.useCallback(e=>{i||o(e)},[])]}function Bc(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=Rc(!0),f=d!==void 0;return K.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:ut})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!qt&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&c.type===`regular-item`&&ln(s.current,e,{detail:1})}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Vc={type:`regular-item`};function Hc(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=K.useRef(null),{getButtonProps:d,buttonRef:f}=Ot({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Bc({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=K.useCallback(e=>Mt(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=et(u,f);return K.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Uc=K.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Wc(){return K.useContext(Uc)}function Gc(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Wc(),u=K.useRef(-1),[d,f]=K.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=K.useRef(null),h=K.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return W(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Kc=K.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Gc({guess:!0,label:a}),f=Pc(!0),p=Re(i),{store:m}=Ic(),h=m.useState(`disabled`),g=s||h,_=m.useState(`isActive`,d.index),v=m.useState(`itemProps`),{getItemProps:y,itemRef:b}=Hc({closeOnClick:c,disabled:g,highlighted:_,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Vc});return Zt(`div`,e,{state:{disabled:g,highlighted:_},props:[v,u,y],ref:[b,t,d.ref]})}),qc=K.createContext(void 0);function Jc(e){let t=K.useContext(qc);if(t===void 0&&!e)throw Error(Wt(69));return t}var Yc=K.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=Ic(),{side:c,align:l}=Pc(),u=Jc(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`hoverEnabled`),w=s.useState(`disabled`),T=s.useState(`openMethod`),E=_.type===`context-menu`;mn({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),K.useEffect(()=>{function e(e){s.setOpen(!1,zt(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]),ct(b,{enabled:C&&!w&&!E&&_.type!==`menubar`,closeDelay:S});let D=s.useStateSetter(`popupElement`),O={transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},k=Zt(`div`,e,{state:O,ref:[t,s.context.popupRef,D],stateAttributesMapping:gn,props:[p,{onKeyDown(e){u&&cs.has(e.key)&&e.stopPropagation()}},Kt(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||E;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,q.jsx)(Xi,{context:b,openInteractionType:T,modal:E,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:g,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),Xc=K.createContext(void 0);function Zc(){let e=K.useContext(Xc);if(e===void 0)throw Error(Wt(32));return e}var Qc=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Ic();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,q.jsx)(Xc.Provider,{value:n,children:(0,q.jsx)(Ct,{ref:t,...r,portalOwnerRole:o})})});function $c(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=U(i),[,o]=K.useState(!1),s=He(tl).current,c=He(el).current,l=K.useRef(0),u=K.useRef(!0),d=K.useRef(null),f=K.useRef(null),p=U(()=>{u.current||(u.current=!0,o(e=>!e))}),m=U((e,t)=>{c.set(e,t),p()}),h=U(e=>{c.delete(e),p()}),g=U(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!il(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&al(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=rl(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=U(()=>{let[e,t]=nl(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});W(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),W(()=>{u.current&&v()}),W(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=U(e=>(s.add(e),()=>{s.delete(e)})),b=K.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,q.jsx)(Uc.Provider,{value:b,children:t})}function el(){return new Map}function tl(){return new Set}function nl(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>al(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function rl(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function il(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function al(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var ol=20;function sl(e,t,n,r){let[i,a]=K.useState(!1);W(()=>{if(!e||!t||n==null){a(!1);return}let r=it(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-ol)},[e,t,n]),Ts(e&&(!t||i),r)}var cl=K.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=de,style:g,..._}=e,{store:v}=Ic(),y=Zc(),b=Rc(!0),x=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),ee=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),F=v.useState(`adaptiveOrigin`),te=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),ne=v.useState(`floatingParentNodeId`),L=w.useState(`domReferenceElement`),re=K.useRef(null),ie=En(M),ae=n,oe=c,se=l,R=s,z=h;x.type===`context-menu`&&(ae=n??x.context?.anchor,R??=`start`,!o&&R!==`center`&&(se=e.alignOffset??2,oe=e.sideOffset??-5));let ce=o,le=R;x.type===`menu`?(ce??=`inline-end`,le??=`start`,z=e.collisionAvoidance??S):x.type===`menubar`&&(ce??=x.context.orientation===`vertical`?`inline-end`:`bottom`,le??=`start`);let ue=x.type===`context-menu`,B=j({anchor:ae,floatingRootContext:w,positionMethod:b?`fixed`:r,mounted:E,side:ce,sideOffset:oe,align:le,alignOffset:se,arrowPadding:ue?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:z,shift:ue?{crossAxis:!(`side`in z&&z.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:F});K.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,zt(mt)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),K.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,zt(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let V=Ie();K.useEffect(()=>{D||V.clear()},[D,V]),K.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?V.isStarted()||V.start(e,()=>{v.setOpen(!1,zt(mt))}):v.setOpen(!1,zt(mt))}else V.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,V]),K.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:ne,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,ne]),W(()=>{let e=L,t=re.current;if(e&&(re.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ie(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,ie,v]);let fe={open:D,side:B.side,align:B.align,anchorHidden:B.anchorHidden,nested:x.type===`menu`,instant:N},pe=x.type===`menubar`&&x.context.modal;sl(D&&(pe||O&&te!==`trigger-hover`),k===`touch`,M,A);let H=P(e,fe,{styles:B.positionerStyles,transitionStatus:ee,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),me=E&&x.type!==`menu`&&(x.type!==`menubar`&&O&&te!==`trigger-hover`||x.type===`menubar`&&x.context.modal),he=null;return x.type===`menubar`?he=x.context.contentElement:x.type===void 0&&(he=A),(0,q.jsxs)(Nc.Provider,{value:B,children:[me&&(0,q.jsx)(ps,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:C(!D),cutout:he}),(0,q.jsx)(Se,{id:I,children:(0,q.jsx)($c,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:H})})]})}),ll=K.createContext(null);function ul(e){let t=K.useContext(ll);if(t===null&&!e)throw Error(Wt(5));return t}var dl={...xt,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},fl=class extends ve{constructor(e,t,n=!1){let r=new qe,i=ml(r,t,n,e);super(i,pl(r),dl),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef}else e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}unsubscribeParentListener=null};function pl(e){return{positionerRef:K.createRef(),popupRef:K.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:K.createRef(),beforeContentFocusGuardRef:K.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function ml(e,t,n=!1,r){return{...Qt(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new o,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Bt,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var hl=K.createContext(void 0);function gl(){return K.useContext(hl)}var _l=Ne(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:_=!0}=e,v=Rc(!0),b=Ic(!0),x=ul(!0),S=gl(),C=K.useMemo(()=>S&&b?{type:`menu`,store:b.store}:x?{type:`menubar`,context:x}:v&&!b?{type:`context-menu`,context:v}:{type:void 0},[v,b,x,S]),w=ee(),T=ee(),E=ce(),D=C.type===`menu`?C.store:void 0,O=(n??a)&&D?.state.transitionStatus===`starting`,k=He(()=>O?D?.state.instantType:void 0).current,A=vl({open:a,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:C,disabled:o,highlightItemOnHover:_,modal:C.type===void 0?s:void 0,rootId:w,instantType:k},T,E!=null);A.useControlledProp(`openProp`,n),A.useControlledProp(`triggerIdProp`,m),A.useContextCallback(`onOpenChangeComplete`,i);let j=A.useState(`floatingTreeRoot`),M=g(j),N=A.useState(`open`),P=A.useState(`activeTriggerElement`),F=A.useState(`positionerElement`),te=A.useState(`hoverEnabled`),I=A.useState(`disabled`),ne=A.useState(`lastOpenChangeReason`),L=A.useState(`parent`),re=A.useState(`activeIndex`),ie=A.useState(`payload`),ae=A.useState(`floatingParentNodeId`),oe=K.useRef(null),se=K.useRef(L.type!==`context-menu`),R=Ie(),z=K.useRef(!0),le=Ie(),ue=ae!=null,{openMethod:de,triggerProps:B}=Ls(N);A.useSyncedValues({disabled:o,highlightItemOnHover:_,modal:L.type===void 0?s:void 0,openMethod:de,rootId:w}),ft(A);let{forceUnmount:V,transitionStatus:fe}=Gt(N,A,()=>{A.set(`allowMouseEnter`,!1)},O),pe=En(A.context.popupRef);K.useEffect(()=>{if(k===void 0)return;let e=()=>{A.state.instantType===k&&A.set(`instantType`,void 0)};if(!N){e();return}if(fe!==void 0)return;if(A.context.popupRef.current==null){e();return}let t=new AbortController;return pe(e,t.signal),()=>{t.abort()}},[k,N,fe,pe,A]),W(()=>{v&&!b?A.update({parent:{type:`context-menu`,context:v},floatingNodeId:M,floatingParentNodeId:E}):b&&A.update({floatingNodeId:M,floatingParentNodeId:E})},[v,b,M,E,A]),K.useEffect(()=>{N||(oe.current=null),L.type===`context-menu`&&(N?R.start(500,()=>{se.current=!0}):(R.clear(),se.current=!1))},[R,N,L.type]),W(()=>{!N&&!te&&A.set(`hoverEnabled`,!0)},[N,te,A]);let H=U((e,t)=>{let n=t.reason;if(!e&&!A.select(`open`)||N===e&&t.trigger===P&&ne===n)return;let i=kt(t);if(!e&&t.trigger==null&&(t.trigger=P??void 0),r?.(e,t),t.isCanceled)return;A.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!z.current)return;e&&n===`trigger-focus`?(z.current=!1,le.start(300,()=>{z.current=!0})):(z.current=!0,le.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0,s=!e&&(n===`escape-key`||n==null);oe.current=t.event;let c=at(A.state,e,t.trigger,i());c.openChangeReason=n,c.instantType=L.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:o||s?o?`click`:`dismiss`:void 0,A.update(c)}),me=Sn({popupStore:A,floatingRootContext:A.state.floatingRootContext,floatingId:T,nested:E!=null,onOpenChange:H}),he=me.context.events;W(()=>{let e=({open:e,eventDetails:t})=>H(e,t);return he.on(`setOpen`,e),()=>{he?.off(`setOpen`,e)}},[he,H]);let ge=K.useCallback(()=>{A.setOpen(!1,zt(rt))},[A]);K.useImperativeHandle(u,()=>({unmount:V,close:ge}),[V,ge]);let _e;L.type===`context-menu`&&(_e=L.context),K.useImperativeHandle(_e?.positionerRef,()=>F,[F]),K.useImperativeHandle(_e?.actionsRef,()=>({setOpen:H}),[H]);let ve=p(me,{enabled:!I,bubbles:{escapeKey:d&&L.type===`menu`},outsidePress(){return L.type!==`context-menu`||oe.current?.type===`contextmenu`||se.current},externalTree:ue?j:void 0}),ye=Fe(),be=K.useCallback(e=>{A.select(`activeIndex`)!==e&&A.set(`activeIndex`,e)},[A]),xe=ha(me,{enabled:!I,listRef:A.context.itemDomElements,activeIndex:re,nested:L.type!==void 0,loopFocus:c,orientation:l,parentOrientation:L.type===`menubar`?L.context.orientation:void 0,rtl:ye===`rtl`,disabledIndices:Ke,onNavigate:be,openOnArrowKeyDown:L.type!==`context-menu`,externalTree:ue?j:void 0,focusItemOnHover:_}),Se=K.useCallback(e=>{A.context.typingRef.current=e},[A]),Ce=ga(me,{enabled:!I,listRef:A.context.itemLabels,elementsRef:A.context.itemDomElements,activeIndex:re,resetMs:500,onMatch:e=>{N&&e!==re&&A.set(`activeIndex`,e)},onTyping:Se}),we=K.useMemo(()=>{let e=Mt(Ce.reference,xe.reference,ve.reference,{onMouseMove(){A.set(`allowMouseEnter`,!0)}},B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=N,e},[A,Ce.reference,xe.reference,ve.reference,B,N]),Te=K.useMemo(()=>{let e=Mt(xe.trigger,ve.trigger,B);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[xe.trigger,ve.trigger,B]);He(()=>(A.update({inactiveTriggerProps:Te}),null));let Ee=K.useMemo(()=>Mt(Vt,{id:T,role:`menu`,"aria-orientation":l===`horizontal`?`horizontal`:void 0,"aria-labelledby":P?.id,onMouseMove(){A.set(`allowMouseEnter`,!0),L.type===`menu`&&A.set(`hoverEnabled`,!1)},onClick(){A.select(`hoverEnabled`)&&A.set(`hoverEnabled`,!1)},onKeyDown(e){let t=A.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ce.floating,xe.floating,ve.floating),[P,T,l,L.type,A,Ce.floating,xe.floating,ve.floating]),De=xe.item??Bt;Nt(A,{floatingRootContext:me,activeTriggerProps:we,inactiveTriggerProps:Te,popupProps:Ee,itemProps:De});let Oe=K.useMemo(()=>({store:A,parent:C}),[A,C]),ke=(0,q.jsxs)(Fc.Provider,{value:Oe,children:[f&&(0,q.jsx)(nn,{handle:f,store:A}),typeof t==`function`?t({payload:ie}):t]});return L.type===void 0||L.type===`context-menu`?(0,q.jsx)(y,{externalTree:j,children:ke}):ke});function vl(e,t,n){return He(()=>new fl(e,t,n)).current}var yl=5;function bl(e,t){let n=xl(t);return e.clientX>=n.left-yl&&e.clientX<=n.right+yl&&e.clientY>=n.top-yl&&e.clientY<=n.bottom+yl}function xl(e){let t=e.getBoundingClientRect(),n=Xe(e);if(Ae)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Sl(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=dt(),{ref:i,index:a}=Gc(e),o=n===a,s=K.useRef(null),c=et(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Cl(e){let{render:t,className:n,style:r,state:i=Bt,props:a=Ke,refs:o=Ke,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Sl({metadata:s});return Zt(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function wl(e){if(_e(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!f(e))return wl(Tn(e))}var Tl=An(Tt(),1);function El(e,t){let n=K.useRef(null);function r(t){Tl.flushSync(()=>{e.setOpen(!1,zt(cn,t.nativeEvent,t.currentTarget))}),je(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&T(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{Tl.flushSync(()=>{e.setOpen(!1,zt(cn,n.nativeEvent,n.currentTarget))});let i=Te(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&H(r,i);){let e=i;if(i=Oe(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Dl(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=K.useRef(!1);return K.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,it(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Bt,[t,n,r])}var Ol=ze(function(t,n){let{render:r,className:i,style:a,disabled:s=!1,nativeButton:c=!0,id:l,openOnHover:u,delay:d=100,closeDelay:f=0,handle:p,payload:m,...h}=t,_=Ic(!0),v=Lt(p)??_?.store;if(!v)throw Error(Wt(85));let y=Re(l),b=v.useState(`isTriggerActive`,y),x=v.useState(`floatingRootContext`),S=v.useState(`isOpenedByTrigger`,y),C=v.useState(`triggerPopupId`,y),w=K.useRef(null),T=Al(),E=dt(!0),D=Et(),O=K.useMemo(()=>D??new o,[D]),k=g(O),A=ce(),{registerTrigger:ee,isMountedByThisTrigger:j}=Ue(y,w,v,{payload:m,closeDelay:f,parent:T,floatingTreeRoot:O,floatingNodeId:k,floatingParentNodeId:A,keyboardEventRelay:E?.relayKeyboardEvent}),M=T.type===`menubar`,N=v.useState(`disabled`),P=s||N||M&&T.context.disabled,{getButtonProps:F,buttonRef:te}=Ot({disabled:P,native:c});K.useEffect(()=>{!S&&T.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,S,T.type]);let I=K.useRef(null),ne=Ie(),L=U(e=>{if(!I.current)return;ne.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;H(I.current,t)||H(v.select(`positionerElement`),t)||t===I.current||t!=null&&wl(t)===v.select(`rootId`)||bl(e,I.current)||O.events.emit(`close`,{domEvent:e,reason:en})});K.useEffect(()=>{S&&v.select(`lastOpenChangeReason`)===`trigger-hover`&&it(I.current).addEventListener(`mouseup`,L,{once:!0})},[S,L,v]);let re=M&&T.context.hasSubmenuOpen,ie=e(x,{enabled:(u??re)&&!P&&(!M||re&&!j),handleClose:B({blockPointerEvents:!M}),mouseOnly:!0,move:!1,restMs:T.type===void 0?d:void 0,delay:{close:f},triggerElementRef:w,externalTree:O,isActiveTrigger:b,isClosing:()=>v.select(`transitionStatus`)===`ending`}),ae=kl(S,v.select(`lastOpenChangeReason`)),oe=Zi(x,{enabled:!P,event:S&&M?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0&&ae}),se=on(x,{enabled:!P&&re}),R=Dl({open:S,enabled:M,mouseDownAction:`open`}),z=K.useMemo(()=>Mt(se.reference,oe.reference),[se.reference,oe.reference]),le=v.useState(`triggerProps`,j),{preFocusGuardRef:ue,handlePreFocusGuardFocus:de,handleFocusTargetFocus:V}=El(v,w),fe={disabled:P,open:S},pe=[I,n,te,ee,w],me=[z,ie??Bt,le,{"aria-haspopup":`menu`,"aria-controls":C,id:y,onMouseDown:e=>{v.select(`open`)||(ne.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),it(e.currentTarget).addEventListener(`mouseup`,L,{once:!0}))}},M?{role:`menuitem`}:{},R,h,F],he=Zt(`button`,t,{enabled:!M,stateAttributesMapping:be,state:fe,ref:pe,props:me});return M?(0,q.jsx)(Cl,{tag:`button`,render:r,className:i,style:a,state:fe,refs:pe,props:me,stateAttributesMapping:be}):S?(0,q.jsxs)(K.Fragment,{children:[(0,q.jsx)(ot,{ref:ue,onFocus:de},`${y}-pre-focus-guard`),(0,q.jsx)(K.Fragment,{children:he},y),(0,q.jsx)(ot,{ref:v.context.triggerFocusTargetRef,onFocus:V},`${y}-post-focus-guard`)]}):(0,q.jsx)(K.Fragment,{children:he},y)});function kl(e,t){let n=Ie(),[r,i]=K.useState(!1);return W(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Al(){let e=ul(!0);return K.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var jl=K.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Zt(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Ml({...e}){return(0,q.jsx)(_l,{"data-slot":`dropdown-menu`,...e})}function Nl({...e}){return(0,q.jsx)(Ol,{"data-slot":`dropdown-menu-trigger`,...e})}function Pl({className:e,align:t=`end`,sideOffset:n=6,...r}){return(0,q.jsx)(Qc,{children:(0,q.jsx)(cl,{align:t,className:`isolate z-50`,sideOffset:n,children:(0,q.jsx)(Yc,{className:G(`min-w-48 pop-menu rounded-lg border border-border bg-popover p-1 text-sm text-popover-foreground shadow-md outline-none`,e),"data-slot":`dropdown-menu-content`,...r})})})}function Fl({className:e,...t}){return(0,q.jsx)(Kc,{className:G(`flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-150 ease-out outline-none select-none data-highlighted:bg-secondary data-highlighted:text-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-muted-foreground`,e),"data-slot":`dropdown-menu-item`,...t})}function Il({className:e,...t}){return(0,q.jsx)(jl,{className:G(`-mx-1 my-1 h-px bg-border`,e),"data-slot":`dropdown-menu-separator`,...t})}var Ll=()=>{let e=Ve();return async(t,n)=>{await navigator.clipboard.writeText(t),e.add({title:n})}},Rl=async({model:e,copy:t})=>{let{listener:n,branch:r}=e,i=n?.run??null,a=n?.worktree??null,o=n?.agents.find(e=>e.label===i?.agent)??null;a!==null&&i!==null&&o!==null&&(await t(jc({resume:i.resume,interactive:o.interactive,worktree:a,branch:r}),`Resume command copied · paste it in a terminal`),await e.handleStop())},zl=({model:e,copy:t})=>e.listener?.run?.state===`running`&&e.listener.worktree!==null?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Fl,{disabled:e.isBusy,onClick:()=>{Rl({model:e,copy:t})},children:[(0,q.jsx)(hi,{}),`Take over in your terminal`]}),(0,q.jsx)(Il,{})]}):null,Bl=e=>e.agents.find(t=>t.id===e.chosen)??null,Vl=({model:e,isHeard:t,onSettings:n})=>{let r=Ll(),{listener:i,isBusy:a,branch:o}=e;if(i===null)return null;let s=Bl(i),c=i.agents.filter(e=>e.isInstalled&&e.id!==s?.id),{worktree:l}=i;return(0,q.jsxs)(Ml,{children:[(0,q.jsx)(Nl,{render:(0,q.jsx)(st,{"aria-label":`Agent options`,size:`icon-xs`,variant:`ghost`,children:(0,q.jsx)(qn,{})})}),(0,q.jsxs)(Pl,{children:[(0,q.jsx)(zl,{copy:r,model:e}),t?null:c.map(t=>(0,q.jsxs)(Fl,{disabled:a||l===null,onClick:()=>void e.handleStart(t.id),children:[(0,q.jsx)(Yr,{}),`Start a headless ${t.label}`]},t.id)),t||c.length===0?null:(0,q.jsx)(Il,{}),(0,q.jsxs)(Fl,{disabled:l===null,onClick:()=>{l!==null&&r(kc(l,o),`Prompt copied: paste it to your agent`)},children:[(0,q.jsx)(lr,{}),`Copy a prompt for your agent`]}),s===null?null:(0,q.jsxs)(Fl,{disabled:l===null,onClick:()=>{l!==null&&r(Mc(s.interactive,l,o),`Command copied: paste it in a terminal to open ${s.label}`)},children:[(0,q.jsx)(hi,{}),`Copy a terminal command for ${s.label}`]}),(0,q.jsx)(Il,{}),(0,q.jsxs)(Fl,{onClick:n,children:[(0,q.jsx)(ai,{}),`Agent settings…`]})]})]})},Hl=e=>{let t=Ll(),n=e.listener,{listener:r}=n,i=r?.worktree??null;if(r===null||i===null)return[];let a=Bl(r),o=r.run?.state===`running`;return[{id:`start`,icon:li,label:`Start ${a?.label??`an agent`}`,note:`It reads your comments and answers them in the background`,isShown:!o&&!r.isListening&&a!==null,onPress:()=>{a!==null&&n.handleStart(a.id)}},{id:`take-over`,icon:hi,label:`Take over in your terminal`,note:`Copies a command that resumes its session, and stops it here`,isShown:o,onPress:()=>{Rl({model:n,copy:t})}},{id:`stop`,icon:_i,label:`Stop ${r.run?.agent??`the agent`}`,isShown:o,onPress:()=>{n.handleStop()}},{id:`terminal`,icon:hi,label:`Copy a terminal command`,note:`Opens ${a?.label??`the agent`} in this worktree, already listening`,isShown:!o&&a!==null,onPress:()=>{a!==null&&t(Mc(a.interactive,i,n.branch),`Command copied · paste it in a terminal`)}}]},Ul=`[data-review-diff]`,Wl=`[data-review-row]`,Gl=100,Kl=()=>{let e=document.querySelector(Ul);if(e===null)return null;let{top:t}=e.getBoundingClientRect(),n=[...e.querySelectorAll(Wl)].find(e=>e.getBoundingClientRect().bottom>t);return n===void 0?null:{diff:e,row:n,at:n.getBoundingClientRect().top}},ql=e=>{let t=Kl();$t(e),t!==null&&(t.diff.scrollTop+=t.row.getBoundingClientRect().top-t.at),Ht({codeSize:e})},Jl=()=>{let{codeSize:e}=Qe();return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`label`,{className:`flex min-h-14 items-center gap-3 px-3.5`,children:[(0,q.jsx)(`span`,{className:`sr-only`,children:`Code size`}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`w-4 text-center text-xs text-muted-foreground`,children:`A`}),(0,q.jsx)(`input`,{"aria-valuetext":`${String(e)} pixels`,className:`code-size-range min-w-0 flex-1`,max:Dt.max,min:Dt.min,ref:t=>{let n=(e-Dt.min)/(Dt.max-Dt.min);t?.style.setProperty(`--fill`,`${String(n*Gl)}%`)},onChange:e=>{ql(Number(e.currentTarget.value))},step:1,type:`range`,value:e}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`w-4 text-center text-lg text-muted-foreground`,children:`A`})]})})},Yl=({isOn:e})=>(0,q.jsx)(`span`,{"aria-hidden":!0,className:`relative h-7 w-16 shrink-0 rounded-full bg-foreground/16 transition-colors duration-200 data-on:bg-sign-add`,"data-on":e?``:void 0,children:(0,q.jsx)(`span`,{className:`absolute inset-s-0.5 top-0.5 h-6 w-9.5 switch-thumb rounded-full bg-white shadow-sm`})}),Xl=({action:e})=>{let t=e.icon,n=e.isOn!==void 0;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{"aria-checked":n?e.isOn:void 0,className:`flex min-h-13 w-full items-center gap-3 px-3.5 py-1.5 text-start text-base/5 text-foreground transition-colors duration-150 active:bg-foreground/8`,onClick:()=>{e.onPress()},role:n?`switch`:void 0,type:`button`,children:[(0,q.jsx)(`span`,{className:`grid size-7.5 shrink-0 place-items-center rounded-lg bg-foreground/9`,children:(0,q.jsx)(t,{className:`size-4.5`})}),(0,q.jsxs)(`span`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,q.jsx)(`span`,{children:e.label}),e.note===void 0?null:(0,q.jsx)(`span`,{className:`text-ui text-muted-foreground`,children:e.note})]}),e.value===void 0?null:(0,q.jsx)(`span`,{className:`max-w-32 truncate font-mono text-ui text-muted-foreground`,children:e.value}),n?(0,q.jsx)(Yl,{isOn:e.isOn===!0}):(0,q.jsx)(Zn,{"aria-hidden":!0,className:`size-4 shrink-0 text-subtle`})]})})},Zl=({title:e,actions:t,extra:n=null})=>{let r=t.filter(e=>e.isShown!==!1);return r.length===0?null:(0,q.jsxs)(`section`,{children:[(0,q.jsx)(`h3`,{className:`m-0 px-4 pt-3.5 pb-1.5 text-ui font-normal text-muted-foreground`,children:e}),(0,q.jsxs)(`ul`,{className:`m-0 list-none more-group p-0`,children:[r.map(e=>(0,q.jsx)(Xl,{action:e},e.id)),n]})]})},Ql=(e,{present:t,isShown:n})=>{let r=new Set(t);return e.map((e,t)=>{let i=e.files.filter(e=>r.has(e));return{kind:`layer`,key:Wo(t),index:t,address:e.address,ticket:e.ticket,title:e.title,all:i,files:i.filter(e=>n(t,e))}})},$l=(e,t)=>{let n=[];return e.forEach(e=>{let{ticket:r}=e,i=n.find(e=>e.kind===`ticket`&&e.number===r),a=t.find(e=>e.number===r);r===null||a===void 0?n.push(e):i?.kind===`ticket`?i.groups.push(e):n.push({kind:`ticket`,key:Go(r),number:r,title:a.title,groups:[e]})}),n},eu=e=>e.kind===`ticket`?e.groups:[e],tu=(e,{depth:t,isOpen:n})=>[{kind:`dir`,key:e.key,label:e.title,full:e.key,depth:t},...n(e)?e.files.map(n=>({kind:`file`,key:Ko(e.index,n),path:n,label:ko(n),depth:t+1})):[]],nu=(e,t)=>e.flatMap(e=>e.kind===`layer`?tu(e,{depth:0,isOpen:t}):[{kind:`dir`,key:e.key,label:e.title,full:e.key,depth:0},...t(e)?e.groups.flatMap(e=>tu(e,{depth:1,isOpen:t})):[]]),ru=e=>e.flatMap(e=>eu(e).flatMap(e=>e.files.map(t=>Ko(e.index,t)))),iu=(e,{isDone:t,isOpen:n,isReadOpen:r})=>{let i=e.filter(e=>t(e)),a=e.filter(e=>!t(e));if(i.length===0)return{rows:nu(e,n),order:ru(e),done:i,rest:a};let o={kind:`dir`,key:Qo,label:`${String(i.length)} ${i.length===1?`layer`:`layers`} read`,full:Qo,depth:0},s=r?[...i,...a]:a;return{rows:[o,...nu(s,n)],order:ru(s),done:i,rest:a}},au={gone:``,settled:`✓`,filed:`○`,waiting:`◎`,answered:`●`,asked:`◉`},ou={gone:`Removed`,settled:`Settled`,filed:`Not picked up`,waiting:`Picked up, no answer`,answered:`Answered, not settled`,asked:`Waiting on you`},su={gone:`removed`,settled:`settled`,filed:`not picked up`,waiting:`picked up`,answered:`answered`,asked:`waiting on you`},cu={open:0,stand:`gone`},lu=(e,t)=>e.find(e=>e.path===t)??cu,uu=(e,t)=>e?.parts.find(e=>e.path===t)??cu,du=({open:e,stand:t,settled:n=0})=>e===0&&t===`settled`?`${String(n)} settled`:`${String(e)} ${e===1?`comment`:`comments`} · ${e===1?``:`the loudest `}${su[t]}`,fu=(e,t,n)=>e.findIndex(e=>(t===`new`?e.new:e.old)===n),pu=(e,{threads:t,layer:n})=>n===null||t.some(t=>t.file===e.path&&t.side===e.side&&t.end===e.line&&!t.isMovedPast&&t.layers.includes(n+1)),mu=({lineMarks:e,threads:t,drafts:n,path:r,rows:i,layer:a})=>{let o=new Map;return e.filter(e=>e.path===r&&pu(e,{threads:t,layer:a})).forEach(e=>{let t=fu(i,e.side,e.line);t!==-1&&o.set(t,{stand:e.stand,settled:e.settled})}),n.filter(e=>e.file===r).forEach(e=>{let t=fu(i,`new`,e.end),n=o.get(t);t!==-1&&o.set(t,{stand:n===void 0||n.stand===`settled`?`filed`:n.stand,settled:n?.settled??0})}),o},hu=/(?<=\.)\s+(?=[A-Z`?@(])/u,gu=/^[-•·*]\s+/u,_u=/\*\*(?<words>[^*]+)\*\*/gu,vu=/^Read\b/u,yu=e=>e.replaceAll(_u,`$<words>`),bu=e=>(e.includes(`
|
|
4
4
|
`)?e.split(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __toESM } from "../_runtime.mjs";
|
|
2
2
|
import { createCoalesced, nameThreadLayers } from "./review.server-BVLvmBWu.mjs";
|
|
3
|
-
import { Button$1, CODE_SIZES, EDITORS, Hint, IconButton, Kbd, KbdGroup, KeyTip, Route$2, THEMES, THEME_NAMES, Tooltip$1, TooltipContent, TooltipTrigger, cn, createSsrRpc, getReviewPrefs, setIntroFolded, setReviewPrefs, setTheme, showCodeSize, toggleNoted, toggleOthersShown, toggleScoped, uncover, useReviewPrefs, useTheme, useToast, useWindowEvent } from "./router
|
|
3
|
+
import { Button$1, CODE_SIZES, EDITORS, Hint, IconButton, Kbd, KbdGroup, KeyTip, Route$2, THEMES, THEME_NAMES, Tooltip$1, TooltipContent, TooltipTrigger, cn, createSsrRpc, getReviewPrefs, setIntroFolded, setReviewPrefs, setTheme, showCodeSize, toggleNoted, toggleOthersShown, toggleScoped, uncover, useReviewPrefs, useTheme, useToast, useWindowEvent } from "./router--oWwEEA0.mjs";
|
|
4
4
|
import { createServerFn } from "./ssr.mjs";
|
|
5
5
|
import { reviewActSchema, reviewBaseSchema, reviewCommentSchema, reviewDraftSchema, reviewExtrasSchema, reviewFileSchema, reviewMarkSchema, reviewOutlineSchema, reviewPartsSchema, reviewRemarkSchema, reviewReplySchema, reviewSearchSchema, reviewSettleSchema, reviewSinceSchema, reviewTargetOnlySchema } from "./review-schema-C0qXng9-.mjs";
|
|
6
6
|
import { threadCodeSchema, toAsk } from "./thread-code-CYNB3wg5.mjs";
|
|
@@ -13,7 +13,7 @@ import { ArrowDownToLine, ArrowRight, ArrowUp, ArrowUpToLine, Check, CheckCheck,
|
|
|
13
13
|
import { cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
14
14
|
import { Markdown as Markdown$1 } from "../_libs/react-markdown+[...].mjs";
|
|
15
15
|
import { remarkGfm } from "../_libs/remark-gfm.mjs";
|
|
16
|
-
// node_modules/.nitro/vite/services/ssr/assets/review-
|
|
16
|
+
// node_modules/.nitro/vite/services/ssr/assets/review-CrJpbEai.js
|
|
17
17
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
18
18
|
var import_jsx_runtime = require_jsx_runtime();
|
|
19
19
|
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom());
|
|
@@ -13,7 +13,7 @@ import { cva } from "../_libs/class-variance-authority+clsx.mjs";
|
|
|
13
13
|
import { createCn } from "../_libs/cn.mjs";
|
|
14
14
|
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
15
15
|
import path from "node:path";
|
|
16
|
-
// node_modules/.nitro/vite/services/ssr/assets/router
|
|
16
|
+
// node_modules/.nitro/vite/services/ssr/assets/router--oWwEEA0.js
|
|
17
17
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
18
18
|
var import_jsx_runtime = require_jsx_runtime();
|
|
19
19
|
var __defProp = Object.defineProperty;
|
|
@@ -246,7 +246,7 @@ var useWindowEvent = (name, handler) => {
|
|
|
246
246
|
};
|
|
247
247
|
}, [name]);
|
|
248
248
|
};
|
|
249
|
-
var BUILD_ID = "2026-11-
|
|
249
|
+
var BUILD_ID = "2026-11-30T12:00:50.584Z";
|
|
250
250
|
var POLL_MS = 1e4;
|
|
251
251
|
var buildSchema = object({ id: string() });
|
|
252
252
|
var fetchBuildId = async () => {
|
|
@@ -263,7 +263,7 @@ var useNewBuild = () => {
|
|
|
263
263
|
const [isStale, setIsStale] = (0, import_react.useState)(false);
|
|
264
264
|
const check = async () => {
|
|
265
265
|
const id = await fetchBuildId();
|
|
266
|
-
if (id !== null && id !== "2026-11-
|
|
266
|
+
if (id !== null && id !== "2026-11-30T12:00:50.584Z") setIsStale(true);
|
|
267
267
|
};
|
|
268
268
|
useInterval(() => {
|
|
269
269
|
check();
|
|
@@ -557,7 +557,7 @@ var Route$4 = createFileRoute("/")({
|
|
|
557
557
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
558
558
|
});
|
|
559
559
|
var Route$3 = createFileRoute("/build-id")({ server: { handlers: { GET: () => Response.json({ id: BUILD_ID }, { headers: { "cache-control": "no-store" } }) } } });
|
|
560
|
-
var $$splitComponentImporter = () => import("./review-
|
|
560
|
+
var $$splitComponentImporter = () => import("./review-CrJpbEai.mjs");
|
|
561
561
|
var Route$2 = createFileRoute("/review/")({
|
|
562
562
|
validateSearch: reviewLinkSchema,
|
|
563
563
|
loaderDeps: ({ search }) => search,
|
|
@@ -4245,7 +4245,7 @@ var RawStream = class {
|
|
|
4245
4245
|
* the dev styles URL for route-scoped CSS collection.
|
|
4246
4246
|
*/
|
|
4247
4247
|
async function getStartManifest(matchedRoutes) {
|
|
4248
|
-
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-
|
|
4248
|
+
const { tsrStartManifest } = await import("../_tanstack-start-manifest_v-Bp3WfTRd.mjs");
|
|
4249
4249
|
const startManifest = tsrStartManifest();
|
|
4250
4250
|
let routes = startManifest.routes;
|
|
4251
4251
|
routes[rootRouteId];
|
|
@@ -7008,7 +7008,7 @@ var getBaseManifest = getProdBaseManifest;
|
|
|
7008
7008
|
var createEarlyHintsForRequest = createEarlyHintsCollector;
|
|
7009
7009
|
async function loadEntries() {
|
|
7010
7010
|
const [routerEntry, startEntry, pluginAdapters] = await Promise.all([
|
|
7011
|
-
import("./router
|
|
7011
|
+
import("./router--oWwEEA0.mjs").then((n) => n.router_exports),
|
|
7012
7012
|
import("./start-C00iYDdG.mjs"),
|
|
7013
7013
|
import("./empty-plugin-adapters-B3CY_z0V.mjs")
|
|
7014
7014
|
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-
|
|
1
|
+
// node_modules/.nitro/vite/services/ssr/assets/_tanstack-start-manifest_v-Bp3WfTRd.js
|
|
2
2
|
var tsrStartManifest = () => ({ routes: {
|
|
3
3
|
__root__: {
|
|
4
4
|
filePath: "/home/runner/work/agent-diff/agent-diff/web/src/routes/__root.tsx",
|
|
@@ -9,11 +9,11 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
9
9
|
"/review/image",
|
|
10
10
|
"/review/"
|
|
11
11
|
],
|
|
12
|
-
preloads: ["/assets/index-
|
|
12
|
+
preloads: ["/assets/index-RB6aBuh0.js", "/assets/jsx-runtime-EIAPxkjE.js"],
|
|
13
13
|
scripts: [{ attrs: {
|
|
14
14
|
type: "module",
|
|
15
15
|
async: !0,
|
|
16
|
-
src: "/assets/index-
|
|
16
|
+
src: "/assets/index-RB6aBuh0.js"
|
|
17
17
|
} }]
|
|
18
18
|
},
|
|
19
19
|
"/": {
|
|
@@ -24,7 +24,7 @@ var tsrStartManifest = () => ({ routes: {
|
|
|
24
24
|
"/review/": {
|
|
25
25
|
filePath: "/home/runner/work/agent-diff/agent-diff/web/src/routes/review/index.tsx",
|
|
26
26
|
children: void 0,
|
|
27
|
-
preloads: ["/assets/review-
|
|
27
|
+
preloads: ["/assets/review-DV4b3ziW.js"]
|
|
28
28
|
}
|
|
29
29
|
} });
|
|
30
30
|
export { tsrStartManifest };
|
|
@@ -10,37 +10,37 @@ var public_assets_data_default = {
|
|
|
10
10
|
"/assets/index-Bh4VvgUA.css": {
|
|
11
11
|
"type": "text/css; charset=utf-8",
|
|
12
12
|
"etag": "\"18541-x3JQFOC8axn0E1WeX2UtFWqhWgE\"",
|
|
13
|
-
"mtime": "2026-11-
|
|
13
|
+
"mtime": "2026-11-30T12:00:52.084Z",
|
|
14
14
|
"size": 99649,
|
|
15
15
|
"path": "../public/assets/index-Bh4VvgUA.css"
|
|
16
16
|
},
|
|
17
17
|
"/assets/jsx-runtime-EIAPxkjE.js": {
|
|
18
18
|
"type": "text/javascript; charset=utf-8",
|
|
19
19
|
"etag": "\"44a-PaYN9rm3A7etz/YdFwt3BfC0xDc\"",
|
|
20
|
-
"mtime": "2026-11-
|
|
20
|
+
"mtime": "2026-11-30T12:00:52.084Z",
|
|
21
21
|
"size": 1098,
|
|
22
22
|
"path": "../public/assets/jsx-runtime-EIAPxkjE.js"
|
|
23
23
|
},
|
|
24
|
-
"/assets/review-n355efiY.js": {
|
|
25
|
-
"type": "text/javascript; charset=utf-8",
|
|
26
|
-
"etag": "\"7915a-L2BkK2ubTkRH86RMsijz7hIu4Xc\"",
|
|
27
|
-
"mtime": "2026-11-30T11:17:00.561Z",
|
|
28
|
-
"size": 495962,
|
|
29
|
-
"path": "../public/assets/review-n355efiY.js"
|
|
30
|
-
},
|
|
31
24
|
"/assets/routes-CS6_XKJl.js": {
|
|
32
25
|
"type": "text/javascript; charset=utf-8",
|
|
33
26
|
"etag": "\"1b6-B7LMEB8Y7RLYHENLYU6D1W2d4/Q\"",
|
|
34
|
-
"mtime": "2026-11-
|
|
27
|
+
"mtime": "2026-11-30T12:00:52.084Z",
|
|
35
28
|
"size": 438,
|
|
36
29
|
"path": "../public/assets/routes-CS6_XKJl.js"
|
|
37
30
|
},
|
|
38
|
-
"/assets/
|
|
31
|
+
"/assets/review-DV4b3ziW.js": {
|
|
32
|
+
"type": "text/javascript; charset=utf-8",
|
|
33
|
+
"etag": "\"7915a-uE1hpfZtieSm4K0mea/NRN0kva0\"",
|
|
34
|
+
"mtime": "2026-11-30T12:00:52.084Z",
|
|
35
|
+
"size": 495962,
|
|
36
|
+
"path": "../public/assets/review-DV4b3ziW.js"
|
|
37
|
+
},
|
|
38
|
+
"/assets/index-RB6aBuh0.js": {
|
|
39
39
|
"type": "text/javascript; charset=utf-8",
|
|
40
|
-
"etag": "\"85e86-
|
|
41
|
-
"mtime": "2026-11-
|
|
40
|
+
"etag": "\"85e86-fWEpSrM3YvdWC5un3SshEPY+J8k\"",
|
|
41
|
+
"mtime": "2026-11-30T12:00:52.082Z",
|
|
42
42
|
"size": 548486,
|
|
43
|
-
"path": "../public/assets/index-
|
|
43
|
+
"path": "../public/assets/index-RB6aBuh0.js"
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
// #nitro/virtual/public-assets-node
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bin": {
|
|
26
26
|
"adiff": "./bin/adiff.js"
|
|
27
27
|
},
|
|
28
|
-
"version": "0.1.0-alpha.
|
|
28
|
+
"version": "0.1.0-alpha.220",
|
|
29
29
|
"description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"repository": {
|
package/skills/adiff/SKILL.md
CHANGED
|
@@ -376,7 +376,10 @@ Rules that make a layers worth reading:
|
|
|
376
376
|
Data model, then the code that uses it, then the surface, then the mechanical bits last.
|
|
377
377
|
- **A title is a claim, not a file name.** "Add the invitation API", never "changes to
|
|
378
378
|
src/api/invites.ts".
|
|
379
|
-
- **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports.
|
|
379
|
+
- **Line numbers are the new side of the diff**, the same numbers `adiff comment take` reports. A
|
|
380
|
+
span over new lines 255 to 265 also holds the lines removed between them. To claim removed lines
|
|
381
|
+
by their old numbers, give the span `"side": "old"`: it holds only removed lines, never added ones.
|
|
382
|
+
A file the branch deletes has no new lines, so its spans count old lines.
|
|
380
383
|
- **A note is a lead and a few points, not a paragraph.** The first line says how to read the
|
|
381
384
|
layer or what it claims, in one clause. Then up to four lines, each starting `- `, each one
|
|
382
385
|
decision or surprise the reviewer would otherwise miss. About 220 characters in all. Put names
|
|
@@ -398,8 +401,10 @@ The answer to `layers set` is the honest report — check it before you claim to
|
|
|
398
401
|
which of your own layers is the thin one. `vanished` on a layer names paths it claims that are not
|
|
399
402
|
in the diff — usually a typo or a file that moved.
|
|
400
403
|
|
|
401
|
-
`added` and `removed` on a layer count the changed lines
|
|
402
|
-
|
|
404
|
+
`added` and `removed` on a layer count the changed lines its own spans hold, by the same rule. A
|
|
405
|
+
line two layers both claim counts in each. `uncovered` names every changed line no layer holds: added
|
|
406
|
+
lines as runs of new line numbers, removed lines as runs of old line numbers with `"side": "old"`.
|
|
407
|
+
Copy a run into a layer as it is to claim it.
|
|
403
408
|
|
|
404
409
|
`layers set` refuses a document it cannot use and says which layer is wrong and why: a span that
|
|
405
410
|
ends before it starts, a span starting below line 1, a start or end that is not a whole number, a
|