@intent-hq/web 2.370.0 → 2.370.2
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/{B-kUJzil.js → 2fnkFLNz.js} +1 -1
- package/web/app/immutable/chunks/{DbCFTbwM.js → 37RwnxdA.js} +1 -1
- package/web/app/immutable/chunks/{D5_auhOU.js → 5LALF9-w.js} +2 -2
- package/web/app/immutable/chunks/{eCVtubQ8.js → 5eDYSo3l.js} +1 -1
- package/web/app/immutable/chunks/{BEV9WkWU.js → 5kePy1TE.js} +1 -1
- package/web/app/immutable/chunks/{EzpfJOSe.js → 61v4Xd-q.js} +1 -1
- package/web/app/immutable/chunks/{D9MwZkzV.js → 6VefuM40.js} +1 -1
- package/web/app/immutable/chunks/{1pIqWRUk.js → 711s5WU0.js} +1 -1
- package/web/app/immutable/chunks/{CwWm64yZ.js → 8kPgwy6s.js} +1 -1
- package/web/app/immutable/chunks/{DcUCHDGY.js → AsFm-iq9.js} +1 -1
- package/web/app/immutable/chunks/{DFr6bn5t.js → B-7g-jyw.js} +4 -4
- package/web/app/immutable/chunks/{ZIOU9Sxd.js → B1tKRs9e.js} +1 -1
- package/web/app/immutable/chunks/{CaHds95Q.js → B3s08q4i.js} +1 -1
- package/web/app/immutable/chunks/{1GrJvO3a.js → B4F8uEiO.js} +1 -1
- package/web/app/immutable/chunks/{vLtMR-kj.js → B4rTQlY3.js} +1 -1
- package/web/app/immutable/chunks/{B3Gso1ut.js → B7CIdOn0.js} +1 -1
- package/web/app/immutable/chunks/{CQ_NwL45.js → B7nQiJX-.js} +2 -2
- package/web/app/immutable/chunks/{B9BjyTgZ.js → BFgsQcq9.js} +1 -1
- package/web/app/immutable/chunks/{CBRZjI7P.js → BGndkjol.js} +2 -2
- package/web/app/immutable/chunks/{BSfkjlLx.js → BHCTYYXY.js} +1 -1
- package/web/app/immutable/chunks/{CYKOPxuJ.js → BIY9btQv.js} +1 -1
- package/web/app/immutable/chunks/{qi41b1Ac.js → BLaGtfsC.js} +1 -1
- package/web/app/immutable/chunks/{D6dNunKo.js → BLb6jd9K.js} +1 -1
- package/web/app/immutable/chunks/{DELYEsRi.js → BM1qSBOB.js} +2 -2
- package/web/app/immutable/chunks/{BVLa_5Le.js → BNv5miK-.js} +1 -1
- package/web/app/immutable/chunks/{gHT8Z5q-.js → BOHkf2gI.js} +1 -1
- package/web/app/immutable/chunks/{bb5Wjkri.js → BOROIf_S.js} +1 -1
- package/web/app/immutable/chunks/{t7yAUuZn.js → BOWO4Ybr.js} +2 -2
- package/web/app/immutable/chunks/{Bus1Z5ou.js → BPOdNeJW.js} +1 -1
- package/web/app/immutable/chunks/{C_E26DWe.js → BR1Dvtpp.js} +1 -1
- package/web/app/immutable/chunks/{C2Vj5Vs6.js → BR75pcGU.js} +1 -1
- package/web/app/immutable/chunks/{DSacn4II.js → BR9APAxb.js} +1 -1
- package/web/app/immutable/chunks/{THdp5Vpk.js → BROVvkEL.js} +1 -1
- package/web/app/immutable/chunks/{jG-4Z8qH.js → BS5Nujz5.js} +1 -1
- package/web/app/immutable/chunks/{D_hG-oZK.js → BTodhwDl.js} +1 -1
- package/web/app/immutable/chunks/{CSBGusi9.js → BWn2FCdq.js} +1 -1
- package/web/app/immutable/chunks/{VdR0DXlW.js → BWu7Gpqf.js} +47 -47
- package/web/app/immutable/chunks/{CGzD6XfW.js → BZJ31k0Z.js} +1 -1
- package/web/app/immutable/chunks/{CmW3Zqh6.js → BZWU4mlm.js} +2 -2
- package/web/app/immutable/chunks/{DrOwYgbZ.js → BZgI7WU1.js} +1 -1
- package/web/app/immutable/chunks/{DZIz7Wk9.js → BaGw_bDr.js} +1 -1
- package/web/app/immutable/chunks/{NQru5r2h.js → BcrA9Yen.js} +1 -1
- package/web/app/immutable/chunks/{BvZfa6RH.js → BdJsd1ki.js} +1 -1
- package/web/app/immutable/chunks/{gySpGbnA.js → Bfp4ruWu.js} +1 -1
- package/web/app/immutable/chunks/{B1hj1DGj.js → BgE7NCeJ.js} +1 -1
- package/web/app/immutable/chunks/BghZcrpF.js +1 -0
- package/web/app/immutable/chunks/{CY-vjmpy.js → BiVa9bC9.js} +1 -1
- package/web/app/immutable/chunks/{DB9n2KBT.js → Bj-9TYLg.js} +1 -1
- package/web/app/immutable/chunks/{CFNJHO2G.js → BkG4Behb.js} +1 -1
- package/web/app/immutable/chunks/{BzFy3u2D.js → BlQvrYPa.js} +1 -1
- package/web/app/immutable/chunks/{FtGWFokI.js → BldeOF88.js} +1 -1
- package/web/app/immutable/chunks/{CdOh_Fmv.js → BnA9v3pc.js} +1 -1
- package/web/app/immutable/chunks/{CnztNSaN.js → BoQ8Q7zJ.js} +1 -1
- package/web/app/immutable/chunks/{CPlH-52U.js → BpcFcSgh.js} +7 -7
- package/web/app/immutable/chunks/{CiZzqOpk.js → BpyEBWKW.js} +1 -1
- package/web/app/immutable/chunks/{DgMr61cU.js → Bq3GMUqF.js} +1 -1
- package/web/app/immutable/chunks/{TE7UDCh6.js → BrGoXwG8.js} +1 -1
- package/web/app/immutable/chunks/{CyWgrZMk.js → Bsyy-0lH.js} +5 -5
- package/web/app/immutable/chunks/{Chnr0_jK.js → Bvf6gH6c.js} +1 -1
- package/web/app/immutable/chunks/{CylWx-GB.js → BxN9s7AP.js} +1 -1
- package/web/app/immutable/chunks/{Dekzflbl.js → BxQi83db.js} +1 -1
- package/web/app/immutable/chunks/{BGT9uvaQ.js → Bzz0c_ry.js} +5 -5
- package/web/app/immutable/chunks/{zye35u-t.js → C-IS8SBb.js} +1 -1
- package/web/app/immutable/chunks/{DUGztmZo.js → C0jW3ncX.js} +1 -1
- package/web/app/immutable/chunks/{Bc7pHsTy.js → C1YR8Gnj.js} +1 -1
- package/web/app/immutable/chunks/{Blu9C_Vv.js → C289w7fG.js} +1 -1
- package/web/app/immutable/chunks/{C0wua3Vt.js → C2UYU20O.js} +1 -1
- package/web/app/immutable/chunks/{CgwFGLCK.js → C2wWLl1x.js} +1 -1
- package/web/app/immutable/chunks/{CjTGc2Y5.js → C30xT9-i.js} +2 -2
- package/web/app/immutable/chunks/{9-nUCsGi.js → C3pE6msh.js} +1 -1
- package/web/app/immutable/chunks/{CQHtdg39.js → C5T8uUpU.js} +1 -1
- package/web/app/immutable/chunks/{DeE0yn_3.js → C5pJ7DEG.js} +1 -1
- package/web/app/immutable/chunks/{CH7fgKro.js → C6P_twJN.js} +1 -1
- package/web/app/immutable/chunks/{UQXXh4U7.js → C6ROKFdp.js} +1 -1
- package/web/app/immutable/chunks/{YcqSYZ1W.js → C96BAoIR.js} +1 -1
- package/web/app/immutable/chunks/{BnNJN3Ls.js → C9AWL-_E.js} +1 -1
- package/web/app/immutable/chunks/{CzW29tkb.js → CAV1CzzW.js} +1 -1
- package/web/app/immutable/chunks/{CfUtc4-L.js → CDsbSWM0.js} +1 -1
- package/web/app/immutable/chunks/{DC_1j_gh.js → CELHofTd.js} +3 -3
- package/web/app/immutable/chunks/{Bg7YNbVH.js → CFdTsqjt.js} +1 -1
- package/web/app/immutable/chunks/{d1EmVp98.js → CGLbiObk.js} +1 -1
- package/web/app/immutable/chunks/{B-_ROixI.js → CHvjIWnN.js} +2 -2
- package/web/app/immutable/chunks/{CbRsc9i4.js → CI4_aI7e.js} +5 -5
- package/web/app/immutable/chunks/{C_-WdiR8.js → CKf0K7iH.js} +1 -1
- package/web/app/immutable/chunks/{CCrwZkau.js → CMYDhfVs.js} +1 -1
- package/web/app/immutable/chunks/{CmVXj6KK.js → CQCytUET.js} +2 -2
- package/web/app/immutable/chunks/CQIdhUGs.js +1 -0
- package/web/app/immutable/chunks/{D_-ztW_Y.js → CQiC3L5q.js} +1 -1
- package/web/app/immutable/chunks/{BwtGEQS3.js → CRhdiLrU.js} +1 -1
- package/web/app/immutable/chunks/{uCQEgTob.js → CTBZXNUF.js} +1 -1
- package/web/app/immutable/chunks/{BkFHmpuY.js → CUj3qXAR.js} +1 -1
- package/web/app/immutable/chunks/{Dv0Jc2Nv.js → CVpnQG0j.js} +1 -1
- package/web/app/immutable/chunks/{R2N5eDxY.js → CWOeseZJ.js} +2 -2
- package/web/app/immutable/chunks/{DtHX0_aW.js → CX-8a7xU.js} +2 -2
- package/web/app/immutable/chunks/{BhZDGIfe.js → CX-WDgpQ.js} +1 -1
- package/web/app/immutable/chunks/{DJFAYXyc.js → CZ0MIbMm.js} +1 -1
- package/web/app/immutable/chunks/{CUMRLgxB.js → C_WatYYk.js} +1 -1
- package/web/app/immutable/chunks/{CRY4aELR.js → CcCeOCLG.js} +4 -4
- package/web/app/immutable/chunks/{BX9hgO_H.js → CcYjFBrM.js} +6 -6
- package/web/app/immutable/chunks/{B_IEMfS6.js → Ce4DeuTo.js} +3 -3
- package/web/app/immutable/chunks/{CMLBE7U6.js → CmdzVgvT.js} +1 -1
- package/web/app/immutable/chunks/{Bvo32SXP.js → CnS7dtdu.js} +1 -1
- package/web/app/immutable/chunks/{9sCF_0su.js → Cnfa9ycD.js} +1 -1
- package/web/app/immutable/chunks/{Db8-C0Zq.js → CoDlIYWp.js} +1 -1
- package/web/app/immutable/chunks/{BSsEOl8-.js → CoZeNthD.js} +1 -1
- package/web/app/immutable/chunks/{D2dAlclh.js → Cov6EESF.js} +3 -3
- package/web/app/immutable/chunks/{DwXKCf3Q.js → CplGG62F.js} +1 -1
- package/web/app/immutable/chunks/CqCZk0ca.js +4 -0
- package/web/app/immutable/chunks/{qjcf4Gb9.js → Cr_u-KK4.js} +1 -1
- package/web/app/immutable/chunks/{BHaE4286.js → CvqKGiPA.js} +1 -1
- package/web/app/immutable/chunks/{B0SoVMRS.js → Cw0RkUSg.js} +1 -1
- package/web/app/immutable/chunks/{CzS5ny-g.js → Cxn7PlP-.js} +1 -1
- package/web/app/immutable/chunks/{Dsn82AW0.js → Cxs4PvAD.js} +1 -1
- package/web/app/immutable/chunks/{DtfuSWPd.js → Cy9k09g5.js} +1 -1
- package/web/app/immutable/chunks/{BAymCgEX.js → Cz-HgbT1.js} +1 -1
- package/web/app/immutable/chunks/{B9mj0qwd.js → CzM5SEDv.js} +1 -1
- package/web/app/immutable/chunks/{YV53nLSc.js → D2CiBsJQ.js} +1 -1
- package/web/app/immutable/chunks/{D1bivTve.js → D2dH0brU.js} +2 -2
- package/web/app/immutable/chunks/{DxyI4IUi.js → D2jpdqLS.js} +1 -1
- package/web/app/immutable/chunks/{CQAAihrI.js → D3VYu5tL.js} +1 -1
- package/web/app/immutable/chunks/{CKnpbRTh.js → D3gleuKc.js} +9 -9
- package/web/app/immutable/chunks/{CCsCF1Mh.js → D4D4msrU.js} +1 -1
- package/web/app/immutable/chunks/{DISyGoja.js → D5-1hxdu.js} +1 -1
- package/web/app/immutable/chunks/{BqxcrzZH.js → D5CXAAzn.js} +1 -1
- package/web/app/immutable/chunks/{Bi0vr71w.js → D5MxzPoI.js} +1 -1
- package/web/app/immutable/chunks/{DCW2c0FY.js → D5xUDbUx.js} +1 -1
- package/web/app/immutable/chunks/{BUA7BUyu.js → D6vwIrtC.js} +1 -1
- package/web/app/immutable/chunks/{BYMXwcID.js → D8-Qc246.js} +1 -1
- package/web/app/immutable/chunks/{CRNfAyhd.js → DAfOI1BG.js} +1 -1
- package/web/app/immutable/chunks/{BnhOIUmr.js → DDVgDlM2.js} +1 -1
- package/web/app/immutable/chunks/{CCSbqNiH.js → DExi1WR7.js} +1 -1
- package/web/app/immutable/chunks/DFMjHFLq.js +1 -0
- package/web/app/immutable/chunks/{NqK_XT0y.js → DFrynV0u.js} +1 -1
- package/web/app/immutable/chunks/{Dawt227W.js → DGQoqGp4.js} +1 -1
- package/web/app/immutable/chunks/{Bp098-aN.js → DJOX3PaT.js} +1 -1
- package/web/app/immutable/chunks/{BSD34ZVo.js → DLfLfqER.js} +1 -1
- package/web/app/immutable/chunks/{D1V2Et17.js → DMH0w6el.js} +1 -1
- package/web/app/immutable/chunks/{WlqVlpOk.js → DNF6envV.js} +1 -1
- package/web/app/immutable/chunks/{Iq8JI4_0.js → DNbpqTjh.js} +1 -1
- package/web/app/immutable/chunks/{DWEA_zul.js → DOiozQGI.js} +1 -1
- package/web/app/immutable/chunks/{Dp9fBXaC.js → DOwDDYVN.js} +1 -1
- package/web/app/immutable/chunks/{5lieSvED.js → DP7n2Ccw.js} +1 -1
- package/web/app/immutable/chunks/{C2YH0P-B.js → DPvT-ATr.js} +1 -1
- package/web/app/immutable/chunks/{BRRvOx4M.js → DQLMO9xD.js} +2 -2
- package/web/app/immutable/chunks/{sS3MW5B6.js → DQZlstPH.js} +1 -1
- package/web/app/immutable/chunks/{CADQyVDS.js → DTbH-mAR.js} +2 -2
- package/web/app/immutable/chunks/{CblB0zCN.js → DUAki0uS.js} +1 -1
- package/web/app/immutable/chunks/{fr0BmHL-.js → DUj14ka7.js} +1 -1
- package/web/app/immutable/chunks/{CbyU6cEf.js → DVu7tZ67.js} +1 -1
- package/web/app/immutable/chunks/{CBafvv8h.js → DWC3_76J.js} +1 -1
- package/web/app/immutable/chunks/{BpEHjU4g.js → DXtdMDwl.js} +1 -1
- package/web/app/immutable/chunks/{CR2m4w2U.js → DY9gJ8US.js} +1 -1
- package/web/app/immutable/chunks/{DIukqb9l.js → D_izGjgJ.js} +1 -1
- package/web/app/immutable/chunks/{D-NrCL67.js → D_pS9hme.js} +1 -1
- package/web/app/immutable/chunks/{Cj_UUgNI.js → DaqXt9wp.js} +1 -1
- package/web/app/immutable/chunks/{BvKqDQXM.js → DcnKM2c0.js} +1 -1
- package/web/app/immutable/chunks/{A4nvdmL6.js → DcsxLfDg.js} +1 -1
- package/web/app/immutable/chunks/{B2AfKG58.js → DgTfsal1.js} +2 -2
- package/web/app/immutable/chunks/{rB5UfCey.js → DiD2Cn17.js} +1 -1
- package/web/app/immutable/chunks/{R1s5ARST.js → Dk27S3e8.js} +1 -1
- package/web/app/immutable/chunks/{BmBa9vQp.js → DkkmguuG.js} +1 -1
- package/web/app/immutable/chunks/{CUdMuhJF.js → DlGpNWpV.js} +1 -1
- package/web/app/immutable/chunks/{Cv2YUgTX.js → DnV9eAGG.js} +1 -1
- package/web/app/immutable/chunks/{BulBKnVz.js → DnfgukfK.js} +1 -1
- package/web/app/immutable/chunks/{CA2ANaNj.js → Dnz4szur.js} +1 -1
- package/web/app/immutable/chunks/{Df-HaYIr.js → Do5lDWBq.js} +1 -1
- package/web/app/immutable/chunks/{Bqm2Rf6d.js → Dq9sK6wY.js} +1 -1
- package/web/app/immutable/chunks/{Caqml6gj.js → Dqa8MqiX.js} +1 -1
- package/web/app/immutable/chunks/{f686-QUd.js → DqvpZseI.js} +1 -1
- package/web/app/immutable/chunks/{cFozej4U.js → Dr1T9Ela.js} +3 -3
- package/web/app/immutable/chunks/{DksUdusM.js → DrBfRK-l.js} +2 -2
- package/web/app/immutable/chunks/{D0DIS-cT.js → DrMbcJpA.js} +1 -1
- package/web/app/immutable/chunks/{qvt-0QTi.js → DsGwNgOu.js} +3 -3
- package/web/app/immutable/chunks/{wgljT0D3.js → DuR22uzB.js} +1 -1
- package/web/app/immutable/chunks/DwEChUMY.js +1 -0
- package/web/app/immutable/chunks/{BG2RPA7A.js → DxOqqCxd.js} +2 -2
- package/web/app/immutable/chunks/{BDA31WCY.js → F6KnEzK2.js} +1 -1
- package/web/app/immutable/chunks/{UN8KT7fR.js → FhXVX7Hi.js} +1 -1
- package/web/app/immutable/chunks/{BCQ1W7zT.js → IbOrXYhr.js} +3 -3
- package/web/app/immutable/chunks/{DL1CE4TH.js → JvjGgKob.js} +1 -1
- package/web/app/immutable/chunks/{B-1iBpaq.js → Jx0QEit0.js} +1 -1
- package/web/app/immutable/chunks/{BgPtjifd.js → KEjNxHSN.js} +1 -1
- package/web/app/immutable/chunks/KvL2D8eF.js +1 -0
- package/web/app/immutable/chunks/{D6VfSAVQ.js → MmbRHAVV.js} +1 -1
- package/web/app/immutable/chunks/{D_r5h8IL.js → NgjMs0r6.js} +1 -1
- package/web/app/immutable/chunks/{DFBd8tOh.js → OK80LzXp.js} +1 -1
- package/web/app/immutable/chunks/{tDUnXf7O.js → QFEvVzf2.js} +1 -1
- package/web/app/immutable/chunks/RMFOakJ8.js +1 -0
- package/web/app/immutable/chunks/{ir8Qz45r.js → Rtb2u0aS.js} +1 -1
- package/web/app/immutable/chunks/{qHChsLZZ.js → S0vfIVN4.js} +1 -1
- package/web/app/immutable/chunks/{C1AEP5wW.js → SxNO1NUM.js} +1 -1
- package/web/app/immutable/chunks/{DZRLhNnQ.js → Tl9_Ag57.js} +1 -1
- package/web/app/immutable/chunks/{1DKpnRTj.js → YcLv7RIG.js} +1 -1
- package/web/app/immutable/chunks/{CgS_FiQI.js → YjkXFMdR.js} +1 -1
- package/web/app/immutable/chunks/{CbRNm5he.js → YlOhdwpJ.js} +1 -1
- package/web/app/immutable/chunks/{Hd1u2Z-S.js → ZiiliHwl.js} +3 -3
- package/web/app/immutable/chunks/{BinPWBvt.js → a-02PhaD.js} +1 -1
- package/web/app/immutable/chunks/{BmjF1SON.js → deZv7xr3.js} +2 -2
- package/web/app/immutable/chunks/{CqVZxU_G.js → e6y6K_3x.js} +1 -1
- package/web/app/immutable/chunks/{_EqQOSVK.js → eHZL9ha9.js} +2 -2
- package/web/app/immutable/chunks/{VJkCr9xp.js → eRIG79tn.js} +1 -1
- package/web/app/immutable/chunks/{1GGKXNxU.js → e_K38tqB.js} +1 -1
- package/web/app/immutable/chunks/{D69ZLPjW.js → hSiYrZoo.js} +1 -1
- package/web/app/immutable/chunks/{DvATy2o1.js → hqZSbKVs.js} +1 -1
- package/web/app/immutable/chunks/{DRy2oEmj.js → l3HuVu6N.js} +1 -1
- package/web/app/immutable/chunks/{Ev5lig9W.js → lUjoTdjg.js} +1 -1
- package/web/app/immutable/chunks/{CUNx-_2d.js → mPd0q3-n.js} +4 -4
- package/web/app/immutable/chunks/{B8_Ff8zl.js → mdamofpo.js} +7 -7
- package/web/app/immutable/chunks/{BDcauMkX.js → mwFmA_HW.js} +1 -1
- package/web/app/immutable/chunks/{BimRiD6s.js → nxYQz1Bp.js} +1 -1
- package/web/app/immutable/chunks/{DkJkWZTE.js → qOqJpb_a.js} +1 -1
- package/web/app/immutable/chunks/{Cgn_eC9-.js → rIUowGAi.js} +2 -2
- package/web/app/immutable/chunks/{DvrEye74.js → rei1qYSi.js} +1 -1
- package/web/app/immutable/chunks/{BR2t5nsF.js → wNJjv8Uj.js} +2 -2
- package/web/app/immutable/chunks/{MifrdpDQ.js → xIIgydKf.js} +1 -1
- package/web/app/immutable/chunks/{CqwiFk32.js → yGw_3prC.js} +1 -1
- package/web/app/immutable/chunks/{Cq4X6ptS.js → z2CLzpx7.js} +1 -1
- package/web/app/immutable/entry/{app.jT7Rd2u4.js → app.CC3URvKW.js} +2 -2
- package/web/app/immutable/entry/start.C3bg9se6.js +1 -0
- package/web/app/immutable/nodes/{0.9lwWQtfB.js → 0.C4aXi2Zc.js} +1 -1
- package/web/app/immutable/nodes/{1.Ck4yEk2l.js → 1.O03B6KYk.js} +1 -1
- package/web/app/immutable/nodes/{10.C4FEQjC7.js → 10.DSjz-a23.js} +17 -17
- package/web/app/immutable/nodes/{11.C-vXNNmX.js → 11.DUbB-MHX.js} +4 -4
- package/web/app/immutable/nodes/{13.DhKVmEQi.js → 13.DTamgdFN.js} +1 -1
- package/web/app/immutable/nodes/{14.INZu_e5k.js → 14.CzznX4mY.js} +1 -1
- package/web/app/immutable/nodes/{15.DdKSdQ-h.js → 15.BU8WwWus.js} +1 -1
- package/web/app/immutable/nodes/{16.Ad-t6nft.js → 16.D1WCmH9D.js} +1 -1
- package/web/app/immutable/nodes/{17.pLS5JsPi.js → 17.DXnAkOJb.js} +1 -1
- package/web/app/immutable/nodes/{18.DIVxEUeB.js → 18.BBYG39nr.js} +1 -1
- package/web/app/immutable/nodes/{19.BB9LuT5j.js → 19.C3kZuMc1.js} +2 -2
- package/web/app/immutable/nodes/2.SHzQR8g8.js +13 -0
- package/web/app/immutable/nodes/{20.BGTcjiLa.js → 20.DyC7cckU.js} +1 -1
- package/web/app/immutable/nodes/{3.DRJnaOSe.js → 3.D7EtacCx.js} +1 -1
- package/web/app/immutable/nodes/{4.p67SnElB.js → 4._-Ygm1PE.js} +1 -1
- package/web/app/immutable/nodes/{5.DRmIJA2c.js → 5.B5veLa-N.js} +1 -1
- package/web/app/immutable/nodes/{6.Bjeibumi.js → 6.BnrdHFCS.js} +2 -2
- package/web/app/immutable/nodes/{7.CjIaxqZ1.js → 7.DAUgpsnC.js} +1 -1
- package/web/app/immutable/nodes/{8.DAlxovqG.js → 8.Cj1FZ4Vr.js} +1 -1
- package/web/app/immutable/nodes/{9.BKQZzsCi.js → 9.BuIEgUbP.js} +11 -11
- package/web/app/version.json +1 -1
- package/web/index.html +12 -12
- package/web/app/immutable/chunks/-7AqlW5j.js +0 -1
- package/web/app/immutable/chunks/B1lYPzEU.js +0 -1
- package/web/app/immutable/chunks/C14Hgf8a.js +0 -1
- package/web/app/immutable/chunks/CK4eAyad.js +0 -1
- package/web/app/immutable/chunks/DBdkAKrm.js +0 -4
- package/web/app/immutable/chunks/UGr2VEtG.js +0 -1
- package/web/app/immutable/chunks/i8PKWJT0.js +0 -1
- package/web/app/immutable/entry/start.CSuXA93h.js +0 -1
- package/web/app/immutable/nodes/2.Bp80wZmn.js +0 -13
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ae}from"./
|
|
1
|
+
import{g as ae}from"./qOqJpb_a.js";import{s as ce}from"./Dqa8MqiX.js";import{b as l,ay as C,a1 as le,aP as he,W as de,O as G,X as B,aV as F,a8 as ge,an as ue,au as pe,H as fe}from"./mPd0q3-n.js";var Y=(function(){var n=l(function(x,s,i,o){for(i=i||{},o=x.length;o--;i[x[o]]=s);return i},"o"),e=[1,4],a=[1,13],d=[1,12],t=[1,15],h=[1,16],u=[1,20],m=[1,19],E=[6,7,8],_=[1,26],D=[1,24],w=[1,25],g=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,f,r,$){var p=r.length-1;switch(f){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[p].id),c.addNode(r[p-1].length,r[p].id,r[p].descr,r[p].type);break;case 16:c.getLogger().trace("Icon: ",r[p]),c.decorateNode({icon:r[p]});break;case 17:case 21:c.decorateNode({class:r[p]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[p].id),c.addNode(0,r[p].id,r[p].descr,r[p].type);break;case 20:c.decorateNode({icon:r[p]});break;case 25:c.getLogger().trace("node found ..",r[p-2]),this.$={id:r[p-1],descr:r[p-1],type:c.getType(r[p-2],r[p])};break;case 26:this.$={id:r[p],descr:r[p],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[p-3]),this.$={id:r[p-3],descr:r[p-1],type:c.getType(r[p-2],r[p])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(E,[2,3]),{1:[2,2]},n(E,[2,4]),n(E,[2,5]),{1:[2,6],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:a,9:22,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:_,7:D,10:23,11:w},n(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:m}),n(g,[2,18]),n(g,[2,19]),n(g,[2,20]),n(g,[2,21]),n(g,[2,23]),n(g,[2,24]),n(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:_,7:D,10:32,11:w},{1:[2,7],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(R,[2,14],{7:q,11:J}),n(A,[2,8]),n(A,[2,9]),n(A,[2,10]),n(g,[2,15]),n(g,[2,16]),n(g,[2,17]),{20:[1,35]},{21:[1,36]},n(R,[2,13],{7:q,11:J}),n(A,[2,11]),n(A,[2,12]),{21:[1,37]},n(g,[2,25]),n(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],f=[null],r=[],$=this.table,p="",M=0,K=0,ie=2,Q=1,se=r.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(v.yy[H]=this.yy[H]);y.setInput(s,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var re=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(b){o.length=o.length-2*b,f.length=f.length-b,r.length=r.length-b}l(oe,"popStack");function Z(){var b;return b=c.pop()||y.lex()||Q,typeof b!="number"&&(b instanceof Array&&(c=b,b=c.pop()),b=i.symbols_[b]||b),b}l(Z,"lex");for(var k,T,S,X,O={},U,N,ee,V;;){if(T=o[o.length-1],this.defaultActions[T]?S=this.defaultActions[T]:((k===null||typeof k>"u")&&(k=Z()),S=$[T]&&$[T][k]),typeof S>"u"||!S.length||!S[0]){var z="";V=[];for(U in $[T])this.terminals_[U]&&U>ie&&V.push("'"+this.terminals_[U]+"'");y.showPosition?z="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+y.showPosition()+`
|
|
3
3
|
Expecting `+V.join(", ")+", got '"+(this.terminals_[k]||k)+"'":z="Parse error on line "+(M+1)+": Unexpected "+(k==Q?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(z,{text:y.match,token:this.terminals_[k]||k,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(S[0]){case 1:o.push(k),f.push(y.yytext),r.push(y.yylloc),o.push(S[1]),k=null,K=y.yyleng,p=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(N=this.productions_[S[1]][1],O.$=f[f.length-N],O._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(O._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(O,[p,K,M,v.yy,S[1],f,r].concat(se)),typeof X<"u")return X;N&&(o=o.slice(0,-1*N*2),f=f.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[S[1]][0]),f.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},ne=(function(){var x={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{bm as v,_ as h}from"./51_h0jm2.js";import{a as S}from"./BdWqymET.js";import{bl as A,J4 as k,i as T,HA as C,GA as D,vd as j,vb as B,vs as V,ns as z}from"./CbRsc9i4.js";import{bL as $}from"./BSsEOl8-.js";import{m as R}from"./BAymCgEX.js";import"./CJxGDkBm.js";import"./CpPNoOk-.js";import"./DxvSggY5.js";import{R as N,F as g,E as G,Q as O}from"./Cgn_eC9-.js";import"./ChTqQfQN.js";import"./D6dNunKo.js";import{o as q}from"./CnztNSaN.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./DtHX0_aW.js");return{showAssistantContent:_}},__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]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./B-_ROixI.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),b(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),b(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./CGzD6XfW.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function b(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:P}=await import("./CgwFGLCK.js").then(M=>M.ea);return{selectWorkspaceById:P}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const P=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${P}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),b(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./B3bYRRle.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BVLa_5Le.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./DtHX0_aW.js");return{showAssistantContent:r}},__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]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./CBafvv8h.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{b({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./BmBa9vQp.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./Cgn_eC9-.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CX-8a7xU.js","/app/immutable/chunks/51_h0jm2.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CI4_aI7e.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BEklUrxK.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DxvSggY5.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/DaqXt9wp.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/rIUowGAi.js","/app/immutable/chunks/BQDGTBxC.js","/app/immutable/chunks/CpPNoOk-.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BHCTYYXY.js","/app/immutable/chunks/CHvjIWnN.js","/app/immutable/chunks/Cz-HgbT1.js","/app/immutable/chunks/PXCFrn2V.js","/app/immutable/chunks/BnA9v3pc.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/Bjy4ygfJ.js","/app/immutable/chunks/DGmOjLYi.js","/app/immutable/chunks/C9UsZ4re.js","/app/immutable/chunks/DqFWZ_g1.js","/app/immutable/chunks/BLb6jd9K.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/DSQT151l.js","/app/immutable/chunks/BxwkoIbZ.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/C2wWLl1x.js","/app/immutable/chunks/BoQ8Q7zJ.js","/app/immutable/chunks/Dq9sK6wY.js","/app/immutable/chunks/DQLMO9xD.js","/app/immutable/chunks/D_pS9hme.js","/app/immutable/chunks/BZJ31k0Z.js","/app/immutable/chunks/BOWO4Ybr.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/B3bYRRle.js","/app/immutable/chunks/BNv5miK-.js","/app/immutable/chunks/DWC3_76J.js","/app/immutable/chunks/DkkmguuG.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bm as v,_ as h}from"./51_h0jm2.js";import{a as S}from"./BdWqymET.js";import{bl as A,J5 as k,i as T,HB as C,GB as D,ve as B,vc as j,vt as V,nt as z}from"./CI4_aI7e.js";import{bL as $}from"./CoZeNthD.js";import{m as R}from"./Cz-HgbT1.js";import"./CJxGDkBm.js";import"./CpPNoOk-.js";import"./DxvSggY5.js";import{R as N,F as g,E as G,Q as O}from"./rIUowGAi.js";import"./ChTqQfQN.js";import"./BLb6jd9K.js";import{o as q}from"./BoQ8Q7zJ.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const i=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return i.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const s=N(e),{event:d}=t,f=s&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./CX-8a7xU.js");return{showAssistantContent:_}},__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]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return i.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(i.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(s&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...s,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,s,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(i.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return i.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./CHvjIWnN.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return i.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return i.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);i.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(B(t.workspaceId,o,t.sourcePanelId)):k.dispatch(j(t.workspaceId,o)),!0}return i.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return i.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./BZJ31k0Z.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:s}=t;if(!s)return i.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return i.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./C2wWLl1x.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,s),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{i.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return i.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(s,t),P(t),k.dispatch(V(s,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),i.debug("Opened file link in workspace file viewer",{path:r,workspaceId:s,line:l}),!0}catch(n){return i.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./B3bYRRle.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),s=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&s){const p=s.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:s,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&ie(c,e),i.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return i.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function ie(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BNv5miK-.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{i.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function se(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return i.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./CX-8a7xU.js");return{showAssistantContent:r}},__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]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){i.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return i.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./DWC3_76J.js").then(s=>s.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){i.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./DkkmguuG.js").then(s=>s.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),i.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return i.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),i.debug("Opened URL in external browser",{url:e}),!0}catch(t){return i.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),i.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return i.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./rIUowGAi.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function s(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",s),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",s),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:se},Symbol.toStringTag,{value:"Module"}));export{E as a,se as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as mt,bo as h,bw as dt,bq as ut,b as ft,bs as _,bm as D}from"./51_h0jm2.js";import{bs as gt,ca as T,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as i,cd as j,aA as k,bS as bt,aB as $t}from"./CJxGDkBm.js";import{i as A}from"./PXCFrn2V.js";import{k as q}from"./C9UsZ4re.js";import{c as z}from"./DGmOjLYi.js";import{aw as It,cS as wt}from"./DSQT151l.js";import{dz as St,dX as ht}from"./
|
|
1
|
+
import{t as mt,bo as h,bw as dt,bq as ut,b as ft,bs as _,bm as D}from"./51_h0jm2.js";import{bs as gt,ca as T,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as i,cd as j,aA as k,bS as bt,aB as $t}from"./CJxGDkBm.js";import{i as A}from"./PXCFrn2V.js";import{k as q}from"./C9UsZ4re.js";import{c as z}from"./DGmOjLYi.js";import{aw as It,cS as wt}from"./DSQT151l.js";import{dz as St,dX as ht}from"./C2wWLl1x.js";import{S as kt,c as Ct}from"./D2dH0brU.js";import{selectScriptById as yt,selectCanDeleteScript as xt}from"./Bq3GMUqF.js";import"./CpPNoOk-.js";import"./DxvSggY5.js";import"./rIUowGAi.js";import"./BROVvkEL.js";import{M as J}from"./C2UYU20O.js";import{g as Dt}from"./BrMXrCxP.js";import{T as Tt}from"./DFrynV0u.js";import{t as At,e as Bt}from"./BxQi83db.js";import{J5 as B,De as Vt,vi as Wt,gS as Rt}from"./CI4_aI7e.js";var Ht=$t("<!> <!>",1);function Mt(V,c){if(new.target)return mt({component:Mt,...V});gt(c,!0);const $=()=>_(K,"$fullContext$",u),P=()=>_(Q,"$canDeleteScript$",u),X=()=>_(L,"$scriptContext$",u),E=()=>_(N,"$script$",u),W=()=>_(U,"$homeView$",u),[u,F]=ut(),G=t=>{var r=b(),n=m(r);{var f=g=>{var w=Ht(),O=m(w);{let v=i(()=>D.workspace_shell_showInBottomBar_tooltip());z(O,()=>J,(S,x)=>{x(S,{get icon(){return It},get label(){return e(v)},onclick:Z,"data-move-to-bottom-bar":!0})})}var st=bt(O,2);{var nt=v=>{var S=b(),x=m(S);{let it=i(()=>D.scripts_delete_label()),ct=i(()=>P()?void 0:D.scripts_delete_disabled_description());z(x,()=>J,(lt,pt)=>{pt(lt,{get icon(){return wt},get label(){return e(it)},destructive:!0,get disabledReason(){return e(ct)},onclick:Y})})}d(v,S)};A(st,v=>{e(o)&&v(nt)})}d(g,w)};A(n,g=>{$()&&g(f)})}d(t,r)};let s=h(c,"tab",7),a=h(c,"workspaceId",7),C=h(c,"layoutId",7),l=h(c,"isActive",7);const I=i(()=>s().terminalId),o=i(()=>s().scriptId),R=Dt(),p=j(""),y=j("");T(()=>p.set(a())),T(()=>y.set(e(o)??""));const K=St(p),L=ht(p),N=yt(p,y),Q=xt(p,y),U=At(p);let H=!0;vt(()=>{H=!1});function Y(){if(!e(o))return;const t=a(),r=e(o),n=s().id;return Ct(t,r,()=>H&&l()&&a()===t&&e(o)===r&&s().id===n)}function Z(){$()&&(e(o)&&B.dispatch(Vt(a(),e(o))),B.dispatch(Wt(a(),e(I))),B.dispatch(Rt(C()??a(),s().id)))}T(()=>{if(!(!R||!l()))return R.registerActions({actions:G})});var tt={get tab(){return s()},set tab(t){s(t),k()},get workspaceId(){return a()},set workspaceId(t){a(t),k()},get layoutId(){return C()},set layoutId(t){C(t),k()},get isActive(){return l()},set isActive(t){l(t),k()},$set:dt,$on:(t,r)=>ft(c,t,r)},M=b(),et=m(M);{var rt=t=>{var r=b(),n=m(r);q(n,()=>e(o),f=>{{let g=i(()=>W()?.unavailable===!0),w=i(()=>Bt(W()));kt(f,{get scriptId(){return e(o)},get workspaceId(){return a()},class:"h-full",get runDisabled(){return e(g)},get runDisabledReason(){return e(w)}})}}),d(t,r)},at=t=>{var r=b(),n=m(r);q(n,()=>e(I),f=>{Tt(f,{get terminalId(){return e(I)},get workspaceId(){return a()},class:"h-full"})}),d(t,r)};A(et,t=>{e(o)&&l()&&X()&&($()||E())?t(rt):e(I)&&l()&&$()&&t(at,1)})}d(V,M);var ot=_t(tt);return F(),ot}export{Mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ft=Object.defineProperty;var Ze=s=>{throw TypeError(s)};var gt=(s,e,t)=>e in s?ft(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var R=(s,e,t)=>gt(s,typeof e!="symbol"?e+"":e,t),We=(s,e,t)=>e.has(s)||Ze("Cannot "+t);var u=(s,e,t)=>(We(s,e,"read from private field"),t?t.call(s):e.get(s)),F=(s,e,t)=>e.has(s)?Ze("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),X=(s,e,t,i)=>(We(s,e,"write to private field"),i?i.call(s,t):e.set(s,t),t),K=(s,e,t)=>(We(s,e,"access private method"),t);import{t as xe,bo as r,bw as Ee,b as He,br as Z,bp as Ve}from"./51_h0jm2.js";import{c9 as x,aD as c,bH as Q,bV as oe,bo as nt,bs as Te,a7 as P,ay as y,W as d,bn as De,aA as n,a5 as he,bf as $,bA as de,aB as st,ca as vt}from"./CJxGDkBm.js";import{s as G}from"./DxvSggY5.js";import{c as Ce}from"./DGmOjLYi.js";import{s as mt,i as Ct,h as Pt}from"./DZIz7Wk9.js";import{p as yt,u as Ot}from"./D6dNunKo.js";import{h as _t,an as it,a8 as wt,aK as Be,aO as At,aP as Ke,aG as Ft,aF as at,a2 as $e,av as V,a$ as lt,D as bt,l as St,a6 as It,ar as xt,ay as Et,az as ke,aS as b,a0 as ut,$ as ct,aQ as ge,aH as Me,H as Ht,a1 as Tt}from"./CdOh_Fmv.js";import{i as ue}from"./PXCFrn2V.js";import{b as fe,e as Dt}from"./CpPNoOk-.js";import{b as Nt}from"./THdp5Vpk.js";import{c as Kt,u as kt,s as Mt}from"./DJfJ5NWH.js";import{O as et}from"./CYKOPxuJ.js";const Ge=Et({component:"popover",parts:["root","trigger","content","close","overlay"]}),Ye=new _t("Popover.Root");var Pe,ye,Oe,_e,we,Ae,Fe,ne,se,J,re;const je=class je{constructor(e){F(this,J);R(this,"opts");F(this,Pe,oe(null));R(this,"contentPresence");F(this,ye,oe(null));F(this,Oe,oe(null));R(this,"overlayPresence");F(this,_e,oe(!1));F(this,we,oe(!1));F(this,Ae,oe(!1));F(this,Fe,oe(0));F(this,ne,null);F(this,se,null);this.opts=e,this.contentPresence=new $e({ref:V(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new $e({ref:V(()=>this.overlayNode),open:this.opts.open}),lt(()=>this.opts.open.current,t=>{t||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,K(this,J,re).call(this))})}static create(e){return Ye.set(new je(e))}get contentNode(){return c(u(this,Pe))}set contentNode(e){Q(u(this,Pe),e,!0)}get triggerNode(){return c(u(this,ye))}set triggerNode(e){Q(u(this,ye),e,!0)}get overlayNode(){return c(u(this,Oe))}set overlayNode(e){Q(u(this,Oe),e,!0)}get openedViaHover(){return c(u(this,_e))}set openedViaHover(e){Q(u(this,_e),e,!0)}get hasInteractedWithContent(){return c(u(this,we))}set hasInteractedWithContent(e){Q(u(this,we),e,!0)}get hoverCooldown(){return c(u(this,Ae))}set hoverCooldown(e){Q(u(this,Ae),e,!0)}get closeDelay(){return c(u(this,Fe))}set closeDelay(e){Q(u(this,Fe),e,!0)}setDomContext(e){X(this,se,e)}toggleOpen(){K(this,J,re).call(this),this.opts.open.current=!this.opts.open.current}handleClose(){K(this,J,re).call(this),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){K(this,J,re).call(this),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(K(this,J,re).call(this),this.closeDelay<=0?this.opts.open.current=!1:u(this,se)&&X(this,ne,u(this,se).setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),X(this,ne,null)},this.closeDelay))))}cancelDelayedClose(){K(this,J,re).call(this)}markInteraction(){this.hasInteractedWithContent=!0,K(this,J,re).call(this)}};Pe=new WeakMap,ye=new WeakMap,Oe=new WeakMap,_e=new WeakMap,we=new WeakMap,Ae=new WeakMap,Fe=new WeakMap,ne=new WeakMap,se=new WeakMap,J=new WeakSet,re=function(){u(this,ne)!==null&&u(this,se)&&(u(this,se).clearTimeout(u(this,ne)),X(this,ne,null))};let qe=je;var ie,ve,le,q,ze,Le,Qe,pt,be;const Je=class Je{constructor(e,t){F(this,q);R(this,"opts");R(this,"root");R(this,"attachment");R(this,"domContext");F(this,ie,null);F(this,ve,null);F(this,le,oe(!1));F(this,be,x(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":xt(this.root.opts.open.current),"data-state":at(this.root.opts.open.current),"aria-controls":K(this,q,pt).call(this),[Ge.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment})));this.opts=e,this.root=t,this.attachment=it(this.opts.ref,i=>this.root.triggerNode=i),this.domContext=new bt(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),lt(()=>this.opts.closeDelay.current,i=>{this.root.closeDelay=i})}static create(e){return new Je(e,Ye.get())}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Ke(e)||(Q(u(this,le),!0),K(this,q,Le).call(this),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():X(this,ie,this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),X(this,ie,null)},t))}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Ke(e)||(Q(u(this,le),!1),K(this,q,ze).call(this),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(K(this,q,Qe).call(this),c(u(this,le))&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}c(u(this,le))&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===St||e.key===It)&&(e.preventDefault(),K(this,q,Qe).call(this),this.root.toggleOpen())}get props(){return c(u(this,be))}set props(e){Q(u(this,be),e)}};ie=new WeakMap,ve=new WeakMap,le=new WeakMap,q=new WeakSet,ze=function(){u(this,ie)!==null&&(this.domContext.clearTimeout(u(this,ie)),X(this,ie,null))},Le=function(){u(this,ve)!==null&&(this.domContext.clearTimeout(u(this,ve)),X(this,ve,null))},Qe=function(){K(this,q,ze).call(this),K(this,q,Le).call(this)},pt=function(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id},be=new WeakMap;let tt=Je;var Se,Ie;const Xe=class Xe{constructor(e,t){R(this,"opts");R(this,"root");R(this,"attachment");R(this,"onInteractOutside",e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!Be(e.target))return;const t=e.target.closest(Ge.selector("trigger"));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Be(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current=="string"){const i=document.querySelector(this.opts.customAnchor.current);if(i&&i.contains(e.target))return}}this.root.handleClose()}});R(this,"onEscapeKeydown",e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()});F(this,Se,x(()=>({open:this.root.opts.open.current})));F(this,Ie,x(()=>({id:this.opts.id.current,tabindex:-1,"data-state":at(this.root.opts.open.current),...Ft(this.root.contentPresence.transitionStatus),[Ge.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment})));R(this,"popperProps",{onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown});this.opts=e,this.root=t,this.attachment=it(this.opts.ref,i=>this.root.contentNode=i),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new wt({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}static create(e){return new Xe(e,Ye.get())}onpointerdown(e){this.root.markInteraction()}onfocusin(e){const t=e.target;Be(t)&&At(t)&&this.root.markInteraction()}onpointerenter(e){Ke(e)||this.root.cancelDelayedClose()}onpointerleave(e){Ke(e)}get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}get snippetProps(){return c(u(this,Se))}set snippetProps(e){Q(u(this,Se),e)}get props(){return c(u(this,Ie))}set props(e){Q(u(this,Ie),e)}};Se=new WeakMap,Ie=new WeakMap;let Re=Xe;var Rt=new Set(["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]),ot=st("<div><div><!></div></div>");function Ue(s,e){const t=nt();if(new.target)return xe({component:Ue,...s});Te(e,!0);let i=r(e,"child",7),m=r(e,"children",7),f=r(e,"ref",15,null),O=r(e,"id",23,()=>ke(t)),p=r(e,"forceMount",7,!1),_=r(e,"onOpenAutoFocus",7,b),w=r(e,"onCloseAutoFocus",7,b),h=r(e,"onEscapeKeydown",7,b),E=r(e,"onInteractOutside",7,b),k=r(e,"trapFocus",7,!0),z=r(e,"preventScroll",7,!1),L=r(e,"customAnchor",7,null),g=r(e,"style",7),ee=Ve(e,Rt);const S=Re.create({id:V(()=>O()),ref:V(()=>f(),o=>f(o)),onInteractOutside:V(()=>E()),onEscapeKeydown:V(()=>h()),customAnchor:V(()=>L())}),te=x(()=>ge(ee,S.props)),ce=x(()=>k()&&S.shouldTrapFocus);function pe(o){S.shouldTrapFocus||o.preventDefault(),_()(o)}var me={get child(){return i()},set child(o){i(o),n()},get children(){return m()},set children(o){m(o),n()},get ref(){return f()},set ref(o=null){f(o),n()},get id(){return O()},set id(o=ke(t)){O(o),n()},get forceMount(){return p()},set forceMount(o=!1){p(o),n()},get onOpenAutoFocus(){return _()},set onOpenAutoFocus(o=b){_(o),n()},get onCloseAutoFocus(){return w()},set onCloseAutoFocus(o=b){w(o),n()},get onEscapeKeydown(){return h()},set onEscapeKeydown(o=b){h(o),n()},get onInteractOutside(){return E()},set onInteractOutside(o=b){E(o),n()},get trapFocus(){return k()},set trapFocus(o=!0){k(o),n()},get preventScroll(){return z()},set preventScroll(o=!1){z(o),n()},get customAnchor(){return L()},set customAnchor(o=null){L(o),n()},get style(){return g()},set style(o){g(o),n()},$set:Ee,$on:(o,N)=>He(e,o,N)},a=P(),l=y(a);{var H=o=>{ut(o,Z(()=>c(te),()=>S.popperProps,{get ref(){return S.opts.ref},get enabled(){return S.root.opts.open.current},get id(){return O()},get trapFocus(){return c(ce)},get preventScroll(){return z()},loop:!0,forceMount:!0,get customAnchor(){return L()},onOpenAutoFocus:pe,get onCloseAutoFocus(){return w()},get shouldRender(){return S.shouldRender},popper:(A,W)=>{let M=()=>(W?.()).props,T=()=>(W?.()).wrapperProps;const C=x(()=>ge(M(),{style:Me("popover")},{style:g()}));var v=P(),B=y(v);{var Y=D=>{var I=P(),j=y(I);{let ae=x(()=>({props:c(C),wrapperProps:T(),...S.snippetProps}));G(j,i,()=>c(ae))}d(D,I)},Ne=D=>{var I=ot();fe(I,()=>({...T()}));var j=he(I);fe(j,()=>({...c(C)}));var ae=he(j);G(ae,()=>m()??$),de(j),de(I),d(D,I)};ue(B,D=>{i()?D(Y):D(Ne,-1)})}d(A,v)},$$slots:{popper:!0}}))},U=o=>{ct(o,Z(()=>c(te),()=>S.popperProps,{get ref(){return S.opts.ref},get open(){return S.root.opts.open.current},get id(){return O()},get trapFocus(){return c(ce)},get preventScroll(){return z()},loop:!0,forceMount:!1,get customAnchor(){return L()},onOpenAutoFocus:pe,get onCloseAutoFocus(){return w()},get shouldRender(){return S.shouldRender},popper:(A,W)=>{let M=()=>(W?.()).props,T=()=>(W?.()).wrapperProps;const C=x(()=>ge(M(),{style:Me("popover")},{style:g()}));var v=P(),B=y(v);{var Y=D=>{var I=P(),j=y(I);{let ae=x(()=>({props:c(C),wrapperProps:T(),...S.snippetProps}));G(j,i,()=>c(ae))}d(D,I)},Ne=D=>{var I=ot();fe(I,()=>({...T()}));var j=he(I);fe(j,()=>({...c(C)}));var ae=he(j);G(ae,()=>m()??$),de(j),de(I),d(D,I)};ue(B,D=>{i()?D(Y):D(Ne,-1)})}d(A,v)},$$slots:{popper:!0}}))};ue(l,o=>{p()?o(H):p()||o(U,1)})}return d(s,a),De(me)}var Vt=new Set(["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","style"]),rt=st("<div><!></div>");function ht(s,e){const t=nt();if(new.target)return xe({component:ht,...s});Te(e,!0);let i=r(e,"child",7),m=r(e,"children",7),f=r(e,"ref",15,null),O=r(e,"id",23,()=>ke(t)),p=r(e,"forceMount",7,!1),_=r(e,"onCloseAutoFocus",7,b),w=r(e,"onEscapeKeydown",7,b),h=r(e,"onInteractOutside",7,b),E=r(e,"trapFocus",7,!0),k=r(e,"preventScroll",7,!1),z=r(e,"style",7),L=Ve(e,Vt);const g=Re.create({id:V(()=>O()),ref:V(()=>f(),a=>f(a)),onInteractOutside:V(()=>h()),onEscapeKeydown:V(()=>w()),customAnchor:V(()=>null)}),ee=x(()=>ge(L,g.props));var S={get child(){return i()},set child(a){i(a),n()},get children(){return m()},set children(a){m(a),n()},get ref(){return f()},set ref(a=null){f(a),n()},get id(){return O()},set id(a=ke(t)){O(a),n()},get forceMount(){return p()},set forceMount(a=!1){p(a),n()},get onCloseAutoFocus(){return _()},set onCloseAutoFocus(a=b){_(a),n()},get onEscapeKeydown(){return w()},set onEscapeKeydown(a=b){w(a),n()},get onInteractOutside(){return h()},set onInteractOutside(a=b){h(a),n()},get trapFocus(){return E()},set trapFocus(a=!0){E(a),n()},get preventScroll(){return k()},set preventScroll(a=!1){k(a),n()},get style(){return z()},set style(a){z(a),n()},$set:Ee,$on:(a,l)=>He(e,a,l)},te=P(),ce=y(te);{var pe=a=>{ut(a,Z(()=>c(ee),()=>g.popperProps,{get ref(){return g.opts.ref},isStatic:!0,get enabled(){return g.root.opts.open.current},get id(){return O()},get trapFocus(){return E()},get preventScroll(){return k()},loop:!0,forceMount:!0,get onCloseAutoFocus(){return _()},get shouldRender(){return g.shouldRender},popper:(H,U)=>{let o=()=>(U?.()).props;const N=x(()=>ge(o(),{style:Me("popover")},{style:z()}));var A=P(),W=y(A);{var M=C=>{var v=P(),B=y(v);{let Y=x(()=>({props:c(N),...g.snippetProps}));G(B,i,()=>c(Y))}d(C,v)},T=C=>{var v=rt();fe(v,()=>({...c(N)}));var B=he(v);G(B,()=>m()??$),de(v),d(C,v)};ue(W,C=>{i()?C(M):C(T,-1)})}d(H,A)},$$slots:{popper:!0}}))},me=a=>{ct(a,Z(()=>c(ee),()=>g.popperProps,{get ref(){return g.opts.ref},isStatic:!0,get open(){return g.root.opts.open.current},get id(){return O()},get trapFocus(){return E()},get preventScroll(){return k()},loop:!0,forceMount:!1,get onCloseAutoFocus(){return _()},get shouldRender(){return g.shouldRender},popper:(H,U)=>{let o=()=>(U?.()).props;const N=x(()=>ge(o(),{style:Me("popover")},{style:z()}));var A=P(),W=y(A);{var M=C=>{var v=P(),B=y(v);{let Y=x(()=>({props:c(N),...g.snippetProps}));G(B,i,()=>c(Y))}d(C,v)},T=C=>{var v=rt();fe(v,()=>({...c(N)}));var B=he(v);G(B,()=>m()??$),de(v),d(C,v)};ue(W,C=>{i()?C(M):C(T,-1)})}d(H,A)},$$slots:{popper:!0}}))};ue(ce,a=>{p()?a(pe):p()||a(me,1)})}return d(s,te),De(S)}function dt(s,e){if(new.target)return xe({component:dt,...s});Te(e,!0);let t=r(e,"open",15,!1),i=r(e,"onOpenChange",7,b),m=r(e,"onOpenChangeComplete",7,b),f=r(e,"children",7);qe.create({open:V(()=>t(),p=>{t(p),i()(p)}),onOpenChangeComplete:V(()=>m())});var O={get open(){return t()},set open(p=!1){t(p),n()},get onOpenChange(){return i()},set onOpenChange(p=b){i(p),n()},get onOpenChangeComplete(){return m()},set onOpenChangeComplete(p=b){m(p),n()},get children(){return f()},set children(p){f(p),n()},$set:Ee,$on:(p,_)=>He(e,p,_)};return Ht(s,{children:(p,_)=>{var w=P(),h=y(w);G(h,()=>f()??$),d(p,w)},$$slots:{default:!0}}),De(O)}var Wt=new Set(["$$slots","$$events","$$legacy","open","staticPosition","children","onOpenChange"]);function Bt(s,e){if(new.target)return xe({component:Bt,...s});Te(e,!0);let t=r(e,"open",15,!1),i=r(e,"staticPosition",7,!1),m=r(e,"children",7),f=r(e,"onOpenChange",7),O=Ve(e,Wt);yt(()=>i()),mt(()=>{t(!1),f()?.(!1)});var p={get open(){return t()},set open(h=!1){t(h),n()},get staticPosition(){return i()},set staticPosition(h=!1){i(h),n()},get children(){return m()},set children(h){m(h),n()},get onOpenChange(){return f()},set onOpenChange(h){f(h),n()},$set:Ee,$on:(h,E)=>He(e,h,E)},_=P(),w=y(_);return Ce(w,()=>dt,(h,E)=>{E(h,Z({get onOpenChange(){return f()}},()=>O,{get open(){return t()},set open(k){t(k)},children:(k,z)=>{var L=P(),g=y(L);G(g,()=>m()??$),d(k,L)},$$slots:{default:!0}}))}),d(s,_),De(p)}var Gt=new Set(["$$slots","$$events","$$legacy","ref","class","portal","portalProps","staticPosition","sideOffset","collisionPadding","children"]);function qt(s,e){if(new.target)return xe({component:qt,...s});Te(e,!0);let t=r(e,"ref",15,null),i=r(e,"class",7),m=r(e,"portal",7,!0),f=r(e,"portalProps",7),O=r(e,"staticPosition",7),p=r(e,"sideOffset",7,4),_=r(e,"collisionPadding",7,et),w=r(e,"children",7),h=Ve(e,Gt);const E=Ct(),k=Pt();vt(()=>{const l=t();if(!(!l||!E))return E.register(l,k)});const z=Ot(),L=x(()=>O()??z()),g=Kt(kt()+2);Mt(g);const ee=x(()=>Dt(Nt(),i()));var S={get ref(){return t()},set ref(l=null){t(l),n()},get class(){return i()},set class(l){i(l),n()},get portal(){return m()},set portal(l=!0){m(l),n()},get portalProps(){return f()},set portalProps(l){f(l),n()},get staticPosition(){return O()},set staticPosition(l){O(l),n()},get sideOffset(){return p()},set sideOffset(l=4){p(l),n()},get collisionPadding(){return _()},set collisionPadding(l=et){_(l),n()},get children(){return w()},set children(l){w(l),n()},$set:Ee,$on:(l,H)=>He(e,l,H)},te=P(),ce=y(te);{var pe=l=>{var H=P(),U=y(H);Ce(U,()=>ht,(o,N)=>{N(o,Z({preventScroll:!1,trapFocus:!1,"data-slot":"popover-content","data-static-position":!0,get"data-surface-level"(){return g},get class(){return c(ee)}},()=>h,{get ref(){return t()},set ref(A){t(A)},children:(A,W)=>{var M=P(),T=y(M);G(T,()=>w()??$),d(A,M)},$$slots:{default:!0}}))}),d(l,H)},me=l=>{var H=P(),U=y(H);{let o=x(()=>f()?.to??E?.target());Ce(U,()=>Tt,(N,A)=>{A(N,Z(f,{get to(){return c(o)},children:(W,M)=>{var T=P(),C=y(T);Ce(C,()=>Ue,(v,B)=>{B(v,Z({"data-slot":"popover-content",get"data-surface-level"(){return g},get class(){return c(ee)},get sideOffset(){return p()},get collisionPadding(){return _()}},()=>h,{get ref(){return t()},set ref(Y){t(Y)},children:(Y,Ne)=>{var D=P(),I=y(D);G(I,()=>w()??$),d(Y,D)},$$slots:{default:!0}}))}),d(W,T)},$$slots:{default:!0}}))})}d(l,H)},a=l=>{var H=P(),U=y(H);Ce(U,()=>Ue,(o,N)=>{N(o,Z({"data-slot":"popover-content",get"data-surface-level"(){return g},get class(){return c(ee)},get sideOffset(){return p()},get collisionPadding(){return _()}},()=>h,{get ref(){return t()},set ref(A){t(A)},children:(A,W)=>{var M=P(),T=y(M);G(T,()=>w()??$),d(A,M)},$$slots:{default:!0}}))}),d(l,H)};ue(ce,l=>{c(L)?l(pe):m()?l(me,1):l(a,-1)})}return d(s,te),De(S)}export{dt as P,tt as a,Ue as b,qt as c,Bt as d};
|
|
1
|
+
var ft=Object.defineProperty;var Ze=s=>{throw TypeError(s)};var gt=(s,e,t)=>e in s?ft(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var R=(s,e,t)=>gt(s,typeof e!="symbol"?e+"":e,t),We=(s,e,t)=>e.has(s)||Ze("Cannot "+t);var u=(s,e,t)=>(We(s,e,"read from private field"),t?t.call(s):e.get(s)),F=(s,e,t)=>e.has(s)?Ze("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),X=(s,e,t,i)=>(We(s,e,"write to private field"),i?i.call(s,t):e.set(s,t),t),K=(s,e,t)=>(We(s,e,"access private method"),t);import{t as xe,bo as r,bw as Ee,b as He,br as Z,bp as Ve}from"./51_h0jm2.js";import{c9 as x,aD as c,bH as Q,bV as oe,bo as nt,bs as Te,a7 as P,ay as y,W as d,bn as De,aA as n,a5 as he,bf as $,bA as de,aB as st,ca as vt}from"./CJxGDkBm.js";import{s as G}from"./DxvSggY5.js";import{c as Ce}from"./DGmOjLYi.js";import{s as mt,i as Ct,h as Pt}from"./BaGw_bDr.js";import{p as yt,u as Ot}from"./BLb6jd9K.js";import{h as _t,an as it,a8 as wt,aK as Be,aO as At,aP as Ke,aG as Ft,aF as at,a2 as $e,av as V,a$ as lt,D as bt,l as St,a6 as It,ar as xt,ay as Et,az as ke,aS as b,a0 as ut,$ as ct,aQ as ge,aH as Me,H as Ht,a1 as Tt}from"./BnA9v3pc.js";import{i as ue}from"./PXCFrn2V.js";import{b as fe,e as Dt}from"./CpPNoOk-.js";import{b as Nt}from"./BROVvkEL.js";import{c as Kt,u as kt,s as Mt}from"./DJfJ5NWH.js";import{O as et}from"./BIY9btQv.js";const Ge=Et({component:"popover",parts:["root","trigger","content","close","overlay"]}),Ye=new _t("Popover.Root");var Pe,ye,Oe,_e,we,Ae,Fe,ne,se,J,re;const je=class je{constructor(e){F(this,J);R(this,"opts");F(this,Pe,oe(null));R(this,"contentPresence");F(this,ye,oe(null));F(this,Oe,oe(null));R(this,"overlayPresence");F(this,_e,oe(!1));F(this,we,oe(!1));F(this,Ae,oe(!1));F(this,Fe,oe(0));F(this,ne,null);F(this,se,null);this.opts=e,this.contentPresence=new $e({ref:V(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new $e({ref:V(()=>this.overlayNode),open:this.opts.open}),lt(()=>this.opts.open.current,t=>{t||(this.openedViaHover=!1,this.hasInteractedWithContent=!1,K(this,J,re).call(this))})}static create(e){return Ye.set(new je(e))}get contentNode(){return c(u(this,Pe))}set contentNode(e){Q(u(this,Pe),e,!0)}get triggerNode(){return c(u(this,ye))}set triggerNode(e){Q(u(this,ye),e,!0)}get overlayNode(){return c(u(this,Oe))}set overlayNode(e){Q(u(this,Oe),e,!0)}get openedViaHover(){return c(u(this,_e))}set openedViaHover(e){Q(u(this,_e),e,!0)}get hasInteractedWithContent(){return c(u(this,we))}set hasInteractedWithContent(e){Q(u(this,we),e,!0)}get hoverCooldown(){return c(u(this,Ae))}set hoverCooldown(e){Q(u(this,Ae),e,!0)}get closeDelay(){return c(u(this,Fe))}set closeDelay(e){Q(u(this,Fe),e,!0)}setDomContext(e){X(this,se,e)}toggleOpen(){K(this,J,re).call(this),this.opts.open.current=!this.opts.open.current}handleClose(){K(this,J,re).call(this),this.opts.open.current&&(this.opts.open.current=!1)}handleHoverOpen(){K(this,J,re).call(this),!this.opts.open.current&&(this.openedViaHover=!0,this.opts.open.current=!0)}handleHoverClose(){this.opts.open.current&&this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1)}handleDelayedHoverClose(){this.opts.open.current&&(!this.openedViaHover||this.hasInteractedWithContent||(K(this,J,re).call(this),this.closeDelay<=0?this.opts.open.current=!1:u(this,se)&&X(this,ne,u(this,se).setTimeout(()=>{this.openedViaHover&&!this.hasInteractedWithContent&&(this.opts.open.current=!1),X(this,ne,null)},this.closeDelay))))}cancelDelayedClose(){K(this,J,re).call(this)}markInteraction(){this.hasInteractedWithContent=!0,K(this,J,re).call(this)}};Pe=new WeakMap,ye=new WeakMap,Oe=new WeakMap,_e=new WeakMap,we=new WeakMap,Ae=new WeakMap,Fe=new WeakMap,ne=new WeakMap,se=new WeakMap,J=new WeakSet,re=function(){u(this,ne)!==null&&u(this,se)&&(u(this,se).clearTimeout(u(this,ne)),X(this,ne,null))};let qe=je;var ie,ve,le,q,ze,Le,Qe,pt,be;const Je=class Je{constructor(e,t){F(this,q);R(this,"opts");R(this,"root");R(this,"attachment");R(this,"domContext");F(this,ie,null);F(this,ve,null);F(this,le,oe(!1));F(this,be,x(()=>({id:this.opts.id.current,"aria-haspopup":"dialog","aria-expanded":xt(this.root.opts.open.current),"data-state":at(this.root.opts.open.current),"aria-controls":K(this,q,pt).call(this),[Ge.trigger]:"",disabled:this.opts.disabled.current,onkeydown:this.onkeydown,onclick:this.onclick,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment})));this.opts=e,this.root=t,this.attachment=it(this.opts.ref,i=>this.root.triggerNode=i),this.domContext=new bt(e.ref),this.root.setDomContext(this.domContext),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),lt(()=>this.opts.closeDelay.current,i=>{this.root.closeDelay=i})}static create(e){return new Je(e,Ye.get())}onpointerenter(e){if(this.opts.disabled.current||!this.opts.openOnHover.current||Ke(e)||(Q(u(this,le),!0),K(this,q,Le).call(this),this.root.cancelDelayedClose(),this.root.opts.open.current||this.root.hoverCooldown))return;const t=this.opts.openDelay.current;t<=0?this.root.handleHoverOpen():X(this,ie,this.domContext.setTimeout(()=>{this.root.handleHoverOpen(),X(this,ie,null)},t))}onpointerleave(e){this.opts.disabled.current||this.opts.openOnHover.current&&(Ke(e)||(Q(u(this,le),!1),K(this,q,ze).call(this),this.root.hoverCooldown=!1))}onclick(e){if(!this.opts.disabled.current&&e.button===0){if(K(this,q,Qe).call(this),c(u(this,le))&&this.root.opts.open.current&&this.root.openedViaHover){this.root.openedViaHover=!1,this.root.hasInteractedWithContent=!0;return}c(u(this,le))&&this.opts.openOnHover.current&&this.root.opts.open.current&&(this.root.hoverCooldown=!0),this.root.hoverCooldown&&!this.root.opts.open.current&&(this.root.hoverCooldown=!1),this.root.toggleOpen()}}onkeydown(e){this.opts.disabled.current||(e.key===St||e.key===It)&&(e.preventDefault(),K(this,q,Qe).call(this),this.root.toggleOpen())}get props(){return c(u(this,be))}set props(e){Q(u(this,be),e)}};ie=new WeakMap,ve=new WeakMap,le=new WeakMap,q=new WeakSet,ze=function(){u(this,ie)!==null&&(this.domContext.clearTimeout(u(this,ie)),X(this,ie,null))},Le=function(){u(this,ve)!==null&&(this.domContext.clearTimeout(u(this,ve)),X(this,ve,null))},Qe=function(){K(this,q,ze).call(this),K(this,q,Le).call(this)},pt=function(){if(this.root.opts.open.current&&this.root.contentNode?.id)return this.root.contentNode?.id},be=new WeakMap;let tt=Je;var Se,Ie;const Xe=class Xe{constructor(e,t){R(this,"opts");R(this,"root");R(this,"attachment");R(this,"onInteractOutside",e=>{if(this.opts.onInteractOutside.current(e),e.defaultPrevented||!Be(e.target))return;const t=e.target.closest(Ge.selector("trigger"));if(!(t&&t===this.root.triggerNode)){if(this.opts.customAnchor.current){if(Be(this.opts.customAnchor.current)){if(this.opts.customAnchor.current.contains(e.target))return}else if(typeof this.opts.customAnchor.current=="string"){const i=document.querySelector(this.opts.customAnchor.current);if(i&&i.contains(e.target))return}}this.root.handleClose()}});R(this,"onEscapeKeydown",e=>{this.opts.onEscapeKeydown.current(e),!e.defaultPrevented&&this.root.handleClose()});F(this,Se,x(()=>({open:this.root.opts.open.current})));F(this,Ie,x(()=>({id:this.opts.id.current,tabindex:-1,"data-state":at(this.root.opts.open.current),...Ft(this.root.contentPresence.transitionStatus),[Ge.content]:"",style:{pointerEvents:"auto",contain:"layout style"},onpointerdown:this.onpointerdown,onfocusin:this.onfocusin,onpointerenter:this.onpointerenter,onpointerleave:this.onpointerleave,...this.attachment})));R(this,"popperProps",{onInteractOutside:this.onInteractOutside,onEscapeKeydown:this.onEscapeKeydown});this.opts=e,this.root=t,this.attachment=it(this.opts.ref,i=>this.root.contentNode=i),this.onpointerdown=this.onpointerdown.bind(this),this.onfocusin=this.onfocusin.bind(this),this.onpointerenter=this.onpointerenter.bind(this),this.onpointerleave=this.onpointerleave.bind(this),new wt({triggerNode:()=>this.root.triggerNode,contentNode:()=>this.root.contentNode,enabled:()=>this.root.opts.open.current&&this.root.openedViaHover&&!this.root.hasInteractedWithContent,onPointerExit:()=>{this.root.handleDelayedHoverClose()}})}static create(e){return new Xe(e,Ye.get())}onpointerdown(e){this.root.markInteraction()}onfocusin(e){const t=e.target;Be(t)&&At(t)&&this.root.markInteraction()}onpointerenter(e){Ke(e)||this.root.cancelDelayedClose()}onpointerleave(e){Ke(e)}get shouldRender(){return this.root.contentPresence.shouldRender}get shouldTrapFocus(){return!(this.root.openedViaHover&&!this.root.hasInteractedWithContent)}get snippetProps(){return c(u(this,Se))}set snippetProps(e){Q(u(this,Se),e)}get props(){return c(u(this,Ie))}set props(e){Q(u(this,Ie),e)}};Se=new WeakMap,Ie=new WeakMap;let Re=Xe;var Rt=new Set(["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","customAnchor","style"]),ot=st("<div><div><!></div></div>");function Ue(s,e){const t=nt();if(new.target)return xe({component:Ue,...s});Te(e,!0);let i=r(e,"child",7),m=r(e,"children",7),f=r(e,"ref",15,null),O=r(e,"id",23,()=>ke(t)),p=r(e,"forceMount",7,!1),_=r(e,"onOpenAutoFocus",7,b),w=r(e,"onCloseAutoFocus",7,b),h=r(e,"onEscapeKeydown",7,b),E=r(e,"onInteractOutside",7,b),k=r(e,"trapFocus",7,!0),z=r(e,"preventScroll",7,!1),L=r(e,"customAnchor",7,null),g=r(e,"style",7),ee=Ve(e,Rt);const S=Re.create({id:V(()=>O()),ref:V(()=>f(),o=>f(o)),onInteractOutside:V(()=>E()),onEscapeKeydown:V(()=>h()),customAnchor:V(()=>L())}),te=x(()=>ge(ee,S.props)),ce=x(()=>k()&&S.shouldTrapFocus);function pe(o){S.shouldTrapFocus||o.preventDefault(),_()(o)}var me={get child(){return i()},set child(o){i(o),n()},get children(){return m()},set children(o){m(o),n()},get ref(){return f()},set ref(o=null){f(o),n()},get id(){return O()},set id(o=ke(t)){O(o),n()},get forceMount(){return p()},set forceMount(o=!1){p(o),n()},get onOpenAutoFocus(){return _()},set onOpenAutoFocus(o=b){_(o),n()},get onCloseAutoFocus(){return w()},set onCloseAutoFocus(o=b){w(o),n()},get onEscapeKeydown(){return h()},set onEscapeKeydown(o=b){h(o),n()},get onInteractOutside(){return E()},set onInteractOutside(o=b){E(o),n()},get trapFocus(){return k()},set trapFocus(o=!0){k(o),n()},get preventScroll(){return z()},set preventScroll(o=!1){z(o),n()},get customAnchor(){return L()},set customAnchor(o=null){L(o),n()},get style(){return g()},set style(o){g(o),n()},$set:Ee,$on:(o,N)=>He(e,o,N)},a=P(),l=y(a);{var H=o=>{ut(o,Z(()=>c(te),()=>S.popperProps,{get ref(){return S.opts.ref},get enabled(){return S.root.opts.open.current},get id(){return O()},get trapFocus(){return c(ce)},get preventScroll(){return z()},loop:!0,forceMount:!0,get customAnchor(){return L()},onOpenAutoFocus:pe,get onCloseAutoFocus(){return w()},get shouldRender(){return S.shouldRender},popper:(A,W)=>{let M=()=>(W?.()).props,T=()=>(W?.()).wrapperProps;const C=x(()=>ge(M(),{style:Me("popover")},{style:g()}));var v=P(),B=y(v);{var Y=D=>{var I=P(),j=y(I);{let ae=x(()=>({props:c(C),wrapperProps:T(),...S.snippetProps}));G(j,i,()=>c(ae))}d(D,I)},Ne=D=>{var I=ot();fe(I,()=>({...T()}));var j=he(I);fe(j,()=>({...c(C)}));var ae=he(j);G(ae,()=>m()??$),de(j),de(I),d(D,I)};ue(B,D=>{i()?D(Y):D(Ne,-1)})}d(A,v)},$$slots:{popper:!0}}))},U=o=>{ct(o,Z(()=>c(te),()=>S.popperProps,{get ref(){return S.opts.ref},get open(){return S.root.opts.open.current},get id(){return O()},get trapFocus(){return c(ce)},get preventScroll(){return z()},loop:!0,forceMount:!1,get customAnchor(){return L()},onOpenAutoFocus:pe,get onCloseAutoFocus(){return w()},get shouldRender(){return S.shouldRender},popper:(A,W)=>{let M=()=>(W?.()).props,T=()=>(W?.()).wrapperProps;const C=x(()=>ge(M(),{style:Me("popover")},{style:g()}));var v=P(),B=y(v);{var Y=D=>{var I=P(),j=y(I);{let ae=x(()=>({props:c(C),wrapperProps:T(),...S.snippetProps}));G(j,i,()=>c(ae))}d(D,I)},Ne=D=>{var I=ot();fe(I,()=>({...T()}));var j=he(I);fe(j,()=>({...c(C)}));var ae=he(j);G(ae,()=>m()??$),de(j),de(I),d(D,I)};ue(B,D=>{i()?D(Y):D(Ne,-1)})}d(A,v)},$$slots:{popper:!0}}))};ue(l,o=>{p()?o(H):p()||o(U,1)})}return d(s,a),De(me)}var Vt=new Set(["$$slots","$$events","$$legacy","child","children","ref","id","forceMount","onCloseAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","style"]),rt=st("<div><!></div>");function ht(s,e){const t=nt();if(new.target)return xe({component:ht,...s});Te(e,!0);let i=r(e,"child",7),m=r(e,"children",7),f=r(e,"ref",15,null),O=r(e,"id",23,()=>ke(t)),p=r(e,"forceMount",7,!1),_=r(e,"onCloseAutoFocus",7,b),w=r(e,"onEscapeKeydown",7,b),h=r(e,"onInteractOutside",7,b),E=r(e,"trapFocus",7,!0),k=r(e,"preventScroll",7,!1),z=r(e,"style",7),L=Ve(e,Vt);const g=Re.create({id:V(()=>O()),ref:V(()=>f(),a=>f(a)),onInteractOutside:V(()=>h()),onEscapeKeydown:V(()=>w()),customAnchor:V(()=>null)}),ee=x(()=>ge(L,g.props));var S={get child(){return i()},set child(a){i(a),n()},get children(){return m()},set children(a){m(a),n()},get ref(){return f()},set ref(a=null){f(a),n()},get id(){return O()},set id(a=ke(t)){O(a),n()},get forceMount(){return p()},set forceMount(a=!1){p(a),n()},get onCloseAutoFocus(){return _()},set onCloseAutoFocus(a=b){_(a),n()},get onEscapeKeydown(){return w()},set onEscapeKeydown(a=b){w(a),n()},get onInteractOutside(){return h()},set onInteractOutside(a=b){h(a),n()},get trapFocus(){return E()},set trapFocus(a=!0){E(a),n()},get preventScroll(){return k()},set preventScroll(a=!1){k(a),n()},get style(){return z()},set style(a){z(a),n()},$set:Ee,$on:(a,l)=>He(e,a,l)},te=P(),ce=y(te);{var pe=a=>{ut(a,Z(()=>c(ee),()=>g.popperProps,{get ref(){return g.opts.ref},isStatic:!0,get enabled(){return g.root.opts.open.current},get id(){return O()},get trapFocus(){return E()},get preventScroll(){return k()},loop:!0,forceMount:!0,get onCloseAutoFocus(){return _()},get shouldRender(){return g.shouldRender},popper:(H,U)=>{let o=()=>(U?.()).props;const N=x(()=>ge(o(),{style:Me("popover")},{style:z()}));var A=P(),W=y(A);{var M=C=>{var v=P(),B=y(v);{let Y=x(()=>({props:c(N),...g.snippetProps}));G(B,i,()=>c(Y))}d(C,v)},T=C=>{var v=rt();fe(v,()=>({...c(N)}));var B=he(v);G(B,()=>m()??$),de(v),d(C,v)};ue(W,C=>{i()?C(M):C(T,-1)})}d(H,A)},$$slots:{popper:!0}}))},me=a=>{ct(a,Z(()=>c(ee),()=>g.popperProps,{get ref(){return g.opts.ref},isStatic:!0,get open(){return g.root.opts.open.current},get id(){return O()},get trapFocus(){return E()},get preventScroll(){return k()},loop:!0,forceMount:!1,get onCloseAutoFocus(){return _()},get shouldRender(){return g.shouldRender},popper:(H,U)=>{let o=()=>(U?.()).props;const N=x(()=>ge(o(),{style:Me("popover")},{style:z()}));var A=P(),W=y(A);{var M=C=>{var v=P(),B=y(v);{let Y=x(()=>({props:c(N),...g.snippetProps}));G(B,i,()=>c(Y))}d(C,v)},T=C=>{var v=rt();fe(v,()=>({...c(N)}));var B=he(v);G(B,()=>m()??$),de(v),d(C,v)};ue(W,C=>{i()?C(M):C(T,-1)})}d(H,A)},$$slots:{popper:!0}}))};ue(ce,a=>{p()?a(pe):p()||a(me,1)})}return d(s,te),De(S)}function dt(s,e){if(new.target)return xe({component:dt,...s});Te(e,!0);let t=r(e,"open",15,!1),i=r(e,"onOpenChange",7,b),m=r(e,"onOpenChangeComplete",7,b),f=r(e,"children",7);qe.create({open:V(()=>t(),p=>{t(p),i()(p)}),onOpenChangeComplete:V(()=>m())});var O={get open(){return t()},set open(p=!1){t(p),n()},get onOpenChange(){return i()},set onOpenChange(p=b){i(p),n()},get onOpenChangeComplete(){return m()},set onOpenChangeComplete(p=b){m(p),n()},get children(){return f()},set children(p){f(p),n()},$set:Ee,$on:(p,_)=>He(e,p,_)};return Ht(s,{children:(p,_)=>{var w=P(),h=y(w);G(h,()=>f()??$),d(p,w)},$$slots:{default:!0}}),De(O)}var Wt=new Set(["$$slots","$$events","$$legacy","open","staticPosition","children","onOpenChange"]);function Bt(s,e){if(new.target)return xe({component:Bt,...s});Te(e,!0);let t=r(e,"open",15,!1),i=r(e,"staticPosition",7,!1),m=r(e,"children",7),f=r(e,"onOpenChange",7),O=Ve(e,Wt);yt(()=>i()),mt(()=>{t(!1),f()?.(!1)});var p={get open(){return t()},set open(h=!1){t(h),n()},get staticPosition(){return i()},set staticPosition(h=!1){i(h),n()},get children(){return m()},set children(h){m(h),n()},get onOpenChange(){return f()},set onOpenChange(h){f(h),n()},$set:Ee,$on:(h,E)=>He(e,h,E)},_=P(),w=y(_);return Ce(w,()=>dt,(h,E)=>{E(h,Z({get onOpenChange(){return f()}},()=>O,{get open(){return t()},set open(k){t(k)},children:(k,z)=>{var L=P(),g=y(L);G(g,()=>m()??$),d(k,L)},$$slots:{default:!0}}))}),d(s,_),De(p)}var Gt=new Set(["$$slots","$$events","$$legacy","ref","class","portal","portalProps","staticPosition","sideOffset","collisionPadding","children"]);function qt(s,e){if(new.target)return xe({component:qt,...s});Te(e,!0);let t=r(e,"ref",15,null),i=r(e,"class",7),m=r(e,"portal",7,!0),f=r(e,"portalProps",7),O=r(e,"staticPosition",7),p=r(e,"sideOffset",7,4),_=r(e,"collisionPadding",7,et),w=r(e,"children",7),h=Ve(e,Gt);const E=Ct(),k=Pt();vt(()=>{const l=t();if(!(!l||!E))return E.register(l,k)});const z=Ot(),L=x(()=>O()??z()),g=Kt(kt()+2);Mt(g);const ee=x(()=>Dt(Nt(),i()));var S={get ref(){return t()},set ref(l=null){t(l),n()},get class(){return i()},set class(l){i(l),n()},get portal(){return m()},set portal(l=!0){m(l),n()},get portalProps(){return f()},set portalProps(l){f(l),n()},get staticPosition(){return O()},set staticPosition(l){O(l),n()},get sideOffset(){return p()},set sideOffset(l=4){p(l),n()},get collisionPadding(){return _()},set collisionPadding(l=et){_(l),n()},get children(){return w()},set children(l){w(l),n()},$set:Ee,$on:(l,H)=>He(e,l,H)},te=P(),ce=y(te);{var pe=l=>{var H=P(),U=y(H);Ce(U,()=>ht,(o,N)=>{N(o,Z({preventScroll:!1,trapFocus:!1,"data-slot":"popover-content","data-static-position":!0,get"data-surface-level"(){return g},get class(){return c(ee)}},()=>h,{get ref(){return t()},set ref(A){t(A)},children:(A,W)=>{var M=P(),T=y(M);G(T,()=>w()??$),d(A,M)},$$slots:{default:!0}}))}),d(l,H)},me=l=>{var H=P(),U=y(H);{let o=x(()=>f()?.to??E?.target());Ce(U,()=>Tt,(N,A)=>{A(N,Z(f,{get to(){return c(o)},children:(W,M)=>{var T=P(),C=y(T);Ce(C,()=>Ue,(v,B)=>{B(v,Z({"data-slot":"popover-content",get"data-surface-level"(){return g},get class(){return c(ee)},get sideOffset(){return p()},get collisionPadding(){return _()}},()=>h,{get ref(){return t()},set ref(Y){t(Y)},children:(Y,Ne)=>{var D=P(),I=y(D);G(I,()=>w()??$),d(Y,D)},$$slots:{default:!0}}))}),d(W,T)},$$slots:{default:!0}}))})}d(l,H)},a=l=>{var H=P(),U=y(H);Ce(U,()=>Ue,(o,N)=>{N(o,Z({"data-slot":"popover-content",get"data-surface-level"(){return g},get class(){return c(ee)},get sideOffset(){return p()},get collisionPadding(){return _()}},()=>h,{get ref(){return t()},set ref(A){t(A)},children:(A,W)=>{var M=P(),T=y(M);G(T,()=>w()??$),d(A,M)},$$slots:{default:!0}}))}),d(l,H)};ue(ce,l=>{c(L)?l(pe):m()?l(me,1):l(a,-1)})}return d(s,te),De(S)}export{dt as P,tt as a,Ue as b,qt as c,Bt as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as $,bo as v,bw as w,b as A,br as P,bs as B,bq as W,bp as R}from"./51_h0jm2.js";import{bs as h,b_ as F,aD as p,W as f,bA as M,bn as y,c9 as x,aA as m,aB as g,bV as k,br as q,ca as E,bH as C,a5 as H,bl as L,bS as N,bO as U,ay as V}from"./CJxGDkBm.js";import{f as Y}from"./
|
|
1
|
+
import{t as $,bo as v,bw as w,b as A,br as P,bs as B,bq as W,bp as R}from"./51_h0jm2.js";import{bs as h,b_ as F,aD as p,W as f,bA as M,bn as y,c9 as x,aA as m,aB as g,bV as k,br as q,ca as E,bH as C,a5 as H,bl as L,bS as N,bO as U,ay as V}from"./CJxGDkBm.js";import{f as Y}from"./BnA9v3pc.js";import{Y as j}from"./rIUowGAi.js";import{F as G,cF as J}from"./DSQT151l.js";import{ay as K,aB as Q}from"./CAV1CzzW.js";import{f as X}from"./BqkCNgyL.js";import{g as Z,i as ee}from"./Bjy4ygfJ.js";import{s as te,g as se}from"./CpPNoOk-.js";import{a as z}from"./CoZeNthD.js";var ae=g('<span class="svelte-dywwvd"></span>'),re=g('<span class="waveform svelte-dywwvd" aria-hidden="true" data-dictation-waveform=""></span>');function T(c,e){if(new.target)return $({component:T,...c});h(e,!0);let n=v(e,"levels",7);const r=x(()=>{const t=n().slice(-z).map(a=>Number.isFinite(a)?Math.min(1,Math.max(0,a)):0);return[...new Array(z-t.length).fill(0),...t]});var l={get levels(){return n()},set levels(t){n(t),m()},$set:w,$on:(t,a)=>A(e,t,a)},o=re();return Z(o,21,()=>p(r),ee,(t,a)=>{var i=ae();let d;F(()=>{te(i,"data-level",p(a)),d=se(i,"",d,{height:`${2+p(a)*12}px`})}),f(t,i)}),M(o),f(c,o),y(l)}var ne=g('<span class="dictation-meter svelte-1oz1rct"><span class="elapsed svelte-1oz1rct" data-dictation-elapsed=""> </span> <!></span>');function I(c,e){if(new.target)return $({component:I,...c});h(e,!0);let n=v(e,"levels",7),r=v(e,"startedAt",7,null),l=v(e,"elapsed",7),o=k(q(Date.now()));E(()=>{if(!(l()!==void 0||r()===null))return C(o,Date.now(),!0),j.subscribe(new Date(r()),()=>C(o,Date.now(),!0),"second")});const t=x(()=>l()??X(r()===null?0:p(o)-r()));var a={get levels(){return n()},set levels(s){n(s),m()},get startedAt(){return r()},set startedAt(s=null){r(s),m()},get elapsed(){return l()},set elapsed(s){l(s),m()},$set:w,$on:(s,u)=>A(e,s,u)},i=ne(),d=H(i),_=L(d,!0),b=N(d,2);return T(b,{get levels(){return n()}}),M(i),F(()=>U(_,p(t))),f(c,i),y(a)}var le=new Set(["$$slots","$$events","$$legacy","class"]),oe=g("<!> <!>",1);function ie(c,e){if(new.target)return $({component:ie,...c});h(e,!0);const n=()=>B(i,"$levels$",l),r=()=>B(d,"$startedAt$",l),[l,o]=W();let t=v(e,"class",7,""),a=R(e,le);const i=K(),d=Q();var _={get class(){return t()},set class(s=""){t(s),m()},$set:w,$on:(s,u)=>A(e,s,u)};{let s=x(()=>`dictation-stop-pill ${t()}`.trim());Y(c,P({variant:"ghost",size:"sm",get class(){return p(s)},"aria-pressed":"true"},()=>a,{children:(u,ce)=>{var D=oe(),S=V(D);G(S,{get icon(){return J},size:14});var O=N(S,2);I(O,{get levels(){return n()},get startedAt(){return r()}}),f(u,D)},$$slots:{default:!0}}))}var b=y(_);return o(),b}export{I as D,ie as a};
|
|
@@ -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{x as Le,J as ce,Z as le,ai as z,ar as ve}from"./D2dAlclh.js";import{b_ as we,c_ as ue,cq as de,cp as be}from"./CMLBE7U6.js";import{J4 as p,BP as Fe,bD as ke,e as Pe,L9 as me,ie as Ee,bP as Ge,DK as H,Cc as xe,fc as Ve,Ai as Ue,dZ as fe,f8 as _e,dY as he,AN as Be,KP as $e,wf as Xe}from"./CbRsc9i4.js";import{aN as Se,dT as ge,A as K,P as Re,aJ as Q}from"./CgwFGLCK.js";import{h as Ye}from"./Cgn_eC9-.js";import{c as q}from"./ChTqQfQN.js";import{a as qe}from"./BdWqymET.js";import{m as Z}from"./BAymCgEX.js";import"./CJxGDkBm.js";import{bm as n}from"./51_h0jm2.js";import"./CpPNoOk-.js";import"./DxvSggY5.js";import"./D6dNunKo.js";import{R as pe}from"./B5aYN90J.js";import{L as We}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 j=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=j.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=j.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=j.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}"})}},Ze={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 je(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return je(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):Ze[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 Y 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&&Z.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}`,G=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&&!$&&Z.error(G),new Y(G,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&&Z.error(ee(a.message)),new Y(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 Y?[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 Y(`${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 We({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-"),W=e.worktreePath||e.repositoryPath||e.path;if(!h&&W){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:Pe.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],G={...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:{...G,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Ge(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()}`),W=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 Ye("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:W,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,P=T.turnId,L=typeof P=="string"?P: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,P=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===P));if(u()&&typeof P=="string"){const S=fe(s,t);A(_e(i,m.id,S,P,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:G})),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{x as Le,J as ce,Z as le,ai as z,ar as ve}from"./Cov6EESF.js";import{b_ as we,c_ as ue,cq as de,cp as be}from"./CmdzVgvT.js";import{J5 as p,BQ as Fe,bD as ke,e as Ge,La as me,ie as Ee,bP as Pe,DL as H,Cd as xe,fc as Ve,Aj as Ue,dZ as fe,f8 as _e,dY as he,AO as Be,KQ as $e,wg as Xe}from"./CI4_aI7e.js";import{aN as Se,dT as ge,A as K,P as Re,aJ as Q}from"./C2wWLl1x.js";import{h as Ye}from"./rIUowGAi.js";import{c as q}from"./ChTqQfQN.js";import{a as qe}from"./BdWqymET.js";import{m as j}from"./Cz-HgbT1.js";import"./CJxGDkBm.js";import{bm as n}from"./51_h0jm2.js";import"./CpPNoOk-.js";import"./DxvSggY5.js";import"./BLb6jd9K.js";import{R as pe}from"./B5aYN90J.js";import{L as We}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 Y 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 Y(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 Y(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 Y?[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 Y(`${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 We({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-"),W=e.worktreePath||e.repositoryPath||e.path;if(!h&&W){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()}`),W=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 Ye("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:W,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 +1 @@
|
|
|
1
|
-
import{t as V,bo as q,bm as H,bw as F,bq as dt,b as G,bs as nt}from"./51_h0jm2.js";import{bs as K,cd as lt,ca as z,c5 as ct,a5 as T,be as D,b$ as J,b_ as x,bO as _,W as l,bH as M,aD as e,bS as C,bA as B,bn as N,bV as it,aA as R,c9 as u,aB as b,bl as S,ay as pt}from"./CJxGDkBm.js";import{i as L}from"./PXCFrn2V.js";import{C as ut}from"./
|
|
1
|
+
import{t as V,bo as q,bm as H,bw as F,bq as dt,b as G,bs as nt}from"./51_h0jm2.js";import{bs as K,cd as lt,ca as z,c5 as ct,a5 as T,be as D,b$ as J,b_ as x,bO as _,W as l,bH as M,aD as e,bS as C,bA as B,bn as N,bV as it,aA as R,c9 as u,aB as b,bl as S,ay as pt}from"./CJxGDkBm.js";import{i as L}from"./PXCFrn2V.js";import{C as ut}from"./e_K38tqB.js";import{f as U}from"./BnA9v3pc.js";import"./rIUowGAi.js";import{k as bt}from"./D_pS9hme.js";import{J5 as W,dw as vt,du as kt,dx as _t}from"./CI4_aI7e.js";var gt=b('<p class="p-2 text-xs text-subtle" data-testid="hook-script-content-too-large"> </p>'),mt=b('<div class="min-h-0 min-w-0 flex-1 overflow-auto" data-testid="hook-script-content-script"><!></div>'),ft=b('<span class="text-xs font-medium text-danger"> </span> <pre class="whitespace-pre-wrap break-all rounded bg-danger-background/10 p-2 font-mono text-xs text-danger"> </pre>',1),xt=b('<pre class="whitespace-pre-wrap break-all rounded bg-muted/40 p-2 font-mono text-xs text-subtle"> </pre>'),ht=b('<p class="text-xs text-subtle"> </p>'),wt=b('<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto" data-testid="hook-script-content-logs"><!> <!></div>'),It=b('<div class="flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden" data-testid="hook-script-content"><div class="flex shrink-0 border-b border-border" role="tablist"><!> <!></div> <!></div>');function Q(h,c){if(new.target)return V({component:Q,...h});K(c,!0);const g=()=>nt($,"$hooks$",w),[w,E]=dt();let s=q(c,"workspaceId",7),I=q(c,"hookId",7);const d=lt(s());z(()=>d.set(s()));const $=bt(d),v=u(()=>g().find(t=>t.hookId===I()));z(()=>{if(!s())return;const t=s();return ct(()=>{W.dispatch(vt(t)),W.dispatch(kt(t))}),()=>W.dispatch(_t(t))});let k=it("script");var X={get workspaceId(){return s()},set workspaceId(t){s(t),R()},get hookId(){return I()},set hookId(t){I(t),R()},$set:F,$on:(t,r)=>G(c,t,r)},A=It(),O=T(A),j=T(O);{let t=u(()=>e(k)==="script"),r=u(()=>e(k)==="script"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");U(j,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>M(k,"script"),children:(p,y)=>{D();var i=J();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_scriptTab_label()]),l(p,i)},$$slots:{default:!0}})}var Y=C(j,2);{let t=u(()=>e(k)==="logs"),r=u(()=>e(k)==="logs"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");U(Y,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>M(k,"logs"),children:(p,y)=>{D();var i=J();x(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_logsTab_label()]),l(p,i)},$$slots:{default:!0}})}B(O);var Z=C(O,2);{var tt=t=>{var r=mt(),p=T(r);{var y=a=>{var m=gt(),o=S(m,!0);x(n=>_(o,n),[()=>H.chat_backgroundHooks_modal_codeTooLarge_description({size:(e(v).codeBytes??0).toLocaleString()})]),l(a,m)},i=a=>{{let m=u(()=>e(v)?.code??"");ut(a,{get code(){return e(m)},language:"javascript",noMargin:!0})}};L(p,a=>{e(v)?.codeOmitted?a(y):a(i,-1)})}B(r),l(t,r)},et=t=>{var r=wt(),p=T(r);{var y=o=>{var n=ft(),f=pt(n),P=S(f,!0),at=C(f,2),ot=S(at,!0);x(st=>{_(P,st),_(ot,e(v).lastError)},[()=>H.chat_backgroundHooks_modal_lastError_label()]),l(o,n)};L(p,o=>{e(v)?.lastError&&o(y)})}var i=C(p,2);{var a=o=>{var n=xt(),f=S(n,!0);x(()=>_(f,e(v).lastLogs)),l(o,n)},m=o=>{var n=ht(),f=S(n,!0);x(P=>_(f,P),[()=>H.chat_backgroundHooks_modal_noLogs_description()]),l(o,n)};L(i,o=>{e(v)?.lastLogs?o(a):o(m,-1)})}B(r),l(t,r)};L(Z,t=>{e(k)==="script"?t(tt):t(et,-1)})}B(A),l(h,A);var rt=N(X);return E(),rt}var $t=b('<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden p-4" data-testid="hook-script-panel"><!></div>');function yt(h,c){if(new.target)return V({component:yt,...h});K(c,!0);let g=q(c,"tab",7),w=q(c,"workspaceId",7);var E={get tab(){return g()},set tab(d){g(d),R()},get workspaceId(){return w()},set workspaceId(d){w(d),R()},$set:F,$on:(d,$)=>G(c,d,$)},s=$t(),I=T(s);{let d=u(()=>g().workspaceId??w()),$=u(()=>g().hookId??"");Q(I,{get workspaceId(){return e(d)},get hookId(){return e($)}})}return B(s),l(h,s),N(E)}export{yt as default};
|