@intent-hq/web 2.392.1 → 2.392.3
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/{DotCIVLI.js → -xPMI1SM.js} +1 -1
- package/web/app/immutable/chunks/{x9IQ_8UO.js → 2ZBNrUZy.js} +1 -1
- package/web/app/immutable/chunks/{ByvcSsIj.js → 2bueaerM.js} +1 -1
- package/web/app/immutable/chunks/{AlO3r9jV.js → 4Rh5tdzC.js} +1 -1
- package/web/app/immutable/chunks/{CLX81MHV.js → 6_Ki4zfU.js} +1 -1
- package/web/app/immutable/chunks/{D_YMc8vN.js → 7n-O-xn5.js} +1 -1
- package/web/app/immutable/chunks/{CccfsETL.js → 8ItTOum-.js} +2 -2
- package/web/app/immutable/chunks/{aoX2v33V.js → 9AeivJQm.js} +4 -4
- package/web/app/immutable/chunks/{CngTEvgU.js → A9FjQ4ig.js} +1 -1
- package/web/app/immutable/chunks/{DaTwSOqs.js → B0dqY8Yd.js} +1 -1
- package/web/app/immutable/chunks/{KPBWxwIA.js → B26epB4C.js} +1 -1
- package/web/app/immutable/chunks/B3ZeLze4.js +2 -0
- package/web/app/immutable/chunks/{BSpgPPjp.js → B3sgdO-M.js} +1 -1
- package/web/app/immutable/chunks/{3rqOYBi3.js → B5OK1c9R.js} +1 -1
- package/web/app/immutable/chunks/{OuI4JmWC.js → B5V_Igzh.js} +1 -1
- package/web/app/immutable/chunks/{D0DIeAXH.js → B87xP_ZF.js} +1 -1
- package/web/app/immutable/chunks/{Bwa2n5jC.js → BAbB1JR3.js} +1 -1
- package/web/app/immutable/chunks/{B2frqTj8.js → BC2ymm4x.js} +1 -1
- package/web/app/immutable/chunks/{CUmvnJK5.js → BC7-67A3.js} +1 -1
- package/web/app/immutable/chunks/{KRACSBb9.js → BFMw_Rsu.js} +1 -1
- package/web/app/immutable/chunks/{B97l6Xkk.js → BH56GSiy.js} +1 -1
- package/web/app/immutable/chunks/{CcMCIG6E.js → BHYEUr70.js} +2 -2
- package/web/app/immutable/chunks/{CorT7tdR.js → BLNxuTdw.js} +1 -1
- package/web/app/immutable/chunks/{DQe_5JbW.js → BOnAZ0Bh.js} +1 -1
- package/web/app/immutable/chunks/{CiNmS1jZ.js → BQLNg--d.js} +1 -1
- package/web/app/immutable/chunks/{CdLJ0-dH.js → BRtw-FGJ.js} +1 -1
- package/web/app/immutable/chunks/{BdlwjSpf.js → BSsSTp5c.js} +1 -1
- package/web/app/immutable/chunks/{9AKr1UyY.js → BV3fep4W.js} +1 -1
- package/web/app/immutable/chunks/{C6Af0QaF.js → BWtzEUuh.js} +1 -1
- package/web/app/immutable/chunks/{R3fZBk-k.js → BYanH6N9.js} +1 -1
- package/web/app/immutable/chunks/{vJJtTADX.js → BZNRCsEn.js} +1 -1
- package/web/app/immutable/chunks/{b7gnFN68.js → BafkB9h2.js} +1 -1
- package/web/app/immutable/chunks/BeZe2Rt-.js +4 -0
- package/web/app/immutable/chunks/{DFNKkiho.js → Bex9L_jH.js} +4 -4
- package/web/app/immutable/chunks/{Dp0kLnIL.js → BezBXtqG.js} +1 -1
- package/web/app/immutable/chunks/{DY9w61PC.js → BhD6TCSq.js} +6 -6
- package/web/app/immutable/chunks/{Dvzvnzzu.js → Bhk2u-_3.js} +1 -1
- package/web/app/immutable/chunks/{CGJ5yTzR.js → BipAYtG2.js} +3 -3
- package/web/app/immutable/chunks/{i2Q0D3-m.js → BptF1xOU.js} +1 -1
- package/web/app/immutable/chunks/{CUiYYsIq.js → BrCVQoPE.js} +1 -1
- package/web/app/immutable/chunks/{CJItvMq2.js → BrLVGrLO.js} +1 -1
- package/web/app/immutable/chunks/{50HYkjWD.js → Bsnum5pm.js} +3 -3
- package/web/app/immutable/chunks/{FS0kRzLP.js → BtOGFmaT.js} +1 -1
- package/web/app/immutable/chunks/{z2uEgbos.js → BtmdpA7S.js} +1 -1
- package/web/app/immutable/chunks/{CzK_7_Jd.js → By6WkvE9.js} +1 -1
- package/web/app/immutable/chunks/{DmtYsVlu.js → Bz-Q0sJs.js} +2 -2
- package/web/app/immutable/chunks/{vq6mxGLA.js → BzZzhsx0.js} +1 -1
- package/web/app/immutable/chunks/{DbB491_u.js → C1UoJPr2.js} +1 -1
- package/web/app/immutable/chunks/{oM2TfoNE.js → C2KrJl1V.js} +1 -1
- package/web/app/immutable/chunks/{DTbyG794.js → C3L7kk5u.js} +1 -1
- package/web/app/immutable/chunks/{BJEFEyAm.js → C6O8IM8T.js} +1 -1
- package/web/app/immutable/chunks/{BwFe8eI9.js → C8XfkHlI.js} +1 -1
- package/web/app/immutable/chunks/{KvfW-q1N.js → CCMvmg57.js} +1 -1
- package/web/app/immutable/chunks/CDCAMh6o.js +1 -0
- package/web/app/immutable/chunks/{D8MIwtpL.js → CDUwgFl9.js} +1 -1
- package/web/app/immutable/chunks/{D_R1vNH8.js → CE7ZckmT.js} +1 -1
- package/web/app/immutable/chunks/{gXHlCg5O.js → CKa70XGN.js} +1 -1
- package/web/app/immutable/chunks/{rmHQzJ1a.js → CKzjrq__.js} +1 -1
- package/web/app/immutable/chunks/{DDDvNwR-.js → CN7DE5jB.js} +1 -1
- package/web/app/immutable/chunks/{D-j7vD5Z.js → CNKJ8_Xr.js} +1 -1
- package/web/app/immutable/chunks/{CPNOsHfj.js → CO-JfYA5.js} +1 -1
- package/web/app/immutable/chunks/{CCyGGl6b.js → CPgSaaZt.js} +1 -1
- package/web/app/immutable/chunks/{BVBh582U.js → CQmOm-Tm.js} +1 -1
- package/web/app/immutable/chunks/{DvdITStP.js → CQzFriMx.js} +1 -1
- package/web/app/immutable/chunks/{BlVpCoL1.js → CTGxPVh7.js} +1 -1
- package/web/app/immutable/chunks/{BDRM-DVo.js → CVCwKAMk.js} +1 -1
- package/web/app/immutable/chunks/{DNup87JQ.js → CVG625sB.js} +1 -1
- package/web/app/immutable/chunks/{H8hIaDaV.js → CcUDp4zq.js} +1 -1
- package/web/app/immutable/chunks/{r4dmBxo_.js → Ce20e-vK.js} +1 -1
- package/web/app/immutable/chunks/Ce2Qo9vu.js +3 -0
- package/web/app/immutable/chunks/{PejVYY2W.js → Cf5NbMeL.js} +3 -3
- package/web/app/immutable/chunks/{CY56l_5k.js → CfOrhDjV.js} +1 -1
- package/web/app/immutable/chunks/{DTNrtzyx.js → Cim9mWY1.js} +1 -1
- package/web/app/immutable/chunks/{DIxibpTv.js → Cks1DUg1.js} +1 -1
- package/web/app/immutable/chunks/{CDcxODgf.js → CnDbx_Wj.js} +1 -1
- package/web/app/immutable/chunks/{DznISJQO.js → CnDy2OA4.js} +1 -1
- package/web/app/immutable/chunks/{Bp6DusVC.js → Cp9hDo50.js} +1 -1
- package/web/app/immutable/chunks/{ciQFmiC4.js → Cs3vMbTn.js} +1 -1
- package/web/app/immutable/chunks/{0TbppU-W.js → Ct1r6efw.js} +2 -2
- package/web/app/immutable/chunks/{CpT48V2z.js → Cy5LTcPz.js} +1 -1
- package/web/app/immutable/chunks/{RqSv1iWX.js → CyUokemm.js} +1 -1
- package/web/app/immutable/chunks/{gX9ZnDRD.js → D1Tekuc4.js} +1 -1
- package/web/app/immutable/chunks/{pQalwNsE.js → D2Jd8tc3.js} +1 -1
- package/web/app/immutable/chunks/{Cdw7QKyr.js → D80ng7VB.js} +3 -3
- package/web/app/immutable/chunks/{CWS5g6aA.js → D9OezaF9.js} +1 -1
- package/web/app/immutable/chunks/{BUPWY1pO.js → DDhuJH-4.js} +1 -1
- package/web/app/immutable/chunks/{WWq3hijy.js → DEOVFEjx.js} +1 -1
- package/web/app/immutable/chunks/{Bhul7r_Y.js → DEuuzjmM.js} +1 -1
- package/web/app/immutable/chunks/{DaTkisKB.js → DEykPUjl.js} +1 -1
- package/web/app/immutable/chunks/{DdYVblGk.js → DFh2QzKR.js} +1 -1
- package/web/app/immutable/chunks/{BB5TUToP.js → DGMKnMeG.js} +2 -2
- package/web/app/immutable/chunks/{DEsM7h8K.js → DIHHBzYi.js} +2 -2
- package/web/app/immutable/chunks/{CcBmcC9f.js → DIUdGij-.js} +2 -2
- package/web/app/immutable/chunks/{BTE0066U.js → DJDA_1H4.js} +1 -1
- package/web/app/immutable/chunks/{B0oQ37UY.js → DQxnu3QZ.js} +1 -1
- package/web/app/immutable/chunks/{CEqrck_t.js → DRpk7IAR.js} +1 -1
- package/web/app/immutable/chunks/{a3O-Ns1M.js → DUbqvr_K.js} +1 -1
- package/web/app/immutable/chunks/{BPFSAjsd.js → DVSwhvvP.js} +7 -7
- package/web/app/immutable/chunks/{QKQvZF-2.js → DVqhJMup.js} +2 -2
- package/web/app/immutable/chunks/{CeHL-3WK.js → DWOcsYbU.js} +1 -1
- package/web/app/immutable/chunks/{DuFY1gwd.js → DWurigib.js} +4 -4
- package/web/app/immutable/chunks/{DTco_120.js → D__LL1n8.js} +1 -1
- package/web/app/immutable/chunks/{BS9LmSp_.js → DccCxKmZ.js} +1 -1
- package/web/app/immutable/chunks/{CSzXeH2S.js → DdpYiyRs.js} +1 -1
- package/web/app/immutable/chunks/{7zxUzaYz.js → DeJMgdsa.js} +1 -1
- package/web/app/immutable/chunks/{B9NjB9vD.js → DgzWQmDb.js} +1 -1
- package/web/app/immutable/chunks/{DIME5LWK.js → DimbKbDZ.js} +2 -2
- package/web/app/immutable/chunks/{BvByaKKp.js → DjyYYXwz.js} +1 -1
- package/web/app/immutable/chunks/{CRFyRwf-.js → DlbHdfKY.js} +1 -1
- package/web/app/immutable/chunks/{C7MFACZg.js → DqQqeuqi.js} +1 -1
- package/web/app/immutable/chunks/{BSMi55yC.js → DthJR85Z.js} +1 -1
- package/web/app/immutable/chunks/{BUF0WvAS.js → DtqJUfJC.js} +1 -1
- package/web/app/immutable/chunks/{DYzxLuOL.js → DvXSJM4q.js} +1 -1
- package/web/app/immutable/chunks/{B6wkNYPs.js → DxZIPHU6.js} +1 -1
- package/web/app/immutable/chunks/{Ct0fN4Lt.js → DyrDaCZi.js} +1 -1
- package/web/app/immutable/chunks/{D6EyZ2rd.js → Dz-57yVz.js} +1 -1
- package/web/app/immutable/chunks/{DL__HI6l.js → DzR2lw_C.js} +1 -1
- package/web/app/immutable/chunks/{DUcJILSg.js → ERz1iYnn.js} +1 -1
- package/web/app/immutable/chunks/{C9iwh4F-.js → Egi6fNpS.js} +1 -1
- package/web/app/immutable/chunks/{DdU2snxg.js → FTRClsUK.js} +1 -1
- package/web/app/immutable/chunks/{CBQrOO2t.js → L9YD-wcw.js} +1 -1
- package/web/app/immutable/chunks/{CQClkuxa.js → O8yKLCWC.js} +1 -1
- package/web/app/immutable/chunks/{B9ZgGXDm.js → PAEJNClQ.js} +1 -1
- package/web/app/immutable/chunks/{DA3tGWzX.js → PZ5MSUIU.js} +1 -1
- package/web/app/immutable/chunks/{DqCgFTqN.js → QnRBGtVu.js} +1 -1
- package/web/app/immutable/chunks/{f0WUpIfB.js → RGi81mvu.js} +1 -1
- package/web/app/immutable/chunks/{CA5vNvRD.js → VeOG7xIg.js} +3 -3
- package/web/app/immutable/chunks/XAL8NtHj.js +1 -0
- package/web/app/immutable/chunks/{CPav-V5t.js → YClu3XTz.js} +2 -2
- package/web/app/immutable/chunks/{CtzbB_EQ.js → ZspDMNEv.js} +1 -1
- package/web/app/immutable/chunks/{Cp4SiU7R.js → _aw8AL2s.js} +1 -1
- package/web/app/immutable/chunks/{CRIoGx5T.js → edaGtK2z.js} +1 -1
- package/web/app/immutable/chunks/{Dgvdn_ax.js → g2j4hm88.js} +1 -1
- package/web/app/immutable/chunks/{ZIePA90q.js → gdhW58MB.js} +3 -3
- package/web/app/immutable/chunks/{CPmXQBUf.js → n1INJGMs.js} +1 -1
- package/web/app/immutable/chunks/{BvvIG-FE.js → nUY7GyaZ.js} +1 -1
- package/web/app/immutable/chunks/{C9DStJW1.js → q9gf_Sso.js} +1 -1
- package/web/app/immutable/chunks/{CewZlXwy.js → u-Z99Ptk.js} +1 -1
- package/web/app/immutable/chunks/{BE3g5vcj.js → uQRHnH1Z.js} +1 -1
- package/web/app/immutable/chunks/{Dhs7RSq9.js → wsIl6ydR.js} +1 -1
- package/web/app/immutable/chunks/{C13CRqsS.js → yus24-dF.js} +1 -1
- package/web/app/immutable/chunks/zdzlwKoA.js +1 -0
- package/web/app/immutable/entry/{app.Dh0FLLBd.js → app.DBKLYfDG.js} +2 -2
- package/web/app/immutable/entry/start.DyzI50m5.js +1 -0
- package/web/app/immutable/nodes/{0.BlcS-Hyh.js → 0.Dr_KMFP9.js} +1 -1
- package/web/app/immutable/nodes/{1.BMTchPFq.js → 1.B4UC5y6C.js} +1 -1
- package/web/app/immutable/nodes/{10.CfDNhRgU.js → 10.D-SXaVii.js} +1 -1
- package/web/app/immutable/nodes/{11.CxSRkGHD.js → 11.CD0ZMPB_.js} +1 -1
- package/web/app/immutable/nodes/{15.DCpm4k7K.js → 15.CWhAy0IL.js} +1 -1
- package/web/app/immutable/nodes/{19.C2T81__z.js → 19.Cl4NIDR3.js} +2 -2
- package/web/app/immutable/nodes/{2.1iJIAnw5.js → 2.DgYKd6eT.js} +1 -1
- package/web/app/immutable/nodes/{20.BHRuLw4-.js → 20.gu-VpWFh.js} +1 -1
- package/web/app/immutable/nodes/{3.BDDby9Gq.js → 3.Cz3D2Kq7.js} +1 -1
- package/web/app/immutable/nodes/{4.utfN0vdd.js → 4.CjaUjxEb.js} +1 -1
- package/web/app/immutable/nodes/{5.Z6w8za6J.js → 5.COJH7IAv.js} +1 -1
- package/web/app/immutable/nodes/{6.w_k_ibWb.js → 6.Da5DOHiE.js} +1 -1
- package/web/app/immutable/nodes/{7.I-q-I1bs.js → 7.dcDATK47.js} +1 -1
- package/web/app/immutable/nodes/{8.BgjULPKU.js → 8.C2qio8n9.js} +1 -1
- package/web/app/immutable/nodes/{9.DOkmR0cl.js → 9.CjfzK0IK.js} +2 -2
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/BuM8LV7z.js +0 -4
- package/web/app/immutable/chunks/DejjV5ft.js +0 -1
- package/web/app/immutable/chunks/DivmpPFQ.js +0 -1
- package/web/app/immutable/chunks/DlnCrS3y.js +0 -2
- package/web/app/immutable/chunks/MFTfhUYi.js +0 -1
- package/web/app/immutable/chunks/Xr-aTNRN.js +0 -3
- package/web/app/immutable/entry/start.IMZH36aM.js +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B0SSzYpD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/DP31pjuo.js","/app/immutable/chunks/Bw-Zu1Zf.js","/app/immutable/chunks/BYfDvU8j.js","/app/immutable/chunks/D8cNe_33.js","/app/immutable/chunks/BFO-Le8U.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/ghzRmqKs.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/
|
|
2
|
-
import{JH as n,o8 as I,n_ as g,nZ as k,ms as Z,r1 as Q,iq as ee,of as Ce,mv as te,vY as He,jY as $e,E0 as Be,vt as Ve,qA as ze,mu as Ke,m7 as Je,aU as le,mh as Ye,mn as Xe,yJ as Ze,GD as Qe,D_ as et,Ag as tt,od as st,mx as rt}from"./D0qhIm1r.js";import{selectActiveWorkspaceIds as nt}from"./_IjN0Lbt.js";import{b8 as V,b3 as se,cR as v,cU as ue,cC as at,dI as M,cx as ot,b4 as ct,cS as it,dD as lt,v as de,Z as ut,dF as dt,ch as pt,aw as mt,aG as ht,ao as ft,bQ as St,cO as gt,db as yt,cA as bt,bR as kt}from"./cD292w1o.js";import{x as wt}from"./DejjV5ft.js";import{ag as It,cQ as _t,aZ as vt,av as Ct,p as At}from"./D-j7vD5Z.js";import{h as Rt}from"./B0SSzYpD.js";import{bm as p,_ as q}from"./Fcr7AvC-.js";import{i as w}from"./CL3a4Hm1.js";import{I as Et}from"./Bqd7fdCF.js";import{L as P}from"./s_T1Uukt.js";import{ag as Tt,l as Pt,i as O,a9 as Ot,q as Wt}from"./ByvcSsIj.js";import{c as Nt}from"./ChTqQfQN.js";import{r as x}from"./uXuxG9cN.js";import{j as xt,u as Mt,n as Lt}from"./CH7HNVC2.js";import{u as Dt}from"./BwweojP5.js";import{aq as Ut,p as jt}from"./DlnCrS3y.js";import{M as pe,O as me,h as Ae}from"./BAtAwQ72.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";import{m as qt,p as Ft}from"./MFTfhUYi.js";const ur=n.createSelector(e=>e.workspaceShare.open),dr=n.createSelector(e=>e.workspaceShare.workspaceId),pr=n.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=n.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),mr=n.createSelector(e=>e.workspaceShare.createRequest),hr=n.createSelector(e=>e.workspaceShare.mutationGeneration),fr=n.createSelector(e=>e.workspaceShare.workspaceTitle),Sr=n.createSelector(e=>g(e.workspaceShare.members)),gr=n.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),yr=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),br=n.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),kr=n.createSelector(e=>e.workspaceShare.guestCount),wr=n.createSelector(e=>e.workspaceShare.guestLimit),Ir=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),_r=n.createSelector(e=>e.workspaceShare.loadError),vr=n.createSelector(e=>e.workspaceShare.creating),Cr=n.createSelector(e=>e.workspaceShare.createError),Ar=n.createSelector(e=>e.workspaceShare.createdLink),Rr=n.createSelector(e=>e.workspaceShare.revokingInviteId),Er=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Tr=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Pr=n.createSelector(e=>e.workspaceShare.actionError),Or=n.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Wr=n.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Nr=n.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));n.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const xr=n.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Mr=n.createSelector(e=>e.workspaceShare.integrationAuth),Lr=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=n.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===v.select(e)),Ht=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Dr=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),$t=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Bt=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Ur=n.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&Ht.select(e)===null&&Bt.select(e)===null&&!$t.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),jr=n.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:at.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),Gr=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),qr=n.createSelector(e=>e.workspaceShare.roleErrors),ge=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Vt=n.createSelector(e=>{const t=v.select(e),s=nt.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Fr=n.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),zt=[],Kt=n.createSelector((e,t)=>{const s=v.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return zt;const a=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&k(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Hr=n.createSelector(e=>{const s=Vt.select(e).workspaceIds.flatMap(r=>Kt.select(e,r).map(a=>Date.parse(a.expiresAt)));return s.length?Math.min(...s):null});function $r(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Br=n.createSelector(e=>e.hostRequirements.git),Vr=n.createSelector(e=>e.hostRequirements.node),zr=n.createSelector(e=>e.hostRequirements.gh),Kr=n.createSelector(e=>e.hostRequirements.checking),Jr=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Re(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Yr=n.createSelector(Re),Jt=n.createSelector(e=>!ot.select(e)),Xr=n.createSelector(e=>(e.hostRequirements.node.ok||!Jt.select(e))&&(e.hostRequirements.git.available||Re(e))),Zr=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Qr="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Yt(e.clientId)}function en(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:a}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&a!==s)}}const tn=n.createSelector(e=>e?.browserClients?.ownClientId??null),sn=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const rn=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>k(e.browserClients.liveClients,t));const nn=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),an=n.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const on=n.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),a=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Rt(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),cn=n.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),a=k(r,s.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ln=n.createSelector((e,t,s)=>{const r=e?.browserClients??Q,a=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(a,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),un=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),dn=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function pn(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function mn(e){const t=N.get(e);return t?t():null}function hn(e){N.delete(e)}const Ee="From repo config",fn="repo-config";function Sn(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Te(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Te(t).setupScript}async function gn(e){if(!e)return null;try{const t=await w(Et.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?Xt(s):null}catch{return null}}async function yn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./B0SSzYpD.js").then(c=>c.s);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),a=await r.integrations.githubRepoConfig(e,t,s);return Te(a.config).setupScript}catch{return null}}function bn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function kn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Pe="setup-scripts:last-used-by-repo",Oe="setup-scripts:recent-by-repo",$=20,We=10,Zt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t))r&&Ne(a)&&(s[r]=a);return s}catch{return{}}}function xe(){try{const e=localStorage.getItem(Oe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t)){if(!r||!Array.isArray(a))continue;const o=a.filter(Ne);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function Me(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Le(e){const t=[];for(const s of e)t.some(r=>Qt(r,s))||t.push(s);return t}function wn(e,t){if(!e)return[];const s=ne(e,t),r=xe()[s]??[],a=B()[s];return Le(Me(a?[...r,a]:r)).slice(0,We).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function es(e,t,s){try{const r=xe(),a=r[e]??(s?[s]:[]);r[e]=Le([t,...Me(a)]).slice(0,We);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(o)))}catch{}}function In(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function _n(e,t,s){const r=t.content.trim();if(!e||!r)return;const a=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};es(a,o,B()[a]);try{const c=B();c[a]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(i)))}catch{}}const ts={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},vn=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:ts},Symbol.toStringTag,{value:"Module"})),_={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},ss={async isAuthenticated(e){try{return await w(_.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(_.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(_.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(_.LOGOUT)},async fetchProjects(e){try{return await w(_.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(_.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(_.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(_.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},Cn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:ss},Symbol.toStringTag,{value:"Module"})),ae=n.createSelector(e=>{const t=v.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=n.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),An=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),Rn=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),rs=n.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),En=n.createSelector((e,t)=>{const s=rs.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),Tn="__new-workspace__",Pn="__initializer__",On="compact-workspace-initializer-state-prompt",Wn="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function Nn(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let a=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(a+i>U){o+=1;continue}r.push(c),a+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const ns="host.providerAuthStatus";function as(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function os(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function cs(e){const{email:t,orgName:s}=e??{};return t&&s?os(t,s)?t:`${t} · ${s}`:t||s||void 0}function is(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},a=cs(s.identity);a!==void 0&&(r.authDetails=a),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const ls=6e4,R=new Map,j=new Map,A=new Map;let F=0,De=0;const us=e=>JSON.stringify([it.select(n.state),De,e.workspaceId??null,e.providerId??"*"]);function ds(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of R.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&R.delete(t)}else R.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(ds(e)??"")&&J()});typeof me=="function"&&me(()=>{De+=1,J()});function ps(e={}){const t=us(e);if(e.force)J(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const s=j.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),ps({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,a=Ae(ns,as(e)).then(is).then(o=>(r===F&&R.set(t,{verdicts:o,expiresAt:Date.now()+ls}),o)).finally(()=>{j.get(t)?.promise===a&&j.delete(t)});return j.set(t,{generation:r,promise:a}),a}function xn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ms=n.createSelector((e,t,s)=>{const r=Ce(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});n.createSelector((e,t,s)=>{const r=ms.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Mn=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=Ce(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(a=>a.context):[],unavailableReason:s.unavailableReason}}),Ln=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Dn=n.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===v.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Un=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),jn=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),be={auggie:"npm install -g @augmentcode/auggie","claude-code":"curl -fsSL https://claude.ai/install.sh | bash",codex:"npm i -g @openai/codex",opencode:"curl -fsSL https://opencode.ai/install | bash",droid:"curl -fsSL https://app.factory.ai/cli | sh",grok:"npm i -g @xai-official/grok",cursor:"curl https://cursor.com/install -fsS | bash",dsh:"npm i -g @deepseek-ai/dsh",cortex:"curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh"};function Gn(e){return Object.hasOwn(be,e)?be[e]:void 0}const hs=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){const t=new Set(hs);return fs(e).some(s=>t.has(s))}const gs=new Set(["lastActivity","statusMessage","statusImageAssetId"]),ys=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function bs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ks(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function ws(e){const t=ks(e);return!t||Ss(t)?!1:!bs(t).some(s=>ys.has(s))}function Is(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>gs.has(r))}function h(e){return typeof e=="string"?e.trim():""}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ke(e){const t=E(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function _s(e){const t=E(e.data),s={workspaceId:e.workspaceId,closable:!0},r=a=>a?{...s,type:"note",noteId:a,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=h(t.agentId)||h(e.sessionId);return a?{...s,type:"agent",agentId:a,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=h(t.path)||h(t.relativePath);return a&&t.action!=="delete"?{...s,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=h(t.commit),o=h(t.gitRootId);return a?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function we(e,t){const s=E(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?a(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return ws(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(Is(e))return null;const c=E(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function vs(e,t,s,r){const a=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=E(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=ke(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=E(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Fe=S?h(f.messageId):"",T=S?ke(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?a.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=we(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):we(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:_s(u),messageId:Fe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const qn=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fn=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cs=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Hn=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),$n=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Bn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Vn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),Ue=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),zn=n.createSelector((e,t)=>Object.values(Ue.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Kn=n.createSelector((e,t,s)=>{const r=Cs.select(e,t),o=vs(t,r,_t.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=Ue.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})});function Jn(e,t=e,s="default",r,a){if(!Dt.select(n.state))return;const o=a??xt.select(n.state,t)??Mt.select(n.state,t)[0];if(!o)return;const c=Lt.select(n.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>He(m,i));s==="new"&&n.dispatch($e(e)),n.dispatch(l?Be(t,l.id,o):Ve(t,i,o,void 0,!0,void 0,!0))}const Yn=n.createSelector((e,t)=>{const s=[],r=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[ze(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),As=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ke),Rs=n.createSelector((e,t)=>g(As.select(e,t).items)),Xn=n.createSelector((e,t)=>Rs.select(e,t).filter(s=>!s.parentNoteId)),Zn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??je),Qn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??je),je={},ea=n.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=n.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),ta=n.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),sa=n.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function Ie(e){return e.title||`PR #${e.number}`}const oe=n.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function Es(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Ts(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const ra=n.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Ts);return s?[Es(s),...r]:r}),na=n.createSelector((e,t)=>oe.select(e,t).length>0),aa=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Ps=n.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Je).operations,s)),oa=n.createSelector((e,t,s)=>Ps.select(e,t,s)?.status==="running"),ca=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ia=n.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(a=>a.status===le.Open||a.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),la=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ua=n.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),a=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=vt(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),Ie,o),yt.select(e,t),o,oe.select(e,t),Ie).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Ut.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&r[0]?.hash&&a.mergeHeadSha!==r[0].hash)}}),da=n.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Ye),Os=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Xe);n.createSelector((e,t,s)=>Os.select(e,t).operations[s]);const pa=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),ma=n.createSelector(e=>e.noteReadTracking.readRecords),Ws="host.providerTestPrompt",Ns=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),xs=3e5;async function ha(e){const t=await Ae(Ws,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xs}),s=Ns.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Ms=-1,Ls=/^remote-script-lost:\s*/,Ds=["idle","starting","running","restarting","exited"],_e=e=>!!e&&typeof e=="object"&&!Array.isArray(e),ve=e=>typeof e=="string"&&e.trim().length>0;function Us(e){return _e(e)&&ve(e.remoteAgentId)&&ve(e.nodeId)&&_e(e.runtime)&&Ds.includes(e.runtime.status)}function fa(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Us):[]}function Sa(e,t,s){const r=qt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const a=t?.nodeId===e.nodeId?t:null;return{...r,name:a?.nodeName?.trim()||r.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function js(e){return e.status==="exited"&&e.exitCode===Ms}function Gs(e){const t=e.error?.trim().replace(Ls,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ga(e){if(js(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gs(e)})};const t=jt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const G=e=>typeof e=="string"&&e.length>0,qs=/\bremote-script-agent-ending:/;function ya(e){return!!e&&qs.test(e)}function ba(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...G(s.machineVersion)?{machineVersion:s.machineVersion}:{},...G(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return G(c.route)&&G(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ka(e){const s=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Fs={status:"idle",error:null},Hs=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Fs);n.createSelector((e,t)=>Hs.select(e,t).error);const wa=n.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),qe=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$s=e=>e==="hydrated"||e==="live",Ia=n.createSelector((e,t)=>{const s=qe.select(e,t);return s==="hydrated"||s==="live"}),_a=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>$s(t[s]))}),va=n.createSelector((e,t)=>qe.select(e,t)==="live");function Ca(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:a}=e;if(!t)return;const o=s&&Ze(s)===t?s:t;if(!(!r&&o===s))return a(Qe({providerId:t,enabled:!0})),a(et(o)),a(tt()),t}function Aa(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const a=[];if(a.push(`[${s.identifier}] ${s.title}`),s.url&&a.push(`URL: ${s.url}`),s.description&&a.push(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B0SSzYpD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/DP31pjuo.js","/app/immutable/chunks/Bw-Zu1Zf.js","/app/immutable/chunks/BYfDvU8j.js","/app/immutable/chunks/D8cNe_33.js","/app/immutable/chunks/BFO-Le8U.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/ghzRmqKs.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/ZspDMNEv.js","/app/immutable/chunks/B3ZeLze4.js","/app/immutable/chunks/cD292w1o.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BeZe2Rt-.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/CDCAMh6o.js","/app/immutable/chunks/8ItTOum-.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/BafkB9h2.js","/app/immutable/chunks/2bueaerM.js","/app/immutable/chunks/CNKJ8_Xr.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/D4WPlvMg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{JH as n,o8 as I,n_ as g,nZ as k,ms as Z,r1 as Q,iq as ee,of as Ce,mv as te,vY as He,jY as $e,E0 as Be,vt as Ve,qA as ze,mu as Ke,m7 as Je,aU as le,mh as Ye,mn as Xe,yJ as Ze,GD as Qe,D_ as et,Ag as tt,od as st,mx as rt}from"./D0qhIm1r.js";import{selectActiveWorkspaceIds as nt}from"./_IjN0Lbt.js";import{b8 as V,b3 as se,cR as v,cU as ue,cC as at,dI as M,cx as ot,b4 as ct,cS as it,dD as lt,v as de,Z as ut,dF as dt,ch as pt,aw as mt,aG as ht,ao as ft,bQ as St,cO as gt,db as yt,cA as bt,bR as kt}from"./cD292w1o.js";import{x as wt}from"./CDCAMh6o.js";import{ag as It,cQ as _t,aZ as vt,av as Ct,p as At}from"./CNKJ8_Xr.js";import{h as Rt}from"./B0SSzYpD.js";import{bm as p,_ as q}from"./Fcr7AvC-.js";import{i as w}from"./CL3a4Hm1.js";import{I as Et}from"./Bqd7fdCF.js";import{L as P}from"./s_T1Uukt.js";import{ag as Tt,l as Pt,i as O,a9 as Ot,q as Wt}from"./2bueaerM.js";import{c as Nt}from"./ChTqQfQN.js";import{r as x}from"./uXuxG9cN.js";import{j as xt,u as Mt,n as Lt}from"./CH7HNVC2.js";import{u as Dt}from"./BwweojP5.js";import{aq as Ut,p as jt}from"./B3ZeLze4.js";import{M as pe,O as me,h as Ae}from"./BAtAwQ72.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";import{m as qt,p as Ft}from"./XAL8NtHj.js";const ur=n.createSelector(e=>e.workspaceShare.open),dr=n.createSelector(e=>e.workspaceShare.workspaceId),pr=n.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=n.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),mr=n.createSelector(e=>e.workspaceShare.createRequest),hr=n.createSelector(e=>e.workspaceShare.mutationGeneration),fr=n.createSelector(e=>e.workspaceShare.workspaceTitle),Sr=n.createSelector(e=>g(e.workspaceShare.members)),gr=n.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),yr=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),br=n.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),kr=n.createSelector(e=>e.workspaceShare.guestCount),wr=n.createSelector(e=>e.workspaceShare.guestLimit),Ir=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),_r=n.createSelector(e=>e.workspaceShare.loadError),vr=n.createSelector(e=>e.workspaceShare.creating),Cr=n.createSelector(e=>e.workspaceShare.createError),Ar=n.createSelector(e=>e.workspaceShare.createdLink),Rr=n.createSelector(e=>e.workspaceShare.revokingInviteId),Er=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Tr=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Pr=n.createSelector(e=>e.workspaceShare.actionError),Or=n.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Wr=n.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Nr=n.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));n.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const xr=n.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Mr=n.createSelector(e=>e.workspaceShare.integrationAuth),Lr=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=n.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===v.select(e)),Ht=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Dr=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),$t=n.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Bt=n.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Ur=n.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&Ht.select(e)===null&&Bt.select(e)===null&&!$t.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),jr=n.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:at.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),Gr=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),qr=n.createSelector(e=>e.workspaceShare.roleErrors),ge=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Vt=n.createSelector(e=>{const t=v.select(e),s=nt.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Fr=n.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),zt=[],Kt=n.createSelector((e,t)=>{const s=v.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return zt;const a=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&k(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Hr=n.createSelector(e=>{const s=Vt.select(e).workspaceIds.flatMap(r=>Kt.select(e,r).map(a=>Date.parse(a.expiresAt)));return s.length?Math.min(...s):null});function $r(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Br=n.createSelector(e=>e.hostRequirements.git),Vr=n.createSelector(e=>e.hostRequirements.node),zr=n.createSelector(e=>e.hostRequirements.gh),Kr=n.createSelector(e=>e.hostRequirements.checking),Jr=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Re(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Yr=n.createSelector(Re),Jt=n.createSelector(e=>!ot.select(e)),Xr=n.createSelector(e=>(e.hostRequirements.node.ok||!Jt.select(e))&&(e.hostRequirements.git.available||Re(e))),Zr=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Qr="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Yt(e.clientId)}function en(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:a}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&a!==s)}}const tn=n.createSelector(e=>e?.browserClients?.ownClientId??null),sn=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const rn=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>k(e.browserClients.liveClients,t));const nn=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),an=n.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const on=n.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),a=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Rt(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),cn=n.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),a=k(r,s.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ln=n.createSelector((e,t,s)=>{const r=e?.browserClients??Q,a=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(a,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),un=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),dn=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function pn(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function mn(e){const t=N.get(e);return t?t():null}function hn(e){N.delete(e)}const Ee="From repo config",fn="repo-config";function Sn(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Te(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Te(t).setupScript}async function gn(e){if(!e)return null;try{const t=await w(Et.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?Xt(s):null}catch{return null}}async function yn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./B0SSzYpD.js").then(c=>c.s);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url),a=await r.integrations.githubRepoConfig(e,t,s);return Te(a.config).setupScript}catch{return null}}function bn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function kn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Pe="setup-scripts:last-used-by-repo",Oe="setup-scripts:recent-by-repo",$=20,We=10,Zt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t))r&&Ne(a)&&(s[r]=a);return s}catch{return{}}}function xe(){try{const e=localStorage.getItem(Oe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,a]of Object.entries(t)){if(!r||!Array.isArray(a))continue;const o=a.filter(Ne);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function Me(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Le(e){const t=[];for(const s of e)t.some(r=>Qt(r,s))||t.push(s);return t}function wn(e,t){if(!e)return[];const s=ne(e,t),r=xe()[s]??[],a=B()[s];return Le(Me(a?[...r,a]:r)).slice(0,We).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function es(e,t,s){try{const r=xe(),a=r[e]??(s?[s]:[]);r[e]=Le([t,...Me(a)]).slice(0,We);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Oe,JSON.stringify(Object.fromEntries(o)))}catch{}}function In(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function _n(e,t,s){const r=t.content.trim();if(!e||!r)return;const a=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};es(a,o,B()[a]);try{const c=B();c[a]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(i)))}catch{}}const ts={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},vn=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:ts},Symbol.toStringTag,{value:"Module"})),_={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},ss={async isAuthenticated(e){try{return await w(_.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(_.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(_.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(_.LOGOUT)},async fetchProjects(e){try{return await w(_.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(_.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(_.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(_.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},Cn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:ss},Symbol.toStringTag,{value:"Module"})),ae=n.createSelector(e=>{const t=v.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=n.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),An=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),Rn=n.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),rs=n.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),En=n.createSelector((e,t)=>{const s=rs.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),Tn="__new-workspace__",Pn="__initializer__",On="compact-workspace-initializer-state-prompt",Wn="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function Nn(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let a=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(a+i>U){o+=1;continue}r.push(c),a+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const ns="host.providerAuthStatus";function as(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function os(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function cs(e){const{email:t,orgName:s}=e??{};return t&&s?os(t,s)?t:`${t} · ${s}`:t||s||void 0}function is(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},a=cs(s.identity);a!==void 0&&(r.authDetails=a),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const ls=6e4,R=new Map,j=new Map,A=new Map;let F=0,De=0;const us=e=>JSON.stringify([it.select(n.state),De,e.workspaceId??null,e.providerId??"*"]);function ds(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of R.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&R.delete(t)}else R.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(ds(e)??"")&&J()});typeof me=="function"&&me(()=>{De+=1,J()});function ps(e={}){const t=us(e);if(e.force)J(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const s=j.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),ps({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,a=Ae(ns,as(e)).then(is).then(o=>(r===F&&R.set(t,{verdicts:o,expiresAt:Date.now()+ls}),o)).finally(()=>{j.get(t)?.promise===a&&j.delete(t)});return j.set(t,{generation:r,promise:a}),a}function xn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ms=n.createSelector((e,t,s)=>{const r=Ce(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});n.createSelector((e,t,s)=>{const r=ms.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Mn=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=Ce(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(a=>a.context):[],unavailableReason:s.unavailableReason}}),Ln=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Dn=n.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===v.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Un=n.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),jn=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),be={auggie:"npm install -g @augmentcode/auggie","claude-code":"curl -fsSL https://claude.ai/install.sh | bash",codex:"npm i -g @openai/codex",opencode:"curl -fsSL https://opencode.ai/install | bash",droid:"curl -fsSL https://app.factory.ai/cli | sh",grok:"npm i -g @xai-official/grok",cursor:"curl https://cursor.com/install -fsS | bash",dsh:"npm i -g @deepseek-ai/dsh",cortex:"curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh"};function Gn(e){return Object.hasOwn(be,e)?be[e]:void 0}const hs=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){const t=new Set(hs);return fs(e).some(s=>t.has(s))}const gs=new Set(["lastActivity","statusMessage","statusImageAssetId"]),ys=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function bs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ks(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function ws(e){const t=ks(e);return!t||Ss(t)?!1:!bs(t).some(s=>ys.has(s))}function Is(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>gs.has(r))}function h(e){return typeof e=="string"?e.trim():""}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ke(e){const t=E(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function _s(e){const t=E(e.data),s={workspaceId:e.workspaceId,closable:!0},r=a=>a?{...s,type:"note",noteId:a,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=h(t.agentId)||h(e.sessionId);return a?{...s,type:"agent",agentId:a,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=h(t.path)||h(t.relativePath);return a&&t.action!=="delete"?{...s,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=h(t.commit),o=h(t.gitRootId);return a?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function we(e,t){const s=E(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?a(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return ws(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(Is(e))return null;const c=E(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function vs(e,t,s,r){const a=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=E(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=ke(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=E(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Fe=S?h(f.messageId):"",T=S?ke(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?a.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=we(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):we(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:_s(u),messageId:Fe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const qn=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fn=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cs=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Hn=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),$n=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Bn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Vn=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),Ue=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),zn=n.createSelector((e,t)=>Object.values(Ue.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Kn=n.createSelector((e,t,s)=>{const r=Cs.select(e,t),o=vs(t,r,_t.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=Ue.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})});function Jn(e,t=e,s="default",r,a){if(!Dt.select(n.state))return;const o=a??xt.select(n.state,t)??Mt.select(n.state,t)[0];if(!o)return;const c=Lt.select(n.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>He(m,i));s==="new"&&n.dispatch($e(e)),n.dispatch(l?Be(t,l.id,o):Ve(t,i,o,void 0,!0,void 0,!0))}const Yn=n.createSelector((e,t)=>{const s=[],r=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[ze(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),As=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ke),Rs=n.createSelector((e,t)=>g(As.select(e,t).items)),Xn=n.createSelector((e,t)=>Rs.select(e,t).filter(s=>!s.parentNoteId)),Zn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??je),Qn=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??je),je={},ea=n.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=n.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),ta=n.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),sa=n.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function Ie(e){return e.title||`PR #${e.number}`}const oe=n.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function Es(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Ts(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const ra=n.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Ts);return s?[Es(s),...r]:r}),na=n.createSelector((e,t)=>oe.select(e,t).length>0),aa=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Ps=n.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Je).operations,s)),oa=n.createSelector((e,t,s)=>Ps.select(e,t,s)?.status==="running"),ca=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ia=n.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(a=>a.status===le.Open||a.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),la=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ua=n.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),a=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=vt(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),Ie,o),yt.select(e,t),o,oe.select(e,t),Ie).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Ut.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&r[0]?.hash&&a.mergeHeadSha!==r[0].hash)}}),da=n.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Ye),Os=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Xe);n.createSelector((e,t,s)=>Os.select(e,t).operations[s]);const pa=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),ma=n.createSelector(e=>e.noteReadTracking.readRecords),Ws="host.providerTestPrompt",Ns=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),xs=3e5;async function ha(e){const t=await Ae(Ws,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xs}),s=Ns.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Ms=-1,Ls=/^remote-script-lost:\s*/,Ds=["idle","starting","running","restarting","exited"],_e=e=>!!e&&typeof e=="object"&&!Array.isArray(e),ve=e=>typeof e=="string"&&e.trim().length>0;function Us(e){return _e(e)&&ve(e.remoteAgentId)&&ve(e.nodeId)&&_e(e.runtime)&&Ds.includes(e.runtime.status)}function fa(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Us):[]}function Sa(e,t,s){const r=qt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const a=t?.nodeId===e.nodeId?t:null;return{...r,name:a?.nodeName?.trim()||r.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function js(e){return e.status==="exited"&&e.exitCode===Ms}function Gs(e){const t=e.error?.trim().replace(Ls,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ga(e){if(js(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gs(e)})};const t=jt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const G=e=>typeof e=="string"&&e.length>0,qs=/\bremote-script-agent-ending:/;function ya(e){return!!e&&qs.test(e)}function ba(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...G(s.machineVersion)?{machineVersion:s.machineVersion}:{},...G(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return G(c.route)&&G(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ka(e){const s=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Fs={status:"idle",error:null},Hs=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Fs);n.createSelector((e,t)=>Hs.select(e,t).error);const wa=n.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),qe=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$s=e=>e==="hydrated"||e==="live",Ia=n.createSelector((e,t)=>{const s=qe.select(e,t);return s==="hydrated"||s==="live"}),_a=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>$s(t[s]))}),va=n.createSelector((e,t)=>qe.select(e,t)==="live");function Ca(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:a}=e;if(!t)return;const o=s&&Ze(s)===t?s:t;if(!(!r&&o===s))return a(Qe({providerId:t,enabled:!0})),a(et(o)),a(tt()),t}function Aa(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const a=[];if(a.push(`[${s.identifier}] ${s.title}`),s.url&&a.push(`URL: ${s.url}`),s.description&&a.push(`
|
|
3
3
|
Description:
|
|
4
4
|
${s.description}`),r.state&&a.push(`Status: ${r.state}`),r.teamName&&a.push(`Team: ${r.teamName}`),r.priority!==void 0){const o=["No priority","Urgent","High","Medium","Low"];a.push(`Priority: ${o[r.priority]||r.priority}`)}r.assignee&&a.push(`Assignee: ${r.assignee}`),t.push({type:s.itemType||"unknown",provider:s.provider,identifier:s.identifier,title:s.title,url:s.url,content:a.join(`
|
|
5
|
-
`),metadata:r})}return t}function Ra(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const a=s.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(r=a)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function Ea(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:a}=await q(async()=>{const{terminalManager:l}=await import("./DP31pjuo.js").then(m=>m.b);return{terminalManager:l}},__vite__mapDeps([22,3,2,18,19,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await a.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(a){t?.warn("[OnboardingContext] Failed to read terminal buffer:",a)}if(r.type==="script")try{const{selectScriptById:a,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./
|
|
5
|
+
`),metadata:r})}return t}function Ra(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const a=s.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(r=a)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function Ea(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:a}=await q(async()=>{const{terminalManager:l}=await import("./DP31pjuo.js").then(m=>m.b);return{terminalManager:l}},__vite__mapDeps([22,3,2,18,19,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,20,21,23,24,25,26,27,28,29,30,31,32]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await a.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(a){t?.warn("[OnboardingContext] Failed to read terminal buffer:",a)}if(r.type==="script")try{const{selectScriptById:a,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./ZspDMNEv.js");return{selectScriptById:S,selectScriptRuntime:b}},__vite__mapDeps([33,4,5,3,6,7,8,9,2,10,11,12,34,35,21,36,37,38,15,16,39,13,14,17,30,40,41,19,18,42,43,44,45,1,46,47]),import.meta.url),{readScriptContextOutputLines:c}=await q(async()=>{const{readScriptContextOutputLines:S}=await import("./BafkB9h2.js");return{readScriptContextOutputLines:S}},__vite__mapDeps([48,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,49,35,36,37,38,39,30,40,50,34,41,42,43,44,45,46,47,51,52,53,54,55,56,57,58,59,60,61,33]),import.meta.url),i=r.meta?.workspaceId||"",l=r.id??"",m=n.state,y=await c(m,i,l),u=a.select(m,i,l),d=o.select(m,i,l);let f=`Script: ${u?.name||r.label}
|
|
6
6
|
`;if(f+=`Command: ${u?.command||"unknown"}
|
|
7
7
|
`,f+=`Status: ${d.status}`,d.exitCode!==null&&d.exitCode!==void 0&&(f+=` (exit code: ${d.exitCode})`),f+=`
|
|
8
8
|
`,d.detectedUrl&&(f+=`URL: ${d.detectedUrl}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as k1}from"./
|
|
1
|
+
import{g as k1}from"./n1INJGMs.js";import{g as E1}from"./DlbHdfKY.js";import{s as C1}from"./edaGtK2z.js";import{b as k,a$ as t1,ay as oe,X as Ce,a1 as S1,aP as x1,bh as Gt,a_ as T1,aZ as D1,b0 as _1,V as v1,U as F1,Y as V1,z as I1,ax as s1,J as i1,as as L1,$ as Rt,aW as Ot,r as B1,N as M1,am as y1,aU as w1,ab as N1,x as R1,aT as O1,p as P1}from"./Bex9L_jH.js";import{c as G1}from"./DjyYYXwz.js";import{aR as U1}from"./CNKJ8_Xr.js";var tt={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},j1=new Set([tt.SHAPE_UNSUPPORTED,tt.SHAPE_REMOVED,tt.CONTAINMENT_VIOLATION]);new Set(Object.values(tt).filter(s=>!j1.has(s)));var z1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["lean_right","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),W1=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),K1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),$e="roundedRect";function et(s){return s&&(z1.get(s)??s)}k(et,"resolveShapeAlias");function r1(s,i){for(const n of s)if(!n.isGroup){if((!n.shape||n.shape==="squareRect"||n.shape==="rect")&&(n.shape=$e),W1.has(n.shape)){const r=`shape "${n.shape}" was removed in v0.8.1, using "${$e}"`;i?.emitError?i.emitError("SHAPE_REMOVED",r,{nodeId:n.id}):oe.warn(`agentflow: ${r}`),n.shape=$e;continue}if(!K1.has(n.shape)){const r=`shape "${n.shape}" is not supported, using "${$e}"`;i?.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",r,{nodeId:n.id}):oe.warn(`agentflow: ${r}`),n.shape=$e}}}k(r1,"normaliseNodeShapes");var Lt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),a1=Lt.size,o1=k(s=>`af-kind-${s}`,"kindClass"),H1=[...Lt.keys()],u1=k(s=>Math.max(1,s-a1),"containerSlotCount"),l1=k((s,i)=>{const n=a1+s%u1(i);return i>0?n%i:n},"containerSlot");function c1(s,i,n){const r=Ce().themeVariables?.borderColorArray,u=Array.isArray(r)?r.length:0;let l=n.size;for(const c of s??[]){if(c.isGroup||c.shape==="collapsedGroup"){const h=n.get(String(c.id))??l++;c.colorIndex=l1(h,u);continue}const a=i(String(c.id));a&&Lt.has(a)&&(c.cssClasses=`${c.cssClasses??""} ${o1(a)}`.replace(/\s+/g," ").trim())}}k(c1,"assignColorSlots");var n1="agentflow-",Pt=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),Y1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),q1={flow:"flowGroup"};function It(s){if(Array.isArray(s))return s.map(n=>It(n));if(s===null||typeof s!="object")return s;const i={};for(const n of Object.keys(s))n==="__proto__"||n==="constructor"||n==="prototype"||(i[n]=It(s[n]));return i}k(It,"stripPrototypeKeys");function d1(s){let i=!1,n=!1,r=0,u;const l=[];for(const c of s.split(`
|
|
2
2
|
`)){if(u!==void 0){const p=c.length-c.trimStart().length;if(c.trim()===""||p>u){l.push(c);continue}u=void 0}let a=-1;for(let p=0;p<c.length;p++){const A=c[p];if(n)A==="\\"?p++:A==='"'&&(n=!1);else if(i)A==="'"&&(i=!1);else if(A==='"')n=!0;else if(A==="'")i=!0;else if(A==="#"&&(p===0||c[p-1]===" "||c[p-1]===" ")){a=p;break}else A==="["||A==="{"?r++:(A==="]"||A==="}")&&(r=Math.max(0,r-1))}if(i||n||r>0){l.push(c);continue}const h=a>=0?c.slice(0,a):c,g=a>=0?c.slice(a):"";if(/:\s*[>|][\d+-]*\s*$/.test(h)){u=c.length-c.trimStart().length,l.push(c);continue}l.push(h.replace(/,([\t ]*)$/,"$1")+g)}return l.join(`
|
|
3
3
|
`)}k(d1,"stripLineTrailingCommas");var Ze,X1=(Ze=class{constructor(){this.vertexCounter=0,this.config=Ce(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=T1,this.setAccDescription=D1,this.setDiagramTitle=_1,this.getAccTitle=v1,this.getAccDescription=F1,this.getDiagramTitle=V1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return I1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const n of this.vertices.values())if(n.id===i)return this.diagramId?`${this.diagramId}-${n.domId}`:n.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,n,r,u,l,c,a={},h,g){if(!i||i.trim().length===0)return;let p;if(h!==void 0){let m;h.includes(`
|
|
4
4
|
`)?m=h+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as le}from"./CPNOsHfj.js";import{p as he}from"./CSzXeH2S.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"./DFNKkiho.js";import{p as Ee}from"./BBfR26V0.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"./CO-JfYA5.js";import{p as he}from"./DdpYiyRs.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"./Bex9L_jH.js";import{p as Ee}from"./BBfR26V0.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{k as qa,s as fa}from"./
|
|
1
|
+
import{k as qa,s as fa}from"./BzZzhsx0.js";import{p as ma,g as Ct,I as Wa,X as Qa,e as En}from"./CA6H1-bp.js";import{aB as Ga,cX as Ka,A as Va,a_ as xn,bZ as Xa,v as Ya}from"./CNKJ8_Xr.js";import{bm as c,t as Pt,bo as w,bw as Tt,b as Rt,bq as qn,bs as Re,br as Ja}from"./Fcr7AvC-.js";import{bo as Wn,bs as Ot,a5 as O,bl as U,bS as b,bA as $,b_ as x,aD as e,W as l,ay as H,a7 as Oe,bO as L,bn as Lt,c9 as u,aA as k,aB as _,ca as ze,bH as h,b$ as Qt,bV as le,cd as Mt,br as va,be as un,c5 as Za,bi as Nn,bj as er,bf as hn,am as ta,ax as na,ai as tr,aj as nr,c0 as ar}from"./3SdAC2_C.js";import{i as M}from"./BhYXv0ZM.js";import{t as _a}from"./CWfjuhY2.js";import{e as rr}from"./iMqZaR5X.js";import{s as q,g as en,f as ve,b as sr}from"./BRCr02in.js";import{a as or,n as ha}from"./CxR-pcVt.js";import{r as ir,o as lr,A as aa,L as dr}from"./YClu3XTz.js";import{t as Dn}from"./DAsc1V4f.js";import{R as ra}from"./DkQdSPDN.js";import{I as ba}from"./C3KgmGxd.js";import"./x4bPxhVW.js";import{aO as wn,cN as ur,ax as cr,aM as pr,cH as gr,cI as fr,as as mr,au as vr,aC as _r,aI as hr,s as br,O as wr,e9 as kr,X as xr,cy as yr,c4 as $r}from"./cD292w1o.js";import{JH as J,cq as zn,co as wa,cr as kn,rw as Ar,E3 as Sr,fV as ka,E8 as Ir,bF as Cr,Ae as Pr,mP as sa,us as Tr,cu as Rr,v1 as oa,nM as Or,DP as Lr,E6 as Er,cc as Nr}from"./D0qhIm1r.js";import{A as Dr,b as Mr}from"./6_Ki4zfU.js";import{y as Fr}from"./Bqd7fdCF.js";import{l as zr}from"./Cim9mWY1.js";import{f as ia}from"./B5V_Igzh.js";import{h as Br,g as jr}from"./2OP7IVCM.js";import{o as Hr,S as Ur}from"./Cf5NbMeL.js";import"./BzXQ5SMs.js";import{ae as qr,ah as Wr,f as Mn,a1 as Qr}from"./Beq_QLuz.js";import{h as Gr,F as la}from"./BAtAwQ72.js";import"./O5ZlQHf9.js";import{C as Kr,k as Vr,j as Xr,i as Yr}from"./D7KhILhs.js";import{L as Jr}from"./BpFxCD0b.js";import{c as de}from"./2z64ELW5.js";import{c as Bn,b as da,d as jn,a as Hn,A as xa}from"./Ce2Qo9vu.js";import{l as Wt,b as Zr}from"./C7b3vXLD.js";import{F as es,bb as ts}from"./B3ZeLze4.js";import{D as ns}from"./DcrCEeFN.js";import{b as as}from"./Ch9YoFhc.js";import{T as rs}from"./BQ5x_RaT.js";import"./lK1e5NlM.js";import{cl as ya,cP as ss,cO as os,bR as is,M as ls,F as yn,b5 as ds,au as us,aK as cs,aG as ps,cT as gs,be as fs,aA as ms,aL as vs,b1 as _s,ah as ua,a8 as hs,c6 as bs,ag as ws,cF as ks,an as xs,cS as ys,aD as $s}from"./ChHRVjww.js";import{b as As}from"./Dn334wJv.js";import"./Cz3WzTlQ.js";import{S as bn}from"./BnnKw3Va.js";import{E as Ss}from"./B8m3-qrW.js";import"./CpK0xLH4.js";import{f as Is}from"./BDQvAsU6.js";import{P as Cs}from"./B2-ooCTr.js";import{b as Ps,P as Ts}from"./Dbqo6rfT.js";import{h as Rs,H as Os,g as Ls}from"./XAL8NtHj.js";const Es=80,Ns=10,Ds=new Ga(Ka,{renderer:{html({text:a}){return Va(a)},image({tokens:a}){return this.parser.parseInline(a)}}});function Qn(a){const n=document.createElement("template");n.innerHTML=Ds.parseInline(a,{async:!1});for(const o of n.content.querySelectorAll("br"))o.replaceWith(" ");return(n.content.textContent??"").replace(/\s+/g," ").trim()}function Ft(a){return a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`+([^`]*?)`+/g,"$1").replace(/<[^>]+>/g,"").replace(/\\([\\`*_[\]{}()#+\-.!>])/g,"$1").replace(/[*~]/g,"").replace(/(^|[^A-Za-z0-9])_+/g,"$1").replace(/_+([^A-Za-z0-9]|$)/g,"$1").replace(/\s+/g," ").trim()}function Un(a,n){return a.slice(n).replace(/^(?:[ \t]*(?:\r\n|\n|\r))+/,"")}function Sn(a,n){return!n||n.length>Es||n.split(/\s+/).length>Ns||/[.!?;]$/.test(n)?!1:!/^[ \t]*(?:[-+*][ \t]+|\d+[.)][ \t]+|>|```|~~~|\|)/.test(a)}function tl(a){const o=a.trim().match(/^\*\*([^\r\n]+)\*\*$/);if(!o)return null;const i=Ft(o[1]);return Sn(o[0],i)?i:null}function Gn(a,n=!1,o=!0){const i=a.match(/^(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",r=a.slice(i.length).match(/^\*\*([^\r\n]+)\*\*[ \t]*(?:(?:\r\n|\n|\r)|$)/);if(!r)return null;if(n){const v=r[1],f=v.match(/\\+$/)?.[0].length??0;if(v!==v.trim()||v.includes("**")||v.startsWith("*")||v.endsWith("*")||f%2!==0)return null}const p=Ft(r[1]);return Sn(r[0],p)?{title:n&&o?Qn(r[1]):p,body:Un(a,i.length+r[0].length)}:null}function ca(a){const n=[];let o=a;for(;o.trim();){const i=Kn(o,!0),d=i.heading?{body:i.body}:Gn(o,!0,!1);if(!d)return null;n.push(o.slice(0,o.length-d.body.length)),o=d.body}return n.length?n:null}function nl(a){const n=[];let o=a;for(;o.trim();){const i=Kn(o,!0,Qn),d=i.heading?{title:i.heading,body:i.body}:Gn(o,!0);if(!d)return null;n.push(d.title),o=d.body}return n.length?n:null}function al(a){const n=Fs(a),o=[];let i=a;for(n.heading&&(o.push({title:n.heading,body:""}),i=n.body);i;){const d=Gn(i);if(!d||d.body.length>=i.length)break;o.push({title:d.title,body:""}),i=d.body}if(o.length===0){const d=a.trim(),r=Ft(d);return!d.includes(`
|
|
2
2
|
`)&&Sn(d,r)?[{title:r,body:""}]:d?[{title:null,body:d}]:[]}return o[o.length-1].body=i.trim(),o}function Ms(a){const n=a.replace(/^ {0,3}/,"");return!/^(?:\s|>|`{3}|~{3}|(?:[-+*]|\d+[.)])(?:[ \t]|$)|#{1,6}(?:[ \t]|$)|<|\[[^\]]*\]:)/.test(n)&&!/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})$/.test(n)}function Kn(a,n=!1,o=Ft){const i=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",d=a.slice(i.length);if(n&&/^(?: {4}| {0,3}\t)/.test(d))return{heading:null,body:a};const r=d.match(/^[ \t]{0,3}#{1,6}[ \t]+([^\r\n]*?)(?:[ \t]+#+)?[ \t]*(?:\r\n|\n|\r|$)/);if(r&&Ft(r[1]))return{heading:o(r[1]),body:Un(a,i.length+r[0].length)};const p=d.match(/^([^\r\n]+)(?:\r\n|\n|\r)([ \t]{0,3})(?:=+|-+)[ \t]*(?:\r\n|\n|\r|$)/);return p&&(!n||Ms(p[1])&&!p[2].includes(" "))&&Ft(p[1])?{heading:o(p[1]),body:Un(a,i.length+p[0].length)}:{heading:null,body:a}}function Fs(a,{preserveInlineText:n=!1}={}){const o=n?Qn:Ft,i=Kn(a,!1,o);if(i.heading)return i;const d=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",p=a.slice(d.length).match(/^([^\r\n]+)(?:\r\n|\n|\r)(?:[ \t]*(?:\r\n|\n|\r))+/);if(p){const v=Ft(p[1]),f=a.slice(d.length+p[0].length);if(f.trim()&&Sn(p[1],v))return{heading:o(p[1]),body:f}}return{heading:null,body:a}}const Gt="[--operational-row-inline-padding:var(--chat-operational-row-inline-padding,0.5rem)] [--operational-leading-slot-size:1.25rem] [--operational-leading-half-slot-size:0.625rem] [--operational-leading-gap:var(--chat-operational-leading-gap,0.5rem)]",rl="type-body font-family-child font-normal text-muted-foreground",sl=`${Gt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ol=`${Gt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1.5`,il=`${Gt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1`,ll=`${Gt} relative min-w-0 max-w-full`,dl=`${Gt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ul=`${Gt} operational-group-child-row ml-2 min-w-0 w-[calc(100%-0.5rem)] max-w-[calc(100%-0.5rem)]`,cl="pt-6",pl="text-muted-foreground",gl="text-muted-foreground",$a="font-normal text-muted-foreground",fl="tool-call-container group relative block w-full min-w-0 max-w-full overflow-hidden type-body font-family-child font-normal text-muted-foreground",ml="h-[16px]! w-[16px]! shrink-0",vl=`${Gt} relative grid h-7 w-full min-w-0 max-w-full grid-cols-[var(--operational-leading-slot-size)_minmax(0,1fr)_auto] items-center gap-[var(--operational-leading-gap)] overflow-hidden rounded-md px-[var(--operational-row-inline-padding)] type-body transition-colors duration-[var(--motion-fast)] motion-reduce:transition-none`,_l=`a11y-ignore pointer-events-none flex size-[var(--operational-leading-slot-size)] min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center [&_svg]:size-[16px]! ${$a}`,hl=`type-body block min-w-0 max-w-full truncate overflow-hidden text-ellipsis whitespace-nowrap border-0 bg-transparent p-0 text-left ${$a}`,bl="type-body flex min-w-0 shrink-0 items-center gap-1 whitespace-nowrap",wl="h-[16px]! w-[16px]! shrink-0 opacity-60 transition-transform duration-[var(--motion-fast)] motion-reduce:transition-none";function kl(a){return qa(a,{axis:"y",duration:ma()?0:150})}function cn(a){return a.type==="thinking"||a.type==="tool_use"||a.type==="content_group"}function xl(a){const n=a?.[0];return!n||cn(n)?"":"pt-4"}function yl(a,n,o=()=>!0){const i=a[n];if(!i||!o(i)||!cn(i))return!1;let d=n-1;for(;d>=0&&!o(a[d]);)d-=1;return d>=0&&cn(a[d])}function $l(a,n,o=()=>!0,i=!1){const d=a[n];if(!d||!o(d))return"";let r=n-1;for(;r>=0&&!o(a[r]);)r-=1;if(r<0)return"";const p=a[r];if(p.type==="thinking"&&d.type==="thinking")return i||ca(p.text??p.content??"")!==null&&ca(d.text??d.content??"")!==null?"":"pt-14";const v=cn(p),f=cn(d);return v&&f?"":p.type==="thinking"&&!f?"pt-6":v||f?"pt-4":"pt-1"}const Al="shrink-0 whitespace-nowrap text-ui text-subtle focus-visible:outline-none focus-visible:text-foreground";function zs(a){if(a?.status==="halted")return c.agent_node_halted_label();if(a?.status==="resuming")return c.agent_node_resuming_label();if(a?.placement?.target==="remote"||Fr(a?.placement?.target)){if(a.placementError)return c.remoteAgent_status_failed();if(a.cloudStart)return c.remoteAgent_status_starting();if(a.effectiveIsolation==="pending")return a.setup?.state==="pending"?c.remoteAgent_status_preparingCheckout():a.setup?.state==="running"?c.remoteAgent_status_runningSetup():c.remoteAgent_status_starting()}if(a?.placement&&a.effectiveIsolation==="pending")return c.agent_node_provisioning_label()}var Bs=_('<span class="owner-fill block h-full svelte-sxf8s9"></span>'),js=_('<span class="shrink-0 text-xs text-muted-foreground"> </span>'),Hs=_('<span class="flex items-center gap-2"><span class="group-key size-1.5 shrink-0 rounded-full svelte-sxf8s9"></span> <span class="min-w-0 flex-1"> </span> <!> <span> </span></span>'),Us=_('<dd class="col-span-2 pl-[1.125rem] text-xs text-muted-foreground wrap-anywhere"> </dd>'),qs=_(`<div class="grid grid-cols-[1fr_auto] items-baseline gap-x-3 py-0.5 text-sm"><dt class="relative min-w-0 pl-[1.125rem] wrap-anywhere before:absolute before:top-2 before:left-0 before:size-1 before:rounded-full before:bg-muted-foreground before:content-['']"> </dt> <dd> </dd> <!></div>`),Ws=_('<dl class="ml-3.5 text-foreground"></dl>'),Fn=_("<!> <!>",1),Qs=_('<span class="flex items-center gap-2"><span class="min-w-0 flex-1"> </span> <span class="shrink-0 tabular-nums text-muted-foreground"> </span></span>'),Gs=_('<div class="min-w-0"><dt class="truncate text-sm text-foreground"> </dt> <dd class="text-xs text-muted-foreground wrap-anywhere"> </dd></div>'),Ks=_('<dl class="ml-3.5 flex flex-col gap-2"></dl>'),Vs=_('<section class="min-w-0" data-testid="prompt-breakdown"><div class="mb-3 flex items-baseline justify-between gap-3"><h3 class="text-sm font-medium"> </h3> <span class="shrink-0 text-sm tabular-nums text-muted-foreground"> </span></div> <div class="owner-strip mb-2 flex h-1.5 w-full overflow-hidden svelte-sxf8s9" role="img"></div> <!></section>');function Aa(a,n){const o=Wn();if(new.target)return Pt({component:Aa,...a});Ot(n,!0);let i=w(n,"breakdown",7);const d="type-body font-normal text-foreground data-[state=open]:font-normal";function r(T){return Zr(T,{maximumFractionDigits:T<1e4?1:0})}function p(T){return T==="native"?c.agent_contextBreakdown_owner_native_label():T==="intent"?c.agent_contextBreakdown_owner_intent_label():c.agent_contextBreakdown_owner_user_label()}const v=u(()=>i().owners.map(T=>c.agent_contextBreakdown_ownerShare_label({owner:p(T.owner),tokens:r(T.estTokens)})).join(", "));var f={get breakdown(){return i()},set breakdown(T){i(T),k()},$set:Tt,$on:(T,m)=>Rt(n,T,m)},S=Vs(),y=O(S),g=O(y),N=U(g,!0),F=b(g,2),Ce=U(F,!0);$(y);var D=b(y,2);Ct(D,21,()=>i().owners,T=>T.owner,(T,m)=>{var me=Bs();let ue;x(()=>{q(me,"data-owner",e(m).owner),ue=en(me,"",ue,{"flex-grow":e(m).share})}),l(T,me)}),$(D);var P=b(D,2);return de(P,()=>xa,(T,m)=>{m(T,{type:"multiple",children:(me,ue)=>{var R=Fn(),_e=H(R);Ct(_e,17,()=>i().groups,pe=>pe.kind,(pe,K)=>{var W=Oe(),ne=H(W);de(ne,()=>Bn,(ge,Fe)=>{Fe(ge,{get value(){return e(K).kind},get"data-prompt-group"(){return e(K).kind},children:(ot,G)=>{var I=Fn(),ae=H(I);de(ae,()=>da,(he,E)=>{E(he,{level:4,children:(Le,Y)=>{var Q=Oe(),Z=H(Q);de(Z,()=>jn,(V,oe)=>{oe(V,{inset:!1,class:d,children:(ee,Ee)=>{var be=Hs(),je=O(be),et=b(je,2),ut=U(et,!0),tt=b(et,2);{var at=ct=>{var Et=js(),yt=U(Et,!0);x(X=>L(yt,X),[()=>c.agent_contextBreakdown_notCounted_label()]),l(ct,Et)};M(tt,ct=>{e(K).kind==="native"&&ct(at)})}var Ne=b(tt,2),Kt=U(Ne,!0);$(be),x((ct,Et)=>{q(je,"data-kind",e(K).kind),L(ut,ct),ve(Ne,1,`shrink-0 tabular-nums ${e(K).kind==="native"?"text-muted-foreground":""}`),L(Kt,Et)},[()=>p(e(K).kind),()=>r(e(K).estTokens)]),l(ee,be)},$$slots:{default:!0}})}),l(Le,Q)},$$slots:{default:!0}})});var Be=b(ae,2);de(Be,()=>Hn,(he,E)=>{E(he,{inset:!1,children:(Le,Y)=>{var Q=Ws();Ct(Q,21,()=>e(K).rows,Z=>Z.key,(Z,V)=>{var oe=qs(),ee=O(oe),Ee=U(ee,!0),be=b(ee,2),je=U(be,!0),et=b(be,2);{var ut=tt=>{var at=Us(),Ne=U(at,!0);x(()=>L(Ne,e(V).hint)),l(tt,at)};M(et,tt=>{e(V).hint&&tt(ut)})}$(oe),x(tt=>{L(Ee,e(V).label),ve(be,1,`tabular-nums ${e(V).counted?"":"text-muted-foreground"}`),L(je,tt)},[()=>r(e(V).estTokens)]),l(Z,oe)}),$(Q),l(Le,Q)},$$slots:{default:!0}})}),l(ot,I)},$$slots:{default:!0}})}),l(pe,W)});var ce=b(_e,2);{var xe=pe=>{var K=Oe(),W=H(K);de(W,()=>Bn,(ne,ge)=>{ge(ne,{value:"hidden-skills",class:"mt-1",children:(Fe,ot)=>{var G=Fn(),I=H(G);de(I,()=>da,(Be,he)=>{he(Be,{level:4,children:(E,Le)=>{var Y=Oe(),Q=H(Y);de(Q,()=>jn,(Z,V)=>{V(Z,{inset:!1,class:d,children:(oe,ee)=>{var Ee=Qs(),be=O(Ee),je=U(be,!0),et=b(be,2),ut=U(et,!0);$(Ee),x((tt,at)=>{L(je,tt),L(ut,at)},[()=>c.agent_contextBreakdown_hiddenSkills_title(),()=>Wt(i().hiddenSkills.length)]),l(oe,Ee)},$$slots:{default:!0}})}),l(E,Y)},$$slots:{default:!0}})});var ae=b(I,2);de(ae,()=>Hn,(Be,he)=>{he(Be,{inset:!1,children:(E,Le)=>{var Y=Ks();Ct(Y,21,()=>i().hiddenSkills,Q=>Q.name,(Q,Z)=>{var V=Gs(),oe=O(V),ee=U(oe,!0),Ee=b(oe,2),be=U(Ee,!0);$(V),x(je=>{L(ee,e(Z).name),L(be,je)},[()=>[e(Z).detail,e(Z).fix].filter(Boolean).join(" · ")]),l(Q,V)}),$(Y),l(E,Y)},$$slots:{default:!0}})}),l(Fe,G)},$$slots:{default:!0}})}),l(pe,K)};M(ce,pe=>{i().hiddenSkills.length>0&&pe(xe)})}l(me,R)},$$slots:{default:!0}})}),$(S),x((T,m)=>{q(S,"aria-labelledby",`${o}-title`),q(g,"id",`${o}-title`),L(N,T),L(Ce,m),q(D,"aria-label",e(v))},[()=>c.agent_contextBreakdown_title(),()=>c.agent_contextBreakdown_tokens_label({tokens:r(i().estTokens)})]),l(a,S),Lt(f)}const Xs=["intent","user"],Ys=["systemPrompt","toolDescription","provider"],Js=["native","user","intent"],$n=a=>typeof a=="object"&&a!==null&&!Array.isArray(a),An=a=>typeof a=="number"&&Number.isFinite(a)&&a>=0,Zs=a=>a==="intent"||a==="user";function eo(a,n){if(!$n(a))return null;const{id:o,label:i,owner:d,location:r,chars:p,estTokens:v,controlHint:f}=a;if(typeof o!="string"||typeof i!="string"||!Zs(d)||typeof r!="string"||!Ys.includes(r)||!An(p)||!An(v))return null;const S=$n(f)&&typeof f.text=="string"&&f.text;return{key:`${n}:${o}`,id:o,label:i,owner:d,chars:p,estTokens:v,counted:r!=="provider",...S?{hint:S}:{}}}function to(a){if(!$n(a))return null;const{name:n,reason:o,detail:i,fix:d}=a;return[n,o,i,d].some(r=>typeof r!="string")?null:{name:n,reason:o,detail:i,fix:d}}function no(a){if(!$n(a)||a.available!==!0)return null;const{totalChars:n,estTokens:o,sections:i,hiddenSkills:d}=a;if(!An(n)||!An(o)||!Array.isArray(i)||!Array.isArray(d))return null;const r=i.map(eo).filter(f=>f!==null).sort((f,S)=>S.chars-f.chars),p=Xs.map(f=>{const S=r.filter(g=>g.counted&&g.owner===f),y=S.reduce((g,N)=>g+N.chars,0);return{owner:f,chars:y,estTokens:S.reduce((g,N)=>g+N.estTokens,0),share:n>0?y/n:0}}).filter(f=>f.chars>0),v=Js.map(f=>{const S=r.filter(y=>f==="native"?!y.counted:y.counted&&y.owner===f);return{kind:f,chars:S.reduce((y,g)=>y+g.chars,0),estTokens:S.reduce((y,g)=>y+g.estTokens,0),rows:S}}).filter(f=>f.rows.length>0);return{totalChars:n,estTokens:o,rows:r,groups:v,owners:p,hiddenSkills:d.map(to).filter(f=>f!==null)}}async function ao(a){try{const n=await Gr("agent.getSession",{agentId:a});return no(n?.session?.promptBreakdown)}catch{return null}}const pa=es.map(a=>({key:a.path.replace(/^agentFeatures\./,""),label:a.label,description:a.description}));function ro(a){const n=a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase().trim();return n.charAt(0).toUpperCase()+n.slice(1)}function so(a){const n=a??{},o=pa.map(r=>({key:r.key,label:r.label(),description:r.description(),enabled:n[r.key]===!0,known:!0})),i=new Set(pa.map(r=>r.key)),d=[];for(const[r,p]of Object.entries(n))i.has(r)||d.push({key:r,label:ro(r),description:null,enabled:p===!0,known:!1});return d.sort((r,p)=>r.label.localeCompare(p.label)),o.concat(d)}var oo=_('<div class="mb-6 border-b border-border pb-6"><!></div>'),io=_("<span> </span>"),lo=_('<!> <span class="sr-only"> </span>',1),uo=_('<div role="listitem" class="text-xs text-subtle" aria-hidden="true">—</div>'),co=_('<section class="min-w-0"><h4 class="text-sm font-medium mb-3"> </h4> <div role="list" class="space-y-2"></div></section>'),po=_('<div class="@container"><!> <section><h3 class="text-sm font-medium"> </h3> <p class="mb-4 mt-1 text-sm text-muted-foreground"> </p> <div class="grid grid-cols-1 gap-6 @min-[28rem]:grid-cols-2" data-testid="harness-features-list"></div></section></div>');function Sa(a,n){const o=Wn();if(new.target)return Pt({component:Sa,...a});Ot(n,!0);let i=w(n,"open",15,!1),d=w(n,"static",7,!1),r=w(n,"version",7),p=w(n,"features",7,null),v=w(n,"agentId",7),f=w(n,"breakdown",7),S=le(null);const y=u(()=>f()===void 0&&!!v());ze(()=>{if(!i()||!e(y)||!v())return;const D=v();let P=!0;return ao(D).then(T=>{P&&h(S,{agentId:D,view:T},!0)}),()=>{P=!1}});const g=u(()=>f()!==void 0?f():e(y)&&e(S)&&e(S).agentId===v()?e(S).view:null),N=u(()=>so(p())),F=u(()=>[{enabled:!0,label:c.chat_shared_valueOn_label(),rows:e(N).filter(D=>D.enabled)},{enabled:!1,label:c.chat_shared_valueOff_label(),rows:e(N).filter(D=>!D.enabled)}]);var Ce={get open(){return i()},set open(D=!1){i(D),k()},get static(){return d()},set static(D=!1){d(D),k()},get version(){return r()},set version(D){r(D),k()},get features(){return p()},set features(D=null){p(D),k()},get agentId(){return v()},set agentId(D){v(D),k()},get breakdown(){return f()},set breakdown(D){f(D),k()},$set:Tt,$on:(D,P)=>Rt(n,D,P)};{let D=u(()=>c.chat_harnessFeaturesModal_title({version:r()}));Kr(a,{get static(){return d()},get title(){return e(D)},size:"wide",get open(){return i()},set open(P){i(P)},children:(P,T)=>{var m=po(),me=O(m);{var ue=W=>{var ne=oo(),ge=O(ne);Aa(ge,{get breakdown(){return e(g)}}),$(ne),l(W,ne)};M(me,W=>{e(g)&&W(ue)})}var R=b(me,2),_e=O(R),ce=U(_e,!0),xe=b(_e,2),pe=U(xe,!0),K=b(xe,2);Ct(K,21,()=>e(F),W=>W.enabled,(W,ne)=>{var ge=co(),Fe=O(ge),ot=U(Fe,!0),G=b(Fe,2);Ct(G,21,()=>e(ne).rows,I=>I.key,(I,ae)=>{Jr(I,{role:"listitem",class:"min-h-0 px-0 py-0 [&_.truncate]:whitespace-normal","data-testid":"harness-feature-state",get"data-feature"(){return e(ae).key},get"data-enabled"(){return e(ae).enabled},title:he=>{var E=Oe(),Le=H(E);{var Y=Z=>{var V=lo(),oe=H(V);qr(oe,{get content(){return e(ae).description},side:"top",size:"sm",children:(be,je)=>{var et=io(),ut=U(et,!0);x(()=>L(ut,e(ae).label)),l(be,et)},$$slots:{default:!0}});var ee=b(oe,2),Ee=U(ee,!0);x(()=>L(Ee,e(ae).description)),l(Z,V)},Q=Z=>{var V=Qt();x(()=>L(V,e(ae).label)),l(Z,V)};M(Le,Z=>{e(ae).description?Z(Y):Z(Q,-1)})}l(he,E)},$$slots:{title:!0}})},I=>{var ae=uo();l(I,ae)}),$(G),$(ge),x(()=>{q(ge,"aria-label",e(ne).label),L(ot,e(ne).label)}),l(W,ge)}),$(K),$(R),$(m),x((W,ne)=>{q(R,"aria-labelledby",`${o}-capabilities`),q(_e,"id",`${o}-capabilities`),L(ce,W),L(pe,ne)},[()=>c.chat_harnessFeaturesModal_capabilities_title(),()=>c.chat_harnessFeaturesModal_description()]),l(P,m)},$$slots:{default:!0}})}return Lt(Ce)}var go=_('<p role="alert" class="type-body text-danger"> </p>');function Ia(a,n){if(new.target)return Pt({component:Ia,...a});Ot(n,!0);const o=()=>Re(g,"$outcome$",i),[i,d]=qn();let r=w(n,"open",15,!1),p=w(n,"agentName",7),v=w(n,"workspaceId",7),f=w(n,"agentId",7);const S=crypto.randomUUID(),y=Mt(""),g=xn(y,S),N=u(()=>o()?.workspaceId===v()&&o().agentId===f()?o():void 0),F=u(()=>e(N)?.status==="pending"),Ce=u(()=>e(N)?.status==="failed"?e(N).error:"");ze(()=>{const m=v();return f(),y.set(m),()=>J.dispatch(zn(m,S))}),ze(()=>{e(N)?.status==="succeeded"&&(r(!1),J.dispatch(wa(v(),S,e(N).requestId)))});function D(){const m=xn.select(J.state,v(),S);m?.agentId===f()&&m.status==="pending"||J.dispatch(kn(v(),S,crypto.randomUUID(),f(),{kind:"retire"}))}var P={get open(){return r()},set open(m=!1){r(m),k()},get agentName(){return p()},set agentName(m){p(m),k()},get workspaceId(){return v()},set workspaceId(m){v(m),k()},get agentId(){return f()},set agentId(m){f(m),k()},$set:Tt,$on:(m,me)=>Rt(n,m,me)};{const m=ce=>{var xe=Oe(),pe=H(xe);{var K=W=>{var ne=go(),ge=U(ne,!0);x(()=>L(ge,e(Ce))),l(W,ne)};M(pe,W=>{e(Ce)&&W(K)})}l(ce,xe)};let me=u(()=>c.modals_retireAgent_title()),ue=u(()=>c.modals_retireAgent_description({name:p()})),R=u(()=>c.modals_retireAgent_confirm_label()),_e=u(()=>c.modals_bulkActionConfirm_cancel_label());ns(a,{get title(){return e(me)},get description(){return e(ue)},get confirmLabel(){return e(R)},get cancelLabel(){return e(_e)},focusSubmit:!1,focusCancel:!0,get busy(){return e(F)},onConfirm:D,get open(){return r()},set open(ce){r(ce)},details:m,$$slots:{details:!0}})}var T=Lt(P);return d(),T}function fo({agentName:a,specialist:n}){const o=n?`{ topLevel: true, specialist: ${JSON.stringify(n)} }`:"{ topLevel: true }",i=n?`and keep the same specialist (${JSON.stringify(n)})`:"and, if you were created with a specialist, pass that exact same `specialist` value in the options";return`Please replace yourself with a fresh top-level agent and run a gradual, coordinated hand-off:
|
|
3
3
|
|
|
4
4
|
1. Create your replacement now: call \`ws.agent.create(${JSON.stringify(a)}, kickoffMessage, ${o})\`. The first argument must be your EXACT current name (${JSON.stringify(a)}) ${i}. Write the kickoff message as a thorough context hand-off: the overall goal, the current state of the work, key notes and files, decisions already made, and open threads.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{_ as Z}from"./Fcr7AvC-.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./DFNKkiho.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./DTco_120.js");return{captureNodeSizes:b}},__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,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/D__LL1n8.js","/app/immutable/chunks/Bex9L_jH.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CNKJ8_Xr.js","/app/immutable/chunks/cD292w1o.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/B3ZeLze4.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BeZe2Rt-.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/CDCAMh6o.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/8ItTOum-.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/B0SSzYpD.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/C1UoJPr2.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/D7KhILhs.js","/app/immutable/chunks/DfINI0LK.js","/app/immutable/chunks/C3KgmGxd.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/x4bPxhVW.js","/app/immutable/chunks/CWtyXmQ4.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/Cz3WzTlQ.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/O5ZlQHf9.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BzXQ5SMs.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/B8m3-qrW.js","/app/immutable/chunks/CpK0xLH4.js","/app/immutable/chunks/C2RnxEnO.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/koUs6Gjt.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/CVx5OKWy.js","/app/immutable/chunks/DimbKbDZ.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/iMqZaR5X.js","/app/immutable/chunks/DhXSKt_a.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Z}from"./Fcr7AvC-.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./Bex9L_jH.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./D__LL1n8.js");return{captureNodeSizes:b}},__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,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|