@intent-hq/web 2.310.1 → 2.310.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/assets/{DiagramPresentation.fimBl1wP.css → DiagramPresentation.Bfi3xHm0.css} +1 -1
- package/web/app/immutable/chunks/-xK_vQQs.js +1 -0
- package/web/app/immutable/chunks/{CeEeQIAV.js → 2rlMb19F.js} +1 -1
- package/web/app/immutable/chunks/{Bhcwd2SW.js → 6Z5k9P1U.js} +4 -4
- package/web/app/immutable/chunks/7xAw-BT0.js +213 -0
- package/web/app/immutable/chunks/{t3bi-ExW.js → B1s3oEqm.js} +2 -2
- package/web/app/immutable/chunks/{phowbgF-.js → B2JLNOy6.js} +1 -1
- package/web/app/immutable/chunks/B53WwE3a.js +1 -0
- package/web/app/immutable/chunks/{R7gFhaG_.js → B7VncZW5.js} +1 -1
- package/web/app/immutable/chunks/{EZw3rvya.js → B7s4-XTz.js} +30 -30
- package/web/app/immutable/chunks/{DOHtPCK9.js → BDPXN-l5.js} +1 -1
- package/web/app/immutable/chunks/{zXW6V5sa.js → BENBNSN7.js} +1 -1
- package/web/app/immutable/chunks/{DevHtnbn.js → BFXzH5IE.js} +1 -1
- package/web/app/immutable/chunks/BGcL9rs9.js +217 -0
- package/web/app/immutable/chunks/BHnD9zfx.js +99 -0
- package/web/app/immutable/chunks/{qMHHnffV.js → BI_SwxaN.js} +1 -1
- package/web/app/immutable/chunks/{BV9p4X5I.js → BMMFveB2.js} +6 -6
- package/web/app/immutable/chunks/BP6OqM9o.js +1 -0
- package/web/app/immutable/chunks/BRvgBsbx.js +291 -0
- package/web/app/immutable/chunks/{Cuozo7M1.js → BSel_zEu.js} +1 -1
- package/web/app/immutable/chunks/{B4dTn6xv.js → BUlPMLws.js} +1 -1
- package/web/app/immutable/chunks/{xMirTl3q.js → BYxB_o2p.js} +2 -2
- package/web/app/immutable/chunks/{CsYRAdgB.js → B_mbXOka.js} +1 -1
- package/web/app/immutable/chunks/BakMVsPT.js +2 -0
- package/web/app/immutable/chunks/{DeopB2f-.js → Bd0N6Q84.js} +3 -3
- package/web/app/immutable/chunks/{CHH2PtZ7.js → BfPWAh77.js} +1 -1
- package/web/app/immutable/chunks/BfZK-g4H.js +2 -0
- package/web/app/immutable/chunks/BhWJ-mUa.js +292 -0
- package/web/app/immutable/chunks/{CwH3s3Sg.js → Bhw4MKUW.js} +1 -1
- package/web/app/immutable/chunks/{CUvX4uDB.js → BmpVZmDT.js} +3 -3
- package/web/app/immutable/chunks/{BNg3GOxL.js → Bn-4GS40.js} +2 -2
- package/web/app/immutable/chunks/BpXeqZkK.js +12 -0
- package/web/app/immutable/chunks/{D-9LH0ah.js → Bpofk5Ge.js} +1 -1
- package/web/app/immutable/chunks/{DjEB6QMF.js → BrV7vQ-C.js} +1 -1
- package/web/app/immutable/chunks/ByGoYv9M.js +1 -0
- package/web/app/immutable/chunks/C-1nTNwc.js +120 -0
- package/web/app/immutable/chunks/{CBHPIqXg.js → C3nOF7W6.js} +1 -1
- package/web/app/immutable/chunks/{BIxkRFIj.js → C72YfPmr.js} +2 -2
- package/web/app/immutable/chunks/{DMGAuSgb.js → C87YV7yB.js} +4 -4
- package/web/app/immutable/chunks/{Coy9jSf1.js → CCDTjxXZ.js} +1 -1
- package/web/app/immutable/chunks/CEXJj_TX.js +62 -0
- package/web/app/immutable/chunks/CHFvnHJS.js +39 -0
- package/web/app/immutable/chunks/{CWyh7Yhz.js → CK1qXB1I.js} +1 -1
- package/web/app/immutable/chunks/{CCIGQjYf.js → CLEySo6k.js} +1 -1
- package/web/app/immutable/chunks/{DXOCO_oS.js → CNxOtEoC.js} +1 -1
- package/web/app/immutable/chunks/{7KTbkf4W.js → CPi1vTiT.js} +2 -2
- package/web/app/immutable/chunks/{ejL3HmTG.js → CQI-dvtu.js} +3 -3
- package/web/app/immutable/chunks/CSiG9Hvp.js +1 -0
- package/web/app/immutable/chunks/{C0DDaBnV.js → CTaTQq2B.js} +1 -1
- package/web/app/immutable/chunks/{dtB9lR1B.js → CUMlGGeg.js} +1 -1
- package/web/app/immutable/chunks/{fULl8IO9.js → CVyfvlNb.js} +7 -7
- package/web/app/immutable/chunks/{DUkegami.js → C_tu278J.js} +1 -1
- package/web/app/immutable/chunks/CcUMYVEM.js +41 -0
- package/web/app/immutable/chunks/Ccfa6x-j.js +24 -0
- package/web/app/immutable/chunks/{BmDskjjc.js → Cd_IIsl2.js} +1 -1
- package/web/app/immutable/chunks/CeijcUhC.js +38 -0
- package/web/app/immutable/chunks/Ci2_N-bK.js +370 -0
- package/web/app/immutable/chunks/CiPifYNB.js +1 -0
- package/web/app/immutable/chunks/{D8SVxzqF.js → CjcP6chv.js} +1 -1
- package/web/app/immutable/chunks/Cl430GWg.js +344 -0
- package/web/app/immutable/chunks/ClKsLSpN.js +27 -0
- package/web/app/immutable/chunks/ClebXGIM.js +141 -0
- package/web/app/immutable/chunks/{DOVnLHFz.js → CnIb6mve.js} +1 -1
- package/web/app/immutable/chunks/{qOCErwrn.js → CrdTEIp7.js} +1 -1
- package/web/app/immutable/chunks/{CPvhRhlk.js → Cstq9SM5.js} +11 -11
- package/web/app/immutable/chunks/CuzanJ4G.js +1 -0
- package/web/app/immutable/chunks/{D81gRUjY.js → D-QdqmeZ.js} +1 -1
- package/web/app/immutable/chunks/D0gJOzJU.js +40 -0
- package/web/app/immutable/chunks/{CoeuT-m3.js → D2ffSQ9J.js} +1 -1
- package/web/app/immutable/chunks/D2ojbL4J.js +98 -0
- package/web/app/immutable/chunks/{Bfkn2BGM.js → D3lH_sy-.js} +1 -1
- package/web/app/immutable/chunks/{C0Yks_oS.js → D5XrjD_m.js} +1 -1
- package/web/app/immutable/chunks/{DzvQOT8_.js → D5gGhPeB.js} +1 -1
- package/web/app/immutable/chunks/{DLm51UIm.js → D7ePuUtq.js} +1 -1
- package/web/app/immutable/chunks/{B9r0JXjW.js → D9RktmhG.js} +1 -1
- package/web/app/immutable/chunks/{Si43_nYW.js → D9zTmP-H.js} +3 -3
- package/web/app/immutable/chunks/{DQEBW0YT.js → DAhqFWJw.js} +1 -1
- package/web/app/immutable/chunks/{B20hJMKp.js → DAmyup4Q.js} +2 -2
- package/web/app/immutable/chunks/{B0X6Qy4e.js → DH-0T9oO.js} +1 -1
- package/web/app/immutable/chunks/{D-o9b0Cd.js → DHf042m3.js} +2 -2
- package/web/app/immutable/chunks/DICP2Iar.js +169 -0
- package/web/app/immutable/chunks/{D04E4MVv.js → DJ4er0zy.js} +4 -4
- package/web/app/immutable/chunks/{BtHVXttl.js → DLTK7s08.js} +5 -5
- package/web/app/immutable/chunks/{DQulsXJ7.js → DM80xiYc.js} +1 -1
- package/web/app/immutable/chunks/{BsP5G0Fo.js → DPWD_Z0m.js} +1 -1
- package/web/app/immutable/chunks/{t9id1Dgw.js → DPjuFI2m.js} +1 -1
- package/web/app/immutable/chunks/{DhdMM_zt.js → DR30pTuY.js} +14 -14
- package/web/app/immutable/chunks/{D_9AVJm5.js → DStbB4cJ.js} +1 -1
- package/web/app/immutable/chunks/{C8CCN24q.js → DV_gHrZ4.js} +1 -1
- package/web/app/immutable/chunks/{CQe4IdgR.js → DWqMBuHP.js} +1 -1
- package/web/app/immutable/chunks/DhDem5lD.js +34 -0
- package/web/app/immutable/chunks/{DaEQgqyy.js → Dj7a19mR.js} +1 -1
- package/web/app/immutable/chunks/{CnmCWFKQ.js → Dn1Hge9W.js} +2 -2
- package/web/app/immutable/chunks/{DxlwMmI8.js → DpbPS--w.js} +1 -1
- package/web/app/immutable/chunks/{Drg52kVf.js → DqPGIq9m.js} +1 -1
- package/web/app/immutable/chunks/Dr9n9KYD.js +8 -0
- package/web/app/immutable/chunks/Dx4xDmS-.js +1 -0
- package/web/app/immutable/chunks/{D411lQkp.js → DxBZwGJl.js} +1 -1
- package/web/app/immutable/chunks/{CEdLQlJ6.js → EF47gh5F.js} +6 -6
- package/web/app/immutable/chunks/FTZaXc8b.js +106 -0
- package/web/app/immutable/chunks/NHQiGgbv.js +200 -0
- package/web/app/immutable/chunks/{BCm8Gasf.js → OEEtadht.js} +1 -1
- package/web/app/immutable/chunks/{DCeW9_0X.js → PR2rc_KV.js} +2 -2
- package/web/app/immutable/chunks/{_F3xl3RI.js → Q48HTbqK.js} +1 -1
- package/web/app/immutable/chunks/{TQIai6Ne.js → Sd4DhpzB.js} +79 -79
- package/web/app/immutable/chunks/{C-Mmob1s.js → WaYTk5P-.js} +1 -1
- package/web/app/immutable/chunks/{ByGsJxdn.js → X-Frg4xt.js} +1 -1
- package/web/app/immutable/chunks/YDWB9C4j.js +36 -0
- package/web/app/immutable/chunks/{BUSwtV99.js → YqBgboHy.js} +1 -1
- package/web/app/immutable/chunks/{B_D0NLtg.js → _GDZ01fB.js} +1 -1
- package/web/app/immutable/chunks/{C7oH1dbI.js → aloh9OcN.js} +1 -1
- package/web/app/immutable/chunks/{BEhoKnQT.js → ap51LBWo.js} +1 -1
- package/web/app/immutable/chunks/bBO0iA4_.js +7 -0
- package/web/app/immutable/chunks/cMysCMc_.js +24 -0
- package/web/app/immutable/chunks/dpdLM1Cx.js +140 -0
- package/web/app/immutable/chunks/eHLf0w_s.js +1 -0
- package/web/app/immutable/chunks/fyjA8lOg.js +4 -0
- package/web/app/immutable/chunks/{CQf-fH5v.js → h6Xb9K7f.js} +1 -1
- package/web/app/immutable/chunks/{j0ThtFJc.js → iX-41BqF.js} +1 -1
- package/web/app/immutable/chunks/ibC6Wlul.js +3 -0
- package/web/app/immutable/chunks/jU5_8m_P.js +84 -0
- package/web/app/immutable/chunks/{BKGPkCRs.js → kHJUvxPR.js} +1 -1
- package/web/app/immutable/chunks/{BBTS8ZOM.js → lG67Zx5D.js} +3 -3
- package/web/app/immutable/chunks/{CgAIOmc3.js → lb9Uy5lM.js} +4 -4
- package/web/app/immutable/chunks/{DdAxykhC.js → lh2cjQS1.js} +1 -1
- package/web/app/immutable/chunks/{r1_PrlQL.js → lqs_HYEw.js} +1 -1
- package/web/app/immutable/chunks/{CnszEr0a.js → oEWQ7BWN.js} +1 -1
- package/web/app/immutable/chunks/{BGLkcG6I.js → ry72TFIz.js} +2 -2
- package/web/app/immutable/chunks/{BV7dztYI.js → ryFwnMjp.js} +1 -1
- package/web/app/immutable/chunks/{CsASRGy9.js → uOEty9O6.js} +5 -5
- package/web/app/immutable/chunks/wh3Y68il.js +1 -0
- package/web/app/immutable/chunks/{DRMT9vvq.js → xPs_63iv.js} +1 -1
- package/web/app/immutable/entry/{app.DlF41taB.js → app.np0VAfbg.js} +2 -2
- package/web/app/immutable/entry/start.BGCfjmAX.js +1 -0
- package/web/app/immutable/nodes/{0.BLjNhnkb.js → 0.DoZAnEaT.js} +1 -1
- package/web/app/immutable/nodes/{1.DaghOy3j.js → 1.BfLNDde5.js} +1 -1
- package/web/app/immutable/nodes/{10.CbV_flkh.js → 10.WVRhKQHR.js} +1 -1
- package/web/app/immutable/nodes/{14.N_oC1pv5.js → 14.BGrxllXE.js} +1 -1
- package/web/app/immutable/nodes/{16.Cn0uYbJe.js → 16.CkZkKSWx.js} +2 -2
- package/web/app/immutable/nodes/{2.CMERPJYK.js → 2.COM3w17g.js} +8 -8
- package/web/app/immutable/nodes/{3.Dk5w9XeG.js → 3.BhRx3b1m.js} +1 -1
- package/web/app/immutable/nodes/{4.CvLiKH0B.js → 4.C02hhSi-.js} +1 -1
- package/web/app/immutable/nodes/{5.BL5oLCOi.js → 5.Dgt2hWD3.js} +1 -1
- package/web/app/immutable/nodes/{6.DiKzgiKt.js → 6.KyP4WP5g.js} +1 -1
- package/web/app/immutable/nodes/{7.CM-hNW3A.js → 7.BxnoAMeX.js} +1 -1
- package/web/app/immutable/nodes/{8.BThIGSQR.js → 8.CnlHpTsC.js} +2 -2
- package/web/app/immutable/nodes/{9.D70tN3NX.js → 9.CJ1_wepy.js} +18 -18
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/-SL67XKV.js +0 -1
- package/web/app/immutable/chunks/351KaJp_.js +0 -24
- package/web/app/immutable/chunks/7Iuyw4Ow.js +0 -106
- package/web/app/immutable/chunks/9ySBq1wF.js +0 -36
- package/web/app/immutable/chunks/B2safKX4.js +0 -1
- package/web/app/immutable/chunks/B8QrskMI.js +0 -139
- package/web/app/immutable/chunks/BCO4VeSA.js +0 -1
- package/web/app/immutable/chunks/BCaDoF8Y.js +0 -1
- package/web/app/immutable/chunks/BEdJCn-8.js +0 -1
- package/web/app/immutable/chunks/BGBb6fI-.js +0 -120
- package/web/app/immutable/chunks/BGQ3htf5.js +0 -1
- package/web/app/immutable/chunks/BKLEAopb.js +0 -7
- package/web/app/immutable/chunks/BKSgn5w-.js +0 -1
- package/web/app/immutable/chunks/BKY64haD.js +0 -12
- package/web/app/immutable/chunks/BOXqfDS_.js +0 -40
- package/web/app/immutable/chunks/BP_ooGOd.js +0 -24
- package/web/app/immutable/chunks/BQApP15C.js +0 -99
- package/web/app/immutable/chunks/BS6cE8e9.js +0 -231
- package/web/app/immutable/chunks/BTXk2yGf.js +0 -96
- package/web/app/immutable/chunks/BVrOGXf1.js +0 -78
- package/web/app/immutable/chunks/BZoKWA-r.js +0 -96
- package/web/app/immutable/chunks/BbiXTFqz.js +0 -1
- package/web/app/immutable/chunks/BgmKjqUX.js +0 -1
- package/web/app/immutable/chunks/Bk7xBWHf.js +0 -34
- package/web/app/immutable/chunks/BoiNnj2h.js +0 -1
- package/web/app/immutable/chunks/BrVvVCxw.js +0 -1
- package/web/app/immutable/chunks/ByM2DIOs.js +0 -1
- package/web/app/immutable/chunks/ByzYvvQp.js +0 -70
- package/web/app/immutable/chunks/Bz0SnIMO.js +0 -1
- package/web/app/immutable/chunks/C1IwSyrV.js +0 -99
- package/web/app/immutable/chunks/C9gL5x04.js +0 -39
- package/web/app/immutable/chunks/C9nyJoiB.js +0 -41
- package/web/app/immutable/chunks/CBV2Z_QZ.js +0 -89
- package/web/app/immutable/chunks/CDHds8o_.js +0 -3
- package/web/app/immutable/chunks/CHIHAnR-.js +0 -1
- package/web/app/immutable/chunks/CHj2oCmD.js +0 -39
- package/web/app/immutable/chunks/CIXNMjfT.js +0 -206
- package/web/app/immutable/chunks/CKFDW9cI.js +0 -24
- package/web/app/immutable/chunks/CKQlE_M1.js +0 -88
- package/web/app/immutable/chunks/CSBhPNbN.js +0 -206
- package/web/app/immutable/chunks/CSLTsum9.js +0 -38
- package/web/app/immutable/chunks/CSbiiZpm.js +0 -354
- package/web/app/immutable/chunks/CToDhNW4.js +0 -1
- package/web/app/immutable/chunks/CYFK9YEX.js +0 -168
- package/web/app/immutable/chunks/CcGF51wP.js +0 -1
- package/web/app/immutable/chunks/Cd5vVJw4.js +0 -292
- package/web/app/immutable/chunks/CgjSMAIJ.js +0 -120
- package/web/app/immutable/chunks/Ck7B90Kr.js +0 -38
- package/web/app/immutable/chunks/CkAILno9.js +0 -62
- package/web/app/immutable/chunks/CkawHIFZ.js +0 -1
- package/web/app/immutable/chunks/ClXr1b-t.js +0 -8
- package/web/app/immutable/chunks/CmWBRPmR.js +0 -24
- package/web/app/immutable/chunks/Cmo-9vFV.js +0 -1
- package/web/app/immutable/chunks/CoFCa7Mb.js +0 -231
- package/web/app/immutable/chunks/CrcLvVto.js +0 -84
- package/web/app/immutable/chunks/Cs_Q6mos.js +0 -1
- package/web/app/immutable/chunks/CsnLwu9F.js +0 -2
- package/web/app/immutable/chunks/CuYeKLE8.js +0 -8
- package/web/app/immutable/chunks/CvOaoHrI.js +0 -1
- package/web/app/immutable/chunks/CvYzv8kf.js +0 -1
- package/web/app/immutable/chunks/CxRm1vYn.js +0 -342
- package/web/app/immutable/chunks/CyfBUrNA.js +0 -1
- package/web/app/immutable/chunks/D1QKDDLH.js +0 -1
- package/web/app/immutable/chunks/D61DwhDw.js +0 -3
- package/web/app/immutable/chunks/DBAJPVI_.js +0 -1
- package/web/app/immutable/chunks/DBt8jmEX.js +0 -40
- package/web/app/immutable/chunks/DD-T_Om0.js +0 -178
- package/web/app/immutable/chunks/DEOiJZFa.js +0 -168
- package/web/app/immutable/chunks/DHW4IXFj.js +0 -36
- package/web/app/immutable/chunks/DJ0w8Oax.js +0 -129
- package/web/app/immutable/chunks/DJ52BT20.js +0 -1
- package/web/app/immutable/chunks/DK1048Bw.js +0 -129
- package/web/app/immutable/chunks/DZ0nrC9W.js +0 -162
- package/web/app/immutable/chunks/DeRneTJF.js +0 -106
- package/web/app/immutable/chunks/Df6EnPla.js +0 -4
- package/web/app/immutable/chunks/DfMKUxMU.js +0 -30
- package/web/app/immutable/chunks/DkH3yb1j.js +0 -34
- package/web/app/immutable/chunks/Doxgswr3.js +0 -4
- package/web/app/immutable/chunks/Dt53cexP.js +0 -1
- package/web/app/immutable/chunks/Dx6eBL0x.js +0 -1
- package/web/app/immutable/chunks/HP7Asd0t.js +0 -2
- package/web/app/immutable/chunks/HP8lGamR.js +0 -257
- package/web/app/immutable/chunks/HzpfURmp.js +0 -84
- package/web/app/immutable/chunks/PJfe_iA1.js +0 -1
- package/web/app/immutable/chunks/PXMyYXQv.js +0 -1
- package/web/app/immutable/chunks/Qi3HrsAm.js +0 -1
- package/web/app/immutable/chunks/S1FanOB0.js +0 -162
- package/web/app/immutable/chunks/SuMU9B9i.js +0 -1
- package/web/app/immutable/chunks/UaGv-ChR.js +0 -257
- package/web/app/immutable/chunks/YqyEOqRv.js +0 -178
- package/web/app/immutable/chunks/_MGNV7ZN.js +0 -338
- package/web/app/immutable/chunks/_lZu5Dth.js +0 -292
- package/web/app/immutable/chunks/gzjZWAx8.js +0 -62
- package/web/app/immutable/chunks/hqSEunOk.js +0 -15
- package/web/app/immutable/chunks/nGCCQCpO.js +0 -1
- package/web/app/immutable/chunks/o-kBqlaj.js +0 -7
- package/web/app/immutable/chunks/opO2fBQB.js +0 -1
- package/web/app/immutable/chunks/pdFamTTi.js +0 -7
- package/web/app/immutable/chunks/rEI8JpP3.js +0 -1
- package/web/app/immutable/chunks/s5P9UVzf.js +0 -1
- package/web/app/immutable/chunks/sIHUXgeh.js +0 -41
- package/web/app/immutable/entry/start.CCtO40vu.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bq as C,a_ as M,bo as P,by as un,bs as On,b as hn,bu as je}from"./7rNOGHzs.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as L,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as S,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Hn,a as Us,be as Tt,b$ as ft,bf as or}from"./B8o4lNgr.js";import{k as En,s as Ve,h as Pt,i as Ln,I as ir,a as ar,l as lr}from"./DmsDslNo.js";import{H as cn,E as Ws,c as Bs,t as Rt}from"./DzMmhJrp.js";import{b as on}from"./D2g8BuR1.js";import{Hq as Me,eD as Vs,eu as Ks,ev as js,o8 as qs,mY as Vt,n0 as cr,m$ as In,ex as Gs,u6 as Qs,u7 as Xs,u9 as Ys,FD as Js,Hv as Zs,qJ as eo,eC as to}from"./CRwmdgt6.js";import{c as no}from"./BEJX9KVN.js";import{F as Ne,a0 as ro,a7 as An,av as dr,aw as ur,bP as so,aN as oo,c9 as hr,bW as gr,cl as fr}from"./CFejQM6t.js";import{dl as io,bc as ao,L as lo,aB as mr,h as co}from"./KQTrHxko.js";import{L as pr}from"./Cek5DjPu.js";import{C as an}from"./DypB-Dwi.js";import{b5 as kr,bK as uo,bN as ho}from"./TQIai6Ne.js";import{q as $e,d as go,g as fo}from"./DQEBW0YT.js";import"./CQ4a5a4v.js";import{f as ke}from"./Bgegixo2.js";import{e as mo}from"./t3bi-ExW.js";import{T as Pr}from"./CnszEr0a.js";import{g as Nn}from"./DsNWmyox.js";import{C as po}from"./BGspgxWf.js";import{C as vo}from"./lfJ8pseq.js";import{s as vr}from"./_F3xl3RI.js";import{w as Dt}from"./DSjRkndX.js";import{P as _o,l as _r}from"./EZw3rvya.js";import{g as wo}from"./DCj0DpxQ.js";import{a2 as bo,S as yo}from"./B4dTn6xv.js";import{ar as So}from"./BBTS8ZOM.js";import{s as wr}from"./DjEB6QMF.js";import{a6 as Co,a5 as xo,a7 as ko}from"./BV9p4X5I.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,y=a?l+c*2:b;if(r=Math.max(r,y),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+y,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Ho=[0,1e-6,.99999,1],Lo={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Lo,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Ho,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,y=a+c+p;return!(r<b-l||r>y)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:y}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(y==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let y,A;b<=0?(y=b,A="bottom"):(y=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(y>=0&&(a.fileOffset<0||y<a.fileOffset)||y<0&&a.fileOffset<0&&y>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:y,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=C(r,"change",7),y=C(r,"foldUnchanged",7,!0),A=C(r,"allowHeadReads",7,!0),F=C(r,"canReadHeadFiles",7),G=C(r,"lineWrapping",7,!1),h=C(r,"scrollToLine",7),oe=C(r,"isAggregate",7,!1),Te=C(r,"showScrollHint",7,!1),ue=C(r,"onStageHunk",7),Q=C(r,"onUnstageHunk",7),at=C(r,"onOpenCommit",7),pt=C(r,"virtualizer",7),vt=C(r,"gitRootId",7,void 0),_t=C(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),ye=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(ye,!0)}function De(){m(ye,!1),m(Fe,!1),m(Ue,0)}function He(v){!e(ye)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(ye))&&(m(Fe,!1),m(Ue,0))});let Ht=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:yt,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let St;return Ke==="committed"?St=an.Committed:rt?St=an.Staged:St=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:St,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:yt},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Lt={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return y()},set foldUnchanged(v=!0){y(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},Le=To();let wt;var It=N(Le);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Ht)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return y()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var yt=S(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=S(At);L(Ke),L(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(yt,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(yt=>K(Qe,yt),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}L(Le),on(Le,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(Le,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(Le,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",Le,ie),sn("mouseleave",Le,De),sn("wheel",Le,He),ln("focusin",Le,jt),ln("focusout",Le,qt),w(f,Le);var mn=fn(Lt);return c(),mn}xr(["focusin","focusout"]);function yr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
1
|
+
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bq as C,a_ as M,bo as P,by as un,bs as On,b as hn,bu as je}from"./7rNOGHzs.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as H,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as S,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Ln,a as Us,be as Tt,b$ as ft,bf as or}from"./B8o4lNgr.js";import{k as En,s as Ve,h as Pt,i as Hn,I as ir,a as ar,l as lr}from"./DmsDslNo.js";import{H as cn,E as Ws,c as Bs,t as Rt}from"./DzMmhJrp.js";import{b as on}from"./D2g8BuR1.js";import{Hq as Me,eD as Vs,eu as Ks,ev as js,o8 as qs,mY as Vt,n0 as cr,m$ as In,ex as Gs,u6 as Qs,u7 as Xs,u9 as Ys,FD as Js,Hv as Zs,qJ as eo,eC as to}from"./CRwmdgt6.js";import{c as no}from"./BEJX9KVN.js";import{F as Ne,a0 as ro,a7 as An,av as dr,aw as ur,bP as so,aN as oo,c9 as hr,bW as gr,cl as fr}from"./CFejQM6t.js";import{dl as io,bc as ao,L as lo,aB as mr,h as co}from"./KQTrHxko.js";import{L as pr}from"./Cek5DjPu.js";import{C as an}from"./DypB-Dwi.js";import{b6 as kr,bL as uo,bO as ho}from"./Sd4DhpzB.js";import{q as $e,d as go,g as fo}from"./DAhqFWJw.js";import"./CQ4a5a4v.js";import{f as ke}from"./Bgegixo2.js";import{e as mo}from"./B1s3oEqm.js";import{T as Pr}from"./oEWQ7BWN.js";import{g as Nn}from"./DsNWmyox.js";import{C as po}from"./BGspgxWf.js";import{C as vo}from"./lfJ8pseq.js";import{s as vr}from"./Q48HTbqK.js";import{w as Dt}from"./DSjRkndX.js";import{P as _o,l as _r}from"./B7s4-XTz.js";import{g as wo}from"./DCj0DpxQ.js";import{a2 as bo,S as yo}from"./BUlPMLws.js";import{ar as So}from"./lG67Zx5D.js";import{s as wr}from"./BrV7vQ-C.js";import{a6 as Co,a5 as xo,a7 as ko}from"./BMMFveB2.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,y=a?l+c*2:b;if(r=Math.max(r,y),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+y,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Lo=[0,1e-6,.99999,1],Ho={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Ho,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Lo,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,y=a+c+p;return!(r<b-l||r>y)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:y}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(y==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let y,A;b<=0?(y=b,A="bottom"):(y=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(y>=0&&(a.fileOffset<0||y<a.fileOffset)||y<0&&a.fileOffset<0&&y>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:y,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Lr(f,r){if(new.target)return dn({component:Lr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=C(r,"change",7),y=C(r,"foldUnchanged",7,!0),A=C(r,"allowHeadReads",7,!0),F=C(r,"canReadHeadFiles",7),G=C(r,"lineWrapping",7,!1),h=C(r,"scrollToLine",7),oe=C(r,"isAggregate",7,!1),Te=C(r,"showScrollHint",7,!1),ue=C(r,"onStageHunk",7),Q=C(r,"onUnstageHunk",7),at=C(r,"onOpenCommit",7),pt=C(r,"virtualizer",7),vt=C(r,"gitRootId",7,void 0),_t=C(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),ye=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(ye,!0)}function De(){m(ye,!1),m(Fe,!1),m(Ue,0)}function Le(v){!e(ye)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(ye))&&(m(Fe,!1),m(Ue,0))});let Lt=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:yt,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let St;return Ke==="committed"?St=an.Committed:rt?St=an.Staged:St=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:St,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:yt},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Ht={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return y()},set foldUnchanged(v=!0){y(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},He=To();let wt;var It=N(He);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Lt)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return y()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var yt=S(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=S(At);H(Ke),H(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(yt,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(yt=>K(Qe,yt),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}H(He),on(He,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(He,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(He,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",He,ie),sn("mouseleave",He,De),sn("wheel",He,Le),ln("focusin",He,jt),ln("focusout",He,qt),w(f,He);var mn=fn(Ht);return c(),mn}xr(["focusin","focusout"]);function yr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
2
2
|
`):[],a=r?r.split(`
|
|
3
3
|
`):[];if(l.length===0&&a.length===0)return[];const c=[];for(const p of l)c.push({type:"Deletion",content:p});for(const p of a)c.push({type:"Addition",content:p});return[{oldStart:1,oldLines:l.length,newStart:1,newLines:a.length,lines:c}]}function Mo(f){if(!f||f.length===0)return[];const r=[];for(const a of f){let c=a.change.chunks||[];c.length===0&&(a.change.oldContent!=null||a.change.newContent!=null)&&(c=zo(a.change.oldContent??"",a.change.newContent??"")),c.forEach((p,b)=>{r.push({hunk:p,stage:a.category,part:a,hunkIndex:b})})}if(r.length===0)return[];r.sort((a,c)=>a.hunk.newStart-c.hunk.newStart);const l=[];for(const{hunk:a,stage:c,hunkIndex:p}of r){const y=Do(a).map(A=>({type:A.type,content:A.content,oldLineNumber:A.oldLineNumber,newLineNumber:A.newLineNumber,stage:c,hunkIndex:p}));l.push({headStart:a.oldStart,headLines:a.oldLines,wtStart:a.newStart,wtLines:a.newLines,lines:y,stages:new Set([c])})}return $o(l)}function $o(f){if(f.length<=1)return f;const r=[];let l=f[0];for(let a=1;a<f.length;a++){const c=f[a],p=l.wtStart+l.wtLines;c.wtStart<=p+3?l=Fo(l,c):(r.push(l),l=c)}return r.push(l),r}function Fo(f,r){const l=new Map,a=new Map,c=new Set;for(const h of f.lines)c.add(yr(h)),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h);const p=[...f.lines];for(const h of r.lines){const oe=yr(h);if(!c.has(oe)){if(h.type==="Context"){const Te=h.newLineNumber!==void 0?l.get(h.newLineNumber):void 0,ue=h.oldLineNumber!==void 0?a.get(h.oldLineNumber):void 0;if(Te?.type==="Context"||ue?.type==="Context"){c.add(oe);continue}}p.push(h),c.add(oe),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h)}}p.sort((h,oe)=>{const Te=h.newLineNumber??h.oldLineNumber??0,ue=oe.newLineNumber??oe.oldLineNumber??0;return Te-ue});const b=new Set([...f.stages,...r.stages]),y=Math.min(f.headStart,r.headStart),A=Math.min(f.wtStart,r.wtStart),F=Math.max(f.headStart+f.headLines,r.headStart+r.headLines),G=Math.max(f.wtStart+f.wtLines,r.wtStart+r.wtLines);return{headStart:y,headLines:F-y,wtStart:A,wtLines:G-A,lines:p,stages:b}}function Uo(f){const r=[],l=[];let a=f[0]?.headStart??1,c=f[0]?.wtStart??1;const p=(b,y,A)=>{let F=y;for(;F<A;)b.push(""),F++;return F};for(const b of f){a=p(r,a,b.headStart),c=p(l,c,b.wtStart);for(const y of b.lines)y.type==="Context"?(y.oldLineNumber!==void 0&&(a=p(r,a,y.oldLineNumber)),y.newLineNumber!==void 0&&(c=p(l,c,y.newLineNumber)),r.push(y.content),l.push(y.content),a++,c++):y.type==="Deletion"?(y.oldLineNumber!==void 0&&(a=p(r,a,y.oldLineNumber)),r.push(y.content),a++):y.type==="Addition"&&(y.newLineNumber!==void 0&&(c=p(l,c,y.newLineNumber)),l.push(y.content),c++)}return{oldContent:r.join(`
|
|
4
4
|
`),newContent:l.join(`
|
|
5
|
-
`)}}var Wo=T('<div class="flex items-center justify-start py-8 text-left text-sm text-subtle"> </div>'),Bo=T('<div class="unified-multi-stage-diff svelte-16i1ho7"><!></div>'),Vo=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>');function
|
|
5
|
+
`)}}var Wo=T('<div class="flex items-center justify-start py-8 text-left text-sm text-subtle"> </div>'),Bo=T('<div class="unified-multi-stage-diff svelte-16i1ho7"><!></div>'),Vo=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>');function Hr(f,r){if(new.target)return dn({component:Hr,...f});gn(r,!0);const l=()=>je(Te,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=C(r,"parts",7),y=C(r,"foldUnchanged",7,!0),A=C(r,"lineWrapping",7,!1),F=C(r,"onStageHunk",7),G=C(r,"onUnstageHunk",7),h=C(r,"onOpenCommit",7),oe=C(r,"virtualizer",7);h();const Te=kr(),ue=u(()=>Mo(b())),Q=u(()=>Uo(e(ue))),at=u(()=>b()[0]?.change.filePath||P.chat_toolClassifier_file_subject()),pt=u(()=>e(ue)[0]?.wtStart??1),vt=u(()=>{let $=0,ie=0;for(const De of e(ue))for(const Le of De.lines)Le.type==="Addition"?$++:Le.type==="Deletion"&&ie++;return{id:`merged-${e(at)}`,file:e(at),relativePath:e(at),stage:an.Unstaged,stats:{additions:$,deletions:ie},attribution:{timestamp:0},content:{oldContent:e(Q).oldContent,newContent:e(Q).newContent}}});var _t={get parts(){return b()},set parts($){b($),x()},get foldUnchanged(){return y()},set foldUnchanged($=!0){y($),x()},get lineWrapping(){return A()},set lineWrapping($=!1){A($),x()},get onStageHunk(){return F()},set onStageHunk($){F($),x()},get onUnstageHunk(){return G()},set onUnstageHunk($){G($),x()},get onOpenCommit(){return h()},set onOpenCommit($){h($),x()},get virtualizer(){return oe()},set virtualizer($){oe($),x()},$set:un,$on:($,ie)=>hn(r,$,ie)},ve=nt(),Re=ne(ve);{var ye=$=>{var ie=Wo(),De=de(ie,!0);z(Le=>K(De,Le),[()=>P.chat_unifiedMultiStageDiff_noChanges_label()]),w($,ie)},Fe=$=>{var ie=Bo(),De=N(ie);{let Le=u(()=>l()?"split":"unified");Pr(De,{get change(){return e(vt)},get workspaceId(){return p},get viewMode(){return e(Le)},get foldUnchanged(){return y()},get lineWrapping(){return A()},get onStageHunk(){return F()},get onUnstageHunk(){return G()},useProvidedContent:!0,get lineOffset(){return e(pt)},get virtualizer(){return oe()}})}H(ie),w($,ie)},Ue=$=>{var ie=Vo(),De=de(ie,!0);z(Le=>K(De,Le),[()=>P.chat_unifiedMultiStageDiff_noWorkspace_label()]),w($,ie)};M(Re,$=>{e(ue).length===0?$(ye):p?$(Fe,1):$(Ue,-1)})}w(f,ve);var qe=fn(_t);return c(),qe}function Ir(f,r){if(new.target)return dn({component:Ir,...f});gn(r,!0);let l=C(r,"parts",7),a=C(r,"foldUnchanged",7,!0),c=C(r,"lineWrapping",7,!1),p=C(r,"isAggregate",7,!1),b=C(r,"onStageHunk",7),y=C(r,"onUnstageHunk",7),A=C(r,"onOpenCommit",7),F=C(r,"virtualizer",7);p();var G={get parts(){return l()},set parts(h){l(h),x()},get foldUnchanged(){return a()},set foldUnchanged(h=!0){a(h),x()},get lineWrapping(){return c()},set lineWrapping(h=!1){c(h),x()},get isAggregate(){return p()},set isAggregate(h=!1){p(h),x()},get onStageHunk(){return b()},set onStageHunk(h){b(h),x()},get onUnstageHunk(){return y()},set onUnstageHunk(h){y(h),x()},get onOpenCommit(){return A()},set onOpenCommit(h){A(h),x()},get virtualizer(){return F()},set virtualizer(h){F(h),x()},$set:un,$on:(h,oe)=>hn(r,h,oe)};return Hr(f,{get parts(){return l()},get foldUnchanged(){return a()},get lineWrapping(){return c()},get onStageHunk(){return b()},get onUnstageHunk(){return y()},get onOpenCommit(){return A()},get virtualizer(){return F()}}),fn(G)}function mt(){return P.chat_changesPanel_lockedFile_tooltip()}var Ko=T(" <!>",1),jo=T('<p class="text-sm font-medium text-foreground leading-snug"> </p>'),Sr=T("<span> </span>"),qo=T('<span class="text-ghost">·</span> <span> </span>',1),Go=T('<span class="text-ghost">·</span> <span class="inline-flex items-center gap-0.5 font-mono"> <!></span>',1),Qo=T('<p class="text-xs text-subtle whitespace-pre-wrap leading-relaxed pt-0.5"> </p>'),Xo=T('<span class="shrink-0"><!></span> <span class="truncate"> </span>',1),Yo=T('<!> <span class="truncate"> </span>',1),Jo=T('<div class="flex items-center gap-2.5 min-w-0"><!> <!></div>'),Zo=T('<div class="mb-3"><div class="flex items-center gap-2.5 py-2"><div class="flex-1 min-w-0 space-y-1"><!> <div class="flex items-center gap-1.5 text-ui text-subtle flex-wrap"><!> <!> <!></div> <!> <!></div> <div class="shrink-0 w-7 h-7 rounded-full bg-muted-foreground/15 flex items-center justify-center text-ui font-medium text-subtle select-none overflow-hidden"><!></div></div></div>'),Cr=T('<mark class="rounded-sm bg-warning/10 px-0.5 text-foreground"> </mark>'),ei=T('<span class="text-xs text-subtle truncate hidden sm:inline shrink-6"></span>'),ti=T('<span role="img"><!></span>'),ni=T('<span class="text-sm truncate shrink-0 max-w-full"></span> <!> <!> <!> <!> <!>',1),ri=T("<!> <!> <!>",1),si=T("<!> <!>",1),oi=T('<div class="flex h-[300px] items-center justify-start text-left text-subtle"><!> </div>'),ii=T('<div class="border-t border-border [&_.tracked-change-diff-viewer]:overflow-visible!"><!></div>'),ai=T('<div><div><!> <div class="absolute right-2 flex items-center gap-px"><div class="flex items-center gap-px bg-background opacity-0 group-hover:opacity-100 transition-opacity"><!> <!> <!></div> <label class="shrink-0 flex items-center gap-1.5 cursor-pointer ml-1"><!> <span class="text-xs text-subtle"> </span></label></div></div> <!></div>'),li=T('<p class="px-5 py-2 text-xs text-muted-foreground" role="status"> </p>'),ci=T('<div class="rounded-lg border border-border bg-card p-4"><div class="flex items-center justify-between mb-3"><div class="flex items-center gap-2 flex-1"><!> <!></div> <!></div> <div class="space-y-2"><!> <!> <!></div></div>'),di=T('<div class="flex flex-col gap-3 py-6"></div>'),ui=T('<div class="flex h-full items-center justify-start py-6 text-left text-subtle"> </div>'),hi=T('<span class="text-subtle">·</span> <span> </span>',1),gi=T('<div class="flex items-center gap-0.5 rounded-md border border-border bg-muted/50 p-0.5 -my-1"><!> <!></div>'),fi=T('<!> <div class="shrink-0 w-5 h-5 rounded-full bg-muted-foreground/15 flex items-center justify-center text-ui font-medium text-subtle select-none overflow-hidden"><!></div> <span class="text-sm font-medium text-foreground truncate flex-1 min-w-0"> </span>',1),mi=T('<span> </span> <span class="text-ghost">·</span>',1),pi=T('<div class="flex flex-col gap-2 mt-2 mx-2"></div>'),vi=T('<div class="mb-2"><div class="sticky top-[31.5px] z-[11] bg-background rounded-md"><div class="flex items-center gap-2 w-full px-3 py-2 rounded-md bg-muted/30"><!> <span class="text-ui text-subtle shrink-0 flex items-center gap-1.5"><!> <span> </span></span> <!></div></div> <!></div>'),_i=T('<div class="sticky top-0 z-20 -mx-5 px-5"><div class="flex items-center justify-between py-2 bg-background border-b border-border"><div class="flex items-center justify-start gap-1.5 whitespace-nowrap text-left text-xs font-medium text-subtle"><span> </span> <!> <!> <!></div> <div class="flex items-center gap-2"><!></div></div></div> <div class="flex flex-col gap-2 py-6"><!></div>',1),wi=T('<div class="h-full w-full flex flex-col overflow-hidden relative" tabindex="-1"><!> <!> <div class="h-full overflow-auto p-5 pt-0"><div><!> <!></div></div></div>');function bi(f,r){if(new.target)return dn({component:bi,...f});gn(r,!0);const l=()=>je(e(mn),"$agentSession$",h),a=()=>je(vt,"$workspace$",h),c=()=>je(_t,"$lockedFilePaths$",h),p=()=>je(zt,"$changes$",h),b=()=>je(At,"$consumer$",h),y=()=>je(Mt,"$refreshingPaths$",h),A=()=>je(Xe,"$ftCommits$",h),F=()=>je(at,"$foldUnchanged",h),G=()=>je(pt,"$lineWrapping",h),[h,oe]=On(),Te=t=>{const n=u(()=>Zn(D()?.authorEmail));var s=Zo(),i=N(s),o=N(i),d=N(o);{var g=_=>{{let R=u(()=>P.chat_changesPanel_openOnGitHub_title());ke(_,{type:"button",variant:"link",class:"h-auto justify-start px-0 text-sm font-medium text-foreground hover:text-accent-foreground hover:underline underline-offset-2 text-left cursor-pointer transition-colors leading-snug",onclick:Ss,get title(){return e(R)},children:(O,X)=>{Tt();var J=Ko(),I=ne(J),E=S(I);Ne(E,{get icon(){return An},class:"inline-block w-2.5 h-2.5 ml-1 opacity-40"}),z(V=>K(I,`${V??""} `),[()=>D()?.message?.split(`
|
|
6
6
|
`)[0]||P.chat_changesPanel_untitledCommit_fallback()]),w(O,J)},$$slots:{default:!0}})}},k=u(()=>e(Cs)()),W=_=>{var R=jo(),O=de(R,!0);z(X=>K(O,X),[()=>D()?.message?.split(`
|
|
7
|
-
`)[0]||P.chat_changesPanel_untitledCommit_fallback()]),w(_,R)};M(d,_=>{e(k)?_(g):_(W,-1)})}var
|
|
7
|
+
`)[0]||P.chat_changesPanel_untitledCommit_fallback()]),w(_,R)};M(d,_=>{e(k)?_(g):_(W,-1)})}var L=S(d,2),se=N(L);{var Ce=_=>{var R=Sr(),O=de(R,!0);z(()=>K(O,D().author)),w(_,R)};M(se,_=>{D()?.author&&_(Ce)})}var ae=S(se,2);{var ze=_=>{var R=qo(),O=S(ne(R),2),X=de(O,!0);z(J=>{Ve(O,"title",D().date),K(X,J)},[()=>wr(D().date)]),w(_,R)};M(ae,_=>{D()?.date&&_(ze)})}var Je=S(ae,2);{var kt=_=>{var R=Go(),O=S(ne(R),2),X=N(O),J=S(X);{let I=u(()=>P.chat_changesPanel_copyFullSha_title());vo(J,{get text(){return D().hash},get label(){return e(I)},class:"size-5 text-muted-foreground"})}H(O),z(I=>K(X,`${I??""} `),[()=>D().hash.substring(0,7)]),w(_,R)};M(Je,_=>{D()?.hash&&_(kt)})}H(L);var Ot=S(L,2);{var ht=_=>{const R=u(()=>D().message.split(`
|
|
8
8
|
`).slice(1).join(`
|
|
9
9
|
`).trim());var O=nt(),X=ne(O);{var J=I=>{var E=Qo(),V=de(E,!0);z(()=>K(V,e(R))),w(I,E)};M(X,I=>{e(R)&&I(J)})}w(_,O)},Nt=u(()=>D()?.message&&D().message.includes(`
|
|
10
|
-
`));M(Ot,_=>{e(Nt)&&_(ht)})}var te=S(Ot,2);{var he=_=>{var R=Jo(),O=N(R);{var X=E=>{const V=u(()=>D()?.agentId||ye()),ge=u(()=>Me.state),fe=u(()=>Q),U=u(()=>e(V)&&e(fe)?mr.select(e(ge),e(V)):void 0),Z=u(()=>e(U)?.name&&e(U).name!=="New Workspace Agent"?e(U).name:P.chat_shared_agentName_fallback());{let Ie=u(()=>P.chat_changesPanel_openAgent_title());ke(E,{type:"button",variant:"plain",class:"flex items-center gap-1 text-ui text-muted-foreground hover:text-foreground transition-colors cursor-pointer min-w-0",onclick:ee=>ys(ee),get title(){return e(Ie)},children:(ee,ce)=>{var Ae=Xo(),Ee=ne(Ae),Ze=N(Ee);{let pe=u(()=>e(V)??void 0);mo(Ze,{get agentId(){return e(pe)},size:14})}L(Ee);var me=S(Ee,2),le=de(me,!0);z(()=>K(le,e(Z))),w(ee,Ae)},$$slots:{default:!0}})}};M(O,E=>{(D()?.agentId||ye())&&E(X)})}var J=S(O,2);{var I=E=>{const V=u(()=>yo.select(Me.state,Q,D().linkedNoteId)),ge=u(()=>e(V)?.title||P.chat_changesPanel_note_fallback());{let fe=u(()=>P.chat_changesPanel_openLinkedNote_title());ke(E,{type:"button",variant:"plain",class:"flex items-center gap-1 text-ui text-muted-foreground hover:text-foreground transition-colors cursor-pointer min-w-0",onclick:U=>Lt()?.(D()?.linkedNoteId,U),get title(){return e(fe)},children:(U,Z)=>{var Ie=Yo(),ee=ne(Ie);Ne(ee,{get icon(){return co},class:"w-2.5 h-2.5 shrink-0"});var ce=S(ee,2),Ae=de(ce,!0);z(()=>K(Ae,e(ge))),w(U,Ie)},$$slots:{default:!0}})}};M(J,E=>{D()?.linkedNoteId&&Lt()&&E(I)})}L(R),w(_,R)};M(te,_=>{(D()?.agentId||ye()||D()?.linkedNoteId)&&_(he)})}L(o);var xe=S(o,2),be=N(xe);{var B=_=>{{const R=X=>{Tt();var J=ft();z(I=>K(J,I),[()=>tn(D()?.author)]),w(X,J)};let O=u(()=>D()?.author||"");_r(_,{get identity(){return e(n)},get alt(){return e(O)},size:28,class:"w-full h-full object-cover",fallback:R,$$slots:{fallback:!0}})}},j=_=>{var R=ft();z(O=>K(R,O),[()=>tn(D()?.author)]),w(_,R)};M(be,_=>{e(n)?_(B):_(j,-1)})}L(xe),L(i),L(s),z(()=>Ve(xe,"title",D()?.author||"")),w(t,s)},ue=(t,n=or,s=or)=>{const i=u(()=>Tr(n().filePath)),o=u(()=>ve(n())),d=u(()=>e(Ct).has(n().filePath)),g=u(()=>rt(n().filePath)),k=u(()=>s()?"64px":"31.5px");var W=ai(),H=N(W),se=N(H);ke(se,{variant:"plain",onclick:()=>Gr(e(o)),class:"flex min-w-0 flex-1 shrink cursor-pointer items-center justify-start gap-2 text-left",children:(j,_)=>{var R=ni(),O=ne(R);Pt(O,21,()=>Xn(cr(e(i))),Ln,(ee,ce)=>{var Ae=nt(),Ee=ne(Ae);{var Ze=le=>{var pe=Cr(),Oe=de(pe,!0);z(()=>K(Oe,e(ce).text)),w(le,pe)},me=le=>{var pe=ft();z(()=>K(pe,e(ce).text)),w(le,pe)};M(Ee,le=>{e(ce).isMatch?le(Ze):le(me,-1)})}w(ee,Ae)}),L(O);var X=S(O,2);{let ee=u(()=>e(Se).has(e(o))?dr:ur);Ne(X,{get icon(){return e(ee)},class:"text-subtle w-2.5! h-2.5! shrink-0"})}var J=S(X,2);{var I=ee=>{var ce=ei();Pt(ce,21,()=>Xn(In(e(i))),Ln,(Ae,Ee)=>{var Ze=nt(),me=ne(Ze);{var le=Oe=>{var We=Cr(),Pn=de(We,!0);z(()=>K(Pn,e(Ee).text)),w(Oe,We)},pe=Oe=>{var We=ft();z(()=>K(We,e(Ee).text)),w(Oe,We)};M(me,Oe=>{e(Ee).isMatch?Oe(le):Oe(pe,-1)})}w(Ae,Ze)}),L(ce),w(ee,ce)},E=u(()=>In(e(i)));M(J,ee=>{e(E)&&ee(I)})}var V=S(J,2);pr(V,{get additions(){return n().additions},get deletions(){return n().deletions},size:"xs"});var ge=S(V,2);{var fe=ee=>{var ce=ti(),Ae=N(ce);Ne(Ae,{get icon(){return so},class:"w-2.5 h-2.5 text-subtle shrink-0"}),L(ce),z((Ee,Ze)=>{Ve(ce,"aria-label",Ee),Ve(ce,"title",Ze)},[()=>mt(),()=>mt()]),w(ee,ce)};M(ge,ee=>{e(g)&&ee(fe)})}var U=S(ge,2);{var Z=ee=>{ir(ee,{size:12,class:"text-ghost shrink-0"})},Ie=u(()=>e(Ar).has(n().filePath));M(U,ee=>{e(Ie)&&ee(Z)})}z(()=>Ve(O,"title",e(i))),w(j,R)},$$slots:{default:!0}});var Ce=S(se,2),ae=N(Ce),ze=N(ae);{var Je=j=>{var _=nt(),R=ne(_);{var O=I=>{var E=ri(),V=ne(E);{let U=u(()=>e(g)?mt():P.chat_changesPanel_stageUnstaged_tooltip());ke(V,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),ie()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return hr},class:"w-3 h-3"})},$$slots:{default:!0}})}var ge=S(V,2);{let U=u(()=>e(g)?mt():P.chat_changesPanel_unstageStaged_tooltip());ke(ge,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),De()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return gr},class:"w-3 h-3"})},$$slots:{default:!0}})}var fe=S(ge,2);{let U=u(()=>e(g)?mt():P.chat_changesPanel_revertUnstaged_tooltip());ke(fe,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),He()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return fr},class:"w-3 h-3"})},$$slots:{default:!0}})}w(I,E)},X=I=>{{let E=u(()=>e(g)?mt():P.chat_changesPanel_unstageFile_tooltip());ke(I,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(E)},get disabled(){return e(g)},onclick:V=>{V.stopPropagation(),De()?.(n().filePath)},children:(V,ge)=>{Ne(V,{get icon(){return gr},class:"w-3 h-3"})},$$slots:{default:!0}})}},J=I=>{var E=si(),V=ne(E);{let fe=u(()=>e(g)?mt():P.chat_changesPanel_stageFile_tooltip());ke(V,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(fe)},get disabled(){return e(g)},onclick:U=>{U.stopPropagation(),ie()?.(n().filePath)},children:(U,Z)=>{Ne(U,{get icon(){return hr},class:"w-3 h-3"})},$$slots:{default:!0}})}var ge=S(V,2);{let fe=u(()=>e(g)?mt():P.chat_changesPanel_revertChanges_tooltip());ke(ge,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(fe)},get disabled(){return e(g)},onclick:U=>{U.stopPropagation(),He()?.(n().filePath)},children:(U,Z)=>{Ne(U,{get icon(){return fr},class:"w-3 h-3"})},$$slots:{default:!0}})}w(I,E)};M(R,I=>{n().isMerged?I(O):n().staged?I(X,1):n().category!=="committed"&&I(J,2)})}w(j,_)};M(ze,j=>{e(_e)&&j(Je)})}var kt=S(ze,2);{let j=u(()=>P.chat_changesPanel_viewCurrentDiff_tooltip());ke(kt,{variant:"ghost-light",size:"icon-xs",get disabled(){return e(v)},get tooltip(){return e(j)},onclick:_=>{_.stopPropagation(),jr(n().filePath,_)},children:(_,R)=>{Ne(_,{get icon(){return oo},class:"w-3 h-3"})},$$slots:{default:!0}})}var Ot=S(kt,2);{let j=u(()=>P.chat_changesPanel_openFile_tooltip());ke(Ot,{variant:"ghost-light",size:"icon-xs",get disabled(){return e(v)},get tooltip(){return e(j)},onclick:_=>{_.stopPropagation(),qr(n().filePath,_)},children:(_,R)=>{Ne(_,{get icon(){return An},class:"w-3 h-3"})},$$slots:{default:!0}})}L(ae);var ht=S(ae,2),Nt=N(ht);{let j=u(()=>e(d)?P.chat_changesPanel_markNotViewed_title():P.chat_changesPanel_markViewed_title());po(Nt,{get checked(){return e(d)},onCheckedChange:()=>ts(n().filePath,e(o)),size:"sm",get ariaLabel(){return e(j)}})}var te=S(Nt,2),he=de(te,!0);L(ht),L(Ce),L(H),ar(H,j=>Kr?.(j));var xe=S(H,2);{var be=j=>{var _=ii(),R=N(_);{var O=I=>{var E=nt(),V=ne(E);{var ge=U=>{{let Z=u(()=>e(_e)&&!e(g)?Un:void 0),Ie=u(()=>e(_e)&&!e(g)?Wn:void 0);Ir(U,{get parts(){return n().allParts},get foldUnchanged(){return F()},get lineWrapping(){return G()},get isAggregate(){return e(Qe)},get onStageHunk(){return e(Z)},get onUnstageHunk(){return e(Ie)},onOpenCommit:yn,get virtualizer(){return e(Ft)}})}},fe=U=>{const Z=u(()=>Vt(n()));{let Ie=u(()=>!e(v)),ee=u(()=>e(Vn)?.filePath===n().filePath?e(Vn)?.lineNumber:void 0),ce=u(()=>e(_e)&&!e(g)&&e(Z)==="unstaged"?Un:void 0),Ae=u(()=>e(_e)&&!e(g)&&e(Z)==="staged"?Wn:void 0),Ee=u(()=>e(Z)==="committed"?yn:void 0);Hr(U,{get allowHeadReads(){return e(Ie)},canReadHeadFiles:()=>no(Me.state,ye()),get change(){return n()},get foldUnchanged(){return F()},get lineWrapping(){return G()},get scrollToLine(){return e(ee)},get isAggregate(){return e(Qe)},get onStageHunk(){return e(ce)},get onUnstageHunk(){return e(Ae)},get onOpenCommit(){return e(Ee)},get virtualizer(){return e(Ft)},get gitRootId(){return Ge()},get gitRootPath(){return bt()}})}};M(V,U=>{n().isMerged&&n().allParts&&n().allParts.length>1?U(ge):U(fe,-1)})}w(I,E)},X=u(()=>e(st).has(e(o))),J=I=>{var E=oi(),V=N(E);ir(V,{size:16,class:"mr-2"});var ge=S(V);L(E),z(fe=>K(ge,` ${fe??""}`),[()=>P.chat_changesPanel_loadingDiff_label()]),w(I,E)};M(R,I=>{e(X)?I(O):I(J,-1)})}L(_),ar(_,(I,E)=>Vr?.(I,E),()=>e(o)),cn(3,_,()=>vr,()=>({tier:"moderate"})),w(j,_)},B=u(()=>e(Se).has(e(o)));M(xe,j=>{e(B)&&j(be)})}L(W),z((j,_,R,O)=>{En(W,1,`mb-4 bg-sidebar border border-border rounded-lg overflow-clip transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none ${e(d)?"opacity-50":""}`),lr(W,`overflow-anchor: none; --change-file-sticky-top: ${e(k)??""};`),Ve(W,"data-change-card-key",e(o)),En(H,1,`flex items-center gap-2 px-0 py-1.5 group relative sticky z-10 bg-sidebar ${j??""} ${e(Zt)===e(o)?"ring-2 ring-blue-400/70 bg-blue-500/10":""}`),lr(H,`top: ${e(k)??""}; border-bottom: 1px solid ${_??""}`),Ve(H,"data-change-header-key",e(o)),Ve(H,"data-change-sticky-top",e(k)),Ve(H,"data-change-search-text",e(i)),Ve(ht,"title",R),K(he,O)},[()=>e(Jt).has(e(o))?"ring-1 ring-warning/30 bg-warning/10":"",()=>e(Se).has(e(o))?"var(--border)":"transparent",()=>e(d)?P.chat_changesPanel_markNotViewed_title():P.chat_changesPanel_markViewed_title(),()=>P.chat_changesPanel_viewed_label()]),ln("click",ht,j=>j.stopPropagation()),w(t,W)},Q=Nn()?.workspaceId??"",at=uo(),pt=ho(),vt=io(Q),_t=So(Q);function ve(t){return e(re)&&t.commitHash?`${t.filePath}-${t.commitHash}`:t.filePath}let Re=C(r,"changes",7),ye=C(r,"agentId",7,null),Fe=C(r,"isAggregate",7,!1),Ue=C(r,"onOpenAgent",7),qe=C(r,"showStagingControls",7,!1),$=C(r,"showCategoryFilter",7,!1),ie=C(r,"onStage",7),De=C(r,"onUnstage",7),He=C(r,"onRevert",7),jt=C(r,"onStageAll",7),qt=C(r,"onUnstageAll",7),Ht=C(r,"isLoading",7,!1),D=C(r,"commitInfo",7,null),Lt=C(r,"onOpenNote",7),Le=C(r,"groupByCommit",7,!1),wt=C(r,"branchBaseRef",7,null),It=C(r,"branchBaseCommitSha",7,null),Ge=C(r,"gitRootId",7,void 0),bt=C(r,"gitRootPath",7,void 0);const mn=u(()=>mr(ye()??"")),v=u(()=>!!ye()&&(!l()||qs(l()))),_e=u(()=>qe()&&!e(v)&&!lo(a())),Qe=u(()=>Fe()&&!e(v)),yt=u(()=>e(v)&&l()?.nodeState==="offline");let re=Y(tt(Le()));const Xe=ao(Q);function rt(t){const n=a(),s=n?.worktreePath||n?.repositoryPath;return eo(c(),t,s)}const Ke=crypto.randomUUID(),At=Co(Q,Ke),zt=xo(Q,Ke),Mt=ko(Q,Ke),St=u(()=>e(v)?Re():p()),Tn=u(()=>b()?.status==="pending"),Ar=u(()=>new Set(y()));Be(()=>{Me.dispatch(Vs(Q,Ke,crypto.randomUUID(),{changes:Re(),agentId:ye(),showStagingControls:e(_e),isAggregate:e(Qe),groupByCommit:e(re),nodeOwnedPaths:e(v),branchBaseRef:wt()??void 0,branchBaseCommitSha:It()??void 0,gitRootId:Ge(),gitRootPath:bt()}))}),sr(()=>Me.dispatch(Gs(Q,Ke)));function Er(){return Q?bo.select(Me.state,Q):{}}function Dn(t){return e(_n).filter(s=>s.filePath===t&&s.commitHash).map(s=>s.commitHash).sort().join(",")}let pn=!1;Be(()=>{const t=e(we);if(!Q||t.length===0||pn)return;const s=Er();if(Object.keys(s).length===0){pn=!0;return}const i=new Set;for(const[o,d]of Object.entries(s))Dn(o)===d&&i.add(o);if(pn=!0,i.size>0){m(Ct,i,!0);const o=new Set(e(Se));for(const d of e(we))i.has(d.filePath)&&o.delete(ve(d));m(Se,o,!0)}});let vn=Y(!1);Be(()=>{if(e(vn))return;const t=e(Tn),n=gt(()=>e(we).length>0);!Ht()&&!t&&n&&m(vn,!0)});const Or=u(()=>(Ht()||e(Tn))&&!e(vn));let Nr=Y(tt(new Set(["unstaged","staged","committed"]))),Gt=Y(tt({unstaged:0,staged:0,committed:0}));Be(()=>{let t=0,n=0,s=0;for(const i of e(we))if(i.isMerged&&i.allParts)for(const o of i.allParts)o.category==="unstaged"?t++:o.category==="staged"?n++:o.category==="committed"&&s++;else{const o=i.category||(i.staged?"staged":"unstaged");o==="unstaged"?t++:o==="staged"?n++:o==="committed"&&s++}(t!==e(Gt).unstaged||n!==e(Gt).staged||s!==e(Gt).committed)&&m(Gt,{unstaged:t,staged:n,committed:s},!0)});function Tr(t){const n=a(),s=n?.worktreePath||n?.repositoryPath;if(s){const i=Zs(t,s);if(i!==t)return i||t}if(t.startsWith("/")){const i=["/src/","/lib/","/app/","/components/","/features/","/routes/"];for(const o of i){const d=t.indexOf(o);if(d!==-1)return t.slice(d+1)}return t.split("/").pop()||t}return t}let Dr=u(()=>$()?e(St).filter(t=>e(Nr).has(Vt(t))):e(St));function zn(t){if(!t)return{filename:"",directory:""};const n=t.replace(/\/+$/,""),s=n.lastIndexOf("/");return s===-1?{filename:n,directory:""}:{filename:n.substring(s+1),directory:n.substring(0,s)}}function zr(t){return[...t].sort((n,s)=>{const i=zn(n.filePath),o=zn(s.filePath);return i.directory!==o.directory?i.directory.localeCompare(o.directory):i.filename.localeCompare(o.filename)})}let _n=u(()=>e(Dr));function Mr(t){const n=new Map;for(const i of t){const o=Vt(i),d=n.get(i.filePath)||{};o==="committed"?(d.committed||(d.committed=[]),d.committed.push(i)):o==="staged"?d.staged=i:d.unstaged=i,n.set(i.filePath,d)}const s=[];for(const[i,o]of n){const d=[];if(o.staged&&d.push({change:o.staged,category:"staged"}),o.unstaged&&d.push({change:o.unstaged,category:"unstaged"}),o.committed)for(const H of o.committed)d.push({change:H,category:"committed"});let g=0,k=0;for(const H of d)g+=H.change.additions||0,k+=H.change.deletions||0;const W=o.staged||o.unstaged;if(W&&d.length>1){const H=o.unstaged||o.staged||o.committed?.[0];H&&s.push({...H,filePath:i,isMerged:!0,stagedPart:o.staged,unstagedPart:o.unstaged,allParts:d,additions:g,deletions:k,category:void 0,staged:void 0})}else if(d.length===1)s.push(d[0].change);else if(!W&&o.committed&&o.committed.length>0)if(e(re))for(const H of o.committed)s.push(H);else if(o.committed.length===1)s.push(o.committed[0]);else{const H=o.committed[0];s.push({...H,filePath:i,isMerged:!0,allParts:d,additions:g,deletions:k,category:void 0,staged:void 0})}}return s}let Mn="",we=Y(tt([]));Be(()=>{const t=zr(e(_e)?Mr(e(_n)):e(_n)),n=`gbc:${e(re)}::`+t.map(s=>{const i=s.gitlink?`|gl:${s.gitlink.oldSha||""}:${s.gitlink.newSha||""}`:"",o=`${s.filePath}|${s.category||s.staged}|${s.isMerged||!1}|${s.additions||0}|${s.deletions||0}${i}`;if(s.isMerged){const d=s.stagedPart?`${s.stagedPart.additions||0}:${s.stagedPart.deletions||0}`:"none",g=s.unstagedPart?`${s.unstagedPart.additions||0}:${s.unstagedPart.deletions||0}`:"none";return`${o}|s:${d}|u:${g}`}return o}).join(";;");!e(v)&&n===Mn||(Mn=n,m(we,t,!0))});const $r=30,Fr=10;let Se=Y(tt(new Set)),wn=Y(null),st=Y(tt(new Set)),Ct=Y(tt(new Set)),$n=u(()=>e(Ct).size),bn=u(()=>new Set(e(we).map(t=>t.filePath)).size),Ur=u(()=>e(we).reduce((t,n)=>t+(n.additions??0),0)),Wr=u(()=>e(we).reduce((t,n)=>t+(n.deletions??0),0)),Br=u(()=>Re().some(t=>Vt(t)==="committed")),Qt=u(()=>{const t=new Set;for(const n of Re())n.commitHash&&t.add(n.commitHash);return t.size}),ot=Y(tt(new Set)),lt=u(()=>{if(!e(re))return null;const t=[],n=new Map,s=A()||[];for(const i of e(we))if(i.commitHash){const o=n.get(i.commitHash);if(o!==void 0)t[o].changes.push(i);else{const d=s.find(g=>g.hash===i.commitHash);n.set(i.commitHash,t.length),t.push({hash:i.commitHash,message:i.commitMessage||i.commitHash.substring(0,7),author:d?.author,authorEmail:d?.authorEmail,date:d?.date,agentId:d?.agentId,linkedNoteId:d?.linkedNoteId,changes:[i]})}}else{const o=t.length>0?t[t.length-1]:null;o&&o.hash===""?o.changes.push(i):t.push({hash:"",message:P.chat_changesPanel_workingChanges_label(),changes:[i]})}return t});Be(()=>{if(e(lt)){const t=gt(()=>e(ot)),n=e(lt).find(s=>s.hash);n&&!t.has(n.hash)&&m(ot,new Set([...t,n.hash]),!0)}}),Be(()=>{const t=new Set(e(we).map(o=>ve(o))),n=gt(()=>e(wn)),s=gt(()=>e(Se)),i=[...s].some(o=>t.has(o));if(t.size>0&&!i)if(n==="collapsed")m(Se,new Set,!0),m(st,new Set,!0);else{const o=gt(()=>e(ot)),d=e(re)&&o.size>0?e(we).filter(k=>k.commitHash&&o.has(k.commitHash)):e(we);if(n==="expanded"||n==null&&t.size<=$r)m(Se,new Set(d.map(k=>ve(k))),!0);else{const k=gt(()=>e(Ct)),W=new Set;for(const H of d){if(W.size>=Fr)break;k.has(H.filePath)||W.add(ve(H))}m(Se,W,!0)}m(st,new Set,!0)}else{const o=gt(()=>e(st)),d=new Set;for(const k of s)t.has(k)&&d.add(k);d.size!==s.size&&m(Se,d,!0);const g=new Set;for(const k of o)t.has(k)&&g.add(k);g.size!==o.size&&m(st,g,!0)}});function Vr(t,n){if(e(st).has(n))return{destroy(){}};const s=new IntersectionObserver(i=>{for(const o of i)o.isIntersecting&&(m(st,new Set([...e(st),n]),!0),s.disconnect())},{root:null,rootMargin:"400px",threshold:0});return s.observe(t),{destroy(){s.disconnect()}}}function Kr(t){const n=t.parentElement;if(!n)return{};const s=()=>n.style.setProperty("--change-file-header-height",`${t.offsetHeight}px`),i=new ResizeObserver(s);return i.observe(t),s(),{destroy(){i.disconnect()}}}function jr(t,n){if(e(v))return;const s=Re().find(H=>H.filePath===t),i=n?.metaKey||n?.ctrlKey||!1,d=(n?.target?n.target?.closest("[data-panel-id]"):null)?.getAttribute("data-panel-id")??void 0,g=Q;if(!g)return;const k=s?Vt(s):void 0,W=s?{id:`chat-change-${t}`,file:t,relativePath:t,type:"modified",stage:k==="committed"?"committed":s.staged?"staged":"unstaged",stats:s?{additions:s.additions,deletions:s.deletions}:{additions:0,deletions:0},attribution:{manual:!0,timestamp:Date.now()}}:void 0;W&&Me.dispatch(Xs(g,W,{changeId:`chat-change-${t}`,filePath:t,openInAdjacentPanel:i,sourcePanelId:d,branchBaseRef:wt()??void 0,branchBaseCommitSha:It()??void 0,gitRootId:Ge(),gitRootPath:bt()}))}function qr(t,n){if(e(v))return;const s=n?.metaKey||n?.ctrlKey||!1,o=(n?.target?n.target?.closest("[data-panel-id]"):null)?.getAttribute("data-panel-id")??void 0,d=Q;d&&Me.dispatch(Ys(d,t,{openInAdjacentPanel:s,sourcePanelId:o}))}let $t;function Fn(t,n,s){const i=crypto.randomUUID();$t={requestId:i,top:e(ct)?.scrollTop??0},Me.dispatch(to(Q,Ke,i,t,n,s))}function Un(t,n){Fn("stageHunk",t,n)}function Wn(t,n){Fn("unstageHunk",t,n)}Be(()=>{const t=b()?.completedMutationRequestId;if(!$t||$t.requestId!==t)return;const n=$t.top;$t=void 0;const s=requestAnimationFrame(()=>{e(ct)&&(e(ct).scrollTop=n)});return()=>cancelAnimationFrame(s)});function yn(t){const n=Q;n&&Me.dispatch(Qs(n,t,void 0,Ge()?{gitRootId:Ge()}:void 0))}function Gr(t){const n=new Set(e(Se));n.has(t)?n.delete(t):n.add(t),m(Se,n,!0)}function Qr(t){const n=new Set(e(ot));n.has(t)?n.delete(t):n.add(t),m(ot,n,!0)}const Xr=230;function Yr(){if(e(re)&&e(lt)){const t=[];for(const n of e(lt))n.hash&&!e(ot).has(n.hash)||t.push(...n.changes.map(s=>ve(s)));return t}return e(we).map(t=>ve(t))}function Jr(t){const n=Yr(),s=n.indexOf(t);return s>=0?n[s+1]??t:t}function Zr(t){const n=e(Et);if(!n)return null;for(const s of n.querySelectorAll("[data-change-header-key]"))if(s.dataset.changeHeaderKey===t)return s;return null}function Bn(t){const n=e(ct),s=Zr(t);if(!n||!s)return;const i=n.getBoundingClientRect(),o=s.getBoundingClientRect(),d=Number.parseFloat(s.dataset.changeStickyTop??"0")||0,g=Math.max(0,n.scrollHeight-n.clientHeight),k=n.scrollTop+o.top-i.top-d;n.scrollTo({top:Math.min(g,Math.max(0,k)),behavior:"auto"})}function es(t){const n=Jr(t);Hn().then(()=>{requestAnimationFrame(()=>{Bn(n),window.setTimeout(()=>{Bn(n)},Xr)})})}function ts(t,n){const s=new Set(e(Ct)),i=new Set(e(Se)),o=s.has(t),d=!o&&i.has(n);if(o)s.delete(t),i.add(n);else{s.add(t);for(const g of e(we))g.filePath===t&&i.delete(ve(g))}if(m(Ct,s,!0),m(Se,i,!0),d&&es(n),Q){const g={};for(const k of s)g[k]=Dn(k);Me.dispatch(Js(Q,g))}}function ns(){m(wn,"expanded"),m(Se,new Set(e(we).filter(t=>!e(Ct).has(t.filePath)).map(t=>ve(t))),!0)}function rs(){m(wn,"collapsed"),m(Se,new Set,!0)}function ss(t){m(re,t,!0)}let Vn=Y(null),xt=Y(null),ct=Y(null),Et=Y(null),Ft=Y(void 0);Be(()=>{const t=e(ct),n=e(Et);if(!t||!n)return;const s=new Ao;return s.setup(t,n),m(Ft,s,!0),()=>{s.cleanUp(),e(Ft)===s&&m(Ft,void 0)}});const os=["[data-column-content]","[data-content] [data-line]","[data-content] [data-no-newline]","pre [data-line]"].join(","),Kn="rgba(255, 213, 0, 0.4)",is="rgba(59, 130, 246, 0.5)",Xt=16,as=150;let dt=Y(!1),ut=Y(""),it=Y(tt([])),Ye=Y(0),Yt=Y(null),Jt=Y(tt(new Set)),Zt=Y(null),Ut=null,ls=u(()=>{const t=e(re)&&e(lt)?e(lt).filter(n=>!n.hash||e(ot).has(n.hash)).flatMap(n=>n.changes.map(s=>ve(s))):e(we).map(n=>ve(n));return[e(re)?"grouped":"combined",t.join("|"),[...e(Se)].join("|"),[...e(st)].join("|")].join("::")});function jn(){const t=e(Et);return t?Array.from(t.querySelectorAll("diffs-container")).map(n=>n.shadowRoot).filter(n=>n!=null):[]}function cs(){const t=fo(e(xt),{extraRoots:jn()});t&&(m(ut,t,!0),m(Ye,0)),m(dt,!0),Hn().then(()=>{e(Yt)?.focus(),e(Yt)?.select()})}function qn(){en(),m(dt,!1),m(ut,""),Sn()}function Sn(){Gn(),m(it,[],!0),m(Ye,0),m(Jt,new Set,!0),m(Zt,null)}function en(){Ut!==null&&(clearTimeout(Ut),Ut=null)}function ds(t){if(en(),m(Ye,0),!e(dt)||!t.trim()){Sn();return}Ut=setTimeout(()=>{Ut=null,e(dt)&&e(ut).trim()&&us(e(ut))},as)}sr(en);function Gn(){const t=jn();for(const n of t)n.querySelectorAll(".all-changes-search-highlight").forEach(s=>{const i=s.parentNode;if(i){for(;s.firstChild;)i.insertBefore(s.firstChild,s);i.removeChild(s),i.normalize()}})}function us(t){Gn(),m(it,[],!0),m(Jt,new Set,!0),m(Zt,null),m(Ye,0);const n=t.trim(),s=e(Et);if(!n||!s)return;const i=[],o=new Set,d=n.toLowerCase();s.querySelectorAll("[data-change-card-key]").forEach(g=>{const k=g.querySelector("[data-change-header-key]"),W=k?.dataset.changeHeaderKey,H=k?.dataset.changeSearchText??"";k&&W&&vs(H,d)&&(o.add(W),i.push({element:k,headerKey:W})),g.querySelectorAll("diffs-container").forEach(se=>{const Ce=se.shadowRoot;Ce&&(hs(Ce).forEach(ae=>{gs(ae,n)}),Ce.querySelectorAll(".all-changes-search-highlight").forEach(ae=>{fs(ae)&&i.push({element:ae})}))})}),m(Jt,o,!0),m(it,i,!0),i.length>0&&Wt(0)}function hs(t){const n=Array.from(t.querySelectorAll(os)),s=[];for(const i of n)s.some(o=>o.contains(i))||s.push(i);return s}function gs(t,n){const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(se){return se.textContent?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),i=[],o=n.toLowerCase();let d="",g;for(;g=s.nextNode();){const se=g.textContent||"";i.push({node:g,start:d.length,end:d.length+se.length}),d+=se}const k=d.toLowerCase(),W=[];let H=0;for(;(H=k.indexOf(o,H))!==-1;)W.push({start:H,end:H+n.length}),H+=n.length;for(let se=W.length-1;se>=0;se--){const Ce=Qn(i,W[se].start,!1),ae=Qn(i,W[se].end,!0);if(!Ce||!ae)continue;const ze=document.createRange();ze.setStart(Ce.node,Ce.offset),ze.setEnd(ae.node,ae.offset);const Je=document.createElement("span");Je.className="all-changes-search-highlight",Je.style.backgroundColor=Kn,Je.appendChild(ze.extractContents()),ze.insertNode(Je)}}function Qn(t,n,s){const i=s?[...t].reverse():t;for(const o of i)if(s?n>o.start&&n<=o.end:n>=o.start&&n<o.end)return{node:o.node,offset:n-o.start};return null}function fs(t){return Array.from(t.getClientRects()).some(n=>n.width>0&&n.height>0)}function Wt(t){if(e(it).length===0)return;e(it).forEach(s=>{s.element.classList.remove("all-changes-search-current"),s.headerKey||(s.element.style.backgroundColor=Kn)}),t<0&&(t=e(it).length-1),t>=e(it).length&&(t=0),m(Ye,t,!0);const n=e(it)[t];m(Zt,n.headerKey??null,!0),n.element.classList.add("all-changes-search-current"),n.headerKey||(n.element.style.backgroundColor=is),ms(n.element)}function ms(t){const n=e(ct);if(!n){t.scrollIntoView?.({behavior:"smooth",block:"center",inline:"nearest"});return}ps(t,n)}function ps(t,n){const s=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=s.top-i.top+n.scrollTop,d=s.left-i.left+n.scrollLeft,g=Math.max(0,o-n.clientHeight/2+s.height/2);let k=n.scrollLeft;s.left<i.left+Xt?k=Math.max(0,d-Xt):s.right>i.right-Xt&&(k=Math.max(0,d-n.clientWidth+s.width+Xt)),n.scrollTo({top:g,left:k,behavior:"smooth"})}function Xn(t){const n=e(dt)?e(ut).trim():"";if(!n)return[{text:t,isMatch:!1}];const s=t.toLowerCase(),i=n.toLowerCase(),o=[];let d=0,g=0;for(;(g=s.indexOf(i,d))!==-1;)g>d&&o.push({text:t.slice(d,g),isMatch:!1}),o.push({text:t.slice(g,g+n.length),isMatch:!0}),d=g+n.length;return d<t.length&&o.push({text:t.slice(d),isMatch:!1}),o.length>0?o:[{text:t,isMatch:!1}]}function vs(t,n){return[cr(t),In(t)].filter(Boolean).some(s=>s.toLowerCase().includes(n))}function Yn(t){if(!e(xt)||!t)return!1;if(e(xt).contains(t))return!0;const n=t.getRootNode();return n instanceof ShadowRoot&&e(xt).contains(n.host)}function Jn(t){return t.defaultPrevented?!1:t.composedPath().some(n=>n instanceof Node&&Yn(n))?!0:Yn(document.activeElement)}function _s(t){if((t.metaKey||t.ctrlKey)&&t.key==="f"){Jn(t)&&(t.preventDefault(),cs());return}e(dt)&&t.key==="Escape"&&Jn(t)&&(t.preventDefault(),qn())}function ws(t){(t.key==="F3"||t.key==="g"&&(t.ctrlKey||t.metaKey))&&(t.preventDefault(),t.shiftKey?Wt(e(Ye)-1):Wt(e(Ye)+1))}function bs(t){t.defaultPrevented||t.button!==0||t.target?.closest('button, input, textarea, select, a, [contenteditable="true"], diffs-container')||e(xt)?.focus({preventScroll:!0})}let Cn=0;Be(()=>{const t=e(dt),n=e(ut);e(ls),gt(()=>{if(!t||!n.trim()){Cn++,en(),Sn();return}const s=++Cn;Hn().then(()=>{s===Cn&&ds(n)})})});function ys(t){const n=D()?.agentId||ye();n&&Ue()?.(n,t)}function Ss(){if(!D()?.hash)return;const t=a(),n=t?.repositoryOwner,s=t?.repositoryName,i=t?.id;if(n&&s&&i){const o=`https://github.com/${n}/${s}/commit/${D().hash}`;wo(i).openTab({type:"browser",title:`${D().hash.substring(0,7)} · ${s}`,closable:!0,browserUrl:o,workspaceId:i})}}const Cs=u(()=>()=>{const t=a();return!!(D()?.hash&&t?.repositoryOwner&&t?.repositoryName)});function Zn(t){if(!t)return null;const n=t.match(/(?:\d+\+)?([^@]+)@users\.noreply\.github\.com/);return n?n[1]:null}function tn(t){if(!t)return"?";const n=t.trim().split(/\s+/);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t[0]?.toUpperCase()||"?"}Be(()=>{const t=Q;if(!(!t||!(e(re)&&!Ge()&&!e(v))))return Me.dispatch(Ks(t,"history")),()=>Me.dispatch(js(t,"history"))});var xs={expandAll:ns,collapseAll:rs,setGroupByCommit:ss,get changes(){return Re()},set changes(t){Re(t),x()},get agentId(){return ye()},set agentId(t=null){ye(t),x()},get isAggregate(){return Fe()},set isAggregate(t=!1){Fe(t),x()},get onOpenAgent(){return Ue()},set onOpenAgent(t){Ue(t),x()},get showStagingControls(){return qe()},set showStagingControls(t=!1){qe(t),x()},get showCategoryFilter(){return $()},set showCategoryFilter(t=!1){$(t),x()},get onStage(){return ie()},set onStage(t){ie(t),x()},get onUnstage(){return De()},set onUnstage(t){De(t),x()},get onRevert(){return He()},set onRevert(t){He(t),x()},get onStageAll(){return jt()},set onStageAll(t){jt(t),x()},get onUnstageAll(){return qt()},set onUnstageAll(t){qt(t),x()},get isLoading(){return Ht()},set isLoading(t=!1){Ht(t),x()},get commitInfo(){return D()},set commitInfo(t=null){D(t),x()},get onOpenNote(){return Lt()},set onOpenNote(t){Lt(t),x()},get groupByCommit(){return Le()},set groupByCommit(t=!1){Le(t),x()},get branchBaseRef(){return wt()},set branchBaseRef(t=null){wt(t),x()},get branchBaseCommitSha(){return It()},set branchBaseCommitSha(t=null){It(t),x()},get gitRootId(){return Ge()},set gitRootId(t=void 0){Ge(t),x()},get gitRootPath(){return bt()},set gitRootPath(t=void 0){bt(t),x()},$set:un,$on:(t,n)=>hn(r,t,n)},Bt=wi();sn("keydown",Us,_s);var er=N(Bt);{var ks=t=>{var n=li(),s=de(n);z((i,o)=>K(s,`${i??""}
|
|
11
|
-
${o??""}`),[()=>l()?.checkpoint?P.agent_node_checkpoint_available({time:l().checkpoint.capturedAt}):P.agent_node_checkpoint_unavailable(),()=>P.agent_node_transcript_diff_notice()]),w(t,n)};M(er,t=>{e(yt)&&t(ks)})}var tr=S(er,2);{var Ps=t=>{{let n=u(()=>P.chat_changesPanel_findInChanges_placeholder());_o(t,{get placeholder(){return e(n)},get currentMatchIndex(){return e(Ye)},get totalMatches(){return e(it).length},emptyResultText:"No results",resultVariant:"muted",inputClass:"w-48",onKeydown:ws,onPrevious:()=>Wt(e(Ye)-1),onNext:()=>Wt(e(Ye)+1),onClose:qn,get query(){return e(ut)},set query(s){m(ut,s,!0)},get inputRef(){return e(Yt)},set inputRef(s){m(Yt,s,!0)}})}};M(tr,t=>{e(dt)&&t(Ps)})}var xn=S(tr,2),kn=N(xn),nr=N(kn);{var Rs=t=>{Te(t)};M(nr,t=>{D()&&t(Rs)})}var
|
|
12
|
-
`)[0]]),w(me,pe)},$$slots:{default:!0}});var fe=S(ge,2),U=N(fe);{var Z=me=>{var le=mi(),pe=ne(le),Oe=de(pe,!0);Tt(2),z(We=>K(Oe,We),[()=>wr(e(B).date)]),w(me,le)};M(U,me=>{e(B).date&&me(Z)})}var Ie=S(U,2),ee=de(Ie,!0);
|
|
10
|
+
`));M(Ot,_=>{e(Nt)&&_(ht)})}var te=S(Ot,2);{var he=_=>{var R=Jo(),O=N(R);{var X=E=>{const V=u(()=>D()?.agentId||ye()),ge=u(()=>Me.state),fe=u(()=>Q),U=u(()=>e(V)&&e(fe)?mr.select(e(ge),e(V)):void 0),Z=u(()=>e(U)?.name&&e(U).name!=="New Workspace Agent"?e(U).name:P.chat_shared_agentName_fallback());{let Ie=u(()=>P.chat_changesPanel_openAgent_title());ke(E,{type:"button",variant:"plain",class:"flex items-center gap-1 text-ui text-muted-foreground hover:text-foreground transition-colors cursor-pointer min-w-0",onclick:ee=>ys(ee),get title(){return e(Ie)},children:(ee,ce)=>{var Ae=Xo(),Ee=ne(Ae),Ze=N(Ee);{let pe=u(()=>e(V)??void 0);mo(Ze,{get agentId(){return e(pe)},size:14})}H(Ee);var me=S(Ee,2),le=de(me,!0);z(()=>K(le,e(Z))),w(ee,Ae)},$$slots:{default:!0}})}};M(O,E=>{(D()?.agentId||ye())&&E(X)})}var J=S(O,2);{var I=E=>{const V=u(()=>yo.select(Me.state,Q,D().linkedNoteId)),ge=u(()=>e(V)?.title||P.chat_changesPanel_note_fallback());{let fe=u(()=>P.chat_changesPanel_openLinkedNote_title());ke(E,{type:"button",variant:"plain",class:"flex items-center gap-1 text-ui text-muted-foreground hover:text-foreground transition-colors cursor-pointer min-w-0",onclick:U=>Ht()?.(D()?.linkedNoteId,U),get title(){return e(fe)},children:(U,Z)=>{var Ie=Yo(),ee=ne(Ie);Ne(ee,{get icon(){return co},class:"w-2.5 h-2.5 shrink-0"});var ce=S(ee,2),Ae=de(ce,!0);z(()=>K(Ae,e(ge))),w(U,Ie)},$$slots:{default:!0}})}};M(J,E=>{D()?.linkedNoteId&&Ht()&&E(I)})}H(R),w(_,R)};M(te,_=>{(D()?.agentId||ye()||D()?.linkedNoteId)&&_(he)})}H(o);var xe=S(o,2),be=N(xe);{var B=_=>{{const R=X=>{Tt();var J=ft();z(I=>K(J,I),[()=>tn(D()?.author)]),w(X,J)};let O=u(()=>D()?.author||"");_r(_,{get identity(){return e(n)},get alt(){return e(O)},size:28,class:"w-full h-full object-cover",fallback:R,$$slots:{fallback:!0}})}},j=_=>{var R=ft();z(O=>K(R,O),[()=>tn(D()?.author)]),w(_,R)};M(be,_=>{e(n)?_(B):_(j,-1)})}H(xe),H(i),H(s),z(()=>Ve(xe,"title",D()?.author||"")),w(t,s)},ue=(t,n=or,s=or)=>{const i=u(()=>Tr(n().filePath)),o=u(()=>ve(n())),d=u(()=>e(Ct).has(n().filePath)),g=u(()=>rt(n().filePath)),k=u(()=>s()?"64px":"31.5px");var W=ai(),L=N(W),se=N(L);ke(se,{variant:"plain",onclick:()=>Gr(e(o)),class:"flex min-w-0 flex-1 shrink cursor-pointer items-center justify-start gap-2 text-left",children:(j,_)=>{var R=ni(),O=ne(R);Pt(O,21,()=>Xn(cr(e(i))),Hn,(ee,ce)=>{var Ae=nt(),Ee=ne(Ae);{var Ze=le=>{var pe=Cr(),Oe=de(pe,!0);z(()=>K(Oe,e(ce).text)),w(le,pe)},me=le=>{var pe=ft();z(()=>K(pe,e(ce).text)),w(le,pe)};M(Ee,le=>{e(ce).isMatch?le(Ze):le(me,-1)})}w(ee,Ae)}),H(O);var X=S(O,2);{let ee=u(()=>e(Se).has(e(o))?dr:ur);Ne(X,{get icon(){return e(ee)},class:"text-subtle w-2.5! h-2.5! shrink-0"})}var J=S(X,2);{var I=ee=>{var ce=ei();Pt(ce,21,()=>Xn(In(e(i))),Hn,(Ae,Ee)=>{var Ze=nt(),me=ne(Ze);{var le=Oe=>{var We=Cr(),Pn=de(We,!0);z(()=>K(Pn,e(Ee).text)),w(Oe,We)},pe=Oe=>{var We=ft();z(()=>K(We,e(Ee).text)),w(Oe,We)};M(me,Oe=>{e(Ee).isMatch?Oe(le):Oe(pe,-1)})}w(Ae,Ze)}),H(ce),w(ee,ce)},E=u(()=>In(e(i)));M(J,ee=>{e(E)&&ee(I)})}var V=S(J,2);pr(V,{get additions(){return n().additions},get deletions(){return n().deletions},size:"xs"});var ge=S(V,2);{var fe=ee=>{var ce=ti(),Ae=N(ce);Ne(Ae,{get icon(){return so},class:"w-2.5 h-2.5 text-subtle shrink-0"}),H(ce),z((Ee,Ze)=>{Ve(ce,"aria-label",Ee),Ve(ce,"title",Ze)},[()=>mt(),()=>mt()]),w(ee,ce)};M(ge,ee=>{e(g)&&ee(fe)})}var U=S(ge,2);{var Z=ee=>{ir(ee,{size:12,class:"text-ghost shrink-0"})},Ie=u(()=>e(Ar).has(n().filePath));M(U,ee=>{e(Ie)&&ee(Z)})}z(()=>Ve(O,"title",e(i))),w(j,R)},$$slots:{default:!0}});var Ce=S(se,2),ae=N(Ce),ze=N(ae);{var Je=j=>{var _=nt(),R=ne(_);{var O=I=>{var E=ri(),V=ne(E);{let U=u(()=>e(g)?mt():P.chat_changesPanel_stageUnstaged_tooltip());ke(V,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),ie()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return hr},class:"w-3 h-3"})},$$slots:{default:!0}})}var ge=S(V,2);{let U=u(()=>e(g)?mt():P.chat_changesPanel_unstageStaged_tooltip());ke(ge,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),De()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return gr},class:"w-3 h-3"})},$$slots:{default:!0}})}var fe=S(ge,2);{let U=u(()=>e(g)?mt():P.chat_changesPanel_revertUnstaged_tooltip());ke(fe,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(U)},get disabled(){return e(g)},onclick:Z=>{Z.stopPropagation(),Le()?.(n().filePath)},children:(Z,Ie)=>{Ne(Z,{get icon(){return fr},class:"w-3 h-3"})},$$slots:{default:!0}})}w(I,E)},X=I=>{{let E=u(()=>e(g)?mt():P.chat_changesPanel_unstageFile_tooltip());ke(I,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(E)},get disabled(){return e(g)},onclick:V=>{V.stopPropagation(),De()?.(n().filePath)},children:(V,ge)=>{Ne(V,{get icon(){return gr},class:"w-3 h-3"})},$$slots:{default:!0}})}},J=I=>{var E=si(),V=ne(E);{let fe=u(()=>e(g)?mt():P.chat_changesPanel_stageFile_tooltip());ke(V,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(fe)},get disabled(){return e(g)},onclick:U=>{U.stopPropagation(),ie()?.(n().filePath)},children:(U,Z)=>{Ne(U,{get icon(){return hr},class:"w-3 h-3"})},$$slots:{default:!0}})}var ge=S(V,2);{let fe=u(()=>e(g)?mt():P.chat_changesPanel_revertChanges_tooltip());ke(ge,{variant:"ghost-light",size:"icon-xs",get tooltip(){return e(fe)},get disabled(){return e(g)},onclick:U=>{U.stopPropagation(),Le()?.(n().filePath)},children:(U,Z)=>{Ne(U,{get icon(){return fr},class:"w-3 h-3"})},$$slots:{default:!0}})}w(I,E)};M(R,I=>{n().isMerged?I(O):n().staged?I(X,1):n().category!=="committed"&&I(J,2)})}w(j,_)};M(ze,j=>{e(_e)&&j(Je)})}var kt=S(ze,2);{let j=u(()=>P.chat_changesPanel_viewCurrentDiff_tooltip());ke(kt,{variant:"ghost-light",size:"icon-xs",get disabled(){return e(v)},get tooltip(){return e(j)},onclick:_=>{_.stopPropagation(),jr(n().filePath,_)},children:(_,R)=>{Ne(_,{get icon(){return oo},class:"w-3 h-3"})},$$slots:{default:!0}})}var Ot=S(kt,2);{let j=u(()=>P.chat_changesPanel_openFile_tooltip());ke(Ot,{variant:"ghost-light",size:"icon-xs",get disabled(){return e(v)},get tooltip(){return e(j)},onclick:_=>{_.stopPropagation(),qr(n().filePath,_)},children:(_,R)=>{Ne(_,{get icon(){return An},class:"w-3 h-3"})},$$slots:{default:!0}})}H(ae);var ht=S(ae,2),Nt=N(ht);{let j=u(()=>e(d)?P.chat_changesPanel_markNotViewed_title():P.chat_changesPanel_markViewed_title());po(Nt,{get checked(){return e(d)},onCheckedChange:()=>ts(n().filePath,e(o)),size:"sm",get ariaLabel(){return e(j)}})}var te=S(Nt,2),he=de(te,!0);H(ht),H(Ce),H(L),ar(L,j=>Kr?.(j));var xe=S(L,2);{var be=j=>{var _=ii(),R=N(_);{var O=I=>{var E=nt(),V=ne(E);{var ge=U=>{{let Z=u(()=>e(_e)&&!e(g)?Un:void 0),Ie=u(()=>e(_e)&&!e(g)?Wn:void 0);Ir(U,{get parts(){return n().allParts},get foldUnchanged(){return F()},get lineWrapping(){return G()},get isAggregate(){return e(Qe)},get onStageHunk(){return e(Z)},get onUnstageHunk(){return e(Ie)},onOpenCommit:yn,get virtualizer(){return e(Ft)}})}},fe=U=>{const Z=u(()=>Vt(n()));{let Ie=u(()=>!e(v)),ee=u(()=>e(Vn)?.filePath===n().filePath?e(Vn)?.lineNumber:void 0),ce=u(()=>e(_e)&&!e(g)&&e(Z)==="unstaged"?Un:void 0),Ae=u(()=>e(_e)&&!e(g)&&e(Z)==="staged"?Wn:void 0),Ee=u(()=>e(Z)==="committed"?yn:void 0);Lr(U,{get allowHeadReads(){return e(Ie)},canReadHeadFiles:()=>no(Me.state,ye()),get change(){return n()},get foldUnchanged(){return F()},get lineWrapping(){return G()},get scrollToLine(){return e(ee)},get isAggregate(){return e(Qe)},get onStageHunk(){return e(ce)},get onUnstageHunk(){return e(Ae)},get onOpenCommit(){return e(Ee)},get virtualizer(){return e(Ft)},get gitRootId(){return Ge()},get gitRootPath(){return bt()}})}};M(V,U=>{n().isMerged&&n().allParts&&n().allParts.length>1?U(ge):U(fe,-1)})}w(I,E)},X=u(()=>e(st).has(e(o))),J=I=>{var E=oi(),V=N(E);ir(V,{size:16,class:"mr-2"});var ge=S(V);H(E),z(fe=>K(ge,` ${fe??""}`),[()=>P.chat_changesPanel_loadingDiff_label()]),w(I,E)};M(R,I=>{e(X)?I(O):I(J,-1)})}H(_),ar(_,(I,E)=>Vr?.(I,E),()=>e(o)),cn(3,_,()=>vr,()=>({tier:"moderate"})),w(j,_)},B=u(()=>e(Se).has(e(o)));M(xe,j=>{e(B)&&j(be)})}H(W),z((j,_,R,O)=>{En(W,1,`mb-4 bg-sidebar border border-border rounded-lg overflow-clip transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none ${e(d)?"opacity-50":""}`),lr(W,`overflow-anchor: none; --change-file-sticky-top: ${e(k)??""};`),Ve(W,"data-change-card-key",e(o)),En(L,1,`flex items-center gap-2 px-0 py-1.5 group relative sticky z-10 bg-sidebar ${j??""} ${e(Zt)===e(o)?"ring-2 ring-blue-400/70 bg-blue-500/10":""}`),lr(L,`top: ${e(k)??""}; border-bottom: 1px solid ${_??""}`),Ve(L,"data-change-header-key",e(o)),Ve(L,"data-change-sticky-top",e(k)),Ve(L,"data-change-search-text",e(i)),Ve(ht,"title",R),K(he,O)},[()=>e(Jt).has(e(o))?"ring-1 ring-warning/30 bg-warning/10":"",()=>e(Se).has(e(o))?"var(--border)":"transparent",()=>e(d)?P.chat_changesPanel_markNotViewed_title():P.chat_changesPanel_markViewed_title(),()=>P.chat_changesPanel_viewed_label()]),ln("click",ht,j=>j.stopPropagation()),w(t,W)},Q=Nn()?.workspaceId??"",at=uo(),pt=ho(),vt=io(Q),_t=So(Q);function ve(t){return e(re)&&t.commitHash?`${t.filePath}-${t.commitHash}`:t.filePath}let Re=C(r,"changes",7),ye=C(r,"agentId",7,null),Fe=C(r,"isAggregate",7,!1),Ue=C(r,"onOpenAgent",7),qe=C(r,"showStagingControls",7,!1),$=C(r,"showCategoryFilter",7,!1),ie=C(r,"onStage",7),De=C(r,"onUnstage",7),Le=C(r,"onRevert",7),jt=C(r,"onStageAll",7),qt=C(r,"onUnstageAll",7),Lt=C(r,"isLoading",7,!1),D=C(r,"commitInfo",7,null),Ht=C(r,"onOpenNote",7),He=C(r,"groupByCommit",7,!1),wt=C(r,"branchBaseRef",7,null),It=C(r,"branchBaseCommitSha",7,null),Ge=C(r,"gitRootId",7,void 0),bt=C(r,"gitRootPath",7,void 0);const mn=u(()=>mr(ye()??"")),v=u(()=>!!ye()&&(!l()||qs(l()))),_e=u(()=>qe()&&!e(v)&&!lo(a())),Qe=u(()=>Fe()&&!e(v)),yt=u(()=>e(v)&&l()?.nodeState==="offline");let re=Y(tt(He()));const Xe=ao(Q);function rt(t){const n=a(),s=n?.worktreePath||n?.repositoryPath;return eo(c(),t,s)}const Ke=crypto.randomUUID(),At=Co(Q,Ke),zt=xo(Q,Ke),Mt=ko(Q,Ke),St=u(()=>e(v)?Re():p()),Tn=u(()=>b()?.status==="pending"),Ar=u(()=>new Set(y()));Be(()=>{Me.dispatch(Vs(Q,Ke,crypto.randomUUID(),{changes:Re(),agentId:ye(),showStagingControls:e(_e),isAggregate:e(Qe),groupByCommit:e(re),nodeOwnedPaths:e(v),branchBaseRef:wt()??void 0,branchBaseCommitSha:It()??void 0,gitRootId:Ge(),gitRootPath:bt()}))}),sr(()=>Me.dispatch(Gs(Q,Ke)));function Er(){return Q?bo.select(Me.state,Q):{}}function Dn(t){return e(_n).filter(s=>s.filePath===t&&s.commitHash).map(s=>s.commitHash).sort().join(",")}let pn=!1;Be(()=>{const t=e(we);if(!Q||t.length===0||pn)return;const s=Er();if(Object.keys(s).length===0){pn=!0;return}const i=new Set;for(const[o,d]of Object.entries(s))Dn(o)===d&&i.add(o);if(pn=!0,i.size>0){m(Ct,i,!0);const o=new Set(e(Se));for(const d of e(we))i.has(d.filePath)&&o.delete(ve(d));m(Se,o,!0)}});let vn=Y(!1);Be(()=>{if(e(vn))return;const t=e(Tn),n=gt(()=>e(we).length>0);!Lt()&&!t&&n&&m(vn,!0)});const Or=u(()=>(Lt()||e(Tn))&&!e(vn));let Nr=Y(tt(new Set(["unstaged","staged","committed"]))),Gt=Y(tt({unstaged:0,staged:0,committed:0}));Be(()=>{let t=0,n=0,s=0;for(const i of e(we))if(i.isMerged&&i.allParts)for(const o of i.allParts)o.category==="unstaged"?t++:o.category==="staged"?n++:o.category==="committed"&&s++;else{const o=i.category||(i.staged?"staged":"unstaged");o==="unstaged"?t++:o==="staged"?n++:o==="committed"&&s++}(t!==e(Gt).unstaged||n!==e(Gt).staged||s!==e(Gt).committed)&&m(Gt,{unstaged:t,staged:n,committed:s},!0)});function Tr(t){const n=a(),s=n?.worktreePath||n?.repositoryPath;if(s){const i=Zs(t,s);if(i!==t)return i||t}if(t.startsWith("/")){const i=["/src/","/lib/","/app/","/components/","/features/","/routes/"];for(const o of i){const d=t.indexOf(o);if(d!==-1)return t.slice(d+1)}return t.split("/").pop()||t}return t}let Dr=u(()=>$()?e(St).filter(t=>e(Nr).has(Vt(t))):e(St));function zn(t){if(!t)return{filename:"",directory:""};const n=t.replace(/\/+$/,""),s=n.lastIndexOf("/");return s===-1?{filename:n,directory:""}:{filename:n.substring(s+1),directory:n.substring(0,s)}}function zr(t){return[...t].sort((n,s)=>{const i=zn(n.filePath),o=zn(s.filePath);return i.directory!==o.directory?i.directory.localeCompare(o.directory):i.filename.localeCompare(o.filename)})}let _n=u(()=>e(Dr));function Mr(t){const n=new Map;for(const i of t){const o=Vt(i),d=n.get(i.filePath)||{};o==="committed"?(d.committed||(d.committed=[]),d.committed.push(i)):o==="staged"?d.staged=i:d.unstaged=i,n.set(i.filePath,d)}const s=[];for(const[i,o]of n){const d=[];if(o.staged&&d.push({change:o.staged,category:"staged"}),o.unstaged&&d.push({change:o.unstaged,category:"unstaged"}),o.committed)for(const L of o.committed)d.push({change:L,category:"committed"});let g=0,k=0;for(const L of d)g+=L.change.additions||0,k+=L.change.deletions||0;const W=o.staged||o.unstaged;if(W&&d.length>1){const L=o.unstaged||o.staged||o.committed?.[0];L&&s.push({...L,filePath:i,isMerged:!0,stagedPart:o.staged,unstagedPart:o.unstaged,allParts:d,additions:g,deletions:k,category:void 0,staged:void 0})}else if(d.length===1)s.push(d[0].change);else if(!W&&o.committed&&o.committed.length>0)if(e(re))for(const L of o.committed)s.push(L);else if(o.committed.length===1)s.push(o.committed[0]);else{const L=o.committed[0];s.push({...L,filePath:i,isMerged:!0,allParts:d,additions:g,deletions:k,category:void 0,staged:void 0})}}return s}let Mn="",we=Y(tt([]));Be(()=>{const t=zr(e(_e)?Mr(e(_n)):e(_n)),n=`gbc:${e(re)}::`+t.map(s=>{const i=s.gitlink?`|gl:${s.gitlink.oldSha||""}:${s.gitlink.newSha||""}`:"",o=`${s.filePath}|${s.category||s.staged}|${s.isMerged||!1}|${s.additions||0}|${s.deletions||0}${i}`;if(s.isMerged){const d=s.stagedPart?`${s.stagedPart.additions||0}:${s.stagedPart.deletions||0}`:"none",g=s.unstagedPart?`${s.unstagedPart.additions||0}:${s.unstagedPart.deletions||0}`:"none";return`${o}|s:${d}|u:${g}`}return o}).join(";;");!e(v)&&n===Mn||(Mn=n,m(we,t,!0))});const $r=30,Fr=10;let Se=Y(tt(new Set)),wn=Y(null),st=Y(tt(new Set)),Ct=Y(tt(new Set)),$n=u(()=>e(Ct).size),bn=u(()=>new Set(e(we).map(t=>t.filePath)).size),Ur=u(()=>e(we).reduce((t,n)=>t+(n.additions??0),0)),Wr=u(()=>e(we).reduce((t,n)=>t+(n.deletions??0),0)),Br=u(()=>Re().some(t=>Vt(t)==="committed")),Qt=u(()=>{const t=new Set;for(const n of Re())n.commitHash&&t.add(n.commitHash);return t.size}),ot=Y(tt(new Set)),lt=u(()=>{if(!e(re))return null;const t=[],n=new Map,s=A()||[];for(const i of e(we))if(i.commitHash){const o=n.get(i.commitHash);if(o!==void 0)t[o].changes.push(i);else{const d=s.find(g=>g.hash===i.commitHash);n.set(i.commitHash,t.length),t.push({hash:i.commitHash,message:i.commitMessage||i.commitHash.substring(0,7),author:d?.author,authorEmail:d?.authorEmail,date:d?.date,agentId:d?.agentId,linkedNoteId:d?.linkedNoteId,changes:[i]})}}else{const o=t.length>0?t[t.length-1]:null;o&&o.hash===""?o.changes.push(i):t.push({hash:"",message:P.chat_changesPanel_workingChanges_label(),changes:[i]})}return t});Be(()=>{if(e(lt)){const t=gt(()=>e(ot)),n=e(lt).find(s=>s.hash);n&&!t.has(n.hash)&&m(ot,new Set([...t,n.hash]),!0)}}),Be(()=>{const t=new Set(e(we).map(o=>ve(o))),n=gt(()=>e(wn)),s=gt(()=>e(Se)),i=[...s].some(o=>t.has(o));if(t.size>0&&!i)if(n==="collapsed")m(Se,new Set,!0),m(st,new Set,!0);else{const o=gt(()=>e(ot)),d=e(re)&&o.size>0?e(we).filter(k=>k.commitHash&&o.has(k.commitHash)):e(we);if(n==="expanded"||n==null&&t.size<=$r)m(Se,new Set(d.map(k=>ve(k))),!0);else{const k=gt(()=>e(Ct)),W=new Set;for(const L of d){if(W.size>=Fr)break;k.has(L.filePath)||W.add(ve(L))}m(Se,W,!0)}m(st,new Set,!0)}else{const o=gt(()=>e(st)),d=new Set;for(const k of s)t.has(k)&&d.add(k);d.size!==s.size&&m(Se,d,!0);const g=new Set;for(const k of o)t.has(k)&&g.add(k);g.size!==o.size&&m(st,g,!0)}});function Vr(t,n){if(e(st).has(n))return{destroy(){}};const s=new IntersectionObserver(i=>{for(const o of i)o.isIntersecting&&(m(st,new Set([...e(st),n]),!0),s.disconnect())},{root:null,rootMargin:"400px",threshold:0});return s.observe(t),{destroy(){s.disconnect()}}}function Kr(t){const n=t.parentElement;if(!n)return{};const s=()=>n.style.setProperty("--change-file-header-height",`${t.offsetHeight}px`),i=new ResizeObserver(s);return i.observe(t),s(),{destroy(){i.disconnect()}}}function jr(t,n){if(e(v))return;const s=Re().find(L=>L.filePath===t),i=n?.metaKey||n?.ctrlKey||!1,d=(n?.target?n.target?.closest("[data-panel-id]"):null)?.getAttribute("data-panel-id")??void 0,g=Q;if(!g)return;const k=s?Vt(s):void 0,W=s?{id:`chat-change-${t}`,file:t,relativePath:t,type:"modified",stage:k==="committed"?"committed":s.staged?"staged":"unstaged",stats:s?{additions:s.additions,deletions:s.deletions}:{additions:0,deletions:0},attribution:{manual:!0,timestamp:Date.now()}}:void 0;W&&Me.dispatch(Xs(g,W,{changeId:`chat-change-${t}`,filePath:t,openInAdjacentPanel:i,sourcePanelId:d,branchBaseRef:wt()??void 0,branchBaseCommitSha:It()??void 0,gitRootId:Ge(),gitRootPath:bt()}))}function qr(t,n){if(e(v))return;const s=n?.metaKey||n?.ctrlKey||!1,o=(n?.target?n.target?.closest("[data-panel-id]"):null)?.getAttribute("data-panel-id")??void 0,d=Q;d&&Me.dispatch(Ys(d,t,{openInAdjacentPanel:s,sourcePanelId:o}))}let $t;function Fn(t,n,s){const i=crypto.randomUUID();$t={requestId:i,top:e(ct)?.scrollTop??0},Me.dispatch(to(Q,Ke,i,t,n,s))}function Un(t,n){Fn("stageHunk",t,n)}function Wn(t,n){Fn("unstageHunk",t,n)}Be(()=>{const t=b()?.completedMutationRequestId;if(!$t||$t.requestId!==t)return;const n=$t.top;$t=void 0;const s=requestAnimationFrame(()=>{e(ct)&&(e(ct).scrollTop=n)});return()=>cancelAnimationFrame(s)});function yn(t){const n=Q;n&&Me.dispatch(Qs(n,t,void 0,Ge()?{gitRootId:Ge()}:void 0))}function Gr(t){const n=new Set(e(Se));n.has(t)?n.delete(t):n.add(t),m(Se,n,!0)}function Qr(t){const n=new Set(e(ot));n.has(t)?n.delete(t):n.add(t),m(ot,n,!0)}const Xr=230;function Yr(){if(e(re)&&e(lt)){const t=[];for(const n of e(lt))n.hash&&!e(ot).has(n.hash)||t.push(...n.changes.map(s=>ve(s)));return t}return e(we).map(t=>ve(t))}function Jr(t){const n=Yr(),s=n.indexOf(t);return s>=0?n[s+1]??t:t}function Zr(t){const n=e(Et);if(!n)return null;for(const s of n.querySelectorAll("[data-change-header-key]"))if(s.dataset.changeHeaderKey===t)return s;return null}function Bn(t){const n=e(ct),s=Zr(t);if(!n||!s)return;const i=n.getBoundingClientRect(),o=s.getBoundingClientRect(),d=Number.parseFloat(s.dataset.changeStickyTop??"0")||0,g=Math.max(0,n.scrollHeight-n.clientHeight),k=n.scrollTop+o.top-i.top-d;n.scrollTo({top:Math.min(g,Math.max(0,k)),behavior:"auto"})}function es(t){const n=Jr(t);Ln().then(()=>{requestAnimationFrame(()=>{Bn(n),window.setTimeout(()=>{Bn(n)},Xr)})})}function ts(t,n){const s=new Set(e(Ct)),i=new Set(e(Se)),o=s.has(t),d=!o&&i.has(n);if(o)s.delete(t),i.add(n);else{s.add(t);for(const g of e(we))g.filePath===t&&i.delete(ve(g))}if(m(Ct,s,!0),m(Se,i,!0),d&&es(n),Q){const g={};for(const k of s)g[k]=Dn(k);Me.dispatch(Js(Q,g))}}function ns(){m(wn,"expanded"),m(Se,new Set(e(we).filter(t=>!e(Ct).has(t.filePath)).map(t=>ve(t))),!0)}function rs(){m(wn,"collapsed"),m(Se,new Set,!0)}function ss(t){m(re,t,!0)}let Vn=Y(null),xt=Y(null),ct=Y(null),Et=Y(null),Ft=Y(void 0);Be(()=>{const t=e(ct),n=e(Et);if(!t||!n)return;const s=new Ao;return s.setup(t,n),m(Ft,s,!0),()=>{s.cleanUp(),e(Ft)===s&&m(Ft,void 0)}});const os=["[data-column-content]","[data-content] [data-line]","[data-content] [data-no-newline]","pre [data-line]"].join(","),Kn="rgba(255, 213, 0, 0.4)",is="rgba(59, 130, 246, 0.5)",Xt=16,as=150;let dt=Y(!1),ut=Y(""),it=Y(tt([])),Ye=Y(0),Yt=Y(null),Jt=Y(tt(new Set)),Zt=Y(null),Ut=null,ls=u(()=>{const t=e(re)&&e(lt)?e(lt).filter(n=>!n.hash||e(ot).has(n.hash)).flatMap(n=>n.changes.map(s=>ve(s))):e(we).map(n=>ve(n));return[e(re)?"grouped":"combined",t.join("|"),[...e(Se)].join("|"),[...e(st)].join("|")].join("::")});function jn(){const t=e(Et);return t?Array.from(t.querySelectorAll("diffs-container")).map(n=>n.shadowRoot).filter(n=>n!=null):[]}function cs(){const t=fo(e(xt),{extraRoots:jn()});t&&(m(ut,t,!0),m(Ye,0)),m(dt,!0),Ln().then(()=>{e(Yt)?.focus(),e(Yt)?.select()})}function qn(){en(),m(dt,!1),m(ut,""),Sn()}function Sn(){Gn(),m(it,[],!0),m(Ye,0),m(Jt,new Set,!0),m(Zt,null)}function en(){Ut!==null&&(clearTimeout(Ut),Ut=null)}function ds(t){if(en(),m(Ye,0),!e(dt)||!t.trim()){Sn();return}Ut=setTimeout(()=>{Ut=null,e(dt)&&e(ut).trim()&&us(e(ut))},as)}sr(en);function Gn(){const t=jn();for(const n of t)n.querySelectorAll(".all-changes-search-highlight").forEach(s=>{const i=s.parentNode;if(i){for(;s.firstChild;)i.insertBefore(s.firstChild,s);i.removeChild(s),i.normalize()}})}function us(t){Gn(),m(it,[],!0),m(Jt,new Set,!0),m(Zt,null),m(Ye,0);const n=t.trim(),s=e(Et);if(!n||!s)return;const i=[],o=new Set,d=n.toLowerCase();s.querySelectorAll("[data-change-card-key]").forEach(g=>{const k=g.querySelector("[data-change-header-key]"),W=k?.dataset.changeHeaderKey,L=k?.dataset.changeSearchText??"";k&&W&&vs(L,d)&&(o.add(W),i.push({element:k,headerKey:W})),g.querySelectorAll("diffs-container").forEach(se=>{const Ce=se.shadowRoot;Ce&&(hs(Ce).forEach(ae=>{gs(ae,n)}),Ce.querySelectorAll(".all-changes-search-highlight").forEach(ae=>{fs(ae)&&i.push({element:ae})}))})}),m(Jt,o,!0),m(it,i,!0),i.length>0&&Wt(0)}function hs(t){const n=Array.from(t.querySelectorAll(os)),s=[];for(const i of n)s.some(o=>o.contains(i))||s.push(i);return s}function gs(t,n){const s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(se){return se.textContent?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),i=[],o=n.toLowerCase();let d="",g;for(;g=s.nextNode();){const se=g.textContent||"";i.push({node:g,start:d.length,end:d.length+se.length}),d+=se}const k=d.toLowerCase(),W=[];let L=0;for(;(L=k.indexOf(o,L))!==-1;)W.push({start:L,end:L+n.length}),L+=n.length;for(let se=W.length-1;se>=0;se--){const Ce=Qn(i,W[se].start,!1),ae=Qn(i,W[se].end,!0);if(!Ce||!ae)continue;const ze=document.createRange();ze.setStart(Ce.node,Ce.offset),ze.setEnd(ae.node,ae.offset);const Je=document.createElement("span");Je.className="all-changes-search-highlight",Je.style.backgroundColor=Kn,Je.appendChild(ze.extractContents()),ze.insertNode(Je)}}function Qn(t,n,s){const i=s?[...t].reverse():t;for(const o of i)if(s?n>o.start&&n<=o.end:n>=o.start&&n<o.end)return{node:o.node,offset:n-o.start};return null}function fs(t){return Array.from(t.getClientRects()).some(n=>n.width>0&&n.height>0)}function Wt(t){if(e(it).length===0)return;e(it).forEach(s=>{s.element.classList.remove("all-changes-search-current"),s.headerKey||(s.element.style.backgroundColor=Kn)}),t<0&&(t=e(it).length-1),t>=e(it).length&&(t=0),m(Ye,t,!0);const n=e(it)[t];m(Zt,n.headerKey??null,!0),n.element.classList.add("all-changes-search-current"),n.headerKey||(n.element.style.backgroundColor=is),ms(n.element)}function ms(t){const n=e(ct);if(!n){t.scrollIntoView?.({behavior:"smooth",block:"center",inline:"nearest"});return}ps(t,n)}function ps(t,n){const s=t.getBoundingClientRect(),i=n.getBoundingClientRect(),o=s.top-i.top+n.scrollTop,d=s.left-i.left+n.scrollLeft,g=Math.max(0,o-n.clientHeight/2+s.height/2);let k=n.scrollLeft;s.left<i.left+Xt?k=Math.max(0,d-Xt):s.right>i.right-Xt&&(k=Math.max(0,d-n.clientWidth+s.width+Xt)),n.scrollTo({top:g,left:k,behavior:"smooth"})}function Xn(t){const n=e(dt)?e(ut).trim():"";if(!n)return[{text:t,isMatch:!1}];const s=t.toLowerCase(),i=n.toLowerCase(),o=[];let d=0,g=0;for(;(g=s.indexOf(i,d))!==-1;)g>d&&o.push({text:t.slice(d,g),isMatch:!1}),o.push({text:t.slice(g,g+n.length),isMatch:!0}),d=g+n.length;return d<t.length&&o.push({text:t.slice(d),isMatch:!1}),o.length>0?o:[{text:t,isMatch:!1}]}function vs(t,n){return[cr(t),In(t)].filter(Boolean).some(s=>s.toLowerCase().includes(n))}function Yn(t){if(!e(xt)||!t)return!1;if(e(xt).contains(t))return!0;const n=t.getRootNode();return n instanceof ShadowRoot&&e(xt).contains(n.host)}function Jn(t){return t.defaultPrevented?!1:t.composedPath().some(n=>n instanceof Node&&Yn(n))?!0:Yn(document.activeElement)}function _s(t){if((t.metaKey||t.ctrlKey)&&t.key==="f"){Jn(t)&&(t.preventDefault(),cs());return}e(dt)&&t.key==="Escape"&&Jn(t)&&(t.preventDefault(),qn())}function ws(t){(t.key==="F3"||t.key==="g"&&(t.ctrlKey||t.metaKey))&&(t.preventDefault(),t.shiftKey?Wt(e(Ye)-1):Wt(e(Ye)+1))}function bs(t){t.defaultPrevented||t.button!==0||t.target?.closest('button, input, textarea, select, a, [contenteditable="true"], diffs-container')||e(xt)?.focus({preventScroll:!0})}let Cn=0;Be(()=>{const t=e(dt),n=e(ut);e(ls),gt(()=>{if(!t||!n.trim()){Cn++,en(),Sn();return}const s=++Cn;Ln().then(()=>{s===Cn&&ds(n)})})});function ys(t){const n=D()?.agentId||ye();n&&Ue()?.(n,t)}function Ss(){if(!D()?.hash)return;const t=a(),n=t?.repositoryOwner,s=t?.repositoryName,i=t?.id;if(n&&s&&i){const o=`https://github.com/${n}/${s}/commit/${D().hash}`;wo(i).openTab({type:"browser",title:`${D().hash.substring(0,7)} · ${s}`,closable:!0,browserUrl:o,workspaceId:i})}}const Cs=u(()=>()=>{const t=a();return!!(D()?.hash&&t?.repositoryOwner&&t?.repositoryName)});function Zn(t){if(!t)return null;const n=t.match(/(?:\d+\+)?([^@]+)@users\.noreply\.github\.com/);return n?n[1]:null}function tn(t){if(!t)return"?";const n=t.trim().split(/\s+/);return n.length>=2?(n[0][0]+n[n.length-1][0]).toUpperCase():t[0]?.toUpperCase()||"?"}Be(()=>{const t=Q;if(!(!t||!(e(re)&&!Ge()&&!e(v))))return Me.dispatch(Ks(t,"history")),()=>Me.dispatch(js(t,"history"))});var xs={expandAll:ns,collapseAll:rs,setGroupByCommit:ss,get changes(){return Re()},set changes(t){Re(t),x()},get agentId(){return ye()},set agentId(t=null){ye(t),x()},get isAggregate(){return Fe()},set isAggregate(t=!1){Fe(t),x()},get onOpenAgent(){return Ue()},set onOpenAgent(t){Ue(t),x()},get showStagingControls(){return qe()},set showStagingControls(t=!1){qe(t),x()},get showCategoryFilter(){return $()},set showCategoryFilter(t=!1){$(t),x()},get onStage(){return ie()},set onStage(t){ie(t),x()},get onUnstage(){return De()},set onUnstage(t){De(t),x()},get onRevert(){return Le()},set onRevert(t){Le(t),x()},get onStageAll(){return jt()},set onStageAll(t){jt(t),x()},get onUnstageAll(){return qt()},set onUnstageAll(t){qt(t),x()},get isLoading(){return Lt()},set isLoading(t=!1){Lt(t),x()},get commitInfo(){return D()},set commitInfo(t=null){D(t),x()},get onOpenNote(){return Ht()},set onOpenNote(t){Ht(t),x()},get groupByCommit(){return He()},set groupByCommit(t=!1){He(t),x()},get branchBaseRef(){return wt()},set branchBaseRef(t=null){wt(t),x()},get branchBaseCommitSha(){return It()},set branchBaseCommitSha(t=null){It(t),x()},get gitRootId(){return Ge()},set gitRootId(t=void 0){Ge(t),x()},get gitRootPath(){return bt()},set gitRootPath(t=void 0){bt(t),x()},$set:un,$on:(t,n)=>hn(r,t,n)},Bt=wi();sn("keydown",Us,_s);var er=N(Bt);{var ks=t=>{var n=li(),s=de(n);z((i,o)=>K(s,`${i??""}
|
|
11
|
+
${o??""}`),[()=>l()?.checkpoint?P.agent_node_checkpoint_available({time:l().checkpoint.capturedAt}):P.agent_node_checkpoint_unavailable(),()=>P.agent_node_transcript_diff_notice()]),w(t,n)};M(er,t=>{e(yt)&&t(ks)})}var tr=S(er,2);{var Ps=t=>{{let n=u(()=>P.chat_changesPanel_findInChanges_placeholder());_o(t,{get placeholder(){return e(n)},get currentMatchIndex(){return e(Ye)},get totalMatches(){return e(it).length},emptyResultText:"No results",resultVariant:"muted",inputClass:"w-48",onKeydown:ws,onPrevious:()=>Wt(e(Ye)-1),onNext:()=>Wt(e(Ye)+1),onClose:qn,get query(){return e(ut)},set query(s){m(ut,s,!0)},get inputRef(){return e(Yt)},set inputRef(s){m(Yt,s,!0)}})}};M(tr,t=>{e(dt)&&t(Ps)})}var xn=S(tr,2),kn=N(xn),nr=N(kn);{var Rs=t=>{Te(t)};M(nr,t=>{D()&&t(Rs)})}var Ls=S(nr,2);{var Hs=t=>{var n=di();Pt(n,20,()=>Array(4),Hn,(s,i)=>{var o=ci(),d=N(o),g=N(d),k=N(g);Dt(k,{class:"h-4 w-4 rounded"});var W=S(k,2);Dt(W,{class:"h-4 w-48"}),H(g);var L=S(g,2);Dt(L,{class:"h-5 w-16 rounded-full"}),H(d);var se=S(d,2),Ce=N(se);Dt(Ce,{class:"h-3 w-full"});var ae=S(Ce,2);Dt(ae,{class:"h-3 w-5/6"});var ze=S(ae,2);Dt(ze,{class:"h-3 w-4/6"}),H(se),H(o),w(s,o)}),H(n),w(t,n)},Is=t=>{var n=ui(),s=de(n,!0);z(i=>K(s,i),[()=>P.chat_changesPanel_noChanges_label()]),w(t,n)},As=t=>{var n=_i(),s=ne(n),i=N(s),o=N(i),d=N(o),g=de(d,!0),k=S(d,2);pr(k,{get additions(){return e(Ur)},get deletions(){return e(Wr)},size:"xs",class:"opacity-80"});var W=S(k,2);{var L=te=>{var he=Sr(),xe=de(he,!0);z(be=>K(xe,be),[()=>e(Qt)===1?P.chat_changesPanel_commitCount_one({count:Rt(e(Qt))}):P.chat_changesPanel_commitCount_many({count:Rt(e(Qt))})]),w(te,he)};M(W,te=>{e(re)&&e(Qt)>0&&te(L)})}var se=S(W,2);{var Ce=te=>{var he=hi(),xe=S(ne(he),2),be=de(xe,!0);z(B=>K(be,B),[()=>P.chat_changesPanel_viewedCount_label({count:Rt(e($n))})]),w(te,he)};M(se,te=>{e($n)>0&&te(Ce)})}H(o);var ae=S(o,2),ze=N(ae);{var Je=te=>{var he=gi(),xe=N(he);{let B=u(()=>e(re)?"text-muted-foreground hover:text-foreground":"bg-background text-foreground shadow-sm");ke(xe,{type:"button",variant:"plain",get class(){return`px-2 py-0.5 text-xs rounded cursor-pointer transition-colors ${e(B)??""}`},onclick:()=>m(re,!1),children:(j,_)=>{Tt();var R=ft();z(O=>K(R,O),[()=>P.chat_changesPanel_combined_label()]),w(j,R)},$$slots:{default:!0}})}var be=S(xe,2);{let B=u(()=>e(re)?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground");ke(be,{type:"button",variant:"plain",get class(){return`px-2 py-0.5 text-xs rounded cursor-pointer transition-colors ${e(B)??""}`},onclick:()=>m(re,!0),children:(j,_)=>{Tt();var R=ft();z(O=>K(R,O),[()=>P.chat_changesPanel_byCommit_label()]),w(j,R)},$$slots:{default:!0}})}H(he),w(te,he)};M(ze,te=>{e(Br)&&!D()&&te(Je)})}H(ae),H(i),H(s);var kt=S(s,2),Ot=N(kt);{var ht=te=>{var he=nt(),xe=ne(he);Pt(xe,19,()=>e(lt),(be,B)=>be.hash||"working-"+B,(be,B)=>{var j=nt(),_=ne(j);{var R=X=>{const J=u(()=>Zn(e(B).authorEmail));var I=vi(),E=N(I),V=N(E),ge=N(V);ke(ge,{type:"button",variant:"plain",class:"flex items-center gap-2 flex-1 min-w-0 text-left cursor-pointer",onclick:()=>Qr(e(B).hash),children:(me,le)=>{var pe=fi(),Oe=ne(pe);{let et=u(()=>e(ot).has(e(B).hash)?dr:ur);Ne(Oe,{get icon(){return e(et)},class:"text-subtle w-2.5! h-2.5! shrink-0"})}var We=S(Oe,2),Pn=N(We);{var Os=et=>{{const nn=zs=>{Tt();var rr=ft();z(Ms=>K(rr,Ms),[()=>tn(e(B).author)]),w(zs,rr)};let Rn=u(()=>e(B).author||"");_r(et,{get identity(){return e(J)},get alt(){return e(Rn)},size:20,class:"w-full h-full object-cover",fallback:nn,$$slots:{fallback:!0}})}},Ns=et=>{var nn=ft();z(Rn=>K(nn,Rn),[()=>tn(e(B).author)]),w(et,nn)};M(Pn,et=>{e(J)?et(Os):et(Ns,-1)})}H(We);var Ts=S(We,2),Ds=de(Ts,!0);z(et=>{Ve(We,"title",e(B).author||""),K(Ds,et)},[()=>e(B).message.split(`
|
|
12
|
+
`)[0]]),w(me,pe)},$$slots:{default:!0}});var fe=S(ge,2),U=N(fe);{var Z=me=>{var le=mi(),pe=ne(le),Oe=de(pe,!0);Tt(2),z(We=>K(Oe,We),[()=>wr(e(B).date)]),w(me,le)};M(U,me=>{e(B).date&&me(Z)})}var Ie=S(U,2),ee=de(Ie,!0);H(fe);var ce=S(fe,2);{let me=u(()=>P.chat_changesPanel_openCommit_title());ke(ce,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"text-ui text-muted-foreground hover:text-foreground transition-colors cursor-pointer shrink-0",onclick:()=>yn(e(B).hash),get title(){return e(me)},children:(le,pe)=>{Ne(le,{get icon(){return An},class:"w-2.5 h-2.5"})},$$slots:{default:!0}})}H(V),H(E);var Ae=S(E,2);{var Ee=me=>{var le=pi();Pt(le,21,()=>e(B).changes,pe=>ve(pe),(pe,Oe)=>{ue(pe,()=>e(Oe),()=>!0)}),H(le),cn(3,le,()=>vr,()=>({tier:"fast"})),w(me,le)},Ze=u(()=>e(ot).has(e(B).hash));M(Ae,me=>{e(Ze)&&me(Ee)})}H(I),z(me=>K(ee,me),[()=>e(B).changes.length===1?P.chat_changesPanel_fileCount_one({count:Rt(e(B).changes.length)}):P.chat_changesPanel_fileCount_many({count:Rt(e(B).changes.length)})]),w(X,I)},O=X=>{var J=nt(),I=ne(J);Pt(I,17,()=>e(B).changes,E=>ve(E),(E,V)=>{ue(E,()=>e(V),()=>!1)}),w(X,J)};M(_,X=>{e(B).hash?X(R):X(O,-1)})}w(be,j)}),w(te,he)},Nt=te=>{var he=nt(),xe=ne(he);Pt(xe,17,()=>e(we),be=>be.filePath+"-"+(be.commitHash||"working"),(be,B)=>{ue(be,()=>e(B))}),w(te,he)};M(Ot,te=>{e(re)&&e(lt)?te(ht):te(Nt,-1)})}H(kt),z(te=>K(g,te),[()=>e(bn)===1?P.chat_changesPanel_filesChanged_one({count:Rt(e(bn))}):P.chat_changesPanel_filesChanged_many({count:Rt(e(bn))})]),w(t,n)};M(Ls,t=>{e(Or)?t(Hs):e(we).length===0?t(Is,1):t(As,-1)})}H(kn),on(kn,t=>m(Et,t),()=>e(Et)),H(xn),on(xn,t=>m(ct,t),()=>e(ct)),H(Bt),on(Bt,t=>m(xt,t),()=>e(xt)),ln("pointerdown",Bt,bs),w(f,Bt);var Es=fn(xs);return oe(),Es}xr(["click","pointerdown"]);export{bi as C};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import{I as le}from"./lh2cjQS1.js";import{p as he}from"./ap51LBWo.js";import{a9 as $e,bi as fe,bf as ge,a5 as ue,a6 as ye,bg as xe,c as h,a7 as J,aN as w,bc as me,a8 as q,bC as pe,bm as be,w as we,G as B,v as ke,W as ve,b2 as Ce}from"./Cl430GWg.js";import{p as Ee}from"./ClebXGIM.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"),De=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"),We=h(function(){return d.records.currBranch},"getCurrentBranch"),Pe=h(function(){return d.records.direction},"getDirection"),qe=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:De,getCommitsArray:ne,getCurrentBranch:We,getDirection:Pe,getHead:qe,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,W=new Map,z=[],I=0,y="LR",Je=h(()=>{C.clear(),E.clear(),W.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}=q(),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
|
+
${s-i/2-L/2},${x+R}
|
|
3
|
+
${s-i/2-L/2},${x-R}
|
|
4
|
+
${t.posWithOffset-i/2-L},${x-c-R}
|
|
5
|
+
${t.posWithOffset+i/2+L},${x-c-R}
|
|
6
|
+
${t.posWithOffset+i/2+L},${x+c+R}
|
|
7
|
+
${t.posWithOffset-i/2-L},${x+c+R}`),f.attr("cy",x).attr("cx",s-i/2+L/2).attr("r",1.5).attr("class","tag-hole"),y==="TB"||y==="BT"){const u=s+$;g.attr("class","tag-label-bkg").attr("points",`
|
|
8
|
+
${t.x},${u+2}
|
|
9
|
+
${t.x},${u-2}
|
|
10
|
+
${t.x+O},${u-c-2}
|
|
11
|
+
${t.x+O+i+4},${u-c-2}
|
|
12
|
+
${t.x+O+i+4},${u+c+2}
|
|
13
|
+
${t.x+O},${u+c+2}`).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),f.attr("cx",t.x+L/2).attr("cy",u).attr("transform","translate(12,12) rotate(45, "+t.x+","+s+")"),l.attr("x",t.x+5).attr("y",u+3).attr("transform","translate(14,14) rotate(45, "+t.x+","+s+")")}}}},"drawCommitTags"),cr=h(e=>{switch(e.customType??e.type){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}},"getCommitClassType"),ir=h((e,r,t,s)=>{const o={x:0,y:0};if(e.parents.length>0){const i=ce(e.parents);if(i){const n=s.get(i)??o;return r==="TB"?n.y+_:r==="BT"?(s.get(e.id)??o).y-_:n.x+_}}else return r==="TB"?F:r==="BT"?(s.get(e.id)??o).y-_:0;return 0},"calculatePosition"),dr=h((e,r,t)=>{const s=y==="BT"&&t?r:r+O,o=C.get(e.branch)?.pos,i=y==="TB"||y==="BT"?C.get(e.branch)?.pos:s;if(i===void 0||o===void 0)throw new Error(`Position were undefined for commit ${e.id}`);const n=j.has(q().theme??""),a=y==="TB"||y==="BT"?s:o+(n?X/2+1:-2);return{x:i,y:a,posWithOffset:s}},"getCommitPosition"),re=h((e,r,t,s)=>{const o=e.append("g").attr("class","commit-bullets"),i=e.append("g").attr("class","commit-labels");let n=y==="TB"||y==="BT"?F:0;const a=[...r.keys()],l=s.parallelCommits??!1,f=h(($,c)=>{const x=r.get($)?.seq,u=r.get(c)?.seq;return x!==void 0&&u!==void 0?x-u:0},"sortKeys");let g=a.sort(f);y==="BT"&&(l&&Ze(g,r,n),g=g.reverse()),g.forEach($=>{const c=r.get($);if(!c)throw new Error(`Commit not found for key ${$}`);l&&(n=ir(c,y,n,E));const x=dr(c,n,l);if(t){const u=cr(c),p=c.customType??c.type,b=C.get(c.branch)?.index??0;nr(o,c,x,u,b,p),sr(i,c,x,n,s),or(i,c,x,n)}y==="TB"||y==="BT"?E.set(c.id,{x:x.x,y:x.posWithOffset}):E.set(c.id,{x:x.posWithOffset,y:x.y}),n=y==="BT"&&l?n+_:n+_+O,n>I&&(I=n)})},"drawCommits"),lr=h((e,r,t,s,o)=>{const n=(y==="TB"||y==="BT"?t.x<s.x:t.y<s.y)?r.branch:e.branch,a=h(f=>f.branch===n,"isOnBranchToGetCurve"),l=h(f=>f.seq>e.seq&&f.seq<r.seq,"isBetweenCommits");return[...o.values()].some(f=>l(f)&&a(f))},"shouldRerouteArrow"),P=h((e,r,t=0)=>{const s=e+Math.abs(e-r)/2;if(t>5)return s;if(z.every(n=>Math.abs(n-s)>=10))return z.push(s),s;const i=Math.abs(e-r);return P(e,r-i/5,t+1)},"findLane"),hr=h((e,r,t,s)=>{const{theme:o}=q(),i=Z.has(o??""),n=E.get(r.id),a=E.get(t.id);if(n===void 0||a===void 0)throw new Error(`Commit positions not found for commits ${r.id} and ${t.id}`);const l=lr(r,t,n,a,s);let f="",g="",$=0,c=0,x=C.get(t.branch)?.index;t.type===m.MERGE&&r.id!==t.parents[0]&&(x=C.get(r.branch)?.index);let u;if(l){f="A 10 10, 0, 0, 0,",g="A 10 10, 0, 0, 1,",$=10,c=10;const p=n.y<a.y?P(n.y,a.y):P(a.y,n.y),b=n.x<a.x?P(n.x,a.x):P(a.x,n.x);y==="TB"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${g} ${b} ${n.y+c} L ${b} ${a.y-$} ${f} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${f} ${b} ${n.y+c} L ${b} ${a.y-$} ${g} ${b-c} ${a.y} L ${a.x} ${a.y}`):y==="BT"?n.x<a.x?u=`M ${n.x} ${n.y} L ${b-$} ${n.y} ${f} ${b} ${n.y-c} L ${b} ${a.y+$} ${g} ${b+c} ${a.y} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${b+$} ${n.y} ${g} ${b} ${n.y-c} L ${b} ${a.y+$} ${f} ${b-c} ${a.y} L ${a.x} ${a.y}`):n.y<a.y?u=`M ${n.x} ${n.y} L ${n.x} ${p-$} ${f} ${n.x+c} ${p} L ${a.x-$} ${p} ${g} ${a.x} ${p+c} L ${a.x} ${a.y}`:(x=C.get(r.branch)?.index,u=`M ${n.x} ${n.y} L ${n.x} ${p+$} ${g} ${n.x+c} ${p} L ${a.x-$} ${p} ${f} ${a.x} ${p-c} L ${a.x} ${a.y}`)}else f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,y==="TB"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${g} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${f} ${a.x} ${n.y+c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):y==="BT"?(n.x<a.x&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x>a.x&&(f="A 20 20, 0, 0, 0,",g="A 20 20, 0, 0, 1,",$=20,c=20,t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${f} ${n.x-c} ${a.y} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${a.x+$} ${n.y} ${g} ${a.x} ${n.y-c} L ${a.x} ${a.y}`),n.x===a.x&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`)):(n.y<a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${g} ${a.x} ${n.y+c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y-$} ${f} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y>a.y&&(t.type===m.MERGE&&r.id!==t.parents[0]?u=`M ${n.x} ${n.y} L ${a.x-$} ${n.y} ${f} ${a.x} ${n.y-c} L ${a.x} ${a.y}`:u=`M ${n.x} ${n.y} L ${n.x} ${a.y+$} ${g} ${n.x+c} ${a.y} L ${a.x} ${a.y}`),n.y===a.y&&(u=`M ${n.x} ${n.y} L ${a.x} ${a.y}`));if(u===void 0)throw new Error("Line definition not found");e.append("path").attr("d",u).attr("class","arrow arrow"+H(x,G,i))},"drawArrow"),$r=h((e,r)=>{const t=e.append("g").attr("class","commit-arrows");[...r.keys()].forEach(s=>{const o=r.get(s);o.parents&&o.parents.length>0&&o.parents.forEach(i=>{hr(t,r.get(i),o,r)})})},"drawArrows"),fr=h((e,r,t,s)=>{const{look:o,theme:i,themeVariables:n}=q(),{dropShadow:a,THEME_COLOR_LIMIT:l}=n,f=j.has(i??""),g=Z.has(i??""),$=e.append("g");r.forEach((c,x)=>{const u=H(x,f?l:G,g),p=C.get(c.name)?.pos;if(p===void 0)throw new Error(`Position not found for branch ${c.name}`);const b=y==="TB"||y==="BT"?p:f?p+X/2+1:p-2,k=$.append("line");k.attr("x1",0),k.attr("y1",b),k.attr("x2",I),k.attr("y2",b),k.attr("class","branch branch"+u),y==="TB"?(k.attr("y1",F),k.attr("x1",p),k.attr("y2",I),k.attr("x2",p)):y==="BT"&&(k.attr("y1",I),k.attr("x1",p),k.attr("y2",F),k.attr("x2",p)),z.push(b);const U=c.name,D=oe(U),T=$.insert("rect"),M=$.insert("g").attr("class","branchLabel").insert("g").attr("class","label branch-label"+u);M.node().appendChild(D);const v=D.getBBox(),ee=f?0:4,N=f?16:0,A=f?X:0;o==="neo"&&T.attr("data-look","neo"),T.attr("class","branchLabelBkg label"+u).attr("style",o==="neo"?`filter:${f?`url(#${s}-drop-shadow)`:a}`:"").attr("rx",ee).attr("ry",ee).attr("x",-v.width-4-(t.rotateCommitLabel===!0?30:0)).attr("y",-v.height/2+10).attr("width",v.width+18+N).attr("height",v.height+4+A),M.attr("transform","translate("+(-v.width-14-(t.rotateCommitLabel===!0?30:0)+N/2)+", "+(b-v.height/2-2)+")"),y==="TB"?(T.attr("x",p-v.width/2-10).attr("y",0),M.attr("transform","translate("+(p-v.width/2-5)+", 0)"),f&&(T.attr("transform",`translate(${-N/2-3}, ${-A-10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(-A*2+7)+")"))):y==="BT"?(T.attr("x",p-v.width/2-10).attr("y",I),M.attr("transform","translate("+(p-v.width/2-5)+", "+I+")"),f&&(T.attr("transform",`translate(${-N/2-3}, ${A+10})`),M.attr("transform","translate("+(p-v.width/2-5)+", "+(I+A*2+4)+")"))):T.attr("transform","translate(-19, "+(b-12-A/2)+")")})},"drawBranches"),gr=h(function(e,r,t,s,o){return C.set(e,{pos:r,index:t}),r+=50+(o?40:0)+(y==="TB"||y==="BT"?s.width/2:0),r},"setBranchPosition"),ur=h(function(e,r,t,s){Je(),w.debug("in gitgraph renderer",e+`
|
|
14
|
+
`,"id:",r,t);const o=s.db;if(!o.getConfig){w.error("getConfig method is not available on db");return}const i=o.getConfig(),n=i.rotateCommitLabel??!1;W=o.getCommits();const a=o.getBranchesAsObjArray();y=o.getDirection();const l=me(`[id="${r}"]`),{look:f,theme:g,themeVariables:$}=q(),{useGradient:c,gradientStart:x,gradientStop:u,filterColor:p}=$;if(c){const k=l.append("defs").append("linearGradient").attr("id",r+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");k.append("stop").attr("offset","0%").attr("stop-color",x).attr("stop-opacity",1),k.append("stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}f==="neo"&&j.has(g??"")&&l.append("defs").append("filter").attr("id",r+"-drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",p);let b=0;a.forEach((k,U)=>{const D=oe(k.name),T=l.append("g"),K=T.insert("g").attr("class","branchLabel"),M=K.insert("g").attr("class","label branch-label");M.node()?.appendChild(D);const v=D.getBBox();b=gr(k.name,b,U,v,n),M.remove(),K.remove(),T.remove()}),re(l,W,!1,i),i.showBranches&&fr(l,a,i,r),$r(l,W),re(l,W,!0,i),pe.insertTitle(l,"gitTitleText",i.titleTopMargin??0,o.getDiagramTitle()),be(void 0,l,i.diagramPadding,i.useMaxWidth)},"draw"),yr={draw:ur},ie=8,de=new Set(["redux","redux-dark","redux-color","redux-dark-color"]),xr=new Set(["redux-color","redux-dark-color"]),mr=new Set(["neo","neo-dark"]),pr=new Set(["dark","redux-dark","redux-dark-color","neo-dark"]),br=new Set(["redux","redux-dark","redux-color","redux-dark-color","neo","neo-dark"]),wr=h(e=>{const{svgId:r}=e;let t="";if(e.useGradient&&r)for(let s=0;s<e.THEME_COLOR_LIMIT;s++)t+=`
|
|
15
|
+
.label${s} { fill: ${e.mainBkg}; stroke: url(${r}-gradient); stroke-width: ${e.strokeWidth};}
|
|
16
|
+
`;return t},"genGitGraphGradient"),kr=h(e=>{const r=J(),{theme:t,themeVariables:s}=r,{borderColorArray:o}=s,i=de.has(t);if(mr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
|
|
17
|
+
.branch-label${a} { fill: ${e.nodeBorder};}
|
|
18
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
19
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
20
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
21
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
22
|
+
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
|
23
|
+
${wr(e)}`;else{const l=a%ie;n+=`
|
|
24
|
+
.branch-label${a} { fill: ${e["gitBranchLabel"+l]}; }
|
|
25
|
+
.commit${a} { stroke: ${e["git"+l]}; fill: ${e["git"+l]}; }
|
|
26
|
+
.commit-highlight${a} { stroke: ${e["gitInv"+l]}; fill: ${e["gitInv"+l]}; }
|
|
27
|
+
.arrow${a} { stroke: ${e["git"+l]}; }
|
|
28
|
+
`}return n}else if(xr.has(t)){let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
|
|
29
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
|
30
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
31
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
|
|
32
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
|
33
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
34
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
35
|
+
`;else{const l=a%o.length;n+=`
|
|
36
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
|
37
|
+
.commit${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
|
38
|
+
.commit-highlight${a} { stroke: ${o[l]}; fill: ${o[l]}; }
|
|
39
|
+
.label${a} { fill: ${pr.has(t)?e.mainBkg:o[l]}; stroke: ${o[l]}; stroke-width: ${e.strokeWidth}; }
|
|
40
|
+
.arrow${a} { stroke: ${o[l]}; }
|
|
41
|
+
`}return n}else{let n="";for(let a=0;a<e.THEME_COLOR_LIMIT;a++)n+=`
|
|
42
|
+
.branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:""} }
|
|
43
|
+
.commit${a} { stroke: ${e.nodeBorder}; }
|
|
44
|
+
.commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
|
|
45
|
+
.label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:""}}
|
|
46
|
+
.arrow${a} { stroke: ${e.nodeBorder}; }
|
|
47
|
+
.commit-bullets { fill: ${e.nodeBorder}; }
|
|
48
|
+
.commit-cherry-pick${a} { stroke: ${e.nodeBorder}; }
|
|
49
|
+
`;return n}},"genColor"),vr=h(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(r,t)=>t).map(r=>{const t=r%ie;return`
|
|
50
|
+
.branch-label${r} { fill: ${e["gitBranchLabel"+t]}; }
|
|
51
|
+
.commit${r} { stroke: ${e["git"+t]}; fill: ${e["git"+t]}; }
|
|
52
|
+
.commit-highlight${r} { stroke: ${e["gitInv"+t]}; fill: ${e["gitInv"+t]}; }
|
|
53
|
+
.label${r} { fill: ${e["git"+t]}; }
|
|
54
|
+
.arrow${r} { stroke: ${e["git"+t]}; }
|
|
55
|
+
`}).join(`
|
|
56
|
+
`)}`,"normalTheme"),Cr=h(e=>{const r=J(),{theme:t}=r,s=br.has(t);return`
|
|
57
|
+
.commit-id,
|
|
58
|
+
.commit-msg,
|
|
59
|
+
.branch-label {
|
|
60
|
+
fill: lightgrey;
|
|
61
|
+
color: lightgrey;
|
|
62
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
63
|
+
font-family: var(--mermaid-font-family);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
${s?kr(e):vr(e)}
|
|
67
|
+
|
|
68
|
+
.branch {
|
|
69
|
+
stroke-width: ${e.strokeWidth};
|
|
70
|
+
stroke: ${e.commitLineColor??e.lineColor};
|
|
71
|
+
stroke-dasharray: ${s?"4 2":"2"};
|
|
72
|
+
}
|
|
73
|
+
.commit-label { font-size: ${e.commitLabelFontSize}; fill: ${s?e.nodeBorder:e.commitLabelColor}; ${s?`font-weight:${e.noteFontWeight};`:""}}
|
|
74
|
+
.commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${s?"transparent":e.commitLabelBackground}; opacity: ${s?"":.5}; }
|
|
75
|
+
.tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
|
|
76
|
+
.tag-label-bkg { fill: ${s?e.mainBkg:e.tagLabelBackground}; stroke: ${s?e.nodeBorder:e.tagLabelBorder}; ${s?`filter:${e.dropShadow}`:""} }
|
|
77
|
+
.tag-hole { fill: ${e.textColor}; }
|
|
78
|
+
|
|
79
|
+
.commit-merge {
|
|
80
|
+
stroke: ${s?e.mainBkg:e.primaryColor};
|
|
81
|
+
fill: ${s?e.mainBkg:e.primaryColor};
|
|
82
|
+
}
|
|
83
|
+
.commit-reverse {
|
|
84
|
+
stroke: ${s?e.mainBkg:e.primaryColor};
|
|
85
|
+
fill: ${s?e.mainBkg:e.primaryColor};
|
|
86
|
+
stroke-width: ${s?e.strokeWidth:3};
|
|
87
|
+
}
|
|
88
|
+
.commit-highlight-outer {
|
|
89
|
+
}
|
|
90
|
+
.commit-highlight-inner {
|
|
91
|
+
stroke: ${s?e.mainBkg:e.primaryColor};
|
|
92
|
+
fill: ${s?e.mainBkg:e.primaryColor};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.arrow {
|
|
96
|
+
/* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
|
|
97
|
+
stroke-width: ${de.has(t)?e.strokeWidth:8};
|
|
98
|
+
stroke-linecap: round;
|
|
99
|
+
fill: none
|
|
100
|
+
}
|
|
101
|
+
.gitTitleText {
|
|
102
|
+
text-anchor: middle;
|
|
103
|
+
font-size: 18px;
|
|
104
|
+
fill: ${e.textColor};
|
|
105
|
+
}
|
|
106
|
+
`},"getStyles"),Er=Cr,Rr={parser:Ve,db:se,renderer:yr,styles:Er};export{Rr as diagram};
|