onepipeline-ui 0.89.1 → 0.90.0
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,Ct as i,D as a,E as o,Et as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,St as S,T as C,Tt as w,U as T,V as E,W as D,X as O,Y as k,Z as A,_ as j,_t as M,a as N,at as P,b as F,bt as I,c as ee,ct as L,d as te,dt as ne,et as re,f as ie,ft as ae,g as oe,gt as se,ht as ce,i as le,it as ue,j as de,k as fe,l as pe,lt as me,m as he,mt as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,pt as Se,q as Ce,r as we,rt as R,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as je,vt as Me,w as Ne,wt as Pe,x as Fe,xt as Ie,y as Le,yt as Re,z as ze}from"./index-QfkEF-pv.js";var Be=R(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Ve=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),He=R(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ue=R(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),We=R(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ge=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ke=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),qe=R(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Je=R(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),Ye=R(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Xe=R(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ze=R(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Qe=R(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),$e=R(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),et=R(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),tt=R(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),nt=R(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),rt=R(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),it=R(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),at=R(`layers`,[[`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`}]]),ot=R(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),st=R(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ct=R(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),lt=R(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ut=R(`message-square-off`,[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`,key:`1wyg69`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`,key:`mhl4k6`}]]),dt=R(`message-square-reply`,[[`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:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]),ft=R(`octagon-minus`,[[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),pt=R(`octagon-pause`,[[`path`,{d:`M10 15V9`,key:`1lckn7`}],[`path`,{d:`M14 15V9`,key:`1muqhk`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}]]),mt=R(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ht=R(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),gt=R(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),_t=R(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),vt=R(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),yt=R(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),bt=R(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),xt=R(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),St=R(`square-terminal`,[[`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`}]]),Ct=R(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),wt=R(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Tt=R(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Et=R(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Dt=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ot=1e3,kt=60*Ot,At=60*kt,jt=24*At,Mt=[1,2,5,10,20,50,100,200,500,Ot,2*Ot,5*Ot,10*Ot,15*Ot,20*Ot,30*Ot,kt,2*kt,5*kt,10*kt,15*kt,20*kt,30*kt,At,2*At,3*At,6*At,12*At,jt,2*jt,7*jt,14*jt,30*jt,60*jt,90*jt,180*jt,365*jt],Nt=5.6,Pt=8,Ft=160;function It(e,t=2){return String(e).padStart(t,`0`)}function Lt(e){let t=new Date(e);if(Number.isNaN(t.valueOf()))return String(e);let n=`${It(t.getHours())}:${It(t.getMinutes())}`,r=t.getMilliseconds();if(t.getSeconds()===0&&r===0)return n;let i=`${n}:${It(t.getSeconds())}`;if(r===0)return i;let a=r%100==0?1:r%10==0?2:3;return`${i}.${It(r,3).slice(0,a)}`}function Rt(e,t){let n=e<0?`-`:`+`,r=Math.round(Math.abs(e)/t)*t,i=Math.floor(r/At),a=Math.floor(r%At/kt),o=Math.round(r%kt),s=[];if(i>0&&s.push(`${i} h`),a>0&&s.push(`${a} min`),o>0){let e=t<Ot?Math.round(Math.log10(Ot/t)):0;s.push(`${Number((o/Ot).toFixed(e))} s`)}return s.length===0?`+0 ${t>=kt?`min`:`s`}`:`${n}${s.join(` `)}`}function zt(e){return e>=kt?kt:e>=Ot?Ot:10**Math.floor(Math.log10(e))}function Bt(e){return[1,10,100,Ot].find(t=>t>=e)??kt}function Vt(e,t,n){let r=Bt(n),i=Math.round(e/r)*r;return{clock:Lt(i),offset:Rt(i-t,r)}}function Ht(e,t){return Math.max(e.length,t.length)*Nt}function Ut(e,t){let n=t>=At?-new Date(e).getTimezoneOffset()*kt:0;return Math.ceil((e+n)/t)*t-n}function Wt(e,t,n,r){let i=t.end-t.start,a=zt(e),o=[],s=0,c=-1/0;for(let l=Ut(t.start,e);l<=t.end;l+=e){let e=Lt(l),u=Rt(l-n,a),d=Ht(e,u);s=Math.max(s,d);let f=(l-t.start)/i*r-d/2,p=`center`;f<0?(f=0,p=`start`):f+d>r&&(f=r-d,p=`end`),!(f<c+Pt)&&(c=f+d,o.push({alignment:p,clock:e,offset:u,value:l}))}return{regular:e/i*r>=s+Pt,ticks:o}}function Gt({minSpacingPx:e=0,origin:t,range:n,width:r}){let i=n.end-n.start;if(!(i>0)||!(r>0))return[];let a=Math.max(2,Math.floor(r/Ft)),o=null,s=null,c=[];for(let l of Mt){if(l/i*r<Math.max(e,36))continue;let{regular:u,ticks:d}=Wt(l,n,t,r);c=d,u&&(o??=d,d.length>=a&&(s=d))}return s??o??c}var z=s(Ie(),1),B=A(),Kt=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],qt=`__timeline_implicit_lane__`;function Jt(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return Kt[(t>>>0)%Kt.length]??Kt[0]}function Yt(e){return e.laneId??qt}function Xt(e){return typeof e.end==`number`&&Number.isFinite(e.end)?e.end:typeof e.duration==`number`&&Number.isFinite(e.duration)?e.start+e.duration:e.start}function Zt(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function Qt(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function $t(e,t){let n=Xt(e),r=[e.label,`Lane: ${Yt(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${Qt(e.start)}`];return n>e.start?r.push(`End: ${Qt(n)}`,`Duration: ${Zt(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}var en=e=>`item:${e.id}`,tn=e=>`marker:${e.id}`;function nn(e,t,n,r){let i=(0,z.useRef)(new Map),a=(0,z.useRef)(null),[o,s]=(0,z.useState)(null),c=(0,z.useCallback)((e,t)=>{t?i.current.set(e,t):i.current.delete(e)},[]),l=(e,t)=>{if(e===a.current)return;a.current=e,s(e);let n=e===null?void 0:i.current.get(e);r?.(t&&n?{element:n,entry:t}:null)};return{hoveredKey:o,leave:()=>l(null,null),register:c,resolve:(r,a,o)=>{let s=[...e.flatMap(e=>{let t=Xt(e);return t<n.start||e.start>n.end?[]:[{distance:r<e.start?e.start-r:r>t?r-t:0,entry:e,key:en(e),marker:!1}]}),...t.flatMap(e=>e.at<n.start||e.at>n.end?[]:[{distance:Math.abs(e.at-r),entry:e,key:tn(e),marker:!0}])],c=a instanceof Element?a.closest(`[data-timeline-entry]`):null,u=s.find(e=>i.current.get(e.key)===c),d=s.reduce((e,t)=>!e||t.distance<e.distance||t.distance===e.distance&&t.marker===o&&e.marker!==o?t:e,null),f=u??d;l(f?.key??null,f?.entry??null)}}}function rn(e,t){let n=t;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)if(getComputedStyle(r).overflowX!==`visible`){n=r;break}let r=e.getBoundingClientRect(),i=n.getBoundingClientRect().left+n.clientLeft,a=i+n.clientWidth;r.left<i?n.scrollLeft+=r.left-i:r.right>a&&(n.scrollLeft+=r.right-a)}function an(e,t,n){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),s=(0,z.useRef)(null),c=(t&&t[1]>t[0]?{end:t[1],start:t[0]}:null)??r??e,l=Math.max(1,c.end-c.start),u=e=>{n?.([e.start,e.end]),t||i(e)},d=e=>{let t=s.current?.getBoundingClientRect(),n=t?.width||1e3;return c.start+Math.min(1,Math.max(0,(e-(t?.left??0))/n))*l};return{axis:s,brushStart:e=>o(d(e)),finishBrush:e=>{if(a===null)return;let t=d(e);Math.abs(t-a)>=l*.02&&u({end:Math.max(t,a),start:Math.min(t,a)}),o(null)},range:c,reset:()=>{n?.([e.start,e.end]),t||i(null)},viewChanged:c.start!==e.start||c.end!==e.end,zoom:(t,n)=>{let r=d(t),i=n<0?.75:1.25,a=Math.max(1,e.end-e.start),o=Math.min(a,Math.max(a/100,l*i)),s=r-o*((r-c.start)/l);s=Math.max(e.start,Math.min(s,e.end-o)),u({end:s+o,start:s})}}}function on({axis:e,cursor:t,crosshair:n=!0,ticks:r,expanded:i=!1,getFailureExcerpt:a,items:o,label:s=`Timeline`,lanes:c,markers:l=[],onExpandedChange:u,onHover:d,onRangeChange:f,onSelect:p,range:m,selectedId:h}){let g=(0,z.useId)(),[_,v]=(0,z.useState)(1e3),[y,b]=(0,z.useState)(null),[x,S]=(0,z.useState)(null),C=(0,z.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),w=(0,z.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),T=(0,z.useMemo)(()=>c?[...c]:[...new Set(C.map(Yt))].map(e=>({id:e,label:e===qt?`Events`:e})),[c,C]),E=(0,z.useMemo)(()=>{let e=[...C.flatMap(e=>[e.start,Xt(e)]),...w.map(e=>e.at)];if(e.length===0)return{end:1,start:0};let t=Math.min(...e),n=Math.max(...e);return{end:n>t?n:t+1,start:t}},[C,w]),D=an(E,m,f),{axis:O,range:A}=D,j=nn(C,w,A,d),M=(0,z.useRef)(null),N=C.length>0||w.length>0;(0,z.useEffect)(()=>{if(!N)return;let e=O.current;if(!e)return;let t=()=>v(e.getBoundingClientRect().width||1e3);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[O,N]),(0,z.useEffect)(()=>{let e=O.current,t=h?e?.querySelector(`[data-selected="true"]`):null;e&&t&&rn(t,e)},[O,h]);let P=Math.max(1,A.end-A.start),F=e=>(e-A.start)/P*100,I=i?T:[{id:`overlay`,label:`All events`}],ee=e?.origin??E.start,L=r?.minSpacingPx,te=L!==void 0&&Number.isFinite(L)&&L>0?L:0,ne=(0,z.useMemo)(()=>Gt({minSpacingPx:te,origin:ee,range:{end:A.end,start:A.start},width:_}),[te,ee,_,A.end,A.start]),ie=y===null?null:A.start+y*P,ae=ie===null?null:Vt(ie,ee,P/_),oe=e=>{let t=Xt(e);if(t<A.start||e.start>A.end)return null;let n=Math.max(0,F(Math.max(e.start,A.start))),r=Math.max(.8,F(Math.min(t,A.end))-n),i=t<=e.start,o=`timeline-detail-${g}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=Jt(Yt(e));return(0,B.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,B.jsx)(`button`,{"aria-describedby":o,"aria-label":`${e.label}, ${i?`point event`:`span`}`,"aria-pressed":h===e.id,"aria-current":h===e.id?`true`:void 0,"data-turn-id":e.turnId,"data-tool-call-id":e.toolCallId,"data-event-index":e.eventIndex,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===en(e)?`true`:void 0,className:k(`absolute top-0 h-5 border-2 border-card shadow-sm hover:opacity-80 focus-visible:z-20`,i?`w-5 -translate-x-1/2 rounded-full`:`min-w-1 rounded-md`,h===e.id&&`ring-2 ring-foreground ring-offset-1`,s),"data-lane-color":s,"data-selected":h===e.id?`true`:`false`,"data-timeline-shape":i?`point`:`span`,onBlur:()=>S(null),onClick:t=>{t.stopPropagation(),S(e.id),p?.(e)},onFocus:()=>S(e.id),onMouseEnter:()=>S(e.id),onMouseLeave:()=>S(null),ref:t=>j.register(en(e),t),style:{width:i?void 0:`${r}cqw`},type:`button`,children:i?(0,B.jsx)(ve,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,B.jsx)(`span`,{className:k(`pointer-events-none absolute z-30 w-80 rounded-md bg-popover px-2.5 py-2 text-[10px] text-popover-foreground shadow-lg`,x===e.id?`block`:`sr-only`),id:o,role:x===e.id?`tooltip`:void 0,style:{top:`1.4rem`},children:$t(e,a?.(e))})]},e.id)};return(0,B.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:T.map(e=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-2 rounded-full`,Jt(e.id))}),e.label]},e.id))}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsxs)(`button`,{"aria-label":i?`Collapse timeline`:`Expand timeline`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,onClick:()=>u?.(!i),type:`button`,children:[i?(0,B.jsx)(Ke,{"aria-hidden":`true`,className:`size-3`}):(0,B.jsx)(We,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,B.jsxs)(`button`,{"aria-label":`Reset timeline zoom`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted disabled:opacity-40`,disabled:!D.viewChanged,onClick:D.reset,type:`button`,children:[(0,B.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),C.length===0&&w.length===0?(0,B.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,B.jsxs)(`div`,{"aria-label":`Timeline plot. Scroll to zoom or drag to select a range.`,className:`relative touch-none select-none overflow-hidden rounded-lg border bg-muted/40 pb-3 pt-7`,onPointerMove:e=>{let t=e.currentTarget,n=t.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-n.left-t.clientLeft)/(t.clientWidth||n.width||1e3)));b(r);let i=M.current?.getBoundingClientRect().top??n.top;j.resolve(A.start+r*P,e.target,e.clientY<i)},onPointerLeave:()=>{b(null),j.leave()},onPointerDown:e=>D.brushStart(e.clientX),onPointerUp:e=>D.finishBrush(e.clientX),onWheel:e=>{e.preventDefault(),D.zoom(e.clientX,e.deltaY)},ref:O,children:[n&&ae!==null?(0,B.jsx)(`div`,{"aria-label":`Timeline crosshair`,className:`pointer-events-none absolute inset-y-0 z-30 w-0.5 -translate-x-1/2 bg-foreground shadow-[0_0_0_1px_var(--card)]`,style:{left:`${(y??0)*100}%`},children:(0,B.jsxs)(`span`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap rounded-sm border bg-popover px-1 text-[10px] leading-3 text-popover-foreground shadow-sm`,style:{transform:(y??0)>.5?`translateX(-100%)`:void 0},children:[(0,B.jsx)(`span`,{children:ae.clock}),(0,B.jsx)(`span`,{children:ae.offset})]})}):null,(0,B.jsxs)(`div`,{className:`relative grid gap-2`,ref:M,style:{containerType:`inline-size`},children:[I.map(e=>(0,B.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,B.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?C.filter(t=>Yt(t)===e.id):C).map(oe)]},e.id)),w.map(e=>e.at<A.start||e.at>A.end?null:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${F(e.at)}%`},children:[(0,B.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,B.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":h===e.id,className:k(`pointer-events-auto absolute bottom-full left-1/2 mb-1 flex size-5 -translate-x-1/2 items-center justify-center rounded-full bg-card text-foreground shadow`,h===e.id&&`ring-2 ring-foreground`),"data-selected":h===e.id?`true`:`false`,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===tn(e)?`true`:void 0,onClick:t=>{t.stopPropagation(),p?.(e)},ref:t=>j.register(tn(e),t),type:`button`,children:e.icon??(0,B.jsx)(ct,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=A.start&&t<=A.end?(0,B.jsx)(`span`,{"aria-label":`Timeline cursor`,className:`pointer-events-none absolute inset-y-0 z-10 w-px bg-primary`,"data-testid":`timeline-cursor`,style:{left:`${F(t)}%`}}):null]}),(0,B.jsx)(`ol`,{"aria-label":`Timeline axis`,className:`relative m-0 mt-2 h-6 list-none p-0 font-mono text-[9px] leading-3 text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:ne.map(e=>(0,B.jsxs)(`li`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap`,"data-tick-time":e.value,style:e.alignment===`start`?{left:0}:e.alignment===`end`?{right:0}:{left:`${F(e.value)}%`,transform:`translateX(-50%)`},children:[(0,B.jsx)(`span`,{children:e.clock}),(0,B.jsx)(`span`,{children:e.offset})]},e.value))})]})]})}var sn=Object.defineProperty,cn=(e,t)=>sn(e,`name`,{value:t,configurable:!0});function ln(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=cn(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return cn(i,`useContext`),[r,i]}cn(ln,`createContext`);function un(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=cn(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return cn(s,`useContext`),[o,s]}cn(r,`createContext`);let i=cn(()=>{let t=n.map(e=>z.createContext(e));return cn(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,dn(i,...t)]}cn(un,`createContextScope`);function dn(...e){let t=e[0];if(e.length===1)return t;let n=cn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return cn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}cn(dn,`composeContextScopes`);var fn=Object.defineProperty,pn=(e,t)=>fn(e,`name`,{value:t,configurable:!0});function mn(e){let t=e+`CollectionProvider`,[n,r]=un(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=pn(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,m=p(u),h=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=f(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(m,{[d]:``,ref:s,children:r})});h.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return pn(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}pn(mn,`createCollection`);var hn=new WeakMap,gn=class e extends Map{static{pn(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],hn.set(this,!0)}set(e,t){return hn.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=yn(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=_n(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=_n(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return _n(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function _n(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=vn(e,t);return n===-1?void 0:e[n]}pn(_n,`at`);function vn(e,t){let n=e.length,r=yn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}pn(vn,`toSafeIndex`);function yn(e){return e!==e||e===0?0:Math.trunc(e)}pn(yn,`toSafeInteger`);function bn(e){let t=e+`CollectionProvider`,[n,r]=un(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new gn,setItemMap:pn(()=>void 0,`setItemMap`)}),o=pn(({state:e,...t})=>e?(0,B.jsx)(c,{...t,state:e}):(0,B.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=pn(e=>{let t=_();return(0,B.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=pn(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=f(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=wn(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,B.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=p(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(l,n).collectionRef);return(0,B.jsx)(u,{ref:i,children:r})});d.displayName=l;let m=e+`CollectionItemSlot`,h=p(m),g=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=f(t,o,c),{setItemMap:u}=a(m,n),d=z.useRef(i);xn(d.current,i)||(d.current=i);let p=d.current;return z.useEffect(()=>{let e=p;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Cn):(t.set(s,{...e,element:s}),t.toSorted(Cn)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new gn(e)))}},[s,p,u]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return z.useState(new gn)}pn(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return pn(v,`useCollection`),[{Provider:o,Slot:d,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}pn(bn,`createCollection`);function xn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}pn(xn,`shallowEqual`);function Sn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}pn(Sn,`isElementPreceding`);function Cn(e,t){return!e[1].element||!t[1].element?0:Sn(e[1].element,t[1].element)?-1:1}pn(Cn,`sortByDocumentPosition`);function wn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}pn(wn,`getChildListObserver`);var Tn=Object.defineProperty,En=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),Dn=!!(typeof window<`u`&&window.document&&window.document.createElement);function On(e,t,{checkForDefaultPrevented:n=!0}={}){return En(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}En(On,`composeEventHandlers`);function kn(e){if(!Dn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}En(kn,`getOwnerWindow`);function An(e){if(!Dn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}En(An,`getOwnerDocument`);function jn(e,t=!1){let{activeElement:n}=An(e);if(!n?.nodeName)return null;if(Mn(n)&&n.contentDocument)return jn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=An(n).getElementById(e);if(t)return t}}return n}En(jn,`getActiveElement`);function Mn(e){return e.tagName===`IFRAME`}En(Mn,`isFrame`);var Nn=globalThis?.document?z.useLayoutEffect:()=>{},Pn=Object.defineProperty,Fn=(e,t)=>Pn(e,`name`,{value:t,configurable:!0}),In=z.useEffectEvent,Ln=z.useInsertionEffect;function Rn(e){if(typeof In==`function`)return In(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ln==`function`?Ln(()=>{t.current=e}):Nn(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Fn(Rn,`useEffectEvent`);var zn=Object.defineProperty,Bn=(e,t)=>zn(e,`name`,{value:t,configurable:!0}),Vn=z.useInsertionEffect||Nn;function Hn({prop:e,defaultProp:t,onChange:n=Bn(()=>{},`onChange`),caller:r}){let[i,a,o]=Un({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=Wn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Bn(Hn,`useControllableState`);function Un({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Vn(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Bn(Un,`useUncontrolledState`);function Wn(e){return typeof e==`function`}Bn(Wn,`isFunction`);var Gn=Symbol(`RADIX:SYNC_STATE`);function Kn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Rn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===Gn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Gn,state:i})},[i,d.state,c]),[h,f]}Bn(Kn,`useControllableStateReducer`);var qn=s(I(),1),Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Zn(e,t){e&&qn.flushSync(()=>e.dispatchEvent(t))}Yn(Zn,`dispatchDiscreteCustomEvent`);var Qn=Object.defineProperty,$n=(e,t)=>Qn(e,`name`,{value:t,configurable:!0});function er(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}$n(er,`useStateMachine`);var tr=$n(e=>{let{present:t,children:n}=e,r=nr(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=ir(r.ref,or(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function nr(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=er(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??ar(r.current),o.current=void 0):a.current=`none`},[s]),Nn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ar(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Nn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=$n(a=>{let o=ar(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=$n(e=>{e.target===t&&(a.current=ar(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ar(t)}else r.current=null;n(e)},[])}}$n(nr,`usePresence`);function rr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$n(rr,`setRef`);function ir(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=rr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():rr(n[e],null)}}},[])}$n(ir,`useStableComposedRefs`);function ar(e){return e?.animationName||`none`}$n(ar,`getAnimationName`);function or(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$n(or,`getElementRef`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0}),lr=z.useId||(()=>void 0),ur=0;function dr(e){let[t,n]=z.useState(lr());return Nn(()=>{e||n(e=>e??String(ur++))},[e]),e||(t?`radix-${t}`:``)}cr(dr,`useId`);var fr=Object.defineProperty,pr=(e,t)=>fr(e,`name`,{value:t,configurable:!0}),mr=`Collapsible`,[hr,gr]=un(mr),[_r,vr]=hr(mr),yr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Hn({prop:r,defaultProp:i??!1,onChange:o,caller:mr});return(0,B.jsx)(_r,{scope:n,disabled:a,contentId:dr(),open:c,onOpenToggle:z.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(Xn.div,{"data-state":Tr(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),br=`CollapsibleTrigger`,xr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=vr(br,n);return(0,B.jsx)(Xn.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Tr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:On(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Sr=`CollapsibleContent`,Cr=z.forwardRef(pr(function(e,t){let{forceMount:n,...r}=e,i=vr(Sr,e.__scopeCollapsible);return(0,B.jsx)(tr,{present:n||i.open,children:({present:e})=>(0,B.jsx)(wr,{...r,ref:t,present:e})})},`CollapsibleContent`)),wr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=vr(Sr,n),[s,c]=z.useState(r),l=z.useRef(null),u=f(t,l),d=z.useRef(0),p=d.current,m=z.useRef(0),h=m.current,g=o.open||s,_=z.useRef(g),v=z.useRef(void 0);return z.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Nn(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(Xn.div,{"data-state":Tr(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Tr(e){return e?`open`:`closed`}pr(Tr,`getState`);var Er=yr,Dr=xr,Or=Cr,kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),jr=z.createContext(void 0);function Mr(e){let t=z.useContext(jr);return e||t||`ltr`}Ar(Mr,`useDirection`);var Nr=Object.defineProperty,Pr=(e,t)=>Nr(e,`name`,{value:t,configurable:!0}),Fr=`Accordion`,Ir=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Lr,Rr,zr]=mn(Fr),[Br,Vr]=un(Fr,[zr,gr]),Hr=gr(),Ur=z.forwardRef(Pr(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(Lr.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Yr,{...a,ref:t}):(0,B.jsx)(Jr,{...i,ref:t})})},`Accordion`)),[Wr,Gr]=Br(Fr),[Kr,qr]=Br(Fr,{collapsible:!1}),Jr=z.forwardRef(Pr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Pr(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=Hn({prop:n,defaultProp:r??``,onChange:i,caller:Fr});return(0,B.jsx)(Wr,{scope:e.__scopeAccordion,value:z.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:z.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Kr,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(Qr,{...o,ref:t})})})},`AccordionImplSingle`)),Yr=z.forwardRef(Pr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Pr(()=>{},`onValueChange`),...a}=e,[o,s]=Hn({prop:n,defaultProp:r??[],onChange:i,caller:Fr}),c=z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(Wr,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Kr,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(Qr,{...a,ref:t})})})},`AccordionImplMultiple`)),[Xr,Zr]=Br(Fr),Qr=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=f(z.useRef(null),t),c=Rr(n),l=Mr(i)===`ltr`,u=On(e.onKeyDown,e=>{if(!Ir.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=Pr(()=>{o=r+1,o>s&&(o=0)},`moveNext`),d=Pr(()=>{o=r-1,o<0&&(o=s)},`movePrev`);switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Xr,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(Lr.Slot,{scope:n,children:(0,B.jsx)(Xn.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})},`AccordionImpl`)),$r=`AccordionItem`,[ei,ti]=Br($r),ni=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=Zr($r,n),o=Gr($r,n),s=Hr(n),c=dr(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(ei,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Er,{"data-orientation":a.orientation,"data-state":li(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),ri=`AccordionHeader`,ii=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(ri,n);return(0,B.jsx)(Xn.h3,{"data-orientation":i.orientation,"data-state":li(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),ai=`AccordionTrigger`,oi=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(ai,n),o=qr(ai,n),s=Hr(n);return(0,B.jsx)(Lr.ItemSlot,{scope:n,children:(0,B.jsx)(Dr,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),si=`AccordionContent`,ci=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(si,n),o=Hr(n);return(0,B.jsx)(Or,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})},`AccordionContent`));function li(e){return e?`open`:`closed`}Pr(li,`getState`);var ui=Ur,di=ni,fi=ii,pi=oi,mi=ci;function hi({...e}){return(0,B.jsx)(ui,{"data-slot":`accordion`,...e})}function gi({className:e,...t}){return(0,B.jsx)(di,{"data-slot":`accordion-item`,className:k(`border-b last:border-b-0`,e),...t})}function _i({className:e,children:t,...n}){return(0,B.jsx)(fi,{className:`flex`,children:(0,B.jsxs)(pi,{"data-slot":`accordion-trigger`,className:k(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,B.jsx)(We,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function vi({className:e,children:t,...n}){return(0,B.jsx)(mi,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,B.jsx)(`div`,{className:k(`pt-0 pb-4`,e),children:t})})}var yi=D(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive bg-destructive-surface text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function bi({className:e,variant:t,...n}){return(0,B.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:k(yi({variant:t}),e),...n})}function xi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-title`,className:k(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function Si({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-description`,className:k(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Ci=Object.defineProperty,wi=(e,t)=>Ci(e,`name`,{value:t,configurable:!0});function Ti(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}wi(Ti,`useCallbackRef`);var Ei=Object.defineProperty,Di=(e,t)=>Ei(e,`name`,{value:t,configurable:!0}),Oi=`Avatar`,[ki,Ai]=un(Oi),ji=[0,()=>void 0],[Mi,Ni]=ki(Oi),Pi=z.forwardRef(Di(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=z.useState(`idle`),[o,s]=zi();return(0,B.jsx)(Mi,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,B.jsx)(Xn.span,{...r,ref:t})})},`Avatar`)),Fi=`AvatarFallback`,Ii=z.forwardRef(Di(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Ni(Fi,n),[o,s]=z.useState(r===void 0);return z.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,B.jsx)(Xn.span,{...i,ref:t}):null},`AvatarFallback`));function Li(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Nn(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Di(e=>{let t=e.currentTarget;n(Ri(t))},`handleLoad`),o=Di(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Ri(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Di(Li,`useImageLoadingStatus`);function Ri(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Di(Ri,`getImageLoadingStatus`);function zi(){return ji}Di(zi,`useImageCount`);function Bi(e){}Di(Bi,`useUpdateImageCount`);function Vi({className:e,size:t=`default`,...n}){return(0,B.jsx)(Pi,{"data-slot":`avatar`,"data-size":t,className:k(`group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...n})}function Hi({className:e,...t}){return(0,B.jsx)(Ii,{"data-slot":`avatar-fallback`,className:k(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Ui({className:e,...t}){return(0,B.jsx)(`img`,{className:k(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var Wi=D(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`border border-destructive bg-destructive-surface text-destructive hover:bg-destructive-surface/80 focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Gi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?l:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:k(Wi({variant:t,size:n,className:e})),...i})}function Ki({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function qi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-6`,e),...t})}var Ji=Object.defineProperty,Yi=(e,t)=>Ji(e,`name`,{value:t,configurable:!0}),Xi=`dismissableLayer.update`,Zi=`dismissableLayer.pointerDownOutside`,Qi=`dismissableLayer.focusOutside`,$i,ea=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ta=z.forwardRef(Yi(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=z.useContext(ea),[d,p]=z.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=z.useState({}),g=f(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=ia(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=aa(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=d?b===_.length-1:!1,D=Ti(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return z.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($i=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),oa(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=$i))}},[d,m,n,u]),z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),oa())},[d,u]),z.useEffect(()=>{let e=Yi(()=>h({}),`handleUpdate`);return document.addEventListener(Xi,e),()=>document.removeEventListener(Xi,e)},[]),(0,B.jsx)(Xn.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:On(e.onFocusCapture,T.onFocusCapture),onBlurCapture:On(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:On(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function na(){let e=z.useContext(ea),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Yi(na,`useDismissableLayerSurface`);var ra=Yi(()=>!0,`IS_TRUE`);function ia(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ra}=t,s=Ti(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Yi(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Yi(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Yi(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Yi(p,`handleInteractionBubble`);let m=Yi(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||sa(Zi,s,p,{discrete:!0})};if(Yi(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Yi(()=>c.current=!0,`onPointerDownCapture`)}}Yi(ia,`usePointerDownOutside`);function aa(e,t=globalThis?.document){let n=Ti(e),r=z.useRef(!1);return z.useEffect(()=>{let e=Yi(e=>{e.target&&!r.current&&sa(Qi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Yi(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Yi(()=>r.current=!1,`onBlurCapture`)}}Yi(aa,`useFocusOutside`);function oa(){let e=new CustomEvent(Xi);document.dispatchEvent(e)}Yi(oa,`dispatchUpdate`);function sa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Zn(i,a):i.dispatchEvent(a)}Yi(sa,`handleAndDispatchCustomEvent`);var ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0}),ua=`focusScope.autoFocusOnMount`,da=`focusScope.autoFocusOnUnmount`,fa={bubbles:!1,cancelable:!0},pa=z.forwardRef(la(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Ti(i),u=Ti(a),d=z.useRef(null),p=f(t,c),m=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ba(d.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ba(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ba(s)};la(e,`handleFocusIn`),la(t,`handleFocusOut`),la(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),z.useEffect(()=>{if(s){xa.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ua,fa);s.addEventListener(ua,l),s.dispatchEvent(t),t.defaultPrevented||(ma(wa(ga(s)),{select:!0}),document.activeElement===e&&ba(s))}return()=>{s.removeEventListener(ua,l),setTimeout(()=>{let t=new CustomEvent(da,fa);s.addEventListener(da,u),s.dispatchEvent(t),t.defaultPrevented||ba(e??document.body,{select:!0}),s.removeEventListener(da,u),xa.remove(m)},0)}}},[s,l,u,m]);let h=z.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ha(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ba(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ba(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,B.jsx)(Xn.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function ma(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ba(r,{select:t}),document.activeElement!==n)return}la(ma,`focusFirst`);function ha(e){let t=ga(e);return[_a(t,e),_a(t.reverse(),e)]}la(ha,`getTabbableEdges`);function ga(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:la(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}la(ga,`getTabbableCandidates`);function _a(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):va(r,{upTo:t})))return r}la(_a,`findVisible`);function va(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}la(va,`isHidden`);function ya(e){return e instanceof HTMLInputElement&&`select`in e}la(ya,`isSelectableInput`);function ba(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ya(e)&&t&&e.select()}}la(ba,`focus`);var xa=Sa();function Sa(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ca(e,t),e.unshift(t)},remove(t){e=Ca(e,t),e[0]?.resume()}}}la(Sa,`createFocusScopesStack`);function Ca(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}la(Ca,`arrayRemove`);function wa(e){return e.filter(e=>e.tagName!==`A`)}la(wa,`removeLinks`);var Ta=Object.defineProperty,Ea=z.forwardRef(((e,t)=>Ta(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);Nn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?qn.createPortal((0,B.jsx)(Xn.div,{...r,ref:t}),o):null},`Portal`)),Da=Object.defineProperty,Oa=(e,t)=>Da(e,`name`,{value:t,configurable:!0}),ka=0,Aa=null;function ja(e){return Ma(),e.children}Oa(ja,`FocusGuards`);function Ma(){z.useEffect(()=>{Aa||={start:Na(),end:Na()};let{start:e,end:t}=Aa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ka++,()=>{ka===1&&(Aa?.start.remove(),Aa?.end.remove(),Aa=null),ka=Math.max(0,ka-1)}},[])}Oa(Ma,`useFocusGuards`);function Na(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Oa(Na,`createFocusGuard`);var Pa=function(){return Pa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pa.apply(this,arguments)};function Fa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ia(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var La=`right-scroll-bar-position`,Ra=`width-before-scroll-bar`,za=`with-scroll-bars-hidden`,Ba=`--removed-body-scroll-bar-size`;function Va(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ha(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ua=typeof window<`u`?z.useLayoutEffect:z.useEffect,Wa=new WeakMap;function Ga(e,t){var n=Ha(t||null,function(t){return e.forEach(function(e){return Va(e,t)})});return Ua(function(){var t=Wa.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Va(e,null)}),i.forEach(function(e){r.has(e)||Va(e,a)})}Wa.set(n,e)},[e]),n}function Ka(e){return e}function qa(e,t){t===void 0&&(t=Ka);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ja(e){e===void 0&&(e={});var t=qa(null);return t.options=Pa({async:!0,ssr:!1},e),t}var Ya=function(e){var t=e.sideCar,n=Fa(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,Pa({},n))};Ya.isSideCarExport=!0;function Xa(e,t){return e.useMedium(t),Ya}var Za=Ja(),Qa=function(){},$a=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Qa,onWheelCapture:Qa,onTouchMoveCapture:Qa}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Fa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ga([n,t]),C=Pa(Pa({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Za,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Pa(Pa({},C),{ref:S})):z.createElement(v,Pa({},C,{className:c,ref:S}),s))});$a.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$a.classNames={fullWidth:Ra,zeroRight:La};var eo,to=function(){if(eo)return eo;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function no(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=to();return t&&e.setAttribute(`nonce`,t),e}function ro(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function io(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ao=function(){var e=0,t=null;return{add:function(n){e==0&&(t=no())&&(ro(t,n),io(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oo=function(){var e=ao();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},so=function(){var e=oo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},co={left:0,top:0,right:0,gap:0},lo=function(e){return parseInt(e||``,10)||0},uo=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[lo(n),lo(r),lo(i)]},fo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return co;var t=uo(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},po=so(),mo=`data-scroll-locked`,ho=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,Ct as i,D as a,E as o,Et as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,O as _,P as v,Q as y,R as b,S as x,St as S,T as C,Tt as w,U as T,V as E,W as D,X as O,Y as k,Z as A,_ as j,_t as M,a as N,at as P,b as F,bt as I,c as ee,ct as L,d as te,dt as ne,et as re,f as ie,ft as ae,g as oe,gt as se,ht as ce,i as le,it as ue,j as de,k as fe,l as pe,lt as me,m as he,mt as ge,n as _e,nt as ve,o as ye,ot as be,p as xe,pt as Se,q as Ce,r as we,rt as R,s as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as je,vt as Me,w as Ne,wt as Pe,x as Fe,xt as Ie,y as Le,yt as Re,z as ze}from"./index-Bi0LXUte.js";var Be=R(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Ve=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),He=R(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Ue=R(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),We=R(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ge=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ke=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),qe=R(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Je=R(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),Ye=R(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Xe=R(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Ze=R(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Qe=R(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),$e=R(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),et=R(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),tt=R(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),nt=R(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),rt=R(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),it=R(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),at=R(`layers`,[[`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`}]]),ot=R(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),st=R(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ct=R(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),lt=R(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),ut=R(`message-square-off`,[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`,key:`1wyg69`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`,key:`mhl4k6`}]]),dt=R(`message-square-reply`,[[`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:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]),ft=R(`octagon-minus`,[[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),pt=R(`octagon-pause`,[[`path`,{d:`M10 15V9`,key:`1lckn7`}],[`path`,{d:`M14 15V9`,key:`1muqhk`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}]]),mt=R(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ht=R(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),gt=R(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),_t=R(`repeat-2`,[[`path`,{d:`m2 9 3-3 3 3`,key:`1ltn5i`}],[`path`,{d:`M13 18H7a2 2 0 0 1-2-2V6`,key:`1r6tfw`}],[`path`,{d:`m22 15-3 3-3-3`,key:`4rnwn2`}],[`path`,{d:`M11 6h6a2 2 0 0 1 2 2v10`,key:`2f72bc`}]]),vt=R(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),yt=R(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),bt=R(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),xt=R(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),St=R(`square-terminal`,[[`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`}]]),Ct=R(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),wt=R(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),Tt=R(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),Et=R(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Dt=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ot=1e3,kt=60*Ot,At=60*kt,jt=24*At,Mt=[1,2,5,10,20,50,100,200,500,Ot,2*Ot,5*Ot,10*Ot,15*Ot,20*Ot,30*Ot,kt,2*kt,5*kt,10*kt,15*kt,20*kt,30*kt,At,2*At,3*At,6*At,12*At,jt,2*jt,7*jt,14*jt,30*jt,60*jt,90*jt,180*jt,365*jt],Nt=5.6,Pt=8,Ft=160;function It(e,t=2){return String(e).padStart(t,`0`)}function Lt(e){let t=new Date(e);if(Number.isNaN(t.valueOf()))return String(e);let n=`${It(t.getHours())}:${It(t.getMinutes())}`,r=t.getMilliseconds();if(t.getSeconds()===0&&r===0)return n;let i=`${n}:${It(t.getSeconds())}`;if(r===0)return i;let a=r%100==0?1:r%10==0?2:3;return`${i}.${It(r,3).slice(0,a)}`}function Rt(e,t){let n=e<0?`-`:`+`,r=Math.round(Math.abs(e)/t)*t,i=Math.floor(r/At),a=Math.floor(r%At/kt),o=Math.round(r%kt),s=[];if(i>0&&s.push(`${i} h`),a>0&&s.push(`${a} min`),o>0){let e=t<Ot?Math.round(Math.log10(Ot/t)):0;s.push(`${Number((o/Ot).toFixed(e))} s`)}return s.length===0?`+0 ${t>=kt?`min`:`s`}`:`${n}${s.join(` `)}`}function zt(e){return e>=kt?kt:e>=Ot?Ot:10**Math.floor(Math.log10(e))}function Bt(e){return[1,10,100,Ot].find(t=>t>=e)??kt}function Vt(e,t,n){let r=Bt(n),i=Math.round(e/r)*r;return{clock:Lt(i),offset:Rt(i-t,r)}}function Ht(e,t){return Math.max(e.length,t.length)*Nt}function Ut(e,t){let n=t>=At?-new Date(e).getTimezoneOffset()*kt:0;return Math.ceil((e+n)/t)*t-n}function Wt(e,t,n,r){let i=t.end-t.start,a=zt(e),o=[],s=0,c=-1/0;for(let l=Ut(t.start,e);l<=t.end;l+=e){let e=Lt(l),u=Rt(l-n,a),d=Ht(e,u);s=Math.max(s,d);let f=(l-t.start)/i*r-d/2,p=`center`;f<0?(f=0,p=`start`):f+d>r&&(f=r-d,p=`end`),!(f<c+Pt)&&(c=f+d,o.push({alignment:p,clock:e,offset:u,value:l}))}return{regular:e/i*r>=s+Pt,ticks:o}}function Gt({minSpacingPx:e=0,origin:t,range:n,width:r}){let i=n.end-n.start;if(!(i>0)||!(r>0))return[];let a=Math.max(2,Math.floor(r/Ft)),o=null,s=null,c=[];for(let l of Mt){if(l/i*r<Math.max(e,36))continue;let{regular:u,ticks:d}=Wt(l,n,t,r);c=d,u&&(o??=d,d.length>=a&&(s=d))}return s??o??c}var z=s(Ie(),1),B=A(),Kt=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],qt=`__timeline_implicit_lane__`;function Jt(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return Kt[(t>>>0)%Kt.length]??Kt[0]}function Yt(e){return e.laneId??qt}function Xt(e){return typeof e.end==`number`&&Number.isFinite(e.end)?e.end:typeof e.duration==`number`&&Number.isFinite(e.duration)?e.start+e.duration:e.start}function Zt(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function Qt(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function $t(e,t){let n=Xt(e),r=[e.label,`Lane: ${Yt(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${Qt(e.start)}`];return n>e.start?r.push(`End: ${Qt(n)}`,`Duration: ${Zt(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}var en=e=>`item:${e.id}`,tn=e=>`marker:${e.id}`;function nn(e,t,n,r){let i=(0,z.useRef)(new Map),a=(0,z.useRef)(null),[o,s]=(0,z.useState)(null),c=(0,z.useCallback)((e,t)=>{t?i.current.set(e,t):i.current.delete(e)},[]),l=(e,t)=>{if(e===a.current)return;a.current=e,s(e);let n=e===null?void 0:i.current.get(e);r?.(t&&n?{element:n,entry:t}:null)};return{hoveredKey:o,leave:()=>l(null,null),register:c,resolve:(r,a,o)=>{let s=[...e.flatMap(e=>{let t=Xt(e);return t<n.start||e.start>n.end?[]:[{distance:r<e.start?e.start-r:r>t?r-t:0,entry:e,key:en(e),marker:!1}]}),...t.flatMap(e=>e.at<n.start||e.at>n.end?[]:[{distance:Math.abs(e.at-r),entry:e,key:tn(e),marker:!0}])],c=a instanceof Element?a.closest(`[data-timeline-entry]`):null,u=s.find(e=>i.current.get(e.key)===c),d=s.reduce((e,t)=>!e||t.distance<e.distance||t.distance===e.distance&&t.marker===o&&e.marker!==o?t:e,null),f=u??d;l(f?.key??null,f?.entry??null)}}}function rn(e,t){let n=t;for(let r=e.parentElement;r&&r!==t;r=r.parentElement)if(getComputedStyle(r).overflowX!==`visible`){n=r;break}let r=e.getBoundingClientRect(),i=n.getBoundingClientRect().left+n.clientLeft,a=i+n.clientWidth;r.left<i?n.scrollLeft+=r.left-i:r.right>a&&(n.scrollLeft+=r.right-a)}function an(e,t,n){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),s=(0,z.useRef)(null),c=(t&&t[1]>t[0]?{end:t[1],start:t[0]}:null)??r??e,l=Math.max(1,c.end-c.start),u=e=>{n?.([e.start,e.end]),t||i(e)},d=e=>{let t=s.current?.getBoundingClientRect(),n=t?.width||1e3;return c.start+Math.min(1,Math.max(0,(e-(t?.left??0))/n))*l};return{axis:s,brushStart:e=>o(d(e)),finishBrush:e=>{if(a===null)return;let t=d(e);Math.abs(t-a)>=l*.02&&u({end:Math.max(t,a),start:Math.min(t,a)}),o(null)},range:c,reset:()=>{n?.([e.start,e.end]),t||i(null)},viewChanged:c.start!==e.start||c.end!==e.end,zoom:(t,n)=>{let r=d(t),i=n<0?.75:1.25,a=Math.max(1,e.end-e.start),o=Math.min(a,Math.max(a/100,l*i)),s=r-o*((r-c.start)/l);s=Math.max(e.start,Math.min(s,e.end-o)),u({end:s+o,start:s})}}}function on({axis:e,cursor:t,crosshair:n=!0,ticks:r,expanded:i=!1,getFailureExcerpt:a,items:o,label:s=`Timeline`,lanes:c,markers:l=[],onExpandedChange:u,onHover:d,onRangeChange:f,onSelect:p,range:m,selectedId:h}){let g=(0,z.useId)(),[_,v]=(0,z.useState)(1e3),[y,b]=(0,z.useState)(null),[x,S]=(0,z.useState)(null),C=(0,z.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),w=(0,z.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),T=(0,z.useMemo)(()=>c?[...c]:[...new Set(C.map(Yt))].map(e=>({id:e,label:e===qt?`Events`:e})),[c,C]),E=(0,z.useMemo)(()=>{let e=[...C.flatMap(e=>[e.start,Xt(e)]),...w.map(e=>e.at)];if(e.length===0)return{end:1,start:0};let t=Math.min(...e),n=Math.max(...e);return{end:n>t?n:t+1,start:t}},[C,w]),D=an(E,m,f),{axis:O,range:A}=D,j=nn(C,w,A,d),M=(0,z.useRef)(null),N=C.length>0||w.length>0;(0,z.useEffect)(()=>{if(!N)return;let e=O.current;if(!e)return;let t=()=>v(e.getBoundingClientRect().width||1e3);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[O,N]),(0,z.useEffect)(()=>{let e=O.current,t=h?e?.querySelector(`[data-selected="true"]`):null;e&&t&&rn(t,e)},[O,h]);let P=Math.max(1,A.end-A.start),F=e=>(e-A.start)/P*100,I=i?T:[{id:`overlay`,label:`All events`}],ee=e?.origin??E.start,L=r?.minSpacingPx,te=L!==void 0&&Number.isFinite(L)&&L>0?L:0,ne=(0,z.useMemo)(()=>Gt({minSpacingPx:te,origin:ee,range:{end:A.end,start:A.start},width:_}),[te,ee,_,A.end,A.start]),ie=y===null?null:A.start+y*P,ae=ie===null?null:Vt(ie,ee,P/_),oe=e=>{let t=Xt(e);if(t<A.start||e.start>A.end)return null;let n=Math.max(0,F(Math.max(e.start,A.start))),r=Math.max(.8,F(Math.min(t,A.end))-n),i=t<=e.start,o=`timeline-detail-${g}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=Jt(Yt(e));return(0,B.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,B.jsx)(`button`,{"aria-describedby":o,"aria-label":`${e.label}, ${i?`point event`:`span`}`,"aria-pressed":h===e.id,"aria-current":h===e.id?`true`:void 0,"data-turn-id":e.turnId,"data-tool-call-id":e.toolCallId,"data-event-index":e.eventIndex,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===en(e)?`true`:void 0,className:k(`absolute top-0 h-5 border-2 border-card shadow-sm hover:opacity-80 focus-visible:z-20`,i?`w-5 -translate-x-1/2 rounded-full`:`min-w-1 rounded-md`,h===e.id&&`ring-2 ring-foreground ring-offset-1`,s),"data-lane-color":s,"data-selected":h===e.id?`true`:`false`,"data-timeline-shape":i?`point`:`span`,onBlur:()=>S(null),onClick:t=>{t.stopPropagation(),S(e.id),p?.(e)},onFocus:()=>S(e.id),onMouseEnter:()=>S(e.id),onMouseLeave:()=>S(null),ref:t=>j.register(en(e),t),style:{width:i?void 0:`${r}cqw`},type:`button`,children:i?(0,B.jsx)(ve,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,B.jsx)(`span`,{className:k(`pointer-events-none absolute z-30 w-80 rounded-md bg-popover px-2.5 py-2 text-[10px] text-popover-foreground shadow-lg`,x===e.id?`block`:`sr-only`),id:o,role:x===e.id?`tooltip`:void 0,style:{top:`1.4rem`},children:$t(e,a?.(e))})]},e.id)};return(0,B.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:T.map(e=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-2 rounded-full`,Jt(e.id))}),e.label]},e.id))}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsxs)(`button`,{"aria-label":i?`Collapse timeline`:`Expand timeline`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,onClick:()=>u?.(!i),type:`button`,children:[i?(0,B.jsx)(Ke,{"aria-hidden":`true`,className:`size-3`}):(0,B.jsx)(We,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,B.jsxs)(`button`,{"aria-label":`Reset timeline zoom`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted disabled:opacity-40`,disabled:!D.viewChanged,onClick:D.reset,type:`button`,children:[(0,B.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),C.length===0&&w.length===0?(0,B.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,B.jsxs)(`div`,{"aria-label":`Timeline plot. Scroll to zoom or drag to select a range.`,className:`relative touch-none select-none overflow-hidden rounded-lg border bg-muted/40 pb-3 pt-7`,onPointerMove:e=>{let t=e.currentTarget,n=t.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-n.left-t.clientLeft)/(t.clientWidth||n.width||1e3)));b(r);let i=M.current?.getBoundingClientRect().top??n.top;j.resolve(A.start+r*P,e.target,e.clientY<i)},onPointerLeave:()=>{b(null),j.leave()},onPointerDown:e=>D.brushStart(e.clientX),onPointerUp:e=>D.finishBrush(e.clientX),onWheel:e=>{e.preventDefault(),D.zoom(e.clientX,e.deltaY)},ref:O,children:[n&&ae!==null?(0,B.jsx)(`div`,{"aria-label":`Timeline crosshair`,className:`pointer-events-none absolute inset-y-0 z-30 w-0.5 -translate-x-1/2 bg-foreground shadow-[0_0_0_1px_var(--card)]`,style:{left:`${(y??0)*100}%`},children:(0,B.jsxs)(`span`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap rounded-sm border bg-popover px-1 text-[10px] leading-3 text-popover-foreground shadow-sm`,style:{transform:(y??0)>.5?`translateX(-100%)`:void 0},children:[(0,B.jsx)(`span`,{children:ae.clock}),(0,B.jsx)(`span`,{children:ae.offset})]})}):null,(0,B.jsxs)(`div`,{className:`relative grid gap-2`,ref:M,style:{containerType:`inline-size`},children:[I.map(e=>(0,B.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,B.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?C.filter(t=>Yt(t)===e.id):C).map(oe)]},e.id)),w.map(e=>e.at<A.start||e.at>A.end?null:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${F(e.at)}%`},children:[(0,B.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,B.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":h===e.id,className:k(`pointer-events-auto absolute bottom-full left-1/2 mb-1 flex size-5 -translate-x-1/2 items-center justify-center rounded-full bg-card text-foreground shadow`,h===e.id&&`ring-2 ring-foreground`),"data-selected":h===e.id?`true`:`false`,"data-timeline-entry":``,"data-timeline-hovered":j.hoveredKey===tn(e)?`true`:void 0,onClick:t=>{t.stopPropagation(),p?.(e)},ref:t=>j.register(tn(e),t),type:`button`,children:e.icon??(0,B.jsx)(ct,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=A.start&&t<=A.end?(0,B.jsx)(`span`,{"aria-label":`Timeline cursor`,className:`pointer-events-none absolute inset-y-0 z-10 w-px bg-primary`,"data-testid":`timeline-cursor`,style:{left:`${F(t)}%`}}):null]}),(0,B.jsx)(`ol`,{"aria-label":`Timeline axis`,className:`relative m-0 mt-2 h-6 list-none p-0 font-mono text-[9px] leading-3 text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:ne.map(e=>(0,B.jsxs)(`li`,{className:`absolute top-0 flex flex-col items-center whitespace-nowrap`,"data-tick-time":e.value,style:e.alignment===`start`?{left:0}:e.alignment===`end`?{right:0}:{left:`${F(e.value)}%`,transform:`translateX(-50%)`},children:[(0,B.jsx)(`span`,{children:e.clock}),(0,B.jsx)(`span`,{children:e.offset})]},e.value))})]})]})}var sn=Object.defineProperty,cn=(e,t)=>sn(e,`name`,{value:t,configurable:!0});function ln(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=cn(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return cn(i,`useContext`),[r,i]}cn(ln,`createContext`);function un(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=cn(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return cn(s,`useContext`),[o,s]}cn(r,`createContext`);let i=cn(()=>{let t=n.map(e=>z.createContext(e));return cn(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,dn(i,...t)]}cn(un,`createContextScope`);function dn(...e){let t=e[0];if(e.length===1)return t;let n=cn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return cn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}cn(dn,`composeContextScopes`);var fn=Object.defineProperty,pn=(e,t)=>fn(e,`name`,{value:t,configurable:!0});function mn(e){let t=e+`CollectionProvider`,[n,r]=un(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=pn(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,B.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=p(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(s,n).collectionRef);return(0,B.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,m=p(u),h=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=f(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,B.jsx)(m,{[d]:``,ref:s,children:r})});h.displayName=u;function g(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return pn(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}pn(mn,`createCollection`);var hn=new WeakMap,gn=class e extends Map{static{pn(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],hn.set(this,!0)}set(e,t){return hn.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=yn(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=_n(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=_n(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return _n(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function _n(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=vn(e,t);return n===-1?void 0:e[n]}pn(_n,`at`);function vn(e,t){let n=e.length,r=yn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}pn(vn,`toSafeIndex`);function yn(e){return e!==e||e===0?0:Math.trunc(e)}pn(yn,`toSafeInteger`);function bn(e){let t=e+`CollectionProvider`,[n,r]=un(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new gn,setItemMap:pn(()=>void 0,`setItemMap`)}),o=pn(({state:e,...t})=>e?(0,B.jsx)(c,{...t,state:e}):(0,B.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=pn(e=>{let t=_();return(0,B.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=pn(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=f(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=wn(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,B.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=p(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=f(t,a(l,n).collectionRef);return(0,B.jsx)(u,{ref:i,children:r})});d.displayName=l;let m=e+`CollectionItemSlot`,h=p(m),g=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=f(t,o,c),{setItemMap:u}=a(m,n),d=z.useRef(i);xn(d.current,i)||(d.current=i);let p=d.current;return z.useEffect(()=>{let e=p;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Cn):(t.set(s,{...e,element:s}),t.toSorted(Cn)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new gn(e)))}},[s,p,u]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return z.useState(new gn)}pn(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return pn(v,`useCollection`),[{Provider:o,Slot:d,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}pn(bn,`createCollection`);function xn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}pn(xn,`shallowEqual`);function Sn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}pn(Sn,`isElementPreceding`);function Cn(e,t){return!e[1].element||!t[1].element?0:Sn(e[1].element,t[1].element)?-1:1}pn(Cn,`sortByDocumentPosition`);function wn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}pn(wn,`getChildListObserver`);var Tn=Object.defineProperty,En=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),Dn=!!(typeof window<`u`&&window.document&&window.document.createElement);function On(e,t,{checkForDefaultPrevented:n=!0}={}){return En(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}En(On,`composeEventHandlers`);function kn(e){if(!Dn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}En(kn,`getOwnerWindow`);function An(e){if(!Dn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}En(An,`getOwnerDocument`);function jn(e,t=!1){let{activeElement:n}=An(e);if(!n?.nodeName)return null;if(Mn(n)&&n.contentDocument)return jn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=An(n).getElementById(e);if(t)return t}}return n}En(jn,`getActiveElement`);function Mn(e){return e.tagName===`IFRAME`}En(Mn,`isFrame`);var Nn=globalThis?.document?z.useLayoutEffect:()=>{},Pn=Object.defineProperty,Fn=(e,t)=>Pn(e,`name`,{value:t,configurable:!0}),In=z.useEffectEvent,Ln=z.useInsertionEffect;function Rn(e){if(typeof In==`function`)return In(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ln==`function`?Ln(()=>{t.current=e}):Nn(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Fn(Rn,`useEffectEvent`);var zn=Object.defineProperty,Bn=(e,t)=>zn(e,`name`,{value:t,configurable:!0}),Vn=z.useInsertionEffect||Nn;function Hn({prop:e,defaultProp:t,onChange:n=Bn(()=>{},`onChange`),caller:r}){let[i,a,o]=Un({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=Wn(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Bn(Hn,`useControllableState`);function Un({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Vn(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Bn(Un,`useUncontrolledState`);function Wn(e){return typeof e==`function`}Bn(Wn,`isFunction`);var Gn=Symbol(`RADIX:SYNC_STATE`);function Kn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Rn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===Gn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Gn,state:i})},[i,d.state,c]),[h,f]}Bn(Kn,`useControllableStateReducer`);var qn=s(I(),1),Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Zn(e,t){e&&qn.flushSync(()=>e.dispatchEvent(t))}Yn(Zn,`dispatchDiscreteCustomEvent`);var Qn=Object.defineProperty,$n=(e,t)=>Qn(e,`name`,{value:t,configurable:!0});function er(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}$n(er,`useStateMachine`);var tr=$n(e=>{let{present:t,children:n}=e,r=nr(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=ir(r.ref,or(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function nr(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=er(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??ar(r.current),o.current=void 0):a.current=`none`},[s]),Nn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ar(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Nn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=$n(a=>{let o=ar(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=$n(e=>{e.target===t&&(a.current=ar(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ar(t)}else r.current=null;n(e)},[])}}$n(nr,`usePresence`);function rr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$n(rr,`setRef`);function ir(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=rr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():rr(n[e],null)}}},[])}$n(ir,`useStableComposedRefs`);function ar(e){return e?.animationName||`none`}$n(ar,`getAnimationName`);function or(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$n(or,`getElementRef`);var sr=Object.defineProperty,cr=(e,t)=>sr(e,`name`,{value:t,configurable:!0}),lr=z.useId||(()=>void 0),ur=0;function dr(e){let[t,n]=z.useState(lr());return Nn(()=>{e||n(e=>e??String(ur++))},[e]),e||(t?`radix-${t}`:``)}cr(dr,`useId`);var fr=Object.defineProperty,pr=(e,t)=>fr(e,`name`,{value:t,configurable:!0}),mr=`Collapsible`,[hr,gr]=un(mr),[_r,vr]=hr(mr),yr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=Hn({prop:r,defaultProp:i??!1,onChange:o,caller:mr});return(0,B.jsx)(_r,{scope:n,disabled:a,contentId:dr(),open:c,onOpenToggle:z.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(Xn.div,{"data-state":Tr(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),br=`CollapsibleTrigger`,xr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=vr(br,n);return(0,B.jsx)(Xn.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Tr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:On(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Sr=`CollapsibleContent`,Cr=z.forwardRef(pr(function(e,t){let{forceMount:n,...r}=e,i=vr(Sr,e.__scopeCollapsible);return(0,B.jsx)(tr,{present:n||i.open,children:({present:e})=>(0,B.jsx)(wr,{...r,ref:t,present:e})})},`CollapsibleContent`)),wr=z.forwardRef(pr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=vr(Sr,n),[s,c]=z.useState(r),l=z.useRef(null),u=f(t,l),d=z.useRef(0),p=d.current,m=z.useRef(0),h=m.current,g=o.open||s,_=z.useRef(g),v=z.useRef(void 0);return z.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Nn(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,B.jsx)(Xn.div,{"data-state":Tr(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Tr(e){return e?`open`:`closed`}pr(Tr,`getState`);var Er=yr,Dr=xr,Or=Cr,kr=Object.defineProperty,Ar=(e,t)=>kr(e,`name`,{value:t,configurable:!0}),jr=z.createContext(void 0);function Mr(e){let t=z.useContext(jr);return e||t||`ltr`}Ar(Mr,`useDirection`);var Nr=Object.defineProperty,Pr=(e,t)=>Nr(e,`name`,{value:t,configurable:!0}),Fr=`Accordion`,Ir=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[Lr,Rr,zr]=mn(Fr),[Br,Vr]=un(Fr,[zr,gr]),Hr=gr(),Ur=z.forwardRef(Pr(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(Lr.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(Yr,{...a,ref:t}):(0,B.jsx)(Jr,{...i,ref:t})})},`Accordion`)),[Wr,Gr]=Br(Fr),[Kr,qr]=Br(Fr,{collapsible:!1}),Jr=z.forwardRef(Pr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Pr(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=Hn({prop:n,defaultProp:r??``,onChange:i,caller:Fr});return(0,B.jsx)(Wr,{scope:e.__scopeAccordion,value:z.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:z.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(Kr,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(Qr,{...o,ref:t})})})},`AccordionImplSingle`)),Yr=z.forwardRef(Pr(function(e,t){let{value:n,defaultValue:r,onValueChange:i=Pr(()=>{},`onValueChange`),...a}=e,[o,s]=Hn({prop:n,defaultProp:r??[],onChange:i,caller:Fr}),c=z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(Wr,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(Kr,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(Qr,{...a,ref:t})})})},`AccordionImplMultiple`)),[Xr,Zr]=Br(Fr),Qr=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=f(z.useRef(null),t),c=Rr(n),l=Mr(i)===`ltr`,u=On(e.onKeyDown,e=>{if(!Ir.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=Pr(()=>{o=r+1,o>s&&(o=0)},`moveNext`),d=Pr(()=>{o=r-1,o<0&&(o=s)},`movePrev`);switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(Xr,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(Lr.Slot,{scope:n,children:(0,B.jsx)(Xn.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:u})})})},`AccordionImpl`)),$r=`AccordionItem`,[ei,ti]=Br($r),ni=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=Zr($r,n),o=Gr($r,n),s=Hr(n),c=dr(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(ei,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Er,{"data-orientation":a.orientation,"data-state":li(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),ri=`AccordionHeader`,ii=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(ri,n);return(0,B.jsx)(Xn.h3,{"data-orientation":i.orientation,"data-state":li(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),ai=`AccordionTrigger`,oi=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(ai,n),o=qr(ai,n),s=Hr(n);return(0,B.jsx)(Lr.ItemSlot,{scope:n,children:(0,B.jsx)(Dr,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),si=`AccordionContent`,ci=z.forwardRef(Pr(function(e,t){let{__scopeAccordion:n,...r}=e,i=Zr(Fr,n),a=ti(si,n),o=Hr(n);return(0,B.jsx)(Or,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})},`AccordionContent`));function li(e){return e?`open`:`closed`}Pr(li,`getState`);var ui=Ur,di=ni,fi=ii,pi=oi,mi=ci;function hi({...e}){return(0,B.jsx)(ui,{"data-slot":`accordion`,...e})}function gi({className:e,...t}){return(0,B.jsx)(di,{"data-slot":`accordion-item`,className:k(`border-b last:border-b-0`,e),...t})}function _i({className:e,children:t,...n}){return(0,B.jsx)(fi,{className:`flex`,children:(0,B.jsxs)(pi,{"data-slot":`accordion-trigger`,className:k(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,B.jsx)(We,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function vi({className:e,children:t,...n}){return(0,B.jsx)(mi,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,B.jsx)(`div`,{className:k(`pt-0 pb-4`,e),children:t})})}var yi=D(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive bg-destructive-surface text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function bi({className:e,variant:t,...n}){return(0,B.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:k(yi({variant:t}),e),...n})}function xi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-title`,className:k(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function Si({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-description`,className:k(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Ci=Object.defineProperty,wi=(e,t)=>Ci(e,`name`,{value:t,configurable:!0});function Ti(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}wi(Ti,`useCallbackRef`);var Ei=Object.defineProperty,Di=(e,t)=>Ei(e,`name`,{value:t,configurable:!0}),Oi=`Avatar`,[ki,Ai]=un(Oi),ji=[0,()=>void 0],[Mi,Ni]=ki(Oi),Pi=z.forwardRef(Di(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=z.useState(`idle`),[o,s]=zi();return(0,B.jsx)(Mi,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,B.jsx)(Xn.span,{...r,ref:t})})},`Avatar`)),Fi=`AvatarFallback`,Ii=z.forwardRef(Di(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Ni(Fi,n),[o,s]=z.useState(r===void 0);return z.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,B.jsx)(Xn.span,{...i,ref:t}):null},`AvatarFallback`));function Li(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Nn(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Di(e=>{let t=e.currentTarget;n(Ri(t))},`handleLoad`),o=Di(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(Ri(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Di(Li,`useImageLoadingStatus`);function Ri(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Di(Ri,`getImageLoadingStatus`);function zi(){return ji}Di(zi,`useImageCount`);function Bi(e){}Di(Bi,`useUpdateImageCount`);function Vi({className:e,size:t=`default`,...n}){return(0,B.jsx)(Pi,{"data-slot":`avatar`,"data-size":t,className:k(`group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...n})}function Hi({className:e,...t}){return(0,B.jsx)(Ii,{"data-slot":`avatar-fallback`,className:k(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function Ui({className:e,...t}){return(0,B.jsx)(`img`,{className:k(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var Wi=D(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`border border-destructive bg-destructive-surface text-destructive hover:bg-destructive-surface/80 focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Gi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?l:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:k(Wi({variant:t,size:n,className:e})),...i})}function Ki({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function qi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-6`,e),...t})}var Ji=Object.defineProperty,Yi=(e,t)=>Ji(e,`name`,{value:t,configurable:!0}),Xi=`dismissableLayer.update`,Zi=`dismissableLayer.pointerDownOutside`,Qi=`dismissableLayer.focusOutside`,$i,ea=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ta=z.forwardRef(Yi(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=z.useContext(ea),[d,p]=z.useState(null),m=d?.ownerDocument??globalThis?.document,[,h]=z.useState({}),g=f(t,p),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=ia(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=aa(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},m),E=d?b===_.length-1:!1,D=Ti(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return z.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($i=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),oa(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=$i))}},[d,m,n,u]),z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),oa())},[d,u]),z.useEffect(()=>{let e=Yi(()=>h({}),`handleUpdate`);return document.addEventListener(Xi,e),()=>document.removeEventListener(Xi,e)},[]),(0,B.jsx)(Xn.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:On(e.onFocusCapture,T.onFocusCapture),onBlurCapture:On(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:On(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function na(){let e=z.useContext(ea),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Yi(na,`useDismissableLayerSurface`);var ra=Yi(()=>!0,`IS_TRUE`);function ia(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=ra}=t,s=Ti(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Yi(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Yi(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Yi(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Yi(p,`handleInteractionBubble`);let m=Yi(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||sa(Zi,s,p,{discrete:!0})};if(Yi(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Yi(()=>c.current=!0,`onPointerDownCapture`)}}Yi(ia,`usePointerDownOutside`);function aa(e,t=globalThis?.document){let n=Ti(e),r=z.useRef(!1);return z.useEffect(()=>{let e=Yi(e=>{e.target&&!r.current&&sa(Qi,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Yi(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Yi(()=>r.current=!1,`onBlurCapture`)}}Yi(aa,`useFocusOutside`);function oa(){let e=new CustomEvent(Xi);document.dispatchEvent(e)}Yi(oa,`dispatchUpdate`);function sa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Zn(i,a):i.dispatchEvent(a)}Yi(sa,`handleAndDispatchCustomEvent`);var ca=Object.defineProperty,la=(e,t)=>ca(e,`name`,{value:t,configurable:!0}),ua=`focusScope.autoFocusOnMount`,da=`focusScope.autoFocusOnUnmount`,fa={bubbles:!1,cancelable:!0},pa=z.forwardRef(la(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Ti(i),u=Ti(a),d=z.useRef(null),p=f(t,c),m=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ba(d.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ba(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ba(s)};la(e,`handleFocusIn`),la(t,`handleFocusOut`),la(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),z.useEffect(()=>{if(s){xa.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ua,fa);s.addEventListener(ua,l),s.dispatchEvent(t),t.defaultPrevented||(ma(wa(ga(s)),{select:!0}),document.activeElement===e&&ba(s))}return()=>{s.removeEventListener(ua,l),setTimeout(()=>{let t=new CustomEvent(da,fa);s.addEventListener(da,u),s.dispatchEvent(t),t.defaultPrevented||ba(e??document.body,{select:!0}),s.removeEventListener(da,u),xa.remove(m)},0)}}},[s,l,u,m]);let h=z.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ha(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ba(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ba(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,B.jsx)(Xn.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function ma(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ba(r,{select:t}),document.activeElement!==n)return}la(ma,`focusFirst`);function ha(e){let t=ga(e);return[_a(t,e),_a(t.reverse(),e)]}la(ha,`getTabbableEdges`);function ga(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:la(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}la(ga,`getTabbableCandidates`);function _a(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):va(r,{upTo:t})))return r}la(_a,`findVisible`);function va(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}la(va,`isHidden`);function ya(e){return e instanceof HTMLInputElement&&`select`in e}la(ya,`isSelectableInput`);function ba(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ya(e)&&t&&e.select()}}la(ba,`focus`);var xa=Sa();function Sa(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ca(e,t),e.unshift(t)},remove(t){e=Ca(e,t),e[0]?.resume()}}}la(Sa,`createFocusScopesStack`);function Ca(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}la(Ca,`arrayRemove`);function wa(e){return e.filter(e=>e.tagName!==`A`)}la(wa,`removeLinks`);var Ta=Object.defineProperty,Ea=z.forwardRef(((e,t)=>Ta(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);Nn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?qn.createPortal((0,B.jsx)(Xn.div,{...r,ref:t}),o):null},`Portal`)),Da=Object.defineProperty,Oa=(e,t)=>Da(e,`name`,{value:t,configurable:!0}),ka=0,Aa=null;function ja(e){return Ma(),e.children}Oa(ja,`FocusGuards`);function Ma(){z.useEffect(()=>{Aa||={start:Na(),end:Na()};let{start:e,end:t}=Aa;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ka++,()=>{ka===1&&(Aa?.start.remove(),Aa?.end.remove(),Aa=null),ka=Math.max(0,ka-1)}},[])}Oa(Ma,`useFocusGuards`);function Na(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Oa(Na,`createFocusGuard`);var Pa=function(){return Pa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Pa.apply(this,arguments)};function Fa(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ia(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var La=`right-scroll-bar-position`,Ra=`width-before-scroll-bar`,za=`with-scroll-bars-hidden`,Ba=`--removed-body-scroll-bar-size`;function Va(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ha(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ua=typeof window<`u`?z.useLayoutEffect:z.useEffect,Wa=new WeakMap;function Ga(e,t){var n=Ha(t||null,function(t){return e.forEach(function(e){return Va(e,t)})});return Ua(function(){var t=Wa.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Va(e,null)}),i.forEach(function(e){r.has(e)||Va(e,a)})}Wa.set(n,e)},[e]),n}function Ka(e){return e}function qa(e,t){t===void 0&&(t=Ka);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ja(e){e===void 0&&(e={});var t=qa(null);return t.options=Pa({async:!0,ssr:!1},e),t}var Ya=function(e){var t=e.sideCar,n=Fa(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,Pa({},n))};Ya.isSideCarExport=!0;function Xa(e,t){return e.useMedium(t),Ya}var Za=Ja(),Qa=function(){},$a=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:Qa,onWheelCapture:Qa,onTouchMoveCapture:Qa}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Fa(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Ga([n,t]),C=Pa(Pa({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:Za,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Pa(Pa({},C),{ref:S})):z.createElement(v,Pa({},C,{className:c,ref:S}),s))});$a.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$a.classNames={fullWidth:Ra,zeroRight:La};var eo,to=function(){if(eo)return eo;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function no(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=to();return t&&e.setAttribute(`nonce`,t),e}function ro(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function io(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ao=function(){var e=0,t=null;return{add:function(n){e==0&&(t=no())&&(ro(t,n),io(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oo=function(){var e=ao();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},so=function(){var e=oo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},co={left:0,top:0,right:0,gap:0},lo=function(e){return parseInt(e||``,10)||0},uo=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[lo(n),lo(r),lo(i)]},fo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return co;var t=uo(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},po=so(),mo=`data-scroll-locked`,ho=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
2
|
.${za} {
|
|
3
3
|
overflow: hidden ${r};
|
|
4
4
|
padding-right: ${s}px ${r};
|
|
@@ -102,6 +102,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
|
|
|
102
102
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
103
103
|
`))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return Oq(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=TJ.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function FJ(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&IJ(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function IJ(e,t){let n=!1;return ky(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&Th(e)&&(t.options.setext||n))}function LJ(){return{exit:{taskListCheckValueChecked:zJ,taskListCheckValueUnchecked:zJ,paragraph:BJ}}}function RJ(){return{handlers:{paragraph:VJ},join:[HJ]}}function zJ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function BJ(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function VJ(e,t,n,r){if(!t||t.type!==`listItem`||UJ(t)!==e)return TJ.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+TJ.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function HJ(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=UJ(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function UJ(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function WJ(){return[UK(),hq(),bq(),EJ(),LJ()]}function GJ(e){return{extensions:[WK(),gq(e),xq(),PJ(e),RJ()]}}var KJ={tokenize:oY,partial:!0},qJ={tokenize:sY,partial:!0},JJ={tokenize:cY,partial:!0},YJ={tokenize:lY,partial:!0},XJ={tokenize:uY,partial:!0},ZJ={name:`wwwAutolink`,tokenize:iY,previous:dY},QJ={name:`protocolAutolink`,tokenize:aY,previous:fY},$J={name:`emailAutolink`,tokenize:rY,previous:pY},eY={};function tY(){return{text:eY}}for(var nY=48;nY<123;)eY[nY]=$J,nY++,nY===58?nY=65:nY===91&&(nY=97);eY[43]=$J,eY[45]=$J,eY[46]=$J,eY[95]=$J,eY[72]=[$J,QJ],eY[104]=[$J,QJ],eY[87]=[$J,ZJ],eY[119]=[$J,ZJ];function rY(e,t,n){let r=this,i,a;return o;function o(t){return!mY(t)||!pY.call(r,r.previous)||hY(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return mY(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(XJ,u,l)(t):t===45||t===95||Bh(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&zh(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function iY(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!dY.call(r,r.previous)||hY(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(KJ,e.attempt(qJ,e.attempt(JJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function aY(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&fY.call(r,r.previous)&&!hY(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(zh(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Hh(t)||Kh(t)||Yh(t)||Jh(t)?n(t):e.attempt(qJ,e.attempt(JJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function oY(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function sY(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(YJ,c,s)(t):t===null||Kh(t)||Yh(t)||t!==45&&Jh(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function cY(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(YJ,t,a)(o):o===null||Kh(o)||Yh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function lY(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Kh(o)||Yh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Kh(e)||Yh(e)?t(e):r(e)}function a(e){return zh(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):zh(t)?(e.consume(t),o):n(t)}}function uY(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Bh(e)?n(e):t(e)}}function dY(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Kh(e)}function fY(e){return!zh(e)}function pY(e){return!(e===47||mY(e))}function mY(e){return e===43||e===45||e===46||e===95||Bh(e)}function hY(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var gY={tokenize:wY,partial:!0};function _Y(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:xY,continuation:{tokenize:SY},exit:CY}},text:{91:{name:`gfmFootnoteCall`,tokenize:bY},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:vY,resolveTo:yY}}}}function vY(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Rh(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function yY(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function bY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Kh(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Rh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Kh(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function xY(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Kh(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Rh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Kh(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Qh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function SY(e,t,n){return e.check(pg,t,e.attempt(gY,t,n))}function CY(e){e.exit(`gfmFootnoteDefinition`)}function wY(e,t,n){let r=this;return Qh(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function TY(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&jh(o,o.length,0,og(s,e.slice(r+1,n),t)),jh(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),jh(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ag(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ag(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var EY=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){DY(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function DY(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function OY(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function kY(){return{flow:{null:{name:`table`,tokenize:AY,resolveAll:jY}}}}function AY(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):U(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):qh(t)?Qh(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Kh(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,qh(t)?Qh(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return qh(t)?Qh(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||U(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return qh(t)?Qh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||U(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||U(n)?(e.exit(`tableRow`),t(n)):qh(n)?Qh(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Kh(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function jY(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new EY;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(NY(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=MY(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=MY(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=MY(f,t,o,i,n,d)):(o[0]=o[1],d=MY(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&NY(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=OY(t.events,n))}return e}function MY(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},PY(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=PY(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=PY(t.events,n[2]),a=PY(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},PY(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function NY(e,t,n,r,i){let a=[],o=PY(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function PY(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var FY={name:`tasklistCheck`,tokenize:LY};function IY(){return{text:{91:FY}}}function LY(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Kh(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return U(r)?t(r):qh(r)?e.check({tokenize:RY},t,n)(r):n(r)}}function RY(e,t,n){return Qh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zY(e){return Ph([tY(),_Y(),TY(e),kY(),IY()])}var BY={};function VY(e){let t=this,n=e||BY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zY(n)),a.push(WJ()),o.push(GJ(n))}var HY=new Set([`http:`,`https:`,`mailto:`]);function UY(e){try{return new URL(e)}catch{return}}function WY(e){let t=e===void 0?void 0:UY(e)?.protocol;return t!==void 0&&HY.has(t)?e:void 0}var GY={target:`_blank`,rel:`noopener noreferrer`},KY=typeof window>`u`?z.useEffect:z.useLayoutEffect;function qY(e,t){let n=(0,z.useRef)(null);return KY(()=>{let t=n.current;if(!t||e===void 0)return;let r=()=>{t.removeAttribute(`data-otg-table-cut`);let e=t.querySelector(`table`);if(!e||t.scrollHeight<=t.clientHeight)return;let n=e.getBoundingClientRect().top-t.getBoundingClientRect().top;t.toggleAttribute(`data-otg-table-cut`,n<t.clientHeight)};r();let i=t.clientWidth,a=new ResizeObserver(()=>{t.clientWidth!==i&&(i=t.clientWidth,r())});a.observe(t);let o=!0;return document.fonts?.ready.then(()=>{o&&r()}),()=>{o=!1,a.disconnect()}},[e,t]),n}function JY(e){return e.tagName===`img`?{type:`text`,value:String(e.properties?.alt||`image`)}:(e.children&&=e.children.map(JY),e)}function YY(){let e=t=>{t.tagName===`a`?JY(t):t.children?.forEach(e)};return e}function XY({href:e,children:t}){let n=WY(e);return(0,B.jsx)(`a`,{href:n,...n===void 0?{}:GY,children:t})}var ZY={a:({href:e,children:t})=>(0,B.jsx)(XY,{href:e,children:t}),img:({src:e,alt:t})=>(0,B.jsx)(XY,{href:typeof e==`string`?e:void 0,children:t||`image`})},QY=[VY],$Y=[YY];function eX({source:e,clamp:t}){let n=t!==void 0&&Number.isInteger(t)&&t>0?t:void 0,r=qY(n,e),i=n===void 0?void 0:{WebkitLineClamp:n,maxHeight:`calc(${n} * 1lh)`};return(0,B.jsx)(`div`,{className:n===void 0?`otg-markdown`:`otg-markdown otg-markdown--clamped`,ref:r,style:i,children:(0,B.jsx)(Db,{components:ZY,rehypePlugins:$Y,remarkPlugins:QY,children:e})})}function tX({title:e,body:t,badges:n,meta:r,links:i,actions:a,clamp:o,children:s,className:c,...l}){let u=(0,z.useId)();return(0,B.jsx)(`article`,{...l,"aria-labelledby":u,className:c?`otg-card ${c}`:`otg-card`,children:(0,B.jsxs)(`div`,{className:`otg-card__surface`,children:[(0,B.jsxs)(`div`,{className:`otg-card__header`,children:[n!=null&&(0,B.jsx)(`div`,{className:`otg-card__badges`,children:n}),(0,B.jsx)(`h3`,{className:`otg-card__title`,id:u,children:e}),a!=null&&(0,B.jsx)(`div`,{className:`otg-card__actions`,children:a})]}),r!=null&&(0,B.jsx)(`div`,{className:`otg-card__meta`,children:r}),i!=null&&(0,B.jsx)(`div`,{className:`otg-card__links`,children:i}),t?(0,B.jsx)(eX,{source:t,...o===void 0?{}:{clamp:o}}):null,s]})})}var nX=new Map([[`github.com`,`GitHub`],[`linear.app`,`Linear`]]);function rX(e){return nX.get(UY(e)?.hostname??``)??`tracker`}function iX({url:e,label:t,...n}){let r=WY(e);return(0,B.jsx)(`a`,{"aria-label":`Open ${rX(e)} issue ${t}`,...n,href:r,...GY,className:[`otg-source-link`,n.className].filter(Boolean).join(` `),children:t})}function aX({label:e,item:t,busyLabel:n=`${e}…`,reopen:r,sending:i,disabled:a=!1,onPress:o,className:s,control:c={}}){let[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(!1),p=(0,z.useId)(),m=t===void 0?e:`${e}: ${t}`,h=`Why ${e} is unavailable${t===void 0?``:`: ${t}`}`;return r?.available===!1?(0,B.jsxs)(`fieldset`,{"aria-label":`${m} (unavailable)`,className:`${s} human-items-unavailable`,onPointerEnter:()=>f(!0),onPointerLeave:()=>f(!1),children:[(0,B.jsx)(`button`,{"aria-describedby":p,disabled:!0,type:`button`,children:e}),(0,B.jsx)(`sup`,{className:`human-items-why-anchor`,children:(0,B.jsx)(`button`,{...c,"aria-controls":p,"aria-expanded":l,"aria-label":h,className:`human-items-why`,onClick:e=>{e.stopPropagation(),u(e=>!e)},type:`button`,children:`?`})}),(0,B.jsx)(`span`,{className:`human-items-why-tip`,hidden:!(l||d),id:p,role:`tooltip`,children:r.reason})]}):(0,B.jsx)(`button`,{...c,"aria-busy":i,"aria-label":i?void 0:m,className:s,disabled:a,onClick:()=>{i||o()},type:`button`,children:i?n:e})}var oX=15e3;function sX(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(null),{key:m,phase:h,followUp:g}=e,_=h===`sending`||g?.phase===`failed`||g?.phase===`sending`;return(0,z.useLayoutEffect)(()=>{if(f(!1),_)return;let e=setTimeout(()=>f(!0),oX);return()=>clearTimeout(e)},[`${m}:${h}:${g?.kind??``}:${g?.phase??``}`,_]),(0,z.useEffect)(()=>{c(!1),u(``)},[m]),(0,z.useEffect)(()=>{g?.kind===`note`&&g.phase===`done`&&(c(!1),u(``))},[g]),(0,z.useEffect)(()=>{if(!d||r||s)return;let e=p.current?.contains(document.activeElement)??!1;a&&e||t()},[d,r,a,s,t]),(0,z.useEffect)(()=>{if(!r)return;let e=e=>{let t=p.current;t!==null&&e.target instanceof Node&&!t.contains(e.target)&&i(!1)};return document.addEventListener(`pointerover`,e,!0),()=>document.removeEventListener(`pointerover`,e,!0)},[r]),(0,z.useEffect)(()=>{let e=p.current;if(e===null)return;let t=()=>n(e.getBoundingClientRect().height);t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect(),n(0)}},[n]),{holds:{ref:p,onFocus:()=>o(!0),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||o(!1)},onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1)},writing:s,setWriting:c,text:l,setText:u}}var cX={complete:`Completed`,dismiss:`Dismissed`,reopen:`Reopened`},lX={complete:`Completing`,dismiss:`Dismissing`,reopen:`Reopening`},uX={complete:`Reopened`,dismiss:`Restored`,reopen:`Reopened`};function dX(e){let{action:t,title:n,phase:r,error:i,followUp:a}=e;if(r===`failed`)return`Not ${cX[t].toLowerCase()}: ${n}. ${i??``}`.trim();let o=uX[t],s=t===`dismiss`?`Reason`:`Comment`;return a?.phase===`failed`?a.kind===`undo`?`Not ${o.toLowerCase()}: ${n}. ${a.error??``}`.trim():`${s} not saved: ${n}. ${a.error??``}`.trim():a?.phase===`done`?a.kind===`undo`?`${o}: ${n}`:`${s} saved: ${n}`:r===`sending`?`${lX[t]}: ${n}…`:`${cX[t]}: ${n}`}function fX({toast:e,onUndo:t,onNote:n,onClose:r,onRoom:i}){let{holds:a,writing:o,setWriting:s,text:c,setText:l}=sX(e,r,i),u=(0,z.useId)(),{action:d,phase:f,followUp:p}=e,m=f===`failed`||p?.phase===`failed`,h=f!==`failed`&&d!==`reopen`,g=p?.kind===`undo`&&p.phase===`done`,_=d===`dismiss`?`Add reason`:`Add comment`,v=d===`dismiss`?`Reason`:`Comment`,y=p?.kind===`note`&&p.phase===`sending`,b=p?.kind===`undo`&&p.phase===`sending`;return(0,B.jsxs)(`section`,{"aria-label":`Action result`,className:`human-items-toast`,"data-phase":p?.phase??f,"data-tone":m?`failure`:`success`,...a,children:[(0,B.jsx)(`p`,{className:`human-items-toast-message`,role:m?`alert`:`status`,children:dX(e)}),p?.kind===`note`&&p.saved!==void 0&&(0,B.jsx)(`blockquote`,{"aria-label":`Saved ${v.toLowerCase()}`,className:`human-items-toast-saved`,children:p.saved}),h&&!g&&(0,B.jsxs)(`div`,{className:`human-items-toast-actions`,children:[(0,B.jsx)(aX,{className:`human-items-toast-action`,disabled:b,label:d===`dismiss`?`Restore`:`Reopen`,onPress:t,reopen:e.reopen,sending:b}),!o&&(0,B.jsx)(`button`,{className:`human-items-toast-action`,onClick:()=>s(!0),type:`button`,children:_})]}),h&&!g&&o&&(0,B.jsxs)(`form`,{className:`human-items-toast-note`,onSubmit:e=>{e.preventDefault(),c.trim()!==``&&n(c)},children:[(0,B.jsx)(`label`,{className:`sr-only`,htmlFor:u,children:v}),(0,B.jsx)(`input`,{autoFocus:!0,id:u,onChange:e=>l(e.target.value),placeholder:`${v}, then Enter`,readOnly:y,value:c}),(0,B.jsx)(`button`,{"aria-busy":y,className:`human-items-toast-action`,disabled:y,type:`submit`,children:y?`Sending…`:p?.kind===`note`&&p.phase===`failed`?`Send again`:`Send`})]}),(0,B.jsx)(`button`,{"aria-label":`Close`,className:`human-items-toast-close`,onClick:r,type:`button`,children:(0,B.jsx)(Dt,{"aria-hidden":`true`,size:14})})]})}var pX=eA.map(e=>({wire:e,label:tA[e]}));function mX(e){return tA[e.priority]}function hX(e){return e.kind===`task`?`Task`:`Question`}var gX={open:`Open`,answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`,expired:`Expired`},_X=[`open`,`answered`,`completed`,`dismissed`,`expired`],vX=_X.map(e=>({state:e,label:gX[e]}));function yX(e){return gX[e.state]}function bX(e){return e.state===`open`&&e.block.scope!==`nothing`}function xX(e){return e===1?`1 step`:`${e} steps`}function SX(e){let{item:t,blocked:n}=e;if(!bX(t))return[];switch(t.block.scope){case`host`:return[`blocks all work on this host`];case`plan`:return[`blocks all of ${t.block.plan}`];case`work`:return n.plans.map(({plan:e,count:t})=>`blocks ${xX(t)} in ${e}`);default:return[]}}function CX(e){let t=SX(e);return e.item.block.scope===`work`?e.blocked.plans.map(({count:e,preview:n},r)=>{let i=e-n.length,a=n.map(({node:e})=>e).join(`, `);return`${t[r]}: ${a}${i>0?` +${i} more`:``}`}).join(`; `):t.join(`; `)}function wX(e){if(e.block.scope===`host`)return`host`;let{plan:t,run:n,session:r}=e.owner;return t!==null&&n!==null?`plan ${t} / run ${n}`:t===null?n===null?`session ${r}`:`run ${n}`:`plan ${t}`}function TX(e){let t=SX(e);if(e.item.block.scope!==`work`)return t.map(t=>({phrase:t,nodes:e.nodes}));let n=0;return e.blocked.plans.map(({count:r},i)=>{let a=e.nodes.slice(n,n+r);return n+=r,{phrase:t[i]??``,nodes:a}})}function EX(e){return e===`user`?`you`:`the manager`}function DX(e){return e.resolution?.provenance??`manager`}var OX={"human-item-raised":`Raised`,"human-item-answered":`Answered`,"human-item-completed":`Completed`,"human-item-dismissed":`Dismissed`,"human-item-auto-resolved":`Resolved`,"human-item-reopened":`Reopened`,"human-item-noted":`Note`,"human-item-expired":`Expired`};function kX(e){let t=e.action===`human-item-expired`&&e.actor===`engine`?`the engine`:EX(e.provenance);return`${OX[e.action]} by ${t}`}var AX=60;function jX(e,t){return e===1?`${t}`:`${e} ${t}s`}function MX(e){return e%3600==0?jX(e/3600,`hour`):e%60==0?jX(e/60,`minute`):jX(e,`second`)}function NX(e){return e.join(` `)}function PX(e){switch(e.when){case`time`:return e.at===void 0?`${MX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return e.on===`settled`?`when run ${e.run} settles`:`when run ${e.run} ends`;case`node`:return`when step ${e.node} of run ${e.run} settles`;case`check`:return`when its check ${NX(e.command)} says so, checked every ${MX(e.interval_seconds??AX)}`}}function FX(e){let t=e.expiry??[];if(!(e.state!==`open`||t.length===0))return`Expires ${t.map(PX).join(`, or `)}`}function IX(e){switch(e.when){case`time`:return e.at===void 0?`${MX(e.after_seconds??0)} after it was raised`:`at ${me(e.at)}`;case`run`:return`run ${e.run} ${e.on===`settled`?`settled`:`ended`}`;case`node`:return`step ${e.node} of run ${e.run} settled`;case`check`:return`its check ${NX(e.command)}`}}function LX(e){return e.charAt(0).toUpperCase()+e.slice(1)}function RX(e){let{resolution:t}=e;if(e.state!==`expired`||t===null)return;let n=t.condition??void 0;return{reason:LX(t.reason??``),held:n===void 0?``:LX(IX(n))}}function zX(e){switch(e.outcome){case`holds`:return`expired`;case`not-yet`:return`not yet`;case`failed`:return`failed: ${e.detail??``}`}}function BX(e){return e.item.state===`open`?(e.checks??[]).filter(({outcome:e})=>e===`failed`):[]}function VX(e){return(e.item.expiry??[]).map((t,n)=>({key:`${n}`,words:LX(PX(t)),last:e.checks?.find(e=>e.condition===n)}))}function HX(e){let{resolution:t}=e;if(t!==null){if(e.state===`dismissed`&&t.reason!==null)return{label:`Reason`,text:t.reason};if(e.state===`completed`&&t.text!==null)return{label:`Comment`,text:t.text}}}function UX(e){let{item:t}=e,{plan:n,run:r}=t.owner,i=SX(e).join(`; `),a={answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`}[t.state],o=HX(t),s=RX(t);return[{label:`Priority`,value:mX(t)},{label:`Kind`,value:hX(t)},{label:`State`,value:yX(t)},{label:`Source`,value:wX(t)},...n===null?[]:[{label:`Plan`,value:n}],...r===null?[]:[{label:`Run`,value:r}],{label:`Blocks`,value:i===``?`Nothing`:i},{label:`Raised`,at:t.created_at},...a===void 0?[]:[{label:a,at:t.updated_at,party:EX(DX(t))}],...o===void 0?[]:[{label:o.label,value:o.text}],...s===void 0?[]:[{label:`Expired`,at:t.updated_at,party:`the engine`},{label:`Reason`,value:s.reason},{label:`Condition that held`,value:s.held}]]}function WX(e,t){return e.find(e=>e===t)}var GX=[``,`task`,`question`],KX=[``,`yes`,`no`],qX=[``,...eA],JX=_X,YX=[``,`session`,`run`,`plan`,`host`],XX={kind:``,blocking:``,priority:``,state:`open`,source:``,sourceId:``};function ZX(e){let t=e.sourceId.trim();return{...e.kind===``?{}:{kind:e.kind},...e.blocking===``?{}:{blocking:e.blocking===`yes`},...e.priority===``?{}:{priority:e.priority},...e.state===`open`?{}:{state:e.state},...e.source===`host`?{host:!0}:{},...e.source!==``&&e.source!==`host`&&t!==``?{[e.source]:t}:{}}}function QX(e){return Number(e.kind!==XX.kind)+Number(e.blocking!==XX.blocking)+Number(e.priority!==XX.priority)+Number(e.state!==XX.state)+Number(e.source!==XX.source)}var $X=[`priority`,`kind`,`source`,`blocking`,`none`],eZ=`priority`,tZ=[{value:`priority`,label:`Priority`},{value:`kind`,label:`Kind`},{value:`source`,label:`Source`},{value:`blocking`,label:`Blocking`},{value:`none`,label:`None`}],nZ=[`default`,`newest`,`oldest`],rZ=`default`,iZ=[{value:`default`,label:`Default`},{value:`newest`,label:`Newest first`},{value:`oldest`,label:`Oldest first`}];function aZ(e,t){if(t==="default")return e;let n=t===`newest`?-1:1;return e.map(e=>({view:e,at:Date.parse(e.item.created_at)})).sort((e,t)=>n*(e.at-t.at)).map(({view:e})=>e)}function oZ(e){if(typeof e!=`object`||!e)return;let t=t=>{let n=Reflect.get(e,t);return typeof n==`string`?n:``},n=WX(JX,t(`state`));if(n!==void 0)return{kind:WX(GX,t(`kind`))??``,blocking:WX(KX,t(`blocking`))??``,priority:WX(qX,t(`priority`))??``,state:n,source:WX(YX,t(`source`))??``,sourceId:t(`sourceId`)}}function sZ(e,t){let{item:n}=e;switch(t){case`priority`:return{key:n.priority,label:mX(n),rank:eA.indexOf(n.priority)};case`kind`:return{key:n.kind,label:hX(n),rank:n.kind===`task`?0:1};case`blocking`:return bX(n)?{key:`blocking`,label:`Blocking`,rank:0}:{key:`not-blocking`,label:`Not blocking`,rank:1};case`source`:{let e=wX(n);return{key:e,label:`Source: ${e}`,rank:0}}}}function cZ(e,t,n=rZ){if(t===`none`)return[{key:`all`,items:aZ(e,n)}];let r=new Map;return e.forEach((e,n)=>{let{key:i,label:a,rank:o}=sZ(e,t),s=r.get(i);s?s.items.push(e):r.set(i,{label:a,rank:o,first:n,items:[e]})}),[...r.entries()].sort(([,e],[,t])=>e.rank-t.rank||e.first-t.first).map(([e,{label:t,items:r}])=>({key:e,label:t,items:aZ(r,n)}))}function lZ({answers:e,onRoom:t}){let n=(0,z.useRef)(null),{count:r,remaining:i,sending:a,sendError:o,notices:s}=e,c=r>0||o!==void 0||s.length>0;return(0,z.useEffect)(()=>{let e=n.current;if(e===null)return;let r=()=>t(e.getBoundingClientRect().height);r();let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect(),t(0)}},[t,c]),c?(0,B.jsxs)(`section`,{"aria-label":`Drafted answers`,className:`human-items-send`,ref:n,children:[r>0&&(0,B.jsxs)(`div`,{className:`human-items-send-bar`,children:[(0,B.jsx)(`button`,{"aria-busy":a,className:`human-items-send-action`,"data-primary":`true`,disabled:a,onClick:()=>void e.send(),type:`button`,children:a?`Sending…`:`Send ${r} ${r===1?`answer`:`answers`}`}),(0,B.jsx)(`button`,{className:`human-items-send-action`,disabled:a,onClick:e.discard,type:`button`,children:`Discard`}),i>0&&(0,B.jsxs)(`span`,{className:`human-items-send-more`,children:[i,` more after this`]})]}),o!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent, and your drafts are kept: `,o]}),s.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Not sent`,className:`human-items-not-sent`,children:s.map(t=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`p`,{children:[(0,B.jsxs)(`strong`,{children:[`Not sent: `,t.title]}),` (`,t.reason,`)`]}),t.choiceTitle!==void 0&&(0,B.jsxs)(`p`,{children:[`Choice: `,t.choiceTitle]}),t.text!==void 0&&(0,B.jsx)(eX,{source:t.text}),(0,B.jsx)(`button`,{className:`human-items-send-action`,onClick:()=>e.clearNotice(t.key),type:`button`,children:`Clear`})]},t.key))})]}):null}var uZ=`answered or dismissed elsewhere`,dZ=`onepipeline-ui.human-items.draft.`,fZ=/^[^\s/?#]+$/u,pZ=J({title:K(),choice:K().optional(),choiceTitle:K().optional(),text:K().optional()});function mZ(){try{let e={};for(let t=0;t<window.localStorage.length;t+=1){let n=window.localStorage.key(t);if(n===null||!n.startsWith(dZ))continue;let r=n.slice(33),i=hZ(window.localStorage.getItem(n));i!==void 0&&fZ.test(r)&&(e[r]=i)}return e}catch{return}}function hZ(e){if(e!==null)try{let t=pZ.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}}function gZ(e,t){try{t===void 0?window.localStorage.removeItem(`${dZ}${e}`):window.localStorage.setItem(`${dZ}${e}`,JSON.stringify(t))}catch{}}function _Z(e){return e!==void 0&&e.trim()!==``}function vZ(e){return e.choice!==void 0||_Z(e.text)}function yZ(e,t){return{id:e,...t.choice===void 0?{}:{choice:t.choice},..._Z(t.text)?{text:t.text}:{}}}function bZ(e){return e.kind===`conflict`?e.reason:`human items are unavailable on this host`}async function xZ(e,t){try{return(await e.getHumanItem(t)).item.state!==`open`}catch(e){return e instanceof EN&&e.status===404||void 0}}function SZ(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function CZ(e,t,n,r,i,a){let[o,s]=(0,z.useState)(()=>mZ()??{}),[c,l]=(0,z.useState)({}),[u,d]=(0,z.useState)([]),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(),g=(0,z.useRef)(!1),_=(0,z.useRef)(0),v=(0,z.useRef)(o);v.current=o;let y=(0,z.useRef)(new Set),b=(0,z.useRef)(new Set),x=(0,z.useRef)(0),S=(0,z.useCallback)((e,t)=>{gZ(e,t),s(n=>t===void 0?SZ(n,e):{...n,[e]:t}),l(t=>SZ(t,e)),h(void 0)},[]),C=(0,z.useCallback)((e,t)=>{let n=v.current[e];if(n===void 0)return;gZ(e,void 0),s(t=>SZ(t,e)),l(t=>SZ(t,e)),_.current+=1;let r=_.current;d(e=>[...e,{...n,key:r,reason:t}])},[]),w=(0,z.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{text:i}=v.current[n]??{},a={title:r,...v.current[n]?.choice===t.id?{}:{choice:t.id,choiceTitle:t.title},...i===void 0?{}:{text:i}};S(n,vZ(a)?a:void 0)},[S]),T=(0,z.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{choice:i,choiceTitle:a}=v.current[n]??{},o={title:r,...i===void 0?{}:{choice:i},...a===void 0?{}:{choiceTitle:a},...t===``?{}:{text:t}};S(n,o.choice===void 0&&t===``?void 0:o)},[S]),E=Object.entries(o).filter(([,e])=>vZ(e)),D=E.slice(0,50),O=(0,z.useCallback)(async(t,n)=>{await xZ(e,t)===!0?C(t,n):l(e=>({...e,[t]:n}))},[e,C]),k=(0,z.useCallback)(async()=>{if(g.current)return;let t=mZ(),n=D.filter(([e])=>t!==void 0&&t[e]===void 0);for(let[e]of n)s(t=>SZ(t,e));let r=D.flatMap(([e,t])=>n.some(([t])=>t===e)?[]:[yZ(e,t)]);if(r.length!==0){g.current=!0,p(!0),h(void 0),a(r.map(({id:e})=>e));try{let t=await e.answerHumanItems(r);for(let{item:e}of t.answered)gZ(e.item.id,void 0),s(t=>SZ(t,e.item.id)),l(t=>SZ(t,e.item.id));i(t.answered),await Promise.all(t.refused.map(({id:e,refusal:t})=>O(e,bZ(t))))}catch(e){h(e instanceof Error?e.message:String(e))}finally{g.current=!1,p(!1),a([])}}},[D,e,i,a,O]),A=(0,z.useCallback)(()=>{for(let e of Object.keys(v.current))gZ(e,void 0);s({}),l({}),h(void 0)},[]),j=(0,z.useCallback)(e=>{d(t=>t.filter(t=>t.key!==e))},[]);return(0,z.useEffect)(()=>{y.current.clear(),x.current+=1},[n]),(0,z.useEffect)(()=>{if(t===void 0||f)return;for(let e of Object.keys(o)){if(r(e))continue;let i=t.find(({item:t})=>t.id===e);if(i!==void 0){y.current.delete(e),i.item.state!==`open`&&C(e,uZ);continue}y.current.has(e)||b.current.has(e)||n(e)}function n(t){let r=x.current;b.current.add(t),xZ(e,t).then(e=>{if(e===!1&&r!==x.current&&!g.current){n(t);return}b.current.delete(t),!g.current&&(e===!0?C(t,uZ):e===!1&&y.current.add(t))})}},[e,o,t,C,f,r]),{drafts:o,refusals:c,notices:u,sending:f,sendError:m,count:D.length,remaining:E.length-D.length,pressChoice:w,setText:T,retire:C,send:k,discard:A,clearNotice:j}}function wZ(e,t,n,r=String){let[i,a]=(0,z.useState)(()=>{try{let r=window.localStorage.getItem(e);return(r===null?void 0:t(r))??n}catch{return n}});return[i,(0,z.useCallback)(t=>{a(t);try{window.localStorage.setItem(e,r(t))}catch{}},[e,r])]}var TZ=`onepipeline-ui.human-items.filters`;function EZ(e){try{return oZ(JSON.parse(e))}catch{return}}function DZ(e){let[t,n]=wZ(TZ,EZ,XX,JSON.stringify),[r,i]=(0,z.useState)(),a=(0,z.useMemo)(()=>{if(!e)return;let n=ZX(t);return{type:`human-items`,...Object.keys(n).length===0?{}:{filter:n},...r===void 0?{}:{item:r}}},[e,JSON.stringify(ZX(t)),r]);return(0,z.useEffect)(()=>{e||i(void 0)},[e]),{choice:t,setChoice:n,selectedId:r,setSelectedId:i,view:a}}function OZ(e,t,n,r,i=``){let[a,o]=(0,z.useState)({}),[s,c]=(0,z.useState)(),[l,u]=(0,z.useState)([]),[d,f]=(0,z.useState)({}),[p,m]=(0,z.useState)({}),[h,g]=(0,z.useState)(),_=(0,z.useRef)(new Set),v=(0,z.useRef)(new Map),y=(0,z.useRef)(0),b=(0,z.useRef)(void 0);b.current=s;let x=t.items,S=(0,z.useRef)(i);S.current=i,(0,z.useEffect)(()=>{m(e=>Object.keys(e).length===0?e:{})},[i]);let C=(0,z.useMemo)(()=>{if(x===void 0)return;let e=x.flatMap(e=>{let t=d[e.item.id];if(t!==void 0)return[t.view];let n=p[e.item.id]?.view;return n===void 0||!AZ(n,e)?[e]:n.item.state===r?[n]:[]}),t=t=>e.some(({item:e})=>e.id===t);for(let{view:n,at:a,filter:o}of Object.values(p))o===i&&n.item.state===r&&!t(n.item.id)&&e.splice(Math.min(a,e.length),0,n);for(let{view:n,at:r}of[...l,...Object.values(d)])t(n.item.id)||e.splice(Math.min(r,e.length),0,n);return e},[x,l,p,d,r,i]);(0,z.useEffect)(()=>{x!==void 0&&m(e=>{let t=Object.entries(e).filter(([e,{view:t}])=>{let n=x.find(({item:t})=>t.id===e);return n===void 0?t.item.state===r:AZ(t,n)});return t.length===Object.keys(e).length?e:Object.fromEntries(t)})},[x,r]);let w=t.error===void 0&&t.item===n?t.detail:void 0,T=n===void 0?void 0:p[n]?.view,E=w&&T!==void 0&&AZ(T,{item:w.item})?{...w,item:T.item,reopen:T.reopen}:w,D=(0,z.useRef)(x);D.current=x;let O=CZ(e,x,i,(0,z.useCallback)(e=>_.current.has(e),[]),(0,z.useCallback)(e=>{let t=S.current;m(n=>{let r={...n};for(let{item:n}of e){let e=Math.max(0,D.current?.findIndex(({item:e})=>e.id===n.item.id)??0);r[n.item.id]={view:n,at:e,filter:t}}return r});let n=new Set(e.map(({item:e})=>e.item.id));u(e=>e.filter(({view:e})=>!n.has(e.item.id)))},[]),(0,z.useCallback)(e=>{let t=D.current??[];u(e.flatMap(e=>{let n=t.findIndex(({item:t})=>t.id===e),r=t[n];return r===void 0?[]:[{view:r,at:n}]}))},[])),{retire:k}=O,A=(0,z.useCallback)((e,t)=>c(n=>n?.key===e?t(n):n),[]),j=(0,z.useCallback)((t,n,r)=>{let{id:i,title:a}=t.item;if(_.current.has(i))return;_.current.add(i);let s=++y.current,l=S.current,u=Math.max(0,D.current?.findIndex(({item:e})=>e.id===i)??0);o(e=>({...e,[i]:{pending:n.action}})),f(e=>({...e,[i]:{view:t,at:u}})),c({key:s,id:i,title:a,action:n.action,phase:`sending`});let d=n.action===`complete`?e.completeHumanItem(i):n.action===`dismiss`?e.dismissHumanItem(i,n.reason):e.reopenHumanItem(i);v.current.set(s,d),d.then(e=>{m(t=>({...t,[i]:{view:e.item,at:u,filter:l}})),o(e=>({...e,[i]:{}})),n.action!==`reopen`&&k(i,`dismissed here`),r?.(),A(s,t=>({...t,phase:`done`,reopen:e.item.reopen}))},e=>{let t=MZ(e);o(e=>({...e,[i]:{error:t}})),A(s,e=>({...e,phase:`failed`,error:t})),g({id:i})}).finally(()=>{_.current.delete(i),f(kZ(i))})},[e,A,k]),M=(0,z.useCallback)((e,t)=>{let n=b.current;if(n===void 0)return;let r=v.current.get(n.key);if(r===void 0||n.followUp?.phase===`sending`)return;let{key:i,id:a}=n,o=S.current;A(i,t=>({...t,followUp:{kind:e,phase:`sending`}})),r.then(n=>{if(e===`undo`&&!n.item.reopen.available){A(i,e=>({...e,followUp:void 0}));return}t(a).then(t=>{m(e=>({...e,[a]:{view:t.item,at:e[a]?.at??0,filter:o}}));let n=e===`note`?jZ(t.item.item):void 0;A(i,r=>({...r,reopen:t.item.reopen,followUp:{kind:e,phase:`done`,...n===void 0?{}:{saved:n}}}))},t=>A(i,n=>({...n,followUp:{kind:e,phase:`failed`,error:MZ(t)}})))},()=>A(i,e=>({...e,followUp:void 0})))},[A]),N=(0,z.useCallback)(()=>M(`undo`,t=>e.reopenHumanItem(t)),[e,M]),P=(0,z.useCallback)(t=>M(`note`,n=>e.noteHumanItem(n,t)),[e,M]),F=(0,z.useCallback)(()=>c(void 0),[]);return{items:C,listError:n===void 0||C===void 0?t.error:void 0,detail:E===null?void 0:E,gone:n!==void 0&&E===null,detailError:n===void 0?void 0:t.error,writes:a,answers:O,write:j,toast:s,undo:N,note:P,closeToast:F,returned:h}}function kZ(e){return t=>t[e]===void 0?t:Object.fromEntries(Object.entries(t).filter(([t])=>t!==e))}function AZ(e,t){return Date.parse(e.item.updated_at)>Date.parse(t.item.updated_at)}function jZ(e){let{resolution:t}=e;if(t!==null)return(e.state===`dismissed`?t.reason:t.text)??void 0}function MZ(e){return e instanceof Error?e.message:String(e)}var NZ=`onepipeline-ui.human-items.group-by`,PZ=`onepipeline-ui.human-items.sort`,FZ=e=>WX($X,e),IZ=e=>WX(nZ,e);function LZ(){let[e,t]=wZ(NZ,FZ,eZ),[n,r]=wZ(PZ,IZ,rZ);return{groupBy:e,setGroupBy:t,sort:n,setSort:r}}var RZ=`data-card-action`,zZ=4;function BZ({client:e,live:t,choice:n,setChoice:r,selectedId:i,setSelectedId:a}){let o=OZ(e,t,i,n.state,JSON.stringify(n)),{groupBy:s,setGroupBy:c,sort:l,setSort:u}=LZ(),[d,f]=(0,z.useState)(0),[p,m]=(0,z.useState)(0),h=(0,z.useRef)(null),g=o.items?.find(({item:e})=>e.id===i)??o.detail,_=(0,z.useRef)(void 0);g===void 0?_.current?.item.id!==i&&(_.current=void 0):_.current=g;let v=(0,z.useRef)(i);v.current=i;let y=(e,t)=>{o.write(e,t,()=>{v.current===e.item.id&&a(void 0)})},b=o.returned;(0,z.useEffect)(()=>{b!==void 0&&h.current?.querySelector(`[data-item-id="${CSS.escape(b.id)}"]`)?.scrollIntoView({block:`nearest`})},[b]);let x=cZ(o.items??[],s,l);return(0,B.jsxs)(`section`,{"aria-label":`Action items`,className:`human-items-page`,"data-detail-open":i!==void 0,style:VZ(d,p),children:[(0,B.jsx)(WZ,{choice:n,groupBy:s,onChange:r,onGroupBy:c,onSort:u,sort:l}),(0,B.jsxs)(`div`,{className:`human-items-body`,children:[(0,B.jsxs)(`section`,{"aria-label":`Action item list`,className:`human-items-list`,children:[o.listError&&(0,B.jsx)(`p`,{role:`alert`,children:o.listError}),o.items===void 0&&!o.listError&&(0,B.jsx)(`p`,{role:`status`,children:`Reading action items…`}),o.items?.length===0&&(0,B.jsx)(`p`,{role:`status`,children:`No action items match these filters.`}),(0,B.jsx)(`div`,{className:`human-items-groups`,onKeyDown:e=>UZ(e,h.current),ref:h,children:x.map(e=>(0,B.jsx)(HZ,{answering:o.answers,group:e,groupBy:s,onSelect:a,onWrite:y,selectedId:i,writes:o.writes},e.key))}),(o.items?.length??0)>0&&(0,B.jsx)(`button`,{className:`card-actions-entry`,onFocus:()=>h.current?.querySelector(`[${RZ}]`)?.focus(),type:`button`,children:`Card actions: use the arrow keys`})]}),i!==void 0&&(0,B.jsx)(lQ,{answering:o.answers,error:o.detailError,detail:o.detail,gone:o.gone,lastShown:_.current,onClose:()=>a(void 0),onWrite:y,state:o.writes[i],view:g})]}),(0,B.jsx)(lZ,{answers:o.answers,onRoom:m}),o.toast&&(0,B.jsx)(fX,{onClose:o.closeToast,onNote:o.note,onRoom:f,onUndo:o.undo,toast:o.toast})]})}function VZ(e,t){return{"--toast-room":`${e}px`,"--send-room":`${t}px`}}function HZ({group:e,groupBy:t,selectedId:n,writes:r,answering:i,onSelect:a,onWrite:o}){let s=(0,z.useId)(),c=e.items.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(JZ,{answering:i,groupBy:t,onSelect:()=>a(e.item.id),onWrite:o,selected:e.item.id===n,state:r[e.item.id],view:e})},e.item.id));return e.label===void 0?(0,B.jsx)(`ul`,{"aria-label":`Action items`,children:c}):(0,B.jsxs)(`section`,{"aria-labelledby":s,className:`human-items-group`,children:[(0,B.jsxs)(`h2`,{className:`human-items-group-heading`,id:s,children:[e.label,` `,(0,B.jsxs)(`span`,{className:`human-items-group-count`,children:[`(`,e.items.length,`)`]})]}),(0,B.jsx)(`ul`,{"aria-labelledby":s,children:c})]})}function UZ(e,t){let n=e.target;if(t===null||!(n instanceof HTMLElement)||!n.hasAttribute(RZ))return;let r=[...t.querySelectorAll(`[${RZ}]`)],i=r.indexOf(n),a=e.key===`ArrowRight`||e.key===`ArrowDown`?r[Math.min(i+1,r.length-1)]:e.key===`ArrowLeft`||e.key===`ArrowUp`?r[Math.max(i-1,0)]:e.key===`Home`?r[0]:e.key===`End`?r.at(-1):void 0;a!==void 0&&(e.preventDefault(),a.focus())}function WZ({choice:e,groupBy:t,sort:n,onChange:r,onGroupBy:i,onSort:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(!1),l=(t,n)=>r({...e,[t]:n}),u=e.source!==``&&e.source!==`host`,d=QX(e)+Number(t!==eZ);return(0,B.jsxs)(`div`,{className:`human-items-controls`,"data-open":s,children:[(0,B.jsxs)(`button`,{"aria-controls":`${o}-filters`,"aria-expanded":s,"aria-label":d>0?`Filters, ${d} changed`:`Filters`,className:`human-items-filters-toggle`,onClick:()=>c(e=>!e),type:`button`,children:[(0,B.jsx)(xt,{"aria-hidden":`true`,size:14}),`Filters`,d>0&&(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`human-items-filters-count`,children:d})]}),(0,B.jsx)(`select`,{"aria-label":`Sort`,className:`human-items-sort-toggle`,onChange:e=>a(GZ(e.target.value)),value:n,children:iZ.map(({value:e,label:t})=>(0,B.jsxs)(`option`,{value:e,children:[`Sort: `,t]},e))}),(0,B.jsxs)(`fieldset`,{className:`human-items-filters`,id:`${o}-filters`,children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Filter action items`}),(0,B.jsx)(`label`,{htmlFor:`${o}-group`,children:`Group by`}),(0,B.jsx)(`select`,{id:`${o}-group`,onChange:e=>i(WX($X,e.target.value)??`priority`),value:t,children:tZ.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{className:`human-items-sort-label`,htmlFor:`${o}-sort`,children:`Sort`}),(0,B.jsx)(`select`,{className:`human-items-sort-select`,id:`${o}-sort`,onChange:e=>a(GZ(e.target.value)),value:n,children:iZ.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-kind`,children:`Kind`}),(0,B.jsxs)(`select`,{id:`${o}-kind`,onChange:e=>l(`kind`,WX(GX,e.target.value)??``),value:e.kind,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),(0,B.jsx)(`option`,{value:`task`,children:`Task`}),(0,B.jsx)(`option`,{value:`question`,children:`Question`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-blocking`,children:`Blocking`}),(0,B.jsxs)(`select`,{id:`${o}-blocking`,onChange:e=>l(`blocking`,WX(KX,e.target.value)??``),value:e.blocking,children:[(0,B.jsx)(`option`,{value:``,children:`Any`}),(0,B.jsx)(`option`,{value:`yes`,children:`Yes`}),(0,B.jsx)(`option`,{value:`no`,children:`No`})]}),(0,B.jsx)(`label`,{htmlFor:`${o}-priority`,children:`Priority`}),(0,B.jsxs)(`select`,{id:`${o}-priority`,onChange:e=>l(`priority`,WX(qX,e.target.value)??``),value:e.priority,children:[(0,B.jsx)(`option`,{value:``,children:`Any priority`}),pX.map(({wire:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))]}),(0,B.jsx)(`label`,{htmlFor:`${o}-state`,children:`State`}),(0,B.jsx)(`select`,{id:`${o}-state`,onChange:e=>l(`state`,WX(JX,e.target.value)??`open`),value:e.state,children:vX.map(({state:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${o}-source`,children:`Source`}),(0,B.jsxs)(`select`,{id:`${o}-source`,onChange:e=>l(`source`,WX(YX,e.target.value)??``),value:e.source,children:[(0,B.jsx)(`option`,{value:``,children:`Any source`}),(0,B.jsx)(`option`,{value:`session`,children:`Session`}),(0,B.jsx)(`option`,{value:`run`,children:`Run`}),(0,B.jsx)(`option`,{value:`plan`,children:`Plan`}),(0,B.jsx)(`option`,{value:`host`,children:`Host`})]}),u&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`${o}-source-id`,children:`Source identifier`}),(0,B.jsx)(`input`,{id:`${o}-source-id`,onChange:e=>l(`sourceId`,e.target.value),placeholder:`${e.source} id`,type:`search`,value:e.sourceId})]})]})]})}function GZ(e){return WX(nZ,e)??`default`}function KZ(e){return e.target instanceof Element&&e.target.closest(`a, button, textarea, input, select, [data-long-pressed="true"]`)===null}function qZ({view:e,groupBy:t}){let{item:n}=e;return(0,B.jsxs)(B.Fragment,{children:[n.state===`expired`&&(0,B.jsx)(`span`,{className:`human-item-expired-badge`,children:yX(n)}),t!==`priority`&&(0,B.jsx)(`span`,{className:`human-item-priority`,"data-priority":n.priority,children:mX(n)}),t!==`kind`&&(0,B.jsx)(`span`,{className:`human-item-kind`,children:hX(n)}),t!==`blocking`&&bX(n)&&(0,B.jsx)(`span`,{className:`human-item-blocking`,children:`Blocking`})]})}function JZ({view:e,groupBy:t,selected:n,state:r,answering:i,onSelect:a,onWrite:o}){let{item:s}=e,c=s.state===`open`,l=s.state===`expired`,u=CX(e),d=[{key:`raised`,part:(0,B.jsx)($Z,{at:s.created_at})},...c||l?[]:[{key:`state`,part:yX(s)}],...u?[{key:`blocked`,part:u}]:[],...t===`source`?[]:[{key:`source`,part:`Source: ${wX(s)}`}]],f=(s.choices?.length??0)>0,p=HX(s);return(0,B.jsxs)(tX,{actions:(0,B.jsx)(YZ,{item:e,onSelect:a,onWrite:o,state:r}),badges:(0,B.jsx)(qZ,{groupBy:t,view:e}),body:s.body,className:`human-item-card`,clamp:zZ,"data-blocking":bX(s),"data-expired":l,"data-item-id":s.id,"data-selected":n,meta:d.map(({key:e,part:t},n)=>(0,B.jsxs)(z.Fragment,{children:[n>0&&` · `,(0,B.jsx)(`span`,{children:t})]},e)),onClick:e=>{KZ(e)&&a()},title:s.title,children:[s.kind===`question`&&c&&f&&(0,B.jsxs)(`fieldset`,{className:`human-item-choices`,children:[(0,B.jsxs)(`legend`,{className:`sr-only`,children:[`Choices: `,s.title]}),s.choices?.map(t=>(0,B.jsx)(nQ,{answering:i,choice:t,view:e},t.id))]}),s.kind===`question`&&c&&(0,B.jsx)(rQ,{answering:i,label:`Answer: ${s.title}`,view:e}),(0,B.jsx)(oQ,{view:e}),p&&(0,B.jsx)(tQ,{label:p.label,text:p.text}),(0,B.jsx)(iQ,{view:e}),(0,B.jsx)(sQ,{reason:i.refusals[s.id]}),(0,B.jsx)(cQ,{state:r})]})}function YZ({item:e,state:t,onSelect:n,onWrite:r}){let{item:i}=e,a=i.state===`open`,o=t?.pending;return(0,B.jsxs)(B.Fragment,{children:[i.tracker&&(0,B.jsx)(iX,{className:`human-item-tracker`,"data-card-action":``,label:i.tracker.task,title:i.tracker.task,onClick:e=>e.stopPropagation(),tabIndex:-1,url:i.tracker.url}),(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:n,type:`button`,"aria-label":`Details: ${i.title}`,children:`Details`}),a&&i.kind===`task`&&(0,B.jsx)(QZ,{action:`complete`,control:XZ,className:`human-item-action`,name:`Complete: ${i.title}`,onPress:()=>r(e,{action:`complete`}),pending:o}),a&&(0,B.jsx)(QZ,{action:`dismiss`,control:XZ,className:`human-item-action`,name:`Dismiss: ${i.title}`,onPress:()=>r(e,{action:`dismiss`}),pending:o}),!a&&(0,B.jsx)(aX,{busyLabel:`Reopening…`,className:`human-item-action`,control:XZ,disabled:o!==void 0,label:`Reopen`,item:i.title,onPress:()=>r(e,{action:`reopen`}),reopen:e.reopen,sending:o===`reopen`})]})}var XZ={[RZ]:``,tabIndex:-1},ZZ={complete:{label:`Complete`,busy:`Completing…`},dismiss:{label:`Dismiss`,busy:`Dismissing…`}};function QZ({action:e,name:t,pending:n,onPress:r,className:i,control:a={},children:o}){let s=n===e,c=ZZ[e],l={...a,"aria-busy":s,"aria-label":s?void 0:t,className:i,disabled:n!==void 0,onClick:r,type:`button`,children:s?c.busy:c.label};return o?o(l):(0,B.jsx)(`button`,{...l})}function $Z({at:e}){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=(0,z.useRef)(void 0),o=(0,z.useId)(),s=Ae(e),c=()=>clearTimeout(a.current);return(0,B.jsxs)(`span`,{"aria-describedby":t?o:void 0,className:`human-item-raised`,"data-long-pressed":r,tabIndex:-1,onPointerCancel:c,onPointerEnter:e=>{e.pointerType===`mouse`&&n(!0)},onPointerDown:e=>{i(!1),e.pointerType!==`mouse`&&(c(),a.current=setTimeout(()=>{n(!0),i(!0)},eQ))},onPointerLeave:()=>{c(),n(!1)},onPointerUp:c,children:[`Raised `,(0,B.jsx)(u,{at:e,relative:!0}),t&&s!==void 0&&(0,B.jsx)(`span`,{className:`human-item-raised-tip`,id:o,role:`tooltip`,children:L(s)})]})}var eQ=500;function tQ({label:e,text:t}){return(0,B.jsxs)(`p`,{className:`human-item-note`,children:[(0,B.jsxs)(`span`,{className:`human-item-note-label`,children:[e,`:`]}),` `,t]})}function nQ({view:e,choice:t,answering:n}){return(0,B.jsx)(`button`,{"aria-pressed":n.drafts[e.item.id]?.choice===t.id,className:`human-item-choice`,disabled:n.sending,onClick:()=>n.pressChoice(e,t),type:`button`,children:t.title})}function rQ({view:e,label:t,answering:n}){return(0,B.jsx)(`textarea`,{"aria-busy":n.sending,"aria-label":t,className:`human-item-answer`,onChange:t=>n.setText(e,t.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.preventDefault()},placeholder:(e.item.choices?.length??0)>0?`Or write your own answer`:`Write an answer`,readOnly:n.sending,rows:1,value:n.drafts[e.item.id]?.text??``})}function iQ({view:e}){let t=RX(e.item);if(t!==void 0)return(0,B.jsxs)(`p`,{className:`human-item-expiry-reason`,children:[t.reason,t.held!==``&&(0,B.jsxs)(`span`,{className:`human-item-expiry-held`,children:[` · `,t.held]})]});let n=FX(e.item);return(0,B.jsxs)(B.Fragment,{children:[n!==void 0&&(0,B.jsx)(`p`,{className:`human-item-expiry`,children:n}),BX(e).map(e=>(0,B.jsxs)(`p`,{className:`human-item-status human-item-check-failed`,"data-failed":`true`,title:e.detail??void 0,children:[`Check `,zX(e)]},e.condition))]})}function aQ({view:e}){if(e.item.state!==`open`)return null;let t=VX(e);return t.length===0?null:(0,B.jsxs)(`section`,{"aria-label":`Expiry`,className:`human-item-detail-expiry`,children:[(0,B.jsx)(`h3`,{children:`Expiry`}),(0,B.jsx)(`ul`,{children:t.map(({key:e,words:t,last:n})=>(0,B.jsxs)(`li`,{children:[t,n!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-check-detail`,"data-failed":n.outcome===`failed`,children:[`Last check `,zX(n),` · `,(0,B.jsx)(u,{at:n.last_run_at,relative:!0})]})]},e))})]})}function oQ({view:e}){let{item:t}=e;if(t.state!==`answered`||t.resolution===null)return null;let{choice:n,text:r}=t.resolution,i=t.choices?.find(({id:e})=>e===n);return(0,B.jsxs)(`section`,{"aria-label":`Answer`,className:`human-item-answered`,children:[i&&(0,B.jsx)(`p`,{className:`human-item-answered-choice`,children:i.title}),r!==null&&(0,B.jsx)(eX,{source:r})]})}function sQ({reason:e}){return e===void 0?null:(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent: `,e]})}function cQ({state:e}){return e?.error?(0,B.jsx)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:e.error}):null}function lQ({view:e,detail:t,gone:n,lastShown:r,error:i,state:a,answering:o,onWrite:s,onClose:c}){if(n&&e===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[r&&(0,B.jsx)(`h2`,{children:r.item.title}),(0,B.jsx)(Gi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),(0,B.jsx)(`p`,{role:`status`,children:`Resolved: this item needs nothing more from you.`})]});let l=t??e;if(l===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsx)(Gi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})}),i?(0,B.jsx)(`p`,{role:`alert`,children:i}):(0,B.jsx)(`p`,{role:`status`,children:`Reading…`})]});let{item:d}=l,f=d.state===`open`,p=d.choices??[],m=d.kind===`question`&&f;return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,tabIndex:0,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[(0,B.jsx)(`h2`,{children:d.title}),(0,B.jsx)(Gi,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(Dt,{size:14})})]}),i&&(0,B.jsx)(`p`,{role:`alert`,children:i}),(0,B.jsx)(`section`,{"aria-label":`Full body`,className:`human-item-detail-body`,children:(0,B.jsx)(eX,{source:d.body})}),m&&p.length>0&&(0,B.jsxs)(`fieldset`,{className:`human-item-choice-list`,children:[(0,B.jsx)(`legend`,{children:`Choices`}),p.map(e=>(0,B.jsxs)(`div`,{className:`human-item-choice-entry`,children:[(0,B.jsx)(nQ,{answering:o,choice:e,view:l}),(0,B.jsx)(`div`,{className:`human-item-choice-description`,children:(0,B.jsx)(eX,{source:e.description})})]},e.id))]}),m&&(0,B.jsx)(rQ,{answering:o,label:`Answer in detail: ${d.title}`,view:l}),(0,B.jsx)(oQ,{view:l}),(0,B.jsx)(aQ,{view:l}),(0,B.jsx)(sQ,{reason:o.refusals[d.id]}),(0,B.jsxs)(`div`,{className:`human-item-detail-actions`,children:[f&&d.kind===`task`&&(0,B.jsx)(QZ,{action:`complete`,onPress:()=>s(l,{action:`complete`}),pending:a?.pending,children:e=>(0,B.jsx)(Gi,{...e,size:`sm`})}),f&&(0,B.jsx)(QZ,{action:`dismiss`,onPress:()=>s(l,{action:`dismiss`}),pending:a?.pending,children:e=>(0,B.jsx)(Gi,{...e,size:`sm`,variant:`outline`})}),!f&&(0,B.jsx)(aX,{busyLabel:`Reopening…`,className:`human-item-detail-reopen`,disabled:a?.pending!==void 0,label:`Reopen`,onPress:()=>s(l,{action:`reopen`}),reopen:l.reopen,sending:a?.pending===`reopen`}),(0,B.jsx)(cQ,{state:a})]}),t?.history!==void 0&&t.history.length>0&&(0,B.jsx)(uQ,{history:t.history}),(0,B.jsxs)(`dl`,{className:`human-item-metadata`,children:[UX(l).map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:`value`in e?e.value:(0,B.jsxs)(B.Fragment,{children:[e.party!==void 0&&`By ${e.party} · `,(0,B.jsx)(u,{at:e.at,relative:!0})]})})]},e.label)),t&&t.nodes.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Blocked steps`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`section`,{"aria-label":`Blocked steps`,className:`human-item-steps`,children:TX(t).map(({phrase:e,nodes:t})=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>(0,B.jsxs)(`li`,{children:[e.run,` / `,e.node,`: `,e.title]},`${e.run}/${e.node}`))})]},e))})})]}),d.tracker&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Tracker`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(iX,{className:`human-item-tracker-full`,label:d.tracker.task,url:d.tracker.url})})]})]})]})}function uQ({history:e}){return(0,B.jsxs)(`section`,{"aria-label":`History`,className:`human-item-history`,children:[(0,B.jsx)(`h3`,{children:`History`}),(0,B.jsx)(`ol`,{children:e.map((e,t)=>(0,B.jsxs)(`li`,{children:[kX(e),` · `,(0,B.jsx)(u,{at:e.at,relative:!0})]},t))})]})}function dQ({className:e,state:t}){let n=fQ(t);return(0,B.jsxs)(T,{className:k(`gap-1.5 tracking-[.03em] uppercase`,n&&mQ[n],e),variant:`outline`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:k(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),t]})}function fQ(e){return bQ[e]}var pQ=e=>{let t=fQ(e);return k(`size-2 shrink-0 rounded-full bg-current`,t===void 0?`text-muted-foreground`:hQ[t])},mQ={success:`border-success bg-success-surface text-success`,destructive:`border-destructive bg-destructive-surface text-destructive`,warning:`border-warning bg-warning-surface text-warning`,info:`border-info bg-info-surface text-info`},hQ={success:`text-success`,destructive:`text-destructive`,warning:`text-warning`,info:`text-info`},gQ=`success`,_Q=`destructive`,vQ=`warning`,yQ={blocked:vQ,cancelled:_Q,"complete-but-draft":vQ,"complete-but-held":vQ,done:gQ,failed:_Q,"not-completed":_Q,parked:void 0,pending:void 0,ready:void 0,running:`info`,skipped:vQ,unknown:void 0,waiting:void 0},bQ={...yQ,complete:yQ.done,settled:yQ.done,active:yQ.running},xQ=`/human-items`;function SQ(e){return e===`/human-items`||e===`/human-items/`}function CQ(e){return SQ(e)?`/`:e}function wQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}var TQ=()=>window.location.pathname;function EQ(){let e=(0,z.useSyncExternalStore)(wQ,TQ,TQ),t=(0,z.useCallback)(()=>{let e=new URLSearchParams;for(let t of new URLSearchParams(window.location.search).getAll(`hide-kind`))e.append(`hide-kind`,t);let t=e.size>0?`?${e}`:``;window.history.pushState(null,``,`${xQ}${t}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{active:SQ(e),open:t}}var DQ={graph:`graph`,overall:`overall`};function OQ(e){return e!==null&&Object.hasOwn(DQ,e)}var kQ={projects:`projects`,runs:`runs`};function AQ(e){return e!==null&&Object.hasOwn(kQ,e)}var jQ={timeline:`Timeline`,task:`Task`,criteria:`Acceptance criteria`,dependencies:`Dependencies`,remote:`Remote`};function MQ(e){return e!==null&&Object.hasOwn(jQ,e)}function NQ(e,t){let n=e.get(t);return n!==null&&se(n)?n:void 0}function PQ(){let e=(0,z.useSyncExternalStore)(FQ,IQ,IQ),t=new URLSearchParams(e),n=t.get(`list`),r=AQ(n)?n:`projects`,i=t.get(`project`),a=i!==null&&(i===`none`||wM(i))?i:void 0,o=NQ(t,`run`),s=NQ(t,`node`),c=NQ(t,`event`),l=t.get(`view`),u=t.get(`tab`),d=u===`pr`||u===`checks`?`remote`:MQ(u)?u:`timeline`,f=OQ(l)?l:s===void 0?`overall`:`graph`,p=(0,z.useCallback)((e,t=!1)=>{let n=new URLSearchParams(window.location.search);e(n);let r=t?window.location.pathname:CQ(window.location.pathname);window.history.pushState(null,``,`${r}?${n}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{list:r,host:t.get(`page`)===`host`,hiddenKinds:t.getAll(`hide-kind`),hiddenEventTypes:[...new Set(t.getAll(`hide-event`))].filter(ge),selectEventTypes:e=>p(t=>{t.delete(`hide-event`);for(let n of e)t.append(`hide-event`,n)},!0),selectHost:()=>p(e=>{e.set(`page`,`host`)}),selectKinds:e=>p(t=>{t.delete(`hide-kind`);for(let n of e)t.append(`hide-kind`,n)},!0),projectKey:a,runId:o,nodeId:s,itemId:c,view:f,nodeTab:d,selectList:e=>p(t=>{e===`projects`?t.delete(`list`):t.set(`list`,e),t.delete(`project`)}),selectProject:e=>p(t=>{e===void 0?t.delete(`project`):t.set(`project`,e),t.delete(`list`),t.delete(`run`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectRun:e=>p(t=>{t.set(`run`,e),t.delete(`page`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectNode:e=>p(t=>{e?t.set(`node`,e):t.delete(`node`),t.delete(`event`),t.delete(`tab`),t.set(`view`,`graph`)}),selectItem:e=>p(t=>{e?t.set(`event`,e):t.delete(`event`)}),showOverall:()=>p(e=>{e.set(`view`,`overall`),e.delete(`node`),e.delete(`event`),e.delete(`tab`)}),selectNodeTab:e=>p(t=>{e===`timeline`?t.delete(`tab`):t.set(`tab`,e),e!==`timeline`&&t.delete(`event`)})}}function FQ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function IQ(){return window.location.search}function LQ(e){return[...e].sort((e,t)=>{let n=e.started_at,r=t.started_at;return n!==void 0&&r===void 0?-1:n===void 0&&r!==void 0?1:(r===void 0?0:Date.parse(r))-(n===void 0?0:Date.parse(n))||Date.parse(t.updated_at)-Date.parse(e.updated_at)||e.id.localeCompare(t.id)})}function RQ(e){let t=new Map;for(let n of e){let e=n.group?.project??`none`,r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t].map(([e,t])=>{let n=LQ(t),r=t[0]?.group?.project??null,i=t.map(e=>e.updated_at).reduce((e,t)=>Date.parse(t)>Date.parse(e)?t:e);return{key:e,project:r,label:r===null?`Other runs`:n.find(e=>e.group?.name)?.group?.name??r,rows:n,updatedAt:i}}).sort((e,t)=>Number(e.project===null)-Number(t.project===null)||Date.parse(t.updatedAt)-Date.parse(e.updatedAt)||e.key.localeCompare(t.key))}function zQ(e){let{done:t,failed:n,running:r}=e.nodes;return ee({done:t,failed:n,running:r})}function BQ(e,t){let n=new Map(e.map(e=>[e.id,JSON.stringify(e)])),r=t.filter(e=>n.get(e.id)!==JSON.stringify(e)).length,i=new Set(t.map(e=>e.id));return r+e.filter(e=>!i.has(e.id)).length}function VQ(e,t,n,r){let[i,a]=(0,z.useState)(new Set),o=(0,z.useCallback)(e=>{a(t=>t.has(e)?t:new Set(t).add(e))},[]),s=(0,z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),c=(0,z.useMemo)(()=>RQ(e??[]),[e]),l=c.find(e=>e.rows.some(e=>e.id===n))?.key,[u,d]=(0,z.useState)();return l!==u&&(d(l),l!==void 0&&o(l)),(0,z.useMemo)(()=>({kinds:[...new Set(e?.flatMap(e=>e.kind?[e.kind]:[])??[])].sort(),groups:c.map(e=>{let n=e.rows.filter(e=>!e.kind||!t.includes(e.kind)),a=n[0];return{key:e.key,label:e.label,runs:n,expanded:i.has(e.key),toggle:()=>s(e.key),open:()=>{o(e.key),a&&r(a.id)}}})}),[e,c,t,i,o,s,r])}var HQ=240,UQ=`data-row-key`;function WQ(e,t){let n=(0,z.useRef)(new Map);(0,z.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().top,i=[...t.querySelectorAll(`[${UQ}]`)],a=new Map(i.map(e=>[e.getAttribute(`data-row-key`)??``,e.getBoundingClientRect().top-r])),o=[...n.current.keys()].filter(e=>a.has(e)),s=[...a.keys()].filter(e=>n.current.has(e));if(o.join(`
|
|
104
104
|
`)!==s.join(`
|
|
105
|
-
`)&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let e of i){let t=n.current.get(e.getAttribute(`data-row-key`)??``),r=a.get(e.getAttribute(`data-row-key`)??``);t===void 0||r===void 0||t===r||e.animate([{transform:`translateY(${t-r}px)`},{transform:`translateY(0)`}],{duration:HQ,easing:`ease-out`})}n.current=a},[e,t])}function GQ({rows:e,failed:t=!1,selectedRunId:n,onSelect:r,onOpenProject:i,onHost:a,hostCurrent:o=!1,onActionItems:s,actionItemsCurrent:c=!1,hiddenKinds:l,onKindsChange:u,updates:d,drawerOpen:f=!1,drawerRef:p}){let{kinds:m,groups:h}=VQ(e,l,n,i??r),g=(0,z.useRef)(null);return WQ(g,h),(0,B.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,B.jsx)(_d,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,B.jsxs)(`div`,{className:`brand`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,B.jsx)(Be,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,B.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,B.jsx)(Ad,{className:`my-[22px]`}),(0,B.jsxs)(`div`,{className:`nav-pages`,children:[(0,B.jsx)(Gi,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,B.jsx)(Gi,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!l.includes(e),onChange:t=>u(t.target.checked?l.filter(t=>t!==e):[...l,e])}),e]},e))]})]}),d,e===void 0?(0,B.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,B.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,B.jsxs)(`div`,{className:`project-row`,[UQ]:`project:${e.key}`,children:[(0,B.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,B.jsx)(Ge,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,B.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,B.jsx)(`span`,{className:`project-name`,children:e.label}),(0,B.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,B.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,B.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,zQ(e)].filter(Boolean).join(` · `);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:`run-link`,"data-active":t,onClick:()=>r(e.id),title:i,type:`button`,"data-row-key":`run:${e.id}`,children:[(0,B.jsxs)(Sp,{children:[(0,B.jsx)(Cp,{asChild:!0,children:(0,B.jsx)(`span`,{role:`img`,"aria-label":e.state,className:k(`run-dot`,pQ(e.state))})}),(0,B.jsx)(wp,{children:e.state})]}),(0,B.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,B.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,B.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function KQ(){let[e,t]=(0,z.useState)(!1),n=(0,z.useRef)(null),r=(0,z.useRef)(null),i=(0,z.useRef)(!1),a=(0,z.useCallback)(()=>t(!1),[]),o=(0,z.useCallback)(()=>t(e=>!e),[]);return(0,z.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t(!1)},i=()=>{n.current?.offsetParent===null&&t(!1)};return document.addEventListener(`keydown`,r),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`keydown`,r),window.removeEventListener(`resize`,i)}},[e]),(0,z.useEffect)(()=>{e?r.current?.querySelector(`button`)?.focus():i.current&&n.current?.focus(),i.current=e},[e]),{open:e,close:a,toggle:o,menuButton:n,drawer:r}}function qQ(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useRef)(void 0),a=(0,z.useRef)(t);a.current=t;let o=e===`live`,s=(0,z.useRef)(o);s.current=o;let c=(0,z.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,z.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,z.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,z.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,z.useEffect)(()=>{o&&l()},[o,l]),(0,z.useEffect)(()=>{if(typeof e!=`number`)return;let t=setInterval(l,e*1e3);return()=>clearInterval(t)},[e,l]),{waiting:n,show:c,take:l,offer:u,drop:d}}function JQ(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),[o,s]=(0,z.useState)({}),c=(0,z.useRef)([]),[l,u]=(0,z.useState)(),[d,f]=(0,z.useState)(),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(),[_,v]=(0,z.useState)(),[y,b]=(0,z.useState)(),[x,S]=(0,z.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?LQ(l)[0]?.id:void 0,T=(0,z.useMemo)(()=>t.humanItems??Me(t.host?void 0:w,t.view,t.nodeId),[t.humanItems,t.host,w,t.view,t.nodeId]),E=(0,z.useRef)(void 0),D=(0,z.useRef)(T);D.current=T;let O=(0,z.useRef)(t.first),k=qQ(t.navigationUpdates,f),A=qQ(t.mainUpdates,(0,z.useCallback)(e=>{r(e.state),a(e.view);let{visible:t}=e.state;if(t.type===`human-items`){let{items:n,detail:r}=t;s({items:n,detail:r,...e.view.type===`human-items`&&e.view.item!==void 0?{item:e.view.item}:{}})}m(new Date().toISOString()),e.reset!==void 0&&b(`The live view was re-sent whole: ${e.reset}.`)},[])),j=t.navigationUpdates!==`off`||t.mainUpdates!==`off`,M=(0,z.useRef)(j);M.current=j,(0,z.useEffect)(()=>{g(void 0);let t=!0,n=O.current;if(O.current=void 0,n?.error!==void 0){g(n.error);return}let r=e.live({view:D.current,paused:!M.current,...n?.answer!==void 0&&JSON.stringify(n.address.view)===JSON.stringify(D.current)?{initial:n.answer}:{},onState:(e,n)=>{let i=c.current;e.sidebar!==void 0&&(c.current=e.sidebar,u(e.sidebar)),g(void 0),v(void 0);let a={state:e,view:r.view,...n.kind===`reset`?{reset:n.reason}:{}};if(n.kind===`snapshot`){if(A.show(a),e.sidebar!==void 0){if(t)k.show(e.sidebar);else if(i!==e.sidebar){let t=BQ(i,e.sidebar);t>0&&k.offer(e.sidebar,t)}}t=!1;return}if(n.kind===`reset`){e.sidebar!==void 0&&k.offer(e.sidebar),A.offer(a);return}if(n.frame.type===`sidebar.snapshot`){k.show(n.frame.rows);return}let o=n.frame.type===`run.changed`||n.frame.type===`run.removed`;o&&e.sidebar!==void 0&&k.offer(e.sidebar),(!o||e.visible.type===`sidebar`)&&A.offer(a)},onError:e=>{if(r.view.type===`human-items`){s(t=>({...t.items===void 0?{}:{items:t.items},error:e.message})),r.change({type:`sidebar`});return}if(e instanceof EN&&(e.code===`run_not_found`||e.code===`node_not_found`)){r.change({type:`sidebar`});return}g(e)},onDisconnected:()=>v(Error(`Live telemetry stream disconnected`)),onConnected:()=>v(void 0)});return E.current=r,()=>{r.close(),E.current===r&&(E.current=void 0)}},[e,x,A.show,A.offer,k.show,k.offer]),(0,z.useEffect)(()=>{JSON.stringify(E.current?.view)!==JSON.stringify(T)&&A.drop(),E.current?.change(T),T.type!==`human-items`&&s(e=>Object.keys(e).length===0?e:{})},[T,A.drop]),(0,z.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,z.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,z.useCallback)(()=>{b(void 0),N(),S(e=>e+1)},[N]),F=n?.visible,I=F!==void 0&&F.type!==`sidebar`&&F.type!==`human-items`&&F.run_id===w&&YQ(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,ee=(0,z.useRef)(void 0),L=I?.detail??(ee.current?.run.run_id===w?ee.current:void 0);ee.current=L;let te=(0,z.useMemo)(()=>XQ(L),[L]),ne=h!==void 0&&T.type===`timeline`&&L!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:L,timeline:I&&`timeline`in I?I.timeline:void 0,humanItems:o,timelineError:ne?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:te,error:ne?_:h??_,notice:y,refresh:P}}function YQ(e,t){return t.type===e.type?t.type===`timeline`&&e.type===`timeline`?t.scope===e.scope&&(t.scope===`run`||e.scope===`node`&&e.node===t.node):!0:!1}function XQ(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=Gj.safeParse(t);return n.success?n.data:[]}var ZQ={minutes:60,seconds:1},QQ=e=>Object.hasOwn(ZQ,e),$Q=600%ZQ.minutes==0?{amount:String(600/ZQ.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function e$(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*ZQ[e.unit];return Number.isSafeInteger(n)?n:void 0}function t$(e){if(e===0)return`no grace`;let t=Math.floor(e/60),n=e%60,r=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return t===0?r(n,`second`):n===0?r(t,`minute`):`${r(t,`minute`)} ${r(n,`second`)}`}function n$(e){return e.map(e=>({runId:e.run_id,owner:Te(e.launch)}))}function r$(e,t){return t instanceof EN&&t.status!==void 0&&t.code!==void 0?{phase:`refused`,sent:e,error:t}:{phase:`lost`,sent:e,error:t instanceof Error?t:Error(String(t))}}var i$={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function a$(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(i$);return n.flatMap(e=>{if(!r.has(e.run_id))return[];let n=e.last_event;if(n===null||!i.includes(n))return[];let a=t.get(e.run_id);return a!==void 0&&a.last_event===n&&a.last_progress_at===e.last_progress_at?[]:[{runId:e.run_id,recorded:n===i$.hostShutdown?i$.hostShutdown:i$.dispatchStopped}]})}function o$(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function s$(e){return(0,z.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.owner,(t.get(n.owner)??0)+1);return[...t].map(([e,t])=>({owner:e,count:t}))},[e])}var c$=`Each live dispatch is asked to stop and commit, and given the grace to end itself; whatever is still standing then is torn down, and every branch the run's records name is pushed to its origin. Nothing is sent until you confirm.`;function l$({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)($Q),[l,u]=(0,z.useState)(!1),d=e$(s),f=n!==void 0&&r===void 0,p=()=>{c($Q),u(!1),t(!1)};return(0,B.jsx)(Ds,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,B.jsxs)(js,{className:`shutdown-dialog`,children:[(0,B.jsxs)(Ms,{children:[(0,B.jsx)(Ps,{children:`Shut down the entire host?`}),(0,B.jsx)(Fs,{children:c$})]}),(0,B.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,B.jsx)(d$,{caption:`It acts on all ${u$(n.length)} on this host, over their owners — each is interrupted, torn down and pushed:`,label:`Runs on this host`,runs:n,warning:!0}):(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,B.jsxs)(`p`,{className:`shutdown-scope-note`,children:[i===1?`1 run root on this host could not be read`:`${i} run roots on this host could not be read`,`: the engine cannot read them either, so this shutdown signals nothing in them and pushes none of their branches.`]}),(0,B.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,B.jsx)(`legend`,{children:`Grace`}),(0,B.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,B.jsx)(zs,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,B.jsx)(Is,{"aria-describedby":`${o}-grace-help`,"aria-invalid":d===void 0,id:`${o}-grace`,inputMode:`numeric`,min:0,onChange:e=>c({...s,amount:e.target.value}),step:1,type:`number`,value:s.amount}),(0,B.jsx)(zs,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,B.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;QQ(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(ZQ).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(`p`,{className:`channel-age`,id:`${o}-grace-help`,children:d===void 0?`The grace is a whole number of minutes or seconds, 0 or more.`:`How long each live dispatch has to end itself once asked: ${t$(d)}. The engine's default is ${t$(e$($Q)??0)}.`})]}),(0,B.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,B.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,B.jsx)(zs,{htmlFor:`${o}-force`,children:`Force: skip the interrupt and the wait and go straight to the teardown — whatever a worker had not committed is lost.`})]})]}),(0,B.jsxs)(Ns,{children:[(0,B.jsx)(ks,{asChild:!0,children:(0,B.jsx)(Gi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Gi,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var u$=e=>e===1?`1 run`:`${e} runs`;function d$({caption:e,label:t,runs:n,warning:r=!1}){let i=s$(n);return(0,B.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,B.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,B.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,B.jsxs)(`li`,{children:[e,` — `,u$(t)]},e))})]})}function f$(e,t,n){let[r,i]=(0,z.useState)(),a=p$(r!==void 0,e,t,n);return{open:r,setOpen:i,opener:e=>()=>i(e),runs:a.rows===void 0||r===void 0?void 0:n$(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function p$(e,t,n,r){let i=(0,z.useRef)(new Set),a=t?.next_cursor;return(0,z.useEffect)(()=>{if(!e){i.current.clear();return}a===void 0||r||i.current.has(a)||(i.current.add(a),n())},[e,a,r,n]),t===void 0?{blocked:`Reading the runs listing this view holds…`}:a===void 0?{rows:t.runs}:!r&&i.current.has(a)?{blocked:`The rest of the runs listing could not be read (${t.runs.length} runs read), so the runs this acts on cannot all be named. Close this and try again.`}:{blocked:`Reading the rest of the runs listing so every run this acts on can be named (${t.runs.length} read so far)…`}}function m$(e,t){let[n,r]=(0,z.useState)({phase:`idle`}),i=(0,z.useRef)(!1);return{state:n,confirm:(0,z.useCallback)((n,a,o)=>{if(i.current)return;i.current=!0;let s={scope:e,runs:n,grace:a,force:o,sentAt:Date.now()};r({phase:`sending`,sent:s}),t({grace:a,force:o}).then(e=>r({phase:`answered`,sent:s,report:e}),e=>r(r$(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,z.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var h$=[`host`];function g$(e){return{host:m$(`host`,(0,z.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function _$({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=f$(e,t,n),u=r.host.state.phase===`sending`;return(0,B.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,B.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,B.jsxs)(Gi,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(ht,{size:14}),` Shut down the entire host`]})}),h$.map(e=>(0,B.jsx)(l$,{blocked:c,onConfirm:(e,t)=>s!==void 0&&r.host.confirm(s,e,t),onOpenChange:t=>a(t?e:void 0),open:i===e,runs:i===e?s:void 0,unreadable:l},e))]})}var v$=1e3;function y$(e,t){let[n,r]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),v$);return()=>clearInterval(e)},[]);let i=a$(e,(0,z.useRef)(new Map(t.filter(t=>e.runs.some(({runId:e})=>e===t.run_id)).map(e=>[e.run_id,e]))).current,t);return{now:n,progress:i,done:i.filter(({recorded:e})=>e===i$.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function b$({label:t,state:n,rows:r,onDismiss:i}){return n.phase===`idle`?null:(0,B.jsxs)(`section`,{"aria-label":t,className:`shutdown-status`,children:[n.phase===`sending`?(0,B.jsx)(S$,{rows:r,sent:n.sent}):n.phase===`lost`?(0,B.jsxs)(bi,{"aria-label":`${t} lost`,variant:`destructive`,children:[(0,B.jsx)(wt,{}),(0,B.jsx)(xi,{children:`Shutdown lost: no answer came back`}),(0,B.jsxs)(Si,{children:[(0,B.jsxs)(`p`,{children:[`The request sent at `,o$(n.sent.sentAt),` ended without an answer (`,n.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,B.jsx)(x$,{sent:n.sent})]})]}):n.phase===`refused`?(0,B.jsxs)(bi,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(xi,{children:[`Shutdown refused · `,n.error.status,` `,n.error.code]}),(0,B.jsxs)(Si,{children:[(0,B.jsx)(`pre`,{className:`verb-text`,children:n.error.message}),(0,B.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,B.jsx)(w$,{label:t,report:n.report}),n.phase!==`sending`&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Gi,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function x$({sent:e}){return(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,o$(e.sentAt),` · scope `,e.scope,` · grace`,` `,t$(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function S$({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=y$(e,t);return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,B.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,B.jsx)(st,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,B.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,be(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,B.jsx)(x$,{sent:e}),(0,B.jsx)(`p`,{children:o?n<a?`Waiting out the ${t$(e.grace)} grace until ${o$(a)} (${be(a-n)} left) for each live dispatch to end itself; runs are worked through one after another, each with its own grace.`:`The first grace ran out at ${o$(a)}; the engine is tearing down what is still standing and pushing branches, run by run.`:`Forced: nothing is asked or waited for; the engine is tearing the runs down and pushing their branches.`}),(0,B.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,B.jsxs)(`li`,{children:[e,`:`,` `,t===i$.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function C$(e){let t=e.remote===null?``:` to ${e.remote}`,n=e.commit===null?``:` at ${e.commit}`;switch(e.result){case`pushed`:return`pushed${t}${n}`;case`already-on-origin`:return`already on its origin${t}${n}; nothing was pushed`;case`no-remote`:return`not pushed: this identity has no origin${n}`;case`refused`:return`could not be preserved${n}`}}function w$({label:t,report:n}){return(0,B.jsxs)(bi,{"aria-label":`${t} report`,variant:n.complete?`default`:`destructive`,children:[n.complete?(0,B.jsx)(qe,{}):(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:n.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,B.jsxs)(Si,{className:`shutdown-report`,children:[!n.complete&&(0,B.jsx)(`p`,{children:`Not everything went as asked: a dispatch was killed at the deadline or is still running, a teardown was not clean, or a branch could not be preserved. Read the runs below.`}),(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,n.scope,` · grace `,t$(n.grace_seconds),n.forced?` · forced`:``,` · runs root `,n.root]}),n.runs.length===0?(0,B.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):n.runs.map(e=>(0,B.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,B.jsxs)(`h4`,{children:[e.run_id,` · owner `,e.owner,e.forced_over_owner&&` — another session's run, acted on over its owner`]}),e.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,B.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,B.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,be(e.waited_ms),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,B.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,B.jsx)(`p`,{children:`No branch this run's records name.`}):(0,B.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,B.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,C$(e),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),n.not_pushed_unread===null?n.not_pushed.length===0?(0,B.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,n.not_pushed.length,`):`]}),(0,B.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:n.not_pushed.map(({identity:e,branch:t})=>(0,B.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,n.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:`The engine's own report`}),(0,B.jsx)(`pre`,{className:`verb-text`,children:n.rendered})]})]})]})}function T$(e){if(e===void 0||e===``)return;let t;try{t=new URL(e).pathname}catch{return E$}let n=/\/[^/]+\/([^/]+)\/pull\/(\d+)\/?$/u.exec(t);return n===null?E$:`${n[1]}#${n[2]}`}var E$=`Change request`,D$={crosshair:!0,ticks:{minSpacingPx:80}},O$=2e3;function k$(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-O$/2,r+O$/2]}var A$=1e3;function j$({completedAt:e,startedAt:t}){let n=t===void 0?void 0:Ae(t),r=e===void 0?void 0:Ae(e),i=M$(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,B.jsxs)(B.Fragment,{children:[be(i-n.getTime()),` · running`]}):(0,B.jsx)(B.Fragment,{children:be(r.getTime()-n.getTime())})}function M$(e){let[t,n]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),A$);return()=>clearInterval(t)},[e]),t}var N$={passed:qe,failed:et,skipped:Xe,neutral:Ye,queued:Je,running:st,"not recorded":Qe};function P$(e){if(e.conclusion===void 0){if(e.status===void 0)return`not recorded`;if(e.status===`in_progress`)return`running`;if(e.status!==`completed`)return`queued`}switch(e.conclusion){case`success`:return`passed`;case`skipped`:return`skipped`;case`neutral`:return`neutral`;default:return`failed`}}function F$({check:e}){let t=P$(e),n=N$[t];return(0,B.jsxs)(`span`,{className:`check-status`,"data-check":t.replace(` `,`-`),title:[e.status??`not recorded`,e.conclusion].filter(Boolean).join(`: `),children:[(0,B.jsx)(n,{"aria-label":t,role:`img`,size:14}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:t})]})}function I$({control:e}){if(e===void 0)return null;let t=e.addressable?`Turn reachable`:`No turn to reach`,n=e.addressable?`a planner's note can be delivered into the ${e.member??`member`} turn in flight`:e.reason,r=e.addressable?dt:ut;return(0,B.jsxs)(T,{"aria-label":`${t}: ${n}`,className:k(`node-view-control gap-1.5`,e.addressable?`border-info bg-info-surface text-info`:`border-warning bg-warning-surface text-warning`),title:n,variant:`outline`,children:[(0,B.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function L$({counts:e,hidden:t,onHiddenChange:n}){let r=ne.filter(n=>(e.get(n)??0)>0||t.has(n)),i=r.filter(e=>!t.has(e)).length,a=(0,z.useId)();return(0,B.jsxs)(`header`,{className:`event-list-head`,children:[(0,B.jsx)(`h3`,{children:`Events`}),r.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter event-type-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Event types:`,` `,i===r.length?`all ${r.length}`:`${i} of ${r.length}`]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Event types`}),r.map(r=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{"aria-describedby":`${a}-${r}`,"aria-label":Se(r),checked:!t.has(r),onChange:e=>n(e.target.checked?[...t].filter(e=>e!==r):[...t,r]),type:`checkbox`}),(0,B.jsx)(`span`,{children:Se(r)}),(0,B.jsx)(`span`,{className:`event-type-count`,id:`${a}-${r}`,children:e.get(r)??0})]},r)),(0,B.jsxs)(`p`,{className:`event-type-filter-foot`,children:[(0,B.jsx)(`button`,{onClick:()=>n([]),type:`button`,children:`Select all`}),(0,B.jsx)(`button`,{onClick:()=>n([...ne]),type:`button`,children:`Clear`})]})]})]})]})}function R$({onClear:e}){return(0,B.jsxs)(`div`,{className:`event-list-empty`,role:`status`,children:[(0,B.jsx)(`p`,{children:`The event-type filter hides every event in this list.`}),(0,B.jsx)(`button`,{className:`load-earlier`,onClick:e,type:`button`,children:`Show every event type`})]})}function z$({entry:e,onToggle:t,children:n}){let{group:r}=e,i=x(r);return(0,B.jsxs)(`section`,{"aria-label":`${i}: ${r.displayLabel}`,className:`transcript-cycle`,"data-cycle-count":r.count,children:[(0,B.jsxs)(`header`,{className:`transcript-cycle-head`,children:[(0,B.jsx)(_t,{"aria-hidden":`true`,size:14}),(0,B.jsxs)(`strong`,{className:`transcript-cycle-count`,children:[`×`,r.count]}),(0,B.jsxs)(`span`,{className:`transcript-cycle-span`,children:[i,` · `,(0,B.jsx)(u,{at:r.startedAt}),`–`,(0,B.jsx)(u,{at:r.endedAt??r.startedAt}),r.durationMs!==null&&` · ${be(r.durationMs)}`]}),(0,B.jsx)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:e.expanded?`Show one pass`:`Show all ${r.children.length}`})]}),n]})}function B$({failure:e,what:t=`Earlier rows`}){return(0,B.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[t,` did not load: `,e.message]}),(0,B.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}var V$=`Partial — loading`;function H$({load:e}){let t=e.total===void 0?`${e.loaded.toLocaleString()} records loaded`:`${e.loaded.toLocaleString()} of ${e.total.toLocaleString()} records loaded`;return(0,B.jsxs)(`p`,{className:`partial-mark`,role:`status`,children:[(0,B.jsx)(`span`,{className:`partial-mark-label`,children:V$}),(0,B.jsx)(`span`,{className:`partial-mark-count`,children:t})]})}function U$(e,t){let[n,r]=(0,z.useState)(null);return(0,z.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,z.useLayoutEffect)(()=>{let i=e.current;if(!t||n!==null||i===null)return;let a=()=>{let e=i.querySelector(`[aria-label^="Timeline plot"]`);return e===null?!1:(getComputedStyle(e).position===`static`&&(e.style.position=`relative`),r(e),!0)};if(a())return;let o=new MutationObserver(()=>{a()&&o.disconnect()});return o.observe(i,{childList:!0,subtree:!0}),()=>o.disconnect()}),n}function W$({container:e,partial:t=!1,range:n,stretches:r}){let i=U$(e,r.length>0);if(i===null)return null;let a=Math.max(n[1]-n[0],1),o=e=>(Math.min(Math.max(e,n[0]),n[1])-n[0])/a*100;return(0,qn.createPortal)(r.map(([e,n])=>(0,B.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":n,style:{left:`${o(e)}%`,width:`${o(n)-o(e)}%`},children:(0,B.jsx)(`span`,{className:`history-hatch-label`,children:t?V$:j})},`${e}-${n}`)),i)}function G$(e){return e===`human-step`?`human step`:e}function K$(e){return e.style===`human-step`}function q$(e){switch(e){case`not-released`:return`not released yet`;case`awaiting-human-step`:return`waiting for the human step`;case`not-answered`:return`the registry did not answer`;case`not-landed`:return`released, but not carrying this work yet`;default:return e}}function J$(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function Y$(e){if(e!==void 0)return e===`live`?`Live — into the turn that was already running`:e===`next`?`Deferred — onto the node's next dispatch`:e}function X$(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function Z$({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:G$(e.style)],[`Version`,e.version],[`Probe outcome`,e.outcome],[`Probed through`,e.form],[`Probe took`,e.elapsed_ms===void 0?void 0:`${e.elapsed_ms} ms`],[`Acknowledged by`,e.actor],[`Superseded`,J$(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,Y$(e.delivery)]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[t.length>0&&(0,B.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,B.jsxs)(`li`,{children:[K$(e)?(0,B.jsxs)(bi,{children:[(0,B.jsx)(y,{}),(0,B.jsxs)(xi,{children:[`Waiting on a person · `,X$(e)]}),(0,B.jsx)(Si,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,X$(e)]}),(0,B.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:q$(e.last_answer),e.waited_seconds===void 0?void 0:`waited ${e.waited_seconds}s`].filter(e=>e!==void 0).join(` · `)})]},`${e.dep}·${e.identity??``}·${e.target??``}`))})]}),e.versions!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function Q$({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,B.jsx)(B.Fragment,{children:[t.target,t.style===void 0?void 0:G$(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function $$({artifactId:t,client:n,focusFirstPrompt:r=!1,runId:i}){let a=VN(`${i}/${t}`,()=>n.getArtifact(i,t),0),o=a.value?.turns??[],s=o[0],c=r&&s!==void 0?{turnId:s.id,part:`prompt`}:void 0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),a.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):a.value===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):a.value.unavailable===void 0?(0,B.jsx)(Ki,{className:r?`harness-conversation-focused gap-0 py-3`:`gap-0 py-3`,children:(0,B.jsx)(qi,{className:`px-3`,children:o.map(e=>(0,B.jsx)(KC,{...c?.turnId===e.id?{focus:c}:{},turn:e},e.id))})}):(0,B.jsxs)(bi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Transcript unavailable`}),(0,B.jsx)(Si,{children:a.value.unavailable})]})]})}function e1({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=t1(e),c=VN(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,B.jsxs)(B.Fragment,{children:[c.value?.truncated===!0&&(0,B.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,B.jsx)(`section`,{"aria-label":n,children:(0,B.jsx)(`pre`,{children:l})})]})]})}function t1(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}var n1=6,r1=8,i1=`[aria-describedby^="timeline-detail-"]`,a1=`[data-timeline-entry]`,o1=e=>{if(!(e instanceof Element))return;let t=E(e);if(t!==void 0)return t;let n=e.closest(i1);if(n instanceof HTMLElement){let e=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return e?{element:n,detail:e}:void 0}let r=e.closest(a1),i=r?.getAttribute(`aria-label`)?.replace(/, marker$/u,``);return r instanceof HTMLElement&&i?{element:r,detail:i}:void 0},s1=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t,c1=(0,z.createContext)(()=>void 0);function l1(){let e=(0,z.useContext)(c1),t=(0,z.useRef)(!1);return(0,z.useEffect)(()=>()=>{t.current&&e(null)},[e]),(0,z.useCallback)(n=>{t.current=n!==null,e(n?.element??null)},[e])}function u1({children:e}){let t=(0,z.useContext)(c1);return(0,B.jsx)(`div`,{onPointerLeave:()=>t(null),onPointerOver:e=>{let n=e.target;t(n instanceof Element?o1(n)?.element??null:null)},children:e})}function d1({children:e}){let t=(0,z.useRef)(null),[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),o=n??i,s=(0,z.useCallback)(()=>{r(void 0),a(void 0)},[]),c=(0,z.useCallback)(e=>r(t=>s1(t,e===null?void 0:o1(e))),[]);(0,z.useEffect)(()=>{let e=e=>a(t=>s1(t,o1(e.target))),t=e=>a(t=>s1(t,o1(e.relatedTarget))),n=()=>r(void 0);return document.addEventListener(`pointerleave`,n),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t),()=>{document.removeEventListener(`pointerleave`,n),document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t)}},[]);let l=(0,z.useCallback)(()=>{let e=t.current;if(e===null||o===void 0)return;if(!o.element.isConnected)return s();let n=o.element.getBoundingClientRect(),r=e.getBoundingClientRect(),i=window.innerWidth-r.width-r1,a=Math.min(Math.max(n.left,r1),Math.max(r1,i)),c=n.bottom+n1,l=n.top-r.height-n1,u=Math.max(r1,window.innerHeight-r.height-r1),d=c+r.height<=window.innerHeight-r1?c:l,f=Math.min(Math.max(d,r1),u);e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(f)}px`,e.style.visibility=`visible`},[o,s]);return(0,z.useLayoutEffect)(l,[l]),(0,z.useEffect)(()=>{if(o!==void 0)return window.addEventListener(`scroll`,l,!0),window.addEventListener(`resize`,l),()=>{window.removeEventListener(`scroll`,l,!0),window.removeEventListener(`resize`,l)}},[o,l]),(0,B.jsxs)(c1.Provider,{value:c,children:[e,o!==void 0&&(0,qn.createPortal)((0,B.jsx)(`div`,{"aria-hidden":`true`,className:`timeline-popover`,"data-testid":`timeline-popover`,ref:t,style:{visibility:`hidden`},children:o.detail},o.detail),document.body)]})}function f1(e,t,n,r){let[i,a]=(0,z.useState)(),o=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,z.useEffect)(()=>{if(o===void 0||t===void 0||n===void 0)return;let r=!0;return e.getConversation(t,n).then(e=>{r&&a({key:o,conversation:e})}).catch(e=>{if(!r)return;let t=e instanceof Error?e:Error(String(e));a(e=>e?.key===o&&e.conversation!==void 0?e:{key:o,error:t})}),()=>{r=!1}},[e,t,n,o,r]);let s=i?.key===o?i:void 0;return(0,z.useMemo)(()=>({conversation:s?.conversation,error:s?.error,loading:o!==void 0&&s===void 0}),[s,o])}function p1(e){let t=(0,z.useRef)(void 0);return(0,z.useCallback)(n=>{t.current?.disconnect(),t.current=void 0;let r=n?.parentElement;if(n===null||r==null)return;let i=()=>r.style.setProperty(e,`${n.getBoundingClientRect().height}px`);i(),t.current=new ResizeObserver(i),t.current.observe(n)},[e])}var m1=[`keydown`,`pointerdown`,`touchstart`,`wheel`];function h1(e){for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t}return null}function g1(e,t){(0,z.useLayoutEffect)(()=>{let n=e.current;if(n===null||t===``)return;let r=h1(n);if(r===null)return;let i=()=>{let e=Number.parseFloat(getComputedStyle(n).scrollMarginTop)||0,t=r.getBoundingClientRect().top+r.clientTop;return n.getBoundingClientRect().top-(t+e)},a=()=>{let e=i();Math.abs(e)>=.5&&r.scrollTo({behavior:`instant`,top:r.scrollTop+e})};a();let o=!0,s=()=>{o=!1},c=new ResizeObserver(()=>{o&&a()});for(let e of new Set([n,...r.children]))c.observe(e);for(let e of m1)r.addEventListener(e,s,{passive:!0});return()=>{c.disconnect();for(let e of m1)r.removeEventListener(e,s)}},[e,t])}var _1=32;function v1(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function y1(e,t){let n=(0,z.useRef)(null),r=(0,z.useRef)(!0),i=(0,z.useRef)({key:e,count:t}),a=(0,z.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=_1)},[]),o=(0,z.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=v1(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,z.useLayoutEffect)(()=>{let a=i.current;i.current={key:e,count:t};let o=a.key===e&&a.count>0&&t>a.count,s=n.current;!o||s===null||!r.current||(s.scrollTop=s.scrollHeight)},[e,t]),o}var b1=25,x1=2e3;function S1({client:e,runId:t,node:r,row:i}){let a=i===void 0?void 0:Z1(i),o=a?.kind===`conversation`?a.value:void 0,[s,c]=(0,z.useState)(0),l=f1(e,t,o,i===void 0?void 0:`${G1(i)}|${s}`),u=i!==void 0&&O1(i,l,r)===`not-yet`;(0,z.useEffect)(()=>{if(!u)return;let e=setInterval(()=>c(e=>e+1),x1);return()=>clearInterval(e)},[u]);let d=y1(o,K1(i,l)),f=a?.kind===`oneharness_session`?t1(a.value):void 0;return(0,B.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,B.jsx)(_d,{className:`h-full`,children:(0,B.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:d,children:i===void 0?(0,B.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,B.jsx)(ot,{size:30}),(0,B.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):X1(a)?(0,B.jsx)(N1,{conversationId:a?.value??``,...r===void 0?{}:{node:r},row:i,transcript:l}):f===void 0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{row:i}),(0,B.jsx)(Ad,{className:`my-4`}),(0,B.jsx)(C1,{client:e,runId:t,node:r,reference:a,row:i}),i.rowKind===`event`&&(0,B.jsx)(n0,{client:e,event:i.event,...i.event.kind===`edit-rejected`?{shown:B1}:{}})]}):(0,B.jsx)($$,{artifactId:f,client:e,focusFirstPrompt:!0,runId:t})})})})}function C1({client:e,runId:t,row:n,node:r,reference:i}){if(n.rowKind===`event`&&n.event.kind===`edit-rejected`)return(0,B.jsx)(z1,{client:e,event:n.event,reference:i,runId:t});let a=q1(n);if(a!==void 0)return(0,B.jsx)(L1,{redirection:a,row:n});let o=J1(n);if(o!==void 0)return(0,B.jsx)(Z$,{release:o});let s=Y1(n);return s===void 0?$1(n)?(0,B.jsx)(P1,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&t1(i.value)!==void 0?(0,B.jsx)(F1,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):e0(n,i)&&r!==void 0?(0,B.jsx)(I1,{node:r,reference:i}):(0,B.jsx)(U1,{reference:i,row:n}):(0,B.jsx)(H1,{row:n,surface:s})}function w1({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,B.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function T1(e){if(e.rowKind===`event`)return e.event.conversation_item;if(e.rowKind===`span`)return e.span.conversation_item}function E1(e){return e.conversation_item?.turn??e.tool?.turn??e.id}function D1(e,t){if(e.rowKind===`event`&&e.event.tool!==void 0){let n=E1(e.event),r=t.find(({id:e})=>e===n),{index:i,tool_call_id:a}=e.event.tool;return r===void 0?{turnId:n,eventIndex:i}:a!==void 0&&r.tools.some(e=>e.toolCallId===a)?{turnId:r.id,toolCallId:a}:!(r.tools.some(e=>e.index===i)||(r.agentEvents??[]).some(e=>e.index===i))&&e.event.fields?.kind===`message`?{turnId:r.id,part:`answer`}:{turnId:r.id,eventIndex:i}}let n=T1(e);return n===void 0?void 0:{turnId:n.turn,part:n.part}}function O1(e,t,n){let r=t.conversation?.conversation;if(r===void 0)return;let i=T1(e),a=e.rowKind===`event`?E1(e.event):i?.turn;if(a===void 0||i?.gap!==!0&&r.turns.some(({id:e})=>e===a))return;if(i?.gap===!0)return`not-yet`;let o=Number(a.slice(a.lastIndexOf(`.`)+1));return Number.isInteger(o)&&o>=r.turns.length&&A1(r.state,n)?`not-yet`:`no-longer`}var k1={pending:!0,ready:!0,running:!0,waiting:!0,blocked:!0,parked:!0,unknown:!0,done:!1,failed:!1,cancelled:!1,skipped:!1,"not-completed":!1,"complete-but-draft":!1,"complete-but-held":!1};function A1(e,t){return e===`member-settled`?!1:t===void 0||k1[t.status]}function j1({turnId:e,absence:t}){let n=(0,z.useRef)(null);return g1(n,`${e}|${t}`),(0,B.jsx)(`div`,{className:`conversation-turn-absent`,"data-turn-id":e,children:(0,B.jsx)(`p`,{"aria-current":`true`,className:`detail-note conversation-focus-highlight`,ref:n,role:`note`,children:t===`not-yet`?`This turn is not in the recorded transcript yet.`:`This turn is no longer part of the recorded transcript.`})})}function M1({turn:t}){let n=[t.unknown.instruction_truncated===!0?`its prompt`:void 0,t.unknown.truncated===!0?`its reply`:void 0,t.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,t.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return n.length===0?null:(0,B.jsxs)(bi,{className:`mb-3`,role:`note`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Cut by the recorder`}),(0,B.jsxs)(Si,{children:[`The run's recorder cut `,n.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function N1({conversationId:t,node:n,row:i,transcript:a}){let[o,s]=(0,z.useState)(b1),c=a.conversation,l=c?.conversation.turns??[],u=i.rowKind===`event`?E1(i.event):void 0,d=O1(i,a,n),f=u===void 0?l:d===void 0?l.filter(({id:e})=>e===u):[],p=f.length===0?l:f,m=Lp(p.map(e=>({id:e.id,time:Date.parse(e.timestamp)}))),h=p1(`--conversation-focus-offset`),g=D1(i,p),_=d===void 0?void 0:u??g?.turnId,v=c===void 0?r(i.role,i.transport):t0(c.attribution.agentRole,c.attribution.transportRole),y=c?.attribution.persona;return(0,B.jsx)(Ki,{className:`gap-0 py-3`,children:(0,B.jsxs)(qi,{className:`px-3`,children:[(0,B.jsxs)(`header`,{className:`transcript-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`eyebrow`,children:[i.dispatch===void 0?``:`${i.dispatch.label} · `,v,y?` · ${y}`:``]}),(0,B.jsx)(`h4`,{children:c?.conversation.name??t})]}),c===void 0?(0,B.jsx)(jd,{className:`transcript-state-placeholder`}):(0,B.jsx)(Ep,{state:c.conversation.state})]}),(0,B.jsx)(Ad,{className:`my-2.5`}),a.loading?(0,B.jsxs)(`div`,{className:`conversation-loading`,children:[(0,B.jsx)(`div`,{className:`conversation-timeline-sticky conversation-timeline-placeholder`,children:(0,B.jsx)(jd,{className:`h-full w-full`})}),(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,B.jsx)(jd,{className:`h-2 w-40`}),(0,B.jsx)(jd,{className:`h-2 w-24`}),`Loading transcript…`]})]}):c===void 0?(0,B.jsxs)(bi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Transcript unavailable`}),(0,B.jsxs)(Si,{children:[(0,B.jsx)(`p`,{children:a.error?.message??`The server recorded no transcript.`}),i.rowKind===`event`&&Object.keys(i.event.fields??{}).length>0&&(0,B.jsx)(i0,{value:i.event.fields??{}})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`conversation-timeline-sticky`,ref:h,children:(0,B.jsx)(u1,{children:(0,B.jsx)(Ip,{cursor:m.cursor,...g===void 0?{}:d===void 0?{focus:g}:{expanded:!0},onSelectTurn:m.scrollTo,turns:[...p]})})}),(0,B.jsxs)(`div`,{className:`conversation-turns`,ref:m.containerRef,children:[d!==void 0&&_!==void 0&&(0,B.jsx)(j1,{absence:d,turnId:_}),f.slice(0,o).map(e=>(0,B.jsxs)(`div`,{ref:t=>m.register(e.id,t),children:[(0,B.jsx)(M1,{turn:e}),(0,B.jsx)(KC,{author:{label:v},...g?.turnId===e.id?{focus:g}:{},turn:e}),(0,B.jsx)(w1,{turn:e})]},e.id)),u!==void 0&&(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`conversation-focus-room`})]}),f.length>o&&(0,B.jsxs)(Gi,{onClick:()=>s(o+b1),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,f.length,` turns`]})]})]})})}function P1({row:e,client:t,runId:n,reference:r}){let i=e.rowKind===`span`?e.span.detail:void 0,a=i?.artifact_id??(r?.kind===`gate_log`?r.value:void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Result`}),(0,B.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,B.jsx)(`pre`,{children:i.output_tail})]}),(0,B.jsx)(e1,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function F1({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(e1,{artifactId:e,client:t,heading:`Worker report`,missing:`This settlement recorded no report.`,noun:`report`,runId:i,unreadable:`This run kept no readable copy of that report.`}),(0,B.jsx)(U1,{reference:n,row:r})]})}function I1({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,B.jsx)(W1,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,B.jsx)(rt,{size:13})]})}):r?.branch_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,B.jsx)(rt,{size:13})]})}):!r?.pr_url&&(0,B.jsx)(W1,{fallback:`No publication was recorded.`,reference:t}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,B.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.name}),(0,B.jsx)(`dd`,{children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function L1({redirection:e,row:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Delivery`}),(0,B.jsx)(`dd`,{children:e.delivered?`Live — into the turn that was already running`:`Deferred — onto the node's next dispatch`})]}),e.turn!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Turn`}),(0,B.jsx)(`dd`,{children:e.turn===`turn-end`?`Left to end — the note reached it as it ended`:`Interrupted — its replacement opened on the note`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Redirected at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Member`}),(0,B.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Note`}),(0,B.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,B.jsx)(R1,{row:t})]}),e.reason!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function R1({row:e}){let t=e.rowKind===`event`?Ne(e.event):void 0;return t===void 0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Author`}),(0,B.jsx)(`dd`,{children:t})]})}function z1({client:e,event:t,reference:n,runId:r}){let i=t.fields??{},a=e=>typeof i[e]==`string`?i[e]:void 0,o=Ne(t),s=a(`summary`),c=a(`node`),l=a(`reason`),d=[[`Author`,o],[`Summary`,s],[`Node`,c]],f=a(`full_reason`)!==void 0&&n?.kind===`refusal`?t1(n.value):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Refused edit`,className:`refusal`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.at,relative:!0})})]}),d.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e)),i.command!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command as sent`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(a0,{value:i.command})})]})]}),f===void 0?l===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:`The record holds no reason.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:l})]}):(0,B.jsx)(V1,{artifactId:f,client:e,cut:i.full_reason_truncated===!0,runId:r})]})}var B1=new Set([`author`,`summary`,`node`,`command`,`reason`,`full_reason`,`full_reason_truncated`]);function V1({artifactId:e,client:t,cut:n,runId:r}){let i=VN(`${r}/${e}`,()=>t.getArtifact(r,e),0),a=i.value?.content;return(0,B.jsxs)(B.Fragment,{children:[n&&(0,B.jsx)(`p`,{className:`detail-note`,role:`note`,children:`The hook wrote more than the engine reads, so its output was cut at the engine's read bound.`}),i.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading the complete refusal…`}):a===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`This run holds no readable copy of the complete refusal.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Complete refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:a})]})]})}function H1({surface:e,row:t}){let n=[[`Kind`,e.kind],[`Raised by`,e.source],[`Blocking`,e.blocking===void 0?void 0:e.blocking?`yes — dependents wait on the answer`:`no — nothing waits on it`]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function U1({row:e,reference:t}){if(e.rowKind===`event`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]})}),t!==void 0&&(0,B.jsx)(W1,{reference:t,fallback:`No recorded artifact.`})]});let n=e.rowKind===`group`?void 0:e,r=e.rowKind===`span`&&e.span.count!==void 0?`${e.span.count} records`:void 0,i=(e.rowKind===`span`?e.span.reasons:void 0)??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Ended`}),(0,B.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,B.jsx)(u,{at:e.endedAt,relative:!0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Duration`}),(0,B.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:be(e.durationMs)})]}),r!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Aggregated`}),(0,B.jsx)(`dd`,{children:r})]}),i.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Waiting on`}),(0,B.jsx)(`dd`,{children:i.map(_).join(` and `)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Step`}),(0,B.jsx)(`dd`,{children:Q1(n)??`None`})]}),(0,B.jsx)(R1,{row:e})]}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,B.jsx)(W1,{fallback:e.rowKind===`span`&&e.span.kind===`dispatch`?`No transcript was recorded for this dispatch.`:`This item points at no recorded artifact.`,reference:t})]})}function W1({reference:e,fallback:t}){return e===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.kind===`pr`?T$(e.value):e.value,` `,(0,B.jsx)(rt,{size:13})]})}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[(0,B.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,B.jsx)(`code`,{children:e.value})]})}function G1(e){if(e.rowKind!==`span`)return e.id;let t=e.span.events.at(-1);return[e.span.id,e.span.status??``,e.span.ended_at??``,e.span.events.length,t?.id??``,t?.at??``,t?.status??``].join(`|`)}function K1(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function q1(e){return e.rowKind===`event`?e.event.redirection:void 0}function J1(e){return e.rowKind===`event`?e.event.release:void 0}function Y1(e){return e.rowKind===`event`?e.event.surface:void 0}function X1(e){return e?.kind===`conversation`}function Z1(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function Q1(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function $1(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function e0(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function t0(e,t){return r(e,t)}function n0({client:e,event:t,shown:n}){let r=n===void 0?t.fields??{}:Object.fromEntries(Object.entries(t.fields??{}).filter(([e])=>!n.has(e)));if(n!==void 0&&Object.keys(r).length===0)return null;let i=t.kind===`command-started`?ue(r.command):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Recorded fields`,className:`record-content`,children:[t.surface_state!==void 0&&(0,B.jsx)(c0,{state:t.surface_state}),t.kind===`human-attested`&&(0,B.jsx)(l0,{client:e,item:r.item}),(t.kind===`node-held`||t.kind===`node-unheld`)&&(0,B.jsx)(u0,{event:t}),(t.kind===`edit-committed`||t.kind===`command-accepted`)&&(0,B.jsx)(d0,{operations:r.operations}),i!==void 0&&(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(i)})})]})}),Object.keys(r).length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This record holds no fields.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Recorded fields`}),(0,B.jsx)(i0,{value:i===void 0?r:Object.fromEntries(Object.entries(r).filter(([e])=>e!==`command`))})]})]})}function r0(e){let t=e.replaceAll(/[_-]+/gu,` `).trim();return t.length===0?e:`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function i0({value:e}){return(0,B.jsx)(`dl`,{className:`facts record-fields`,children:Object.entries(e).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r0(e)}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(a0,{value:t})})]},e))})}function a0({value:e}){if(e==null)return(0,B.jsx)(`span`,{className:`record-none`,children:`None`});if(typeof e==`string`)return(0,B.jsx)(`span`,{className:`record-text`,children:e});if(typeof e==`number`||typeof e==`boolean`)return(0,B.jsx)(B.Fragment,{children:String(e)});if(Array.isArray(e))return e.length===0?(0,B.jsx)(`span`,{className:`record-none`,children:`None`}):(0,B.jsx)(`ol`,{className:`record-list`,children:e.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(a0,{value:e})},t))});let t=o0(e);return t===void 0?(0,B.jsx)(B.Fragment,{children:String(e)}):(0,B.jsx)(i0,{value:t})}function o0(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function s0(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()!==``?n:void 0}function c0({state:e}){let{status:t}=d(e),n=e.reply,r=[[`Queued`,e.queued_at],[`Read`,e.read_at],[`Answered`,e.replied_at]];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{className:`detail-heading`,children:[`Surface `,e.id]}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:t})]}),r.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t===void 0?`Not yet`:(0,B.jsx)(u,{at:t})})]},e)),e.correlation!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Correlation`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:e.correlation})})]})]}),n!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reply`}),(0,B.jsx)(i0,{value:n})]})]})}function l0({client:e,item:t}){let n=o0(t),r=s0(n,`id`),i=o0(n?.resolution),a=s0(i,`choice`),o=VN(a===void 0?void 0:r,()=>e.getHumanItem(r??``),0);if(n===void 0)return(0,B.jsx)(`p`,{className:`detail-note`,children:`Attested with no human item resolved: the planner attested it itself.`});let s=o.value?.item.choices?.find(e=>e.id===a)?.title,c=[[`Item`,r],[`Action`,s0(n,`action`)],[`By`,s0(i,`actor`)],[`On behalf of`,s0(i,`on_behalf_of`)],[`Provenance`,s0(i,`provenance`)??`manager`],[`Choice`,a===void 0?void 0:s===void 0?a:`${s} (${a})`],[`Reason`,s0(i,`reason`)]],l=s0(i,`text`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Human item`}),(0,B.jsx)(`dl`,{className:`facts`,children:c.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),l!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Words`}),(0,B.jsx)(`p`,{className:`detail-note record-text`,children:l})]})]})}function u0({event:e}){let t=fe(e);return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:e.kind===`node-held`?`Held because`:`Released from`}),(0,B.jsx)(`ul`,{className:`hold-reasons`,children:t.map((e,t)=>(0,B.jsx)(`li`,{children:_(e)},t))})]})}function d0({operations:e}){return!Array.isArray(e)||e.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Operations`}),(0,B.jsx)(`ol`,{className:`record-operations`,children:e.map((e,t)=>{let n=o0(e);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:s0(n,`kind`)??`Operation ${t+1}`}),n===void 0?(0,B.jsx)(a0,{value:e}):(0,B.jsx)(i0,{value:n})]},t)})})]})}var f0=`span:`,p0=500,m0=ae,h0=e=>500*2**(e-1),g0=e=>e.record_id??e.id,_0=hM.omit({events:!0});function v0(e,t){if(t===void 0)return e;let n=new Set(e.events.map(g0)),r=t.filter(e=>!n.has(g0(e)));if(r.length===0)return e;let i=[...e.events,...r].map(e=>[Date.parse(e.at),e.journal_order??0,e]);return i.sort((e,t)=>e[0]-t[0]||e[1]-t[1]),{...e,events:i.map(([,,e])=>e)}}function y0(e){let t=e.flatMap(e=>{let t=e.events_total;if(t===void 0||t<=e.events.length)return[];let n=e.events[0],r=Date.parse(e.started_at),i=n===void 0?Date.parse(e.ended_at??e.started_at):Date.parse(n.at);return i>r?[[r,i]]:[]}).sort((e,t)=>e[0]-t[0]),n=[];for(let[e,r]of t){let t=n.at(-1);t!==void 0&&e<=t[1]?t[1]=Math.max(t[1],r):n.push([e,r])}return n}function b0({client:e,runId:t,scope:n,nodeId:r,timeline:i}){let a=(0,z.useRef)(new Map),o=(0,z.useRef)(new Map),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),[u,d]=(0,z.useState)(()=>new Map),f=(0,z.useCallback)(()=>l(e=>e+1),[]),p=(0,z.useCallback)(e=>{for(let t of e.rows)a.current.set(g0(t),t)},[]),m=(0,z.useCallback)(e=>{d(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),h=(0,z.useCallback)((e,t,n)=>{s.current.delete(e),d(r=>new Map(r).set(e,{message:t instanceof Error?t.message:String(t),retry:n})),f()},[f]),g=(0,z.useMemo)(()=>{if(i===void 0)return i;if(n===`node`)for(let e of i.spans)for(let t of e.events)a.current.has(g0(t))||a.current.set(g0(t),{...t,span_id:e.id});let e=new Map;for(let t of a.current.values()){let n=e.get(t.span_id);n===void 0?e.set(t.span_id,[t]):n.push(t)}return e.size===0&&o.current.size===0?i:{...i,spans:i.spans.map(t=>{let n=v0(t,e.get(t.id)),r=o.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[i,c,n]),_=x0({client:e,runId:t,nodeId:n===`node`?r:void 0,opened:i!==void 0,take:p,bump:f}),v=_?.state===`loading`,y=(0,z.useMemo)(()=>n!==`node`||!v?[]:y0(g?.spans??[]),[g,n,v]),b=_?.failure??[...u].find(([e])=>!e.startsWith(f0))?.[1],x=(0,z.useCallback)(e=>u.get(`${f0}${e}`),[u]),S=(0,z.useCallback)(e=>m(`${f0}${e}`),[m]),C=(0,z.useCallback)(async(r,i,a)=>{m(r);try{let r;for(;;){let a=await e.getTimelineEvents(t,{scope:n,limit:p0,...i,...r===void 0?{}:{cursor:r}});p(a);let{span:s}=a;if(i.span!==void 0&&s!==void 0&&o.current.set(i.span,_0.parse(s)),f(),a.next_cursor===null)return;r=a.next_cursor}}catch(e){h(r,e,a)}},[f,m,e,h,t,n,p]),w=(0,z.useCallback)(e=>{let t=`${f0}${e}`;s.current.has(t)||(s.current.add(t),C(t,{span:e,...r===void 0?{}:{node:r}},()=>w(e)))},[r,C]),T=(0,z.useCallback)(e=>{let t=`row:${e??``}`;s.current.has(t)||(s.current.add(t),C(t,e===void 0?{}:{node:e},()=>T(e)))},[C]),E=(0,z.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;s.current.has(r)||(s.current.add(r),C(r,{...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>E(e,t,n)))},[C]);return{...g===void 0?{}:{timeline:g},unheld:y,loadSpan:w,loadRow:T,loadStretch:E,spanFailure:x,forgetSpan:S,...b===void 0?{}:{failure:b},..._===void 0?{}:{nodeLoad:S0(_)}}}function x0({client:e,runId:t,nodeId:n,opened:r,take:i,bump:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(0);if((0,z.useEffect)(()=>{if(n===void 0||!r)return;let o=new AbortController,c=new Set,u,d=()=>u!==void 0&&c.size>=u,f=!1,p,m=(e,t)=>s({node:n,state:e,loaded:c.size,...u===void 0?{}:{total:u},partial:e===`loading`&&f,...t===void 0?{}:{failure:t}}),h=setTimeout(()=>{f=!0,s(e=>e?.node===n&&e.state===`loading`?{...e,partial:!0}:e)},m0),g=async r=>{try{for await(let r of e.streamNodeTimeline(t,n,o.signal)){if(r.kind===`start`)u=r.total;else{i(r);for(let e of r.rows)c.add(g0(e));a()}d()&&clearTimeout(h),m(d()?`held`:`loading`)}clearTimeout(h),m(`held`),a()}catch(e){if(o.signal.aborted||d())return;if(r<3){p=setTimeout(()=>void g(r+1),h0(r));return}clearTimeout(h),m(`failed`,{message:e instanceof Error?e.message:String(e),retry:()=>l(e=>e+1)})}};return m(`loading`),g(1),()=>{o.abort(),clearTimeout(h),p!==void 0&&clearTimeout(p)}},[e,t,n,r,i,a,c]),!(n===void 0||o?.node!==n))return o}function S0(e){return{state:e.state,loaded:e.loaded,...e.total===void 0?{}:{total:e.total},partial:e.partial}}var C0=`This node is not on the run's graph, so the plan holds no task for it.`;function w0({client:n,runId:r,node:i,nodes:a,timeline:o,timelineError:s,hiddenTypes:c=[],onHiddenTypesChange:l=()=>{},runLoaded:u=!0,onRetry:d,selectedItemId:f,onSelectItem:p,onBack:m,selectedTab:h,onSelectTab:g}){let _=(0,z.useMemo)(()=>t(o,i.id),[o,i.id]);(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(f===void 0?m():p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,p,f]);let v=i.detail?.publication===void 0?i.result?.pr??void 0:i.detail.publication.pr_url;return(0,B.jsx)(`section`,{"aria-label":`Timeline for ${i.label}`,className:`node-view`,children:(0,B.jsxs)(jf,{className:`node-tabs`,onValueChange:e=>{MQ(e)&&g(e)},value:h,children:[(0,B.jsxs)(`section`,{"aria-label":`Node header`,className:`node-view-head`,children:[(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,B.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(Gi,{onClick:m,size:`sm`,type:`button`,variant:`ghost`,children:[(0,B.jsx)(Ve,{size:14}),` Graph`]})}),(0,B.jsx)(`li`,{"aria-current":`page`,children:(0,B.jsx)(`span`,{className:`breadcrumb-node`,children:i.label})})]})}),(0,B.jsxs)(`div`,{className:`node-view-facts`,children:[(0,B.jsx)(dQ,{className:`node-view-state`,state:i.status}),(0,B.jsx)(I$,{control:i.control}),(0,B.jsxs)(`span`,{className:`node-view-meta`,children:[pe(i),` node ·`,` `,u?`${i.telemetry?.turns??0} turns · ${i.telemetry?.lint??0} lint turns`:`turns ${oe}`]}),v!==void 0&&(0,B.jsxs)(`a`,{className:`node-view-pr`,href:v,rel:`noreferrer`,target:`_blank`,children:[T$(v),` `,(0,B.jsx)(rt,{size:12})]})]}),(0,B.jsx)(Nf,{"aria-label":`Node details`,variant:`line`,children:Object.entries(jQ).map(([e,t])=>(0,B.jsx)(Pf,{value:e,children:t},e))})]}),(0,B.jsx)(I0,{node:i,nodes:a}),(0,B.jsx)(P0,{node:i}),(0,B.jsx)(F0,{node:i}),(0,B.jsxs)(Ff,{className:`node-tab-panel`,value:`task`,children:[i.task===void 0?(0,B.jsx)(`p`,{children:C0}):u?(0,B.jsx)(eX,{source:j0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Settled as`}),(0,B.jsx)(`dd`,{children:L0(i.result?.outcome)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:L0(i.result?.detail)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Graph overrides`}),(0,B.jsx)(`dd`,{children:u?(i.task?.sets??[]).length===0?`None`:(0,B.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:i.task?.sets?.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`code`,{children:e})},t))}):oe})]})]})]}),(0,B.jsx)(Ff,{className:`node-tab-panel`,value:`criteria`,children:i.task===void 0?(0,B.jsx)(`p`,{children:C0}):u?(0,B.jsx)(eX,{source:M0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe})}),(0,B.jsx)(Ff,{className:`node-tab-panel`,value:`dependencies`,children:(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Dependencies`}),(0,B.jsx)(`dd`,{children:(i.task?.deps??[]).map(e=>{let t=a.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unblocks`}),(0,B.jsx)(`dd`,{children:i.dependents.join(`, `)||`None`})]})]})}),(0,B.jsxs)(Ff,{className:`node-tab-panel`,value:`remote`,children:[!u&&(0,B.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,B.jsxs)(`dl`,{className:`facts`,hidden:!u,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Publication`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(N0,{node:i})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Branch`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?.branch??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Merge`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?i.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Release`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(Q$,{node:i})})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Verification coverage`}),(0,B.jsxs)(`dd`,{children:[`Hook:`,` `,i.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,i.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Observed checks`}),(0,B.jsx)(`dd`,{children:(i.detail?.verification.checks??[]).length===0?`No checks observed`:(0,B.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Runtime`}),(0,B.jsx)(`th`,{children:`Required`})]})}),(0,B.jsx)(`tbody`,{children:i.detail?.verification.checks?.map(e=>(0,B.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,B.jsx)(`th`,{scope:`row`,children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,B.jsx)(`td`,{children:(0,B.jsx)(F$,{check:e})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(j$,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,B.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,B.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,B.jsx)(`path`,{d:`M6 0.5 L11 2.5 V6 C11 9 8.5 11 6 11.5 C3.5 11 1 9 1 6 V2.5 Z`,fill:`currentColor`}):(0,B.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`2 1.5`})}),e.required?`Required`:`Optional`]})]},e.name))})]})})]})]})]}),(0,B.jsx)(Ff,{className:`node-timeline-panel`,value:`timeline`,children:s===void 0?o===void 0?(0,B.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):_.rows.length===0?(0,B.jsxs)(Ki,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,B.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,B.jsx)(T0,{client:n,hiddenTypes:c,node:i,onHiddenTypesChange:l,onSelectItem:p,runId:r,selectedItemId:f,timeline:o}):(0,B.jsxs)(bi,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Timeline unavailable`}),(0,B.jsxs)(Si,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Gi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})})}function T0({client:e,hiddenTypes:t,node:n,onHiddenTypesChange:r,onSelectItem:i,runId:s,selectedItemId:c,timeline:l}){let u=b0({client:e,runId:s,scope:`node`,nodeId:n.id,timeline:l}),d=u.timeline??l,f=(0,z.useMemo)(()=>de(d,n.id),[d,n.id]),p=(0,z.useMemo)(()=>new Set(t),[t]),_=(0,z.useMemo)(()=>o(f.tree,p),[f.tree,p]),v=(0,z.useMemo)(()=>ze(f.tree),[f.tree]),[y,x]=(0,z.useState)(()=>new Set),S=(0,z.useMemo)(()=>c===void 0?[]:h(_,c).filter(e=>e.rowKind===`group`).map(({id:e})=>e),[_,c]),C=(0,z.useMemo)(()=>S.length===0?y:new Set([...y,...S]),[y,S]),w=(0,z.useMemo)(()=>m(_,C),[_,C]),T=(0,z.useMemo)(()=>g(w).map(e=>({id:e.id,time:Date.parse(e.startedAt)})),[w]);D0(f,w);let E=u.nodeLoad?.state===`loading`,D=(0,z.useRef)(T);E||(D.current=T);let O=Lp(E?D.current:T),[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(),N=(0,z.useMemo)(()=>F(f.items,f.lanes),[f.items,f.lanes]),P=(0,z.useMemo)(()=>Fe(f.markers,f.items,c),[f.items,f.markers,c]),I=(0,z.useMemo)(()=>E0([...f.items,...f.markers.map(({at:e})=>({start:e}))]),[f.items,f.markers]),ee=(0,z.useMemo)(()=>E0([...k?f.items:N,...P.map(({at:e})=>({start:e}))]),[k,f.items,N,P]),L=O.cursor===void 0?void 0:Math.min(Math.max(O.cursor,I[0]),I[1]),te=c===void 0?void 0:a(_,c)??a(f.rows,c),ne=(0,z.useRef)(0),re=e=>{ne.current=Date.now()+500,i(e),O.scrollTo(e)},ie=(0,z.useRef)(re);ie.current=re;let ae=(0,z.useCallback)(e=>ie.current(e),[]),oe=(0,z.useRef)(null),{containerRef:se}=O,ce=(0,z.useCallback)(e=>{oe.current=e,se(e)},[se]),le=(0,z.useRef)(null),ue=l1(),{loadSpan:fe,forgetSpan:pe}=u,me=te?.rowKind===`span`?te.span.id:void 0;(0,z.useEffect)(()=>{if(me!==void 0)return fe(me),()=>pe(me)},[me,fe,pe]);let he=me===void 0?void 0:u.spanFailure(me),{scrollTo:ge}=O;return(0,z.useEffect)(()=>{c!==void 0&&(ne.current=Date.now()+500,ge(c))},[c,ge]),(0,B.jsxs)(`div`,{className:`node-execution`,"data-expanded":k,children:[(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:le,children:[(0,B.jsx)(W$,{container:le,partial:u.nodeLoad?.partial===!0,range:j??ee,stretches:u.unheld}),u.nodeLoad?.partial===!0&&(0,B.jsx)(H$,{load:u.nodeLoad}),(0,B.jsx)(on,{...D$,axis:{origin:I[0]},cursor:L,expanded:k,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:k?f.items:N,lanes:f.lanes,markers:P,onExpandedChange:A,onHover:ue,onRangeChange:e=>M(e[0]<=ee[0]&&e[1]>=ee[1]?void 0:k$(e)),onSelect:e=>re(e.id),range:j??ee,selectedId:c})]}),(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node transcript`,className:`node-transcript`,ref:ce,children:[u.failure!==void 0&&(0,B.jsx)(B$,{failure:u.failure,what:`This node's timeline`}),(0,B.jsx)(L$,{counts:v,hidden:p,onHiddenChange:r}),_.length===0&&f.tree.length>0&&(0,B.jsx)(R$,{onClear:()=>r([])}),b(w).map(e=>{let t=(0,B.jsx)(O0,{entries:e.entries,onOpen:ae,onToggle:e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),register:O.register,selectedItemId:c},e.id);return e.dispatch===void 0?(0,B.jsx)(z.Fragment,{children:t},e.id):(0,B.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,B.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),te!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Gi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(S1,{client:e,node:n,row:te,runId:s}),he!==void 0&&(0,B.jsx)(B$,{failure:he})]})]})}function E0(e){let t=e.map(({start:e})=>e),n=e.map(e=>e.end??e.start);if(t.length===0)return[0,1];let r=Math.min(...t),i=Math.max(...n);return[r,i>r?i:r+1]}function D0(e,t){(0,z.useLayoutEffect)(()=>{let n=window.__nodeLoadProbe;if(n===void 0)return;let r=[],i=e=>{r.push(e.id);for(let t of e.children)i(t)};for(let e of t)if(e.entryKind===`row`)r.push(e.row.id);else for(let t of e.group.children)i(t);n({chart:[...e.items.map(e=>e.id),...e.markers.map(e=>e.id)],list:r})},[e,t])}function O0({entries:e,onOpen:t,onToggle:n,register:r,selectedItemId:i}){return e.map(e=>e.entryKind===`row`?(0,B.jsx)(A0,{onOpen:t,register:r,row:e.row,selected:e.row.id===i||i!==void 0&&e.row.aliases?.includes(i)===!0},e.row.id):(0,B.jsx)(z$,{entry:e,onToggle:()=>n(e.group.id),children:(0,B.jsx)(O0,{entries:e.entries,onOpen:t,onToggle:n,register:r,...i===void 0?{}:{selectedItemId:i}})},e.group.id))}function k0(e,t){let[n,r]=[e.row,t.row];return e.selected===t.selected&&e.register===t.register&&e.onOpen===t.onOpen&&n.id===r.id&&n.rowKind===r.rowKind&&n.displayLabel===r.displayLabel&&n.displayKind===r.displayKind&&n.startedAt===r.startedAt&&n.durationMs===r.durationMs&&n.status===r.status&&n.statusAt===r.statusAt&&n.sessionName===r.sessionName&&n.dispatch?.label===r.dispatch?.label&&(n.rowKind===`event`&&r.rowKind===`event`?n.category===r.category&&n.event.seq===r.event.seq:n.rowKind!==`event`&&r.rowKind!==`event`)}var A0=(0,z.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,z.useCallback)(e=>n(i,e),[n,i]);return(0,B.jsx)(`article`,{"aria-current":t?`true`:void 0,"aria-label":e.displayLabel,className:`transcript-item`,"data-dispatch-group":e.dispatch?.label,"data-journal-seq":e.rowKind===`event`?e.event.seq:void 0,"data-row-id":e.id,"data-selected":t,ref:a,children:(0,B.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,B.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,B.jsx)(O,{category:e.category}),e.displayKind]}),(0,B.jsx)(`strong`,{className:`transcript-label`,title:e.displayLabel,children:e.displayLabel}),(0,B.jsxs)(`span`,{className:`transcript-facts`,children:[(0,B.jsx)(u,{at:e.startedAt}),e.durationMs!==null&&` · ${be(e.durationMs)}`,` · ${e.status??`recorded`}`,e.statusAt!==void 0&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(u,{at:e.statusAt})]}),e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},k0);function j0(e){if(e.task!==void 0)return e.task;let t=e.steps??[];return t.length===0?`No task prose recorded.`:t.map(e=>`## ${e.id}\n\n${e.task}`).join(`
|
|
105
|
+
`)&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let e of i){let t=n.current.get(e.getAttribute(`data-row-key`)??``),r=a.get(e.getAttribute(`data-row-key`)??``);t===void 0||r===void 0||t===r||e.animate([{transform:`translateY(${t-r}px)`},{transform:`translateY(0)`}],{duration:HQ,easing:`ease-out`})}n.current=a},[e,t])}function GQ({rows:e,failed:t=!1,selectedRunId:n,onSelect:r,onOpenProject:i,onHost:a,hostCurrent:o=!1,onActionItems:s,actionItemsCurrent:c=!1,hiddenKinds:l,onKindsChange:u,updates:d,drawerOpen:f=!1,drawerRef:p}){let{kinds:m,groups:h}=VQ(e,l,n,i??r),g=(0,z.useRef)(null);return WQ(g,h),(0,B.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,B.jsx)(_d,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,B.jsxs)(`div`,{className:`brand`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,B.jsx)(Be,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,B.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,B.jsx)(Ad,{className:`my-[22px]`}),(0,B.jsxs)(`div`,{className:`nav-pages`,children:[(0,B.jsx)(Gi,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,B.jsx)(Gi,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!l.includes(e),onChange:t=>u(t.target.checked?l.filter(t=>t!==e):[...l,e])}),e]},e))]})]}),d,e===void 0?(0,B.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,B.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,B.jsxs)(`div`,{className:`project-row`,[UQ]:`project:${e.key}`,children:[(0,B.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,B.jsx)(Ge,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,B.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,B.jsx)(`span`,{className:`project-name`,children:e.label}),(0,B.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,B.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,B.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,zQ(e)].filter(Boolean).join(` · `);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:`run-link`,"data-active":t,onClick:()=>r(e.id),title:i,type:`button`,"data-row-key":`run:${e.id}`,children:[(0,B.jsxs)(Sp,{children:[(0,B.jsx)(Cp,{asChild:!0,children:(0,B.jsx)(`span`,{role:`img`,"aria-label":e.state,className:k(`run-dot`,pQ(e.state))})}),(0,B.jsx)(wp,{children:e.state})]}),(0,B.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,B.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,B.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function KQ(){let[e,t]=(0,z.useState)(!1),n=(0,z.useRef)(null),r=(0,z.useRef)(null),i=(0,z.useRef)(!1),a=(0,z.useCallback)(()=>t(!1),[]),o=(0,z.useCallback)(()=>t(e=>!e),[]);return(0,z.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t(!1)},i=()=>{n.current?.offsetParent===null&&t(!1)};return document.addEventListener(`keydown`,r),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`keydown`,r),window.removeEventListener(`resize`,i)}},[e]),(0,z.useEffect)(()=>{e?r.current?.querySelector(`button`)?.focus():i.current&&n.current?.focus(),i.current=e},[e]),{open:e,close:a,toggle:o,menuButton:n,drawer:r}}function qQ(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useRef)(void 0),a=(0,z.useRef)(t);a.current=t;let o=e===`live`,s=(0,z.useRef)(o);s.current=o;let c=(0,z.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,z.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,z.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,z.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,z.useEffect)(()=>{o&&l()},[o,l]),(0,z.useEffect)(()=>{if(typeof e!=`number`)return;let t=setInterval(l,e*1e3);return()=>clearInterval(t)},[e,l]),{waiting:n,show:c,take:l,offer:u,drop:d}}function JQ(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),[o,s]=(0,z.useState)({}),c=(0,z.useRef)([]),[l,u]=(0,z.useState)(),[d,f]=(0,z.useState)(),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(),[_,v]=(0,z.useState)(),[y,b]=(0,z.useState)(),[x,S]=(0,z.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?LQ(l)[0]?.id:void 0,T=(0,z.useMemo)(()=>t.humanItems??Me(t.host?void 0:w,t.view,t.nodeId),[t.humanItems,t.host,w,t.view,t.nodeId]),E=(0,z.useRef)(void 0),D=(0,z.useRef)(T);D.current=T;let O=(0,z.useRef)(t.first),k=qQ(t.navigationUpdates,f),A=qQ(t.mainUpdates,(0,z.useCallback)(e=>{r(e.state),a(e.view);let{visible:t}=e.state;if(t.type===`human-items`){let{items:n,detail:r}=t;s({items:n,detail:r,...e.view.type===`human-items`&&e.view.item!==void 0?{item:e.view.item}:{}})}m(new Date().toISOString()),e.reset!==void 0&&b(`The live view was re-sent whole: ${e.reset}.`)},[])),j=t.navigationUpdates!==`off`||t.mainUpdates!==`off`,M=(0,z.useRef)(j);M.current=j,(0,z.useEffect)(()=>{g(void 0);let t=!0,n=O.current;if(O.current=void 0,n?.error!==void 0){g(n.error);return}let r=e.live({view:D.current,paused:!M.current,...n?.answer!==void 0&&JSON.stringify(n.address.view)===JSON.stringify(D.current)?{initial:n.answer}:{},onState:(e,n)=>{let i=c.current;e.sidebar!==void 0&&(c.current=e.sidebar,u(e.sidebar)),g(void 0),v(void 0);let a={state:e,view:r.view,...n.kind===`reset`?{reset:n.reason}:{}};if(n.kind===`snapshot`){if(A.show(a),e.sidebar!==void 0){if(t)k.show(e.sidebar);else if(i!==e.sidebar){let t=BQ(i,e.sidebar);t>0&&k.offer(e.sidebar,t)}}t=!1;return}if(n.kind===`reset`){e.sidebar!==void 0&&k.offer(e.sidebar),A.offer(a);return}if(n.frame.type===`sidebar.snapshot`){k.show(n.frame.rows);return}let o=n.frame.type===`run.changed`||n.frame.type===`run.removed`;o&&e.sidebar!==void 0&&k.offer(e.sidebar),(!o||e.visible.type===`sidebar`)&&A.offer(a)},onError:e=>{if(r.view.type===`human-items`){s(t=>({...t.items===void 0?{}:{items:t.items},error:e.message})),r.change({type:`sidebar`});return}if(e instanceof EN&&(e.code===`run_not_found`||e.code===`node_not_found`)){r.change({type:`sidebar`});return}g(e)},onDisconnected:()=>v(Error(`Live telemetry stream disconnected`)),onConnected:()=>v(void 0)});return E.current=r,()=>{r.close(),E.current===r&&(E.current=void 0)}},[e,x,A.show,A.offer,k.show,k.offer]),(0,z.useEffect)(()=>{JSON.stringify(E.current?.view)!==JSON.stringify(T)&&A.drop(),E.current?.change(T),T.type!==`human-items`&&s(e=>Object.keys(e).length===0?e:{})},[T,A.drop]),(0,z.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,z.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,z.useCallback)(()=>{b(void 0),N(),S(e=>e+1)},[N]),F=n?.visible,I=F!==void 0&&F.type!==`sidebar`&&F.type!==`human-items`&&F.run_id===w&&YQ(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,ee=(0,z.useRef)(void 0),L=I?.detail??(ee.current?.run.run_id===w?ee.current:void 0);ee.current=L;let te=(0,z.useMemo)(()=>XQ(L),[L]),ne=h!==void 0&&T.type===`timeline`&&L!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:L,timeline:I&&`timeline`in I?I.timeline:void 0,humanItems:o,timelineError:ne?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:te,error:ne?_:h??_,notice:y,refresh:P}}function YQ(e,t){return t.type===e.type?t.type===`timeline`&&e.type===`timeline`?t.scope===e.scope&&(t.scope===`run`||e.scope===`node`&&e.node===t.node):!0:!1}function XQ(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=Gj.safeParse(t);return n.success?n.data:[]}var ZQ={minutes:60,seconds:1},QQ=e=>Object.hasOwn(ZQ,e),$Q=600%ZQ.minutes==0?{amount:String(600/ZQ.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function e$(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*ZQ[e.unit];return Number.isSafeInteger(n)?n:void 0}function t$(e){if(e===0)return`no grace`;let t=Math.floor(e/60),n=e%60,r=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return t===0?r(n,`second`):n===0?r(t,`minute`):`${r(t,`minute`)} ${r(n,`second`)}`}function n$(e){return e.map(e=>({runId:e.run_id,owner:Te(e.launch)}))}function r$(e,t){return t instanceof EN&&t.status!==void 0&&t.code!==void 0?{phase:`refused`,sent:e,error:t}:{phase:`lost`,sent:e,error:t instanceof Error?t:Error(String(t))}}var i$={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function a$(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(i$);return n.flatMap(e=>{if(!r.has(e.run_id))return[];let n=e.last_event;if(n===null||!i.includes(n))return[];let a=t.get(e.run_id);return a!==void 0&&a.last_event===n&&a.last_progress_at===e.last_progress_at?[]:[{runId:e.run_id,recorded:n===i$.hostShutdown?i$.hostShutdown:i$.dispatchStopped}]})}function o$(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function s$(e){return(0,z.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.owner,(t.get(n.owner)??0)+1);return[...t].map(([e,t])=>({owner:e,count:t}))},[e])}var c$=`Each live dispatch is asked to stop and commit, and given the grace to end itself; whatever is still standing then is torn down, and every branch the run's records name is pushed to its origin. Nothing is sent until you confirm.`;function l$({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)($Q),[l,u]=(0,z.useState)(!1),d=e$(s),f=n!==void 0&&r===void 0,p=()=>{c($Q),u(!1),t(!1)};return(0,B.jsx)(Ds,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,B.jsxs)(js,{className:`shutdown-dialog`,children:[(0,B.jsxs)(Ms,{children:[(0,B.jsx)(Ps,{children:`Shut down the entire host?`}),(0,B.jsx)(Fs,{children:c$})]}),(0,B.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,B.jsx)(d$,{caption:`It acts on all ${u$(n.length)} on this host, over their owners — each is interrupted, torn down and pushed:`,label:`Runs on this host`,runs:n,warning:!0}):(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,B.jsxs)(`p`,{className:`shutdown-scope-note`,children:[i===1?`1 run root on this host could not be read`:`${i} run roots on this host could not be read`,`: the engine cannot read them either, so this shutdown signals nothing in them and pushes none of their branches.`]}),(0,B.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,B.jsx)(`legend`,{children:`Grace`}),(0,B.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,B.jsx)(zs,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,B.jsx)(Is,{"aria-describedby":`${o}-grace-help`,"aria-invalid":d===void 0,id:`${o}-grace`,inputMode:`numeric`,min:0,onChange:e=>c({...s,amount:e.target.value}),step:1,type:`number`,value:s.amount}),(0,B.jsx)(zs,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,B.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;QQ(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(ZQ).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(`p`,{className:`channel-age`,id:`${o}-grace-help`,children:d===void 0?`The grace is a whole number of minutes or seconds, 0 or more.`:`How long each live dispatch has to end itself once asked: ${t$(d)}. The engine's default is ${t$(e$($Q)??0)}.`})]}),(0,B.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,B.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,B.jsx)(zs,{htmlFor:`${o}-force`,children:`Force: skip the interrupt and the wait and go straight to the teardown — whatever a worker had not committed is lost.`})]})]}),(0,B.jsxs)(Ns,{children:[(0,B.jsx)(ks,{asChild:!0,children:(0,B.jsx)(Gi,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(Gi,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var u$=e=>e===1?`1 run`:`${e} runs`;function d$({caption:e,label:t,runs:n,warning:r=!1}){let i=s$(n);return(0,B.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,B.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,B.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,B.jsxs)(`li`,{children:[e,` — `,u$(t)]},e))})]})}function f$(e,t,n){let[r,i]=(0,z.useState)(),a=p$(r!==void 0,e,t,n);return{open:r,setOpen:i,opener:e=>()=>i(e),runs:a.rows===void 0||r===void 0?void 0:n$(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function p$(e,t,n,r){let i=(0,z.useRef)(new Set),a=t?.next_cursor;return(0,z.useEffect)(()=>{if(!e){i.current.clear();return}a===void 0||r||i.current.has(a)||(i.current.add(a),n())},[e,a,r,n]),t===void 0?{blocked:`Reading the runs listing this view holds…`}:a===void 0?{rows:t.runs}:!r&&i.current.has(a)?{blocked:`The rest of the runs listing could not be read (${t.runs.length} runs read), so the runs this acts on cannot all be named. Close this and try again.`}:{blocked:`Reading the rest of the runs listing so every run this acts on can be named (${t.runs.length} read so far)…`}}function m$(e,t){let[n,r]=(0,z.useState)({phase:`idle`}),i=(0,z.useRef)(!1);return{state:n,confirm:(0,z.useCallback)((n,a,o)=>{if(i.current)return;i.current=!0;let s={scope:e,runs:n,grace:a,force:o,sentAt:Date.now()};r({phase:`sending`,sent:s}),t({grace:a,force:o}).then(e=>r({phase:`answered`,sent:s,report:e}),e=>r(r$(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,z.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var h$=[`host`];function g$(e){return{host:m$(`host`,(0,z.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function _$({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=f$(e,t,n),u=r.host.state.phase===`sending`;return(0,B.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,B.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,B.jsxs)(Gi,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(ht,{size:14}),` Shut down the entire host`]})}),h$.map(e=>(0,B.jsx)(l$,{blocked:c,onConfirm:(e,t)=>s!==void 0&&r.host.confirm(s,e,t),onOpenChange:t=>a(t?e:void 0),open:i===e,runs:i===e?s:void 0,unreadable:l},e))]})}var v$=1e3;function y$(e,t){let[n,r]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),v$);return()=>clearInterval(e)},[]);let i=a$(e,(0,z.useRef)(new Map(t.filter(t=>e.runs.some(({runId:e})=>e===t.run_id)).map(e=>[e.run_id,e]))).current,t);return{now:n,progress:i,done:i.filter(({recorded:e})=>e===i$.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function b$({label:t,state:n,rows:r,onDismiss:i}){return n.phase===`idle`?null:(0,B.jsxs)(`section`,{"aria-label":t,className:`shutdown-status`,children:[n.phase===`sending`?(0,B.jsx)(S$,{rows:r,sent:n.sent}):n.phase===`lost`?(0,B.jsxs)(bi,{"aria-label":`${t} lost`,variant:`destructive`,children:[(0,B.jsx)(wt,{}),(0,B.jsx)(xi,{children:`Shutdown lost: no answer came back`}),(0,B.jsxs)(Si,{children:[(0,B.jsxs)(`p`,{children:[`The request sent at `,o$(n.sent.sentAt),` ended without an answer (`,n.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,B.jsx)(x$,{sent:n.sent})]})]}):n.phase===`refused`?(0,B.jsxs)(bi,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsxs)(xi,{children:[`Shutdown refused · `,n.error.status,` `,n.error.code]}),(0,B.jsxs)(Si,{children:[(0,B.jsx)(`pre`,{className:`verb-text`,children:n.error.message}),(0,B.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,B.jsx)(w$,{label:t,report:n.report}),n.phase!==`sending`&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(Gi,{onClick:i,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function x$({sent:e}){return(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,o$(e.sentAt),` · scope `,e.scope,` · grace`,` `,t$(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function S$({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=y$(e,t);return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,B.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,B.jsx)(st,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,B.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,be(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,B.jsx)(x$,{sent:e}),(0,B.jsx)(`p`,{children:o?n<a?`Waiting out the ${t$(e.grace)} grace until ${o$(a)} (${be(a-n)} left) for each live dispatch to end itself; runs are worked through one after another, each with its own grace.`:`The first grace ran out at ${o$(a)}; the engine is tearing down what is still standing and pushing branches, run by run.`:`Forced: nothing is asked or waited for; the engine is tearing the runs down and pushing their branches.`}),(0,B.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,B.jsxs)(`li`,{children:[e,`:`,` `,t===i$.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function C$(e){let t=e.remote===null?``:` to ${e.remote}`,n=e.commit===null?``:` at ${e.commit}`;switch(e.result){case`pushed`:return`pushed${t}${n}`;case`already-on-origin`:return`already on its origin${t}${n}; nothing was pushed`;case`no-remote`:return`not pushed: this identity has no origin${n}`;case`refused`:return`could not be preserved${n}`}}function w$({label:t,report:n}){return(0,B.jsxs)(bi,{"aria-label":`${t} report`,variant:n.complete?`default`:`destructive`,children:[n.complete?(0,B.jsx)(qe,{}):(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:n.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,B.jsxs)(Si,{className:`shutdown-report`,children:[!n.complete&&(0,B.jsx)(`p`,{children:`Not everything went as asked: a dispatch was killed at the deadline or is still running, a teardown was not clean, or a branch could not be preserved. Read the runs below.`}),(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,n.scope,` · grace `,t$(n.grace_seconds),n.forced?` · forced`:``,` · runs root `,n.root]}),n.runs.length===0?(0,B.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):n.runs.map(e=>(0,B.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,B.jsxs)(`h4`,{children:[e.run_id,` · owner `,e.owner,e.forced_over_owner&&` — another session's run, acted on over its owner`]}),e.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,B.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,B.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,be(e.waited_ms),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,B.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,B.jsx)(`p`,{children:`No branch this run's records name.`}):(0,B.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,B.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,C$(e),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),n.not_pushed_unread===null?n.not_pushed.length===0?(0,B.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,n.not_pushed.length,`):`]}),(0,B.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:n.not_pushed.map(({identity:e,branch:t})=>(0,B.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,n.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:`The engine's own report`}),(0,B.jsx)(`pre`,{className:`verb-text`,children:n.rendered})]})]})]})}function T$(e){if(e===void 0||e===``)return;let t;try{t=new URL(e).pathname}catch{return E$}let n=/\/[^/]+\/([^/]+)\/pull\/(\d+)\/?$/u.exec(t);return n===null?E$:`${n[1]}#${n[2]}`}var E$=`Change request`,D$={crosshair:!0,ticks:{minSpacingPx:80}},O$=2e3;function k$(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-O$/2,r+O$/2]}var A$=1e3;function j$({completedAt:e,startedAt:t}){let n=t===void 0?void 0:Ae(t),r=e===void 0?void 0:Ae(e),i=M$(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,B.jsxs)(B.Fragment,{children:[be(i-n.getTime()),` · running`]}):(0,B.jsx)(B.Fragment,{children:be(r.getTime()-n.getTime())})}function M$(e){let[t,n]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),A$);return()=>clearInterval(t)},[e]),t}var N$={passed:qe,failed:et,skipped:Xe,neutral:Ye,queued:Je,running:st,"not recorded":Qe};function P$(e){if(e.conclusion===void 0){if(e.status===void 0)return`not recorded`;if(e.status===`in_progress`)return`running`;if(e.status!==`completed`)return`queued`}switch(e.conclusion){case`success`:return`passed`;case`skipped`:return`skipped`;case`neutral`:return`neutral`;default:return`failed`}}function F$({check:e}){let t=P$(e),n=N$[t];return(0,B.jsxs)(`span`,{className:`check-status`,"data-check":t.replace(` `,`-`),title:[e.status??`not recorded`,e.conclusion].filter(Boolean).join(`: `),children:[(0,B.jsx)(n,{"aria-label":t,role:`img`,size:14}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:t})]})}function I$({control:e}){if(e===void 0)return null;let t=e.addressable?`Turn reachable`:`No turn to reach`,n=e.addressable?`a planner's note can be delivered into the ${e.member??`member`} turn in flight`:e.reason,r=e.addressable?dt:ut;return(0,B.jsxs)(T,{"aria-label":`${t}: ${n}`,className:k(`node-view-control gap-1.5`,e.addressable?`border-info bg-info-surface text-info`:`border-warning bg-warning-surface text-warning`),title:n,variant:`outline`,children:[(0,B.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function L$({counts:e,hidden:t,onHiddenChange:n}){let r=ne.filter(n=>(e.get(n)??0)>0||t.has(n)),i=r.filter(e=>!t.has(e)).length,a=(0,z.useId)();return(0,B.jsxs)(`header`,{className:`event-list-head`,children:[(0,B.jsx)(`h3`,{children:`Events`}),r.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter event-type-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Event types:`,` `,i===r.length?`all ${r.length}`:`${i} of ${r.length}`]}),(0,B.jsx)(We,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Event types`}),r.map(r=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{"aria-describedby":`${a}-${r}`,"aria-label":Se(r),checked:!t.has(r),onChange:e=>n(e.target.checked?[...t].filter(e=>e!==r):[...t,r]),type:`checkbox`}),(0,B.jsx)(`span`,{children:Se(r)}),(0,B.jsx)(`span`,{className:`event-type-count`,id:`${a}-${r}`,children:e.get(r)??0})]},r)),(0,B.jsxs)(`p`,{className:`event-type-filter-foot`,children:[(0,B.jsx)(`button`,{onClick:()=>n([]),type:`button`,children:`Select all`}),(0,B.jsx)(`button`,{onClick:()=>n([...ne]),type:`button`,children:`Clear`})]})]})]})]})}function R$({onClear:e}){return(0,B.jsxs)(`div`,{className:`event-list-empty`,role:`status`,children:[(0,B.jsx)(`p`,{children:`The event-type filter hides every event in this list.`}),(0,B.jsx)(`button`,{className:`load-earlier`,onClick:e,type:`button`,children:`Show every event type`})]})}function z$({entry:e,onToggle:t,children:n}){let{group:r}=e,i=x(r);return(0,B.jsxs)(`section`,{"aria-label":`${i}: ${r.displayLabel}`,className:`transcript-cycle`,"data-cycle-count":r.count,children:[(0,B.jsxs)(`header`,{className:`transcript-cycle-head`,children:[(0,B.jsx)(_t,{"aria-hidden":`true`,size:14}),(0,B.jsxs)(`strong`,{className:`transcript-cycle-count`,children:[`×`,r.count]}),(0,B.jsxs)(`span`,{className:`transcript-cycle-span`,children:[i,` · `,(0,B.jsx)(u,{at:r.startedAt}),`–`,(0,B.jsx)(u,{at:r.endedAt??r.startedAt}),r.durationMs!==null&&` · ${be(r.durationMs)}`]}),(0,B.jsx)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:e.expanded?`Show one pass`:`Show all ${r.children.length}`})]}),n]})}function B$({failure:e,what:t=`Earlier rows`}){return(0,B.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[t,` did not load: `,e.message]}),(0,B.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}var V$=`Partial — loading`;function H$({load:e}){let t=e.total===void 0?`${e.loaded.toLocaleString()} records loaded`:`${e.loaded.toLocaleString()} of ${e.total.toLocaleString()} records loaded`;return(0,B.jsxs)(`p`,{className:`partial-mark`,role:`status`,children:[(0,B.jsx)(`span`,{className:`partial-mark-label`,children:V$}),(0,B.jsx)(`span`,{className:`partial-mark-count`,children:t})]})}function U$(e,t){let[n,r]=(0,z.useState)(null);return(0,z.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,z.useLayoutEffect)(()=>{let i=e.current;if(!t||n!==null||i===null)return;let a=()=>{let e=i.querySelector(`[aria-label^="Timeline plot"]`);return e===null?!1:(getComputedStyle(e).position===`static`&&(e.style.position=`relative`),r(e),!0)};if(a())return;let o=new MutationObserver(()=>{a()&&o.disconnect()});return o.observe(i,{childList:!0,subtree:!0}),()=>o.disconnect()}),n}function W$({container:e,partial:t=!1,range:n,stretches:r}){let i=U$(e,r.length>0);if(i===null)return null;let a=Math.max(n[1]-n[0],1),o=e=>(Math.min(Math.max(e,n[0]),n[1])-n[0])/a*100;return(0,qn.createPortal)(r.map(([e,n])=>(0,B.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":n,style:{left:`${o(e)}%`,width:`${o(n)-o(e)}%`},children:(0,B.jsx)(`span`,{className:`history-hatch-label`,children:t?V$:j})},`${e}-${n}`)),i)}function G$(e){return e===`human-step`?`human step`:e}function K$(e){return e.style===`human-step`}function q$(e){switch(e){case`not-released`:return`not released yet`;case`awaiting-human-step`:return`waiting for the human step`;case`not-answered`:return`the registry did not answer`;case`not-landed`:return`released, but not carrying this work yet`;default:return e}}function J$(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function Y$(e){if(e!==void 0)return e===`live`?`Live — into the turn that was already running`:e===`next`?`Deferred — onto the node's next dispatch`:e}function X$(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function Z$({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:G$(e.style)],[`Version`,e.version],[`Probe outcome`,e.outcome],[`Probed through`,e.form],[`Probe took`,e.elapsed_ms===void 0?void 0:`${e.elapsed_ms} ms`],[`Acknowledged by`,e.actor],[`Superseded`,J$(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,Y$(e.delivery)]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[t.length>0&&(0,B.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,B.jsxs)(`li`,{children:[K$(e)?(0,B.jsxs)(bi,{children:[(0,B.jsx)(y,{}),(0,B.jsxs)(xi,{children:[`Waiting on a person · `,X$(e)]}),(0,B.jsx)(Si,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,X$(e)]}),(0,B.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:q$(e.last_answer),e.waited_seconds===void 0?void 0:`waited ${e.waited_seconds}s`].filter(e=>e!==void 0).join(` · `)})]},`${e.dep}·${e.identity??``}·${e.target??``}`))})]}),e.versions!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function Q$({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,B.jsx)(B.Fragment,{children:[t.target,t.style===void 0?void 0:G$(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function $$({artifactId:t,client:n,focusFirstPrompt:r=!1,runId:i}){let a=VN(`${i}/${t}`,()=>n.getArtifact(i,t),0),o=a.value?.turns??[],s=o[0],c=r&&s!==void 0?{turnId:s.id,part:`prompt`}:void 0;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),a.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):a.value===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):a.value.unavailable===void 0?(0,B.jsx)(Ki,{className:r?`harness-conversation-focused gap-0 py-3`:`gap-0 py-3`,children:(0,B.jsx)(qi,{className:`px-3`,children:o.map(e=>(0,B.jsx)(KC,{...c?.turnId===e.id?{focus:c}:{},turn:e},e.id))})}):(0,B.jsxs)(bi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Transcript unavailable`}),(0,B.jsx)(Si,{children:a.value.unavailable})]})]})}function e1({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=t1(e),c=VN(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,B.jsxs)(B.Fragment,{children:[c.value?.truncated===!0&&(0,B.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,B.jsx)(`section`,{"aria-label":n,children:(0,B.jsx)(`pre`,{children:l})})]})]})}function t1(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}var n1=6,r1=8,i1=`[aria-describedby^="timeline-detail-"]`,a1=`[data-timeline-entry]`,o1=e=>{if(!(e instanceof Element))return;let t=E(e);if(t!==void 0)return t;let n=e.closest(i1);if(n instanceof HTMLElement){let e=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return e?{element:n,detail:e}:void 0}let r=e.closest(a1),i=r?.getAttribute(`aria-label`)?.replace(/, marker$/u,``);return r instanceof HTMLElement&&i?{element:r,detail:i}:void 0},s1=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t,c1=(0,z.createContext)(()=>void 0);function l1(){let e=(0,z.useContext)(c1),t=(0,z.useRef)(!1);return(0,z.useEffect)(()=>()=>{t.current&&e(null)},[e]),(0,z.useCallback)(n=>{t.current=n!==null,e(n?.element??null)},[e])}function u1({children:e}){let t=(0,z.useContext)(c1);return(0,B.jsx)(`div`,{onPointerLeave:()=>t(null),onPointerOver:e=>{let n=e.target;t(n instanceof Element?o1(n)?.element??null:null)},children:e})}function d1({children:e}){let t=(0,z.useRef)(null),[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),o=n??i,s=(0,z.useCallback)(()=>{r(void 0),a(void 0)},[]),c=(0,z.useCallback)(e=>r(t=>s1(t,e===null?void 0:o1(e))),[]);(0,z.useEffect)(()=>{let e=e=>a(t=>s1(t,o1(e.target))),t=e=>a(t=>s1(t,o1(e.relatedTarget))),n=()=>r(void 0);return document.addEventListener(`pointerleave`,n),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t),()=>{document.removeEventListener(`pointerleave`,n),document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t)}},[]);let l=(0,z.useCallback)(()=>{let e=t.current;if(e===null||o===void 0)return;if(!o.element.isConnected)return s();let n=o.element.getBoundingClientRect(),r=e.getBoundingClientRect(),i=window.innerWidth-r.width-r1,a=Math.min(Math.max(n.left,r1),Math.max(r1,i)),c=n.bottom+n1,l=n.top-r.height-n1,u=Math.max(r1,window.innerHeight-r.height-r1),d=c+r.height<=window.innerHeight-r1?c:l,f=Math.min(Math.max(d,r1),u);e.style.left=`${Math.round(a)}px`,e.style.top=`${Math.round(f)}px`,e.style.visibility=`visible`},[o,s]);return(0,z.useLayoutEffect)(l,[l]),(0,z.useEffect)(()=>{if(o!==void 0)return window.addEventListener(`scroll`,l,!0),window.addEventListener(`resize`,l),()=>{window.removeEventListener(`scroll`,l,!0),window.removeEventListener(`resize`,l)}},[o,l]),(0,B.jsxs)(c1.Provider,{value:c,children:[e,o!==void 0&&(0,qn.createPortal)((0,B.jsx)(`div`,{"aria-hidden":`true`,className:`timeline-popover`,"data-testid":`timeline-popover`,ref:t,style:{visibility:`hidden`},children:o.detail},o.detail),document.body)]})}function f1(e,t,n,r){let[i,a]=(0,z.useState)(),o=(0,z.useRef)({asked:0,shown:0}),s=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,z.useEffect)(()=>{if(s===void 0||t===void 0||n===void 0){o.current.key=void 0;return}let r=o.current;r.key!==s&&(r.shown=r.asked),r.key=s,r.asked+=1;let i=r.asked,c=()=>r.key===s&&i>r.shown;e.getConversation(t,n).then(e=>{c()&&(r.shown=i,a({key:s,conversation:e}))}).catch(e=>{if(!c())return;let t=e instanceof Error?e:Error(String(e));a(e=>e?.key===s&&e.conversation!==void 0?e:{key:s,error:t})})},[e,t,n,s,r]);let c=i?.key===s?i:void 0;return(0,z.useMemo)(()=>({conversation:c?.conversation,error:c?.error,loading:s!==void 0&&c===void 0}),[c,s])}function p1(e){let t=(0,z.useRef)(void 0);return(0,z.useCallback)(n=>{t.current?.disconnect(),t.current=void 0;let r=n?.parentElement;if(n===null||r==null)return;let i=()=>r.style.setProperty(e,`${n.getBoundingClientRect().height}px`);i(),t.current=new ResizeObserver(i),t.current.observe(n)},[e])}var m1=[`keydown`,`pointerdown`,`touchstart`,`wheel`];function h1(e){for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).overflowY;if(e===`auto`||e===`scroll`)return t}return null}function g1(e,t){(0,z.useLayoutEffect)(()=>{let n=e.current;if(n===null||t===``)return;let r=h1(n);if(r===null)return;let i=()=>{let e=Number.parseFloat(getComputedStyle(n).scrollMarginTop)||0,t=r.getBoundingClientRect().top+r.clientTop;return n.getBoundingClientRect().top-(t+e)},a=()=>{let e=i();Math.abs(e)>=.5&&r.scrollTo({behavior:`instant`,top:r.scrollTop+e})};a();let o=!0,s=()=>{o=!1},c=new ResizeObserver(()=>{o&&a()});for(let e of new Set([n,...r.children]))c.observe(e);for(let e of m1)r.addEventListener(e,s,{passive:!0});return()=>{c.disconnect();for(let e of m1)r.removeEventListener(e,s)}},[e,t])}var _1=32;function v1(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function y1(e,t){let n=(0,z.useRef)(null),r=(0,z.useRef)(!0),i=(0,z.useRef)({key:e,count:t}),a=(0,z.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=_1)},[]),o=(0,z.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=v1(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,z.useLayoutEffect)(()=>{let a=i.current;i.current={key:e,count:t};let o=a.key===e&&a.count>0&&t>a.count,s=n.current;!o||s===null||!r.current||(s.scrollTop=s.scrollHeight)},[e,t]),o}var b1=25,x1=2e3;function S1({client:e,runId:t,node:r,row:i}){let a=i===void 0?void 0:Z1(i),o=a?.kind===`conversation`?a.value:void 0,[s,c]=(0,z.useState)(0),l=f1(e,t,o,i===void 0?void 0:`${G1(i)}|${s}`),u=i!==void 0&&O1(i,l,r)===`not-yet`;(0,z.useEffect)(()=>{if(!u)return;let e=setInterval(()=>c(e=>e+1),x1);return()=>clearInterval(e)},[u]);let d=y1(o,K1(i,l)),f=a?.kind===`oneharness_session`?t1(a.value):void 0;return(0,B.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,B.jsx)(_d,{className:`h-full`,children:(0,B.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:d,children:i===void 0?(0,B.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,B.jsx)(ot,{size:30}),(0,B.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):X1(a)?(0,B.jsx)(N1,{conversationId:a?.value??``,...r===void 0?{}:{node:r},row:i,transcript:l}):f===void 0?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(n,{row:i}),(0,B.jsx)(Ad,{className:`my-4`}),(0,B.jsx)(C1,{client:e,runId:t,node:r,reference:a,row:i}),i.rowKind===`event`&&(0,B.jsx)(n0,{client:e,event:i.event,...i.event.kind===`edit-rejected`?{shown:B1}:{}})]}):(0,B.jsx)($$,{artifactId:f,client:e,focusFirstPrompt:!0,runId:t})})})})}function C1({client:e,runId:t,row:n,node:r,reference:i}){if(n.rowKind===`event`&&n.event.kind===`edit-rejected`)return(0,B.jsx)(z1,{client:e,event:n.event,reference:i,runId:t});let a=q1(n);if(a!==void 0)return(0,B.jsx)(L1,{redirection:a,row:n});let o=J1(n);if(o!==void 0)return(0,B.jsx)(Z$,{release:o});let s=Y1(n);return s===void 0?$1(n)?(0,B.jsx)(P1,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&t1(i.value)!==void 0?(0,B.jsx)(F1,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):e0(n,i)&&r!==void 0?(0,B.jsx)(I1,{node:r,reference:i}):(0,B.jsx)(U1,{reference:i,row:n}):(0,B.jsx)(H1,{row:n,surface:s})}function w1({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,B.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function T1(e){if(e.rowKind===`event`)return e.event.conversation_item;if(e.rowKind===`span`)return e.span.conversation_item}function E1(e){return e.conversation_item?.turn??e.tool?.turn??e.id}function D1(e,t){if(e.rowKind===`event`&&e.event.tool!==void 0){let n=E1(e.event),r=t.find(({id:e})=>e===n),{index:i,tool_call_id:a}=e.event.tool;return r===void 0?{turnId:n,eventIndex:i}:a!==void 0&&r.tools.some(e=>e.toolCallId===a)?{turnId:r.id,toolCallId:a}:!(r.tools.some(e=>e.index===i)||(r.agentEvents??[]).some(e=>e.index===i))&&e.event.fields?.kind===`message`?{turnId:r.id,part:`answer`}:{turnId:r.id,eventIndex:i}}let n=T1(e);return n===void 0?void 0:{turnId:n.turn,part:n.part}}function O1(e,t,n){let r=t.conversation?.conversation;if(r===void 0)return;let i=T1(e),a=e.rowKind===`event`?E1(e.event):i?.turn;if(a===void 0||i?.gap!==!0&&r.turns.some(({id:e})=>e===a))return;if(i?.gap===!0)return`not-yet`;let o=Number(a.slice(a.lastIndexOf(`.`)+1));return Number.isInteger(o)&&o>=r.turns.length&&A1(r.state,n)?`not-yet`:`no-longer`}var k1={pending:!0,ready:!0,running:!0,waiting:!0,blocked:!0,parked:!0,unknown:!0,done:!1,failed:!1,cancelled:!1,skipped:!1,"not-completed":!1,"complete-but-draft":!1,"complete-but-held":!1};function A1(e,t){return e===`member-settled`?!1:t===void 0||k1[t.status]}function j1({turnId:e,absence:t}){let n=(0,z.useRef)(null);return g1(n,`${e}|${t}`),(0,B.jsx)(`div`,{className:`conversation-turn-absent`,"data-turn-id":e,children:(0,B.jsx)(`p`,{"aria-current":`true`,className:`detail-note conversation-focus-highlight`,ref:n,role:`note`,children:t===`not-yet`?`This turn is not in the recorded transcript yet.`:`This turn is no longer part of the recorded transcript.`})})}function M1({turn:t}){let n=[t.unknown.instruction_truncated===!0?`its prompt`:void 0,t.unknown.truncated===!0?`its reply`:void 0,t.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,t.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return n.length===0?null:(0,B.jsxs)(bi,{className:`mb-3`,role:`note`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Cut by the recorder`}),(0,B.jsxs)(Si,{children:[`The run's recorder cut `,n.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function N1({conversationId:t,node:n,row:i,transcript:a}){let[o,s]=(0,z.useState)(b1),c=a.conversation,l=c?.conversation.turns??[],u=i.rowKind===`event`?E1(i.event):void 0,d=O1(i,a,n),f=u===void 0?l:d===void 0?l.filter(({id:e})=>e===u):[],p=f.length===0?l:f,m=Lp(p.map(e=>({id:e.id,time:Date.parse(e.timestamp)}))),h=p1(`--conversation-focus-offset`),g=D1(i,p),_=d===void 0?void 0:u??g?.turnId,v=c===void 0?r(i.role,i.transport):t0(c.attribution.agentRole,c.attribution.transportRole),y=c?.attribution.persona;return(0,B.jsx)(Ki,{className:`gap-0 py-3`,children:(0,B.jsxs)(qi,{className:`px-3`,children:[(0,B.jsxs)(`header`,{className:`transcript-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`eyebrow`,children:[i.dispatch===void 0?``:`${i.dispatch.label} · `,v,y?` · ${y}`:``]}),(0,B.jsx)(`h4`,{children:c?.conversation.name??t})]}),c===void 0?(0,B.jsx)(jd,{className:`transcript-state-placeholder`}):(0,B.jsx)(Ep,{state:c.conversation.state})]}),(0,B.jsx)(Ad,{className:`my-2.5`}),a.loading?(0,B.jsxs)(`div`,{className:`conversation-loading`,children:[(0,B.jsx)(`div`,{className:`conversation-timeline-sticky conversation-timeline-placeholder`,children:(0,B.jsx)(jd,{className:`h-full w-full`})}),(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,B.jsx)(jd,{className:`h-2 w-40`}),(0,B.jsx)(jd,{className:`h-2 w-24`}),`Loading transcript…`]})]}):c===void 0?(0,B.jsxs)(bi,{variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Transcript unavailable`}),(0,B.jsxs)(Si,{children:[(0,B.jsx)(`p`,{children:a.error?.message??`The server recorded no transcript.`}),i.rowKind===`event`&&Object.keys(i.event.fields??{}).length>0&&(0,B.jsx)(i0,{value:i.event.fields??{}})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`conversation-timeline-sticky`,ref:h,children:(0,B.jsx)(u1,{children:(0,B.jsx)(Ip,{cursor:m.cursor,...g===void 0?{}:d===void 0?{focus:g}:{expanded:!0},onSelectTurn:m.scrollTo,turns:[...p]})})}),(0,B.jsxs)(`div`,{className:`conversation-turns`,ref:m.containerRef,children:[d!==void 0&&_!==void 0&&(0,B.jsx)(j1,{absence:d,turnId:_}),f.slice(0,o).map(e=>(0,B.jsxs)(`div`,{ref:t=>m.register(e.id,t),children:[(0,B.jsx)(M1,{turn:e}),(0,B.jsx)(KC,{author:{label:v},...g?.turnId===e.id?{focus:g}:{},turn:e}),(0,B.jsx)(w1,{turn:e})]},e.id)),u!==void 0&&(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`conversation-focus-room`})]}),f.length>o&&(0,B.jsxs)(Gi,{onClick:()=>s(o+b1),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,f.length,` turns`]})]})]})})}function P1({row:e,client:t,runId:n,reference:r}){let i=e.rowKind===`span`?e.span.detail:void 0,a=i?.artifact_id??(r?.kind===`gate_log`?r.value:void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Result`}),(0,B.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,B.jsx)(`pre`,{children:i.output_tail})]}),(0,B.jsx)(e1,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function F1({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(e1,{artifactId:e,client:t,heading:`Worker report`,missing:`This settlement recorded no report.`,noun:`report`,runId:i,unreadable:`This run kept no readable copy of that report.`}),(0,B.jsx)(U1,{reference:n,row:r})]})}function I1({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,B.jsx)(W1,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,B.jsx)(rt,{size:13})]})}):r?.branch_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,B.jsx)(rt,{size:13})]})}):!r?.pr_url&&(0,B.jsx)(W1,{fallback:`No publication was recorded.`,reference:t}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,B.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.name}),(0,B.jsx)(`dd`,{children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function L1({redirection:e,row:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Delivery`}),(0,B.jsx)(`dd`,{children:e.delivered?`Live — into the turn that was already running`:`Deferred — onto the node's next dispatch`})]}),e.turn!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Turn`}),(0,B.jsx)(`dd`,{children:e.turn===`turn-end`?`Left to end — the note reached it as it ended`:`Interrupted — its replacement opened on the note`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Redirected at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Member`}),(0,B.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Note`}),(0,B.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,B.jsx)(R1,{row:t})]}),e.reason!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function R1({row:e}){let t=e.rowKind===`event`?Ne(e.event):void 0;return t===void 0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Author`}),(0,B.jsx)(`dd`,{children:t})]})}function z1({client:e,event:t,reference:n,runId:r}){let i=t.fields??{},a=e=>typeof i[e]==`string`?i[e]:void 0,o=Ne(t),s=a(`summary`),c=a(`node`),l=a(`reason`),d=[[`Author`,o],[`Summary`,s],[`Node`,c]],f=a(`full_reason`)!==void 0&&n?.kind===`refusal`?t1(n.value):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Refused edit`,className:`refusal`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.at,relative:!0})})]}),d.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e)),i.command!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command as sent`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(a0,{value:i.command})})]})]}),f===void 0?l===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:`The record holds no reason.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:l})]}):(0,B.jsx)(V1,{artifactId:f,client:e,cut:i.full_reason_truncated===!0,runId:r})]})}var B1=new Set([`author`,`summary`,`node`,`command`,`reason`,`full_reason`,`full_reason_truncated`]);function V1({artifactId:e,client:t,cut:n,runId:r}){let i=VN(`${r}/${e}`,()=>t.getArtifact(r,e),0),a=i.value?.content;return(0,B.jsxs)(B.Fragment,{children:[n&&(0,B.jsx)(`p`,{className:`detail-note`,role:`note`,children:`The hook wrote more than the engine reads, so its output was cut at the engine's read bound.`}),i.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading the complete refusal…`}):a===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`This run holds no readable copy of the complete refusal.`}):(0,B.jsxs)(`figure`,{className:`refusal-figure`,children:[(0,B.jsx)(`figcaption`,{className:`detail-heading`,children:`Complete refusal`}),(0,B.jsx)(`pre`,{className:`refusal-text`,children:a})]})]})}function H1({surface:e,row:t}){let n=[[`Kind`,e.kind],[`Raised by`,e.source],[`Blocking`,e.blocking===void 0?void 0:e.blocking?`yes — dependents wait on the answer`:`no — nothing waits on it`]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function U1({row:e,reference:t}){if(e.rowKind===`event`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]})}),t!==void 0&&(0,B.jsx)(W1,{reference:t,fallback:`No recorded artifact.`})]});let n=e.rowKind===`group`?void 0:e,r=e.rowKind===`span`&&e.span.count!==void 0?`${e.span.count} records`:void 0,i=(e.rowKind===`span`?e.span.reasons:void 0)??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(u,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Ended`}),(0,B.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,B.jsx)(u,{at:e.endedAt,relative:!0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Duration`}),(0,B.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:be(e.durationMs)})]}),r!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Aggregated`}),(0,B.jsx)(`dd`,{children:r})]}),i.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Waiting on`}),(0,B.jsx)(`dd`,{children:i.map(_).join(` and `)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Step`}),(0,B.jsx)(`dd`,{children:Q1(n)??`None`})]}),(0,B.jsx)(R1,{row:e})]}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,B.jsx)(W1,{fallback:e.rowKind===`span`&&e.span.kind===`dispatch`?`No transcript was recorded for this dispatch.`:`This item points at no recorded artifact.`,reference:t})]})}function W1({reference:e,fallback:t}){return e===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.kind===`pr`?T$(e.value):e.value,` `,(0,B.jsx)(rt,{size:13})]})}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[(0,B.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,B.jsx)(`code`,{children:e.value})]})}function G1(e){if(e.rowKind!==`span`)return e.id;let t=e.span.events.at(-1);return[e.span.id,e.span.status??``,e.span.ended_at??``,e.span.events.length,t?.id??``,t?.at??``,t?.status??``].join(`|`)}function K1(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function q1(e){return e.rowKind===`event`?e.event.redirection:void 0}function J1(e){return e.rowKind===`event`?e.event.release:void 0}function Y1(e){return e.rowKind===`event`?e.event.surface:void 0}function X1(e){return e?.kind===`conversation`}function Z1(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function Q1(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function $1(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function e0(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function t0(e,t){return r(e,t)}function n0({client:e,event:t,shown:n}){let r=n===void 0?t.fields??{}:Object.fromEntries(Object.entries(t.fields??{}).filter(([e])=>!n.has(e)));if(n!==void 0&&Object.keys(r).length===0)return null;let i=t.kind===`command-started`?ue(r.command):void 0;return(0,B.jsxs)(`section`,{"aria-label":`Recorded fields`,className:`record-content`,children:[t.surface_state!==void 0&&(0,B.jsx)(c0,{state:t.surface_state}),t.kind===`human-attested`&&(0,B.jsx)(l0,{client:e,item:r.item}),(t.kind===`node-held`||t.kind===`node-unheld`)&&(0,B.jsx)(u0,{event:t}),(t.kind===`edit-committed`||t.kind===`command-accepted`)&&(0,B.jsx)(d0,{operations:r.operations}),i!==void 0&&(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(i)})})]})}),Object.keys(r).length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This record holds no fields.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Recorded fields`}),(0,B.jsx)(i0,{value:i===void 0?r:Object.fromEntries(Object.entries(r).filter(([e])=>e!==`command`))})]})]})}function r0(e){let t=e.replaceAll(/[_-]+/gu,` `).trim();return t.length===0?e:`${t.charAt(0).toUpperCase()}${t.slice(1)}`}function i0({value:e}){return(0,B.jsx)(`dl`,{className:`facts record-fields`,children:Object.entries(e).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:r0(e)}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(a0,{value:t})})]},e))})}function a0({value:e}){if(e==null)return(0,B.jsx)(`span`,{className:`record-none`,children:`None`});if(typeof e==`string`)return(0,B.jsx)(`span`,{className:`record-text`,children:e});if(typeof e==`number`||typeof e==`boolean`)return(0,B.jsx)(B.Fragment,{children:String(e)});if(Array.isArray(e))return e.length===0?(0,B.jsx)(`span`,{className:`record-none`,children:`None`}):(0,B.jsx)(`ol`,{className:`record-list`,children:e.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(a0,{value:e})},t))});let t=o0(e);return t===void 0?(0,B.jsx)(B.Fragment,{children:String(e)}):(0,B.jsx)(i0,{value:t})}function o0(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function s0(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()!==``?n:void 0}function c0({state:e}){let{status:t}=d(e),n=e.reply,r=[[`Queued`,e.queued_at],[`Read`,e.read_at],[`Answered`,e.replied_at]];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`h3`,{className:`detail-heading`,children:[`Surface `,e.id]}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:t})]}),r.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t===void 0?`Not yet`:(0,B.jsx)(u,{at:t})})]},e)),e.correlation!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Correlation`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:e.correlation})})]})]}),n!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reply`}),(0,B.jsx)(i0,{value:n})]})]})}function l0({client:e,item:t}){let n=o0(t),r=s0(n,`id`),i=o0(n?.resolution),a=s0(i,`choice`),o=VN(a===void 0?void 0:r,()=>e.getHumanItem(r??``),0);if(n===void 0)return(0,B.jsx)(`p`,{className:`detail-note`,children:`Attested with no human item resolved: the planner attested it itself.`});let s=o.value?.item.choices?.find(e=>e.id===a)?.title,c=[[`Item`,r],[`Action`,s0(n,`action`)],[`By`,s0(i,`actor`)],[`On behalf of`,s0(i,`on_behalf_of`)],[`Provenance`,s0(i,`provenance`)??`manager`],[`Choice`,a===void 0?void 0:s===void 0?a:`${s} (${a})`],[`Reason`,s0(i,`reason`)]],l=s0(i,`text`);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Human item`}),(0,B.jsx)(`dl`,{className:`facts`,children:c.filter(([,e])=>e!==void 0).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),l!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Words`}),(0,B.jsx)(`p`,{className:`detail-note record-text`,children:l})]})]})}function u0({event:e}){let t=fe(e);return t.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:e.kind===`node-held`?`Held because`:`Released from`}),(0,B.jsx)(`ul`,{className:`hold-reasons`,children:t.map((e,t)=>(0,B.jsx)(`li`,{children:_(e)},t))})]})}function d0({operations:e}){return!Array.isArray(e)||e.length===0?null:(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Operations`}),(0,B.jsx)(`ol`,{className:`record-operations`,children:e.map((e,t)=>{let n=o0(e);return(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`strong`,{children:s0(n,`kind`)??`Operation ${t+1}`}),n===void 0?(0,B.jsx)(a0,{value:e}):(0,B.jsx)(i0,{value:n})]},t)})})]})}var f0=`span:`,p0=500,m0=ae,h0=e=>500*2**(e-1),g0=e=>e.record_id??e.id,_0=hM.omit({events:!0});function v0(e,t){if(t===void 0)return e;let n=new Set(e.events.map(g0)),r=t.filter(e=>!n.has(g0(e)));if(r.length===0)return e;let i=[...e.events,...r].map(e=>[Date.parse(e.at),e.journal_order??0,e]);return i.sort((e,t)=>e[0]-t[0]||e[1]-t[1]),{...e,events:i.map(([,,e])=>e)}}function y0(e){let t=e.flatMap(e=>{let t=e.events_total;if(t===void 0||t<=e.events.length)return[];let n=e.events[0],r=Date.parse(e.started_at),i=n===void 0?Date.parse(e.ended_at??e.started_at):Date.parse(n.at);return i>r?[[r,i]]:[]}).sort((e,t)=>e[0]-t[0]),n=[];for(let[e,r]of t){let t=n.at(-1);t!==void 0&&e<=t[1]?t[1]=Math.max(t[1],r):n.push([e,r])}return n}function b0({client:e,runId:t,scope:n,nodeId:r,timeline:i}){let a=(0,z.useRef)(new Map),o=(0,z.useRef)(new Map),s=(0,z.useRef)(new Set),[c,l]=(0,z.useState)(0),[u,d]=(0,z.useState)(()=>new Map),f=(0,z.useCallback)(()=>l(e=>e+1),[]),p=(0,z.useCallback)(e=>{for(let t of e.rows)a.current.set(g0(t),t)},[]),m=(0,z.useCallback)(e=>{d(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},[]),h=(0,z.useCallback)((e,t,n)=>{s.current.delete(e),d(r=>new Map(r).set(e,{message:t instanceof Error?t.message:String(t),retry:n})),f()},[f]),g=(0,z.useMemo)(()=>{if(i===void 0)return i;if(n===`node`)for(let e of i.spans)for(let t of e.events)a.current.has(g0(t))||a.current.set(g0(t),{...t,span_id:e.id});let e=new Map;for(let t of a.current.values()){let n=e.get(t.span_id);n===void 0?e.set(t.span_id,[t]):n.push(t)}return e.size===0&&o.current.size===0?i:{...i,spans:i.spans.map(t=>{let n=v0(t,e.get(t.id)),r=o.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[i,c,n]),_=x0({client:e,runId:t,nodeId:n===`node`?r:void 0,opened:i!==void 0,take:p,bump:f}),v=_?.state===`loading`,y=(0,z.useMemo)(()=>n!==`node`||!v?[]:y0(g?.spans??[]),[g,n,v]),b=_?.failure??[...u].find(([e])=>!e.startsWith(f0))?.[1],x=(0,z.useCallback)(e=>u.get(`${f0}${e}`),[u]),S=(0,z.useCallback)(e=>m(`${f0}${e}`),[m]),C=(0,z.useCallback)(async(r,i,a)=>{m(r);try{let r;for(;;){let a=await e.getTimelineEvents(t,{scope:n,limit:p0,...i,...r===void 0?{}:{cursor:r}});p(a);let{span:s}=a;if(i.span!==void 0&&s!==void 0&&o.current.set(i.span,_0.parse(s)),f(),a.next_cursor===null)return;r=a.next_cursor}}catch(e){h(r,e,a)}},[f,m,e,h,t,n,p]),w=(0,z.useCallback)(e=>{let t=`${f0}${e}`;s.current.has(t)||(s.current.add(t),C(t,{span:e,...r===void 0?{}:{node:r}},()=>w(e)))},[r,C]),T=(0,z.useCallback)(e=>{let t=`row:${e??``}`;s.current.has(t)||(s.current.add(t),C(t,e===void 0?{}:{node:e},()=>T(e)))},[C]),E=(0,z.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;s.current.has(r)||(s.current.add(r),C(r,{...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>E(e,t,n)))},[C]);return{...g===void 0?{}:{timeline:g},unheld:y,loadSpan:w,loadRow:T,loadStretch:E,spanFailure:x,forgetSpan:S,...b===void 0?{}:{failure:b},..._===void 0?{}:{nodeLoad:S0(_)}}}function x0({client:e,runId:t,nodeId:n,opened:r,take:i,bump:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(0);if((0,z.useEffect)(()=>{if(n===void 0||!r)return;let o=new AbortController,c=new Set,u,d=()=>u!==void 0&&c.size>=u,f=!1,p,m=(e,t)=>s({node:n,state:e,loaded:c.size,...u===void 0?{}:{total:u},partial:e===`loading`&&f,...t===void 0?{}:{failure:t}}),h=setTimeout(()=>{f=!0,s(e=>e?.node===n&&e.state===`loading`?{...e,partial:!0}:e)},m0),g=async r=>{try{for await(let r of e.streamNodeTimeline(t,n,o.signal)){if(r.kind===`start`)u=r.total;else{i(r);for(let e of r.rows)c.add(g0(e));a()}d()&&clearTimeout(h),m(d()?`held`:`loading`)}clearTimeout(h),m(`held`),a()}catch(e){if(o.signal.aborted||d())return;if(r<3){p=setTimeout(()=>void g(r+1),h0(r));return}clearTimeout(h),m(`failed`,{message:e instanceof Error?e.message:String(e),retry:()=>l(e=>e+1)})}};return m(`loading`),g(1),()=>{o.abort(),clearTimeout(h),p!==void 0&&clearTimeout(p)}},[e,t,n,r,i,a,c]),!(n===void 0||o?.node!==n))return o}function S0(e){return{state:e.state,loaded:e.loaded,...e.total===void 0?{}:{total:e.total},partial:e.partial}}var C0=`This node is not on the run's graph, so the plan holds no task for it.`;function w0({client:n,runId:r,node:i,nodes:a,timeline:o,timelineError:s,hiddenTypes:c=[],onHiddenTypesChange:l=()=>{},runLoaded:u=!0,onRetry:d,selectedItemId:f,onSelectItem:p,onBack:m,selectedTab:h,onSelectTab:g}){let _=(0,z.useMemo)(()=>t(o,i.id),[o,i.id]);(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(f===void 0?m():p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m,p,f]);let v=i.detail?.publication===void 0?i.result?.pr??void 0:i.detail.publication.pr_url;return(0,B.jsx)(`section`,{"aria-label":`Timeline for ${i.label}`,className:`node-view`,children:(0,B.jsxs)(jf,{className:`node-tabs`,onValueChange:e=>{MQ(e)&&g(e)},value:h,children:[(0,B.jsxs)(`section`,{"aria-label":`Node header`,className:`node-view-head`,children:[(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,B.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(Gi,{onClick:m,size:`sm`,type:`button`,variant:`ghost`,children:[(0,B.jsx)(Ve,{size:14}),` Graph`]})}),(0,B.jsx)(`li`,{"aria-current":`page`,children:(0,B.jsx)(`span`,{className:`breadcrumb-node`,children:i.label})})]})}),(0,B.jsxs)(`div`,{className:`node-view-facts`,children:[(0,B.jsx)(dQ,{className:`node-view-state`,state:i.status}),(0,B.jsx)(I$,{control:i.control}),(0,B.jsxs)(`span`,{className:`node-view-meta`,children:[pe(i),` node ·`,` `,u?`${i.telemetry?.turns??0} turns · ${i.telemetry?.lint??0} lint turns`:`turns ${oe}`]}),v!==void 0&&(0,B.jsxs)(`a`,{className:`node-view-pr`,href:v,rel:`noreferrer`,target:`_blank`,children:[T$(v),` `,(0,B.jsx)(rt,{size:12})]})]}),(0,B.jsx)(Nf,{"aria-label":`Node details`,variant:`line`,children:Object.entries(jQ).map(([e,t])=>(0,B.jsx)(Pf,{value:e,children:t},e))})]}),(0,B.jsx)(I0,{node:i,nodes:a}),(0,B.jsx)(P0,{node:i}),(0,B.jsx)(F0,{node:i}),(0,B.jsxs)(Ff,{className:`node-tab-panel`,value:`task`,children:[i.task===void 0?(0,B.jsx)(`p`,{children:C0}):u?(0,B.jsx)(eX,{source:j0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Settled as`}),(0,B.jsx)(`dd`,{children:L0(i.result?.outcome)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:L0(i.result?.detail)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Graph overrides`}),(0,B.jsx)(`dd`,{children:u?(i.task?.sets??[]).length===0?`None`:(0,B.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:i.task?.sets?.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`code`,{children:e})},t))}):oe})]})]})]}),(0,B.jsx)(Ff,{className:`node-tab-panel`,value:`criteria`,children:i.task===void 0?(0,B.jsx)(`p`,{children:C0}):u?(0,B.jsx)(eX,{source:M0(i.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:oe})}),(0,B.jsx)(Ff,{className:`node-tab-panel`,value:`dependencies`,children:(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Dependencies`}),(0,B.jsx)(`dd`,{children:(i.task?.deps??[]).map(e=>{let t=a.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unblocks`}),(0,B.jsx)(`dd`,{children:i.dependents.join(`, `)||`None`})]})]})}),(0,B.jsxs)(Ff,{className:`node-tab-panel`,value:`remote`,children:[!u&&(0,B.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,B.jsxs)(`dl`,{className:`facts`,hidden:!u,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Publication`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(N0,{node:i})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Branch`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?.branch??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Merge`}),(0,B.jsx)(`dd`,{children:i.detail?.publication?i.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Release`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(Q$,{node:i})})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Verification coverage`}),(0,B.jsxs)(`dd`,{children:[`Hook:`,` `,i.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,i.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Observed checks`}),(0,B.jsx)(`dd`,{children:(i.detail?.verification.checks??[]).length===0?`No checks observed`:(0,B.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Runtime`}),(0,B.jsx)(`th`,{children:`Required`})]})}),(0,B.jsx)(`tbody`,{children:i.detail?.verification.checks?.map(e=>(0,B.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,B.jsx)(`th`,{scope:`row`,children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,B.jsx)(`td`,{children:(0,B.jsx)(F$,{check:e})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(j$,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,B.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,B.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,B.jsx)(`path`,{d:`M6 0.5 L11 2.5 V6 C11 9 8.5 11 6 11.5 C3.5 11 1 9 1 6 V2.5 Z`,fill:`currentColor`}):(0,B.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`2 1.5`})}),e.required?`Required`:`Optional`]})]},e.name))})]})})]})]})]}),(0,B.jsx)(Ff,{className:`node-timeline-panel`,value:`timeline`,children:s===void 0?o===void 0?(0,B.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):_.rows.length===0?(0,B.jsxs)(Ki,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,B.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,B.jsx)(T0,{client:n,hiddenTypes:c,node:i,onHiddenTypesChange:l,onSelectItem:p,runId:r,selectedItemId:f,timeline:o}):(0,B.jsxs)(bi,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Timeline unavailable`}),(0,B.jsxs)(Si,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Gi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})})}function T0({client:e,hiddenTypes:t,node:n,onHiddenTypesChange:r,onSelectItem:i,runId:s,selectedItemId:c,timeline:l}){let u=b0({client:e,runId:s,scope:`node`,nodeId:n.id,timeline:l}),d=u.timeline??l,f=(0,z.useMemo)(()=>de(d,n.id),[d,n.id]),p=(0,z.useMemo)(()=>new Set(t),[t]),_=(0,z.useMemo)(()=>o(f.tree,p),[f.tree,p]),v=(0,z.useMemo)(()=>ze(f.tree),[f.tree]),[y,x]=(0,z.useState)(()=>new Set),S=(0,z.useMemo)(()=>c===void 0?[]:h(_,c).filter(e=>e.rowKind===`group`).map(({id:e})=>e),[_,c]),C=(0,z.useMemo)(()=>S.length===0?y:new Set([...y,...S]),[y,S]),w=(0,z.useMemo)(()=>m(_,C),[_,C]),T=(0,z.useMemo)(()=>g(w).map(e=>({id:e.id,time:Date.parse(e.startedAt)})),[w]);D0(f,w);let E=u.nodeLoad?.state===`loading`,D=(0,z.useRef)(T);E||(D.current=T);let O=Lp(E?D.current:T),[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(),N=(0,z.useMemo)(()=>F(f.items,f.lanes),[f.items,f.lanes]),P=(0,z.useMemo)(()=>Fe(f.markers,f.items,c),[f.items,f.markers,c]),I=(0,z.useMemo)(()=>E0([...f.items,...f.markers.map(({at:e})=>({start:e}))]),[f.items,f.markers]),ee=(0,z.useMemo)(()=>E0([...k?f.items:N,...P.map(({at:e})=>({start:e}))]),[k,f.items,N,P]),L=O.cursor===void 0?void 0:Math.min(Math.max(O.cursor,I[0]),I[1]),te=c===void 0?void 0:a(_,c)??a(f.rows,c),ne=(0,z.useRef)(0),re=e=>{ne.current=Date.now()+500,i(e),O.scrollTo(e)},ie=(0,z.useRef)(re);ie.current=re;let ae=(0,z.useCallback)(e=>ie.current(e),[]),oe=(0,z.useRef)(null),{containerRef:se}=O,ce=(0,z.useCallback)(e=>{oe.current=e,se(e)},[se]),le=(0,z.useRef)(null),ue=l1(),{loadSpan:fe,forgetSpan:pe}=u,me=te?.rowKind===`span`?te.span.id:void 0;(0,z.useEffect)(()=>{if(me!==void 0)return fe(me),()=>pe(me)},[me,fe,pe]);let he=me===void 0?void 0:u.spanFailure(me),{scrollTo:ge}=O;return(0,z.useEffect)(()=>{c!==void 0&&(ne.current=Date.now()+500,ge(c))},[c,ge]),(0,B.jsxs)(`div`,{className:`node-execution`,"data-expanded":k,children:[(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:le,children:[(0,B.jsx)(W$,{container:le,partial:u.nodeLoad?.partial===!0,range:j??ee,stretches:u.unheld}),u.nodeLoad?.partial===!0&&(0,B.jsx)(H$,{load:u.nodeLoad}),(0,B.jsx)(on,{...D$,axis:{origin:I[0]},cursor:L,expanded:k,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:k?f.items:N,lanes:f.lanes,markers:P,onExpandedChange:A,onHover:ue,onRangeChange:e=>M(e[0]<=ee[0]&&e[1]>=ee[1]?void 0:k$(e)),onSelect:e=>re(e.id),range:j??ee,selectedId:c})]}),(0,B.jsxs)(`section`,{"aria-busy":E,"aria-label":`Node transcript`,className:`node-transcript`,ref:ce,children:[u.failure!==void 0&&(0,B.jsx)(B$,{failure:u.failure,what:`This node's timeline`}),(0,B.jsx)(L$,{counts:v,hidden:p,onHiddenChange:r}),_.length===0&&f.tree.length>0&&(0,B.jsx)(R$,{onClear:()=>r([])}),b(w).map(e=>{let t=(0,B.jsx)(O0,{entries:e.entries,onOpen:ae,onToggle:e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),register:O.register,selectedItemId:c},e.id);return e.dispatch===void 0?(0,B.jsx)(z.Fragment,{children:t},e.id):(0,B.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,B.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),te!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Gi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(S1,{client:e,node:n,row:te,runId:s}),he!==void 0&&(0,B.jsx)(B$,{failure:he})]})]})}function E0(e){let t=e.map(({start:e})=>e),n=e.map(e=>e.end??e.start);if(t.length===0)return[0,1];let r=Math.min(...t),i=Math.max(...n);return[r,i>r?i:r+1]}function D0(e,t){(0,z.useLayoutEffect)(()=>{let n=window.__nodeLoadProbe;if(n===void 0)return;let r=[],i=e=>{r.push(e.id);for(let t of e.children)i(t)};for(let e of t)if(e.entryKind===`row`)r.push(e.row.id);else for(let t of e.group.children)i(t);n({chart:[...e.items.map(e=>e.id),...e.markers.map(e=>e.id)],list:r})},[e,t])}function O0({entries:e,onOpen:t,onToggle:n,register:r,selectedItemId:i}){return e.map(e=>e.entryKind===`row`?(0,B.jsx)(A0,{onOpen:t,register:r,row:e.row,selected:e.row.id===i||i!==void 0&&e.row.aliases?.includes(i)===!0},e.row.id):(0,B.jsx)(z$,{entry:e,onToggle:()=>n(e.group.id),children:(0,B.jsx)(O0,{entries:e.entries,onOpen:t,onToggle:n,register:r,...i===void 0?{}:{selectedItemId:i}})},e.group.id))}function k0(e,t){let[n,r]=[e.row,t.row];return e.selected===t.selected&&e.register===t.register&&e.onOpen===t.onOpen&&n.id===r.id&&n.rowKind===r.rowKind&&n.displayLabel===r.displayLabel&&n.displayKind===r.displayKind&&n.startedAt===r.startedAt&&n.durationMs===r.durationMs&&n.status===r.status&&n.statusAt===r.statusAt&&n.sessionName===r.sessionName&&n.dispatch?.label===r.dispatch?.label&&(n.rowKind===`event`&&r.rowKind===`event`?n.category===r.category&&n.event.seq===r.event.seq:n.rowKind!==`event`&&r.rowKind!==`event`)}var A0=(0,z.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,z.useCallback)(e=>n(i,e),[n,i]);return(0,B.jsx)(`article`,{"aria-current":t?`true`:void 0,"aria-label":e.displayLabel,className:`transcript-item`,"data-dispatch-group":e.dispatch?.label,"data-journal-seq":e.rowKind===`event`?e.event.seq:void 0,"data-row-id":e.id,"data-selected":t,ref:a,children:(0,B.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,B.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,B.jsx)(O,{category:e.category}),e.displayKind]}),(0,B.jsx)(`strong`,{className:`transcript-label`,title:e.displayLabel,children:e.displayLabel}),(0,B.jsxs)(`span`,{className:`transcript-facts`,children:[(0,B.jsx)(u,{at:e.startedAt}),e.durationMs!==null&&` · ${be(e.durationMs)}`,` · ${e.status??`recorded`}`,e.statusAt!==void 0&&(0,B.jsxs)(B.Fragment,{children:[` `,(0,B.jsx)(u,{at:e.statusAt})]}),e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},k0);function j0(e){if(e.task!==void 0)return e.task;let t=e.steps??[];return t.length===0?`No task prose recorded.`:t.map(e=>`## ${e.id}\n\n${e.task}`).join(`
|
|
106
106
|
|
|
107
107
|
`)}function M0(e){let t=j0(e),n=/(?:^|\n)##[ \t]*acceptance[ \t]+criteria[ \t]*\r?\n([\s\S]*?)(?=\r?\n##[ \t]|$)/i.exec(t)?.[1]?.trim();return n===void 0||n.length===0?`No acceptance criteria recorded in this node's task.`:n}function N0({node:e}){let t=e.detail?.publication;if(t===void 0)return typeof e.result?.pr==`string`&&e.result.pr?(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e.result.pr,rel:`noreferrer`,target:`_blank`,children:[T$(e.result.pr),` `,(0,B.jsx)(rt,{size:12})]}):(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=(t.merged?[[t.pr_url,T$(t.pr_url)],[t.commit_url,`Commit ${t.commit?.slice(0,8)??``}`]]:[[t.pr_url,T$(t.pr_url)],[t.branch_url,t.branch??`Branch`]]).filter(([e])=>e);return n.length===0?(0,B.jsx)(B.Fragment,{children:`Not recorded`}):(0,B.jsx)(B.Fragment,{children:n.map(([e,t],n)=>(0,B.jsxs)(`span`,{children:[n>0&&` · `,(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e,rel:`noreferrer`,target:`_blank`,children:[t,` `,(0,B.jsx)(rt,{size:12})]})]},e))})}function P0({node:e}){let t=_e(e);if(t.length===0)return null;let n=e.result?.detail?.trim()||void 0;return(0,B.jsxs)(`section`,{"aria-label":`Awaited releases`,className:`node-awaiting m-5 rounded-lg border border-warning bg-warning-surface px-4 py-3 text-warning`,children:[(0,B.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,B.jsx)(pt,{size:16}),e.status===`complete-but-held`?`Complete, and held unlanded until its releases arrive`:`Complete, and held as a draft until its releases arrive`]}),(0,B.jsxs)(`dl`,{className:`facts facts-stacked`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.length===1?`Awaits`:`Awaits ${t.length}`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`ul`,{className:`awaited-releases`,children:t.map(e=>(0,B.jsxs)(`li`,{children:[`the `,(0,B.jsx)(`strong`,{children:e.target}),` release of`,` `,(0,B.jsx)(`code`,{children:e.producer})]},`${e.producer} ${e.target}`))})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:n})]})]})]})}function F0({node:e}){if(e.kind!==`command`)return null;let t=e.task?.command,n=e.task?.timeout_seconds,r=e.result?.outcome,i=e.result?.log;return(0,B.jsxs)(`section`,{"aria-label":`Command`,className:`node-command m-5`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[t!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{className:`command-line`,children:P(t)})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Timeout`}),(0,B.jsxs)(`dd`,{children:[n,` seconds`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:r??e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Log`}),(0,B.jsx)(`dd`,{children:i===void 0?`The command has not started.`:i.path})]})]}),i?.content===void 0?i!==void 0&&(0,B.jsx)(`p`,{className:`node-command-log-missing`,children:`The log is not readable from this run.`}):(0,B.jsxs)(`figure`,{className:`node-command-log-figure`,children:[(0,B.jsx)(`figcaption`,{children:`Command log`}),(0,B.jsx)(`pre`,{className:`node-command-log`,children:i.truncated===!0?`…${i.content}`:i.content})]})]})}function I0({node:t,nodes:n}){if(!ye(t.status))return null;let r=t.status===`blocked`||t.status===`skipped`,i=xe(t),a=t.result?.error||void 0,o=t.result?.exit_code;return(0,B.jsxs)(bi,{className:k(`m-5 w-auto`,r&&`border-warning bg-warning-surface text-warning`),variant:r?`default`:`destructive`,children:[r?(0,B.jsx)(pt,{}):(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:r?`This node is ${t.status}`:`This node ${t.status===`cancelled`?`was cancelled`:t.status===`not-completed`?`did not complete`:`failed`}${t.failure?`: ${t.failure.class}`:``}`}),(0,B.jsx)(Si,{children:(0,B.jsxs)(`dl`,{className:`facts`,children:[r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.status===`skipped`?`Unmet`:`Blocked by`}),(0,B.jsx)(`dd`,{children:t.blockers.length>0?t.blockers.map(e=>{let t=n.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `):`Nothing recorded; the run has not written what holds it.`})]}),t.status===`skipped`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Attempts`}),(0,B.jsx)(`dd`,{children:`Never attempted`})]}),!r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:i??`No reason was recorded for this outcome.`})]}),a!==void 0&&a!==i&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:a})]}),typeof o==`number`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Exit code`}),(0,B.jsx)(`dd`,{children:o})]})]})})]})}function L0(e){return e==null||e===``?`Not recorded`:typeof e==`string`?e:JSON.stringify(e,null,2)}function R0({client:t,detail:n,nodes:r,timeline:i,timelineError:s,hiddenTypes:l=[],onHiddenTypesChange:u=()=>{},onRetry:d,journalSeq:f,onSelectNode:p,selectedItemId:m,onSelectItem:h,state:g,status:_}){let y=n.run.run_id,b=b0({client:t,runId:y,scope:`run`,...i===void 0?{}:{timeline:i}}),x=b.timeline,S=je(n.progress),w=(0,z.useMemo)(()=>Le(x,r),[x,r]),T=(x?.spans??[]).filter(e=>e.node_id===void 0),E=(0,z.useMemo)(()=>new Set(l),[l]),D=(0,z.useMemo)(()=>v(x),[x]),O=(0,z.useMemo)(()=>o(D,E),[D,E]),k=T.find(e=>e.id===m),A=T.flatMap(e=>e.events).find(e=>(e.record_id??e.id)===m)??T.flatMap(e=>e.events).find(e=>e.id===m),j=m===void 0?void 0:a(O,m),M=k===void 0?j??(A===void 0?void 0:C(A)):c(k),{loadSpan:N,forgetSpan:P,loadRow:F}=b;(0,z.useEffect)(()=>{m!==void 0&&M===void 0&&x!==void 0&&F(void 0)},[m,M,x,F]);let I=k?.id;(0,z.useEffect)(()=>{if(I!==void 0)return N(I),()=>P(I)},[I,N,P]);let ee=I===void 0?void 0:b.spanFailure(I);return(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m!==void 0&&h()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h,m]),(0,B.jsxs)(`div`,{className:`overall-view`,"data-journal-seq":f,children:[(0,B.jsx)(_d,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`p-[34px] max-sm:p-3`,children:[(0,B.jsxs)(`section`,{"aria-label":`Whole DAG`,className:`overall-hero`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Whole DAG`}),(0,B.jsx)(`h2`,{children:y}),n.graph?.plan.goal?.text&&(0,B.jsx)(`p`,{className:`run-goal`,children:n.graph.plan.goal.text}),(0,B.jsxs)(`p`,{className:`overall-state`,children:[g!==void 0&&(0,B.jsx)(IN,{large:!0,state:g}),(0,B.jsx)(`span`,{children:n.run.last_event?`last event ${n.run.last_event}`:`no events recorded yet`})]})]}),(0,B.jsxs)(`section`,{"aria-label":`Run metrics`,className:`metric-grid`,children:[(0,B.jsx)(W0,{icon:(0,B.jsx)(at,{}),label:`Nodes`,value:le(r)}),(0,B.jsx)(W0,{icon:(0,B.jsx)(tt,{}),label:`Wall time`,value:n.run.timing.wall_seconds===null?`not measured`:Ee(n.run.timing.wall_seconds)}),(0,B.jsx)(W0,{icon:(0,B.jsx)(nt,{}),label:`Turns`,value:typeof n.run.turns==`number`?String(n.run.turns):oe}),(0,B.jsx)(U0,{detail:n,runLoaded:S,status:_})]}),(0,B.jsx)(Ki,{className:`gap-0 py-[15px]`,children:(0,B.jsxs)(qi,{className:`px-[15px]`,children:[(0,B.jsxs)(`div`,{className:`section-heading`,children:[(0,B.jsx)(Be,{size:16}),(0,B.jsx)(`h3`,{children:`Graph timeline`})]}),s===void 0?x===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`m-0 text-[11px] text-muted-foreground`,children:`Loading the run's timeline…`}):x.spans.length===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`This run has recorded no timeline yet.`}):(0,B.jsx)(z0,{graph:w,history:b,runRecordsToLoad:T.some(e=>e.harness_scope===void 0&&(e.events_total===void 0||e.events_total>e.events.length)),onOpenNode:p,onOpenItem:h,selectedItemId:m}):(0,B.jsxs)(bi,{className:`live-issue`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Timeline unavailable`}),(0,B.jsxs)(Si,{children:[s.message,` `,d!==void 0&&(0,B.jsx)(Gi,{onClick:d,size:`sm`,variant:`outline`,children:`Try again`})]})]})]})}),x!==void 0&&x.spans.length>0&&(0,B.jsx)(V0,{counts:ze(D),hidden:E,listed:O,onHiddenChange:u,onOpen:h,recorded:D.length,...m===void 0?{}:{selectedItemId:m}})]})}),M!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(Gi,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>h(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(Dt,{})}),(0,B.jsx)(S1,{client:t,row:M,runId:y}),ee!==void 0&&(0,B.jsx)(B$,{failure:ee})]})]})}function z0({graph:e,history:t,runRecordsToLoad:n,onOpenNode:r,onOpenItem:i,selectedItemId:a}){let[o,s]=(0,z.useState)(),[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(new Set),f=o??e.range,[p,m]=(0,z.useState)(!1),{loadRow:h,loadStretch:g}=t;(0,z.useEffect)(()=>{if(o===void 0)return;let e=setTimeout(()=>g(o[0],o[1],void 0),250);return()=>clearTimeout(e)},[o,g]);let _=e=>{e.kind===`record`&&e.nodeId===void 0||e.nodeId===void 0?i(e.id):r(e.nodeId)},v=l1(),y=e.line.lanes.filter(({id:t})=>e.line.items.some(e=>e.laneId===t));return(0,B.jsxs)(`div`,{className:`graph-timeline`,"data-rows-open":c,children:[(0,B.jsx)(on,{...D$,axis:{origin:e.range[0]},expanded:!1,items:e.line.items,label:`Graph timeline`,lanes:y,markers:e.line.markers,onExpandedChange:l,onHover:v,onRangeChange:e=>s(k$(e)),onSelect:e=>_(e.payload),range:f,selectedId:a}),t.failure!==void 0&&(0,B.jsx)(B$,{failure:t.failure}),n&&!p&&(0,B.jsx)(`button`,{className:`load-earlier`,onClick:()=>{m(!0),h(void 0)},type:`button`,children:`Load the run's own records`}),c&&(0,B.jsx)(`ol`,{className:`graph-rows`,children:e.rows.map(t=>(0,B.jsx)(H0,{onOpen:_,onOpenNode:r,onExpandedChange:e=>{e&&h(t.nodeId),d(n=>{let r=new Set(n);return e?r.add(t.id):r.delete(t.id),r})},expanded:u.has(t.id),origin:e.range[0],range:f,onRangeChange:e=>s(k$(e)),row:t,selectedItemId:a},t.id))})]})}var B0=()=>{};function V0({counts:e,hidden:t,listed:n,onHiddenChange:r,onOpen:i,recorded:a,selectedItemId:o}){let[s,c]=(0,z.useState)(new Set),l=(0,z.useMemo)(()=>{if(o===void 0)return s;let e=h(n,o).filter(e=>e.rowKind===`group`).map(({id:e})=>e);return e.length===0?s:new Set([...s,...e])},[n,s,o]),u=(0,z.useMemo)(()=>m(n,l),[n,l]),d=(0,z.useCallback)(e=>c(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]);return(0,B.jsx)(Ki,{className:`mt-4 gap-0 py-[15px]`,children:(0,B.jsx)(qi,{className:`px-[15px]`,children:(0,B.jsxs)(`section`,{"aria-label":`Run events`,className:`run-events`,children:[(0,B.jsx)(L$,{counts:e,hidden:t,onHiddenChange:r}),a===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`No record of the run's own is held yet.`}):n.length===0?(0,B.jsx)(R$,{onClear:()=>r([])}):(0,B.jsx)(O0,{entries:u,onOpen:i,onToggle:d,register:B0,...o===void 0?{}:{selectedItemId:o}})]})})})}function H0({row:e,range:t,origin:n,expanded:r,onExpandedChange:i,onRangeChange:a,onOpen:o,onOpenNode:s,selectedItemId:c}){let l=e.nodeId,u=l1();return(0,B.jsxs)(`li`,{className:`graph-row`,"data-row-kind":e.kind,children:[(0,B.jsxs)(`header`,{className:`graph-row-head`,children:[l===void 0?(0,B.jsx)(`span`,{className:`graph-row-name`,children:e.label}):(0,B.jsx)(`button`,{className:`graph-row-name`,onClick:()=>s(l),type:`button`,children:e.label}),(0,B.jsxs)(`span`,{className:`graph-row-facts`,children:[be(e.workedMs),` recorded · `,be(e.idleMs),` `,`idle`]})]}),(0,B.jsx)(on,{...D$,axis:{origin:n},expanded:r,items:r?e.items:e.line,label:`${e.label} timeline`,lanes:e.lanes,markers:e.markers,onExpandedChange:i,onHover:u,onRangeChange:a,onSelect:e=>o(e.payload),range:t,selectedId:c})]})}function U0({detail:e,status:t,runLoaded:n}){let r=t.value?.unread_surfaces,i=e.run.last_progress_at;return(0,B.jsxs)(Ki,{"aria-label":`Run details`,className:`metric run-details gap-2 p-4`,role:`group`,children:[(0,B.jsx)(`p`,{children:`Run details`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Launching session`}),(0,B.jsx)(`dd`,{children:n?Te(e.launch):oe})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unread surfaces`}),(0,B.jsxs)(`dd`,{children:[r===void 0?t.error===void 0?oe:`Unavailable`:r.oldest_seconds===null?String(r.count):`${r.count} · oldest ${Ee(r.oldest_seconds)}`,t.error!==void 0&&(0,B.jsxs)(`span`,{className:`run-details-error`,role:`alert`,children:[` `,`Status unavailable: `,t.error.message]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Last progress`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Last progress`,children:n?i===void 0||i<=0?`—`:(0,B.jsx)(u,{at:new Date(i*1e3).toISOString(),relative:!0}):oe})})]})]})]})}function W0({icon:e,label:t,value:n}){return(0,B.jsxs)(Ki,{"aria-label":t,className:`metric flex-row items-center gap-3 p-4`,role:`group`,children:[e,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{children:t}),(0,B.jsx)(`strong`,{children:n})]})]})}var G0=[{setting:`live`,label:`Live`},{setting:10,label:`Every 10 seconds`},{setting:30,label:`Every 30 seconds`},{setting:60,label:`Every minute`},{setting:300,label:`Every 5 minutes`},{setting:`off`,label:`Off`}],K0=`live`,q0={navigation:`dag-ui.updates.navigation`,main:`dag-ui.updates.main`};function J0(e){return G0.find(({setting:t})=>String(t)===e)?.setting}function Y0(e){try{return window.localStorage.getItem(e)}catch{return null}}function X0(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function Z0(e,t){let[n,r]=(0,z.useState)(()=>J0(Y0(e))??t);return[n,(0,z.useCallback)(t=>{r(t),X0(e,t)},[e])]}function Q0(){let[e,t]=Z0(q0.navigation,30),[n,r]=Z0(q0.main,K0);return{navigation:e,setNavigation:t,main:n,setMain:r}}function $0({name:e,caption:t,setting:n,waiting:r,onChange:i}){return(0,B.jsxs)(`div`,{className:`update-setting`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:t}),(0,B.jsx)(`select`,{"aria-label":e,onChange:e=>{let t=J0(e.target.value);t!==void 0&&i(t)},value:String(n),children:G0.map(({setting:e,label:t})=>(0,B.jsx)(`option`,{value:String(e),children:t},e))})]}),r>0&&(0,B.jsxs)(`output`,{"aria-label":`${e} waiting`,className:`update-waiting`,children:[r,` waiting`]})]})}var e2=new ON(window.location.origin,{fetch:window.fetch.bind(window)});function t2(e){let t=(0,z.useRef)({value:e,count:0});return t.current.value!==e&&(t.current={value:e,count:t.current.count+1}),t.current.count}var n2=()=>Promise.resolve();function r2({client:t=e2,first:n,onDrawn:r}){let i=PQ(),a=EQ(),o=i.host||a.active,s=DZ(a.active),c=Q0(),l=KQ(),d=JQ(t,{runId:i.runId,view:M(i.view,i.nodeId),nodeId:i.nodeId,selectFirst:!o,host:o,humanItems:s.view,navigationUpdates:c.navigation,mainUpdates:c.main,...n===void 0?{}:{first:n}}),f=d.rows,p=d.runId,m=d.activity.at(-1),h=d.detail,g=(0,z.useMemo)(()=>h?te(h):[],[h]),_=UN(t,p),v=_.status.value?.liveness,y=(0,z.useMemo)(()=>h===void 0?void 0:he({state:h.run.state,...v===void 0?{}:{liveness:v},statuses:h.graph?.node_status??{}}),[h,v]),b=g$(t),[x,S]=(0,z.useState)(0),C=b.host.state.phase===`sending`,w=t2(f),{list:T,error:E}=kK(t,i.host||C,x+(C?w:0)),D=h===void 0?void 0:N(h),O=je(h?.progress),k=h?.progress?.failed??d.timeline?.progress?.failed,A=!o&&(h?.progress?.complete===!1||d.timeline?.progress?.complete===!1),j=!o&&h===void 0&&d.error!==void 0,P=(0,z.useRef)(!1);(0,z.useLayoutEffect)(()=>{P.current||(h!==void 0||d.error!==void 0)&&(P.current=!0,r?.())},[h,d.error,r]);let F=ie(h,g,i.nodeId);(0,z.useEffect)(()=>{if(o||!f)return;let e=RQ(f),t=e.find(e=>e.rows.some(e=>e.id===i.runId)),n=t?.rows.find(e=>e.id===i.runId),r=(t?.rows??e.flatMap(e=>e.rows)).filter(e=>!e.kind||!i.hiddenKinds.includes(e.kind));(!i.runId||n?.kind&&i.hiddenKinds.includes(n.kind))&&r[0]&&i.selectRun(r[0].id)},[f,i,o]),(0,z.useEffect)(()=>{if(p&&i.runId&&i.runId!==p){let e=new URLSearchParams(window.location.search);e.set(`run`,p),e.delete(`node`),e.delete(`event`),e.set(`view`,i.view),window.history.replaceState(null,``,`${window.location.pathname}?${e}`),window.dispatchEvent(new PopStateEvent(`popstate`))}},[i.runId,p,i.view]);let I=a.active?`Action items`:i.host?`Host`:p??`No DAG selected`,ee=e=>(0,B.jsxs)(`section`,{"aria-label":p&&!o?`Run header`:`Workspace header`,className:`topbar${p&&!o?` run-topbar`:``}`,children:[(0,B.jsx)(`button`,{"aria-controls":`run-navigation`,"aria-expanded":l.open,"aria-label":`Open navigation`,className:`nav-menu`,onClick:l.toggle,ref:l.menuButton,type:`button`,children:(0,B.jsx)(lt,{"aria-hidden":`true`,size:18})}),(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Execution telemetry`}),(0,B.jsx)(`h2`,{title:I,children:I})]})}),(0,B.jsxs)(`div`,{className:`topbar-actions`,children:[!o&&p!==void 0&&(0,B.jsx)(zN,{control:_,runId:p,ended:h!==void 0&&(h.run.state===`settled`||h.run.state.startsWith(`ended-`)),...y===void 0?{}:{state:y}}),(0,B.jsxs)(`span`,{className:`connection`,children:[(0,B.jsx)(yt,{size:15}),d.lastUpdated===void 0?`Waiting for first update`:(0,B.jsxs)(B.Fragment,{children:[`Last updated `,(0,B.jsx)(u,{at:d.lastUpdated,relative:!0})]})]}),!o&&m!==void 0&&(0,B.jsxs)(`button`,{className:`last-activity connection`,type:`button`,title:`${m.node}: ${i2(m)}`,onClick:()=>{i.selectNode(m.node),i.selectItem(m.event_id)},children:[m.node,`: `,i2(m)]})]}),e,(0,B.jsxs)(`div`,{className:`main-updates`,children:[(0,B.jsx)($0,{caption:`Updates`,name:`Main area updates`,onChange:c.setMain,setting:c.main,waiting:d.mainWaiting}),(0,B.jsxs)(Gi,{onClick:()=>{S(e=>e+1),d.refresh(),o||_.reread()},size:`sm`,type:`button`,variant:`outline`,children:[(0,B.jsx)(gt,{size:14}),` Refresh`]})]})]}),L=(0,B.jsxs)(B.Fragment,{children:[d.error&&!j&&(0,B.jsxs)(bi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`Live telemetry issue`}),(0,B.jsxs)(Si,{children:[d.error.message,` `,(0,B.jsx)(Gi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),k!==void 0&&(0,B.jsxs)(bi,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(e,{}),(0,B.jsx)(xi,{children:`The rest of this run's history did not load`}),(0,B.jsxs)(Si,{children:[k,` `,(0,B.jsx)(Gi,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),d.notice&&(0,B.jsx)(`p`,{className:`live-notice`,role:`status`,children:d.notice}),(0,B.jsx)(b$,{label:`Shutdown of the entire host`,onDismiss:b.host.dismiss,rows:T?.runs??[],state:b.host.state})]});return(0,B.jsx)(xp,{children:(0,B.jsx)(d1,{children:(0,B.jsxs)(`div`,{className:`app-shell`,children:[(0,B.jsx)(GQ,{rows:d.navigationRows,failed:d.rows===void 0&&d.error!==void 0,selectedRunId:p,onSelect:e=>{i.selectRun(e),l.close()},onOpenProject:i.selectRun,onHost:()=>{i.selectHost(),l.close()},hostCurrent:i.host&&!a.active,onActionItems:()=>{a.open(),l.close()},actionItemsCurrent:a.active,hiddenKinds:i.hiddenKinds,onKindsChange:i.selectKinds,drawerOpen:l.open,drawerRef:l.drawer,updates:(0,B.jsx)($0,{caption:`Navigation`,name:`Navigation updates`,onChange:c.setNavigation,setting:c.navigation,waiting:d.navigationWaiting})}),l.open&&(0,B.jsx)(`button`,{"aria-label":`Close navigation`,className:`nav-scrim`,onClick:l.close,type:`button`}),(0,B.jsx)(`main`,{className:`workspace`,inert:l.open,children:o?(0,B.jsxs)(B.Fragment,{children:[ee(void 0),L,a.active?(0,B.jsx)(BZ,{client:t,live:d.humanItems,choice:s.choice,setChoice:s.setChoice,selectedId:s.selectedId,setSelectedId:s.setSelectedId}):(0,B.jsx)(OK,{client:t,listError:E,onRefresh:()=>S(e=>e+1),list:T,rows:d.hostRows,children:(0,B.jsx)(_$,{list:T,loadMore:n2,loadingMore:!1,shutdowns:b})})]}):(0,B.jsxs)(jf,{className:`min-h-0 flex-1 gap-0`,onValueChange:e=>e===`overall`?i.showOverall():i.selectNode(void 0),value:i.view,children:[ee((0,B.jsx)(`div`,{className:`view-tabs`,children:(0,B.jsxs)(Nf,{"aria-label":`DAG views`,variant:`line`,children:[(0,B.jsxs)(Pf,{value:`graph`,children:[(0,B.jsx)(Et,{size:15}),` Graph`]}),(0,B.jsxs)(Pf,{value:`overall`,children:[(0,B.jsx)(vt,{size:15}),` Overall`]})]})})),L,(0,B.jsx)(Ff,{className:`min-h-0`,value:i.view,children:j&&d.error?(0,B.jsx)(`div`,{className:`loading-state`,children:(0,B.jsxs)(`div`,{className:`read-failed`,role:`alert`,children:[(0,B.jsx)(`strong`,{children:`This run's history did not load`}),(0,B.jsx)(`p`,{children:d.error.message}),(0,B.jsx)(`button`,{onClick:d.refresh,type:`button`,children:`Try again`})]})}):!h&&(d.loading||p!==void 0)?(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,B.jsx)(jd,{className:`h-2 w-48`}),(0,B.jsx)(jd,{className:`h-2 w-32`}),`Loading execution history…`]}):h&&p?i.view===`overall`?(0,B.jsx)(R0,{client:t,detail:h,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,journalSeq:D?.last_seq,nodes:g,onRetry:d.refresh,state:y,status:_.status,timeline:d.timeline,timelineError:d.timelineError,onSelectNode:i.selectNode,onSelectItem:i.selectItem,selectedItemId:i.itemId},p):F?(0,B.jsx)(w0,{client:t,hiddenTypes:i.hiddenEventTypes,onHiddenTypesChange:i.selectEventTypes,runLoaded:O,onRetry:d.refresh,node:F,nodes:g,onBack:()=>i.selectNode(void 0),onSelectItem:i.selectItem,runId:p,selectedItemId:i.itemId,selectedTab:i.nodeTab,onSelectTab:i.selectNodeTab,timeline:d.timeline,timelineError:d.timelineError},`${p}:${F.id}`):(0,B.jsx)(CK,{journalSeq:D?.last_seq,nodes:g,selectedNodeId:i.nodeId,onSelectNode:i.selectNode}):(0,B.jsxs)(`div`,{className:`empty-state`,children:[(0,B.jsx)(Et,{size:34}),(0,B.jsx)(`h2`,{children:`No DAG runs found`}),(0,B.jsx)(`p`,{children:`Start an orchestrated run to see it appear here.`})]})})]})}),A&&k===void 0&&(0,B.jsx)(`p`,{className:`history-loading`,role:`status`,children:`The rest of this run's history is still loading`})]})})})}function i2(e){return e.description||e.kind}var a2=class extends z.Component{state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`DAG UI render failed`,e,t.componentStack)}render(){return this.state.error?(0,B.jsxs)(`main`,{className:`fatal-error`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Rendering error`}),(0,B.jsx)(`h1`,{children:`The DAG view could not be displayed.`}),(0,B.jsx)(`p`,{children:this.state.error.message}),(0,B.jsx)(Gi,{onClick:()=>(this.props.onReload??(()=>window.location.reload()))(),type:`button`,variant:`secondary`,children:`Reload`})]}):this.props.children}};function o2(e,t,n){let r=n===void 0?e:document.createElement(`div`);r!==e&&(r.setAttribute(`data-app-behind-first-screen`,``),r.style.cssText=`position:fixed;inset:0;visibility:hidden;`,document.body.appendChild(r)),(0,$k.createRoot)(r).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(a2,{children:(0,B.jsx)(r2,{first:t,onDrawn:()=>{r!==e&&(n?.unmount(),e.replaceWith(r),r.id=`root`,r.removeAttribute(`data-app-behind-first-screen`),r.style.cssText=``)}})})}))}export{o2 as mountApp};
|