@intent-hq/web 2.280.0 → 2.280.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.
Files changed (247) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{CqWjEg_w.js → -CwTNgWz.js} +1 -1
  3. package/web/app/immutable/chunks/{gb654U7I.js → 2jlj3Ler.js} +1 -1
  4. package/web/app/immutable/chunks/{N6QJHIhO.js → 3jOBMSa2.js} +1 -1
  5. package/web/app/immutable/chunks/{C90yTaYt.js → 4_muao6M.js} +1 -1
  6. package/web/app/immutable/chunks/{DXBMViP_.js → 68rxuoyq.js} +1 -1
  7. package/web/app/immutable/chunks/{hkbK0uGm.js → 6WgKbzWn.js} +1 -1
  8. package/web/app/immutable/chunks/{C7i9B-ha.js → 9hy801AX.js} +1 -1
  9. package/web/app/immutable/chunks/{DnhUO3WC.js → A03aFnAi.js} +1 -1
  10. package/web/app/immutable/chunks/{DY3OgpfJ.js → A9wPt9W8.js} +1 -1
  11. package/web/app/immutable/chunks/{CSWj16FD.js → AxG32tEq.js} +1 -1
  12. package/web/app/immutable/chunks/{BvY26mms.js → B2K72oo5.js} +1 -1
  13. package/web/app/immutable/chunks/{ZEBhSR5D.js → B45awpwY.js} +6 -6
  14. package/web/app/immutable/chunks/{DuEMgIMk.js → B4FELDN8.js} +1 -1
  15. package/web/app/immutable/chunks/{CcncgTgR.js → B4m64te4.js} +1 -1
  16. package/web/app/immutable/chunks/{DYYnXH8M.js → B6ZTfeOu.js} +2 -2
  17. package/web/app/immutable/chunks/{BjT2fyp4.js → B898Thex.js} +1 -1
  18. package/web/app/immutable/chunks/{B3HWhL7f.js → BAKCy1ct.js} +1 -1
  19. package/web/app/immutable/chunks/{CEwq2icc.js → BBzV6xv4.js} +1 -1
  20. package/web/app/immutable/chunks/{T2cz-xly.js → BDjsvDcb.js} +2 -2
  21. package/web/app/immutable/chunks/{NPEQPSOM.js → BEl--qal.js} +1 -1
  22. package/web/app/immutable/chunks/{BhWpP6Em.js → BFT1DBam.js} +1 -1
  23. package/web/app/immutable/chunks/{URngKIcX.js → BHgv1zSY.js} +1 -1
  24. package/web/app/immutable/chunks/{CTzUuaPY.js → BLSSZOMv.js} +1 -1
  25. package/web/app/immutable/chunks/{DKzibOTp.js → BP9ZIbzc.js} +1 -1
  26. package/web/app/immutable/chunks/{8a4VhuXU.js → BPNaYp5g.js} +1 -1
  27. package/web/app/immutable/chunks/{nBH4tfK0.js → BPQzmBfs.js} +1 -1
  28. package/web/app/immutable/chunks/{CAwhk8oQ.js → BPSTu_LB.js} +1 -1
  29. package/web/app/immutable/chunks/{DfgY-kiD.js → BPU_rzFz.js} +1 -1
  30. package/web/app/immutable/chunks/{B4LsznIm.js → BQ-dHdWP.js} +1 -1
  31. package/web/app/immutable/chunks/{CJ-1Nicc.js → BQHODbmu.js} +1 -1
  32. package/web/app/immutable/chunks/BT84ap5K.js +1 -0
  33. package/web/app/immutable/chunks/{BMMv1dT9.js → BTM_WGL_.js} +1 -1
  34. package/web/app/immutable/chunks/{DoyPrFXR.js → BU0pqKbR.js} +1 -1
  35. package/web/app/immutable/chunks/{DfNuJ6oL.js → BVKhCVH9.js} +1 -1
  36. package/web/app/immutable/chunks/{YHdlsWct.js → BVXynvnn.js} +1 -1
  37. package/web/app/immutable/chunks/{B_NbPKl3.js → BW-plizF.js} +1 -1
  38. package/web/app/immutable/chunks/{CtJg7u1A.js → BW8TPfRW.js} +3 -3
  39. package/web/app/immutable/chunks/{Dm0QgRo-.js → BXciywVo.js} +1 -1
  40. package/web/app/immutable/chunks/{eQM-IxZX.js → BY0FrRuN.js} +5 -5
  41. package/web/app/immutable/chunks/{DOrHUF0y.js → BYkwlyOx.js} +1 -1
  42. package/web/app/immutable/chunks/BZ8IpxwP.js +1 -0
  43. package/web/app/immutable/chunks/{DAtbkiMc.js → BZLCAaA0.js} +1 -1
  44. package/web/app/immutable/chunks/{C93vPsHK.js → BZux1no-.js} +1 -1
  45. package/web/app/immutable/chunks/{3riJ9IqO.js → B_b2DFb_.js} +1 -1
  46. package/web/app/immutable/chunks/{CDYpj3Wv.js → B_gYec_y.js} +1 -1
  47. package/web/app/immutable/chunks/{BkBahiMY.js → Baw2yANm.js} +1 -1
  48. package/web/app/immutable/chunks/{DKp6jlON.js → Bbx7keP6.js} +1 -1
  49. package/web/app/immutable/chunks/{DZLfTd9v.js → Bc1u6HH9.js} +1 -1
  50. package/web/app/immutable/chunks/{BwKTpHLe.js → BceFI8C_.js} +1 -1
  51. package/web/app/immutable/chunks/{Bx952p7Q.js → BfwUFrB0.js} +1 -1
  52. package/web/app/immutable/chunks/{DLqv0Ikg.js → BgNO_1M2.js} +1 -1
  53. package/web/app/immutable/chunks/{BPNyirUe.js → BguE5B0x.js} +1 -1
  54. package/web/app/immutable/chunks/{B_eTXuFT.js → BhDJcXuT.js} +1 -1
  55. package/web/app/immutable/chunks/{DvaVsSuU.js → BjBETkWC.js} +1 -1
  56. package/web/app/immutable/chunks/{stotUVND.js → Bl0HJ17r.js} +3 -3
  57. package/web/app/immutable/chunks/{BLUcjUGa.js → Bm52rc6Y.js} +1 -1
  58. package/web/app/immutable/chunks/{N7fhICzs.js → Bmb9f-vS.js} +1 -1
  59. package/web/app/immutable/chunks/{DkJZ6qt_.js → BmdFGxql.js} +1 -1
  60. package/web/app/immutable/chunks/{B4VMxRrC.js → BmyBU_d0.js} +1 -1
  61. package/web/app/immutable/chunks/{clVAYYi3.js → BoGQvi6r.js} +1 -1
  62. package/web/app/immutable/chunks/{DkOgrmDO.js → BoqFUVbe.js} +1 -1
  63. package/web/app/immutable/chunks/{CQWH6H5Q.js → BrW2Z0Ue.js} +1 -1
  64. package/web/app/immutable/chunks/{9nkBC1Gf.js → BtNv1rB8.js} +1 -1
  65. package/web/app/immutable/chunks/{xYBj3dw3.js → Bu2f_xik.js} +1 -1
  66. package/web/app/immutable/chunks/{BP0nvB-r.js → BvugS_th.js} +1 -1
  67. package/web/app/immutable/chunks/{y8oZX4sf.js → BxG24Fz6.js} +1 -1
  68. package/web/app/immutable/chunks/{Dvrl4uc9.js → BzSqqrdV.js} +1 -1
  69. package/web/app/immutable/chunks/{UQoGZ5qq.js → C-3IOyFr.js} +1 -1
  70. package/web/app/immutable/chunks/{B__WlfRy.js → C-YIgYgI.js} +3 -3
  71. package/web/app/immutable/chunks/{N6Oy5HNi.js → C1A6QIyB.js} +1 -1
  72. package/web/app/immutable/chunks/{BZSrLoH0.js → C1F9VBVR.js} +1 -1
  73. package/web/app/immutable/chunks/{CQB9d6Yf.js → C3uzPV7c.js} +1 -1
  74. package/web/app/immutable/chunks/{BlWy-Yyj.js → C7uEROnA.js} +3 -3
  75. package/web/app/immutable/chunks/C82p3eaN.js +410 -0
  76. package/web/app/immutable/chunks/{CqMqlLWW.js → C87twKUp.js} +1 -1
  77. package/web/app/immutable/chunks/{Dz9B-9IH.js → C8BD21JK.js} +1 -1
  78. package/web/app/immutable/chunks/{CdjxL29Q.js → C8Ri7767.js} +1 -1
  79. package/web/app/immutable/chunks/{nSxzXlBd.js → CAvR_m9C.js} +1 -1
  80. package/web/app/immutable/chunks/{BC5uKK7w.js → CBGnfmpX.js} +1 -1
  81. package/web/app/immutable/chunks/{vpnNwaI3.js → CBQ-NG4P.js} +1 -1
  82. package/web/app/immutable/chunks/{DXT5rgnn.js → CBWj5Yn9.js} +1 -1
  83. package/web/app/immutable/chunks/{BVt6P2Dk.js → CE_2ADe7.js} +1 -1
  84. package/web/app/immutable/chunks/{CMAGQJUI.js → CH6MdBMX.js} +1 -1
  85. package/web/app/immutable/chunks/{C-WnhoQ3.js → CJ17D0UC.js} +1 -1
  86. package/web/app/immutable/chunks/{DERVpCl4.js → CLst9ImY.js} +1 -1
  87. package/web/app/immutable/chunks/CN6Xgdqp.js +1 -0
  88. package/web/app/immutable/chunks/{eQHw-9b6.js → COGdwXWC.js} +2 -2
  89. package/web/app/immutable/chunks/{B7f90q4s.js → CPRrGZdb.js} +1 -1
  90. package/web/app/immutable/chunks/{BndTIIgb.js → CRK47dBR.js} +1 -1
  91. package/web/app/immutable/chunks/{CJ0FjS97.js → CSZ4_RTQ.js} +2 -2
  92. package/web/app/immutable/chunks/{CongIN9X.js → CS_zvIHS.js} +1 -1
  93. package/web/app/immutable/chunks/{Te3M5bc7.js → CVgZfK3-.js} +1 -1
  94. package/web/app/immutable/chunks/{Cz4cjwfL.js → CX9zash3.js} +1 -1
  95. package/web/app/immutable/chunks/{uA-GSod5.js → CYmzMH2T.js} +1 -1
  96. package/web/app/immutable/chunks/{CeNnTXT3.js → C_FFOKOn.js} +1 -1
  97. package/web/app/immutable/chunks/{D0X3JVqD.js → CcMBhJ58.js} +1 -1
  98. package/web/app/immutable/chunks/{Bp5ygEp6.js → CdJoXoLx.js} +1 -1
  99. package/web/app/immutable/chunks/{6mfqT9F0.js → CeCzBIMM.js} +1 -1
  100. package/web/app/immutable/chunks/{BAw6o6lJ.js → CfBY2vbK.js} +1 -1
  101. package/web/app/immutable/chunks/{DGsBebnq.js → CfBpHiou.js} +1 -1
  102. package/web/app/immutable/chunks/{rrF5Hl_J.js → CgGQ3Slz.js} +1 -1
  103. package/web/app/immutable/chunks/{BUxfGI8Z.js → ChBxJ_T2.js} +1 -1
  104. package/web/app/immutable/chunks/{Df1cVjK1.js → CiShviCo.js} +4 -4
  105. package/web/app/immutable/chunks/{BGVlzHwy.js → CkFE8VfK.js} +1 -1
  106. package/web/app/immutable/chunks/{Q2u3rFY1.js → ClR-TTMN.js} +2 -2
  107. package/web/app/immutable/chunks/{Yip29sR2.js → Cmf1A7_B.js} +1 -1
  108. package/web/app/immutable/chunks/{CEIySDvB.js → Cmr6Xpw3.js} +1 -1
  109. package/web/app/immutable/chunks/{BvP_3Sy4.js → Cmzu4CqY.js} +1 -1
  110. package/web/app/immutable/chunks/{CS36kkvG.js → Com4THH3.js} +1 -1
  111. package/web/app/immutable/chunks/{UFzyo4ne.js → CqF12LNt.js} +1 -1
  112. package/web/app/immutable/chunks/{B6Rs6hHm.js → Cql2yasp.js} +1 -1
  113. package/web/app/immutable/chunks/{t7BMdiLm.js → Cr_gbuBh.js} +1 -1
  114. package/web/app/immutable/chunks/{BJfxejEG.js → CrarsPv2.js} +1 -1
  115. package/web/app/immutable/chunks/{CDSYYpwa.js → CriyUZJv.js} +1 -1
  116. package/web/app/immutable/chunks/{CwSIKtqo.js → CszhQy-T.js} +1 -1
  117. package/web/app/immutable/chunks/{mklnjf4_.js → CtfKkjtt.js} +1 -1
  118. package/web/app/immutable/chunks/{C33zLAon.js → CwW1BUBB.js} +1 -1
  119. package/web/app/immutable/chunks/{BkVUImC4.js → D5SukII7.js} +1 -1
  120. package/web/app/immutable/chunks/{w-RLNdGr.js → D5nEFEMU.js} +1 -1
  121. package/web/app/immutable/chunks/{C1r_dvAi.js → D8KNd2JX.js} +1 -1
  122. package/web/app/immutable/chunks/{D5DS8MOZ.js → DACKa6C3.js} +1 -1
  123. package/web/app/immutable/chunks/{oLkbmMHL.js → DB_7wrc7.js} +1 -1
  124. package/web/app/immutable/chunks/{lF96b5e4.js → DBct6Vvn.js} +1 -1
  125. package/web/app/immutable/chunks/{CJGDfIog.js → DC6J5sZ-.js} +1 -1
  126. package/web/app/immutable/chunks/DCU5S8Gd.js +1 -0
  127. package/web/app/immutable/chunks/{DiXg0x-W.js → DD57Mp8Z.js} +1 -1
  128. package/web/app/immutable/chunks/{D3jilL3b.js → DDK55OAB.js} +1 -1
  129. package/web/app/immutable/chunks/{Jw-22-gH.js → DFKo1ZAJ.js} +1 -1
  130. package/web/app/immutable/chunks/{HoeZnZ3h.js → DFxsImeG.js} +1 -1
  131. package/web/app/immutable/chunks/{CbO_toqh.js → DFz-Vr9a.js} +1 -1
  132. package/web/app/immutable/chunks/{EzR2MUkx.js → DGC3jX9C.js} +3 -3
  133. package/web/app/immutable/chunks/{CB2itZPT.js → DGrFhzHu.js} +2 -2
  134. package/web/app/immutable/chunks/{Bq0kEo6t.js → DGsKwFeF.js} +1 -1
  135. package/web/app/immutable/chunks/{DH71XKkM.js → DHM3GVKY.js} +1 -1
  136. package/web/app/immutable/chunks/{LK9i1Fgb.js → DHMcsnK1.js} +1 -1
  137. package/web/app/immutable/chunks/{C9fQIDg9.js → DHt5Qx-W.js} +1 -1
  138. package/web/app/immutable/chunks/{bTkQsu94.js → DIGRq3Np.js} +1 -1
  139. package/web/app/immutable/chunks/{Cr8O6b9X.js → DJxE8cOI.js} +4 -4
  140. package/web/app/immutable/chunks/{DTULcguA.js → DM3bYLxj.js} +1 -1
  141. package/web/app/immutable/chunks/{C19ZZHpm.js → DOqOxnjD.js} +1 -1
  142. package/web/app/immutable/chunks/{CtxR6yc7.js → DOsLfX1h.js} +3 -3
  143. package/web/app/immutable/chunks/{DeqDTWfs.js → DPMpx6lS.js} +1 -1
  144. package/web/app/immutable/chunks/{Cp73wfaC.js → DPsGF2i5.js} +1 -1
  145. package/web/app/immutable/chunks/{6Ys1q35u.js → DS_3tw6q.js} +1 -1
  146. package/web/app/immutable/chunks/{DjeJHedD.js → DSvMjM09.js} +1 -1
  147. package/web/app/immutable/chunks/{B3-959pn.js → DTOf9l3E.js} +1 -1
  148. package/web/app/immutable/chunks/{Dukd5fsq.js → DTd1YpaC.js} +1 -1
  149. package/web/app/immutable/chunks/{BVb5pfaA.js → DTpHCyDe.js} +1 -1
  150. package/web/app/immutable/chunks/{C8n2AuxQ.js → DUOglMHy.js} +1 -1
  151. package/web/app/immutable/chunks/{BH9ttt95.js → DVh97JfW.js} +1 -1
  152. package/web/app/immutable/chunks/{DI5BNHva.js → DVqZmj-R.js} +1 -1
  153. package/web/app/immutable/chunks/{CbKxMrMY.js → D_qXZ-ka.js} +3 -3
  154. package/web/app/immutable/chunks/{CgDKiC6v.js → Dayd4Wgp.js} +2 -2
  155. package/web/app/immutable/chunks/{ElkcFG4d.js → De0AF9gl.js} +1 -1
  156. package/web/app/immutable/chunks/{BXrUMWsR.js → DePQKdPz.js} +1 -1
  157. package/web/app/immutable/chunks/{DACPyPs7.js → DgFsji4g.js} +1 -1
  158. package/web/app/immutable/chunks/{D1Ntri6z.js → Di6uZPiF.js} +1 -1
  159. package/web/app/immutable/chunks/{IJ5h6xZ4.js → DkNxxzmT.js} +1 -1
  160. package/web/app/immutable/chunks/{Dzimjbdi.js → DkxKadFP.js} +1 -1
  161. package/web/app/immutable/chunks/{BANaLpH3.js → DnE5aVuv.js} +1 -1
  162. package/web/app/immutable/chunks/{BuN1aIUI.js → DnEM5LKJ.js} +1 -1
  163. package/web/app/immutable/chunks/{CiLfhM-B.js → Do7HQr7r.js} +2 -2
  164. package/web/app/immutable/chunks/{C-uox8N9.js → DpQUJ1uI.js} +1 -1
  165. package/web/app/immutable/chunks/{Cnhc2tSL.js → Dp_sBH9q.js} +1 -1
  166. package/web/app/immutable/chunks/{B3vK-R-o.js → DrooRzRX.js} +1 -1
  167. package/web/app/immutable/chunks/{Dm2prBtG.js → Ds0y9W2N.js} +1 -1
  168. package/web/app/immutable/chunks/{D6EF8Ce7.js → Ds641dV5.js} +1 -1
  169. package/web/app/immutable/chunks/{waekWt8I.js → DsB3GaMq.js} +1 -1
  170. package/web/app/immutable/chunks/{CpA81uUD.js → DuJ8M51r.js} +1 -1
  171. package/web/app/immutable/chunks/{CMlYEClg.js → Duy6Dp7J.js} +1 -1
  172. package/web/app/immutable/chunks/{BNa1xVO7.js → Dwp3N9DW.js} +1 -1
  173. package/web/app/immutable/chunks/{Aq_hvPuk.js → DxrVr4Z-.js} +1 -1
  174. package/web/app/immutable/chunks/{DtDJkmRR.js → DzBqr5Ds.js} +1 -1
  175. package/web/app/immutable/chunks/{UEOyoIDp.js → DzTcsuyr.js} +1 -1
  176. package/web/app/immutable/chunks/{BUkZ_wc0.js → EYJa5XI2.js} +1 -1
  177. package/web/app/immutable/chunks/{DQ1jf8rv.js → F78VMou9.js} +2 -2
  178. package/web/app/immutable/chunks/{CGZwKPOh.js → GHkZED_H.js} +1 -1
  179. package/web/app/immutable/chunks/{FJwDbpvw.js → H0GxNKO6.js} +1 -1
  180. package/web/app/immutable/chunks/{6PSZ6lUf.js → HnBTNAMz.js} +1 -1
  181. package/web/app/immutable/chunks/{e95iwXST.js → IsiJ9INb.js} +1 -1
  182. package/web/app/immutable/chunks/{CBOwO-Mt.js → Jp68-Q2x.js} +1 -1
  183. package/web/app/immutable/chunks/{s9eau3Xa.js → Jy9V3N_7.js} +1 -1
  184. package/web/app/immutable/chunks/{DenIsJVL.js → K0azdCX9.js} +1 -1
  185. package/web/app/immutable/chunks/{BM_-VfIm.js → Kk07D7VE.js} +1 -1
  186. package/web/app/immutable/chunks/{DMWrQCj4.js → LXk8sd0A.js} +1 -1
  187. package/web/app/immutable/chunks/{D6xwyO9X.js → Lr6hvseQ.js} +1 -1
  188. package/web/app/immutable/chunks/{CE4Q63si.js → MQaqCR4A.js} +1 -1
  189. package/web/app/immutable/chunks/{DYk_WT-b.js → Njxs8gUf.js} +1 -1
  190. package/web/app/immutable/chunks/{BzC1GMNV.js → OiX-SxC_.js} +1 -1
  191. package/web/app/immutable/chunks/{A0CZ88DG.js → OwL7thrT.js} +1 -1
  192. package/web/app/immutable/chunks/{BxMZftIo.js → PWYpp4hZ.js} +1 -1
  193. package/web/app/immutable/chunks/{fxbWd_e1.js → UJwgGUj4.js} +1 -1
  194. package/web/app/immutable/chunks/{qMMt4K52.js → UgfAVREY.js} +1 -1
  195. package/web/app/immutable/chunks/{Cv5hE_ED.js → XUEHMX7O.js} +1 -1
  196. package/web/app/immutable/chunks/{BLPQXyX_.js → Z6bOeoYv.js} +1 -1
  197. package/web/app/immutable/chunks/{D51GwsQ1.js → ZOO6Vfpu.js} +1 -1
  198. package/web/app/immutable/chunks/{BI00pPJ1.js → a8E6fbkW.js} +1 -1
  199. package/web/app/immutable/chunks/{UOvnclhB.js → aZQ0-tdp.js} +4 -4
  200. package/web/app/immutable/chunks/{DtIgh-Wb.js → bxUMV0oT.js} +1 -1
  201. package/web/app/immutable/chunks/{BQM-54by.js → c3Abb5qo.js} +1 -1
  202. package/web/app/immutable/chunks/{BsLu-N-o.js → cOSCr41c.js} +1 -1
  203. package/web/app/immutable/chunks/{B05_pVBL.js → caVSTeyS.js} +1 -1
  204. package/web/app/immutable/chunks/{CKaz-nQX.js → cfpFgXT5.js} +1 -1
  205. package/web/app/immutable/chunks/{D8hmEpbp.js → e0v3-ZIG.js} +1 -1
  206. package/web/app/immutable/chunks/{CVma05vh.js → i9DY-0TX.js} +1 -1
  207. package/web/app/immutable/chunks/{4c21rJgy.js → kSHx_2s_.js} +1 -1
  208. package/web/app/immutable/chunks/{Dqugp38s.js → qasXuzlR.js} +1 -1
  209. package/web/app/immutable/chunks/{Dcg7SWi9.js → qj5yCt7h.js} +1 -1
  210. package/web/app/immutable/chunks/{Ci0AQ6w8.js → qkfs_BCa.js} +1 -1
  211. package/web/app/immutable/chunks/{C6HFp_sK.js → qqmEa9H6.js} +1 -1
  212. package/web/app/immutable/chunks/{BrgQitGU.js → sSa7Wn7K.js} +1 -1
  213. package/web/app/immutable/chunks/{D5DbIKBx.js → sXvRCqUb.js} +1 -1
  214. package/web/app/immutable/chunks/{BjM2Qc64.js → tdATXSHH.js} +1 -1
  215. package/web/app/immutable/chunks/{CR9OjoGG.js → tuQscXjh.js} +1 -1
  216. package/web/app/immutable/chunks/{DWTk7BzJ.js → uYOEUrhQ.js} +1 -1
  217. package/web/app/immutable/chunks/{DnQbQ1Ee.js → vJt7gt7x.js} +7 -7
  218. package/web/app/immutable/chunks/{CkoWrmIy.js → y3HzT_To.js} +1 -1
  219. package/web/app/immutable/chunks/{DrDKCvwv.js → yL59xdGf.js} +1 -1
  220. package/web/app/immutable/chunks/{CZvE7cU6.js → yvuwpbPL.js} +1 -1
  221. package/web/app/immutable/chunks/{BAR8yUHQ.js → zd6Cuy6l.js} +1 -1
  222. package/web/app/immutable/entry/app.DY99f_Ty.js +4 -0
  223. package/web/app/immutable/entry/start.BcYitP96.js +1 -0
  224. package/web/app/immutable/nodes/{0.BoxQzHDp.js → 0.C4LmvMoM.js} +1 -1
  225. package/web/app/immutable/nodes/{1.DU9opyfh.js → 1.BYE5bJSa.js} +1 -1
  226. package/web/app/immutable/nodes/{10.eExevNYJ.js → 10.BrKhL_G6.js} +1 -1
  227. package/web/app/immutable/nodes/{12.DyoMTbCQ.js → 12.BGqWnph6.js} +1 -1
  228. package/web/app/immutable/nodes/{13.C0iYfqVI.js → 13.vfNjr05l.js} +1 -1
  229. package/web/app/immutable/nodes/{14.KEg9Fqc4.js → 14.U6Ne_Zng.js} +1 -1
  230. package/web/app/immutable/nodes/{15.F8zDHy08.js → 15.DHcLeO2-.js} +1 -1
  231. package/web/app/immutable/nodes/{16.dAZs6dYD.js → 16.Brkz5pXG.js} +2 -2
  232. package/web/app/immutable/nodes/{2.BrvzcNmI.js → 2.BsPWX-pi.js} +4 -4
  233. package/web/app/immutable/nodes/{3.ByPIR3CM.js → 3.CYtb_dsh.js} +1 -1
  234. package/web/app/immutable/nodes/{4.JEfjf0UF.js → 4.DWQJjc9i.js} +1 -1
  235. package/web/app/immutable/nodes/{5.BUymCG_x.js → 5.BrUyXV_u.js} +1 -1
  236. package/web/app/immutable/nodes/{6.Btna6Yhq.js → 6.CA6jFqpu.js} +1 -1
  237. package/web/app/immutable/nodes/{7.BHmutzAv.js → 7.BYZ_h1_W.js} +1 -1
  238. package/web/app/immutable/nodes/{8.Ctc8SBWw.js → 8.ie9sNdo3.js} +4 -4
  239. package/web/app/immutable/nodes/{9.Cwg6B2vl.js → 9.nBlKsA0T.js} +4 -4
  240. package/web/app/version.json +1 -1
  241. package/web/index.html +11 -10
  242. package/web/app/immutable/chunks/BH6SkDfK.js +0 -1
  243. package/web/app/immutable/chunks/CmlEVTR3.js +0 -410
  244. package/web/app/immutable/chunks/DK5QZ1vP.js +0 -1
  245. package/web/app/immutable/chunks/DW3Zf5Ax.js +0 -1
  246. package/web/app/immutable/entry/app.b6gE4ET2.js +0 -4
  247. package/web/app/immutable/entry/start.BoRhInyV.js +0 -1
@@ -1 +1 @@
1
- var mt=Object.defineProperty;var Qe=r=>{throw TypeError(r)};var yt=(r,e,n)=>e in r?mt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var b=(r,e,n)=>yt(r,typeof e!="symbol"?e+"":e,n),bt=(r,e,n)=>e.has(r)||Qe("Cannot "+n);var l=(r,e,n)=>(bt(r,e,"read from private field"),n?n.call(r):e.get(r)),w=(r,e,n)=>e.has(r)?Qe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,n);import{aR as B,aP as Ye,aQ as Fe,m as _t,a0 as Ct,l as Ot,ab as Pt,Y as wt,b3 as St,aJ as xt,ad as Nt,bM as Ze,bL as Re,O as $e,bZ as At,w as Et,bN as Ae,bV as T,aD as u,bH as _,c9 as E,bo as _e,bs as J,a7 as I,ay as A,W as O,bn as U,aA as i,a5 as Ce,bf as V,bA as Oe,aB as Y,bS as et,aG as Le,br as It,ca as kt,bI as it}from"./B8o4lNgr.js";import{B as Ft,t as j,bq as a,a_ as L,by as q,b as z,br as Z,bt as Ee}from"./GWL2EpD7.js";import{B as tt,f as Rt,D as Tt}from"./bocWuth7.js";import{s as F}from"./vOveF3fP.js";import{c as Pe}from"./CYiv-51w.js";import{h as Dt,a6 as rt,aJ as S,bL as Xe,bt as Mt,b0 as Bt,av as we,aR as Kt,b1 as at,aE as Ie,ad as Wt,l as Lt,aS as D,bm as K,bo as k,I as Xt,n as Gt,j as Jt,al as Ut,ag as nt}from"./CgDKiC6v.js";import{c as Vt}from"./DJCBi8x9.js";import{k as jt}from"./CS36kkvG.js";import{b9 as qt}from"./C2YltVuJ.js";function kr(r,e,n,o,v,h){let m=B;B&&Ye();var d=null;B&&Fe.nodeType===_t&&(d=Fe,Ye());var P=B?Fe:r,p=$e,f=new Ft(P,!1);Ct(()=>{const y=e()||null;var C=y==="svg"?Et:void 0;if(y===null){f.ensure(null,null),Ae(!0);return}return f.ensure(y,N=>{if(y){if(d=B?d:Pt(y,C),wt(d,d),o){var x=null;B&&St(y)&&d.append(x=document.createComment(""));var s=B?xt(d):d.appendChild(Nt());B&&(s===null?Ze(!1):Re(s)),tt(p),o(d,s),x?.remove(),tt(null)}$e.nodes.end=d,N.before(d)}B&&Re(N)}),Ae(!0),()=>{y&&Ae(!1)}},Ot),At(()=>{Ae(!0)}),m&&(Ze(!0),Re(P))}const zt=Kt({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),G=new Dt("Dialog.Root | AlertDialog.Root");var re,ne,se,oe,ie,ae,le,de,ce,ue,he;const Ge=class Ge{constructor(e,n){b(this,"opts");w(this,re,T(null));w(this,ne,T(null));w(this,se,T(null));w(this,oe,T(null));w(this,ie,T(void 0));w(this,ae,T(void 0));w(this,le,T(void 0));w(this,de,T(void 0));w(this,ce,T(null));w(this,ue,T(0));b(this,"depth");b(this,"parent");b(this,"contentPresence");b(this,"overlayPresence");b(this,"getBitsAttr",e=>zt.getAttr(e,this.opts.variant.current));w(this,he,E(()=>({"data-state":Bt(this.opts.open.current)})));this.opts=e,this.parent=n,this.depth=n?n.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new rt({ref:S(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new rt({ref:S(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Xe(()=>this.opts.open.current,o=>{this.parent&&(o?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Mt(()=>{this.opts.open.current&&this.parent?.decrementNested()})}static create(e){const n=G.getOr(null);return G.set(new Ge(e,n))}get triggerNode(){return u(l(this,re))}set triggerNode(e){_(l(this,re),e,!0)}get contentNode(){return u(l(this,ne))}set contentNode(e){_(l(this,ne),e,!0)}get overlayNode(){return u(l(this,se))}set overlayNode(e){_(l(this,se),e,!0)}get descriptionNode(){return u(l(this,oe))}set descriptionNode(e){_(l(this,oe),e,!0)}get contentId(){return u(l(this,ie))}set contentId(e){_(l(this,ie),e,!0)}get titleId(){return u(l(this,ae))}set titleId(e){_(l(this,ae),e,!0)}get triggerId(){return u(l(this,le))}set triggerId(e){_(l(this,le),e,!0)}get descriptionId(){return u(l(this,de))}set descriptionId(e){_(l(this,de),e,!0)}get cancelNode(){return u(l(this,ce))}set cancelNode(e){_(l(this,ce),e,!0)}get nestedOpenCount(){return u(l(this,ue))}set nestedOpenCount(e){_(l(this,ue),e,!0)}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}get sharedProps(){return u(l(this,he))}set sharedProps(e){_(l(this,he),e)}};re=new WeakMap,ne=new WeakMap,se=new WeakMap,oe=new WeakMap,ie=new WeakMap,ae=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,ue=new WeakMap,he=new WeakMap;let Te=Ge;var pe;const Je=class Je{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,pe,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(e){return new Je(e,G.get())}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===Wt||e.key===Lt)&&(e.preventDefault(),this.root.handleClose())}get props(){return u(l(this,pe))}set props(e){_(l(this,pe),e)}};pe=new WeakMap;let De=Je;var fe;const Ue=class Ue{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,fe,E(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.root.titleId=this.opts.id.current,this.attachment=we(this.opts.ref),Xe.pre(()=>this.opts.id.current,o=>{this.root.titleId=o})}static create(e){return new Ue(e,G.get())}get props(){return u(l(this,fe))}set props(e){_(l(this,fe),e)}};fe=new WeakMap;let Me=Ue;var ge;const Ve=class Ve{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ge,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.root.descriptionId=this.opts.id.current,this.attachment=we(this.opts.ref,o=>{this.root.descriptionNode=o}),Xe.pre(()=>this.opts.id.current,o=>{this.root.descriptionId=o})}static create(e){return new Ve(e,G.get())}get props(){return u(l(this,ge))}set props(e){_(l(this,ge),e)}};ge=new WeakMap;let Be=Ve;var ve,me;const je=class je{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ve,E(()=>({open:this.root.opts.open.current})));w(this,me,E(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Ie(this.root.nestedOpenCount>0),"data-nested":Ie(this.root.parent!==null),...at(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref,o=>{this.root.contentNode=o,this.root.contentId=o?.id})}static create(e){return new je(e,G.get())}get snippetProps(){return u(l(this,ve))}set snippetProps(e){_(l(this,ve),e)}get props(){return u(l(this,me))}set props(e){_(l(this,me),e)}get shouldRender(){return this.root.contentPresence.shouldRender}};ve=new WeakMap,me=new WeakMap;let Ke=je;var ye,be;const qe=class qe{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ye,E(()=>({open:this.root.opts.open.current})));w(this,be,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Ie(this.root.nestedOpenCount>0),"data-nested":Ie(this.root.parent!==null),...at(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref,o=>this.root.overlayNode=o)}static create(e){return new qe(e,G.get())}get snippetProps(){return u(l(this,ye))}set snippetProps(e){_(l(this,ye),e)}get props(){return u(l(this,be))}set props(e){_(l(this,be),e)}get shouldRender(){return this.root.overlayPresence.shouldRender}};ye=new WeakMap,be=new WeakMap;let We=qe;var Ht=new Set(["$$slots","$$events","$$legacy","id","ref","child","children","level"]),Qt=Y("<div><!></div>");function Yt(r,e){const n=_e();if(new.target)return j({component:Yt,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"ref",15,null),h=a(e,"child",7),m=a(e,"children",7),d=a(e,"level",7,2),P=Z(e,Ht);const p=Me.create({id:S(()=>o()),level:S(()=>d()),ref:S(()=>v(),t=>v(t))}),f=E(()=>K(P,p.props));var y={get id(){return o()},set id(t=D(n)){o(t),i()},get ref(){return v()},set ref(t=null){v(t),i()},get child(){return h()},set child(t){h(t),i()},get children(){return m()},set children(t){m(t),i()},get level(){return d()},set level(t=2){d(t),i()},$set:q,$on:(t,g)=>z(e,t,g)},C=I(),N=A(C);{var x=t=>{var g=I(),R=A(g);F(R,h,()=>({props:u(f)})),O(t,g)},s=t=>{var g=Qt();Pe(g,()=>({...u(f)}));var R=Ce(g);F(R,()=>m()??V),Oe(g),O(t,g)};L(N,t=>{h()?t(x):t(s,-1)})}return O(r,C),U(y)}var Zt=new Set(["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]),$t=Y("<div><!></div>");function er(r,e){const n=_e();if(new.target)return j({component:er,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"forceMount",7,!1),h=a(e,"child",7),m=a(e,"children",7),d=a(e,"ref",15,null),P=Z(e,Zt);const p=We.create({id:S(()=>o()),ref:S(()=>d(),s=>d(s))}),f=E(()=>K(P,p.props));var y={get id(){return o()},set id(s=D(n)){o(s),i()},get forceMount(){return v()},set forceMount(s=!1){v(s),i()},get child(){return h()},set child(s){h(s),i()},get children(){return m()},set children(s){m(s),i()},get ref(){return d()},set ref(s=null){d(s),i()},$set:q,$on:(s,t)=>z(e,s,t)},C=I(),N=A(C);{var x=s=>{var t=I(),g=A(t);{var R=W=>{var M=I(),c=A(M);{let H=E(()=>({props:K(u(f)),...p.snippetProps}));F(c,h,()=>u(H))}O(W,M)},Se=W=>{var M=$t();Pe(M,H=>({...H}),[()=>K(u(f))]);var c=Ce(M);F(c,()=>m()??V,()=>p.snippetProps),Oe(M),O(W,M)};L(g,W=>{h()?W(R):W(Se,-1)})}O(s,t)};L(N,s=>{(p.shouldRender||v())&&s(x)})}return O(r,C),U(y)}var tr=new Set(["$$slots","$$events","$$legacy","id","children","child","ref"]),rr=Y("<div><!></div>");function nr(r,e){const n=_e();if(new.target)return j({component:nr,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"children",7),h=a(e,"child",7),m=a(e,"ref",15,null),d=Z(e,tr);const P=Be.create({id:S(()=>o()),ref:S(()=>m(),s=>m(s))}),p=E(()=>K(d,P.props));var f={get id(){return o()},set id(s=D(n)){o(s),i()},get children(){return v()},set children(s){v(s),i()},get child(){return h()},set child(s){h(s),i()},get ref(){return m()},set ref(s=null){m(s),i()},$set:q,$on:(s,t)=>z(e,s,t)},y=I(),C=A(y);{var N=s=>{var t=I(),g=A(t);F(g,h,()=>({props:u(p)})),O(s,t)},x=s=>{var t=rr();Pe(t,()=>({...u(p)}));var g=Ce(t);F(g,()=>v()??V),Oe(t),O(s,t)};L(C,s=>{h()?s(N):s(x,-1)})}return O(r,y),U(f)}function lt(r,e){if(new.target)return j({component:lt,...r});J(e,!0);let n=a(e,"open",15,!1),o=a(e,"onOpenChange",7,k),v=a(e,"onOpenChangeComplete",7,k),h=a(e,"children",7);Te.create({variant:S(()=>"dialog"),open:S(()=>n(),p=>{n(p),o()(p)}),onOpenChangeComplete:S(()=>v())});var m={get open(){return n()},set open(p=!1){n(p),i()},get onOpenChange(){return o()},set onOpenChange(p=k){o(p),i()},get onOpenChangeComplete(){return v()},set onOpenChangeComplete(p=k){v(p),i()},get children(){return h()},set children(p){h(p),i()},$set:q,$on:(p,f)=>z(e,p,f)},d=I(),P=A(d);return F(P,()=>h()??V),O(r,d),U(m)}var sr=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]),or=Y("<button><!></button>");function ir(r,e){const n=_e();if(new.target)return j({component:ir,...r});J(e,!0);let o=a(e,"children",7),v=a(e,"child",7),h=a(e,"id",23,()=>D(n)),m=a(e,"ref",15,null),d=a(e,"disabled",7,!1),P=Z(e,sr);const p=De.create({variant:S(()=>"close"),id:S(()=>h()),ref:S(()=>m(),t=>m(t)),disabled:S(()=>!!d())}),f=E(()=>K(P,p.props));var y={get children(){return o()},set children(t){o(t),i()},get child(){return v()},set child(t){v(t),i()},get id(){return h()},set id(t=D(n)){h(t),i()},get ref(){return m()},set ref(t=null){m(t),i()},get disabled(){return d()},set disabled(t=!1){d(t),i()},$set:q,$on:(t,g)=>z(e,t,g)},C=I(),N=A(C);{var x=t=>{var g=I(),R=A(g);F(R,v,()=>({props:u(f)})),O(t,g)},s=t=>{var g=or();Pe(g,()=>({...u(f)}));var R=Ce(g);F(R,()=>o()??V),Oe(g),O(t,g)};L(N,t=>{v()?t(x):t(s,-1)})}return O(r,C),U(y)}var ar=new Set(["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]),lr=Y("<!> <!>",1),dr=Y("<!> <div><!></div>",1);function cr(r,e){const n=_e();if(new.target)return j({component:cr,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"children",7),h=a(e,"child",7),m=a(e,"ref",15,null),d=a(e,"forceMount",7,!1),P=a(e,"onCloseAutoFocus",7,k),p=a(e,"onOpenAutoFocus",7,k),f=a(e,"onEscapeKeydown",7,k),y=a(e,"onInteractOutside",7,k),C=a(e,"trapFocus",7,!0),N=a(e,"preventScroll",7,!0),x=a(e,"restoreScrollDelay",7,null),s=Z(e,ar);const t=Ke.create({id:S(()=>o()),ref:S(()=>m(),c=>m(c))}),g=E(()=>K(s,t.props));var R={get id(){return o()},set id(c=D(n)){o(c),i()},get children(){return v()},set children(c){v(c),i()},get child(){return h()},set child(c){h(c),i()},get ref(){return m()},set ref(c=null){m(c),i()},get forceMount(){return d()},set forceMount(c=!1){d(c),i()},get onCloseAutoFocus(){return P()},set onCloseAutoFocus(c=k){P(c),i()},get onOpenAutoFocus(){return p()},set onOpenAutoFocus(c=k){p(c),i()},get onEscapeKeydown(){return f()},set onEscapeKeydown(c=k){f(c),i()},get onInteractOutside(){return y()},set onInteractOutside(c=k){y(c),i()},get trapFocus(){return C()},set trapFocus(c=!0){C(c),i()},get preventScroll(){return N()},set preventScroll(c=!0){N(c),i()},get restoreScrollDelay(){return x()},set restoreScrollDelay(c=null){x(c),i()},$set:q,$on:(c,H)=>z(e,c,H)},Se=I(),W=A(Se);{var M=c=>{Xt(c,{get ref(){return t.opts.ref},loop:!0,get trapFocus(){return C()},get enabled(){return t.root.opts.open.current},get onOpenAutoFocus(){return p()},get onCloseAutoFocus(){return P()},focusScope:(ut,ht)=>{let ze=()=>(ht?.()).props;Gt(ut,Ee(()=>u(g),{get enabled(){return t.root.opts.open.current},get ref(){return t.opts.ref},onEscapeKeydown:xe=>{f()(xe),!xe.defaultPrevented&&t.root.handleClose()},children:(xe,yr)=>{Jt(xe,Ee(()=>u(g),{get ref(){return t.opts.ref},get enabled(){return t.root.opts.open.current},onInteractOutside:Ne=>{y()(Ne),!Ne.defaultPrevented&&t.root.handleClose()},children:(Ne,br)=>{Ut(Ne,Ee(()=>u(g),{get ref(){return t.opts.ref},get enabled(){return t.root.opts.open.current},children:(pt,_r)=>{var He=I(),ft=A(He);{var gt=Q=>{var $=lr(),ee=A($);{var te=X=>{nt(X,{get preventScroll(){return N()},get restoreScrollDelay(){return x()}})};L(ee,X=>{t.root.opts.open.current&&X(te)})}var ke=et(ee,2);{let X=E(()=>({props:K(u(g),ze()),...t.snippetProps}));F(ke,h,()=>u(X))}O(Q,$)},vt=Q=>{var $=dr(),ee=A($);nt(ee,{get preventScroll(){return N()}});var te=et(ee,2);Pe(te,X=>({...X}),[()=>K(u(g),ze())]);var ke=Ce(te);F(ke,()=>v()??V),Oe(te),O(Q,$)};L(ft,Q=>{h()?Q(gt):Q(vt,-1)})}O(pt,He)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};L(W,c=>{(t.shouldRender||d())&&c(M)})}return O(r,Se),U(R)}const dt=Symbol("overlay-open"),ct=Symbol("overlay-static"),st={tier:"moderate",x:0,y:0,scale:1,opacity:0},ot={tier:"slow",x:0,y:8,scale:.97,opacity:0},ur={top:{x:0,y:"-100%"},right:{x:"100%",y:0},bottom:{x:0,y:"100%"},left:{x:"-100%",y:0}},Fr={backdrop:{enter:st,exit:st},dialog:{enter:ot,exit:ot},sheet(r){const e={tier:"slow",scale:1,opacity:1,...ur[r]};return{enter:e,exit:e}}};function hr(r){it(dt,r)}function Rr(){const r=Le(dt);if(!r)throw new Error("Dialog or Sheet Content must be nested inside its Root.");return r}function pr(r){it(ct,r)}function Tr(){return Le(ct)??(()=>!1)}function Dr(r){let e=T(It(r()));return kt(()=>{if(r()){_(e,!0);return}if(!u(e))return;const n=window.setTimeout(()=>_(e,!1),Rt(Tt.slow));return()=>window.clearTimeout(n)}),{get mounted(){return u(e)},finishExit(){r()||_(e,!1)}}}var fr=new Set(["$$slots","$$events","$$legacy","open","staticPosition","children","onOpenChange"]);function gr(r,e){if(new.target)return j({component:gr,...r});J(e,!0);let n=a(e,"open",15,!1),o=a(e,"staticPosition",7,!1),v=a(e,"children",7),h=a(e,"onOpenChange",7),m=Z(e,fr);hr(()=>n()),pr(()=>o()),jt(()=>{n(!1),h()?.(!1)});var d={get open(){return n()},set open(f=!1){n(f),i()},get staticPosition(){return o()},set staticPosition(f=!1){o(f),i()},get children(){return v()},set children(f){v(f),i()},get onOpenChange(){return h()},set onOpenChange(f){h(f),i()},$set:q,$on:(f,y)=>z(e,f,y)},P=I(),p=A(P);return Vt(p,()=>lt,(f,y)=>{y(f,Ee({get onOpenChange(){return h()}},()=>m,{get open(){return n()},set open(C){n(C)},children:(C,N)=>{var x=I(),s=A(x);F(s,()=>v()??V),O(C,x)},$$slots:{default:!0}}))}),O(r,P),U(d)}const vr=Symbol("workspace-route-context");function mr(r){return r&&r!=="new"?qt(r):null}function Mr(r,e){return r?.startsWith("/workspace/")?mr(e):null}function Br(){try{return Le(vr)}catch{return}}export{ir as D,gr as O,vr as W,cr as a,nr as b,er as c,Yt as d,Dr as e,kr as f,Br as g,Tr as h,mr as i,Fr as o,Rr as u,Mr as w};
1
+ var mt=Object.defineProperty;var Qe=r=>{throw TypeError(r)};var yt=(r,e,n)=>e in r?mt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var b=(r,e,n)=>yt(r,typeof e!="symbol"?e+"":e,n),bt=(r,e,n)=>e.has(r)||Qe("Cannot "+n);var l=(r,e,n)=>(bt(r,e,"read from private field"),n?n.call(r):e.get(r)),w=(r,e,n)=>e.has(r)?Qe("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,n);import{aR as B,aP as Ye,aQ as Fe,m as _t,a0 as Ct,l as Ot,ab as Pt,Y as wt,b3 as St,aJ as xt,ad as Nt,bM as Ze,bL as Re,O as $e,bZ as At,w as Et,bN as Ae,bV as T,aD as u,bH as _,c9 as E,bo as _e,bs as J,a7 as I,ay as A,W as O,bn as U,aA as i,a5 as Ce,bf as V,bA as Oe,aB as Y,bS as et,aG as Le,br as It,ca as kt,bI as it}from"./B8o4lNgr.js";import{B as Ft,t as j,bq as a,a_ as L,by as q,b as z,br as Z,bt as Ee}from"./GWL2EpD7.js";import{B as tt,f as Rt,D as Tt}from"./bocWuth7.js";import{s as F}from"./vOveF3fP.js";import{c as Pe}from"./CYiv-51w.js";import{h as Dt,a6 as rt,aJ as S,bL as Xe,bt as Mt,b0 as Bt,av as we,aR as Kt,b1 as at,aE as Ie,ad as Wt,l as Lt,aS as D,bm as K,bo as k,I as Xt,n as Gt,j as Jt,al as Ut,ag as nt}from"./Dayd4Wgp.js";import{c as Vt}from"./DJCBi8x9.js";import{k as jt}from"./Com4THH3.js";import{b9 as qt}from"./C2YltVuJ.js";function kr(r,e,n,o,v,h){let m=B;B&&Ye();var d=null;B&&Fe.nodeType===_t&&(d=Fe,Ye());var P=B?Fe:r,p=$e,f=new Ft(P,!1);Ct(()=>{const y=e()||null;var C=y==="svg"?Et:void 0;if(y===null){f.ensure(null,null),Ae(!0);return}return f.ensure(y,N=>{if(y){if(d=B?d:Pt(y,C),wt(d,d),o){var x=null;B&&St(y)&&d.append(x=document.createComment(""));var s=B?xt(d):d.appendChild(Nt());B&&(s===null?Ze(!1):Re(s)),tt(p),o(d,s),x?.remove(),tt(null)}$e.nodes.end=d,N.before(d)}B&&Re(N)}),Ae(!0),()=>{y&&Ae(!1)}},Ot),At(()=>{Ae(!0)}),m&&(Ze(!0),Re(P))}const zt=Kt({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),G=new Dt("Dialog.Root | AlertDialog.Root");var re,ne,se,oe,ie,ae,le,de,ce,ue,he;const Ge=class Ge{constructor(e,n){b(this,"opts");w(this,re,T(null));w(this,ne,T(null));w(this,se,T(null));w(this,oe,T(null));w(this,ie,T(void 0));w(this,ae,T(void 0));w(this,le,T(void 0));w(this,de,T(void 0));w(this,ce,T(null));w(this,ue,T(0));b(this,"depth");b(this,"parent");b(this,"contentPresence");b(this,"overlayPresence");b(this,"getBitsAttr",e=>zt.getAttr(e,this.opts.variant.current));w(this,he,E(()=>({"data-state":Bt(this.opts.open.current)})));this.opts=e,this.parent=n,this.depth=n?n.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new rt({ref:S(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new rt({ref:S(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Xe(()=>this.opts.open.current,o=>{this.parent&&(o?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),Mt(()=>{this.opts.open.current&&this.parent?.decrementNested()})}static create(e){const n=G.getOr(null);return G.set(new Ge(e,n))}get triggerNode(){return u(l(this,re))}set triggerNode(e){_(l(this,re),e,!0)}get contentNode(){return u(l(this,ne))}set contentNode(e){_(l(this,ne),e,!0)}get overlayNode(){return u(l(this,se))}set overlayNode(e){_(l(this,se),e,!0)}get descriptionNode(){return u(l(this,oe))}set descriptionNode(e){_(l(this,oe),e,!0)}get contentId(){return u(l(this,ie))}set contentId(e){_(l(this,ie),e,!0)}get titleId(){return u(l(this,ae))}set titleId(e){_(l(this,ae),e,!0)}get triggerId(){return u(l(this,le))}set triggerId(e){_(l(this,le),e,!0)}get descriptionId(){return u(l(this,de))}set descriptionId(e){_(l(this,de),e,!0)}get cancelNode(){return u(l(this,ce))}set cancelNode(e){_(l(this,ce),e,!0)}get nestedOpenCount(){return u(l(this,ue))}set nestedOpenCount(e){_(l(this,ue),e,!0)}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}get sharedProps(){return u(l(this,he))}set sharedProps(e){_(l(this,he),e)}};re=new WeakMap,ne=new WeakMap,se=new WeakMap,oe=new WeakMap,ie=new WeakMap,ae=new WeakMap,le=new WeakMap,de=new WeakMap,ce=new WeakMap,ue=new WeakMap,he=new WeakMap;let Te=Ge;var pe;const Je=class Je{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,pe,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(e){return new Je(e,G.get())}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===Wt||e.key===Lt)&&(e.preventDefault(),this.root.handleClose())}get props(){return u(l(this,pe))}set props(e){_(l(this,pe),e)}};pe=new WeakMap;let De=Je;var fe;const Ue=class Ue{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,fe,E(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.root.titleId=this.opts.id.current,this.attachment=we(this.opts.ref),Xe.pre(()=>this.opts.id.current,o=>{this.root.titleId=o})}static create(e){return new Ue(e,G.get())}get props(){return u(l(this,fe))}set props(e){_(l(this,fe),e)}};fe=new WeakMap;let Me=Ue;var ge;const Ve=class Ve{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ge,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.root.descriptionId=this.opts.id.current,this.attachment=we(this.opts.ref,o=>{this.root.descriptionNode=o}),Xe.pre(()=>this.opts.id.current,o=>{this.root.descriptionId=o})}static create(e){return new Ve(e,G.get())}get props(){return u(l(this,ge))}set props(e){_(l(this,ge),e)}};ge=new WeakMap;let Be=Ve;var ve,me;const je=class je{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ve,E(()=>({open:this.root.opts.open.current})));w(this,me,E(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":Ie(this.root.nestedOpenCount>0),"data-nested":Ie(this.root.parent!==null),...at(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref,o=>{this.root.contentNode=o,this.root.contentId=o?.id})}static create(e){return new je(e,G.get())}get snippetProps(){return u(l(this,ve))}set snippetProps(e){_(l(this,ve),e)}get props(){return u(l(this,me))}set props(e){_(l(this,me),e)}get shouldRender(){return this.root.contentPresence.shouldRender}};ve=new WeakMap,me=new WeakMap;let Ke=je;var ye,be;const qe=class qe{constructor(e,n){b(this,"opts");b(this,"root");b(this,"attachment");w(this,ye,E(()=>({open:this.root.opts.open.current})));w(this,be,E(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":Ie(this.root.nestedOpenCount>0),"data-nested":Ie(this.root.parent!==null),...at(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment})));this.opts=e,this.root=n,this.attachment=we(this.opts.ref,o=>this.root.overlayNode=o)}static create(e){return new qe(e,G.get())}get snippetProps(){return u(l(this,ye))}set snippetProps(e){_(l(this,ye),e)}get props(){return u(l(this,be))}set props(e){_(l(this,be),e)}get shouldRender(){return this.root.overlayPresence.shouldRender}};ye=new WeakMap,be=new WeakMap;let We=qe;var Ht=new Set(["$$slots","$$events","$$legacy","id","ref","child","children","level"]),Qt=Y("<div><!></div>");function Yt(r,e){const n=_e();if(new.target)return j({component:Yt,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"ref",15,null),h=a(e,"child",7),m=a(e,"children",7),d=a(e,"level",7,2),P=Z(e,Ht);const p=Me.create({id:S(()=>o()),level:S(()=>d()),ref:S(()=>v(),t=>v(t))}),f=E(()=>K(P,p.props));var y={get id(){return o()},set id(t=D(n)){o(t),i()},get ref(){return v()},set ref(t=null){v(t),i()},get child(){return h()},set child(t){h(t),i()},get children(){return m()},set children(t){m(t),i()},get level(){return d()},set level(t=2){d(t),i()},$set:q,$on:(t,g)=>z(e,t,g)},C=I(),N=A(C);{var x=t=>{var g=I(),R=A(g);F(R,h,()=>({props:u(f)})),O(t,g)},s=t=>{var g=Qt();Pe(g,()=>({...u(f)}));var R=Ce(g);F(R,()=>m()??V),Oe(g),O(t,g)};L(N,t=>{h()?t(x):t(s,-1)})}return O(r,C),U(y)}var Zt=new Set(["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]),$t=Y("<div><!></div>");function er(r,e){const n=_e();if(new.target)return j({component:er,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"forceMount",7,!1),h=a(e,"child",7),m=a(e,"children",7),d=a(e,"ref",15,null),P=Z(e,Zt);const p=We.create({id:S(()=>o()),ref:S(()=>d(),s=>d(s))}),f=E(()=>K(P,p.props));var y={get id(){return o()},set id(s=D(n)){o(s),i()},get forceMount(){return v()},set forceMount(s=!1){v(s),i()},get child(){return h()},set child(s){h(s),i()},get children(){return m()},set children(s){m(s),i()},get ref(){return d()},set ref(s=null){d(s),i()},$set:q,$on:(s,t)=>z(e,s,t)},C=I(),N=A(C);{var x=s=>{var t=I(),g=A(t);{var R=W=>{var M=I(),c=A(M);{let H=E(()=>({props:K(u(f)),...p.snippetProps}));F(c,h,()=>u(H))}O(W,M)},Se=W=>{var M=$t();Pe(M,H=>({...H}),[()=>K(u(f))]);var c=Ce(M);F(c,()=>m()??V,()=>p.snippetProps),Oe(M),O(W,M)};L(g,W=>{h()?W(R):W(Se,-1)})}O(s,t)};L(N,s=>{(p.shouldRender||v())&&s(x)})}return O(r,C),U(y)}var tr=new Set(["$$slots","$$events","$$legacy","id","children","child","ref"]),rr=Y("<div><!></div>");function nr(r,e){const n=_e();if(new.target)return j({component:nr,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"children",7),h=a(e,"child",7),m=a(e,"ref",15,null),d=Z(e,tr);const P=Be.create({id:S(()=>o()),ref:S(()=>m(),s=>m(s))}),p=E(()=>K(d,P.props));var f={get id(){return o()},set id(s=D(n)){o(s),i()},get children(){return v()},set children(s){v(s),i()},get child(){return h()},set child(s){h(s),i()},get ref(){return m()},set ref(s=null){m(s),i()},$set:q,$on:(s,t)=>z(e,s,t)},y=I(),C=A(y);{var N=s=>{var t=I(),g=A(t);F(g,h,()=>({props:u(p)})),O(s,t)},x=s=>{var t=rr();Pe(t,()=>({...u(p)}));var g=Ce(t);F(g,()=>v()??V),Oe(t),O(s,t)};L(C,s=>{h()?s(N):s(x,-1)})}return O(r,y),U(f)}function lt(r,e){if(new.target)return j({component:lt,...r});J(e,!0);let n=a(e,"open",15,!1),o=a(e,"onOpenChange",7,k),v=a(e,"onOpenChangeComplete",7,k),h=a(e,"children",7);Te.create({variant:S(()=>"dialog"),open:S(()=>n(),p=>{n(p),o()(p)}),onOpenChangeComplete:S(()=>v())});var m={get open(){return n()},set open(p=!1){n(p),i()},get onOpenChange(){return o()},set onOpenChange(p=k){o(p),i()},get onOpenChangeComplete(){return v()},set onOpenChangeComplete(p=k){v(p),i()},get children(){return h()},set children(p){h(p),i()},$set:q,$on:(p,f)=>z(e,p,f)},d=I(),P=A(d);return F(P,()=>h()??V),O(r,d),U(m)}var sr=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]),or=Y("<button><!></button>");function ir(r,e){const n=_e();if(new.target)return j({component:ir,...r});J(e,!0);let o=a(e,"children",7),v=a(e,"child",7),h=a(e,"id",23,()=>D(n)),m=a(e,"ref",15,null),d=a(e,"disabled",7,!1),P=Z(e,sr);const p=De.create({variant:S(()=>"close"),id:S(()=>h()),ref:S(()=>m(),t=>m(t)),disabled:S(()=>!!d())}),f=E(()=>K(P,p.props));var y={get children(){return o()},set children(t){o(t),i()},get child(){return v()},set child(t){v(t),i()},get id(){return h()},set id(t=D(n)){h(t),i()},get ref(){return m()},set ref(t=null){m(t),i()},get disabled(){return d()},set disabled(t=!1){d(t),i()},$set:q,$on:(t,g)=>z(e,t,g)},C=I(),N=A(C);{var x=t=>{var g=I(),R=A(g);F(R,v,()=>({props:u(f)})),O(t,g)},s=t=>{var g=or();Pe(g,()=>({...u(f)}));var R=Ce(g);F(R,()=>o()??V),Oe(g),O(t,g)};L(N,t=>{v()?t(x):t(s,-1)})}return O(r,C),U(y)}var ar=new Set(["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]),lr=Y("<!> <!>",1),dr=Y("<!> <div><!></div>",1);function cr(r,e){const n=_e();if(new.target)return j({component:cr,...r});J(e,!0);let o=a(e,"id",23,()=>D(n)),v=a(e,"children",7),h=a(e,"child",7),m=a(e,"ref",15,null),d=a(e,"forceMount",7,!1),P=a(e,"onCloseAutoFocus",7,k),p=a(e,"onOpenAutoFocus",7,k),f=a(e,"onEscapeKeydown",7,k),y=a(e,"onInteractOutside",7,k),C=a(e,"trapFocus",7,!0),N=a(e,"preventScroll",7,!0),x=a(e,"restoreScrollDelay",7,null),s=Z(e,ar);const t=Ke.create({id:S(()=>o()),ref:S(()=>m(),c=>m(c))}),g=E(()=>K(s,t.props));var R={get id(){return o()},set id(c=D(n)){o(c),i()},get children(){return v()},set children(c){v(c),i()},get child(){return h()},set child(c){h(c),i()},get ref(){return m()},set ref(c=null){m(c),i()},get forceMount(){return d()},set forceMount(c=!1){d(c),i()},get onCloseAutoFocus(){return P()},set onCloseAutoFocus(c=k){P(c),i()},get onOpenAutoFocus(){return p()},set onOpenAutoFocus(c=k){p(c),i()},get onEscapeKeydown(){return f()},set onEscapeKeydown(c=k){f(c),i()},get onInteractOutside(){return y()},set onInteractOutside(c=k){y(c),i()},get trapFocus(){return C()},set trapFocus(c=!0){C(c),i()},get preventScroll(){return N()},set preventScroll(c=!0){N(c),i()},get restoreScrollDelay(){return x()},set restoreScrollDelay(c=null){x(c),i()},$set:q,$on:(c,H)=>z(e,c,H)},Se=I(),W=A(Se);{var M=c=>{Xt(c,{get ref(){return t.opts.ref},loop:!0,get trapFocus(){return C()},get enabled(){return t.root.opts.open.current},get onOpenAutoFocus(){return p()},get onCloseAutoFocus(){return P()},focusScope:(ut,ht)=>{let ze=()=>(ht?.()).props;Gt(ut,Ee(()=>u(g),{get enabled(){return t.root.opts.open.current},get ref(){return t.opts.ref},onEscapeKeydown:xe=>{f()(xe),!xe.defaultPrevented&&t.root.handleClose()},children:(xe,yr)=>{Jt(xe,Ee(()=>u(g),{get ref(){return t.opts.ref},get enabled(){return t.root.opts.open.current},onInteractOutside:Ne=>{y()(Ne),!Ne.defaultPrevented&&t.root.handleClose()},children:(Ne,br)=>{Ut(Ne,Ee(()=>u(g),{get ref(){return t.opts.ref},get enabled(){return t.root.opts.open.current},children:(pt,_r)=>{var He=I(),ft=A(He);{var gt=Q=>{var $=lr(),ee=A($);{var te=X=>{nt(X,{get preventScroll(){return N()},get restoreScrollDelay(){return x()}})};L(ee,X=>{t.root.opts.open.current&&X(te)})}var ke=et(ee,2);{let X=E(()=>({props:K(u(g),ze()),...t.snippetProps}));F(ke,h,()=>u(X))}O(Q,$)},vt=Q=>{var $=dr(),ee=A($);nt(ee,{get preventScroll(){return N()}});var te=et(ee,2);Pe(te,X=>({...X}),[()=>K(u(g),ze())]);var ke=Ce(te);F(ke,()=>v()??V),Oe(te),O(Q,$)};L(ft,Q=>{h()?Q(gt):Q(vt,-1)})}O(pt,He)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};L(W,c=>{(t.shouldRender||d())&&c(M)})}return O(r,Se),U(R)}const dt=Symbol("overlay-open"),ct=Symbol("overlay-static"),st={tier:"moderate",x:0,y:0,scale:1,opacity:0},ot={tier:"slow",x:0,y:8,scale:.97,opacity:0},ur={top:{x:0,y:"-100%"},right:{x:"100%",y:0},bottom:{x:0,y:"100%"},left:{x:"-100%",y:0}},Fr={backdrop:{enter:st,exit:st},dialog:{enter:ot,exit:ot},sheet(r){const e={tier:"slow",scale:1,opacity:1,...ur[r]};return{enter:e,exit:e}}};function hr(r){it(dt,r)}function Rr(){const r=Le(dt);if(!r)throw new Error("Dialog or Sheet Content must be nested inside its Root.");return r}function pr(r){it(ct,r)}function Tr(){return Le(ct)??(()=>!1)}function Dr(r){let e=T(It(r()));return kt(()=>{if(r()){_(e,!0);return}if(!u(e))return;const n=window.setTimeout(()=>_(e,!1),Rt(Tt.slow));return()=>window.clearTimeout(n)}),{get mounted(){return u(e)},finishExit(){r()||_(e,!1)}}}var fr=new Set(["$$slots","$$events","$$legacy","open","staticPosition","children","onOpenChange"]);function gr(r,e){if(new.target)return j({component:gr,...r});J(e,!0);let n=a(e,"open",15,!1),o=a(e,"staticPosition",7,!1),v=a(e,"children",7),h=a(e,"onOpenChange",7),m=Z(e,fr);hr(()=>n()),pr(()=>o()),jt(()=>{n(!1),h()?.(!1)});var d={get open(){return n()},set open(f=!1){n(f),i()},get staticPosition(){return o()},set staticPosition(f=!1){o(f),i()},get children(){return v()},set children(f){v(f),i()},get onOpenChange(){return h()},set onOpenChange(f){h(f),i()},$set:q,$on:(f,y)=>z(e,f,y)},P=I(),p=A(P);return Vt(p,()=>lt,(f,y)=>{y(f,Ee({get onOpenChange(){return h()}},()=>m,{get open(){return n()},set open(C){n(C)},children:(C,N)=>{var x=I(),s=A(x);F(s,()=>v()??V),O(C,x)},$$slots:{default:!0}}))}),O(r,P),U(d)}const vr=Symbol("workspace-route-context");function mr(r){return r&&r!=="new"?qt(r):null}function Mr(r,e){return r?.startsWith("/workspace/")?mr(e):null}function Br(){try{return Le(vr)}catch{return}}export{ir as D,gr as O,vr as W,cr as a,nr as b,er as c,Yt as d,Dr as e,kr as f,Br as g,Tr as h,mr as i,Fr as o,Rr as u,Mr as w};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DXiZnX1H.js","/app/immutable/chunks/C2YltVuJ.js","/app/immutable/chunks/CjSUqH7t.js","/app/immutable/chunks/B8o4lNgr.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DVkfuwKw.js","/app/immutable/chunks/CpHIRYx9.js","/app/immutable/chunks/vOveF3fP.js","/app/immutable/chunks/GWL2EpD7.js","/app/immutable/chunks/BeYie-c5.js","/app/immutable/chunks/DCmgYKro.js","/app/immutable/chunks/0I000Ru9.js"])))=>i.map(i=>d[i]);
2
- import{t as Xt,bq as Q,a_ as D,by as Kt,bu as P,bs as Gt,b as Nt,bo as o,_ as Zt}from"./GWL2EpD7.js";import{bs as Jt,ca as S,bH as U,c5 as ft,aD as Y,bj as Qt,a5 as A,bS as p,bA as F,b_ as b,W as h,bn as Yt,cd as tt,bV as _t,c9 as te,aA as et,bl as T,bO as y,ay as vt,aB as k}from"./B8o4lNgr.js";import{k as xt,l as ee}from"./CYiv-51w.js";import{b as re}from"./D2g8BuR1.js";import{b as se}from"./Bsxt04FP.js";import{G0 as u,zZ as ae,zP as ne,zO as oe,FW as ie,zA as le,hH as ce,i2 as ue}from"./C2YltVuJ.js";import{a as de,T as pe,D as me,L as fe,o as _e}from"./B__WlfRy.js";import{F as rt,cS as ve,c1 as xe,cO as he}from"./BM7uH7Bn.js";import{f as ht}from"./CgDKiC6v.js";import{n as G}from"./Dz9B-9IH.js";import"./vOveF3fP.js";import"./ChTqQfQN.js";import"./QjTmIbp0.js";import{r as ge}from"./B_NbPKl3.js";import{selectScriptById as st,selectScriptRuntime as be,selectScriptOutput as gt,selectScriptRetainedOutput as ye,selectCanDeleteScript as bt}from"./Dzimjbdi.js";import{f as ke}from"./C6YXNiX1.js";import{bP as we,dD as $e,de as yt}from"./hkbK0uGm.js";import"./BlBijATU.js";import"./IJ5h6xZ4.js";import"./CPj7dkhl.js";import{c as Se}from"./CpA81uUD.js";var kt=k("<!> ",1),Ae=k('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),Fe=k('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),Oe=k('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Ce=k('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Re=k('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),Ie=k('<code class="text-muted-foreground font-mono text-xs"> </code>'),Le=k('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!></div></div>'),ze=k('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function De(f,m){if(new.target)return Xt({component:De,...f});Jt(m,!0);const H=()=>P(It,"$outputAuthority",C),i=()=>P(At,"$runtime$",C),_=()=>P(Ft,"$output$",C),O=()=>P(Rt,"$codeFontFamilyCSS",C),q=()=>P(Ot,"$retainedOutput$",C),wt=()=>P(Ct,"$hidesAgentLifecycleActions$",C),at=()=>P(St,"$script$",C),[C,$t]=Gt();let w=Q(m,"scriptId",7),v=Q(m,"workspaceId",7),N=Q(m,"class",7,"");const R=tt(""),E=tt(""),nt=tt("");let Z=_t(!1);S(()=>R.set(v())),S(()=>E.set(w()));let I,n=null,W=null,V=null,M=null,L=null,j=null;const St=st(R,E),At=be(R,E),Ft=gt(R,E),Ot=ye(R,E,nt),Ct=we(R),Rt=ke(),It=$e(R),ot=crypto.randomUUID();S(()=>{const t=v();return w(),()=>{t&&u.dispatch(ae(t,ot))}}),S(()=>{const t=v(),e=w(),s=H(),r=i();if(!s||!t||!e)return;r.status,r.startedAt;const l=crypto.randomUUID();return nt.set(l),U(Z,ft(()=>_().chunks.length===0),!0),u.dispatch(ne(t,e,l)),()=>u.dispatch(oe(t,e,l))});let X=_t(0);const Lt=te(()=>i().status==="exited"&&i().exitCode!=null&&i().exitCode!==0&&i().exitCode<128);function zt(){if(!I||n)return;M=new pe(I);const t=M.getCurrentTheme();n=new me({allowProposedApi:!0,fontFamily:O(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),n.attachCustomKeyEventHandler(s=>{const r=s.metaKey||s.ctrlKey;return!(r&&s.key==="`"||r&&s.key==="j"||r&&s.key==="k")}),W=new _e,n.loadAddon(W);const e=new fe((s,r)=>{try{const l=new URL(r);l.hostname==="localhost"||l.hostname==="127.0.0.1"?ge(r).then(g=>{Zt(async()=>{const{getPanelLayoutManager:c}=await import("./DXiZnX1H.js").then(x=>x.p);return{getPanelLayoutManager:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(({getPanelLayoutManager:c})=>{c(v()).openBrowserPanel(g.url,void 0,void 0,g.requestedUrl)}).catch(()=>{window.open(g.url,"_blank")})}):window.open(r,"_blank")}catch{window.open(r,"_blank")}});n.loadAddon(e),n.open(I),M.applyTheme(n),j=requestAnimationFrame(()=>{j=null,W?.fit()}),V=new ResizeObserver(()=>{W?.fit()}),V.observe(I),Dt()}function Dt(){if(!n)return;const t=gt.select(u.state,v(),w());t.chunks.length>0&&n.write(t.chunks.map(e=>e.text).join("")),U(X,t.dropped+t.chunks.length)}function it(){L!==null&&(cancelAnimationFrame(L),L=null),j!==null&&(cancelAnimationFrame(j),j=null),V?.disconnect(),V=null,M?.dispose(),M=null;const t=n;n=null,W=null,U(X,0),t&&de(t)}S(()=>{const t=_(),e=ft(()=>Y(X)),s=t.dropped+t.chunks.length;if(!n||s<=e)return;const r=Math.max(e-t.dropped,0);n.write(t.chunks.slice(r).map(l=>l.text).join("")),U(X,s)}),S(()=>{const t=O();n&&n.options.fontFamily!==t&&(n.options.fontFamily=t)});function Pt(){u.dispatch(ie(v(),w()))}function Tt(){if(!v()){G.error(o.terminal_scriptOutput_noWorkspace_error());return}u.dispatch(ce(v(),w(),q()?.text,ot))}S(()=>{i().status==="idle"&&_().chunks.length===0&&it()}),S(()=>{!(i().status==="idle"&&_().chunks.length===0)&&I&&!n&&(L!==null&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{L=null,zt()}))}),Qt(()=>{it()});var qt={get scriptId(){return w()},set scriptId(t){w(t),et()},get workspaceId(){return v()},set workspaceId(t){v(t),et()},get class(){return N()},set class(t=""){N(t),et()},$set:Kt,$on:(t,e)=>Nt(m,t,e)},K=ze(),lt=A(K);{var Bt=t=>{var e=Ae(),s=A(e),r=A(s),l=A(r);rt(l,{get icon(){return ve},size:"xs"}),F(r);var g=p(r,2),c=T(g,!0);F(s);var x=p(s,2);{var $=a=>{ht(a,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Tt,children:(d,z)=>{var B=kt(),mt=vt(B);rt(mt,{get icon(){return he},size:"sm",class:"mr-1.5"});var Ht=p(mt);b(Vt=>y(Ht,` ${Vt??""}`),[()=>o.terminal_scriptOutput_askAiToFix_label()]),h(d,B)},$$slots:{default:!0}})};D(x,a=>{wt()||a($)})}F(e),b(a=>y(c,a),[()=>o.terminal_scriptOutput_buildFailed_label({exitCode:i().exitCode??0})]),h(t,e)};D(lt,t=>{Y(Lt)&&t(Bt)})}var ct=p(lt,2);{var Et=t=>{var e=Ce(),s=A(e),r=T(s,!0),l=p(s,2),g=T(l,!0),c=p(l,2);{var x=a=>{var d=Fe();let z;var B=T(d,!0);b(()=>{z=ee(d,"",z,{"font-family":O()}),y(B,q().text)}),h(a,d)},$=a=>{var d=Oe(),z=T(d,!0);b(B=>y(z,B),[()=>q().status==="loading"?o.terminal_scriptOutput_retainedLoading_label():o.terminal_scriptOutput_retainedUnavailable_label()]),h(a,d)};D(c,a=>{q().status==="available"?a(x):a($,-1)})}F(e),b((a,d)=>{y(r,a),y(g,d)},[()=>o.terminal_scriptOutput_retained_label(),()=>o.terminal_scriptOutput_retained_description()]),se("open","toggle",e,a=>U(Z,a),()=>Y(Z)),h(t,e)};D(ct,t=>{q()&&t(Et)})}var ut=p(ct,2);{var Wt=t=>{var e=Re(),s=T(e,!0);b(r=>y(s,r),[()=>o.terminal_scriptOutput_live_label()]),h(t,e)};D(ut,t=>{_().chunks.length>0&&q()&&t(Wt)})}var dt=p(ut,2);{var Mt=t=>{var e=Le(),s=A(e),r=p(A(s),2);{var l=c=>{var x=Ie(),$=T(x,!0);b(a=>y($,a),[()=>le(at())]),h(c,x)};D(r,c=>{at()&&c(l)})}var g=p(r,2);ht(g,{variant:"ghost",size:"xs",onclick:Pt,class:"text-muted-foreground hover:text-foreground",children:(c,x)=>{var $=kt(),a=vt($);rt(a,{get icon(){return xe},class:"h-3 w-3 mr-1"});var d=p(a);b(z=>y(d,` ${z??""}`),[()=>o.terminal_scriptOutput_run_label()]),h(c,$)},$$slots:{default:!0}}),F(s),F(e),h(t,e)};D(dt,t=>{i().status==="idle"&&_().chunks.length===0&&t(Mt)})}var J=p(dt,2);let pt;var jt=A(J);re(jt,t=>I=t,()=>I),F(J),F(K),b(()=>{xt(K,1,`script-output-viewer ${N()??""}`,"svelte-115p4sl"),pt=xt(J,1,"flex-1 relative overflow-hidden",null,pt,{hidden:i().status==="idle"&&_().chunks.length===0})}),h(f,K);var Ut=Yt(qt);return $t(),Ut}async function rr(f,m,H){const i=st.select(u.state,f,m);if(!i||!H()||!bt.select(u.state,f,m))return;const _=yt.select(u.state,f);if(!_){G.error(o.workspace_client_accessChanged_error());return}if(!await Se({title:o.scripts_delete_title({name:i.name}),description:o.scripts_delete_description(),confirmLabel:o.scripts_delete_label(),destructive:!0}))return;if(_!==yt.select(u.state,f)){G.error(o.workspace_client_accessChanged_error());return}const O=st.select(u.state,f,m);if(!H()||!O||O.createdAt!==i.createdAt||O.name!==i.name||!bt.select(u.state,f,m)){G.error(o.scripts_delete_changed_error());return}u.dispatch(ue(f,m,o.terminal_quakeOverlay_deleteScriptFailed_error()))}export{De as S,rr as c};
2
+ import{t as Xt,bq as Q,a_ as D,by as Kt,bu as P,bs as Gt,b as Nt,bo as o,_ as Zt}from"./GWL2EpD7.js";import{bs as Jt,ca as S,bH as U,c5 as ft,aD as Y,bj as Qt,a5 as A,bS as p,bA as F,b_ as b,W as h,bn as Yt,cd as tt,bV as _t,c9 as te,aA as et,bl as T,bO as y,ay as vt,aB as k}from"./B8o4lNgr.js";import{k as xt,l as ee}from"./CYiv-51w.js";import{b as re}from"./D2g8BuR1.js";import{b as se}from"./Bsxt04FP.js";import{G0 as u,zZ as ae,zP as ne,zO as oe,FW as ie,zA as le,hH as ce,i2 as ue}from"./C2YltVuJ.js";import{a as de,T as pe,D as me,L as fe,o as _e}from"./C-YIgYgI.js";import{F as rt,cS as ve,c1 as xe,cO as he}from"./BM7uH7Bn.js";import{f as ht}from"./Dayd4Wgp.js";import{n as G}from"./C8BD21JK.js";import"./vOveF3fP.js";import"./ChTqQfQN.js";import"./QjTmIbp0.js";import{r as ge}from"./BW-plizF.js";import{selectScriptById as st,selectScriptRuntime as be,selectScriptOutput as gt,selectScriptRetainedOutput as ye,selectCanDeleteScript as bt}from"./DkxKadFP.js";import{f as ke}from"./C6YXNiX1.js";import{bP as we,dD as $e,de as yt}from"./6WgKbzWn.js";import"./BlBijATU.js";import"./DkNxxzmT.js";import"./CPj7dkhl.js";import{c as Se}from"./DuJ8M51r.js";var kt=k("<!> ",1),Ae=k('<div class="bg-danger-background/20 border-y border-danger/20 px-3 py-1.5 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-danger font-medium"><div class="w-4 h-4 rounded-full bg-danger-background flex items-center justify-center"><!></div> <span> </span></div> <!></div>'),Fe=k('<pre class="retained-text px-3 pb-3 text-xs svelte-115p4sl"> </pre>'),Oe=k('<p class="px-3 pb-3 text-xs text-muted-foreground" role="status"> </p>'),Ce=k('<details class="retained-output border-b border-border svelte-115p4sl"><summary class="cursor-pointer px-3 py-2 text-xs text-muted-foreground"> </summary> <p class="px-3 pb-2 text-xs text-muted-foreground"> </p> <!></details>'),Re=k('<div class="px-3 py-1 text-xs text-muted-foreground"> </div>'),Ie=k('<code class="text-muted-foreground font-mono text-xs"> </code>'),Le=k('<div class="flex-1 flex items-center justify-center px-4 py-8"><div class="flex items-center gap-3 text-sm"><span class="text-subtle font-mono">$</span> <!> <!></div></div>'),ze=k('<div><!> <!> <!> <!> <div><div class="xterm-output svelte-115p4sl"></div></div></div>');function De(f,m){if(new.target)return Xt({component:De,...f});Jt(m,!0);const H=()=>P(It,"$outputAuthority",C),i=()=>P(At,"$runtime$",C),_=()=>P(Ft,"$output$",C),O=()=>P(Rt,"$codeFontFamilyCSS",C),q=()=>P(Ot,"$retainedOutput$",C),wt=()=>P(Ct,"$hidesAgentLifecycleActions$",C),at=()=>P(St,"$script$",C),[C,$t]=Gt();let w=Q(m,"scriptId",7),v=Q(m,"workspaceId",7),N=Q(m,"class",7,"");const R=tt(""),E=tt(""),nt=tt("");let Z=_t(!1);S(()=>R.set(v())),S(()=>E.set(w()));let I,n=null,W=null,V=null,M=null,L=null,j=null;const St=st(R,E),At=be(R,E),Ft=gt(R,E),Ot=ye(R,E,nt),Ct=we(R),Rt=ke(),It=$e(R),ot=crypto.randomUUID();S(()=>{const t=v();return w(),()=>{t&&u.dispatch(ae(t,ot))}}),S(()=>{const t=v(),e=w(),s=H(),r=i();if(!s||!t||!e)return;r.status,r.startedAt;const l=crypto.randomUUID();return nt.set(l),U(Z,ft(()=>_().chunks.length===0),!0),u.dispatch(ne(t,e,l)),()=>u.dispatch(oe(t,e,l))});let X=_t(0);const Lt=te(()=>i().status==="exited"&&i().exitCode!=null&&i().exitCode!==0&&i().exitCode<128);function zt(){if(!I||n)return;M=new pe(I);const t=M.getCurrentTheme();n=new me({allowProposedApi:!0,fontFamily:O(),fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!1,cursorStyle:"underline",cursorWidth:1,scrollback:1e4,allowTransparency:!0,convertEol:!0,disableStdin:!0,drawBoldTextInBrightColors:!0,theme:t}),n.attachCustomKeyEventHandler(s=>{const r=s.metaKey||s.ctrlKey;return!(r&&s.key==="`"||r&&s.key==="j"||r&&s.key==="k")}),W=new _e,n.loadAddon(W);const e=new fe((s,r)=>{try{const l=new URL(r);l.hostname==="localhost"||l.hostname==="127.0.0.1"?ge(r).then(g=>{Zt(async()=>{const{getPanelLayoutManager:c}=await import("./DXiZnX1H.js").then(x=>x.p);return{getPanelLayoutManager:c}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(({getPanelLayoutManager:c})=>{c(v()).openBrowserPanel(g.url,void 0,void 0,g.requestedUrl)}).catch(()=>{window.open(g.url,"_blank")})}):window.open(r,"_blank")}catch{window.open(r,"_blank")}});n.loadAddon(e),n.open(I),M.applyTheme(n),j=requestAnimationFrame(()=>{j=null,W?.fit()}),V=new ResizeObserver(()=>{W?.fit()}),V.observe(I),Dt()}function Dt(){if(!n)return;const t=gt.select(u.state,v(),w());t.chunks.length>0&&n.write(t.chunks.map(e=>e.text).join("")),U(X,t.dropped+t.chunks.length)}function it(){L!==null&&(cancelAnimationFrame(L),L=null),j!==null&&(cancelAnimationFrame(j),j=null),V?.disconnect(),V=null,M?.dispose(),M=null;const t=n;n=null,W=null,U(X,0),t&&de(t)}S(()=>{const t=_(),e=ft(()=>Y(X)),s=t.dropped+t.chunks.length;if(!n||s<=e)return;const r=Math.max(e-t.dropped,0);n.write(t.chunks.slice(r).map(l=>l.text).join("")),U(X,s)}),S(()=>{const t=O();n&&n.options.fontFamily!==t&&(n.options.fontFamily=t)});function Pt(){u.dispatch(ie(v(),w()))}function Tt(){if(!v()){G.error(o.terminal_scriptOutput_noWorkspace_error());return}u.dispatch(ce(v(),w(),q()?.text,ot))}S(()=>{i().status==="idle"&&_().chunks.length===0&&it()}),S(()=>{!(i().status==="idle"&&_().chunks.length===0)&&I&&!n&&(L!==null&&cancelAnimationFrame(L),L=requestAnimationFrame(()=>{L=null,zt()}))}),Qt(()=>{it()});var qt={get scriptId(){return w()},set scriptId(t){w(t),et()},get workspaceId(){return v()},set workspaceId(t){v(t),et()},get class(){return N()},set class(t=""){N(t),et()},$set:Kt,$on:(t,e)=>Nt(m,t,e)},K=ze(),lt=A(K);{var Bt=t=>{var e=Ae(),s=A(e),r=A(s),l=A(r);rt(l,{get icon(){return ve},size:"xs"}),F(r);var g=p(r,2),c=T(g,!0);F(s);var x=p(s,2);{var $=a=>{ht(a,{variant:"outline",size:"sm",class:"h-7 text-xs bg-background border border-border text-danger",onclick:Tt,children:(d,z)=>{var B=kt(),mt=vt(B);rt(mt,{get icon(){return he},size:"sm",class:"mr-1.5"});var Ht=p(mt);b(Vt=>y(Ht,` ${Vt??""}`),[()=>o.terminal_scriptOutput_askAiToFix_label()]),h(d,B)},$$slots:{default:!0}})};D(x,a=>{wt()||a($)})}F(e),b(a=>y(c,a),[()=>o.terminal_scriptOutput_buildFailed_label({exitCode:i().exitCode??0})]),h(t,e)};D(lt,t=>{Y(Lt)&&t(Bt)})}var ct=p(lt,2);{var Et=t=>{var e=Ce(),s=A(e),r=T(s,!0),l=p(s,2),g=T(l,!0),c=p(l,2);{var x=a=>{var d=Fe();let z;var B=T(d,!0);b(()=>{z=ee(d,"",z,{"font-family":O()}),y(B,q().text)}),h(a,d)},$=a=>{var d=Oe(),z=T(d,!0);b(B=>y(z,B),[()=>q().status==="loading"?o.terminal_scriptOutput_retainedLoading_label():o.terminal_scriptOutput_retainedUnavailable_label()]),h(a,d)};D(c,a=>{q().status==="available"?a(x):a($,-1)})}F(e),b((a,d)=>{y(r,a),y(g,d)},[()=>o.terminal_scriptOutput_retained_label(),()=>o.terminal_scriptOutput_retained_description()]),se("open","toggle",e,a=>U(Z,a),()=>Y(Z)),h(t,e)};D(ct,t=>{q()&&t(Et)})}var ut=p(ct,2);{var Wt=t=>{var e=Re(),s=T(e,!0);b(r=>y(s,r),[()=>o.terminal_scriptOutput_live_label()]),h(t,e)};D(ut,t=>{_().chunks.length>0&&q()&&t(Wt)})}var dt=p(ut,2);{var Mt=t=>{var e=Le(),s=A(e),r=p(A(s),2);{var l=c=>{var x=Ie(),$=T(x,!0);b(a=>y($,a),[()=>le(at())]),h(c,x)};D(r,c=>{at()&&c(l)})}var g=p(r,2);ht(g,{variant:"ghost",size:"xs",onclick:Pt,class:"text-muted-foreground hover:text-foreground",children:(c,x)=>{var $=kt(),a=vt($);rt(a,{get icon(){return xe},class:"h-3 w-3 mr-1"});var d=p(a);b(z=>y(d,` ${z??""}`),[()=>o.terminal_scriptOutput_run_label()]),h(c,$)},$$slots:{default:!0}}),F(s),F(e),h(t,e)};D(dt,t=>{i().status==="idle"&&_().chunks.length===0&&t(Mt)})}var J=p(dt,2);let pt;var jt=A(J);re(jt,t=>I=t,()=>I),F(J),F(K),b(()=>{xt(K,1,`script-output-viewer ${N()??""}`,"svelte-115p4sl"),pt=xt(J,1,"flex-1 relative overflow-hidden",null,pt,{hidden:i().status==="idle"&&_().chunks.length===0})}),h(f,K);var Ut=Yt(qt);return $t(),Ut}async function rr(f,m,H){const i=st.select(u.state,f,m);if(!i||!H()||!bt.select(u.state,f,m))return;const _=yt.select(u.state,f);if(!_){G.error(o.workspace_client_accessChanged_error());return}if(!await Se({title:o.scripts_delete_title({name:i.name}),description:o.scripts_delete_description(),confirmLabel:o.scripts_delete_label(),destructive:!0}))return;if(_!==yt.select(u.state,f)){G.error(o.workspace_client_accessChanged_error());return}const O=st.select(u.state,f,m);if(!H()||!O||O.createdAt!==i.createdAt||O.name!==i.name||!bt.select(u.state,f,m)){G.error(o.scripts_delete_changed_error());return}u.dispatch(ue(f,m,o.terminal_quakeOverlay_deleteScriptFailed_error()))}export{De as S,rr as c};
@@ -1 +1 @@
1
- var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Y as ce,ag as q,ao as Ce}from"./CtxR6yc7.js";import{bJ as Le,cE as le,c5 as ue,c4 as ve}from"./B_eTXuFT.js";import{G0 as p,z2 as we,br as be,c as Fe,HX as de,hz as me,bD as ke,AU as z,zq as Ge,eT as Pe,xC as xe,dP as Ee,eP as fe,dO as _e,y1 as Ve,HD as Ue,tS as Be}from"./C2YltVuJ.js";import{aA as Ae,dy as he,A as H,P as ge,aw as K}from"./hkbK0uGm.js";import{ax as $e}from"./CgDKiC6v.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./Dz9B-9IH.js";import"./B8o4lNgr.js";import{bo as n}from"./GWL2EpD7.js";import"./CYiv-51w.js";import"./vOveF3fP.js";import"./QjTmIbp0.js";import{R as Re}from"./0I000Ru9.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
1
+ var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Y as ce,ag as q,ao as Ce}from"./DOsLfX1h.js";import{bJ as Le,cE as le,c5 as ue,c4 as ve}from"./BhDJcXuT.js";import{G0 as p,z2 as we,br as be,c as Fe,HX as de,hz as me,bD as ke,AU as z,zq as Ge,eT as Pe,xC as xe,dP as Ee,eP as fe,dO as _e,y1 as Ve,HD as Ue,tS as Be}from"./C2YltVuJ.js";import{aA as Ae,dy as he,A as H,P as ge,aw as K}from"./6WgKbzWn.js";import{ax as $e}from"./Dayd4Wgp.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./C8BD21JK.js";import"./B8o4lNgr.js";import{bo as n}from"./GWL2EpD7.js";import"./CYiv-51w.js";import"./vOveF3fP.js";import"./QjTmIbp0.js";import{R as Re}from"./0I000Ru9.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
@@ -1 +1 @@
1
- import{b as t,a,s as r,S as s}from"./Dvrl4uc9.js";import{a as i}from"./DnQbQ1Ee.js";import"./ZEBhSR5D.js";import"./DERVpCl4.js";var u={parser:r,get db(){return new s(2)},renderer:a,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{u as diagram};
1
+ import{b as t,a,s as r,S as s}from"./BzSqqrdV.js";import{a as i}from"./vJt7gt7x.js";import"./B45awpwY.js";import"./CLst9ImY.js";var u={parser:r,get db(){return new s(2)},renderer:a,styles:t,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{u as diagram};