@intent-hq/web 2.384.2 → 2.385.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{CK2Cr1RP.js → 0RCk28l5.js} +1 -1
- package/web/app/immutable/chunks/{DVL_BM5a.js → 0oyPeRI9.js} +1 -1
- package/web/app/immutable/chunks/{BEjISjEF.js → 2zSj5_GV.js} +1 -1
- package/web/app/immutable/chunks/{D6Hf6lXy.js → 3VhO4Wn2.js} +1 -1
- package/web/app/immutable/chunks/{6n7e2aNB.js → 3qVSmuIV.js} +1 -1
- package/web/app/immutable/chunks/{CYQKXGJn.js → 40W1U6K5.js} +1 -1
- package/web/app/immutable/chunks/{BZidc-yX.js → 418Agcsp.js} +1 -1
- package/web/app/immutable/chunks/{BTtAt-Pu.js → 4PAYwk2I.js} +1 -1
- package/web/app/immutable/chunks/{DXdFemRu.js → 4g_iHoQm.js} +1 -1
- package/web/app/immutable/chunks/{BRsOtr8M.js → 4poQ2xKW.js} +1 -1
- package/web/app/immutable/chunks/{CXul4WJt.js → 5-0LQoqd.js} +1 -1
- package/web/app/immutable/chunks/{BTc_j7Dt.js → 7KxcPj98.js} +1 -1
- package/web/app/immutable/chunks/{CpMQqUEz.js → 7OH6WUSt.js} +1 -1
- package/web/app/immutable/chunks/{BwLxx4IG.js → 7y3Z0Q49.js} +3 -3
- package/web/app/immutable/chunks/{B4mHWFlW.js → 8jMQM9h0.js} +1 -1
- package/web/app/immutable/chunks/{xmnalplU.js → 94vL4WlW.js} +1 -1
- package/web/app/immutable/chunks/{BVlMQ1xQ.js → 9GO97JAL.js} +1 -1
- package/web/app/immutable/chunks/{CpimfPxg.js → A0KsbysW.js} +1 -1
- package/web/app/immutable/chunks/{QFC15GkG.js → B-E_4dSm.js} +2 -2
- package/web/app/immutable/chunks/{DaXosNFA.js → B0qb2Ymj.js} +1 -1
- package/web/app/immutable/chunks/{B7h1ZmQS.js → B22zVGFP.js} +1 -1
- package/web/app/immutable/chunks/{k863GLf6.js → B2CniqS1.js} +1 -1
- package/web/app/immutable/chunks/{DB0jxR-D.js → B2XeuV1l.js} +1 -1
- package/web/app/immutable/chunks/{CmImGhNY.js → B433f4mk.js} +1 -1
- package/web/app/immutable/chunks/{4QXQvR4H.js → B5pL-E-o.js} +1 -1
- package/web/app/immutable/chunks/{55FYKQCf.js → B5qiyEpH.js} +1 -1
- package/web/app/immutable/chunks/{BNN0vAFF.js → B5tvpTFB.js} +1 -1
- package/web/app/immutable/chunks/{CE0jr9sE.js → B6FGs8l2.js} +1 -1
- package/web/app/immutable/chunks/{CdMAY9xp.js → B6QnBRPC.js} +1 -1
- package/web/app/immutable/chunks/{Di3TE7pQ.js → B6d1Nolc.js} +1 -1
- package/web/app/immutable/chunks/{B4PfEXaO.js → B6eTPmJH.js} +1 -1
- package/web/app/immutable/chunks/{B7JHU89G.js → B8HnjSSF.js} +1 -1
- package/web/app/immutable/chunks/{xeMXLCBg.js → B8QvP_8b.js} +1 -1
- package/web/app/immutable/chunks/{BYU-C1jV.js → B9ka1bX8.js} +2 -2
- package/web/app/immutable/chunks/{CNzCvSR9.js → BBYtaKSX.js} +1 -1
- package/web/app/immutable/chunks/{I8XhKsSY.js → BByf3ILj.js} +1 -1
- package/web/app/immutable/chunks/{DJM7b4MF.js → BCLFORRd.js} +1 -1
- package/web/app/immutable/chunks/{leDczq9h.js → BD9db4FR.js} +1 -1
- package/web/app/immutable/chunks/{DLvrhtSt.js → BDsciJGp.js} +1 -1
- package/web/app/immutable/chunks/{X-wIiWCo.js → BECK4OaG.js} +1 -1
- package/web/app/immutable/chunks/{DnozpXMO.js → BGspyNwk.js} +1 -1
- package/web/app/immutable/chunks/{DpeQIGDn.js → BHEogMS0.js} +2 -2
- package/web/app/immutable/chunks/{BAdVoGAI.js → BHqp2vwo.js} +1 -1
- package/web/app/immutable/chunks/{CIU_APaR.js → BIGqOuh0.js} +1 -1
- package/web/app/immutable/chunks/{DilOhRAO.js → BJO0de_7.js} +1 -1
- package/web/app/immutable/chunks/{BDPP0w0q.js → BJgwBOBz.js} +1 -1
- package/web/app/immutable/chunks/{DxDZbRkP.js → BLKFshyr.js} +1 -1
- package/web/app/immutable/chunks/{Dg5FvxXA.js → BNX4ri6c.js} +3 -3
- package/web/app/immutable/chunks/{D2Rapl2X.js → BNa9zzEx.js} +1 -1
- package/web/app/immutable/chunks/{B7RoQL2j.js → BO4b6Ny-.js} +2 -2
- package/web/app/immutable/chunks/{CVoQx6Vw.js → BO8Bp7Ht.js} +1 -1
- package/web/app/immutable/chunks/{DLKd3Oyl.js → BORk03Sd.js} +1 -1
- package/web/app/immutable/chunks/{tF7VK2wM.js → BP1fPIN6.js} +1 -1
- package/web/app/immutable/chunks/{rNjiZ_3W.js → BPuz5cN_.js} +2 -2
- package/web/app/immutable/chunks/{Bygp72Wl.js → BSUnflvl.js} +1 -1
- package/web/app/immutable/chunks/{Bm6FDHvN.js → BSWVBeG0.js} +1 -1
- package/web/app/immutable/chunks/{Df4fyHSB.js → BSgFpkqa.js} +1 -1
- package/web/app/immutable/chunks/{BOpszErG.js → BSntxgH1.js} +1 -1
- package/web/app/immutable/chunks/{YTt0B0lA.js → BT8hDSo1.js} +1 -1
- package/web/app/immutable/chunks/{BAAb6Ol7.js → BU1Gcrkq.js} +1 -1
- package/web/app/immutable/chunks/{Cb6nJOfB.js → BV1ayWTC.js} +1 -1
- package/web/app/immutable/chunks/{DN-MAVuE.js → BV47Ledo.js} +1 -1
- package/web/app/immutable/chunks/{CI-VmE1m.js → BVctKbNy.js} +1 -1
- package/web/app/immutable/chunks/{CIzFSDuO.js → BVkAOJlr.js} +1 -1
- package/web/app/immutable/chunks/{Bosi029J.js → BVl79jmM.js} +1 -1
- package/web/app/immutable/chunks/{iVHs_bWz.js → BVuLEX_p.js} +1 -1
- package/web/app/immutable/chunks/{uAXEbxa8.js → BW1iql_y.js} +1 -1
- package/web/app/immutable/chunks/{DDnDtSlm.js → BXJzIaQM.js} +1 -1
- package/web/app/immutable/chunks/{C4IVoYqo.js → BYLCAn5f.js} +1 -1
- package/web/app/immutable/chunks/{Mh0PqgbP.js → B_4WsP9b.js} +1 -1
- package/web/app/immutable/chunks/{D5-RCLzi.js → B_75gRww.js} +1 -1
- package/web/app/immutable/chunks/{CQZUFyS7.js → BbLh3POL.js} +1 -1
- package/web/app/immutable/chunks/{D5q2XDzo.js → BbuLzldI.js} +1 -1
- package/web/app/immutable/chunks/{72S4_8Fo.js → Bc1vJq_Z.js} +1 -1
- package/web/app/immutable/chunks/{D8s3q34H.js → BcEkxi5l.js} +1 -1
- package/web/app/immutable/chunks/{BTtqZJEI.js → BcKrkXju.js} +1 -1
- package/web/app/immutable/chunks/{2bsrY56g.js → Bd1Doib5.js} +2 -2
- package/web/app/immutable/chunks/{6kZoubzS.js → BdEtT3Ti.js} +1 -1
- package/web/app/immutable/chunks/{CJ72QIuX.js → BeJRU38G.js} +3 -3
- package/web/app/immutable/chunks/{DGZLYT-c.js → BeU-lAdJ.js} +1 -1
- package/web/app/immutable/chunks/{BXE_7Biv.js → Bf_nrOhg.js} +1 -1
- package/web/app/immutable/chunks/{CwHPdS9l.js → BgDnzAo4.js} +1 -1
- package/web/app/immutable/chunks/{D3qs3VJZ.js → BhD_8q1J.js} +1 -1
- package/web/app/immutable/chunks/{Za_i3D8P.js → Bhb3isek.js} +4 -4
- package/web/app/immutable/chunks/{CayjT2l8.js → Bi-y50ry.js} +1 -1
- package/web/app/immutable/chunks/{0tWsVa0y.js → Bi_Yd73A.js} +1 -1
- package/web/app/immutable/chunks/{CEjK2ich.js → BjlMkd10.js} +1 -1
- package/web/app/immutable/chunks/{gkPeOUJv.js → BlDwsvYd.js} +1 -1
- package/web/app/immutable/chunks/{RWWlGLMu.js → BlIRL_82.js} +1 -1
- package/web/app/immutable/chunks/{D4g4334W.js → BmF8Qq3w.js} +1 -1
- package/web/app/immutable/chunks/{BPZBxYco.js → BoIbJp9v.js} +1 -1
- package/web/app/immutable/chunks/{B4l71ix-.js → BpYEdDT4.js} +1 -1
- package/web/app/immutable/chunks/BsdyWfPQ.js +2 -0
- package/web/app/immutable/chunks/{CMbvNZma.js → BtBQ5qfh.js} +1 -1
- package/web/app/immutable/chunks/{4oPBEC4-.js → Bt_vaAcw.js} +1 -1
- package/web/app/immutable/chunks/{CcmN1reb.js → Bu-RLSv9.js} +1 -1
- package/web/app/immutable/chunks/{CXrVII1G.js → BuFDqZnJ.js} +1 -1
- package/web/app/immutable/chunks/{D0sQr-H_.js → BuPmvT2w.js} +1 -1
- package/web/app/immutable/chunks/{ZNhLMxqQ.js → BupDQr_B.js} +2 -2
- package/web/app/immutable/chunks/{CJoPlWyA.js → Bv_xG3nA.js} +1 -1
- package/web/app/immutable/chunks/{Bap7o4n5.js → BvbZcfOT.js} +1 -1
- package/web/app/immutable/chunks/{Djz9uuuA.js → BvbeTrka.js} +1 -1
- package/web/app/immutable/chunks/{BJZU-qAV.js → BvzO6hxM.js} +1 -1
- package/web/app/immutable/chunks/{BK6CZrM5.js → BwC--T1G.js} +1 -1
- package/web/app/immutable/chunks/{4jB5IsVV.js → BwPwF85e.js} +1 -1
- package/web/app/immutable/chunks/{DKrlwauu.js → Bwx5QwNp.js} +1 -1
- package/web/app/immutable/chunks/{CgJXgMzB.js → BxU4EAMe.js} +1 -1
- package/web/app/immutable/chunks/{CBvkahdk.js → ByZMA8RF.js} +1 -1
- package/web/app/immutable/chunks/{IxfPVMNO.js → C-G2u0Oe.js} +1 -1
- package/web/app/immutable/chunks/{0v4yIgtg.js → C-PQQ8rb.js} +1 -1
- package/web/app/immutable/chunks/{D400ElMz.js → C-zB-6G6.js} +1 -1
- package/web/app/immutable/chunks/{YtoDeXhM.js → C0Zo7HuP.js} +1 -1
- package/web/app/immutable/chunks/{ump_SWLl.js → C1AUaRa8.js} +1 -1
- package/web/app/immutable/chunks/{COB2k0Aa.js → C2F2Vd1P.js} +1 -1
- package/web/app/immutable/chunks/{DkET5D1Z.js → C2Hs8n0u.js} +1 -1
- package/web/app/immutable/chunks/{CnHcPhIW.js → C3-81PRC.js} +4 -4
- package/web/app/immutable/chunks/{rYnu2FeJ.js → C3gIkQxX.js} +1 -1
- package/web/app/immutable/chunks/{CCAcpS1o.js → C412Y6ti.js} +2 -2
- package/web/app/immutable/chunks/{BGN0Ete3.js → C4Py2-C-.js} +1 -1
- package/web/app/immutable/chunks/{DHbqsCcC.js → C4UnZ5aI.js} +1 -1
- package/web/app/immutable/chunks/{C6g7LzDB.js → C50zlWbZ.js} +1 -1
- package/web/app/immutable/chunks/{CmbheRhJ.js → C63WwVct.js} +1 -1
- package/web/app/immutable/chunks/{CJW4jhjq.js → C8LrJXqa.js} +1 -1
- package/web/app/immutable/chunks/{Bb9tq6rt.js → C9ew0Hx2.js} +1 -1
- package/web/app/immutable/chunks/{DpChblex.js → C9p4fddz.js} +1 -1
- package/web/app/immutable/chunks/{Cw2ZnpX7.js → CA8JHp72.js} +1 -1
- package/web/app/immutable/chunks/{C0fFeGdB.js → CAfPEsZt.js} +1 -1
- package/web/app/immutable/chunks/CAtVH-rJ.js +158 -0
- package/web/app/immutable/chunks/CCIZBeez.js +1 -0
- package/web/app/immutable/chunks/{BhVPbMnV.js → CD-M_2xD.js} +1 -1
- package/web/app/immutable/chunks/{cKonll34.js → CDAnHxmJ.js} +1 -1
- package/web/app/immutable/chunks/{qLxI2L63.js → CDBHtmaA.js} +1 -1
- package/web/app/immutable/chunks/{H9nIRlnK.js → CE9_m5Rd.js} +1 -1
- package/web/app/immutable/chunks/{AYsHMWH3.js → CEEUgGO1.js} +1 -1
- package/web/app/immutable/chunks/{CjyJQV6j.js → CEfkJpk7.js} +1 -1
- package/web/app/immutable/chunks/{DETS1-K4.js → CGYPBD6G.js} +1 -1
- package/web/app/immutable/chunks/{C0CrTfQC.js → CHto7_WH.js} +1 -1
- package/web/app/immutable/chunks/{KMO8sO00.js → CI0C7_h-.js} +1 -1
- package/web/app/immutable/chunks/{D4ZMSrvm.js → CIWky03S.js} +3 -3
- package/web/app/immutable/chunks/{CHMwcoWM.js → CIaruUrd.js} +1 -1
- package/web/app/immutable/chunks/{BzqJYEOZ.js → CJB-ebPL.js} +1 -1
- package/web/app/immutable/chunks/{_0LhNaan.js → CJNNcGWg.js} +1 -1
- package/web/app/immutable/chunks/{NZ_vlsKe.js → CLlFdy2p.js} +1 -1
- package/web/app/immutable/chunks/{jmJoSjVa.js → CLo9TzNK.js} +1 -1
- package/web/app/immutable/chunks/{CegXgKbh.js → CNSshwg_.js} +1 -1
- package/web/app/immutable/chunks/{Ciei8d6b.js → COflq_3N.js} +3 -3
- package/web/app/immutable/chunks/{O63l2zGE.js → COgn_CzG.js} +1 -1
- package/web/app/immutable/chunks/{BWtgRgi0.js → CPI5xBWX.js} +1 -1
- package/web/app/immutable/chunks/{oTjaecL9.js → CPaH4fRt.js} +1 -1
- package/web/app/immutable/chunks/{ByYwSpDO.js → CQMFoUkp.js} +1 -1
- package/web/app/immutable/chunks/{BmALJKBY.js → CR-JVxLD.js} +1 -1
- package/web/app/immutable/chunks/CT9qg5pc.js +1 -0
- package/web/app/immutable/chunks/{DpmMYKqt.js → CTW83wJs.js} +1 -1
- package/web/app/immutable/chunks/{DMrypNw-.js → CV2tdNDf.js} +1 -1
- package/web/app/immutable/chunks/{BqU6TsU1.js → CVU_1O7c.js} +1 -1
- package/web/app/immutable/chunks/{DV6uX7ff.js → CVs9CHtI.js} +1 -1
- package/web/app/immutable/chunks/{C9fPgzDG.js → CWOQ_pUA.js} +1 -1
- package/web/app/immutable/chunks/{BcffwE-d.js → CWTUGfLW.js} +1 -1
- package/web/app/immutable/chunks/{CWwAStwx.js → CXDUvPYf.js} +1 -1
- package/web/app/immutable/chunks/{_Tye__BB.js → CYSndAne.js} +1 -1
- package/web/app/immutable/chunks/{DnHJL326.js → C_SKcJv7.js} +1 -1
- package/web/app/immutable/chunks/{Cb0AGw5F.js → Cbb4o3qj.js} +1 -1
- package/web/app/immutable/chunks/{Dk0Z1pVU.js → CbxBZqC_.js} +1 -1
- package/web/app/immutable/chunks/{DKLk3Wx8.js → CdbRvoG6.js} +1 -1
- package/web/app/immutable/chunks/{Bw8_vMki.js → ClNMpui4.js} +1 -1
- package/web/app/immutable/chunks/{edw8TVSr.js → CletI6Pa.js} +1 -1
- package/web/app/immutable/chunks/{Dfh8DRT0.js → Clez3uTU.js} +3 -3
- package/web/app/immutable/chunks/{CwTWayd0.js → Clo7aK1n.js} +1 -1
- package/web/app/immutable/chunks/{CbucW-av.js → Cnl_O3ZO.js} +1 -1
- package/web/app/immutable/chunks/{CWezNj5-.js → CoJyxFcH.js} +1 -1
- package/web/app/immutable/chunks/{DCP9TL-A.js → Cp02CBjf.js} +1 -1
- package/web/app/immutable/chunks/{BaJfBXet.js → Cp7Byf5d.js} +1 -1
- package/web/app/immutable/chunks/{BGaOyp5o.js → CqrCSb8W.js} +1 -1
- package/web/app/immutable/chunks/{BziYv9ZW.js → Cr2Op5yp.js} +2 -2
- package/web/app/immutable/chunks/{BHKaBN6i.js → Cr5QjekU.js} +1 -1
- package/web/app/immutable/chunks/{CJHIllR1.js → CrEMns9K.js} +1 -1
- package/web/app/immutable/chunks/{DXB4L22V.js → CrsbEWnE.js} +1 -1
- package/web/app/immutable/chunks/{BNFLngEB.js → Csh6XB2J.js} +1 -1
- package/web/app/immutable/chunks/{BaodMpKG.js → CsyhqW-P.js} +1 -1
- package/web/app/immutable/chunks/{DOuyIvfN.js → CuPx_r7k.js} +1 -1
- package/web/app/immutable/chunks/{BD47nZkr.js → Cy9hcA7q.js} +1 -1
- package/web/app/immutable/chunks/{CjZEyjv4.js → D-rRuAXZ.js} +1 -1
- package/web/app/immutable/chunks/{B7o2QL9R.js → D0R3sca1.js} +1 -1
- package/web/app/immutable/chunks/{DoStKyYK.js → D20kqX2U.js} +2 -2
- package/web/app/immutable/chunks/{DOU-V4Cg.js → D2mnZ9kC.js} +2 -2
- package/web/app/immutable/chunks/{DZjKvOyB.js → D5Tu5Sg8.js} +1 -1
- package/web/app/immutable/chunks/{DTU57FsX.js → D7Dfbf5g.js} +1 -1
- package/web/app/immutable/chunks/{D5u143LD.js → D8XzixBC.js} +1 -1
- package/web/app/immutable/chunks/{CPel99qV.js → DDb9H7X6.js} +3 -3
- package/web/app/immutable/chunks/{DltbAw1B.js → DDrpCbke.js} +1 -1
- package/web/app/immutable/chunks/{Dm9EHXJZ.js → DEDo4DeD.js} +4 -4
- package/web/app/immutable/chunks/{Cx6Utm5I.js → DErxk4N4.js} +1 -1
- package/web/app/immutable/chunks/{DfOxl3xY.js → DEs9kPtf.js} +1 -1
- package/web/app/immutable/chunks/{DhHLTWgE.js → DGMrUmNq.js} +1 -1
- package/web/app/immutable/chunks/{BCx-pM-8.js → DGVdJiQ7.js} +1 -1
- package/web/app/immutable/chunks/{DcACHBPs.js → DHf7N1bI.js} +1 -1
- package/web/app/immutable/chunks/{CvxVjZLu.js → DI71nFp4.js} +1 -1
- package/web/app/immutable/chunks/{AXE1aiRo.js → DJPIUVkw.js} +1 -1
- package/web/app/immutable/chunks/{BWmYJDmC.js → DLCFUd4s.js} +1 -1
- package/web/app/immutable/chunks/{2V6-Yhg-.js → DM1_VFfD.js} +1 -1
- package/web/app/immutable/chunks/{BFc0Rlfo.js → DMeCi1eF.js} +1 -1
- package/web/app/immutable/chunks/{Bs8vOu-_.js → DPR_clFy.js} +1 -1
- package/web/app/immutable/chunks/{RzextV4B.js → DPY-p9P3.js} +2 -2
- package/web/app/immutable/chunks/{7Em2EC6e.js → DQT1hnTe.js} +1 -1
- package/web/app/immutable/chunks/{CU_25eHm.js → DR6M_MBd.js} +1 -1
- package/web/app/immutable/chunks/{D0I7VQ8a.js → DSiGyv9Y.js} +1 -1
- package/web/app/immutable/chunks/{mLzVJBUx.js → DTDtxEAk.js} +1 -1
- package/web/app/immutable/chunks/{CSIAWhhl.js → DUAtqTLU.js} +1 -1
- package/web/app/immutable/chunks/{CU89eAKc.js → DV7x43jt.js} +1 -1
- package/web/app/immutable/chunks/{BEvFtidS.js → DWa-2rkZ.js} +1 -1
- package/web/app/immutable/chunks/{CRFehAxF.js → DX9N1RQz.js} +1 -1
- package/web/app/immutable/chunks/{DB4f78Ip.js → D_VvdZe2.js} +1 -1
- package/web/app/immutable/chunks/{BNm3whw0.js → Da-Blgd9.js} +1 -1
- package/web/app/immutable/chunks/{BXT21uPn.js → DcOkWaeN.js} +1 -1
- package/web/app/immutable/chunks/{Ct8L3-dh.js → DgJnzjEh.js} +1 -1
- package/web/app/immutable/chunks/{Jh2BVut2.js → DiURwJNX.js} +1 -1
- package/web/app/immutable/chunks/{C5tAJtyd.js → DlU1rxYV.js} +1 -1
- package/web/app/immutable/chunks/{BQ1b28aV.js → DlUpt_0u.js} +1 -1
- package/web/app/immutable/chunks/{ez7LBTR9.js → DlWS0XX3.js} +1 -1
- package/web/app/immutable/chunks/{h3LTJhAu.js → DmhHa5tp.js} +1 -1
- package/web/app/immutable/chunks/{DAzQ7i2U.js → Dmn1abz2.js} +1 -1
- package/web/app/immutable/chunks/{Dl9we4aZ.js → DnLmeVJZ.js} +1 -1
- package/web/app/immutable/chunks/{1MN-thc1.js → Do2KlQU0.js} +1 -1
- package/web/app/immutable/chunks/DoOue2dc.js +2 -0
- package/web/app/immutable/chunks/{2ndYjFQq.js → Dp8FVKoA.js} +1 -1
- package/web/app/immutable/chunks/{Chx7ONT3.js → DqAYkzSz.js} +1 -1
- package/web/app/immutable/chunks/{hcDGwCEP.js → DrTTxENT.js} +1 -1
- package/web/app/immutable/chunks/{BqCuw50f.js → DsfORPYa.js} +1 -1
- package/web/app/immutable/chunks/{CcSZrbR4.js → DtqPBHQj.js} +1 -1
- package/web/app/immutable/chunks/{BEpYOO0x.js → DtyEiVnc.js} +1 -1
- package/web/app/immutable/chunks/{CXCw-Jw-.js → DuAAGnM9.js} +1 -1
- package/web/app/immutable/chunks/{CAmQkXZq.js → Dval4sTX.js} +1 -1
- package/web/app/immutable/chunks/{CJtFSxbf.js → Dvi4g0xk.js} +1 -1
- package/web/app/immutable/chunks/Dws-34a7.js +1 -0
- package/web/app/immutable/chunks/{BBV_EtXR.js → Dx3P5K2z.js} +1 -1
- package/web/app/immutable/chunks/{BdnR40vX.js → DxC0zTSc.js} +1 -1
- package/web/app/immutable/chunks/{CBZTF7Qa.js → DxPvfI2H.js} +4 -4
- package/web/app/immutable/chunks/{DbDI5c8r.js → Dxfvrgme.js} +1 -1
- package/web/app/immutable/chunks/{BhpCwvYl.js → DyZa5hX5.js} +1 -1
- package/web/app/immutable/chunks/{Bc3o0U_Z.js → Ex_x2wO5.js} +1 -1
- package/web/app/immutable/chunks/{B8nUpMEz.js → GIVowYni.js} +1 -1
- package/web/app/immutable/chunks/{CP9jggxp.js → Gt7Fxn5w.js} +1 -1
- package/web/app/immutable/chunks/{C0A3yiL9.js → HU1Ksz8U.js} +1 -1
- package/web/app/immutable/chunks/{wZz1J3UE.js → IIW6JGdD.js} +1 -1
- package/web/app/immutable/chunks/{BvFRd1je.js → JM7CQkWC.js} +1 -1
- package/web/app/immutable/chunks/{CceLSCZq.js → K8u-JjT9.js} +1 -1
- package/web/app/immutable/chunks/{oki3b9jv.js → L7Esr5Id.js} +1 -1
- package/web/app/immutable/chunks/{CGaMCAik.js → LQRHF1eM.js} +1 -1
- package/web/app/immutable/chunks/{x019Lcmv.js → OGqbAD_O.js} +1 -1
- package/web/app/immutable/chunks/{CbDsELcV.js → OrN9D77d.js} +3 -3
- package/web/app/immutable/chunks/{DZEg_JlV.js → PhAbES0t.js} +1 -1
- package/web/app/immutable/chunks/{BaJMqkSd.js → QRUY44Ff.js} +1 -1
- package/web/app/immutable/chunks/{9Bk8hwX5.js → RHSH5iZ7.js} +1 -1
- package/web/app/immutable/chunks/{C9aF-Sor.js → SbTG0nwQ.js} +1 -1
- package/web/app/immutable/chunks/{CyYfX9fz.js → TT8yXpG-.js} +1 -1
- package/web/app/immutable/chunks/{C4VXXfVL.js → U7dpdlAf.js} +1 -1
- package/web/app/immutable/chunks/{Bcb1iqQJ.js → VeUh5OMZ.js} +1 -1
- package/web/app/immutable/chunks/Whej1Dge.js +1 -0
- package/web/app/immutable/chunks/{DaZ7K0cS.js → Z9NyJp9w.js} +3 -3
- package/web/app/immutable/chunks/{DCGl0RXW.js → ZRNKCUqe.js} +47 -47
- package/web/app/immutable/chunks/{CUWtSiZ5.js → _2VCBG9z.js} +1 -1
- package/web/app/immutable/chunks/{DZAKdz0-.js → ada9rZfE.js} +1 -1
- package/web/app/immutable/chunks/{BzllE3aT.js → d8NijX_Z.js} +2 -2
- package/web/app/immutable/chunks/{BLZhAOLT.js → deEweluJ.js} +1 -1
- package/web/app/immutable/chunks/{Do6vtrQf.js → dmZv6JOg.js} +1 -1
- package/web/app/immutable/chunks/{D2LsUZli.js → e9nNeD_8.js} +1 -1
- package/web/app/immutable/chunks/{BJHkJxQ6.js → fHygQTSC.js} +1 -1
- package/web/app/immutable/chunks/{CbqBbwIN.js → gU2qspu9.js} +1 -1
- package/web/app/immutable/chunks/{-J-Hmuck.js → h8JtxU_T.js} +1 -1
- package/web/app/immutable/chunks/{MsC14vMO.js → hNQ1u1TD.js} +1 -1
- package/web/app/immutable/chunks/{Df-2xtN9.js → hYcAQyax.js} +1 -1
- package/web/app/immutable/chunks/{jiLgt56M.js → i0UHQwRY.js} +1 -1
- package/web/app/immutable/chunks/{HQDMr2H7.js → iCWz6IE9.js} +1 -1
- package/web/app/immutable/chunks/{CbaFGz2w.js → jBG7W4tL.js} +1 -1
- package/web/app/immutable/chunks/{oRcurxpq.js → lTwh0Wzj.js} +1 -1
- package/web/app/immutable/chunks/{DyHx5QFY.js → nwO3KCpP.js} +1 -1
- package/web/app/immutable/chunks/{05jEdw2V.js → pMP23LzB.js} +1 -1
- package/web/app/immutable/chunks/{BJTYazIn.js → pomj9evG.js} +1 -1
- package/web/app/immutable/chunks/{WWSsQ21S.js → rEslErv9.js} +1 -1
- package/web/app/immutable/chunks/{x_GKKTQV.js → rXKOJqUt.js} +1 -1
- package/web/app/immutable/chunks/{McOgUz0K.js → sOF-qTei.js} +1 -1
- package/web/app/immutable/chunks/{BXyd6A9p.js → sSXTMg2P.js} +1 -1
- package/web/app/immutable/chunks/{B0fUscDD.js → tLFaYuVN.js} +1 -1
- package/web/app/immutable/chunks/{BEiVNbJd.js → tuKjkgzS.js} +1 -1
- package/web/app/immutable/chunks/{Ipu7_2rx.js → v3_7O0A0.js} +1 -1
- package/web/app/immutable/chunks/{DZnKNdAN.js → vdylZNCS.js} +1 -1
- package/web/app/immutable/chunks/{ChdMCKvy.js → vyUklWDK.js} +1 -1
- package/web/app/immutable/chunks/{DU4sJYad.js → wiGlLVr-.js} +1 -1
- package/web/app/immutable/chunks/{CCPr9hs_.js → yDmmPu6L.js} +1 -1
- package/web/app/immutable/chunks/{Dv-bjgEk.js → zB9UbdEg.js} +1 -1
- package/web/app/immutable/entry/{app.CHgb5yMQ.js → app.DEnhhDc1.js} +3 -3
- package/web/app/immutable/entry/start.Cmawmwgw.js +1 -0
- package/web/app/immutable/nodes/{0.DECevrtM.js → 0.DLkagS9u.js} +1 -1
- package/web/app/immutable/nodes/{1.LZZdSQoJ.js → 1.ChB9puqR.js} +1 -1
- package/web/app/immutable/nodes/10.B3YEuSxS.js +39 -0
- package/web/app/immutable/nodes/{11.D5CTYtT6.js → 11.rgOqEz2U.js} +1 -1
- package/web/app/immutable/nodes/{12.iQywXLwT.js → 12.D6rxlIQy.js} +1 -1
- package/web/app/immutable/nodes/{13.m6xe0bMv.js → 13.CHYsmiD_.js} +1 -1
- package/web/app/immutable/nodes/{14.CyaNpqAL.js → 14.mG-YN9pn.js} +3 -3
- package/web/app/immutable/nodes/{15.5st_fzCN.js → 15.CgSxPoXZ.js} +1 -1
- package/web/app/immutable/nodes/{16.MUmBS-bv.js → 16.BsFtzH0D.js} +1 -1
- package/web/app/immutable/nodes/{17.C_k1qpf6.js → 17.me_aOx8O.js} +1 -1
- package/web/app/immutable/nodes/{18.BjTfofOz.js → 18.BO1oZWgm.js} +1 -1
- package/web/app/immutable/nodes/{19.wB7XsK3B.js → 19.DS0Anfm0.js} +2 -2
- package/web/app/immutable/nodes/{2.C7whbYui.js → 2.BB55cMHs.js} +4 -4
- package/web/app/immutable/nodes/{20.DuDV-BZU.js → 20.LbRPieV_.js} +1 -1
- package/web/app/immutable/nodes/{3.KbBbpAm6.js → 3.B1suR6zI.js} +1 -1
- package/web/app/immutable/nodes/{4.C1b_QyI0.js → 4.BdkLcCps.js} +1 -1
- package/web/app/immutable/nodes/{5.CG-B5vOM.js → 5.DlFTrLdG.js} +1 -1
- package/web/app/immutable/nodes/{6.v-GnNHdu.js → 6.EdJoOCRv.js} +1 -1
- package/web/app/immutable/nodes/{7.D9LU-AZb.js → 7.iPBOmxFo.js} +1 -1
- package/web/app/immutable/nodes/{8.BJP_1POW.js → 8.BRpg5Nn-.js} +1 -1
- package/web/app/immutable/nodes/{9.f8mHa7_b.js → 9.CeyWcdBf.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/generated/paraglide.js +49 -49
- package/web/index.html +18 -18
- package/web/app/immutable/chunks/B8evz7o6.js +0 -2
- package/web/app/immutable/chunks/C0P2MUJp.js +0 -1
- package/web/app/immutable/chunks/D8elUKsb.js +0 -158
- package/web/app/immutable/chunks/DY52XPja.js +0 -2
- package/web/app/immutable/chunks/KU76P7cR.js +0 -1
- package/web/app/immutable/chunks/akx8_VtJ.js +0 -1
- package/web/app/immutable/chunks/hY0rMePc.js +0 -1
- package/web/app/immutable/entry/start.CINDVXKj.js +0 -1
- package/web/app/immutable/nodes/10.KUh1filM.js +0 -39
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CLo9TzNK.js","/app/immutable/chunks/Dws-34a7.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/4g_iHoQm.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/8jMQM9h0.js","/app/immutable/chunks/D-rRuAXZ.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/BupDQr_B.js","/app/immutable/chunks/SbTG0nwQ.js","/app/immutable/chunks/CGYPBD6G.js","/app/immutable/chunks/B5tvpTFB.js","/app/immutable/chunks/DLCFUd4s.js","/app/immutable/chunks/BD9db4FR.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C-zB-6G6.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BPuz5cN_.js","/app/immutable/chunks/7KxcPj98.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Dval4sTX.js","/app/immutable/chunks/B8HnjSSF.js","/app/immutable/chunks/B-E_4dSm.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/B_4WsP9b.js","/app/immutable/chunks/DtqPBHQj.js","/app/immutable/chunks/tLFaYuVN.js","/app/immutable/chunks/B6eTPmJH.js","/app/immutable/chunks/PhAbES0t.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/H2jLkRRS.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/rXKOJqUt.js","/app/immutable/chunks/BIGqOuh0.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/5-0LQoqd.js","/app/immutable/chunks/DcOkWaeN.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/Bc1vJq_Z.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BmF8Qq3w.js","/app/immutable/chunks/94vL4WlW.js","/app/immutable/chunks/Dvi4g0xk.js","/app/immutable/chunks/jBG7W4tL.js","/app/immutable/chunks/D_VvdZe2.js","/app/immutable/chunks/C63WwVct.js","/app/immutable/chunks/C2F2Vd1P.js","/app/immutable/chunks/CrsbEWnE.js","/app/immutable/chunks/DWa-2rkZ.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/gU2qspu9.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BW1iql_y.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/DSiGyv9Y.js","/app/immutable/chunks/C_SKcJv7.js","/app/immutable/chunks/BNa9zzEx.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as Da,bo as i,bw as Ra,bp as Rr,b as Wa,br as Un,bs as Y,bq as dn,bm as d,_ as co}from"./Dws-34a7.js";import{bs as Aa,a5 as le,aD as e,bA as X,W as f,bn as Ma,aA as s,c9 as c,aB as D,ay as k,bl as Vt,bS as b,b_ as me,bO as dt,ca as mt,a7 as je,cd as Cn,be as Ga,b$ as sn,ai as Wr,bV as Z,br as Sa,bj as Ar,aw as Qe,a as fo,aj as Ia,bH as o,bf as Ca,c0 as Tn,am as ir,ax as sr,aC as Mr,aG as go,c5 as xn,cb as Er,bk as po}from"./3SdAC2_C.js";import{i as I}from"./DLCFUd4s.js";import{f as ga,ae as $n}from"./BIGqOuh0.js";import{w as Ta,F as ho}from"./BPuz5cN_.js";import{b as vo,e as fa,f as Kt,s as Fe,c as Oa,g as Sn}from"./BD9db4FR.js";import{C as mo,F as za,aV as dr,d3 as bo,bg as Kn,au as _o,a_ as yo,aZ as gn,bo as wo,a8 as Ln,bb as ur,d1 as To,aY as Po,a0 as xo,a2 as ko,cI as Io,c6 as Co,cn as cr,cK as fr,bv as gr}from"./CGYPBD6G.js";import{g as Va,e as hn}from"./C-zB-6G6.js";import{t as ra}from"./D-rRuAXZ.js";import{b as zn}from"./Dn334wJv.js";import{B as pr,a as So}from"./CXDUvPYf.js";import{k as On}from"./5-0LQoqd.js";import{c as ke}from"./B5tvpTFB.js";import{o as hr,t as Fn}from"./DAsc1V4f.js";import{I as vr}from"./C63WwVct.js";import"./C2F2Vd1P.js";import{K as zo,f as pn,G as ja,e as mr,h as qa,l as Do,d as Ro,M as Wo}from"./jBG7W4tL.js";import{i as rn}from"./CL3a4Hm1.js";import{w as br}from"./Bqd7fdCF.js";import{m as ve}from"./rXKOJqUt.js";import{c as Ao}from"./ChTqQfQN.js";import"./DcOkWaeN.js";import{Jx as Ce,rU as Mo,s3 as _r,Jm as yr,mO as Zn,K8 as Eo,tk as Bo,JC as $o,v0 as Lo,vp as Oo,Kz as Fo,v7 as Ho,tH as No,HP as Hn,H4 as Uo,Gy as Ko,Bx as wr}from"./4g_iHoQm.js";import{D as Zo}from"./Dvi4g0xk.js";import{o as jo,S as qo}from"./CIWky03S.js";import{selectIsDragging as Br}from"./DtqPBHQj.js";import{o as Tr}from"./DxC0zTSc.js";import{Y as Pr,ah as Go,w as Xo}from"./BHEogMS0.js";import{b as Vo}from"./D4WPlvMg.js";import{i as Yo}from"./DKwAaLwd.js";import{A as Jo,b as Qo}from"./VeUh5OMZ.js";import{bZ as el,v as tl,bL as al,bR as nl,cj as rl,ch as ol,ce as xr,cf as kr}from"./CA8JHp72.js";import{aO as ll,aJ as il,cB as sl,a_ as $r,dH as dl}from"./SbTG0nwQ.js";import{l as ul}from"./CNSshwg_.js";import{B as cl}from"./U7dpdlAf.js";import{l as fl}from"./B8HnjSSF.js";import{u as gl}from"./Dval4sTX.js";import{t as Ir}from"./CHto7_WH.js";import{t as on}from"./H2jLkRRS.js";import{bK as pl}from"./BupDQr_B.js";import{e as zt}from"./B2CniqS1.js";import{R as kn,g as jn}from"./CJB-ebPL.js";import{M as Nn}from"./Bv_xG3nA.js";import{i as hl,M as vl,P as Cr,g as ml,u as bl,b as _l,a as yl}from"./CAfPEsZt.js";import{E as wl}from"./DSiGyv9Y.js";import"./C_SKcJv7.js";import{A as Tl,j as Pl}from"./B6eTPmJH.js";import{f as xl}from"./pMP23LzB.js";import{c as kl}from"./DWGXN6Nr.js";import{a as Il,c as Cl}from"./DqAYkzSz.js";import{s as Sl}from"./DgAgTFcK.js";import{k as Sr,n as zl,h as Dl}from"./Bc1vJq_Z.js";var Rl=new Set(["$$slots","$$events","$$legacy","expanded","class"]),Wl=D("<span><!></span>");function Lr(m,r){if(new.target)return Da({component:Lr,...m});Aa(r,!0);let B=i(r,"expanded",7),x=i(r,"class",7),z=Rr(r,Rl);var y={get expanded(){return B()},set expanded(R){B(R),s()},get class(){return x()},set class(R){x(R),s()},$set:Ra,$on:(R,w)=>Wa(r,R,w)},C=Wl();vo(C,R=>({...z,"data-disclosure-icon":!0,"aria-hidden":"true",class:R}),[()=>fa("inline-flex size-3 shrink-0 items-center justify-center text-muted-foreground",x())]);var We=le(C);{let R=c(()=>B()?"":"-rotate-90");mo(We,{size:10,weight:"regular",mirrored:!1,style:"width: 0.625rem; height: 0.625rem;","aria-hidden":"true",focusable:"false","data-owns-stroke":!0,"data-disclosure-glyph":!0,get class(){return`transition-transform duration-spring-moderate ease-spring-moderate motion-reduce:transition-none ${e(R)??""}`}})}return X(C),f(m,C),Ma(y)}var Al=new Set(["$$slots","$$events","$$legacy","title","label","meta","expanded","onclick"]),Ml=D('<span class="min-w-4 shrink-0 text-center type-caption font-normal leading-none tabular-nums text-muted-foreground"> </span>'),El=D('<span class="min-w-0 flex-1 truncate text-left"> </span> <!> <!>',1);function Bl(m,r){if(new.target)return Da({component:Bl,...m});Aa(r,!0);let B=i(r,"title",7),x=i(r,"label",7),z=i(r,"meta",7),y=i(r,"expanded",7),C=i(r,"onclick",7),We=Rr(r,Al);var R={get title(){return B()},set title(w){B(w),s()},get label(){return x()},set label(w){x(w),s()},get meta(){return z()},set meta(w){z(w),s()},get expanded(){return y()},set expanded(w){y(w),s()},get onclick(){return C()},set onclick(w){C(w),s()},$set:Ra,$on:(w,ee)=>Wa(r,w,ee)};return ga(m,Un(()=>We,{variant:"ghost",size:"compact",class:"h-8 w-full justify-start gap-2 px-2 type-caption font-normal text-muted-foreground hover:text-foreground",get"aria-expanded"(){return y()},get"aria-label"(){return x()},get onclick(){return C()},"data-sidebar-group-header":!0,children:(w,ee)=>{var S=El(),F=k(S),be=Vt(F,!0),ge=b(F,2);{var qe=j=>{var W=Ml(),ie=Vt(W,!0);me(()=>dt(ie,z())),f(j,W)};I(ge,j=>{z()&&j(qe)})}var Be=b(ge,2);Lr(Be,{get expanded(){return y()}}),me(()=>dt(be,B())),f(w,S)},$$slots:{default:!0}})),Ma(R)}const qn="application/x-panel-tab",Or="data-pane-drag-image",ln=.2,Pn=.03,$l=40;function Rs(m,r,B=!0){if(!B||m.width<=0||r.length===0)return[];const x=r.map(ee=>({left:ee.left,right:ee.left+ee.width})),z=x[0],y=x.at(-1);if(!z||!y)return[];const C=[z.left,...x.slice(1).map((ee,S)=>(x[S].right+ee.left)/2),y.right].map(ee=>Math.max(m.left,Math.min(m.left+m.width,ee))),We=C.slice(1).reduce((ee,S,F)=>Math.min(ee,S-C[F]),1/0),R=Math.min($l,m.width,Number.isFinite(We)?Math.max(1,We/2):m.width),w=Math.max(0,m.width-R);return C.map((ee,S)=>({index:S,left:Math.max(0,Math.min(w,ee-m.left-R/2)),width:R}))}function Ll(m,r,B){const x=m-r.left;return B.find(z=>x>=z.left&&x<=z.left+z.width)??null}function Ol(m,r){if(m===0)return{kind:"edge",position:"before"};if(m===r.length)return{kind:"edge",position:"after"};const B=r[m];return B?{kind:"panel",targetPanelId:B,zone:"left"}:null}function Ws(m,r,B,x){const z=Ll(m,r,B);return z?Ol(z.index,x):null}function Fl(m,r,B=!0,x=null){if(!B)return"center";const z=Math.max(0,Math.min(1,r.width>0?(m-r.left)/r.width:.5));return x==="left"&&z<=ln+Pn?"left":x==="right"&&z>=1-ln-Pn?"right":x==="center"&&z>=ln-Pn&&z<=1-ln+Pn?"center":z<ln?"left":z>1-ln?"right":"center"}let Vn=null;function Hl(m){Vn=m}function Fr(){Vn=null,!(typeof document>"u")&&document.querySelectorAll(`[${Or}]`).forEach(m=>{m.remove()})}function Xa(){return Vn}function Nl(m){const r=document.createElement("div");return r.setAttribute(Or,""),r.textContent=m,Object.assign(r.style,{position:"fixed",left:"-10000px",top:"-10000px",width:"220px",height:"32px",padding:"0 12px",display:"flex",alignItems:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--card)",color:"var(--card-foreground)",boxShadow:"var(--elevation-raised)",font:"500 12px/1 system-ui, sans-serif",pointerEvents:"none"}),document.body.append(r),r}function In(m,r){if(new.target)return Da({component:In,...m});Aa(r,!0);const B=()=>Y(w,"$session$",C),x=()=>Y(F,"$hasCapturedQuestion$",C),z=()=>Y(S,"$permissionCount$",C),y=()=>Y(ee,"$provider$",C),[C,We]=dn();let R=i(r,"agentId",7);const w=ll(R()),ee=il(R()),S=el(R()),F=ul(R()),be=c(()=>B()?.metadata?.specialist??B()?.agentMetadata?.specialist??null),ge=c(()=>x()||tl(Ce.state,R(),B()?.messages??[])),qe=c(()=>Qo(B(),{isActive:!0,hasPermissionRequest:z()>0,hasQuestion:e(ge)}));var Be={get agentId(){return R()},set agentId(W){R(W),s()},$set:Ra,$on:(W,ie)=>Wa(r,W,ie)};Jo(m,{get agentId(){return R()},variant:"emphasized",get state(){return e(qe)},get specialist(){return e(be)},get provider(){return y()}});var j=Ma(Be);return We(),j}function Gn(m,r){if(new.target)return Da({component:Gn,...m});Aa(r,!0);const B=()=>Y(S,"$multiplayer$",z),x=()=>Y(ee,"$unread$",z),[z,y]=dn();let C=i(r,"workspaceId",7),We=i(r,"conversationId",7);const R=Cn(""),w=Cn("default");mt(()=>R.set(C())),mt(()=>w.set(We()));const ee=al(R,w),S=gl();var F={get workspaceId(){return C()},set workspaceId(j){C(j),s()},get conversationId(){return We()},set conversationId(j){We(j),s()},$set:Ra,$on:(j,W)=>Wa(r,j,W)},be=je(),ge=k(be);{var qe=j=>{cl(j,{size:"compact",variant:"solid",color:"blue","data-discussion-unread-badge":!0,children:(W,ie)=>{Ga();var Le=sn();me(bt=>dt(Le,bt),[()=>d.workspace_discussion_jumpNew_label({count:fl(x().count)})]),f(W,Le)},$$slots:{default:!0}})};I(ge,j=>{B()&&x().count>0&&j(qe)})}f(m,be);var Be=Ma(F);return y(),Be}var Ul=D('<span data-resource-icon-tile="" aria-hidden="true"><span class="resource-icon-glyph svelte-slhtuz" data-resource-icon-glyph=""><!></span></span>');function Xn(m,r){if(new.target)return Da({component:Xn,...m});Aa(r,!0);let B=i(r,"kind",7),x=i(r,"variant",7,"standard"),z=i(r,"class",7,"");var y={get kind(){return B()},set kind(w){B(w),s()},get variant(){return x()},set variant(w="standard"){x(w),s()},get class(){return z()},set class(w=""){z(w),s()},$set:Ra,$on:(w,ee)=>Wa(r,w,ee)},C=Ul(),We=le(C),R=le(We);return za(R,{get icon(){return kn[B()]}}),X(We),X(C),me(()=>{Kt(C,1,`resource-icon-tile ${z()??""}`,"svelte-slhtuz"),Fe(C,"data-resource-kind",B()),Fe(C,"data-resource-icon-variant",x())}),f(m,C),Ma(y)}function Kl(m,r,B){if(m.type==="browser")return m.browserUrl?{kind:"browser",url:m.browserUrl}:{kind:"unavailable",reason:"missing-resource"};if(!B)return{kind:"unavailable",reason:"remote"};const x=m.workspaceId||r;if(!x)return{kind:"unavailable",reason:"missing-resource"};if(m.type==="file")return m.filePath?{kind:"path",filePath:m.filePath,workspaceId:x,isDirectory:!1}:{kind:"unavailable",reason:"missing-resource"};if(m.type==="diff"){const z=m.diffPath||m.filePath;return z?{kind:"path",filePath:z,workspaceId:x,isDirectory:!1,isDiff:!0}:{kind:"unavailable",reason:"missing-resource"}}return m.type==="note"||m.type==="agent"?{kind:"path",filePath:".",workspaceId:x,isDirectory:!0,isWorkspaceRoot:!0,workspaceFolderPath:"__WORKSPACE_ROOT__"}:{kind:"path",filePath:".",workspaceId:x,isDirectory:!0,isWorkspaceRoot:!0,workspaceFolderPath:"__WORKSPACE_ROOT__"}}var zr=D("<!> <!> <!>",1),wa=D("<!> <!>",1),Dr=D("<!> <!> <!> <!> <!>",1),Zl=Mr('<svg viewBox="0 0 16 16" fill="none" class="size-4!" aria-hidden="true"><g transform="rotate(-90 8 8)" stroke="currentColor" stroke-width="1.33"><path d="M3 8H12" stroke-linecap="square"></path><path d="M8.518 3 12.634 7.116C13.122 7.604 13.122 8.396 12.634 8.884L8.518 13" stroke-linejoin="round"></path></g></svg>'),jl=D('<!> <div class="panel-move-pad svelte-11borfu"></div>',1),ql=D('<!> <div data-panel-actions-section="open-in"><!></div>',1),Gl=Mr('<svg viewBox="0 0 16 16" fill="none" class="size-4!" aria-hidden="true"><path d="M3.5 3.5 6.5 6.5C7.328 7.328 7.328 8.672 6.5 9.5L3.5 12.5M12.5 12.5 9.5 9.5C8.672 8.672 8.672 7.328 9.5 6.5L12.5 3.5" stroke="currentColor" stroke-width="1.33"></path></svg>'),Xl=D('<span class="panel-header-leading-surface flex shrink-0 items-center justify-center svelte-11borfu" data-panel-header-leading-surface=""><!></span>'),Vl=D('<!> <span class="panel-selector-title min-w-0 flex-1 truncate text-left" data-panel-header-title=""> </span>',1),Yl=D('<span class="absolute right-0.5 top-0.5 size-1.5 rounded-full bg-primary" aria-hidden="true"></span>'),Jl=D('<!> <svg viewBox="0 0 8 14" fill="none" class="h-3.5! w-2! shrink-0 text-muted-foreground" aria-hidden="true"><path d="M6.532 4 4.332 1.067C3.932.533 3.132.533 2.732 1.067L.532 4M.532 10 2.732 12.933C3.132 13.467 3.932 13.467 4.332 12.933L6.532 10" stroke="currentColor" stroke-width="1.33" stroke-linejoin="round"></path></svg> <!>',1),Ql=D('<span class="panel-selector-row-avatar flex shrink-0 items-center justify-center svelte-11borfu"><!></span>'),ei=D('<span class="size-1.5 shrink-0 rounded-full bg-primary" aria-hidden="true"></span>'),ti=D('<span class="flex size-(--menu-icon-size) shrink-0 items-center justify-center" aria-hidden="true" data-pane-stack-current-check=""><!></span>'),ai=D('<span class="min-w-0 flex-1 truncate"> </span> <!> <!> <!>',1),ni=D('<div class="overflow-y-auto overscroll-contain" data-pane-stack-list=""></div>'),ri=D('<div class="panel-selector-button absolute inset-0 flex min-w-0 items-center bg-sidebar dark:bg-muted" data-panel-title-editor=""><!> <!> <span class="w-2 shrink-0" aria-hidden="true"></span></div>'),oi=D('<span data-panel-header-identity=""><!> <!></span>'),li=D('<div class="absolute left-0 top-1 bottom-1 w-0.5 bg-primary rounded-full z-10"></div>'),ii=D('<span class="tab-title font-medium truncate max-w-24"> </span>'),si=D('<span class="text-ui font-medium text-muted-foreground bg-muted px-1 py-0.5 rounded"> </span>'),di=D('<span class="unsaved-dot w-1.5 h-1.5 rounded-full bg-primary"></span>'),ui=D('<div class="absolute right-0 top-1 bottom-1 w-0.5 bg-primary rounded-full z-10"></div>'),ci=D('<div role="tab" tabindex="0"><!> <div><!> <!> <!> <!> <!> <!></div> <!></div>'),fi=D('<div class="flex items-center h-full px-1"><div class="w-0.5 h-5 bg-primary rounded-full"></div></div>'),gi=D('<span class="panel-header-leading-surface pointer-events-none flex shrink-0 items-center justify-center svelte-11borfu"><!></span>'),pi=D('<div draggable="true" data-panel-tabless-header="" data-panel-content-header="" role="group" data-pane-stack=""><!> <div class="min-w-0 flex-1" aria-hidden="true"></div> <!> <div class="flex shrink-0 items-center gap-0.5" data-panel-header-actions=""><!> <!></div></div>'),hi=D('<div data-panel-tabless-header="" data-empty-panel-header=""><div class="min-w-0 flex-1" aria-hidden="true"></div> <div class="flex shrink-0 items-center gap-0.5" data-panel-header-actions=""><!> <!></div></div>'),vi=D('<div class="panel-tab-wrapper flex flex-col svelte-11borfu"><div data-panel-tab-bar=""><div class="absolute inset-x-0 bottom-0 z-0"></div> <div class="relative flex-1 flex items-center z-10 min-w-0 overflow-x-auto scrollbar-none"><!> <!></div> <div class="shrink-0 h-full flex items-center"><div class="panel-actions flex items-center gap-0.5 px-1 z-20" data-panel-header-actions=""><!> <!></div></div></div> <!></div> <!>',1);function Hr(m,r){if(new.target)return Da({component:Hr,...m});Aa(r,!0);const B=()=>Y(wt,"$copyBrowserUrlShortcut$",be),x=()=>Y(Tt,"$closePaneShortcut$",be),z=()=>Y(pa,"$createColumnRightShortcut$",be),y=()=>Y(oa,"$movePaneLeftShortcut$",be),C=()=>Y(la,"$movePaneRightShortcut$",be),We=()=>Y(Jt,"$pagesMode$",be),R=()=>Y(A,"$workspaceAgents$",be),w=()=>Y(T,"$isWorkspaceHostLocal$",be),ee=()=>Y(Yt,"$tabWindowShortcut$",be),S=()=>Y(Bt,"$zoomPanelShortcut$",be),F=()=>Y(Ft,"$isDragging",be),[be,ge]=dn(),qe=(t,n=Ca)=>{{const h=(ae,$)=>{let q=()=>($?.()).props;{let O=c(()=>d.ui_breadcrumb_more_label());ga(ae,Un(q,{variant:"ghost-light",size:"icon-sm",wrapContent:!1,get"aria-label"(){return e(O)},class:"panel-header-action-button","data-testid":"panel-actions-trigger",children:(xe,Ye)=>{zo(xe,{class:"size-4!"})},$$slots:{default:!0}}))}},N=(ae,$)=>{let q=()=>($?.()).close;const O=Te=>{var Ke=je(),Ze=k(Ke);{var ht=oe=>{var Me=je(),U=k(Me);{let se=c(()=>d.workspace_notes_rename_label());ke(U,()=>Nn,(fe,$e)=>{$e(fe,{get icon(){return Co},iconWeight:"regular",get label(){return e(se)},onclick:async()=>{const E=e(P);q()(),await Tn(),await Jn(E)}})})}f(oe,Me)},Je=c(()=>e(P)&&An(e(P))&&Ve());I(Ze,oe=>{e(Je)&&oe(ht)})}f(Te,Ke)};var xe=Dr(),Ye=k(xe);{var ne=Te=>{var Ke=zr(),Ze=k(Ke);ke(Ze,()=>ja,(U,se)=>{se(U,{"data-panel-actions-section":"conversation",children:(fe,$e)=>{var E=zr(),J=k(E);ke(J,()=>pn,(Q,K)=>{K(Q,{alignIconColumn:!1,children:(he,vt)=>{Ga();var Ct=sn();me(Ee=>dt(Ct,Ee),[()=>d.dock_conversation_transcript_label()]),f(he,Ct)},$$slots:{default:!0}})});var u=b(J,2);O(u);var v=b(u,2);ra(v,()=>p().conversation,()=>e(jt)[n()]),f(fe,E)},$$slots:{default:!0}})});var ht=b(Ze,2);{var Je=U=>{var se=wa(),fe=k(se);ke(fe,()=>qa,(E,J)=>{J(E,{})});var $e=b(fe,2);ke($e,()=>ja,(E,J)=>{J(E,{"data-panel-actions-section":"settings",children:(u,v)=>{var Q=wa(),K=k(Q);ke(K,()=>pn,(vt,Ct)=>{Ct(vt,{alignIconColumn:!1,children:(Ee,St)=>{Ga();var Xt=sn();me(Za=>dt(Xt,Za),[()=>d.settings_page_title()]),f(Ee,Xt)},$$slots:{default:!0}})});var he=b(K,2);ra(he,()=>p().display),f(u,Q)},$$slots:{default:!0}})}),f(U,se)};I(ht,U=>{p().display&&U(Je)})}var oe=b(ht,2);{var Me=U=>{var se=wa(),fe=k(se);ke(fe,()=>qa,(E,J)=>{J(E,{})});var $e=b(fe,2);ke($e,()=>ja,(E,J)=>{J(E,{"data-panel-actions-section":"agent",children:(u,v)=>{var Q=wa(),K=k(Q);ke(K,()=>pn,(vt,Ct)=>{Ct(vt,{alignIconColumn:!1,children:(Ee,St)=>{Ga();var Xt=sn();me(Za=>dt(Xt,Za),[()=>d.layout_tabTypes_agent_title()]),f(Ee,Xt)},$$slots:{default:!0}})});var he=b(K,2);ra(he,()=>p().lifecycle),f(u,Q)},$$slots:{default:!0}})}),f(U,se)};I(oe,U=>{p().lifecycle&&U(Me)})}f(Te,Ke)},G=Te=>{var Ke=wa(),Ze=k(Ke);{var ht=U=>{var se=wa(),fe=k(se);ke(fe,()=>ja,(E,J)=>{J(E,{"data-panel-actions-section":"display",children:(u,v)=>{var Q=je(),K=k(Q);ra(K,()=>p().display),f(u,Q)},$$slots:{default:!0}})});var $e=b(fe,2);ke($e,()=>qa,(E,J)=>{J(E,{})}),f(U,se)};I(Ze,U=>{p()?.display&&U(ht)})}var Je=b(Ze,2);{var oe=U=>{var se=wa(),fe=k(se);ke(fe,()=>ja,(u,v)=>{v(u,{"data-panel-actions-section":"actions",children:(Q,K)=>{var he=Dr(),vt=k(he);ke(vt,()=>pn,(Za,En)=>{En(Za,{alignIconColumn:!1,children:(Bn,Wi)=>{Ga();var lr=sn();me(uo=>dt(lr,uo),[()=>d.layout_panelTabBar_actionsSection_label()]),f(Bn,lr)},$$slots:{default:!0}})});var Ct=b(vt,2);O(Ct);var Ee=b(Ct,2);ra(Ee,()=>p()?.primary??Ca);var St=b(Ee,2);ra(St,()=>p()?.actions??Ca);var Xt=b(St,2);ra(Xt,()=>p()?.destructive??Ca),f(Q,he)},$$slots:{default:!0}})});var $e=b(fe,2);{var E=u=>{var v=je(),Q=k(v);ke(Q,()=>qa,(K,he)=>{he(K,{})}),f(u,v)},J=c(()=>e(Wt).some(u=>u.enabled));I($e,u=>{e(J)&&u(E)})}f(U,se)},Me=c(()=>e(P)&&An(e(P))&&Ve()||p()?.primary||p()?.actions||p()?.destructive);I(Je,U=>{e(Me)&&U(oe)})}f(Te,Ke)};I(Ye,Te=>{p()?.conversation?Te(ne):Te(G,-1)})}var Nt=b(Ye,2);{var Ut=Te=>{var Ke=wa(),Ze=k(Ke);{var ht=oe=>{var Me=je(),U=k(Me);ke(U,()=>qa,(se,fe)=>{fe(se,{})}),f(oe,Me)};I(Ze,oe=>{p()?.conversation&&oe(ht)})}var Je=b(Ze,2);ke(Je,()=>ja,(oe,Me)=>{Me(oe,{"data-panel-actions-section":"move",children:(U,se)=>{var fe=jl(),$e=k(fe);ke($e,()=>pn,(J,u)=>{u(J,{alignIconColumn:!1,children:(v,Q)=>{Ga();var K=sn();me(he=>dt(K,he),[()=>d.layout_panelTabBar_movePanel_label()]),f(v,K)},$$slots:{default:!0}})});var E=b($e,2);Va(E,21,()=>e(Wt),J=>J.direction,(J,u)=>{var v=je(),Q=k(v);{let K=c(()=>!e(u).enabled);ke(Q,()=>mr,(he,vt)=>{vt(he,{get class(){return`panel-move-direction panel-move-${e(u).direction??""}`},get"aria-label"(){return e(u).label},get disabled(){return e(K)},onSelect:()=>{Ea[n()]=e(u).move,q()()},children:(Ct,Ee)=>{var St=Zl();f(Ct,St)},$$slots:{default:!0}})})}f(J,v)}),X(E),f(U,fe)},$$slots:{default:!0}})}),f(Te,Ke)},It=c(()=>e(Wt).some(Te=>Te.enabled));I(Nt,Te=>{e(It)&&Te(Ut)})}var ua=b(Nt,2);{var Ka=Te=>{var Ke=je(),Ze=k(Ke);{var ht=Je=>{const oe=c(()=>Kl(e(P),te(),w()));var Me=ql(),U=k(Me);ke(U,()=>qa,(u,v)=>{v(u,{})});var se=b(U,2),fe=le(se);{var $e=u=>{var v=je(),Q=k(v);{let K=c(()=>d.layout_panelTabBar_openInBrowser_label());ke(Q,()=>Nn,(he,vt)=>{vt(he,{get icon(){return Ln},get label(){return e(K)},iconWeight:"regular",onclick:()=>{_n(e(P)),q()()}})})}f(u,v)},E=u=>{var v=je(),Q=k(v);So(Q,()=>co(()=>import("./CLo9TzNK.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67]),import.meta.url),null,(K,he)=>{const vt=c(()=>e(he).default);var Ct=je(),Ee=k(Ct);{let St=c(()=>e(oe).isDiff??!1),Xt=c(()=>e(oe).isWorkspaceRoot??!1),Za=c(()=>e(oe).workspaceFolderPath??"");ke(Ee,()=>e(vt),(En,Bn)=>{Bn(En,{get filePath(){return e(oe).filePath},get workspaceId(){return e(oe).workspaceId},get isDirectory(){return e(oe).isDirectory},get isDiff(){return e(St)},get isWorkspaceRoot(){return e(Xt)},get workspaceFolderPath(){return e(Za)},showDeleteOption:!1,showArchiveOption:!1,showPathCopy:!1,showFileNameCopy:!1,layout:"submenu",iconWeight:"regular",get onClose(){return q()}})})}f(K,Ct)}),f(u,v)},J=u=>{var v=je(),Q=k(v);{let K=c(()=>d.ui_fileActions_noRepoPath_tooltip());ke(Q,()=>Nn,(he,vt)=>{vt(he,{get icon(){return Ln},get label(){return e(K)},iconWeight:"regular",disabled:!0})})}f(u,v)};I(fe,u=>{e(oe).kind==="browser"?u($e):e(oe).kind==="path"?u(E,1):u(J,-1)})}X(se),f(Je,Me)};I(Ze,Je=>{e(P)&&Je(ht)})}f(Te,Ke)},_a=c(()=>w()&&yt&&e(P)?.type!=="browser"||e(P)&&!sa&&V(e(P)));I(ua,Te=>{e(_a)&&Te(Ka)})}var ca=b(ua,2);{var Re=Te=>{var Ke=wa(),Ze=k(Ke);ke(Ze,()=>qa,(Je,oe)=>{oe(Je,{})});var ht=b(Ze,2);ke(ht,()=>ja,(Je,oe)=>{oe(Je,{"data-panel-actions-section":"additional",children:(Me,U)=>{var se=je(),fe=k(se);ra(fe,()=>p().additional,()=>e(jt)[n()]),f(Me,se)},$$slots:{default:!0}})}),f(Te,Ke)};I(ca,Te=>{p()?.additional&&Te(Re)})}var ya=b(ca,2);ra(ya,()=>p()?.footer??Ca),f(ae,xe)};let we=c(()=>fa("panel-header-menu panel-actions-menu-content",p()?.conversation&&"panel-conversation-menu"));Zo(t,{onOpenChangeComplete:async ae=>{if(ae)return;const $=Ea[n()];Ea[n()]=null,$&&(await Tn(),$())},align:"end",side:"bottom",get contentClass(){return e(we)},subContentClass:"panel-header-menu panel-header-submenu",get open(){return e(jt)[n()]},set open(ae){e(jt)[n()]=ae},trigger:h,content:N,$$slots:{trigger:!0,content:!0}})}},Be=(t,n)=>{let h=ir(()=>sr(n?.(),null));var N=je(),we=k(N);{var ae=$=>{const q=c(()=>e(h)?.type==="browser"&&e(h).ownerAgentId),O=c(()=>e(h)?e(q)?d.layout_panelTabBar_hideOwnedTab_ariaLabel():d.layout_panelTabBar_closePane_ariaLabel():d.layout_panelTabBar_closePanel_label()),xe=c(()=>e(h)&&!e(q)?d.layout_panelTabBar_actionWithShortcut_tooltip({label:e(O),shortcut:e(Zt)}):e(O));$n($,{get content(){return e(xe)},side:"bottom",delayDuration:300,children:(Ye,ne)=>{{let G=c(()=>e(h)?.id);ga(Ye,{variant:"ghost-light",size:"icon-sm",wrapContent:!1,onclick:()=>e(h)?ut()?.(e(h).id):ct()?.(),get"aria-label"(){return e(O)},class:"panel-header-action-button","data-testid":"panel-close-button",get"data-pane-close"(){return e(G)},children:(Nt,Ut)=>{var It=Gl();f(Nt,It)},$$slots:{default:!0}})}},$$slots:{default:!0}})};I(we,$=>{(e(h)&&ut()||!e(h)&&ct())&&$(ae)})}f(t,N)},j=(t,n=Ca,h)=>{let N=ir(()=>sr(h?.(),!1));const we=c(()=>jn(n().type));var ae=je(),$=k(ae);{var q=ne=>{{let G=c(()=>e(N)?14:16);za(ne,{get icon(){return dr},get size(){return e(G)},class:"shrink-0 text-muted-foreground","data-panel-agent-chat-glyph":!0})}},O=ne=>{{let G=c(()=>e(N)?"standard":"emphasized");Xn(ne,{get kind(){return e(we)},get variant(){return e(G)}})}},xe=ne=>{{let G=c(()=>e(N)?14:16);pr(ne,{get faviconUrl(){return n().faviconUrl},get size(){return e(G)}})}},Ye=ne=>{{let G=c(()=>Yn(n().type)),Nt=c(()=>e(N)?14:16);za(ne,{get icon(){return e(G)},get size(){return e(Nt)},class:"shrink-0 text-muted-foreground"})}};I($,ne=>{n().type==="agent"?ne(q):e(we)?ne(O,1):n().type==="browser"?ne(xe,2):ne(Ye,-1)})}f(t,ae)},W=(t,n=Ca)=>{var h=Xl(),N=le(h);{var we=$=>{var q=je(),O=k(q);On(O,()=>n().agentId,xe=>{In(xe,{get agentId(){return n().agentId}})}),f($,q)},ae=$=>{j($,n)};I(N,$=>{n().type==="agent"&&n().agentId?$(we):$(ae,-1)})}X(h),f(t,h)},ie=t=>{var n=oi();let h;var N=le(n);ke(N,()=>Wo,($,q)=>{q($,{get open(){return e(pt)},set open(O){o(pt,O,!0)},children:(O,xe)=>{var Ye=wa(),ne=k(Ye);{const Nt=(Ut,It)=>{let ua=()=>(It?.()).props;const Ka=c(()=>e(P)?d.layout_panelTabBar_paneSelectorNamed_ariaLabel({title:L(e(P)),count:re().length}):d.layout_panelTabBar_paneSelector_ariaLabel({count:re().length})),_a=c(()=>e(P)?Gt(e(P)):null),ca=c(()=>e(P)?.type==="diff"?e(P).data?.change?.commitHash:void 0);{let Re=c(()=>[e(P)?L(e(P)):e(Ka),e(_a),e(ca)].filter(Boolean).join(" · ")),ya=c(()=>e(pt)||!!e(P)&&!e(_a)&&!e(ca)&&!e(Le));$n(Ut,{class:"block w-full min-w-0",get content(){return e(Re)},side:"bottom",delayDuration:300,get disabled(){return e(ya)},children:(Te,Ke)=>{{let Ze=c(()=>e(Ba)>0||e(P)&&e(aa).has(e(P).id)?"":void 0);ga(Te,Un(ua,{variant:"plain",size:"lg",class:"panel-selector-button w-full min-w-0 max-w-full justify-start bg-sidebar dark:bg-muted",wrapContent:!1,get"aria-label"(){return e(Ka)},"data-testid":"pane-stack-selector-trigger","data-pane-stack-selector-trigger":!0,get"data-attention"(){return e(Ze)},children:(ht,Je)=>{var oe=Jl(),Me=k(oe);{var U=E=>{var J=Vl(),u=k(J);W(u,()=>e(P));var v=b(u,2),Q=Vt(v,!0);hn(v,(K,he)=>hr?.(K,he),()=>K=>o(Le,K,!0)),me(K=>dt(Q,K),[()=>L(e(P))]),f(E,J)};I(Me,E=>{e(P)&&E(U)})}var se=b(Me,4);{var fe=E=>{var J=Yl();f(E,J)},$e=c(()=>e(Ba)>0||e(P)&&e(aa).has(e(P).id));I(se,E=>{e($e)&&E(fe)})}f(ht,oe)},$$slots:{default:!0}}))}},$$slots:{default:!0}})}};ke(ne,()=>Do,(Ut,It)=>{It(Ut,{child:Nt,$$slots:{child:!0}})})}var G=b(ne,2);{let Nt=c(()=>d.layout_panelTabBar_paneMenu_ariaLabel());ke(G,()=>Ro,(Ut,It)=>{It(Ut,{align:"start",side:"bottom",collisionPadding:8,class:"panel-header-menu panel-selector-menu bg-background",maxHeight:"var(--bits-dropdown-menu-content-available-height, calc(100dvh - 1rem))",get"aria-label"(){return e(Nt)},"data-pane-stack-menu":!0,children:(ua,Ka)=>{var _a=ni();Va(_a,21,()=>re().toReversed(),ca=>ca.id,(ca,Re)=>{const ya=c(()=>e(Re).id===Ge());var Te=je(),Ke=k(Te);{const Ze=Me=>{var U=Ql(),se=le(U);{var fe=E=>{var J=je(),u=k(J);On(u,()=>e(Re).agentId,v=>{In(v,{get agentId(){return e(Re).agentId}})}),f(E,J)},$e=E=>{j(E,()=>e(Re),()=>!0)};I(se,E=>{e(Re).type==="agent"&&e(Re).agentId?E(fe):E($e,-1)})}X(U),me(()=>Fe(U,"data-pane-stack-item-identity",e(Re).type)),f(Me,U)};let ht=c(()=>e(ya)?"page":void 0),Je=c(()=>e(aa).has(e(Re).id)?d.layout_panelTabBar_paneMenuAttention_ariaLabel({title:L(e(Re))}):e(Re).type==="discussion"?void 0:L(e(Re))),oe=c(()=>e(aa).has(e(Re).id)?"":void 0);ke(Ke,()=>mr,(Me,U)=>{U(Me,{class:"panel-selector-row",get"aria-current"(){return e(ht)},get"aria-label"(){return e(Je)},onclick:()=>Pe(e(Re).id),get"data-pane-stack-item"(){return e(Re).id},get"data-attention"(){return e(oe)},leading:Ze,children:(se,fe)=>{var $e=ai(),E=k($e),J=Vt(E,!0),u=b(E,2);{var v=Ee=>{{let St=c(()=>e(Re).workspaceId??te()),Xt=c(()=>typeof e(Re).data?.conversationId=="string"?e(Re).data.conversationId:"default");Gn(Ee,{get workspaceId(){return e(St)},get conversationId(){return e(Xt)}})}};I(u,Ee=>{e(Re).type==="discussion"&&!e(ya)&&Ee(v)})}var Q=b(u,2);{var K=Ee=>{var St=ei();f(Ee,St)},he=c(()=>e(aa).has(e(Re).id));I(Q,Ee=>{e(he)&&Ee(K)})}var vt=b(Q,2);{var Ct=Ee=>{var St=ti(),Xt=le(St);za(Xt,{get icon(){return _o},class:"size-(--menu-icon-size) text-muted-foreground"}),X(St),f(Ee,St)};I(vt,Ee=>{e(ya)&&Ee(Ct)})}me(Ee=>dt(J,Ee),[()=>L(e(Re))]),f(se,$e)},$$slots:{leading:!0,default:!0}})})}f(ca,Te)}),X(_a),f(ua,_a)},$$slots:{default:!0}})})}f(O,Ye)},$$slots:{default:!0}})});var we=b(N,2);{var ae=$=>{var q=ri(),O=le(q);W(O,()=>e(P));var xe=b(O,2);{let Ye=c(()=>d.ui_editableName_rename_tooltip());vr(xe,{variant:"inline",noFocusStyle:!0,class:"panel-selector-title min-w-0 flex-1",get"aria-label"(){return e(Ye)},onblur:wn,onkeydown:async ne=>{if(ne.key!=="Enter"&&ne.key!=="Escape")return;ne.preventDefault(),ne.stopPropagation();const G=ne.currentTarget.closest("[data-panel-tabless-header]");ne.key==="Enter"?wn():Qn(),await Tn(),G?.querySelector("[data-pane-stack-selector-trigger]")?.focus()},get ref(){return e(da)},set ref(ne){o(da,ne,!0)},get value(){return e(_)},set value(ne){o(_,ne,!0)}})}Ga(2),X(q),f($,q)};I(we,$=>{e(P)&&e(qt)===e(P).id&&!Xe()&&$(ae)})}X(n),me(()=>h=Kt(n,1,"pane-stack-selector relative z-10 min-w-0 shrink self-center svelte-11borfu",null,h,{editing:!!e(P)&&e(qt)===e(P).id})),f(t,n)};let Le=Z(!1),bt=Z(Sa({}));const _t=typeof navigator<"u"&&navigator.platform?.startsWith("Win"),Et=typeof navigator<"u"&&(navigator.userAgentData?.platform==="macOS"||/Mac|iPhone|iPad|iPod/.test(navigator.userAgent)),et=_t?d.layout_panelTabBar_fileManagerExplorer_label():Et?d.layout_panelTabBar_fileManagerFinder_label():d.layout_panelTabBar_fileManagerGeneric_label(),Se=Ao("PanelTabBar"),yt=br("externalEditors"),de=br("systemFileManager"),wt=zt("panel.copy-browser-url"),Tt=zt("navigation.close-tab"),Bt=zt("panel.maximize"),Yt=zt("panel.tab-window"),Jt=Vo,pa=zt("panel.create-column-right"),oa=zt("panel.move-pane-previous-column"),la=zt("panel.move-pane-next-column"),ia=c(()=>Ta(B())),Zt=c(()=>Ta(x())),kt=c(()=>Ta(z())),Qt=c(()=>Ta(y())),He=c(()=>Ta(C())),tt='button, a, input, textarea, select, [role="button"], [role="tab"], [contenteditable="true"]';let re=i(r,"tabs",23,()=>[]),Ge=i(r,"activeTabId",7,null),Ne=i(r,"attentionTabIds",23,()=>[]),$t=i(r,"panelId",7),te=i(r,"workspaceId",7),ot=i(r,"layoutId",7),at=i(r,"isFocused",7,!1),Lt=i(r,"isRightmostPanel",7,!1),p=i(r,"contentActions",7,null),Xe=i(r,"showTabStrip",7,!1),ha=i(r,"onTabClick",7),ut=i(r,"onTabClose",7),ue=i(r,"onTabReorder",7),ea=i(r,"onTabMoveToPanel",7),Dt=i(r,"onPaneDragFinish",7),ta=i(r,"onMovePaneUp",7),Ae=i(r,"onMovePaneDown",7),Ie=i(r,"onMovePaneLeft",7),Pt=i(r,"onMovePaneRight",7),ze=i(r,"onCloseOtherTabs",7),Oe=i(r,"onCloseTabsToRight",7),Ue=i(r,"onCloseAllTabs",7),pe=i(r,"onCloseAllOthersEverywhere",7),ct=i(r,"onClosePanel",7),ft=i(r,"onZoomToggle",7),lt=i(r,"isZoomed",7,!1),Ve=i(r,"onTabRename",7),Ot=i(r,"onSplitHorizontal",7);const sa=Mo();function V(t){const n=Ce.state?.browserClients?.ownClientId??null;return t.type==="browser"&&t.hostClientId!==void 0&&t.hostClientId!==n}const De=c(()=>We()==="main"&&Go()&&!Yo(ot())),_e=$t(),Ft=Br();let gt=Z(null);const va=c(()=>re().find(t=>t.id===e(gt)?.tabId));let pt=Z(!1),jt=Z(Sa({tabBar:!1,compact:!1}));const Ea={tabBar:null,compact:null};mt(()=>{Ge(),e(jt).tabBar=!1,e(jt).compact=!1});let qt=Z(null),da=Z(null),_=Z("");const l=Cn(te());mt(()=>{l.set(te())});const T=sl(l),A=$r(l);function ye(t,n){t.ownerAgentId&&Ce.dispatch(Lo(te(),{agentId:t.ownerAgentId,sourcePanelId:_e,openInAdjacentPanel:ho({event:n})}))}function L(t){if(t.type==="note"&&t.noteId){if(_r(t.noteId))return d.chat_shared_spec_label();const n=Pr.select(Ce.state,t.workspaceId??te(),t.noteId);if(n)return n.title||d.layout_panelLayout_untitled_fallback()}if(t.type==="agent"&&t.agentId){const n=R().find(h=>h.id===t.agentId);if(n?.name)return n.name}return t.type==="browser"?t.title||d.layout_panelLayout_browser_fallback():t.title}function ce(t){if(t.type!=="agent"||!t.agentId)return!1;const n=R().find(h=>h.id===t.agentId);return!!(n?.isBackground||n?.metadata?.isBackground)}function Gt(t){const n=t.filePath??t.diffPath;if(!n)return null;const h=dl.select(Ce.state,te()),N=h?.worktreePath||h?.repositoryPath||"";if(N){const we=$o(n,N);if(we!==n)return we}return n}function Rt(t){ha()?.(t)}function xt(t){return t.type==="browser"&&!!t.ownerAgentId}const aa=c(()=>new Set(Ne())),Ba=c(()=>re().filter(t=>t.id!==Ge()&&e(aa).has(t.id)).length),Wt=c(()=>[{direction:"up",label:d.layout_panelTabBar_movePanelUp_label(),enabled:!!ta(),move:()=>ta()?.()},{direction:"right",label:d.layout_panelTabBar_movePanelRight_label(),enabled:!!Pt(),move:()=>Pt()?.()},{direction:"down",label:d.layout_panelTabBar_movePanelDown_label(),enabled:!!Ae(),move:()=>Ae()?.()},{direction:"left",label:d.layout_panelTabBar_movePanelLeft_label(),enabled:!!Ie(),move:()=>Ie()?.()}]);function Pe(t){Rt(t),o(pt,!1)}function nt(t,n){t.stopPropagation(),ut()?.(n)}function At(t,n){const h=jo(t);h&&(e(jt).tabBar=!1,e(jt).compact=!1,o(gt,{tabId:n,...h},!0))}function ma(t){const n=t.target;n instanceof Element&&n.closest(tt)||(t.preventDefault(),o(gt,null),e(jt).compact=!0)}function rt(){o(gt,null)}const ba=c(()=>{const t=e(va);if(!t)return[];const n=[];Vr(t)&&n.push({id:"locate",label:d.layout_panelTabBar_revealInSidebar_label(),icon:yo,onClick:()=>Jr(t)});const h=t.type==="file"||t.type==="diff"?{relative:Fa,absolute:Ya,filename:$a,reveal:La}:t.type==="agent"?{relative:vn,absolute:Ja,filename:Qa,reveal:Dn}:t.type==="note"?{relative:mn,absolute:en,filename:bn,reveal:Pa}:null;return h?(n.push({id:"copy-relative-path",label:d.layout_panelTabBar_copyRelativePath_label(),icon:gn,onClick:()=>void h.relative(t)},{id:"copy-absolute-path",label:d.layout_panelTabBar_copyAbsolutePath_label(),icon:gn,onClick:()=>void h.absolute(t)},{id:"copy-filename",label:d.layout_panelTabBar_copyFilename_label(),icon:gn,onClick:()=>void h.filename(t)}),w()&&de&&n.push({id:"reveal-file",label:d.layout_panelTabBar_revealIn_label({fileManager:et}),icon:wo,onClick:()=>void h.reveal(t)})):t.type==="browser"&&t.browserUrl?(n.push({id:"copy-url",label:d.layout_panelTabBar_copyUrl_label(),icon:gn,shortcut:e(ia),onClick:()=>void Rn(t)}),sa?e(De)&&n.push({id:"full-screen",label:d.browser_overflow_fullScreen_label(),icon:ur,onClick:()=>Ce.dispatch(Tr(ot()??te(),te(),t.id))}):n.push({id:"open-browser",label:d.layout_panelTabBar_openInBrowser_label(),icon:Ln,onClick:()=>void _n(t)})):t.type==="terminal"&&n.push({id:"copy-terminal-name",label:d.layout_panelTabBar_copyTerminalName_label(),icon:gn,onClick:()=>void yn(t)}),e(De)&&n.push({type:"separator"},{id:"open-in-own-window",label:d.tabWindow_openInOwnWindow_label(),icon:To,shortcut:Ta(ee()),onClick:()=>Ce.dispatch(Tr(ot()??te(),te(),t.id))}),n.push({type:"separator"},{id:"zoom-panel",label:lt()?d.layout_panelTabBar_unzoomPanel_label():d.layout_panelTabBar_zoomPanel_label(),icon:lt()?Po:ur,shortcut:Ta(S()),disabled:!ft(),onClick:()=>ft()?.()},{id:"move-panel-left",label:d.layout_panelTabBar_movePanelLeft_label(),icon:xo,shortcut:e(Qt),disabled:!Ie(),onClick:()=>Ie()?.()},{id:"move-panel-right",label:d.layout_panelTabBar_movePanelRight_label(),icon:ko,shortcut:e(He),disabled:!Pt(),onClick:()=>Pt()?.()},{id:"split-panel",label:d.layout_panelTabBar_splitRight_label(),icon:Io,shortcut:e(kt),disabled:!Ot(),onClick:()=>Ot()?.()},{type:"separator"},{id:"close-tab",label:d.layout_panelTabBar_close_label(),shortcut:e(Zt),disabled:!ut()||t.closable===!1,onClick:()=>ut()?.(t.id)},{id:"close-other-tabs",label:d.layout_panelTabBar_closeOtherTabs_label(),disabled:!ze(),onClick:()=>ze()?.(t.id)},{id:"close-tabs-right",label:d.layout_panelTabBar_closeTabsToRight_label(),disabled:!Oe(),onClick:()=>Oe()?.(t.id)},{id:"close-panel",label:d.layout_panelTabBar_closePanel_label(),disabled:!ct(),onClick:()=>ct()?.()},{id:"close-all-others",label:d.layout_panelTabBar_closeAllOthers_label(),disabled:!pe(),onClick:()=>pe()?.(t.id)}),n});function na(t){return t.filePath??t.diffPath??null}async function Fa(t){const n=Gt(t);if(n)try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_pathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function Ya(t){const n=na(t);if(n)try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_absolutePathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function $a(t){const n=t.filePath??t.diffPath;if(!n)return;const h=n.split(/[/\\]/).pop()||n;try{await navigator.clipboard.writeText(h),ve.success(d.layout_panelTabBar_filenameCopied_label())}catch{ve.error(d.layout_panelTabBar_copyFilenameFailed_error())}}async function La(t){const n=na(t);if(n)try{await rn("shell:showItemInFolder",{path:n})}catch{ve.error(d.layout_panelTabBar_revealFailed_error({fileManager:et}))}}async function un(t){if(!t.agentId)return null;const n=t.workspaceId||te();if(!n)return null;try{const h=await rn("workspace:get-root",{workspaceId:n});return h?`${h}/.workspace/agents/${t.agentId}.json`:null}catch{return null}}async function vn(t){const n=`.workspace/agents/${t.agentId}.json`;try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_pathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function Ja(t){const n=await un(t);if(!n){ve.error(d.layout_panelTabBar_agentPathUnresolved_error());return}try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_absolutePathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function Qa(t){const n=`${t.agentId}.json`;try{await navigator.clipboard.writeText(n),ve.success(d.layout_panelTabBar_filenameCopied_label())}catch{ve.error(d.layout_panelTabBar_copyFilenameFailed_error())}}async function Dn(t){const n=await un(t);if(!n){ve.error(d.layout_panelTabBar_agentPathUnresolved_error());return}try{await rn("shell:showItemInFolder",{path:n})}catch{ve.error(d.layout_panelTabBar_revealFailed_error({fileManager:et}))}}async function Ha(t){if(!t.noteId)return null;const n=t.workspaceId||te();if(!n)return null;try{const h=await rn("workspace:get-root",{workspaceId:n});return h?`${h}/.workspace/notes/${t.noteId}.md`:null}catch{return null}}async function mn(t){const n=`.workspace/notes/${t.noteId}.md`;try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_pathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function en(t){const n=await Ha(t);if(!n){ve.error(d.layout_panelTabBar_notePathUnresolved_error());return}try{await navigator.clipboard.writeText(on(n)),ve.success(d.layout_panelTabBar_absolutePathCopied_label())}catch{ve.error(d.layout_panelTabBar_copyPathFailed_error())}}async function bn(t){const n=`${t.noteId}.md`;try{await navigator.clipboard.writeText(n),ve.success(d.layout_panelTabBar_filenameCopied_label())}catch{ve.error(d.layout_panelTabBar_copyFilenameFailed_error())}}async function Pa(t){const n=await Ha(t);if(!n){ve.error(d.layout_panelTabBar_notePathUnresolved_error());return}try{await rn("shell:showItemInFolder",{path:n})}catch{ve.error(d.layout_panelTabBar_revealFailed_error({fileManager:et}))}}async function Rn(t){if(t.browserUrl)try{await pl(t.browserUrl),ve.success(d.layout_panelTabBar_urlCopied_label())}catch(n){Se.error("Failed to copy browser tab URL",n,{url:t.browserUrl}),ve.error(d.layout_panelTabBar_copyUrlFailed_error())}}async function _n(t){if(t.browserUrl)try{await rn("shell:openExternal",{url:t.browserUrl})}catch{ve.error(d.layout_panelTabBar_openInBrowserFailed_error())}}async function yn(t){const n=L(t);try{await navigator.clipboard.writeText(n),ve.success(d.layout_panelTabBar_copied_label())}catch{ve.error(d.layout_panelTabBar_copyFailed_error())}}const tn=qn;let Mt=Z(null),it=Z(null),st=Z(null),a=Z(!1),g=Z(null),H=Z(null);function M(t){if(!e(g))return;const n=t.deltaY||t.deltaX;n!==0&&(t.preventDefault(),e(g).scrollLeft+=n)}mt(()=>{if(e(g))return e(g).addEventListener("wheel",M,{passive:!1}),()=>{e(g)?.removeEventListener("wheel",M)}});function Ht(){if(!Xe()||!e(g)||!Ge())return;const t=e(g).querySelector(`[data-tab-id="${Ge()}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}mt(()=>{Ge()&&e(g)&&requestAnimationFrame(()=>{Ht()})});function xa(t,n){if(!t.dataTransfer)return;o(Mt,n,!0),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData(tn,JSON.stringify({tabId:n,panelId:_e})),Ce.dispatch(yr());const h=t.target;requestAnimationFrame(()=>{h.style.opacity="0.5"})}function ka(t){const n=t.target;n.style.opacity="",o(Mt,null),o(it,null),o(st,null),o(a,!1),Ce.dispatch(Zn())}function cn(t){if(!t.dataTransfer)return;if(t.target.closest('button, input, [contenteditable="true"]')){t.preventDefault();return}if(!e(P)){t.preventDefault();return}const h={tabId:e(P).id,panelId:_e};Hl(h),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData(qn,JSON.stringify(h));const N=Nl(e(P).title??"");t.dataTransfer.setDragImage(N,16,16),requestAnimationFrame(()=>N.remove()),Ce.dispatch(yr())}function Na(){const t=Dt();t?t():(Fr(),Ce.dispatch(Zn()))}function fn(){Xa()?.panelId===_e&&Na()}function Wn(t){t.key!=="Escape"||Xa()?.panelId!==_e||Na()}Ar(()=>{Xa()?.panelId===_e&&Na()});function an(t){return t.dataTransfer?.types.includes(tn)??!1}function Ur(t,n,h){if(!an(t)||e(Mt)===n)return;t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move");const N=h.getBoundingClientRect(),we=N.left+N.width/2,ae=t.clientX>=we,$=re().findIndex(q=>q.id===n);ae&&$<re().length-1?(o(it,re()[$+1].id,!0),o(st,"before")):(o(it,n,!0),o(st,ae?"after":"before",!0))}function Kr(){o(it,null),o(st,null)}function Zr(t,n){if(!an(t))return;t.preventDefault(),t.stopPropagation();const h=e(st),N=e(it),we=t.dataTransfer?.getData(tn);if(!we){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}try{const{tabId:ae,panelId:$}=JSON.parse(we);if(ae===n){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}const q=N||n;let O=re().findIndex(xe=>xe.id===q);if(O===-1){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}if(h==="after"&&(O=O+1),$===_e){const xe=re().findIndex(ne=>ne.id===ae);if(xe===-1){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}let Ye=O;xe<Ye&&(Ye=Ye-1),ue()?.(xe,Ye)}else ea()?.(ae,$,O)}catch{}o(Mt,null),o(it,null),o(st,null),o(a,!1)}function jr(t){an(t)&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),o(a,!0))}function qr(t){const n=t.relatedTarget;e(g)?.contains(n)||(o(a,!1),o(it,null),o(st,null))}function Gr(t){if(!an(t))return;t.preventDefault(),t.stopPropagation();const n=e(it),h=e(st),N=t.dataTransfer?.getData(tn);if(!N){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}try{const{tabId:we,panelId:ae}=JSON.parse(N);let $;if(n){const q=re().findIndex(O=>O.id===n);q!==-1&&($=h==="after"?q+1:q)}if(ae===_e){const q=re().findIndex(xe=>xe.id===we);if(q===-1){o(Mt,null),o(it,null),o(st,null),o(a,!1);return}let O=$??re().length-1;q<O&&(O=O-1),q!==O&&ue()?.(q,O)}else ea()?.(we,ae,$)}catch{}o(Mt,null),o(it,null),o(st,null),o(a,!1)}function Yn(t){return Ir.getIcon(t)??Kn}const P=c(()=>re().find(t=>t.id===Ge())||re()[0]||null);function An(t){return t.type==="note"&&t.noteId&&_r(t.noteId)||t.type==="note"&&t.noteId&&Pr.select(Ce.state,t.workspaceId??te(),t.noteId)?.contentTruncated?!1:t.type==="note"||t.type==="agent"||t.type==="file"}async function Jn(t){!An(t)||!Ve()||(o(qt,t.id,!0),o(_,L(t),!0),await Tn(),e(da)&&(e(da).focus(),e(da).select()))}function wn(){if(!e(qt))return;const t=re().find(n=>n.id===e(qt));if(t){const n=e(_).trim(),h=L(t);n&&n!==h&&Ve()?.(t,n)}o(qt,null)}function Qn(){o(qt,null),o(_,"")}function Xr(t,n){t.preventDefault(),t.stopPropagation(),Jn(n)}function er(t){const n=t.target;!(n instanceof Element)||n.closest(tt)||Xa()!==null||(t.preventDefault(),t.stopPropagation(),Ce.dispatch(Eo(ot()??te(),_e)))}function Vr(t){return["note","file","agent","terminal"].includes(t.type)}function Yr(t){return Ir.getSidebarTabId(t)}function Jr(t){const n=Yr(t.type);n&&Ce.dispatch(Bo(te(),{sidebarTabId:n,type:t.type,noteId:t.noteId,filePath:t.filePath,agentId:t.agentId,terminalId:t.terminalId,scriptId:t.scriptId}))}var Qr={get tabs(){return re()},set tabs(t=[]){re(t),s()},get activeTabId(){return Ge()},set activeTabId(t=null){Ge(t),s()},get attentionTabIds(){return Ne()},set attentionTabIds(t=[]){Ne(t),s()},get panelId(){return $t()},set panelId(t){$t(t),s()},get workspaceId(){return te()},set workspaceId(t){te(t),s()},get layoutId(){return ot()},set layoutId(t){ot(t),s()},get isFocused(){return at()},set isFocused(t=!1){at(t),s()},get isRightmostPanel(){return Lt()},set isRightmostPanel(t=!1){Lt(t),s()},get contentActions(){return p()},set contentActions(t=null){p(t),s()},get showTabStrip(){return Xe()},set showTabStrip(t=!1){Xe(t),s()},get onTabClick(){return ha()},set onTabClick(t){ha(t),s()},get onTabClose(){return ut()},set onTabClose(t){ut(t),s()},get onTabReorder(){return ue()},set onTabReorder(t){ue(t),s()},get onTabMoveToPanel(){return ea()},set onTabMoveToPanel(t){ea(t),s()},get onPaneDragFinish(){return Dt()},set onPaneDragFinish(t){Dt(t),s()},get onMovePaneUp(){return ta()},set onMovePaneUp(t){ta(t),s()},get onMovePaneDown(){return Ae()},set onMovePaneDown(t){Ae(t),s()},get onMovePaneLeft(){return Ie()},set onMovePaneLeft(t){Ie(t),s()},get onMovePaneRight(){return Pt()},set onMovePaneRight(t){Pt(t),s()},get onCloseOtherTabs(){return ze()},set onCloseOtherTabs(t){ze(t),s()},get onCloseTabsToRight(){return Oe()},set onCloseTabsToRight(t){Oe(t),s()},get onCloseAllTabs(){return Ue()},set onCloseAllTabs(t){Ue(t),s()},get onCloseAllOthersEverywhere(){return pe()},set onCloseAllOthersEverywhere(t){pe(t),s()},get onClosePanel(){return ct()},set onClosePanel(t){ct(t),s()},get onZoomToggle(){return ft()},set onZoomToggle(t){ft(t),s()},get isZoomed(){return lt()},set isZoomed(t=!1){lt(t),s()},get onTabRename(){return Ve()},set onTabRename(t){Ve(t),s()},get onSplitHorizontal(){return Ot()},set onSplitHorizontal(t){Ot(t),s()},$set:Ra,$on:(t,n)=>Wa(r,t,n)},tr=vi();Qe("keydown",fo,Wn);var Mn=k(tr),nn=le(Mn),Ua=b(le(nn),2),ar=le(Ua);Va(ar,19,re,t=>t.id,(t,n,h)=>{const N=c(()=>e(n).id===Ge()),we=c(()=>e(h)<9?`⌘${e(h)+1}`:null),ae=c(()=>e(it)===e(n).id),$=c(()=>L(e(n))),q=c(()=>jn(e(n).type));{let O=c(()=>e(we)&&at()?`${e($)} (${e(we)})`:e($)),xe=c(()=>!(e(we)&&at())&&!e(bt)[e(n).id]);$n(t,{get content(){return e(O)},get disabled(){return e(xe)},side:"bottom",delayDuration:500,children:(Ye,ne)=>{var G=ci(),Nt=le(G);{var Ut=u=>{var v=li();f(u,v)};I(Nt,u=>{e(ae)&&e(st)==="before"&&u(Ut)})}var It=b(Nt,2),ua=le(It);{var Ka=u=>{za(u,{get icon(){return dr},size:16,class:"shrink-0 text-muted-foreground","data-panel-agent-chat-glyph":!0})},_a=u=>{Xn(u,{get kind(){return e(q)}})},ca=u=>{pr(u,{get faviconUrl(){return e(n).faviconUrl},size:16,fallbackClass:"tab-icon opacity-50"})},Re=u=>{{let v=c(()=>Yn(e(n).type));za(u,{get icon(){return e(v)},size:16,class:"tab-icon shrink-0 opacity-50"})}};I(ua,u=>{e(n).type==="agent"?u(Ka):e(q)?u(_a,1):e(n).type==="browser"?u(ca,2):u(Re,-1)})}var ya=b(ua,2);{var Te=u=>{vr(u,{variant:"inline",noFocusStyle:!0,style:"field-sizing: content;",class:"tab-title w-auto min-w-[1ch] max-w-24 font-medium",onkeydown:v=>{v.key==="Enter"?(v.preventDefault(),wn()):v.key==="Escape"&&(v.preventDefault(),Qn())},onblur:wn,onclick:v=>v.stopPropagation(),ondblclick:v=>v.stopPropagation(),get ref(){return e(da)},set ref(v){o(da,v,!0)},get value(){return e(_)},set value(v){o(_,v,!0)}})},Ke=u=>{var v=ii(),Q=Vt(v,!0);hn(v,(K,he)=>hr?.(K,he),()=>K=>e(bt)[e(n).id]=K),me(()=>dt(Q,e($))),f(u,v)};I(ya,u=>{e(qt)===e(n).id?u(Te):u(Ke,-1)})}var Ze=b(ya,2);{var ht=u=>{{let v=c(()=>e(n).workspaceId??te()),Q=c(()=>typeof e(n).data?.conversationId=="string"?e(n).data.conversationId:"default");Gn(u,{get workspaceId(){return e(v)},get conversationId(){return e(Q)}})}};I(Ze,u=>{e(n).type==="discussion"&&!e(N)&&u(ht)})}var Je=b(Ze,2);{var oe=u=>{var v=si(),Q=Vt(v,!0);me(K=>dt(Q,K),[()=>d.layout_panelTabBar_bgBadge_label()]),f(u,v)},Me=c(()=>ce(e(n)));I(Je,u=>{e(Me)&&u(oe)})}var U=b(Je,2);{var se=u=>{var v=di();f(u,v)};I(U,u=>{e(n).hasUnsavedChanges&&u(se)})}var fe=b(U,2);{var $e=u=>{{let v=c(()=>fa("tab-close ml-1 transition-opacity cursor-pointer",e(N)?"opacity-60 hover:opacity-100 focus-visible:opacity-100":"opacity-0 group-hover:opacity-60 group-focus-within:opacity-60")),Q=c(()=>xt(e(n))?d.layout_panelTabBar_hideOwnedTab_tooltip():void 0),K=c(()=>xt(e(n))?d.layout_panelTabBar_hideOwnedTab_ariaLabel():d.layout_panelTabBar_closeTab_ariaLabel());ga(u,{variant:"ghost-light",size:"icon-compact",iconOnly:!0,get class(){return e(v)},onclick:he=>nt(he,e(n).id),get title(){return e(Q)},get"aria-label"(){return e(K)},children:(he,vt)=>{za(he,{get icon(){return bo},size:"xs"})},$$slots:{default:!0}})}};I(fe,u=>{e(n).closable&&u($e)})}X(It);var E=b(It,2);{var J=u=>{var v=ui();f(u,v)};I(E,u=>{e(ae)&&e(st)==="after"&&e(h)===re().length-1&&u(J)})}X(G),me((u,v)=>{Fe(G,"data-tab-id",e(n).id),Kt(G,1,u,"svelte-11borfu"),Fe(G,"draggable",e(qt)!==e(n).id),Fe(G,"aria-selected",e(N)),Kt(It,1,v,"svelte-11borfu")},[()=>Oa(fa("panel-tab group cursor-pointer relative",e(N)?"text-foreground after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:rounded-full after:bg-ring":"text-muted-foreground hover:text-foreground",e(Mt)===e(n).id&&"opacity-50")),()=>Oa(fa("flex items-center gap-1.5 pl-2.5 pr-2 py-1 h-9 text-ui whitespace-nowrap"))]),Ia("click",G,()=>Rt(e(n).id)),Ia("mousedown",G,()=>Rt(e(n).id)),Ia("dblclick",G,u=>Xr(u,e(n))),Ia("keydown",G,u=>{u.key==="Enter"?Rt(e(n).id):At(u,e(n).id)}),Ia("contextmenu",G,u=>At(u,e(n).id)),Qe("auxclick",G,u=>{u.button===1&&e(n).closable!==!1&&(u.preventDefault(),u.stopPropagation(),ut()?.(e(n).id))}),Qe("dragstart",G,u=>xa(u,e(n).id)),Qe("dragend",G,ka),Qe("dragover",G,u=>Ur(u,e(n).id,u.currentTarget)),Qe("dragleave",G,Kr),Qe("drop",G,u=>Zr(u,e(n).id)),f(Ye,G)},$$slots:{default:!0}})}});var eo=b(ar,2);{var to=t=>{var n=fi();f(t,n)};I(eo,t=>{(e(Mt)||F())&&e(a)&&!e(it)&&t(to)})}X(Ua),zn(Ua,t=>o(g,t),()=>e(g));var nr=b(Ua,2),rr=le(nr),or=le(rr);qe(or,()=>"tabBar");var ao=b(or,2);Be(ao,()=>e(P)),X(rr),X(nr),X(nn),zn(nn,t=>o(H,t),()=>e(H));var no=b(nn,2);{var ro=t=>{var n=pi(),h=le(n);ie(h);var N=b(h,4);{var we=O=>{const xe=c(()=>Xo(e(P).ownerAgentId,R(),e(P).ownerAgentName));{let Ye=c(()=>d.browser_embedded_ownerChip_ariaLabel({name:e(xe)})),ne=c(()=>d.browser_tabNotice_agentControl_label({name:e(xe)}));ga(O,{variant:"ghost-light",size:"icon-sm",wrapContent:!1,class:"panel-header-action-button",get"aria-label"(){return e(Ye)},get tooltip(){return e(ne)},tooltipSide:"bottom",tooltipDelayDuration:300,onclick:G=>e(P)&&ye(e(P),G),get"data-browser-tab-agent-control"(){return e(P).ownerAgentId},children:(G,Nt)=>{var Ut=gi(),It=le(Ut);On(It,()=>e(P).ownerAgentId,ua=>{In(ua,{get agentId(){return e(P).ownerAgentId}})}),X(Ut),f(G,Ut)},$$slots:{default:!0}})}};I(N,O=>{e(P).type==="browser"&&e(P).ownerAgentId&&O(we)})}var ae=b(N,2),$=le(ae);qe($,()=>"compact");var q=b($,2);Be(q,()=>e(P)),X(ae),X(n),me((O,xe)=>{Kt(n,1,O,"svelte-11borfu"),Fe(n,"data-column-focused",at()?"":void 0),Fe(n,"aria-label",xe),Fe(n,"data-pane-stack-size",re().length)},[()=>Oa(fa("panel-header group/header relative flex h-[var(--panel-header-height)] cursor-grab items-center bg-background pr-2.5 active:cursor-grabbing",e(P).type==="agent"&&"panel-agent-header",at()&&"focused")),()=>d.layout_panelTabBar_paneStack_ariaLabel({count:re().length})]),Ia("contextmenu",n,ma),Ia("dblclick",n,er),Qe("dragstart",n,cn),Qe("dragend",n,fn),f(t,n)},oo=t=>{var n=hi();Sn(n,"",{},{height:"var(--panel-header-height)"});var h=b(le(n),2),N=le(h);qe(N,()=>"compact");var we=b(N,2);Be(we),X(h),X(n),me(ae=>{Kt(n,1,ae,"svelte-11borfu"),Fe(n,"data-column-focused",at()?"":void 0)},[()=>Oa(fa("panel-header group/header relative flex items-center pr-2.5",at()&&"focused"))]),f(t,n)};I(no,t=>{e(P)?t(ro):t(oo,-1)})}X(Mn);var lo=b(Mn,2);{var io=t=>{qo(t,{get x(){return e(gt).x},get y(){return e(gt).y},get returnFocus(){return e(gt).returnFocus},get items(){return e(ba)},onClickOutside:rt})};I(lo,t=>{e(gt)&&e(va)&&t(io)})}me(t=>Kt(nn,1,t,"svelte-11borfu"),[()=>Oa(fa("panel-tab-bar group/tabbar relative flex items-center h-[var(--panel-header-height)] bg-background",!Xe()&&"hidden"))]),Ia("dblclick",nn,er),Qe("dragover",Ua,jr),Qe("dragleave",Ua,qr),Qe("drop",Ua,Gr),f(m,tr);var so=Ma(Qr);return ge(),so}Wr(["dblclick","click","mousedown","keydown","contextmenu"]);var mi=D('<span class="relative flex min-w-0 items-center gap-x-2"><span class="flex shrink-0 items-center" aria-hidden="true"><!></span> <span class="min-w-0 truncate font-medium"> </span></span> <kbd class="shortcut-key relative shrink-0 justify-self-end whitespace-nowrap text-right text-muted-foreground svelte-1j5ruko"> </kbd>',1),bi=D('<span class="relative flex min-w-0 items-center gap-x-2"><span class="flex shrink-0 items-center opacity-70" aria-hidden="true"><!></span> <span class="relative min-w-0 truncate"> </span></span>'),_i=D('<span class="relative min-w-0 truncate"> </span>'),yi=D('<kbd class="shortcut-key relative shrink-0 justify-self-end whitespace-nowrap text-right text-muted-foreground svelte-1j5ruko"> </kbd>'),wi=D("<!> <!>",1),Ti=D('<div class="recent-list mt-5 flex flex-col gap-0.5"></div>'),Pi=D('<span class="relative min-w-0 truncate"> </span> <kbd class="shortcut-key relative shrink-0 justify-self-end whitespace-nowrap text-right text-muted-foreground svelte-1j5ruko"> </kbd>',1),xi=D('<section class="empty-state-content type-caption min-w-0 w-full max-w-xs"><div class="creation-list flex flex-col gap-0.5"></div> <!> <div class="shortcut-list mt-5 flex flex-col gap-0.5"></div></section>');function Nr(m,r){if(new.target)return Da({component:Nr,...m});Aa(r,!0);const B=()=>Y(yt,"$recentlyClosed$",ge),x=()=>Y(de,"$workspaceAgents$",ge),z=()=>Y(wt,"$workspaceTerminals$",ge),y=()=>Y(ia,"$newAgentShortcut$",ge),C=()=>Y(Zt,"$newNoteShortcut$",ge),We=()=>Y(kt,"$newTerminalShortcut$",ge),R=()=>Y(Qt,"$newBrowserShortcut$",ge),w=()=>Y(Ge,"$reopenTabShortcut$",ge),ee=()=>Y(tt,"$newPanelShortcut$",ge),S=()=>Y(re,"$commandPaletteShortcut$",ge),F=()=>Y(Ne,"$toggleSidebarShortcut$",ge),be=()=>Y($t,"$keyboardShortcutsShortcut$",ge),[ge,qe]=dn();let Be=i(r,"workspaceId",7),j=i(r,"panelId",7),W=i(r,"onCreateAgent",7),ie=i(r,"onCreateAgentWithSpecialist",7),Le=i(r,"onCreateNote",7),bt=i(r,"onCreateTerminal",7),_t=i(r,"onOpenBrowser",7);const Et=go("panelLayoutManager"),et=c(()=>Et?.()),Se=Cn(Be());mt(()=>{Se.set(Be())});const yt=Tl(Se),de=$r(Se),wt=xl(Se),Tt=c(()=>{const p=B()??[];if(p.length===0)return[];const Xe=new Set((x()??[]).map(ue=>String(ue.id))),ha=new Set((z()??[]).map(ue=>ue.id));return p.filter(ue=>ue.tab.type==="agent"?ue.tab.agentId?Xe.has(ue.tab.agentId):!0:ue.tab.type==="terminal"&&ue.tab.terminalId?ha.has(ue.tab.terminalId):!0).slice(0,5)});function Bt(p){return p.type==="browser"?p.title||d.layout_panelLayout_browser_fallback():p.title}function Yt(p){const Xe=jn(p);if(Xe)return kn[Xe];switch(p){case"agent":return cr;case"note":return kn.note;case"terminal":return fr;case"browser":return gr;case"file":case"diff":return Kn;default:return Kn}}function Jt(){e(et)?.reopenLastClosed()}function pa(p){e(et)?.reopenClosedTab(p,j())}function oa(){if(W()){W()(j());return}ie()?.(null,j())}function la(){const p=Pl.select(Ce.state,Be());p&&e(et)?.splitPanel(p,"horizontal")}const ia=zt("workspace.new-agent"),Zt=zt("workspace.new-note"),kt=zt("workspace.new-terminal"),Qt=zt("workspace.new-browser"),He=c(()=>[...W()||ie()?[{id:"agent",label:d.layout_panelEmptyState_agent_label(),icon:cr,key:y(),action:oa}]:[],{id:"note",label:d.layout_panelEmptyState_note_label(),icon:kn.note,key:C(),action:()=>Le()?.(j())},...bt()?[{id:"terminal",label:d.layout_panelEmptyState_terminal_label(),icon:fr,key:We(),action:()=>bt()?.(j())}]:[],..._t()?[{id:"browser",label:d.layout_panelEmptyState_browser_label(),icon:gr,key:R(),action:()=>_t()?.(j())}]:[]]),tt=zt("navigation.new-tab"),re=zt("global.command-palette-alt"),Ge=zt("navigation.reopen-tab"),Ne=zt("panel.toggle-sidebar"),$t=zt("global.keyboard-shortcuts"),te=c(()=>[{id:"reopen-latest",label:d.layout_panelEmptyState_reopenLastClosed_label(),shortcut:w(),icon:void 0,onSelect:Jt,title:d.layout_panelEmptyState_reopenLastClosed_label(),isUtility:!0},...e(Tt).map(p=>{const Xe=Bt(p.tab);return{id:`${p.tab.id}-${p.closedAt}`,label:Xe,shortcut:void 0,icon:Yt(p.tab.type),onSelect:()=>pa(p.tab.id),title:d.layout_panelEmptyState_reopen_tooltip({title:Xe}),isUtility:!1}})]),ot=c(()=>[{key:ee(),label:d.layout_panelEmptyState_newPanel_label(),action:la},{key:S(),label:d.layout_panelEmptyState_commandPalette_label(),action:()=>Ce.dispatch(Oo())},{key:w(),label:d.layout_panelEmptyState_reopenClosed_label(),action:Jt},{key:F(),label:d.layout_panelEmptyState_toggleSidebar_label(),action:()=>Ce.dispatch(Fo())},{key:be(),label:d.layout_panelEmptyState_allShortcuts_label(),action:()=>Ce.dispatch(Ho("global"))}]);var at={get workspaceId(){return Be()},set workspaceId(p){Be(p),s()},get panelId(){return j()},set panelId(p){j(p),s()},get onCreateAgent(){return W()},set onCreateAgent(p){W(p),s()},get onCreateAgentWithSpecialist(){return ie()},set onCreateAgentWithSpecialist(p){ie(p),s()},get onCreateNote(){return Le()},set onCreateNote(p){Le(p),s()},get onCreateTerminal(){return bt()},set onCreateTerminal(p){bt(p),s()},get onOpenBrowser(){return _t()},set onOpenBrowser(p){_t(p),s()},$set:Ra,$on:(p,Xe)=>Wa(r,p,Xe)};{let p=c(()=>d.layout_panelEmptyState_createInEmptyPanel_ariaLabel());wl(m,{class:"empty-state h-full overflow-y-auto bg-sidebar px-6 py-8 text-foreground text-left",contentClass:"w-full max-w-xs",get"aria-label"(){return e(p)},"data-panel-empty-state":!0,children:(Xe,ha)=>{var ut=xi(),ue=le(ut);Va(ue,21,()=>e(He),Ae=>Ae.id,(Ae,Ie)=>{{let Pt=c(()=>d.layout_panelEmptyState_newItem_tooltip({label:e(Ie).label}));ga(Ae,{wrapContent:!1,variant:"ghost",size:"sm",class:"creation-action empty-state-row grid min-h-7 min-w-0 w-full max-w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-x-2 px-2 py-1 text-left font-medium text-foreground transition-colors duration-spring-fast ease-spring-fast hover:text-muted-foreground focus-visible:outline focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring motion-reduce:transition-none",get onclick(){return e(Ie).action},get"aria-label"(){return e(Pt)},children:(ze,Oe)=>{var Ue=mi(),pe=k(Ue),ct=le(pe),ft=le(ct);za(ft,{get icon(){return e(Ie).icon},class:"size-[1em]"}),X(ct);var lt=b(ct,2),Ve=Vt(lt,!0);hn(lt,(V,De)=>Fn?.(V,De),()=>d.layout_panelEmptyState_newItem_tooltip({label:e(Ie).label})),X(pe);var Ot=b(pe,2),sa=Vt(Ot,!0);me((V,De)=>{dt(Ve,V),dt(sa,De)},[()=>d.layout_panelEmptyState_newItem_tooltip({label:e(Ie).label}),()=>Ta(e(Ie).key)]),f(ze,Ue)},$$slots:{default:!0}})}}),X(ue);var ea=b(ue,2);{var Dt=Ae=>{var Ie=Ti();Va(Ie,21,()=>e(te),Pt=>Pt.id,(Pt,ze)=>{{let Oe=c(()=>e(ze).isUtility?"reopen-hint":"recent-item"),Ue=c(()=>e(ze).isUtility?void 0:e(ze).title);ga(Pt,{wrapContent:!1,variant:"ghost",size:"sm",get class(){return`${e(Oe)??""} empty-state-row grid min-h-7 min-w-0 w-full max-w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-x-2 px-2 py-1 text-left font-normal text-muted-foreground transition-colors duration-spring-fast ease-spring-fast hover:text-foreground focus-visible:outline focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring motion-reduce:transition-none`},get onclick(){return e(ze).onSelect},get title(){return e(Ue)},children:(pe,ct)=>{var ft=wi(),lt=k(ft);{var Ve=De=>{var _e=bi(),Ft=le(_e),gt=le(Ft);za(gt,{get icon(){return e(ze).icon},class:"size-[1em]"}),X(Ft);var va=b(Ft,2),pt=Vt(va,!0);X(_e),me(()=>dt(pt,e(ze).label)),f(De,_e)},Ot=De=>{var _e=_i(),Ft=Vt(_e,!0);hn(_e,(gt,va)=>Fn?.(gt,va),()=>e(ze).label),me(()=>dt(Ft,e(ze).label)),f(De,_e)};I(lt,De=>{e(ze).icon?De(Ve):De(Ot,-1)})}var sa=b(lt,2);{var V=De=>{var _e=yi(),Ft=Vt(_e,!0);me(gt=>dt(Ft,gt),[()=>Ta(e(ze).shortcut)]),f(De,_e)};I(sa,De=>{e(ze).shortcut&&De(V)})}f(pe,ft)},$$slots:{default:!0}})}}),X(Ie),f(Ae,Ie)};I(ea,Ae=>{e(Tt).length>0&&Ae(Dt)})}var ta=b(ea,2);Va(ta,21,()=>e(ot),Ae=>Ae.label,(Ae,Ie)=>{ga(Ae,{wrapContent:!1,variant:"ghost",size:"sm",class:"shortcut-item empty-state-row grid min-h-7 min-w-0 w-full max-w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-x-2 px-2 py-1 text-left font-normal text-muted-foreground transition-colors duration-spring-fast ease-spring-fast hover:text-foreground focus-visible:outline focus-visible:outline-1 focus-visible:-outline-offset-1 focus-visible:outline-ring motion-reduce:transition-none",get onclick(){return e(Ie).action},get"aria-label"(){return e(Ie).label},children:(Pt,ze)=>{var Oe=Pi(),Ue=k(Oe),pe=Vt(Ue,!0);hn(Ue,(lt,Ve)=>Fn?.(lt,Ve),()=>e(Ie).label);var ct=b(Ue,2),ft=Vt(ct,!0);me(lt=>{dt(pe,e(Ie).label),dt(ft,lt)},[()=>Ta(e(Ie).key)]),f(Pt,Oe)},$$slots:{default:!0}})}),X(ta),X(ut),me(Ae=>Fe(ut,"aria-label",Ae),[()=>d.layout_panelEmptyState_createInEmptyPanel_ariaLabel()]),f(Xe,ut)},$$slots:{default:!0}})}var Lt=Ma(at);return qe(),Lt}var ki=D("<div><!></div>"),Ii=D('<div data-panel-drop-destination="" aria-hidden="true"></div>'),Ci=D('<div role="region"><div data-panel-header=""><!></div> <div><!></div> <!></div>');function Si(m,r){if(new.target)return Da({component:Si,...m});Aa(r,!0);const B=()=>Y(ct,"$isDragging",x),[x,z]=dn();let y=i(r,"panel",7),C=i(r,"isFocused",7,!1),We=i(r,"showFocusBorder",7,!1),R=i(r,"workspaceId",7),w=i(r,"layoutId",7),ee=i(r,"active",7,!0),S=i(r,"availableCanvasWidth",7),F=i(r,"isRightmostPanel",7,!1),be=i(r,"canCreateColumn",7,!0),ge=i(r,"contained",7,!1),qe=i(r,"onFocus",7),Be=i(r,"onTabClick",7),j=i(r,"onTabClose",7),W=i(r,"onTabReorder",7),ie=i(r,"onCloseOtherTabs",7),Le=i(r,"onCloseTabsToRight",7),bt=i(r,"onCloseAllTabs",7),_t=i(r,"onCloseAllOthersEverywhere",7),Et=i(r,"onClosePanel",7),et=i(r,"onZoomToggle",7),Se=i(r,"isZoomed",7,!1),yt=i(r,"onTabDrop",7),de=i(r,"onTabMoveToPanel",7),wt=i(r,"onPaneDropPreview",7),Tt=i(r,"onPaneDragFinish",7),Bt=i(r,"onMovePaneUp",7),Yt=i(r,"onMovePaneDown",7),Jt=i(r,"onMovePaneLeft",7),pa=i(r,"onMovePaneRight",7),oa=i(r,"onMoveLeft",7),la=i(r,"onMoveRight",7),ia=i(r,"onTabRename",7),Zt=i(r,"onCreateAgent",7),kt=i(r,"onCreateAgentWithSpecialist",7),Qt=i(r,"onCreateNote",7),He=i(r,"onCreateTerminal",7),tt=i(r,"onOpenBrowser",7),re=i(r,"emptyState",7),Ge=i(r,"onSplitHorizontal",7);const Ne=y().id,{actions:$t}=kl(),{handler:te}=Il(),ot=Cl({onDragChange:l=>te.current?.onDragChange(l),onDrop:l=>te.current?.onDrop(l)});let at=null;mt(()=>{te.current!==at&&(at=te.current,ot.reset())});function Lt(l){te.current&&ot.handleDragEnter(l)}function p(l){te.current&&ot.handleDragLeave(l)}function Xe(l){te.current&&ot.handleDragOver(l)}function ha(l){te.current&&ot.handleDrop(l)}Sl(Ne);let ut=c(()=>y()?.tabs?.find(l=>l.id===y().activeTabId)??null),ue=Z(null);const ea={ttlMs:Cr,maxInactiveTabs:vl};let Dt=Z(Sa(xn(()=>hl(ee(),y().tabs,y().activeTabId,Date.now(),ea))));function ta(l=y().tabs,T=y().activeTabId,A=Date.now()){const{currentCache:ye,nextCache:L}=xn(()=>{const ce=e(Dt);return{currentCache:ce,nextCache:bl(ce,l,T,A,ea)}});_l(ye,L)||o(Dt,L,!0)}let Ae;mt(()=>{if(ee())ta(y().tabs,y().activeTabId),Ae=y().activeTabId;else if(Ae){const l=Ae;xn(()=>{e(Dt).has(l)&&o(Dt,new Map(e(Dt)).set(l,Date.now()),!0)}),Ae=null}}),Er(()=>{const l=y().activeTabId,T=ee();if(typeof document>"u"||!e(ue))return;const A=document.activeElement;if(!(A instanceof HTMLElement)||!e(ue).contains(A))return;const ye=A.closest(".tab-content-wrapper");ye&&(!T||ye.dataset.tabId!==l)&&A.blur()}),mt(()=>{const l=ee()?y().activeTabId:null,T=ml(e(Dt),l,Date.now(),Cr,y().tabs);if(T===null)return;const A=setTimeout(()=>ta(y().tabs,l),T);return()=>clearTimeout(A)});let Ie=c(()=>y().tabs.filter(l=>e(Dt).has(l.id))),Pt=Z(!1);const ze=qn;let Oe=Z(!1),Ue=Z(!1),pe=Z(null);const ct=Br();mt(()=>{B()||(o(Oe,!1),o(Ue,!1),o(pe,null))});let ft=!1;function lt(){ft||C()||qe()?.()}function Ve(){y().pristine&&Ce.dispatch(No(w(),Ne))}function Ot(l){return l instanceof Element&&l.closest("[data-panel-empty-state]")!==null}function sa(l){Ot(l.target)||Ve(),ft=!0,queueMicrotask(()=>ft=!1),!C()&&qe()?.()}function V(l){Ot(l.target)||Ve()}function De(l){return e(ue)?Fl(l.clientX,e(ue).getBoundingClientRect(),be(),e(pe)):"center"}function _e(l){const T=Xa();return!T||l==="center"&&T.panelId===Ne||l!=="center"&&T.panelId===Ne&&y().tabs.length===1?null:{kind:"panel",targetPanelId:Ne,zone:l}}function Ft(l){if(!l.dataTransfer?.types.includes(ze))return;l.preventDefault();const T=De(l);o(Oe,Xa()!==null),o(Ue,!e(Oe)),o(pe,T,!0),e(Oe)&&wt()?.(_e(T)),l.dataTransfer&&(l.dataTransfer.dropEffect="move")}function gt(l){const T=l.relatedTarget;if(!(T&&e(ue)?.contains(T))){if(e(ue)){const A=e(ue).getBoundingClientRect();if(l.clientX>=A.left&&l.clientX<=A.right&&l.clientY>=A.top&&l.clientY<=A.bottom)return}e(Oe)&&wt()?.(null),o(Oe,!1),o(Ue,!1),o(pe,null)}}function va(){o(Oe,!1),o(pe,null),wt()?.(null);const l=Tt();l?l():(Fr(),Ce.dispatch(Zn()))}function pt(l){l.preventDefault(),l.stopPropagation();const T=Xa();if(T){const ye=e(pe)??De(l),L=_e(ye);if(va(),!L)return;Ve(),L.zone==="center"?de()?.(T.tabId,T.panelId):yt()?.(T.tabId,T.panelId,L.zone);return}Ve();const A=e(pe)??De(l);o(pe,null),o(Ue,!1);try{const ye=l.dataTransfer?.getData(ze);if(!ye)return;const{tabId:L,panelId:ce}=JSON.parse(ye);if(A==="center")ce!==Ne&&de()?.(L,ce);else{if(ce===Ne&&y().tabs.length===1)return;yt()?.(L,ce,A)}}catch{o(pe,null)}}var jt={get panel(){return y()},set panel(l){y(l),s()},get isFocused(){return C()},set isFocused(l=!1){C(l),s()},get showFocusBorder(){return We()},set showFocusBorder(l=!1){We(l),s()},get workspaceId(){return R()},set workspaceId(l){R(l),s()},get layoutId(){return w()},set layoutId(l){w(l),s()},get active(){return ee()},set active(l=!0){ee(l),s()},get availableCanvasWidth(){return S()},set availableCanvasWidth(l){S(l),s()},get isRightmostPanel(){return F()},set isRightmostPanel(l=!1){F(l),s()},get canCreateColumn(){return be()},set canCreateColumn(l=!0){be(l),s()},get contained(){return ge()},set contained(l=!1){ge(l),s()},get onFocus(){return qe()},set onFocus(l){qe(l),s()},get onTabClick(){return Be()},set onTabClick(l){Be(l),s()},get onTabClose(){return j()},set onTabClose(l){j(l),s()},get onTabReorder(){return W()},set onTabReorder(l){W(l),s()},get onCloseOtherTabs(){return ie()},set onCloseOtherTabs(l){ie(l),s()},get onCloseTabsToRight(){return Le()},set onCloseTabsToRight(l){Le(l),s()},get onCloseAllTabs(){return bt()},set onCloseAllTabs(l){bt(l),s()},get onCloseAllOthersEverywhere(){return _t()},set onCloseAllOthersEverywhere(l){_t(l),s()},get onClosePanel(){return Et()},set onClosePanel(l){Et(l),s()},get onZoomToggle(){return et()},set onZoomToggle(l){et(l),s()},get isZoomed(){return Se()},set isZoomed(l=!1){Se(l),s()},get onTabDrop(){return yt()},set onTabDrop(l){yt(l),s()},get onTabMoveToPanel(){return de()},set onTabMoveToPanel(l){de(l),s()},get onPaneDropPreview(){return wt()},set onPaneDropPreview(l){wt(l),s()},get onPaneDragFinish(){return Tt()},set onPaneDragFinish(l){Tt(l),s()},get onMovePaneUp(){return Bt()},set onMovePaneUp(l){Bt(l),s()},get onMovePaneDown(){return Yt()},set onMovePaneDown(l){Yt(l),s()},get onMovePaneLeft(){return Jt()},set onMovePaneLeft(l){Jt(l),s()},get onMovePaneRight(){return pa()},set onMovePaneRight(l){pa(l),s()},get onMoveLeft(){return oa()},set onMoveLeft(l){oa(l),s()},get onMoveRight(){return la()},set onMoveRight(l){la(l),s()},get onTabRename(){return ia()},set onTabRename(l){ia(l),s()},get onCreateAgent(){return Zt()},set onCreateAgent(l){Zt(l),s()},get onCreateAgentWithSpecialist(){return kt()},set onCreateAgentWithSpecialist(l){kt(l),s()},get onCreateNote(){return Qt()},set onCreateNote(l){Qt(l),s()},get onCreateTerminal(){return He()},set onCreateTerminal(l){He(l),s()},get onOpenBrowser(){return tt()},set onOpenBrowser(l){tt(l),s()},get emptyState(){return re()},set emptyState(l){re(l),s()},get onSplitHorizontal(){return Ge()},set onSplitHorizontal(l){Ge(l),s()},$set:Ra,$on:(l,T)=>Wa(r,l,T)},Ea=je(),qt=k(Ea);{var da=l=>{var T=Ci();let A;var ye=le(T);Sn(ye,e(Pt)?"animation: slideDownTabBar 350ms cubic-bezier(0.33, 1, 0.68, 1) 300ms forwards; opacity: 0; transform: translateY(-100%);":"");var L=le(ye);{let Pe=c(()=>y()?.tabs),nt=c(()=>y()?.activeTabId),At=c(()=>y()?.attentionTabIds);Hr(L,{get tabs(){return e(Pe)},get activeTabId(){return e(nt)},get attentionTabIds(){return e(At)},get panelId(){return Ne},get workspaceId(){return R()},get layoutId(){return w()},get availableCanvasWidth(){return S()},get isRightmostPanel(){return F()},get isFocused(){return C()},get contentActions(){return $t.current},get onTabClick(){return Be()},get onTabClose(){return j()},get onTabReorder(){return W()},get onTabMoveToPanel(){return de()},get onPaneDragFinish(){return Tt()},get onMovePaneUp(){return Bt()},get onMovePaneDown(){return Yt()},get onMovePaneLeft(){return Jt()},get onMovePaneRight(){return pa()},get onMoveLeft(){return oa()},get onMoveRight(){return la()},get onCloseOtherTabs(){return ie()},get onCloseTabsToRight(){return Le()},get onCloseAllTabs(){return bt()},get onCloseAllOthersEverywhere(){return _t()},get onClosePanel(){return Et()},get onZoomToggle(){return et()},get isZoomed(){return Se()},get onTabRename(){return ia()},get onCreateAgent(){return Zt()},get onCreateAgentWithSpecialist(){return kt()},get onCreateNote(){return Qt()},get onCreateTerminal(){return He()},get onOpenBrowser(){return tt()},get onSplitHorizontal(){return Ge()}})}X(ye);var ce=b(ye,2),Gt=le(ce);{var Rt=Pe=>{var nt=je(),At=k(nt);Va(At,17,()=>e(Ie),ma=>ma.id,(ma,rt)=>{const ba=c(()=>ee()&&e(rt).id===y().activeTabId);var na=ki();let Fa;var Ya=le(na);{let $a=c(()=>e(rt).workspaceId??R()),La=c(()=>C()&&e(ba));yl(Ya,{get tab(){return e(rt)},get workspaceId(){return e($a)},get layoutId(){return w()},get isActive(){return e(ba)},get isPanelFocused(){return e(La)},onFocus:()=>qe()?.()})}X(na),me(()=>{Fa=Kt(na,1,"tab-content-wrapper h-full w-full svelte-iuokxa",null,Fa,{hidden:!e(ba)&&e(rt).type!=="browser","browser-background":!e(ba)&&e(rt).type==="browser"}),Fe(na,"data-tab-id",e(rt).id),Fe(na,"aria-hidden",!e(ba)),na.inert=!e(ba)}),f(ma,na)}),f(Pe,nt)},xt=Pe=>{var nt=je(),At=k(nt);ra(At,re),f(Pe,nt)},aa=Pe=>{Nr(Pe,{get workspaceId(){return R()},get panelId(){return Ne},get onCreateAgent(){return Zt()},get onCreateAgentWithSpecialist(){return kt()},get onCreateNote(){return Qt()},get onCreateTerminal(){return He()},get onOpenBrowser(){return tt()}})};I(Gt,Pe=>{y().tabs.length>0&&e(ut)?Pe(Rt):re()?Pe(xt,1):Pe(aa,-1)})}X(ce);var Ba=b(ce,2);{var Wt=Pe=>{var nt=Ii();me(At=>{Kt(nt,1,At,"svelte-iuokxa"),Fe(nt,"data-panel-legacy-tab-drop-zone",e(pe))},[()=>Oa(fa("legacy-tab-drop-destination",e(pe)))]),f(Pe,nt)};I(Ba,Pe=>{e(Ue)&&e(pe)&&Pe(Wt)})}X(T),zn(T,Pe=>o(ue,Pe),()=>e(ue)),me((Pe,nt,At)=>{A=Kt(T,1,Pe,"svelte-iuokxa",A,{"bg-sidebar":y().tabs.length===0,"bg-background":y().tabs.length>0,contained:ge()}),Fe(T,"data-panel-id",Ne),Fe(T,"data-layout-id",w()),Fe(T,"data-focused",C()),Fe(T,"data-focus-border-visible",C()&&We()),Fe(T,"data-empty-panel-shell",y().tabs.length===0?"true":void 0),Fe(T,"data-zoomed",Se()),Fe(T,"data-pristine",y().pristine===!0),Fe(T,"data-empty-panel-surface",y().pristine===!0&&y().tabs.length===0?"true":void 0),Fe(T,"aria-label",nt),Kt(ce,1,At,"svelte-iuokxa")},[()=>Oa(fa("panel group/panel relative flex flex-col h-full overflow-hidden rounded-(--panel-shell-radius) text-foreground")),()=>d.layout_panel_ariaLabel(),()=>Oa(fa("panel-content flex-1 overflow-hidden",B()&&"pointer-events-none"))]),Ia("focusin",T,lt),Qe("pointerdown",T,sa,!0),Qe("keydown",T,V,!0),Qe("dragover",T,Ft),Qe("dragleave",T,gt),Qe("drop",T,pt),Qe("dragenter",ye,Lt),Qe("dragleave",ye,p),Qe("dragover",ye,Xe),Qe("drop",ye,ha),f(l,T)};I(qt,l=>{y()&&l(da)})}f(m,Ea);var _=Ma(jt);return z(),_}Wr(["focusin"]);var zi=D("<div><div><!></div> <!></div>"),Di=D("<div><!> <!></div>");function Ri(m,r){if(new.target)return Da({component:Ri,...m});Aa(r,!0);const B=()=>Y(ha,"$sidebarWidth",w),x=()=>Y(ue,"$storedPanelSize",w),z=()=>Y(ut,"$sidebarExpandedWidth",w),y=()=>Y(ea,"$storedExpandedPanelSize",w),C=()=>Y(Xe,"$sidebarIsCollapsed",w),We=()=>Y(Dt,"$storedPanelSizeHydrated",w),R=()=>Y(ta,"$storedExpandedPanelSizeHydrated",w),[w,ee]=dn();let S=i(r,"orientation",7,"horizontal"),F=i(r,"storageKey",7,null),be=i(r,"className",7,""),ge=i(r,"handleClassName",7,""),qe=i(r,"showHandleIndicator",7,!1),Be=i(r,"resizable",7,!0),j=i(r,"active",7,!0),W=i(r,"minWidth",7,280),ie=i(r,"maxWidth",7,800),Le=i(r,"defaultWidth",7,320),bt=i(r,"resetWidth",7,void 0),_t=i(r,"restoreStoredWidth",7,!0),Et=i(r,"defaultExpandedWidth",7,600),et=i(r,"side",7,"right"),Se=i(r,"expandedStorageKey",7,null),yt=i(r,"collapseThreshold",7,null),de=i(r,"isExpanded",7,!1),wt=i(r,"minHeight",7,200),Tt=i(r,"maxHeight",7,800),Bt=i(r,"defaultHeight",7,400),Yt=i(r,"edge",7,"top"),Jt=i(r,"animateOnMount",7,!1),pa=i(r,"animationDuration",23,()=>Sr.slow.settleMs),oa=i(r,"disableWidthTransition",7,!1),la=i(r,"onWidthChange",7),ia=i(r,"onResizeStart",7),Zt=i(r,"onResize",7),kt=i(r,"onResizeEnd",7),Qt=i(r,"onResizeCancel",7),He=i(r,"resizeScrollContainer",7,null),tt=i(r,"doSkipResize",7,!1),re=i(r,"growWithDefaultWidth",7,!1),Ge=i(r,"resizeWithDefaultWidth",7,!1),Ne=i(r,"syncWithDefaultWidth",7,!1),$t=i(r,"lockRenderedWidthDuringResize",7,!1),te=i(r,"transientWidthDelta",7,0),ot=i(r,"percentageWeight",7,0),at=i(r,"usePercentage",7,void 0),Lt=i(r,"initiallyCollapsed",7,!1),p=i(r,"children",7);const Xe=nl(),ha=rl(),ut=ol(),ue=xr(F()??""),ea=xr(Se()??""),Dt=kr(F()??""),ta=kr(Se()??""),Ae=F()==="workspace-left-panel-width"||F()?.startsWith("workspace-left-panel-width:")===!0,Ie=Se()==="workspace-left-panel-expanded-width"||Se()?.startsWith("workspace-left-panel-expanded-width:")===!0,ze=Ae||Ie,Oe=F()==="workspace-left-panel-width",Ue=Se()==="workspace-left-panel-expanded-width";let pe=Z(void 0),ct=Z(void 0),ft=Le(),lt=Ge()||Ne();const Ve=c(()=>at()!==void 0?at()?1:0:Math.max(0,Math.min(1,ot())));function Ot(){return typeof window<"u"?window.innerWidth:1200}function sa(){return typeof window<"u"?window.innerHeight:800}function V(a,g){const H=g?Ot():sa();return a/H*100}function De(a,g){const H=g?Ot():sa();return a/100*H}function _e(a,g){const M=jt()>0?De(a,g):a,Ht=g?W():wt(),xa=g?ie():Tt();return M>=Ht&&M<=xa?M:null}function Ft(a){if(a&&Oe)return B();const g=x();return g===void 0?null:_e(g,a)}function gt(){if(Ue)return z();const a=y();return a===void 0?null:_e(a,!0)}function va(a,g){return e(Ve)>0?V(a,g):a}function pt(a,g,H){a&&(a==="workspace-left-panel-width"?Ce.dispatch(Hn(g)):a==="workspace-left-panel-expanded-width"?Ce.dispatch(Uo(g)):Ce.dispatch(Ko(a,va(g,H))))}function jt(){return at()!==void 0?at()?1:0:Math.max(0,Math.min(1,ot()))}function Ea(){const a=_t()?Ft(!0):null;return a!==null?a:Le()}function qt(){const a=gt();return a!==null?a:Et()}function da(){const a=Ft(!1);return a!==null?a:Bt()}let _=Z(Sa(Lt()?0:S()==="horizontal"?Ea():Le())),l=Z(null),T=Z(Sa(tt())),A=Z(Sa(S()==="horizontal"?qt():Et())),ye=Z(Sa(Lt())),L=Z(Sa(S()==="vertical"?da():Bt())),ce=Z(0),Gt=Z(0),Rt=Z(0),xt=Z(!1),aa=Z(0),Ba=Z(0),Wt=Z(0),Pe=Z(0),nt=Z(0),At=0,ma=0,rt=null;const ba=24,na=8;function Fa(){const a=e(Ve);if(a!==0){if(S()==="horizontal"){if(e(ce)>0){const g=De(e(ce),!0),M=e(_)*(1-a)+g*a;o(_,Math.max(W(),Math.min(ie(),M)),!0),F()==="workspace-left-panel-width"&&Ce.dispatch(Hn(e(_)))}if(e(Gt)>0){const g=De(e(Gt),!0),H=e(A)*(1-a)+g*a;o(A,Math.max(W(),Math.min(ie(),H)),!0)}}else if(e(Rt)>0){const g=De(e(Rt),!1),H=e(L)*(1-a)+g*a;o(L,Math.max(wt(),Math.min(Tt(),H)),!0)}}}function Ya(a){a?(e(_)>0&&o($a,e(_),!0),o(_,0)):o(_,e($a)>0?e($a):Le(),!0),o(ce,V(e(_),!0),!0)}let $a=Z(Sa(Le())),La=Z(void 0);mt(()=>{if(!_t()||Lt()||de()||S()!=="horizontal")return;const a=Oe?B():x();if(a===void 0||a===e(pe))return;const g=Oe?a:_e(a,!0);g!==null&&(ze&&C()?(o($a,g,!0),o(_,0)):o(_,g,!0),o(ce,V(e(_),!0),!0),o(pe,a,!0))}),mt(()=>{if(S()!=="horizontal")return;const a=Ue?z():y();if(a===void 0||a===e(ct))return;const g=Ue?a:_e(a,!0);g!==null&&(o(A,g,!0),o(Gt,V(e(A),!0),!0),o(ct,a,!0))}),mt(()=>{if(S()!=="vertical")return;const a=x();if(a===void 0||a===e(pe))return;const g=_e(a,!1);g!==null&&(o(L,g,!0),o(Rt,V(e(L),!1),!0),o(pe,a,!0))}),mt(()=>{const a=Le(),g=ft,H=Ge()||Ne(),M=lt;if(ft=a,lt=H,!(_t()&&H&&!M)){if(H&&!Lt()&&!de()&&S()==="horizontal"&&a!==g){const Ht=Ne()?a:e(_)+a-g;o(_,Math.max(W(),Math.min(ie(),Ht)),!0),o(ce,V(e(_),!0),!0),pt(F(),e(_),!0);return}!re()||Lt()||de()||S()!=="horizontal"||a<=g||e(_)>=a||(o(_,Math.max(W(),Math.min(ie(),a)),!0),o(ce,V(e(_),!0),!0),pt(F(),e(_),!0))}}),mt(()=>{if(!j()||!ze||S()!=="horizontal")return;const a=C();if(e(La)===void 0){o(La,a,!0);return}a!==e(La)&&(o(La,a,!0),Ya(a))}),po(()=>{_t()&&F()&&!Oe&&!We()&&Ce.dispatch(wr(F())),Se()&&!Ue&&!R()&&Ce.dispatch(wr(Se())),S()==="horizontal"&&yt()&&e(_)<yt()&&(o(ye,!0),o(_,W())),o(ce,V(e(_),!0),!0),o(Gt,V(e(A),!0),!0),o(Rt,V(e(L),!1),!0),ze&&C()&&Ya(!0)}),mt(()=>{if(j())return e(Ve)>0&&window.addEventListener("resize",Fa),()=>{window.removeEventListener("resize",Fa)}});function un(a){const g=He()?He().scrollLeft-At:0,H=et()==="left"?a-e(aa)+g:e(aa)-a-g;let M=e(Wt)+H;M=Math.max(W(),Math.min(ie(),M)),de()&&!$t()?(o(A,M,!0),o(Gt,V(M,!0),!0)):$t()||(yt()!==null?M<yt()?(o(ye,!0),o(_,W()),o(ce,V(W(),!0),!0)):(o(ye,!1),o(_,M,!0),o(ce,V(M,!0),!0)):(o(_,M,!0),o(ce,V(M,!0),!0)),F()==="workspace-left-panel-width"&&Ce.dispatch(Hn(e(_))));const Ht=$t()?M:de()?e(A):e(_);Zt()?.(e(nt),Ht),o(nt,Ht,!0)}function vn(){if(rt!==null||!He()||et()!=="left")return;const a=He().getBoundingClientRect(),g=de()?e(A):e(_);ma<a.right-ba||g>=ie()||(rt=requestAnimationFrame(()=>{if(rt=null,!e(xt)||!He())return;const H=Math.max(0,He().scrollWidth-He().clientWidth),M=Math.min(H,He().scrollLeft+na);M!==He().scrollLeft&&(He().scrollLeft=M,un(ma),vn())}))}function Ja(a){if(e(xt))if(S()==="horizontal")ma=a.clientX,un(a.clientX),vn();else{const g=Yt()==="top"?e(Ba)-a.clientY:a.clientY-e(Ba);let H=e(Pe)+g;H=Math.max(wt(),Math.min(Tt(),H)),o(L,H,!0),o(Rt,V(H,!1),!0)}}function Qa(){if(!e(xt))return;o(xt,!1),rt!==null&&cancelAnimationFrame(rt),rt=null;const a=S()==="horizontal"?$t()?e(nt):de()?e(A):e(_):e(L);kt()?.(S()==="horizontal"?e(Wt):e(Pe),a),document.body.classList.remove("panel-resizing"),document.body.style.cursor="",document.body.style.userSelect="",S()==="horizontal"?de()&&Se()?pt(Se(),e(A),!0):!de()&&F()&&pt(F(),e(_),!0):F()&&pt(F(),e(L),!1),document.removeEventListener("mousemove",Ja),document.removeEventListener("mouseup",Qa),document.removeEventListener("keydown",Ha)}function Dn(){e(xt)&&(o(xt,!1),rt!==null&&cancelAnimationFrame(rt),rt=null,S()==="horizontal"?de()?(o(A,e(Wt),!0),o(Gt,V(e(Wt),!0),!0)):(o(_,e(Wt),!0),o(ce,V(e(Wt),!0),!0)):(o(L,e(Pe),!0),o(Rt,V(e(Pe),!1),!0)),document.body.classList.remove("panel-resizing"),document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",Ja),document.removeEventListener("mouseup",Qa),document.removeEventListener("keydown",Ha),Qt()?.())}function Ha(a){a.key==="Escape"&&(a.preventDefault(),Dn())}function mn(a){j()&&(o(xt,!0),ia()?.(),document.body.classList.add("panel-resizing"),S()==="horizontal"?(o(aa,a.clientX,!0),ma=a.clientX,At=He()?.scrollLeft??0,o(Wt,Math.max(W(),Math.min(ie(),de()?e(A):e(_))),!0),o(nt,e(Wt),!0),document.body.style.cursor=et()==="left"?"col-resize":"ew-resize"):(o(Ba,a.clientY,!0),o(Pe,e(L),!0),document.body.style.cursor="ns-resize"),document.body.style.userSelect="none",document.addEventListener("mousemove",Ja),document.addEventListener("mouseup",Qa),document.addEventListener("keydown",Ha))}function en(){if(S()==="horizontal")if(de()){const a=e(A);o(A,Et()),o(Gt,V(Et(),!0),!0),Se()&&pt(Se(),e(A),!0),kt()?.(a,e(A))}else{const a=e(_),g=bt()??Le();o(_,Math.max(W(),Math.min(ie(),g)),!0),o(ye,!1),o(ce,V(e(_),!0),!0),F()&&pt(F(),e(_),!0),kt()?.(a,e(_))}else{const a=e(L);o(L,Bt()),o(Rt,V(Bt(),!1),!0),F()&&pt(F(),e(L),!1),kt()?.(a,e(L))}}function bn(a){const g=a.shiftKey?20:10;if(S()==="horizontal")if(a.key==="ArrowLeft"||a.key==="ArrowRight"){a.preventDefault();const H=a.key==="ArrowLeft"?-g:g;let M=Math.min(ie(),de()?e(A):e(_))+H;M=Math.max(W(),Math.min(ie(),M)),de()?(o(A,M,!0),o(Gt,V(M,!0),!0)):yt()!==null?M<yt()?(o(ye,!0),o(_,W()),o(ce,V(W(),!0),!0)):(o(ye,!1),o(_,M,!0),o(ce,V(M,!0),!0)):(o(_,M,!0),o(ce,V(M,!0),!0));const Ht=de()?e(A):e(_);pt(de()?Se():F(),Ht,!0)}else a.key==="Enter"&&en();else if(a.key==="ArrowUp"||a.key==="ArrowDown"){a.preventDefault();const H=a.key==="ArrowUp"?-g:g;let M=e(L)+H;M=Math.max(wt(),Math.min(Tt(),M)),o(L,M,!0),o(Rt,V(M,!1),!0)}else a.key==="Enter"&&en()}Ar(()=>{document.removeEventListener("mousemove",Ja),document.removeEventListener("mouseup",Qa),document.removeEventListener("keydown",Ha),document.body.classList.remove("panel-resizing"),document.body.style.cursor="",document.body.style.userSelect="",rt!==null&&cancelAnimationFrame(rt),e(xt)&&kt()?.(S()==="horizontal"?e(Wt):e(Pe),S()==="horizontal"?de()?e(A):e(_):e(L))});let Pa=c(()=>!de()&&e(_)===0?0:Math.max(W(),Math.min(ie(),(de()?e(A):e(_))+te()))),Rn=c(()=>e(L));Er(()=>{const a=tt();if(e(T)&&!a){const g=e(l)?.getBoundingClientRect().width??0;g>0&&(o(_,Math.max(W(),Math.min(ie(),g)),!0),o(ce,V(e(_),!0),!0))}o(T,a,!0)}),mt(()=>{const a=e(Pa);j()&&xn(()=>la()?.(a))});var _n={get orientation(){return S()},set orientation(a="horizontal"){S(a),s()},get storageKey(){return F()},set storageKey(a=null){F(a),s()},get className(){return be()},set className(a=""){be(a),s()},get handleClassName(){return ge()},set handleClassName(a=""){ge(a),s()},get showHandleIndicator(){return qe()},set showHandleIndicator(a=!1){qe(a),s()},get resizable(){return Be()},set resizable(a=!0){Be(a),s()},get active(){return j()},set active(a=!0){j(a),s()},get minWidth(){return W()},set minWidth(a=280){W(a),s()},get maxWidth(){return ie()},set maxWidth(a=800){ie(a),s()},get defaultWidth(){return Le()},set defaultWidth(a=320){Le(a),s()},get resetWidth(){return bt()},set resetWidth(a=void 0){bt(a),s()},get restoreStoredWidth(){return _t()},set restoreStoredWidth(a=!0){_t(a),s()},get defaultExpandedWidth(){return Et()},set defaultExpandedWidth(a=600){Et(a),s()},get side(){return et()},set side(a="right"){et(a),s()},get expandedStorageKey(){return Se()},set expandedStorageKey(a=null){Se(a),s()},get collapseThreshold(){return yt()},set collapseThreshold(a=null){yt(a),s()},get isExpanded(){return de()},set isExpanded(a=!1){de(a),s()},get minHeight(){return wt()},set minHeight(a=200){wt(a),s()},get maxHeight(){return Tt()},set maxHeight(a=800){Tt(a),s()},get defaultHeight(){return Bt()},set defaultHeight(a=400){Bt(a),s()},get edge(){return Yt()},set edge(a="top"){Yt(a),s()},get animateOnMount(){return Jt()},set animateOnMount(a=!1){Jt(a),s()},get animationDuration(){return pa()},set animationDuration(a=Sr.slow.settleMs){pa(a),s()},get disableWidthTransition(){return oa()},set disableWidthTransition(a=!1){oa(a),s()},get onWidthChange(){return la()},set onWidthChange(a){la(a),s()},get onResizeStart(){return ia()},set onResizeStart(a){ia(a),s()},get onResize(){return Zt()},set onResize(a){Zt(a),s()},get onResizeEnd(){return kt()},set onResizeEnd(a){kt(a),s()},get onResizeCancel(){return Qt()},set onResizeCancel(a){Qt(a),s()},get resizeScrollContainer(){return He()},set resizeScrollContainer(a=null){He(a),s()},get doSkipResize(){return tt()},set doSkipResize(a=!1){tt(a),s()},get growWithDefaultWidth(){return re()},set growWithDefaultWidth(a=!1){re(a),s()},get resizeWithDefaultWidth(){return Ge()},set resizeWithDefaultWidth(a=!1){Ge(a),s()},get syncWithDefaultWidth(){return Ne()},set syncWithDefaultWidth(a=!1){Ne(a),s()},get lockRenderedWidthDuringResize(){return $t()},set lockRenderedWidthDuringResize(a=!1){$t(a),s()},get transientWidthDelta(){return te()},set transientWidthDelta(a=0){te(a),s()},get percentageWeight(){return ot()},set percentageWeight(a=0){ot(a),s()},get usePercentage(){return at()},set usePercentage(a=void 0){at(a),s()},get initiallyCollapsed(){return Lt()},set initiallyCollapsed(a=!1){Lt(a),s()},get children(){return p()},set children(a){p(a),s()},$set:Ra,$on:(a,g)=>Wa(r,a,g)},yn=je(),tn=k(yn);{var Mt=a=>{var g=zi(),H=le(g),M=le(H);ra(M,()=>p()??Ca,()=>({isCollapsed:e(ye)})),X(H);var Ht=b(H,2);{var xa=ka=>{{let cn=c(()=>et()==="left"?"-right-2":"-left-2"),Na=c(ge),fn=c(()=>qe()?"short":void 0),Wn=c(()=>d.layout_resizable_resizePanel_ariaLabel()),an=c(()=>d.layout_resizable_dragToResize_tooltip());ga(ka,{variant:"ghost",type:"button",get class(){return`absolute top-0 ${e(cn)??""} app-resize-handle resizable-panel-handle h-full w-4 z-30 ${e(Na)??""}`},"data-resize-axis":"x",get"data-resize-indicator"(){return e(fn)},get"data-resizing"(){return e(xt)},onmousedown:mn,ondblclick:en,onkeydown:bn,tabindex:0,get"aria-label"(){return e(Wn)},get tooltip(){return e(an)}})}};I(Ht,ka=>{Be()&&!tt()&&ka(xa)})}X(g),zn(g,ka=>o(l,ka),()=>e(l)),me(()=>{Kt(g,1,`relative shrink-0 ${e(xt)||oa()?"":"transition-[width,min-width,max-width] mx-auto duration-spring-slow ease-spring-slow motion-reduce:transition-none"} ${!tt()&&e(Pa)===0?"overflow-hidden":""} ${be()??""}`),Sn(g,tt()?"width: 100%;":`width: ${e(Pa)}px; min-width: ${e(Pa)===0?0:W()}px; max-width: ${ie()}px;`),Kt(H,1,`h-full min-h-0 transition-opacity duration-spring-slow ease-spring-slow motion-reduce:transition-none ${!tt()&&e(Pa)===0?"opacity-0":"opacity-100"}`)}),zl(3,g,()=>Dl,()=>({axis:"x",distance:Jt()?et()==="right"?e(Pa):-e(Pa):0,tier:"slow"})),f(a,g)},it=a=>{var g=Di(),H=le(g);{var M=xa=>{{let ka=c(()=>Yt()==="top"?"absolute -top-2":"absolute -bottom-2"),cn=c(ge),Na=c(()=>d.layout_resizable_resizePanelHeight_ariaLabel()),fn=c(()=>d.layout_resizable_dragToResizeHeight_tooltip());ga(xa,{variant:"ghost",type:"button",get class(){return`${e(ka)??""} app-resize-handle resizable-panel-handle left-0 right-0 h-4 z-30 ${e(cn)??""}`},"data-resize-axis":"y",get"data-resizing"(){return e(xt)},onmousedown:mn,ondblclick:en,onkeydown:bn,tabindex:0,get"aria-label"(){return e(Na)},get tooltip(){return e(fn)}})}};I(H,xa=>{Be()&&!tt()&&xa(M)})}var Ht=b(H,2);ra(Ht,()=>p()??Ca),X(g),me(()=>{Kt(g,1,`relative flex flex-col ${e(xt)?"":"transition-[height] duration-spring-moderate ease-spring-moderate motion-reduce:transition-none"} ${be()??""}`),Sn(g,tt()?"":`height: ${e(Rn)}px; min-height: ${wt()}px; max-height: ${Tt()}px;`)}),f(a,g)};I(tn,a=>{S()==="horizontal"?a(Mt):a(it,-1)})}f(m,yn);var st=Ma(_n);return ee(),st}export{Lr as D,Si as P,Ri as R,Bl as S,Gn as a,Xn as b,Fr as c,Fl as d,Ws as e,Rs as f,Xa as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as y,e as I,s as S,g as A}from"./
|
|
1
|
+
import{o as y,e as I,s as S,g as A}from"./7KxcPj98.js";function U(){return!0}const o=new Date().toISOString(),d=[{id:"mock-ws-1",title:"Example Project",branch:"feature/demo",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/example",repositoryOwner:"demo",repositoryName:"example-project",tags:[],agentSummary:{agentIds:["agent-1"]}},{id:"mock-ws-2",title:"Design System",branch:"feature/tokens",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/design-system",repositoryOwner:"demo",repositoryName:"design-system",tags:[]}],g=[{path:"workspaceInitializer.state",label:"Workspace initializer state",description:"Browser-preview workspace initializer state.",category:"workspace",type:"object",defaultValue:{},value:{hydrated:!0}},{path:"hardwareConsole.state",label:"Hardware console state",description:"Browser-preview hardware console state.",category:"hardwareConsole",type:"object",defaultValue:{},value:{}},{path:"rtk.enabled",label:"RTK enabled",description:"Use RTK compressed command output.",category:"tools",type:"boolean",defaultValue:!1,value:!1,origin:"default"}];let l=0;function C(t){const e=g.find(a=>a.path===t);if(!e)return m("INVALID_PARAMS",-32602,`Browser mock: setting "${String(t)}" not found`);const{value:r,origin:s,...i}=e;return{path:e.path,value:r,definition:i,...s?{origin:s}:{},revision:l}}function M(t){return Array.isArray(t)?Object.fromEntries(t.filter(e=>typeof e=="string").map(e=>[e,{available:!1}])):{}}let w=0,B=0;const R=crypto.randomUUID(),p=Symbol("browser-mock-error");function m(t,e,r){return{[p]:{code:t,message:r,data:{code:t},rpcCode:e}}}function T(t){return typeof t=="object"&&t!==null&&p in t}function W(t,e){if(t==="workspace.list")return{workspaces:d};if(t==="workspace.get"){const r=d.find(s=>s.id===e?.workspaceId);return r?{workspace:r}:m("INVALID_PARAMS",-32602,`Browser mock: workspace "${String(e?.workspaceId)}" not found`)}if(t==="task.listAgentLinks")return{links:[],linksByNoteId:{}};if(t==="workspace.getTokenUsage")return{tokenUsage:{byAgentId:{},totals:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0},byModel:{},byAgentModel:[],lastScanAt:null}};if(t==="workspace.getContext")return{items:[]};if(t==="script.list")return{scripts:[]};if(t==="terminal.list")return{terminals:[],daemonBootId:R};if(t==="terminal.create")return{terminalId:`browser-mock-terminal-${++B}`};if(t==="terminal.write"||t==="terminal.resize"||t==="terminal.kill")return{ok:!0};if(t==="terminal.getBuffer")return{terminalId:String(e?.terminalId??""),data:""};if(t==="terminal.readOutput")return"";if(t==="agent.listActive")return{streams:[]};if(t==="prMonitor.list")return{monitors:[]};if(t==="gitRoot.list")return{gitRoots:[]};if(t==="file.tree")return[];if(t==="file-tracking.getChanges")return{changes:[],truncated:!1,totalCount:0};if(t==="file-tracking.loadCommits")return{commits:[],boundarySha:null,nextToken:null};if(t==="repo.list")return{repos:[]};if(t==="settings.list")return{settings:g,revision:l};if(t==="settings.get")return C(e?.path);if(t==="settings.update"){const r=Array.isArray(e?.changes)?e.changes:[],s=[];for(const i of r){if(typeof i!="object"||i===null)continue;const{path:a,value:c}=i,u=g.find(v=>v.path===a);u&&(u.value=c,s.push({path:u.path,value:c,...u.origin?{origin:u.origin}:{}}))}return s.length>0&&(l+=1),{applied:s,revision:l}}if(t==="host.checkAuggie"||t==="host.findBinary")return{available:!1};if(t==="host.toolAvailability")return{tools:M(e?.tools)};if(t==="host.providerAuthStatus")return{providers:[]};if(t==="host.providerDiscovery")return{providers:[]};if(t==="system.status")return{running:!0,listenMode:"browser-mock",version:"0.0.0-browser",protocolVersion:"0.0.0-browser",host:{os:"browser",arch:"browser",locality:"local"}};if(t==="agent.list")return{agents:[],retiredCount:0};if(t==="agent.listInterrupted")return{agents:[]};if(t==="models.list")return{models:[]};if(t==="skill.list")return{skills:[]};if(t==="search.fileNames")return{files:[]};if(t==="comment.list")return{threads:[]};if(t==="task.list")return{tasks:[],stats:{total:0,completed:0,inProgress:0}};if(t==="note.list")return{notes:[]};if(t==="git.status")return{branch:"",ahead:0,behind:0,diverged:!1,files:[],hasUncommittedChanges:!1,hasUntrackedFiles:!1};if(t==="event.query")return e?.paginate===!0||typeof e?.nextToken=="string"?{items:[],nextToken:null}:[];if(t==="events.subscribe")return{subscriptionId:`browser-mock-sub-${++w}`};if(t==="events.unsubscribe")return{}}function O(t,e){if(t==="backend:request"){const r=e?.method;if(typeof r!="string"||r.length===0)return{ok:!1,error:{code:"INVALID_PARAMS",message:"method is required"}};const s=W(r,e?.params);return T(s)?{ok:!1,error:s[p]}:s!==void 0?{ok:!0,result:s}:{ok:!1,error:{code:"NOT_IMPLEMENTED",message:`Browser mock: backend method "${r}" not implemented`}}}if(t==="backend:subscribe")return{ok:!0,result:{subscriptionId:`browser-mock-sub-${++w}`}};if(t==="backend:unsubscribe")return{ok:!0,result:{}};if(t==="backend:get-status"){const r=A();if(r)return{status:r.getStatus(),daemonStartup:r.getStartupState(),transport:{mode:"external-ws",target:r.getTarget()}};const s=I();return s?{status:"connecting",transport:{mode:"external-ws",target:S(s)}}:{status:"connected",transport:"browser-mock"}}}function P(t,e){const r=O(t,e);return r!==void 0?r:t==="workspace:list"?{success:!0,data:d}:t==="workspace:get-recent-repositories"?{success:!0,data:[]}:t==="workspace:get-settings"||t==="workspace:getSettings"?{success:!0,data:{}}:t==="app:version"||t==="app:get-version"?{success:!0,data:"0.0.0-browser"}:t==="system:get-info"?{success:!0,data:{platform:"browser",arch:"wasm",hostname:"localhost"}}:t==="providers:get-models"?{success:!0,data:[]}:t==="providers:get-availability"?{success:!0,data:{}}:t==="providers:get-paths"?{success:!0,data:{}}:t==="feature-codes:get-active"?{features:[]}:t==="config:get"||t==="config:get-all"||t==="config:getAll"?{success:!0,data:{}}:t==="settings:get"||t==="settings:getAll"?{success:!0,data:{}}:t==="auto-update:get-state"?{success:!0,data:{channel:"stable",status:"idle"}}:t.startsWith("window:")?{success:!0}:t==="panel-layout:load"?{success:!0,data:null}:t==="first-visit-state:load"?{success:!0,data:null}:t==="rules:list"||t==="rules:load-workspace"?{success:!0,data:[]}:t.startsWith("specialists:")?{success:!0,data:[]}:t.startsWith("user-rules:")?{success:!0,data:t.includes("get-all")?[]:""}:t.startsWith("git:")?{success:!0,data:null}:t.startsWith("persistence:")||t.startsWith("storage:")?{success:!0,data:null}:t.startsWith("notes:")?{success:!0,data:t.includes("list")?[]:null}:t.startsWith("agent:")?{success:!0,data:null}:t.startsWith("log:")?{success:!0,data:null}:t.startsWith("user-mcp:")||t.startsWith("mcp:")?{success:!0,data:t.includes("list")?[]:null}:t==="skills:list"?{success:!0,data:[]}:t.includes("-auth:")||t.includes("auth:")?{success:!0,data:{authenticated:!1}}:t.startsWith("dialog:")?{success:!0,data:{canceled:!0,filePaths:[]}}:(console.debug(`[BrowserMock] Unhandled IPC channel: ${t}`),{success:!1,error:`Browser mock: channel "${t}" not implemented`})}const n=[];function f(t,e){for(const r of[...n])r.channel===t&&r.callback(e)}let k=0;const x={invoke:async(t,e)=>(console.warn(`[BrowserMock] Serving MOCK response for IPC channel '${t}' — this is dev-only mock data, not a real bridge`),P(t,e)),send:(t,...e)=>{},on:(t,e)=>{const r=`browser-mock-${++k}`;return n.push({id:r,channel:t,callback:e}),r},off:(t,e)=>{},offById:(t,e)=>{const r=n.findIndex(s=>s.id===e);r!==-1&&n.splice(r,1)},removeAllListeners:t=>{for(let e=n.length-1;e>=0;e--)n[e].channel===t&&n.splice(e,1)},once:(t,e)=>{const r=`browser-mock-${++k}`,s=(...i)=>{e(...i);const a=n.findIndex(c=>c.id===r);a!==-1&&n.splice(a,1)};n.push({id:r,channel:t,callback:s})},getPathForFile:t=>"",platform:"darwin",arch:"arm64",versions:{node:"20.0.0",chrome:"120.0.0",electron:"0.0.0-browser"}};function D(){return typeof window>"u"||window.electronAPI?!1:(console.warn("[BrowserMock] Installing mock electronAPI for browser-mode rendering — all IPC responses are DEV MOCKS"),window.electronAPI=x,_(),!0)}let b=!1;function _(){if(b)return;b=!0;let t=null,e=null,r=null;y(s=>{t?.(),e?.(),r?.(),t=s.onStatusChange(i=>{f("backend:status",{status:i,daemonStartup:s.getStartupState(),transport:{mode:"external-ws",target:s.getTarget()}})}),r=s.onStartupChange(i=>{f("backend:status",{status:s.getStatus(),daemonStartup:i,transport:{mode:"external-ws",target:s.getTarget()}})}),e=s.onReconnected(()=>{f("backend:status",{status:"connected",reconnected:!0,transport:{mode:"external-ws",target:s.getTarget()}})})})}D();export{D as installBrowserMock,U as isBrowserMockEnabled};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{K as jt}from"./
|
|
1
|
+
import{K as jt}from"./COflq_3N.js";import{U as Ut}from"./CIWky03S.js";import{bI as Mt,aD as s,aG as zt,bH as Ie,bV as Me,bs as dt,ca as _t,c0 as Ht,a5 as j,bS as u,bl as F,bA as U,b_ as v,bO as l,aw as Kt,W as n,bn as pt,c9 as y,aA as T,aB as N,b$ as L,bf as ee,a7 as V,ay as w,be as De,am as Fe,ax as Ee}from"./3SdAC2_C.js";import{t as vt,bo as O,bm as _,bw as ut,b as ct,bs as Ze,bq as qt}from"./Dws-34a7.js";import{i as I}from"./DLCFUd4s.js";import{s as je,f as Ue,g as Be}from"./BD9db4FR.js";import{b as Yt}from"./Dn334wJv.js";import{A as Gt,c as $t}from"./BHEogMS0.js";import{k as et}from"./5-0LQoqd.js";import{t as tt}from"./D-rRuAXZ.js";import{n as se,b as at,j as ge}from"./Bc1vJq_Z.js";import{F as Vt,bo as Xt,aN as Jt,cK as Qt,cn as Zt}from"./CGYPBD6G.js";import{m as ea}from"./rXKOJqUt.js";import{f as Le}from"./BIGqOuh0.js";import"./BPuz5cN_.js";import{T as rt}from"./BV1ayWTC.js";import"./ChTqQfQN.js";import"./DcOkWaeN.js";import"./4g_iHoQm.js";import{q as ta,h as aa,S as ra}from"./ClNMpui4.js";import{O as We}from"./BmF8Qq3w.js";import{bd as na,D as sa,q as oa}from"./BupDQr_B.js";import{d as ia}from"./BGspyNwk.js";import{s as la,f as da,c as nt}from"./DuAAGnM9.js";function ar(M){let b=0,E=!1;function Q(x){E!==x&&(E=x,M.onDragChange(x))}function Z(){b=0,Q(!1)}function X(x){return M.isEnabled&&!M.isEnabled()?!1:jt(x)}return{handleDragEnter(x){X(x)&&(x.preventDefault(),b++,Q(!0))},handleDragLeave(x){X(x)&&(x.preventDefault(),b=Math.max(0,b-1),b===0&&Q(!1))},handleDragOver(x){X(x)&&x.preventDefault()},handleDrop(x){if(!X(x))return;x.preventDefault(),Z();const G=Ut(x.dataTransfer);(G.files.length>0||G.folderFiles.length>0)&&M.onDrop(G)},reset:Z}}const gt=Symbol("panel-file-drop-context");function rr(){let M=Me(null);const b={register(E){Ie(M,E)},unregister(E){s(M)===E&&Ie(M,null)}};return Mt(gt,b),{context:b,handler:{get current(){return s(M)}}}}function nr(){return zt(gt)??null}var _a=N('<p class="type-caption text-subtle"> </p>'),pa=N('<div class="space-y-1" data-remote-setup-log=""><!> <pre role="log" tabindex="0"> </pre></div>');function va(M,b){if(new.target)return vt({component:va,...M});dt(b,!0);let E=O(b,"machine",7),Q=O(b,"output",7),Z=O(b,"truncated",7,!1);const X=y(()=>Gt({chunks:[{text:Q()??"",timestamp:""}]}).join(`
|
|
2
2
|
`));let x=Me(null),G=!0;function $(){s(x)&&(G=s(x).scrollHeight-s(x).scrollTop-s(x).clientHeight<8)}_t(()=>{s(X),!(!s(x)||!G)&&Ht().then(()=>{s(x)&&(s(x).scrollTop=s(x).scrollHeight)})});var oe={get machine(){return E()},set machine(R){E(R),T()},get output(){return Q()},set output(R){Q(R),T()},get truncated(){return Z()},set truncated(R=!1){Z(R),T()},$set:ut,$on:(R,J)=>ct(b,R,J)},H=pa(),te=j(H);{var ae=R=>{var J=_a(),W=F(J,!0);v(re=>l(W,re),[()=>_.remoteAgent_setup_outputTruncated()]),n(R,J)};I(te,R=>{Z()&&R(ae)})}var q=u(te,2),pe=F(q,!0);return Yt(q,R=>Ie(x,R),()=>s(x)),U(H),v((R,J)=>{je(q,"aria-label",R),Ue(q,1,`max-h-60 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/60 px-3 py-2 font-mono text-xs ${s(X)?"text-foreground":"text-subtle"} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`),l(pe,J)},[()=>_.remoteAgent_setup_outputLabel({machine:E()}),()=>s(X)||_.remoteAgent_setup_noOutput()]),Kt("scroll",q,$),n(M,H),pt(oe)}var ua=N('<span class="inline-flex items-center gap-1.5 svelte-enden2"> </span>'),ca=N('<h3 class="text-lg font-semibold tracking-[-0.016em] transition-colors duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2"><!></h3>'),ga=N('<span class="inline-block col-span-1 row-span-1 svelte-enden2"> </span>'),fa=N('<span class="text-sm font-mono text-muted-foreground tabular-nums svelte-enden2"><span class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></span> </span>'),ma=N('<div class="absolute inset-0 left-5 svelte-enden2"><!></div>'),st=N('<div class="svelte-enden2"><!></div>'),ba=N('<div class="relative flex items-start overflow-hidden rounded-md py-0.75 text-base leading-relaxed svelte-enden2"><!> <span data-testid="workspace-setup-step-icon"><!></span> <div class="setup-step-content min-w-0 text-muted-foreground font-normal leading-snug relative z-10 svelte-enden2" data-testid="workspace-setup-step-content"><!></div></div>'),xa=N('<div class="mt-1 text-xs tabular-nums svelte-enden2" data-testid="setup-card-progress-transfer"> </div>'),ha=N('<span data-testid="setup-card-progress-label" class="svelte-enden2"> </span> <div class="mt-1 h-[2px] w-full max-w-64 rounded-full bg-secondary overflow-hidden svelte-enden2"><div class="h-full bg-foreground/60 transition-[width] duration-spring-slow ease-spring-slow motion-reduce:transition-none svelte-enden2" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-testid="setup-card-progress-bar"></div></div> <!>',1),fe=N(" <!>",1),Ca=N('<span data-testid="setup-card-plain-folder" class="svelte-enden2"> <!> </span>'),wa=N(' <code class="text-sm bg-secondary py-1 px-1.5 svelte-enden2"> </code> <!>',1),ot=N(" <!> <!>",1),Sa=N(' <span class="svelte-enden2"> </span> ',1),ya=N(' <span class="svelte-enden2"> </span> <!>',1),ka=N('<span class="underline underline-offset-2 svelte-enden2"> </span><span class="whitespace-nowrap svelte-enden2"><span class="underline underline-offset-2 svelte-enden2"> </span><span class="setup-reference-punctuation svelte-enden2" aria-hidden="true"> </span></span>',1),Pa=N("<!> ",1),it=N('<span class="svelte-enden2"> </span>'),_e=N(" <!> ",1),Da=N('<pre class="text-xs text-muted-foreground font-mono leading-snug line-clamp-2 whitespace-pre-wrap svelte-enden2"> </pre>'),lt=N('<span class="text-xs text-muted-foreground opacity-50 svelte-enden2"> </span>'),Ia=N(" <!> <!> ",1),Na=N('<p class="text-xs text-muted-foreground leading-snug svelte-enden2"> </p>'),Ta=N('<div><div class="flex items-baseline gap-2.5 pt-3 pb-2 svelte-enden2"><div class="inline-grid *:[grid-area:1/1] svelte-enden2"><!></div> <!></div> <div class="space-y-0.5 pb-4 svelte-enden2"><!> <!> <!> <!></div></div>');function Oa(M,b){if(new.target)return vt({component:Oa,...M});dt(b,!0);const E=()=>Ze(ft,"$progressEntry$",Z),Q=()=>Ze(mt,"$specialists$",Z),[Z,X]=qt();let x=O(b,"repoName",7),G=O(b,"repoPath",7),$=O(b,"worktreePath",7),oe=O(b,"workspaceId",7),H=O(b,"branch",7),te=O(b,"baseRef",7,"origin/main"),ae=O(b,"projectType",7),q=O(b,"setupScriptStatus",7),pe=O(b,"setupScriptContent",7),R=O(b,"onFocusSetupTerminal",7),J=O(b,"specialistName",7),W=O(b,"specialistId",7),re=O(b,"hasPrompt",7,!0),ve=O(b,"repoStatus",7,"pending"),me=O(b,"branchStatus",7,"pending"),be=O(b,"agentStatus",7,"pending"),ie=O(b,"skipIsolation",7,!1),ue=O(b,"plainFolder",7,!1),Ne=O(b,"progressId",7);const ft=la(Ne()??""),mt=na();let xe=Me(0);_t(()=>{const d=Math.min(E()?.percent??0,100);d>s(xe)&&Ie(xe,d,!0)});const bt=y(()=>E()?.sawFrame===!0),ze=y(()=>E()?.transfer?$t(E().transfer):null),xt=y(()=>te().replace(/^[^/]+\//,"")),Te=y(()=>W()?oa(W()):void 0),ht=y(()=>W()?Q().find(d=>d.id===W()):void 0),Ct=y(()=>s(ht)?.name||s(Te)?.name||J()),He=y(()=>W()==="spec-writer"||W()===sa),Ke=y(()=>{const d=ue()?[ve()]:[ve(),me()];return q()&&d.push(q()),d.push(be()),d}),Oe=y(()=>s(Ke).length),qe=y(()=>s(Ke).filter(d=>d==="done").length),Ye=y(()=>Math.min(s(qe)+1,s(Oe))),ye=y(()=>s(qe)===s(Oe)),Ge=y(()=>s(ye)?_.onboarding_setupCard_ready_title():_.onboarding_setupCard_settingUp_title());function wt(d,B){navigator.clipboard.writeText(d),ea.success(_.onboarding_setupCard_copied_label({label:B}))}function Ae(d){return d.replace(/^\/Users\/[^/]+/,"~")}function St(){W()&&ia({specialist:W(),hash:"specialists"})}var yt={get repoName(){return x()},set repoName(d){x(d),T()},get repoPath(){return G()},set repoPath(d){G(d),T()},get worktreePath(){return $()},set worktreePath(d){$(d),T()},get workspaceId(){return oe()},set workspaceId(d){oe(d),T()},get branch(){return H()},set branch(d){H(d),T()},get baseRef(){return te()},set baseRef(d="origin/main"){te(d),T()},get projectType(){return ae()},set projectType(d){ae(d),T()},get setupScriptStatus(){return q()},set setupScriptStatus(d){q(d),T()},get setupScriptContent(){return pe()},set setupScriptContent(d){pe(d),T()},get onFocusSetupTerminal(){return R()},set onFocusSetupTerminal(d){R(d),T()},get specialistName(){return J()},set specialistName(d){J(d),T()},get specialistId(){return W()},set specialistId(d){W(d),T()},get hasPrompt(){return re()},set hasPrompt(d=!0){re(d),T()},get repoStatus(){return ve()},set repoStatus(d="pending"){ve(d),T()},get branchStatus(){return me()},set branchStatus(d="pending"){me(d),T()},get agentStatus(){return be()},set agentStatus(d="pending"){be(d),T()},get skipIsolation(){return ie()},set skipIsolation(d=!1){ie(d),T()},get plainFolder(){return ue()},set plainFolder(d=!1){ue(d),T()},get progressId(){return Ne()},set progressId(d){Ne(d),T()},$set:ut,$on:(d,B)=>ct(b,d,B)},ke=Ta(),Pe=j(ke);Be(Pe,"",{},{"padding-inline":"var(--operational-row-inline-padding)"});var Re=j(Pe),kt=j(Re);et(kt,()=>s(ye),d=>{var B=ca(),le=j(B);{var he=Y=>{var z=ua(),we=F(z,!0);v(()=>l(we,s(Ge))),n(Y,z)},Ce=Y=>{var z=L();v(()=>l(z,s(Ge))),n(Y,z)};I(le,Y=>{s(ye)?Y(he):Y(Ce,-1)})}U(B),se(1,B,()=>at,()=>({tier:"slow",distance:3})),se(2,B,()=>at,()=>({tier:"slow",distance:3})),n(d,B)}),U(Re);var Pt=u(Re,2);{var Dt=d=>{var B=fa(),le=j(B),he=j(le);et(he,()=>s(Ye),Y=>{var z=ga(),we=F(z,!0);v(()=>l(we,s(Ye))),se(1,z,()=>ge,()=>({axis:"y",tier:"slow"})),n(Y,z)}),U(le);var Ce=u(le);U(B),v(()=>l(Ce,`/${s(Oe)??""}`)),n(d,B)};I(Pt,d=>{s(ye)||d(Dt)})}U(Pe);var $e=u(Pe,2);{const d=(f,h=ee,P=ee,D=ee,S=ee,C=ee)=>{var o=ba();Be(o,"",{},{gap:"0.25rem","padding-inline":"var(--operational-row-inline-padding)"});var t=j(o);{var e=m=>{var k=ma(),A=j(k);ra(A,{}),U(k),n(m,k)};I(t,m=>{h()==="active"&&m(e)})}var a=u(t,2),r=j(a);Vt(r,{get icon(){return P()},size:14,get class(){return D()}}),U(a);var i=u(a,2),c=j(i);{var g=m=>{var k=st(),A=j(k);tt(A,S),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)},p=m=>{var k=st(),A=j(k);tt(A,C),U(k),se(1,k,()=>ge,()=>({axis:"y",tier:"moderate"})),se(2,k,()=>ge,()=>({axis:"y",tier:"moderate"})),n(m,k)};I(c,m=>{h()==="active"?m(g):m(p,-1)})}U(i),U(o),v(()=>Ue(a,1,`${aa} relative z-10 mt-1 flex size-4 shrink-0 items-center justify-start`,"svelte-enden2")),se(3,o,()=>ge,()=>({tier:"slow"})),n(f,o)},B=(f,h)=>{let P=Fe(()=>Ee(h?.(),""));var D=V(),S=w(D);{var C=t=>{{let e=y(()=>_.onboarding_setupCard_originalFolder_label());z(t,x,()=>s(e),G,()=>s(P))}},o=t=>{var e=L();v(()=>l(e,`${x()??""}${s(P)??""}`)),n(t,e)};I(S,t=>{G()?t(C):t(o,-1)})}n(f,D)},le=f=>{var h=V(),P=w(h);{var D=o=>{var t=ha(),e=w(t),a=F(e,!0),r=u(e,2),i=F(r),c=u(r,2);{var g=p=>{var m=xa(),k=F(m,!0);v(()=>l(k,s(ze))),n(p,m)};I(c,p=>{s(ze)&&p(g)})}v((p,m)=>{l(a,p),Be(i,`width: ${s(xe)??""}%`),je(i,"aria-label",m),je(i,"aria-valuenow",s(xe))},[()=>_.workspace_compactInitializer_progressWithPercent_label({label:nt(E()),percent:da(s(xe))}),()=>nt(E())]),n(o,t)},S=o=>{var t=fe(),e=w(t),a=u(e);{let r=y(()=>_.onboarding_setupCard_opening_after());B(a,()=>s(r))}v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_opening_before()]),n(o,t)},C=o=>{var t=fe(),e=w(t),a=u(e);B(a),v(r=>l(e,`${r??""} `),[()=>_.onboarding_setupCard_creatingIsolatedCopy_before()]),n(o,t)};I(P,o=>{s(bt)&&E()?o(D):ie()||ue()?o(S,1):o(C,-1)})}n(f,h)},he=f=>{var h=V(),P=w(h);{var D=o=>{const t=y(()=>$()||G());var e=Ca(),a=j(e),r=u(a);{var i=p=>{We(p,{get filePath(){return s(t)},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(m,k)=>{{let A=y(()=>Ae(s(t)));Y(m,()=>s(A),()=>".")}},$$slots:{default:!0}})},c=p=>{var m=L();v(()=>l(m,`${x()??""}.`)),n(p,m)};I(r,p=>{s(t)?p(i):p(c,-1)})}var g=u(r);U(e),v((p,m)=>{l(a,`${p??""} `),l(g,` ${m??""}`)},[()=>_.onboarding_setupCard_workingInFolder_before(),()=>_.onboarding_setupCard_plainFolderInPlace_label()]),n(o,e)},S=o=>{var t=wa(),e=w(t),a=u(e),r=F(a,!0),i=u(a,2);{var c=p=>{var m=fe(),k=w(m),A=u(k);We(A,{get filePath(){return $()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(K,de)=>{{let ne=y(()=>Ae($()));Y(K,()=>s(ne),()=>".")}},$$slots:{default:!0}}),v(K=>l(k,` ${K??""} `),[()=>_.onboarding_setupCard_at_label()]),n(p,m)},g=p=>{var m=L(".");n(p,m)};I(i,p=>{$()?p(c):p(g,-1)})}v(p=>{l(e,`${p??""} `),l(r,s(xt))},[()=>_.onboarding_setupCard_workingDirectlyOn_before()]),n(o,t)},C=o=>{var t=ot(),e=w(t),a=u(e);B(a);var r=u(a,2);{var i=g=>{var p=fe(),m=w(p),k=u(m);We(k,{get filePath(){return $()},get workspaceId(){return oe()},isDirectory:!0,variant:"sidebar",compact:!0,inline:!0,class:"setup-path",children:(A,K)=>{{let de=y(()=>Ae($()));Y(A,()=>s(de),()=>".")}},$$slots:{default:!0}}),v(A=>l(m,` ${A??""} `),[()=>_.onboarding_setupCard_at_label()]),n(g,p)},c=g=>{var p=L(".");n(g,p)};I(r,g=>{$()?g(i):g(c,-1)})}v(g=>l(e,`${g??""} `),[()=>_.onboarding_setupCard_createdIsolatedCopy_before()]),n(o,t)};I(P,o=>{ue()?o(D):ie()?o(S,1):o(C,-1)})}n(f,h)},Ce=f=>{var h=V(),P=w(h);{var D=o=>{var t=V(),e=w(t);{var a=i=>{var c=Sa(),g=w(c),p=u(g),m=F(p,!0),k=u(p,1,!0);v((A,K)=>{l(g,`${A??""} `),l(m,H()),l(k,K)},[()=>_.onboarding_setupCard_workingOnBranchNamed_before(),()=>_.onboarding_setupCard_workingOnBranchActive_after()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ya(),e=w(t),a=u(e),r=F(a,!0),i=u(a),c=u(i);{let g=y(()=>_.onboarding_setupCard_baseRef_label()),p=y(()=>_.onboarding_setupCard_creatingBranch_after());z(c,te,()=>s(g),()=>{},()=>s(p))}v((g,p)=>{l(e,`${g??""} `),l(r,H()),l(i,` ${p??""} `)},[()=>_.onboarding_setupCard_creatingBranch_before(),()=>_.onboarding_setupCard_creatingBranch_middle()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_creatingBranchNoName_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Y=(f,h=ee,P)=>{let D=Fe(()=>Ee(P?.(),""));const S=y(()=>Array.from(h()));var C=ka(),o=w(C),t=F(o,!0),e=u(o),a=j(e),r=F(a,!0),i=u(a),c=F(i,!0);U(e),v((g,p)=>{l(t,g),l(r,p),l(c,s(D))},[()=>s(S).slice(0,-1).join(""),()=>s(S).at(-1)??""]),n(f,C)},z=(f,h=ee,P=ee,D=ee,S)=>{let C=Fe(()=>Ee(S?.(),""));const o=y(()=>s(C).match(/^\p{P}+/u)?.[0]??"");var t=Pa(),e=w(t);Le(e,{variant:"plain",wrapContent:!1,class:"setup-inline-link cursor-pointer hover:text-foreground transition-colors",onclick:()=>wt(D()??h(),P()),children:(r,i)=>{Y(r,h,()=>s(o))},$$slots:{default:!0}});var a=u(e,1,!0);v(r=>l(a,r),[()=>s(C).slice(s(o).length)]),n(f,t)},we=f=>{var h=V(),P=w(h);{var D=o=>{var t=V(),e=w(t);{var a=i=>{var c=fe(),g=w(c),p=u(g);{let m=y(()=>_.onboarding_setupCard_branchName_label()),k=y(()=>_.onboarding_setupCard_workingOnBranchDone_after());z(p,H,()=>s(m),()=>{},()=>s(k))}v(m=>l(g,`${m??""} `),[()=>_.onboarding_setupCard_workingOnBranchNamed_before()]),n(i,c)},r=i=>{var c=L();v(g=>l(c,g),[()=>_.onboarding_setupCard_workingDirectlyOnBranch_label()]),n(i,c)};I(e,i=>{H()?i(a):i(r,-1)})}n(o,t)},S=o=>{var t=ot(),e=w(t),a=u(e);{let i=y(()=>_.onboarding_setupCard_branchName_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_middle());z(a,H,()=>s(i),()=>{},()=>s(c))}var r=u(a,2);{let i=y(()=>_.onboarding_setupCard_baseRef_label()),c=y(()=>_.onboarding_setupCard_workingInNewBranch_after());z(r,te,()=>s(i),()=>{},()=>s(c))}v(i=>l(e,`${i??""} `),[()=>_.onboarding_setupCard_workingInNewBranch_before()]),n(o,t)},C=o=>{var t=L();v(e=>l(t,e),[()=>_.onboarding_setupCard_branchCreated_label()]),n(o,t)};I(P,o=>{ie()?o(D):H()?o(S,1):o(C,-1)})}n(f,h)},Ft=f=>{De();var h=_e(),P=w(h),D=u(P);{var S=t=>{var e=it(),a=F(e,!0);v(()=>l(a,ae())),n(t,e)},C=t=>{var e=L();v(a=>l(e,a),[()=>_.onboarding_setupCard_project_label()]),n(t,e)};I(D,t=>{ae()?t(S):t(C,-1)})}var o=u(D);v((t,e)=>{l(P,`${t??""} `),l(o,` ${e??""}`)},[()=>_.onboarding_setupCard_runningSetup_before(),()=>_.onboarding_setupCard_runningSetup_after()]),n(f,h)},Et=f=>{De();var h=Ia(),P=w(h),D=u(P);{var S=r=>{var i=it(),c=F(i,!0);v(()=>l(c,ae())),n(r,i)},C=r=>{var i=L();v(c=>l(i,c),[()=>_.onboarding_setupCard_project_label()]),n(r,i)};I(D,r=>{ae()?r(S):r(C,-1)})}var o=u(D),t=u(o);{var e=r=>{var i=fe(),c=w(i),g=u(c);rt(g,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:A=>{Le(A,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",get onclick(){return R()},children:(K,de)=>{De();var ne=L();v(Se=>l(ne,Se),[()=>_.onboarding_setupCard_terminalTab_label()]),n(K,ne)},$$slots:{default:!0}})},content:A=>{var K=V(),de=w(K);{var ne=Se=>{var Qe=Da(),Wt=F(Qe,!0);v(()=>l(Wt,pe())),n(Se,Qe)};I(de,Se=>{pe()&&Se(ne)})}n(A,K)},footer:A=>{var K=lt(),de=F(K,!0);v(ne=>l(de,ne),[()=>_.onboarding_setupCard_openTerminal_footer()]),n(A,K)},$$slots:{trigger:!0,content:!0,footer:!0}}),v(p=>l(c,` ${p??""} `),[()=>_.onboarding_setupCard_ranSetupIn_middle()]),n(r,i)};I(t,r=>{R()&&r(e)})}var a=u(t,1,!0);v((r,i,c)=>{l(P,`${r??""} `),l(o,` ${i??""}`),l(a,c)},[()=>_.onboarding_setupCard_ranSetup_before(),()=>_.onboarding_setupCard_ranSetup_middle(),()=>_.onboarding_setupCard_ranSetup_after()]),n(f,h)},ce=f=>{rt(f,{class:"inline",side:"bottom",align:"start",interactive:!0,maxWidth:"22rem",delayDuration:300,trigger:S=>{Le(S,{variant:"plain",wrapContent:!1,class:"setup-inline-link underline underline-offset-2 cursor-pointer hover:text-foreground transition-colors",onclick:St,children:(C,o)=>{De();var t=L();v(()=>l(t,s(Ct))),n(C,t)},$$slots:{default:!0}})},content:S=>{var C=V(),o=w(C);{var t=e=>{var a=Na(),r=F(a,!0);v(()=>l(r,s(Te).description)),n(e,a)};I(o,e=>{s(Te)&&e(t)})}n(S,C)},footer:S=>{var C=lt(),o=F(C,!0);v(t=>l(o,t),[()=>_.onboarding_setupCard_editInSettings_footer()]),n(S,C)},$$slots:{trigger:!0,content:!0,footer:!0}})},Bt=f=>{var h=V(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specStartingUp_before(),()=>_.onboarding_setupCard_specStartingUp_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_startingUpNamed_before(),()=>_.onboarding_setupCard_startingUpNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_startingUp_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)},Lt=f=>{var h=V(),P=w(h);{var D=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentReadyNamed_before(),()=>_.onboarding_setupCard_agentReadyNamed_after()]),n(e,a)},S=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentReady_label()]),n(e,a)},C=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_specDone_before(),()=>_.onboarding_setupCard_specDone_after()]),n(e,a)},o=e=>{var a=_e(),r=w(a),i=u(r);ce(i);var c=u(i);v((g,p)=>{l(r,`${g??""} `),l(c,` ${p??""}`)},[()=>_.onboarding_setupCard_agentDoneNamed_before(),()=>_.onboarding_setupCard_agentDoneNamed_after()]),n(e,a)},t=e=>{var a=L();v(r=>l(a,r),[()=>_.onboarding_setupCard_agentOrienting_label()]),n(e,a)};I(P,e=>{!re()&&W()?e(D):re()?s(He)?e(C,2):W()?e(o,3):e(t,-1):e(S,1)})}n(f,h)};var Ve=j($e);{var It=f=>{d(f,ve,()=>Xt,()=>"-ml-px transform scale-[0.98]",()=>le,()=>he)};I(Ve,f=>{ve()!=="pending"&&f(It)})}var Xe=u(Ve,2);{var Nt=f=>{d(f,me,()=>Jt,()=>"",()=>Ce,()=>we)};I(Xe,f=>{me()!=="pending"&&!ie()&&!ue()&&f(Nt)})}var Je=u(Xe,2);{var Tt=f=>{d(f,q,()=>Qt,()=>"ml-[0.5px]",()=>Ft,()=>Et)};I(Je,f=>{q()&&q()!=="pending"&&f(Tt)})}var Ot=u(Je,2);{var At=f=>{d(f,be,()=>Zt,()=>"ml-[-0.5px]",()=>Bt,()=>Lt)};I(Ot,f=>{be()!=="pending"&&f(At)})}U($e)}U(ke),v(()=>Ue(ke,1,`${ta} w-full overflow-hidden transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none`,"svelte-enden2")),n(M,ke);var Rt=pt(yt);return X(),Rt}export{va as R,Oa as W,rr as a,ar as c,nr as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./CnHcPhIW.js";import{b_ as we,c_ as ue,cq as de,cp as be}from"./Cw2ZnpX7.js";import{Jx as p,C6 as Fe,bJ as ke,i as Ge,LC as me,ir as Ee,bV as Pe,E2 as H,Cv as xe,fl as Ve,AB as Ue,e3 as fe,fh as _e,e2 as he,B4 as Be,Lg as $e,wx as Xe}from"./DXdFemRu.js";import{aO as Se,dW as ge,A as K,P as Re,aK as Q}from"./C9aF-Sor.js";import{h as We}from"./rNjiZ_3W.js";import{c as q}from"./ChTqQfQN.js";import{a as qe}from"./BdWqymET.js";import{m as j}from"./x_GKKTQV.js";import"./3SdAC2_C.js";import{bm as n}from"./hY0rMePc.js";import"./leDczq9h.js";import"./CjZEyjv4.js";import"./BXT21uPn.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new qe("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class W extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=q("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new W(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new W(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof W?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new W(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=q("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=q("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=q("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await We("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|
|
1
|
+
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./C3-81PRC.js";import{b_ as we,c_ as ue,cq as de,cp as be}from"./CA8JHp72.js";import{Jx as p,C6 as Fe,bJ as ke,i as Ge,LC as me,ir as Ee,bV as Pe,E2 as H,Cv as xe,fl as Ve,AB as Ue,e3 as fe,fh as _e,e2 as he,B4 as Be,Lg as $e,wx as Xe}from"./4g_iHoQm.js";import{aO as Se,dW as ge,A as K,P as Re,aK as Q}from"./SbTG0nwQ.js";import{h as We}from"./BPuz5cN_.js";import{c as q}from"./ChTqQfQN.js";import{a as qe}from"./BdWqymET.js";import{m as j}from"./rXKOJqUt.js";import"./3SdAC2_C.js";import{bm as n}from"./Dws-34a7.js";import"./BD9db4FR.js";import"./D-rRuAXZ.js";import"./DcOkWaeN.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new qe("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class W extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=q("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new W(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new W(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof W?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new W(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=q("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=q("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=q("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await We("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|