@intent-hq/web 2.391.1 → 2.392.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 (328) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{gQ8VFuWN.js → 0TbppU-W.js} +2 -2
  3. package/web/app/immutable/chunks/{B2awO10u.js → 2OP7IVCM.js} +1 -1
  4. package/web/app/immutable/chunks/{BZ27qIg1.js → 2z64ELW5.js} +1 -1
  5. package/web/app/immutable/chunks/{Cr9C4VDu.js → 3rqOYBi3.js} +1 -1
  6. package/web/app/immutable/chunks/{z0xDttNV.js → 50HYkjWD.js} +3 -3
  7. package/web/app/immutable/chunks/{DLqZuVvj.js → 52kdRKiP.js} +1 -1
  8. package/web/app/immutable/chunks/{Dh1j4V0b.js → 7zxUzaYz.js} +1 -1
  9. package/web/app/immutable/chunks/{Drn9m8Tp.js → 9AKr1UyY.js} +1 -1
  10. package/web/app/immutable/chunks/{DXCHCOFX.js → 9ryMZ44V.js} +1 -1
  11. package/web/app/immutable/chunks/{B7hGbqIM.js → AlO3r9jV.js} +1 -1
  12. package/web/app/immutable/chunks/{CVtLV3_x.js → B0SSzYpD.js} +1 -1
  13. package/web/app/immutable/chunks/{DuZtgB5V.js → B0oQ37UY.js} +1 -1
  14. package/web/app/immutable/chunks/{9eqoPT_C.js → B2-ooCTr.js} +1 -1
  15. package/web/app/immutable/chunks/{C1MYTxgW.js → B2frqTj8.js} +1 -1
  16. package/web/app/immutable/chunks/{CedswVQA.js → B36ccT8S.js} +1 -1
  17. package/web/app/immutable/chunks/{g5QqP-QE.js → B6Qz5J1y.js} +1 -1
  18. package/web/app/immutable/chunks/{DHvVAxAW.js → B6wkNYPs.js} +1 -1
  19. package/web/app/immutable/chunks/{DG3-me8H.js → B8m3-qrW.js} +1 -1
  20. package/web/app/immutable/chunks/{YQwkPi_0.js → B97l6Xkk.js} +1 -1
  21. package/web/app/immutable/chunks/{Cp-4w4r1.js → B9NjB9vD.js} +1 -1
  22. package/web/app/immutable/chunks/{DPk2fLxi.js → B9R2bql6.js} +1 -1
  23. package/web/app/immutable/chunks/{Cr5mKkdD.js → B9ZgGXDm.js} +1 -1
  24. package/web/app/immutable/chunks/{CT8vPg_p.js → BAtAwQ72.js} +2 -2
  25. package/web/app/immutable/chunks/{D5Jk5CWk.js → BB5TUToP.js} +2 -2
  26. package/web/app/immutable/chunks/{DGU9U1O6.js → BBfR26V0.js} +1 -1
  27. package/web/app/immutable/chunks/{C4l6men1.js → BCw-LKCu.js} +1 -1
  28. package/web/app/immutable/chunks/{WYNXUtt9.js → BDQvAsU6.js} +1 -1
  29. package/web/app/immutable/chunks/{DDvFH8QS.js → BDRM-DVo.js} +1 -1
  30. package/web/app/immutable/chunks/{D9T_0Eev.js → BE3g5vcj.js} +3 -3
  31. package/web/app/immutable/chunks/{KWtYfwVq.js → BE4DZU9i.js} +1 -1
  32. package/web/app/immutable/chunks/{C3JJkOFb.js → BEGGqaof.js} +1 -1
  33. package/web/app/immutable/chunks/{CyvzL5p8.js → BFO-Le8U.js} +3 -3
  34. package/web/app/immutable/chunks/BGSmaq6H.js +1 -0
  35. package/web/app/immutable/chunks/{K0WiFC8Y.js → BJEFEyAm.js} +1 -1
  36. package/web/app/immutable/chunks/{CEyWnfg4.js → BJIUXUAo.js} +1 -1
  37. package/web/app/immutable/chunks/{B_JGVEqN.js → BKGQPtRi.js} +1 -1
  38. package/web/app/immutable/chunks/BPFSAjsd.js +411 -0
  39. package/web/app/immutable/chunks/{CV17KbhT.js → BQ5x_RaT.js} +1 -1
  40. package/web/app/immutable/chunks/{B26ZHg3s.js → BRCr02in.js} +1 -1
  41. package/web/app/immutable/chunks/{CHIxjTWu.js → BS1zON0P.js} +1 -1
  42. package/web/app/immutable/chunks/{kkKMJ9w9.js → BS5e_kKu.js} +1 -1
  43. package/web/app/immutable/chunks/{CpwS8V1F.js → BS9LmSp_.js} +1 -1
  44. package/web/app/immutable/chunks/{CwqJ7uz4.js → BSMi55yC.js} +1 -1
  45. package/web/app/immutable/chunks/{BBcnUEuQ.js → BSpgPPjp.js} +1 -1
  46. package/web/app/immutable/chunks/{6JlgfFWd.js → BT6sDnDt.js} +1 -1
  47. package/web/app/immutable/chunks/{BmaG8vdR.js → BTE0066U.js} +1 -1
  48. package/web/app/immutable/chunks/{BRScUzfU.js → BUF0WvAS.js} +1 -1
  49. package/web/app/immutable/chunks/{CUgl7USU.js → BUPWY1pO.js} +1 -1
  50. package/web/app/immutable/chunks/{Cnkux63v.js → BVBh582U.js} +1 -1
  51. package/web/app/immutable/chunks/{BSKVcPN7.js → BVhnyyZ7.js} +1 -1
  52. package/web/app/immutable/chunks/{CH6Im5iM.js → BYfDvU8j.js} +1 -1
  53. package/web/app/immutable/chunks/{Ci6PI5sn.js → Bc4EBjSN.js} +1 -1
  54. package/web/app/immutable/chunks/{CiHhUIjb.js → BdWMbiFk.js} +1 -1
  55. package/web/app/immutable/chunks/{7-WRRruG.js → BdlwjSpf.js} +1 -1
  56. package/web/app/immutable/chunks/{D9R5fzn8.js → Beq_QLuz.js} +1 -1
  57. package/web/app/immutable/chunks/{B2Ny2uiy.js → Bh3yfjRP.js} +1 -1
  58. package/web/app/immutable/chunks/{DynUeYUu.js → BhYXv0ZM.js} +1 -1
  59. package/web/app/immutable/chunks/{D3pRyooW.js → Bhul7r_Y.js} +1 -1
  60. package/web/app/immutable/chunks/{OsJD3pkm.js → Bky3Gaqa.js} +1 -1
  61. package/web/app/immutable/chunks/{B5-Plsom.js → BlVpCoL1.js} +1 -1
  62. package/web/app/immutable/chunks/{CwCvyVGi.js → BmqZzhgO.js} +1 -1
  63. package/web/app/immutable/chunks/{Chbrtg19.js → BnnKw3Va.js} +1 -1
  64. package/web/app/immutable/chunks/{DmQ5G_6J.js → Bo0PodRV.js} +1 -1
  65. package/web/app/immutable/chunks/{Cxc8q3rR.js → BonA_mfc.js} +1 -1
  66. package/web/app/immutable/chunks/{BuyrOC4V.js → Bp6DusVC.js} +1 -1
  67. package/web/app/immutable/chunks/{DIIj7EWA.js → BpFxCD0b.js} +1 -1
  68. package/web/app/immutable/chunks/{DqtLBCnq.js → BqRQBnTW.js} +1 -1
  69. package/web/app/immutable/chunks/{JvFe2B29.js → BuM8LV7z.js} +1 -1
  70. package/web/app/immutable/chunks/{BM39k1x6.js → BusD2v6a.js} +1 -1
  71. package/web/app/immutable/chunks/{DF15jnSX.js → BvByaKKp.js} +1 -1
  72. package/web/app/immutable/chunks/{z4O7yNZ6.js → BvvIG-FE.js} +1 -1
  73. package/web/app/immutable/chunks/{Bhyo7hBL.js → Bvwrya09.js} +1 -1
  74. package/web/app/immutable/chunks/{RV6uszBL.js → Bw-Zu1Zf.js} +1 -1
  75. package/web/app/immutable/chunks/{Dl1AOLZu.js → BwFe8eI9.js} +1 -1
  76. package/web/app/immutable/chunks/{Dr6-g-BO.js → Bwa2n5jC.js} +1 -1
  77. package/web/app/immutable/chunks/{QzxpbvSo.js → BwweojP5.js} +1 -1
  78. package/web/app/immutable/chunks/{CnDgS0vt.js → ByaJIEgQ.js} +1 -1
  79. package/web/app/immutable/chunks/{BZCcX8wj.js → ByvcSsIj.js} +2 -2
  80. package/web/app/immutable/chunks/{Bz80vYvX.js → BzXQ5SMs.js} +1 -1
  81. package/web/app/immutable/chunks/{CPnqf2bo.js → C13CRqsS.js} +1 -1
  82. package/web/app/immutable/chunks/{CAGrRNbp.js → C1SGWBXH.js} +1 -1
  83. package/web/app/immutable/chunks/{B4Yz29Q3.js → C2RnxEnO.js} +1 -1
  84. package/web/app/immutable/chunks/{DcraaizU.js → C3KgmGxd.js} +1 -1
  85. package/web/app/immutable/chunks/{Dd_KPYBw.js → C6Af0QaF.js} +1 -1
  86. package/web/app/immutable/chunks/{sFief-xo.js → C7MFACZg.js} +1 -1
  87. package/web/app/immutable/chunks/{DMEIbJII.js → C7b3vXLD.js} +1 -1
  88. package/web/app/immutable/chunks/{BMTanQ2Z.js → C8OXQeb2.js} +1 -1
  89. package/web/app/immutable/chunks/{Bb-kpHQF.js → C8PR5GO9.js} +1 -1
  90. package/web/app/immutable/chunks/C9DStJW1.js +1 -0
  91. package/web/app/immutable/chunks/{5az3n8fR.js → C9iwh4F-.js} +1 -1
  92. package/web/app/immutable/chunks/{CwOdvmTo.js → CA5vNvRD.js} +3 -3
  93. package/web/app/immutable/chunks/{CnFZbWXv.js → CA6H1-bp.js} +1 -1
  94. package/web/app/immutable/chunks/{B6m0Dypi.js → CBQrOO2t.js} +1 -1
  95. package/web/app/immutable/chunks/{Bhq56Jsu.js → CCAtqaSn.js} +1 -1
  96. package/web/app/immutable/chunks/{CREbzS7Z.js → CCSQmeuF.js} +1 -1
  97. package/web/app/immutable/chunks/{CCzPC_cB.js → CCyGGl6b.js} +1 -1
  98. package/web/app/immutable/chunks/{CoSEZL3s.js → CDcxODgf.js} +1 -1
  99. package/web/app/immutable/chunks/{CAUJiTuz.js → CDtaIFAl.js} +1 -1
  100. package/web/app/immutable/chunks/{Csqi0oV3.js → CEqrck_t.js} +1 -1
  101. package/web/app/immutable/chunks/{B2Q_FC4n.js → CGJ5yTzR.js} +3 -3
  102. package/web/app/immutable/chunks/{BkcCJyDK.js → CH7HNVC2.js} +1 -1
  103. package/web/app/immutable/chunks/{DLt9OoMP.js → CJItvMq2.js} +1 -1
  104. package/web/app/immutable/chunks/{By2YlE-l.js → CLX81MHV.js} +1 -1
  105. package/web/app/immutable/chunks/{BOPrepKH.js → COmspkQo.js} +1 -1
  106. package/web/app/immutable/chunks/{9qqz3Jr0.js → CPNOsHfj.js} +1 -1
  107. package/web/app/immutable/chunks/{CA-b7pAY.js → CPav-V5t.js} +2 -2
  108. package/web/app/immutable/chunks/{C5fxud9g.js → CPmXQBUf.js} +1 -1
  109. package/web/app/immutable/chunks/{BrL12o40.js → CQClkuxa.js} +1 -1
  110. package/web/app/immutable/chunks/{BQCtWEZ2.js → CRFyRwf-.js} +1 -1
  111. package/web/app/immutable/chunks/{CHUYHKuh.js → CRIoGx5T.js} +1 -1
  112. package/web/app/immutable/chunks/{CbB6SI0i.js → CRm25OCR.js} +1 -1
  113. package/web/app/immutable/chunks/{mFWmuyR-.js → CS6als-f.js} +1 -1
  114. package/web/app/immutable/chunks/{CfDqTHT1.js → CSzXeH2S.js} +1 -1
  115. package/web/app/immutable/chunks/{DHkcvVzr.js → CTkkv_Ih.js} +1 -1
  116. package/web/app/immutable/chunks/{DSs6r6NG.js → CUiYYsIq.js} +1 -1
  117. package/web/app/immutable/chunks/{DR_b4dt8.js → CUmvnJK5.js} +1 -1
  118. package/web/app/immutable/chunks/{DQpGArF7.js → CVx5OKWy.js} +1 -1
  119. package/web/app/immutable/chunks/{DISm8kek.js → CWS5g6aA.js} +1 -1
  120. package/web/app/immutable/chunks/{CGmYraIa.js → CWfjuhY2.js} +1 -1
  121. package/web/app/immutable/chunks/{CRXlvdEs.js → CWtyXmQ4.js} +1 -1
  122. package/web/app/immutable/chunks/{CWXVdpgZ.js → CXygwMkb.js} +1 -1
  123. package/web/app/immutable/chunks/{pXrAh3i2.js → CY56l_5k.js} +1 -1
  124. package/web/app/immutable/chunks/{B1lpukIv.js → CZfU7DE3.js} +1 -1
  125. package/web/app/immutable/chunks/{Ao0jjYj2.js → CbSZGuz9.js} +1 -1
  126. package/web/app/immutable/chunks/{DFKhOU69.js → Cc0763mU.js} +1 -1
  127. package/web/app/immutable/chunks/{DidHgSQp.js → CcBmcC9f.js} +2 -2
  128. package/web/app/immutable/chunks/{D59tCG3q.js → CcMCIG6E.js} +2 -2
  129. package/web/app/immutable/chunks/{qWgJ-CUF.js → CccfsETL.js} +2 -2
  130. package/web/app/immutable/chunks/{BDeGl6ee.js → CdLJ0-dH.js} +1 -1
  131. package/web/app/immutable/chunks/{-CpNnXIW.js → CdtwTpzR.js} +1 -1
  132. package/web/app/immutable/chunks/{DQNtbVVY.js → Cdw7QKyr.js} +3 -3
  133. package/web/app/immutable/chunks/{C9N7yhqm.js → Ce-va2I0.js} +1 -1
  134. package/web/app/immutable/chunks/{CK543FRe.js → CeHL-3WK.js} +1 -1
  135. package/web/app/immutable/chunks/{D5al-p9o.js → CewZlXwy.js} +1 -1
  136. package/web/app/immutable/chunks/{C22cBcHz.js → Ch9YoFhc.js} +1 -1
  137. package/web/app/immutable/chunks/{COofQgO0.js → ChHRVjww.js} +1 -1
  138. package/web/app/immutable/chunks/{D__sU8Ug.js → CiNmS1jZ.js} +1 -1
  139. package/web/app/immutable/chunks/{BlzuDW6O.js → CjrqEuvI.js} +1 -1
  140. package/web/app/immutable/chunks/{D49mWFig.js → CnPYlvZC.js} +1 -1
  141. package/web/app/immutable/chunks/{ByP-EusE.js → CngTEvgU.js} +1 -1
  142. package/web/app/immutable/chunks/{DeFlL2nh.js → CorT7tdR.js} +1 -1
  143. package/web/app/immutable/chunks/{9GL-RXJZ.js → Cp4SiU7R.js} +1 -1
  144. package/web/app/immutable/chunks/{DUTvR2si.js → CpK0xLH4.js} +1 -1
  145. package/web/app/immutable/chunks/CpT48V2z.js +1 -0
  146. package/web/app/immutable/chunks/{jyQWudgn.js → Cq97NFfR.js} +1 -1
  147. package/web/app/immutable/chunks/{BczcQRsN.js → CqRvL4xi.js} +1 -1
  148. package/web/app/immutable/chunks/{DvUsJK3H.js → Ct0fN4Lt.js} +1 -1
  149. package/web/app/immutable/chunks/{DJcR4XQR.js → CtzbB_EQ.js} +1 -1
  150. package/web/app/immutable/chunks/{CjpWOZGa.js → Cu9dGfYE.js} +1 -1
  151. package/web/app/immutable/chunks/{DJqiMUht.js → Cv-fAWZf.js} +1 -1
  152. package/web/app/immutable/chunks/{CU15H7o_.js → Cx394IAH.js} +1 -1
  153. package/web/app/immutable/chunks/{Bx1P9uW7.js → CxR-pcVt.js} +1 -1
  154. package/web/app/immutable/chunks/{CTgYTdXw.js → Cz3WzTlQ.js} +1 -1
  155. package/web/app/immutable/chunks/{23FyIn6O.js → CzK_7_Jd.js} +1 -1
  156. package/web/app/immutable/chunks/{BTXzEcFX.js → D-j7vD5Z.js} +1 -1
  157. package/web/app/immutable/chunks/{CAUle5iU.js → D0DIeAXH.js} +1 -1
  158. package/web/app/immutable/chunks/{CiKoEJ2m.js → D0qhIm1r.js} +1 -1
  159. package/web/app/immutable/chunks/{CeoBhFo7.js → D179JMBI.js} +1 -1
  160. package/web/app/immutable/chunks/{Cgz4dZpP.js → D5ocbEo-.js} +1 -1
  161. package/web/app/immutable/chunks/{fCtMtGYt.js → D6EyZ2rd.js} +1 -1
  162. package/web/app/immutable/chunks/{DoB-G8kB.js → D6H34kDj.js} +1 -1
  163. package/web/app/immutable/chunks/{aWBSU8IQ.js → D7KhILhs.js} +1 -1
  164. package/web/app/immutable/chunks/{CR5XXYcE.js → D8MIwtpL.js} +1 -1
  165. package/web/app/immutable/chunks/{DyreqWqr.js → D8cNe_33.js} +1 -1
  166. package/web/app/immutable/chunks/{CzxEKNiF.js → D9gMMVdB.js} +1 -1
  167. package/web/app/immutable/chunks/{JiW1DfLK.js → DA3tGWzX.js} +1 -1
  168. package/web/app/immutable/chunks/{CLMwPQBQ.js → DDDvNwR-.js} +1 -1
  169. package/web/app/immutable/chunks/{CDh2mZdS.js → DEQnE_KB.js} +1 -1
  170. package/web/app/immutable/chunks/{DcU8bi_n.js → DEsM7h8K.js} +2 -2
  171. package/web/app/immutable/chunks/{DMudvlKI.js → DFNKkiho.js} +4 -4
  172. package/web/app/immutable/chunks/{DcPZfWKB.js → DFRVxmWf.js} +1 -1
  173. package/web/app/immutable/chunks/{Dgo57zmq.js → DHMxSQaO.js} +1 -1
  174. package/web/app/immutable/chunks/{CIxnaBAb.js → DIME5LWK.js} +2 -2
  175. package/web/app/immutable/chunks/{BLtLj2yz.js → DIxibpTv.js} +1 -1
  176. package/web/app/immutable/chunks/{KaOLys0u.js → DJZIHUd7.js} +1 -1
  177. package/web/app/immutable/chunks/{HiIoMspb.js → DLPlXnVY.js} +1 -1
  178. package/web/app/immutable/chunks/{1-MeqddK.js → DL__HI6l.js} +1 -1
  179. package/web/app/immutable/chunks/{k48f0Jn8.js → DMOXpjfz.js} +1 -1
  180. package/web/app/immutable/chunks/{BLfqsc2a.js → DNup87JQ.js} +1 -1
  181. package/web/app/immutable/chunks/{B7pblHOt.js → DON9zoQ1.js} +1 -1
  182. package/web/app/immutable/chunks/{CwqyVbqi.js → DP31pjuo.js} +3 -3
  183. package/web/app/immutable/chunks/{Bpi8OSTE.js → DQe_5JbW.js} +1 -1
  184. package/web/app/immutable/chunks/{BFfRQORP.js → DRMe5Ypb.js} +1 -1
  185. package/web/app/immutable/chunks/{DoJ49Zrl.js → DTNrtzyx.js} +1 -1
  186. package/web/app/immutable/chunks/{Q1bO23Hj.js → DTbyG794.js} +1 -1
  187. package/web/app/immutable/chunks/{DWRtOXBU.js → DTco_120.js} +1 -1
  188. package/web/app/immutable/chunks/{S3jMTv3a.js → DUcJILSg.js} +1 -1
  189. package/web/app/immutable/chunks/{Cxmepjfl.js → DWjpzYNk.js} +1 -1
  190. package/web/app/immutable/chunks/{BFHmbbvG.js → DY9w61PC.js} +6 -6
  191. package/web/app/immutable/chunks/{CiRkFhK8.js → DYzxLuOL.js} +1 -1
  192. package/web/app/immutable/chunks/{CKTB5KRw.js → D_R1vNH8.js} +1 -1
  193. package/web/app/immutable/chunks/{DF54qNJU.js → D_YMc8vN.js} +1 -1
  194. package/web/app/immutable/chunks/{BGeImWEk.js → D_jEt7ej.js} +1 -1
  195. package/web/app/immutable/chunks/{BVwQph9_.js → DaTkisKB.js} +1 -1
  196. package/web/app/immutable/chunks/{DxmPtFKv.js → DaTwSOqs.js} +1 -1
  197. package/web/app/immutable/chunks/{DE8II0cx.js → DbB491_u.js} +1 -1
  198. package/web/app/immutable/chunks/{BWQPB65O.js → DbPBKS19.js} +1 -1
  199. package/web/app/immutable/chunks/{BHgSQJqT.js → Dbqo6rfT.js} +1 -1
  200. package/web/app/immutable/chunks/{TPru2I57.js → DcrCEeFN.js} +1 -1
  201. package/web/app/immutable/chunks/{0R5VEpaM.js → DdU2snxg.js} +4 -4
  202. package/web/app/immutable/chunks/{CUZpLDKB.js → DdYVblGk.js} +1 -1
  203. package/web/app/immutable/chunks/DejjV5ft.js +1 -0
  204. package/web/app/immutable/chunks/{D3tqOSzT.js → DepS1LOg.js} +1 -1
  205. package/web/app/immutable/chunks/{DW8fwVBf.js → DfINI0LK.js} +1 -1
  206. package/web/app/immutable/chunks/{QeZhJHLb.js → Dgvdn_ax.js} +1 -1
  207. package/web/app/immutable/chunks/{CktgkomQ.js → DhXSKt_a.js} +1 -1
  208. package/web/app/immutable/chunks/{B7hWIBzm.js → Dhs7RSq9.js} +1 -1
  209. package/web/app/immutable/chunks/{CyinuwPx.js → DivmpPFQ.js} +1 -1
  210. package/web/app/immutable/chunks/{DOhHP999.js → DjAFd7Fr.js} +1 -1
  211. package/web/app/immutable/chunks/{l7sDKa65.js → Dk9lUzSs.js} +1 -1
  212. package/web/app/immutable/chunks/{C3jMXj_V.js → DkQdSPDN.js} +1 -1
  213. package/web/app/immutable/chunks/{DEr2A_-h.js → DlnCrS3y.js} +2 -2
  214. package/web/app/immutable/chunks/{DBYe3Dcp.js → DmtYsVlu.js} +2 -2
  215. package/web/app/immutable/chunks/{BM2ubpAw.js → DoFGyuPK.js} +1 -1
  216. package/web/app/immutable/chunks/{C5tJUrGJ.js → DotCIVLI.js} +1 -1
  217. package/web/app/immutable/chunks/{BOVldAsb.js → Dp0kLnIL.js} +1 -1
  218. package/web/app/immutable/chunks/{Dk7Kxi97.js → DqCgFTqN.js} +1 -1
  219. package/web/app/immutable/chunks/{uyQciu7h.js → DuFY1gwd.js} +4 -4
  220. package/web/app/immutable/chunks/{BT8mEFV6.js → DuYgHIqV.js} +1 -1
  221. package/web/app/immutable/chunks/{BJCm9MUD.js → Dusq2uGc.js} +1 -1
  222. package/web/app/immutable/chunks/{zXLHCuiE.js → DvEcqVUt.js} +1 -1
  223. package/web/app/immutable/chunks/{B28HQLvX.js → DvdITStP.js} +1 -1
  224. package/web/app/immutable/chunks/{Dt_7lHy8.js → Dvzvnzzu.js} +1 -1
  225. package/web/app/immutable/chunks/{Cq8_4net.js → DznISJQO.js} +1 -1
  226. package/web/app/immutable/chunks/{DhTLwmro.js → EK8GFErl.js} +1 -1
  227. package/web/app/immutable/chunks/{C2tSFTTb.js → FS0kRzLP.js} +1 -1
  228. package/web/app/immutable/chunks/Fcr7AvC-.js +1 -0
  229. package/web/app/immutable/chunks/{Byobtdo1.js → G_kSYo3Y.js} +1 -1
  230. package/web/app/immutable/chunks/{BKKCpqXK.js → H8hIaDaV.js} +2 -2
  231. package/web/app/immutable/chunks/{CaX8Mme7.js → KPBWxwIA.js} +1 -1
  232. package/web/app/immutable/chunks/{GwtGeFMJ.js → KRACSBb9.js} +1 -1
  233. package/web/app/immutable/chunks/{DupTZXsI.js → KvfW-q1N.js} +1 -1
  234. package/web/app/immutable/chunks/{D5tDAzIo.js → MFTfhUYi.js} +1 -1
  235. package/web/app/immutable/chunks/{BS9WBIBb.js → O5ZlQHf9.js} +1 -1
  236. package/web/app/immutable/chunks/{ChYLETZB.js → OqslD7bF.js} +1 -1
  237. package/web/app/immutable/chunks/{DXXFBdjF.js → OuI4JmWC.js} +1 -1
  238. package/web/app/immutable/chunks/{BXwdb0J5.js → PejVYY2W.js} +3 -3
  239. package/web/app/immutable/chunks/{C9wxB2bb.js → QKQvZF-2.js} +2 -2
  240. package/web/app/immutable/chunks/R3fZBk-k.js +1 -0
  241. package/web/app/immutable/chunks/{BNYZa6GV.js → Rq6GuI3F.js} +1 -1
  242. package/web/app/immutable/chunks/{BcdTbj6d.js → RqSv1iWX.js} +1 -1
  243. package/web/app/immutable/chunks/{Xgzr3BTD.js → T6UBEOFc.js} +1 -1
  244. package/web/app/immutable/chunks/{BpezAJRw.js → TdGvVwuC.js} +1 -1
  245. package/web/app/immutable/chunks/{DSZbBNDD.js → Tgw7Kdvt.js} +1 -1
  246. package/web/app/immutable/chunks/{P7zPRuFC.js → U5o8u-di.js} +1 -1
  247. package/web/app/immutable/chunks/{BUSErGiB.js → UWtWVoQE.js} +1 -1
  248. package/web/app/immutable/chunks/{BCLYeYwk.js → W7uazUja.js} +1 -1
  249. package/web/app/immutable/chunks/{CDUYzZ2W.js → WWDClKTE.js} +1 -1
  250. package/web/app/immutable/chunks/{DJSvqrCI.js → WWq3hijy.js} +1 -1
  251. package/web/app/immutable/chunks/{B9Nn4kQr.js → Xr-aTNRN.js} +1 -1
  252. package/web/app/immutable/chunks/{DlljGo_I.js → Y8hdNZSZ.js} +1 -1
  253. package/web/app/immutable/chunks/{Dh-DCh2Y.js → YsAO4v_N.js} +1 -1
  254. package/web/app/immutable/chunks/{BB2vaoZ2.js → ZIePA90q.js} +3 -3
  255. package/web/app/immutable/chunks/{C-nTKxY9.js → ZfkZCfTr.js} +1 -1
  256. package/web/app/immutable/chunks/{CLvqghA8.js → ZmAQurQV.js} +1 -1
  257. package/web/app/immutable/chunks/{BU3y3Xes.js → _IjN0Lbt.js} +1 -1
  258. package/web/app/immutable/chunks/{DnzDw_9l.js → a3O-Ns1M.js} +1 -1
  259. package/web/app/immutable/chunks/{Em5CdgqH.js → aoX2v33V.js} +4 -4
  260. package/web/app/immutable/chunks/{C00PRSTi.js → b7gnFN68.js} +1 -1
  261. package/web/app/immutable/chunks/{iQDlfKDR.js → cD292w1o.js} +1 -1
  262. package/web/app/immutable/chunks/{COo5pTrI.js → ciQFmiC4.js} +1 -1
  263. package/web/app/immutable/chunks/{ClaP_sir.js → dvKmN4h6.js} +1 -1
  264. package/web/app/immutable/chunks/{D7QFmXLb.js → f0WUpIfB.js} +1 -1
  265. package/web/app/immutable/chunks/{Crey45Oa.js → f5b-J-bi.js} +1 -1
  266. package/web/app/immutable/chunks/{ZX798KkU.js → gKdztwD8.js} +1 -1
  267. package/web/app/immutable/chunks/{BdhKX9ZN.js → gNR_yDDX.js} +1 -1
  268. package/web/app/immutable/chunks/{BAMJ8Hnj.js → gX9ZnDRD.js} +1 -1
  269. package/web/app/immutable/chunks/{BVUW22uN.js → gXHlCg5O.js} +1 -1
  270. package/web/app/immutable/chunks/{axwUS21u.js → ghzRmqKs.js} +1 -1
  271. package/web/app/immutable/chunks/{FM3MDwzB.js → gocm4HZf.js} +1 -1
  272. package/web/app/immutable/chunks/{SdVpHK7d.js → i2Q0D3-m.js} +1 -1
  273. package/web/app/immutable/chunks/{CdTSfppl.js → iCTyujt5.js} +1 -1
  274. package/web/app/immutable/chunks/{IxxdIKNN.js → iMqZaR5X.js} +1 -1
  275. package/web/app/immutable/chunks/{BT5iyspK.js → iNacp7Sr.js} +1 -1
  276. package/web/app/immutable/chunks/{BjGqF2I6.js → iViWtmHm.js} +1 -1
  277. package/web/app/immutable/chunks/{D3JNbQ4D.js → jphlY6bT.js} +1 -1
  278. package/web/app/immutable/chunks/{CEA7jD1C.js → koUs6Gjt.js} +1 -1
  279. package/web/app/immutable/chunks/{rwibDzZr.js → l3Y4i65_.js} +1 -1
  280. package/web/app/immutable/chunks/{BTvJ4T_4.js → lK1e5NlM.js} +1 -1
  281. package/web/app/immutable/chunks/{Cd-qmx8U.js → oM2TfoNE.js} +1 -1
  282. package/web/app/immutable/chunks/{Di3gErxh.js → pQalwNsE.js} +1 -1
  283. package/web/app/immutable/chunks/{DWBUvNGh.js → r4dmBxo_.js} +1 -1
  284. package/web/app/immutable/chunks/{BU9me3Pg.js → rmHQzJ1a.js} +1 -1
  285. package/web/app/immutable/chunks/s_T1Uukt.js +1 -0
  286. package/web/app/immutable/chunks/{Cn-Afla1.js → u_H5ILVa.js} +1 -1
  287. package/web/app/immutable/chunks/{bJK6npyT.js → vJJtTADX.js} +1 -1
  288. package/web/app/immutable/chunks/{BSZu3BUb.js → vq6mxGLA.js} +1 -1
  289. package/web/app/immutable/chunks/{B3T1oiJl.js → x4bPxhVW.js} +1 -1
  290. package/web/app/immutable/chunks/{Cn4-Fvkn.js → x9IQ_8UO.js} +1 -1
  291. package/web/app/immutable/chunks/{n0_jgWL7.js → z2uEgbos.js} +1 -1
  292. package/web/app/immutable/entry/{app.B0HiWR5T.js → app.Dh0FLLBd.js} +3 -3
  293. package/web/app/immutable/entry/start.IMZH36aM.js +1 -0
  294. package/web/app/immutable/nodes/{0.5oa9JC3V.js → 0.BlcS-Hyh.js} +1 -1
  295. package/web/app/immutable/nodes/{1.dLY473QL.js → 1.BMTchPFq.js} +1 -1
  296. package/web/app/immutable/nodes/{10.Dg3iEVmH.js → 10.CfDNhRgU.js} +14 -14
  297. package/web/app/immutable/nodes/{11.PFTrUEsb.js → 11.CxSRkGHD.js} +1 -1
  298. package/web/app/immutable/nodes/{12.DUMat2GN.js → 12.B8s5KuaN.js} +1 -1
  299. package/web/app/immutable/nodes/{13.BEiznOPk.js → 13.J8EpPA9A.js} +1 -1
  300. package/web/app/immutable/nodes/{14.DFolVj6c.js → 14.C5TLXVit.js} +3 -3
  301. package/web/app/immutable/nodes/{15.CGEsAjgd.js → 15.DCpm4k7K.js} +1 -1
  302. package/web/app/immutable/nodes/{16.cptOJ-f9.js → 16.T0PyvW1V.js} +1 -1
  303. package/web/app/immutable/nodes/{17.BVn1LtfR.js → 17.pi-yfOoM.js} +1 -1
  304. package/web/app/immutable/nodes/{18.BLC8YWHJ.js → 18.CTVha2lA.js} +1 -1
  305. package/web/app/immutable/nodes/{19.CqJycQsd.js → 19.C2T81__z.js} +2 -2
  306. package/web/app/immutable/nodes/{2.BaR1WF3o.js → 2.1iJIAnw5.js} +4 -4
  307. package/web/app/immutable/nodes/{20.g9As4rvG.js → 20.BHRuLw4-.js} +1 -1
  308. package/web/app/immutable/nodes/{3.DwF_25Xt.js → 3.BDDby9Gq.js} +1 -1
  309. package/web/app/immutable/nodes/{4.ttOSy2Tq.js → 4.utfN0vdd.js} +1 -1
  310. package/web/app/immutable/nodes/{5.BVpoghsD.js → 5.Z6w8za6J.js} +1 -1
  311. package/web/app/immutable/nodes/6.w_k_ibWb.js +5 -0
  312. package/web/app/immutable/nodes/{7.BO56ByN2.js → 7.I-q-I1bs.js} +1 -1
  313. package/web/app/immutable/nodes/{8.CPtVgnSI.js → 8.BgjULPKU.js} +1 -1
  314. package/web/app/immutable/nodes/9.DOkmR0cl.js +14 -0
  315. package/web/app/version.json +1 -1
  316. package/web/generated/paraglide.js +49 -49
  317. package/web/index.html +18 -18
  318. package/web/app/immutable/chunks/BaXq2aUL.js +0 -411
  319. package/web/app/immutable/chunks/Bheykcr9.js +0 -1
  320. package/web/app/immutable/chunks/C8E14ldW.js +0 -1
  321. package/web/app/immutable/chunks/CDVPwJHE.js +0 -1
  322. package/web/app/immutable/chunks/CtfEuoOH.js +0 -1
  323. package/web/app/immutable/chunks/DRuLniWc.js +0 -1
  324. package/web/app/immutable/chunks/T9rMC0YB.js +0 -1
  325. package/web/app/immutable/chunks/jlu1ZSD8.js +0 -1
  326. package/web/app/immutable/entry/start.BFcXwo9Y.js +0 -1
  327. package/web/app/immutable/nodes/6.D6pOrTxH.js +0 -5
  328. package/web/app/immutable/nodes/9.cl9L6J-I.js +0 -14
@@ -1 +1 @@
1
- var W=Object.defineProperty;var q=(n,a,r)=>a in n?W(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var S=(n,a,r)=>q(n,typeof a!="symbol"?a+"":a,r);import{t as N,bo as f,bw as R,b as T}from"./CtfEuoOH.js";import{bs as j,a7 as J,ay as K,W as s,bn as E,aA as g,be as z,b_ as V,aC as l,a5 as D,bS as P,aD as c,bA as I,c9 as y,bl as Q,bO as U}from"./3SdAC2_C.js";import{i as F}from"./DynUeYUu.js";import{s as v,f as X,g as Y}from"./B26ZHg3s.js";/* empty css */var Z=l('<g transform="translate(-2 -2)"><path d="M9.958 11.718V16.135M4.658 6.455L7.477 8.082C7.826 8.284 8.264 8.246 8.573 7.986C8.881 7.727 8.995 7.302 8.857 6.924L7.744 3.865M12.172 3.865L11.059 6.924C10.921 7.302 11.035 7.727 11.344 7.986C11.653 8.246 12.091 8.284 12.44 8.082L15.259 6.455M6.014 14.111L8.106 11.618C8.366 11.309 8.404 10.871 8.202 10.522C8.001 10.173 7.602 9.987 7.205 10.057L4 10.622M16 10.622L12.794 10.057C12.397 9.987 11.999 10.173 11.797 10.522C11.596 10.871 11.634 11.309 11.893 11.618L13.985 14.111"></path></g>'),$=l('<path d="M5.333 4.666H6C7.105 4.666 8 5.561 8 6.666V8.333M5.333 11.999H6C7.105 11.999 8 11.104 8 9.999V8.332M10.667 4.666H10C8.896 4.666 8 5.561 8 6.666V8.333M10.667 11.999H10C8.896 11.999 8 11.104 8 9.999V8.332"></path><path d="M3.667 6L2.303 6.963C1.485 7.54 1.451 8.741 2.235 9.363L3.667 10.5M12.334 6L13.698 6.963C14.515 7.54 14.549 8.741 13.766 9.363L12.334 10.5"></path>',1),ee=l('<path d="M3.667 5.75L2.303 6.713C1.485 7.29 1.451 8.491 2.235 9.113L3.667 10.25M12.334 5.75L13.698 6.713C14.515 7.29 14.549 8.491 13.765 9.113L12.334 10.25M5.5 7.756L6.441 9.688C6.818 10.46 7.928 10.43 8.262 9.638L10.5 4.333"></path>'),ae=l('<rect x="6.333" y="6.333" width="3.334" height="3.334" rx="0.334"></rect><path d="M9 3H11C12.105 3 13 3.895 13 5V7M9 13H11C12.105 13 13 12.105 13 11V9M7 3H5C3.895 3 3 3.895 3 5V7M7 13H5C3.895 13 3 12.105 3 11V9"></path>',1),re=l('<g transform="translate(1 4.468)"><path d="M4 .543L1.636 2.212C.818 2.789.784 3.99 1.568 4.612L4 6.543M10 .543L12.364 2.212C13.182 2.789 13.216 3.99 12.432 4.612L10 6.543"></path><circle cx="7" cy="3.543" r="1.25" fill="currentColor" stroke="none"></circle></g>'),te=l('<g transform="translate(.5 4)"><path d="M10 7.665H5M10 4.165H5M10 .665H5M3 2.165L1.636 3.128C.818 3.705.784 4.906 1.568 5.528L3 6.665M12 2.165L13.364 3.128C14.182 3.705 14.216 4.906 13.432 5.528L12 6.665"></path></g>'),ne=l('<g transform="translate(1 3)"><path d="M7 0V10M4 2L1.636 3.669C.818 4.246.784 5.447 1.568 6.069L4 8M10 2L12.364 3.669C13.182 4.246 13.216 5.447 12.432 6.069L10 8"></path></g>'),ie=l('<g transform="translate(1 5.335)"><path d="M6 2.665H8M0 2.665H2M12 2.665H14"></path><circle cx="4" cy="2.665" r="2"></circle><circle cx="10" cy="2.665" r="2"></circle></g>'),se=l('<g><path d="M2 5.665L3.62 1.461C3.788.982 4.219.665 4.7.665C5.183.665 5.616.98 5.79 1.457L6.043 2.154C6.363 3.038 7.616 3.031 7.926 2.144L8.165 1.461C8.333.982 8.764.665 9.246.665C9.729.665 10.162.98 10.335 1.457L12 5.665M0 5.665H14"></path><circle cx="4.5" cy="8.915" r="1.25" fill="currentColor" stroke="none"></circle><circle cx="9.5" cy="8.915" r="1.25" fill="currentColor" stroke="none"></circle></g>'),oe=l('<g transform="translate(1 3.085)"><path d="M2 5.665L3.62 1.461C3.788.982 4.219.665 4.7.665C5.183.665 5.616.98 5.79 1.457L6.043 2.154C6.363 3.038 7.616 3.031 7.926 2.144L8.165 1.461C8.333.982 8.764.665 9.246.665C9.729.665 10.162.98 10.335 1.457L12 5.665M0 5.665H14M4 9.165H10"></path></g>'),le=l('<path d="M13 4.5L10.636 6.169C9.818 6.746 9.784 7.947 10.568 8.569L13 10.5M3 4.5L5.364 6.169C6.182 6.746 6.216 7.947 5.432 8.569L3 10.5M6 11.5H10"></path>'),ce=l('<g transform="translate(4 6.5)" fill="currentColor" stroke="none"><circle cx="1.5" cy="1.5" r="1.5"></circle><circle cx="6.5" cy="1.5" r="1.5"></circle></g>');function G(n,a){if(new.target)return N({component:G,...n});j(a,!0);let r=f(a,"design",7);var u={get design(){return r()},set design(e){r(e),g()},$set:R,$on:(e,t)=>T(a,e,t)},h=J(),M=K(h);{var p=e=>{var t=Z();s(e,t)},m=e=>{var t=$();z(),s(e,t)},_=e=>{var t=ee();s(e,t)},d=e=>{var t=ae();z(),s(e,t)},b=e=>{var t=re();s(e,t)},C=e=>{var t=te();s(e,t)},L=e=>{var t=ne();s(e,t)},A=e=>{var t=ie();s(e,t)},o=e=>{var t=se();V(()=>v(t,"transform",r()==="fallback-crown"?"translate(1 2.918)":"translate(1 13.082) scale(1 -1)")),s(e,t)},w=e=>{var t=oe();s(e,t)},k=e=>{var t=le();s(e,t)},H=e=>{var t=ce();s(e,t)};F(M,e=>{r()==="coordinator"?e(p):r()==="implementor"?e(m,1):r()==="verifier"?e(_,2):r()==="pr-reviewer"?e(d,3):r()==="ui-designer"?e(b,4):r()==="chief-of-staff"?e(C,5):r()==="ralph"?e(L,6):r()==="fallback-glasses"?e(A,7):r()==="fallback-crown"||r()==="fallback-crown-inverted"?e(o,8):r()==="fallback-crown-mouth"?e(w,9):r()==="fallback-code"?e(k,10):e(H,-1)})}return s(n,h),E(u)}function de(n){let a=0;if(n.length===0)return a;for(let r=0;r<n.length;r++){const u=n.charCodeAt(r);a=(a<<5)-a+u,a=a&a}return Math.abs(a)}class fe{constructor(a){S(this,"seed");this.seed=a}next(){return this.seed=this.seed*1103515245+12345&2147483647,this.seed/2147483648}pick(a){if(a.length===0)throw new Error("Cannot pick from empty array");const r=Math.floor(this.next()*a.length);return a[r]}nextInt(a){return Math.floor(this.next()*a)}}function ge(n){return new fe(de(n))}const ve=["fallback-glasses","fallback-crown","fallback-crown-inverted","fallback-crown-mouth","fallback-code","fallback-dots"],ue=["coordinator","implementor","verifier","pr-reviewer","ui-designer","chief-of-staff","ralph"],he={coordinator:"coordinator","spec-writer":"coordinator",implementor:"implementor",verifier:"verifier",developer:"verifier","product-manager":"coordinator","maintenance-coordinator":"ralph","pr-reviewer":"pr-reviewer","ui-designer":"ui-designer","chief-of-staff":"chief-of-staff",ralph:"ralph"};function pe(n){return ge(n).pick([...ve])}function me(n){return ue.includes(n)}function Ce(n,a,r){return r&&me(r)?r:he[a??""]??pe(n)}const Le={compact:{surface:16,art:14,clearSpace:1,radius:5,ring:1,overlap:4},standard:{surface:20,art:16,clearSpace:2,radius:6,ring:1,overlap:5},emphasized:{surface:24,art:20,clearSpace:2,radius:7,ring:1,overlap:6},"card-stack":{surface:24,art:20,clearSpace:2,radius:7,ring:1,overlap:6},prominent:{surface:40,art:32,clearSpace:4,radius:12,ring:2,overlap:8}},B="standard";var Me=l("<title> </title>"),_e=l('<svg viewBox="0 0 16 16" fill="none" overflow="hidden" xmlns="http://www.w3.org/2000/svg" focusable="false" data-agent-avatar=""><!><g fill="none" stroke="currentColor" stroke-width="1.33" stroke-linecap="butt" stroke-linejoin="miter"><!></g></svg>');function be(n,a){if(new.target)return N({component:be,...n});j(a,!0);let r=f(a,"agentId",7,""),u=f(a,"specialist",7,null),h=f(a,"icon",7,null),M=f(a,"provider",7,void 0),p=f(a,"variant",7,B),m=f(a,"size",7,void 0),_=f(a,"class",7,""),d=f(a,"ariaLabel",7,void 0);const b=y(()=>(M(),Ce(r(),u(),h()))),C=y(()=>m()??Le[p()].surface),L=y(()=>m()===void 0);var A={get agentId(){return r()},set agentId(i=""){r(i),g()},get specialist(){return u()},set specialist(i=null){u(i),g()},get icon(){return h()},set icon(i=null){h(i),g()},get provider(){return M()},set provider(i=void 0){M(i),g()},get variant(){return p()},set variant(i=B){p(i),g()},get size(){return m()},set size(i=void 0){m(i),g()},get class(){return _()},set class(i=""){_(i),g()},get ariaLabel(){return d()},set ariaLabel(i=void 0){d(i),g()},$set:R,$on:(i,x)=>T(a,i,x)},o=_e();let w;var k=D(o);{var H=i=>{var x=Me(),O=Q(x,!0);V(()=>U(O,d())),s(i,x)};F(k,i=>{d()&&i(H)})}var e=P(k),t=D(e);return G(t,{get design(){return c(b)}}),I(e),I(o),V(()=>{v(o,"width",c(C)),v(o,"height",c(C)),X(o,0,`agent-avatar agent-avatar--${c(L)?"named":"legacy"} ${_()??""}`,"svelte-1vi6z9y"),v(o,"role",d()?"img":void 0),v(o,"aria-label",d()),v(o,"aria-hidden",d()?void 0:"true"),v(o,"data-avatar-variant",c(L)?p():void 0),v(o,"data-avatar-design",c(b)),w=Y(o,"",w,{width:c(L)?void 0:`${c(C)}px`,height:c(L)?void 0:`${c(C)}px`})}),s(n,o),E(A)}export{be as A,Le as a,B as d};
1
+ var W=Object.defineProperty;var q=(n,a,r)=>a in n?W(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var S=(n,a,r)=>q(n,typeof a!="symbol"?a+"":a,r);import{t as N,bo as f,bw as R,b as T}from"./Fcr7AvC-.js";import{bs as j,a7 as J,ay as K,W as s,bn as E,aA as g,be as z,b_ as V,aC as l,a5 as D,bS as P,aD as c,bA as I,c9 as y,bl as Q,bO as U}from"./3SdAC2_C.js";import{i as F}from"./BhYXv0ZM.js";import{s as v,f as X,g as Y}from"./BRCr02in.js";/* empty css */var Z=l('<g transform="translate(-2 -2)"><path d="M9.958 11.718V16.135M4.658 6.455L7.477 8.082C7.826 8.284 8.264 8.246 8.573 7.986C8.881 7.727 8.995 7.302 8.857 6.924L7.744 3.865M12.172 3.865L11.059 6.924C10.921 7.302 11.035 7.727 11.344 7.986C11.653 8.246 12.091 8.284 12.44 8.082L15.259 6.455M6.014 14.111L8.106 11.618C8.366 11.309 8.404 10.871 8.202 10.522C8.001 10.173 7.602 9.987 7.205 10.057L4 10.622M16 10.622L12.794 10.057C12.397 9.987 11.999 10.173 11.797 10.522C11.596 10.871 11.634 11.309 11.893 11.618L13.985 14.111"></path></g>'),$=l('<path d="M5.333 4.666H6C7.105 4.666 8 5.561 8 6.666V8.333M5.333 11.999H6C7.105 11.999 8 11.104 8 9.999V8.332M10.667 4.666H10C8.896 4.666 8 5.561 8 6.666V8.333M10.667 11.999H10C8.896 11.999 8 11.104 8 9.999V8.332"></path><path d="M3.667 6L2.303 6.963C1.485 7.54 1.451 8.741 2.235 9.363L3.667 10.5M12.334 6L13.698 6.963C14.515 7.54 14.549 8.741 13.766 9.363L12.334 10.5"></path>',1),ee=l('<path d="M3.667 5.75L2.303 6.713C1.485 7.29 1.451 8.491 2.235 9.113L3.667 10.25M12.334 5.75L13.698 6.713C14.515 7.29 14.549 8.491 13.765 9.113L12.334 10.25M5.5 7.756L6.441 9.688C6.818 10.46 7.928 10.43 8.262 9.638L10.5 4.333"></path>'),ae=l('<rect x="6.333" y="6.333" width="3.334" height="3.334" rx="0.334"></rect><path d="M9 3H11C12.105 3 13 3.895 13 5V7M9 13H11C12.105 13 13 12.105 13 11V9M7 3H5C3.895 3 3 3.895 3 5V7M7 13H5C3.895 13 3 12.105 3 11V9"></path>',1),re=l('<g transform="translate(1 4.468)"><path d="M4 .543L1.636 2.212C.818 2.789.784 3.99 1.568 4.612L4 6.543M10 .543L12.364 2.212C13.182 2.789 13.216 3.99 12.432 4.612L10 6.543"></path><circle cx="7" cy="3.543" r="1.25" fill="currentColor" stroke="none"></circle></g>'),te=l('<g transform="translate(.5 4)"><path d="M10 7.665H5M10 4.165H5M10 .665H5M3 2.165L1.636 3.128C.818 3.705.784 4.906 1.568 5.528L3 6.665M12 2.165L13.364 3.128C14.182 3.705 14.216 4.906 13.432 5.528L12 6.665"></path></g>'),ne=l('<g transform="translate(1 3)"><path d="M7 0V10M4 2L1.636 3.669C.818 4.246.784 5.447 1.568 6.069L4 8M10 2L12.364 3.669C13.182 4.246 13.216 5.447 12.432 6.069L10 8"></path></g>'),ie=l('<g transform="translate(1 5.335)"><path d="M6 2.665H8M0 2.665H2M12 2.665H14"></path><circle cx="4" cy="2.665" r="2"></circle><circle cx="10" cy="2.665" r="2"></circle></g>'),se=l('<g><path d="M2 5.665L3.62 1.461C3.788.982 4.219.665 4.7.665C5.183.665 5.616.98 5.79 1.457L6.043 2.154C6.363 3.038 7.616 3.031 7.926 2.144L8.165 1.461C8.333.982 8.764.665 9.246.665C9.729.665 10.162.98 10.335 1.457L12 5.665M0 5.665H14"></path><circle cx="4.5" cy="8.915" r="1.25" fill="currentColor" stroke="none"></circle><circle cx="9.5" cy="8.915" r="1.25" fill="currentColor" stroke="none"></circle></g>'),oe=l('<g transform="translate(1 3.085)"><path d="M2 5.665L3.62 1.461C3.788.982 4.219.665 4.7.665C5.183.665 5.616.98 5.79 1.457L6.043 2.154C6.363 3.038 7.616 3.031 7.926 2.144L8.165 1.461C8.333.982 8.764.665 9.246.665C9.729.665 10.162.98 10.335 1.457L12 5.665M0 5.665H14M4 9.165H10"></path></g>'),le=l('<path d="M13 4.5L10.636 6.169C9.818 6.746 9.784 7.947 10.568 8.569L13 10.5M3 4.5L5.364 6.169C6.182 6.746 6.216 7.947 5.432 8.569L3 10.5M6 11.5H10"></path>'),ce=l('<g transform="translate(4 6.5)" fill="currentColor" stroke="none"><circle cx="1.5" cy="1.5" r="1.5"></circle><circle cx="6.5" cy="1.5" r="1.5"></circle></g>');function G(n,a){if(new.target)return N({component:G,...n});j(a,!0);let r=f(a,"design",7);var u={get design(){return r()},set design(e){r(e),g()},$set:R,$on:(e,t)=>T(a,e,t)},h=J(),M=K(h);{var p=e=>{var t=Z();s(e,t)},m=e=>{var t=$();z(),s(e,t)},_=e=>{var t=ee();s(e,t)},d=e=>{var t=ae();z(),s(e,t)},b=e=>{var t=re();s(e,t)},C=e=>{var t=te();s(e,t)},L=e=>{var t=ne();s(e,t)},A=e=>{var t=ie();s(e,t)},o=e=>{var t=se();V(()=>v(t,"transform",r()==="fallback-crown"?"translate(1 2.918)":"translate(1 13.082) scale(1 -1)")),s(e,t)},w=e=>{var t=oe();s(e,t)},k=e=>{var t=le();s(e,t)},H=e=>{var t=ce();s(e,t)};F(M,e=>{r()==="coordinator"?e(p):r()==="implementor"?e(m,1):r()==="verifier"?e(_,2):r()==="pr-reviewer"?e(d,3):r()==="ui-designer"?e(b,4):r()==="chief-of-staff"?e(C,5):r()==="ralph"?e(L,6):r()==="fallback-glasses"?e(A,7):r()==="fallback-crown"||r()==="fallback-crown-inverted"?e(o,8):r()==="fallback-crown-mouth"?e(w,9):r()==="fallback-code"?e(k,10):e(H,-1)})}return s(n,h),E(u)}function de(n){let a=0;if(n.length===0)return a;for(let r=0;r<n.length;r++){const u=n.charCodeAt(r);a=(a<<5)-a+u,a=a&a}return Math.abs(a)}class fe{constructor(a){S(this,"seed");this.seed=a}next(){return this.seed=this.seed*1103515245+12345&2147483647,this.seed/2147483648}pick(a){if(a.length===0)throw new Error("Cannot pick from empty array");const r=Math.floor(this.next()*a.length);return a[r]}nextInt(a){return Math.floor(this.next()*a)}}function ge(n){return new fe(de(n))}const ve=["fallback-glasses","fallback-crown","fallback-crown-inverted","fallback-crown-mouth","fallback-code","fallback-dots"],ue=["coordinator","implementor","verifier","pr-reviewer","ui-designer","chief-of-staff","ralph"],he={coordinator:"coordinator","spec-writer":"coordinator",implementor:"implementor",verifier:"verifier",developer:"verifier","product-manager":"coordinator","maintenance-coordinator":"ralph","pr-reviewer":"pr-reviewer","ui-designer":"ui-designer","chief-of-staff":"chief-of-staff",ralph:"ralph"};function pe(n){return ge(n).pick([...ve])}function me(n){return ue.includes(n)}function Ce(n,a,r){return r&&me(r)?r:he[a??""]??pe(n)}const Le={compact:{surface:16,art:14,clearSpace:1,radius:5,ring:1,overlap:4},standard:{surface:20,art:16,clearSpace:2,radius:6,ring:1,overlap:5},emphasized:{surface:24,art:20,clearSpace:2,radius:7,ring:1,overlap:6},"card-stack":{surface:24,art:20,clearSpace:2,radius:7,ring:1,overlap:6},prominent:{surface:40,art:32,clearSpace:4,radius:12,ring:2,overlap:8}},B="standard";var Me=l("<title> </title>"),_e=l('<svg viewBox="0 0 16 16" fill="none" overflow="hidden" xmlns="http://www.w3.org/2000/svg" focusable="false" data-agent-avatar=""><!><g fill="none" stroke="currentColor" stroke-width="1.33" stroke-linecap="butt" stroke-linejoin="miter"><!></g></svg>');function be(n,a){if(new.target)return N({component:be,...n});j(a,!0);let r=f(a,"agentId",7,""),u=f(a,"specialist",7,null),h=f(a,"icon",7,null),M=f(a,"provider",7,void 0),p=f(a,"variant",7,B),m=f(a,"size",7,void 0),_=f(a,"class",7,""),d=f(a,"ariaLabel",7,void 0);const b=y(()=>(M(),Ce(r(),u(),h()))),C=y(()=>m()??Le[p()].surface),L=y(()=>m()===void 0);var A={get agentId(){return r()},set agentId(i=""){r(i),g()},get specialist(){return u()},set specialist(i=null){u(i),g()},get icon(){return h()},set icon(i=null){h(i),g()},get provider(){return M()},set provider(i=void 0){M(i),g()},get variant(){return p()},set variant(i=B){p(i),g()},get size(){return m()},set size(i=void 0){m(i),g()},get class(){return _()},set class(i=""){_(i),g()},get ariaLabel(){return d()},set ariaLabel(i=void 0){d(i),g()},$set:R,$on:(i,x)=>T(a,i,x)},o=_e();let w;var k=D(o);{var H=i=>{var x=Me(),O=Q(x,!0);V(()=>U(O,d())),s(i,x)};F(k,i=>{d()&&i(H)})}var e=P(k),t=D(e);return G(t,{get design(){return c(b)}}),I(e),I(o),V(()=>{v(o,"width",c(C)),v(o,"height",c(C)),X(o,0,`agent-avatar agent-avatar--${c(L)?"named":"legacy"} ${_()??""}`,"svelte-1vi6z9y"),v(o,"role",d()?"img":void 0),v(o,"aria-label",d()),v(o,"aria-hidden",d()?void 0:"true"),v(o,"data-avatar-variant",c(L)?p():void 0),v(o,"data-avatar-design",c(b)),w=Y(o,"",w,{width:c(L)?void 0:`${c(C)}px`,height:c(L)?void 0:`${c(C)}px`})}),s(n,o),E(A)}export{be as A,Le as a,B as d};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Cn-Afla1.js","/app/immutable/chunks/C3jMXj_V.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CtfEuoOH.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/DynUeYUu.js","/app/immutable/chunks/B26ZHg3s.js","/app/immutable/chunks/CGmYraIa.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/D9R5fzn8.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CnFZbWXv.js","/app/immutable/chunks/CT8vPg_p.js","/app/immutable/chunks/BpezAJRw.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BZ27qIg1.js","/app/immutable/chunks/DFKhOU69.js","/app/immutable/chunks/DMEIbJII.js","/app/immutable/chunks/BFfRQORP.js","/app/immutable/chunks/CiKoEJ2m.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CHIxjTWu.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/COofQgO0.js","/app/immutable/chunks/Bx1P9uW7.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/B2awO10u.js","/app/immutable/chunks/BkcCJyDK.js"])))=>i.map(i=>d[i]);
2
- var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./3SdAC2_C.js";import{bm as $s,_ as Dn}from"./CtfEuoOH.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./BBWuirRW.js";import{f as Wh}from"./CVtLV3_x.js";import{t as Hh}from"./RV6uszBL.js";import{d as Hi}from"./B0Z-1lwJ.js";import{c as Uh}from"./ChTqQfQN.js";import{s as Wt}from"./CQ409-Pj.js";import{H as Kh}from"./CT8vPg_p.js";import{JH as _t,KM as Bn,gE as qh,a$ as Vh,CN as Gh,A_ as Yh,sl as Xh}from"./CiKoEJ2m.js";import{O as An,S as Pn,J as On,B as In}from"./Bqd7fdCF.js";import{g as jh}from"./QzxpbvSo.js";import{f as Zh,l as Jh}from"./axwUS21u.js";/**
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/u_H5ILVa.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/2OP7IVCM.js","/app/immutable/chunks/CH7HNVC2.js"])))=>i.map(i=>d[i]);
2
+ var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./3SdAC2_C.js";import{bm as $s,_ as Dn}from"./Fcr7AvC-.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./BBWuirRW.js";import{f as Wh}from"./B0SSzYpD.js";import{t as Hh}from"./Bw-Zu1Zf.js";import{d as Hi}from"./B0Z-1lwJ.js";import{c as Uh}from"./ChTqQfQN.js";import{s as Wt}from"./CQ409-Pj.js";import{H as Kh}from"./BAtAwQ72.js";import{JH as _t,KM as Bn,gE as qh,a$ as Vh,CN as Gh,A_ as Yh,sl as Xh}from"./D0qhIm1r.js";import{O as An,S as Pn,J as On,B as In}from"./Bqd7fdCF.js";import{g as jh}from"./BwweojP5.js";import{f as Zh,l as Jh}from"./ghzRmqKs.js";/**
3
3
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
4
4
  * @license MIT
5
5
  *
@@ -141,6 +141,6 @@ void main() {
141
141
  `))}},df=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},uf=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},_f=0,dr=class{constructor(t){this.value=t,this.id=_f++}},ff=2,gf,ut=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new lf(t?.onListenerError??cr,this._options?.leakWarningThreshold??hf):void 0,this._perfMon=this._options?._profName?new af(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let a=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],l=new uf(`${o}. HINT: Stack shows most frequent listener (${a[1]}-times)`,a[0]);return(this._options?.onListenerError||cr)(l),Kt.None}if(this._disposed)return Kt.None;e&&(t=t.bind(e));let s=new dr(t),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=cf.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof dr?(this._deliveryQueue??=new pf,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=Ci(()=>{r?.(),this._removeListener(s)});return i instanceof xn?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*ff<=e.length){let r=0;for(let n=0;n<e.length;n++)e[n]?e[r++]=e[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(t,e){if(!t)return;let i=this._options?.onListenerError||cr;if(!i){t.value(e);return}try{t.value(e)}catch(s){i(s)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof dr)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},pf=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ph=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),mf;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof vf?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ph})})(mf||={});var vf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ph:(this._emitter||(this._emitter=new ut),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},pi="en",ur=!1,cs,bs=pi,oa=pi,Sf,Et,ri=globalThis,Ge;typeof ri.vscode<"u"&&typeof ri.vscode.process<"u"?Ge=ri.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ge=process);var wf=typeof Ge?.versions?.electron=="string",bf=wf&&Ge?.type==="renderer";if(typeof Ge=="object"){Ge.platform,Ge.platform,ur=Ge.platform==="linux",ur&&Ge.env.SNAP&&Ge.env.SNAP_REVISION,Ge.env.CI||Ge.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cs=pi,bs=pi;let t=Ge.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);cs=e.userLocale,oa=e.osLocale,bs=e.resolvedLanguage||pi,Sf=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!bf?(Et=navigator.userAgent,Et.indexOf("Windows")>=0,Et.indexOf("Macintosh")>=0,(Et.indexOf("Macintosh")>=0||Et.indexOf("iPad")>=0||Et.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ur=Et.indexOf("Linux")>=0,Et?.indexOf("Mobi")>=0,bs=globalThis._VSCODE_NLS_LANGUAGE||pi,cs=navigator.language.toLowerCase(),oa=cs):console.error("Unable to resolve platform.");var vt=Et,$t=bs,Cf;(t=>{function e(){return $t}t.value=e;function i(){return $t.length===2?$t==="en":$t.length>=3?$t[0]==="e"&&$t[1]==="n"&&$t[2]==="-":!1}t.isDefaultVariant=i;function s(){return $t==="en"}t.isDefault=s})(Cf||={});var yf=typeof ri.postMessage=="function"&&!ri.importScripts;(()=>{if(yf){let t=[];ri.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{let s=++e;t.push({id:s,callback:i}),ri.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var xf=!!(vt&&vt.indexOf("Chrome")>=0);vt&&vt.indexOf("Firefox")>=0;!xf&&vt&&vt.indexOf("Safari")>=0;vt&&vt.indexOf("Edg/")>=0;vt&&vt.indexOf("Android")>=0;function Oh(t,e=0,i){let s=setTimeout(()=>{t()},e);return Ci(()=>{clearTimeout(s)})}var kf;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(kf||={});var aa=class Qe{static fromArray(e){return new Qe(i=>{i.emitMany(e)})}static fromPromise(e){return new Qe(async i=>{i.emitMany(await e)})}static fromPromises(e){return new Qe(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new Qe(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ut,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await kn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new Qe(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return Qe.map(this,e)}static filter(e,i){return new Qe(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return Qe.filter(this,e)}static coalesce(e){return Qe.filter(e,i=>!!i)}coalesce(){return Qe.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return Qe.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};aa.EMPTY=aa.fromArray([]);var Lf=class extends Kt{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new Ts),this._linesCacheDisposables=this._register(new Ts),this._register(Ci(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Eh(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Oh(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,e){this._linesCache&&(this._linesCache[t]=e)}translateBufferLineToStringWithWrap(t,e){let i=[],s=[0],r=this._terminal.buffer.active.getLine(t);for(;r;){let n=this._terminal.buffer.active.getLine(t+1),o=n?n.isWrapped:!1,a=r.translateToString(!o&&e);if(o&&n){let l=r.getCell(r.length-1);l&&l.getCode()===0&&l.getWidth()===1&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;t++,r=n}return[i.join(""),s]}},Ef=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,e){return e?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(e):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},Mf=class{constructor(t,e){this._terminal=t,this._lineCache=e}find(t,e,i,s){if(!t||t.length===0){this._terminal.clearSelection();return}if(i>this._terminal.cols)throw new Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:e,startCol:i},n=this._findInLine(t,r,s);if(!n)for(let o=e+1;o<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=o,r.startCol=0,n=this._findInLine(t,r,s),!n);o++);return n}findNextWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===t?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(t,o,e);if(!a)for(let l=n+1;l<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);if(!a&&n!==0)for(let l=0;l<n&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(t,o,e)),a}findPreviousWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols,o=!0;this._lineCache.initLinesCache();let a={startRow:r,startCol:n},l;if(s&&(a.startRow=r=s.start.y,a.startCol=n=s.start.x,i!==t&&(l=this._findInLine(t,a,e,!1),l||(a.startRow=r=s.end.y,a.startCol=n=s.end.x))),l||(l=this._findInLine(t,a,e,o)),!l){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let h=r-1;h>=0&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);}if(!l&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let h=this._terminal.buffer.active.baseY+this._terminal.rows-1;h>=r&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);return l}_isWholeWord(t,e,i){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t-1]))&&(t+i.length===e.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t+i.length]))}_findInLine(t,e,i={},s=!1){let r=e.startRow,n=e.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){e.startCol+=this._terminal.cols;return}return e.startRow--,e.startCol+=this._terminal.cols,this._findInLine(t,e,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=t,d=a;i.regex||(c=i.caseSensitive?t:t.toLowerCase(),d=i.caseSensitive?a:a.toLowerCase());let u=-1;if(i.regex){let f=RegExp(c,i.caseSensitive?"g":"gi"),g;if(s)for(;g=f.exec(d.slice(0,h));)u=f.lastIndex-g[0].length,t=g[0],f.lastIndex-=t.length-1;else g=f.exec(d.slice(h)),g&&g[0].length>0&&(u=h+(f.lastIndex-g[0].length),t=g[0])}else s?h-c.length>=0&&(u=d.lastIndexOf(c,h-c.length)):u=d.indexOf(c,h);if(u>=0){if(i.wholeWord&&!this._isWholeWord(u,d,t))return;let f=0;for(;f<l.length-1&&u>=l[f+1];)f++;let g=f;for(;g<l.length-1&&u+t.length>=l[g+1];)g++;let C=u-l[f],L=u+t.length-l[g],D=this._stringLengthToBufferSize(r+f,C),B=this._stringLengthToBufferSize(r+g,L)-D+this._terminal.cols*(g-f);return{term:t,col:D,row:r+f,size:B}}}_stringLengthToBufferSize(t,e){let i=this._terminal.buffer.active.getLine(t);if(!i)return 0;for(let s=0;s<e;s++){let r=i.getCell(s);if(!r)break;let n=r.getChars();n.length>1&&(e-=n.length-1);let o=i.getCell(s+1);o&&o.getWidth()===0&&e++}return e}_bufferColsToStringOffset(t,e){let i=t,s=0,r=this._terminal.buffer.active.getLine(i);for(;e>0&&r;){for(let n=0;n<e&&n<this._terminal.cols;n++){let o=r.getCell(n);if(!o)break;o.getWidth()&&(s+=o.getCode()===0?1:o.getChars().length)}if(i++,r=this._terminal.buffer.active.getLine(i),r&&!r.isWrapped)break;e-=this._terminal.cols}return s}},Tf=class extends Kt{constructor(t){super(),this._terminal=t,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(Ci(()=>this.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let i of t){let s=this._createResultDecorations(i,e,!1);if(s)for(let r of s)this._storeDecoration(r,i)}}createActiveDecoration(t,e){let i=this._createResultDecorations(t,e,!0);if(i)return{decorations:i,match:t,dispose(){Ki(i)}}}clearHighlightDecorations(){Ki(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,i){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),i&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,i){let s=[],r=t.col,n=t.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;n>0;){let l=Math.min(this._terminal.cols-r,n);s.push([o,r,l]),r=0,n-=l,o++}let a=[];for(let l of s){let h=this._terminal.registerMarker(l[0]),c=this._terminal.registerDecoration({marker:h,x:l[1],width:l[2],backgroundColor:i?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(h.line)?void 0:{color:i?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(c){let d=[];d.push(h),d.push(c.onRender(u=>this._applyStyles(u,i?e.activeMatchBorder:e.matchBorder,!1))),d.push(c.onDispose(()=>Ki(d))),a.push(c)}}return a.length===0?void 0:a}},Rf=class extends Kt{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new ut)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;e<this._searchResults.length;e++){let i=this._searchResults[e];if(i.row===t.row&&i.col===t.col&&i.size===t.size)return e}return-1}fireResultsChanged(t){if(!t)return;let e=-1;this._selectedDecoration&&(e=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:e,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},Df=class extends Kt{constructor(t){super(),this._highlightTimeout=this._register(new Ts),this._lineCache=this._register(new Ts),this._state=new Ef,this._resultTracker=this._register(new Rf),this._highlightLimit=t?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(t){this._terminal=t,this._lineCache.value=new Lf(t),this._engine=new Mf(t,this._lineCache.value),this._decorationManager=new Tf(t),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Ci(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=Oh(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findNextAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let i=[],s,r=this._engine.find(t,0,0,e);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(t,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,e);this._resultTracker.updateResults(i,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(i,e.decorations)}_findNextAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}findPrevious(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findPreviousAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}_selectResult(t,e,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let s=this._decorationManager.createActiveDecoration(t,e);s&&(this._resultTracker.selectedDecoration=s)}if(!i&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.row<this._terminal.buffer.active.viewportY)){let s=t.row-this._terminal.buffer.active.viewportY;s-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(s)}return!0}};const Gt=new Xi("TerminalStateMachine");var et=(t=>(t.UNINITIALIZED="uninitialized",t.INITIALIZING="initializing",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.DISCONNECTED="disconnected",t.ERROR="error",t.DISPOSED="disposed",t))(et||{});class Bf{constructor(e){P(this,"currentState","uninitialized");P(this,"stateListeners",new Map);P(this,"transitionListeners",new Set);P(this,"errorHandlers",new Set);P(this,"transitions",[{from:["uninitialized"],to:"initializing",action:"initialize"},{from:["initializing"],to:"connecting",action:"connect"},{from:["connecting"],to:"connected",action:"connected"},{from:["disconnected","error"],to:"reconnecting",action:"reconnect"},{from:["reconnecting"],to:"connected",action:"reconnected"},{from:["connected","connecting"],to:"disconnected",action:"disconnect"},{from:["initializing","connecting","connected","reconnecting"],to:"error",action:"error"},{from:["uninitialized","initializing","connecting","connected","reconnecting","disconnected","error"],to:"disposed",action:"dispose"}]);this.terminalId=e}getState(){return this.currentState}canTransition(e){const i=this.transitions.find(s=>s.action===e&&s.from.includes(this.currentState));return!(!i||i.guard&&!i.guard())}transition(e){const i=this.transitions.find(r=>r.action===e&&r.from.includes(this.currentState));if(!i)return Gt.warn(`Invalid transition: ${e} from ${this.currentState}`),!1;if(i.guard&&!i.guard())return Gt.warn(`Guard failed for transition: ${e}`),!1;const s=this.currentState;return this.currentState=i.to,Gt.info(`Terminal ${this.terminalId}: ${s} -> ${this.currentState} (${e})`),this.notifyStateListeners(this.currentState),this.notifyTransitionListeners(s,this.currentState),!0}onStateChange(e,i){let s=this.stateListeners.get(e);return s||(s=new Set,this.stateListeners.set(e,s)),s.add(i),()=>{this.stateListeners.get(e)?.delete(i)}}onTransition(e){return this.transitionListeners.add(e),()=>{this.transitionListeners.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}reportError(e){Gt.error(`Terminal ${this.terminalId} error:`,e),this.errorHandlers.forEach(i=>{try{i(e)}catch(s){Gt.error("Error handler threw exception:",s)}}),this.currentState!=="disposed"&&this.transition("error")}isHealthy(){return["connected","connecting","reconnecting"].includes(this.currentState)}canAcceptInput(){return this.currentState==="connected"}isDisposed(){return this.currentState==="disposed"}notifyStateListeners(e){this.stateListeners.get(e)?.forEach(i=>{try{i()}catch(s){Gt.error("Error in state listener:",s)}})}notifyTransitionListeners(e,i){this.transitionListeners.forEach(s=>{try{s(e,i)}catch(r){Gt.error("Error in transition listener:",r)}})}dispose(){this.isDisposed()||this.transition("dispose"),this.stateListeners.clear(),this.transitionListeners.clear(),this.errorHandlers.clear()}}const ct=new Xi("TerminalBufferManager"),Ln="terminal-buffer-index";let Zt=null,an=0;const Af=5e3;function En(){const t=Date.now();if(Zt&&t-an<Af)return Zt;try{const e=localStorage.getItem(Ln);if(e){const i=JSON.parse(e);Zt=new Map(i.map(s=>[s.key,s.timestamp]))}else Zt=new Map}catch{Zt=new Map}return an=t,Zt}function Mn(t){try{const e=Array.from(t.entries()).map(([i,s])=>({key:i,timestamp:s}));localStorage.setItem(Ln,JSON.stringify(e)),Zt=t,an=Date.now()}catch{}}function ha(t,e){const i=En();i.set(t,e),Mn(i)}function la(t){const e=En();e.delete(t),Mn(e)}const $e=class $e{constructor(e,i){P(this,"storageKey");P(this,"fallbackStorage",new Map);this.workspaceId=e,this.terminalId=i,this.storageKey=`terminal-buffer-${e}-${i}`}async saveBuffer(e,i,s){try{const n={lines:this.trimBuffer(e),cursorX:i,cursorY:s,timestamp:Date.now(),version:$e.BUFFER_VERSION};if(await this.hasStorageSpace(n))try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),ct.debug(`Saved buffer for terminal ${this.terminalId}`),!0}catch(o){return ct.warn("localStorage failed, using fallback storage:",o),this.fallbackStorage.set(this.storageKey,n),!0}else{await this.cleanupOldBuffers();try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),!0}catch{return this.fallbackStorage.set(this.storageKey,n),!0}}}catch(r){return ct.error("Failed to save buffer:",r),!1}}async restoreBuffer(){try{const e=localStorage.getItem(this.storageKey);if(e){const s=JSON.parse(e);if(this.isValidSnapshot(s))return ct.debug(`Restored buffer for terminal ${this.terminalId}`),s;localStorage.removeItem(this.storageKey)}const i=this.fallbackStorage.get(this.storageKey);return i&&this.isValidSnapshot(i)?i:null}catch(e){return ct.error("Failed to restore buffer:",e),null}}async clearBuffer(){try{localStorage.removeItem(this.storageKey),this.fallbackStorage.delete(this.storageKey),la(this.storageKey)}catch(e){ct.error("Failed to clear buffer:",e)}}trimBuffer(e){for(;e.length>0&&!e[e.length-1].trim();)e.pop();return e.length>$e.MAX_BUFFER_SIZE&&(e=e.slice(-1e4)),e.map(i=>i.length>$e.MAX_LINE_LENGTH?`${i.substring(0,$e.MAX_LINE_LENGTH)}…`:i)}isValidSnapshot(e){return!(e.version!==$e.BUFFER_VERSION||Date.now()-e.timestamp>$e.RETENTION_PERIOD||!Array.isArray(e.lines))}async hasStorageSpace(e){try{const i=JSON.stringify(e).length;if("storage"in navigator&&"estimate"in navigator.storage){const s=await navigator.storage.estimate();return(s.quota||0)-(s.usage||0)>i+$e.STORAGE_QUOTA_BUFFER}return!0}catch{return!0}}async cleanupOldBuffers(){try{const e=[],i=Date.now(),s=En();for(const[r,n]of s)i-n>$e.RETENTION_PERIOD&&e.push(r);for(const r of e)localStorage.removeItem(r),la(r),ct.debug(`Cleaned up old buffer: ${r}`);s.size===0&&await this.rebuildBufferIndex()}catch(e){ct.error("Failed to cleanup old buffers:",e)}}async rebuildBufferIndex(){try{const e=new Map;for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);if(s?.startsWith("terminal-buffer-")&&s!==Ln)try{const r=localStorage.getItem(s);if(r){const n=JSON.parse(r);e.set(s,n.timestamp)}}catch{}}e.size>0&&(Mn(e),ct.debug(`Rebuilt buffer index with ${e.size} entries`))}catch(e){ct.error("Failed to rebuild buffer index:",e)}}getStats(){try{const e=localStorage.getItem(this.storageKey);if(e){const i=JSON.parse(e);return{size:e.length,lineCount:i.lines.length,age:Date.now()-i.timestamp}}return null}catch{return null}}};P($e,"BUFFER_VERSION",1),P($e,"MAX_BUFFER_SIZE",1e4),P($e,"MAX_LINE_LENGTH",1e3),P($e,"RETENTION_PERIOD",1440*60*1e3),P($e,"STORAGE_QUOTA_BUFFER",100*1024);let Rs=$e;const Pi=new Xi("TerminalThemeManager"),Se=class Se{constructor(e){P(this,"currentTheme");P(this,"customTerminalTheme",null);P(this,"themeObserver",null);P(this,"transitionTimeout",null);P(this,"darkModeQuery",null);P(this,"darkModeChangeHandler",null);P(this,"themeChangeHandler",null);this.container=e,this.currentTheme=this.detectSystemTheme(),this.setContainer(this.container??null),this.setupThemeObserver()}setContainer(e){this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.container&&this.container!==e&&(this.container.style.transition=""),this.container=e,this.container&&(this.container.style.backgroundColor=this.currentTheme.background||"transparent")}getCurrentTheme(){return this.currentTheme}applyTheme(e,i){const s=i||this.detectSystemTheme();if(s.name!==this.currentTheme.name)try{this.container&&(this.container.style.transition=`background-color ${Se.TRANSITION_DURATION}ms ease`),e.options.theme=s,this.container&&(this.container.style.backgroundColor=s.background||"transparent"),e.refresh(0,e.rows-1),this.currentTheme=s,Pi.debug(`Applied theme: ${s.name}`),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.container&&(this.container.style.transition="")},Se.TRANSITION_DURATION)}catch(r){Pi.error("Failed to apply theme:",r)}}detectSystemTheme(){if(this.customTerminalTheme)return this.customTerminalTheme;const e=document.documentElement.classList.contains("dark"),i=document.documentElement.classList.contains("light");if(e)return Se.DARK_THEME;if(i)return Se.LIGHT_THEME;const s=document.documentElement.getAttribute("data-theme");if(s==="dark")return Se.DARK_THEME;if(s==="light")return Se.LIGHT_THEME;const n=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return n&&this.isColorDark(n)||Hh.isDark()?Se.DARK_THEME:Se.LIGHT_THEME}isColorDark(e){const i=this.colorToRgb(e);return i?(.299*i.r+.587*i.g+.114*i.b)/255<.5:!1}colorToRgb(e){if(e.startsWith("#")){const s=e.slice(1);if(s.length===3)return{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16)};if(s.length===6)return{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16)}}const i=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);return i?{r:parseInt(i[1]),g:parseInt(i[2]),b:parseInt(i[3])}:null}setupThemeObserver(){typeof window>"u"||(this.themeObserver=new MutationObserver(e=>{for(const i of e)if(i.type==="attributes"){const s=i.attributeName;if(s==="class"||s==="data-theme"){const r=this.detectSystemTheme();r.name!==this.currentTheme.name&&(Pi.debug(`Theme change detected: ${this.currentTheme.name} -> ${r.name}`),Hi("terminal-theme-changed",{theme:r}))}}}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.darkModeChangeHandler=()=>{Pi.debug("System theme preference changed");const e=this.detectSystemTheme();e.name!==this.currentTheme.name&&Hi("terminal-theme-changed",{theme:e})},this.darkModeQuery.addEventListener("change",this.darkModeChangeHandler),this.themeChangeHandler=e=>{const i=e.detail?.isDark,s=e.detail?.terminalColors;let r;s&&Object.keys(s).length>0?(r={...i?Se.DARK_THEME:Se.LIGHT_THEME,...s,name:"custom",isDark:i},this.customTerminalTheme=r):(this.customTerminalTheme=null,r=i?Se.DARK_THEME:Se.LIGHT_THEME),(r.name!==this.currentTheme.name||s)&&(Pi.debug(`App theme changed to ${r.name}`),Hi("terminal-theme-changed",{theme:r}))},window.addEventListener("theme-changed",this.themeChangeHandler))}dispose(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.darkModeQuery&&this.darkModeChangeHandler&&(this.darkModeQuery.removeEventListener("change",this.darkModeChangeHandler),this.darkModeQuery=null,this.darkModeChangeHandler=null),this.themeChangeHandler&&(window.removeEventListener("theme-changed",this.themeChangeHandler),this.themeChangeHandler=null),this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.setContainer(null)}};P(Se,"TRANSITION_DURATION",200),P(Se,"DARK_THEME",{name:"sleek-dark",isDark:!0,background:"#0B0B0E",foreground:"#e4e4e7",cursor:"#fbbf24",cursorAccent:"#1a1a1a",selectionBackground:"#3f3f46",selectionForeground:"#F7F7F7",selectionInactiveBackground:"#27272a",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#d4d4d8",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#f4f4f5"}),P(Se,"LIGHT_THEME",{name:"sleek-light",isDark:!1,background:"#F7F7F8",foreground:"#18181b",cursor:"#f59e0b",cursorAccent:"#F7F7F7",selectionBackground:"#e4e4e7",selectionForeground:"#09090b",selectionInactiveBackground:"#f4f4f5",black:"#18181b",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#e4e4e7",brightBlack:"#71717a",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#F7F7F7"});let hn=Se;const Yt=Uh("TerminalHistoryTracker"),Jt=class Jt{constructor(){P(this,"histories",new Map);P(this,"MAX_HISTORY_SIZE",10);P(this,"MAX_OUTPUT_LENGTH",500);P(this,"STORAGE_PREFIX","terminal-history-");P(this,"_updateCounter",zh(0));P(this,"updateCounter",{subscribe:this._updateCounter.subscribe});this.loadHistories()}notifyUpdate(){this._updateCounter.update(e=>e+1)}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}getOrCreateHistory(e,i){let s=this.histories.get(e);return s||(s={terminalId:e,workspaceId:i,commands:[],currentOutput:"",isExecuting:!1},this.histories.set(e,s)),s}onCommandStart(e,i,s){const r=this.getOrCreateHistory(e,i),n=Wt(s);r.currentCommand=n,r.currentOutput="",r.isExecuting=!0,r.lastCommand=n,this.notifyUpdate(),Yt.debug(`Command started for terminal ${e}: ${n}`)}onOutput(e,i,s){const r=this.getOrCreateHistory(e,i);r.currentOutput.length<this.MAX_OUTPUT_LENGTH&&(r.currentOutput+=s,r.currentOutput.length>this.MAX_OUTPUT_LENGTH&&(r.currentOutput=`${r.currentOutput.substring(0,this.MAX_OUTPUT_LENGTH)}...`))}onCommandFinish(e,i){const s=this.getOrCreateHistory(e,i);if(s.currentCommand){const r=Wt(s.currentCommand),n={command:r,timestamp:Date.now(),output:s.currentOutput};s.commands.push(n),s.commands.length>this.MAX_HISTORY_SIZE&&(s.commands=s.commands.slice(-this.MAX_HISTORY_SIZE)),s.lastCommand=r,s.lastOutput=s.currentOutput,this.saveHistory(e,s),Yt.debug(`Command finished for terminal ${e}: ${r}`)}s.currentCommand=void 0,s.currentOutput="",s.isExecuting=!1,this.notifyUpdate()}getHistory(e){return this.histories.get(e)}getHistoriesForWorkspace(e){return Array.from(this.histories.values()).filter(i=>i.workspaceId===e)}getLastCommand(e){return this.histories.get(e)?.lastCommand}getLastOutput(e){return this.histories.get(e)?.lastOutput}saveHistory(e,i){try{const s=`${this.STORAGE_PREFIX}${e}`,r={terminalId:i.terminalId,workspaceId:i.workspaceId,commands:i.commands.slice(-5).map(n=>({...n,command:Wt(n.command)})),lastCommand:i.lastCommand?Wt(i.lastCommand):void 0,lastOutput:i.lastOutput?.substring(0,200)};localStorage.setItem(s,JSON.stringify(r))}catch(s){Yt.warn("Failed to save terminal history:",s)}}loadHistories(){try{const e=Object.keys(localStorage).filter(i=>i.startsWith(this.STORAGE_PREFIX));for(const i of e)try{const s=localStorage.getItem(i);if(s){const r=JSON.parse(s);r.terminalId&&this.histories.set(r.terminalId,{...r,currentOutput:"",isExecuting:!1,commands:r.commands||[]})}}catch(s){Yt.warn(`Failed to load terminal history for ${i}:`,s)}Yt.info(`Loaded ${this.histories.size} terminal histories from localStorage`)}catch(e){Yt.error("Failed to load terminal histories:",e)}}clearHistory(e){this.histories.delete(e);try{localStorage.removeItem(`${this.STORAGE_PREFIX}${e}`)}catch(i){Yt.warn("Failed to clear terminal history:",i)}}clearWorkspaceHistories(e){const i=[];for(const[s,r]of this.histories.entries())r.workspaceId===e&&i.push(s);for(const s of i)this.clearHistory(s)}};P(Jt,"instance");let ln=Jt;const Oi=ln.getInstance();function Pf(t,e){return setTimeout(()=>{try{t.dispose()}catch(i){if(e)e(i);else throw i}},0)}const Of=["panel.focus-next-column","panel.focus-previous-column","global.next-space-alt","global.previous-space-alt","navigation.go-to-tab","navigation.recent-agents"];function If(t,e,i,s=!1){const r=o=>An(o,e),n=s?r("navigation.go-to-device"):An("navigation.go-to-tab",e)===Pn["navigation.go-to-tab"]?Pn["navigation.go-to-device"]:null;return n&&On(t,n,i)>=0&&!In("navigation.go-to-device",t,r,i)?!0:Of.some(o=>On(t,r(o),i)>=0&&(o!=="navigation.go-to-tab"||!In(o,t,r,i)))}const $f=Df,I=new Xi("TerminalAdapter"),Ff=typeof process<"u"&&process.platform==="win32",Nf=100,Ae=class Ae{constructor(e){P(this,"xterm");P(this,"fitAddon");P(this,"searchAddon");P(this,"webLinksAddon");P(this,"webglAddon",null);P(this,"stateMachine");P(this,"bufferManager");P(this,"themeManager");P(this,"terminalId");P(this,"workspaceId");P(this,"container");P(this,"eventListeners",[]);P(this,"resizeObserver",null);P(this,"reattachFitObserver",null);P(this,"reattachFitTimer",null);P(this,"visibilityObserver",null);P(this,"wasVisible",!0);P(this,"isVisible",!0);P(this,"lastFittedSize",null);P(this,"resizeDebounceTimer",null);P(this,"bufferSaveTimer",null);P(this,"dataDisposable",null);P(this,"resizeDisposable",null);P(this,"selectionDisposable",null);P(this,"ipcCleanup",null);P(this,"themeCleanup",null);P(this,"webglContextLostCleanup",null);P(this,"isDisposed",!1);P(this,"isXtermOpened",!1);P(this,"autoReconnectTimer",null);P(this,"autoReconnectAttempts",0);P(this,"heartbeatTimer",null);P(this,"webglRecoveryAttempts",0);P(this,"exitedNormally",!1);P(this,"lastCwd");P(this,"isExecuting",!1);P(this,"startTime",Date.now());P(this,"commandBuffer","");P(this,"currentLineBuffer","");P(this,"isAtPrompt",!1);P(this,"callbacks");P(this,"terminals");this.workspaceId=e.workspaceId,this.terminalId=e.terminalId||`terminal-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,this.container=e.container,this.terminals=(e.appClient??Wh).terminals,this.callbacks={onReady:e.onReady,onExit:e.onExit,onCommandStart:e.onCommandStart,onCommandFinished:e.onCommandFinished,onCwdChanged:e.onCwdChanged,onError:e.onError,onToggleSearch:e.onToggleSearch},this.stateMachine=new Bf(this.terminalId),this.setupStateMachineListeners(),this.bufferManager=new Rs(this.workspaceId,this.terminalId),this.themeManager=new hn(this.container);const i=e.fontFamily??jh.select(_t.state);this.xterm=new au({allowProposedApi:!0,linkHandler:{activate:(s,r)=>this.handleLinkClick(r)},fontFamily:i,fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!0,cursorStyle:"block",cursorWidth:1,scrollback:1e4,allowTransparency:!0,windowsPty:Ff?{backend:"conpty"}:void 0,macOptionIsMeta:!0,rightClickSelectsWord:!0,convertEol:!0,drawBoldTextInBrightColors:!0,scrollSensitivity:1,theme:this.themeManager.getCurrentTheme()}),this.fitAddon=new cu,this.xterm.loadAddon(this.fitAddon),this.webLinksAddon=new pu((s,r)=>{this.handleLinkClick(r)}),this.xterm.loadAddon(this.webLinksAddon),this.searchAddon=new $f,this.xterm.loadAddon(this.searchAddon),this.searchAddon.onDidChangeResults(s=>{this.callbacks.onSearchResultsChange?.(s.resultIndex,s.resultCount)})}getSearchDecorations(){return{matchBackground:"#515c6a",matchBorder:"#515c6a",matchOverviewRuler:"#515c6a",activeMatchBackground:"#eab308",activeMatchBorder:"#ca8a04",activeMatchColorOverviewRuler:"#eab308"}}setupStateMachineListeners(){this.stateMachine.onTransition((e,i)=>{i===et.ERROR&&this.handleError(new Error(`Terminal entered error state from ${e}`)),(i===et.DISCONNECTED||i===et.ERROR)&&(this.stopHeartbeat(),this.exitedNormally||this.scheduleAutoReconnect()),i===et.CONNECTED&&(this.autoReconnectAttempts=0,this.cancelAutoReconnect(),this.startHeartbeat())}),this.stateMachine.onError(e=>{this.handleError(e)})}async initialize(e=!1){if(this.isDisposed)throw new Error("Cannot initialize disposed terminal");if(!this.container)throw new Error("Cannot initialize terminal without a container");const i=this.container;if(!this.stateMachine.canTransition("initialize"))throw new Error(`Cannot initialize terminal in state ${this.stateMachine.getState()}`);this.stateMachine.transition("initialize");try{this.isXtermOpened?I.warn(`[initialize] XTerm already opened for terminal ${this.terminalId}, skipping open()`):(this.xterm.open(i),this.isXtermOpened=!0,I.info(`[initialize] XTerm opened for terminal ${this.terminalId}`)),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer for light theme (better anti-aliasing)"),this.themeManager.applyTheme(this.xterm),this.fitTerminalToContainer()||(I.warn("Container has no dimensions, delaying fit"),setTimeout(()=>{this.fitTerminalToContainer()},100)),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.setupThemeChangeListener();const r=this.xterm.cols,n=this.xterm.rows,o=await this.findBackendTerminal(),a=o!==null;if(!e)if(a)try{const l=await this.terminals.getBuffer(this.terminalId,void 0,this.workspaceId);l&&(I.info(`Restoring ${l.length} bytes of buffered output from backend`),this.xterm.write(l),this.parseTerminalOutput(l))}catch(l){I.warn("Could not restore terminal buffer from backend:",l)}else{const l=await this.bufferManager.restoreBuffer();l&&(I.info("Restoring terminal buffer from local storage"),this.restoreFromSnapshot(l))}this.startBufferAutoSave(),this.stateMachine.transition("connect"),a?(this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.resize(r,n),o?.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.()):(I.debug(`[initialize] Terminal ${this.terminalId} creating new PTY`),await this.openPtyConnection(r,n)),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}catch(s){throw this.stateMachine.reportError(s),s}}async openPtyConnection(e,i){try{const s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_openFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(s){throw this.stateMachine.reportError(s),s}}async findBackendTerminal(){try{const{terminals:e}=await this.terminals.list(this.workspaceId);return e.find(i=>i.id===this.terminalId)??null}catch(e){return I.warn("Could not check terminal existence:",e),null}}async terminalExistsOnBackend(){return await this.findBackendTerminal()!==null}hideCursorOnExit(){this.isDisposed||(this.xterm.options.cursorBlink=!1,this.xterm.write("\x1B[?25l"))}restoreCursor(){this.isDisposed||(this.xterm.options.cursorBlink=!0,this.xterm.write("\x1B[?25h"))}setupXTermEventHandlers(){this.container&&(this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.resizeDisposable&&(this.resizeDisposable.dispose(),this.resizeDisposable=null),this.selectionDisposable&&(this.selectionDisposable.dispose(),this.selectionDisposable=null),this.xterm.attachCustomKeyEventHandler(e=>{const i=navigator.platform.toUpperCase().includes("MAC"),s=i?e.metaKey:e.ctrlKey;return e.metaKey&&e.key==="k"&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.clear(),!1):s&&e.key==="j"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(Bn(this.workspaceId)),!1):s&&e.key==="f"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.callbacks.onToggleSearch?.(),!1):s&&(e.key==="t"||e.key==="T")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&Hi("workspace:new-terminal",{workspaceId:this.workspaceId}),!1):s&&(e.key==="w"||e.key==="W")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(qh(this.workspaceId)),!1):If(e,_t.state.userPreferences?.shortcutOverrides??{},i,_t.state.machineRail?.enabled??!1)||s&&e.shiftKey&&!e.altKey&&(e.key==="]"||e.key==="}"||e.key==="["||e.key==="{")?!1:e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.key==="`"||e.key==="~")?(e.type==="keydown"&&(e.shiftKey||e.key==="~"?Hi("workspace:new-terminal",{workspaceId:this.workspaceId}):_t.dispatch(Bn(this.workspaceId))),!1):!0}),this.dataDisposable=this.xterm.onData(e=>{this.isDisposed||this.write(e)}),this.resizeDisposable=this.xterm.onResize(({cols:e,rows:i})=>{!this.isDisposed&&this.stateMachine.canAcceptInput()&&this.resize(e,i)}),this.selectionDisposable=this.xterm.onSelectionChange(()=>{}))}setupIpcEventHandlers(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null);let e=!1;const i=this.terminals.subscribeEvents(this.terminalId,{onData:({chunk:s})=>{e||this.isDisposed||this.stateMachine.canAcceptInput()&&(this.xterm.write(s),this.parseTerminalOutput(s))},onExit:({exitCode:s})=>{e||this.isDisposed||(this.exitedNormally=!0,this.hideCursorOnExit(),this.callbacks.onExit?.(s),this.stateMachine.transition("disconnect"))},onCwd:({cwd:s})=>{e||this.isDisposed||(this.lastCwd=s,this.callbacks.onCwdChanged?.(s))}},this.workspaceId);this.ipcCleanup=()=>{e=!0;try{i()}catch(s){I.warn("Failed to unsubscribe terminal events:",s)}}}setupResizeObserver(){if(!this.container||!this.isVisible)return;const e=this.container;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e),this.setupVisibilityObserver()}setupVisibilityObserver(){if(!this.container)return;const e=this.container;this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.visibilityObserver=new IntersectionObserver(i=>{for(const s of i){const r=s.isIntersecting;r&&!this.wasVisible&&(I.debug(`[visibility] Terminal ${this.terminalId} became visible, reconnecting ResizeObserver`),this.resizeObserver||(this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e)),this.fitTerminalToContainer()),this.wasVisible=r}}),this.visibilityObserver.observe(e)}loadWebglAddon(){this.disposeWebglAddon();try{this.webglAddon=new Z_,this.xterm.loadAddon(this.webglAddon);const e=this.xterm.element?.querySelector("canvas");if(e){const i=s=>{s.preventDefault(),I.warn(`[WebGL] Context lost for terminal ${this.terminalId}, recovering...`),!this.isDisposed&&(this.disposeWebglAddon(),setTimeout(()=>{if(this.isDisposed)return;if(!this.themeManager.getCurrentTheme().isDark){I.info("[WebGL] Skipping WebGL recovery on light theme, using Canvas renderer");return}if(this.webglRecoveryAttempts>=Ae.MAX_WEBGL_RECOVERY_ATTEMPTS){I.warn(`[WebGL] Max recovery attempts (${Ae.MAX_WEBGL_RECOVERY_ATTEMPTS}) reached for terminal ${this.terminalId}, staying on Canvas renderer`);return}this.webglRecoveryAttempts++;try{this.loadWebglAddon(),I.info(`[WebGL] Successfully recovered from context loss (attempt ${this.webglRecoveryAttempts})`)}catch(n){I.warn("[WebGL] Failed to recover from context loss, falling back to Canvas renderer:",n),this.webglAddon=null}},100))};e.addEventListener("webglcontextlost",i),this.webglContextLostCleanup=()=>{e.removeEventListener("webglcontextlost",i)}}}catch(e){I.warn("Failed to load WebGL renderer, falling back to Canvas renderer:",e),this.webglAddon=null}}disposeWebglAddon(){if(this.webglContextLostCleanup&&(this.webglContextLostCleanup(),this.webglContextLostCleanup=null),this.webglAddon){try{this.webglAddon.dispose()}catch(e){I.warn("Error disposing WebGL addon:",e)}this.webglAddon=null}}setupThemeChangeListener(){this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null);const e=i=>{const s=i.detail?.theme;s&&this.xterm&&(I.info(`[Theme] Theme changed to: ${s.name} (isDark: ${s.isDark})`),this.themeManager.applyTheme(this.xterm,s),s.isDark?this.webglAddon||this.loadWebglAddon():this.webglAddon&&(this.disposeWebglAddon(),I.info("[WebGL] Disposed WebGL addon for light theme (using Canvas renderer)")))};window.addEventListener("terminal-theme-changed",e),this.themeCleanup=()=>{window.removeEventListener("terminal-theme-changed",e)}}parseTerminalOutput(e){Oi.onOutput(this.terminalId,this.workspaceId,e),e.includes("\x1B]133;C\x07")?(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId)),this.commandBuffer="",this.isAtPrompt=!0):e.includes("\x1B]133;A\x07")&&(this.isExecuting||(this.isExecuting=!0,this.callbacks.onCommandStart?.()),this.isAtPrompt=!0,this.commandBuffer="");const i=/[\$%]\s*$/,s=/^.*[\$%]\s+(.+)$/,r=e.split(/\r?\n/);for(const o of r){const a=o.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b\][^\x1b]*\x1b\\/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x1b[=>]/g,"").replace(/\x1b[78]/g,"").replace(/\x1b[DME]/g,"").replace(/\x1b[HZ]/g,"").replace(/\x1b[c]/g,"").replace(/\[\?[0-9;]*[a-zA-Z]/g,"").replace(/\x07/g,"").replace(/\x00-\x08\x0b\x0c\x0e-\x1f/g,"").trim();if(!a||/^\[[\?0-9;]*[a-zA-Z]$/.test(a))continue;const l=a.match(s);if(l&&l[1]){const h=l[1].trim(),c=/^[a-zA-Z0-9.\/~]/.test(h);h.length>0&&!this.isExecuting&&c?(I.info(`[TerminalAdapter] Detected command from output: ${Wt(h)}`),Oi.onCommandStart(this.terminalId,this.workspaceId,h),this.isExecuting=!0,this.callbacks.onCommandStart?.()):h.length>0&&!c&&I.debug(`[TerminalAdapter] Skipping suspicious command detection: ${Wt(h)}`)}i.test(a)&&!l&&(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId),I.debug(`[TerminalAdapter] Command finished, prompt detected: ${Wt(a)}`)),this.isAtPrompt=!0,this.commandBuffer="")}const n=e.match(/\x1b\]7;file:\/\/[^/]*([^\x07]*)\x07/);if(n){const o=decodeURIComponent(n[1]);o!==this.lastCwd&&(this.lastCwd=o,this.callbacks.onCwdChanged?.(o))}}startBufferAutoSave(){this.bufferSaveTimer=setInterval(()=>{this.stateMachine?.canAcceptInput()&&this.saveBuffer()},5e3)}async saveBuffer(){try{const e=this.xterm.buffer.active,i=[];for(let s=0;s<e.length;s++){const r=e.getLine(s);r&&i.push(r.translateToString(!0))}await this.bufferManager.saveBuffer(i,e.cursorX,e.cursorY)}catch(e){I.error("Failed to save buffer:",e)}}restoreFromSnapshot(e){if(e.lines&&e.lines.length>0){this.xterm.clear();const i=[...e.lines];for(;i.length>0&&i[i.length-1].trim()==="";)i.pop();const s=/[\$>#%]\s*$/,r=/@[\w-]+/;if(i.length>0){const n=i[i.length-1],o=i.length>1?i[i.length-2]:"";if(s.test(n)&&r.test(n))i.pop();else if(s.test(n)&&n.trim().length<80)i.pop(),i.length>0&&r.test(i[i.length-1])&&i.pop();else if(i.length>=2){const a=o+n;s.test(a)&&r.test(a)&&(i.pop(),i.pop())}}for(let n=0;n<i.length;n++)n<i.length-1?this.xterm.writeln(i[n]):i[n].trim()&&this.xterm.writeln(i[n]);I.debug(`Restored terminal buffer for ${this.terminalId} with ${i.length} lines (prompt removed)`)}}getCommandFromXtermBuffer(){try{const e=this.xterm.buffer.active,i=e.cursorY+e.baseY,s=e.getLine(i);if(!s)return null;const r=s.translateToString(!0);if(!r||!r.trim())return null;const n=r.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x07/g,"").trim();if(!n)return null;const o=n.match(/^.*[\$%#❯➜]\s+(.+)$/);return o&&o[1]?o[1].trim():null}catch{return null}}write(e){if(!(this.isDisposed||!this.stateMachine.canAcceptInput())){if(e==="\r"||e===`
142
142
  `){const i=this.getCommandFromXtermBuffer(),s=i||this.commandBuffer.trim();s&&(Oi.onCommandStart(this.terminalId,this.workspaceId,s),this.isExecuting=!0,I.debug(`Command executed: ${Wt(s)}${i?" (from xterm buffer)":" (from keystroke buffer)"}`)),this.commandBuffer="",this.currentLineBuffer=""}else e===""||e==="\b"?this.commandBuffer.length>0&&(this.commandBuffer=this.commandBuffer.slice(0,-1)):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e.match(/[\x00-\x1F\x7F]/)||(this.commandBuffer+=e,this.currentLineBuffer+=e);this.terminals.write(this.terminalId,e,this.workspaceId).then(i=>{i.success||I.error(`[write] Terminal ${this.terminalId}: write failed - ${i.error}`)}).catch(i=>{I.error(`[write] Terminal ${this.terminalId}: transport error - ${i}`),this.isDisposed||this.stateMachine.reportError(i)})}}resize(e,i){this.isDisposed||!this.stateMachine.canAcceptInput()||this.terminals.resize(this.terminalId,e,i,this.workspaceId).catch(s=>{I.error("Failed to resize terminal:",s)})}focus(){!this.isDisposed&&this.isVisible&&this.xterm.focus()}blur(){this.isDisposed||this.xterm.blur()}setVisible(e){if(!(this.isDisposed||this.isVisible===e)){if(this.isVisible=e,this.wasVisible=e,!e){this.xterm.blur(),this.disconnectLayoutObservers();return}this.setupResizeObserver(),requestAnimationFrame(()=>this.fitTerminalToContainer())}}fitTerminalToContainer(){if(this.isDisposed||!this.isVisible||!this.container)return!1;const{width:e,height:i}=this.container.getBoundingClientRect();return e<=0||i<=0?!1:(this.lastFittedSize?.width===e&&this.lastFittedSize.height===i||(this.fitAddon.fit(),this.lastFittedSize={width:e,height:i}),!0)}disconnectLayoutObservers(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.visibilityObserver?.disconnect(),this.visibilityObserver=null,this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null)}fitAfterReattach(e){if(this.cancelReattachFit(),this.fitReattachedContainer(e))return;const i=new ResizeObserver(()=>{if(this.reattachFitObserver!==i){i.disconnect();return}this.hasReattachedContainerBox(e)&&(this.reattachFitTimer&&clearTimeout(this.reattachFitTimer),this.reattachFitTimer=setTimeout(()=>{this.reattachFitTimer=null,this.fitReattachedContainer(e)&&this.cancelReattachFit()},Nf))});this.reattachFitObserver=i,i.observe(e)}fitReattachedContainer(e){if(this.isDisposed||this.container!==e)return!0;if(!this.hasReattachedContainerBox(e))return!1;const{width:i,height:s}=e.getBoundingClientRect();return this.fitAddon.fit(),this.lastFittedSize={width:i,height:s},this.xterm.refresh(0,this.xterm.rows-1),!0}hasReattachedContainerBox(e){if(!this.isVisible)return!1;const{width:i,height:s}=e.getBoundingClientRect();return i>0&&s>0}cancelReattachFit(){this.reattachFitObserver?.disconnect(),this.reattachFitObserver=null,this.reattachFitTimer&&(clearTimeout(this.reattachFitTimer),this.reattachFitTimer=null)}clear(){this.isDisposed||this.xterm.clear()}async reattach(e){if(this.isDisposed||this.stateMachine.isDisposed())throw new Error("Cannot reattach disposed terminal");this.cancelAutoReconnect(),this.autoReconnectAttempts=0,this.webglRecoveryAttempts=0,this.exitedNormally=!1,this.setupIpcEventHandlers();const i=this.stateMachine.getState();if(i!==et.CONNECTED){I.info(`[reattach] Terminal ${this.terminalId} not in CONNECTED state (${i}), attempting to restore`);const n=await this.findBackendTerminal();n&&(i===et.DISCONNECTED||i===et.ERROR?(this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected")):i===et.CONNECTING&&this.stateMachine.transition("connected"),n.isExecuting===!1&&this.hideCursorOnExit(),I.info(`[reattach] Terminal ${this.terminalId} state restored to ${this.stateMachine.getState()}`))}const s=this.xterm.element;if(s){e.appendChild(s),this.container=e,this.themeManager.setContainer(e),this.disposeWebglAddon(),this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer after move (light theme)"),this.fitAfterReattach(e),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()});return}I.warn(`Could not move terminal element, recreating for terminal ${this.terminalId}`),this.container&&(this.container.innerHTML=""),this.disposeWebglAddon(),this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.container=e,this.themeManager.setContainer(e),this.isXtermOpened&&I.warn(`[reattach] XTerm was already opened for terminal ${this.terminalId}, calling open() again may cause duplicate handlers`),this.xterm.open(e),this.isXtermOpened=!0,this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer on reattach (light theme)"),this.fitAfterReattach(e),this.setupXTermEventHandlers(),this.setupResizeObserver(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}updateCallbacks(e){Object.assign(this.callbacks,e)}updateFontFamily(e){this.isDisposed||this.xterm.options.fontFamily!==e&&(this.xterm.options.fontFamily=e)}findNext(e,i){return this.searchAddon.findNext(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}findPrevious(e,i){return this.searchAddon.findPrevious(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}clearSearch(){this.searchAddon.clearDecorations()}getSelection(){return this.xterm.getSelection()}getInfo(){const e=this.bufferManager.getStats();return{id:this.terminalId,workspaceId:this.workspaceId,state:this.stateMachine.getState(),cwd:this.lastCwd,isExecuting:this.isExecuting,stats:e?{bufferSize:e.size,lineCount:e.lineCount,uptime:Date.now()-this.startTime}:void 0}}startHeartbeat(){this.heartbeatTimer||this.isDisposed||(I.debug(`[heartbeat] Starting for terminal ${this.terminalId} (every ${Ae.HEARTBEAT_INTERVAL_MS}ms)`),this.heartbeatTimer=setInterval(()=>{this.performHealthCheck()},Ae.HEARTBEAT_INTERVAL_MS))}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null,I.debug(`[heartbeat] Stopped for terminal ${this.terminalId}`))}async performHealthCheck(){if(this.isDisposed||!this.ipcCleanup||this.stateMachine.getState()!==et.CONNECTED)return;let e=null;try{const i=await Promise.race([this.terminalExistsOnBackend(),new Promise((s,r)=>{e=setTimeout(()=>r(new Error("Heartbeat timeout")),Ae.HEARTBEAT_TIMEOUT_MS)})]);if(e&&clearTimeout(e),this.isDisposed)return;i||(I.warn(`[heartbeat] Terminal ${this.terminalId}: PTY not found on backend, transitioning to DISCONNECTED`),this.stopHeartbeat(),this.stateMachine.transition("disconnect"))}catch(i){if(e&&clearTimeout(e),this.isDisposed)return;I.warn(`[heartbeat] Terminal ${this.terminalId}: health check failed:`,i),this.stopHeartbeat(),this.stateMachine.transition("disconnect")}}scheduleAutoReconnect(){if(this.isDisposed)return;if(this.autoReconnectAttempts>=Ae.MAX_RECONNECT_ATTEMPTS){I.warn(`[auto-reconnect] Terminal ${this.terminalId}: max reconnect attempts (${Ae.MAX_RECONNECT_ATTEMPTS}) reached, giving up`);return}this.cancelAutoReconnect();const e=Ae.BASE_RECONNECT_DELAY_MS*Math.pow(2,this.autoReconnectAttempts);this.autoReconnectAttempts++,I.info(`[auto-reconnect] Terminal ${this.terminalId}: scheduling attempt ${this.autoReconnectAttempts}/${Ae.MAX_RECONNECT_ATTEMPTS} in ${e}ms`),this.autoReconnectTimer=setTimeout(()=>{this.autoReconnectTimer=null,this.attemptAutoReconnect()},e)}cancelAutoReconnect(){this.autoReconnectTimer&&(clearTimeout(this.autoReconnectTimer),this.autoReconnectTimer=null)}async attemptAutoReconnect(){if(this.isDisposed)return;const e=this.stateMachine.getState();if(e!==et.DISCONNECTED&&e!==et.ERROR){I.debug(`[auto-reconnect] Terminal ${this.terminalId}: skipping, state is ${e}`);return}this.exitedNormally=!1,I.info(`[auto-reconnect] Terminal ${this.terminalId}: attempting reconnect (attempt ${this.autoReconnectAttempts})`);try{const i=await this.findBackendTerminal();if(this.isDisposed)return;i?(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY exists on backend, re-establishing connection`),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected"),this.xterm.cols&&this.xterm.rows&&this.resize(this.xterm.cols,this.xterm.rows),i.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: reconnected successfully`)):(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY not found, creating new PTY`),await this.reconnect(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: new PTY created successfully`))}catch(i){I.error(`[auto-reconnect] Terminal ${this.terminalId}: attempt ${this.autoReconnectAttempts} failed:`,i),this.scheduleAutoReconnect()}}handleError(e){I.error(`Terminal ${this.terminalId} error:`,e),this.callbacks.onError?.(e),this.isDisposed||this.xterm.writeln(`\r
143
143
  \x1B[31m${$s.terminal_adapter_errorLine_label({message:e.message})}\x1B[0m\r
144
- `)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./Cn-Afla1.js").then(s=>s.b);return{resolveBrowserLinkForOpen:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url).then(({resolveBrowserLinkForOpen:i})=>i(e)).catch(()=>({url:e})).then(i=>{Dn(async()=>{const{getPanelLayoutManager:s}=await import("./B2awO10u.js").then(r=>r.p);return{getPanelLayoutManager:s}},__vite__mapDeps([32,21,22,5,23,24,3,8,4,25,15,2,33]),import.meta.url).then(({getPanelLayoutManager:s})=>{s(this.workspaceId).openBrowserPanel(i.url,void 0,void 0,i.requestedUrl),I.debug("Opened URL in browser panel",{uri:e,resolvedUrl:i.url,workspaceId:this.workspaceId})}).catch(s=>{I.warn("Failed to open URL in browser panel, falling back to external browser",{uri:e,error:s}),Fs("shell:openExternal",{url:i.url})})})}catch(i){I.warn("Failed to handle link click",{uri:e,error:i}),Fs("shell:openExternal",{url:e})}}async reconnect(){if(this.isDisposed)throw new Error("Cannot reconnect disposed terminal");if(!this.stateMachine.canTransition("reconnect"))throw new Error(`Cannot reconnect in state ${this.stateMachine.getState()}`);this.exitedNormally=!1,this.stateMachine.transition("reconnect");try{const e=this.xterm.cols,i=this.xterm.rows,s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_reconnectFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(e){throw this.stateMachine.reportError(e),e}}detach(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null),this.stopHeartbeat(),this.cancelAutoReconnect(),this.cancelReattachFit(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null);const e=this.xterm.element;e&&e.parentNode&&e.parentNode.removeChild(e),this.themeManager.setContainer(null),this.container=null}dispose(e={}){if(!(this.isDisposed||this.stateMachine.isDisposed())){if(this.isDisposed=!0,this.cancelAutoReconnect(),this.stopHeartbeat(),this.cancelReattachFit(),this.stateMachine.transition("dispose"),this.saveBuffer().catch(()=>{}),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.bufferSaveTimer&&(clearInterval(this.bufferSaveTimer),this.bufferSaveTimer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.dataDisposable){try{this.dataDisposable.dispose()}catch(i){I.error("Error disposing data handler:",i)}this.dataDisposable=null}if(this.resizeDisposable){try{this.resizeDisposable.dispose()}catch(i){I.error("Error disposing resize handler:",i)}this.resizeDisposable=null}if(this.selectionDisposable){try{this.selectionDisposable.dispose()}catch(i){I.error("Error disposing selection handler:",i)}this.selectionDisposable=null}if(this.ipcCleanup){try{this.ipcCleanup()}catch(i){I.error("Error cleaning up IPC handlers:",i)}this.ipcCleanup=null}if(this.themeCleanup){try{this.themeCleanup()}catch(i){I.error("Error cleaning up theme listener:",i)}this.themeCleanup=null}this.eventListeners.forEach(i=>{try{i()}catch(s){I.error("Error cleaning up event listener:",s)}}),this.eventListeners=[],e.killPty!==!1&&this.terminals.kill(this.terminalId,this.workspaceId).catch(i=>{I.error("Error killing PTY connection:",i)});try{this.searchAddon?.dispose&&this.searchAddon.dispose(),this.webLinksAddon?.dispose&&this.webLinksAddon.dispose(),this.disposeWebglAddon(),this.fitAddon?.dispose&&this.fitAddon.dispose()}catch(i){I.error("Error disposing addons:",i)}try{this.themeManager.dispose()}catch(i){I.error("Error disposing theme manager:",i)}try{this.stateMachine.dispose()}catch(i){I.error("Error disposing state machine:",i)}Pf(this.xterm,i=>{I.error("Error disposing xterm:",i)})}}};P(Ae,"MAX_RECONNECT_ATTEMPTS",5),P(Ae,"BASE_RECONNECT_DELAY_MS",1e3),P(Ae,"HEARTBEAT_INTERVAL_MS",3e4),P(Ae,"HEARTBEAT_TIMEOUT_MS",1e4),P(Ae,"MAX_WEBGL_RECOVERY_ATTEMPTS",3);let cn=Ae;const le=new Xi("TerminalManager");class zf{constructor(){P(this,"terminals",new Map)}saveTerminalMetadata(e,i,s){try{_t.dispatch(Gh(i,e,s,new Date().toISOString())),le.debug(`[RendererTerminalManager] Saved terminal metadata for ${e}`)}catch(r){le.error("[RendererTerminalManager] Failed to save terminal metadata:",r)}}loadTerminalMetadata(e){try{return Zh.select(_t.state,e).map(i=>({terminalId:i.id,workspaceId:i.workspaceId??e,createdAt:i.createdAt??"",title:i.customName||Jh(i.name)}))}catch(i){le.error("[RendererTerminalManager] Failed to load terminal metadata:",i)}return[]}removeTerminalMetadata(e,i){try{_t.dispatch(Yh(i,e)),le.debug(`[RendererTerminalManager] Removed terminal metadata for ${e}`)}catch(s){le.error("[RendererTerminalManager] Failed to remove terminal metadata:",s)}}hasTerminal(e){return this.terminals.has(e)}async getOrCreateTerminal(e,i,s,r,n=!1){let o=this.terminals.get(e);if(n&&o&&(le.info(`[RendererTerminalManager] Force creating new terminal, disposing existing: ${e}`),this.disposeTerminal(e),o=void 0),o)if(o.workspaceId!==i)le.warn(`[RendererTerminalManager] Terminal ${e} has mismatched workspaceId (has: ${o.workspaceId}, requested: ${i}). Disposing and recreating.`),this.disposeTerminal(e),o=void 0;else return le.info(`[RendererTerminalManager] Reattaching to existing terminal: ${e} (was attached: ${o.isAttached})`),o.container=s,o.isAttached=!0,await o.adapter.reattach(s),r&&(o.adapter.updateCallbacks(r),r.onReady?.()),le.info(`[RendererTerminalManager] Successfully reattached terminal: ${e}`),o.adapter;le.info(`[RendererTerminalManager] Creating new terminal: ${e}`);const a=new cn({workspaceId:i,terminalId:e,container:s,...r});return o={adapter:a,terminalId:e,workspaceId:i,isAttached:!0,container:s},this.terminals.set(e,o),this.saveTerminalMetadata(e,i),await a.initialize(n),a}isAttachedTo(e,i){const s=this.terminals.get(e);return!!s&&s.isAttached&&s.container===i}detachTerminal(e,i){const s=this.terminals.get(e);if(s){if(i&&s.container!==i){le.info(`[RendererTerminalManager] Ignoring detach from a stale surface: ${e}`);return}le.info(`[RendererTerminalManager] Detaching terminal: ${e}`),s.isAttached=!1,s.adapter.detach(),s.container=null}}disposeTerminal(e,i){const s=this.terminals.get(e);s?(le.info(`[RendererTerminalManager] Disposing terminal: ${e}`),s.adapter.dispose(),this.terminals.delete(e),this.removeTerminalMetadata(e,s.workspaceId)):_t.dispatch(Xh(e,i))}disposeExitedTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Disposing exited terminal: ${e}`),i.adapter.dispose({killPty:!1}),this.terminals.delete(e))}clearTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Clearing terminal: ${e}`),i.adapter.clear())}getTerminalInfo(e){const i=this.terminals.get(e);return i?i.adapter.getInfo():null}async getBufferContent(e,i){const s=this.terminals.get(e);if(s?.adapter)try{const r=s.adapter.xterm;if(r?.buffer?.active){const n=r.buffer.active,o=[];for(let a=0;a<n.length;a++){const l=n.getLine(a);l&&o.push(l.translateToString(!0))}for(;o.length>0&&!o[o.length-1].trim();)o.pop();if(o.length>0)return o.join(`
144
+ `)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./u_H5ILVa.js").then(s=>s.b);return{resolveBrowserLinkForOpen:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url).then(({resolveBrowserLinkForOpen:i})=>i(e)).catch(()=>({url:e})).then(i=>{Dn(async()=>{const{getPanelLayoutManager:s}=await import("./2OP7IVCM.js").then(r=>r.p);return{getPanelLayoutManager:s}},__vite__mapDeps([32,21,22,5,23,24,3,8,4,25,15,2,33]),import.meta.url).then(({getPanelLayoutManager:s})=>{s(this.workspaceId).openBrowserPanel(i.url,void 0,void 0,i.requestedUrl),I.debug("Opened URL in browser panel",{uri:e,resolvedUrl:i.url,workspaceId:this.workspaceId})}).catch(s=>{I.warn("Failed to open URL in browser panel, falling back to external browser",{uri:e,error:s}),Fs("shell:openExternal",{url:i.url})})})}catch(i){I.warn("Failed to handle link click",{uri:e,error:i}),Fs("shell:openExternal",{url:e})}}async reconnect(){if(this.isDisposed)throw new Error("Cannot reconnect disposed terminal");if(!this.stateMachine.canTransition("reconnect"))throw new Error(`Cannot reconnect in state ${this.stateMachine.getState()}`);this.exitedNormally=!1,this.stateMachine.transition("reconnect");try{const e=this.xterm.cols,i=this.xterm.rows,s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_reconnectFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(e){throw this.stateMachine.reportError(e),e}}detach(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null),this.stopHeartbeat(),this.cancelAutoReconnect(),this.cancelReattachFit(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null);const e=this.xterm.element;e&&e.parentNode&&e.parentNode.removeChild(e),this.themeManager.setContainer(null),this.container=null}dispose(e={}){if(!(this.isDisposed||this.stateMachine.isDisposed())){if(this.isDisposed=!0,this.cancelAutoReconnect(),this.stopHeartbeat(),this.cancelReattachFit(),this.stateMachine.transition("dispose"),this.saveBuffer().catch(()=>{}),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.bufferSaveTimer&&(clearInterval(this.bufferSaveTimer),this.bufferSaveTimer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.dataDisposable){try{this.dataDisposable.dispose()}catch(i){I.error("Error disposing data handler:",i)}this.dataDisposable=null}if(this.resizeDisposable){try{this.resizeDisposable.dispose()}catch(i){I.error("Error disposing resize handler:",i)}this.resizeDisposable=null}if(this.selectionDisposable){try{this.selectionDisposable.dispose()}catch(i){I.error("Error disposing selection handler:",i)}this.selectionDisposable=null}if(this.ipcCleanup){try{this.ipcCleanup()}catch(i){I.error("Error cleaning up IPC handlers:",i)}this.ipcCleanup=null}if(this.themeCleanup){try{this.themeCleanup()}catch(i){I.error("Error cleaning up theme listener:",i)}this.themeCleanup=null}this.eventListeners.forEach(i=>{try{i()}catch(s){I.error("Error cleaning up event listener:",s)}}),this.eventListeners=[],e.killPty!==!1&&this.terminals.kill(this.terminalId,this.workspaceId).catch(i=>{I.error("Error killing PTY connection:",i)});try{this.searchAddon?.dispose&&this.searchAddon.dispose(),this.webLinksAddon?.dispose&&this.webLinksAddon.dispose(),this.disposeWebglAddon(),this.fitAddon?.dispose&&this.fitAddon.dispose()}catch(i){I.error("Error disposing addons:",i)}try{this.themeManager.dispose()}catch(i){I.error("Error disposing theme manager:",i)}try{this.stateMachine.dispose()}catch(i){I.error("Error disposing state machine:",i)}Pf(this.xterm,i=>{I.error("Error disposing xterm:",i)})}}};P(Ae,"MAX_RECONNECT_ATTEMPTS",5),P(Ae,"BASE_RECONNECT_DELAY_MS",1e3),P(Ae,"HEARTBEAT_INTERVAL_MS",3e4),P(Ae,"HEARTBEAT_TIMEOUT_MS",1e4),P(Ae,"MAX_WEBGL_RECOVERY_ATTEMPTS",3);let cn=Ae;const le=new Xi("TerminalManager");class zf{constructor(){P(this,"terminals",new Map)}saveTerminalMetadata(e,i,s){try{_t.dispatch(Gh(i,e,s,new Date().toISOString())),le.debug(`[RendererTerminalManager] Saved terminal metadata for ${e}`)}catch(r){le.error("[RendererTerminalManager] Failed to save terminal metadata:",r)}}loadTerminalMetadata(e){try{return Zh.select(_t.state,e).map(i=>({terminalId:i.id,workspaceId:i.workspaceId??e,createdAt:i.createdAt??"",title:i.customName||Jh(i.name)}))}catch(i){le.error("[RendererTerminalManager] Failed to load terminal metadata:",i)}return[]}removeTerminalMetadata(e,i){try{_t.dispatch(Yh(i,e)),le.debug(`[RendererTerminalManager] Removed terminal metadata for ${e}`)}catch(s){le.error("[RendererTerminalManager] Failed to remove terminal metadata:",s)}}hasTerminal(e){return this.terminals.has(e)}async getOrCreateTerminal(e,i,s,r,n=!1){let o=this.terminals.get(e);if(n&&o&&(le.info(`[RendererTerminalManager] Force creating new terminal, disposing existing: ${e}`),this.disposeTerminal(e),o=void 0),o)if(o.workspaceId!==i)le.warn(`[RendererTerminalManager] Terminal ${e} has mismatched workspaceId (has: ${o.workspaceId}, requested: ${i}). Disposing and recreating.`),this.disposeTerminal(e),o=void 0;else return le.info(`[RendererTerminalManager] Reattaching to existing terminal: ${e} (was attached: ${o.isAttached})`),o.container=s,o.isAttached=!0,await o.adapter.reattach(s),r&&(o.adapter.updateCallbacks(r),r.onReady?.()),le.info(`[RendererTerminalManager] Successfully reattached terminal: ${e}`),o.adapter;le.info(`[RendererTerminalManager] Creating new terminal: ${e}`);const a=new cn({workspaceId:i,terminalId:e,container:s,...r});return o={adapter:a,terminalId:e,workspaceId:i,isAttached:!0,container:s},this.terminals.set(e,o),this.saveTerminalMetadata(e,i),await a.initialize(n),a}isAttachedTo(e,i){const s=this.terminals.get(e);return!!s&&s.isAttached&&s.container===i}detachTerminal(e,i){const s=this.terminals.get(e);if(s){if(i&&s.container!==i){le.info(`[RendererTerminalManager] Ignoring detach from a stale surface: ${e}`);return}le.info(`[RendererTerminalManager] Detaching terminal: ${e}`),s.isAttached=!1,s.adapter.detach(),s.container=null}}disposeTerminal(e,i){const s=this.terminals.get(e);s?(le.info(`[RendererTerminalManager] Disposing terminal: ${e}`),s.adapter.dispose(),this.terminals.delete(e),this.removeTerminalMetadata(e,s.workspaceId)):_t.dispatch(Xh(e,i))}disposeExitedTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Disposing exited terminal: ${e}`),i.adapter.dispose({killPty:!1}),this.terminals.delete(e))}clearTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Clearing terminal: ${e}`),i.adapter.clear())}getTerminalInfo(e){const i=this.terminals.get(e);return i?i.adapter.getInfo():null}async getBufferContent(e,i){const s=this.terminals.get(e);if(s?.adapter)try{const r=s.adapter.xterm;if(r?.buffer?.active){const n=r.buffer.active,o=[];for(let a=0;a<n.length;a++){const l=n.getLine(a);l&&o.push(l.translateToString(!0))}for(;o.length>0&&!o[o.length-1].trim();)o.pop();if(o.length>0)return o.join(`
145
145
  `)}}catch(r){le.warn("[RendererTerminalManager] Failed to read live buffer, falling back:",r)}try{const n=await new Rs(i,e).restoreBuffer();if(n&&n.lines.length>0){const o=[...n.lines];for(;o.length>0&&!o[o.length-1].trim();)o.pop();return o.join(`
146
146
  `)}}catch(r){le.error("[RendererTerminalManager] Failed to read persisted buffer:",r)}return null}disposeWorkspaceTerminals(e){const i=[];for(const[s,r]of this.terminals)r.workspaceId===e&&i.push(s);if(i.length>0){le.info(`[RendererTerminalManager] Disposing ${i.length} terminals for workspace ${e}`);for(const s of i)try{const r=this.terminals.get(s);r&&(r.adapter.dispose(),this.terminals.delete(s))}catch(r){le.error(`[RendererTerminalManager] Failed to dispose terminal ${s}:`,r)}}}disposeAll(){le.info(`[RendererTerminalManager] Disposing all ${this.terminals.size} terminals`);for(const[e,i]of this.terminals)try{i.adapter.dispose()}catch(s){le.error(`[RendererTerminalManager] Failed to dispose terminal ${e}:`,s)}this.terminals.clear()}}typeof window<"u"&&!window.__terminalManager&&(window.__terminalManager=new zf);const Wf=window.__terminalManager,Tp=Object.freeze(Object.defineProperty({__proto__:null,terminalManager:Wf},Symbol.toStringTag,{value:"Module"}));export{au as D,pu as L,hn as T,Wf as a,Tp as b,Pf as d,cu as o,Oi as t};
@@ -1,3 +1,3 @@
1
- import{p as re}from"./CfDqTHT1.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./DMudvlKI.js";import{p as be,i as ve}from"./DGU9U1O6.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
1
+ import{p as re}from"./CSzXeH2S.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./DFNKkiho.js";import{p as be,i as ve}from"./BBfR26V0.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
2
2
  `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function G(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(G,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function j(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],$=f[p-1];y.y=$.y+$.height+s.swimlaneGap}return h}o(j,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function Z(e,n){const t=n;if(z(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=q(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:T,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Z,"decidePositionRelation");function J(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(J,"evolveRelationPositioned");var Me={[D]:G,[k]:Z},Be={[N]:j,[T]:J};function Q(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Q,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Q(e,n);return ee(e,t)}o(v,"dispatch");var M={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:W,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),M.setAst(n),re(n,M)},"parse")},Ae=R(),$e=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Re=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
3
3
  `,"id:",n,t),!$e)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=R(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:Re},Ne=o(e=>"","getStyles"),Te=Ne,Ie={parser:Ee,db:M,renderer:De,styles:Te};export{Ie as diagram};
@@ -1 +1 @@
1
- import{aG as a,bI as l}from"./3SdAC2_C.js";import{JH as t}from"./CiKoEJ2m.js";const s=Symbol("static-overlay");function n(e){l(s,e)}function b(){return a(s)??(()=>!1)}const r=["border-rose-500/30 bg-rose-500/15 text-rose-700 dark:text-rose-300","border-amber-500/30 bg-amber-500/15 text-amber-700 dark:text-amber-300","border-yellow-500/30 bg-yellow-500/15 text-yellow-700 dark:text-yellow-300","border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300","border-sky-500/30 bg-sky-500/15 text-sky-700 dark:text-sky-300","border-violet-500/30 bg-violet-500/15 text-violet-700 dark:text-violet-300"],o=["hover:bg-rose-500/25","hover:bg-amber-500/25","hover:bg-yellow-500/25","hover:bg-emerald-500/25","hover:bg-sky-500/25","hover:bg-violet-500/25"];function h(e){return r[e%r.length]}function d(e){return o[e%o.length]}const u=t.createSelector(e=>e.theme.preference),v=t.createSelector(e=>e.theme.name==="dark"),S=t.createSelector(e=>e.theme.hasCustomTheme),i=t.createSelector(e=>e.theme.customThemeName),g=t.createSelector(e=>e.theme.activePresetId),x=t.createSelector(e=>e.theme.error);export{i as a,S as b,v as c,x as d,u as e,h as f,d as g,n as p,g as s,b as u};
1
+ import{aG as a,bI as l}from"./3SdAC2_C.js";import{JH as t}from"./D0qhIm1r.js";const s=Symbol("static-overlay");function n(e){l(s,e)}function b(){return a(s)??(()=>!1)}const r=["border-rose-500/30 bg-rose-500/15 text-rose-700 dark:text-rose-300","border-amber-500/30 bg-amber-500/15 text-amber-700 dark:text-amber-300","border-yellow-500/30 bg-yellow-500/15 text-yellow-700 dark:text-yellow-300","border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300","border-sky-500/30 bg-sky-500/15 text-sky-700 dark:text-sky-300","border-violet-500/30 bg-violet-500/15 text-violet-700 dark:text-violet-300"],o=["hover:bg-rose-500/25","hover:bg-amber-500/25","hover:bg-yellow-500/25","hover:bg-emerald-500/25","hover:bg-sky-500/25","hover:bg-violet-500/25"];function h(e){return r[e%r.length]}function d(e){return o[e%o.length]}const u=t.createSelector(e=>e.theme.preference),v=t.createSelector(e=>e.theme.name==="dark"),S=t.createSelector(e=>e.theme.hasCustomTheme),i=t.createSelector(e=>e.theme.customThemeName),g=t.createSelector(e=>e.theme.activePresetId),x=t.createSelector(e=>e.theme.error);export{i as a,S as b,v as c,x as d,u as e,h as f,d as g,n as p,g as s,b as u};
@@ -1,2 +1,2 @@
1
- import{Z as Q,n as j,aA as J,ax as X,aI as z,w as Z,b as $}from"./iQDlfKDR.js";import{JH as l,nZ as m,n_ as _,JQ as q,bs as O,a4 as Y,nM as C,rR as P,sd as ee,kr as te,sb as W,K9 as M,rw as ne,fV as K,rS as F,a6 as se,bq as oe,m as ie}from"./CiKoEJ2m.js";import{m as x,a0 as re,l as ae}from"./JvFe2B29.js";import{a as L}from"./B1lpukIv.js";const ce=["[WORKSPACE EVENTS]","[TASK WAKE]","[AGENT MESSAGE]"];function de(e){const t=e.metadata;if(t&&typeof t=="object"){if(t.type==="question_answers")return!1;if(!Q(t))return!0}const n=j(e);return ce.some(s=>n.startsWith(s))}const U=1440*60*1e3;function le(e){let t=null;for(const n of e){if(de({id:n.id,timestamp:n.createdAt,metadata:n.metadata,contentBlocks:[{type:"text",text:n.preview.trimStart()}]}))continue;const s=Date.parse(n.createdAt);Number.isFinite(s)&&(t===null||s>t)&&(t=s)}return t}const ue=50,ge=20;function D(e,t){return e===null||t!==null&&t>e?t:e}async function De(e,t){let n,s=null;for(let i=0;i<ge;i++){const r=await e({limit:ue,nextToken:n});if(!r.ok)return null;const d=r.items;s===null&&d.length>0&&(s=d[d.length-1].id);const c=t?.newestId!=null?d.findIndex(a=>a.id===t.newestId):-1,o=le(c>=0?d.slice(c+1):d);if(c>=0)return{latest:D(o,t?.latest??null),newestId:s};if(o!==null)return{latest:D(o,t?.latest??null),newestId:s};if(typeof r.nextToken!="string")return{latest:null,newestId:s};n=r.nextToken}return{latest:t?.latest??null,newestId:s}}function E(e,t){return e!=null&&e<=t&&e>t-U}function fe(e,t){return e!=null&&Number.isFinite(e)&&e>0&&e<=t-U}function pe(e,t){const{workspaceId:n,agentId:s,authority:i,nativePairId:r,evidence:d}=e;if(!n||!s||!i||i!==t)return null;const c=JSON.stringify([n,s]);if(r!==c||d?.id!==c)return null;const o=d.clips.find(a=>a.status==="recording");return!o||o.discarding||!Number.isFinite(o.startedAt)||!Number.isFinite(o.pausedMs??0)||o.pausedAt!=null&&!Number.isFinite(o.pausedAt)?null:{workspaceId:n,agentId:s,clipId:o.id,startedAt:o.startedAt,pausedAt:o.pausedAt??null,pausedMs:o.pausedMs??0}}function Ee(e,t){return t!==void 0&&e!==t?"ignore":e?"stop":"start"}const Ne=l.createSelector(e=>{const t=e.dockConversation,n=t.workspaceId&&t.agentId?JSON.stringify([t.workspaceId,t.agentId]):null;return pe({workspaceId:t.workspaceId,agentId:t.agentId,authority:t.authority,nativePairId:t.nativeSpeech.pairId,evidence:n?m(t.evidence,n):null},L(e))});l.createSelector(e=>e.hud.active);l.createSelector(e=>e.hud.feed);l.createSelector(e=>e.hud.usage);l.createSelector(e=>e.hud.usageError);const He=l.createSelector(e=>e.hud.rateHistory),qe=l.createSelector(e=>_(e.workspace.workspaces)),Pe=l.createSelector(e=>{const t=e.hud.usage?.totals;return t?q(t):0}),Ke=l.createSelector(e=>e.hud.burnRatePerMin),Fe=l.createSelector(e=>e.hud.burnTrend),xe=l.createSelector(e=>{const{health:t,stats:n,lastUpdated:s,hostLocality:i}=e.daemonHealth,r=n?.hostname;return{online:t!=="down",uptimeSeconds:typeof n?.uptimeSeconds=="number"?n.uptimeSeconds:null,version:n?.version??null,fetchedAtMs:s?Date.parse(s):null,remoteHostname:i==="remote"&&r?r.split(".",1)[0]??r:null}}),Le=l.createSelector(e=>e.hud.gridFilter);l.createSelector(e=>e.hud.attentionByWorkspaceId);const Ue=l.createSelector((e,t)=>{const n=e.hud?.questionsByAgentId?.[t];if(!n)return!1;const s=e.agentSessions?.byAgentId[t]?.metadata??{};return!x(s,n.messageId)}),Ge=l.createSelector(e=>e.hud.takeoverRequestWorkspaceId);function ke(e,t){return t[String(e.id)]??e.displayStatus}const S=l.createSelector(e=>{const t=e.hud.displayStatusByWorkspaceId;return _(e.workspace.workspaces).filter(n=>n.status!==O.Archived&&n.status!==O.Retired&&n.status!==O.Deleted).map(n=>{const s=ke(n,t);return s&&s!==n.displayStatus?{...n,displayStatus:s}:n})});function w(e){const t=e.agentSummary;return!t||!Array.isArray(t.agents)?[]:t.agents.filter(n=>!!n&&typeof n=="object"&&typeof n.id=="string"&&n.status!=="deleted"&&!ae(n.id))}const Ve=l.createSelector(e=>{const t=Object.fromEntries(Y.map(n=>[n,0]));for(const n of S.select(e))for(const s of w(n))t[I(e,s).bucket]+=1;return t}),Qe=l.createSelector(e=>{const t={idle:0,unread:0,progress:0,attention:0,waiting:0,prOpen:0,prMerged:0,failed:0,completed:0,total:0};for(const n of B.select(e))switch(t.total+=1,n.isUnread&&(t.unread+=1),n.isWaiting&&(t.waiting+=1),n.stateKey){case"wait":case"blocked":t.attention+=1;break;case"failed":t.failed+=1;break;case"in_progress":t.progress+=1;break;case"complete":t.completed+=1;break;case"pr_open":case"pr_ready":case"pr_queued":t.prOpen+=1;break;case"pr_merged":t.prMerged+=1;break;default:t.idle+=1}return t}),Se=l.createSelector(e=>{const t={};for(const n of S.select(e))for(const s of w(n))typeof s.name=="string"&&s.name.length>0&&(t[s.id]=s.name);return t});function N(e){if(!e.sinceTs)return 0;const t=Date.parse(e.sinceTs);return Number.isFinite(t)?t:0}const je=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=e.hud.questionsByAgentId,s=[];for(const i of S.select(e)){const r=String(i.id);let d=!1;for(const o of v(i,e)){const{bucket:a,attentionKind:u,hasQuestion:g}=o;if(a!=="needs-attention"&&a!=="failed"||!o.topLevel||o.isBackground||h(e,o.id))continue;const k=g?n[o.id]:void 0,f=u?C(e.agentSessions?.byAgentId[o.id])?.reason:void 0,p=k?"question":u??void 0;s.push({workspaceId:r,workspaceTitle:i.title,kind:a==="needs-attention"?"agent_waiting":"agent_failed",...a==="needs-attention"&&p?{signal:p}:{},agentName:o.name,message:k?.question??f??null,sinceTs:o.lastActivityTs}),d=!0}const c=t[r];c&&P(c.attention)&&(s.push({workspaceId:r,workspaceTitle:i.title,kind:"workspace_attention",attention:c.attention,message:null,sinceTs:c.raisedAtTs}),d=!0),G.has(b(i))&&!d&&s.push({workspaceId:r,workspaceTitle:i.title,kind:"workspace_attention",message:null,sinceTs:null})}return s.sort((i,r)=>N(r)-N(i))}),Je=l.createSelector(e=>{const t=Se.select(e);return e.hud.feed.map(n=>({...n,workspaceTitle:m(e.workspace.workspaces,n.source)?.title??null,resolvedAgentName:n.agentName??(n.agentId?t[n.agentId]??null:null)}))}),Ae={total:0,completed:0,inProgress:0};function b(e){const t=ee(e.displayStatus)?e.displayStatus:"not_started";return te(t)??"not_started"}const G=new Set(["wait","blocked","failed"]);function he(e,t,n){if(t==="failed"){const i=n.find(d=>d.bucket==="failed"&&!h(e,d.id)),r=i?e.agentSessions?.byAgentId[i.id]?.stopReason:null;return{kind:"failed",text:typeof r=="string"&&r.length>0?r:""}}if(t!=="wait"&&t!=="blocked")return null;const s=n.filter(i=>i.topLevel&&!i.isBackground&&!h(e,i.id));for(const i of s){if(!i.hasQuestion)continue;const r=e.hud.questionsByAgentId[i.id];if(r?.question)return{kind:"question",text:r.question}}for(const i of["blocker","discussion"])for(const r of s){if(r.attentionKind!==i)continue;const d=e.agentSessions?.byAgentId[r.id],c=C(d)?.reason;if(c)return{kind:i,text:c}}return{kind:"pending",text:""}}const y=new Set(["running","needs-attention","failed"]);function H(e){const t=typeof e.lastActivity=="string"?Date.parse(e.lastActivity):NaN;return Number.isFinite(t)?t:-1/0}function me(e){const t=n=>{const s=e.get(n.id)?.bucket;return s!==void 0&&y.has(s)?0:1};return(n,s)=>{const i=n.specialist==="spec-writer",r=s.specialist==="spec-writer";if(i!==r)return i?-1:1;const d=t(n)-t(s);if(d!==0)return d;const c=H(n),o=H(s);return c!==o?o-c:n.id<s.id?-1:n.id>s.id?1:0}}function ye(e,t){const n=new Set(e.map(o=>o.id)),s=new Map,i=[];for(const o of e){const a=typeof o.parentAgentId=="string"&&o.parentAgentId!==o.id&&n.has(o.parentAgentId)?o.parentAgentId:null;if(a){const u=s.get(a)??[];u.push(o),s.set(a,u)}else i.push(o)}i.sort(t);for(const o of s.values())o.sort(t);const r=[],d=new Set,c=(o,a,u)=>{if(!d.has(o.id)){d.add(o.id),r.push({info:o,depth:a,parentAgentId:u});for(const g of s.get(o.id)??[])c(g,a+1,o.id)}};for(const o of i)c(o,0,null);for(const o of e)c(o,0,null);return r}function I(e,t){const n=e.agentSessions?.byAgentId[t.id],s=n?.metadata??{},i=n?C(n)?.kind??null:null,r=n?J.select(e,t.id)||typeof n.status=="string"&&W(n.status):W(t.status),d=n?M(typeof n.status=="string"?n.status:t.status):null,c=!!n&&d!=="failed"&&d!=="done"&&(n.isWaitingForOtherAgents===!0||Array.isArray(n.waitingForAgentIds)&&n.waitingForAgentIds.length>0||Array.isArray(n.waitingOnHooks)&&n.waitingOnHooks.length>0||Array.isArray(n.waitingOnPrMonitors)&&n.waitingOnPrMonitors.length>0||Array.isArray(n.waitingOnScriptMonitors)&&n.waitingOnScriptMonitors.length>0),o=!!n&&(n.turnInFlight===!0||n.liveTurnOpen===!0);let a;n?c&&!o&&n.isStreaming!==!0&&n.isProcessing!==!0?a="idle":X.select(e,t.id)?a="running":r?a="idle":a=M(typeof n.status=="string"?n.status:t.status):a=t.isResponding===!0||t.isStreaming===!0?"running":M(t.status);const u=e.hud.questionsByAgentId[t.id],g=a!=="failed"&&!!u&&!x(s,u.messageId);return{bucket:a==="failed"?"failed":i!==null||g?"needs-attention":a,attentionKind:i,hasQuestion:g,isRunning:a==="running"}}function V(e,t){const n=i=>typeof i=="string"&&i!==e.id?i:null,s=i=>({isBackground:i?.isBackground,createdByAgentId:n(i?.createdByAgentId)});return{parentAgentId:n(e.parentAgentId)??n(t?.parentAgentId),isBackground:e.isBackground??t?.isBackground,metadata:s(t?.metadata),agentMetadata:s(t?.agentMetadata)}}function h(e,t){return e.agentSessions?.byAgentId[t]?.notificationsMuted===!0}function Ie(e){if(!e)return null;switch(e.kind){case"attention":return e.attention.reason??null;case"live-tool":case"last-tool":{const t=$(e.toolUse.name,e.toolUse.input||{});return t.hidden?null:[t.verb,t.subject,t.path].filter(Boolean).join(" ").trim()||null}default:{const t=e.text||"";return t?t.includes(`
1
+ import{Z as Q,n as j,aA as J,ax as X,aI as z,w as Z,b as $}from"./cD292w1o.js";import{JH as l,nZ as m,n_ as _,JQ as q,bs as O,a4 as Y,nM as C,rR as P,sd as ee,kr as te,sb as W,K9 as M,rw as ne,fV as K,rS as F,a6 as se,bq as oe,m as ie}from"./D0qhIm1r.js";import{m as x,a0 as re,l as ae}from"./BuM8LV7z.js";import{a as L}from"./CZfU7DE3.js";const ce=["[WORKSPACE EVENTS]","[TASK WAKE]","[AGENT MESSAGE]"];function de(e){const t=e.metadata;if(t&&typeof t=="object"){if(t.type==="question_answers")return!1;if(!Q(t))return!0}const n=j(e);return ce.some(s=>n.startsWith(s))}const U=1440*60*1e3;function le(e){let t=null;for(const n of e){if(de({id:n.id,timestamp:n.createdAt,metadata:n.metadata,contentBlocks:[{type:"text",text:n.preview.trimStart()}]}))continue;const s=Date.parse(n.createdAt);Number.isFinite(s)&&(t===null||s>t)&&(t=s)}return t}const ue=50,ge=20;function D(e,t){return e===null||t!==null&&t>e?t:e}async function De(e,t){let n,s=null;for(let i=0;i<ge;i++){const r=await e({limit:ue,nextToken:n});if(!r.ok)return null;const d=r.items;s===null&&d.length>0&&(s=d[d.length-1].id);const c=t?.newestId!=null?d.findIndex(a=>a.id===t.newestId):-1,o=le(c>=0?d.slice(c+1):d);if(c>=0)return{latest:D(o,t?.latest??null),newestId:s};if(o!==null)return{latest:D(o,t?.latest??null),newestId:s};if(typeof r.nextToken!="string")return{latest:null,newestId:s};n=r.nextToken}return{latest:t?.latest??null,newestId:s}}function E(e,t){return e!=null&&e<=t&&e>t-U}function fe(e,t){return e!=null&&Number.isFinite(e)&&e>0&&e<=t-U}function pe(e,t){const{workspaceId:n,agentId:s,authority:i,nativePairId:r,evidence:d}=e;if(!n||!s||!i||i!==t)return null;const c=JSON.stringify([n,s]);if(r!==c||d?.id!==c)return null;const o=d.clips.find(a=>a.status==="recording");return!o||o.discarding||!Number.isFinite(o.startedAt)||!Number.isFinite(o.pausedMs??0)||o.pausedAt!=null&&!Number.isFinite(o.pausedAt)?null:{workspaceId:n,agentId:s,clipId:o.id,startedAt:o.startedAt,pausedAt:o.pausedAt??null,pausedMs:o.pausedMs??0}}function Ee(e,t){return t!==void 0&&e!==t?"ignore":e?"stop":"start"}const Ne=l.createSelector(e=>{const t=e.dockConversation,n=t.workspaceId&&t.agentId?JSON.stringify([t.workspaceId,t.agentId]):null;return pe({workspaceId:t.workspaceId,agentId:t.agentId,authority:t.authority,nativePairId:t.nativeSpeech.pairId,evidence:n?m(t.evidence,n):null},L(e))});l.createSelector(e=>e.hud.active);l.createSelector(e=>e.hud.feed);l.createSelector(e=>e.hud.usage);l.createSelector(e=>e.hud.usageError);const He=l.createSelector(e=>e.hud.rateHistory),qe=l.createSelector(e=>_(e.workspace.workspaces)),Pe=l.createSelector(e=>{const t=e.hud.usage?.totals;return t?q(t):0}),Ke=l.createSelector(e=>e.hud.burnRatePerMin),Fe=l.createSelector(e=>e.hud.burnTrend),xe=l.createSelector(e=>{const{health:t,stats:n,lastUpdated:s,hostLocality:i}=e.daemonHealth,r=n?.hostname;return{online:t!=="down",uptimeSeconds:typeof n?.uptimeSeconds=="number"?n.uptimeSeconds:null,version:n?.version??null,fetchedAtMs:s?Date.parse(s):null,remoteHostname:i==="remote"&&r?r.split(".",1)[0]??r:null}}),Le=l.createSelector(e=>e.hud.gridFilter);l.createSelector(e=>e.hud.attentionByWorkspaceId);const Ue=l.createSelector((e,t)=>{const n=e.hud?.questionsByAgentId?.[t];if(!n)return!1;const s=e.agentSessions?.byAgentId[t]?.metadata??{};return!x(s,n.messageId)}),Ge=l.createSelector(e=>e.hud.takeoverRequestWorkspaceId);function ke(e,t){return t[String(e.id)]??e.displayStatus}const S=l.createSelector(e=>{const t=e.hud.displayStatusByWorkspaceId;return _(e.workspace.workspaces).filter(n=>n.status!==O.Archived&&n.status!==O.Retired&&n.status!==O.Deleted).map(n=>{const s=ke(n,t);return s&&s!==n.displayStatus?{...n,displayStatus:s}:n})});function w(e){const t=e.agentSummary;return!t||!Array.isArray(t.agents)?[]:t.agents.filter(n=>!!n&&typeof n=="object"&&typeof n.id=="string"&&n.status!=="deleted"&&!ae(n.id))}const Ve=l.createSelector(e=>{const t=Object.fromEntries(Y.map(n=>[n,0]));for(const n of S.select(e))for(const s of w(n))t[I(e,s).bucket]+=1;return t}),Qe=l.createSelector(e=>{const t={idle:0,unread:0,progress:0,attention:0,waiting:0,prOpen:0,prMerged:0,failed:0,completed:0,total:0};for(const n of B.select(e))switch(t.total+=1,n.isUnread&&(t.unread+=1),n.isWaiting&&(t.waiting+=1),n.stateKey){case"wait":case"blocked":t.attention+=1;break;case"failed":t.failed+=1;break;case"in_progress":t.progress+=1;break;case"complete":t.completed+=1;break;case"pr_open":case"pr_ready":case"pr_queued":t.prOpen+=1;break;case"pr_merged":t.prMerged+=1;break;default:t.idle+=1}return t}),Se=l.createSelector(e=>{const t={};for(const n of S.select(e))for(const s of w(n))typeof s.name=="string"&&s.name.length>0&&(t[s.id]=s.name);return t});function N(e){if(!e.sinceTs)return 0;const t=Date.parse(e.sinceTs);return Number.isFinite(t)?t:0}const je=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=e.hud.questionsByAgentId,s=[];for(const i of S.select(e)){const r=String(i.id);let d=!1;for(const o of v(i,e)){const{bucket:a,attentionKind:u,hasQuestion:g}=o;if(a!=="needs-attention"&&a!=="failed"||!o.topLevel||o.isBackground||h(e,o.id))continue;const k=g?n[o.id]:void 0,f=u?C(e.agentSessions?.byAgentId[o.id])?.reason:void 0,p=k?"question":u??void 0;s.push({workspaceId:r,workspaceTitle:i.title,kind:a==="needs-attention"?"agent_waiting":"agent_failed",...a==="needs-attention"&&p?{signal:p}:{},agentName:o.name,message:k?.question??f??null,sinceTs:o.lastActivityTs}),d=!0}const c=t[r];c&&P(c.attention)&&(s.push({workspaceId:r,workspaceTitle:i.title,kind:"workspace_attention",attention:c.attention,message:null,sinceTs:c.raisedAtTs}),d=!0),G.has(b(i))&&!d&&s.push({workspaceId:r,workspaceTitle:i.title,kind:"workspace_attention",message:null,sinceTs:null})}return s.sort((i,r)=>N(r)-N(i))}),Je=l.createSelector(e=>{const t=Se.select(e);return e.hud.feed.map(n=>({...n,workspaceTitle:m(e.workspace.workspaces,n.source)?.title??null,resolvedAgentName:n.agentName??(n.agentId?t[n.agentId]??null:null)}))}),Ae={total:0,completed:0,inProgress:0};function b(e){const t=ee(e.displayStatus)?e.displayStatus:"not_started";return te(t)??"not_started"}const G=new Set(["wait","blocked","failed"]);function he(e,t,n){if(t==="failed"){const i=n.find(d=>d.bucket==="failed"&&!h(e,d.id)),r=i?e.agentSessions?.byAgentId[i.id]?.stopReason:null;return{kind:"failed",text:typeof r=="string"&&r.length>0?r:""}}if(t!=="wait"&&t!=="blocked")return null;const s=n.filter(i=>i.topLevel&&!i.isBackground&&!h(e,i.id));for(const i of s){if(!i.hasQuestion)continue;const r=e.hud.questionsByAgentId[i.id];if(r?.question)return{kind:"question",text:r.question}}for(const i of["blocker","discussion"])for(const r of s){if(r.attentionKind!==i)continue;const d=e.agentSessions?.byAgentId[r.id],c=C(d)?.reason;if(c)return{kind:i,text:c}}return{kind:"pending",text:""}}const y=new Set(["running","needs-attention","failed"]);function H(e){const t=typeof e.lastActivity=="string"?Date.parse(e.lastActivity):NaN;return Number.isFinite(t)?t:-1/0}function me(e){const t=n=>{const s=e.get(n.id)?.bucket;return s!==void 0&&y.has(s)?0:1};return(n,s)=>{const i=n.specialist==="spec-writer",r=s.specialist==="spec-writer";if(i!==r)return i?-1:1;const d=t(n)-t(s);if(d!==0)return d;const c=H(n),o=H(s);return c!==o?o-c:n.id<s.id?-1:n.id>s.id?1:0}}function ye(e,t){const n=new Set(e.map(o=>o.id)),s=new Map,i=[];for(const o of e){const a=typeof o.parentAgentId=="string"&&o.parentAgentId!==o.id&&n.has(o.parentAgentId)?o.parentAgentId:null;if(a){const u=s.get(a)??[];u.push(o),s.set(a,u)}else i.push(o)}i.sort(t);for(const o of s.values())o.sort(t);const r=[],d=new Set,c=(o,a,u)=>{if(!d.has(o.id)){d.add(o.id),r.push({info:o,depth:a,parentAgentId:u});for(const g of s.get(o.id)??[])c(g,a+1,o.id)}};for(const o of i)c(o,0,null);for(const o of e)c(o,0,null);return r}function I(e,t){const n=e.agentSessions?.byAgentId[t.id],s=n?.metadata??{},i=n?C(n)?.kind??null:null,r=n?J.select(e,t.id)||typeof n.status=="string"&&W(n.status):W(t.status),d=n?M(typeof n.status=="string"?n.status:t.status):null,c=!!n&&d!=="failed"&&d!=="done"&&(n.isWaitingForOtherAgents===!0||Array.isArray(n.waitingForAgentIds)&&n.waitingForAgentIds.length>0||Array.isArray(n.waitingOnHooks)&&n.waitingOnHooks.length>0||Array.isArray(n.waitingOnPrMonitors)&&n.waitingOnPrMonitors.length>0||Array.isArray(n.waitingOnScriptMonitors)&&n.waitingOnScriptMonitors.length>0),o=!!n&&(n.turnInFlight===!0||n.liveTurnOpen===!0);let a;n?c&&!o&&n.isStreaming!==!0&&n.isProcessing!==!0?a="idle":X.select(e,t.id)?a="running":r?a="idle":a=M(typeof n.status=="string"?n.status:t.status):a=t.isResponding===!0||t.isStreaming===!0?"running":M(t.status);const u=e.hud.questionsByAgentId[t.id],g=a!=="failed"&&!!u&&!x(s,u.messageId);return{bucket:a==="failed"?"failed":i!==null||g?"needs-attention":a,attentionKind:i,hasQuestion:g,isRunning:a==="running"}}function V(e,t){const n=i=>typeof i=="string"&&i!==e.id?i:null,s=i=>({isBackground:i?.isBackground,createdByAgentId:n(i?.createdByAgentId)});return{parentAgentId:n(e.parentAgentId)??n(t?.parentAgentId),isBackground:e.isBackground??t?.isBackground,metadata:s(t?.metadata),agentMetadata:s(t?.agentMetadata)}}function h(e,t){return e.agentSessions?.byAgentId[t]?.notificationsMuted===!0}function Ie(e){if(!e)return null;switch(e.kind){case"attention":return e.attention.reason??null;case"live-tool":case"last-tool":{const t=$(e.toolUse.name,e.toolUse.input||{});return t.hidden?null:[t.verb,t.subject,t.path].filter(Boolean).join(" ").trim()||null}default:{const t=e.text||"";return t?t.includes(`
2
2
  `)?Z(t)||null:t:null}}}function v(e,t){const n=w(e),s=new Map(n.map(r=>[r.id,I(t,r)]));return ye(n,me(s)).map(({info:r,depth:d,parentAgentId:c})=>{const o=t.agentSessions?.byAgentId[r.id],a=V(r,o),{bucket:u,attentionKind:g,hasQuestion:k}=s.get(r.id)??I(t,r),f=Array.isArray(o?.waitingForAgentIds)?o.waitingForAgentIds.filter(p=>typeof p=="string"):[];return{id:r.id,name:r.name,bucket:u,lastActivityTs:r.lastActivity??null,line:Ie(z.select(t,r.id)),parentAgentId:c,depth:d,treePrefix:"",topLevel:K(a)==="topLevel",isBackground:ne(a),attentionKind:g,hasQuestion:k,isWaitingForAgents:o?.isWaitingForOtherAgents===!0||f.length>0||Array.isArray(o?.waitingOnHooks)&&o.waitingOnHooks.length>0||Array.isArray(o?.waitingOnPrMonitors)&&o.waitingOnPrMonitors.length>0||Array.isArray(o?.waitingOnScriptMonitors)&&o.waitingOnScriptMonitors.length>0,waitingForAgentIds:f}})}function we(e){const t=new Set;for(const i of e)for(const r of i.waitingForAgentIds)t.add(r);const n=i=>y.has(i.bucket)||i.isWaitingForAgents||t.has(i.id);return e.filter((i,r)=>{if(n(i))return!0;for(let d=r+1;d<e.length&&!(e[d].depth<=i.depth);d++)if(n(e[d]))return!0;return!1}).map((i,r,d)=>{if(i.depth===0)return{...i,treePrefix:""};let c=!0;for(let o=r+1;o<d.length&&!(d[o].depth<i.depth);o++)if(d[o].depth===i.depth){c=!1;break}return{...i,treePrefix:(i.depth>=2?"│ ":"")+(c?"└─":"├─")}})}const B=l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId,n=re.select(e);return S.select(e).map(s=>{const i=String(s.id),r=n.indexOf(i),d=t[i]?.attention??(typeof s.attention=="string"&&F(s.attention)?s.attention:null),c=v(s,e),o=b(s),a=e.tokenUsage?.byWorkspaceId[i]?.totals,u=e.workspaceTasks?.byWorkspaceId[i]?.stats,g=typeof s.statusMessage=="string"&&s.statusMessage.trim().length>0?s.statusMessage:null;return{workspaceId:i,title:s.title,repoRef:s.repositoryName?`${s.repositoryOwner?`${s.repositoryOwner}/`:""}${s.repositoryName}`:s.branch,stateKey:o,attention:d,isUnread:d===se,isWaiting:s.waiting===!0,statusMessage:g,attentionSnippet:he(e,o,c),prNumber:typeof s.prNumber=="number"?s.prNumber:null,keySlot:r===-1?null:r,tasks:u?{total:u.total,completed:u.completed,inProgress:u.inProgress}:Ae,tokens:a?q(a):0,agents:we(c)}})}),R=4;function be(e,t,n){const s=e.agentSessions?.byAgentId[n.id];return!s||String(s.workspaceId)!==t||s.pendingDeleteAt||K(V(n,s))!=="topLevel"?!1:!h(e,n.id)}const ve=l.createSelector(e=>{const t={},n=e.hud.attentionByWorkspaceId;for(const s of S.select(e)){const i=String(s.id),r=new Map,d=(f,p)=>{const A=r.get(f)??[];A.includes(p)||A.push(p),r.set(f,A)},o=w(s).filter(f=>be(e,i,f));for(const f of o){const p=I(e,f);p.bucket==="failed"?d("failed",f.name):p.hasQuestion?d("question",f.name):p.attentionKind==="blocker"?d("blocker",f.name):p.attentionKind==="discussion"&&d("discussion",f.name),p.isRunning&&d("running",f.name)}const a=b(s);a==="failed"&&!r.has("failed")&&r.set("failed",[]),a==="blocked"&&!r.has("blocker")&&r.set("blocker",[]),a==="wait"&&!r.has("question")&&!r.has("blocker")&&!r.has("discussion")&&r.set("needs_input",[]);const u=n[i]?.attention??(typeof s.attention=="string"&&F(s.attention)?s.attention:null);u==="review_required"&&r.set("review",[]),u==="unread"&&r.set("unread",[]),s.activity==="agent_running"&&!r.has("running")&&r.set("running",[]);const g=oe.flatMap(f=>{const p=r.get(f);return p?[{category:f,count:Math.max(1,p.length),agentNames:p}]:[]});if(g.length===0)continue;const k=g.length>R;t[i]={agentCount:o.length,categories:g,visibleCategories:k?g.slice(0,R-1):g,hiddenCategoryCount:k?g.length-(R-1):0}}return t});l.createSelector(e=>{const t=e.hud.attentionByWorkspaceId;let n=0;for(const s of S.select(e)){let i=!1;for(const c of v(s,e))c.topLevel&&!c.isBackground&&!h(e,c.id)&&(c.bucket==="failed"||c.attentionKind!==null||c.hasQuestion)&&(n+=1,i=!0);const r=t[String(s.id)],d=r!==void 0&&P(r.attention);d&&(n+=1),G.has(b(s))&&!i&&!d&&(n+=1)}return n});function Te(e,t,n,s){const i=s.slice().sort((o,a)=>a.createdAt-o.createdAt);for(const o of i){const u=e.agentSessions?.byAgentId[o.agentId]?.metadata?.completionReport;if(typeof u=="string"&&u.trim().length>0)return u}const r=e.workspaceNotes?.byWorkspaceId[t]?.notes,d=r?m(r,n):void 0,c=d?.content||d?.contentPreview;return typeof c=="string"&&c.trim().length>0?c:null}const Xe=l.createSelector((e,t)=>{const n=B.select(e).find(a=>a.workspaceId===t);if(!n)return null;const s=m(e.workspace.workspaces,t),i=s?v(s,e):[],r=new Map(i.map(a=>[a.id,a])),d=e.taskAgentAssociations?.byWorkspaceId[t]?.byNoteId??{},c=e.workspaceTasks?.byWorkspaceId[t],o=c?_(c.tasks).filter(a=>a.status!=="cancelled").map(a=>{const u=Object.values(d[a.id]??{});return{id:a.id,title:a.title,status:a.status,agents:u.map(g=>r.get(g.agentId)).filter(g=>!!g),report:a.status==="complete"?Te(e,t,a.id,u):null,...a.specLinked!==void 0?{specLinked:a.specLinked}:{},...a.dependsOn?{dependsOn:a.dependsOn}:{},...a.conflictsWith?{conflictsWith:a.conflictsWith}:{},...a.unmetDependsOn?{unmetDependsOn:a.unmetDependsOn}:{}}}):[];return{workspaceId:t,title:n.title,repoRef:n.repoRef,statusMessage:n.statusMessage,keySlot:n.keySlot,stats:n.tasks,tasks:o,activeAgents:i.filter(a=>y.has(a.bucket)),idleAgents:i.filter(a=>!y.has(a.bucket))}}),Oe=new Set(["failed","blocker","question","discussion","needs_input","review"]);function Me(e){for(const t of e?.categories??[])switch(t.category){case"failed":return"failure";case"blocker":return"blocker";case"question":return"question";case"review":return"review"}return"none"}const Re=3,ze=l.createSelector((e,t="recent")=>{const n=B.select(e),s=ve.select(e),i=new Map(S.select(e).map(c=>[String(c.id),c])),r={action:[],unread:[],active:[]};for(const c of n){const o=i.get(c.workspaceId);if(!o||o.id===ie)continue;const a=e.hud.dockConversationAtByWorkspaceId[c.workspaceId];if(!E(a,e.hud.dockRecencyNow)&&!fe(a,e.hud.dockRecencyNow))continue;const u=s[c.workspaceId],g=u?.categories??[],k=g.some(T=>Oe.has(T.category)),f=c.isUnread,p=g.some(T=>T.category==="running"),A=k?"action":f?"unread":"active";r[A].push({workspace:o,badgeKind:Me(u),priorityGroup:A,isUnread:f,isRunning:p,isWaiting:c.isWaiting})}return[...r.action,...r.unread,...r.active].sort((c,o)=>e.hud.dockConversationAtByWorkspaceId[String(o.workspace.id)]-e.hud.dockConversationAtByWorkspaceId[String(c.workspace.id)]||String(c.workspace.id).localeCompare(String(o.workspace.id))).filter((c,o)=>{const a=o<Re||E(e.hud.dockConversationAtByWorkspaceId[String(c.workspace.id)],e.hud.dockRecencyNow);return t==="older"?!a:a})}),Ze=l.createSelector(e=>e.hud.dockPlacement),$e=l.createSelector(e=>e.hud.dockPlacementError),Ye=l.createSelector(e=>e.hud.dockFocusRequest),et=l.createSelector(e=>e.hud.dockCloseRequest),tt=l.createSelector(e=>e.hud.dockDragStartResult),nt=l.createSelector(e=>e.hud.dockResizeStartResult),st=l.createSelector(e=>({pending:e.hud.dockMachineSwitching,error:e.hud.dockMachineSwitchError})),ot=l.createSelector(e=>{const t=e.hud.dockEditorCompactRequest,n=e.dockConversation,s=n.workspaceId&&n.agentId?m(n.evidence,JSON.stringify([n.workspaceId,n.agentId])):null,i=!!n.nativeSpeech.activeId||!!s?.annotation||s?.clips.some(r=>r.status==="recording")||e.hardwareConsole.pttRecording||e.hardwareConsole.voiceTranscribing;return t&&!i&&e.hud.active&&t.conversationGeneration===n.generation&&t.authority===L(e)&&t.backendId===e.connections.windowBackendId&&t.workspaceId===e.dockConversation.workspaceId&&t.agentId===e.dockConversation.agentId?t:null});export{qe as A,Qe as B,ve as C,et as a,tt as b,ot as c,Ye as d,st as e,Ze as f,$e as g,Ne as h,de as i,nt as j,ze as k,Ue as l,Ve as m,je as n,Ke as o,Fe as p,Je as q,Ee as r,De as s,Le as t,He as u,xe as v,Ge as w,Xe as x,Pe as y,B as z};