@intent-hq/web 2.391.1 → 2.392.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (326) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{CpwS8V1F.js → 1NvRJVY9.js} +1 -1
  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/{DLqZuVvj.js → 52kdRKiP.js} +1 -1
  6. package/web/app/immutable/chunks/{pXrAh3i2.js → 7590d3_e.js} +1 -1
  7. package/web/app/immutable/chunks/{CaX8Mme7.js → 7BHYBi88.js} +1 -1
  8. package/web/app/immutable/chunks/{DJcR4XQR.js → 8ljmIEEj.js} +1 -1
  9. package/web/app/immutable/chunks/{DXCHCOFX.js → 9ryMZ44V.js} +1 -1
  10. package/web/app/immutable/chunks/{DISm8kek.js → AVUhaNFO.js} +1 -1
  11. package/web/app/immutable/chunks/{ByP-EusE.js → B-mEBo1a.js} +1 -1
  12. package/web/app/immutable/chunks/{CVtLV3_x.js → B0SSzYpD.js} +1 -1
  13. package/web/app/immutable/chunks/{9eqoPT_C.js → B2-ooCTr.js} +1 -1
  14. package/web/app/immutable/chunks/{CedswVQA.js → B36ccT8S.js} +1 -1
  15. package/web/app/immutable/chunks/{CIxnaBAb.js → B469nFvV.js} +2 -2
  16. package/web/app/immutable/chunks/{YQwkPi_0.js → B4OBYHli.js} +1 -1
  17. package/web/app/immutable/chunks/{g5QqP-QE.js → B6Qz5J1y.js} +1 -1
  18. package/web/app/immutable/chunks/{CwOdvmTo.js → B6SGYvow.js} +3 -3
  19. package/web/app/immutable/chunks/{23FyIn6O.js → B76dt5zP.js} +1 -1
  20. package/web/app/immutable/chunks/{Dh1j4V0b.js → B77w2td3.js} +1 -1
  21. package/web/app/immutable/chunks/{DWRtOXBU.js → B8RXlIBH.js} +1 -1
  22. package/web/app/immutable/chunks/{DG3-me8H.js → B8m3-qrW.js} +1 -1
  23. package/web/app/immutable/chunks/{C5tJUrGJ.js → B8pX1T5t.js} +1 -1
  24. package/web/app/immutable/chunks/{Dt_7lHy8.js → B9-jkWWp.js} +1 -1
  25. package/web/app/immutable/chunks/{DPk2fLxi.js → B9R2bql6.js} +1 -1
  26. package/web/app/immutable/chunks/{CT8vPg_p.js → BAtAwQ72.js} +2 -2
  27. package/web/app/immutable/chunks/{DGU9U1O6.js → BBfR26V0.js} +1 -1
  28. package/web/app/immutable/chunks/{BB2vaoZ2.js → BCL-o_Md.js} +3 -3
  29. package/web/app/immutable/chunks/{C4l6men1.js → BCw-LKCu.js} +1 -1
  30. package/web/app/immutable/chunks/{CoSEZL3s.js → BCwKGJpG.js} +1 -1
  31. package/web/app/immutable/chunks/{WYNXUtt9.js → BDQvAsU6.js} +1 -1
  32. package/web/app/immutable/chunks/{KWtYfwVq.js → BE4DZU9i.js} +1 -1
  33. package/web/app/immutable/chunks/{C3JJkOFb.js → BEGGqaof.js} +1 -1
  34. package/web/app/immutable/chunks/{CyvzL5p8.js → BFO-Le8U.js} +3 -3
  35. package/web/app/immutable/chunks/{CUZpLDKB.js → BFVncOQi.js} +1 -1
  36. package/web/app/immutable/chunks/BGSmaq6H.js +1 -0
  37. package/web/app/immutable/chunks/{CEyWnfg4.js → BJIUXUAo.js} +1 -1
  38. package/web/app/immutable/chunks/{z4O7yNZ6.js → BJRZEnHw.js} +1 -1
  39. package/web/app/immutable/chunks/{Dd_KPYBw.js → BK5l06W2.js} +1 -1
  40. package/web/app/immutable/chunks/{B_JGVEqN.js → BKGQPtRi.js} +1 -1
  41. package/web/app/immutable/chunks/BKxcGjV6.js +1 -0
  42. package/web/app/immutable/chunks/{DoJ49Zrl.js → BLUGgUG-.js} +1 -1
  43. package/web/app/immutable/chunks/{C2tSFTTb.js → BN9pl0_x.js} +1 -1
  44. package/web/app/immutable/chunks/{Bpi8OSTE.js → BNNeufNk.js} +1 -1
  45. package/web/app/immutable/chunks/{DLt9OoMP.js → BPd-Q6x4.js} +1 -1
  46. package/web/app/immutable/chunks/{CV17KbhT.js → BQ5x_RaT.js} +1 -1
  47. package/web/app/immutable/chunks/{B26ZHg3s.js → BRCr02in.js} +1 -1
  48. package/web/app/immutable/chunks/{DidHgSQp.js → BRPh2Gky.js} +2 -2
  49. package/web/app/immutable/chunks/{CHIxjTWu.js → BS1zON0P.js} +1 -1
  50. package/web/app/immutable/chunks/{kkKMJ9w9.js → BS5e_kKu.js} +1 -1
  51. package/web/app/immutable/chunks/{6JlgfFWd.js → BT6sDnDt.js} +1 -1
  52. package/web/app/immutable/chunks/{BSKVcPN7.js → BVhnyyZ7.js} +1 -1
  53. package/web/app/immutable/chunks/{CH6Im5iM.js → BYfDvU8j.js} +1 -1
  54. package/web/app/immutable/chunks/{DMudvlKI.js → BZnji9hP.js} +4 -4
  55. package/web/app/immutable/chunks/{D3pRyooW.js → B_4oJZFT.js} +1 -1
  56. package/web/app/immutable/chunks/{z0xDttNV.js → B_DmwFyf.js} +3 -3
  57. package/web/app/immutable/chunks/{C1MYTxgW.js → B_GvRk21.js} +1 -1
  58. package/web/app/immutable/chunks/{BQCtWEZ2.js → BbK9qDRy.js} +1 -1
  59. package/web/app/immutable/chunks/{Ci6PI5sn.js → Bc4EBjSN.js} +1 -1
  60. package/web/app/immutable/chunks/{CiHhUIjb.js → BdWMbiFk.js} +1 -1
  61. package/web/app/immutable/chunks/{7-WRRruG.js → Bdh-SKNo.js} +1 -1
  62. package/web/app/immutable/chunks/{D9R5fzn8.js → Beq_QLuz.js} +1 -1
  63. package/web/app/immutable/chunks/{D9T_0Eev.js → Bg5K6Ci3.js} +3 -3
  64. package/web/app/immutable/chunks/{B2Ny2uiy.js → Bh3yfjRP.js} +1 -1
  65. package/web/app/immutable/chunks/{DynUeYUu.js → BhYXv0ZM.js} +1 -1
  66. package/web/app/immutable/chunks/{CKTB5KRw.js → BhxHPYvf.js} +1 -1
  67. package/web/app/immutable/chunks/{Di3gErxh.js → BirGv2ci.js} +1 -1
  68. package/web/app/immutable/chunks/{Csqi0oV3.js → Bj58rFtD.js} +1 -1
  69. package/web/app/immutable/chunks/{0R5VEpaM.js → BjEG_fCJ.js} +4 -4
  70. package/web/app/immutable/chunks/{CA-b7pAY.js → BjPpzZjk.js} +2 -2
  71. package/web/app/immutable/chunks/{CwqJ7uz4.js → Bk3dX2Ob.js} +1 -1
  72. package/web/app/immutable/chunks/{BLtLj2yz.js → BkxevPaB.js} +1 -1
  73. package/web/app/immutable/chunks/{OsJD3pkm.js → Bky3Gaqa.js} +1 -1
  74. package/web/app/immutable/chunks/{CwCvyVGi.js → BmqZzhgO.js} +1 -1
  75. package/web/app/immutable/chunks/{B28HQLvX.js → BmyNM7bS.js} +1 -1
  76. package/web/app/immutable/chunks/{BRScUzfU.js → BnGY4PVn.js} +1 -1
  77. package/web/app/immutable/chunks/{Dk7Kxi97.js → BnJ52enz.js} +1 -1
  78. package/web/app/immutable/chunks/{BZCcX8wj.js → BnbmXiW4.js} +2 -2
  79. package/web/app/immutable/chunks/{Chbrtg19.js → BnnKw3Va.js} +1 -1
  80. package/web/app/immutable/chunks/{DmQ5G_6J.js → Bo0PodRV.js} +1 -1
  81. package/web/app/immutable/chunks/{BDeGl6ee.js → Boky5e4-.js} +1 -1
  82. package/web/app/immutable/chunks/{Cxc8q3rR.js → BonA_mfc.js} +1 -1
  83. package/web/app/immutable/chunks/{DIIj7EWA.js → BpFxCD0b.js} +1 -1
  84. package/web/app/immutable/chunks/{qWgJ-CUF.js → BqF1bVQC.js} +2 -2
  85. package/web/app/immutable/chunks/{DqtLBCnq.js → BqRQBnTW.js} +1 -1
  86. package/web/app/immutable/chunks/{9GL-RXJZ.js → Bs5b-3jJ.js} +1 -1
  87. package/web/app/immutable/chunks/{BM39k1x6.js → BusD2v6a.js} +1 -1
  88. package/web/app/immutable/chunks/{Bhyo7hBL.js → Bvwrya09.js} +1 -1
  89. package/web/app/immutable/chunks/{RV6uszBL.js → Bw-Zu1Zf.js} +1 -1
  90. package/web/app/immutable/chunks/{QzxpbvSo.js → BwweojP5.js} +1 -1
  91. package/web/app/immutable/chunks/{K0WiFC8Y.js → BxCgCRwx.js} +1 -1
  92. package/web/app/immutable/chunks/{CnDgS0vt.js → ByaJIEgQ.js} +1 -1
  93. package/web/app/immutable/chunks/{DuZtgB5V.js → BybDBA-a.js} +1 -1
  94. package/web/app/immutable/chunks/{CyinuwPx.js → BzKqzACd.js} +1 -1
  95. package/web/app/immutable/chunks/{Bz80vYvX.js → BzXQ5SMs.js} +1 -1
  96. package/web/app/immutable/chunks/{Q1bO23Hj.js → C-BJXKy-.js} +1 -1
  97. package/web/app/immutable/chunks/{BSZu3BUb.js → C-e2e9PC.js} +1 -1
  98. package/web/app/immutable/chunks/{BTXzEcFX.js → C0JQvbI4.js} +1 -1
  99. package/web/app/immutable/chunks/{CAGrRNbp.js → C1SGWBXH.js} +1 -1
  100. package/web/app/immutable/chunks/{B4Yz29Q3.js → C2RnxEnO.js} +1 -1
  101. package/web/app/immutable/chunks/{DR_b4dt8.js → C3AR_gNB.js} +1 -1
  102. package/web/app/immutable/chunks/{DcraaizU.js → C3KgmGxd.js} +1 -1
  103. package/web/app/immutable/chunks/C3cVfkio.js +1 -0
  104. package/web/app/immutable/chunks/{BaXq2aUL.js → C4AJzMws.js} +46 -46
  105. package/web/app/immutable/chunks/{Cr5mKkdD.js → C6DQmPVB.js} +1 -1
  106. package/web/app/immutable/chunks/{DMEIbJII.js → C7b3vXLD.js} +1 -1
  107. package/web/app/immutable/chunks/{S3jMTv3a.js → C7q_UkFQ.js} +1 -1
  108. package/web/app/immutable/chunks/{BMTanQ2Z.js → C8OXQeb2.js} +1 -1
  109. package/web/app/immutable/chunks/{Bb-kpHQF.js → C8PR5GO9.js} +1 -1
  110. package/web/app/immutable/chunks/{DvUsJK3H.js → C8TRSNUb.js} +1 -1
  111. package/web/app/immutable/chunks/{CnFZbWXv.js → CA6H1-bp.js} +1 -1
  112. package/web/app/immutable/chunks/{gQ8VFuWN.js → CB8FMdnB.js} +2 -2
  113. package/web/app/immutable/chunks/{Bhq56Jsu.js → CCAtqaSn.js} +1 -1
  114. package/web/app/immutable/chunks/{CREbzS7Z.js → CCSQmeuF.js} +1 -1
  115. package/web/app/immutable/chunks/{CUgl7USU.js → CDD7ui9Z.js} +1 -1
  116. package/web/app/immutable/chunks/{B9Nn4kQr.js → CDUMf4mn.js} +1 -1
  117. package/web/app/immutable/chunks/{DxmPtFKv.js → CDjbPb5H.js} +1 -1
  118. package/web/app/immutable/chunks/{CAUJiTuz.js → CDtaIFAl.js} +1 -1
  119. package/web/app/immutable/chunks/{BcdTbj6d.js → CGO_zr9m.js} +1 -1
  120. package/web/app/immutable/chunks/{BkcCJyDK.js → CH7HNVC2.js} +1 -1
  121. package/web/app/immutable/chunks/{BAMJ8Hnj.js → CIqC9ucK.js} +1 -1
  122. package/web/app/immutable/chunks/{BOPrepKH.js → COmspkQo.js} +1 -1
  123. package/web/app/immutable/chunks/{GwtGeFMJ.js → CPUJ3EYc.js} +1 -1
  124. package/web/app/immutable/chunks/{Cnkux63v.js → CQPid4Qr.js} +1 -1
  125. package/web/app/immutable/chunks/{CbB6SI0i.js → CRm25OCR.js} +1 -1
  126. package/web/app/immutable/chunks/{mFWmuyR-.js → CS6als-f.js} +1 -1
  127. package/web/app/immutable/chunks/{CCzPC_cB.js → CSbEYhAV.js} +1 -1
  128. package/web/app/immutable/chunks/{DHkcvVzr.js → CTkkv_Ih.js} +1 -1
  129. package/web/app/immutable/chunks/{JiW1DfLK.js → CUtsQ_at.js} +1 -1
  130. package/web/app/immutable/chunks/{Drn9m8Tp.js → CV86ty5-.js} +1 -1
  131. package/web/app/immutable/chunks/{fCtMtGYt.js → CVZzx9IJ.js} +1 -1
  132. package/web/app/immutable/chunks/{DQpGArF7.js → CVx5OKWy.js} +1 -1
  133. package/web/app/immutable/chunks/{CGmYraIa.js → CWfjuhY2.js} +1 -1
  134. package/web/app/immutable/chunks/{CRXlvdEs.js → CWtyXmQ4.js} +1 -1
  135. package/web/app/immutable/chunks/{1-MeqddK.js → CXTQXSCs.js} +1 -1
  136. package/web/app/immutable/chunks/{CWXVdpgZ.js → CXygwMkb.js} +1 -1
  137. package/web/app/immutable/chunks/{B1lpukIv.js → CZfU7DE3.js} +1 -1
  138. package/web/app/immutable/chunks/{B2Q_FC4n.js → Ca1iiPGq.js} +3 -3
  139. package/web/app/immutable/chunks/{B7hWIBzm.js → Cb6ALa0V.js} +1 -1
  140. package/web/app/immutable/chunks/{Ao0jjYj2.js → CbSZGuz9.js} +1 -1
  141. package/web/app/immutable/chunks/{DFKhOU69.js → Cc0763mU.js} +1 -1
  142. package/web/app/immutable/chunks/{B6m0Dypi.js → CcijsN8m.js} +1 -1
  143. package/web/app/immutable/chunks/{-CpNnXIW.js → CdtwTpzR.js} +1 -1
  144. package/web/app/immutable/chunks/{C9N7yhqm.js → Ce-va2I0.js} +1 -1
  145. package/web/app/immutable/chunks/{C22cBcHz.js → Ch9YoFhc.js} +1 -1
  146. package/web/app/immutable/chunks/{COofQgO0.js → ChHRVjww.js} +1 -1
  147. package/web/app/immutable/chunks/{BlzuDW6O.js → CjrqEuvI.js} +1 -1
  148. package/web/app/immutable/chunks/{BOVldAsb.js → CkTAy7fl.js} +1 -1
  149. package/web/app/immutable/chunks/{DXXFBdjF.js → CkyxPppw.js} +1 -1
  150. package/web/app/immutable/chunks/{D49mWFig.js → CnPYlvZC.js} +1 -1
  151. package/web/app/immutable/chunks/{DUTvR2si.js → CpK0xLH4.js} +1 -1
  152. package/web/app/immutable/chunks/{jyQWudgn.js → Cq97NFfR.js} +1 -1
  153. package/web/app/immutable/chunks/{BVUW22uN.js → CqPoxrPz.js} +1 -1
  154. package/web/app/immutable/chunks/{BczcQRsN.js → CqRvL4xi.js} +1 -1
  155. package/web/app/immutable/chunks/{CAUle5iU.js → CtBzyNOX.js} +1 -1
  156. package/web/app/immutable/chunks/{BrL12o40.js → CtcGxSOx.js} +1 -1
  157. package/web/app/immutable/chunks/{CjpWOZGa.js → Cu9dGfYE.js} +1 -1
  158. package/web/app/immutable/chunks/{DJqiMUht.js → Cv-fAWZf.js} +1 -1
  159. package/web/app/immutable/chunks/{C5fxud9g.js → Cv6grH4l.js} +1 -1
  160. package/web/app/immutable/chunks/{CU15H7o_.js → Cx394IAH.js} +1 -1
  161. package/web/app/immutable/chunks/{BXwdb0J5.js → Cx8Rw_sH.js} +3 -3
  162. package/web/app/immutable/chunks/{Bx1P9uW7.js → CxR-pcVt.js} +1 -1
  163. package/web/app/immutable/chunks/{BFHmbbvG.js → CxuKWK-9.js} +2 -2
  164. package/web/app/immutable/chunks/{DF54qNJU.js → CyHB14hJ.js} +1 -1
  165. package/web/app/immutable/chunks/{D59tCG3q.js → CykElrvo.js} +2 -2
  166. package/web/app/immutable/chunks/{CTgYTdXw.js → Cz3WzTlQ.js} +1 -1
  167. package/web/app/immutable/chunks/{CiKoEJ2m.js → D0qhIm1r.js} +1 -1
  168. package/web/app/immutable/chunks/{CeoBhFo7.js → D179JMBI.js} +1 -1
  169. package/web/app/immutable/chunks/{COo5pTrI.js → D3m2Y1N8.js} +1 -1
  170. package/web/app/immutable/chunks/{DE8II0cx.js → D42wJcQ3.js} +1 -1
  171. package/web/app/immutable/chunks/{Dl1AOLZu.js → D5A4PJDt.js} +1 -1
  172. package/web/app/immutable/chunks/{Cgz4dZpP.js → D5ocbEo-.js} +1 -1
  173. package/web/app/immutable/chunks/{DoB-G8kB.js → D6H34kDj.js} +1 -1
  174. package/web/app/immutable/chunks/{aWBSU8IQ.js → D7KhILhs.js} +1 -1
  175. package/web/app/immutable/chunks/{CLMwPQBQ.js → D7VoSTzK.js} +1 -1
  176. package/web/app/immutable/chunks/{Cr9C4VDu.js → D7rh8Clb.js} +1 -1
  177. package/web/app/immutable/chunks/{SdVpHK7d.js → D7z6HEeo.js} +1 -1
  178. package/web/app/immutable/chunks/{DF15jnSX.js → D8CQQUv8.js} +1 -1
  179. package/web/app/immutable/chunks/{DyreqWqr.js → D8cNe_33.js} +1 -1
  180. package/web/app/immutable/chunks/{CzxEKNiF.js → D9gMMVdB.js} +1 -1
  181. package/web/app/immutable/chunks/{CDh2mZdS.js → DEQnE_KB.js} +1 -1
  182. package/web/app/immutable/chunks/{DcPZfWKB.js → DFRVxmWf.js} +1 -1
  183. package/web/app/immutable/chunks/{Dgo57zmq.js → DHMxSQaO.js} +1 -1
  184. package/web/app/immutable/chunks/{Dr6-g-BO.js → DITs7RNY.js} +1 -1
  185. package/web/app/immutable/chunks/{BU9me3Pg.js → DJSAkzw5.js} +1 -1
  186. package/web/app/immutable/chunks/{KaOLys0u.js → DJZIHUd7.js} +1 -1
  187. package/web/app/immutable/chunks/{HiIoMspb.js → DLPlXnVY.js} +1 -1
  188. package/web/app/immutable/chunks/{k48f0Jn8.js → DMOXpjfz.js} +1 -1
  189. package/web/app/immutable/chunks/{B7pblHOt.js → DON9zoQ1.js} +1 -1
  190. package/web/app/immutable/chunks/{CwqyVbqi.js → DP31pjuo.js} +3 -3
  191. package/web/app/immutable/chunks/{uyQciu7h.js → DPbxpEc3.js} +4 -4
  192. package/web/app/immutable/chunks/{B5-Plsom.js → DQ3EU1b-.js} +1 -1
  193. package/web/app/immutable/chunks/{BuyrOC4V.js → DQYwt0RJ.js} +1 -1
  194. package/web/app/immutable/chunks/{BFfRQORP.js → DRMe5Ypb.js} +1 -1
  195. package/web/app/immutable/chunks/{Cn4-Fvkn.js → DT_a2Oi3.js} +1 -1
  196. package/web/app/immutable/chunks/{Cxmepjfl.js → DWjpzYNk.js} +1 -1
  197. package/web/app/immutable/chunks/{bJK6npyT.js → DYrrsQ1p.js} +1 -1
  198. package/web/app/immutable/chunks/{CfDqTHT1.js → D_-4DIK6.js} +1 -1
  199. package/web/app/immutable/chunks/{BGeImWEk.js → D_jEt7ej.js} +1 -1
  200. package/web/app/immutable/chunks/{BWQPB65O.js → DbPBKS19.js} +1 -1
  201. package/web/app/immutable/chunks/{DupTZXsI.js → DbSflHPQ.js} +1 -1
  202. package/web/app/immutable/chunks/{BHgSQJqT.js → Dbqo6rfT.js} +1 -1
  203. package/web/app/immutable/chunks/{TPru2I57.js → DcrCEeFN.js} +1 -1
  204. package/web/app/immutable/chunks/{n0_jgWL7.js → DeLdUBWT.js} +1 -1
  205. package/web/app/immutable/chunks/{D3tqOSzT.js → DepS1LOg.js} +1 -1
  206. package/web/app/immutable/chunks/{DW8fwVBf.js → DfINI0LK.js} +1 -1
  207. package/web/app/immutable/chunks/{Em5CdgqH.js → DfyDNbbj.js} +4 -4
  208. package/web/app/immutable/chunks/{CktgkomQ.js → DhXSKt_a.js} +1 -1
  209. package/web/app/immutable/chunks/{DOhHP999.js → DjAFd7Fr.js} +1 -1
  210. package/web/app/immutable/chunks/{l7sDKa65.js → Dk9lUzSs.js} +1 -1
  211. package/web/app/immutable/chunks/{C3jMXj_V.js → DkQdSPDN.js} +1 -1
  212. package/web/app/immutable/chunks/{Cp-4w4r1.js → DnNE_pmq.js} +1 -1
  213. package/web/app/immutable/chunks/{BM2ubpAw.js → DoFGyuPK.js} +1 -1
  214. package/web/app/immutable/chunks/{D5Jk5CWk.js → DpDGJXfb.js} +2 -2
  215. package/web/app/immutable/chunks/{CK543FRe.js → DqQWmhFJ.js} +1 -1
  216. package/web/app/immutable/chunks/{C8E14ldW.js → DrCYFWYk.js} +1 -1
  217. package/web/app/immutable/chunks/{D7QFmXLb.js → DsDbrkJf.js} +1 -1
  218. package/web/app/immutable/chunks/{QeZhJHLb.js → DtuubiMf.js} +1 -1
  219. package/web/app/immutable/chunks/{BT8mEFV6.js → DuYgHIqV.js} +1 -1
  220. package/web/app/immutable/chunks/{BJCm9MUD.js → Dusq2uGc.js} +1 -1
  221. package/web/app/immutable/chunks/{BmaG8vdR.js → Dv2WcD53.js} +1 -1
  222. package/web/app/immutable/chunks/{zXLHCuiE.js → DvEcqVUt.js} +1 -1
  223. package/web/app/immutable/chunks/{DQNtbVVY.js → DwJUGAx4.js} +3 -3
  224. package/web/app/immutable/chunks/{CR5XXYcE.js → DwwEvwlj.js} +1 -1
  225. package/web/app/immutable/chunks/{9qqz3Jr0.js → DzNzbnYA.js} +1 -1
  226. package/web/app/immutable/chunks/{DhTLwmro.js → EK8GFErl.js} +1 -1
  227. package/web/app/immutable/chunks/Fcr7AvC-.js +1 -0
  228. package/web/app/immutable/chunks/{D__sU8Ug.js → Fiwts6D3.js} +1 -1
  229. package/web/app/immutable/chunks/{Byobtdo1.js → G_kSYo3Y.js} +1 -1
  230. package/web/app/immutable/chunks/{DcU8bi_n.js → IHdKCjQM.js} +2 -2
  231. package/web/app/immutable/chunks/{B7hGbqIM.js → IhhtpC0N.js} +1 -1
  232. package/web/app/immutable/chunks/{BS9WBIBb.js → O5ZlQHf9.js} +1 -1
  233. package/web/app/immutable/chunks/{ChYLETZB.js → OqslD7bF.js} +1 -1
  234. package/web/app/immutable/chunks/{By2YlE-l.js → Qvf67TfJ.js} +1 -1
  235. package/web/app/immutable/chunks/{DeFlL2nh.js → R2QRct6h.js} +1 -1
  236. package/web/app/immutable/chunks/{BNYZa6GV.js → Rq6GuI3F.js} +1 -1
  237. package/web/app/immutable/chunks/{Xgzr3BTD.js → T6UBEOFc.js} +1 -1
  238. package/web/app/immutable/chunks/{BpezAJRw.js → TdGvVwuC.js} +1 -1
  239. package/web/app/immutable/chunks/{DSZbBNDD.js → Tgw7Kdvt.js} +1 -1
  240. package/web/app/immutable/chunks/{P7zPRuFC.js → U5o8u-di.js} +1 -1
  241. package/web/app/immutable/chunks/{BUSErGiB.js → UWtWVoQE.js} +1 -1
  242. package/web/app/immutable/chunks/{BCLYeYwk.js → W7uazUja.js} +1 -1
  243. package/web/app/immutable/chunks/{CDUYzZ2W.js → WWDClKTE.js} +1 -1
  244. package/web/app/immutable/chunks/{DEr2A_-h.js → Xk1ND_1x.js} +2 -2
  245. package/web/app/immutable/chunks/{DlljGo_I.js → Y8hdNZSZ.js} +1 -1
  246. package/web/app/immutable/chunks/{Dh-DCh2Y.js → YsAO4v_N.js} +1 -1
  247. package/web/app/immutable/chunks/{C00PRSTi.js → Z_lXVxA_.js} +1 -1
  248. package/web/app/immutable/chunks/{C-nTKxY9.js → ZfkZCfTr.js} +1 -1
  249. package/web/app/immutable/chunks/{CLvqghA8.js → ZmAQurQV.js} +1 -1
  250. package/web/app/immutable/chunks/{CHUYHKuh.js → _IIJlCYC.js} +1 -1
  251. package/web/app/immutable/chunks/{BU3y3Xes.js → _IjN0Lbt.js} +1 -1
  252. package/web/app/immutable/chunks/{iQDlfKDR.js → cD292w1o.js} +1 -1
  253. package/web/app/immutable/chunks/{ClaP_sir.js → dvKmN4h6.js} +1 -1
  254. package/web/app/immutable/chunks/{Crey45Oa.js → f5b-J-bi.js} +1 -1
  255. package/web/app/immutable/chunks/{ZX798KkU.js → gKdztwD8.js} +1 -1
  256. package/web/app/immutable/chunks/{BdhKX9ZN.js → gNR_yDDX.js} +1 -1
  257. package/web/app/immutable/chunks/{D5al-p9o.js → ggRB4LMK.js} +1 -1
  258. package/web/app/immutable/chunks/{axwUS21u.js → ghzRmqKs.js} +1 -1
  259. package/web/app/immutable/chunks/{FM3MDwzB.js → gocm4HZf.js} +1 -1
  260. package/web/app/immutable/chunks/{DBYe3Dcp.js → i2kR60wc.js} +2 -2
  261. package/web/app/immutable/chunks/{CdTSfppl.js → iCTyujt5.js} +1 -1
  262. package/web/app/immutable/chunks/{IxxdIKNN.js → iMqZaR5X.js} +1 -1
  263. package/web/app/immutable/chunks/{BT5iyspK.js → iNacp7Sr.js} +1 -1
  264. package/web/app/immutable/chunks/{BjGqF2I6.js → iViWtmHm.js} +1 -1
  265. package/web/app/immutable/chunks/{D3JNbQ4D.js → jphlY6bT.js} +1 -1
  266. package/web/app/immutable/chunks/{JvFe2B29.js → k5fprFtz.js} +1 -1
  267. package/web/app/immutable/chunks/{DSs6r6NG.js → kSTrWIIB.js} +1 -1
  268. package/web/app/immutable/chunks/{CEA7jD1C.js → koUs6Gjt.js} +1 -1
  269. package/web/app/immutable/chunks/{rwibDzZr.js → l3Y4i65_.js} +1 -1
  270. package/web/app/immutable/chunks/{DDvFH8QS.js → lE7gD_tn.js} +1 -1
  271. package/web/app/immutable/chunks/{BTvJ4T_4.js → lK1e5NlM.js} +1 -1
  272. package/web/app/immutable/chunks/{C9wxB2bb.js → m8Q2Rt7R.js} +2 -2
  273. package/web/app/immutable/chunks/{DHvVAxAW.js → mE5-Vs-0.js} +1 -1
  274. package/web/app/immutable/chunks/{BLfqsc2a.js → mpTxy2jJ.js} +1 -1
  275. package/web/app/immutable/chunks/pUywXnJP.js +1 -0
  276. package/web/app/immutable/chunks/{DWBUvNGh.js → qLTVpfPn.js} +1 -1
  277. package/web/app/immutable/chunks/{BBcnUEuQ.js → qqJggbSF.js} +1 -1
  278. package/web/app/immutable/chunks/s_T1Uukt.js +1 -0
  279. package/web/app/immutable/chunks/{5az3n8fR.js → uPtH8pRz.js} +1 -1
  280. package/web/app/immutable/chunks/{Cn-Afla1.js → u_H5ILVa.js} +1 -1
  281. package/web/app/immutable/chunks/{sFief-xo.js → udmuNwTR.js} +1 -1
  282. package/web/app/immutable/chunks/{D5tDAzIo.js → vezRCn6E.js} +1 -1
  283. package/web/app/immutable/chunks/{CPnqf2bo.js → vpLnaArD.js} +1 -1
  284. package/web/app/immutable/chunks/{BKKCpqXK.js → w3KJAO4V.js} +2 -2
  285. package/web/app/immutable/chunks/{CiRkFhK8.js → wRT2cc73.js} +1 -1
  286. package/web/app/immutable/chunks/{BVwQph9_.js → wtJmZfcy.js} +1 -1
  287. package/web/app/immutable/chunks/{B3T1oiJl.js → x4bPxhVW.js} +1 -1
  288. package/web/app/immutable/chunks/{DnzDw_9l.js → xK5y1U34.js} +1 -1
  289. package/web/app/immutable/chunks/{Cd-qmx8U.js → y83c7yRZ.js} +1 -1
  290. package/web/app/immutable/chunks/{Cq8_4net.js → ynQC8xZQ.js} +1 -1
  291. package/web/app/immutable/chunks/{DJSvqrCI.js → zFu37m6L.js} +1 -1
  292. package/web/app/immutable/entry/{app.B0HiWR5T.js → app.aDjWpyk7.js} +3 -3
  293. package/web/app/immutable/entry/start.1qdHg029.js +1 -0
  294. package/web/app/immutable/nodes/{0.5oa9JC3V.js → 0.D_e7AeTl.js} +1 -1
  295. package/web/app/immutable/nodes/{1.dLY473QL.js → 1.DA21OvwY.js} +1 -1
  296. package/web/app/immutable/nodes/{10.Dg3iEVmH.js → 10.CSASJEbg.js} +14 -14
  297. package/web/app/immutable/nodes/{11.PFTrUEsb.js → 11.DW2JfBsq.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.DrH3We44.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.DyUaZQFK.js} +2 -2
  306. package/web/app/immutable/nodes/{2.BaR1WF3o.js → 2.CTOsyef2.js} +4 -4
  307. package/web/app/immutable/nodes/{20.g9As4rvG.js → 20.BPfqGZ4o.js} +1 -1
  308. package/web/app/immutable/nodes/{3.DwF_25Xt.js → 3.xcZps6DB.js} +1 -1
  309. package/web/app/immutable/nodes/{4.ttOSy2Tq.js → 4.DaJkDmFI.js} +1 -1
  310. package/web/app/immutable/nodes/{5.BVpoghsD.js → 5.7rTxN-4O.js} +1 -1
  311. package/web/app/immutable/nodes/6.tsWwri9c.js +5 -0
  312. package/web/app/immutable/nodes/{7.BO56ByN2.js → 7.CDTojphP.js} +1 -1
  313. package/web/app/immutable/nodes/{8.CPtVgnSI.js → 8.BO5ffLDm.js} +1 -1
  314. package/web/app/immutable/nodes/9.D0POivb2.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/Bheykcr9.js +0 -1
  319. package/web/app/immutable/chunks/CDVPwJHE.js +0 -1
  320. package/web/app/immutable/chunks/CtfEuoOH.js +0 -1
  321. package/web/app/immutable/chunks/DRuLniWc.js +0 -1
  322. package/web/app/immutable/chunks/T9rMC0YB.js +0 -1
  323. package/web/app/immutable/chunks/jlu1ZSD8.js +0 -1
  324. package/web/app/immutable/entry/start.BFcXwo9Y.js +0 -1
  325. package/web/app/immutable/nodes/6.D6pOrTxH.js +0 -5
  326. package/web/app/immutable/nodes/9.cl9L6J-I.js +0 -14
@@ -1 +1 @@
1
- var j=Object.defineProperty;var V=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>V(s,typeof e!="symbol"?e+"":e,t);import{f as x,j as G,p as z}from"./uXuxG9cN.js";import{u as J,o as T,_ as C,s as b,l as _,n as U}from"./CIyUrgF0.js";import{bm as $}from"./CtfEuoOH.js";class u extends Error{constructor(t){super(t.message);n(this,"code");n(this,"data");n(this,"rpcCode");this.name="BackendError",this.code=t.code,this.data=t.data,this.rpcCode=t.rpcCode}}function Ee(s){return!s||typeof s!="object"?!1:typeof s.rpcCode=="number"}const K=-32003;function Ce(s){return!s||typeof s!="object"?!1:s.rpcCode===K}const Ae=x.refine(s=>s.repository.provider==="github"&&s.kind==="pull-request"||s.repository.provider==="gitlab"&&s.kind==="merge-request"),Oe=J([T({state:C(["available","pending","reconnect-required","restricted","disabled","unsupported","unavailable","unknown"])}),T({state:_("backoff"),retryAt:b()}),T({state:_("unresolved"),reason:C(["missing-provenance","unverified-import","invalid-target","missing-authority","unknown"]).catch("unknown")})]).catch({state:"unknown"}),_e=T({backendId:b().min(1),sessionId:b().min(1),workspaceId:b().min(1)}).strict();function v(s){return typeof s=="number"&&Number.isSafeInteger(s)&&s>=1}function Ne(s){if(s.resource||s.monitorAvailability||s.title===null||s.url===null||s.lastSnapshot===null)return!1;const e=s.lastSnapshot;return!e||!e.availability&&e.isDraft!==null&&e.hasConflicts!==null&&e.isBehind!==null&&Object.values(e.checks).every(t=>t!==null)&&e.approvals.decision!==null&&e.approvals.have!==null&&e.approvals.changesRequested!==null}const Ie=new Set(["agent.getConversation","agent.listUserMessages","agent.getMessageBlock","chat.subscribe","chat.unsubscribe"]);class Y{constructor(e,t,i,o,a,d,R){n(this,"ready");n(this,"acknowledged",!1);n(this,"closed",!1);n(this,"id",0);n(this,"pending",new Map);n(this,"listeners",new Set);n(this,"rejectReady");n(this,"timer");this.socket=e,this.currentSource=o,this.timeoutMs=a,this.onFailure=R,this.ready=new Promise((m,r)=>{this.rejectReady=r,e.onopen=()=>{if(!this.current())return this.fail();this.send("client.hello",{clientId:t,connectionRole:"review-monitor",capabilities:{reviewMonitoring:i}}).then(f=>{const c=f;if(!this.current()||c?.clientId!==t||c?.connectionRole!=="review-monitor"||!v(c?.server?.capabilities?.reviewMonitoring))return this.fail();this.acknowledged=!0,clearTimeout(this.timer),m()},()=>this.fail())}}),this.timer=setTimeout(()=>this.fail(),d),e.onerror=()=>this.fail(),e.onclose=()=>this.fail(),e.onmessage=({data:m})=>{if(!this.current()||typeof m!="string")return;let r;try{r=JSON.parse(m)}catch{return}if(!r||typeof r!="object")return;if(typeof r.method=="string"){if(r.id!=null){try{e.send(JSON.stringify({jsonrpc:"2.0",id:r.id,error:{code:-32601,message:"Method not found"}}))}catch{this.fail()}return}if(this.acknowledged)for(const c of[...this.listeners])c({method:r.method,params:r.params});return}if(typeof r.id!="number")return;const f=this.pending.get(r.id);if(f)if(this.pending.delete(r.id),clearTimeout(f.timer),r.error){const c=r.error.data,g=c&&typeof c=="object"&&"code"in c&&typeof c.code=="string"?c.code:"SERVER_ERROR";f.reject(new u({code:g,message:typeof r.error.message=="string"?r.error.message:"Monitor request failed",data:c,rpcCode:typeof r.error.code=="number"?r.error.code:void 0}))}else f.resolve(r.result)}}current(){return!this.closed&&this.currentSource()}onNotification(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,t){return!this.acknowledged||e==="client.hello"?Promise.reject(this.unavailable()):this.send(e,t)}close(){if(this.closed)return;this.closed=!0,this.acknowledged=!1,clearTimeout(this.timer);const e=this.unavailable();this.rejectReady(e);for(const t of this.pending.values())clearTimeout(t.timer),t.reject(e);this.pending.clear(),this.listeners.clear(),this.socket.onopen=this.socket.onmessage=this.socket.onerror=this.socket.onclose=null;try{this.socket.close()}catch{}}fail(){this.closed||(this.close(),this.onFailure())}unavailable(){return new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor attachment unavailable"})}send(e,t){if(!this.current())return Promise.reject(this.unavailable());const i=++this.id;return new Promise((o,a)=>{const d=setTimeout(()=>{this.pending.delete(i),a(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`}))},this.timeoutMs);this.pending.set(i,{resolve:o,reject:a,timer:d});try{this.socket.send(JSON.stringify({jsonrpc:"2.0",id:i,method:e,params:t}))}catch{this.fail()}})}}const X=["agentNodes","localNodeIsolation","agentPlatformRouting","workspaceMembershipEvents","rawScreenshotRetention","chiefAttachments","noteTruncatedRead","remoteMachines","remoteInitialAgent","remoteMachineClaim","machineOrder","remoteLinkTraffic","cloudMachines","cloudMachineEntries","cloudMachineProviders"];function Q(s){return Object.freeze(Object.fromEntries(X.map(e=>[e,s?.[e]===1?1:0])))}function Z(s){if(!G(s,11,1))throw new Error($.files_secondaryRoot_unsupported_error())}function ee(s,e,t){te(s,e)&&Z(t)}function te(s,e){if(s!=="file.read"&&s!=="file.readChunk")return!1;const t=e?.gitRootId;return typeof t=="string"&&!!t.trim()}const N=-32012,se="system.startupStatus",ne=1e3,L=1e3,F=3e4,w=U().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ie=T({completedNotes:w,totalNotes:w,processedSourceBytes:w,totalSourceBytes:w}).refine(s=>s.completedNotes<=s.totalNotes&&s.processedSourceBytes<=s.totalSourceBytes),oe=T({startupStatus:_(1),daemonVersion:b().min(1).optional(),attemptId:b().min(1),phase:C(["preparing","indexing","finalizing","ready","failed"]),elapsedMs:w,phaseElapsedMs:w,progressAgeMs:w,retryAfterMs:U().int().min(L).max(F).optional(),progress:ie.optional(),estimatedRemainingMs:w.optional(),finalizingStep:C(["anchors","committing","services"]).optional(),failure:T({code:b().min(1),message:b().min(1)}).optional()}).refine(s=>(s.phase==="ready"||s.phase==="failed"?s.retryAfterMs===void 0:s.retryAfterMs!==void 0)&&(s.phase==="finalizing"?s.finalizingStep!==void 0:s.finalizingStep===void 0)&&(s.phase==="failed"?s.failure!==void 0:s.failure===void 0)&&(s.estimatedRemainingMs===void 0||s.phase==="indexing"));function B(s){const e=oe.safeParse(s);return e.success?e.data:null}function P(s){const e=typeof s=="number"&&Number.isFinite(s)?s:ne;return Math.min(F,Math.max(L,e))}function re(s){const e=s;return typeof e.rpcCode=="number"?e.rpcCode:typeof e.code=="number"?e.code:void 0}function q(s){if(!s||typeof s!="object"||re(s)!==N)return;const e=s.data??{},t=B(e.startup);if(e.code==="daemon-startup-failed"){const i=e.startup?.failure?.message,o=s.message;return{kind:"failed",message:typeof i=="string"&&i.trim()?i:typeof o=="string"?o:"",snapshot:t}}if(!(e.code!=="daemon-not-ready"||e.retryable!==!0))return{kind:"not-ready",retryAfterMs:P(e.retryAfterMs),snapshot:t}}function D(s){const e=s.snapshot??void 0;return s.state==="failed"?{code:N,message:"Daemon startup failed",data:{code:"daemon-startup-failed",retryable:!1,startup:e}}:{code:N,message:"Daemon not ready",data:{code:"daemon-not-ready",retryable:!0,retryAfterMs:P(e?.retryAfterMs),startup:e}}}const ae=5e3,ce=5e3,le=3e4;function he(s){const e=s.snapshot;return JSON.stringify([s.state,s.available,e?.attemptId,e?.phase,e?.finalizingStep,e?.progress?.completedNotes,e?.progress?.totalNotes,e?.estimatedRemainingMs===void 0,(e?.progressAgeMs??0)>=le])}class ue{constructor(e){n(this,"generation",0);n(this,"timer",null);n(this,"snapshot",null);n(this,"lastKey",null);n(this,"lastPublishedAt",0);this.host=e}start(e){this.stop(),this.snapshot=e.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:e.snapshot!==null},!0),this.schedule(e.retryAfterMs)}stop(){this.generation++,this.timer&&(clearTimeout(this.timer),this.timer=null)}reset(){this.stop(),this.snapshot=null,this.lastKey=null,this.lastPublishedAt=0}publish(e,t=!1){const i=he(e),o=Date.now();!t&&i===this.lastKey&&o-this.lastPublishedAt<ce||(this.lastKey=i,this.lastPublishedAt=o,this.host.publish(e))}schedule(e){const t=this.generation;this.timer=setTimeout(()=>{if(this.timer=null,t!==this.generation)return;const i=()=>this.poll(t);this.host.track?this.host.track(i):i()},e)}async poll(e){let t;try{t=B(await this.host.request())}catch(i){if(e!==this.generation)return;const o=q(i);if(o?.kind==="failed"){this.stop(),this.host.fail(o.message,o.snapshot);return}if(o?.kind==="not-ready"){this.snapshot=o.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:o.snapshot!==null}),this.schedule(o.retryAfterMs);return}this.unavailable();return}if(e===this.generation){if(t===null){this.unavailable();return}if(this.snapshot=t,t.phase==="failed"){this.stop(),this.host.fail(t.failure?.message??"",t);return}if(t.phase==="ready"){this.stop(),this.publish({state:"starting",snapshot:t,available:!0},!0),this.host.handoff(!0);return}this.publish({state:"starting",snapshot:t,available:!0}),this.schedule(P(t.retryAfterMs))}}unavailable(){this.stop(),this.publish({state:"starting",snapshot:this.snapshot,available:!1},!0),this.host.handoff(!1)}}function Pe(s=(()=>{const e=globalThis.__INTENT_RUNTIME_CONFIG__;return e?.intentdWsUrl!==void 0?e.intentdWsUrl:typeof process>"u"?void 0:""})()){if(typeof s!="string")return;const e=s.trim();if(!e)return;if(e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")){const o=globalThis.location;if(o?.host&&(o.protocol==="http:"||o.protocol==="https:"))return`${o.protocol==="https:"?"wss:":"ws:"}//${o.host}${e}`;console.warn("[browser-websocket-transport] Ignoring same-origin WebSocket path without an HTTP page origin");return}let t;try{t=new URL(e)}catch{console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}if(t.protocol!=="ws:"&&t.protocol!=="wss:"){console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}const i=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol==="ws:"&&!i){console.warn("[browser-websocket-transport] Ignoring insecure remote WebSocket URL: use wss://");return}return e}function de(s){try{const e=new URL(s);return e.username="",e.password="",e.search="",e.hash="",e.toString()}catch{return s.replace(/[?#].*$/,"").replace(/^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/i,"$1")}}const fe={[-32700]:"PARSE_ERROR",[-32600]:"INVALID_REQUEST",[-32601]:"METHOD_NOT_FOUND",[-32602]:"INVALID_PARAMS",[-32603]:"INTERNAL_ERROR"};function pe(s){const e=fe[s];return e||(s<=-32e3&&s>=-32099?"SERVER_ERROR":"UNKNOWN_ERROR")}function me(s){if(s&&typeof s=="object"&&"code"in s){const e=s.code;if(typeof e=="string"&&e.length>0)return e}}function O(s){const e=me(s.data)??pe(s.code),t=s.data&&typeof s.data=="object"?{...s.data,code:e}:typeof s.data=="string"&&s.data.length>0?{code:e,detail:s.data}:{code:e};return{code:e,message:s.message,data:t,rpcCode:s.code}}function E(s){if(s instanceof u)return s;const e=s instanceof Error?s.message:String(s);return new u({code:"TRANSPORT_ERROR",message:e,data:{code:"TRANSPORT_ERROR"}})}const ge=3e4,Re=1e3,ye=3e4,Se=1e4,be=5e3;class we{constructor(e){n(this,"url");n(this,"webSocketFactory");n(this,"requestTimeoutMs");n(this,"reconnectDelayMs");n(this,"maxReconnectDelayMs");n(this,"connectTimeoutMs");n(this,"socket",null);n(this,"connected",!1);n(this,"connecting",!1);n(this,"disposed",!1);n(this,"requestId",0);n(this,"currentReconnectDelay");n(this,"reconnectTimer",null);n(this,"connectTimer",null);n(this,"connectWaiters",[]);n(this,"clientId");n(this,"helloConfirmed",!1);n(this,"acknowledgedHello",null);n(this,"nodeCapabilities",null);n(this,"capabilityHelloGeneration",0);n(this,"reviewMonitoring");n(this,"reviewMonitoringRecipient");n(this,"reviewMonitoringEnabled",!1);n(this,"ordinaryHello",!1);n(this,"monitorRetry",null);n(this,"monitorRetirements",new Set);n(this,"monitorReady",new Set);n(this,"protocolVersion",null);n(this,"helloError",new u({code:"UNAVAILABLE",message:"client.hello has not completed on this connection"}));n(this,"pending",new Map);n(this,"hasBeenConnected",!1);n(this,"hasConnectionFailed",!1);n(this,"notificationHandlers",new Set);n(this,"reconnectedHandlers",new Set);n(this,"statusHandlers",new Set);n(this,"lastNotifiedStatus","disconnected");n(this,"startupState",null);n(this,"startupSocket",null);n(this,"startupPoller",new ue({request:()=>{const e=this.startupSocket;return e?this.requestOnSocket(se,void 0,{timeoutMs:ae},e):Promise.reject(this.startupRefusal())},publish:e=>this.updateStartup(e),handoff:e=>this.startupHandoff(e),fail:(e,t)=>this.failStartup(e,t)}));n(this,"startupHandlers",new Set);this.reviewMonitoringEnabled=v(e.reviewMonitoring),this.reviewMonitoringRecipient=v(e.reviewMonitoring)?e.reviewMonitoring:void 0,this.url=e.url,this.webSocketFactory=e.webSocketFactory??(t=>new WebSocket(t)),this.requestTimeoutMs=e.requestTimeoutMs??ge,this.reconnectDelayMs=e.reconnectDelayMs??Re,this.maxReconnectDelayMs=e.maxReconnectDelayMs??ye,this.connectTimeoutMs=e.connectTimeoutMs??Se,this.currentReconnectDelay=this.reconnectDelayMs}isAvailable(){return!this.disposed}async readPrincipal(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected(),t=this.capabilityHelloGeneration,i=structuredClone(this.acknowledgedHello),o=()=>!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t&&this.acknowledgedHello!==null;if(!o())throw this.helloError;const a=await this.requestOnSocket("principal.me",{},void 0,e);if(!o())throw new u({code:"UNAVAILABLE",message:"Principal discovery connection changed"});return{hello:i,principal:a}}async observeNodeCapabilities(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected();if(this.disposed||!this.connected||this.socket!==e)throw new u({code:"UNAVAILABLE",message:"Backend connection changed"});return{server:{capabilities:this.nodeCapabilities}}}onMonitorReconnected(e){this.monitorReady.add(e);const t=this.onReconnected(e);return()=>{this.monitorReady.delete(e),t()}}prMonitorBackendId(){return de(this.url)}async capturePrMonitorSession(e){const t=await this.ensureConnected(),i=this.capabilityHelloGeneration,o=()=>new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor connection unavailable"});let a,d=!1;const R=new Set,m=new Set,r=()=>{if(!d){d=!0,this.monitorRetirements.delete(r),a?.close();for(const l of R)l();R.clear()}},f=()=>!d&&!this.disposed&&this.connected&&this.helloConfirmed&&this.socket===t&&i===this.capabilityHelloGeneration,c=()=>f()&&(!a||a.current());if(!c())throw o();this.monitorRetirements.add(r);const g=v(this.reviewMonitoring);let M=g?"consumer-pending":"unsupported";if(g&&this.reviewMonitoringEnabled&&this.ordinaryHello&&this.clientId)try{if(a=new Y(this.webSocketFactory(this.url),this.clientId,Math.min(this.reviewMonitoringRecipient,this.reviewMonitoring),f,this.requestTimeoutMs,this.connectTimeoutMs,()=>{const l=f();r(),l&&this.scheduleMonitorRecovery(t,i)}),await a.ready,!c())throw o();M="supported"}catch(l){const p=f();throw r(),p&&this.scheduleMonitorRecovery(t,i),l}const y=(l,p)=>a?a.request(l,p):this.requestOnSocket(l,p,void 0,t);return{origin:{backendId:this.prMonitorBackendId(),sessionId:crypto.randomUUID(),workspaceId:e},support:M,onRetired(l){return c()?(R.add(l),()=>{R.delete(l)}):(l(),()=>{})},onNotification:l=>(a??this).onNotification(p=>{c()&&l(p)}),request:async(l,p)=>{if(!c()||M==="consumer-pending"||p.workspaceId!==e)throw o();const k=await y(l,p),h=l==="events.subscribe"?k?.subscriptionId:void 0;if(!c())throw h&&this.socket===t&&this.connected&&i===this.capabilityHelloGeneration&&y("events.unsubscribe",{workspaceId:e,subscriptionId:h}).catch(()=>{}),o();return h&&m.add(h),l==="events.unsubscribe"&&m.delete(String(p.subscriptionId)),k},release:async()=>{const l=c();r(),l&&!a&&await Promise.all([...m].map(p=>this.requestOnSocket("events.unsubscribe",{workspaceId:e,subscriptionId:p},void 0,t).catch(()=>{})))}}}request(e,t,i){return this.requestOnSocket(e,t,i)}requestOnSocket(e,t,i,o){if(i?.localMachine)return Promise.reject(new u({code:"UNAVAILABLE",message:"Local machine requests require the desktop bridge"}));if(this.disposed)return Promise.reject(new u({code:"UNAVAILABLE",message:"Backend transport disposed"}));if(!o&&this.startupState?.state==="starting")return Promise.reject(new u(O(D(this.startupState))));const a=++this.requestId,d=i?.timeoutMs,R=typeof d=="number"&&Number.isFinite(d)&&d>0?d:this.requestTimeoutMs;return new Promise((m,r)=>{let f=!1;const c=setTimeout(()=>{f=!0,this.pending.delete(a),r(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`,data:{code:"TIMEOUT"}}))},R),g=y=>{clearTimeout(c),r(E(y))},M=y=>{if(f)return;if(this.disposed||this.socket!==y){g(new u({code:"TRANSPORT_ERROR",message:"Connection replaced"}));return}if(e==="presence.update"&&!this.helloConfirmed){g(this.helloError);return}try{ee(e,t,this.protocolVersion)}catch(h){g(h);return}let l=e==="client.hello"&&this.clientId?{clientId:this.clientId,...t}:t;if(e==="client.hello"){const h={...l},S={...h.capabilities};Object.prototype.hasOwnProperty.call(S,"reviewMonitoring")&&(this.reviewMonitoringEnabled=this.reviewMonitoringRecipient!==void 0&&v(S.reviewMonitoring)),delete S.reviewMonitoring,delete h.connectionRole,h.capabilities!==void 0&&(h.capabilities=S),l=h}const p=JSON.stringify({jsonrpc:"2.0",id:a,method:e,params:l}),k=e==="client.hello"?++this.capabilityHelloGeneration:0;if(e==="client.hello"){this.helloConfirmed=!1,this.ordinaryHello=!1,this.clearMonitorRecovery(),this.nodeCapabilities=null,this.reviewMonitoring=void 0;for(const h of[...this.monitorRetirements])h();this.acknowledgedHello=null}this.pending.set(a,{method:e,timeout:c,resolve:h=>{if(e==="client.hello"&&this.socket===y&&k===this.capabilityHelloGeneration){const S=h?.clientId;if(typeof S=="string"&&S.length>0){const H=h.server?.capabilities;if(this.clientId=S,this.reviewMonitoring=H?.reviewMonitoring,this.ordinaryHello=h.connectionRole===void 0,this.acknowledgedHello=structuredClone(h),this.nodeCapabilities=Q(H),this.protocolVersion=z(h.protocolVersion),this.helloConfirmed=!0,this.connected)for(const W of this.monitorReady)W()}}m(h)},reject:r});try{y.send(p)}catch(h){clearTimeout(c),this.pending.delete(a),r(E(h))}};o?M(o):this.connected&&this.socket?M(this.socket):this.ensureConnected().then(M,g)})}async subscribe(e){return this.request("events.subscribe",e)}async unsubscribe(e,t){try{await this.request("events.unsubscribe",{subscriptionId:e,...t!==void 0?{workspaceId:t}:{}})}catch{}}onNotification(e){return this.notificationHandlers.add(e),()=>this.notificationHandlers.delete(e)}onReconnected(e){return this.reconnectedHandlers.add(e),()=>this.reconnectedHandlers.delete(e)}getConnectionStatus(){return this.connected?"connected":this.connecting?"connecting":"disconnected"}getStartupState(){return this.startupState}onStartupChange(e){return this.startupHandlers.add(e),()=>this.startupHandlers.delete(e)}onConnectionStatusChange(e){return this.statusHandlers.add(e),()=>this.statusHandlers.delete(e)}dispose(){if(this.disposed)return;this.disposed=!0,this.clearReconnect(),this.clearConnectTimer();const e=new u({code:"UNAVAILABLE",message:"Backend transport disposed"});this.failPending(e),this.failWaiters(e),this.teardownSocket(),this.connected=!1,this.connecting=!1,this.notifyStatusChange(),this.notificationHandlers.clear(),this.reconnectedHandlers.clear(),this.statusHandlers.clear(),this.startupHandlers.clear()}ensureConnected(){return this.connected&&this.socket?Promise.resolve(this.socket):new Promise((e,t)=>{this.connectWaiters.push({resolve:e,reject:t}),this.start()})}start(){this.disposed||this.socket||this.connecting||this.reconnectTimer||this.connect()}connect(){this.clearReconnect(),this.connecting=!0,this.notifyStatusChange();let e;try{e=this.webSocketFactory(this.url)}catch(t){this.connecting=!1,this.onConnectionFailure(E(t));return}this.socket=e,this.helloConfirmed=!1,this.connectTimer=setTimeout(()=>{this.connectTimer=null,!(this.socket!==e||this.connected)&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:`WebSocket connect attempt timed out after ${this.connectTimeoutMs}ms`})))},this.connectTimeoutMs),e.onopen=()=>{this.socket===e&&this.onConnected(e)},e.onmessage=t=>{this.socket===e&&this.onMessage(t.data)},e.onerror=null,e.onclose=()=>{this.socket===e&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})))}}onConnected(e){this.clearConnectTimer(),this.performHelloHandshake(e)}async performHelloHandshake(e){try{await this.requestOnSocket("client.hello",{},{timeoutMs:Math.min(this.requestTimeoutMs,be)},e)}catch(o){if(this.disposed||this.socket!==e)return;const a=q(o);if(a){this.enterStartup(e,a);return}this.helloError=E(o)}if(this.disposed||this.socket!==e)return;this.startupPoller.reset(),this.startupSocket=null;const t=this.startupState!==null;this.startupState=null,this.connecting=!1,this.connected=!0,this.currentReconnectDelay=this.reconnectDelayMs;const i=this.hasBeenConnected||this.hasConnectionFailed;if(this.hasBeenConnected=!0,this.hasConnectionFailed=!1,this.notifyStatusChange(),t)for(const o of[...this.startupHandlers])o(null);if(this.flushWaiters(e),i)for(const o of[...this.reconnectedHandlers])o()}onConnectionFailure(e){if(this.clearConnectTimer(),!this.disposed){if(this.startupSocket!==null&&this.startupSocket===this.socket){this.startupHandoff(!0);return}this.startupState?.state==="starting"&&(this.startupPoller.reset(),this.updateStartup(null)),this.hasConnectionFailed=!0,this.connected=!1,this.notifyStatusChange(),this.teardownSocket(),this.failPending(e),this.failWaiters(e),this.scheduleReconnect()}}notifyStatusChange(){const e=this.getConnectionStatus();if(e!==this.lastNotifiedStatus){this.lastNotifiedStatus=e;for(const t of[...this.statusHandlers])t(e)}}onMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{console.warn("[browser-websocket-transport] Dropping unparseable frame");return}if(!t||typeof t!="object")return;const i=typeof t.method=="string",o=t.id!=null;if(i&&o){this.sendFrame({jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${String(t.method)}`}});return}if(o){const a=Number(t.id),d=this.pending.get(a);if(!d)return;this.pending.delete(a),clearTimeout(d.timeout),t.error?d.reject(new u(O(t.error))):d.resolve(t.result);return}if(i){const a={method:t.method,params:t.params};for(const d of[...this.notificationHandlers])d(a)}}sendFrame(e){try{this.socket?.send(JSON.stringify(e))}catch{}}scheduleReconnect(){if(this.disposed||this.reconnectTimer)return;const e=this.currentReconnectDelay;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.currentReconnectDelay=Math.min(e*2,this.maxReconnectDelayMs),this.disposed||this.connect()},e)}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearConnectTimer(){this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null)}scheduleMonitorRecovery(e,t){this.monitorRetry||this.disposed||(this.monitorRetry=setTimeout(()=>{if(this.monitorRetry=null,!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t)for(const i of[...this.monitorReady])i()},this.reconnectDelayMs))}clearMonitorRecovery(){this.monitorRetry&&clearTimeout(this.monitorRetry),this.monitorRetry=null}teardownSocket(){this.startupPoller.stop(),this.startupSocket=null,this.reviewMonitoring=void 0,this.clearMonitorRecovery();for(const t of[...this.monitorRetirements])t();if(this.acknowledgedHello=null,this.nodeCapabilities=null,this.capabilityHelloGeneration+=1,this.protocolVersion=null,!this.socket)return;const e=this.socket;this.socket=null,e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}updateStartup(e){this.startupState=e?Object.freeze({...e}):null;for(const t of[...this.startupHandlers])t(this.startupState)}startupRefusal(){return this.startupState?new u(O(D(this.startupState))):new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})}enterStartup(e,t){if(this.hasConnectionFailed=!0,t.kind==="failed"){this.failStartup(t.message,t.snapshot);return}this.startupSocket=e,this.startupPoller.start(t),this.failWaiters(this.startupRefusal())}startupHandoff(e){const t=this.startupRefusal();if(this.teardownSocket(),this.failPending(t),this.disposed)return;this.connecting=!0,this.notifyStatusChange(),this.clearReconnect();let i=this.reconnectDelayMs;e?this.currentReconnectDelay=this.reconnectDelayMs:(i=this.currentReconnectDelay,this.currentReconnectDelay=Math.min(i*2,this.maxReconnectDelayMs)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.disposed||this.connect()},i)}failStartup(e,t){this.startupPoller.stop(),this.startupSocket=null,this.hasConnectionFailed=!0,this.updateStartup({state:"failed",snapshot:t,available:t!==null,message:e}),this.connecting=!1,this.onConnectionFailure(this.startupRefusal())}failPending(e){for(const t of this.pending.values())clearTimeout(t.timeout),t.reject(e);this.pending.clear()}flushWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.resolve(e)}failWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.reject(e)}}function He(s){return new we(s)}let A=null;const I=new Set;function De(s){A=s;for(const e of[...I])e(s)}function Ue(){return A}function Le(s){return I.add(s),A&&s(A),()=>I.delete(s)}export{u as B,Oe as M,_e as P,Ie as R,Ae as a,Ce as b,He as c,Ne as d,Pe as e,v as f,Ue as g,Ee as i,Le as o,De as r,de as s};
1
+ var j=Object.defineProperty;var V=(s,e,t)=>e in s?j(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var n=(s,e,t)=>V(s,typeof e!="symbol"?e+"":e,t);import{f as x,j as G,p as z}from"./uXuxG9cN.js";import{u as J,o as T,_ as C,s as b,l as _,n as U}from"./CIyUrgF0.js";import{bm as $}from"./Fcr7AvC-.js";class u extends Error{constructor(t){super(t.message);n(this,"code");n(this,"data");n(this,"rpcCode");this.name="BackendError",this.code=t.code,this.data=t.data,this.rpcCode=t.rpcCode}}function Ee(s){return!s||typeof s!="object"?!1:typeof s.rpcCode=="number"}const K=-32003;function Ce(s){return!s||typeof s!="object"?!1:s.rpcCode===K}const Ae=x.refine(s=>s.repository.provider==="github"&&s.kind==="pull-request"||s.repository.provider==="gitlab"&&s.kind==="merge-request"),Oe=J([T({state:C(["available","pending","reconnect-required","restricted","disabled","unsupported","unavailable","unknown"])}),T({state:_("backoff"),retryAt:b()}),T({state:_("unresolved"),reason:C(["missing-provenance","unverified-import","invalid-target","missing-authority","unknown"]).catch("unknown")})]).catch({state:"unknown"}),_e=T({backendId:b().min(1),sessionId:b().min(1),workspaceId:b().min(1)}).strict();function v(s){return typeof s=="number"&&Number.isSafeInteger(s)&&s>=1}function Ne(s){if(s.resource||s.monitorAvailability||s.title===null||s.url===null||s.lastSnapshot===null)return!1;const e=s.lastSnapshot;return!e||!e.availability&&e.isDraft!==null&&e.hasConflicts!==null&&e.isBehind!==null&&Object.values(e.checks).every(t=>t!==null)&&e.approvals.decision!==null&&e.approvals.have!==null&&e.approvals.changesRequested!==null}const Ie=new Set(["agent.getConversation","agent.listUserMessages","agent.getMessageBlock","chat.subscribe","chat.unsubscribe"]);class Y{constructor(e,t,i,o,a,d,R){n(this,"ready");n(this,"acknowledged",!1);n(this,"closed",!1);n(this,"id",0);n(this,"pending",new Map);n(this,"listeners",new Set);n(this,"rejectReady");n(this,"timer");this.socket=e,this.currentSource=o,this.timeoutMs=a,this.onFailure=R,this.ready=new Promise((m,r)=>{this.rejectReady=r,e.onopen=()=>{if(!this.current())return this.fail();this.send("client.hello",{clientId:t,connectionRole:"review-monitor",capabilities:{reviewMonitoring:i}}).then(f=>{const c=f;if(!this.current()||c?.clientId!==t||c?.connectionRole!=="review-monitor"||!v(c?.server?.capabilities?.reviewMonitoring))return this.fail();this.acknowledged=!0,clearTimeout(this.timer),m()},()=>this.fail())}}),this.timer=setTimeout(()=>this.fail(),d),e.onerror=()=>this.fail(),e.onclose=()=>this.fail(),e.onmessage=({data:m})=>{if(!this.current()||typeof m!="string")return;let r;try{r=JSON.parse(m)}catch{return}if(!r||typeof r!="object")return;if(typeof r.method=="string"){if(r.id!=null){try{e.send(JSON.stringify({jsonrpc:"2.0",id:r.id,error:{code:-32601,message:"Method not found"}}))}catch{this.fail()}return}if(this.acknowledged)for(const c of[...this.listeners])c({method:r.method,params:r.params});return}if(typeof r.id!="number")return;const f=this.pending.get(r.id);if(f)if(this.pending.delete(r.id),clearTimeout(f.timer),r.error){const c=r.error.data,g=c&&typeof c=="object"&&"code"in c&&typeof c.code=="string"?c.code:"SERVER_ERROR";f.reject(new u({code:g,message:typeof r.error.message=="string"?r.error.message:"Monitor request failed",data:c,rpcCode:typeof r.error.code=="number"?r.error.code:void 0}))}else f.resolve(r.result)}}current(){return!this.closed&&this.currentSource()}onNotification(e){return this.listeners.add(e),()=>this.listeners.delete(e)}request(e,t){return!this.acknowledged||e==="client.hello"?Promise.reject(this.unavailable()):this.send(e,t)}close(){if(this.closed)return;this.closed=!0,this.acknowledged=!1,clearTimeout(this.timer);const e=this.unavailable();this.rejectReady(e);for(const t of this.pending.values())clearTimeout(t.timer),t.reject(e);this.pending.clear(),this.listeners.clear(),this.socket.onopen=this.socket.onmessage=this.socket.onerror=this.socket.onclose=null;try{this.socket.close()}catch{}}fail(){this.closed||(this.close(),this.onFailure())}unavailable(){return new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor attachment unavailable"})}send(e,t){if(!this.current())return Promise.reject(this.unavailable());const i=++this.id;return new Promise((o,a)=>{const d=setTimeout(()=>{this.pending.delete(i),a(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`}))},this.timeoutMs);this.pending.set(i,{resolve:o,reject:a,timer:d});try{this.socket.send(JSON.stringify({jsonrpc:"2.0",id:i,method:e,params:t}))}catch{this.fail()}})}}const X=["agentNodes","localNodeIsolation","agentPlatformRouting","workspaceMembershipEvents","rawScreenshotRetention","chiefAttachments","noteTruncatedRead","remoteMachines","remoteInitialAgent","remoteMachineClaim","machineOrder","remoteLinkTraffic","cloudMachines","cloudMachineEntries","cloudMachineProviders"];function Q(s){return Object.freeze(Object.fromEntries(X.map(e=>[e,s?.[e]===1?1:0])))}function Z(s){if(!G(s,11,1))throw new Error($.files_secondaryRoot_unsupported_error())}function ee(s,e,t){te(s,e)&&Z(t)}function te(s,e){if(s!=="file.read"&&s!=="file.readChunk")return!1;const t=e?.gitRootId;return typeof t=="string"&&!!t.trim()}const N=-32012,se="system.startupStatus",ne=1e3,L=1e3,F=3e4,w=U().int().nonnegative().max(Number.MAX_SAFE_INTEGER),ie=T({completedNotes:w,totalNotes:w,processedSourceBytes:w,totalSourceBytes:w}).refine(s=>s.completedNotes<=s.totalNotes&&s.processedSourceBytes<=s.totalSourceBytes),oe=T({startupStatus:_(1),daemonVersion:b().min(1).optional(),attemptId:b().min(1),phase:C(["preparing","indexing","finalizing","ready","failed"]),elapsedMs:w,phaseElapsedMs:w,progressAgeMs:w,retryAfterMs:U().int().min(L).max(F).optional(),progress:ie.optional(),estimatedRemainingMs:w.optional(),finalizingStep:C(["anchors","committing","services"]).optional(),failure:T({code:b().min(1),message:b().min(1)}).optional()}).refine(s=>(s.phase==="ready"||s.phase==="failed"?s.retryAfterMs===void 0:s.retryAfterMs!==void 0)&&(s.phase==="finalizing"?s.finalizingStep!==void 0:s.finalizingStep===void 0)&&(s.phase==="failed"?s.failure!==void 0:s.failure===void 0)&&(s.estimatedRemainingMs===void 0||s.phase==="indexing"));function B(s){const e=oe.safeParse(s);return e.success?e.data:null}function P(s){const e=typeof s=="number"&&Number.isFinite(s)?s:ne;return Math.min(F,Math.max(L,e))}function re(s){const e=s;return typeof e.rpcCode=="number"?e.rpcCode:typeof e.code=="number"?e.code:void 0}function q(s){if(!s||typeof s!="object"||re(s)!==N)return;const e=s.data??{},t=B(e.startup);if(e.code==="daemon-startup-failed"){const i=e.startup?.failure?.message,o=s.message;return{kind:"failed",message:typeof i=="string"&&i.trim()?i:typeof o=="string"?o:"",snapshot:t}}if(!(e.code!=="daemon-not-ready"||e.retryable!==!0))return{kind:"not-ready",retryAfterMs:P(e.retryAfterMs),snapshot:t}}function D(s){const e=s.snapshot??void 0;return s.state==="failed"?{code:N,message:"Daemon startup failed",data:{code:"daemon-startup-failed",retryable:!1,startup:e}}:{code:N,message:"Daemon not ready",data:{code:"daemon-not-ready",retryable:!0,retryAfterMs:P(e?.retryAfterMs),startup:e}}}const ae=5e3,ce=5e3,le=3e4;function he(s){const e=s.snapshot;return JSON.stringify([s.state,s.available,e?.attemptId,e?.phase,e?.finalizingStep,e?.progress?.completedNotes,e?.progress?.totalNotes,e?.estimatedRemainingMs===void 0,(e?.progressAgeMs??0)>=le])}class ue{constructor(e){n(this,"generation",0);n(this,"timer",null);n(this,"snapshot",null);n(this,"lastKey",null);n(this,"lastPublishedAt",0);this.host=e}start(e){this.stop(),this.snapshot=e.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:e.snapshot!==null},!0),this.schedule(e.retryAfterMs)}stop(){this.generation++,this.timer&&(clearTimeout(this.timer),this.timer=null)}reset(){this.stop(),this.snapshot=null,this.lastKey=null,this.lastPublishedAt=0}publish(e,t=!1){const i=he(e),o=Date.now();!t&&i===this.lastKey&&o-this.lastPublishedAt<ce||(this.lastKey=i,this.lastPublishedAt=o,this.host.publish(e))}schedule(e){const t=this.generation;this.timer=setTimeout(()=>{if(this.timer=null,t!==this.generation)return;const i=()=>this.poll(t);this.host.track?this.host.track(i):i()},e)}async poll(e){let t;try{t=B(await this.host.request())}catch(i){if(e!==this.generation)return;const o=q(i);if(o?.kind==="failed"){this.stop(),this.host.fail(o.message,o.snapshot);return}if(o?.kind==="not-ready"){this.snapshot=o.snapshot??this.snapshot,this.publish({state:"starting",snapshot:this.snapshot,available:o.snapshot!==null}),this.schedule(o.retryAfterMs);return}this.unavailable();return}if(e===this.generation){if(t===null){this.unavailable();return}if(this.snapshot=t,t.phase==="failed"){this.stop(),this.host.fail(t.failure?.message??"",t);return}if(t.phase==="ready"){this.stop(),this.publish({state:"starting",snapshot:t,available:!0},!0),this.host.handoff(!0);return}this.publish({state:"starting",snapshot:t,available:!0}),this.schedule(P(t.retryAfterMs))}}unavailable(){this.stop(),this.publish({state:"starting",snapshot:this.snapshot,available:!1},!0),this.host.handoff(!1)}}function Pe(s=(()=>{const e=globalThis.__INTENT_RUNTIME_CONFIG__;return e?.intentdWsUrl!==void 0?e.intentdWsUrl:typeof process>"u"?void 0:""})()){if(typeof s!="string")return;const e=s.trim();if(!e)return;if(e.startsWith("/")&&!e.startsWith("//")&&!e.includes("\\")){const o=globalThis.location;if(o?.host&&(o.protocol==="http:"||o.protocol==="https:"))return`${o.protocol==="https:"?"wss:":"ws:"}//${o.host}${e}`;console.warn("[browser-websocket-transport] Ignoring same-origin WebSocket path without an HTTP page origin");return}let t;try{t=new URL(e)}catch{console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}if(t.protocol!=="ws:"&&t.protocol!=="wss:"){console.warn("[browser-websocket-transport] Ignoring browser WebSocket URL: expected ws:// or wss://");return}const i=t.hostname==="localhost"||t.hostname==="127.0.0.1"||t.hostname==="[::1]";if(t.protocol==="ws:"&&!i){console.warn("[browser-websocket-transport] Ignoring insecure remote WebSocket URL: use wss://");return}return e}function de(s){try{const e=new URL(s);return e.username="",e.password="",e.search="",e.hash="",e.toString()}catch{return s.replace(/[?#].*$/,"").replace(/^([a-z][a-z0-9+.-]*:\/\/)[^/]*@/i,"$1")}}const fe={[-32700]:"PARSE_ERROR",[-32600]:"INVALID_REQUEST",[-32601]:"METHOD_NOT_FOUND",[-32602]:"INVALID_PARAMS",[-32603]:"INTERNAL_ERROR"};function pe(s){const e=fe[s];return e||(s<=-32e3&&s>=-32099?"SERVER_ERROR":"UNKNOWN_ERROR")}function me(s){if(s&&typeof s=="object"&&"code"in s){const e=s.code;if(typeof e=="string"&&e.length>0)return e}}function O(s){const e=me(s.data)??pe(s.code),t=s.data&&typeof s.data=="object"?{...s.data,code:e}:typeof s.data=="string"&&s.data.length>0?{code:e,detail:s.data}:{code:e};return{code:e,message:s.message,data:t,rpcCode:s.code}}function E(s){if(s instanceof u)return s;const e=s instanceof Error?s.message:String(s);return new u({code:"TRANSPORT_ERROR",message:e,data:{code:"TRANSPORT_ERROR"}})}const ge=3e4,Re=1e3,ye=3e4,Se=1e4,be=5e3;class we{constructor(e){n(this,"url");n(this,"webSocketFactory");n(this,"requestTimeoutMs");n(this,"reconnectDelayMs");n(this,"maxReconnectDelayMs");n(this,"connectTimeoutMs");n(this,"socket",null);n(this,"connected",!1);n(this,"connecting",!1);n(this,"disposed",!1);n(this,"requestId",0);n(this,"currentReconnectDelay");n(this,"reconnectTimer",null);n(this,"connectTimer",null);n(this,"connectWaiters",[]);n(this,"clientId");n(this,"helloConfirmed",!1);n(this,"acknowledgedHello",null);n(this,"nodeCapabilities",null);n(this,"capabilityHelloGeneration",0);n(this,"reviewMonitoring");n(this,"reviewMonitoringRecipient");n(this,"reviewMonitoringEnabled",!1);n(this,"ordinaryHello",!1);n(this,"monitorRetry",null);n(this,"monitorRetirements",new Set);n(this,"monitorReady",new Set);n(this,"protocolVersion",null);n(this,"helloError",new u({code:"UNAVAILABLE",message:"client.hello has not completed on this connection"}));n(this,"pending",new Map);n(this,"hasBeenConnected",!1);n(this,"hasConnectionFailed",!1);n(this,"notificationHandlers",new Set);n(this,"reconnectedHandlers",new Set);n(this,"statusHandlers",new Set);n(this,"lastNotifiedStatus","disconnected");n(this,"startupState",null);n(this,"startupSocket",null);n(this,"startupPoller",new ue({request:()=>{const e=this.startupSocket;return e?this.requestOnSocket(se,void 0,{timeoutMs:ae},e):Promise.reject(this.startupRefusal())},publish:e=>this.updateStartup(e),handoff:e=>this.startupHandoff(e),fail:(e,t)=>this.failStartup(e,t)}));n(this,"startupHandlers",new Set);this.reviewMonitoringEnabled=v(e.reviewMonitoring),this.reviewMonitoringRecipient=v(e.reviewMonitoring)?e.reviewMonitoring:void 0,this.url=e.url,this.webSocketFactory=e.webSocketFactory??(t=>new WebSocket(t)),this.requestTimeoutMs=e.requestTimeoutMs??ge,this.reconnectDelayMs=e.reconnectDelayMs??Re,this.maxReconnectDelayMs=e.maxReconnectDelayMs??ye,this.connectTimeoutMs=e.connectTimeoutMs??Se,this.currentReconnectDelay=this.reconnectDelayMs}isAvailable(){return!this.disposed}async readPrincipal(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected(),t=this.capabilityHelloGeneration,i=structuredClone(this.acknowledgedHello),o=()=>!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t&&this.acknowledgedHello!==null;if(!o())throw this.helloError;const a=await this.requestOnSocket("principal.me",{},void 0,e);if(!o())throw new u({code:"UNAVAILABLE",message:"Principal discovery connection changed"});return{hello:i,principal:a}}async observeNodeCapabilities(){if(this.disposed)throw new u({code:"UNAVAILABLE",message:"Backend transport disposed"});const e=await this.ensureConnected();if(this.disposed||!this.connected||this.socket!==e)throw new u({code:"UNAVAILABLE",message:"Backend connection changed"});return{server:{capabilities:this.nodeCapabilities}}}onMonitorReconnected(e){this.monitorReady.add(e);const t=this.onReconnected(e);return()=>{this.monitorReady.delete(e),t()}}prMonitorBackendId(){return de(this.url)}async capturePrMonitorSession(e){const t=await this.ensureConnected(),i=this.capabilityHelloGeneration,o=()=>new u({code:"PR_MONITOR_SESSION_RETIRED",message:"Monitor connection unavailable"});let a,d=!1;const R=new Set,m=new Set,r=()=>{if(!d){d=!0,this.monitorRetirements.delete(r),a?.close();for(const l of R)l();R.clear()}},f=()=>!d&&!this.disposed&&this.connected&&this.helloConfirmed&&this.socket===t&&i===this.capabilityHelloGeneration,c=()=>f()&&(!a||a.current());if(!c())throw o();this.monitorRetirements.add(r);const g=v(this.reviewMonitoring);let M=g?"consumer-pending":"unsupported";if(g&&this.reviewMonitoringEnabled&&this.ordinaryHello&&this.clientId)try{if(a=new Y(this.webSocketFactory(this.url),this.clientId,Math.min(this.reviewMonitoringRecipient,this.reviewMonitoring),f,this.requestTimeoutMs,this.connectTimeoutMs,()=>{const l=f();r(),l&&this.scheduleMonitorRecovery(t,i)}),await a.ready,!c())throw o();M="supported"}catch(l){const p=f();throw r(),p&&this.scheduleMonitorRecovery(t,i),l}const y=(l,p)=>a?a.request(l,p):this.requestOnSocket(l,p,void 0,t);return{origin:{backendId:this.prMonitorBackendId(),sessionId:crypto.randomUUID(),workspaceId:e},support:M,onRetired(l){return c()?(R.add(l),()=>{R.delete(l)}):(l(),()=>{})},onNotification:l=>(a??this).onNotification(p=>{c()&&l(p)}),request:async(l,p)=>{if(!c()||M==="consumer-pending"||p.workspaceId!==e)throw o();const k=await y(l,p),h=l==="events.subscribe"?k?.subscriptionId:void 0;if(!c())throw h&&this.socket===t&&this.connected&&i===this.capabilityHelloGeneration&&y("events.unsubscribe",{workspaceId:e,subscriptionId:h}).catch(()=>{}),o();return h&&m.add(h),l==="events.unsubscribe"&&m.delete(String(p.subscriptionId)),k},release:async()=>{const l=c();r(),l&&!a&&await Promise.all([...m].map(p=>this.requestOnSocket("events.unsubscribe",{workspaceId:e,subscriptionId:p},void 0,t).catch(()=>{})))}}}request(e,t,i){return this.requestOnSocket(e,t,i)}requestOnSocket(e,t,i,o){if(i?.localMachine)return Promise.reject(new u({code:"UNAVAILABLE",message:"Local machine requests require the desktop bridge"}));if(this.disposed)return Promise.reject(new u({code:"UNAVAILABLE",message:"Backend transport disposed"}));if(!o&&this.startupState?.state==="starting")return Promise.reject(new u(O(D(this.startupState))));const a=++this.requestId,d=i?.timeoutMs,R=typeof d=="number"&&Number.isFinite(d)&&d>0?d:this.requestTimeoutMs;return new Promise((m,r)=>{let f=!1;const c=setTimeout(()=>{f=!0,this.pending.delete(a),r(new u({code:"TIMEOUT",message:`JSON-RPC request timed out: ${e}`,data:{code:"TIMEOUT"}}))},R),g=y=>{clearTimeout(c),r(E(y))},M=y=>{if(f)return;if(this.disposed||this.socket!==y){g(new u({code:"TRANSPORT_ERROR",message:"Connection replaced"}));return}if(e==="presence.update"&&!this.helloConfirmed){g(this.helloError);return}try{ee(e,t,this.protocolVersion)}catch(h){g(h);return}let l=e==="client.hello"&&this.clientId?{clientId:this.clientId,...t}:t;if(e==="client.hello"){const h={...l},S={...h.capabilities};Object.prototype.hasOwnProperty.call(S,"reviewMonitoring")&&(this.reviewMonitoringEnabled=this.reviewMonitoringRecipient!==void 0&&v(S.reviewMonitoring)),delete S.reviewMonitoring,delete h.connectionRole,h.capabilities!==void 0&&(h.capabilities=S),l=h}const p=JSON.stringify({jsonrpc:"2.0",id:a,method:e,params:l}),k=e==="client.hello"?++this.capabilityHelloGeneration:0;if(e==="client.hello"){this.helloConfirmed=!1,this.ordinaryHello=!1,this.clearMonitorRecovery(),this.nodeCapabilities=null,this.reviewMonitoring=void 0;for(const h of[...this.monitorRetirements])h();this.acknowledgedHello=null}this.pending.set(a,{method:e,timeout:c,resolve:h=>{if(e==="client.hello"&&this.socket===y&&k===this.capabilityHelloGeneration){const S=h?.clientId;if(typeof S=="string"&&S.length>0){const H=h.server?.capabilities;if(this.clientId=S,this.reviewMonitoring=H?.reviewMonitoring,this.ordinaryHello=h.connectionRole===void 0,this.acknowledgedHello=structuredClone(h),this.nodeCapabilities=Q(H),this.protocolVersion=z(h.protocolVersion),this.helloConfirmed=!0,this.connected)for(const W of this.monitorReady)W()}}m(h)},reject:r});try{y.send(p)}catch(h){clearTimeout(c),this.pending.delete(a),r(E(h))}};o?M(o):this.connected&&this.socket?M(this.socket):this.ensureConnected().then(M,g)})}async subscribe(e){return this.request("events.subscribe",e)}async unsubscribe(e,t){try{await this.request("events.unsubscribe",{subscriptionId:e,...t!==void 0?{workspaceId:t}:{}})}catch{}}onNotification(e){return this.notificationHandlers.add(e),()=>this.notificationHandlers.delete(e)}onReconnected(e){return this.reconnectedHandlers.add(e),()=>this.reconnectedHandlers.delete(e)}getConnectionStatus(){return this.connected?"connected":this.connecting?"connecting":"disconnected"}getStartupState(){return this.startupState}onStartupChange(e){return this.startupHandlers.add(e),()=>this.startupHandlers.delete(e)}onConnectionStatusChange(e){return this.statusHandlers.add(e),()=>this.statusHandlers.delete(e)}dispose(){if(this.disposed)return;this.disposed=!0,this.clearReconnect(),this.clearConnectTimer();const e=new u({code:"UNAVAILABLE",message:"Backend transport disposed"});this.failPending(e),this.failWaiters(e),this.teardownSocket(),this.connected=!1,this.connecting=!1,this.notifyStatusChange(),this.notificationHandlers.clear(),this.reconnectedHandlers.clear(),this.statusHandlers.clear(),this.startupHandlers.clear()}ensureConnected(){return this.connected&&this.socket?Promise.resolve(this.socket):new Promise((e,t)=>{this.connectWaiters.push({resolve:e,reject:t}),this.start()})}start(){this.disposed||this.socket||this.connecting||this.reconnectTimer||this.connect()}connect(){this.clearReconnect(),this.connecting=!0,this.notifyStatusChange();let e;try{e=this.webSocketFactory(this.url)}catch(t){this.connecting=!1,this.onConnectionFailure(E(t));return}this.socket=e,this.helloConfirmed=!1,this.connectTimer=setTimeout(()=>{this.connectTimer=null,!(this.socket!==e||this.connected)&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:`WebSocket connect attempt timed out after ${this.connectTimeoutMs}ms`})))},this.connectTimeoutMs),e.onopen=()=>{this.socket===e&&this.onConnected(e)},e.onmessage=t=>{this.socket===e&&this.onMessage(t.data)},e.onerror=null,e.onclose=()=>{this.socket===e&&(this.connecting=!1,this.onConnectionFailure(new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})))}}onConnected(e){this.clearConnectTimer(),this.performHelloHandshake(e)}async performHelloHandshake(e){try{await this.requestOnSocket("client.hello",{},{timeoutMs:Math.min(this.requestTimeoutMs,be)},e)}catch(o){if(this.disposed||this.socket!==e)return;const a=q(o);if(a){this.enterStartup(e,a);return}this.helloError=E(o)}if(this.disposed||this.socket!==e)return;this.startupPoller.reset(),this.startupSocket=null;const t=this.startupState!==null;this.startupState=null,this.connecting=!1,this.connected=!0,this.currentReconnectDelay=this.reconnectDelayMs;const i=this.hasBeenConnected||this.hasConnectionFailed;if(this.hasBeenConnected=!0,this.hasConnectionFailed=!1,this.notifyStatusChange(),t)for(const o of[...this.startupHandlers])o(null);if(this.flushWaiters(e),i)for(const o of[...this.reconnectedHandlers])o()}onConnectionFailure(e){if(this.clearConnectTimer(),!this.disposed){if(this.startupSocket!==null&&this.startupSocket===this.socket){this.startupHandoff(!0);return}this.startupState?.state==="starting"&&(this.startupPoller.reset(),this.updateStartup(null)),this.hasConnectionFailed=!0,this.connected=!1,this.notifyStatusChange(),this.teardownSocket(),this.failPending(e),this.failWaiters(e),this.scheduleReconnect()}}notifyStatusChange(){const e=this.getConnectionStatus();if(e!==this.lastNotifiedStatus){this.lastNotifiedStatus=e;for(const t of[...this.statusHandlers])t(e)}}onMessage(e){if(typeof e!="string")return;let t;try{t=JSON.parse(e)}catch{console.warn("[browser-websocket-transport] Dropping unparseable frame");return}if(!t||typeof t!="object")return;const i=typeof t.method=="string",o=t.id!=null;if(i&&o){this.sendFrame({jsonrpc:"2.0",id:t.id,error:{code:-32601,message:`Method not found: ${String(t.method)}`}});return}if(o){const a=Number(t.id),d=this.pending.get(a);if(!d)return;this.pending.delete(a),clearTimeout(d.timeout),t.error?d.reject(new u(O(t.error))):d.resolve(t.result);return}if(i){const a={method:t.method,params:t.params};for(const d of[...this.notificationHandlers])d(a)}}sendFrame(e){try{this.socket?.send(JSON.stringify(e))}catch{}}scheduleReconnect(){if(this.disposed||this.reconnectTimer)return;const e=this.currentReconnectDelay;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.currentReconnectDelay=Math.min(e*2,this.maxReconnectDelayMs),this.disposed||this.connect()},e)}clearReconnect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}clearConnectTimer(){this.connectTimer&&(clearTimeout(this.connectTimer),this.connectTimer=null)}scheduleMonitorRecovery(e,t){this.monitorRetry||this.disposed||(this.monitorRetry=setTimeout(()=>{if(this.monitorRetry=null,!this.disposed&&this.connected&&this.socket===e&&this.capabilityHelloGeneration===t)for(const i of[...this.monitorReady])i()},this.reconnectDelayMs))}clearMonitorRecovery(){this.monitorRetry&&clearTimeout(this.monitorRetry),this.monitorRetry=null}teardownSocket(){this.startupPoller.stop(),this.startupSocket=null,this.reviewMonitoring=void 0,this.clearMonitorRecovery();for(const t of[...this.monitorRetirements])t();if(this.acknowledgedHello=null,this.nodeCapabilities=null,this.capabilityHelloGeneration+=1,this.protocolVersion=null,!this.socket)return;const e=this.socket;this.socket=null,e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}updateStartup(e){this.startupState=e?Object.freeze({...e}):null;for(const t of[...this.startupHandlers])t(this.startupState)}startupRefusal(){return this.startupState?new u(O(D(this.startupState))):new u({code:"TRANSPORT_ERROR",message:"WebSocket connection closed"})}enterStartup(e,t){if(this.hasConnectionFailed=!0,t.kind==="failed"){this.failStartup(t.message,t.snapshot);return}this.startupSocket=e,this.startupPoller.start(t),this.failWaiters(this.startupRefusal())}startupHandoff(e){const t=this.startupRefusal();if(this.teardownSocket(),this.failPending(t),this.disposed)return;this.connecting=!0,this.notifyStatusChange(),this.clearReconnect();let i=this.reconnectDelayMs;e?this.currentReconnectDelay=this.reconnectDelayMs:(i=this.currentReconnectDelay,this.currentReconnectDelay=Math.min(i*2,this.maxReconnectDelayMs)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.disposed||this.connect()},i)}failStartup(e,t){this.startupPoller.stop(),this.startupSocket=null,this.hasConnectionFailed=!0,this.updateStartup({state:"failed",snapshot:t,available:t!==null,message:e}),this.connecting=!1,this.onConnectionFailure(this.startupRefusal())}failPending(e){for(const t of this.pending.values())clearTimeout(t.timeout),t.reject(e);this.pending.clear()}flushWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.resolve(e)}failWaiters(e){const t=this.connectWaiters;this.connectWaiters=[];for(const i of t)i.reject(e)}}function He(s){return new we(s)}let A=null;const I=new Set;function De(s){A=s;for(const e of[...I])e(s)}function Ue(){return A}function Le(s){return I.add(s),A&&s(A),()=>I.delete(s)}export{u as B,Oe as M,_e as P,Ie as R,Ae as a,Ce as b,He as c,Ne as d,Pe as e,v as f,Ue as g,Ee as i,Le as o,De as r,de as s};
@@ -1 +1 @@
1
- import{at as L,ca as T}from"./3SdAC2_C.js";import{a as C,s as E}from"./BsieX9dN.js";import{o as F,p as H}from"./CnFZbWXv.js";import"./B26ZHg3s.js";import{S as N}from"./Bx1P9uW7.js";function b(e){return typeof e=="object"?{open:e.open??!0,tier:e.tier??"slow",onClosed:e.onClosed}:{open:e??!0,tier:"slow",onClosed:void 0}}function W(e){const l=e.querySelectorAll("[data-animated-height-target]"),t=l.item(l.length-1)||e.firstElementChild;if(!t)return e.scrollHeight;const n=getComputedStyle(t),c=Number.parseFloat(n.height);return Number.isFinite(c)?n.boxSizing==="border-box"?c:c+["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((r,u)=>r+(Number.parseFloat(n[u])||0),0):t.offsetHeight}const P=(e,l=!0)=>{let{open:t,onClosed:n}=b(l);const{tier:c}=b(l),r=new N(0,c);let u=!t,v,i=!1,a,h,s;const O=e.style.overflow,S=e.style.height,m=()=>{e.style.overflow="clip",v=r.current,e.style.height=`${v}px`},M=L(()=>{T(()=>{const o=r.current;!u||i||o===v||(s?.(),s=C(()=>{s=void 0,i||m()}))})}),d=()=>{if(i)return;a?.(),h?.();const o=f=>{h=C(()=>{if(h=void 0,i)return;const z=r.set(f,{instant:!u||H()});u=!0,t||z.then(()=>{!i&&!t&&r.current===0&&n?.()}),s?.(),s=void 0,m()})};t?a=E(()=>{a=void 0,o(W(e))}):o(0)},R=()=>{H()&&d()},p=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{t&&d()});let g=null;const y=()=>{const o=e.querySelectorAll("[data-animated-height-target]"),f=o.item(o.length-1)||e.firstElementChild||e;f!==g&&(g&&p?.unobserve(g),g=f,p?.observe(f))};y();const w=typeof MutationObserver>"u"?void 0:new MutationObserver(()=>{i||(y(),t&&d())});w?.observe(e,{childList:!0,subtree:!0});const x=F(R);return d(),{update(o=!0){({open:t,onClosed:n}=b(o)),d()},destroy(){i=!0,a?.(),h?.(),s?.(),r.set(r.current,{instant:!0}),p?.disconnect(),w?.disconnect(),x(),M(),e.style.height=S,e.style.overflow=O}}};export{P as a};
1
+ import{at as L,ca as T}from"./3SdAC2_C.js";import{a as C,s as E}from"./BsieX9dN.js";import{o as F,p as H}from"./CA6H1-bp.js";import"./BRCr02in.js";import{S as N}from"./CxR-pcVt.js";function b(e){return typeof e=="object"?{open:e.open??!0,tier:e.tier??"slow",onClosed:e.onClosed}:{open:e??!0,tier:"slow",onClosed:void 0}}function W(e){const l=e.querySelectorAll("[data-animated-height-target]"),t=l.item(l.length-1)||e.firstElementChild;if(!t)return e.scrollHeight;const n=getComputedStyle(t),c=Number.parseFloat(n.height);return Number.isFinite(c)?n.boxSizing==="border-box"?c:c+["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((r,u)=>r+(Number.parseFloat(n[u])||0),0):t.offsetHeight}const P=(e,l=!0)=>{let{open:t,onClosed:n}=b(l);const{tier:c}=b(l),r=new N(0,c);let u=!t,v,i=!1,a,h,s;const O=e.style.overflow,S=e.style.height,m=()=>{e.style.overflow="clip",v=r.current,e.style.height=`${v}px`},M=L(()=>{T(()=>{const o=r.current;!u||i||o===v||(s?.(),s=C(()=>{s=void 0,i||m()}))})}),d=()=>{if(i)return;a?.(),h?.();const o=f=>{h=C(()=>{if(h=void 0,i)return;const z=r.set(f,{instant:!u||H()});u=!0,t||z.then(()=>{!i&&!t&&r.current===0&&n?.()}),s?.(),s=void 0,m()})};t?a=E(()=>{a=void 0,o(W(e))}):o(0)},R=()=>{H()&&d()},p=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{t&&d()});let g=null;const y=()=>{const o=e.querySelectorAll("[data-animated-height-target]"),f=o.item(o.length-1)||e.firstElementChild||e;f!==g&&(g&&p?.unobserve(g),g=f,p?.observe(f))};y();const w=typeof MutationObserver>"u"?void 0:new MutationObserver(()=>{i||(y(),t&&d())});w?.observe(e,{childList:!0,subtree:!0});const x=F(R);return d(),{update(o=!0){({open:t,onClosed:n}=b(o)),d()},destroy(){i=!0,a?.(),h?.(),s?.(),r.set(r.current,{instant:!0}),p?.disconnect(),w?.disconnect(),x(),M(),e.style.height=S,e.style.overflow=O}}};export{P as a};
@@ -1 +1 @@
1
- import{t as g,bo as n,br as v,bw as b,bp as h,b as x}from"./CtfEuoOH.js";import{bs as w,a7 as S,ay as y,aD as _,W as k,bn as z,aA as i,c9 as C}from"./3SdAC2_C.js";import{c as A}from"./BZ27qIg1.js";import{e as I,p as M}from"./B26ZHg3s.js";import{S as P}from"./Cxmepjfl.js";var W=new Set(["$$slots","$$events","$$legacy","ref","class","data-slot"]);function D(l,t){if(new.target)return g({component:D,...l});w(t,!0);let a=n(t,"ref",15,null),r=n(t,"class",7),s=n(t,"data-slot",7,"separator"),c=h(t,W);var m={get ref(){return a()},set ref(e=null){a(e),i()},get class(){return r()},set class(e){r(e),i()},get"data-slot"(){return s()},set"data-slot"(e="separator"){s(e),i()},$set:b,$on:(e,o)=>x(t,e,o)},p=S(),d=y(p);{let e=C(()=>I("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",r()));A(d,()=>P,(o,u)=>{u(o,v({get"data-slot"(){return s()},get class(){return _(e)}},()=>c,{get ref(){return a()},set ref(f){a(f)}}))})}return k(l,p),z(m)}const F=[{id:"separator-state-matrix",title:"Separator states",states:["horizontal","vertical","decorative","semantic","compact","zoom-200","light","dark"],themes:["light","dark","high-contrast"],viewport:"both"}];M({id:"separator",source:"src/lib/components/ui/separator/separator.svelte",publicImport:"$lib/components/ui/separator",legacyImports:["$lib/components/ui/separator/index.js"],exports:["Root","Separator","separatorMetadata"],category:"primitive",owner:"design-system",callers:["src/features/discussions/components/DiscussionMentionPicker.svelte","src/features/home/HomeAssistantThreads.svelte","src/features/workspace-sharing/components/WorkspaceSharingSetup.svelte","src/lib/component-catalog/renderers/ContentFieldCatalogPreview.svelte","src/lib/components/file-explorer/file-explorer-layout.svelte","src/lib/components/ui/sidebar/sidebar-separator.svelte","src/lib/components/workspace/WorkspaceAgentsList.svelte"],replacement:null,characterizationTest:"src/lib/components/ui/separator/separator.test.ts",removalGate:"Retain while exported and orientation, semantic, and fixture tests pass.",dynamicImports:[],fixtures:F});export{D as S};
1
+ import{t as g,bo as n,br as v,bw as b,bp as h,b as x}from"./Fcr7AvC-.js";import{bs as w,a7 as S,ay as y,aD as _,W as k,bn as z,aA as i,c9 as C}from"./3SdAC2_C.js";import{c as A}from"./2z64ELW5.js";import{e as I,p as M}from"./BRCr02in.js";import{S as P}from"./DWjpzYNk.js";var W=new Set(["$$slots","$$events","$$legacy","ref","class","data-slot"]);function D(l,t){if(new.target)return g({component:D,...l});w(t,!0);let a=n(t,"ref",15,null),r=n(t,"class",7),s=n(t,"data-slot",7,"separator"),c=h(t,W);var m={get ref(){return a()},set ref(e=null){a(e),i()},get class(){return r()},set class(e){r(e),i()},get"data-slot"(){return s()},set"data-slot"(e="separator"){s(e),i()},$set:b,$on:(e,o)=>x(t,e,o)},p=S(),d=y(p);{let e=C(()=>I("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",r()));A(d,()=>P,(o,u)=>{u(o,v({get"data-slot"(){return s()},get class(){return _(e)}},()=>c,{get ref(){return a()},set ref(f){a(f)}}))})}return k(l,p),z(m)}const F=[{id:"separator-state-matrix",title:"Separator states",states:["horizontal","vertical","decorative","semantic","compact","zoom-200","light","dark"],themes:["light","dark","high-contrast"],viewport:"both"}];M({id:"separator",source:"src/lib/components/ui/separator/separator.svelte",publicImport:"$lib/components/ui/separator",legacyImports:["$lib/components/ui/separator/index.js"],exports:["Root","Separator","separatorMetadata"],category:"primitive",owner:"design-system",callers:["src/features/discussions/components/DiscussionMentionPicker.svelte","src/features/home/HomeAssistantThreads.svelte","src/features/workspace-sharing/components/WorkspaceSharingSetup.svelte","src/lib/component-catalog/renderers/ContentFieldCatalogPreview.svelte","src/lib/components/file-explorer/file-explorer-layout.svelte","src/lib/components/ui/sidebar/sidebar-separator.svelte","src/lib/components/workspace/WorkspaceAgentsList.svelte"],replacement:null,characterizationTest:"src/lib/components/ui/separator/separator.test.ts",removalGate:"Retain while exported and orientation, semantic, and fixture tests pass.",dynamicImports:[],fixtures:F});export{D as S};
@@ -1 +1 @@
1
- import{t as _,bo as g,bw as h,b as y,bp as x}from"./CtfEuoOH.js";import{bs as w,a7 as S,ay as P,aD as s,W as i,bn as k,c9 as C,aA as H,aB as W}from"./3SdAC2_C.js";import{i as A}from"./DynUeYUu.js";import{b as d}from"./B26ZHg3s.js";import{e as B}from"./DcraaizU.js";import{aY as D,aQ as O}from"./D9R5fzn8.js";const v={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};D(v);var Q=new Set(["$$slots","$$events","$$legacy","value"]),l=W("<input/>");function T(n,a){if(new.target)return _({component:T,...n});w(a,!0);let r=g(a,"value",15),u=x(a,Q);const o=C(()=>O(u,{"aria-hidden":"true",tabindex:-1,style:{...v,position:"absolute",top:"0",left:"0"}}));var m={get value(){return r()},set value(e){r(e),H()},$set:h,$on:(e,t)=>y(a,e,t)},p=S(),c=P(p);{var f=e=>{var t=l();d(t,()=>({...s(o),value:r()}),void 0,void 0,void 0,void 0,!0),i(e,t)},b=e=>{var t=l();d(t,()=>({...s(o)}),void 0,void 0,void 0,void 0,!0),B(t,r),i(e,t)};A(c,e=>{s(o).type==="checkbox"?e(f):e(b,-1)})}return i(n,p),k(m)}export{T as H};
1
+ import{t as _,bo as g,bw as h,b as y,bp as x}from"./Fcr7AvC-.js";import{bs as w,a7 as S,ay as P,aD as s,W as i,bn as k,c9 as C,aA as H,aB as W}from"./3SdAC2_C.js";import{i as A}from"./BhYXv0ZM.js";import{b as d}from"./BRCr02in.js";import{e as B}from"./C3KgmGxd.js";import{aY as D,aQ as O}from"./Beq_QLuz.js";const v={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};D(v);var Q=new Set(["$$slots","$$events","$$legacy","value"]),l=W("<input/>");function T(n,a){if(new.target)return _({component:T,...n});w(a,!0);let r=g(a,"value",15),u=x(a,Q);const o=C(()=>O(u,{"aria-hidden":"true",tabindex:-1,style:{...v,position:"absolute",top:"0",left:"0"}}));var m={get value(){return r()},set value(e){r(e),H()},$set:h,$on:(e,t)=>y(a,e,t)},p=S(),c=P(p);{var f=e=>{var t=l();d(t,()=>({...s(o),value:r()}),void 0,void 0,void 0,void 0,!0),i(e,t)},b=e=>{var t=l();d(t,()=>({...s(o)}),void 0,void 0,void 0,void 0,!0),B(t,r),i(e,t)};A(c,e=>{s(o).type==="checkbox"?e(f):e(b,-1)})}return i(n,p),k(m)}export{T as H};
@@ -1 +1 @@
1
- import{t as g,bo as h,bm as u,bw as C,b as S}from"./CtfEuoOH.js";import{bs as T,a5 as _,bl as l,bS as m,bA as c,b_ as w,bO as n,W as A,bn as j,aA as B,aB as I}from"./3SdAC2_C.js";var L=I('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><div class="text-center"><p class="text-lg font-medium text-foreground"> </p> <p class="text-sm"> </p> <p class="text-xs mt-4 text-subtle"> </p></div></div>');function O(p,a){if(new.target)return g({component:O,...p});T(a,!0);let e=h(a,"tab",7);var v={get tab(){return e()},set tab(t){e(t),B()},$set:C,$on:(t,r)=>S(a,t,r)},s=L(),o=_(s),b=_(o),d=l(b,!0),i=m(b,2),x=l(i,!0),f=m(i,2),y=l(f,!0);return c(o),c(s),w((t,r)=>{n(d,e().title),n(x,t),n(y,r)},[()=>u.layout_panelContent_typeLabel({type:e().type}),()=>u.layout_settingsTab_notImplemented_label()]),A(p,s),j(v)}export{O as default};
1
+ import{t as g,bo as h,bm as u,bw as C,b as S}from"./Fcr7AvC-.js";import{bs as T,a5 as _,bl as l,bS as m,bA as c,b_ as w,bO as n,W as A,bn as j,aA as B,aB as I}from"./3SdAC2_C.js";var L=I('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><div class="text-center"><p class="text-lg font-medium text-foreground"> </p> <p class="text-sm"> </p> <p class="text-xs mt-4 text-subtle"> </p></div></div>');function O(p,a){if(new.target)return g({component:O,...p});T(a,!0);let e=h(a,"tab",7);var v={get tab(){return e()},set tab(t){e(t),B()},$set:C,$on:(t,r)=>S(a,t,r)},s=L(),o=_(s),b=_(o),d=l(b,!0),i=m(b,2),x=l(i,!0),f=m(i,2),y=l(f,!0);return c(o),c(s),w((t,r)=>{n(d,e().title),n(x,t),n(y,r)},[()=>u.layout_panelContent_typeLabel({type:e().type}),()=>u.layout_settingsTab_notImplemented_label()]),A(p,s),j(v)}export{O as default};
@@ -1 +1 @@
1
- import{JH as o,mi as C,nZ as E,nC as L,JM as W}from"./CiKoEJ2m.js";import{w as z}from"./Dms_DO28.js";import{dI as H,dM as f}from"./iQDlfKDR.js";const a=o.createSelector((t,e)=>t.fileExplorer.byWorkspaceId[e]??C),D=o.createSelector((t,e,s)=>{const n=E(t.fileExplorer.searches,s);return n?.workspaceId===e?n:void 0}),G=o.createSelector((t,e)=>{const s=a.select(t,e);return s.rootPath?E(s.nodes,s.rootPath)??null:null}),J=o.createSelector((t,e)=>a.select(t,e).nodes.map),R=o.createSelector((t,e)=>a.select(t,e).isLoading),q=o.createSelector((t,e)=>a.select(t,e).isInitialized),B=o.createSelector((t,e)=>a.select(t,e).error),K=o.createSelector((t,e)=>a.select(t,e).fileCount),O=o.createSelector((t,e)=>a.select(t,e).gitStatus),g=o.createSelector((t,e)=>{const s=H.select(t,e);return s?.worktreePath||s?.repositoryPath||s?.path||""}),V=o.createSelector((t,e)=>{const s=a.select(t,e);return{workspacePath:g.select(t,e),currentWorkspacePath:s.workspacePath,isLoading:s.isLoading,isInitialized:s.isInitialized}});o.createSelector((t,e)=>e?{wsId:e,workspacePath:g.select(t,e),workspaceEnvironmentConfig:f.select(t,e)}:{wsId:null,workspacePath:"",workspaceEnvironmentConfig:void 0});const Z=o.createSelector((t,e,s)=>a.select(t,e).expandedPaths.includes(s)),A=o.createSelector((t,e,s)=>a.select(t,e).loadingPaths.includes(s)),Q=o.createSelector((t,e)=>{const s=a.select(t,e);return s.expandedPaths.some(n=>n!==s.workspacePath)}),T=o.createSelector((t,e)=>{const s=g.select(t,e);if(!s)return!1;const n=a.select(t,e),p=f.select(t,e);return n.workspacePath!==s?!0:n.isLoading?!1:n.isInitialized?p?.type==="remote"&&!n.isRemoteInitialized:!0}),F=new WeakMap,U=o.createSelector((t,e)=>{const s=a.select(t,e);if(!s.rootPath)return[];const n=E(s.nodes,s.rootPath);if(!n)return[];const p=new Set(s.expandedPaths),y=new Set(s.loadingPaths),I=L(s.nodes,n.children,p,y),{agentFileEdits:v,workspacePath:P,gitStatus:S}=s,x=new Set;for(const r of Object.keys(S)){const i=r.split("/");for(let l=1;l<i.length;l++)x.add(i.slice(0,l).join("/"))}return I.map(r=>{let i=r.node.path;if(P){const w=W(r.node.path,P);w!==r.node.path&&(i=w)}const l=r.node.type==="file",c=v[i],d=l?S[i]:void 0,h=!l&&x.has(i),k={isExpanded:r.isExpanded,isLoading:r.isLoading,agentEdits:c&&c.length>0?c:void 0,gitStatus:d,directoryHasChanges:h,displayPath:r.displayPath,compactedExpandedPathsKey:r.compactedExpandedPaths?.join("\0"),depth:r.depth},u=F.get(r.node);if(u&&z(u.inputs,k))return u.result;const m=c&&c.length>0||d!==void 0||h?{node:r.node,depth:r.depth,displayPath:r.displayPath,...r.compactedExpandedPaths?{compactedExpandedPaths:r.compactedExpandedPaths}:{},isExpanded:r.isExpanded,isLoading:r.isLoading,...c&&c.length>0?{agentEdits:c}:{},...d!==void 0?{gitStatus:d}:{},...h?{directoryHasChanges:!0}:{}}:r;return F.set(r.node,{inputs:k,result:m}),m})});export{B as a,K as b,O as c,V as d,q as e,R as f,J as g,G as h,D as i,a as j,U as k,Q as l,Z as m,A as n,T as o,g as s};
1
+ import{JH as o,mi as C,nZ as E,nC as L,JM as W}from"./D0qhIm1r.js";import{w as z}from"./Dms_DO28.js";import{dI as H,dM as f}from"./cD292w1o.js";const a=o.createSelector((t,e)=>t.fileExplorer.byWorkspaceId[e]??C),D=o.createSelector((t,e,s)=>{const n=E(t.fileExplorer.searches,s);return n?.workspaceId===e?n:void 0}),G=o.createSelector((t,e)=>{const s=a.select(t,e);return s.rootPath?E(s.nodes,s.rootPath)??null:null}),J=o.createSelector((t,e)=>a.select(t,e).nodes.map),R=o.createSelector((t,e)=>a.select(t,e).isLoading),q=o.createSelector((t,e)=>a.select(t,e).isInitialized),B=o.createSelector((t,e)=>a.select(t,e).error),K=o.createSelector((t,e)=>a.select(t,e).fileCount),O=o.createSelector((t,e)=>a.select(t,e).gitStatus),g=o.createSelector((t,e)=>{const s=H.select(t,e);return s?.worktreePath||s?.repositoryPath||s?.path||""}),V=o.createSelector((t,e)=>{const s=a.select(t,e);return{workspacePath:g.select(t,e),currentWorkspacePath:s.workspacePath,isLoading:s.isLoading,isInitialized:s.isInitialized}});o.createSelector((t,e)=>e?{wsId:e,workspacePath:g.select(t,e),workspaceEnvironmentConfig:f.select(t,e)}:{wsId:null,workspacePath:"",workspaceEnvironmentConfig:void 0});const Z=o.createSelector((t,e,s)=>a.select(t,e).expandedPaths.includes(s)),A=o.createSelector((t,e,s)=>a.select(t,e).loadingPaths.includes(s)),Q=o.createSelector((t,e)=>{const s=a.select(t,e);return s.expandedPaths.some(n=>n!==s.workspacePath)}),T=o.createSelector((t,e)=>{const s=g.select(t,e);if(!s)return!1;const n=a.select(t,e),p=f.select(t,e);return n.workspacePath!==s?!0:n.isLoading?!1:n.isInitialized?p?.type==="remote"&&!n.isRemoteInitialized:!0}),F=new WeakMap,U=o.createSelector((t,e)=>{const s=a.select(t,e);if(!s.rootPath)return[];const n=E(s.nodes,s.rootPath);if(!n)return[];const p=new Set(s.expandedPaths),y=new Set(s.loadingPaths),I=L(s.nodes,n.children,p,y),{agentFileEdits:v,workspacePath:P,gitStatus:S}=s,x=new Set;for(const r of Object.keys(S)){const i=r.split("/");for(let l=1;l<i.length;l++)x.add(i.slice(0,l).join("/"))}return I.map(r=>{let i=r.node.path;if(P){const w=W(r.node.path,P);w!==r.node.path&&(i=w)}const l=r.node.type==="file",c=v[i],d=l?S[i]:void 0,h=!l&&x.has(i),k={isExpanded:r.isExpanded,isLoading:r.isLoading,agentEdits:c&&c.length>0?c:void 0,gitStatus:d,directoryHasChanges:h,displayPath:r.displayPath,compactedExpandedPathsKey:r.compactedExpandedPaths?.join("\0"),depth:r.depth},u=F.get(r.node);if(u&&z(u.inputs,k))return u.result;const m=c&&c.length>0||d!==void 0||h?{node:r.node,depth:r.depth,displayPath:r.displayPath,...r.compactedExpandedPaths?{compactedExpandedPaths:r.compactedExpandedPaths}:{},isExpanded:r.isExpanded,isLoading:r.isLoading,...c&&c.length>0?{agentEdits:c}:{},...d!==void 0?{gitStatus:d}:{},...h?{directoryHasChanges:!0}:{}}:r;return F.set(r.node,{inputs:k,result:m}),m})});export{B as a,K as b,O as c,V as d,q as e,R as f,J as g,G as h,D as i,a as j,U as k,Q as l,Z as m,A as n,T as o,g as s};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Bhq56Jsu.js","/app/immutable/chunks/CiKoEJ2m.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CHIxjTWu.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CGmYraIa.js","/app/immutable/chunks/CtfEuoOH.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/iQDlfKDR.js","/app/immutable/chunks/B1lpukIv.js","/app/immutable/chunks/COofQgO0.js","/app/immutable/chunks/BZ27qIg1.js","/app/immutable/chunks/DynUeYUu.js","/app/immutable/chunks/B26ZHg3s.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CnFZbWXv.js","/app/immutable/chunks/CT8vPg_p.js","/app/immutable/chunks/BpezAJRw.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/QzxpbvSo.js","/app/immutable/chunks/DMEIbJII.js","/app/immutable/chunks/BU3y3Xes.js","/app/immutable/chunks/BkcCJyDK.js","/app/immutable/chunks/C3jMXj_V.js","/app/immutable/chunks/D9R5fzn8.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/DFKhOU69.js","/app/immutable/chunks/BFfRQORP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/Bx1P9uW7.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
- var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{JH as a,uC as ce,n_ as k,nZ as y,mq as le,c9 as de,c8 as ue,cn as pe,cm as ge,z6 as C,z7 as B,z4 as he,z3 as fe,z5 as Se,rV as be,o0 as w}from"./CiKoEJ2m.js";import{cU as me,cJ as ve,bJ as _e,cS as Q,aJ as Ae,c3 as ke,c$ as ye,cl as we,cB as Ee,cn as Ce}from"./iQDlfKDR.js";import{a as Pe,i as Re}from"./CL3a4Hm1.js";import{c as N}from"./ChTqQfQN.js";import{x as Me,aO as Te,c as Ie,aD as Fe,B as De,y as Le,z as xe}from"./JvFe2B29.js";import{a0 as Oe,K as J,a1 as We,ay as U,Z as Be,a3 as Ge,L as Ve,$ as Ne,aA as Ue,x as He}from"./C8E14ldW.js";import{bm as n,_ as qe}from"./CtfEuoOH.js";import{i as D}from"./BBWuirRW.js";import{n as ze}from"./qWgJ-CUF.js";const $e=5,L=120,je=4e3,j=.2,Ke=.8;function Ze(e,t,r=$e){const s=e.length>0?t/(2*e.length):0,i=je/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let z=0;for(let F=f;F<b;F+=1)z+=e[F]??0;const $=(z/(b-f)/255-j)/(Ke-j);return Number.isFinite($)?Math.min(1,Math.max(0,$)):0})}const _r=a.createSelector(e=>me.select(e)?.capabilities.gitlabCheckout===!0),Ar=a.createSelector(e=>e.gitlabAuth.host),kr=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),yr=a.createSelector(e=>ce(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Er=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Cr=a.createSelector(e=>e.gitlabAuth.isConfigured),Pr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Rr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Mr=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Tr=a.createSelector(e=>e.gitlabAuth.user),Ir=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const Fr=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],Y=new Set(["pr-reviewer"]),Dr="developer";function Lr(e){return A.find(t=>t.id===e)}const Qe=a.createSelector(e=>e.githubAuth.mutationRequestId),Je=a.createSelector(e=>e.githubAuth.callbacksCancelled),Ye=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),Xe=a.createSelector(e=>e.githubAuth.statusSettled===!0),et=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),tt=a.createSelector(e=>e.githubAuth.user),rt=a.createSelector(e=>e.githubAuth.isAuthenticating),st=a.createSelector(e=>e.githubAuth.deviceFlow),it=a.createSelector(e=>e.githubAuth.error),xr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Je,selectGitHubAuthDeviceFlow:st,selectGitHubAuthError:it,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:rt,selectGitHubAuthIsDisconnecting:Ye,selectGitHubAuthMutationRequestId:Qe,selectGitHubAuthRequiresDaemonAuth:et,selectGitHubAuthStatusSettled:Xe,selectGitHubAuthUser:tt},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function at(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&at(e.modelOptions,r.modelOptions):!1}const Or=a.createSelector(e=>e.specialists.bundledSpecialists),nt=a.createSelector(e=>e.specialists.fileSpecialists),Wr=a.createSelector(e=>k(nt.select(e))),Br=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Gr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Vr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),Nr=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Ur=a.createSelector(e=>e.specialists.specialistsFolderPath),Hr=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(Y.has(t)&&!X.select(e)));function ot(e,t){return t?e:e.filter(r=>!Y.has(r.id))}function ct(e,t){return ot(e,t).filter(r=>!r.hidden)}function qr(e,t){return ct(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=k(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),zr=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),lt=a.createSelector((e,t)=>{const r=y(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&k(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),$r=a.createSelector((e,t)=>lt.select(e,t)?.name??null),jr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),Kr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Zr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Qr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const Jr=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),Yr=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!y(e.specialists.fileSpecialists,t)),Xr=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=y(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return y(e.specialists.fileSpecialists,t)}),es=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),ts=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=y(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),rs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return ve.select(e,o,r);const l=_e.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=y(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:dt.select(e,t)}),dt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:Oe.select(e)?J.select(e):""}),ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?k(r):[]}),is=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??le),as=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),O=N("Clipboard");async function ns(e){let t;if(Pe())try{const r=await Re("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,O.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw O.error("Browser clipboard write failed",r,{electronError:t}),r}throw O.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}function os(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let ut=0;function pt(e,t){const r=++ut;return a.dispatch(ue(e,t,r)),r}function cs(e,t,r){a.dispatch(de(e,t,r))}async function ee(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(pe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??pt(e,t)}))).status==="success"}finally{a.dispatch(ge(i,o))}}async function ls(e,t,r,s,i){return ee(e,t,{kind:"effort",effort:r,previous:s},i)}async function ds(e,t,r,s,i){return ee(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const gt=a.createSelector((e,t)=>k(e.agentModel.mutations).filter(r=>r.consumerId===t)),us=a.createSelector((e,t)=>gt.select(e,t).some(r=>r.status==="pending")),ps=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ae.select(e,t),o=Me.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Te(l),g=c?Ie(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!ke.select(e,r)}});function ht(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const gs=a.createSelector(e=>We.select(e)?null:U.select(e)),ft=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),hs=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),fs=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===ft.select(e)),te=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:ye.select(e)),re=a.createSelector((e,t)=>{if(!t)return J.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return Be.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),se=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=q.select(e,t),s=re.select(e,t),i=S.select(e,t)?.readiness??{};return te.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ss=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return te.select(e,t).filter(i=>ht(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),bs=a.createSelector((e,t)=>t?se.select(e,t):Ve.select(e)),ms=a.createSelector((e,t)=>v.select(e,t)),vs=a.createSelector((e,t)=>t?!!S.select(e,t):Ne.select(e)),_s=a.createSelector((e,t)=>{if(!t)return Fe.select(e);const r=S.select(e,t)?.settings??[],s=re.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),As=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):De.select(e)),ks=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Le.select(e)),ys=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):xe.select(e)),ws=a.createSelector((e,t,r)=>{if(!r)return Ue.select(e,t);const s=q.select(e,r),i=S.select(e,r);return se.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&He(o,i?.readiness[o]?.authenticated))}),Es=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),St={},Cs=a.createSelector(e=>e.providerSettings?.profiles?.status??St),Ps=a.createSelector(e=>e.directoryPicker.source??"daemon"),Rs=a.createSelector(e=>e.directoryPicker.listing),Ms=a.createSelector(e=>e.directoryPicker.loading),Ts=a.createSelector(e=>e.directoryPicker.error),Is=a.createSelector(e=>e.directoryPicker.pathError),Fs=a.createSelector(e=>e.directoryPicker.createError),bt=N("WorkspaceValidation");async function Ds(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mt(s)?_t(s):At(s,t,r)}function mt(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function vt(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function _t(e){return vt(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function At(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(bt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ls(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function xs(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Os(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ws(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Bs(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function yt(e){return e===void 0||!kt.includes(e)}function Gs(e){return e.status==="restarting"?"restarting":yt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function wt(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Vs=a.createSelector(e=>e.voiceSettings.isLoading),Ns=a.createSelector(e=>e.voiceSettings.available),Us=a.createSelector(e=>e.voiceSettings.provider),Hs=a.createSelector(e=>e.voiceSettings.engine),qs=a.createSelector(e=>e.voiceSettings.osEngineAvailable),zs=a.createSelector(e=>e.voiceSettings.keyConfigured),$s=a.createSelector(e=>e.voiceSettings.vocabulary),js=a.createSelector(e=>e.voiceSettings.openaiModel),Ks=a.createSelector(e=>e.voiceSettings.language),Zs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Qs=a.createSelector(e=>e.voiceSettings.inputDeviceId),Js=a.createSelector(e=>e.voiceSettings.inputDevices),Ys=a.createSelector(e=>e.voiceSettings.busyProvider),Xs=a.createSelector(e=>e.voiceSettings.error),ei=a.createSelector(e=>we.select(e)?"unavailable":wt(e.voiceSettings)),G="intent.voice.inputDevice";let V;function Et(){if(V!==void 0)return V;try{const e=localStorage.getItem(G);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ti(e){V=e;try{e===null?localStorage.removeItem(G):localStorage.setItem(G,e)}catch{}}let R=null;function ri(e){R=e}function si(){const e=R;return R=null,e}function Ct(){R=null}const Pt=300,Rt=300;class Mt{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Pt,this.doublePressWindowMs=t.doublePressWindowMs??Rt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let M=null;function ii(e){M=e}function ai(){const e=M;return M=null,e}function Tt(){M=null}const It=66;function Ft(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(Ze(g,l.sampleRate))},It);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Dt=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function ni(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Ot(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Wt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Dt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Ot(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Ft(t,this.onLevels)),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.stopMeter?.(),this.stopMeter=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Mt({onRecordStart:()=>{E&&Nt(E)},onRecordStop:e=>{ie(E,e)}});function oi(){return p!==null}function ci(){return p}function li(e){E=e,_+=1,_===1&&I.keyDown()}function di(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Nt(e,t="key"){if(p!==null)return;Tt(),Ct();const r=new Wt({deviceId:Et(),onLevels:s=>{p===r&&e.dispatch(fe(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(B());return}e.dispatch(he({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(Se({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(B())}})}function ie(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(B());return}m=t,r.stop()}function ui(){ie(null,Vt)}function pi(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ut=N("HardwareConsoleVoiceSetupToast"),Ht="hardware-console-voice-setup";let W=null;function qt(){return W||(W=qe(()=>import("./Bhq56Jsu.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url).then(e=>e.notify)),W}function zt(){ze("/settings?tab=connections#voice").catch(e=>{Ut.error("Failed to open voice settings from setup toast",e)})}function $t(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function gi(){qt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Ht,action:$t()})})}const hi=a.createSelector(e=>e.externalEditors.selectedAction),jt=a.createSelector(e=>e.externalEditors.editors),Kt=a.createSelector(e=>{const t=k(jt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),fi=a.createSelector(e=>e.externalEditors.editorOrder??[]),Si=a.createSelector(e=>e.externalEditors.loading),bi=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),mi=a.createSelector((e,t)=>{if(!(t?Ee.select(e,t):Ce.select(e))||be())return[];const s=Zt.select(e);return Kt.select(e).filter(i=>i.installed&&!s.includes(i.id))}),Z={},Qt=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),vi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),_i=a.createSelector(e=>e.mcpSettings.loading),Ai=a.createSelector(e=>e.mcpSettings.error),ki=a.createSelector(e=>e.mcpSettings.mutationError??null),yi=a.createSelector(e=>e.mcpSettings.enabled),Jt=a.createSelector(e=>e.mcpSettings.disabledServers),Yt=a.createSelector(e=>e.mcpSettings.statusMap),Xt=a.createSelector(e=>e.mcpSettings.toolsMap),er=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),tr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),wi=a.createSelector((e,t)=>Object.keys(tr.select(e,t))),Ei=a.createSelector(e=>{const t=Qt.select(e),r=Yt.select(e),s=Xt.select(e),i=Jt.select(e),o=er.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Ci=a.createSelector(e=>e.mcpSettings.lastImportedCount),Pi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Ri=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(rr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ir(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&sr(t,i.idPattern));return s?{...s,id:t}:void 0}function Mi(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function ar(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const nr=new Set(T.flatMap(e=>e.route?[ar(e.route)]:[])),or=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Ti(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return nr.has(r)?s?!!ir(s):!0:or.some(i=>i.test(r))}const Ii=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],cr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Fi=Object.fromEntries(cr.map(e=>[e.path,e.defaultValue]));export{As as $,ni as A,Et as B,pt as C,Dr as D,vt as E,cr as F,Y as G,ds as H,cs as I,wt as J,ir as K,xs as L,ti as M,us as N,gt as O,ps as P,Or as Q,Nr as R,A as S,bs as T,re as U,q as V,Ss as W,se as X,te as Y,ks as Z,ys as _,$e as a,Ei as a$,ws as a0,Es as a1,vs as a2,_s as a3,ms as a4,Gr as a5,Hr as a6,Fs as a7,Ts as a8,Rs as a9,Ar as aA,yr as aB,Pr as aC,wr as aD,Cr as aE,kr as aF,Tr as aG,_r as aH,Fr as aI,Xr as aJ,Zt as aK,Kt as aL,mi as aM,Si as aN,Jr as aO,Yr as aP,bi as aQ,Ri as aR,Pi as aS,Jt as aT,yi as aU,Ai as aV,er as aW,Ci as aX,_i as aY,ki as aZ,Qt as a_,Ms as aa,Is as ab,Ps as ac,fi as ad,Qr as ae,rs as af,jr as ag,ei as ah,Kr as ai,Zr as aj,Wr as ak,Vr as al,H as am,Je as an,st as ao,it as ap,X as aq,rt as ar,Ye as as,Qe as at,et as au,tt as av,Er as aw,Rr as ax,Mr as ay,Ir as az,Fi as b,Yt as b0,Xt as b1,hi as b2,zr as b3,Cs as b4,gs as b5,lt as b6,is as b7,as as b8,ts as b9,ri as bA,ii as bB,gi as bC,Nt as bD,ui as bE,Os as bF,Ls as bG,Ws as bH,Ds as bI,$t as bJ,ns as bK,ss as ba,$r as bb,es as bc,v as bd,Ur as be,Br as bf,Ys as bg,Hs as bh,Qs as bi,Js as bj,zs as bk,Ks as bl,js as bm,qs as bn,Us as bo,Ns as bp,Xs as bq,Vs as br,$s as bs,Zs as bt,S as bu,ft as bv,fs as bw,hs as bx,wi as by,vi as bz,Ii as c,ls as d,pi as e,Ct as f,Tt as g,si as h,ai as i,qr as j,ct as k,ot as l,ci as m,Mi as n,Bs as o,Gs as p,Lr as q,xr as r,li as s,di as t,yt as u,ht as v,oi as w,os as x,K as y,Ti as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CCAtqaSn.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/cD292w1o.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
+ var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{JH as a,uC as ce,n_ as k,nZ as y,mq as le,c9 as de,c8 as ue,cn as pe,cm as ge,z6 as C,z7 as B,z4 as he,z3 as fe,z5 as Se,rV as be,o0 as w}from"./D0qhIm1r.js";import{cU as me,cJ as ve,bJ as _e,cS as Q,aJ as Ae,c3 as ke,c$ as ye,cl as we,cB as Ee,cn as Ce}from"./cD292w1o.js";import{a as Pe,i as Re}from"./CL3a4Hm1.js";import{c as N}from"./ChTqQfQN.js";import{x as Me,aO as Te,c as Ie,aD as Fe,B as De,y as Le,z as xe}from"./k5fprFtz.js";import{a0 as Oe,K as J,a1 as We,ay as U,Z as Be,a3 as Ge,L as Ve,$ as Ne,aA as Ue,x as He}from"./DrCYFWYk.js";import{bm as n,_ as qe}from"./Fcr7AvC-.js";import{i as D}from"./BBWuirRW.js";import{n as ze}from"./BqF1bVQC.js";const $e=5,L=120,je=4e3,j=.2,Ke=.8;function Ze(e,t,r=$e){const s=e.length>0?t/(2*e.length):0,i=je/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let z=0;for(let F=f;F<b;F+=1)z+=e[F]??0;const $=(z/(b-f)/255-j)/(Ke-j);return Number.isFinite($)?Math.min(1,Math.max(0,$)):0})}const _r=a.createSelector(e=>me.select(e)?.capabilities.gitlabCheckout===!0),Ar=a.createSelector(e=>e.gitlabAuth.host),kr=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),yr=a.createSelector(e=>ce(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Er=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Cr=a.createSelector(e=>e.gitlabAuth.isConfigured),Pr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Rr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Mr=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Tr=a.createSelector(e=>e.gitlabAuth.user),Ir=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const Fr=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],Y=new Set(["pr-reviewer"]),Dr="developer";function Lr(e){return A.find(t=>t.id===e)}const Qe=a.createSelector(e=>e.githubAuth.mutationRequestId),Je=a.createSelector(e=>e.githubAuth.callbacksCancelled),Ye=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),Xe=a.createSelector(e=>e.githubAuth.statusSettled===!0),et=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),tt=a.createSelector(e=>e.githubAuth.user),rt=a.createSelector(e=>e.githubAuth.isAuthenticating),st=a.createSelector(e=>e.githubAuth.deviceFlow),it=a.createSelector(e=>e.githubAuth.error),xr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Je,selectGitHubAuthDeviceFlow:st,selectGitHubAuthError:it,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:rt,selectGitHubAuthIsDisconnecting:Ye,selectGitHubAuthMutationRequestId:Qe,selectGitHubAuthRequiresDaemonAuth:et,selectGitHubAuthStatusSettled:Xe,selectGitHubAuthUser:tt},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function at(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&at(e.modelOptions,r.modelOptions):!1}const Or=a.createSelector(e=>e.specialists.bundledSpecialists),nt=a.createSelector(e=>e.specialists.fileSpecialists),Wr=a.createSelector(e=>k(nt.select(e))),Br=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Gr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Vr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),Nr=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Ur=a.createSelector(e=>e.specialists.specialistsFolderPath),Hr=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(Y.has(t)&&!X.select(e)));function ot(e,t){return t?e:e.filter(r=>!Y.has(r.id))}function ct(e,t){return ot(e,t).filter(r=>!r.hidden)}function qr(e,t){return ct(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=k(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),zr=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),lt=a.createSelector((e,t)=>{const r=y(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&k(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),$r=a.createSelector((e,t)=>lt.select(e,t)?.name??null),jr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),Kr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Zr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Qr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const Jr=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),Yr=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!y(e.specialists.fileSpecialists,t)),Xr=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=y(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return y(e.specialists.fileSpecialists,t)}),es=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),ts=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=y(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),rs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return ve.select(e,o,r);const l=_e.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=y(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:dt.select(e,t)}),dt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:Oe.select(e)?J.select(e):""}),ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?k(r):[]}),is=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??le),as=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),O=N("Clipboard");async function ns(e){let t;if(Pe())try{const r=await Re("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,O.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw O.error("Browser clipboard write failed",r,{electronError:t}),r}throw O.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}function os(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let ut=0;function pt(e,t){const r=++ut;return a.dispatch(ue(e,t,r)),r}function cs(e,t,r){a.dispatch(de(e,t,r))}async function ee(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(pe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??pt(e,t)}))).status==="success"}finally{a.dispatch(ge(i,o))}}async function ls(e,t,r,s,i){return ee(e,t,{kind:"effort",effort:r,previous:s},i)}async function ds(e,t,r,s,i){return ee(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const gt=a.createSelector((e,t)=>k(e.agentModel.mutations).filter(r=>r.consumerId===t)),us=a.createSelector((e,t)=>gt.select(e,t).some(r=>r.status==="pending")),ps=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ae.select(e,t),o=Me.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Te(l),g=c?Ie(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!ke.select(e,r)}});function ht(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const gs=a.createSelector(e=>We.select(e)?null:U.select(e)),ft=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),hs=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),fs=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===ft.select(e)),te=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:ye.select(e)),re=a.createSelector((e,t)=>{if(!t)return J.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return Be.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),se=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=q.select(e,t),s=re.select(e,t),i=S.select(e,t)?.readiness??{};return te.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ss=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return te.select(e,t).filter(i=>ht(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),bs=a.createSelector((e,t)=>t?se.select(e,t):Ve.select(e)),ms=a.createSelector((e,t)=>v.select(e,t)),vs=a.createSelector((e,t)=>t?!!S.select(e,t):Ne.select(e)),_s=a.createSelector((e,t)=>{if(!t)return Fe.select(e);const r=S.select(e,t)?.settings??[],s=re.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),As=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):De.select(e)),ks=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Le.select(e)),ys=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):xe.select(e)),ws=a.createSelector((e,t,r)=>{if(!r)return Ue.select(e,t);const s=q.select(e,r),i=S.select(e,r);return se.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&He(o,i?.readiness[o]?.authenticated))}),Es=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),St={},Cs=a.createSelector(e=>e.providerSettings?.profiles?.status??St),Ps=a.createSelector(e=>e.directoryPicker.source??"daemon"),Rs=a.createSelector(e=>e.directoryPicker.listing),Ms=a.createSelector(e=>e.directoryPicker.loading),Ts=a.createSelector(e=>e.directoryPicker.error),Is=a.createSelector(e=>e.directoryPicker.pathError),Fs=a.createSelector(e=>e.directoryPicker.createError),bt=N("WorkspaceValidation");async function Ds(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mt(s)?_t(s):At(s,t,r)}function mt(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function vt(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function _t(e){return vt(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function At(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(bt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ls(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function xs(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Os(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ws(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Bs(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function yt(e){return e===void 0||!kt.includes(e)}function Gs(e){return e.status==="restarting"?"restarting":yt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function wt(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Vs=a.createSelector(e=>e.voiceSettings.isLoading),Ns=a.createSelector(e=>e.voiceSettings.available),Us=a.createSelector(e=>e.voiceSettings.provider),Hs=a.createSelector(e=>e.voiceSettings.engine),qs=a.createSelector(e=>e.voiceSettings.osEngineAvailable),zs=a.createSelector(e=>e.voiceSettings.keyConfigured),$s=a.createSelector(e=>e.voiceSettings.vocabulary),js=a.createSelector(e=>e.voiceSettings.openaiModel),Ks=a.createSelector(e=>e.voiceSettings.language),Zs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Qs=a.createSelector(e=>e.voiceSettings.inputDeviceId),Js=a.createSelector(e=>e.voiceSettings.inputDevices),Ys=a.createSelector(e=>e.voiceSettings.busyProvider),Xs=a.createSelector(e=>e.voiceSettings.error),ei=a.createSelector(e=>we.select(e)?"unavailable":wt(e.voiceSettings)),G="intent.voice.inputDevice";let V;function Et(){if(V!==void 0)return V;try{const e=localStorage.getItem(G);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ti(e){V=e;try{e===null?localStorage.removeItem(G):localStorage.setItem(G,e)}catch{}}let R=null;function ri(e){R=e}function si(){const e=R;return R=null,e}function Ct(){R=null}const Pt=300,Rt=300;class Mt{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Pt,this.doublePressWindowMs=t.doublePressWindowMs??Rt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let M=null;function ii(e){M=e}function ai(){const e=M;return M=null,e}function Tt(){M=null}const It=66;function Ft(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(Ze(g,l.sampleRate))},It);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Dt=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function ni(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Ot(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Wt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Dt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Ot(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Ft(t,this.onLevels)),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.stopMeter?.(),this.stopMeter=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Mt({onRecordStart:()=>{E&&Nt(E)},onRecordStop:e=>{ie(E,e)}});function oi(){return p!==null}function ci(){return p}function li(e){E=e,_+=1,_===1&&I.keyDown()}function di(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Nt(e,t="key"){if(p!==null)return;Tt(),Ct();const r=new Wt({deviceId:Et(),onLevels:s=>{p===r&&e.dispatch(fe(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(B());return}e.dispatch(he({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(Se({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(B())}})}function ie(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(B());return}m=t,r.stop()}function ui(){ie(null,Vt)}function pi(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ut=N("HardwareConsoleVoiceSetupToast"),Ht="hardware-console-voice-setup";let W=null;function qt(){return W||(W=qe(()=>import("./CCAtqaSn.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url).then(e=>e.notify)),W}function zt(){ze("/settings?tab=connections#voice").catch(e=>{Ut.error("Failed to open voice settings from setup toast",e)})}function $t(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function gi(){qt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Ht,action:$t()})})}const hi=a.createSelector(e=>e.externalEditors.selectedAction),jt=a.createSelector(e=>e.externalEditors.editors),Kt=a.createSelector(e=>{const t=k(jt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),fi=a.createSelector(e=>e.externalEditors.editorOrder??[]),Si=a.createSelector(e=>e.externalEditors.loading),bi=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),mi=a.createSelector((e,t)=>{if(!(t?Ee.select(e,t):Ce.select(e))||be())return[];const s=Zt.select(e);return Kt.select(e).filter(i=>i.installed&&!s.includes(i.id))}),Z={},Qt=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),vi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),_i=a.createSelector(e=>e.mcpSettings.loading),Ai=a.createSelector(e=>e.mcpSettings.error),ki=a.createSelector(e=>e.mcpSettings.mutationError??null),yi=a.createSelector(e=>e.mcpSettings.enabled),Jt=a.createSelector(e=>e.mcpSettings.disabledServers),Yt=a.createSelector(e=>e.mcpSettings.statusMap),Xt=a.createSelector(e=>e.mcpSettings.toolsMap),er=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),tr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),wi=a.createSelector((e,t)=>Object.keys(tr.select(e,t))),Ei=a.createSelector(e=>{const t=Qt.select(e),r=Yt.select(e),s=Xt.select(e),i=Jt.select(e),o=er.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Ci=a.createSelector(e=>e.mcpSettings.lastImportedCount),Pi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Ri=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(rr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ir(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&sr(t,i.idPattern));return s?{...s,id:t}:void 0}function Mi(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function ar(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const nr=new Set(T.flatMap(e=>e.route?[ar(e.route)]:[])),or=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Ti(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return nr.has(r)?s?!!ir(s):!0:or.some(i=>i.test(r))}const Ii=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],cr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Fi=Object.fromEntries(cr.map(e=>[e.path,e.defaultValue]));export{As as $,ni as A,Et as B,pt as C,Dr as D,vt as E,cr as F,Y as G,ds as H,cs as I,wt as J,ir as K,xs as L,ti as M,us as N,gt as O,ps as P,Or as Q,Nr as R,A as S,bs as T,re as U,q as V,Ss as W,se as X,te as Y,ks as Z,ys as _,$e as a,Ei as a$,ws as a0,Es as a1,vs as a2,_s as a3,ms as a4,Gr as a5,Hr as a6,Fs as a7,Ts as a8,Rs as a9,Ar as aA,yr as aB,Pr as aC,wr as aD,Cr as aE,kr as aF,Tr as aG,_r as aH,Fr as aI,Xr as aJ,Zt as aK,Kt as aL,mi as aM,Si as aN,Jr as aO,Yr as aP,bi as aQ,Ri as aR,Pi as aS,Jt as aT,yi as aU,Ai as aV,er as aW,Ci as aX,_i as aY,ki as aZ,Qt as a_,Ms as aa,Is as ab,Ps as ac,fi as ad,Qr as ae,rs as af,jr as ag,ei as ah,Kr as ai,Zr as aj,Wr as ak,Vr as al,H as am,Je as an,st as ao,it as ap,X as aq,rt as ar,Ye as as,Qe as at,et as au,tt as av,Er as aw,Rr as ax,Mr as ay,Ir as az,Fi as b,Yt as b0,Xt as b1,hi as b2,zr as b3,Cs as b4,gs as b5,lt as b6,is as b7,as as b8,ts as b9,ri as bA,ii as bB,gi as bC,Nt as bD,ui as bE,Os as bF,Ls as bG,Ws as bH,Ds as bI,$t as bJ,ns as bK,ss as ba,$r as bb,es as bc,v as bd,Ur as be,Br as bf,Ys as bg,Hs as bh,Qs as bi,Js as bj,zs as bk,Ks as bl,js as bm,qs as bn,Us as bo,Ns as bp,Xs as bq,Vs as br,$s as bs,Zs as bt,S as bu,ft as bv,fs as bw,hs as bx,wi as by,vi as bz,Ii as c,ls as d,pi as e,Ct as f,Tt as g,si as h,ai as i,qr as j,ct as k,ot as l,ci as m,Mi as n,Bs as o,Gs as p,Lr as q,xr as r,li as s,di as t,yt as u,ht as v,oi as w,os as x,K as y,Ti as z};
@@ -1 +1 @@
1
- import{D as O,a as V,d as z}from"./CQcEqK4G.js";import{K as G,T as F,_ as J,d as X,f as Q,X as Y,Q as Z,a0 as q,n as P,e as tt,c as et,m as U,h as N,l as E}from"./CHIxjTWu.js";import{o as u,b as _,s as r,n as h,l as M,_ as x,c as B,u as nt}from"./CIyUrgF0.js";import{I as it}from"./Bqd7fdCF.js";const at="/app/immutable/assets/PatrickHand-Regular.CyLOmwMC.ttf";let D=null,R=null;const W=O.badgeFontFamily;function K(){return R??W}function L(){return D||(D=(async()=>{let t;try{const i=typeof document<"u"?document.fonts:globalThis.fonts;if(!i||typeof FontFace>"u")throw new Error("font-api-unavailable");const a=await Promise.race([new FontFace("Intent Annotation Hand",`url("${at}")`,{style:"normal",weight:"400",display:"block"}).load(),new Promise((l,o)=>{t=setTimeout(()=>o(new Error("font-load-timeout")),2e3)})]);i.add(a),R=O.fontFamily}catch{R=W}finally{clearTimeout(t)}})(),D)}let k=null;function ot(t){const i=G(t);if(t.kind!=="text"||t.style==="sticky"||(k||(k=typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1).getContext("2d"):typeof document<"u"?document.createElement("canvas").getContext("2d"):null),!k))return i;k.font=`${t.fontSize}px ${K()}`,k.textAlign="left",k.textBaseline="top",k.letterSpacing="0px",k.wordSpacing="0px";let a=1/0,l=1/0,o=-1/0,e=-1/0;const{lines:f,lineHeight:c}=F(t);for(const[s,p]of f.entries()){if(!p.trim())continue;const g=k.measureText(p),b=s*c,m=[-g.actualBoundingBoxLeft,b-g.actualBoundingBoxAscent,g.actualBoundingBoxRight,b+g.actualBoundingBoxDescent];if(!m.every(Number.isFinite))return i;a=Math.min(a,m[0]),l=Math.min(l,m[1]),o=Math.max(o,m[2]),e=Math.max(e,m[3])}if(!(o>a&&e>l))return i;const n=Math.max(1,t.fontSize/24);return{x:t.x+a-n,y:t.y+l-n,w:o-a+2*n,h:e-l+2*n}}const C=16e3;function rt(t,i){const l=t.length*2,o=new ArrayBuffer(44+l),e=new DataView(o),f=(n,s)=>{for(let p=0;p<s.length;p+=1)e.setUint8(n+p,s.charCodeAt(p))};f(0,"RIFF"),e.setUint32(4,36+l,!0),f(8,"WAVE"),f(12,"fmt "),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,i,!0),e.setUint32(28,i*2,!0),e.setUint16(32,2,!0),e.setUint16(34,16,!0),f(36,"data"),e.setUint32(40,l,!0);let c=44;for(let n=0;n<t.length;n+=1){const s=Math.max(-1,Math.min(1,t[n]));e.setInt16(c,s<0?s*32768:s*32767,!0),c+=2}return o}function st(t){const i=new Float32Array(t.length);for(let a=0;a<t.numberOfChannels;a+=1){const l=t.getChannelData(a);for(let o=0;o<l.length;o+=1)i[o]+=l[o]/t.numberOfChannels}return i}async function gt(t){const i=new AudioContext;try{const a=await i.decodeAudioData(await t.arrayBuffer()),l=Math.max(1,Math.ceil(a.length*C/a.sampleRate)),o=new OfflineAudioContext(1,l,C),e=o.createBufferSource();e.buffer=a,e.connect(o.destination),e.start();const f=await o.startRendering();return rt(st(f),C)}finally{await i.close().catch(()=>{})}}function $(t){const i=new Uint8Array(t),a=32768;let l="";for(let o=0;o<i.length;o+=a)l+=String.fromCharCode(...i.subarray(o,o+a));return btoa(l)}const d={...O,get fontFamily(){return K()},blurRadius:X};function H(t,i,a=0,l){const o=t.crop??{x:0,y:0,w:i.width,h:i.height},e=Math.max(1,Math.max(i.width,i.height)/1440),f=Math.min(d.badgeRadius*e,o.w/2,o.h/2);return Y(t,i).filter(c=>i.kind==="screenshot"||a>=c.mark.atMs&&a<c.visibleUntilMs).flatMap(({n:c,mark:n})=>{const s=i.kind==="recording"?Z(n.geometry,q(i,n),a):n.geometry;if(!s)return[];const p=ot(s),g=z(p,o,e,f);return[...n.id===l&&s.kind==="text"?[]:[{kind:"geometry",geometry:s,unit:e}],...d.showNumbers?[{kind:"badge",...g,radius:f,label:String(c),unit:e}]:[]]})}function j(t,i){t.save(),t.letterSpacing="0px",t.wordSpacing="0px",t.strokeStyle=d.accent,t.fillStyle=d.accent,t.lineCap="round",t.lineJoin="round";for(const a of i){const l=a.unit??1,o=(c,n)=>{t.strokeStyle=d.halo,t.lineWidth=c+d.haloWidth*l,n?t.stroke(n):t.stroke(),t.strokeStyle=d.accent,t.lineWidth=c,n?t.stroke(n):t.stroke()};if(a.kind==="badge"){t.fillStyle=d.paper,t.beginPath(),t.arc(a.x,a.y,a.radius,0,Math.PI*2),t.fill(),t.strokeStyle=d.accent,t.lineWidth=d.badgeOutline*l,t.stroke(),t.fillStyle=d.ink,t.font=`600 ${a.radius*d.badgeTextScale}px ${d.badgeFontFamily}`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.label,a.x,a.y);continue}const e=a.geometry;t.fillStyle=d.accent;const f=(e.kind==="path"?d.pen:d.stroke)*l;if(e.kind==="rect")t.beginPath(),t.rect(e.x,e.y,e.w,e.h),o(f);else if(e.kind==="text"){const c=F(e);t.fillStyle=d.accent,t.textAlign="left",t.textBaseline="top",t.font=`${e.fontSize}px ${d.fontFamily}`,c.lines.forEach((n,s)=>{const p=e.x+c.padding,g=e.y+c.padding+s*c.lineHeight;t.strokeStyle=d.halo,t.lineWidth=d.haloWidth*l;const b=e.style==="sticky"?c.width-2*c.padding:void 0;t.strokeText(n,p,g,b),t.fillText(n,p,g,b)})}else if(e.kind==="point")t.beginPath(),t.arc(e.x,e.y,Q,0,Math.PI*2),o(f);else if(e.kind==="path")o(f,new Path2D(V(e.points)));else{const c=[e.from,e.to];if(t.beginPath(),c.forEach((n,s)=>s?t.lineTo(n.x,n.y):t.moveTo(n.x,n.y)),e.kind==="arrow"){const n=Math.atan2(e.to.y-e.from.y,e.to.x-e.from.x),s=d.arrowHead*l;t.moveTo(e.to.x-s*Math.cos(n-d.arrowSpread),e.to.y-s*Math.sin(n-d.arrowSpread)),t.lineTo(e.to.x,e.to.y),t.lineTo(e.to.x-s*Math.cos(n+d.arrowSpread),e.to.y-s*Math.sin(n+d.arrowSpread))}o(f)}}t.restore()}function v(t,i){const a=new OffscreenCanvas(Math.max(1,Math.round(t)),Math.max(1,Math.round(i))),l=a.getContext("2d");if(!l)throw new Error("capture-render-unavailable");return{image:a,context:l}}async function pt(t,i,a){if(t.visuals!=="clean")throw new Error("legacy-baked-marks");await L();const{image:l,context:o}=v(t.width,t.height);return j(o,H(i,t,a)),$(await(await l.convertToBlob({type:"image/png"})).arrayBuffer())}async function yt(t,i,a,l){const o=J(i,t,null);if(t.kind!=="screenshot"||o.errors.length)throw new Error(o.errors[0]??"not-a-screenshot");if(t.visuals!=="clean")throw new Error("legacy-baked-marks");await L();const e=Uint8Array.from(atob(a.base64),c=>c.charCodeAt(0)),f=await createImageBitmap(new Blob([e],{type:a.mimeType}));try{if(f.width!==t.width||f.height!==t.height)throw new Error("stale-source-pixels");const c=v(t.width,t.height);if(c.context.drawImage(f,0,0),i.blurRegions.length||i.blurStrokes?.length){const g=v(t.width,t.height);g.context.fillStyle="#000000",g.context.fillRect(0,0,t.width,t.height);const b=`blur(${d.blurRadius}px)`;if(g.context.filter=b,g.context.filter!==b)throw new Error("capture-blur-unavailable");g.context.drawImage(f,0,0);const m=v(t.width,t.height);m.context.fillStyle="#ffffff",m.context.strokeStyle="#ffffff",m.context.lineCap="round",m.context.lineJoin="round";for(const y of i.blurRegions)m.context.fillRect(y.x,y.y,y.w,y.h);for(const y of i.blurStrokes??[]){const S=y.points.filter((I,A)=>A===0||I.x!==y.points[A-1].x||I.y!==y.points[A-1].y);if(m.context.beginPath(),S.length===1){const I=S[0];m.context.arc(I.x,I.y,y.radius,0,Math.PI*2),m.context.fill()}else{m.context.lineWidth=y.radius*2,m.context.moveTo(S[0].x,S[0].y);for(const I of S.slice(1))m.context.lineTo(I.x,I.y);m.context.stroke()}}const T=v(t.width,t.height);T.context.drawImage(g.image,0,0),T.context.globalCompositeOperation="destination-in",T.context.drawImage(m.image,0,0),c.context.drawImage(T.image,0,0)}const n=i.crop??{x:0,y:0,w:t.width,h:t.height},s=v(n.w,n.h);s.context.drawImage(c.image,n.x,n.y,n.w,n.h,0,0,s.image.width,s.image.height),s.context.scale(s.image.width/n.w,s.image.height/n.h),s.context.translate(-n.x,-n.y),j(s.context,H(i,t,0,l?.hiddenTextMarkId));const p=await s.image.convertToBlob({type:"image/png"});return{data:$(await p.arrayBuffer()),mimeType:"image/png",width:s.image.width,height:s.image.height}}finally{f.close()}}const kt=u({outputVersion:M(tt),jobId:r().uuid(),media:P,layers:_(u({atMs:h().finite().nonnegative(),endMs:h().finite().nonnegative(),png:r().min(1).max(48*1024*1024)}).strict()).max(1e4)}).strict(),wt=u({jobId:r().uuid(),media:P,locale:r().min(1).max(80).optional()}).strict(),lt=u({sourceId:r().min(1),sourceRevision:h().int().nonnegative(),durationMs:h().finite().positive().max(120001),intervalMs:M(50),peaks:_(h().finite().min(0).max(1)).max(2401)}).strict().refine(t=>t.peaks.length===Math.ceil(t.durationMs/t.intervalMs),"Incomplete waveform");u({jobId:r().uuid(),media:P}).strict();u({sourceId:r().min(1),sourceRevision:h().int().nonnegative(),trackCount:h().int().nonnegative().max(128),populatedTrackCount:h().int().nonnegative().max(128)}).strict().refine(t=>t.populatedTrackCount<=t.trackCount);const xt=it.DOCK_CAPTURE_EDITOR,w=r().min(1).max(200),ct=u({id:w,tool:x(et),atMs:h().finite().min(0).max(1440*60*1e3).nullable(),label:r().max(200).optional()}).strict();u({kind:x(["recording","screenshot"]),workspaceId:w,agentId:w,attachmentId:w,sourceRevision:r().min(1).max(512),attachmentPath:r().min(1).max(1024),title:r().max(200),durationMs:h().finite().min(0).max(1440*60*1e3).optional(),width:h().int().positive().max(32768).optional(),height:h().int().positive().max(32768).optional(),marks:_(ct).max(500),provenance:u({captureApi:r().max(100).optional(),hasMicAudio:B().optional(),visuals:x(["clean","baked-marks"])}).strict(),source:E.optional(),originalSource:E.optional(),saved:N.nullable().optional(),transcript:U.nullable().optional(),holdToken:r().uuid().optional()}).strict().refine(t=>!t.source||t.source.path===t.attachmentPath&&t.source.attachmentId===t.attachmentId&&t.source.kind===t.kind,"Source does not match the attachment").refine(t=>!t.saved||!!t.source&&t.saved.sourceId===t.source.id&&t.saved.sourceRevision===t.source.revision,"Edit does not match the source").refine(t=>!t.originalSource||t.source?.kind==="screenshot"&&t.originalSource.kind==="screenshot"&&t.originalSource.id!==t.source.id,"Original source does not precede this source");u({openId:r().uuid(),intent:M("attach").optional()}).strict();u({openId:r().uuid(),accept:B()}).strict();u({token:r().uuid(),hide:M(!0).optional()}).strict();u({openId:r().uuid(),requestId:r().uuid()}).strict();u({requestId:r().uuid(),result:x(["saved","stale-source","revision-conflict","failed"]),saved:N.optional()}).strict().refine(t=>t.result==="saved"==!!t.saved,"Saved edit missing");u({pair:u({workspaceId:r().min(1).max(200),agentId:r().min(1).max(200)}).strict(),sourceId:r().min(1).max(512),sourceRevision:h().int().nonnegative(),transcript:U}).strict();nt([u({requestId:r().uuid(),ok:M(!0),source:E}).strict(),u({requestId:r().uuid(),ok:M(!1),error:x(["cancelled","permission","failed"])}).strict()]);const dt=2e4;u({openId:r().uuid(),markId:r().min(1).max(512),generation:h().int().nonnegative(),phase:x(["start","stop"])}).strict();u({requestId:r().uuid(),generation:h().int().nonnegative(),text:r().max(dt),final:B(),error:x(["busy","unavailable","failed","permission"]).optional()}).strict().refine(t=>!t.error||t.final,"An error is final");u({pair:u({workspaceId:r().min(1).max(200),agentId:r().min(1).max(200)}).strict(),sourceId:r().min(1).max(512),sourceRevision:h().int().nonnegative(),waveform:lt}).strict();const bt=u({requestId:r().uuid(),openId:w,pair:u({workspaceId:w,agentId:w}).strict(),kind:x(["screenshot","recording"]),attachmentId:w,sourceId:w.optional(),sourceRevision:h().int().nonnegative().optional(),expectedEditRevision:h().int().nonnegative().optional()}).strict();u({requestId:r().uuid(),result:x(["deleted","stale-source","failed"])}).strict();const It=u({endedOpenId:r().uuid()}).strict();export{xt as D,d as a,dt as b,bt as c,It as d,kt as e,wt as f,$ as g,gt as h,ot as i,K as j,L as k,H as l,pt as m,j as p,yt as r};
1
+ import{D as O,a as V,d as z}from"./CQcEqK4G.js";import{K as G,T as F,_ as J,d as X,f as Q,X as Y,Q as Z,a0 as q,n as P,e as tt,c as et,m as U,h as N,l as E}from"./BS1zON0P.js";import{o as u,b as _,s as r,n as h,l as M,_ as x,c as B,u as nt}from"./CIyUrgF0.js";import{I as it}from"./Bqd7fdCF.js";const at="/app/immutable/assets/PatrickHand-Regular.CyLOmwMC.ttf";let D=null,R=null;const W=O.badgeFontFamily;function K(){return R??W}function L(){return D||(D=(async()=>{let t;try{const i=typeof document<"u"?document.fonts:globalThis.fonts;if(!i||typeof FontFace>"u")throw new Error("font-api-unavailable");const a=await Promise.race([new FontFace("Intent Annotation Hand",`url("${at}")`,{style:"normal",weight:"400",display:"block"}).load(),new Promise((l,o)=>{t=setTimeout(()=>o(new Error("font-load-timeout")),2e3)})]);i.add(a),R=O.fontFamily}catch{R=W}finally{clearTimeout(t)}})(),D)}let k=null;function ot(t){const i=G(t);if(t.kind!=="text"||t.style==="sticky"||(k||(k=typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1).getContext("2d"):typeof document<"u"?document.createElement("canvas").getContext("2d"):null),!k))return i;k.font=`${t.fontSize}px ${K()}`,k.textAlign="left",k.textBaseline="top",k.letterSpacing="0px",k.wordSpacing="0px";let a=1/0,l=1/0,o=-1/0,e=-1/0;const{lines:f,lineHeight:c}=F(t);for(const[s,p]of f.entries()){if(!p.trim())continue;const g=k.measureText(p),b=s*c,m=[-g.actualBoundingBoxLeft,b-g.actualBoundingBoxAscent,g.actualBoundingBoxRight,b+g.actualBoundingBoxDescent];if(!m.every(Number.isFinite))return i;a=Math.min(a,m[0]),l=Math.min(l,m[1]),o=Math.max(o,m[2]),e=Math.max(e,m[3])}if(!(o>a&&e>l))return i;const n=Math.max(1,t.fontSize/24);return{x:t.x+a-n,y:t.y+l-n,w:o-a+2*n,h:e-l+2*n}}const C=16e3;function rt(t,i){const l=t.length*2,o=new ArrayBuffer(44+l),e=new DataView(o),f=(n,s)=>{for(let p=0;p<s.length;p+=1)e.setUint8(n+p,s.charCodeAt(p))};f(0,"RIFF"),e.setUint32(4,36+l,!0),f(8,"WAVE"),f(12,"fmt "),e.setUint32(16,16,!0),e.setUint16(20,1,!0),e.setUint16(22,1,!0),e.setUint32(24,i,!0),e.setUint32(28,i*2,!0),e.setUint16(32,2,!0),e.setUint16(34,16,!0),f(36,"data"),e.setUint32(40,l,!0);let c=44;for(let n=0;n<t.length;n+=1){const s=Math.max(-1,Math.min(1,t[n]));e.setInt16(c,s<0?s*32768:s*32767,!0),c+=2}return o}function st(t){const i=new Float32Array(t.length);for(let a=0;a<t.numberOfChannels;a+=1){const l=t.getChannelData(a);for(let o=0;o<l.length;o+=1)i[o]+=l[o]/t.numberOfChannels}return i}async function gt(t){const i=new AudioContext;try{const a=await i.decodeAudioData(await t.arrayBuffer()),l=Math.max(1,Math.ceil(a.length*C/a.sampleRate)),o=new OfflineAudioContext(1,l,C),e=o.createBufferSource();e.buffer=a,e.connect(o.destination),e.start();const f=await o.startRendering();return rt(st(f),C)}finally{await i.close().catch(()=>{})}}function $(t){const i=new Uint8Array(t),a=32768;let l="";for(let o=0;o<i.length;o+=a)l+=String.fromCharCode(...i.subarray(o,o+a));return btoa(l)}const d={...O,get fontFamily(){return K()},blurRadius:X};function H(t,i,a=0,l){const o=t.crop??{x:0,y:0,w:i.width,h:i.height},e=Math.max(1,Math.max(i.width,i.height)/1440),f=Math.min(d.badgeRadius*e,o.w/2,o.h/2);return Y(t,i).filter(c=>i.kind==="screenshot"||a>=c.mark.atMs&&a<c.visibleUntilMs).flatMap(({n:c,mark:n})=>{const s=i.kind==="recording"?Z(n.geometry,q(i,n),a):n.geometry;if(!s)return[];const p=ot(s),g=z(p,o,e,f);return[...n.id===l&&s.kind==="text"?[]:[{kind:"geometry",geometry:s,unit:e}],...d.showNumbers?[{kind:"badge",...g,radius:f,label:String(c),unit:e}]:[]]})}function j(t,i){t.save(),t.letterSpacing="0px",t.wordSpacing="0px",t.strokeStyle=d.accent,t.fillStyle=d.accent,t.lineCap="round",t.lineJoin="round";for(const a of i){const l=a.unit??1,o=(c,n)=>{t.strokeStyle=d.halo,t.lineWidth=c+d.haloWidth*l,n?t.stroke(n):t.stroke(),t.strokeStyle=d.accent,t.lineWidth=c,n?t.stroke(n):t.stroke()};if(a.kind==="badge"){t.fillStyle=d.paper,t.beginPath(),t.arc(a.x,a.y,a.radius,0,Math.PI*2),t.fill(),t.strokeStyle=d.accent,t.lineWidth=d.badgeOutline*l,t.stroke(),t.fillStyle=d.ink,t.font=`600 ${a.radius*d.badgeTextScale}px ${d.badgeFontFamily}`,t.textAlign="center",t.textBaseline="middle",t.fillText(a.label,a.x,a.y);continue}const e=a.geometry;t.fillStyle=d.accent;const f=(e.kind==="path"?d.pen:d.stroke)*l;if(e.kind==="rect")t.beginPath(),t.rect(e.x,e.y,e.w,e.h),o(f);else if(e.kind==="text"){const c=F(e);t.fillStyle=d.accent,t.textAlign="left",t.textBaseline="top",t.font=`${e.fontSize}px ${d.fontFamily}`,c.lines.forEach((n,s)=>{const p=e.x+c.padding,g=e.y+c.padding+s*c.lineHeight;t.strokeStyle=d.halo,t.lineWidth=d.haloWidth*l;const b=e.style==="sticky"?c.width-2*c.padding:void 0;t.strokeText(n,p,g,b),t.fillText(n,p,g,b)})}else if(e.kind==="point")t.beginPath(),t.arc(e.x,e.y,Q,0,Math.PI*2),o(f);else if(e.kind==="path")o(f,new Path2D(V(e.points)));else{const c=[e.from,e.to];if(t.beginPath(),c.forEach((n,s)=>s?t.lineTo(n.x,n.y):t.moveTo(n.x,n.y)),e.kind==="arrow"){const n=Math.atan2(e.to.y-e.from.y,e.to.x-e.from.x),s=d.arrowHead*l;t.moveTo(e.to.x-s*Math.cos(n-d.arrowSpread),e.to.y-s*Math.sin(n-d.arrowSpread)),t.lineTo(e.to.x,e.to.y),t.lineTo(e.to.x-s*Math.cos(n+d.arrowSpread),e.to.y-s*Math.sin(n+d.arrowSpread))}o(f)}}t.restore()}function v(t,i){const a=new OffscreenCanvas(Math.max(1,Math.round(t)),Math.max(1,Math.round(i))),l=a.getContext("2d");if(!l)throw new Error("capture-render-unavailable");return{image:a,context:l}}async function pt(t,i,a){if(t.visuals!=="clean")throw new Error("legacy-baked-marks");await L();const{image:l,context:o}=v(t.width,t.height);return j(o,H(i,t,a)),$(await(await l.convertToBlob({type:"image/png"})).arrayBuffer())}async function yt(t,i,a,l){const o=J(i,t,null);if(t.kind!=="screenshot"||o.errors.length)throw new Error(o.errors[0]??"not-a-screenshot");if(t.visuals!=="clean")throw new Error("legacy-baked-marks");await L();const e=Uint8Array.from(atob(a.base64),c=>c.charCodeAt(0)),f=await createImageBitmap(new Blob([e],{type:a.mimeType}));try{if(f.width!==t.width||f.height!==t.height)throw new Error("stale-source-pixels");const c=v(t.width,t.height);if(c.context.drawImage(f,0,0),i.blurRegions.length||i.blurStrokes?.length){const g=v(t.width,t.height);g.context.fillStyle="#000000",g.context.fillRect(0,0,t.width,t.height);const b=`blur(${d.blurRadius}px)`;if(g.context.filter=b,g.context.filter!==b)throw new Error("capture-blur-unavailable");g.context.drawImage(f,0,0);const m=v(t.width,t.height);m.context.fillStyle="#ffffff",m.context.strokeStyle="#ffffff",m.context.lineCap="round",m.context.lineJoin="round";for(const y of i.blurRegions)m.context.fillRect(y.x,y.y,y.w,y.h);for(const y of i.blurStrokes??[]){const S=y.points.filter((I,A)=>A===0||I.x!==y.points[A-1].x||I.y!==y.points[A-1].y);if(m.context.beginPath(),S.length===1){const I=S[0];m.context.arc(I.x,I.y,y.radius,0,Math.PI*2),m.context.fill()}else{m.context.lineWidth=y.radius*2,m.context.moveTo(S[0].x,S[0].y);for(const I of S.slice(1))m.context.lineTo(I.x,I.y);m.context.stroke()}}const T=v(t.width,t.height);T.context.drawImage(g.image,0,0),T.context.globalCompositeOperation="destination-in",T.context.drawImage(m.image,0,0),c.context.drawImage(T.image,0,0)}const n=i.crop??{x:0,y:0,w:t.width,h:t.height},s=v(n.w,n.h);s.context.drawImage(c.image,n.x,n.y,n.w,n.h,0,0,s.image.width,s.image.height),s.context.scale(s.image.width/n.w,s.image.height/n.h),s.context.translate(-n.x,-n.y),j(s.context,H(i,t,0,l?.hiddenTextMarkId));const p=await s.image.convertToBlob({type:"image/png"});return{data:$(await p.arrayBuffer()),mimeType:"image/png",width:s.image.width,height:s.image.height}}finally{f.close()}}const kt=u({outputVersion:M(tt),jobId:r().uuid(),media:P,layers:_(u({atMs:h().finite().nonnegative(),endMs:h().finite().nonnegative(),png:r().min(1).max(48*1024*1024)}).strict()).max(1e4)}).strict(),wt=u({jobId:r().uuid(),media:P,locale:r().min(1).max(80).optional()}).strict(),lt=u({sourceId:r().min(1),sourceRevision:h().int().nonnegative(),durationMs:h().finite().positive().max(120001),intervalMs:M(50),peaks:_(h().finite().min(0).max(1)).max(2401)}).strict().refine(t=>t.peaks.length===Math.ceil(t.durationMs/t.intervalMs),"Incomplete waveform");u({jobId:r().uuid(),media:P}).strict();u({sourceId:r().min(1),sourceRevision:h().int().nonnegative(),trackCount:h().int().nonnegative().max(128),populatedTrackCount:h().int().nonnegative().max(128)}).strict().refine(t=>t.populatedTrackCount<=t.trackCount);const xt=it.DOCK_CAPTURE_EDITOR,w=r().min(1).max(200),ct=u({id:w,tool:x(et),atMs:h().finite().min(0).max(1440*60*1e3).nullable(),label:r().max(200).optional()}).strict();u({kind:x(["recording","screenshot"]),workspaceId:w,agentId:w,attachmentId:w,sourceRevision:r().min(1).max(512),attachmentPath:r().min(1).max(1024),title:r().max(200),durationMs:h().finite().min(0).max(1440*60*1e3).optional(),width:h().int().positive().max(32768).optional(),height:h().int().positive().max(32768).optional(),marks:_(ct).max(500),provenance:u({captureApi:r().max(100).optional(),hasMicAudio:B().optional(),visuals:x(["clean","baked-marks"])}).strict(),source:E.optional(),originalSource:E.optional(),saved:N.nullable().optional(),transcript:U.nullable().optional(),holdToken:r().uuid().optional()}).strict().refine(t=>!t.source||t.source.path===t.attachmentPath&&t.source.attachmentId===t.attachmentId&&t.source.kind===t.kind,"Source does not match the attachment").refine(t=>!t.saved||!!t.source&&t.saved.sourceId===t.source.id&&t.saved.sourceRevision===t.source.revision,"Edit does not match the source").refine(t=>!t.originalSource||t.source?.kind==="screenshot"&&t.originalSource.kind==="screenshot"&&t.originalSource.id!==t.source.id,"Original source does not precede this source");u({openId:r().uuid(),intent:M("attach").optional()}).strict();u({openId:r().uuid(),accept:B()}).strict();u({token:r().uuid(),hide:M(!0).optional()}).strict();u({openId:r().uuid(),requestId:r().uuid()}).strict();u({requestId:r().uuid(),result:x(["saved","stale-source","revision-conflict","failed"]),saved:N.optional()}).strict().refine(t=>t.result==="saved"==!!t.saved,"Saved edit missing");u({pair:u({workspaceId:r().min(1).max(200),agentId:r().min(1).max(200)}).strict(),sourceId:r().min(1).max(512),sourceRevision:h().int().nonnegative(),transcript:U}).strict();nt([u({requestId:r().uuid(),ok:M(!0),source:E}).strict(),u({requestId:r().uuid(),ok:M(!1),error:x(["cancelled","permission","failed"])}).strict()]);const dt=2e4;u({openId:r().uuid(),markId:r().min(1).max(512),generation:h().int().nonnegative(),phase:x(["start","stop"])}).strict();u({requestId:r().uuid(),generation:h().int().nonnegative(),text:r().max(dt),final:B(),error:x(["busy","unavailable","failed","permission"]).optional()}).strict().refine(t=>!t.error||t.final,"An error is final");u({pair:u({workspaceId:r().min(1).max(200),agentId:r().min(1).max(200)}).strict(),sourceId:r().min(1).max(512),sourceRevision:h().int().nonnegative(),waveform:lt}).strict();const bt=u({requestId:r().uuid(),openId:w,pair:u({workspaceId:w,agentId:w}).strict(),kind:x(["screenshot","recording"]),attachmentId:w,sourceId:w.optional(),sourceRevision:h().int().nonnegative().optional(),expectedEditRevision:h().int().nonnegative().optional()}).strict();u({requestId:r().uuid(),result:x(["deleted","stale-source","failed"])}).strict();const It=u({endedOpenId:r().uuid()}).strict();export{xt as D,d as a,dt as b,bt as c,It as d,kt as e,wt as f,$ as g,gt as h,ot as i,K as j,L as k,H as l,pt as m,j as p,yt as r};
@@ -1 +1 @@
1
- import{t as g,bo as h,bm as v,bw as w,b as C}from"./CtfEuoOH.js";import{bs as T,a5 as u,bl as l,bS as _,bA as m,b_ as A,bO as p,W as O,bn as S,aA as j,aB as B}from"./3SdAC2_C.js";var I=B('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><div class="text-center"><p class="text-lg font-medium text-foreground"> </p> <p class="text-sm"> </p> <p class="text-xs mt-4 text-subtle"> </p></div></div>');function L(n,a){if(new.target)return g({component:L,...n});T(a,!0);let e=h(a,"tab",7);var c={get tab(){return e()},set tab(t){e(t),j()},$set:w,$on:(t,r)=>C(a,t,r)},s=I(),o=u(s),b=u(o),d=l(b,!0),i=_(b,2),x=l(i,!0),f=_(i,2),y=l(f,!0);return m(o),m(s),A((t,r)=>{p(d,e().title),p(x,t),p(y,r)},[()=>v.layout_panelContent_typeLabel({type:e().type}),()=>v.layout_overviewTab_notImplemented_label()]),O(n,s),S(c)}export{L as default};
1
+ import{t as g,bo as h,bm as v,bw as w,b as C}from"./Fcr7AvC-.js";import{bs as T,a5 as u,bl as l,bS as _,bA as m,b_ as A,bO as p,W as O,bn as S,aA as j,aB as B}from"./3SdAC2_C.js";var I=B('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><div class="text-center"><p class="text-lg font-medium text-foreground"> </p> <p class="text-sm"> </p> <p class="text-xs mt-4 text-subtle"> </p></div></div>');function L(n,a){if(new.target)return g({component:L,...n});T(a,!0);let e=h(a,"tab",7);var c={get tab(){return e()},set tab(t){e(t),j()},$set:w,$on:(t,r)=>C(a,t,r)},s=I(),o=u(s),b=u(o),d=l(b,!0),i=_(b,2),x=l(i,!0),f=_(i,2),y=l(f,!0);return m(o),m(s),A((t,r)=>{p(d,e().title),p(x,t),p(y,r)},[()=>v.layout_panelContent_typeLabel({type:e().type}),()=>v.layout_overviewTab_notImplemented_label()]),O(n,s),S(c)}export{L as default};
@@ -1 +1 @@
1
- import{f as p}from"./CVtLV3_x.js";import{A as s,z as l}from"./BZCcX8wj.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./DJcR4XQR.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
1
+ import{f as p}from"./B0SSzYpD.js";import{A as s,z as l}from"./BnbmXiW4.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./8ljmIEEj.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
@@ -1 +1 @@
1
- import{a as l}from"./B5aYN90J.js";import{H as i,s as c,b0 as s}from"./CiKoEJ2m.js";async function b(e){if(!e)throw new Error("Missing required parameter: url");let o;try{o=new URL(e)}catch{throw new Error(`Invalid external URL: ${e}`)}if(!l.EXTERNAL.includes(o.protocol)&&!l.EXTERNAL_EXACT.includes(e))throw new Error(`Refusing to open URL externally (scheme not allowed): ${o.protocol}`);if(typeof window>"u")throw new Error("Unable to open external URL outside a window context");const r=window.electronAPI;if(r&&typeof r.invoke=="function")try{const a=await r.invoke("shell:openExternal",{url:e});if(a&&a.success===!0)return}catch{}const t=window.open(e,"_blank");if(t){t.opener=null;return}const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",document.body.appendChild(n),n.click(),n.remove()}const p={blue:"bg-blue-600 dark:bg-blue-400",indigo:"bg-indigo-600 dark:bg-indigo-400",violet:"bg-violet-600 dark:bg-violet-400",rose:"bg-rose-600 dark:bg-rose-400",orange:"bg-orange-600 dark:bg-orange-400",emerald:"bg-emerald-600 dark:bg-emerald-400",teal:"bg-teal-600 dark:bg-teal-400"},d={blue:"var(--color-blue-500)",indigo:"var(--color-indigo-500)",violet:"var(--color-violet-500)",rose:"var(--color-rose-500)",orange:"var(--color-orange-500)",emerald:"var(--color-emerald-500)",teal:"var(--color-teal-500)"};function g(e){return e===void 0?i:e}function f(e){return[null,...c.filter(o=>s.includes(o)||o===e)]}function C(e,o){const r=g(e);return o||r===null?"transparent":`color-mix(in srgb, ${d[r]} 7%, transparent)`}function N(e,o){const r=C(e,o);return r==="transparent"?void 0:`linear-gradient(${r} 0 0)`}export{p as C,d as a,N as b,f as c,C as d,b as o,g as r};
1
+ import{a as l}from"./B5aYN90J.js";import{H as i,s as c,b0 as s}from"./D0qhIm1r.js";async function b(e){if(!e)throw new Error("Missing required parameter: url");let o;try{o=new URL(e)}catch{throw new Error(`Invalid external URL: ${e}`)}if(!l.EXTERNAL.includes(o.protocol)&&!l.EXTERNAL_EXACT.includes(e))throw new Error(`Refusing to open URL externally (scheme not allowed): ${o.protocol}`);if(typeof window>"u")throw new Error("Unable to open external URL outside a window context");const r=window.electronAPI;if(r&&typeof r.invoke=="function")try{const a=await r.invoke("shell:openExternal",{url:e});if(a&&a.success===!0)return}catch{}const t=window.open(e,"_blank");if(t){t.opener=null;return}const n=document.createElement("a");n.href=e,n.target="_blank",n.rel="noopener noreferrer",document.body.appendChild(n),n.click(),n.remove()}const p={blue:"bg-blue-600 dark:bg-blue-400",indigo:"bg-indigo-600 dark:bg-indigo-400",violet:"bg-violet-600 dark:bg-violet-400",rose:"bg-rose-600 dark:bg-rose-400",orange:"bg-orange-600 dark:bg-orange-400",emerald:"bg-emerald-600 dark:bg-emerald-400",teal:"bg-teal-600 dark:bg-teal-400"},d={blue:"var(--color-blue-500)",indigo:"var(--color-indigo-500)",violet:"var(--color-violet-500)",rose:"var(--color-rose-500)",orange:"var(--color-orange-500)",emerald:"var(--color-emerald-500)",teal:"var(--color-teal-500)"};function g(e){return e===void 0?i:e}function f(e){return[null,...c.filter(o=>s.includes(o)||o===e)]}function C(e,o){const r=g(e);return o||r===null?"transparent":`color-mix(in srgb, ${d[r]} 7%, transparent)`}function N(e,o){const r=C(e,o);return r==="transparent"?void 0:`linear-gradient(${r} 0 0)`}export{p as C,d as a,N as b,f as c,C as d,b as o,g as r};
@@ -1 +1 @@
1
- import{t as O,bo as s,bw as S,b as V}from"./CtfEuoOH.js";import{bs as W,cb as q,bH as x,a7 as E,ay as F,aD as l,W as h,bn as G,bV as J,c9 as y,aA as i,b_ as z,aw as K,bz as L,bl as M,bO as Q,aB as T}from"./3SdAC2_C.js";import{i as X}from"./DynUeYUu.js";import{c as U,e as k,s as m,f as C,g as N}from"./B26ZHg3s.js";import{n as A}from"./DMEIbJII.js";var Y=T('<img alt="" aria-hidden="true" loading="lazy"/>'),Z=T('<span aria-hidden="true"> </span>');function $(r,a){if(new.target)return O({component:$,...r});W(a,!0);let n=s(a,"avatarUrl",7,null),v=s(a,"label",7),g=s(a,"size",7,24),u=s(a,"class",7,""),p=s(a,"referrerpolicy",7),o=s(a,"testid",7),f=s(a,"fill",7,!1),b=J(!1);const B=y(()=>!!n()&&!l(b)),D=y(()=>v().trim().slice(0,1).toUpperCase()||"?"),d=y(()=>f()?void 0:`${g()}px`);q(()=>{n(),x(b,!1)});var P={get avatarUrl(){return n()},set avatarUrl(e=null){n(e),i()},get label(){return v()},set label(e){v(e),i()},get size(){return g()},set size(e=24){g(e),i()},get class(){return u()},set class(e=""){u(e),i()},get referrerpolicy(){return p()},set referrerpolicy(e){p(e),i()},get testid(){return o()},set testid(e){o(e),i()},get fill(){return f()},set fill(e=!1){f(e),i()},$set:S,$on:(e,t)=>V(a,e,t)},w=E(),R=F(w);{var j=e=>{var t=Y();let c;z(_=>{m(t,"src",n()),C(t,1,_),m(t,"referrerpolicy",p()),m(t,"data-testid",o()),c=N(t,"",c,{width:l(d),height:l(d)})},[()=>U(k(f()?"h-full w-full object-cover":"shrink-0 rounded-full",u()))]),K("error",t,()=>{x(b,!0)}),L(t),h(e,t)},H=e=>{var t=Z();let c;var _=M(t,!0);z(I=>{C(t,1,I),m(t,"data-testid",o()===void 0?void 0:`${o()}-fallback`),c=N(t,"",c,{width:l(d),height:l(d)}),Q(_,l(D))},[()=>U(k(f()?"grid h-full w-full place-items-center":"grid shrink-0 place-items-center rounded-full bg-muted type-caption text-foreground",u()))]),h(e,t)};X(R,e=>{l(B)?e(j):e(H,-1)})}return h(r,w),G(P)}function le(r){return A(r)}function ie(r){return r?A(r,{style:"narrow"}):"Never"}export{$ as P,ie as a,le as f};
1
+ import{t as O,bo as s,bw as S,b as V}from"./Fcr7AvC-.js";import{bs as W,cb as q,bH as x,a7 as E,ay as F,aD as l,W as h,bn as G,bV as J,c9 as y,aA as i,b_ as z,aw as K,bz as L,bl as M,bO as Q,aB as T}from"./3SdAC2_C.js";import{i as X}from"./BhYXv0ZM.js";import{c as U,e as k,s as m,f as C,g as N}from"./BRCr02in.js";import{n as A}from"./C7b3vXLD.js";var Y=T('<img alt="" aria-hidden="true" loading="lazy"/>'),Z=T('<span aria-hidden="true"> </span>');function $(r,a){if(new.target)return O({component:$,...r});W(a,!0);let n=s(a,"avatarUrl",7,null),v=s(a,"label",7),g=s(a,"size",7,24),u=s(a,"class",7,""),p=s(a,"referrerpolicy",7),o=s(a,"testid",7),f=s(a,"fill",7,!1),b=J(!1);const B=y(()=>!!n()&&!l(b)),D=y(()=>v().trim().slice(0,1).toUpperCase()||"?"),d=y(()=>f()?void 0:`${g()}px`);q(()=>{n(),x(b,!1)});var P={get avatarUrl(){return n()},set avatarUrl(e=null){n(e),i()},get label(){return v()},set label(e){v(e),i()},get size(){return g()},set size(e=24){g(e),i()},get class(){return u()},set class(e=""){u(e),i()},get referrerpolicy(){return p()},set referrerpolicy(e){p(e),i()},get testid(){return o()},set testid(e){o(e),i()},get fill(){return f()},set fill(e=!1){f(e),i()},$set:S,$on:(e,t)=>V(a,e,t)},w=E(),R=F(w);{var j=e=>{var t=Y();let c;z(_=>{m(t,"src",n()),C(t,1,_),m(t,"referrerpolicy",p()),m(t,"data-testid",o()),c=N(t,"",c,{width:l(d),height:l(d)})},[()=>U(k(f()?"h-full w-full object-cover":"shrink-0 rounded-full",u()))]),K("error",t,()=>{x(b,!0)}),L(t),h(e,t)},H=e=>{var t=Z();let c;var _=M(t,!0);z(I=>{C(t,1,I),m(t,"data-testid",o()===void 0?void 0:`${o()}-fallback`),c=N(t,"",c,{width:l(d),height:l(d)}),Q(_,l(D))},[()=>U(k(f()?"grid h-full w-full place-items-center":"grid shrink-0 place-items-center rounded-full bg-muted type-caption text-foreground",u()))]),h(e,t)};X(R,e=>{l(B)?e(j):e(H,-1)})}return h(r,w),G(P)}function le(r){return A(r)}function ie(r){return r?A(r,{style:"narrow"}):"Never"}export{$ as P,ie as a,le as f};
@@ -1 +1 @@
1
- import{b as a,B as w,ay as x}from"./DMudvlKI.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s};
1
+ import{b as a,B as w,ay as x}from"./BZnji9hP.js";var g=a((e,t,i,r)=>{e.attr("class",i);const{width:o,height:h,x:n,y:c}=u(e,t);w(e,h,o,r);const s=B(n,c,o,h,t);e.attr("viewBox",s),x.debug(`viewBox configured: ${s} with padding: ${t}`)},"setupViewPortForSVG"),u=a((e,t)=>{const i=e.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+t*2,height:i.height+t*2,x:i.x,y:i.y}},"calculateDimensionsWithPadding"),B=a((e,t,i,r,o)=>`${e-o} ${t-o} ${i} ${r}`,"createViewBox");export{g as s};