@intent-hq/web 2.372.0 → 2.372.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{831yit0u.js → -A1Xt6t2.js} +1 -1
- package/web/app/immutable/chunks/{DzQ9pTdH.js → 0A5oWXer.js} +1 -1
- package/web/app/immutable/chunks/{BjnC0-9k.js → 2EVipgJi.js} +1 -1
- package/web/app/immutable/chunks/{87xWd9kf.js → 7UCN4F7m.js} +1 -1
- package/web/app/immutable/chunks/{CQrtn7uL.js → B-9Pvu6y.js} +1 -1
- package/web/app/immutable/chunks/{DOfs-gJd.js → B-vPMZJe.js} +1 -1
- package/web/app/immutable/chunks/{DPE-JMtK.js → B2pOchvy.js} +1 -1
- package/web/app/immutable/chunks/{CSOGWXLp.js → B6jc-_sR.js} +1 -1
- package/web/app/immutable/chunks/{C2-otZwl.js → B873lVHv.js} +3 -3
- package/web/app/immutable/chunks/{B0VS3QHA.js → BAy-IHSv.js} +1 -1
- package/web/app/immutable/chunks/{Bqcfe5TT.js → BCAvwmcb.js} +1 -1
- package/web/app/immutable/chunks/{CcdfY8p5.js → BD3toGAv.js} +1 -1
- package/web/app/immutable/chunks/{CI-9xLBe.js → BEAj7h28.js} +1 -1
- package/web/app/immutable/chunks/{DZfjVo5t.js → BJ8UpUx3.js} +1 -1
- package/web/app/immutable/chunks/{tHutCKct.js → BN7MhY13.js} +1 -1
- package/web/app/immutable/chunks/{rYQs4fAE.js → BOj9vGyw.js} +1 -1
- package/web/app/immutable/chunks/{BxehPJxq.js → BQYZptYQ.js} +1 -1
- package/web/app/immutable/chunks/{P8hAbmXB.js → BRIObpKH.js} +1 -1
- package/web/app/immutable/chunks/{CKOWGM2h.js → BRbooHVW.js} +1 -1
- package/web/app/immutable/chunks/{DTUDqqvP.js → BRfr79MP.js} +1 -1
- package/web/app/immutable/chunks/{Enj8TVg6.js → BUIz4Yba.js} +1 -1
- package/web/app/immutable/chunks/{Cttcfwyz.js → BbSguaMP.js} +1 -1
- package/web/app/immutable/chunks/{DEY6iSRW.js → BbU8lQ23.js} +1 -1
- package/web/app/immutable/chunks/{BG3Ebj57.js → Bb_op89B.js} +3 -3
- package/web/app/immutable/chunks/{DqABqR68.js → Bc_WCBau.js} +1 -1
- package/web/app/immutable/chunks/{Cs5tgO-b.js → Be-tvUeZ.js} +1 -1
- package/web/app/immutable/chunks/{CbMY6SJh.js → BiWJoWSv.js} +3 -3
- package/web/app/immutable/chunks/{D-rjvjF4.js → Bn_8JArX.js} +1 -1
- package/web/app/immutable/chunks/{D4k6RYUX.js → BtZepnY7.js} +1 -1
- package/web/app/immutable/chunks/{D1XBIS4d.js → BxNRSHj7.js} +3 -3
- package/web/app/immutable/chunks/{CzB8OdN6.js → C-CEp48D.js} +1 -1
- package/web/app/immutable/chunks/{DjRAhqVm.js → C1elIQnx.js} +1 -1
- package/web/app/immutable/chunks/{xDHVFIMJ.js → C3HJlgor.js} +1 -1
- package/web/app/immutable/chunks/{PQTTXGcn.js → C4Dbybcz.js} +1 -1
- package/web/app/immutable/chunks/{CU0T1_4H.js → C7-pF3hJ.js} +1 -1
- package/web/app/immutable/chunks/{BCl0bKac.js → C8e17gER.js} +1 -1
- package/web/app/immutable/chunks/{BisaElGo.js → C8kqUaJu.js} +4 -4
- package/web/app/immutable/chunks/{D2IPgYKy.js → C9WFArWI.js} +2 -2
- package/web/app/immutable/chunks/{CkUjwYD9.js → CFPreIC6.js} +3 -3
- package/web/app/immutable/chunks/{DWne2Ca4.js → CGprRn3S.js} +1 -1
- package/web/app/immutable/chunks/{CEVE3XrG.js → CJJs2g33.js} +1 -1
- package/web/app/immutable/chunks/{DWRcesyP.js → CJrtVlDG.js} +1 -1
- package/web/app/immutable/chunks/{BL6KysZT.js → CKEnN_Hn.js} +1 -1
- package/web/app/immutable/chunks/{DnE-1Bxa.js → CPI29I6f.js} +1 -1
- package/web/app/immutable/chunks/{CYR-FbvP.js → CTpG0iUn.js} +1 -1
- package/web/app/immutable/chunks/{DHh2do2s.js → CU2GkTBo.js} +1 -1
- package/web/app/immutable/chunks/{D43Jqbde.js → CVhHgrXf.js} +1 -1
- package/web/app/immutable/chunks/{CD8rDp1I.js → Cc-PW4gv.js} +1 -1
- package/web/app/immutable/chunks/{Cc258RGc.js → ChUo22u6.js} +3 -3
- package/web/app/immutable/chunks/{B_dYfWPi.js → CiKM_Bkk.js} +3 -3
- package/web/app/immutable/chunks/{CVko5-Ce.js → ClsrgcJW.js} +1 -1
- package/web/app/immutable/chunks/{JhsJwerv.js → Cp4OFkA0.js} +1 -1
- package/web/app/immutable/chunks/{D8lwHYbt.js → Cp6ekE_s.js} +1 -1
- package/web/app/immutable/chunks/{-wVJP2Nv.js → Cqh6RRVt.js} +2 -2
- package/web/app/immutable/chunks/{BWxNGH0I.js → CrKTQysx.js} +1 -1
- package/web/app/immutable/chunks/{4tnKpgtx.js → CtatSKin.js} +2 -2
- package/web/app/immutable/chunks/{DqYcXS23.js → CuByX_yP.js} +1 -1
- package/web/app/immutable/chunks/{D4Sr27VP.js → CugIOLIa.js} +1 -1
- package/web/app/immutable/chunks/{Cu6uSewr.js → CuiAAAM-.js} +2 -2
- package/web/app/immutable/chunks/{14PuynRk.js → Cuk_Gihq.js} +1 -1
- package/web/app/immutable/chunks/{CRPodL8x.js → CutJRErj.js} +1 -1
- package/web/app/immutable/chunks/{Dpx32Qmu.js → CvNJnDlW.js} +3 -3
- package/web/app/immutable/chunks/{SA06hBPi.js → CzTHqaDJ.js} +13 -13
- package/web/app/immutable/chunks/{COL2_tWj.js → D-Uz-39Z.js} +1 -1
- package/web/app/immutable/chunks/{CNY7yqiH.js → D1S-BeW0.js} +1 -1
- package/web/app/immutable/chunks/{B_wU2oqB.js → D6QsCyM5.js} +2 -2
- package/web/app/immutable/chunks/{Bu27PjCq.js → D7c2h2XU.js} +1 -1
- package/web/app/immutable/chunks/{pvJ_cn50.js → D7h3Dl5-.js} +1 -1
- package/web/app/immutable/chunks/{7FgEVpQ3.js → D8PTjyMt.js} +1 -1
- package/web/app/immutable/chunks/{CLAx8h40.js → D9sQ8qcN.js} +1 -1
- package/web/app/immutable/chunks/{CSPmTvrs.js → D9uHbDgA.js} +2 -2
- package/web/app/immutable/chunks/{WNTW6hiT.js → DAd8-v0C.js} +1 -1
- package/web/app/immutable/chunks/{fq6SYOzd.js → DBeNyp1m.js} +1 -1
- package/web/app/immutable/chunks/{C02go3w8.js → DD1WD1M5.js} +1 -1
- package/web/app/immutable/chunks/{B2xC2uJc.js → DDRbr07B.js} +1 -1
- package/web/app/immutable/chunks/{DyBjQloT.js → DEkD3je6.js} +1 -1
- package/web/app/immutable/chunks/{C8Rbp5XG.js → DFudQwu4.js} +1 -1
- package/web/app/immutable/chunks/{xmaMS7As.js → DHk9xTTU.js} +1 -1
- package/web/app/immutable/chunks/{D8p89jlI.js → DJPMh7Pg.js} +1 -1
- package/web/app/immutable/chunks/{B1UYfQY0.js → DLR3Xiy1.js} +1 -1
- package/web/app/immutable/chunks/{CcG4EdUX.js → DRbwhDjx.js} +1 -1
- package/web/app/immutable/chunks/{CsP9aubD.js → DVWpH0Ww.js} +1 -1
- package/web/app/immutable/chunks/{CeH003CQ.js → DVuRO9FX.js} +4 -4
- package/web/app/immutable/chunks/{nSDaSLgN.js → DXoCvZQl.js} +1 -1
- package/web/app/immutable/chunks/{C6eGErE5.js → DaO8nz6N.js} +2 -2
- package/web/app/immutable/chunks/{I3rQi8Mk.js → Demr6Qvy.js} +1 -1
- package/web/app/immutable/chunks/{ixY04dr_.js → Dh6rqlVy.js} +1 -1
- package/web/app/immutable/chunks/{CkdufNLY.js → Dhb96fci.js} +1 -1
- package/web/app/immutable/chunks/{Br82-Xei.js → DiFC8Mk6.js} +1 -1
- package/web/app/immutable/chunks/{O2Ahsla9.js → DjmUoBsP.js} +1 -1
- package/web/app/immutable/chunks/{YeAZLB5H.js → DkM2tUNb.js} +1 -1
- package/web/app/immutable/chunks/{B17WB5I_.js → DlXO0azG.js} +1 -1
- package/web/app/immutable/chunks/{BoQ6mo7A.js → Dm3V_bi_.js} +1 -1
- package/web/app/immutable/chunks/{A9ecW27k.js → DpBTZWt9.js} +1 -1
- package/web/app/immutable/chunks/{DHAMveef.js → DuiyN7wg.js} +1 -1
- package/web/app/immutable/chunks/{DT8wW0xY.js → DuvgBOgL.js} +1 -1
- package/web/app/immutable/chunks/{BJPFCP7M.js → DyVTwc41.js} +1 -1
- package/web/app/immutable/chunks/{DHDLfgZi.js → EUqcNEWQ.js} +1 -1
- package/web/app/immutable/chunks/{ClzgmEiJ.js → IcVyfKsD.js} +1 -1
- package/web/app/immutable/chunks/{BnU26i3j.js → IpC95BdD.js} +1 -1
- package/web/app/immutable/chunks/{DnNbT2UP.js → KwzSRF2d.js} +1 -1
- package/web/app/immutable/chunks/{teD5XqBt.js → MUCe8vjx.js} +6 -6
- package/web/app/immutable/chunks/{GFZ204Jt.js → QMZYeDiU.js} +1 -1
- package/web/app/immutable/chunks/{_Zri9kdP.js → QnlnDXiH.js} +2 -2
- package/web/app/immutable/chunks/{yVus3yZB.js → SSRyQIWE.js} +1 -1
- package/web/app/immutable/chunks/{Dw3Zchmi.js → TET1QjU6.js} +1 -1
- package/web/app/immutable/chunks/{Byf67NBn.js → TYee8CmD.js} +1 -1
- package/web/app/immutable/chunks/{G7hg690T.js → VNZmrcSz.js} +1 -1
- package/web/app/immutable/chunks/{D5F19aKJ.js → d4XsLpJr.js} +1 -1
- package/web/app/immutable/chunks/{DaJLZAtJ.js → fZM82vlq.js} +2 -2
- package/web/app/immutable/chunks/{qmbewbeC.js → gFsMmW36.js} +1 -1
- package/web/app/immutable/chunks/{Cb1kbo-l.js → hlGimPBZ.js} +1 -1
- package/web/app/immutable/chunks/{B2az9vht.js → jWqlu3Sf.js} +2 -2
- package/web/app/immutable/chunks/{CshcKh7R.js → kVZwUKh5.js} +1 -1
- package/web/app/immutable/chunks/{BdKyRGol.js → nPO4QUTk.js} +1 -1
- package/web/app/immutable/chunks/{0WGKoTp7.js → piULzuzd.js} +1 -1
- package/web/app/immutable/chunks/{8nvKsF1U.js → uh-AKdCH.js} +1 -1
- package/web/app/immutable/chunks/{Dw1vGMUI.js → v3dlpdhZ.js} +1 -1
- package/web/app/immutable/chunks/{Bgv4xl9c.js → vRnYB3t4.js} +1 -1
- package/web/app/immutable/chunks/{eJTQudLa.js → vjUVG9_D.js} +1 -1
- package/web/app/immutable/chunks/{BgwOqGGz.js → wUr2Clcr.js} +3 -3
- package/web/app/immutable/chunks/{CfwJkes2.js → xs7GVnBi.js} +1 -1
- package/web/app/immutable/chunks/{Ch_at1f7.js → zmWxChUq.js} +1 -1
- package/web/app/immutable/entry/{app.o5RAXAAj.js → app.HXk4QgVW.js} +2 -2
- package/web/app/immutable/entry/start.okH3MvzT.js +1 -0
- package/web/app/immutable/nodes/{0.DTgMOczx.js → 0.C35VPs87.js} +1 -1
- package/web/app/immutable/nodes/{1.DmX_GPIL.js → 1.ZQ0mU96X.js} +1 -1
- package/web/app/immutable/nodes/{10.CsL1og_U.js → 10.Ba3bdQFj.js} +4 -4
- package/web/app/immutable/nodes/{11.DRyBXsyz.js → 11.ls9oXbQw.js} +1 -1
- package/web/app/immutable/nodes/{15.DDwysLtQ.js → 15.DwnvTlNj.js} +1 -1
- package/web/app/immutable/nodes/{19.DQoSX-dg.js → 19.ChdL9npo.js} +2 -2
- package/web/app/immutable/nodes/{2.9n1G_JzW.js → 2.CEHgYNfF.js} +4 -4
- package/web/app/immutable/nodes/{3.BVw8jFJ4.js → 3.yDo-Jv4L.js} +1 -1
- package/web/app/immutable/nodes/{4.DjCaEZub.js → 4.BfGmTHCX.js} +1 -1
- package/web/app/immutable/nodes/{5.D4a0KA3T.js → 5.CdbvrG1H.js} +1 -1
- package/web/app/immutable/nodes/{6.BHOytGZd.js → 6.D-e34gg6.js} +1 -1
- package/web/app/immutable/nodes/{7.CvMVMdst.js → 7.DkqU_r1v.js} +1 -1
- package/web/app/immutable/nodes/{8.BwKdMsTy.js → 8.DXAWn9Y1.js} +1 -1
- package/web/app/immutable/nodes/{9.CbsmExoL.js → 9.a_zRpwry.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.BwuZE7hN.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var M_=Object.defineProperty;var Ag=n=>{throw TypeError(n)};var E_=(n,r,a)=>r in n?M_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Qs=(n,r,a)=>E_(n,typeof r!="symbol"?r+"":r,a),q_=(n,r,a)=>r.has(n)||Ag("Cannot "+a);var Co=(n,r,a)=>(q_(n,r,"read from private field"),a?a.call(n):r.get(n)),Mg=(n,r,a)=>r.has(n)?Ag("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as dn,bo as Z,bw as un,bp as nf,b as gn,bm as g,bq as Dr,bs as fe,br as Ei}from"./ClpAEjbe.js";import{bs as pn,a5 as I,bf as fs,bA as b,W as p,bn as fn,aA as ee,aB as E,ca as le,a7 as Bt,ay as ye,aD as e,cd as Nn,c9 as o,bS as m,bl as de,be as In,b_ as q,bO as z,c5 as ct,bH as _,bV as _e,bj as Es,bk as to,b$ as _n,ai as Od,aj as ps,bo as Wl,br as Rr,c0 as Lt,cb as nd,aw as _i,a as L_}from"./CJxGDkBm.js";import{i as B}from"./wmcYjLAa.js";import{k as ki}from"./Xh71Wbuh.js";import{g as Hn,i as H_,I as Mo,p as Eo,e as To}from"./BwASeArv.js";import{n as Dt,l as ma,c as Zs,j as Eg,k as Ho,h as O_}from"./oXpJ1LFx.js";import{b as rf,e as Fd,f as ke,s as Ue,c as Ut,g as gs}from"./CnGVh7I3.js";import{b as F_}from"./DfTSMq0b.js";import{b as hr}from"./NtFyWdpR.js";import{m as D_,U as N_,Z as B_,X as W_,Y as U_,I as qg,o as z_,l as j_,a2 as V_,x as Lg,$ as G_,a0 as Hg,r as K_,s as Q_}from"./CkUjwYD9.js";import{Jq as O,fo as J_,eW as Y_,f3 as X_,eX as Z_,f1 as ew,f0 as tw,eZ as nw,e$ as rw,eY as aw,rs as sw,c6 as ow,i as Si,I$ as iw,D8 as af,Dd as lw,Df as Og,Dc as cw,De as dw,vB as uw,vD as gw,Cl as sf,cp as pw,cn as fw,Bu as vw,bE as hw,A0 as mw,Ca as rd,uZ as _w,cq as Fg,dB as ww,dC as bw,Ck as yw,el as Iw,CE as Sw,CD as $w,CI as kw,CH as xw,cQ as Cw,cT as Pw,nA as Rw,er as Tw,wO as Aw,CJ as Mw,wQ as Ew,CK as qw,cU as Lw,cV as Hw,nI as Ow,Ad as Fw,Dp as Dw,wj as Nw,wk as Bw,yY as Ww,z0 as ad,wf as Uw,wg as zw,rQ as jw,rd as Vw,rb as Gw,f_ as Kw,HK as Qw,Le as Jw,GI as Yw,gn as Xw,p0 as Zw,Je as eb,oh as tb,z$ as nb,ft as Dg,r0 as Ng,fm as rb,fl as ab,tz as sb,g3 as Bg,rc as ob,fe as ib,C5 as lb,m as cb,nJ as db,zE as ub,yW as gb,Ev as pb,Ek as Wg,xe as fb,xf as Ug,uY as zg,p1 as vb,DB as hb,gj as mb,g1 as _b,eU as wb,cM as bb,A3 as yb,Lj as Ib,Cq as Sb,LB as $b,x$ as kb,ga as xb,fd as Cb,cL as Pb,cI as Rb,cH as Tb,vp as Ab,xl as Mb,xj as Eb,cF as qb,cE as Lb,z2 as Hb,yZ as Ob,xk as Fb}from"./CpP1PKzF.js";import{a as Dd}from"./CC7to1B5.js";import{aB as Db,aA as Nb,b1 as Bb,_ as Wb,as as Ub,aD as zb,z as of,R as lf,aV as jb,aP as Vb,ai as jg,J as _l,aN as Vg,aM as Gg,aL as Kg}from"./Dpx32Qmu.js";import{k as cf,F as Gb,G as df,ao as Kb,aX as Tl,a5 as uf,Q as Qb,aQ as sd,al as Jb,aD as Yb,B as Xb,y as gf,r as Zb,z as ey,u as ty,aV as ny,aB as pf,aA as ff,aC as ry,aG as od,aN as Qg,aM as wl,aO as Jg,P as Yg,d as ay,e as sy,as as oy,V as Xg,az as iy,c as ly,l as cy,aP as Zg,ak as dy,ar as ep,a as uy,av as gy,a9 as tp,ay as py,aR as np,aU as rp,m as ap,aa as fy,R as vy,at as sp,ah as hy,O as my,an as _y,h as wy,p as by,ax as op,a4 as yy,f as Iy,i as Sy,a2 as $y,a8 as ky}from"./BgwOqGGz.js";import{d as xy,l as Cy,x as Py,v as Ry,k as Ty,Z as ip,a5 as Ay,D as My,c as Ey}from"./BxKppgO5.js";import{g as Ci}from"./DypB-Dwi.js";import{dT as Hl,cR as vf,O as hf,W as qy,bs as Ly,aE as mf,dE as _f,aT as Ao,e4 as Hy,dt as wf,av as Nd,dS as Bd,aM as bf,cM as Oy,V as ha,a3 as Ys,B as Fy,a7 as Dy,a4 as Ny,M as By,a6 as Wy,ar as Uy,aF as yf,aN as Al,r as zy,n as $d,H as jy,dV as Vy,aP as Gy,aJ as Ky,c6 as Qy,aV as Jy,bJ as Yy,bH as Xy,bI as Zy,c5 as eI,c4 as tI,cK as nI,cJ as rI,aR as aI,b9 as sI,bb as oI,be as iI,ba as lI,bj as cI,bd as dI,bc as uI,bf as gI,bg as pI,bi as fI,bh as vI,aw as hI,ax as mI,cg as _I,ch as wI,ds as bI,dr as yI,a_ as II,G as SI,b2 as $I,cc as kI,C as lp,cZ as xI,b8 as ds,bY as CI,X as PI,E as RI,ad as TI,t as AI,cT as MI,d0 as cp,Q as dp,dq as EI,cN as id}from"./D9Ykl3eH.js";import{u as If,a as bl,ag as qI,x as LI,ad as Sf,af as HI,ac as $f,a4 as OI,F as up,D as FI,e as DI,n as NI,s as BI,m as WI,Y as UI,k as zI}from"./CcG4EdUX.js";import{a4 as jI,b5 as VI,cM as GI,a_ as KI,b4 as QI,c2 as JI,c9 as YI,w as XI,x as ZI,cd as eS}from"./D8p89jlI.js";import{n as tS,P as kf,F as nS,ai as rS,r as aS,ac as sS}from"./CgBcONKs.js";import{I as oS,s as iS,H as gp}from"./Bqd7fdCF.js";import{e as lS}from"./CL3a4Hm1.js";import{e as cS,f as dS}from"./BqoCUMk3.js";import{s as uS,o as Xs,b as gS,g as Ol,d as pS,l as wi}from"./CIyUrgF0.js";import{a4 as fS,a6 as vS,D as hS,M as mS,ab as pp,W as _S,i as wS,r as ir,v as Pi,u as Xr,p as $i,x as mr,S as Wd,m as Ul,s as qo,y as Ri,o as no,n as ro,t as fp,a9 as ao,w as so,a8 as Ud,q as _a,z as Lo,I as kd,Z as vp,g as bS,F as yS,U as xf,H as Cf,a7 as Pf,a5 as Ml,N as IS,E as Rf,R as SS,A as $S,b as kS,aa as xS,ac as yl,e as ld,l as CS,C as PS,f as Js,j as hp,G as us,Q as RS,d as cd,c as TS,a as mp,h as AS,K as MS,X as _p,a3 as dd,a0 as wp,$ as ES,a2 as bp,_ as yp,T as qS,B as LS,k as HS,a1 as OS,J as FS,P as DS,O as NS,V as BS}from"./CKOWGM2h.js";import{m as WS}from"./PVXvIyE8.js";import{g as Tf}from"./0LjODXcP.js";import{b as US}from"./C5TH9nNS.js";import{g as zS}from"./BriVXGmT.js";import{a as jS}from"./CvXttgUy.js";import{q as Af,d as lr,r as VS,e as Fl,j as GS,g as xd,i as KS,f as Cd,c as QS,A as JS,O as Ip,k as YS}from"./I3rQi8Mk.js";import{P as XS}from"./Dp3fRAus.js";import{e as ZS}from"./DemmMiIF.js";import{b as e$,a as t$,g as n$,c as r$,i as a$}from"./CNcD7ed8.js";import{R as s$,g as o$,W as Il,c as i$}from"./CNY7yqiH.js";import"./Gb7Ohwuc.js";import"./BYiyLeZ4.js";import{s as Ti}from"./WSVFXKpL.js";import{F as l$,h as c$}from"./CPDV_dyu.js";import"./Qt_rZNko.js";import{C as d$,e as Or,L as u$,l as zl,d as jl,K as Vl,h as zd,M as Gl,S as Da}from"./B06RKBOm.js";import{D as g$}from"./CHXqkR4Y.js";import{f as Sp}from"./D35mkEt2.js";import"./BoIfXiRv.js";import{i as Mf}from"./D-g0wh54.js";import{h as $p,i as kp,g as xp,P as Cp,C as p$,m as El,R as f$}from"./C1zxTHwk.js";import{f as xt,ae as v$}from"./BVi5KkOP.js";import{F as pt,bs as h$,cd as m$,aw as Na,a2 as Ef,c9 as _$,bf as w$,be as b$,bg as y$,aO as Pp,aj as ud,aB as gd,bB as qf,d3 as Dl,cF as I$,aM as Rp,cb as Tp,cK as Nl,bu as S$,aS as $$,d0 as k$,a8 as Lf,ac as x$,ag as C$,cr as P$,ba as R$,aC as Hf,cT as Ap,cz as T$,ax as A$,cD as M$,c3 as E$}from"./CtJxHvGv.js";import{c as Of}from"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{c as Rt}from"./DSqSJXGX.js";import{a5 as Ff,bg as q$,ar as L$,k as H$,Y as O$,W as F$,a2 as D$,Z as N$,bw as B$,V as W$,a1 as U$,ah as z$}from"./Br82-Xei.js";import{d as Bl,f as j$,e as V$}from"./nSDaSLgN.js";import{A as G$}from"./BCrI1nnw.js";import{D as K$}from"./DnYPeWf9.js";import"./B5wwCKYG.js";import{a as Q$,C as J$}from"./BTW5Qz3T.js";import"./V7b2Jgc1.js";import{C as Y$}from"./C7RGdxsV.js";import{h as Pd,r as X$,a as Z$}from"./B_wU2oqB.js";import{s as ek}from"./CRpGhS3h.js";import{I as tk,a as nk}from"./MZe3NxQe.js";import{L as rk}from"./CIMWDf4a.js";import{g as ak,f as sk,b as ok}from"./b89lNINv.js";import{s as Ai,g as Kn,i as ik,j as lk,e as Mp,r as Ep,f as ck,d as dk,a as pd,h as uk}from"./CVko5-Ce.js";import{i as qp,a as gk}from"./Bu13V5mO.js";import{seekConversationToMessage as Lp}from"./Cs5tgO-b.js";import{l as Yt,o as fd,h as jd,n as Rd,q as pk}from"./By588DV1.js";import{o as fk}from"./C6eGErE5.js";import{A as Df}from"./BQgCURYe.js";import{b as Nf}from"./Dd5ei__B.js";import{g as vk,e as Bf,v as hk,f as mk,N as _k,M as wk,K as bk,k as Wf,l as yk,H as Uf,s as zf}from"./Qqd9dQHZ.js";import{selectCurrentWorkspaceTabId as vd}from"./DujUyPvo.js";import{o as Ik}from"./xmaMS7As.js";import{d as Sk}from"./B0Z-1lwJ.js";import{P as $k}from"./BHjJ9bUD.js";import{g as kk}from"./DjRAhqVm.js";import{H as jf,M as xk,y as Ck,g as Pk,i as Rk,u as Tk,e as Vf,c as Gf,d as Ak}from"./Ct82vzld.js";import{c as Mk,h as Vd,f as Kf,M as Ek}from"./B6-GEB4b.js";import{t as qk}from"./DAsc1V4f.js";import{s as Lk}from"./BsieX9dN.js";import{i as Qf}from"./D95Y9O1z.js";import{d as Hk,i as Ok,r as Fk}from"./CTV49dzf.js";import{g as Dk}from"./CsFPvReh.js";var Nk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Bk=E("<div><!></div>");function Jf(n,r){if(new.target)return dn({component:Jf,...n});pn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=nf(r,Nk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return c()},set children(v){c(v),ee()},$set:un,$on:(v,R)=>gn(r,v,R)},u=Bk();rf(u,v=>({"data-slot":"card-header",class:v,...l}),[()=>Fd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",Y$,i())]);var w=I(u);return Ti(w,()=>c()??fs),b(u),hr(u,v=>a(v),()=>a()),p(n,u),fn(f)}var Wk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Uk=E("<div><!></div>");function Yf(n,r){if(new.target)return dn({component:Yf,...n});pn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=nf(r,Wk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return c()},set children(v){c(v),ee()},$set:un,$on:(v,R)=>gn(r,v,R)},u=Uk();rf(u,v=>({"data-slot":"card-title",class:v,...l}),[()=>Fd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var w=I(u);return Ti(w,()=>c()??fs),b(u),hr(u,v=>a(v),()=>a()),p(n,u),fn(f)}const Sl=oS.CHAT_MEDIA,hd=uS().min(1).max(512);Xs({workspaceId:hd,agentId:hd,draftId:Ol(),principalId:hd,media:gS(tS).min(1).max(20)}).strict();const zk=Xs({sessionId:Ol()}).strict();zk.extend({control:pS("action",[Xs({action:wi("readiness")}).strict(),Xs({action:wi("export"),request:cS}).strict(),Xs({action:wi("transcribe"),request:dS}).strict(),Xs({action:wi("release"),jobId:Ol()}).strict(),Xs({action:wi("adopt"),jobId:Ol()}).strict()])}).strict();function Gd(n,r,a,i=async(c,l)=>typeof window>"u"||iS(window)!=="electron"?{ok:!1,error:"unavailable"}:lS().invoke(c,l)){let c=null,l=null,f=!1;async function u(){f=!0,a.removeEventListener("abort",w);const x=c;c=null,x&&await i(Sl.CLOSE,{sessionId:x}).catch(()=>{})}const w=()=>{u()};a.addEventListener("abort",w,{once:!0});const v=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function R(){if(v(),c)return c;if(l)return l;l=(async()=>{const x=await i(Sl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");c=x.value.sessionId;try{return v(),c}catch(F){throw await u(),F}})();try{return await l}finally{l=null}}async function y(x){const F=await R();v();const D=await i(Sl.CONTROL,{sessionId:F,control:x});return v(),D}return{service:{exportMedia:x=>y({action:"export",request:x}),adoptMediaJob:x=>y({action:"adopt",jobId:x}),transcribeMedia:x=>y({action:"transcribe",request:x}),releaseMediaJob:async x=>c?await i(Sl.CONTROL,{sessionId:c,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:u,readiness:()=>y({action:"readiness"})}}const md=new Set;async function jk(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:u}=i,w=Ci(O.state),v=Hl.select(O.state,f),R=vf.select(O.state),y=cf(),M=JSON.stringify([w,f,u]);if(!w||!v||!R||l.wsId!==f||md.has(M))return!1;md.add(M);const x=new AbortController,F=()=>x.abort();a.addEventListener("abort",F,{once:!0});const D=()=>!a.aborted&&!x.signal.aborted&&Ci(O.state)===w&&Hl.select(O.state,f)===v&&uf(y)&&r.isCurrentDraft(i),T=O.getReadableState().subscribe(()=>{D()||x.abort()});let H=null;try{if(!D()||jI(c))return!1;const V=If(i.attachments),oe=kf(nS(f,u),V,c.map(ue=>({contextItemId:ue.id,attachmentId:ue.attachmentId,path:ue.path}))),P=new Set([...oe.images,...oe.clips].map(ue=>ue.contextItemId));if(V.some(([ue])=>!P.has(ue))||oe.images.some(ue=>ue.mediaError)||oe.clips.some(ue=>ue.mediaError)||!rS(l.text,oe))throw new Error("invalid-evidence");if(H=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!D())return!1;const k=await xy.agents.get(u,f);if(!D())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const Q=oe.clips.flatMap(ue=>ue.media?[ue.media]:[]);Q.length&&!H&&(H=Gd({workspaceId:f,agentId:u,draftId:crypto.randomUUID(),principalId:R.principal.id,media:Q},D,x.signal));const ge=Gb(c,oe),Re=df(ge),ve=await Kb({workspaceId:f,agentId:u,evidence:oe,clickedItems:c,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Re.imageBlocks,fileBlocks:Re.fileBlocks},binding:y,service:H?.service??null,current:D,onRecord:()=>{}});return!ve||!D()?!1:Tl(O,u,ve)}catch{return D()&&O.dispatch(J_(u,g.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",F),await H?.dispose(),md.delete(M)}}const Xf=1e4,Hp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Op(n){return fS(n.messageMetadata)}function Vk(n,r){if(n.some(Op)){const a=n[0];return a&&!Op(a)&&Fp(a,r)?[a.id]:[]}return n.filter(a=>Fp(a,r)).map(a=>a.id)}function Gk(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Fp(n,r){return!n.requeuedAfterFailure&&vS(n,r)}function Kk(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,f=r.blocked||r.interrupted,u=r.timeoutMs??Xf;let w=n.prediction;if(w){const x=new Set(i.map(H=>H.id)),F=w.ids.filter(H=>x.has(H)&&!c.has(H)),D=l-w.startedAt>=u,T=n.wasBusy&&!a;!F.length||D||f&&!a||T?w=null:F.length!==w.ids.length&&(w={...w,ids:F})}const v=n.wasBusy&&!a,R=n.wasBusy?n.busySince:a?l:null,y=n.wasBusy&&n.preempted||R!==null&&r.directSendAt!==null&&r.directSendAt>R;if(!w&&v&&!f&&!y){const x=Vk(i,l).filter(F=>!c.has(F));x.length&&(w={ids:x,startedAt:l})}const M={wasBusy:a,busySince:a?R:null,preempted:a&&y,prediction:w};return n.wasBusy===M.wasBusy&&n.busySince===M.busySince&&n.preempted===M.preempted&&n.prediction===M.prediction?n:M}class Qk{constructor(){Qs(this,"previousWorkspaceId",null);Qs(this,"_isRebinding",!1);Qs(this,"_generation",0);Qs(this,"_rebindPromise",null);Qs(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{c=setTimeout(()=>f(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function Jk(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Dp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var Yk=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function Zf(n,r){if(new.target)return dn({component:Zf,...n});pn(r,!0);const a=()=>fe(R,"$typing$",i),[i,c]=Dr();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),u=Z(r,"class",7,"");const w=Nn(""),v=Nn("");le(()=>{w.set(l())}),le(()=>{v.set(f())});const R=VI(w,v),y=o(()=>ZS(a()));var M={get workspaceId(){return l()},set workspaceId(H){l(H),ee()},get agentId(){return f()},set agentId(H){f(H),ee()},get class(){return u()},set class(H=""){u(H),ee()},$set:un,$on:(H,V)=>gn(r,H,V)},x=Bt(),F=ye(x);{var D=H=>{var V=Yk(),oe=I(V),P=I(oe);XS(P,{get people(){return a()},size:12,decorative:!0}),b(oe);var k=m(oe,2),Q=de(k,!0);In(2),b(V),q(()=>{ke(V,1,`${Af} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${u()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),z(Q,e(y))}),p(H,V)};B(F,H=>{e(y)&&H(D)})}p(n,x);var T=fn(M);return c(),T}const Xk=50,Zk=5e3,ex=500,tx=()=>({authority:()=>Ci(O.state),persistSnapshot:Jb,dispatch:n=>O.dispatch(n),ownerView:n=>Yb.withStore(O)(n)});function nx(n){const r=n.store??tx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),f=null,u=null,w=0,v=!1,R=null,y=null,M=null,x=0,F=null,D=null;const T={};let H,V=_e([]),oe=null,P=0,k="",Q=0,ge="";const Re=()=>{const N=n.workspaceId(),C=n.agentId();if(!N||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||v)return null;const Te=n.inputValue(),L=ue(),Y=H?.shared,J=Y?.workspaceId===N&&Y.agentId===C?Y.lifetime:null,be=JSON.stringify([re,N,C,x,J,L.map(U=>[U.id,U.attachmentId,U.path])]);be!==ge&&(ge=be,Q+=1);const Ne=JSON.stringify([re,N,C,Te,L,x]);return Ne!==k&&(k=Ne,P+=1),{authority:re,ownerId:a,workspaceId:N,agentId:C,text:Te,attachments:JSON.parse(JSON.stringify(L)),generation:P,attachmentEpoch:Q}};let ve=null;const ue=()=>qI(n.contextItems(),LI(n.contextItems(),e(V))),we=N=>{if(H=N,!N||v)return;const C=N.restore;if(D&&C?.requestId===D.requestId&&C.status!=="pending"){const{apply:L}=D;D=null,_(c,!1),C.status==="restored"&&_(V,C.draft?.attachments??[]),L(C)}const re=N.shared;if(re&&!e(c)&&u===`${re.workspaceId}\0${re.agentId}`){const L=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(oe!==L){oe=L;const Y=ve??f,J=Y&&n.inputValue()===Y.text&&JSON.stringify(ue())===Y.attachmentsJson;re.origin===a?ve={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(w+=1,M&&clearTimeout(M),_(V,re.snapshot.attachments),ve=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(bl(e(V))),n.applyEditorContent(re.snapshot.text))}}ct(Re);const Te=[];for(const L of N.saves){if(L.status==="pending")continue;Te.push(L.id);const Y=T[L.id];delete T[L.id],Y?.(L)}Te.length>0&&queueMicrotask(()=>r.dispatch(ew(a,Te)))},ne=(N,C,re)=>{const Te=crypto.randomUUID();D={requestId:Te,apply:re},_(c,!0),r.dispatch(nw(a,Te,N,C))},te=()=>{D&&(D=null,_(c,!1),r.dispatch(aw(a)))},ze=()=>{const N=F;N&&(F=null,r.dispatch(rw(a)),H?.saves.some(C=>C.id===N)||delete T[N])};r.dispatch(Y_(a));const se=r.ownerView(a).subscribe(N=>ct(()=>we(N))),he=()=>{y&&(clearTimeout(y),y=null),_(l,!1)},Me=()=>{F&&(F=null,r.dispatch(tw(a)))};le(()=>{const N=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!N){ct(()=>{w+=1,u=null,te(),R&&clearTimeout(R),R=null,he(),M&&clearTimeout(M),M=null,_(i,!1),Me()});return}if(!C||!re)return;const Te=`${C}\0${re}`;if(u===Te)return;const L=u!==null;u=Te;const Y=++w;ct(()=>{f=null,ve=null,oe=null,_(V,[]),R&&clearTimeout(R),he(),M&&(clearTimeout(M),M=null),L&&(Me(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=Qb(C,re);if(J){_(V,J.attachments),_(i,!1);const Ne=n.contextItems().length>0,U=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),Ne||n.setContextItems(bl(J.attachments)),n.applyEditorContent(J.text),f={text:J.text,attachmentsJson:Ie},ne(C,re,Ce=>{if(Ce.status!=="restored")return;const Le=Ce.draft;if(v||!(n.active?.()??!0)||u!==Te||w!==Y)return;const st=Le?.text??"",Xe=Le?.attachments??[],He=JSON.stringify(Xe);sd(C,re,{text:st,attachments:Xe});const Pe=n.inputValue()===U&&JSON.stringify(ue())===Ie;Ne||!Pe||(st!==U&&(n.setInputValue(st),n.applyEditorContent(st)),He!==Ie&&n.setContextItems(bl(Xe)),f={text:st,attachmentsJson:He})});return}_(i,!0),y=setTimeout(()=>{y=null,(n.active?.()??!0)&&_(l,!0)},ex),R=setTimeout(()=>{(n.active?.()??!0)&&(_(i,!1),he())},Zk);const be=()=>{!(n.active?.()??!0)||u!==Te||w!==Y||(R&&clearTimeout(R),_(i,!1),he())};ne(C,re,Ne=>{if(Ne.status!=="restored"){be();return}const U=Ne.draft;if(v||!(n.active?.()??!0)||u!==Te||w!==Y)return;const Ie=!!n.inputValue();if(!Ie&&U?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(bl(U.attachments)),!Ie&&U?.text&&(n.setInputValue(U.text),M=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===U.text&&n.applyEditorContent(U.text)},Xk)),f===null){const Ce=U?.text??"",Le=U?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(Le)},sd(C,re,{text:Ce,attachments:Le})}be()})})}),le(()=>{const N=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Te=e(i);if(!N){ct(ze);return}if(!C||!re)return;const L=n.inputValue(),Y=ue();if(ct(Re),ct(ze),Te||f===null&&!L&&Y.length===0)return;const J=JSON.stringify(Y);if(f!==null&&f.text===L&&f.attachmentsJson===J)return;JSON.stringify(e(V))!==J&&_(V,Y);const be=`${C}\0${re}`,Ne=x,U=crypto.randomUUID();T[U]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){u===be&&x===Ne&&(f={text:L,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ct(()=>{F=U,r.dispatch(X_(a,U,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:L,attachments:Y,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),le(()=>()=>{v=!0,R&&clearTimeout(R),y&&clearTimeout(y),M&&clearTimeout(M),Me(),se(),r.dispatch(Z_(a))});const Ee=N=>{const C=Re();return C!==null&&C.authority===N.authority&&C.ownerId===N.ownerId&&C.workspaceId===N.workspaceId&&C.agentId===N.agentId&&C.generation===N.generation&&C.text===N.text&&JSON.stringify(C.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Re,isCurrentDraft:Ee,updateAttachmentScreen(N,C,re){return!Ee(N)||!N.attachments.some(Te=>Te.id===C)?null:(_(V,N.attachments.map(Te=>Te.id===C?{...Te,screen:structuredClone(re)}:Te)),Re())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(w+=1,x+=1,te(),R&&(clearTimeout(R),R=null),M&&(clearTimeout(M),M=null),_(i,!1),he(),ze(),u!==null){const[N,C]=u.split("\0");sd(N,C,{text:"",attachments:[]}),ve=null,_(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Mi(n){if(!n)return null;const r=kf(JSON.stringify([n.workspaceId,n.agentId]),If(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function rx(n,r,a){const i=O.state.principal.snapshot,c=()=>Ci(O.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,f=Gd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const u=await f.readiness();return!c()||!u.ok?{ready:!1}:u.value.find(w=>w.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Np(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,f=0,u=null;Es(()=>{l=!1,f++}),le(()=>{const y=n.capture();e(r)&&(!y||y.authority!==e(r).capture.authority||y.ownerId!==e(r).capture.ownerId||y.workspaceId!==e(r).capture.workspaceId||y.agentId!==e(r).capture.agentId||y.attachmentEpoch!==e(r).capture.attachmentEpoch)&&_(r,null)});async function w(y){if(n.disabled()||e(a))return;const M=n.drafts.captureDraft(),x=Mi(M),F=x?.clips.find(V=>V.contextItemId===y);if(!M||!F?.media||!x)return;const D=Xb({workspaceId:M.workspaceId,agentId:M.agentId,clip:F,evidence:x,marks:x.marks}),T=gf(M.workspaceId,F.path);if(!D||!T)return;const H=++f;c=document.activeElement instanceof HTMLElement?document.activeElement:null,_(a,!0),_(i,!1);try{if(await n.beforeOpen?.(),!l||f!==H||!n.drafts.isCurrentDraft(M))return;const V=await(n.prepareOutput??rx)(M,F.media,n.drafts);if(!l||f!==H||!n.drafts.isCurrentDraft(M))return;const{attachmentPath:oe,...P}=D;_(r,{capture:M,contextItemId:y,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===H&&_(i,!0)}finally{l&&f===H&&_(a,!1)}}async function v(y){const M=crypto.randomUUID(),x=e(r),F=n.drafts.captureDraft();if(!x||!F||F.authority!==x.capture.authority||F.ownerId!==x.capture.ownerId||F.workspaceId!==x.capture.workspaceId||F.agentId!==x.capture.agentId||F.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:M,result:"stale-source"};const D=Mi(F),T=D?.clips.find(Q=>Q.contextItemId===x.contextItemId);if(!D||!T?.media)return{requestId:M,result:"stale-source"};const V=u?.openId===x.snapshot.openId&&u.inputRevision===y.revision&&JSON.stringify(u.media)===JSON.stringify(T.media)?{...y,revision:T.media.saved?.revision??0}:y,oe=aS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:F.workspaceId,agentId:F.agentId},sourceId:y.sourceId,sourceRevision:y.sourceRevision,expectedEditRevision:V.revision,edit:V});if(oe.status!=="saved")return{requestId:M,result:oe.status==="invalid-edit"?"failed":oe.status};const P=sS({...D,clips:D.clips.map(Q=>Q.id===T.id?{...Q,media:oe.media}:Q)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(F,x.contextItemId,P);if(!k)return{requestId:M,result:"stale-source"};u={openId:x.snapshot.openId,media:oe.media,inputRevision:y.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:M,result:"stale-source"};await n.drafts.flushDraft(k);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!Q||Q.attachmentEpoch!==x.capture.attachmentEpoch||Q.authority!==k.authority||Q.ownerId!==k.ownerId||Q.workspaceId!==k.workspaceId||Q.agentId!==k.agentId||JSON.stringify(Q.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:M,result:"stale-source"}:(u=null,{requestId:M,result:"saved",saved:oe.media.saved??void 0})}catch{return{requestId:M,result:"failed"}}}function R(y){return n.disabled()||!n.onRemove(y)?!1:(e(r)?.contextItemId===y&&_(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:w,save:v,remove:R,close(){_(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var ax=E('<p role="alert"> </p>'),sx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),ox=E("<!> <!> <!>",1);function ev(n,r){if(new.target)return dn({component:ev,...n});pn(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),c=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Np),u=Z(r,"beforeOpen",7),w=Z(r,"onReviewChange",7);const v=ct(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:P=>l()(P),beforeOpen:()=>u()?.()??Promise.resolve()}));le(()=>{const P=v.opening,k=v.session;ct(()=>w()?.(P,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const R=o(Zb),y=o(()=>Mi(a())),M=o(()=>e(y)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Sp(P.durationMs),recording:!1,url:a()?gf(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:ey(P.media.saved)}:{}}))??[]);let x=_e(null);var F={get capture(){return a()},set capture(P){a(P),ee()},get drafts(){return i()},set drafts(P){i(P),ee()},get disabled(){return c()},set disabled(P=!1){c(P),ee()},get onRemove(){return l()},set onRemove(P){l(P),ee()},get controllerFactory(){return f()},set controllerFactory(P=Np){f(P),ee()},get beforeOpen(){return u()},set beforeOpen(P){u(P),ee()},get onReviewChange(){return w()},set onReviewChange(P){w(P),ee()},$set:un,$on:(P,k)=>gn(r,P,k)},D=ox(),T=ye(D);{let P=o(()=>c()||v.opening);hS(T,{get items(){return e(M)},get labels(){return e(R)},get disabled(){return e(P)},onEdit:k=>void v.open(k),onMarkUp:k=>void v.open(k),get onRemove(){return v.remove}})}var H=m(T,2);{var V=P=>{var k=ax(),Q=de(k,!0);q(ge=>z(Q,ge),[()=>g.dock_captureEditor_saveFailed_label()]),p(P,k)};B(H,P=>{v.problem&&P(V)})}var oe=m(H,2);{let P=o(()=>!!v.session),k=o(()=>g.dock_captureEditor_recording_title({duration:v.session?Sp(v.session.snapshot.durationMs??0):""}));d$(oe,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>v.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),v.restoreFocus()},get contentRef(){return e(x)},set contentRef(Q){_(x,Q,!0)},children:(Q,ge)=>{var Re=Bt(),ve=ye(Re);{var ue=we=>{var ne=Bt(),te=ye(ne);ki(te,()=>v.session.snapshot.openId,ze=>{var se=sx(),he=I(se);g$(he,{get snapshot(){return v.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>v.close(),get onSave(){return v.save},onDelete:async()=>!!v.session&&v.remove(v.session.contextItemId)}),b(se),p(ze,se)}),p(we,ne)};B(ve,we=>{v.session&&we(ue)})}p(Q,Re)},$$slots:{default:!0}})}return p(n,D),fn(F)}const $l=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function ix(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,f=null,u=null;async function w(y){y.abort.abort(),y.slot?.cancel(),await y.native?.dispose()}async function v(){l++;const y=u;u=null,y&&await w(y)}to(()=>{const y=()=>{_(r,document.hasFocus(),!0)};return y(),window.addEventListener("focus",y),window.addEventListener("blur",y),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",y)}});const R=O.getReadableState().subscribe(()=>{u&&!u.current()&&v()});return Es(()=>{c=!0,R(),v()}),le(()=>{const y=n.capture(),M=y?$l(y):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===M);ct(()=>{if(!x||!y){v();return}if(u?.key===M)return;if(f===M){v();return}v();const D=Mi(y)?.clips.flatMap(Re=>!Re.mediaError&&Re.media?[Re.media]:[])??[],T=D[0],H=O.state.principal.snapshot,V=Hl.select(O.state,y.workspaceId);if(!T||!H||!V||n.drafts.gateActive)return;const oe=cf(),P=new AbortController,k=()=>!c&&!P.signal.aborted&&Ci(O.state)===y.authority&&Hl.select(O.state,y.workspaceId)===V&&uf(oe)&&!!n.capture()&&$l(n.capture())===M,Q={key:M,capture:y,abort:P,native:null,slot:null,current:k};u=Q;const ge=l;n.drafts.flushDraft(y).then(async Re=>{if(!(u!==Q||ge!==l||!k())){if(!Re){f=M,await v();return}Q.native=Gd({workspaceId:y.workspaceId,agentId:y.agentId,draftId:crypto.randomUUID(),principalId:H.principal.id,media:structuredClone(D)},k,P.signal),Q.slot=ty(Q.native.service),f=M,Q.slot.warm(M,T,k)}}).catch(()=>{u===Q&&v()})})}),{cancel:v,async beforeEditorOpen(){_(a,!0),f=null,await v()},editorState(y,M){_(a,y,!0);const x=M?$l(M.capture):null;M&&e(i)?.openId!==M.openId&&(f=null),_(i,M&&x?{openId:M.openId,key:x}:null)},take(y,M){const x=u;if(!x?.native||!x.slot||x.key!==$l(y)||!x.current())return v(),null;u=null,l++;const F=x.native,D=x.slot,T=()=>x.abort.abort();return M.addEventListener("abort",T,{once:!0}),M.aborted&&T(),{service:{...F.service,takePreparedRecording:H=>D.take(x.key,H,()=>!M.aborted&&x.current())},async dispose(){M.removeEventListener("abort",T),await w(x)}}}}}var lx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function tv(n,r){if(new.target)return dn({component:tv,...n});pn(r,!1);var a={$set:un,$on:(f,u)=>gn(r,f,u)};Mf();var i=lx(),c=I(i),l=de(c,!0);return b(i),q(f=>z(l,f),[()=>g.chat_draftGate_loading_label()]),p(n,i),fn(a)}var cx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Td(n,r){if(new.target)return dn({component:Td,...n});pn(r,!1);var a={$set:un,$on:(f,u)=>gn(r,f,u)};Mf();var i=cx(),c=m(I(i),2),l=de(c,!0);return In(2),b(i),q((f,u)=>{Ue(i,"aria-label",f),z(l,u)},[()=>g.chat_newMessagesDivider_label(),()=>g.chat_newMessagesDivider_label()]),p(n,i),fn(a)}function dx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function ux(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function gx(n,r){return r&&n.includes(r)?r:null}function Bp(n,r,a){return r-n<=a}const px=.2;function Wp(n,r,a){const i=Math.max(0,a-r),c=n-px*r;return Math.min(Math.max(0,c),i)}function fx(n,r,a){return n!==null&&a&&n===r}function vx(n){return n?sw(n)&&ow(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function hx(n){const r=[],a=new Set;let i,c;for(const H of n.messages){if(H.agentId&&H.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(H.id))continue;a.add(H.id),n.breakBeforeMessageIds?.has(H.id)&&(i=void 0,c=void 0);const V=mS(H);if(V?.kind!=="turn-failure")c=void 0;else{const oe=i?.seq!==void 0&&H.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(H.seq)&&H.seq===i.seq+1;(!c||!oe)&&(c={key:JSON.stringify([n.agentId,"notice",H.id]),anchorMessageId:H.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:H.id,reason:V.reason,timestamp:H.timestamp}),c.recordedFailureCount+=1}i=H}const l=new Map;for(const H of n.queue){if(!H.requeuedAfterFailure)continue;const V=H.turnId||void 0,oe=JSON.stringify([n.agentId,V?"turn":"queue",V??H.id]);let P=l.get(oe);P||(P={key:oe,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(oe,P)),P.queueIds.includes(H.id)||P.queueIds.push(H.id)}const f=[...l.values()],u=n.session?.id===n.agentId?n.session:void 0,w=u?.status===Si.Error,v=n.transientError||w&&u.stopReason||null,R=w&&!v,y=w&&(!n.transientError||n.transientError===u.stopReason)?u.stopReasonTimestamp:void 0,M=y?pp(y):null,x=M&&v&&v===u?.stopReason?r.flatMap(H=>H.records).filter(H=>H.reason===v&&pp(H.timestamp)===M):[],F=x.length===1?x[0].messageId:void 0,T=(u?hf(u):!1)?"attempting":f.length?"queued":v||R?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:v,needsFallbackReason:R,timestamp:y,noticeId:F}}}function mx(n,r){const a=n.hiddenTail[0]?.id,i=hx({...r,messages:[...n.groups.flatMap(u=>u.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(u=>({...u,records:u.records.filter(w=>w.messageId!==c)})).filter(u=>u.records.length>0),f=new Set(l.map(u=>u.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(u=>[u.records[0].messageId,u])),collapsedMessageIds:new Set(i.history.flatMap(u=>u.records.map(w=>w.messageId).filter(w=>!f.has(w))))}}var _x=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),wx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),bx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),yx=E('<div class="mb-5"><!></div>'),Ix=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Sx=E("<!> <!>",1),$x=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),kx=E("<!> <span> </span>",1),xx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function nv(n,r){if(new.target)return dn({component:nv,...n});pn(r,!0);const a=()=>fe(x,"$userOverrides$",f),i=()=>fe(M,"$specialists$",f),c=()=>fe(H,"$isGitHubAuth$",f),l=()=>fe(V,"$recentSpecialistIds$",f),[f,u]=Dr();let w=Z(r,"onSpecialistChange",7),v=Z(r,"session",7),R=Z(r,"workspaceId",7);const y=Nn(R()??"");le(()=>y.set(R()??""));const M=Ff(y),x=q$();le(()=>{a()});const F=o(()=>{if(!v()||qy(v()))return null;const N=v().metadata?.specialist||v().agentMetadata?.specialist;return N&&i().find(C=>C.id===N)||null});async function D(N){N?await Bl({specialist:N,hash:"specialists"}):await Bl({view:"create-specialist"})}let T=_e(!1);const H=L$(),V=GI(),oe=o(()=>iw(H$(i(),c()),l()));let P=_e(!1);const k=o(()=>g.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(F)?.name??g.chat_shared_general_fallback()),ge=o(()=>e(F)?.description??g.chat_shared_noSpecializedBehavior_label()),Re=o(()=>e(F)?e(F).defaultBehaviorPrompt||"":e(k));var ve={get onSpecialistChange(){return w()},set onSpecialistChange(N){w(N),ee()},get session(){return v()},set session(N){v(N),ee()},get workspaceId(){return R()},set workspaceId(N){R(N),ee()},$set:un,$on:(N,C)=>gn(r,N,C)},ue=xx(),we=I(ue);{var ne=N=>{var C=yx(),re=I(C);K$(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(Y){_(P,Y,!0)},trigger:(Y,J)=>{let be=()=>(J?.()).props;{let Ne=o(()=>Fd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));xt(Y,Ei(be,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Ne)},"data-testid":"specialist-picker-trigger",children:(U,Ie)=>{var Ce=_x(),Le=ye(Ce),st=I(Le);{let Se=o(()=>e(F)?.id??null),Ae=o(()=>e(F)?.icon??null);G$(st,{agentId:"blank",variant:"emphasized",get specialist(){return e(Se)},get icon(){return e(Ae)}})}b(Le);var Xe=m(Le,2),He=I(Xe),Pe=de(He,!0),j=m(He,2),ae=de(j,!0);b(Xe);var qe=m(Xe,2),G=I(qe);pt(G,{get icon(){return Na},size:10}),b(qe),q(()=>{z(Pe,e(Q)),z(ae,e(ge))}),p(U,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=bx(),be=I(J),Ne=I(be),U=de(Ne,!0),Ie=m(Ne,2),Ce=de(Ie,!0);b(be);var Le=m(be,2),st=I(Le);{let Pe=o(()=>e(F)?.id??null);D_(st,{get specialists(){return e(oe)},get value(){return e(Pe)},onchange:j=>{_(P,!1),w()?.(j)}})}b(Le);var Xe=m(Le,2),He=I(Xe);Rt(He,()=>Or,(Pe,j)=>{j(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{_(P,!1),D()},children:(ae,qe)=>{var G=wx(),Se=ye(G),Ae=I(Se);pt(Ae,{get icon(){return m$},size:12}),b(Se);var je=m(Se,2),Be=de(je,!0);q(We=>z(Be,We),[()=>g.chat_regularAgentWelcome_createSpecialist_label()]),p(ae,G)},$$slots:{default:!0}})}),b(Xe),b(J),q((Pe,j)=>{z(U,Pe),z(Ce,j)},[()=>g.workspace_createAgentSection_specialists_label(),()=>g.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(C),p(N,C)};B(we,N=>{w()&&N(ne)})}var te=m(we,2);{var ze=N=>{var C=Bt(),re=ye(C);{let Te=o(()=>g.chat_specialistSelector_prompt_label());Rt(re,()=>J$,(L,Y)=>{Y(L,{class:"mb-3",role:"region",get"aria-label"(){return e(Te)},children:(J,be)=>{var Ne=Sx(),U=ye(Ne);Rt(U,()=>Jf,(Ce,Le)=>{Le(Ce,{children:(st,Xe)=>{var He=Bt(),Pe=ye(He);Rt(Pe,()=>Yf,(j,ae)=>{ae(j,{class:"type-caption font-medium",children:(qe,G)=>{In();var Se=_n();q(Ae=>z(Se,Ae),[()=>g.chat_specialistSelector_prompt_label()]),p(qe,Se)},$$slots:{default:!0}})}),p(st,He)},$$slots:{default:!0}})});var Ie=m(U,2);Rt(Ie,()=>Q$,(Ce,Le)=>{Le(Ce,{children:(st,Xe)=>{var He=Ix(),Pe=ye(He),j=de(Pe,!0),ae=m(Pe,2);xt(ae,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>_(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(qe,G)=>{In();var Se=_n();q(Ae=>z(Se,Ae),[()=>e(T)?g.chat_regularAgentWelcome_showLess_label():g.chat_regularAgentWelcome_showMore_label()]),p(qe,Se)},$$slots:{default:!0}}),q(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),z(j,e(Re))}),p(st,He)},$$slots:{default:!0}})}),p(J,Ne)},$$slots:{default:!0}})})}p(N,C)},se=N=>{var C=$x(),re=de(C,!0);q(()=>z(re,e(Re))),p(N,C)};B(te,N=>{e(F)?N(ze):N(se,-1)})}var he=m(te,2);{var Me=N=>{xt(N,{variant:"ghost-light",size:"sm",onclick:()=>D(e(F).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Te=kx(),L=ye(Te);pt(L,{get icon(){return h$},size:12,class:"opacity-60"});var Y=m(L,2),J=de(Y,!0);q(be=>z(J,be),[()=>g.chat_regularAgentWelcome_customize_label()]),p(C,Te)},$$slots:{default:!0}})};B(he,N=>{e(F)&&N(Me)})}b(ue),p(n,ue);var Ee=fn(ve);return u(),Ee}var Cx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Px=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Rx=E('<span class="type-caption"> </span>'),Tx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Ax=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Kd(n,r){if(new.target)return dn({component:Kd,...n});pn(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),c=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),u=Z(r,"reserveShortcutHintSpace",7,!1),w=Z(r,"workspaceId",7);const R=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",y=GS.replace("text-ui","type-caption");function M(k){i()(k)}function x(k,Q){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),M(Q))}function F(k,Q){k.preventDefault(),k.stopPropagation(),Pd(Q,{workspaceId:w(),event:k})}function D(k,Q){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Pd(Q,{workspaceId:w(),event:k}))}function T(k){return k<3}var H={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return c()},set onEdit(k){c(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return u()},set reserveShortcutHintSpace(k=!1){u(k),ee()},get workspaceId(){return w()},set workspaceId(k){w(k),ee()},$set:un,$on:(k,Q)=>gn(r,k,Q)},V=Bt(),oe=ye(V);{var P=k=>{var Q=Ax(),ge=I(Q);{const Re=(ue,we)=>{let ne=()=>(we?.()).item,te=()=>(we?.()).index;const ze=o(()=>Bb(ne())),se=o(()=>e(ze)[0]?.type==="text"?e(ze)[0].content:"");var he=Tx(),Me=I(he),Ee=I(Me);pt(Ee,{get icon(){return Ef},size:16,get class(){return lr}}),b(Me);var N=m(Me,2),C=I(N),re=de(C,!0),Te=m(C);Hn(Te,17,()=>e(ze).slice(e(se)?1:0),H_,(U,Ie)=>{var Ce=Bt(),Le=ye(Ce);{var st=He=>{const Pe=o(()=>Nb(e(Ie).url));var j=Cx(),ae=de(j,!0);q(()=>{Ue(j,"href",e(Pe)),Ue(j,"title",e(Pe)),z(ae,e(Ie).label)}),ps("click",j,qe=>F(qe,e(Pe))),ps("keydown",j,qe=>D(qe,e(Pe))),p(He,j)},Xe=He=>{var Pe=_n();q(()=>z(Pe,e(Ie).content)),p(He,Pe)};B(Le,He=>{e(Ie).type==="link"?He(st):He(Xe,-1)})}p(U,Ce)}),b(N);var L=m(N,2);{var Y=U=>{var Ie=Px();let Ce;var Le=de(Ie);q(()=>{Ce=ke(Ie,1,`${y??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),Ue(Ie,"aria-hidden",f()?void 0:"true"),Ue(Ie,"data-hint-visible",f()),z(Le,`${R}${te()+1}`)}),p(U,Ie)},J=o(()=>T(te())&&(f()||u()));B(L,U=>{e(J)&&U(Y)})}var be=m(L,2);{var Ne=U=>{v$(U,{side:"top",delayDuration:300,trigger:Le=>{{let st=o(()=>g.chat_suggestedPrompts_editInInput_ariaLabel());xt(Le,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(ne())},get"aria-label"(){return e(st)},children:(Xe,He)=>{pt(Xe,{get icon(){return _$},size:"xs"})},$$slots:{default:!0}})}},content:Le=>{var st=Rx(),Xe=de(st,!0);q(He=>z(Xe,He),[()=>g.chat_suggestedPrompts_edit_tooltip()]),p(Le,st)},$$slots:{trigger:!0,content:!0}})};B(be,U=>{c()&&U(Ne)})}b(he),q(U=>{ke(he,1,`${Af} ${VS} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Me,1,`${Fl??""} mt-px self-start`),Ue(C,"aria-label",U),z(re,e(se))},[()=>Db(ne())]),ps("click",C,U=>{U.stopPropagation(),M(ne())}),ps("keydown",C,U=>x(U,ne())),p(ue,he)};let ve=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");u$(ge,{get items(){return a()},virtualize:!1,onActivate:M,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(ve)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Re,$$slots:{row:!0}})}b(Q),Dt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Dt(2,Q,()=>Zs,()=>({tier:"fast"})),p(k,Q)};B(oe,k=>{a().length>0&&k(P)})}return p(n,V),fn(H)}Od(["click","keydown"]);var Mx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function rv(n,r){if(new.target)return dn({component:rv,...n});pn(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const c=o(()=>[{label:g.chat_chiefEmptyState_assignedPrs_label(),prompt:g.chat_chiefEmptyState_assignedPrs_prompt()},{label:g.chat_chiefEmptyState_staleWorkspaces_label(),prompt:g.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:g.chat_chiefEmptyState_agentPerformance_label(),prompt:g.chat_chiefEmptyState_agentPerformance_prompt()},{label:g.chat_chiefEmptyState_morningBrief_label(),prompt:g.chat_chiefEmptyState_morningBrief_prompt()},{label:g.chat_chiefEmptyState_randomTheme_label(),prompt:g.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(M=>M.label));function f(M){const x=e(c).find(F=>F.label===M);x&&a()(x.prompt)}var u={get onSelect(){return a()},set onSelect(M){a(M),ee()},get compact(){return i()},set compact(M=!1){i(M),ee()},$set:un,$on:(M,x)=>gn(r,M,x)},w=Mx(),v=I(w),R=de(v,!0),y=m(v,2);return Kd(y,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),b(w),q(M=>z(R,M),[()=>g.chat_chiefEmptyState_intro_label()]),p(n,w),fn(u)}const Qd=2e3,Ex=4e3,qx=Ex-Qd-2;function Lx(n,r=Qd){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(w=>w.type==="text").map(w=>w.text||w.content||"").join(""),u=(l.role==="assistant"?N_(f).cleanedContent:f).trim();u&&(a.unshift({role:l.role,text:u}),i+=u.length)}return a}function Hx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
1
|
+
var M_=Object.defineProperty;var Ag=n=>{throw TypeError(n)};var E_=(n,r,a)=>r in n?M_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Qs=(n,r,a)=>E_(n,typeof r!="symbol"?r+"":r,a),q_=(n,r,a)=>r.has(n)||Ag("Cannot "+a);var Co=(n,r,a)=>(q_(n,r,"read from private field"),a?a.call(n):r.get(n)),Mg=(n,r,a)=>r.has(n)?Ag("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as dn,bo as Z,bw as un,bp as nf,b as gn,bm as g,bq as Dr,bs as fe,br as Ei}from"./ClpAEjbe.js";import{bs as pn,a5 as I,bf as fs,bA as b,W as p,bn as fn,aA as ee,aB as E,ca as le,a7 as Bt,ay as ye,aD as e,cd as Nn,c9 as o,bS as m,bl as de,be as In,b_ as q,bO as z,c5 as ct,bH as _,bV as _e,bj as Es,bk as to,b$ as _n,ai as Od,aj as ps,bo as Wl,br as Rr,c0 as Lt,cb as nd,aw as _i,a as L_}from"./CJxGDkBm.js";import{i as B}from"./wmcYjLAa.js";import{k as ki}from"./Xh71Wbuh.js";import{g as Hn,i as H_,I as Mo,p as Eo,e as To}from"./BwASeArv.js";import{n as Dt,l as ma,c as Zs,j as Eg,k as Ho,h as O_}from"./oXpJ1LFx.js";import{b as rf,e as Fd,f as ke,s as Ue,c as Ut,g as gs}from"./CnGVh7I3.js";import{b as F_}from"./DfTSMq0b.js";import{b as hr}from"./NtFyWdpR.js";import{m as D_,U as N_,Z as B_,X as W_,Y as U_,I as qg,o as z_,l as j_,a2 as V_,x as Lg,$ as G_,a0 as Hg,r as K_,s as Q_}from"./CFPreIC6.js";import{Jq as O,fo as J_,eW as Y_,f3 as X_,eX as Z_,f1 as ew,f0 as tw,eZ as nw,e$ as rw,eY as aw,rs as sw,c6 as ow,i as Si,I$ as iw,D8 as af,Dd as lw,Df as Og,Dc as cw,De as dw,vB as uw,vD as gw,Cl as sf,cp as pw,cn as fw,Bu as vw,bE as hw,A0 as mw,Ca as rd,uZ as _w,cq as Fg,dB as ww,dC as bw,Ck as yw,el as Iw,CE as Sw,CD as $w,CI as kw,CH as xw,cQ as Cw,cT as Pw,nA as Rw,er as Tw,wO as Aw,CJ as Mw,wQ as Ew,CK as qw,cU as Lw,cV as Hw,nI as Ow,Ad as Fw,Dp as Dw,wj as Nw,wk as Bw,yY as Ww,z0 as ad,wf as Uw,wg as zw,rQ as jw,rd as Vw,rb as Gw,f_ as Kw,HK as Qw,Le as Jw,GI as Yw,gn as Xw,p0 as Zw,Je as eb,oh as tb,z$ as nb,ft as Dg,r0 as Ng,fm as rb,fl as ab,tz as sb,g3 as Bg,rc as ob,fe as ib,C5 as lb,m as cb,nJ as db,zE as ub,yW as gb,Ev as pb,Ek as Wg,xe as fb,xf as Ug,uY as zg,p1 as vb,DB as hb,gj as mb,g1 as _b,eU as wb,cM as bb,A3 as yb,Lj as Ib,Cq as Sb,LB as $b,x$ as kb,ga as xb,fd as Cb,cL as Pb,cI as Rb,cH as Tb,vp as Ab,xl as Mb,xj as Eb,cF as qb,cE as Lb,z2 as Hb,yZ as Ob,xk as Fb}from"./CpP1PKzF.js";import{a as Dd}from"./CC7to1B5.js";import{aB as Db,aA as Nb,b1 as Bb,_ as Wb,as as Ub,aD as zb,z as of,R as lf,aV as jb,aP as Vb,ai as jg,J as _l,aN as Vg,aM as Gg,aL as Kg}from"./CvNJnDlW.js";import{k as cf,F as Gb,G as df,ao as Kb,aX as Tl,a5 as uf,Q as Qb,aQ as sd,al as Jb,aD as Yb,B as Xb,y as gf,r as Zb,z as ey,u as ty,aV as ny,aB as pf,aA as ff,aC as ry,aG as od,aN as Qg,aM as wl,aO as Jg,P as Yg,d as ay,e as sy,as as oy,V as Xg,az as iy,c as ly,l as cy,aP as Zg,ak as dy,ar as ep,a as uy,av as gy,a9 as tp,ay as py,aR as np,aU as rp,m as ap,aa as fy,R as vy,at as sp,ah as hy,O as my,an as _y,h as wy,p as by,ax as op,a4 as yy,f as Iy,i as Sy,a2 as $y,a8 as ky}from"./wUr2Clcr.js";import{d as xy,l as Cy,x as Py,v as Ry,k as Ty,Z as ip,a5 as Ay,D as My,c as Ey}from"./BxKppgO5.js";import{g as Ci}from"./DypB-Dwi.js";import{dT as Hl,cR as vf,O as hf,W as qy,bs as Ly,aE as mf,dE as _f,aT as Ao,e4 as Hy,dt as wf,av as Nd,dS as Bd,aM as bf,cM as Oy,V as ha,a3 as Ys,B as Fy,a7 as Dy,a4 as Ny,M as By,a6 as Wy,ar as Uy,aF as yf,aN as Al,r as zy,n as $d,H as jy,dV as Vy,aP as Gy,aJ as Ky,c6 as Qy,aV as Jy,bJ as Yy,bH as Xy,bI as Zy,c5 as eI,c4 as tI,cK as nI,cJ as rI,aR as aI,b9 as sI,bb as oI,be as iI,ba as lI,bj as cI,bd as dI,bc as uI,bf as gI,bg as pI,bi as fI,bh as vI,aw as hI,ax as mI,cg as _I,ch as wI,ds as bI,dr as yI,a_ as II,G as SI,b2 as $I,cc as kI,C as lp,cZ as xI,b8 as ds,bY as CI,X as PI,E as RI,ad as TI,t as AI,cT as MI,d0 as cp,Q as dp,dq as EI,cN as id}from"./D9Ykl3eH.js";import{u as If,a as bl,ag as qI,x as LI,ad as Sf,af as HI,ac as $f,a4 as OI,F as up,D as FI,e as DI,n as NI,s as BI,m as WI,Y as UI,k as zI}from"./DRbwhDjx.js";import{a4 as jI,b5 as VI,cM as GI,a_ as KI,b4 as QI,c2 as JI,c9 as YI,w as XI,x as ZI,cd as eS}from"./DJPMh7Pg.js";import{n as tS,P as kf,F as nS,ai as rS,r as aS,ac as sS}from"./CgBcONKs.js";import{I as oS,s as iS,H as gp}from"./Bqd7fdCF.js";import{e as lS}from"./CL3a4Hm1.js";import{e as cS,f as dS}from"./BqoCUMk3.js";import{s as uS,o as Xs,b as gS,g as Ol,d as pS,l as wi}from"./CIyUrgF0.js";import{a4 as fS,a6 as vS,D as hS,M as mS,ab as pp,W as _S,i as wS,r as ir,v as Pi,u as Xr,p as $i,x as mr,S as Wd,m as Ul,s as qo,y as Ri,o as no,n as ro,t as fp,a9 as ao,w as so,a8 as Ud,q as _a,z as Lo,I as kd,Z as vp,g as bS,F as yS,U as xf,H as Cf,a7 as Pf,a5 as Ml,N as IS,E as Rf,R as SS,A as $S,b as kS,aa as xS,ac as yl,e as ld,l as CS,C as PS,f as Js,j as hp,G as us,Q as RS,d as cd,c as TS,a as mp,h as AS,K as MS,X as _p,a3 as dd,a0 as wp,$ as ES,a2 as bp,_ as yp,T as qS,B as LS,k as HS,a1 as OS,J as FS,P as DS,O as NS,V as BS}from"./BRbooHVW.js";import{m as WS}from"./PVXvIyE8.js";import{g as Tf}from"./0LjODXcP.js";import{b as US}from"./C5TH9nNS.js";import{g as zS}from"./BriVXGmT.js";import{a as jS}from"./CvXttgUy.js";import{q as Af,d as lr,r as VS,e as Fl,j as GS,g as xd,i as KS,f as Cd,c as QS,A as JS,O as Ip,k as YS}from"./Demr6Qvy.js";import{P as XS}from"./Dp3fRAus.js";import{e as ZS}from"./DemmMiIF.js";import{b as e$,a as t$,g as n$,c as r$,i as a$}from"./CNcD7ed8.js";import{R as s$,g as o$,W as Il,c as i$}from"./D1S-BeW0.js";import"./Gb7Ohwuc.js";import"./BYiyLeZ4.js";import{s as Ti}from"./WSVFXKpL.js";import{F as l$,h as c$}from"./CPDV_dyu.js";import"./Qt_rZNko.js";import{C as d$,e as Or,L as u$,l as zl,d as jl,K as Vl,h as zd,M as Gl,S as Da}from"./B06RKBOm.js";import{D as g$}from"./CHXqkR4Y.js";import{f as Sp}from"./D35mkEt2.js";import"./BoIfXiRv.js";import{i as Mf}from"./D-g0wh54.js";import{h as $p,i as kp,g as xp,P as Cp,C as p$,m as El,R as f$}from"./C1zxTHwk.js";import{f as xt,ae as v$}from"./BVi5KkOP.js";import{F as pt,bs as h$,cd as m$,aw as Na,a2 as Ef,c9 as _$,bf as w$,be as b$,bg as y$,aO as Pp,aj as ud,aB as gd,bB as qf,d3 as Dl,cF as I$,aM as Rp,cb as Tp,cK as Nl,bu as S$,aS as $$,d0 as k$,a8 as Lf,ac as x$,ag as C$,cr as P$,ba as R$,aC as Hf,cT as Ap,cz as T$,ax as A$,cD as M$,c3 as E$}from"./CtJxHvGv.js";import{c as Of}from"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{c as Rt}from"./DSqSJXGX.js";import{a5 as Ff,bg as q$,ar as L$,k as H$,Y as O$,W as F$,a2 as D$,Z as N$,bw as B$,V as W$,a1 as U$,ah as z$}from"./DiFC8Mk6.js";import{d as Bl,f as j$,e as V$}from"./DXoCvZQl.js";import{A as G$}from"./BCrI1nnw.js";import{D as K$}from"./DnYPeWf9.js";import"./B5wwCKYG.js";import{a as Q$,C as J$}from"./BTW5Qz3T.js";import"./V7b2Jgc1.js";import{C as Y$}from"./C7RGdxsV.js";import{h as Pd,r as X$,a as Z$}from"./D6QsCyM5.js";import{s as ek}from"./CRpGhS3h.js";import{I as tk,a as nk}from"./MZe3NxQe.js";import{L as rk}from"./CIMWDf4a.js";import{g as ak,f as sk,b as ok}from"./b89lNINv.js";import{s as Ai,g as Kn,i as ik,j as lk,e as Mp,r as Ep,f as ck,d as dk,a as pd,h as uk}from"./ClsrgcJW.js";import{i as qp,a as gk}from"./Bu13V5mO.js";import{seekConversationToMessage as Lp}from"./Be-tvUeZ.js";import{l as Yt,o as fd,h as jd,n as Rd,q as pk}from"./By588DV1.js";import{o as fk}from"./DaO8nz6N.js";import{A as Df}from"./BQgCURYe.js";import{b as Nf}from"./Dd5ei__B.js";import{g as vk,e as Bf,v as hk,f as mk,N as _k,M as wk,K as bk,k as Wf,l as yk,H as Uf,s as zf}from"./Qqd9dQHZ.js";import{selectCurrentWorkspaceTabId as vd}from"./DujUyPvo.js";import{o as Ik}from"./DHk9xTTU.js";import{d as Sk}from"./B0Z-1lwJ.js";import{P as $k}from"./BHjJ9bUD.js";import{g as kk}from"./C1elIQnx.js";import{H as jf,M as xk,y as Ck,g as Pk,i as Rk,u as Tk,e as Vf,c as Gf,d as Ak}from"./Ct82vzld.js";import{c as Mk,h as Vd,f as Kf,M as Ek}from"./B6-GEB4b.js";import{t as qk}from"./DAsc1V4f.js";import{s as Lk}from"./BsieX9dN.js";import{i as Qf}from"./D95Y9O1z.js";import{d as Hk,i as Ok,r as Fk}from"./CTV49dzf.js";import{g as Dk}from"./CsFPvReh.js";var Nk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Bk=E("<div><!></div>");function Jf(n,r){if(new.target)return dn({component:Jf,...n});pn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=nf(r,Nk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return c()},set children(v){c(v),ee()},$set:un,$on:(v,R)=>gn(r,v,R)},u=Bk();rf(u,v=>({"data-slot":"card-header",class:v,...l}),[()=>Fd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",Y$,i())]);var w=I(u);return Ti(w,()=>c()??fs),b(u),hr(u,v=>a(v),()=>a()),p(n,u),fn(f)}var Wk=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),Uk=E("<div><!></div>");function Yf(n,r){if(new.target)return dn({component:Yf,...n});pn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=nf(r,Wk);var f={get ref(){return a()},set ref(v=null){a(v),ee()},get class(){return i()},set class(v){i(v),ee()},get children(){return c()},set children(v){c(v),ee()},$set:un,$on:(v,R)=>gn(r,v,R)},u=Uk();rf(u,v=>({"data-slot":"card-title",class:v,...l}),[()=>Fd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var w=I(u);return Ti(w,()=>c()??fs),b(u),hr(u,v=>a(v),()=>a()),p(n,u),fn(f)}const Sl=oS.CHAT_MEDIA,hd=uS().min(1).max(512);Xs({workspaceId:hd,agentId:hd,draftId:Ol(),principalId:hd,media:gS(tS).min(1).max(20)}).strict();const zk=Xs({sessionId:Ol()}).strict();zk.extend({control:pS("action",[Xs({action:wi("readiness")}).strict(),Xs({action:wi("export"),request:cS}).strict(),Xs({action:wi("transcribe"),request:dS}).strict(),Xs({action:wi("release"),jobId:Ol()}).strict(),Xs({action:wi("adopt"),jobId:Ol()}).strict()])}).strict();function Gd(n,r,a,i=async(c,l)=>typeof window>"u"||iS(window)!=="electron"?{ok:!1,error:"unavailable"}:lS().invoke(c,l)){let c=null,l=null,f=!1;async function u(){f=!0,a.removeEventListener("abort",w);const x=c;c=null,x&&await i(Sl.CLOSE,{sessionId:x}).catch(()=>{})}const w=()=>{u()};a.addEventListener("abort",w,{once:!0});const v=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function R(){if(v(),c)return c;if(l)return l;l=(async()=>{const x=await i(Sl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");c=x.value.sessionId;try{return v(),c}catch(F){throw await u(),F}})();try{return await l}finally{l=null}}async function y(x){const F=await R();v();const D=await i(Sl.CONTROL,{sessionId:F,control:x});return v(),D}return{service:{exportMedia:x=>y({action:"export",request:x}),adoptMediaJob:x=>y({action:"adopt",jobId:x}),transcribeMedia:x=>y({action:"transcribe",request:x}),releaseMediaJob:async x=>c?await i(Sl.CONTROL,{sessionId:c,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:u,readiness:()=>y({action:"readiness"})}}const md=new Set;async function jk(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:u}=i,w=Ci(O.state),v=Hl.select(O.state,f),R=vf.select(O.state),y=cf(),M=JSON.stringify([w,f,u]);if(!w||!v||!R||l.wsId!==f||md.has(M))return!1;md.add(M);const x=new AbortController,F=()=>x.abort();a.addEventListener("abort",F,{once:!0});const D=()=>!a.aborted&&!x.signal.aborted&&Ci(O.state)===w&&Hl.select(O.state,f)===v&&uf(y)&&r.isCurrentDraft(i),T=O.getReadableState().subscribe(()=>{D()||x.abort()});let H=null;try{if(!D()||jI(c))return!1;const V=If(i.attachments),oe=kf(nS(f,u),V,c.map(ue=>({contextItemId:ue.id,attachmentId:ue.attachmentId,path:ue.path}))),P=new Set([...oe.images,...oe.clips].map(ue=>ue.contextItemId));if(V.some(([ue])=>!P.has(ue))||oe.images.some(ue=>ue.mediaError)||oe.clips.some(ue=>ue.mediaError)||!rS(l.text,oe))throw new Error("invalid-evidence");if(H=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!D())return!1;const k=await xy.agents.get(u,f);if(!D())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const Q=oe.clips.flatMap(ue=>ue.media?[ue.media]:[]);Q.length&&!H&&(H=Gd({workspaceId:f,agentId:u,draftId:crypto.randomUUID(),principalId:R.principal.id,media:Q},D,x.signal));const ge=Gb(c,oe),Re=df(ge),ve=await Kb({workspaceId:f,agentId:u,evidence:oe,clickedItems:c,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Re.imageBlocks,fileBlocks:Re.fileBlocks},binding:y,service:H?.service??null,current:D,onRecord:()=>{}});return!ve||!D()?!1:Tl(O,u,ve)}catch{return D()&&O.dispatch(J_(u,g.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",F),await H?.dispose(),md.delete(M)}}const Xf=1e4,Hp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Op(n){return fS(n.messageMetadata)}function Vk(n,r){if(n.some(Op)){const a=n[0];return a&&!Op(a)&&Fp(a,r)?[a.id]:[]}return n.filter(a=>Fp(a,r)).map(a=>a.id)}function Gk(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Fp(n,r){return!n.requeuedAfterFailure&&vS(n,r)}function Kk(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,f=r.blocked||r.interrupted,u=r.timeoutMs??Xf;let w=n.prediction;if(w){const x=new Set(i.map(H=>H.id)),F=w.ids.filter(H=>x.has(H)&&!c.has(H)),D=l-w.startedAt>=u,T=n.wasBusy&&!a;!F.length||D||f&&!a||T?w=null:F.length!==w.ids.length&&(w={...w,ids:F})}const v=n.wasBusy&&!a,R=n.wasBusy?n.busySince:a?l:null,y=n.wasBusy&&n.preempted||R!==null&&r.directSendAt!==null&&r.directSendAt>R;if(!w&&v&&!f&&!y){const x=Vk(i,l).filter(F=>!c.has(F));x.length&&(w={ids:x,startedAt:l})}const M={wasBusy:a,busySince:a?R:null,preempted:a&&y,prediction:w};return n.wasBusy===M.wasBusy&&n.busySince===M.busySince&&n.preempted===M.preempted&&n.prediction===M.prediction?n:M}class Qk{constructor(){Qs(this,"previousWorkspaceId",null);Qs(this,"_isRebinding",!1);Qs(this,"_generation",0);Qs(this,"_rebindPromise",null);Qs(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{c=setTimeout(()=>f(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function Jk(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Dp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var Yk=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function Zf(n,r){if(new.target)return dn({component:Zf,...n});pn(r,!0);const a=()=>fe(R,"$typing$",i),[i,c]=Dr();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),u=Z(r,"class",7,"");const w=Nn(""),v=Nn("");le(()=>{w.set(l())}),le(()=>{v.set(f())});const R=VI(w,v),y=o(()=>ZS(a()));var M={get workspaceId(){return l()},set workspaceId(H){l(H),ee()},get agentId(){return f()},set agentId(H){f(H),ee()},get class(){return u()},set class(H=""){u(H),ee()},$set:un,$on:(H,V)=>gn(r,H,V)},x=Bt(),F=ye(x);{var D=H=>{var V=Yk(),oe=I(V),P=I(oe);XS(P,{get people(){return a()},size:12,decorative:!0}),b(oe);var k=m(oe,2),Q=de(k,!0);In(2),b(V),q(()=>{ke(V,1,`${Af} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${u()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),z(Q,e(y))}),p(H,V)};B(F,H=>{e(y)&&H(D)})}p(n,x);var T=fn(M);return c(),T}const Xk=50,Zk=5e3,ex=500,tx=()=>({authority:()=>Ci(O.state),persistSnapshot:Jb,dispatch:n=>O.dispatch(n),ownerView:n=>Yb.withStore(O)(n)});function nx(n){const r=n.store??tx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),f=null,u=null,w=0,v=!1,R=null,y=null,M=null,x=0,F=null,D=null;const T={};let H,V=_e([]),oe=null,P=0,k="",Q=0,ge="";const Re=()=>{const N=n.workspaceId(),C=n.agentId();if(!N||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||v)return null;const Te=n.inputValue(),L=ue(),Y=H?.shared,J=Y?.workspaceId===N&&Y.agentId===C?Y.lifetime:null,be=JSON.stringify([re,N,C,x,J,L.map(U=>[U.id,U.attachmentId,U.path])]);be!==ge&&(ge=be,Q+=1);const Ne=JSON.stringify([re,N,C,Te,L,x]);return Ne!==k&&(k=Ne,P+=1),{authority:re,ownerId:a,workspaceId:N,agentId:C,text:Te,attachments:JSON.parse(JSON.stringify(L)),generation:P,attachmentEpoch:Q}};let ve=null;const ue=()=>qI(n.contextItems(),LI(n.contextItems(),e(V))),we=N=>{if(H=N,!N||v)return;const C=N.restore;if(D&&C?.requestId===D.requestId&&C.status!=="pending"){const{apply:L}=D;D=null,_(c,!1),C.status==="restored"&&_(V,C.draft?.attachments??[]),L(C)}const re=N.shared;if(re&&!e(c)&&u===`${re.workspaceId}\0${re.agentId}`){const L=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(oe!==L){oe=L;const Y=ve??f,J=Y&&n.inputValue()===Y.text&&JSON.stringify(ue())===Y.attachmentsJson;re.origin===a?ve={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(w+=1,M&&clearTimeout(M),_(V,re.snapshot.attachments),ve=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(bl(e(V))),n.applyEditorContent(re.snapshot.text))}}ct(Re);const Te=[];for(const L of N.saves){if(L.status==="pending")continue;Te.push(L.id);const Y=T[L.id];delete T[L.id],Y?.(L)}Te.length>0&&queueMicrotask(()=>r.dispatch(ew(a,Te)))},ne=(N,C,re)=>{const Te=crypto.randomUUID();D={requestId:Te,apply:re},_(c,!0),r.dispatch(nw(a,Te,N,C))},te=()=>{D&&(D=null,_(c,!1),r.dispatch(aw(a)))},ze=()=>{const N=F;N&&(F=null,r.dispatch(rw(a)),H?.saves.some(C=>C.id===N)||delete T[N])};r.dispatch(Y_(a));const se=r.ownerView(a).subscribe(N=>ct(()=>we(N))),he=()=>{y&&(clearTimeout(y),y=null),_(l,!1)},Me=()=>{F&&(F=null,r.dispatch(tw(a)))};le(()=>{const N=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!N){ct(()=>{w+=1,u=null,te(),R&&clearTimeout(R),R=null,he(),M&&clearTimeout(M),M=null,_(i,!1),Me()});return}if(!C||!re)return;const Te=`${C}\0${re}`;if(u===Te)return;const L=u!==null;u=Te;const Y=++w;ct(()=>{f=null,ve=null,oe=null,_(V,[]),R&&clearTimeout(R),he(),M&&(clearTimeout(M),M=null),L&&(Me(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=Qb(C,re);if(J){_(V,J.attachments),_(i,!1);const Ne=n.contextItems().length>0,U=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),Ne||n.setContextItems(bl(J.attachments)),n.applyEditorContent(J.text),f={text:J.text,attachmentsJson:Ie},ne(C,re,Ce=>{if(Ce.status!=="restored")return;const Le=Ce.draft;if(v||!(n.active?.()??!0)||u!==Te||w!==Y)return;const st=Le?.text??"",Xe=Le?.attachments??[],He=JSON.stringify(Xe);sd(C,re,{text:st,attachments:Xe});const Pe=n.inputValue()===U&&JSON.stringify(ue())===Ie;Ne||!Pe||(st!==U&&(n.setInputValue(st),n.applyEditorContent(st)),He!==Ie&&n.setContextItems(bl(Xe)),f={text:st,attachmentsJson:He})});return}_(i,!0),y=setTimeout(()=>{y=null,(n.active?.()??!0)&&_(l,!0)},ex),R=setTimeout(()=>{(n.active?.()??!0)&&(_(i,!1),he())},Zk);const be=()=>{!(n.active?.()??!0)||u!==Te||w!==Y||(R&&clearTimeout(R),_(i,!1),he())};ne(C,re,Ne=>{if(Ne.status!=="restored"){be();return}const U=Ne.draft;if(v||!(n.active?.()??!0)||u!==Te||w!==Y)return;const Ie=!!n.inputValue();if(!Ie&&U?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(bl(U.attachments)),!Ie&&U?.text&&(n.setInputValue(U.text),M=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===U.text&&n.applyEditorContent(U.text)},Xk)),f===null){const Ce=U?.text??"",Le=U?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(Le)},sd(C,re,{text:Ce,attachments:Le})}be()})})}),le(()=>{const N=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Te=e(i);if(!N){ct(ze);return}if(!C||!re)return;const L=n.inputValue(),Y=ue();if(ct(Re),ct(ze),Te||f===null&&!L&&Y.length===0)return;const J=JSON.stringify(Y);if(f!==null&&f.text===L&&f.attachmentsJson===J)return;JSON.stringify(e(V))!==J&&_(V,Y);const be=`${C}\0${re}`,Ne=x,U=crypto.randomUUID();T[U]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){u===be&&x===Ne&&(f={text:L,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ct(()=>{F=U,r.dispatch(X_(a,U,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:L,attachments:Y,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),le(()=>()=>{v=!0,R&&clearTimeout(R),y&&clearTimeout(y),M&&clearTimeout(M),Me(),se(),r.dispatch(Z_(a))});const Ee=N=>{const C=Re();return C!==null&&C.authority===N.authority&&C.ownerId===N.ownerId&&C.workspaceId===N.workspaceId&&C.agentId===N.agentId&&C.generation===N.generation&&C.text===N.text&&JSON.stringify(C.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Re,isCurrentDraft:Ee,updateAttachmentScreen(N,C,re){return!Ee(N)||!N.attachments.some(Te=>Te.id===C)?null:(_(V,N.attachments.map(Te=>Te.id===C?{...Te,screen:structuredClone(re)}:Te)),Re())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(w+=1,x+=1,te(),R&&(clearTimeout(R),R=null),M&&(clearTimeout(M),M=null),_(i,!1),he(),ze(),u!==null){const[N,C]=u.split("\0");sd(N,C,{text:"",attachments:[]}),ve=null,_(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Mi(n){if(!n)return null;const r=kf(JSON.stringify([n.workspaceId,n.agentId]),If(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function rx(n,r,a){const i=O.state.principal.snapshot,c=()=>Ci(O.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,f=Gd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const u=await f.readiness();return!c()||!u.ok?{ready:!1}:u.value.find(w=>w.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Np(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,f=0,u=null;Es(()=>{l=!1,f++}),le(()=>{const y=n.capture();e(r)&&(!y||y.authority!==e(r).capture.authority||y.ownerId!==e(r).capture.ownerId||y.workspaceId!==e(r).capture.workspaceId||y.agentId!==e(r).capture.agentId||y.attachmentEpoch!==e(r).capture.attachmentEpoch)&&_(r,null)});async function w(y){if(n.disabled()||e(a))return;const M=n.drafts.captureDraft(),x=Mi(M),F=x?.clips.find(V=>V.contextItemId===y);if(!M||!F?.media||!x)return;const D=Xb({workspaceId:M.workspaceId,agentId:M.agentId,clip:F,evidence:x,marks:x.marks}),T=gf(M.workspaceId,F.path);if(!D||!T)return;const H=++f;c=document.activeElement instanceof HTMLElement?document.activeElement:null,_(a,!0),_(i,!1);try{if(await n.beforeOpen?.(),!l||f!==H||!n.drafts.isCurrentDraft(M))return;const V=await(n.prepareOutput??rx)(M,F.media,n.drafts);if(!l||f!==H||!n.drafts.isCurrentDraft(M))return;const{attachmentPath:oe,...P}=D;_(r,{capture:M,contextItemId:y,snapshot:{...P,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===H&&_(i,!0)}finally{l&&f===H&&_(a,!1)}}async function v(y){const M=crypto.randomUUID(),x=e(r),F=n.drafts.captureDraft();if(!x||!F||F.authority!==x.capture.authority||F.ownerId!==x.capture.ownerId||F.workspaceId!==x.capture.workspaceId||F.agentId!==x.capture.agentId||F.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:M,result:"stale-source"};const D=Mi(F),T=D?.clips.find(Q=>Q.contextItemId===x.contextItemId);if(!D||!T?.media)return{requestId:M,result:"stale-source"};const V=u?.openId===x.snapshot.openId&&u.inputRevision===y.revision&&JSON.stringify(u.media)===JSON.stringify(T.media)?{...y,revision:T.media.saved?.revision??0}:y,oe=aS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:F.workspaceId,agentId:F.agentId},sourceId:y.sourceId,sourceRevision:y.sourceRevision,expectedEditRevision:V.revision,edit:V});if(oe.status!=="saved")return{requestId:M,result:oe.status==="invalid-edit"?"failed":oe.status};const P=sS({...D,clips:D.clips.map(Q=>Q.id===T.id?{...Q,media:oe.media}:Q)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(F,x.contextItemId,P);if(!k)return{requestId:M,result:"stale-source"};u={openId:x.snapshot.openId,media:oe.media,inputRevision:y.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:M,result:"stale-source"};await n.drafts.flushDraft(k);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!Q||Q.attachmentEpoch!==x.capture.attachmentEpoch||Q.authority!==k.authority||Q.ownerId!==k.ownerId||Q.workspaceId!==k.workspaceId||Q.agentId!==k.agentId||JSON.stringify(Q.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(P)?{requestId:M,result:"stale-source"}:(u=null,{requestId:M,result:"saved",saved:oe.media.saved??void 0})}catch{return{requestId:M,result:"failed"}}}function R(y){return n.disabled()||!n.onRemove(y)?!1:(e(r)?.contextItemId===y&&_(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:w,save:v,remove:R,close(){_(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var ax=E('<p role="alert"> </p>'),sx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),ox=E("<!> <!> <!>",1);function ev(n,r){if(new.target)return dn({component:ev,...n});pn(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),c=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Np),u=Z(r,"beforeOpen",7),w=Z(r,"onReviewChange",7);const v=ct(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:P=>l()(P),beforeOpen:()=>u()?.()??Promise.resolve()}));le(()=>{const P=v.opening,k=v.session;ct(()=>w()?.(P,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const R=o(Zb),y=o(()=>Mi(a())),M=o(()=>e(y)?.clips.map(P=>({id:P.contextItemId,kind:"clip",owner:"evidence",duration:Sp(P.durationMs),recording:!1,url:a()?gf(a().workspaceId,P.path):void 0,...P.media?.saved?{summary:ey(P.media.saved)}:{}}))??[]);let x=_e(null);var F={get capture(){return a()},set capture(P){a(P),ee()},get drafts(){return i()},set drafts(P){i(P),ee()},get disabled(){return c()},set disabled(P=!1){c(P),ee()},get onRemove(){return l()},set onRemove(P){l(P),ee()},get controllerFactory(){return f()},set controllerFactory(P=Np){f(P),ee()},get beforeOpen(){return u()},set beforeOpen(P){u(P),ee()},get onReviewChange(){return w()},set onReviewChange(P){w(P),ee()},$set:un,$on:(P,k)=>gn(r,P,k)},D=ox(),T=ye(D);{let P=o(()=>c()||v.opening);hS(T,{get items(){return e(M)},get labels(){return e(R)},get disabled(){return e(P)},onEdit:k=>void v.open(k),onMarkUp:k=>void v.open(k),get onRemove(){return v.remove}})}var H=m(T,2);{var V=P=>{var k=ax(),Q=de(k,!0);q(ge=>z(Q,ge),[()=>g.dock_captureEditor_saveFailed_label()]),p(P,k)};B(H,P=>{v.problem&&P(V)})}var oe=m(H,2);{let P=o(()=>!!v.session),k=o(()=>g.dock_captureEditor_recording_title({duration:v.session?Sp(v.session.snapshot.durationMs??0):""}));d$(oe,{get open(){return e(P)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>v.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),v.restoreFocus()},get contentRef(){return e(x)},set contentRef(Q){_(x,Q,!0)},children:(Q,ge)=>{var Re=Bt(),ve=ye(Re);{var ue=we=>{var ne=Bt(),te=ye(ne);ki(te,()=>v.session.snapshot.openId,ze=>{var se=sx(),he=I(se);g$(he,{get snapshot(){return v.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>v.close(),get onSave(){return v.save},onDelete:async()=>!!v.session&&v.remove(v.session.contextItemId)}),b(se),p(ze,se)}),p(we,ne)};B(ve,we=>{v.session&&we(ue)})}p(Q,Re)},$$slots:{default:!0}})}return p(n,D),fn(F)}const $l=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function ix(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,f=null,u=null;async function w(y){y.abort.abort(),y.slot?.cancel(),await y.native?.dispose()}async function v(){l++;const y=u;u=null,y&&await w(y)}to(()=>{const y=()=>{_(r,document.hasFocus(),!0)};return y(),window.addEventListener("focus",y),window.addEventListener("blur",y),()=>{window.removeEventListener("focus",y),window.removeEventListener("blur",y)}});const R=O.getReadableState().subscribe(()=>{u&&!u.current()&&v()});return Es(()=>{c=!0,R(),v()}),le(()=>{const y=n.capture(),M=y?$l(y):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===M);ct(()=>{if(!x||!y){v();return}if(u?.key===M)return;if(f===M){v();return}v();const D=Mi(y)?.clips.flatMap(Re=>!Re.mediaError&&Re.media?[Re.media]:[])??[],T=D[0],H=O.state.principal.snapshot,V=Hl.select(O.state,y.workspaceId);if(!T||!H||!V||n.drafts.gateActive)return;const oe=cf(),P=new AbortController,k=()=>!c&&!P.signal.aborted&&Ci(O.state)===y.authority&&Hl.select(O.state,y.workspaceId)===V&&uf(oe)&&!!n.capture()&&$l(n.capture())===M,Q={key:M,capture:y,abort:P,native:null,slot:null,current:k};u=Q;const ge=l;n.drafts.flushDraft(y).then(async Re=>{if(!(u!==Q||ge!==l||!k())){if(!Re){f=M,await v();return}Q.native=Gd({workspaceId:y.workspaceId,agentId:y.agentId,draftId:crypto.randomUUID(),principalId:H.principal.id,media:structuredClone(D)},k,P.signal),Q.slot=ty(Q.native.service),f=M,Q.slot.warm(M,T,k)}}).catch(()=>{u===Q&&v()})})}),{cancel:v,async beforeEditorOpen(){_(a,!0),f=null,await v()},editorState(y,M){_(a,y,!0);const x=M?$l(M.capture):null;M&&e(i)?.openId!==M.openId&&(f=null),_(i,M&&x?{openId:M.openId,key:x}:null)},take(y,M){const x=u;if(!x?.native||!x.slot||x.key!==$l(y)||!x.current())return v(),null;u=null,l++;const F=x.native,D=x.slot,T=()=>x.abort.abort();return M.addEventListener("abort",T,{once:!0}),M.aborted&&T(),{service:{...F.service,takePreparedRecording:H=>D.take(x.key,H,()=>!M.aborted&&x.current())},async dispose(){M.removeEventListener("abort",T),await w(x)}}}}}var lx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function tv(n,r){if(new.target)return dn({component:tv,...n});pn(r,!1);var a={$set:un,$on:(f,u)=>gn(r,f,u)};Mf();var i=lx(),c=I(i),l=de(c,!0);return b(i),q(f=>z(l,f),[()=>g.chat_draftGate_loading_label()]),p(n,i),fn(a)}var cx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Td(n,r){if(new.target)return dn({component:Td,...n});pn(r,!1);var a={$set:un,$on:(f,u)=>gn(r,f,u)};Mf();var i=cx(),c=m(I(i),2),l=de(c,!0);return In(2),b(i),q((f,u)=>{Ue(i,"aria-label",f),z(l,u)},[()=>g.chat_newMessagesDivider_label(),()=>g.chat_newMessagesDivider_label()]),p(n,i),fn(a)}function dx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function ux(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function gx(n,r){return r&&n.includes(r)?r:null}function Bp(n,r,a){return r-n<=a}const px=.2;function Wp(n,r,a){const i=Math.max(0,a-r),c=n-px*r;return Math.min(Math.max(0,c),i)}function fx(n,r,a){return n!==null&&a&&n===r}function vx(n){return n?sw(n)&&ow(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function hx(n){const r=[],a=new Set;let i,c;for(const H of n.messages){if(H.agentId&&H.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(H.id))continue;a.add(H.id),n.breakBeforeMessageIds?.has(H.id)&&(i=void 0,c=void 0);const V=mS(H);if(V?.kind!=="turn-failure")c=void 0;else{const oe=i?.seq!==void 0&&H.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(H.seq)&&H.seq===i.seq+1;(!c||!oe)&&(c={key:JSON.stringify([n.agentId,"notice",H.id]),anchorMessageId:H.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:H.id,reason:V.reason,timestamp:H.timestamp}),c.recordedFailureCount+=1}i=H}const l=new Map;for(const H of n.queue){if(!H.requeuedAfterFailure)continue;const V=H.turnId||void 0,oe=JSON.stringify([n.agentId,V?"turn":"queue",V??H.id]);let P=l.get(oe);P||(P={key:oe,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(oe,P)),P.queueIds.includes(H.id)||P.queueIds.push(H.id)}const f=[...l.values()],u=n.session?.id===n.agentId?n.session:void 0,w=u?.status===Si.Error,v=n.transientError||w&&u.stopReason||null,R=w&&!v,y=w&&(!n.transientError||n.transientError===u.stopReason)?u.stopReasonTimestamp:void 0,M=y?pp(y):null,x=M&&v&&v===u?.stopReason?r.flatMap(H=>H.records).filter(H=>H.reason===v&&pp(H.timestamp)===M):[],F=x.length===1?x[0].messageId:void 0,T=(u?hf(u):!1)?"attempting":f.length?"queued":v||R?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:v,needsFallbackReason:R,timestamp:y,noticeId:F}}}function mx(n,r){const a=n.hiddenTail[0]?.id,i=hx({...r,messages:[...n.groups.flatMap(u=>u.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(u=>({...u,records:u.records.filter(w=>w.messageId!==c)})).filter(u=>u.records.length>0),f=new Set(l.map(u=>u.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(u=>[u.records[0].messageId,u])),collapsedMessageIds:new Set(i.history.flatMap(u=>u.records.map(w=>w.messageId).filter(w=>!f.has(w))))}}var _x=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),wx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),bx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),yx=E('<div class="mb-5"><!></div>'),Ix=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Sx=E("<!> <!>",1),$x=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),kx=E("<!> <span> </span>",1),xx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function nv(n,r){if(new.target)return dn({component:nv,...n});pn(r,!0);const a=()=>fe(x,"$userOverrides$",f),i=()=>fe(M,"$specialists$",f),c=()=>fe(H,"$isGitHubAuth$",f),l=()=>fe(V,"$recentSpecialistIds$",f),[f,u]=Dr();let w=Z(r,"onSpecialistChange",7),v=Z(r,"session",7),R=Z(r,"workspaceId",7);const y=Nn(R()??"");le(()=>y.set(R()??""));const M=Ff(y),x=q$();le(()=>{a()});const F=o(()=>{if(!v()||qy(v()))return null;const N=v().metadata?.specialist||v().agentMetadata?.specialist;return N&&i().find(C=>C.id===N)||null});async function D(N){N?await Bl({specialist:N,hash:"specialists"}):await Bl({view:"create-specialist"})}let T=_e(!1);const H=L$(),V=GI(),oe=o(()=>iw(H$(i(),c()),l()));let P=_e(!1);const k=o(()=>g.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(F)?.name??g.chat_shared_general_fallback()),ge=o(()=>e(F)?.description??g.chat_shared_noSpecializedBehavior_label()),Re=o(()=>e(F)?e(F).defaultBehaviorPrompt||"":e(k));var ve={get onSpecialistChange(){return w()},set onSpecialistChange(N){w(N),ee()},get session(){return v()},set session(N){v(N),ee()},get workspaceId(){return R()},set workspaceId(N){R(N),ee()},$set:un,$on:(N,C)=>gn(r,N,C)},ue=xx(),we=I(ue);{var ne=N=>{var C=yx(),re=I(C);K$(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(P)},set open(Y){_(P,Y,!0)},trigger:(Y,J)=>{let be=()=>(J?.()).props;{let Ne=o(()=>Fd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));xt(Y,Ei(be,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Ne)},"data-testid":"specialist-picker-trigger",children:(U,Ie)=>{var Ce=_x(),Le=ye(Ce),st=I(Le);{let Se=o(()=>e(F)?.id??null),Ae=o(()=>e(F)?.icon??null);G$(st,{agentId:"blank",variant:"emphasized",get specialist(){return e(Se)},get icon(){return e(Ae)}})}b(Le);var Xe=m(Le,2),He=I(Xe),Pe=de(He,!0),j=m(He,2),ae=de(j,!0);b(Xe);var qe=m(Xe,2),G=I(qe);pt(G,{get icon(){return Na},size:10}),b(qe),q(()=>{z(Pe,e(Q)),z(ae,e(ge))}),p(U,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=bx(),be=I(J),Ne=I(be),U=de(Ne,!0),Ie=m(Ne,2),Ce=de(Ie,!0);b(be);var Le=m(be,2),st=I(Le);{let Pe=o(()=>e(F)?.id??null);D_(st,{get specialists(){return e(oe)},get value(){return e(Pe)},onchange:j=>{_(P,!1),w()?.(j)}})}b(Le);var Xe=m(Le,2),He=I(Xe);Rt(He,()=>Or,(Pe,j)=>{j(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{_(P,!1),D()},children:(ae,qe)=>{var G=wx(),Se=ye(G),Ae=I(Se);pt(Ae,{get icon(){return m$},size:12}),b(Se);var je=m(Se,2),Be=de(je,!0);q(We=>z(Be,We),[()=>g.chat_regularAgentWelcome_createSpecialist_label()]),p(ae,G)},$$slots:{default:!0}})}),b(Xe),b(J),q((Pe,j)=>{z(U,Pe),z(Ce,j)},[()=>g.workspace_createAgentSection_specialists_label(),()=>g.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(C),p(N,C)};B(we,N=>{w()&&N(ne)})}var te=m(we,2);{var ze=N=>{var C=Bt(),re=ye(C);{let Te=o(()=>g.chat_specialistSelector_prompt_label());Rt(re,()=>J$,(L,Y)=>{Y(L,{class:"mb-3",role:"region",get"aria-label"(){return e(Te)},children:(J,be)=>{var Ne=Sx(),U=ye(Ne);Rt(U,()=>Jf,(Ce,Le)=>{Le(Ce,{children:(st,Xe)=>{var He=Bt(),Pe=ye(He);Rt(Pe,()=>Yf,(j,ae)=>{ae(j,{class:"type-caption font-medium",children:(qe,G)=>{In();var Se=_n();q(Ae=>z(Se,Ae),[()=>g.chat_specialistSelector_prompt_label()]),p(qe,Se)},$$slots:{default:!0}})}),p(st,He)},$$slots:{default:!0}})});var Ie=m(U,2);Rt(Ie,()=>Q$,(Ce,Le)=>{Le(Ce,{children:(st,Xe)=>{var He=Ix(),Pe=ye(He),j=de(Pe,!0),ae=m(Pe,2);xt(ae,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>_(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(qe,G)=>{In();var Se=_n();q(Ae=>z(Se,Ae),[()=>e(T)?g.chat_regularAgentWelcome_showLess_label():g.chat_regularAgentWelcome_showMore_label()]),p(qe,Se)},$$slots:{default:!0}}),q(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),z(j,e(Re))}),p(st,He)},$$slots:{default:!0}})}),p(J,Ne)},$$slots:{default:!0}})})}p(N,C)},se=N=>{var C=$x(),re=de(C,!0);q(()=>z(re,e(Re))),p(N,C)};B(te,N=>{e(F)?N(ze):N(se,-1)})}var he=m(te,2);{var Me=N=>{xt(N,{variant:"ghost-light",size:"sm",onclick:()=>D(e(F).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Te=kx(),L=ye(Te);pt(L,{get icon(){return h$},size:12,class:"opacity-60"});var Y=m(L,2),J=de(Y,!0);q(be=>z(J,be),[()=>g.chat_regularAgentWelcome_customize_label()]),p(C,Te)},$$slots:{default:!0}})};B(he,N=>{e(F)&&N(Me)})}b(ue),p(n,ue);var Ee=fn(ve);return u(),Ee}var Cx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Px=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Rx=E('<span class="type-caption"> </span>'),Tx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Ax=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Kd(n,r){if(new.target)return dn({component:Kd,...n});pn(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),c=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),u=Z(r,"reserveShortcutHintSpace",7,!1),w=Z(r,"workspaceId",7);const R=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",y=GS.replace("text-ui","type-caption");function M(k){i()(k)}function x(k,Q){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),M(Q))}function F(k,Q){k.preventDefault(),k.stopPropagation(),Pd(Q,{workspaceId:w(),event:k})}function D(k,Q){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Pd(Q,{workspaceId:w(),event:k}))}function T(k){return k<3}var H={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return c()},set onEdit(k){c(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return u()},set reserveShortcutHintSpace(k=!1){u(k),ee()},get workspaceId(){return w()},set workspaceId(k){w(k),ee()},$set:un,$on:(k,Q)=>gn(r,k,Q)},V=Bt(),oe=ye(V);{var P=k=>{var Q=Ax(),ge=I(Q);{const Re=(ue,we)=>{let ne=()=>(we?.()).item,te=()=>(we?.()).index;const ze=o(()=>Bb(ne())),se=o(()=>e(ze)[0]?.type==="text"?e(ze)[0].content:"");var he=Tx(),Me=I(he),Ee=I(Me);pt(Ee,{get icon(){return Ef},size:16,get class(){return lr}}),b(Me);var N=m(Me,2),C=I(N),re=de(C,!0),Te=m(C);Hn(Te,17,()=>e(ze).slice(e(se)?1:0),H_,(U,Ie)=>{var Ce=Bt(),Le=ye(Ce);{var st=He=>{const Pe=o(()=>Nb(e(Ie).url));var j=Cx(),ae=de(j,!0);q(()=>{Ue(j,"href",e(Pe)),Ue(j,"title",e(Pe)),z(ae,e(Ie).label)}),ps("click",j,qe=>F(qe,e(Pe))),ps("keydown",j,qe=>D(qe,e(Pe))),p(He,j)},Xe=He=>{var Pe=_n();q(()=>z(Pe,e(Ie).content)),p(He,Pe)};B(Le,He=>{e(Ie).type==="link"?He(st):He(Xe,-1)})}p(U,Ce)}),b(N);var L=m(N,2);{var Y=U=>{var Ie=Px();let Ce;var Le=de(Ie);q(()=>{Ce=ke(Ie,1,`${y??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),Ue(Ie,"aria-hidden",f()?void 0:"true"),Ue(Ie,"data-hint-visible",f()),z(Le,`${R}${te()+1}`)}),p(U,Ie)},J=o(()=>T(te())&&(f()||u()));B(L,U=>{e(J)&&U(Y)})}var be=m(L,2);{var Ne=U=>{v$(U,{side:"top",delayDuration:300,trigger:Le=>{{let st=o(()=>g.chat_suggestedPrompts_editInInput_ariaLabel());xt(Le,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(ne())},get"aria-label"(){return e(st)},children:(Xe,He)=>{pt(Xe,{get icon(){return _$},size:"xs"})},$$slots:{default:!0}})}},content:Le=>{var st=Rx(),Xe=de(st,!0);q(He=>z(Xe,He),[()=>g.chat_suggestedPrompts_edit_tooltip()]),p(Le,st)},$$slots:{trigger:!0,content:!0}})};B(be,U=>{c()&&U(Ne)})}b(he),q(U=>{ke(he,1,`${Af} ${VS} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Me,1,`${Fl??""} mt-px self-start`),Ue(C,"aria-label",U),z(re,e(se))},[()=>Db(ne())]),ps("click",C,U=>{U.stopPropagation(),M(ne())}),ps("keydown",C,U=>x(U,ne())),p(ue,he)};let ve=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");u$(ge,{get items(){return a()},virtualize:!1,onActivate:M,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(ve)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Re,$$slots:{row:!0}})}b(Q),Dt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Dt(2,Q,()=>Zs,()=>({tier:"fast"})),p(k,Q)};B(oe,k=>{a().length>0&&k(P)})}return p(n,V),fn(H)}Od(["click","keydown"]);var Mx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function rv(n,r){if(new.target)return dn({component:rv,...n});pn(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const c=o(()=>[{label:g.chat_chiefEmptyState_assignedPrs_label(),prompt:g.chat_chiefEmptyState_assignedPrs_prompt()},{label:g.chat_chiefEmptyState_staleWorkspaces_label(),prompt:g.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:g.chat_chiefEmptyState_agentPerformance_label(),prompt:g.chat_chiefEmptyState_agentPerformance_prompt()},{label:g.chat_chiefEmptyState_morningBrief_label(),prompt:g.chat_chiefEmptyState_morningBrief_prompt()},{label:g.chat_chiefEmptyState_randomTheme_label(),prompt:g.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(M=>M.label));function f(M){const x=e(c).find(F=>F.label===M);x&&a()(x.prompt)}var u={get onSelect(){return a()},set onSelect(M){a(M),ee()},get compact(){return i()},set compact(M=!1){i(M),ee()},$set:un,$on:(M,x)=>gn(r,M,x)},w=Mx(),v=I(w),R=de(v,!0),y=m(v,2);return Kd(y,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),b(w),q(M=>z(R,M),[()=>g.chat_chiefEmptyState_intro_label()]),p(n,w),fn(u)}const Qd=2e3,Ex=4e3,qx=Ex-Qd-2;function Lx(n,r=Qd){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(w=>w.type==="text").map(w=>w.text||w.content||"").join(""),u=(l.role==="assistant"?N_(f).cleanedContent:f).trim();u&&(a.unshift({role:l.role,text:u}),i+=u.length)}return a}function Hx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
2
2
|
|
|
3
3
|
`).slice(-Qd),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const c=`Suggested prompts:
|
|
4
4
|
${i.map(l=>`- ${l}`).join(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{bm as c,_ as p}from"./ClpAEjbe.js";import{m as k}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{Q as A}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{m as L,Jq as d,vG as g,vI as v}from"./CpP1PKzF.js";import{a9 as R}from"./D9Ykl3eH.js";import{selectCurrentWorkspaceTabId as P}from"./DujUyPvo.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Be-tvUeZ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BxKppgO5.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/D9uHbDgA.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DHk9xTTU.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bm as c,_ as p}from"./ClpAEjbe.js";import{m as k}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{Q as A}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{m as L,Jq as d,vG as g,vI as v}from"./CpP1PKzF.js";import{a9 as R}from"./D9Ykl3eH.js";import{selectCurrentWorkspaceTabId as P}from"./DujUyPvo.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./Be-tvUeZ.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./BxKppgO5.js").then(o=>o.o);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./DHk9xTTU.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./DHk9xTTU.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./DHk9xTTU.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./CPDV_dyu.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as le}from"./CfwJkes2.js";import{p as he}from"./WNTW6hiT.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./CeH003CQ.js";import{p as Ee}from"./2ypcXvW0.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
1
|
+
import{I as le}from"./xs7GVnBi.js";import{p as he}from"./DAd8-v0C.js";import{Y as $e,b0 as fe,aZ as ge,U as ue,V as ye,a_ as xe,b as h,W as J,ay as w,aW as me,X as P,bh as pe,b4 as be,r as we,z as B,q as ke,O as ve,aM as Ce}from"./DVuRO9FX.js";import{p as Ee}from"./2ypcXvW0.js";var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},Be=ve.gitGraph,S=h(()=>ke({...Be,...J().gitGraph}),"getConfig"),d=new le(()=>{const e=S(),r=e.mainBranchName,t=e.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:t}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function Y(){return Ce({length:7})}h(Y,"getID");function te(e,r){const t=Object.create(null);return e.reduce((s,o)=>{const i=r(o);return t[i]||(t[i]=!0,s.push(o)),s},[])}h(te,"uniqBy");var Te=h(function(e){d.records.direction=e},"setDirection"),Le=h(function(e){w.debug("options str",e),e=e?.trim(),e=e||"{}";try{d.records.options=JSON.parse(e)}catch(r){w.error("error while parsing gitGraph options",r.message)}},"setOptions"),Me=h(function(){return d.records.options},"getOptions"),Re=h(function(e){let r=e.msg,t=e.id;const s=e.type;let o=e.tags;w.info("commit",r,t,s,o),w.debug("Entering commit:",r,t,s,o);const i=S();t=B.sanitizeText(t,i),r=B.sanitizeText(r,i),o=o?.map(a=>B.sanitizeText(a,i));const n={id:t||d.records.seq+"-"+Y(),message:r,seq:d.records.seq++,type:s??m.NORMAL,tags:o??[],parents:d.records.head==null?[]:[d.records.head.id],branch:d.records.currBranch};d.records.head=n,w.info("main branch",i.mainBranchName),d.records.commits.has(n.id)&&w.warn(`Commit ID ${n.id} already exists`),d.records.commits.set(n.id,n),d.records.branches.set(d.records.currBranch,n.id),w.debug("in pushCommit "+n.id)},"commit"),Ie=h(function(e){let r=e.name;const t=e.order;if(r=B.sanitizeText(r,S()),d.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);d.records.branches.set(r,d.records.head!=null?d.records.head.id:null),d.records.branchConfig.set(r,{name:r,order:t}),ae(r),w.debug("in createBranch")},"branch"),Oe=h(e=>{let r=e.branch,t=e.id;const s=e.type,o=e.tags,i=S();r=B.sanitizeText(r,i),t&&(t=B.sanitizeText(t,i));const n=d.records.branches.get(d.records.currBranch),a=d.records.branches.get(r),l=n?d.records.commits.get(n):void 0,f=a?d.records.commits.get(a):void 0;if(l&&f&&l.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(d.records.currBranch===r){const c=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(l===void 0||!l){const c=new Error(`Incorrect usage of "merge". Current branch (${d.records.currBranch})has no commits`);throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},c}if(!d.records.branches.has(r)){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},c}if(f===void 0||!f){const c=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},c}if(l===f){const c=new Error('Incorrect usage of "merge". Both branches have same head');throw c.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},c}if(t&&d.records.commits.has(t)){const c=new Error('Incorrect usage of "merge". Commit with id:'+t+" already exists, use different custom id");throw c.hash={text:`merge ${r} ${t} ${s} ${o?.join(" ")}`,token:`merge ${r} ${t} ${s} ${o?.join(" ")}`,expected:[`merge ${r} ${t}_UNIQUE ${s} ${o?.join(" ")}`]},c}const g=a||"",$={id:t||`${d.records.seq}-${Y()}`,message:`merged branch ${r} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,g],branch:d.records.currBranch,type:m.MERGE,customType:s,customId:!!t,tags:o??[]};d.records.head=$,d.records.commits.set($.id,$),d.records.branches.set(d.records.currBranch,$.id),w.debug(d.records.branches),w.debug("in mergeBranch")},"merge"),_e=h(function(e){let r=e.id,t=e.targetId,s=e.tags,o=e.parent;w.debug("Entering cherryPick:",r,t,s);const i=S();if(r=B.sanitizeText(r,i),t=B.sanitizeText(t,i),s=s?.map(l=>B.sanitizeText(l,i)),o=B.sanitizeText(o,i),!r||!d.records.commits.has(r)){const l=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw l.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},l}const n=d.records.commits.get(r);if(n===void 0||!n)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(o&&!(Array.isArray(n.parents)&&n.parents.includes(o)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const a=n.branch;if(n.type===m.MERGE&&!o)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!t||!d.records.commits.has(t)){if(a===d.records.currBranch){const $=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const l=d.records.branches.get(d.records.currBranch);if(l===void 0||!l){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const f=d.records.commits.get(l);if(f===void 0||!f){const $=new Error(`Incorrect usage of "cherry-pick". Current branch (${d.records.currBranch})has no commits`);throw $.hash={text:`cherryPick ${r} ${t}`,token:`cherryPick ${r} ${t}`,expected:["cherry-pick abc"]},$}const g={id:d.records.seq+"-"+Y(),message:`cherry-picked ${n?.message} into ${d.records.currBranch}`,seq:d.records.seq++,parents:d.records.head==null?[]:[d.records.head.id,n.id],branch:d.records.currBranch,type:m.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${n.id}${n.type===m.MERGE?`|parent:${o}`:""}`]};d.records.head=g,d.records.commits.set(g.id,g),d.records.branches.set(d.records.currBranch,g.id),w.debug(d.records.branches),w.debug("in cherryPick")}},"cherryPick"),ae=h(function(e){if(e=B.sanitizeText(e,S()),d.records.branches.has(e)){d.records.currBranch=e;const r=d.records.branches.get(d.records.currBranch);r===void 0||!r?d.records.head=null:d.records.head=d.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw r.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},r}},"checkout");function V(e,r,t){const s=e.indexOf(r);s===-1?e.push(t):e.splice(s,1,t)}h(V,"upsert");function Q(e){const r=e.reduce((o,i)=>o.seq>i.seq?o:i,e[0]);let t="";e.forEach(function(o){o===r?t+=" *":t+=" |"});const s=[t,r.id,r.seq];for(const o in d.records.branches)d.records.branches.get(o)===r.id&&s.push(o);if(w.debug(s.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const o=d.records.commits.get(r.parents[0]);V(e,r,o),r.parents[1]&&e.push(d.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const o=d.records.commits.get(r.parents[0]);V(e,r,o)}}e=te(e,o=>o.id),Q(e)}h(Q,"prettyPrintCommitHistory");var Ge=h(function(){w.debug(d.records.commits);const e=ne()[0];Q([e])},"prettyPrint"),He=h(function(){d.reset(),we()},"clear"),Se=h(function(){return[...d.records.branchConfig.values()].map((r,t)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${t}`)}).sort((r,t)=>(r.order??0)-(t.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Ae=h(function(){return d.records.branches},"getBranches"),We=h(function(){return d.records.commits},"getCommits"),ne=h(function(){const e=[...d.records.commits.values()];return e.forEach(function(r){w.debug(r.id)}),e.sort((r,t)=>r.seq-t.seq),e},"getCommitsArray"),De=h(function(){return d.records.currBranch},"getCurrentBranch"),qe=h(function(){return d.records.direction},"getDirection"),Pe=h(function(){return d.records.head},"getHead"),se={commitType:m,getConfig:S,setDirection:Te,setOptions:Le,getOptions:Me,commit:Re,branch:Ie,merge:Oe,cherryPick:_e,checkout:ae,prettyPrint:Ge,clear:He,getBranchesAsObjArray:Se,getBranches:Ae,getCommits:We,getCommitsArray:ne,getCurrentBranch:De,getDirection:qe,getHead:Pe,setAccTitle:xe,getAccTitle:ye,getAccDescription:ue,setAccDescription:ge,setDiagramTitle:fe,getDiagramTitle:$e},Ne=h((e,r)=>{he(e,r),e.dir&&r.setDirection(e.dir);for(const t of e.statements)Fe(t,r)},"populate"),Fe=h((e,r)=>{const s={Commit:h(o=>r.commit(ze(o)),"Commit"),Branch:h(o=>r.branch(Ye(o)),"Branch"),Merge:h(o=>r.merge(je(o)),"Merge"),Checkout:h(o=>r.checkout(Ue(o)),"Checkout"),CherryPicking:h(o=>r.cherryPick(Ke(o)),"CherryPicking")}[e.$type];s?s(e):w.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),ze=h(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?m[e.type]:m.NORMAL,tags:e.tags??void 0}),"parseCommit"),Ye=h(e=>({name:e.name,order:e.order??0}),"parseBranch"),je=h(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?m[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),Ue=h(e=>e.branch,"parseCheckout"),Ke=h(e=>({id:e.id,targetId:"",tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),"parseCherryPicking"),Ve={parse:h(async e=>{const r=await Ee("gitGraph",e);w.debug(r),Ne(r,se)},"parse")},O=10,_=40,L=4,R=2,G=8,j=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),X=12,Z=new Set(["redux-color","redux-dark-color"]),Xe=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),H=h((e,r,t=!1)=>t&&e>0?(e-1)%(r-1)+1:e%r,"calcColorIndex"),C=new Map,E=new Map,F=30,D=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),D.clear(),I=0,z=[],y="LR"},"clear"),oe=h(e=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(s=>{const o=document.createElementNS("http://www.w3.org/2000/svg","tspan");o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o.setAttribute("dy","1em"),o.setAttribute("x","0"),o.setAttribute("class","row"),o.textContent=s.trim(),r.appendChild(o)}),r},"drawText"),ce=h(e=>{let r,t,s;return y==="BT"?(t=h((o,i)=>o<=i,"comparisonFunc"),s=1/0):(t=h((o,i)=>o>=i,"comparisonFunc"),s=0),e.forEach(o=>{const i=y==="TB"||y=="BT"?E.get(o)?.y:E.get(o)?.x;i!==void 0&&t(i,s)&&(r=o,s=i)}),r},"findClosestParent"),Qe=h(e=>{let r="",t=1/0;return e.forEach(s=>{const o=E.get(s).y;o<=t&&(r=s,t=o)}),r||void 0},"findClosestParentBT"),Ze=h((e,r,t)=>{let s=t,o=t;const i=[];e.forEach(n=>{const a=r.get(n);if(!a)throw new Error(`Commit not found for key ${n}`);a.parents.length?(s=rr(a),o=Math.max(s,o)):i.push(a),tr(a,s)}),s=o,i.forEach(n=>{ar(n,s,t)}),e.forEach(n=>{const a=r.get(n);if(a?.parents.length){const l=Qe(a.parents);s=E.get(l).y-_,s<=o&&(o=s);const f=C.get(a.branch).pos,g=s-O;E.set(a.id,{x:f,y:g})}})},"setParallelBTPos"),er=h(e=>{const r=ce(e.parents.filter(s=>s!==null));if(!r)throw new Error(`Closest parent not found for commit ${e.id}`);const t=E.get(r)?.y;if(t===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return t},"findClosestParentPos"),rr=h(e=>er(e)+_,"calculateCommitPosition"),tr=h((e,r)=>{const t=C.get(e.branch);if(!t)throw new Error(`Branch not found for commit ${e.id}`);const s=t.pos,o=r+O;return E.set(e.id,{x:s,y:o}),{x:s,y:o}},"setCommitPosition"),ar=h((e,r,t)=>{const s=C.get(e.branch);if(!s)throw new Error(`Branch not found for commit ${e.id}`);const o=r+t,i=s.pos;E.set(e.id,{x:i,y:o})},"setRootPosition"),nr=h((e,r,t,s,o,i)=>{const{theme:n}=P(),a=j.has(n??""),l=Z.has(n??""),f=Xe.has(n??"");if(i===m.HIGHLIGHT)e.append("rect").attr("x",t.x-10+(a?3:0)).attr("y",t.y-10+(a?3:0)).attr("width",a?14:20).attr("height",a?14:20).attr("class",`commit ${r.id} commit-highlight${H(o,G,l)} ${s}-outer`),e.append("rect").attr("x",t.x-6+(a?2:0)).attr("y",t.y-6+(a?2:0)).attr("width",a?8:12).attr("height",a?8:12).attr("class",`commit ${r.id} commit${H(o,G,l)} ${s}-inner`);else if(i===m.CHERRY_PICK)e.append("circle").attr("cx",t.x).attr("cy",t.y).attr("r",a?7:10).attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x-3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("circle").attr("cx",t.x+3).attr("cy",t.y+2).attr("r",a?2.5:2.75).attr("fill",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x+3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`),e.append("line").attr("x1",t.x-3).attr("y1",t.y+1).attr("x2",t.x).attr("y2",t.y-5).attr("stroke",f?"#000000":"#fff").attr("class",`commit ${r.id} ${s}`);else{const g=e.append("circle");if(g.attr("cx",t.x),g.attr("cy",t.y),g.attr("r",a?7:10),g.attr("class",`commit ${r.id} commit${H(o,G,l)}`),i===m.MERGE){const $=e.append("circle");$.attr("cx",t.x),$.attr("cy",t.y),$.attr("r",a?5:6),$.attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}if(i===m.REVERSE){const $=e.append("path"),c=a?4:5;$.attr("d",`M ${t.x-c},${t.y-c}L${t.x+c},${t.y+c}M${t.x-c},${t.y+c}L${t.x+c},${t.y-c}`).attr("class",`commit ${s} ${r.id} commit${H(o,G,l)}`)}}},"drawCommitBullet"),sr=h((e,r,t,s,o)=>{if(r.type!==m.CHERRY_PICK&&(r.customId&&r.type===m.MERGE||r.type!==m.MERGE)&&o.showCommitLabel){const i=e.append("g"),n=i.insert("rect").attr("class","commit-label-bkg"),a=i.append("text").attr("x",s).attr("y",t.y+25).attr("class","commit-label").text(r.id),l=a.node()?.getBBox();if(l&&(n.attr("x",t.posWithOffset-l.width/2-R).attr("y",t.y+13.5).attr("width",l.width+2*R).attr("height",l.height+2*R),y==="TB"||y==="BT"?(n.attr("x",t.x-(l.width+4*L+5)).attr("y",t.y-12),a.attr("x",t.x-(l.width+4*L)).attr("y",t.y+l.height-12)):a.attr("x",t.posWithOffset-l.width/2),o.rotateCommitLabel))if(y==="TB"||y==="BT")a.attr("transform","rotate(-45, "+t.x+", "+t.y+")"),n.attr("transform","rotate(-45, "+t.x+", "+t.y+")");else{const f=-7.5-(l.width+10)/25*9.5,g=10+l.width/25*8.5;i.attr("transform","translate("+f+", "+g+") rotate(-45, "+s+", "+t.y+")")}}},"drawCommitLabel"),or=h((e,r,t,s)=>{if(r.tags.length>0){let o=0,i=0,n=0;const a=[];for(const l of r.tags.reverse()){const f=e.insert("polygon"),g=e.append("circle"),$=e.append("text").attr("y",t.y-16-o).attr("class","tag-label").text(l),c=$.node()?.getBBox();if(!c)throw new Error("Tag bbox not found");i=Math.max(i,c.width),n=Math.max(n,c.height),$.attr("x",t.posWithOffset-c.width/2),a.push({tag:$,hole:g,rect:f,yOffset:o}),o+=20}for(const{tag:l,hole:f,rect:g,yOffset:$}of a){const c=n/2,x=t.y-19.2-$;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
2
2
|
${s-i/2-L/2},${x+R}
|
|
3
3
|
${s-i/2-L/2},${x-R}
|
|
4
4
|
${t.posWithOffset-i/2-L},${x-c-R}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./ClpAEjbe.js";import{bs as Ue,ca as Ze,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./CJxGDkBm.js";import{nX as Rr,Jq as ct,n2 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./CpP1PKzF.js";import{i as z}from"./wmcYjLAa.js";import{n as We,j as Oe,h as at}from"./oXpJ1LFx.js";import{dE as Ir,bq as Ar}from"./D9Ykl3eH.js";import{a9 as jt}from"./
|
|
1
|
+
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./ClpAEjbe.js";import{bs as Ue,ca as Ze,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./CJxGDkBm.js";import{nX as Rr,Jq as ct,n2 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./CpP1PKzF.js";import{i as z}from"./wmcYjLAa.js";import{n as We,j as Oe,h as at}from"./oXpJ1LFx.js";import{dE as Ir,bq as Ar}from"./D9Ykl3eH.js";import{a9 as jt}from"./CiKM_Bkk.js";import{I as it,g as Ge,i as Lt}from"./BwASeArv.js";import{f as xe}from"./BVi5KkOP.js";import"./CPDV_dyu.js";import{f as ze,s as Er}from"./CnGVh7I3.js";import"./WSVFXKpL.js";import{F as fe,a2 as zr,cR as Hr,aw as ot,ax as pt,c2 as Wr,aV as Dr,bN as Tr,bH as jr,b9 as Fr,cW as Br,cn as Gr,b6 as St,c$ as Rt,cr as _t,bo as Or,cF as Kr,au as Vr}from"./CtJxHvGv.js";import{i as Jr}from"./CzTHqaDJ.js";import{h as Ft}from"./BigcqNWS.js";import{H as Bt}from"./CcNhqKh5.js";import{I as Jt}from"./MZe3NxQe.js";import"./Gb7Ohwuc.js";import{q as Ur}from"./By588DV1.js";import{M as Mt}from"./ChUo22u6.js";import{B as qr}from"./xlUSfXqt.js";import{S as Ct}from"./B06RKBOm.js";const Qr=[/^diff --git /,/^index\s/,/^---\s/,/^\+\+\+\s/,/^\/];function Xr($){const r=[];if(!$)return r;const d=$.split(`
|
|
2
2
|
`);let m=null,b=0,u=0;const T=P=>{const h=P.match(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),U=h?parseInt(h[1],10):0,K=h&&h[2]?parseInt(h[2],10):null,pe=h?parseInt(h[3],10):0,q=h&&h[4]?parseInt(h[4],10):null;m={header:P,oldStart:U,oldLines:K,newStart:pe,newLines:q,lines:[]},r.push(m),b=U,u=pe};for(const P of d){if(P.startsWith("@@")){T(P);continue}if(!m)continue;const h=m;P.startsWith("+")?h.lines.push({type:"addition",content:P.slice(1),oldNum:null,newNum:u++,raw:P}):P.startsWith("-")?h.lines.push({type:"deletion",content:P.slice(1),oldNum:b++,newNum:null,raw:P}):P.startsWith(" ")?h.lines.push({type:"context",content:P.slice(1),oldNum:b++,newNum:u++,raw:P}):Qr.some(U=>U.test(P))||P.trim()===""&&h.lines.push({type:"context",content:"",oldNum:b++,newNum:u++,raw:P})}return r}var Yr=x('<div><!> <!> <!></div> <p class="text-ui text-subtle mt-1"> </p>',1);function Ut($,r){if(new.target)return Ke({component:Ut,...$});Ue(r,!0);let d=k(r,"lineNumber",7,0),m=k(r,"fileName",7,""),b=k(r,"onSend",7),u=k(r,"onClose",7),T=k(r,"isSending",7,!1),P=k(r,"class",7,""),h=we(""),U=we(null);Ze(()=>{e(U)&&e(U).focus()});function K(){!e(h).trim()||T()||(b()?.(e(h).trim(),d(),m()),L(h,""))}function pe(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),K()),I.key==="Escape"&&u()?.()}var q={get lineNumber(){return d()},set lineNumber(I=0){d(I),y()},get fileName(){return m()},set fileName(I=""){m(I),y()},get onSend(){return b()},set onSend(I){b(I),y()},get onClose(){return u()},set onClose(I){u(I),y()},get isSending(){return T()},set isSending(I=!1){T(I),y()},get class(){return P()},set class(I=""){P(I),y()},$set:Ve,$on:(I,he)=>Je(r,I,he)},w=Yr(),H=be(w),de=o(H);{let I=_(()=>Ce.codeReview_inlineComment_askLine_placeholder());Jt(de,{onkeydown:pe,get placeholder(){return e(I)},get disabled(){return T()},class:"flex-1 h-8 rounded-md border border-border bg-background px-3 text-sm placeholder:text-muted-foreground disabled:opacity-50",get ref(){return e(U)},set ref(he){L(U,he,!0)},get value(){return e(h)},set value(he){L(h,he,!0)}})}var ce=n(de,2);{let I=_(()=>!e(h).trim()||T());xe(ce,{type:"button",variant:"primary",onclick:K,get disabled(){return e(I)},class:"h-8 w-8 p-0",children:(he,Ne)=>{var _e=Pt(),S=be(_e);{var E=me=>{it(me,{size:14})},Ie=me=>{fe(me,{get icon(){return zr},class:"h-3.5 w-3.5"})};z(S,me=>{T()?me(E):me(Ie,-1)})}i(he,_e)},$$slots:{default:!0}})}var ae=n(ce,2);xe(ae,{type:"button",variant:"ghost",onclick:()=>u()?.(),class:"h-8 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(I,he)=>{st();var Ne=et();M(_e=>C(Ne,_e),[()=>Ce.codeReview_inlineComment_cancel_label()]),i(I,Ne)},$$slots:{default:!0}}),s(H);var te=n(H,2),ke=O(te,!0);return M(I=>{ze(H,1,`walkthrough-inline-comment flex items-center gap-2 ${P()??""}`),C(ke,I)},[()=>Ce.codeReview_inlineComment_inputHint_label()]),i($,w),qe(q)}var Zr=x('<div class="text-xs text-slate-400 dark:text-slate-500 mt-1"> </div>'),en=x('<span class="font-medium"> </span> <!>',1),tn=x('<div class="flex items-start gap-3 py-2"><div><!></div> <div class="flex-1 min-w-0"><div class="text-sm leading-relaxed text-slate-700 dark:text-slate-300"><!></div></div></div>'),rn=x('<div class="px-4 pb-3 divide-y divide-border"></div>'),nn=x('<div class="border-t border-border"><!> <!></div>'),an=x('<div class="flex items-center gap-2 px-4 py-2 text-xs text-slate-500 dark:text-slate-400 border-t border-border"><!> <span> </span></div>'),sn=x('<div class="flex items-center gap-2"><!> <!> <!></div> <p class="text-ui text-slate-400 dark:text-slate-500 mt-1"> </p>',1),on=x("<!> <span> </span>",1),ln=x('<div><div class="flex items-start gap-3 px-4 py-3"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-sm text-slate-800 dark:text-slate-200 leading-relaxed"><!></div> <!></div> <!></div> <!> <!> <div class="border-t border-border px-4 py-2"><!></div></div>');function qt($,r){if(new.target)return Ke({component:qt,...$});Ue(r,!0);let d=k(r,"annotation",7),m=k(r,"lineNumber",7),b=k(r,"fileName",7),u=k(r,"messages",23,()=>[]),T=k(r,"onSendMessage",7),P=k(r,"onClose",7),h=k(r,"isSending",7,!1),U=k(r,"isAgentResponding",7,!1),K=k(r,"timestamp",7),pe=k(r,"class",7,""),q=we(""),w=we(!1),H=we(!1),de=we(null);Ze(()=>{e(w)&&e(de)&&e(de).focus()});function ce(){!e(q).trim()||h()||(T()?.(e(q).trim(),m(),b()),L(q,""))}function ae(a){a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),ce()),a.key==="Escape"&&(e(q)?L(q,""):L(w,!1))}function te(a){switch(a){case"highlight":return Fr;case"context":return jr;case"explanation":default:return Tr}}function ke(a){switch(a){case"highlight":return"text-orange-500";case"context":return"text-blue-500";case"explanation":default:return"text-warning-ink"}}function I(a){return a?Ur(a):""}const he=_(()=>u().length>0);var Ne={get annotation(){return d()},set annotation(a){d(a),y()},get lineNumber(){return m()},set lineNumber(a){m(a),y()},get fileName(){return b()},set fileName(a){b(a),y()},get messages(){return u()},set messages(a=[]){u(a),y()},get onSendMessage(){return T()},set onSendMessage(a){T(a),y()},get onClose(){return P()},set onClose(a){P(a),y()},get isSending(){return h()},set isSending(a=!1){h(a),y()},get isAgentResponding(){return U()},set isAgentResponding(a=!1){U(a),y()},get timestamp(){return K()},set timestamp(a){K(a),y()},get class(){return pe()},set class(a=""){pe(a),y()},$set:Ve,$on:(a,D)=>Je(r,a,D)},_e=ln(),S=o(_e),E=o(S),Ie=o(E);{let a=_(()=>te(d().type)),D=_(()=>ke(d().type));fe(Ie,{get icon(){return e(a)},get class(){return`h-4 w-4 ${e(D)??""}`}})}s(E);var me=n(E,2),v=o(me),R=o(v);Mt(R,{get content(){return d().message},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(v);var A=n(v,2);{var Y=a=>{var D=Zr(),Z=O(D,!0);M(ee=>C(Z,ee),[()=>I(K())]),i(a,D)};z(A,a=>{K()&&a(Y)})}s(me);var ie=n(me,2);{var $e=a=>{{let D=_(()=>Ce.codeReview_commentThread_dismiss_tooltip());xe(a,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,get onclick(){return P()},class:"shrink-0 text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300 transition-colors",get title(){return e(D)},children:(Z,ee)=>{fe(Z,{get icon(){return Hr}})},$$slots:{default:!0}})}};z(ie,a=>{P()&&a($e)})}s(S);var Se=n(S,2);{var ye=a=>{var D=nn(),Z=o(D);xe(Z,{type:"button",variant:"ghost",onclick:()=>L(H,!e(H)),class:"w-full flex items-center justify-between px-4 py-2 text-sm text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors",children:(Q,se)=>{var X=en(),c=be(X),p=O(c,!0),B=n(c,2);{let ue=_(()=>e(H)?ot:pt);fe(B,{get icon(){return e(ue)},class:"h-3 w-3"})}M(ue=>C(p,ue),[()=>Ce.codeReview_commentThread_suggestedChanges_label()]),i(Q,X)},$$slots:{default:!0}});var ee=n(Z,2);{var re=Q=>{var se=rn();Ge(se,21,u,X=>X.id,(X,c)=>{var p=tn(),B=o(p),ue=o(B);{let g=_(()=>e(c).type==="user"?Br:Gr),N=_(()=>e(c).type==="user"?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400");fe(ue,{get icon(){return e(g)},get class(){return`h-2.5 w-2.5 ${e(N)??""}`}})}s(B);var Re=n(B,2),t=o(Re),l=o(t);Mt(l,{get content(){return e(c).content},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(t),s(Re),s(p),M(()=>ze(B,1,`shrink-0 flex h-5 w-5 items-center justify-center rounded-full ${e(c).type==="user"?"bg-blue-100 dark:bg-blue-900/50":"bg-purple-100 dark:bg-purple-900/50"}`)),We(3,p,()=>at,()=>({axis:"y",distance:4,tier:"moderate"})),i(X,p)}),s(se),We(3,se,()=>Oe,()=>({tier:"moderate"})),i(Q,se)};z(ee,Q=>{e(H)&&Q(re)})}s(D),i(a,D)};z(Se,a=>{e(he)&&a(ye)})}var V=n(Se,2);{var j=a=>{var D=an(),Z=o(D);it(Z,{size:12});var ee=n(Z,2),re=O(ee,!0);s(D),M(Q=>C(re,Q),[()=>Ce.codeReview_commentThread_agentResponding_label()]),i(a,D)};z(V,a=>{U()&&a(j)})}var f=n(V,2),W=o(f);{var F=a=>{var D=sn(),Z=be(D),ee=o(Z);{let c=_(()=>Ce.codeReview_commentThread_followUp_placeholder());Jt(ee,{onkeydown:ae,get placeholder(){return e(c)},get disabled(){return h()},class:"flex-1 h-8 rounded-md border border-border bg-white dark:bg-slate-800 px-3 text-sm placeholder:text-slate-400 disabled:opacity-50",get ref(){return e(de)},set ref(p){L(de,p,!0)},get value(){return e(q)},set value(p){L(q,p,!0)}})}var re=n(ee,2);{let c=_(()=>!e(q).trim()||h());xe(re,{type:"button",variant:"primary",onclick:ce,get disabled(){return e(c)},class:"h-8 w-8 p-0",children:(p,B)=>{var ue=Pt(),Re=be(ue);{var t=g=>{it(g,{size:14})},l=g=>{fe(g,{get icon(){return Wr},class:"h-3 w-3"})};z(Re,g=>{h()?g(t):g(l,-1)})}i(p,ue)},$$slots:{default:!0}})}var Q=n(re,2);xe(Q,{type:"button",variant:"ghost",onclick:()=>{L(w,!1),L(q,"")},class:"h-8 px-2 text-xs text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors",children:(c,p)=>{st();var B=et();M(ue=>C(B,ue),[()=>Ce.codeReview_commentThread_cancel_label()]),i(c,B)},$$slots:{default:!0}}),s(Z);var se=n(Z,2),X=O(se,!0);M(c=>C(X,c),[()=>Ce.codeReview_commentThread_inputHint_label()]),We(3,Z,()=>Oe,()=>({tier:"fast"})),i(a,D)},le=a=>{xe(a,{type:"button",variant:"ghost",onclick:()=>L(w,!0),class:"flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors",children:(D,Z)=>{var ee=on(),re=be(ee);fe(re,{get icon(){return Dr},class:"h-3 w-3"});var Q=n(re,2),se=O(Q,!0);M(X=>C(se,X),[()=>Ce.codeReview_commentThread_askQuestion_label()]),i(D,ee)},$$slots:{default:!0}})};z(W,a=>{e(w)?a(F):a(le,-1)})}return s(f),s(_e),M(()=>ze(_e,1,`walkthrough-comment-thread relative flex w-full flex-col bg-white shadow-sm dark:bg-slate-900 ${pe()??""}`)),We(3,_e,()=>Oe,()=>({tier:"moderate"})),i($,_e),qe(Ne)}var dn=x('<span class="text-emerald-600 dark:text-emerald-400 font-medium"> </span>'),cn=x('<!> <svg class="h-4 w-4 text-ghost shrink-0" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12zm2 0v12h6v-12H5.5z"></path></svg> <div class="flex items-baseline gap-2 flex-1 min-w-0"><span class="text-sm font-medium text-foreground truncate"> </span> <span class="text-xs text-subtle truncate hidden sm:inline"> </span></div> <div class="flex items-center gap-1 text-xs shrink-0"><!></div>',1),un=x('<div class="px-4 pb-3 -mt-1"><p class="text-sm text-subtle"> </p></div>'),vn=x('<div><div><span class="w-12 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <pre class="flex-1 px-1 whitespace-pre overflow-hidden text-ellipsis"><code class="hljs"></code></pre></div>'),gn=x('<div class="border-t border-border"><div class="font-mono text-xs leading-relaxed text-muted-foreground"><!> <!></div></div>'),fn=x('<span class="text-subtle">·</span> <!>',1),hn=x('<div class="flex items-center justify-end gap-2 px-3 py-1.5 bg-muted/20 border-b border-border text-xs"><!> <!></div>'),Gt=x("<!> <span> </span> <!>",1),mn=x('<div class="ml-20"><!></div>'),pn=x('<div class="ml-20 border-l-2 border-primary-ink/50 bg-muted/20"><div class="p-3"><!></div></div>'),_n=x('<div><div><span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span> <span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <div class="flex-1 flex items-center min-w-0 pr-2"><pre class="flex-1 px-1 whitespace-pre overflow-x-auto"><code class="hljs"></code></pre> <!></div></div> <!> <!> <!>',1),xn=x("<!> <!>",1),bn=x('<div class="relative"><!> <div class="overflow-x-auto"><div class="font-mono text-xs leading-relaxed min-w-full"></div></div></div>'),wn=x('<div><div class="flex flex-col border-b border-border"><!> <!></div> <!> <!></div>');function It($,r){if(new.target)return Ke({component:It,...$});Ue(r,!0);let d=k(r,"fileName",7),m=k(r,"patch",7),b=k(r,"annotations",23,()=>[]),u=k(r,"initialCollapsed",7,!1),T=k(r,"contextLines",7,3),P=k(r,"onSendMessage",7),h=k(r,"isSending",7,!1),U=k(r,"additions",7,0),K=k(r,"deletions",7,0),pe=k(r,"fileDescription",7,""),q=k(r,"class",7,"");const w=_(()=>Xr(m())),H=_(()=>Rr(d())),de=_(()=>{const t=new Map;return!e(H)||e(H)==="text"||e(H)==="plaintext"||!Bt.getLanguage(e(H))||e(w).forEach(l=>{const g=[];if(l.lines.forEach(N=>{const G=N.content||"",J=`${N.oldNum}-${N.newNum}`;g.push({content:G,key:J})}),g.length!==0)try{const N=g.map(ne=>ne.content).join(`
|
|
3
3
|
`),J=Bt.highlight(N,{language:e(H)}).value.split(`
|
|
4
4
|
`);g.forEach((ne,oe)=>{oe<J.length&&t.set(ne.key,J[oe])})}catch(N){console.warn("Failed to highlight hunk:",N)}}),t});let ce=we(mt(u())),ae=we(mt(new Set)),te=we(null);const ke=_(()=>{const t=new Map;for(const l of b()){const g=t.get(l.line)||[];g.push(l),t.set(l.line,g)}return t}),I=_(()=>new Set(b().map(t=>t.line)));function he(t){if(t.type==="deletion")return[];const l=t.newNum;return l==null?[]:e(ke).get(l)||[]}function Ne(t,l,g){if(g.type==="addition"||g.type==="deletion")return!0;const N=g.newNum??g.oldNum;if(N!==null&&e(I).has(N))return!0;const G=e(w)[t];if(!G)return!1;for(let J=Math.max(0,l-T());J<=Math.min(G.lines.length-1,l+T());J++){const ne=G.lines[J];if(ne.type==="addition"||ne.type==="deletion")return!0;const oe=ne.newNum??ne.oldNum;if(oe!==null&&e(I).has(oe))return!0}for(const J of e(ae)){const[ne,oe,ve]=J.split("-").map(Number);if(ne===t&&l>=oe&&l<=ve)return!0}return!1}function _e(t){const l=e(w)[t];if(!l)return[];const g=[];let N=null;for(let G=0;G<l.lines.length;G++){const J=Ne(t,G,l.lines[G]);!J&&N===null?N=G:J&&N!==null&&(g.push({startIndex:N,endIndex:G-1,count:G-N}),N=null)}return N!==null&&g.push({startIndex:N,endIndex:l.lines.length-1,count:l.lines.length-N}),g}function S(t,l,g){const N=`${t}-${l}-${g}`;e(ae).add(N),L(ae,new Set(e(ae)),!0)}function E(){for(let t=0;t<e(w).length;t++){const l=e(w)[t];S(t,0,l.lines.length-1)}}function Ie(){L(ae,new Set,!0)}function me(t){const l=`${t.oldNum}-${t.newNum}`,g=e(de).get(l);return g!==void 0?g:v(t.content||"")}function v(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function R(t){switch(t.type){case"addition":return"bg-emerald-500/5 dark:bg-emerald-500/10";case"deletion":return"bg-red-500/5 dark:bg-red-500/10";default:return""}}function A(t){switch(t.type){case"addition":return"text-emerald-600 dark:text-emerald-400 font-medium";case"deletion":return"text-red-600 dark:text-red-400 font-medium";default:return"text-transparent"}}function Y(t){switch(t.type){case"addition":return"+";case"deletion":return"-";default:return" "}}function ie(t){switch(t.type){case"addition":return"bg-emerald-500/10 dark:bg-emerald-500/15";case"deletion":return"bg-red-500/10 dark:bg-red-500/15";default:return"bg-muted/30"}}function $e(){L(ce,!e(ce))}function Se(t){L(te,t,!0)}function ye(){L(te,null)}function V(t,l,g){P()?.(t,l,g),L(te,null)}const j=_(()=>()=>{const t=d().split("/");return t[t.length-1]}),f=_(()=>()=>{const t=d().split("/");return t.length<=1?"":t.slice(0,-1).join("/")}),W=_(()=>{for(let t=0;t<e(w).length;t++)if(_e(t).length>0)return!0;return!1}),F=_(()=>{const l=[];for(let g=0;g<e(w).length&&l.length<3;g++){const N=e(w)[g];for(let G=0;G<N.lines.length&&l.length<3;G++){const J=N.lines[G];(J.type==="addition"||J.type==="deletion")&&l.push({line:J,hunkIndex:g,lineIndex:G})}}return l}),le=_(()=>{let t=0;for(const l of e(w))for(const g of l.lines)(g.type==="addition"||g.type==="deletion")&&t++;return t});let a=we(mt(new Map));function D(t){return`${t.file}:${t.line}:${t.type}`}function Z(t){return e(a).get(D(t))||[]}var ee={get fileName(){return d()},set fileName(t){d(t),y()},get patch(){return m()},set patch(t){m(t),y()},get annotations(){return b()},set annotations(t=[]){b(t),y()},get initialCollapsed(){return u()},set initialCollapsed(t=!1){u(t),y()},get contextLines(){return T()},set contextLines(t=3){T(t),y()},get onSendMessage(){return P()},set onSendMessage(t){P(t),y()},get isSending(){return h()},set isSending(t=!1){h(t),y()},get additions(){return U()},set additions(t=0){U(t),y()},get deletions(){return K()},set deletions(t=0){K(t),y()},get fileDescription(){return pe()},set fileDescription(t=""){pe(t),y()},get class(){return q()},set class(t=""){q(t),y()},$set:Ve,$on:(t,l)=>Je(r,t,l)},re=wn(),Q=o(re),se=o(Q);xe(se,{type:"button",variant:"ghost",class:"w-full flex items-center gap-2 px-4 py-3 hover:bg-muted/30 transition-colors text-left group",onclick:$e,children:(t,l)=>{var g=cn(),N=be(g);{let Le=_(()=>e(ce)?pt:ot);fe(N,{get icon(){return e(Le)},class:"h-3 w-3 text-ghost shrink-0"})}var G=n(N,4),J=o(G),ne=O(J,!0),oe=n(J,2),ve=O(oe,!0);s(G);var Me=n(G,2),Ae=o(Me);{var De=Le=>{var Ee=dn(),Fe=O(Ee);M(()=>C(Fe,`+${U()+K()}`)),i(Le,Ee)};z(Ae,Le=>{(U()>0||K()>0)&&Le(De)})}s(Me),M((Le,Ee)=>{C(ne,Le),C(ve,Ee)},[()=>e(j)(),()=>e(f)()]),i(t,g)},$$slots:{default:!0}});var X=n(se,2);{var c=t=>{var l=un(),g=o(l),N=O(g,!0);s(l),M(()=>C(N,pe())),i(t,l)};z(X,t=>{pe()&&t(c)})}s(Q);var p=n(Q,2);{var B=t=>{var l=gn(),g=o(l),N=o(g);Ge(N,17,()=>e(F),({line:ne,hunkIndex:oe,lineIndex:ve})=>`preview-${oe}-${ve}`,(ne,oe)=>{let ve=()=>e(oe).line;var Me=vn(),Ae=o(Me),De=o(Ae),Le=O(De,!0);s(Ae);var Ee=n(Ae,2),Fe=O(Ee,!0),Te=n(Ee,2),ge=o(Te);Ft(ge,()=>me(ve()),!0),s(ge),s(Te),s(Me),M((Qe,Xe,Ye,tt)=>{ze(Me,1,`flex ${Qe??""}`),ze(Ae,1,`w-12 shrink-0 flex select-none ${Xe??""} border-r border-border`),C(Le,ve().newNum??ve().oldNum??""),ze(Ee,1,`w-5 shrink-0 text-center select-none ${Ye??""}`),C(Fe,tt)},[()=>R(ve()),()=>ie(ve()),()=>A(ve()),()=>Y(ve())]),i(ne,Me)});var G=n(N,2);{var J=ne=>{xe(ne,{type:"button",variant:"ghost",class:"w-full py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors text-center",onclick:$e,children:(oe,ve)=>{st();var Me=et();M(Ae=>C(Me,Ae),[()=>Ce.codeReview_fileDiff_moreLines_label({count:e(le)-e(F).length})]),i(oe,Me)},$$slots:{default:!0}})};z(G,ne=>{e(le)>e(F).length&&ne(J)})}s(g),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};z(p,t=>{e(ce)&&e(F).length>0&&t(B)})}var ue=n(p,2);{var Re=t=>{var l=bn(),g=o(l);{var N=ne=>{var oe=hn(),ve=o(oe);xe(ve,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:E,children:(De,Le)=>{st();var Ee=et();M(Fe=>C(Ee,Fe),[()=>Ce.codeReview_fileDiff_expandAll_label()]),i(De,Ee)},$$slots:{default:!0}});var Me=n(ve,2);{var Ae=De=>{var Le=fn(),Ee=n(be(Le),2);xe(Ee,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:Ie,children:(Fe,Te)=>{st();var ge=et();M(Qe=>C(ge,Qe),[()=>Ce.codeReview_fileDiff_collapse_label()]),i(Fe,ge)},$$slots:{default:!0}}),i(De,Le)};z(Me,De=>{e(ae).size>0&&De(Ae)})}s(oe),i(ne,oe)};z(g,ne=>{e(W)&&ne(N)})}var G=n(g,2),J=o(G);Ge(J,21,()=>e(w),Lt,(ne,oe,ve)=>{const Me=_(()=>_e(ve)),Ae=_(()=>e(Me).find(Te=>Te.startIndex===0));var De=xn(),Le=be(De);{var Ee=Te=>{xe(Te,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-b border-border",onclick:()=>S(ve,e(Ae).startIndex,e(Ae).endIndex),children:(ge,Qe)=>{var Xe=Gt(),Ye=be(Xe);fe(Ye,{get icon(){return ot},class:"h-2.5 w-2.5"});var tt=n(Ye,2),xt=O(tt,!0),rt=n(tt,2);fe(rt,{get icon(){return ot},class:"h-2.5 w-2.5"}),M(ut=>C(xt,ut),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(Ae).count})]),i(ge,Xe)},$$slots:{default:!0}})};z(Le,Te=>{e(Ae)&&Te(Ee)})}var Fe=n(Le,2);Ge(Fe,19,()=>e(oe).lines,(Te,ge)=>`${ve}-${ge}`,(Te,ge,Qe)=>{const Xe=_(()=>`${e(ge).oldNum}-${e(ge).newNum}`),Ye=_(()=>he(e(ge))),tt=_(()=>e(te)===e(Xe)),xt=_(()=>Ne(ve,e(Qe),e(ge))),rt=_(()=>e(Me).find(lt=>lt.startIndex===e(Qe)+1));var ut=Pt(),er=be(ut);{var tr=lt=>{var At=_n(),vt=be(At),gt=o(vt),Et=o(gt),rr=O(Et,!0),nr=n(Et,2),ar=O(nr,!0);s(gt);var bt=n(gt,2),sr=O(bt,!0),zt=n(bt,2),wt=o(zt),Ht=o(wt);Ft(Ht,()=>me(e(ge)),!0),s(Ht),s(wt);var or=n(wt,2);{var ir=Pe=>{{let He=_(()=>Ce.codeReview_fileDiff_askLine_tooltip());xe(Pe,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"size-5 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-primary-ink transition-all shrink-0",onclick:()=>Se(e(Xe)),get title(){return e(He)},children:(je,Be)=>{fe(je,{get icon(){return St}})},$$slots:{default:!0}})}};z(or,Pe=>{P()&&Pe(ir)})}s(zt),s(vt);var Wt=n(vt,2);Ge(Wt,19,()=>e(Ye),(Pe,He)=>`${Pe.line}-${He}`,(Pe,He)=>{var je=mn(),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0),ft=_(()=>Z(e(He)));qt(Be,{get annotation(){return e(He)},get lineNumber(){return e(nt)},get fileName(){return d()},get messages(){return e(ft)},onSendMessage:(kt,yt,$t)=>V(kt,yt,$t),get isSending(){return h()}})}s(je),We(3,je,()=>Oe,()=>({tier:"moderate"})),i(Pe,je)});var Dt=n(Wt,2);{var lr=Pe=>{var He=pn(),je=o(He),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0);Ut(Be,{get lineNumber(){return e(nt)},get fileName(){return d()},onSend:V,onClose:ye,get isSending(){return h()}})}s(je),s(He),i(Pe,He)};z(Dt,Pe=>{e(tt)&&e(Ye).length===0&&Pe(lr)})}var dr=n(Dt,2);{var cr=Pe=>{xe(Pe,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-y border-border bg-muted/10",onclick:()=>S(ve,e(rt).startIndex,e(rt).endIndex),children:(He,je)=>{var Be=Gt(),nt=be(Be);fe(nt,{get icon(){return St},class:"h-2.5 w-2.5"});var ft=n(nt,2),kt=O(ft,!0),yt=n(ft,2);fe(yt,{get icon(){return St},class:"h-2.5 w-2.5"}),M($t=>C(kt,$t),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(rt).count})]),i(He,Be)},$$slots:{default:!0}})};z(dr,Pe=>{e(rt)&&Pe(cr)})}M((Pe,He,je,Be)=>{ze(vt,1,`group flex ${Pe??""} hover:bg-accent/30 transition-colors`),ze(gt,1,`w-20 shrink-0 flex select-none ${He??""} border-r border-border`),C(rr,e(ge).oldNum??""),C(ar,e(ge).newNum??""),ze(bt,1,`w-5 shrink-0 text-center select-none ${je??""}`),C(sr,Be)},[()=>R(e(ge)),()=>ie(e(ge)),()=>A(e(ge)),()=>Y(e(ge))]),i(lt,At)};z(er,lt=>{e(xt)&<(tr)})}i(Te,ut)}),i(ne,De)}),s(J),s(G),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};z(ue,t=>{e(ce)||t(Re)})}return s(re),M(()=>ze(re,1,`walkthrough-file-diff overflow-hidden bg-card ${q()??""}`)),i($,re),qe(ee)}var kn=x('<div class="flex items-start gap-3"><div class="shrink-0 mt-0.5"><svg viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1H8a3 3 0 00-3 3v1.5a1.5 1.5 0 01-3 0V6z" clip-rule="evenodd"></path><path d="M6 12a2 2 0 012-2h8a2 2 0 012 2v2a2 2 0 01-2 2H2h2a2 2 0 002-2v-2z"></path></svg></div> <div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-foreground line-clamp-2"> </h4> <p class="text-xs text-subtle mt-1 line-clamp-2"> </p> <div class="flex items-center gap-1 mt-2 text-xs text-subtle"><svg class="h-3.5 w-3.5" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span> </span></div></div></div>'),yn=x('<div><div class="mb-4"><h3 class="text-sm font-medium text-subtle"> </h3></div> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"></div></div>');function Qt($,r){if(new.target)return Ke({component:Qt,...$});Ue(r,!0);let d=k(r,"categories",7),m=k(r,"onCategoryClick",7),b=k(r,"class",7,"");function u(w){const H=["bg-blue-500/10 border-blue-500/30 hover:border-blue-500/50","bg-purple-500/10 border-purple-500/30 hover:border-purple-500/50","bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50","bg-warning/10 border-warning/30 hover:border-warning/30","bg-rose-500/10 border-rose-500/30 hover:border-rose-500/50","bg-cyan-500/10 border-cyan-500/30 hover:border-cyan-500/50"];return H[w%H.length]}function T(w){const H=["text-blue-500","text-purple-500","text-emerald-500","text-warning-ink","text-rose-500","text-cyan-500"];return H[w%H.length]}var P={get categories(){return d()},set categories(w){d(w),y()},get onCategoryClick(){return m()},set onCategoryClick(w){m(w),y()},get class(){return b()},set class(w=""){b(w),y()},$set:Ve,$on:(w,H)=>Je(r,w,H)},h=yn(),U=o(h),K=o(U),pe=O(K,!0);s(U);var q=n(U,2);return Ge(q,21,d,Lt,(w,H,de)=>{{let ce=_(()=>u(de));xe(w,{type:"button",variant:"ghost",get class(){return`text-left p-4 rounded-lg border transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none ${e(ce)??""}`},onclick:()=>m()?.(de),children:(ae,te)=>{var ke=kn(),I=o(ke),he=O(I),Ne=n(I,2),_e=o(Ne),S=O(_e,!0),E=n(_e,2),Ie=O(E,!0),me=n(E,2),v=n(o(me),2),R=O(v,!0);s(me),s(Ne),s(ke),M((A,Y)=>{ze(he,0,`h-5 w-5 ${A??""}`),C(S,e(H).title),C(Ie,e(H).description),C(R,Y)},[()=>T(de),()=>e(H).files.length===1?Ce.codeReview_categoriesGrid_fileCount_one({count:e(H).files.length}):Ce.codeReview_categoriesGrid_fileCount_many({count:e(H).files.length})]),i(ae,ke)},$$slots:{default:!0}})}}),s(q),s(h),M(w=>{ze(h,1,`walkthrough-categories-grid ${b()??""}`),C(pe,w)},[()=>Ce.codeReview_categoriesGrid_whatChanged_title()]),i($,h),qe(P)}var $n=x('<div class="w-0.5 flex-1 bg-border min-h-5"></div>'),Sn=x('<p class="text-sm text-subtle mt-2"> </p>'),Cn=x('<div class="rounded-lg border border-border bg-card p-4"><div class="flex items-center gap-2"><svg class="h-4 w-4 text-ghost" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span class="text-sm font-medium text-foreground"> </span></div> <!></div>'),Nn=x('<div class="flex gap-4"><div class="relative flex flex-col items-center w-3"><div></div> <div class="absolute top-4 w-2 h-2 rounded-full bg-muted-foreground/30 ring-2 ring-background"></div></div> <div class="flex-1 min-w-0 pb-4"><!></div></div>'),Rn=x('<div><div class="flex items-start gap-4 mb-4"><div class="relative flex flex-col items-center"><div></div> <!></div> <div class="flex-1 min-w-0 -mt-0.5"><h3 class="text-base font-semibold text-foreground"> </h3> <p class="text-sm text-subtle mt-1"> </p></div></div> <div class="relative"></div></div>');function Xt($,r){if(new.target)return Ke({component:Xt,...$});Ue(r,!0);let d=k(r,"category",7),m=k(r,"categoryIndex",7),b=k(r,"filePatchMap",7),u=k(r,"isLast",7,!1),T=k(r,"onSendMessage",7),P=k(r,"isSending",7,!1),h=k(r,"class",7,"");function U(S){const E=["bg-blue-500","bg-purple-500","bg-emerald-500","bg-warning","bg-rose-500","bg-cyan-500"];return E[S%E.length]}const K=_(()=>d().files.map(S=>{const E=b().get(S.path);return{...S,patch:E?.patch,additions:E?.additions??0,deletions:E?.deletions??0}}));var pe={get category(){return d()},set category(S){d(S),y()},get categoryIndex(){return m()},set categoryIndex(S){m(S),y()},get filePatchMap(){return b()},set filePatchMap(S){b(S),y()},get isLast(){return u()},set isLast(S=!1){u(S),y()},get onSendMessage(){return T()},set onSendMessage(S){T(S),y()},get isSending(){return P()},set isSending(S=!1){P(S),y()},get class(){return h()},set class(S=""){h(S),y()},$set:Ve,$on:(S,E)=>Je(r,S,E)},q=Rn(),w=o(q),H=o(w),de=o(H),ce=n(de,2);{var ae=S=>{var E=$n();i(S,E)};z(ce,S=>{(!u()||e(K).length>0)&&S(ae)})}s(H);var te=n(H,2),ke=o(te),I=O(ke,!0),he=n(ke,2),Ne=O(he,!0);s(te),s(w);var _e=n(w,2);return Ge(_e,23,()=>e(K),(S,E)=>`${m()}-${E}`,(S,E,Ie)=>{var me=Nn(),v=o(me),R=o(v);st(2),s(v);var A=n(v,2),Y=o(A);{var ie=Se=>{It(Se,{get fileName(){return e(E).path},get patch(){return e(E).patch},get annotations(){return e(E).annotations},get additions(){return e(E).additions},get deletions(){return e(E).deletions},get fileDescription(){return e(E).summary},get onSendMessage(){return T()},get isSending(){return P()},class:"rounded-lg border border-border overflow-hidden"})},$e=Se=>{var ye=Cn(),V=o(ye),j=n(o(V),2),f=O(j,!0);s(V);var W=n(V,2);{var F=le=>{var a=Sn(),D=O(a,!0);M(()=>C(D,e(E).summary)),i(le,a)};z(W,le=>{e(E).summary&&le(F)})}s(ye),M(()=>C(f,e(E).path)),i(Se,ye)};z(Y,Se=>{e(E).patch?Se(ie):Se($e,-1)})}s(A),s(me),M(()=>ze(R,1,`w-0.5 flex-1 bg-border ${e(Ie)===e(K).length-1&&u()?"h-1/2":""}`)),i(S,me)}),s(_e),s(q),M(S=>{ze(q,1,`walkthrough-category-section ${h()??""}`),Er(q,"id",`category-${m()??""}`),ze(de,1,`w-3 h-3 rounded-full ${S??""} ring-4 ring-background shrink-0`),C(I,d().title),C(Ne,d().description)},[()=>U(m())]),i($,q),qe(pe)}var Mn=x('<!> <!> <span class="text-sm font-medium"> </span> <!>',1),Pn=x('<div class="flex items-center gap-2 text-sm text-subtle py-2"><!> <span> </span></div>'),Ot=x("<!> ",1),Ln=x('<div class="rounded-lg bg-danger-background/10 border border-danger/20 p-4"><p class="text-sm text-danger"> </p> <!></div>'),In=x('<h2 class="text-lg font-semibold text-foreground"> </h2>'),An=x('<p class="text-sm text-subtle italic"> </p>'),Kt=x("<div><!></div>"),En=x('<div class="space-y-8 pt-4"></div>'),zn=x('<!> <!> <span class="text-sm font-medium text-subtle"> </span>',1),Hn=x('<div class="space-y-3 pt-2"></div>'),Wn=x('<div class="pt-4 border-t border-border"><!> <!></div>'),Dn=x('<div class="flex justify-end pt-2"><!></div>'),Tn=x('<div class="space-y-6"><!> <!> <!> <!> <!> <!></div>'),jn=x('<div class="px-4 pb-4"><!> <!> <!></div>'),Fn=x('<div class="border-t border-border"><!> <!></div>');function Yt($,r){if(new.target)return Ke({component:Yt,...$});Ue(r,!0);let d=k(r,"walkthrough",7),m=k(r,"status",7),b=k(r,"workspaceId",7),u=k(r,"error",7,""),T=k(r,"workspacePath",7),P=k(r,"changes",23,()=>[]),h=k(r,"onSendMessage",7),U=k(r,"isSending",7,!1),K=k(r,"onRegenerate",7),pe=k(r,"showCategoriesGrid",7,!0);const q=_(()=>m()==="running"),w=_(()=>m()==="complete"),H=_(()=>!!u());let de=we(!0),ce=we(!1),ae=we(mt(new Map));const te=_(()=>{if(d()?.categories&&d().categories.length>0)return d().categories;if(d()?.annotations&&d().annotations.length>0){const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}return[{title:d().title,description:d().overview,files:Array.from(v.entries()).map(([R,A])=>({path:R,annotations:A.sort((Y,ie)=>Y.line-ie.line)}))}]}return[]}),ke=_(()=>{if(!d()?.annotations)return new Map;const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}for(const[R,A]of v)v.set(R,A.sort((Y,ie)=>Y.line-ie.line));return v}),I=_(()=>{const v=new Set;for(const R of e(te))for(const A of R.files)v.add(A.path);for(const R of e(ke).keys())v.add(R);return v}),he=_(()=>P().filter(v=>!e(I).has(v.relativePath)));Ze(()=>{if(!d()||!T())return;const v=new Set([...e(I),...e(he).map(R=>R.relativePath)]);for(const R of v)e(ae).has(R)||Jr(b(),!0,R).then(A=>{if(A&&A.oldContent!==void 0&&A.newContent!==void 0){const Y=Ne(R,A.oldContent,A.newContent);if(Y){const ie=P().find($e=>$e.relativePath===R);e(ae).set(R,{patch:Y,additions:ie?.stats?.additions??0,deletions:ie?.stats?.deletions??0}),L(ae,new Map(e(ae)),!0)}}}).catch(A=>{console.warn(`Failed to load diff for ${R}:`,A)})});function Ne(v,R,A){const Y=R.split(`
|