@intent-hq/web 2.300.1 → 2.301.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{D24Lh2xV.js → -1vWYJiy.js} +1 -1
- package/web/app/immutable/chunks/{B00a-E5y.js → -8mBz6EW.js} +1 -1
- package/web/app/immutable/chunks/{seZ3kiWB.js → 2Iga5834.js} +1 -1
- package/web/app/immutable/chunks/{DD_wk1WS.js → 3-bIA0_b.js} +2 -2
- package/web/app/immutable/chunks/{VIc8fDOK.js → 3cwLWYk-.js} +1 -1
- package/web/app/immutable/chunks/{uuGBA4cr.js → 4byfznQh.js} +1 -1
- package/web/app/immutable/chunks/{D_HBTAOp.js → 6WuGSm1v.js} +2 -2
- package/web/app/immutable/chunks/{CoKvDYIY.js → 6hOEL6g0.js} +1 -1
- package/web/app/immutable/chunks/{CtPUg4ad.js → 8FC2Ymrs.js} +1 -1
- package/web/app/immutable/chunks/{XRDpypMz.js → 90FT2TPG.js} +2 -2
- package/web/app/immutable/chunks/{7lKdD900.js → 9Bp-qw-c.js} +1 -1
- package/web/app/immutable/chunks/{B6GFXjaE.js → 9pcH5qab.js} +4 -4
- package/web/app/immutable/chunks/{CHHzckiT.js → Alw6Bgam.js} +1 -1
- package/web/app/immutable/chunks/{DOb83nqS.js → B-pxGJ33.js} +1 -1
- package/web/app/immutable/chunks/{CTb5E7ts.js → B1f-Dpa6.js} +1 -1
- package/web/app/immutable/chunks/{C7jsu14h.js → B1ySs1Ps.js} +1 -1
- package/web/app/immutable/chunks/{6bctAAQ4.js → B3pWDt4A.js} +2 -2
- package/web/app/immutable/chunks/{BVR4ypbe.js → B5FPkuba.js} +1 -1
- package/web/app/immutable/chunks/{Ca7foKhO.js → B5gRIzZb.js} +1 -1
- package/web/app/immutable/chunks/{Cr3qamxz.js → B6wnyXxa.js} +1 -1
- package/web/app/immutable/chunks/{CbB5VTQO.js → B9e_lQGd.js} +1 -1
- package/web/app/immutable/chunks/{WAk1in99.js → BAJdDJmt.js} +1 -1
- package/web/app/immutable/chunks/{BKb2X4nY.js → BBfmiZwR.js} +1 -1
- package/web/app/immutable/chunks/{J1JvTxzS.js → BCFfKX9W.js} +1 -1
- package/web/app/immutable/chunks/{BOBlxuhv.js → BDHBtQ3l.js} +1 -1
- package/web/app/immutable/chunks/{DOP6s1nq.js → BDUAehdP.js} +4 -4
- package/web/app/immutable/chunks/{BBi8ZQ4f.js → BFnbk-Kf.js} +1 -1
- package/web/app/immutable/chunks/{DJPQ2gWl.js → BGGzsVfR.js} +1 -1
- package/web/app/immutable/chunks/{ClQcbOPg.js → BH5cuIQi.js} +1 -1
- package/web/app/immutable/chunks/{B08ZRfRe.js → BIDHEGct.js} +1 -1
- package/web/app/immutable/chunks/{CMT8W8d8.js → BIOk6wuV.js} +1 -1
- package/web/app/immutable/chunks/{D1YVXYbM.js → BJ_6izfA.js} +7 -7
- package/web/app/immutable/chunks/{CcJbNmRb.js → BMPb03sg.js} +1 -1
- package/web/app/immutable/chunks/{C1ANrPzv.js → BNPFPBlO.js} +1 -1
- package/web/app/immutable/chunks/{MSSSP_6i.js → BNVzhw1y.js} +1 -1
- package/web/app/immutable/chunks/{CNcMC2eS.js → BO9EbiHx.js} +1 -1
- package/web/app/immutable/chunks/{C0sDoyzY.js → BPC4nNQe.js} +1 -1
- package/web/app/immutable/chunks/{0nqxMME2.js → BR-wS1W8.js} +1 -1
- package/web/app/immutable/chunks/{BRX8YzX5.js → BRKe81M1.js} +1 -1
- package/web/app/immutable/chunks/{BsU6XLOF.js → BSuE_PI2.js} +1 -1
- package/web/app/immutable/chunks/{BS-h7rm3.js → BTIw3yd0.js} +1 -1
- package/web/app/immutable/chunks/{DHUOIULZ.js → BTeM7_LX.js} +1 -1
- package/web/app/immutable/chunks/{DW4Kmsyn.js → BU8fu6L_.js} +1 -1
- package/web/app/immutable/chunks/{DfARSELN.js → BVTor63R.js} +3 -3
- package/web/app/immutable/chunks/{zFZ2p9zT.js → BW_04noU.js} +1 -1
- package/web/app/immutable/chunks/{B648LYGe.js → BWerHQW_.js} +1 -1
- package/web/app/immutable/chunks/{3sRD2IoY.js → BX8IWbyz.js} +2 -2
- package/web/app/immutable/chunks/{BzvRDF8m.js → BYZmS9Dk.js} +1 -1
- package/web/app/immutable/chunks/{C_A8Orac.js → BYk_qw69.js} +1 -1
- package/web/app/immutable/chunks/{Bx4lXaHY.js → BYxkGGC-.js} +1 -1
- package/web/app/immutable/chunks/{D8RydOZp.js → B_vcNRuc.js} +1 -1
- package/web/app/immutable/chunks/{Dj9vAmvP.js → BapFUUqZ.js} +1 -1
- package/web/app/immutable/chunks/{COWTRkIf.js → Bd69ye4n.js} +1 -1
- package/web/app/immutable/chunks/{gM93sUNx.js → Bd9XSgIb.js} +1 -1
- package/web/app/immutable/chunks/{BKoNmPdl.js → BdCx7DnP.js} +1 -1
- package/web/app/immutable/chunks/{3cdteGtc.js → BeRTGLrw.js} +1 -1
- package/web/app/immutable/chunks/{BggFqLcQ.js → BghpE59-.js} +1 -1
- package/web/app/immutable/chunks/{DD1B8iWW.js → BhYLt5th.js} +1 -1
- package/web/app/immutable/chunks/{Ozne-tFy.js → Bk5SMnS3.js} +49 -49
- package/web/app/immutable/chunks/{x9rbYKj9.js → BlDfHMda.js} +1 -1
- package/web/app/immutable/chunks/{QvMOlSpE.js → BlPj7Bqh.js} +1 -1
- package/web/app/immutable/chunks/{CLwukbv5.js → Bo2QS6PZ.js} +1 -1
- package/web/app/immutable/chunks/{CcRQKkS2.js → Bo7YWMXl.js} +1 -1
- package/web/app/immutable/chunks/{0-b4ZvTK.js → BuXA0uuF.js} +1 -1
- package/web/app/immutable/chunks/{9ZGNcJrk.js → BvUM18CV.js} +1 -1
- package/web/app/immutable/chunks/BvgUrOVR.js +227 -0
- package/web/app/immutable/chunks/{BO3uDFyf.js → BwEpZ6hl.js} +3 -3
- package/web/app/immutable/chunks/{xnqT8zWA.js → BxC2yVbF.js} +1 -1
- package/web/app/immutable/chunks/{DPODhnzy.js → BxgeL5Cn.js} +2 -2
- package/web/app/immutable/chunks/{CAdJgRT-.js → BzDjODLF.js} +1 -1
- package/web/app/immutable/chunks/{CojjevwO.js → BzwTpGAs.js} +3 -3
- package/web/app/immutable/chunks/{Cs8-gQAN.js → C-yDVBGV.js} +1 -1
- package/web/app/immutable/chunks/{MkI4_nBU.js → C0DySWij.js} +1 -1
- package/web/app/immutable/chunks/{IFT0w_rv.js → C4Zy0P7R.js} +1 -1
- package/web/app/immutable/chunks/{2ZXwYJuA.js → C4wwbPuR.js} +1 -1
- package/web/app/immutable/chunks/{xn0HgFL2.js → C6PYFU8v.js} +1 -1
- package/web/app/immutable/chunks/{CViglT06.js → C9dil5-t.js} +1 -1
- package/web/app/immutable/chunks/{B5FD8FRF.js → CB1wD_PC.js} +1 -1
- package/web/app/immutable/chunks/{CjZ3vck_.js → CBDImldB.js} +1 -1
- package/web/app/immutable/chunks/{s1gAk8mT.js → CBYPZH-W.js} +1 -1
- package/web/app/immutable/chunks/CDxER840.js +1 -0
- package/web/app/immutable/chunks/{h-HGzFkJ.js → CEOoXkJa.js} +4 -4
- package/web/app/immutable/chunks/{DczZ5XlV.js → CEs-7mch.js} +3 -3
- package/web/app/immutable/chunks/{ConaHaDS.js → CFgK9GfH.js} +1 -1
- package/web/app/immutable/chunks/{CIhr4uzF.js → CGwmPMQc.js} +1 -1
- package/web/app/immutable/chunks/{BQ3lIAxU.js → CHDy3QTf.js} +1 -1
- package/web/app/immutable/chunks/{B1BoYgO3.js → CK1vqkSE.js} +1 -1
- package/web/app/immutable/chunks/{Cc7p6my_.js → CKI5DKl7.js} +6 -6
- package/web/app/immutable/chunks/{Cz3L4t3K.js → CKj5bwOX.js} +1 -1
- package/web/app/immutable/chunks/{CZ0U9o7-.js → CMAl4tQM.js} +1 -1
- package/web/app/immutable/chunks/{Q0MFbJMW.js → CMQqNZFP.js} +1 -1
- package/web/app/immutable/chunks/CMS0Mt7v.js +1 -0
- package/web/app/immutable/chunks/{BB2kR3UP.js → CNGkxhSe.js} +1 -1
- package/web/app/immutable/chunks/{D_fVcaam.js → CORu-AyV.js} +1 -1
- package/web/app/immutable/chunks/{5GrgBznS.js → COuOkYRg.js} +1 -1
- package/web/app/immutable/chunks/{CLt_MpVR.js → CPBiF1gr.js} +1 -1
- package/web/app/immutable/chunks/{qoEkEEyr.js → CS1PgLFW.js} +1 -1
- package/web/app/immutable/chunks/{UiwXoSAw.js → CSiZwu1h.js} +1 -1
- package/web/app/immutable/chunks/{5sBQ6rKD.js → CT_wb7-d.js} +1 -1
- package/web/app/immutable/chunks/{Dp-w6U2a.js → CTt3kMm1.js} +1 -1
- package/web/app/immutable/chunks/{CI_dqO7A.js → CUl5WBR5.js} +1 -1
- package/web/app/immutable/chunks/{BBKgmsAl.js → CUt6iXkF.js} +1 -1
- package/web/app/immutable/chunks/{Djo4Utna.js → CYfBmNaT.js} +1 -1
- package/web/app/immutable/chunks/{C0yADNxK.js → C_-tA5vs.js} +2 -2
- package/web/app/immutable/chunks/{D31GMMqw.js → C_VMQN67.js} +1 -1
- package/web/app/immutable/chunks/{CjJmucSj.js → C_uqctJM.js} +1 -1
- package/web/app/immutable/chunks/{BnoYK4Cg.js → CaibRh-G.js} +1 -1
- package/web/app/immutable/chunks/{DOlRZEzP.js → Cavwt8Mn.js} +1 -1
- package/web/app/immutable/chunks/{dAdxFhG6.js → CbF4ODHW.js} +1 -1
- package/web/app/immutable/chunks/{qVOvfVaw.js → Cdz-CHGd.js} +1 -1
- package/web/app/immutable/chunks/{DYFbONVh.js → CenrrJuj.js} +2 -2
- package/web/app/immutable/chunks/{B0WURFIt.js → Cf891EVZ.js} +1 -1
- package/web/app/immutable/chunks/{ByOlSVuA.js → CfM2ZJef.js} +1 -1
- package/web/app/immutable/chunks/{C9KORVFh.js → Cg_QSby7.js} +1 -1
- package/web/app/immutable/chunks/{DxZVPzM-.js → Cl5KdYjm.js} +1 -1
- package/web/app/immutable/chunks/{GgqVQsTS.js → Cn23SDXY.js} +1 -1
- package/web/app/immutable/chunks/{5D7P8R1M.js → Cnlend6s.js} +1 -1
- package/web/app/immutable/chunks/{BKBZBubB.js → CqnucWm4.js} +1 -1
- package/web/app/immutable/chunks/{lfN_4jdk.js → Crq2Gvaa.js} +1 -1
- package/web/app/immutable/chunks/{-j8RilKC.js → CsqCa0Sd.js} +2 -2
- package/web/app/immutable/chunks/{DDs4Vg0U.js → CuG6uIIP.js} +1 -1
- package/web/app/immutable/chunks/{C6MidKO1.js → Cvg7bd3W.js} +1 -1
- package/web/app/immutable/chunks/{waEdGUDl.js → CwnyA6hc.js} +1 -1
- package/web/app/immutable/chunks/{DsUUGZq_.js → Cx089QrC.js} +1 -1
- package/web/app/immutable/chunks/{BVT8FnwX.js → D-s4Q5GN.js} +1 -1
- package/web/app/immutable/chunks/{CqbBHiiS.js → D1IlJCd0.js} +1 -1
- package/web/app/immutable/chunks/{C2RKkR8r.js → D2gIe4Fc.js} +1 -1
- package/web/app/immutable/chunks/{BVLclYIV.js → D6IXX0lv.js} +1 -1
- package/web/app/immutable/chunks/{DR4IMcDF.js → D6Id8WlN.js} +1 -1
- package/web/app/immutable/chunks/{CMxICaSn.js → D9hi6Z3O.js} +1 -1
- package/web/app/immutable/chunks/D9iN-aHM.js +5 -0
- package/web/app/immutable/chunks/{WhG7Bgtb.js → DD1-zRxp.js} +1 -1
- package/web/app/immutable/chunks/{DW3NYbCg.js → DE5Smm9m.js} +1 -1
- package/web/app/immutable/chunks/{DfZpv0e6.js → DFoGBie-.js} +1 -1
- package/web/app/immutable/chunks/{YJmoM74E.js → DG__gHhd.js} +1 -1
- package/web/app/immutable/chunks/{CURgPz9A.js → DIlG6FTS.js} +1 -1
- package/web/app/immutable/chunks/{DvuFiJGX.js → DK1vbm9l.js} +1 -1
- package/web/app/immutable/chunks/{DayXN3MG.js → DKs2ftKN.js} +1 -1
- package/web/app/immutable/chunks/{BWAM175S.js → DLoJFSfZ.js} +1 -1
- package/web/app/immutable/chunks/{yr_icLi6.js → DMC7qMUv.js} +1 -1
- package/web/app/immutable/chunks/{CNsCQ6no.js → DMaQDnJk.js} +1 -1
- package/web/app/immutable/chunks/{Dy75eCEg.js → DMcsIxoO.js} +1 -1
- package/web/app/immutable/chunks/{BFq_nebX.js → DNmVxfYt.js} +8 -8
- package/web/app/immutable/chunks/{D6tg0AFH.js → DOGdTp2m.js} +1 -1
- package/web/app/immutable/chunks/{2DcZXs_F.js → DR58OcKC.js} +1 -1
- package/web/app/immutable/chunks/{DPaNvpDi.js → DR9205pL.js} +1 -1
- package/web/app/immutable/chunks/{CCOyeB8l.js → DTSOJB0e.js} +1 -1
- package/web/app/immutable/chunks/{CZL3_4T_.js → DXwDIYHN.js} +1 -1
- package/web/app/immutable/chunks/{l4QAkguk.js → DYd7w17e.js} +1 -1
- package/web/app/immutable/chunks/{3pZ2C7Oz.js → DYrK-s5W.js} +1 -1
- package/web/app/immutable/chunks/{BRFS4VDU.js → DYztlXyW.js} +1 -1
- package/web/app/immutable/chunks/{BcN0a7iZ.js → DZ5koqO7.js} +1 -1
- package/web/app/immutable/chunks/{iYBu_bIg.js → D_m0iYjs.js} +1 -1
- package/web/app/immutable/chunks/{BWaQmmKL.js → DadwIC0R.js} +1 -1
- package/web/app/immutable/chunks/{CyAayV8v.js → Dax20l9D.js} +2 -2
- package/web/app/immutable/chunks/{BeXyu8S7.js → DbKrZJmS.js} +6 -6
- package/web/app/immutable/chunks/{D7tJZDri.js → DbY-sUwj.js} +1 -1
- package/web/app/immutable/chunks/{D1mml-OO.js → DcE_Ld1a.js} +1 -1
- package/web/app/immutable/chunks/{CeO1YObE.js → DdKmPHVm.js} +1 -1
- package/web/app/immutable/chunks/{BL66wtH1.js → DffgEGrv.js} +1 -1
- package/web/app/immutable/chunks/{g8wzFaTr.js → DfiXlh8D.js} +1 -1
- package/web/app/immutable/chunks/{BmZ0oFC-.js → DgBCXQ71.js} +1 -1
- package/web/app/immutable/chunks/{BpS2Zkky.js → DiDcqoCZ.js} +1 -1
- package/web/app/immutable/chunks/{TKDyISXm.js → Dj5vfD48.js} +3 -3
- package/web/app/immutable/chunks/{B9UG1fIf.js → DjVfE_Ds.js} +1 -1
- package/web/app/immutable/chunks/{CbSjEe9c.js → Dkg7fAiD.js} +1 -1
- package/web/app/immutable/chunks/{BPC4bZ2e.js → DkibMP99.js} +1 -1
- package/web/app/immutable/chunks/{DnSvdDJQ.js → DkraFhXS.js} +1 -1
- package/web/app/immutable/chunks/{BXDqRhfc.js → DmtmsOtX.js} +1 -1
- package/web/app/immutable/chunks/{AFSjjw3j.js → Do_TqlrK.js} +1 -1
- package/web/app/immutable/chunks/{CUPUpXuX.js → Dovmtid-.js} +1 -1
- package/web/app/immutable/chunks/{dJdm8RiY.js → DpN6Ybfd.js} +1 -1
- package/web/app/immutable/chunks/{CGXAF4r8.js → DrWcQsKJ.js} +1 -1
- package/web/app/immutable/chunks/{B23FAgl4.js → DvCCocml.js} +1 -1
- package/web/app/immutable/chunks/{2N3bEpgZ.js → DwuPw74E.js} +1 -1
- package/web/app/immutable/chunks/{DUb-Rw9h.js → Dz6pz6rM.js} +1 -1
- package/web/app/immutable/chunks/{BiyBBgWJ.js → HcVsBsAl.js} +1 -1
- package/web/app/immutable/chunks/{BuBWlA2n.js → IISaQsK0.js} +1 -1
- package/web/app/immutable/chunks/IJYL54f1.js +1 -0
- package/web/app/immutable/chunks/{BoVqnGlE.js → Iu8s0xrk.js} +1 -1
- package/web/app/immutable/chunks/{DjJQPfKI.js → LzWIYiXc.js} +1 -1
- package/web/app/immutable/chunks/{DzxV-zrJ.js → M8sdbvOT.js} +1 -1
- package/web/app/immutable/chunks/{vTk7TgiT.js → McMSPwXq.js} +1 -1
- package/web/app/immutable/chunks/{_wdKNOb8.js → NPItrD9R.js} +1 -1
- package/web/app/immutable/chunks/{DDDplTKI.js → NlCjCVxn.js} +1 -1
- package/web/app/immutable/chunks/{DSoSzq2S.js → NzxBab7c.js} +1 -1
- package/web/app/immutable/chunks/{Cl4oF0_T.js → PeSBy6Q3.js} +1 -1
- package/web/app/immutable/chunks/{DBYwZc8q.js → PnTDvXOe.js} +1 -1
- package/web/app/immutable/chunks/{CYIyfTfT.js → SiYLjuDS.js} +1 -1
- package/web/app/immutable/chunks/{1-VabEZ0.js → Syl_OSjA.js} +1 -1
- package/web/app/immutable/chunks/{nn-FB5iu.js → TV2_MWXe.js} +1 -1
- package/web/app/immutable/chunks/{EZewBOPv.js → TWVlaXcj.js} +1 -1
- package/web/app/immutable/chunks/{cF3AJqS4.js → U_cmHtqi.js} +1 -1
- package/web/app/immutable/chunks/{D_0pJDZv.js → UakvtOgc.js} +1 -1
- package/web/app/immutable/chunks/{Dpront9T.js → UlQNHb3m.js} +1 -1
- package/web/app/immutable/chunks/{CkiTXhNV.js → Vwfej_EC.js} +3 -3
- package/web/app/immutable/chunks/{C7NJtCoD.js → WL4wAA6m.js} +2 -2
- package/web/app/immutable/chunks/{WC951FwE.js → XO84v1Z5.js} +1 -1
- package/web/app/immutable/chunks/{txAxF1ra.js → b33seoH7.js} +1 -1
- package/web/app/immutable/chunks/{BVnCu4HK.js → dvgX5pbn.js} +1 -1
- package/web/app/immutable/chunks/{BPhCmCpT.js → fX819Pv6.js} +1 -1
- package/web/app/immutable/chunks/{CJB0AMOQ.js → gMye6h60.js} +2 -2
- package/web/app/immutable/chunks/{KoGdyFdq.js → h6ZeyBNW.js} +1 -1
- package/web/app/immutable/chunks/{DOpzySCS.js → ljZI5d7y.js} +1 -1
- package/web/app/immutable/chunks/{CKXP5Dfl.js → mFLgyCOK.js} +1 -1
- package/web/app/immutable/chunks/{DHZp-IFS.js → mNkJFQiA.js} +1 -1
- package/web/app/immutable/chunks/{CuGpCjd7.js → oqxFFnht.js} +1 -1
- package/web/app/immutable/chunks/{4MuDb8sG.js → pDn0_bm8.js} +1 -1
- package/web/app/immutable/chunks/{DEMyUrKD.js → rgnRekX3.js} +1 -1
- package/web/app/immutable/chunks/{CwSA3Dwr.js → sgMaD9-D.js} +3 -3
- package/web/app/immutable/chunks/{CilxFmmt.js → tzy2FJ3p.js} +1 -1
- package/web/app/immutable/chunks/{BTiFAxnk.js → uR5KZKbl.js} +1 -1
- package/web/app/immutable/chunks/{igt8MaJ4.js → udwHGMln.js} +1 -1
- package/web/app/immutable/chunks/{DB9IAENr.js → ulG7NA7z.js} +1 -1
- package/web/app/immutable/chunks/{7L5DlLPB.js → vt-D6r-U.js} +1 -1
- package/web/app/immutable/chunks/{f3mINTV_.js → wD4fx_9g.js} +1 -1
- package/web/app/immutable/chunks/{Bkny4U08.js → x0rjHUHa.js} +1 -1
- package/web/app/immutable/chunks/{CqShCtgy.js → yCx04g4X.js} +1 -1
- package/web/app/immutable/chunks/{B2YeO1vq.js → yW4W7htU.js} +1 -1
- package/web/app/immutable/entry/{app.MRheiWYu.js → app.CIVLA2a9.js} +2 -2
- package/web/app/immutable/entry/start.Cn76ZGVI.js +1 -0
- package/web/app/immutable/nodes/{0.CtDeqO-b.js → 0.ACp4Nz4v.js} +1 -1
- package/web/app/immutable/nodes/{1.DkbI4cS2.js → 1.DRnQyS6A.js} +1 -1
- package/web/app/immutable/nodes/{10.m8CCWmGC.js → 10.CLkVRFBV.js} +1 -1
- package/web/app/immutable/nodes/{12.C6vEm_M7.js → 12.CEAVKYuu.js} +1 -1
- package/web/app/immutable/nodes/{13.DPA662Yd.js → 13.CJ1HRZcd.js} +1 -1
- package/web/app/immutable/nodes/{14.ByaMuLhR.js → 14.9_BXzcxR.js} +1 -1
- package/web/app/immutable/nodes/{15.Byubc7Em.js → 15.CZGq0vsg.js} +1 -1
- package/web/app/immutable/nodes/{16.BmFYAQ9C.js → 16.BMYUgPNR.js} +2 -2
- package/web/app/immutable/nodes/2.d5BGPrjO.js +9 -0
- package/web/app/immutable/nodes/{3.C3UUZ7iK.js → 3.0E-ZGvKe.js} +1 -1
- package/web/app/immutable/nodes/{4.CtX4qgJE.js → 4.DSO5-jdr.js} +1 -1
- package/web/app/immutable/nodes/{5.yLkRrv3R.js → 5.BexFD7jH.js} +1 -1
- package/web/app/immutable/nodes/6.CqlyGMy5.js +1 -0
- package/web/app/immutable/nodes/{7.DCFEio1e.js → 7.C2XKzJeK.js} +1 -1
- package/web/app/immutable/nodes/{8.CGM4vick.js → 8.CMFpn5kb.js} +4 -4
- package/web/app/immutable/nodes/{9.V5qvVUf3.js → 9.BolTThFG.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/9A9__2dZ.js +0 -1
- package/web/app/immutable/chunks/BqQtQly_.js +0 -5
- package/web/app/immutable/chunks/D4Mfx79s.js +0 -227
- package/web/app/immutable/chunks/DGR4UUG4.js +0 -1
- package/web/app/immutable/chunks/W-gkWrYK.js +0 -1
- package/web/app/immutable/entry/start.CSXPreJt.js +0 -1
- package/web/app/immutable/nodes/2.B4Inck9s.js +0 -9
- package/web/app/immutable/nodes/6.CjUsIDeG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as O,bq as s,a_ as W,by as Y,br as G,b as J}from"./yZ5s7S5S.js";import{bo as K,bs as Q,ca as U,aD as i,ay as V,bx as X,bS as Z,W as w,bn as $,c9 as n,aA as r,be as ee,b$ as te,b_ as ae,bO as se,aB as re}from"./B8o4lNgr.js";import{c as ie,f as ne}from"./D46WSk8U.js";import{n as oe,t as de,m as ue,e as le,a as ce}from"./
|
|
1
|
+
import{t as O,bq as s,a_ as W,by as Y,br as G,b as J}from"./yZ5s7S5S.js";import{bo as K,bs as Q,ca as U,aD as i,ay as V,bx as X,bS as Z,W as w,bn as $,c9 as n,aA as r,be as ee,b$ as te,b_ as ae,bO as se,aB as re}from"./B8o4lNgr.js";import{c as ie,f as ne}from"./D46WSk8U.js";import{n as oe,t as de,m as ue,e as le,a as ce}from"./BYxkGGC-.js";import{b as ge}from"./D2g8BuR1.js";import"./CM5eCs6m.js";import{bL as fe}from"./Dax20l9D.js";var me=new Set(["$$slots","$$events","$$legacy","ref","id","class","value","doesExpandToFit","autoResize","minHeight","maxHeight","noFocusStyle","size","message","error","messageId","aria-describedby","aria-invalid"]),he=re("<textarea></textarea> <!>",1);function xe(S,t){const E=K();if(new.target)return O({component:xe,...S});Q(t,!0);const B=fe();let a=s(t,"ref",15),m=s(t,"id",7),h=s(t,"class",7),c=s(t,"value",15),x=s(t,"doesExpandToFit",7,!1),b=s(t,"autoResize",7,!1),g=s(t,"minHeight",7,80),o=s(t,"maxHeight",7,400),v=s(t,"noFocusStyle",7,!1),y=s(t,"size",7),_=s(t,"message",7),d=s(t,"error",7),f=s(t,"messageId",23,()=>`${E}-message`),z=s(t,"aria-describedby",7),p=s(t,"aria-invalid",7),M=G(t,me);const C=n(()=>y()??B),u=n(()=>b()||x()),H=n(()=>d()??_()),j=n(()=>[z(),i(H)?f():void 0].filter(Boolean).join(" ")||void 0),k=n(()=>d()?!0:p());function A(){a()?.focus()}function D(){a()?.blur()}function I(){if(!i(u)||!a())return;a(a().style.height="auto",!0);const e=Math.min(Math.max(a().scrollHeight,g()),o());a(a().style.height=`${e}px`,!0),a(a().style.overflowY=a().scrollHeight>o()?"auto":"hidden",!0)}U(()=>{i(u)&&a()&&c()!==void 0&&I()});var P={focus:A,blur:D,get ref(){return a()},set ref(e){a(e),r()},get id(){return m()},set id(e){m(e),r()},get class(){return h()},set class(e){h(e),r()},get value(){return c()},set value(e){c(e),r()},get doesExpandToFit(){return x()},set doesExpandToFit(e=!1){x(e),r()},get autoResize(){return b()},set autoResize(e=!1){b(e),r()},get minHeight(){return g()},set minHeight(e=80){g(e),r()},get maxHeight(){return o()},set maxHeight(e=400){o(e),r()},get noFocusStyle(){return v()},set noFocusStyle(e=!1){v(e),r()},get size(){return y()},set size(e){y(e),r()},get message(){return _()},set message(e){_(e),r()},get error(){return d()},set error(e){d(e),r()},get messageId(){return f()},set messageId(e=`${E}-message`){f(e),r()},get"aria-describedby"(){return z()},set"aria-describedby"(e){z(e),r()},get"aria-invalid"(){return p()},set"aria-invalid"(e){p(e),r()},$set:Y,$on:(e,F)=>J(t,e,F)},R=he(),l=V(R);X(l),ie(l,e=>({id:m(),"data-slot":"textarea","data-size":i(C),oninput:i(u)?I:void 0,"aria-describedby":i(j),"aria-invalid":i(k),class:e,style:i(u)?`min-height: ${g()}px; max-height: ${o()}px`:void 0,autocorrect:"off",autocapitalize:"off",spellcheck:"false",...M}),[()=>ne("type-caption text-foreground placeholder:text-muted-foreground flex w-full rounded-(--radius-medium) border px-3",ue,de,i(C)==="compact"?"py-1.5":"py-2",i(u)?"resize-none overflow-hidden":"min-h-20",v()&&oe,h())]),ge(l,e=>a(e),()=>a());var q=Z(l,2);{var L=e=>{{let F=n(()=>d()?"error":"helper");ce(e,{get id(){return f()},get tone(){return i(F)},children:(N,be)=>{ee();var T=te();ae(()=>se(T,i(H))),w(N,T)},$$slots:{default:!0}})}};W(q,e=>{i(H)&&e(L)})}return le(l,c),w(S,R),$(P)}export{xe as T};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var be=Object.defineProperty;var ve=(e,t,r)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>ve(e,typeof t!="symbol"?t+"":t,r);import{a as Se,i as _e}from"./Da6QaYq0.js";import{c as H}from"./ChTqQfQN.js";import{i as D}from"./DvUv7DbT.js";import{bo as n,_ as ye}from"./yZ5s7S5S.js";import{Hb as a,n2 as S,n1 as m,lx as we,x8 as M,x9 as L,x6 as ke,x7 as Ee,qG as W,wV as J,D as Ce,uf as Y,c as Me,GZ as Re,a8 as Ae,b_ as Pe,bZ as Te,cc as Ie,cb as De,n4 as k}from"./WOicJa2k.js";import{cs as Oe,bt as xe,c5 as Fe,ck as Le,c7 as Ue,cH as Ne,cL as Ve,cB as X,aw as He,bP as We,cI as qe}from"
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CBYPZH-W.js","/app/immutable/chunks/BeRTGLrw.js","/app/immutable/chunks/yZ5s7S5S.js","/app/immutable/chunks/B8o4lNgr.js","/app/immutable/chunks/D46WSk8U.js","/app/immutable/chunks/CpHIRYx9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Dax20l9D.js","/app/immutable/chunks/Cb1eroFO.js","/app/immutable/chunks/D2g8BuR1.js","/app/immutable/chunks/CVjN4vxe.js","/app/immutable/chunks/G0_EiVNo.js","/app/immutable/chunks/DQT9c-_R.js","/app/immutable/chunks/DVkfuwKw.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Dfbagr79.js","/app/immutable/chunks/BIqUw3gi.js","/app/immutable/chunks/WOicJa2k.js","/app/immutable/chunks/CjSUqH7t.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/D2AmAQEr.js","/app/immutable/chunks/ah7LAYm4.js","/app/immutable/chunks/CUrlpJj4.js","/app/immutable/assets/notify.BeL_JB6L.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var be=Object.defineProperty;var ve=(e,t,r)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>ve(e,typeof t!="symbol"?t+"":t,r);import{a as Se,i as _e}from"./Da6QaYq0.js";import{c as H}from"./ChTqQfQN.js";import{i as D}from"./DvUv7DbT.js";import{bo as n,_ as ye}from"./yZ5s7S5S.js";import{Hb as a,n2 as S,n1 as m,lx as we,x8 as M,x9 as L,x6 as ke,x7 as Ee,qG as W,wV as J,D as Ce,uf as Y,c as Me,GZ as Re,a8 as Ae,b_ as Pe,bZ as Te,cc as Ie,cb as De,n4 as k}from"./WOicJa2k.js";import{cs as Oe,bt as xe,c5 as Fe,ck as Le,c7 as Ue,cH as Ne,cL as Ve,cB as X,aw as He,bP as We,cI as qe}from"./-1vWYJiy.js";import{n as Be}from"./WL4wAA6m.js";import{al as je,F as ee,j as Ge,G as ze,bw as Ke,c as Ye,am as $e,bh as q,$ as Qe,aC as Ze,q as te,K as Je,ah as Xe,bm as et,J as tt,H as rt,I as st,bk as it}from"./tzy2FJ3p.js";import{q as nt,u as re}from"./C3YfsJGu.js";const O=H("Clipboard");async function Gr(e){let t;if(Se())try{const r=await _e("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,O.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw O.error("Browser clipboard write failed",r,{electronError:t}),r}throw O.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const at=a.createSelector(e=>e.githubAuth.mutationRequestId),ot=a.createSelector(e=>e.githubAuth.callbacksCancelled),ct=a.createSelector(e=>e.githubAuth.isDisconnecting),se=a.createSelector(e=>e.githubAuth.isAuthenticated),lt=a.createSelector(e=>e.githubAuth.statusSettled===!0),dt=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),ut=a.createSelector(e=>e.githubAuth.user),pt=a.createSelector(e=>e.githubAuth.isAuthenticating),ft=a.createSelector(e=>e.githubAuth.deviceFlow),ht=a.createSelector(e=>e.githubAuth.error),zr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:ot,selectGitHubAuthDeviceFlow:ft,selectGitHubAuthError:ht,selectGitHubAuthIsAuthenticated:se,selectGitHubAuthIsAuthenticating:pt,selectGitHubAuthIsDisconnecting:ct,selectGitHubAuthMutationRequestId:at,selectGitHubAuthRequiresDaemonAuth:dt,selectGitHubAuthStatusSettled:lt,selectGitHubAuthUser:ut},Symbol.toStringTag,{value:"Module"})),gt=H("WorkspaceValidation");async function Kr(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mt(s)?vt(s):St(s,t,r)}function mt(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function bt(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function vt(e){return bt(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function St(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:n.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(gt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Yr(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function $r(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Qr(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Zr(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Jr(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const v=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:`# Role
|
|
3
3
|
You are a PR review specialist conducting a code review for a pull request.
|
|
4
4
|
|
|
5
5
|
# Objectives
|
|
@@ -419,4 +419,4 @@ Show referenced workspaces as live fenced \`workspace\` blocks with one returned
|
|
|
419
419
|
|
|
420
420
|
For cross-workspace agents, use attributed send for one-way requests, ask when an answer is requested, and waitFor for completion watches. After ask or waitFor, end the turn; do not poll or treat interim messages as completion. On the completion wake, read the specified agent's conversation once and relay its last assistant message with a nonempty message ID. Link that reply as [Workspace Title](intent://local/{workspaceId}/agent/{agentId}/message/{messageId}), taking all IDs and the title from the conversation read, never the outgoing request or a user message. This exact-message source link is the exception to workspace cards. Omit the link if no assistant message ID exists; report missing or failed results honestly.
|
|
421
421
|
|
|
422
|
-
Keep ordinary recommendations to supported features ready for users. Discuss an experiment honestly and label its status only when explicitly asked or when the user is developing or testing it.`,roleReminder:"You are the built-in Assistant. Help with app tasks using ws.app.* and current app guidance. Keep changes reviewable through proposal or confirmation cards, with cards last. Show workspaces as live cards; never use a workspace ID slug as a label. Use the discovered canonical route including its hash fragment. End the turn after registering an agent completion watch; on completion, link the returned assistant reply using its exact message ID."}],ie=new Set(["pr-reviewer"]),Xr="developer";function es(e){return v.find(t=>t.id===e)}function u(e){return e??""}function _t(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function $(e,t,r){if(e.source!=="user"||!r?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const s=t.find(i=>i.id===e.id)??v.find(i=>i.id===e.id);return s?u(e.name)===u(s.name)&&u(e.description)===u(s.description)&&u(e.behaviorPrompt)===u(s.defaultBehaviorPrompt)&&u(e.roleReminder)===u(s.roleReminder)&&u(e.reasoningEffort)===u(s.reasoningEffort)&&_t(e.modelOptions,s.modelOptions):!1}const ts=a.createSelector(e=>e.specialists.bundledSpecialists),yt=a.createSelector(e=>e.specialists.fileSpecialists),rs=a.createSelector(e=>S(yt.select(e))),ss=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const is=a.createSelector(e=>e.specialists.customSpecialistsLoaded),ns=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),as=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),os=a.createSelector(e=>e.specialists.specialistsFolderPath),cs=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(ie.has(t)&&!se.select(e)));function wt(e,t){return t?e:e.filter(r=>!ie.has(r.id))}function kt(e,t){return wt(e,t).filter(r=>!r.hidden)}function ls(e,t){return kt(e,t).filter(r=>r.role!=="internal")}const b=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=S(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const l of r)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of v)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push(l));const c=new Map;for(const l of v)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,f)=>{const _=c.has(l.id),I=c.has(f.id);return _&&I?(c.get(l.id)??0)-(c.get(f.id)??0):_&&!I?-1:!_&&I?1:l.name.localeCompare(f.name)}),o}),ds=a.createSelector(e=>{const t=b.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...v.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),Et=a.createSelector((e,t)=>{const r=m(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&S(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=v.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),us=a.createSelector((e,t)=>Et.select(e,t)?.name??null),ps=a.createSelector((e,t,r)=>{const i=b.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),fs=a.createSelector((e,t,r)=>b.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),hs=a.createSelector((e,t,r)=>b.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),gs=a.createSelector((e,t,r)=>{const i=b.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function R(e,t){return t.some(r=>r.id===e)||v.some(r=>r.id===e)}const ms=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&R(t,e.specialists.bundledSpecialists)}return R(t,e.specialists.bundledSpecialists)}),bs=a.createSelector((e,t,r)=>r?!!B.select(e,t,r):!!m(e.specialists.fileSpecialists,t)),vs=a.createSelector((e,t,r)=>{if(r){const o=B.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:R(t,e.specialists.bundledSpecialists)&&!$(o,e.specialists.bundledSpecialists)}if(!R(t,e.specialists.bundledSpecialists))return!1;const i=m(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!$(i,e.specialists.bundledSpecialists)}),B=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return m(e.specialists.fileSpecialists,t)}),Ss=a.createSelector((e,t,r)=>{const s=B.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),_s=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=m(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),ys=a.createSelector((e,t,r)=>{if(r){const i=b.select(e,r).find(l=>l.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Oe.select(e,o,r);const c=xe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=m(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ct.select(e,t)}),Ct=a.createSelector((e,t)=>{const s=b.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:je.select(e)?ee.select(e):""}),ws=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?S(r):[]}),ks=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??we),Es=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),Mt=["idle","exited"];function Rt(e){return e===void 0||!Mt.includes(e)}function Cs(e){return e.status==="restarting"?"restarting":Rt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function At(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ms=a.createSelector(e=>e.voiceSettings.isLoading),Rs=a.createSelector(e=>e.voiceSettings.available),As=a.createSelector(e=>e.voiceSettings.provider),Ps=a.createSelector(e=>e.voiceSettings.engine),Ts=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Is=a.createSelector(e=>e.voiceSettings.keyConfigured),Ds=a.createSelector(e=>e.voiceSettings.vocabulary),Os=a.createSelector(e=>e.voiceSettings.openaiModel),xs=a.createSelector(e=>e.voiceSettings.language),Fs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Ls=a.createSelector(e=>e.voiceSettings.inputDeviceId),Us=a.createSelector(e=>e.voiceSettings.inputDevices),Ns=a.createSelector(e=>e.voiceSettings.busyProvider),Vs=a.createSelector(e=>e.voiceSettings.error),Hs=a.createSelector(e=>Fe.select(e)?"unavailable":At(e.voiceSettings)),U="intent.voice.inputDevice";let N;function Pt(){if(N!==void 0)return N;try{const e=localStorage.getItem(U);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ws(e){N=e;try{e===null?localStorage.removeItem(U):localStorage.setItem(U,e)}catch{}}let A=null;function qs(e){A=e}function Bs(){const e=A;return A=null,e}function Tt(){A=null}const It=300,Dt=300;class Ot{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??It,this.doublePressWindowMs=t.doublePressWindowMs??Dt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let P=null;function js(e){P=e}function Gs(){const e=P;return P=null,e}function xt(){P=null}const Ft=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function zs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Ut(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Nt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Vt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Ft,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Ut(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Nt(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Ht=300;function Wt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const qt={stopReason:"manual",autoSend:!1};let p=null,g=null,y=0,E=null;const T=new Ot({onRecordStart:()=>{E&&Bt(E)},onRecordStop:e=>{ne(E,e)}});function Ks(){return p!==null}function Ys(){return p}function $s(e){E=e,y+=1,y===1&&T.keyDown()}function Qs(e){E=e,y!==0&&(y-=1,y===0&&T.keyUp())}function Bt(e){if(p!==null)return;xt(),Tt();const t=new Vt({deviceId:Pt(),onFinished:r=>{p===t&&(p=null);const s=g??{stopReason:"auto-stop",autoSend:!1},i=g!==null;if(g=null,e.dispatch(M()),i||T.reset(),r.durationMs<Ht){s.autoSend&&e.dispatch(L());return}e.dispatch(ke({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{p===t&&(p=null),g=null,e.dispatch(M()),e.showHint(Wt(r)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=t,e.dispatch(Ee()),t.start().then(r=>{if(r!=="recording"&&(p===t&&(p=null),r==="discarded")){const s=g?.autoSend===!0;g=null,e.dispatch(M()),s&&e.dispatch(L())}})}function ne(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(L());return}g=t,r.stop()}function Zs(){ne(null,qt)}function Js(e){T.reset(),y=0,g=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(M()))}const jt=H("HardwareConsoleVoiceSetupToast"),Gt="hardware-console-voice-setup";let F=null;function zt(){return F||(F=ye(()=>import("./s1gAk8mT.js").then(e=>e.i),__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]),import.meta.url).then(e=>e.notify)),F}function Kt(){Be("/settings?tab=connections#voice").catch(e=>{jt.error("Failed to open voice settings from setup toast",e)})}function Yt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>Kt()}}function Xs(){zt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Gt,action:Yt()})})}const ei=a.createSelector(e=>e.externalEditors.selectedAction),$t=a.createSelector(e=>e.externalEditors.editors),Qt=a.createSelector(e=>{const t=S($t.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),i=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...i,...t.filter(({id:c})=>!o.has(c))]}),ti=a.createSelector(e=>e.externalEditors.editorOrder??[]),ri=a.createSelector(e=>e.externalEditors.loading),si=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ii=a.createSelector((e,t)=>{if(!(t?Le.select(e,t):Ue.select(e)))return[];const s=Zt.select(e);return Qt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function Jt(e){return e.catalogProfiles.some(t=>typeof t.remoteCompatible=="boolean")||e.defaultRemoteIncompatibility||e.profileDefaults.some(t=>typeof t.remoteCompatible=="boolean")?"supported":e.catalogProfiles.length>0?"unsupported":e.profilesLoadStatus==="idle"?"unknown":"unsupported"}function ni(e,t,r){if(W(e)){const s=t.find(i=>i.providerRef===e);return s?.remoteCompatible!==!1?null:s.remoteIncompatibility??{reason:"unknown",keys:[]}}return r?.[e]??null}function ai(e,t){return e.reason==="account-folder"?n.chat_modelPicker_remoteAccountFolder_description({backend:t}):n.chat_modelPicker_remoteIncompatible_description()}const Xt=1440*60*1e3;function oi(e,t){if(!e?.capabilities)return"missing";const r=e.observedAt?Date.parse(e.observedAt):Number.NaN;return Number.isFinite(r)&&t-r>Xt?"stale":"fresh"}const ci=new Set(["cli-missing","prerequisite-missing"]),er=new Set(["signed-out","auth-failed"]);function tr(e){return er.has(e)}function li(e,t){if(W(t))return!1;const r=J(t),s=e?.capabilities?.providers.find(i=>i.id===r);return!!s&&tr(s.status)}const rr=a.createSelector(e=>nt.select(e)&&re.select(e)&&e.remoteMachines?.supported===!0&&e.cloudMachines?.supported===!0),di=a.createSelector(e=>e.cloudMachines?.entries===!0);function ae(e){return Object.values(e.cloudMachines?.providers??{}).sort((t,r)=>t.configuredAt.localeCompare(r.configuredAt)||t.name.localeCompare(r.name))}const ui=a.createSelector(ae),pi=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).sort((t,r)=>(t.cloud?.startedAt??"").localeCompare(r.cloud?.startedAt??""))),fi=a.createSelector(e=>e.cloudMachines?.readAt??{}),hi=a.createSelector(e=>e.cloudMachines?.pending??{}),gi=a.createSelector(e=>e.cloudMachines?.failures??{}),mi=a.createSelector(e=>e.cloudMachines?.validated??null);function j(e){if(!rr.select(e))return null;const t=ae(e);if(t.length===0)return null;const r=e.cloudMachines?.entries===!0;return t.map(s=>({cloudMachineId:s.id,label:r&&(t.length>1||s.name.trim().toLowerCase()!=="e2b")?n.cloudMachines_startOn_entry_label({name:s.name}):n.cloudMachines_startOn_label(),unavailableReason:s.state==="key-rejected"?n.cloudMachines_state_keyRejected_label():null}))}function sr(e,t,r=e.cloudMachines?.providers[Ce]??null){if(!t)return null;const s=r,i=J(t);if(s&&s.agentProviders.length>0&&!s.agentProviders.includes(i))return n.cloudMachines_startOn_providerMissing();const o=e.providerSettings?.profiles;if(W(t)){const l=o?S(o.items).find(f=>f.providerRef===t):void 0;return l?l.remoteCompatible===!1?n.cloudMachines_startOn_needsProfile():l.env.some(f=>f.kind==="set")?null:n.cloudMachines_startOn_needsProfile():null}const c=o?.defaults?.[i];return c?c.remoteCompatible===!1?n.cloudMachines_startOn_needsProfile():c.env.some(l=>l.kind==="set")?null:n.cloudMachines_startOn_needsProfile():o?.loadStatus==="success"?n.cloudMachines_startOn_needsProfile():null}const ir={macos:"macOS",linux:"Linux",windows:"Windows"},nr={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function w(e,t){const r=[e&&(ir[e]??e),t&&(nr[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function ar(e){return e?.placement?.target==="remote"||e?.placement?.target==="e2b"}const or=new Set(["running","paused","resuming","pausing","stopping"]);function cr(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&or.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function bi(e,t){if(!e||!ar(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(e.placement?.target==="e2b")return{nodeId:r,name:e.nodeName?.trim()||"E2B",platform:w(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:cr(e,s)}};const i=w(e.placement?.os,e.placement?.arch)??w(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||n.remoteAgent_location_unknownMachine(),platform:i,state:o}}function vi(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||n.remoteAgent_location_unknownMachine(),platform:w(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function oe(e){switch(e){case"starting":return n.cloudMachines_agent_starting();case"running":return n.cloudMachines_agent_running();case"paused":return n.cloudMachines_agent_paused();case"resuming":return n.cloudMachines_agent_resuming();case"pausing":return n.cloudMachines_agent_pausing();case"stopping":return n.cloudMachines_agent_stopping();default:return null}}function Si(e){const t=oe(e.cloud?.state);return t?n.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function _i(e){if(e.cloud){const r=oe(e.cloud.state),s=n.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?n.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?n.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):n.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return n.remoteAgent_location_tooltipWithState({location:t,state:n.remoteMachines_state_unreachable_label()});case"revoked":return n.remoteAgent_location_tooltipWithState({location:t,state:n.remoteMachines_state_revoked_label()});default:return t}}function yi(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function ce(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function lr(e,t){const r=e.detail??"",s=ce(r),i=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(i&&s?.data.reason==="prepared-checkout")return{updateRequired:i,message:n.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=Y(s?.data),c=o??(e.code?Y({code:e.code}):null);return c?{updateRequired:i,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:i,message:s?.message||r}}function wi(e){if(e?.placement?.target!=="e2b"||!e.placementError||e.status!==Me.Error)return null;const t=lr(e.placementError,"");return t.cloud?t:null}const dr=["attachments-too-large-for-machine:","node-prompt-too-large:"],ur="remote-agent-unsupported:";function Q(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function ki(e){const t=ce(e)?.message??e;for(const s of dr){const i=t.indexOf(s);if(i<0)continue;const o=t.slice(i+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?n.remoteAgent_attachmentsTooLargeSized_error({size:Q(Number(c[1])),limit:Q(Number(c[2]))}):o?n.remoteAgent_attachmentsTooLarge_error({detail:o}):n.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(ur);return r>=0&&/attachment/i.test(t.slice(r))?n.remoteAgent_attachmentsUnsupported_error():null}const C="",V="cloud:";function le(e){return`${V}${e}`}function de(e){return e?.startsWith(V)&&e.slice(V.length)||null}function pr(e,t){return e?.find(r=>le(r.cloudMachineId)===t&&r.unavailableReason===null)}const fr=new Set(["connected","disconnected"]);function hr(e){switch(e){case"unreachable":return n.remoteMachines_state_unreachable_label();case"revoked":return n.remoteMachines_state_revoked_label();case"update-required":return n.remoteMachines_state_updateRequired_label();default:return}}function G(e){return fr.has(e.state)}function gr({backendLabel:e,backendPlatform:t,machines:r,cloud:s}){const i=[{id:C,label:e,platform:w(t?.os,t?.arch),disabled:!1},...r.map(o=>{const c=w(o.platform?.os,o.platform?.arch);return G(o)?{id:o.id,label:o.name,platform:c,disabled:!1}:{id:o.id,label:o.name,platform:c,disabled:!0,reason:hr(o.state)}})];for(const o of s??[])i.push({id:le(o.cloudMachineId),label:o.label,platform:null,kind:"cloud",disabled:o.unavailableReason!==null,...o.unavailableReason?{reason:o.unavailableReason}:{hint:n.cloudMachines_startOn_hint()}});return i}function mr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(G)||(s??[]).some(i=>i.unavailableReason===null))}function br(e,t,r){if(!e)return C;if(de(e))return pr(r,e)?e:C;const s=t.find(i=>i.id===e);return s&&G(s)?s.id:C}function Ei(e,{cloudEntries:t=!1}={}){const r=de(e);return r?t?{target:"e2b",checkout:"isolated",cloudMachineId:r}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function Ci({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),i=e.find(c=>c.key===t),o=i?s(i):[];if(r){const c=Re(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(i&&o.length>0)return{providerId:i.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}const vr=a.createSelector(e=>re.select(e)&&e.remoteMachines?.supported===!0),z=a.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Mi=a.createSelector(e=>e.remoteMachines.localFingerprint),Ri=a.createSelector(e=>e.remoteMachines.pending),Ai=a.createSelector(e=>e.remoteMachines.failures),Pi=a.createSelector(e=>e.remoteMachines.executorBackends??[]),Sr=a.createSelector((e,t)=>{if(t===Ae)return n.layout_daemonStatus_localConnection_label();const r=m(e.connections.connections,t);return r?Ge(r):t}),_r=a.createSelector(e=>Sr.select(e,e.connections.windowBackendId)),Ti=a.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Ii=a.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return Jt({catalogProfiles:Ve.select(e,t),defaultRemoteIncompatibility:Ne.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Di=a.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),ue=a.createSelector(e=>mr({remoteMachinesVisible:vr.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:z.select(e),cloud:j(e)}));function yr(e){const t=m(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const Oi=a.createSelector(e=>ue.select(e)?gr({backendLabel:_r.select(e),backendPlatform:yr(e),machines:z.select(e),cloud:j(e)}):[]),xi=a.createSelector((e,t,r)=>ue.select(e)?br(t,z.select(e),pe(e,r)):C);function pe(e,t){const r=j(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(i=>{if(i.unavailableReason)return i;const o=sr(e,t,s[i.cloudMachineId]??null);return o?{...i,unavailableReason:o}:i})}const Fi=a.createSelector((e,t)=>pe(e,t));function Li(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let wr=0;function kr(e,t){const r=++wr;return a.dispatch(Te(e,t,r)),r}function Ui(e,t,r){a.dispatch(Pe(e,t,r))}async function fe(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(Ie({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:X.select(a.state)},{...s,intent:s?.intent??kr(e,t)}))).status==="success"}finally{a.dispatch(De(i,o))}}async function Ni(e,t,r,s,i){return fe(e,t,{kind:"effort",effort:r,previous:s},i)}async function Vi(e,t,r,s,i){return fe(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Er=a.createSelector((e,t)=>S(e.agentModel.mutations).filter(r=>r.consumerId===t)),Hi=a.createSelector((e,t)=>Er.select(e,t).some(r=>r.status==="pending")),Wi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=He.select(e,t),o=ze.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=Ke(c),f=l?Ye(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:l,identity:JSON.stringify([f,i]),connection:X.select(e),canWrite:!!s&&s.workspaceId===r&&!We.select(e,r)}});function Cr(e,t,r=!1){return e!=="auggie"||t===!0||r}const qi=a.createSelector(e=>$e.select(e)?null:q.select(e)),Mr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),h=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Bi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),ji=a.createSelector((e,t)=>!!h.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Mr.select(e)),he=a.createSelector((e,t)=>t?h.select(e,t)?.catalog.providers??[]:qe.select(e)),ge=a.createSelector((e,t)=>{if(!t)return ee.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),K=a.createSelector((e,t)=>{if(!t)return Qe.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),me=a.createSelector((e,t)=>{if(!t)return Ze.select(e);const r=K.select(e,t),s=ge.select(e,t),i=h.select(e,t)?.readiness??{};return he.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available&&(o.id!=="antigravity"||te(o.id,i[o.id]?.authenticated))).map(o=>o.id)}),Gi=a.createSelector((e,t)=>{const r=K.select(e,t),s=t?h.select(e,t)?.readiness??{}:q.select(e);return he.select(e,t).filter(i=>Cr(i.id,s[i.id]?.available,r[i.id]===!0)).map(i=>i.id)}),zi=a.createSelector((e,t)=>t?me.select(e,t):Je.select(e)),Ki=a.createSelector((e,t)=>b.select(e,t)),Yi=a.createSelector((e,t)=>t?!!h.select(e,t):Xe.select(e)),$i=a.createSelector((e,t)=>{if(!t)return et.select(e);const r=h.select(e,t)?.settings??[],s=ge.select(e,t),i=r.find(l=>l.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Qi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):tt.select(e)),Zi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):rt.select(e)),Ji=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):st.select(e)),Xi=a.createSelector((e,t,r)=>{if(!r)return it.select(e,t);const s=K.select(e,r),i=h.select(e,r);return me.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&te(o,i?.readiness[o]?.authenticated))}),en=a.createSelector((e,t)=>t?h.select(e,t)?.readiness??{}:q.select(e)),Rr={},tn=a.createSelector(e=>e.providerSettings?.profiles?.status??Rr),rn=a.createSelector(e=>e.directoryPicker.listing),sn=a.createSelector(e=>e.directoryPicker.loading),nn=a.createSelector(e=>e.directoryPicker.error),an=a.createSelector(e=>e.directoryPicker.pathError),on=a.createSelector(e=>e.directoryPicker.createError),Z={},Ar=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),cn=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),ln=a.createSelector(e=>e.mcpSettings.loading),dn=a.createSelector(e=>e.mcpSettings.error),un=a.createSelector(e=>e.mcpSettings.mutationError??null),pn=a.createSelector(e=>e.mcpSettings.enabled),Pr=a.createSelector(e=>e.mcpSettings.disabledServers),Tr=a.createSelector(e=>e.mcpSettings.statusMap),Ir=a.createSelector(e=>e.mcpSettings.toolsMap),Dr=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,k(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),Or=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),fn=a.createSelector((e,t)=>Object.keys(Or.select(e,t))),hn=a.createSelector(e=>{const t=Ar.select(e),r=Tr.select(e),s=Ir.select(e),i=Pr.select(e),o=Dr.select(e);return t.map(c=>{const l=k(c)in i,f=s[k(c)]||[];let _=r[k(c)]||"disconnected";return l&&(_="disabled"),{...c,disabled:l,status:_,tools:f,toolCount:f.length,errorMessage:o[k(c)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const gn=a.createSelector(e=>e.mcpSettings.lastImportedCount),mn=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),bn=a.createSelector(e=>e.mcpSettings.advancedSaveError),vn=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],xr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Sn=Object.fromEntries(xr.map(e=>[e.path,e.defaultValue]));export{Ws as $,Cr as A,Ks as B,Li as C,Xr as D,$ as E,xr as F,ie as G,li as H,zs as I,Pt as J,vi as K,Ci as L,ci as M,w as N,oi as O,kr as P,bt as Q,lr as R,v as S,Vi as T,Ui as U,ki as V,ni as W,ai as X,At as Y,br as Z,$r as _,Sn as a,ms as a$,Hi as a0,Er as a1,Wi as a2,ts as a3,as as a4,ui as a5,di as a6,gi as a7,rr as a8,hi as a9,an as aA,ti as aB,gs as aC,ys as aD,ps as aE,xi as aF,Hs as aG,Pi as aH,fs as aI,hs as aJ,rs as aK,ns as aL,B as aM,ot as aN,ft as aO,ht as aP,se as aQ,pt as aR,ct as aS,at as aT,dt as aU,ut as aV,vs as aW,Zt as aX,Qt as aY,ii as aZ,ri as a_,fi as aa,pi as ab,mi as ac,Sr as ad,zi as ae,ge as af,K as ag,Gi as ah,me as ai,he as aj,Zi as ak,Ji as al,Qi as am,Xi as an,en as ao,Yi as ap,$i as aq,Ki as ar,_r as as,is as at,Di as au,cs as av,on as aw,nn as ax,rn as ay,sn as az,vn as b,de as b$,bs as b0,si as b1,Mi as b2,bn as b3,mn as b4,Pr as b5,pn as b6,dn as b7,Dr as b8,gn as b9,Oi as bA,ue as bB,ss as bC,Ns as bD,Ps as bE,Ls as bF,Us as bG,Is as bH,xs as bI,Os as bJ,Ts as bK,As as bL,Rs as bM,Vs as bN,Ms as bO,Ds as bP,Fs as bQ,h as bR,Mr as bS,ji as bT,Bi as bU,fn as bV,cn as bW,qs as bX,js as bY,Xs as bZ,le as b_,ln as ba,un as bb,Ar as bc,hn as bd,Tr as be,Ir as bf,ei as bg,ds as bh,tn as bi,Ti as bj,Ai as bk,Ri as bl,z as bm,vr as bn,Ii as bo,qi as bp,Et as bq,ks as br,Es as bs,_s as bt,ws as bu,us as bv,Ss as bw,b as bx,os as by,Fi as bz,C as c,Bt as c0,Zs as c1,Qr as c2,Yr as c3,Zr as c4,Kr as c5,Yt as c6,Gr as c7,wi as d,Si as e,bi as f,_i as g,yi as h,Ni as i,Js as j,Tt as k,xt as l,Bs as m,Gs as n,ls as o,kt as p,wt as q,Ys as r,Jr as s,Cs as t,es as u,zr as v,$s as w,Qs as x,Ei as y,Rt as z};
|
|
422
|
+
Keep ordinary recommendations to supported features ready for users. Discuss an experiment honestly and label its status only when explicitly asked or when the user is developing or testing it.`,roleReminder:"You are the built-in Assistant. Help with app tasks using ws.app.* and current app guidance. Keep changes reviewable through proposal or confirmation cards, with cards last. Show workspaces as live cards; never use a workspace ID slug as a label. Use the discovered canonical route including its hash fragment. End the turn after registering an agent completion watch; on completion, link the returned assistant reply using its exact message ID."}],ie=new Set(["pr-reviewer"]),Xr="developer";function es(e){return v.find(t=>t.id===e)}function u(e){return e??""}function _t(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function $(e,t,r){if(e.source!=="user"||!r?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const s=t.find(i=>i.id===e.id)??v.find(i=>i.id===e.id);return s?u(e.name)===u(s.name)&&u(e.description)===u(s.description)&&u(e.behaviorPrompt)===u(s.defaultBehaviorPrompt)&&u(e.roleReminder)===u(s.roleReminder)&&u(e.reasoningEffort)===u(s.reasoningEffort)&&_t(e.modelOptions,s.modelOptions):!1}const ts=a.createSelector(e=>e.specialists.bundledSpecialists),yt=a.createSelector(e=>e.specialists.fileSpecialists),rs=a.createSelector(e=>S(yt.select(e))),ss=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const is=a.createSelector(e=>e.specialists.customSpecialistsLoaded),ns=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),as=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),os=a.createSelector(e=>e.specialists.specialistsFolderPath),cs=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(ie.has(t)&&!se.select(e)));function wt(e,t){return t?e:e.filter(r=>!ie.has(r.id))}function kt(e,t){return wt(e,t).filter(r=>!r.hidden)}function ls(e,t){return kt(e,t).filter(r=>r.role!=="internal")}const b=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=S(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const l of r)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of v)!i.has(l.id)&&x.select(e,l.id)&&(i.add(l.id),o.push(l));const c=new Map;for(const l of v)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,f)=>{const _=c.has(l.id),I=c.has(f.id);return _&&I?(c.get(l.id)??0)-(c.get(f.id)??0):_&&!I?-1:!_&&I?1:l.name.localeCompare(f.name)}),o}),ds=a.createSelector(e=>{const t=b.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...v.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),Et=a.createSelector((e,t)=>{const r=m(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&S(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=v.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),us=a.createSelector((e,t)=>Et.select(e,t)?.name??null),ps=a.createSelector((e,t,r)=>{const i=b.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),fs=a.createSelector((e,t,r)=>b.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),hs=a.createSelector((e,t,r)=>b.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),gs=a.createSelector((e,t,r)=>{const i=b.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function R(e,t){return t.some(r=>r.id===e)||v.some(r=>r.id===e)}const ms=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&R(t,e.specialists.bundledSpecialists)}return R(t,e.specialists.bundledSpecialists)}),bs=a.createSelector((e,t,r)=>r?!!B.select(e,t,r):!!m(e.specialists.fileSpecialists,t)),vs=a.createSelector((e,t,r)=>{if(r){const o=B.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:R(t,e.specialists.bundledSpecialists)&&!$(o,e.specialists.bundledSpecialists)}if(!R(t,e.specialists.bundledSpecialists))return!1;const i=m(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!$(i,e.specialists.bundledSpecialists)}),B=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return m(e.specialists.fileSpecialists,t)}),Ss=a.createSelector((e,t,r)=>{const s=B.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),_s=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=m(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),ys=a.createSelector((e,t,r)=>{if(r){const i=b.select(e,r).find(l=>l.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Oe.select(e,o,r);const c=xe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=m(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ct.select(e,t)}),Ct=a.createSelector((e,t)=>{const s=b.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:je.select(e)?ee.select(e):""}),ws=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?S(r):[]}),ks=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??we),Es=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),Mt=["idle","exited"];function Rt(e){return e===void 0||!Mt.includes(e)}function Cs(e){return e.status==="restarting"?"restarting":Rt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function At(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ms=a.createSelector(e=>e.voiceSettings.isLoading),Rs=a.createSelector(e=>e.voiceSettings.available),As=a.createSelector(e=>e.voiceSettings.provider),Ps=a.createSelector(e=>e.voiceSettings.engine),Ts=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Is=a.createSelector(e=>e.voiceSettings.keyConfigured),Ds=a.createSelector(e=>e.voiceSettings.vocabulary),Os=a.createSelector(e=>e.voiceSettings.openaiModel),xs=a.createSelector(e=>e.voiceSettings.language),Fs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Ls=a.createSelector(e=>e.voiceSettings.inputDeviceId),Us=a.createSelector(e=>e.voiceSettings.inputDevices),Ns=a.createSelector(e=>e.voiceSettings.busyProvider),Vs=a.createSelector(e=>e.voiceSettings.error),Hs=a.createSelector(e=>Fe.select(e)?"unavailable":At(e.voiceSettings)),U="intent.voice.inputDevice";let N;function Pt(){if(N!==void 0)return N;try{const e=localStorage.getItem(U);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ws(e){N=e;try{e===null?localStorage.removeItem(U):localStorage.setItem(U,e)}catch{}}let A=null;function qs(e){A=e}function Bs(){const e=A;return A=null,e}function Tt(){A=null}const It=300,Dt=300;class Ot{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??It,this.doublePressWindowMs=t.doublePressWindowMs??Dt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let P=null;function js(e){P=e}function Gs(){const e=P;return P=null,e}function xt(){P=null}const Ft=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function zs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Ut(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Nt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Vt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Ft,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Ut(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Nt(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Ht=300;function Wt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const qt={stopReason:"manual",autoSend:!1};let p=null,g=null,y=0,E=null;const T=new Ot({onRecordStart:()=>{E&&Bt(E)},onRecordStop:e=>{ne(E,e)}});function Ks(){return p!==null}function Ys(){return p}function $s(e){E=e,y+=1,y===1&&T.keyDown()}function Qs(e){E=e,y!==0&&(y-=1,y===0&&T.keyUp())}function Bt(e){if(p!==null)return;xt(),Tt();const t=new Vt({deviceId:Pt(),onFinished:r=>{p===t&&(p=null);const s=g??{stopReason:"auto-stop",autoSend:!1},i=g!==null;if(g=null,e.dispatch(M()),i||T.reset(),r.durationMs<Ht){s.autoSend&&e.dispatch(L());return}e.dispatch(ke({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{p===t&&(p=null),g=null,e.dispatch(M()),e.showHint(Wt(r)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=t,e.dispatch(Ee()),t.start().then(r=>{if(r!=="recording"&&(p===t&&(p=null),r==="discarded")){const s=g?.autoSend===!0;g=null,e.dispatch(M()),s&&e.dispatch(L())}})}function ne(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(L());return}g=t,r.stop()}function Zs(){ne(null,qt)}function Js(e){T.reset(),y=0,g=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(M()))}const jt=H("HardwareConsoleVoiceSetupToast"),Gt="hardware-console-voice-setup";let F=null;function zt(){return F||(F=ye(()=>import("./CBYPZH-W.js").then(e=>e.i),__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]),import.meta.url).then(e=>e.notify)),F}function Kt(){Be("/settings?tab=connections#voice").catch(e=>{jt.error("Failed to open voice settings from setup toast",e)})}function Yt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>Kt()}}function Xs(){zt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Gt,action:Yt()})})}const ei=a.createSelector(e=>e.externalEditors.selectedAction),$t=a.createSelector(e=>e.externalEditors.editors),Qt=a.createSelector(e=>{const t=S($t.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),i=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...i,...t.filter(({id:c})=>!o.has(c))]}),ti=a.createSelector(e=>e.externalEditors.editorOrder??[]),ri=a.createSelector(e=>e.externalEditors.loading),si=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ii=a.createSelector((e,t)=>{if(!(t?Le.select(e,t):Ue.select(e)))return[];const s=Zt.select(e);return Qt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function Jt(e){return e.catalogProfiles.some(t=>typeof t.remoteCompatible=="boolean")||e.defaultRemoteIncompatibility||e.profileDefaults.some(t=>typeof t.remoteCompatible=="boolean")?"supported":e.catalogProfiles.length>0?"unsupported":e.profilesLoadStatus==="idle"?"unknown":"unsupported"}function ni(e,t,r){if(W(e)){const s=t.find(i=>i.providerRef===e);return s?.remoteCompatible!==!1?null:s.remoteIncompatibility??{reason:"unknown",keys:[]}}return r?.[e]??null}function ai(e,t){return e.reason==="account-folder"?n.chat_modelPicker_remoteAccountFolder_description({backend:t}):n.chat_modelPicker_remoteIncompatible_description()}const Xt=1440*60*1e3;function oi(e,t){if(!e?.capabilities)return"missing";const r=e.observedAt?Date.parse(e.observedAt):Number.NaN;return Number.isFinite(r)&&t-r>Xt?"stale":"fresh"}const ci=new Set(["cli-missing","prerequisite-missing"]),er=new Set(["signed-out","auth-failed"]);function tr(e){return er.has(e)}function li(e,t){if(W(t))return!1;const r=J(t),s=e?.capabilities?.providers.find(i=>i.id===r);return!!s&&tr(s.status)}const rr=a.createSelector(e=>nt.select(e)&&re.select(e)&&e.remoteMachines?.supported===!0&&e.cloudMachines?.supported===!0),di=a.createSelector(e=>e.cloudMachines?.entries===!0);function ae(e){return Object.values(e.cloudMachines?.providers??{}).sort((t,r)=>t.configuredAt.localeCompare(r.configuredAt)||t.name.localeCompare(r.name))}const ui=a.createSelector(ae),pi=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).sort((t,r)=>(t.cloud?.startedAt??"").localeCompare(r.cloud?.startedAt??""))),fi=a.createSelector(e=>e.cloudMachines?.readAt??{}),hi=a.createSelector(e=>e.cloudMachines?.pending??{}),gi=a.createSelector(e=>e.cloudMachines?.failures??{}),mi=a.createSelector(e=>e.cloudMachines?.validated??null);function j(e){if(!rr.select(e))return null;const t=ae(e);if(t.length===0)return null;const r=e.cloudMachines?.entries===!0;return t.map(s=>({cloudMachineId:s.id,label:r&&(t.length>1||s.name.trim().toLowerCase()!=="e2b")?n.cloudMachines_startOn_entry_label({name:s.name}):n.cloudMachines_startOn_label(),unavailableReason:s.state==="key-rejected"?n.cloudMachines_state_keyRejected_label():null}))}function sr(e,t,r=e.cloudMachines?.providers[Ce]??null){if(!t)return null;const s=r,i=J(t);if(s&&s.agentProviders.length>0&&!s.agentProviders.includes(i))return n.cloudMachines_startOn_providerMissing();const o=e.providerSettings?.profiles;if(W(t)){const l=o?S(o.items).find(f=>f.providerRef===t):void 0;return l?l.remoteCompatible===!1?n.cloudMachines_startOn_needsProfile():l.env.some(f=>f.kind==="set")?null:n.cloudMachines_startOn_needsProfile():null}const c=o?.defaults?.[i];return c?c.remoteCompatible===!1?n.cloudMachines_startOn_needsProfile():c.env.some(l=>l.kind==="set")?null:n.cloudMachines_startOn_needsProfile():o?.loadStatus==="success"?n.cloudMachines_startOn_needsProfile():null}const ir={macos:"macOS",linux:"Linux",windows:"Windows"},nr={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function w(e,t){const r=[e&&(ir[e]??e),t&&(nr[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function ar(e){return e?.placement?.target==="remote"||e?.placement?.target==="e2b"}const or=new Set(["running","paused","resuming","pausing","stopping"]);function cr(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&or.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function bi(e,t){if(!e||!ar(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(e.placement?.target==="e2b")return{nodeId:r,name:e.nodeName?.trim()||"E2B",platform:w(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:cr(e,s)}};const i=w(e.placement?.os,e.placement?.arch)??w(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||n.remoteAgent_location_unknownMachine(),platform:i,state:o}}function vi(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||n.remoteAgent_location_unknownMachine(),platform:w(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function oe(e){switch(e){case"starting":return n.cloudMachines_agent_starting();case"running":return n.cloudMachines_agent_running();case"paused":return n.cloudMachines_agent_paused();case"resuming":return n.cloudMachines_agent_resuming();case"pausing":return n.cloudMachines_agent_pausing();case"stopping":return n.cloudMachines_agent_stopping();default:return null}}function Si(e){const t=oe(e.cloud?.state);return t?n.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function _i(e){if(e.cloud){const r=oe(e.cloud.state),s=n.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?n.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?n.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):n.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return n.remoteAgent_location_tooltipWithState({location:t,state:n.remoteMachines_state_unreachable_label()});case"revoked":return n.remoteAgent_location_tooltipWithState({location:t,state:n.remoteMachines_state_revoked_label()});default:return t}}function yi(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function ce(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function lr(e,t){const r=e.detail??"",s=ce(r),i=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(i&&s?.data.reason==="prepared-checkout")return{updateRequired:i,message:n.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=Y(s?.data),c=o??(e.code?Y({code:e.code}):null);return c?{updateRequired:i,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:i,message:s?.message||r}}function wi(e){if(e?.placement?.target!=="e2b"||!e.placementError||e.status!==Me.Error)return null;const t=lr(e.placementError,"");return t.cloud?t:null}const dr=["attachments-too-large-for-machine:","node-prompt-too-large:"],ur="remote-agent-unsupported:";function Q(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function ki(e){const t=ce(e)?.message??e;for(const s of dr){const i=t.indexOf(s);if(i<0)continue;const o=t.slice(i+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?n.remoteAgent_attachmentsTooLargeSized_error({size:Q(Number(c[1])),limit:Q(Number(c[2]))}):o?n.remoteAgent_attachmentsTooLarge_error({detail:o}):n.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(ur);return r>=0&&/attachment/i.test(t.slice(r))?n.remoteAgent_attachmentsUnsupported_error():null}const C="",V="cloud:";function le(e){return`${V}${e}`}function de(e){return e?.startsWith(V)&&e.slice(V.length)||null}function pr(e,t){return e?.find(r=>le(r.cloudMachineId)===t&&r.unavailableReason===null)}const fr=new Set(["connected","disconnected"]);function hr(e){switch(e){case"unreachable":return n.remoteMachines_state_unreachable_label();case"revoked":return n.remoteMachines_state_revoked_label();case"update-required":return n.remoteMachines_state_updateRequired_label();default:return}}function G(e){return fr.has(e.state)}function gr({backendLabel:e,backendPlatform:t,machines:r,cloud:s}){const i=[{id:C,label:e,platform:w(t?.os,t?.arch),disabled:!1},...r.map(o=>{const c=w(o.platform?.os,o.platform?.arch);return G(o)?{id:o.id,label:o.name,platform:c,disabled:!1}:{id:o.id,label:o.name,platform:c,disabled:!0,reason:hr(o.state)}})];for(const o of s??[])i.push({id:le(o.cloudMachineId),label:o.label,platform:null,kind:"cloud",disabled:o.unavailableReason!==null,...o.unavailableReason?{reason:o.unavailableReason}:{hint:n.cloudMachines_startOn_hint()}});return i}function mr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(G)||(s??[]).some(i=>i.unavailableReason===null))}function br(e,t,r){if(!e)return C;if(de(e))return pr(r,e)?e:C;const s=t.find(i=>i.id===e);return s&&G(s)?s.id:C}function Ei(e,{cloudEntries:t=!1}={}){const r=de(e);return r?t?{target:"e2b",checkout:"isolated",cloudMachineId:r}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function Ci({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),i=e.find(c=>c.key===t),o=i?s(i):[];if(r){const c=Re(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(i&&o.length>0)return{providerId:i.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}const vr=a.createSelector(e=>re.select(e)&&e.remoteMachines?.supported===!0),z=a.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Mi=a.createSelector(e=>e.remoteMachines.localFingerprint),Ri=a.createSelector(e=>e.remoteMachines.pending),Ai=a.createSelector(e=>e.remoteMachines.failures),Pi=a.createSelector(e=>e.remoteMachines.executorBackends??[]),Sr=a.createSelector((e,t)=>{if(t===Ae)return n.layout_daemonStatus_localConnection_label();const r=m(e.connections.connections,t);return r?Ge(r):t}),_r=a.createSelector(e=>Sr.select(e,e.connections.windowBackendId)),Ti=a.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Ii=a.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return Jt({catalogProfiles:Ve.select(e,t),defaultRemoteIncompatibility:Ne.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Di=a.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),ue=a.createSelector(e=>mr({remoteMachinesVisible:vr.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:z.select(e),cloud:j(e)}));function yr(e){const t=m(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const Oi=a.createSelector(e=>ue.select(e)?gr({backendLabel:_r.select(e),backendPlatform:yr(e),machines:z.select(e),cloud:j(e)}):[]),xi=a.createSelector((e,t,r)=>ue.select(e)?br(t,z.select(e),pe(e,r)):C);function pe(e,t){const r=j(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(i=>{if(i.unavailableReason)return i;const o=sr(e,t,s[i.cloudMachineId]??null);return o?{...i,unavailableReason:o}:i})}const Fi=a.createSelector((e,t)=>pe(e,t));function Li(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let wr=0;function kr(e,t){const r=++wr;return a.dispatch(Te(e,t,r)),r}function Ui(e,t,r){a.dispatch(Pe(e,t,r))}async function fe(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(Ie({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:X.select(a.state)},{...s,intent:s?.intent??kr(e,t)}))).status==="success"}finally{a.dispatch(De(i,o))}}async function Ni(e,t,r,s,i){return fe(e,t,{kind:"effort",effort:r,previous:s},i)}async function Vi(e,t,r,s,i){return fe(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Er=a.createSelector((e,t)=>S(e.agentModel.mutations).filter(r=>r.consumerId===t)),Hi=a.createSelector((e,t)=>Er.select(e,t).some(r=>r.status==="pending")),Wi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=He.select(e,t),o=ze.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=Ke(c),f=l?Ye(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:l,identity:JSON.stringify([f,i]),connection:X.select(e),canWrite:!!s&&s.workspaceId===r&&!We.select(e,r)}});function Cr(e,t,r=!1){return e!=="auggie"||t===!0||r}const qi=a.createSelector(e=>$e.select(e)?null:q.select(e)),Mr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),h=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Bi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),ji=a.createSelector((e,t)=>!!h.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Mr.select(e)),he=a.createSelector((e,t)=>t?h.select(e,t)?.catalog.providers??[]:qe.select(e)),ge=a.createSelector((e,t)=>{if(!t)return ee.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),K=a.createSelector((e,t)=>{if(!t)return Qe.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),me=a.createSelector((e,t)=>{if(!t)return Ze.select(e);const r=K.select(e,t),s=ge.select(e,t),i=h.select(e,t)?.readiness??{};return he.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available&&(o.id!=="antigravity"||te(o.id,i[o.id]?.authenticated))).map(o=>o.id)}),Gi=a.createSelector((e,t)=>{const r=K.select(e,t),s=t?h.select(e,t)?.readiness??{}:q.select(e);return he.select(e,t).filter(i=>Cr(i.id,s[i.id]?.available,r[i.id]===!0)).map(i=>i.id)}),zi=a.createSelector((e,t)=>t?me.select(e,t):Je.select(e)),Ki=a.createSelector((e,t)=>b.select(e,t)),Yi=a.createSelector((e,t)=>t?!!h.select(e,t):Xe.select(e)),$i=a.createSelector((e,t)=>{if(!t)return et.select(e);const r=h.select(e,t)?.settings??[],s=ge.select(e,t),i=r.find(l=>l.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Qi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):tt.select(e)),Zi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):rt.select(e)),Ji=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):st.select(e)),Xi=a.createSelector((e,t,r)=>{if(!r)return it.select(e,t);const s=K.select(e,r),i=h.select(e,r);return me.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&te(o,i?.readiness[o]?.authenticated))}),en=a.createSelector((e,t)=>t?h.select(e,t)?.readiness??{}:q.select(e)),Rr={},tn=a.createSelector(e=>e.providerSettings?.profiles?.status??Rr),rn=a.createSelector(e=>e.directoryPicker.listing),sn=a.createSelector(e=>e.directoryPicker.loading),nn=a.createSelector(e=>e.directoryPicker.error),an=a.createSelector(e=>e.directoryPicker.pathError),on=a.createSelector(e=>e.directoryPicker.createError),Z={},Ar=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),cn=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),ln=a.createSelector(e=>e.mcpSettings.loading),dn=a.createSelector(e=>e.mcpSettings.error),un=a.createSelector(e=>e.mcpSettings.mutationError??null),pn=a.createSelector(e=>e.mcpSettings.enabled),Pr=a.createSelector(e=>e.mcpSettings.disabledServers),Tr=a.createSelector(e=>e.mcpSettings.statusMap),Ir=a.createSelector(e=>e.mcpSettings.toolsMap),Dr=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,k(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),Or=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),fn=a.createSelector((e,t)=>Object.keys(Or.select(e,t))),hn=a.createSelector(e=>{const t=Ar.select(e),r=Tr.select(e),s=Ir.select(e),i=Pr.select(e),o=Dr.select(e);return t.map(c=>{const l=k(c)in i,f=s[k(c)]||[];let _=r[k(c)]||"disconnected";return l&&(_="disabled"),{...c,disabled:l,status:_,tools:f,toolCount:f.length,errorMessage:o[k(c)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const gn=a.createSelector(e=>e.mcpSettings.lastImportedCount),mn=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),bn=a.createSelector(e=>e.mcpSettings.advancedSaveError),vn=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],xr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Sn=Object.fromEntries(xr.map(e=>[e.path,e.defaultValue]));export{Ws as $,Cr as A,Ks as B,Li as C,Xr as D,$ as E,xr as F,ie as G,li as H,zs as I,Pt as J,vi as K,Ci as L,ci as M,w as N,oi as O,kr as P,bt as Q,lr as R,v as S,Vi as T,Ui as U,ki as V,ni as W,ai as X,At as Y,br as Z,$r as _,Sn as a,ms as a$,Hi as a0,Er as a1,Wi as a2,ts as a3,as as a4,ui as a5,di as a6,gi as a7,rr as a8,hi as a9,an as aA,ti as aB,gs as aC,ys as aD,ps as aE,xi as aF,Hs as aG,Pi as aH,fs as aI,hs as aJ,rs as aK,ns as aL,B as aM,ot as aN,ft as aO,ht as aP,se as aQ,pt as aR,ct as aS,at as aT,dt as aU,ut as aV,vs as aW,Zt as aX,Qt as aY,ii as aZ,ri as a_,fi as aa,pi as ab,mi as ac,Sr as ad,zi as ae,ge as af,K as ag,Gi as ah,me as ai,he as aj,Zi as ak,Ji as al,Qi as am,Xi as an,en as ao,Yi as ap,$i as aq,Ki as ar,_r as as,is as at,Di as au,cs as av,on as aw,nn as ax,rn as ay,sn as az,vn as b,de as b$,bs as b0,si as b1,Mi as b2,bn as b3,mn as b4,Pr as b5,pn as b6,dn as b7,Dr as b8,gn as b9,Oi as bA,ue as bB,ss as bC,Ns as bD,Ps as bE,Ls as bF,Us as bG,Is as bH,xs as bI,Os as bJ,Ts as bK,As as bL,Rs as bM,Vs as bN,Ms as bO,Ds as bP,Fs as bQ,h as bR,Mr as bS,ji as bT,Bi as bU,fn as bV,cn as bW,qs as bX,js as bY,Xs as bZ,le as b_,ln as ba,un as bb,Ar as bc,hn as bd,Tr as be,Ir as bf,ei as bg,ds as bh,tn as bi,Ti as bj,Ai as bk,Ri as bl,z as bm,vr as bn,Ii as bo,qi as bp,Et as bq,ks as br,Es as bs,_s as bt,ws as bu,us as bv,Ss as bw,b as bx,os as by,Fi as bz,C as c,Bt as c0,Zs as c1,Qr as c2,Yr as c3,Zr as c4,Kr as c5,Yt as c6,Gr as c7,wi as d,Si as e,bi as f,_i as g,yi as h,Ni as i,Js as j,Tt as k,xt as l,Bs as m,Gs as n,ls as o,kt as p,wt as q,Ys as r,Jr as s,Cs as t,es as u,zr as v,$s as w,Qs as x,Ei as y,Rt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as P,bq as d,by as V,b as B,a_ as F,bo as L}from"./yZ5s7S5S.js";import{bs as H,b_ as z,W as _,bn as j,aA as p,aC as T,a7 as I,ay as O,aD as r,a5 as U,bS as X,bH as b,bA as Y,be as Z,b$ as $,bO as ee,c9 as c,aB as te,bV as k,bk as re}from"./B8o4lNgr.js";import{s as ne,k as ie,d as oe}from"./D46WSk8U.js";import{D as ae}from"./G0_EiVNo.js";import{I as se}from"./
|
|
1
|
+
import{t as P,bq as d,by as V,b as B,a_ as F,bo as L}from"./yZ5s7S5S.js";import{bs as H,b_ as z,W as _,bn as j,aA as p,aC as T,a7 as I,ay as O,aD as r,a5 as U,bS as X,bH as b,bA as Y,be as Z,b$ as $,bO as ee,c9 as c,aB as te,bV as k,bk as re}from"./B8o4lNgr.js";import{s as ne,k as ie,d as oe}from"./D46WSk8U.js";import{D as ae}from"./G0_EiVNo.js";import{I as se}from"./BYxkGGC-.js";import"./CM5eCs6m.js";import{L as le}from"./BvUM18CV.js";import"./tzy2FJ3p.js";import{D as ue,k as W}from"./gMye6h60.js";import{G as ce,F as y}from"./DgBCXQ71.js";var fe=T('<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M12 15.82L12 23.76M4.44 21L8.35 16.35A1.96 1.96 0 0 0 6.4 12.99L0.42 14.04M1.82 6.12L7.08 9.16A1.96 1.96 0 0 0 10.06 6.66L7.98 0.95M16.02 0.95L13.94 6.66A1.96 1.96 0 0 0 16.92 9.16L22.18 6.12M23.58 14.04L17.6 12.99A1.96 1.96 0 0 0 15.65 16.35L19.56 21" stroke="currentColor" stroke-width="2.06" stroke-linecap="butt" stroke-linejoin="round"></path></svg>');function me(f,o){if(new.target)return P({component:me,...f});H(o,!0);let e=d(o,"width",7,24),n=d(o,"class",7,"");var a={get width(){return e()},set width(s=24){e(s),p()},get class(){return n()},set class(s=""){n(s),p()},$set:V,$on:(s,m)=>B(o,s,m)},l=fe();return z(()=>{ne(l,"width",e()),ie(l,0,oe(n()))}),_(f,l),j(a)}var de=te('<div class="grid gap-2"><!> <!></div>');function E(f,o){if(new.target)return P({component:E,...f});H(o,!0);let e=d(o,"request",7),n=d(o,"value",15,""),a=d(o,"busy",7,!1),l=d(o,"static",7,!1),s=d(o,"onAccept",7),m=d(o,"onCancel",7),v=k(null);var A={get request(){return e()},set request(t){e(t),p()},get value(){return n()},set value(t=""){n(t),p()},get busy(){return a()},set busy(t=!1){a(t),p()},get static(){return l()},set static(t=!1){l(t),p()},get onAccept(){return s()},set onAccept(t){s(t),p()},get onCancel(){return m()},set onCancel(t){m(t),p()},$set:V,$on:(t,g)=>B(o,t,g)},h=I(),i=O(h);{var u=t=>{{let g=c(()=>e().options.confirmLabel??L.modals_bulkActionConfirm_confirm_label()),M=c(()=>e().options.cancelLabel??L.modals_bulkActionConfirm_cancel_label()),D=c(()=>e().options.destructive??!1);ue(t,{open:!0,get static(){return l()},get title(){return e().options.title},get description(){return e().options.description},get confirmLabel(){return r(g)},get cancelLabel(){return r(M)},get destructive(){return r(D)},get busy(){return a()},onConfirm:()=>s()(n()),get onCancel(){return m()}})}},q=t=>{{let g=c(()=>e().options.confirmLabel??L.modals_input_confirm_label()),M=c(()=>e().options.cancelLabel??L.modals_input_cancel_label()),D=c(()=>!e().options.field.required||n().trim().length>0);W(t,{open:!0,get static(){return l()},get title(){return e().options.title},get description(){return e().options.description},get submitLabel(){return r(g)},get cancelLabel(){return r(M)},get canSubmit(){return r(D)},get busy(){return a()},get initialFocus(){return r(v)},onSubmit:()=>s()(n()),get onCancel(){return m()},children:(J,ge)=>{var S=de(),G=U(S);{var K=C=>{le(C,{for:"confirm-prompt-field",children:(R,w)=>{Z();var N=$();z(()=>ee(N,e().options.field.label)),_(R,N)},$$slots:{default:!0}})};F(G,C=>{e().options.field.label&&C(K)})}var Q=X(G,2);{let C=c(()=>e().options.field.type??"text"),R=c(()=>e().options.field.label?void 0:e().options.title);se(Q,{id:"confirm-prompt-field",get type(){return r(C)},get placeholder(){return e().options.field.placeholder},get"aria-label"(){return r(R)},get ref(){return r(v)},set ref(w){b(v,w,!0)},get value(){return n()},set value(w){n(w)}})}Y(S),_(J,S)},$$slots:{default:!0}})}},x=t=>{{let g=c(()=>e().options.confirmLabel??L.modals_input_confirm_label());W(t,{open:!0,get static(){return l()},role:"alertdialog",get title(){return e().options.title},get description(){return e().options.description},get submitLabel(){return r(g)},showCancel:!1,dismissOnInteractOutside:!1,get busy(){return a()},onSubmit:()=>s()(n()),onCancel:()=>s()(n())})}};F(i,t=>{e()?.kind==="confirm"?t(u):e()?.kind==="prompt"?t(q,1):e()?.kind==="alert"&&t(x,2)})}return _(f,h),j(A)}function pe(f,o){if(new.target)return P({component:pe,...f});H(o,!0);let e=k(null),n=k(""),a=k(!1);re(()=>ce(i=>{b(e,i,!0),b(n,i?.kind==="prompt"?i.options.field.initialValue??"":"",!0),b(a,!1)}));function l(){!r(e)||r(a)||y(r(e).id,r(e).kind==="confirm"?!1:null)}async function s(){if(!r(e)||r(a))return;const i=r(e);b(a,!0);try{i.kind==="confirm"?(await i.options.onConfirm?.(),y(i.id,!0)):i.kind==="prompt"?(await i.options.onConfirm?.(r(n).trim()),y(i.id,r(n).trim())):y(i.id,void 0)}catch(u){throw console.error("Confirm action failed:",u),b(a,!1),u}}var m={$set:V,$on:(i,u)=>B(o,i,u)},v=I(),A=O(v);{var h=i=>{var u=I(),q=O(u);ae(q,()=>r(e).id,x=>{E(x,{get request(){return r(e)},get busy(){return r(a)},onAccept:s,onCancel:l,get value(){return r(n)},set value(t){b(n,t,!0)}})}),_(i,u)};F(A,i=>{r(e)&&i(h)})}return _(f,v),j(m)}export{pe as C,me as L};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p,ad as C,aE as q,M as W,k as G,U,r as j,aD as K,N as J}from"./
|
|
1
|
+
import{a as p,ad as C,aE as q,M as W,k as G,U,r as j,aD as K,N as J}from"./BJ_6izfA.js";import{g as Y}from"./CKI5DKl7.js";var M="",A="",O="",D=[],b=new Map,v=p(e=>K(e,J()),"sanitizeText"),$=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map($)};case"choice":return{...e,alternatives:e.alternatives.map($)};case"optional":return{...e,element:$(e.element)};case"repetition":return{...e,element:$(e.element),separator:e.separator?$(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),Q=p(()=>{M="",A="",O="",D.length=0,b.clear(),G(),C.debug("[Railroad] Database cleared")},"clear"),P=p(e=>{M=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),L=p(()=>M,"getTitle"),Z=p(e=>{const i={...e,name:v(e.name),definition:$(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),V=p(()=>D,"getRules"),ee=p(e=>b.get(e),"getRule"),te=p(e=>{A=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),re=p(()=>A,"getAccTitle"),ie=p(e=>{O=v(e).replace(/\n\s+/g,`
|
|
2
2
|
`),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ae=p(()=>O,"getAccDescription"),ne=P,oe=L,le={clear:Q,setTitle:P,getTitle:L,addRule:Z,getRules:V,getRule:ee,setAccTitle:te,getAccTitle:re,setAccDescription:ie,getAccDescription:ae,setDiagramTitle:ne,getDiagramTitle:oe},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},se=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,de=/^[\w "',.-]+$/,ce=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),I=p(e=>e?Object.keys(e).every(i=>i==="railroad"||ce.has(i)):!1,"isRailroadStyleOptions"),me=p(e=>e?"railroad"in e&&e.railroad?e.railroad:I(e)?e:{}:{},"extractRailroadOverrides"),he=p(e=>{if(!e||I(e))return{};const{railroad:i,svgId:n,theme:a,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return se.test(n)?n:i},"sanitizeColorValue"),X=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return de.test(n)?n:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const n=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:i},"sanitizeNumberValue"),pe=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),ue=p(e=>{const i=X(e.fontFamily,f.fontFamily),n=pe(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:n,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=W(),n={...U(),...i.themeVariables??{},...he(e)},a=ue(n),t={...i.railroad??{},...me(e)};return{compactMode:t.compactMode??a.compactMode,padding:F(t.padding,a.padding),verticalSeparation:F(t.verticalSeparation,a.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,a.horizontalSeparation),arcRadius:F(t.arcRadius,a.arcRadius),fontSize:F(t.fontSize,a.fontSize),fontFamily:X(t.fontFamily,a.fontFamily),terminalFill:m(t.terminalFill,a.terminalFill),terminalStroke:m(t.terminalStroke,a.terminalStroke),terminalTextColor:m(t.terminalTextColor,a.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:m(t.lineColor,a.lineColor),strokeWidth:F(t.strokeWidth,a.strokeWidth),markerFill:m(t.markerFill,a.markerFill),commentFill:m(t.commentFill,a.commentFill),commentStroke:m(t.commentStroke,a.commentStroke),commentTextColor:m(t.commentTextColor,a.commentTextColor),specialFill:m(t.specialFill,a.specialFill),specialStroke:m(t.specialStroke,a.specialStroke),ruleNameColor:m(t.ruleNameColor,a.ruleNameColor),showMarkers:t.showMarkers??a.showMarkers,markerRadius:F(t.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),we=p(e=>{const{fontFamily:i,fontSize:n,terminalFill:a,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
|
|
3
3
|
.railroad-diagram {
|
|
4
4
|
font-family: ${i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as Mt,bq as ae,_ as Ar,a_ as re,by as Ut,bu as be,bs as Zt,b as jt,bo as d}from"./yZ5s7S5S.js";import{bs as Et,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as zt,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as C,bO as g,bS as p,bl as S,aB as k,bj as Vr,aw as tt,ai as Wr,c5 as pr,a as gr,a7 as je,aj as vt,cd as Nr,br as Br}from"./B8o4lNgr.js";import{D as mr,E as Or}from"./G0_EiVNo.js";import{s as rt,l as yt,k as or,h as Pt}from"./D46WSk8U.js";import{c as St}from"./CVjN4vxe.js";import{b as _r}from"./D2g8BuR1.js";import{Hb as V,n1 as hr,ux as wr,uw as br,Jq as Hr,Jr as qr,et as Yr,eu as Jr,IR as ir,ld as Ht,Ay as nr,rh as sr,no as Kr,yb as Xr,a9 as lr,HH as Gr,HY as Zr,mD as Qr,iy as ea,n3 as ta,tZ as ra,yy as aa,IQ as oa}from"./WOicJa2k.js";import{g as ia}from"./CoSk1zgY.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./Cu31g7xE.js";import{by as va,bL as pa,dk as ga}from"./D24Lh2xV.js";import{w as cr,d as ma}from"./CbEQLVJd.js";import{f as _a}from"./CWKAugar.js";import{n as Yt}from"./3cdteGtc.js";import{f as Fe,ax as ha}from"./CyAayV8v.js";import"./Cb1eroFO.js";import{F as Qe,a9 as wa,ar as ba,aU as xa,a_ as Tt,cl as ya,cm as Pa,bh as $a,cI as ka,c2 as Ia}from"./ah7LAYm4.js";import{g as Ca,i as Fa,w as ur}from"./9ZGNcJrk.js";import{c as Sa}from"./ChTqQfQN.js";import"./BIqUw3gi.js";import{M as Da}from"./Ozne-tFy.js";import{i as Jt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Xt,p as Ma}from"./COWTRkIf.js";import{M as Ua}from"./B6GFXjaE.js";import{t as Kt,u as xr}from"./Dfbagr79.js";import"./kcPg9Fan.js";import"./CoKvDYIY.js";import{M as Dt}from"./BB2kR3UP.js";import{V as ja}from"./uuGBA4cr.js";import{bG as Ea,a_ as za}from"./CKXP5Dfl.js";import{ag as La}from"./h-HGzFkJ.js";const yr=V.createSelector((X,x)=>hr(X.pdfPreview.previews,x));var Aa=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Va=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(X,x){if(new.target)return Mt({component:Gt,...X});Et(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Ce=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),W=O(1),B=O(1),se=O(!0),E=O(!1),ze=O(null),We=O(0);const ye=i(()=>Ie()?.error??e(ze)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(We);const z=crypto.randomUUID();return V.dispatch(wr(Se,z,l,y,...Ce()?[{gitRootId:Ce()}]:[])),()=>{V.dispatch(br(Se,z))}}),ke(()=>{const l=Ie()?.url;let y=!1,z;if(u(Q,null),u(ze,null),u(se,!0),u(W,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:J}=await Ar(async()=>{const{loadPdfDocument:he}=await import("./BqoyBPEG.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;z=J(l);const le=await z.promise;y||u(Q,le)}catch(J){if(y)return;u(ze,J instanceof Error&&J.name==="PasswordException"?"password":J instanceof Error&&J.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,z?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),z=e(W),J=e(B);if(!l||!y)return;let le=!1,he,U;const de=()=>{if(!U)return;const K=(_e.get(U)??1)-1;K?_e.set(U,K):(_e.delete(U),U.cleanup()),U=void 0};return u(E,!0),(async()=>{try{if(U=await l.getPage(z),_e.set(U,(_e.get(U)??0)+1),le){de();return}const K=U.getViewport({scale:J}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(K.width*K.height)));y.width=Math.ceil(K.width*ee),y.height=Math.ceil(K.height*ee),y.style.width=`${K.width}px`,y.style.height=`${K.height}px`,he=U.render({canvas:y,viewport:K,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(ze,"invalid")}finally{le||u(E,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var Ne={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Ce()},set gitRootId(l){Ce(l),oe()},$set:Ut,$on:(l,y)=>jt(x,l,y)},o=Va(),c=R(o);{var M=l=>{{const y=J=>{Ge();var le=et();C(()=>g(le,e(De))),s(J,le)};let z=i(()=>d.ui_combobox_retry_label());Ca(l,{onRetry:()=>Ot(We),get retryLabel(){return e(z)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Fa(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Aa(),z=ue(y),J=R(z);{let ge=i(()=>e(W)<=1);Fe(J,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(W,-1),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(J,2),he=S(le,!0),U=p(le,2);{let ge=i(()=>e(W)>=e(Q).numPages);Fe(U,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(W),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(U,2);{let ge=i(()=>e(B)<=.25);Fe(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var K=p(de,2),ee=S(K,!0),ot=p(K,2);{let ge=i(()=>e(B)>=3);Fe(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(z);var it=p(z,2),Ye=R(it);let Ze;_r(Ye,ge=>u(qe,ge),()=>e(qe)),P(it),C((ge,Pe,Je)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(E)),rt(Ye,"aria-label",Je),Ze=yt(Ye,"",Ze,{visibility:e(E)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Kt(e(W)),total:Kt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Kt(e(W))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(X,o);var Le=zt(Ne);return ie(),Le}const Wa=V.createSelector((X,x)=>hr(X.videoPreview.previews,x));var Na=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(X,x){if(new.target)return Mt({component:Pr,...X});Et(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Ce=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Wa(Q),W=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,E=!1;Vr(()=>{E=!0,V.dispatch(Hr(Q))});function ze(){if(E||e(W))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),V.dispatch(qr(Q,m.hostname,m.toString()))}function We(m){if(E)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&ze()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Ce()},set allowDownload(m){Ce(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:Ut,$on:(m,w)=>jt(x,m,w)},De=qa(),Ne=R(De);{var o=m=>{var w=Oa(),Le=R(w),l=S(Le,!0),y=p(Le,2);{var z=U=>{var de=Na(),K=S(de,!0);C(ee=>g(K,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(U,de)},J=U=>{var de=Ba(),K=S(de,!0);C(ee=>g(K,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(U,de)};re(y,U=>{e(W)?U(z):U(J,-1)})}var le=p(y,2);{var he=U=>{Fe(U,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,K)=>{Ge();var ee=et();C(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,U=>{Ce()&&U(he)})}P(w),C(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),Le=S(w,!0);C(l=>{rt(w,"src",Ie()?.url??$()),g(Le,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,We),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&ze()}),s(m,w)};re(Ne,m=>{e(B)||e(W)?m(o):m(c,-1)})}P(De),s(X,De);var M=zt(ye);return ie(),M}var Ya=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ja=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ka=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Xa=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(X,x){if(new.target)return Mt({component:Rt,...X});Et(x,!0);const Ie=t=>{var a=Ya(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Fe(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),j=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Fe(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),C(()=>g(h,e(ze))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Ce=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},W=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),E=O(0);const ze=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let We=O(!1),ye=O(0),De=O(0),Ne=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function Le(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(Ne,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(E),u(Ne,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},z=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},J=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=z(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},K=()=>{u(E,(e(E)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(W)==="video"?le():e(W)==="svg"?he():J(),t.download=e(B),t.click()},ot=async()=>{try{const t=J(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const j=document.createElement("canvas");j.width=a.naturalWidth,j.height=a.naturalHeight;const D=j.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),j.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(We,!0),setTimeout(()=>u(We,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Ye=t=>t.split(`
|
|
2
|
-
`).map(f=>f.split(",").map(_=>_.trim()));var Ze={get filePath(){return ie()},set filePath(t){ie(t),oe()},get fileContent(){return $()},set fileContent(t=""){$(t),oe()},get sourceUrl(){return ne()},set sourceUrl(t){ne(t),oe()},get language(){return Ce()},set language(t){Ce(t),oe()},get isBinary(){return Se()},set isBinary(t){Se(t),oe()},get allowDownload(){return xe()},set allowDownload(t=!0){xe(t),oe()},get onDownload(){return _e()},set onDownload(t){_e(t),oe()},get downloading(){return Q()},set downloading(t=!1){Q(t),oe()},$set:Ut,$on:(t,a)=>jt(x,t,a)},ge=io();tt("blur",gr,m);var Pe=R(ge);{var Je=t=>{var a=Ja(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let te=i(()=>d.editor_fileViewer_rotate_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:K,get title(){return e(te)},children:(we,Te)=>{Qe(we,{get icon(){return wa},size:"sm"})},$$slots:{default:!0}})}var j=p(h,4);{let te=i(()=>d.editor_fileViewer_copyImage_tooltip());Fe(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ot,get title(){return e(te)},children:(we,Te)=>{var Ee=je(),Be=ue(Ee);{var At=Ke=>{Qe(Ke,{get icon(){return ba},size:"sm",class:"text-green-500"})},pt=Ke=>{Qe(Ke,{get icon(){return xa},size:"sm"})};re(Be,Ke=>{e(We)?Ke(At):Ke(pt,-1)})}s(we,Ee)},$$slots:{default:!0}})}var D=p(j,2);{let te=i(()=>!xe()||Q()),we=i(()=>d.editor_fileViewer_download_tooltip());Fe(D,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(te)},get title(){return e(we)},children:(Te,Ee)=>{Qe(Te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var T=p(D,2),H=S(T,!0);P(f);var L=p(f,2),G=S(L);P(a),C(te=>{g(H,e(B)),or(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(L,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(G,"src",te),rt(G,"alt",e(B)),yt(G,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(E)??""}deg); transition: transform 0.2s;`)},[()=>J()]),vt("pointerdown",L,w),vt("pointermove",L,Le),vt("pointerup",L,l),tt("pointercancel",L,l),tt("lostpointercapture",L,l),s(t,a)},$e=t=>{var a=Ka(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let L=i(()=>!xe()||Q()),G=i(()=>d.editor_fileViewer_download_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(L)},get title(){return e(G)},children:(te,we)=>{Qe(te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var j=p(h,2),D=S(j,!0);P(f);var T=p(f,2),H=S(T);P(a),C(L=>{g(D,e(B)),or(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(T,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(H,"src",L),rt(H,"alt",e(B)),yt(H,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>he()]),vt("pointerdown",T,w),vt("pointermove",T,Le),vt("pointerup",T,l),tt("pointercancel",T,l),tt("lostpointercapture",T,l),s(t,a)},fe=t=>{const a=i(le);var f=je(),_=ue(f);mr(_,()=>ie()+e(a),h=>{Pr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return xe()},get downloading(){return Q()},onDownload:ee})}),s(t,f)},nt=t=>{var a=Xa(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=R(h),D=p(j);P(h),P(a),C((T,H)=>{g(_,e(B)),rt(j,"src",T),g(D,` ${H??""}`)},[()=>J(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,a)},$t=t=>{var a=Za(),f=p(R(a),2),_=S(f,!0),h=p(f,2);{let j=i(()=>!xe()||Q());Fe(h,{size:"sm",variant:"secondary",onclick:ee,get disabled(){return e(j)},children:(D,T)=>{var H=Ga(),L=ue(H);Qe(L,{get icon(){return Tt},size:"sm",class:"mr-2"});var G=p(L);C(te=>g(G,` ${te??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(D,H)},$$slots:{default:!0}})}P(a),C(j=>g(_,j),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},ct=t=>{{let a=i(()=>it($().toString()));Xt(t,{get value(){return e(a)},language:"json",get fileName(){return ie()},lineNumbers:!0,readOnly:!0})}},ut=t=>{const a=i(()=>Ye($().toString()));var f=ro(),_=R(f),h=R(_),j=R(h);Pt(j,23,()=>e(a)[0]||[],(T,H)=>`header-${H}-${T}`,(T,H)=>{var L=Qa(),G=S(L,!0);C(()=>g(G,e(H))),s(T,L)}),P(j),P(h);var D=p(h);Pt(D,23,()=>e(a).slice(1),(T,H)=>`row-${H}`,(T,H,L)=>{var G=to();Pt(G,23,()=>e(H),(te,we)=>`cell-${e(L)}-${we}`,(te,we)=>{var Te=eo(),Ee=S(Te,!0);C(()=>g(Ee,e(we))),s(te,Te)}),P(G),s(T,G)}),P(D),P(_),P(f),s(t,f)},kt=t=>{var a=ao(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),C(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_archive_label()]),s(t,a)},Lt=t=>{var a=oo(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),C(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_binary_label()]),s(t,a)},It=t=>{{let a=i(()=>$().toString());Xt(t,{get value(){return e(a)},get language(){return Ce()},get fileName(){return ie()},lineNumbers:!0,highlightActiveLine:!0})}};re(Pe,t=>{e(W)==="image"?t(Je):e(W)==="svg"?t($e,1):e(W)==="video"?t(fe,2):e(W)==="audio"?t(nt,3):e(W)==="pdf"?t($t,4):e(W)==="json"?t(ct,5):e(W)==="csv"?t(ut,6):e(W)==="archive"?t(kt,7):e(W)==="binary"?t(Lt,8):t(It,-1)})}return P(ge),s(X,ge),zt(Ze)}Wr(["pointerdown","pointermove","pointerup"]);const no=/access denied|permission denied|outside (?:the )?workspace/i,so=/file not found|no such file or directory/i;function lo(X){return no.test(X)?"access-denied":X===d.files_read_notFound_error()||so.test(X)?"not-found":"generic"}function co(X){switch(X){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var uo=k("<!> <!>",1),fo=k("<!> <!> <!>",1),vo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),fr=k('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),po=k('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),vr=k('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),go=k('<div class="flex items-center gap-3"><!> <!></div>'),mo=k('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),_o=k('<p class="text-xs"> </p>'),ho=k("<li><!></li>"),wo=k('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),bo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),xo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),yo=k('<div class="h-full overflow-auto p-4"><!></div>');function Po(X,x){if(new.target)return Mt({component:Po,...X});Et(x,!0);const Ie=()=>be($e,"$workspace",E),at=()=>be(J,"$fileContentStore",E),ie=()=>be(le,"$fileLoadingStore",E),$=()=>be(he,"$fileSavingStore",E),ne=()=>be(U,"$fileErrorStore",E),Ce=()=>be(de,"$fileNotFoundCandidatesStore",E),Se=()=>be(K,"$isFileBinaryStore",E),xe=()=>be(ee,"$isFileDirtyStore",E),_e=()=>be(ot,"$fileLastUpdatedStore",E),Q=()=>be(it,"$ftChanges$",E),qe=()=>be(Je,"$gutterRead$",E),W=()=>be(De,"$lineWrapping",E),B=()=>be(Ne,"$diffIndicators",E),se=()=>be(ge,"$rootMediaPreview",E),[E,ze]=Zt(),We=r=>{var n=uo(),I=ue(n);{var F=pe=>{var Ae=je(),Oe=ue(Ae);St(Oe,()=>Dt,(ft,_t)=>{_t(ft,{get icon(){return $a},get label(){return e(_)},disabled:!0})}),s(pe,Ae)};re(I,pe=>{!e(te)&&!e(l)&&!e(t)&&pe(F)})}var ve=p(I,2);{var Re=pe=>{{let Ae=i(()=>!e(Ct)||!e(L)),Oe=i(()=>!e(l)&&(!e(Ct)||!e(L)));ja(pe,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Ct)},get previewEnabled(){return e(L)},onTogglePreview:()=>u(L,!e(L)),get showWrap(){return e(Ae)},get wrapEnabled(){return W()},onToggleWrap:()=>V.dispatch(Zr()),get showDiff(){return e(Oe)},get diffEnabled(){return B()},onToggleDiff:()=>V.dispatch(Gr())})}};re(ve,pe=>{o().filePath&&!e(te)&&!e(t)&&pe(Re)})}s(r,n)},ye=r=>{var n=je(),I=ue(n);{var F=ve=>{var Re=fo(),pe=ue(Re);{var Ae=Ve=>{var Xe=je(),lt=ue(Xe);{let ht=i(()=>d.layout_fileTab_goToChanges_tooltip());St(lt,()=>Dt,(wt,bt)=>{bt(wt,{get icon(){return Ia},get label(){return e(ht)},onclick:Tr})})}s(Ve,Xe)};re(pe,Ve=>{e(kr)&&Ve(Ae)})}var Oe=p(pe,2);{var ft=Ve=>{var Xe=je(),lt=ue(Xe);{let ht=i(()=>d.layout_fileTab_downloadFile_label()),wt=i(()=>!e(gt)||e(st));St(lt,()=>Dt,(bt,Wt)=>{Wt(bt,{get icon(){return Tt},get label(){return e(ht)},onclick:Ft,get disabled(){return e(wt)}})})}s(Ve,Xe)};re(Oe,Ve=>{e(Be)&&Ve(ft)})}var _t=p(Oe,2);{let Ve=i(()=>d.layout_fileTab_deleteFile_tooltip());St(_t,()=>Dt,(Xe,lt)=>{lt(Xe,{get icon(){return ka},get label(){return e(Ve)},onclick:Rr,destructive:!0})})}s(ve,Re)};re(I,ve=>{o().filePath&&!e(te)&&!e(l)&&ve(F)})}s(r,n)},De=Ea(),Ne=za();let o=ae(x,"tab",7),c=ae(x,"workspaceId",7),M=ae(x,"isActive",7),m=ae(x,"isPanelFocused",7);ke(()=>{const r=c();if(!(!M()||!r||e(w)))return V.dispatch(Yr(r,"files")),()=>V.dispatch(Jr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),Le=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?_a(o().filePath,e(w)):o().filePath),z=Nr(e(y));ke(()=>{z.set(e(y))});const J=na(c(),z),le=sa(c(),z),he=la(c(),z),U=da(c(),z),de=ca(c(),z),K=ua(c(),z),ee=dr(c(),z),ot=fa(c(),z),it=va(c()),Ye=ia(),Ze=crypto.randomUUID(),ge=yr(Ze),Pe=`file-gutter:${crypto.randomUUID()}`,Je=pa(c(),Pe),$e=ga(c()),fe=i(()=>Ie()?.worktreePath||Ie()?.repositoryPath||Ie()?.path||null),nt=i(at),$t=i(ie),ct=i($),ut=i(ne),kt=i(()=>e(ut)?lo(e(ut)):"generic"),Lt=5,It=i(()=>(Ce()??[]).slice(0,Lt)),t=i(Se),a=i(xe),f=i(_e),_=i(()=>e(ct)?d.ui_saveIndicator_saving_tooltip():e(a)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let h=O(null),j=O(Br([])),D=O(null),T=O(void 0),H=O(void 0),L=O(!0);ke(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(H)||(u(H,n,!0),u(T,{line:r},!0),u(L,!1))});const G=i(()=>e(w)?cr(o().filePath,e(Le)):null),te=i(()=>e(w)?!e(G):!!(o().filePath&&(Ta(o().filePath)||e(fe)&&Ra(o().filePath,e(fe))))),we=i(()=>o().filePath&&e(fe)?Jt(o().filePath)?o().filePath:`${e(fe)}/${o().filePath}`:null),Te=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Ee=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Be=i(()=>c()&&/^[A-Za-z0-9._-]+$/.test(c())?cr(o().filePath,e(fe)):null),At=i(()=>!e(w)&&e(Be)?e(Be).split("/").slice(0,-1).join("/"):void 0),pt=i(()=>e(Te)||e(Ee)?e(Be):null),Ke=i(()=>e(w)&&e(Ee)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);ke(()=>{if(!M()||!e(w)||!e(G)||!e(Ke))return;const r=crypto.randomUUID();return V.dispatch(wr(Ze,r,c(),e(G),{gitRootId:e(w),mimeType:e(Ke)})),()=>V.dispatch(br(Ze,r))});let st=O(!1);const gt=i(()=>!!e(Be)&&!e($t)&&(!e(Ee)||e(D)===e(Be))),Qt=i(()=>e(D)&&c()?`workspace-file://${c()}/${e(D).split("/").map(encodeURIComponent).join("/")}`:null),Vt=i(()=>o().filePath?ta(o().filePath):"plaintext"),Ct=i(()=>e(Vt)==="markdown");ke(()=>{if(!M()||e(Te)||e(w))return;const r=e(pt),n=o().filePath,I=c(),F=o().id;if(u(D,null),!r||!n||!I)return;let ve=!1;const Re=()=>!ve&&c()===I&&o().id===F&&o().filePath===n;return(async()=>{let pe=!1;try{pe=(await ha("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Re())return;if(pe){u(D,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(D,r,!0);return}const{candidates:Ae,truncated:Oe}=await Da(I,r);if(Re()){if(!Oe&&Ae.length===1){V.dispatch(ir(I,n,Ae[0],F));return}u(D,r,!0)}})(),()=>{ve=!0}});function $r(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const mt=i(()=>e(l)||!o().filePath?null:Q().find(r=>$r(r,o().filePath))??null),kr=i(()=>!!e(mt));ke(()=>{if(e(l))return;const r=c(),n=o().filePath,I=e(fe);return()=>{if(!r||!n)return;const F=qt.select(V.state,r,n);if(F?.kind!=="editable-text")return;const ve=Ht(F.localContent),Re=dr.select(V.state,r,n),pe=Jt(n)?n:I?`${I}/${n}`:null;Re&&pe&&V.dispatch(nr(r,n,pe,ve))}}),ke(()=>{const r=o().filePath,n=e(we),I=c();if(!M())return;const F=!e(w)&&!!r&&Jt(r)&&!e(fe);r&&I&&!e(te)&&!e(Ee)&&!e(Te)&&!F&&(e(w)&&e(G)&&e(y)?V.dispatch(sr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(G)}})):V.dispatch(sr(I,r,n??r)))});function Ir(){return e(nt)??""}function Cr(r){e(l)||e(t)||!o().filePath||!c()||!e(we)||V.dispatch(oa(c(),o().filePath,Ht(r)))}function Fr(){if(e(l)||e(t)||!o().filePath||!e(we)||e(nt)===null||e(ct))return;const r=qt.select(V.state,c(),o().filePath);r?.kind==="editable-text"&&V.dispatch(nr(c(),o().filePath,e(we),Ht(r.localContent)))}function Sr(r){const n=o().filePath;!n||!c()||(V.dispatch(aa(c(),n)),V.dispatch(ir(c(),n,r,o().id)))}ke(()=>{const r=o().filePath,n=e(mt);if(!r||!n){u(j,[],!0);return}if(!M())return;const I=c(),F=crypto.randomUUID();return V.dispatch(Kr(I,Pe,F,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{V.dispatch(Xr(I,Pe,F))}}),ke(()=>{const r=qe(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(F=>F.file===o().filePath)??n[0];u(j,I?Ma(I.chunks.map(F=>({oldStart:F.oldStart,oldLines:F.oldLines,newStart:F.newStart,newLines:F.newLines,lines:F.lines.map(ve=>(ve.type===lr.Addition?"+":ve.type===lr.Deletion?"-":" ")+ve.content)}))):[],!0)});function Dr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Re=>Or(r,La(Re),n);if(I("editor.save")){r.preventDefault(),e(a)&&!e(ct)&&Fr();return}const F=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!F||e(l)&&F!=="copy"&&F!=="select-all")return;F!=="toggle-task-list"&&e(h)?.runShortcut(F)&&r.preventDefault()}function Tr(r){if(!o().filePath||!e(mt))return;const n=r?.metaKey||r?.ctrlKey||!1,F=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;V.dispatch(ra(c(),e(mt),{filePath:o().filePath,changeId:e(mt).id,openInAdjacentPanel:n,sourcePanelId:F}))}async function Ft(){const r=e(Be);if(!(e(l)||!r||!c()||!e(gt)||e(st))){u(st,!0);try{const n=await ma(c(),r,e(fe));!n?.success&&!n?.canceled&&Yt.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{Yt.error(d.layout_fileTab_downloadFailed_error())}finally{u(st,!1)}}}function Rr(){const r=e(we);if(e(l)||!o().filePath||!c()||!r)return;const n=Qr(qt.select(V.state,c(),o().filePath));if(!n){Yt.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}V.dispatch(ea(c(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}ke(()=>{if(!Ye||!M())return;const r={isDirty:!e(l)&&e(a),isSaving:!e(l)&&e(ct)};pr(()=>{Ye.registerActions({display:We,actions:ye}),Ye.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),oe()},get workspaceId(){return c()},set workspaceId(r){c(r),oe()},get isActive(){return M()},set isActive(r){M(r),oe()},get isPanelFocused(){return m()},set isPanelFocused(r){m(r),oe()},$set:Ut,$on:(r,n)=>jt(x,r,n)},er=je();tt("keydown",gr,r=>M()&&Dr(r));var Ur=ue(er);{var jr=r=>{var n=je(),I=ue(n);mr(I,()=>o().filePath,F=>{var ve=je(),Re=ue(ve);{var pe=b=>{var v=vo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0);P(v),C(Z=>{g(q,Z),g(Me,o().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ae=b=>{var v=je(),A=ue(v);{var q=N=>{Gt(N,{get workspaceId(){return c()},get filePath(){return e(G)},get gitRootId(){return e(w)}})};re(A,N=>{M()&&N(q)})}s(b,v)},Oe=b=>{var v=je(),A=ue(v);{var q=Z=>{var Y=fr(),ce=R(Y),Ue=S(ce,!0);P(Y),C(me=>g(Ue,me),[()=>d.layout_fileTab_errorLoading_label()]),s(Z,Y)},N=Z=>{Rt(Z,{get filePath(){return o().filePath},get sourceUrl(){return se().url},allowDownload:!1})},Me=Z=>{var Y=po(),ce=R(Y),Ue=S(ce,!0);P(Y),C(me=>g(Ue,me),[()=>d.layout_fileTab_preparing_label()]),s(Z,Y)};re(A,Z=>{se()?.error?Z(q):se()?.url?Z(N,1):Z(Me,-1)})}s(b,v)},ft=b=>{var v=je(),A=ue(v);{var q=N=>{Gt(N,{get workspaceId(){return c()},get filePath(){return e(pt)}})};re(A,N=>{M()&&N(q)})}s(b,v)},_t=b=>{var v=fr(),A=R(v),q=S(A,!0);P(v),C(N=>g(q,N),[()=>d.file_pdf_load_error()]),s(b,v)},Ve=b=>{{let v=i(()=>e(D)??o().filePath),A=i(()=>!e(l)&&e(gt));Rt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Qt)},onDownload:Ft,get allowDownload(){return e(A)},get downloading(){return e(st)}})}},Xe=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),C(N=>g(q,N),[()=>d.layout_fileTab_preparing_label()]),s(b,v)},lt=b=>{var v=mo(),A=R(v);Pt(A,20,()=>[...Array(20).keys()],q=>q,(q,N)=>{var Me=go(),Z=R(Me);ur(Z,{class:"h-3 w-8 shrink-0"});var Y=p(Z,2);ur(Y,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Me),s(q,Me)}),P(A),P(v),s(b,v)},ht=b=>{var v=bo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0),Z=p(N,2);{var Y=me=>{var He=_o(),dt=S(He,!0);C(()=>g(dt,e(ut))),s(me,He)};re(Z,me=>{e(kt)==="generic"&&me(Y)})}var ce=p(Z,2);{var Ue=me=>{var He=wo(),dt=ue(He),Nt=S(dt,!0),tr=p(dt,2);Pt(tr,20,()=>e(It),xt=>xt,(xt,rr)=>{var Bt=ho(),zr=R(Bt);Fe(zr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Sr(rr),children:(Lr,$o)=>{Ge();var ar=et();C(()=>g(ar,rr)),s(Lr,ar)},$$slots:{default:!0}}),P(Bt),s(xt,Bt)}),P(tr),C(xt=>g(Nt,xt),[()=>d.layout_fileTab_didYouMean_label()]),s(me,He)};re(ce,me=>{e(It).length>0&&me(Ue)})}P(v),C(me=>{g(q,me),g(Me,o().filePath)},[()=>co(e(kt))]),s(b,v)},wt=b=>{var v=xo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0),Z=p(N,2);{var Y=ce=>{{let Ue=i(()=>!e(gt)||e(st));Fe(ce,{variant:"secondary",size:"sm",onclick:Ft,get disabled(){return e(Ue)},children:(me,He)=>{Ge();var dt=et();C(Nt=>g(dt,Nt),[()=>d.layout_fileTab_downloadFile_label()]),s(me,dt)},$$slots:{default:!0}})}};re(Z,ce=>{!e(l)&&e(Be)&&ce(Y)})}P(v),C(ce=>{g(q,ce),g(Me,o().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(b,v)},bt=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var A=je(),q=ue(A);{var N=Y=>{{let ce=i(()=>o().filePath||""),Ue=i(()=>!e(l)&&e(gt));Rt(Y,{get filePath(){return e(ce)},get fileContent(){return e(nt)},get language(){return e(Vt)},get isBinary(){return e(t)},onDownload:Ft,get allowDownload(){return e(Ue)},get downloading(){return e(st)}})}},Me=Y=>{var ce=yo(),Ue=R(ce);Ua(Ue,{get content(){return e(nt)},get workspaceId(){return c()},get relativeMediaBase(){return e(At)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(ce),s(Y,ce)},Z=Y=>{var ce=Ir,Ue=Cr;{let me=i(()=>B()?e(j):[]);_r(Xt(Y,{get value(){return ce()},set value(He){Ue(He)},get language(){return e(Vt)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return c()},get filePath(){return o().filePath},get lineWrapping(){return W()},get lineChanges(){return e(me)},get jumpTo(){return e(T)},get externalContentVersion(){return e(f)},get isPanelFocused(){return m()}}),He=>u(h,He,!0),()=>e(h))}};re(q,Y=>{e(v)?Y(N):e(Ct)&&e(L)?Y(Me,1):Y(Z,-1)})}s(b,A)},Wt=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),C(N=>g(q,N),[()=>d.layout_fileTab_preparing_label()]),s(b,v)};re(Re,b=>{e(te)?b(pe):e(w)&&e(Te)&&e(G)?b(Ae,1):e(w)&&e(Ee)?b(Oe,2):e(Te)&&e(pt)?b(ft,3):e(Te)?b(_t,4):e(Qt)?b(Ve,5):e(Ee)?b(Xe,6):e($t)?b(lt,7):e(ut)?b(ht,8):e(t)?b(wt,9):e(nt)!==null?b(bt,10):b(Wt,-1)})}s(F,ve)}),s(r,n)};re(Ur,r=>{o().filePath&&r(jr)})}s(X,er);var Er=zt(Mr);return ze(),Er}export{Po as default};
|
|
1
|
+
import{t as Mt,bq as ae,_ as Ar,a_ as re,by as Ut,bu as be,bs as Zt,b as jt,bo as d}from"./yZ5s7S5S.js";import{bs as Et,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as zt,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as C,bO as g,bS as p,bl as S,aB as k,bj as Vr,aw as tt,ai as Nr,c5 as pr,a as gr,a7 as je,aj as vt,cd as Wr,br as Br}from"./B8o4lNgr.js";import{D as mr,E as Or}from"./G0_EiVNo.js";import{s as rt,l as yt,k as or,h as Pt}from"./D46WSk8U.js";import{c as St}from"./CVjN4vxe.js";import{b as _r}from"./D2g8BuR1.js";import{Hb as V,n1 as hr,ux as wr,uw as br,Jq as Hr,Jr as qr,et as Yr,eu as Jr,IR as ir,ld as Ht,Ay as nr,rh as sr,no as Kr,yb as Xr,a9 as lr,HH as Gr,HY as Zr,mD as Qr,iy as ea,n3 as ta,tZ as ra,yy as aa,IQ as oa}from"./WOicJa2k.js";import{g as ia}from"./CoSk1zgY.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./Cu31g7xE.js";import{by as va,bL as pa,dk as ga}from"./-1vWYJiy.js";import{w as cr,d as ma}from"./CbEQLVJd.js";import{f as _a}from"./CWKAugar.js";import{n as Yt}from"./BeRTGLrw.js";import{f as Fe,ax as ha}from"./Dax20l9D.js";import"./Cb1eroFO.js";import{F as Qe,a9 as wa,ar as ba,aU as xa,a_ as Tt,cl as ya,cm as Pa,bh as $a,cI as ka,c2 as Ia}from"./ah7LAYm4.js";import{g as Ca,i as Fa,w as ur}from"./BvUM18CV.js";import{c as Sa}from"./ChTqQfQN.js";import"./BIqUw3gi.js";import{N as Da}from"./Bk5SMnS3.js";import{i as Jt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Xt,p as Ma}from"./Bd69ye4n.js";import{M as Ua}from"./9pcH5qab.js";import{t as Kt,u as xr}from"./Dfbagr79.js";import"./kcPg9Fan.js";import"./6hOEL6g0.js";import{M as Dt}from"./CNGkxhSe.js";import{V as ja}from"./4byfznQh.js";import{bG as Ea,a_ as za}from"./mFLgyCOK.js";import{ag as La}from"./CEOoXkJa.js";const yr=V.createSelector((X,x)=>hr(X.pdfPreview.previews,x));var Aa=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Va=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(X,x){if(new.target)return Mt({component:Gt,...X});Et(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Ce=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),N=O(1),B=O(1),se=O(!0),E=O(!1),ze=O(null),Ne=O(0);const ye=i(()=>Ie()?.error??e(ze)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(Ne);const z=crypto.randomUUID();return V.dispatch(wr(Se,z,l,y,...Ce()?[{gitRootId:Ce()}]:[])),()=>{V.dispatch(br(Se,z))}}),ke(()=>{const l=Ie()?.url;let y=!1,z;if(u(Q,null),u(ze,null),u(se,!0),u(N,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:J}=await Ar(async()=>{const{loadPdfDocument:he}=await import("./BqoyBPEG.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;z=J(l);const le=await z.promise;y||u(Q,le)}catch(J){if(y)return;u(ze,J instanceof Error&&J.name==="PasswordException"?"password":J instanceof Error&&J.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,z?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),z=e(N),J=e(B);if(!l||!y)return;let le=!1,he,U;const de=()=>{if(!U)return;const K=(_e.get(U)??1)-1;K?_e.set(U,K):(_e.delete(U),U.cleanup()),U=void 0};return u(E,!0),(async()=>{try{if(U=await l.getPage(z),_e.set(U,(_e.get(U)??0)+1),le){de();return}const K=U.getViewport({scale:J}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(K.width*K.height)));y.width=Math.ceil(K.width*ee),y.height=Math.ceil(K.height*ee),y.style.width=`${K.width}px`,y.style.height=`${K.height}px`,he=U.render({canvas:y,viewport:K,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(ze,"invalid")}finally{le||u(E,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var We={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Ce()},set gitRootId(l){Ce(l),oe()},$set:Ut,$on:(l,y)=>jt(x,l,y)},o=Va(),c=R(o);{var M=l=>{{const y=J=>{Ge();var le=et();C(()=>g(le,e(De))),s(J,le)};let z=i(()=>d.ui_combobox_retry_label());Ca(l,{onRetry:()=>Ot(Ne),get retryLabel(){return e(z)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Fa(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Aa(),z=ue(y),J=R(z);{let ge=i(()=>e(N)<=1);Fe(J,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N,-1),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(J,2),he=S(le,!0),U=p(le,2);{let ge=i(()=>e(N)>=e(Q).numPages);Fe(U,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(U,2);{let ge=i(()=>e(B)<=.25);Fe(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var K=p(de,2),ee=S(K,!0),ot=p(K,2);{let ge=i(()=>e(B)>=3);Fe(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Je)=>{Ge();var $e=et();C(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(z);var it=p(z,2),Ye=R(it);let Ze;_r(Ye,ge=>u(qe,ge),()=>e(qe)),P(it),C((ge,Pe,Je)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(E)),rt(Ye,"aria-label",Je),Ze=yt(Ye,"",Ze,{visibility:e(E)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Kt(e(N)),total:Kt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Kt(e(N))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(X,o);var Le=zt(We);return ie(),Le}const Na=V.createSelector((X,x)=>hr(X.videoPreview.previews,x));var Wa=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(X,x){if(new.target)return Mt({component:Pr,...X});Et(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Ce=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Na(Q),N=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,E=!1;Vr(()=>{E=!0,V.dispatch(Hr(Q))});function ze(){if(E||e(N))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),V.dispatch(qr(Q,m.hostname,m.toString()))}function Ne(m){if(E)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&ze()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Ce()},set allowDownload(m){Ce(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:Ut,$on:(m,w)=>jt(x,m,w)},De=qa(),We=R(De);{var o=m=>{var w=Oa(),Le=R(w),l=S(Le,!0),y=p(Le,2);{var z=U=>{var de=Wa(),K=S(de,!0);C(ee=>g(K,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(U,de)},J=U=>{var de=Ba(),K=S(de,!0);C(ee=>g(K,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(U,de)};re(y,U=>{e(N)?U(z):U(J,-1)})}var le=p(y,2);{var he=U=>{Fe(U,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,K)=>{Ge();var ee=et();C(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,U=>{Ce()&&U(he)})}P(w),C(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),Le=S(w,!0);C(l=>{rt(w,"src",Ie()?.url??$()),g(Le,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,Ne),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&ze()}),s(m,w)};re(We,m=>{e(B)||e(N)?m(o):m(c,-1)})}P(De),s(X,De);var M=zt(ye);return ie(),M}var Ya=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Ja=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ka=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Xa=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(X,x){if(new.target)return Mt({component:Rt,...X});Et(x,!0);const Ie=t=>{var a=Ya(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Fe(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),j=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Fe(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),C(()=>g(h,e(ze))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Ce=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},N=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),E=O(0);const ze=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let Ne=O(!1),ye=O(0),De=O(0),We=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function Le(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(We,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(E),u(We,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},z=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},J=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=z(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},K=()=>{u(E,(e(E)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(N)==="video"?le():e(N)==="svg"?he():J(),t.download=e(B),t.click()},ot=async()=>{try{const t=J(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const j=document.createElement("canvas");j.width=a.naturalWidth,j.height=a.naturalHeight;const D=j.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),j.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Ne,!0),setTimeout(()=>u(Ne,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Ye=t=>t.split(`
|
|
2
|
+
`).map(f=>f.split(",").map(_=>_.trim()));var Ze={get filePath(){return ie()},set filePath(t){ie(t),oe()},get fileContent(){return $()},set fileContent(t=""){$(t),oe()},get sourceUrl(){return ne()},set sourceUrl(t){ne(t),oe()},get language(){return Ce()},set language(t){Ce(t),oe()},get isBinary(){return Se()},set isBinary(t){Se(t),oe()},get allowDownload(){return xe()},set allowDownload(t=!0){xe(t),oe()},get onDownload(){return _e()},set onDownload(t){_e(t),oe()},get downloading(){return Q()},set downloading(t=!1){Q(t),oe()},$set:Ut,$on:(t,a)=>jt(x,t,a)},ge=io();tt("blur",gr,m);var Pe=R(ge);{var Je=t=>{var a=Ja(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let te=i(()=>d.editor_fileViewer_rotate_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:K,get title(){return e(te)},children:(we,Te)=>{Qe(we,{get icon(){return wa},size:"sm"})},$$slots:{default:!0}})}var j=p(h,4);{let te=i(()=>d.editor_fileViewer_copyImage_tooltip());Fe(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ot,get title(){return e(te)},children:(we,Te)=>{var Ee=je(),Be=ue(Ee);{var At=Ke=>{Qe(Ke,{get icon(){return ba},size:"sm",class:"text-green-500"})},pt=Ke=>{Qe(Ke,{get icon(){return xa},size:"sm"})};re(Be,Ke=>{e(Ne)?Ke(At):Ke(pt,-1)})}s(we,Ee)},$$slots:{default:!0}})}var D=p(j,2);{let te=i(()=>!xe()||Q()),we=i(()=>d.editor_fileViewer_download_tooltip());Fe(D,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(te)},get title(){return e(we)},children:(Te,Ee)=>{Qe(Te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var T=p(D,2),H=S(T,!0);P(f);var L=p(f,2),G=S(L);P(a),C(te=>{g(H,e(B)),or(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(L,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(G,"src",te),rt(G,"alt",e(B)),yt(G,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(E)??""}deg); transition: transform 0.2s;`)},[()=>J()]),vt("pointerdown",L,w),vt("pointermove",L,Le),vt("pointerup",L,l),tt("pointercancel",L,l),tt("lostpointercapture",L,l),s(t,a)},$e=t=>{var a=Ka(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let L=i(()=>!xe()||Q()),G=i(()=>d.editor_fileViewer_download_tooltip());Fe(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(L)},get title(){return e(G)},children:(te,we)=>{Qe(te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var j=p(h,2),D=S(j,!0);P(f);var T=p(f,2),H=S(T);P(a),C(L=>{g(D,e(B)),or(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(T,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(H,"src",L),rt(H,"alt",e(B)),yt(H,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>he()]),vt("pointerdown",T,w),vt("pointermove",T,Le),vt("pointerup",T,l),tt("pointercancel",T,l),tt("lostpointercapture",T,l),s(t,a)},fe=t=>{const a=i(le);var f=je(),_=ue(f);mr(_,()=>ie()+e(a),h=>{Pr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return xe()},get downloading(){return Q()},onDownload:ee})}),s(t,f)},nt=t=>{var a=Xa(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=R(h),D=p(j);P(h),P(a),C((T,H)=>{g(_,e(B)),rt(j,"src",T),g(D,` ${H??""}`)},[()=>J(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,a)},$t=t=>{var a=Za(),f=p(R(a),2),_=S(f,!0),h=p(f,2);{let j=i(()=>!xe()||Q());Fe(h,{size:"sm",variant:"secondary",onclick:ee,get disabled(){return e(j)},children:(D,T)=>{var H=Ga(),L=ue(H);Qe(L,{get icon(){return Tt},size:"sm",class:"mr-2"});var G=p(L);C(te=>g(G,` ${te??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(D,H)},$$slots:{default:!0}})}P(a),C(j=>g(_,j),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},ct=t=>{{let a=i(()=>it($().toString()));Xt(t,{get value(){return e(a)},language:"json",get fileName(){return ie()},lineNumbers:!0,readOnly:!0})}},ut=t=>{const a=i(()=>Ye($().toString()));var f=ro(),_=R(f),h=R(_),j=R(h);Pt(j,23,()=>e(a)[0]||[],(T,H)=>`header-${H}-${T}`,(T,H)=>{var L=Qa(),G=S(L,!0);C(()=>g(G,e(H))),s(T,L)}),P(j),P(h);var D=p(h);Pt(D,23,()=>e(a).slice(1),(T,H)=>`row-${H}`,(T,H,L)=>{var G=to();Pt(G,23,()=>e(H),(te,we)=>`cell-${e(L)}-${we}`,(te,we)=>{var Te=eo(),Ee=S(Te,!0);C(()=>g(Ee,e(we))),s(te,Te)}),P(G),s(T,G)}),P(D),P(_),P(f),s(t,f)},kt=t=>{var a=ao(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),C(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_archive_label()]),s(t,a)},Lt=t=>{var a=oo(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),C(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_binary_label()]),s(t,a)},It=t=>{{let a=i(()=>$().toString());Xt(t,{get value(){return e(a)},get language(){return Ce()},get fileName(){return ie()},lineNumbers:!0,highlightActiveLine:!0})}};re(Pe,t=>{e(N)==="image"?t(Je):e(N)==="svg"?t($e,1):e(N)==="video"?t(fe,2):e(N)==="audio"?t(nt,3):e(N)==="pdf"?t($t,4):e(N)==="json"?t(ct,5):e(N)==="csv"?t(ut,6):e(N)==="archive"?t(kt,7):e(N)==="binary"?t(Lt,8):t(It,-1)})}return P(ge),s(X,ge),zt(Ze)}Nr(["pointerdown","pointermove","pointerup"]);const no=/access denied|permission denied|outside (?:the )?workspace/i,so=/file not found|no such file or directory/i;function lo(X){return no.test(X)?"access-denied":X===d.files_read_notFound_error()||so.test(X)?"not-found":"generic"}function co(X){switch(X){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var uo=k("<!> <!>",1),fo=k("<!> <!> <!>",1),vo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),fr=k('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),po=k('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),vr=k('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),go=k('<div class="flex items-center gap-3"><!> <!></div>'),mo=k('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),_o=k('<p class="text-xs"> </p>'),ho=k("<li><!></li>"),wo=k('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),bo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),xo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),yo=k('<div class="h-full overflow-auto p-4"><!></div>');function Po(X,x){if(new.target)return Mt({component:Po,...X});Et(x,!0);const Ie=()=>be($e,"$workspace",E),at=()=>be(J,"$fileContentStore",E),ie=()=>be(le,"$fileLoadingStore",E),$=()=>be(he,"$fileSavingStore",E),ne=()=>be(U,"$fileErrorStore",E),Ce=()=>be(de,"$fileNotFoundCandidatesStore",E),Se=()=>be(K,"$isFileBinaryStore",E),xe=()=>be(ee,"$isFileDirtyStore",E),_e=()=>be(ot,"$fileLastUpdatedStore",E),Q=()=>be(it,"$ftChanges$",E),qe=()=>be(Je,"$gutterRead$",E),N=()=>be(De,"$lineWrapping",E),B=()=>be(We,"$diffIndicators",E),se=()=>be(ge,"$rootMediaPreview",E),[E,ze]=Zt(),Ne=r=>{var n=uo(),I=ue(n);{var F=pe=>{var Ae=je(),Oe=ue(Ae);St(Oe,()=>Dt,(ft,_t)=>{_t(ft,{get icon(){return $a},get label(){return e(_)},disabled:!0})}),s(pe,Ae)};re(I,pe=>{!e(te)&&!e(l)&&!e(t)&&pe(F)})}var ve=p(I,2);{var Re=pe=>{{let Ae=i(()=>!e(Ct)||!e(L)),Oe=i(()=>!e(l)&&(!e(Ct)||!e(L)));ja(pe,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Ct)},get previewEnabled(){return e(L)},onTogglePreview:()=>u(L,!e(L)),get showWrap(){return e(Ae)},get wrapEnabled(){return N()},onToggleWrap:()=>V.dispatch(Zr()),get showDiff(){return e(Oe)},get diffEnabled(){return B()},onToggleDiff:()=>V.dispatch(Gr())})}};re(ve,pe=>{o().filePath&&!e(te)&&!e(t)&&pe(Re)})}s(r,n)},ye=r=>{var n=je(),I=ue(n);{var F=ve=>{var Re=fo(),pe=ue(Re);{var Ae=Ve=>{var Xe=je(),lt=ue(Xe);{let ht=i(()=>d.layout_fileTab_goToChanges_tooltip());St(lt,()=>Dt,(wt,bt)=>{bt(wt,{get icon(){return Ia},get label(){return e(ht)},onclick:Tr})})}s(Ve,Xe)};re(pe,Ve=>{e(kr)&&Ve(Ae)})}var Oe=p(pe,2);{var ft=Ve=>{var Xe=je(),lt=ue(Xe);{let ht=i(()=>d.layout_fileTab_downloadFile_label()),wt=i(()=>!e(gt)||e(st));St(lt,()=>Dt,(bt,Nt)=>{Nt(bt,{get icon(){return Tt},get label(){return e(ht)},onclick:Ft,get disabled(){return e(wt)}})})}s(Ve,Xe)};re(Oe,Ve=>{e(Be)&&Ve(ft)})}var _t=p(Oe,2);{let Ve=i(()=>d.layout_fileTab_deleteFile_tooltip());St(_t,()=>Dt,(Xe,lt)=>{lt(Xe,{get icon(){return ka},get label(){return e(Ve)},onclick:Rr,destructive:!0})})}s(ve,Re)};re(I,ve=>{o().filePath&&!e(te)&&!e(l)&&ve(F)})}s(r,n)},De=Ea(),We=za();let o=ae(x,"tab",7),c=ae(x,"workspaceId",7),M=ae(x,"isActive",7),m=ae(x,"isPanelFocused",7);ke(()=>{const r=c();if(!(!M()||!r||e(w)))return V.dispatch(Yr(r,"files")),()=>V.dispatch(Jr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),Le=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?_a(o().filePath,e(w)):o().filePath),z=Wr(e(y));ke(()=>{z.set(e(y))});const J=na(c(),z),le=sa(c(),z),he=la(c(),z),U=da(c(),z),de=ca(c(),z),K=ua(c(),z),ee=dr(c(),z),ot=fa(c(),z),it=va(c()),Ye=ia(),Ze=crypto.randomUUID(),ge=yr(Ze),Pe=`file-gutter:${crypto.randomUUID()}`,Je=pa(c(),Pe),$e=ga(c()),fe=i(()=>Ie()?.worktreePath||Ie()?.repositoryPath||Ie()?.path||null),nt=i(at),$t=i(ie),ct=i($),ut=i(ne),kt=i(()=>e(ut)?lo(e(ut)):"generic"),Lt=5,It=i(()=>(Ce()??[]).slice(0,Lt)),t=i(Se),a=i(xe),f=i(_e),_=i(()=>e(ct)?d.ui_saveIndicator_saving_tooltip():e(a)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let h=O(null),j=O(Br([])),D=O(null),T=O(void 0),H=O(void 0),L=O(!0);ke(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(H)||(u(H,n,!0),u(T,{line:r},!0),u(L,!1))});const G=i(()=>e(w)?cr(o().filePath,e(Le)):null),te=i(()=>e(w)?!e(G):!!(o().filePath&&(Ta(o().filePath)||e(fe)&&Ra(o().filePath,e(fe))))),we=i(()=>o().filePath&&e(fe)?Jt(o().filePath)?o().filePath:`${e(fe)}/${o().filePath}`:null),Te=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Ee=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Be=i(()=>c()&&/^[A-Za-z0-9._-]+$/.test(c())?cr(o().filePath,e(fe)):null),At=i(()=>!e(w)&&e(Be)?e(Be).split("/").slice(0,-1).join("/"):void 0),pt=i(()=>e(Te)||e(Ee)?e(Be):null),Ke=i(()=>e(w)&&e(Ee)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);ke(()=>{if(!M()||!e(w)||!e(G)||!e(Ke))return;const r=crypto.randomUUID();return V.dispatch(wr(Ze,r,c(),e(G),{gitRootId:e(w),mimeType:e(Ke)})),()=>V.dispatch(br(Ze,r))});let st=O(!1);const gt=i(()=>!!e(Be)&&!e($t)&&(!e(Ee)||e(D)===e(Be))),Qt=i(()=>e(D)&&c()?`workspace-file://${c()}/${e(D).split("/").map(encodeURIComponent).join("/")}`:null),Vt=i(()=>o().filePath?ta(o().filePath):"plaintext"),Ct=i(()=>e(Vt)==="markdown");ke(()=>{if(!M()||e(Te)||e(w))return;const r=e(pt),n=o().filePath,I=c(),F=o().id;if(u(D,null),!r||!n||!I)return;let ve=!1;const Re=()=>!ve&&c()===I&&o().id===F&&o().filePath===n;return(async()=>{let pe=!1;try{pe=(await ha("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Re())return;if(pe){u(D,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(D,r,!0);return}const{candidates:Ae,truncated:Oe}=await Da(I,r);if(Re()){if(!Oe&&Ae.length===1){V.dispatch(ir(I,n,Ae[0],F));return}u(D,r,!0)}})(),()=>{ve=!0}});function $r(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const mt=i(()=>e(l)||!o().filePath?null:Q().find(r=>$r(r,o().filePath))??null),kr=i(()=>!!e(mt));ke(()=>{if(e(l))return;const r=c(),n=o().filePath,I=e(fe);return()=>{if(!r||!n)return;const F=qt.select(V.state,r,n);if(F?.kind!=="editable-text")return;const ve=Ht(F.localContent),Re=dr.select(V.state,r,n),pe=Jt(n)?n:I?`${I}/${n}`:null;Re&&pe&&V.dispatch(nr(r,n,pe,ve))}}),ke(()=>{const r=o().filePath,n=e(we),I=c();if(!M())return;const F=!e(w)&&!!r&&Jt(r)&&!e(fe);r&&I&&!e(te)&&!e(Ee)&&!e(Te)&&!F&&(e(w)&&e(G)&&e(y)?V.dispatch(sr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(G)}})):V.dispatch(sr(I,r,n??r)))});function Ir(){return e(nt)??""}function Cr(r){e(l)||e(t)||!o().filePath||!c()||!e(we)||V.dispatch(oa(c(),o().filePath,Ht(r)))}function Fr(){if(e(l)||e(t)||!o().filePath||!e(we)||e(nt)===null||e(ct))return;const r=qt.select(V.state,c(),o().filePath);r?.kind==="editable-text"&&V.dispatch(nr(c(),o().filePath,e(we),Ht(r.localContent)))}function Sr(r){const n=o().filePath;!n||!c()||(V.dispatch(aa(c(),n)),V.dispatch(ir(c(),n,r,o().id)))}ke(()=>{const r=o().filePath,n=e(mt);if(!r||!n){u(j,[],!0);return}if(!M())return;const I=c(),F=crypto.randomUUID();return V.dispatch(Kr(I,Pe,F,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{V.dispatch(Xr(I,Pe,F))}}),ke(()=>{const r=qe(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(F=>F.file===o().filePath)??n[0];u(j,I?Ma(I.chunks.map(F=>({oldStart:F.oldStart,oldLines:F.oldLines,newStart:F.newStart,newLines:F.newLines,lines:F.lines.map(ve=>(ve.type===lr.Addition?"+":ve.type===lr.Deletion?"-":" ")+ve.content)}))):[],!0)});function Dr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Re=>Or(r,La(Re),n);if(I("editor.save")){r.preventDefault(),e(a)&&!e(ct)&&Fr();return}const F=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!F||e(l)&&F!=="copy"&&F!=="select-all")return;F!=="toggle-task-list"&&e(h)?.runShortcut(F)&&r.preventDefault()}function Tr(r){if(!o().filePath||!e(mt))return;const n=r?.metaKey||r?.ctrlKey||!1,F=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;V.dispatch(ra(c(),e(mt),{filePath:o().filePath,changeId:e(mt).id,openInAdjacentPanel:n,sourcePanelId:F}))}async function Ft(){const r=e(Be);if(!(e(l)||!r||!c()||!e(gt)||e(st))){u(st,!0);try{const n=await ma(c(),r,e(fe));!n?.success&&!n?.canceled&&Yt.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{Yt.error(d.layout_fileTab_downloadFailed_error())}finally{u(st,!1)}}}function Rr(){const r=e(we);if(e(l)||!o().filePath||!c()||!r)return;const n=Qr(qt.select(V.state,c(),o().filePath));if(!n){Yt.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}V.dispatch(ea(c(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}ke(()=>{if(!Ye||!M())return;const r={isDirty:!e(l)&&e(a),isSaving:!e(l)&&e(ct)};pr(()=>{Ye.registerActions({display:Ne,actions:ye}),Ye.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),oe()},get workspaceId(){return c()},set workspaceId(r){c(r),oe()},get isActive(){return M()},set isActive(r){M(r),oe()},get isPanelFocused(){return m()},set isPanelFocused(r){m(r),oe()},$set:Ut,$on:(r,n)=>jt(x,r,n)},er=je();tt("keydown",gr,r=>M()&&Dr(r));var Ur=ue(er);{var jr=r=>{var n=je(),I=ue(n);mr(I,()=>o().filePath,F=>{var ve=je(),Re=ue(ve);{var pe=b=>{var v=vo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0);P(v),C(Z=>{g(q,Z),g(Me,o().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ae=b=>{var v=je(),A=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(G)},get gitRootId(){return e(w)}})};re(A,W=>{M()&&W(q)})}s(b,v)},Oe=b=>{var v=je(),A=ue(v);{var q=Z=>{var Y=fr(),ce=R(Y),Ue=S(ce,!0);P(Y),C(me=>g(Ue,me),[()=>d.layout_fileTab_errorLoading_label()]),s(Z,Y)},W=Z=>{Rt(Z,{get filePath(){return o().filePath},get sourceUrl(){return se().url},allowDownload:!1})},Me=Z=>{var Y=po(),ce=R(Y),Ue=S(ce,!0);P(Y),C(me=>g(Ue,me),[()=>d.layout_fileTab_preparing_label()]),s(Z,Y)};re(A,Z=>{se()?.error?Z(q):se()?.url?Z(W,1):Z(Me,-1)})}s(b,v)},ft=b=>{var v=je(),A=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(pt)}})};re(A,W=>{M()&&W(q)})}s(b,v)},_t=b=>{var v=fr(),A=R(v),q=S(A,!0);P(v),C(W=>g(q,W),[()=>d.file_pdf_load_error()]),s(b,v)},Ve=b=>{{let v=i(()=>e(D)??o().filePath),A=i(()=>!e(l)&&e(gt));Rt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Qt)},onDownload:Ft,get allowDownload(){return e(A)},get downloading(){return e(st)}})}},Xe=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),C(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)},lt=b=>{var v=mo(),A=R(v);Pt(A,20,()=>[...Array(20).keys()],q=>q,(q,W)=>{var Me=go(),Z=R(Me);ur(Z,{class:"h-3 w-8 shrink-0"});var Y=p(Z,2);ur(Y,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Me),s(q,Me)}),P(A),P(v),s(b,v)},ht=b=>{var v=bo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0),Z=p(W,2);{var Y=me=>{var He=_o(),dt=S(He,!0);C(()=>g(dt,e(ut))),s(me,He)};re(Z,me=>{e(kt)==="generic"&&me(Y)})}var ce=p(Z,2);{var Ue=me=>{var He=wo(),dt=ue(He),Wt=S(dt,!0),tr=p(dt,2);Pt(tr,20,()=>e(It),xt=>xt,(xt,rr)=>{var Bt=ho(),zr=R(Bt);Fe(zr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Sr(rr),children:(Lr,$o)=>{Ge();var ar=et();C(()=>g(ar,rr)),s(Lr,ar)},$$slots:{default:!0}}),P(Bt),s(xt,Bt)}),P(tr),C(xt=>g(Wt,xt),[()=>d.layout_fileTab_didYouMean_label()]),s(me,He)};re(ce,me=>{e(It).length>0&&me(Ue)})}P(v),C(me=>{g(q,me),g(Me,o().filePath)},[()=>co(e(kt))]),s(b,v)},wt=b=>{var v=xo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0),Z=p(W,2);{var Y=ce=>{{let Ue=i(()=>!e(gt)||e(st));Fe(ce,{variant:"secondary",size:"sm",onclick:Ft,get disabled(){return e(Ue)},children:(me,He)=>{Ge();var dt=et();C(Wt=>g(dt,Wt),[()=>d.layout_fileTab_downloadFile_label()]),s(me,dt)},$$slots:{default:!0}})}};re(Z,ce=>{!e(l)&&e(Be)&&ce(Y)})}P(v),C(ce=>{g(q,ce),g(Me,o().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(b,v)},bt=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var A=je(),q=ue(A);{var W=Y=>{{let ce=i(()=>o().filePath||""),Ue=i(()=>!e(l)&&e(gt));Rt(Y,{get filePath(){return e(ce)},get fileContent(){return e(nt)},get language(){return e(Vt)},get isBinary(){return e(t)},onDownload:Ft,get allowDownload(){return e(Ue)},get downloading(){return e(st)}})}},Me=Y=>{var ce=yo(),Ue=R(ce);Ua(Ue,{get content(){return e(nt)},get workspaceId(){return c()},get relativeMediaBase(){return e(At)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(ce),s(Y,ce)},Z=Y=>{var ce=Ir,Ue=Cr;{let me=i(()=>B()?e(j):[]);_r(Xt(Y,{get value(){return ce()},set value(He){Ue(He)},get language(){return e(Vt)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return c()},get filePath(){return o().filePath},get lineWrapping(){return N()},get lineChanges(){return e(me)},get jumpTo(){return e(T)},get externalContentVersion(){return e(f)},get isPanelFocused(){return m()}}),He=>u(h,He,!0),()=>e(h))}};re(q,Y=>{e(v)?Y(W):e(Ct)&&e(L)?Y(Me,1):Y(Z,-1)})}s(b,A)},Nt=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),C(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)};re(Re,b=>{e(te)?b(pe):e(w)&&e(Te)&&e(G)?b(Ae,1):e(w)&&e(Ee)?b(Oe,2):e(Te)&&e(pt)?b(ft,3):e(Te)?b(_t,4):e(Qt)?b(Ve,5):e(Ee)?b(Xe,6):e($t)?b(lt,7):e(ut)?b(ht,8):e(t)?b(wt,9):e(nt)!==null?b(bt,10):b(Nt,-1)})}s(F,ve)}),s(r,n)};re(Ur,r=>{o().filePath&&r(jr)})}s(X,er);var Er=zt(Mr);return ze(),Er}export{Po as default};
|