@intent-hq/web 2.383.5 → 2.383.7

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 (252) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{RFsxwSsB.js → -jC6R53Y.js} +1 -1
  3. package/web/app/immutable/chunks/{Co4vj0dC.js → 11IPfP64.js} +1 -1
  4. package/web/app/immutable/chunks/{wqIK2bns.js → 1VDAs3Ud.js} +1 -1
  5. package/web/app/immutable/chunks/{DnJ4jlPB.js → 2BBUaa8p.js} +1 -1
  6. package/web/app/immutable/chunks/{Bymbu99U.js → 38BB0grB.js} +1 -1
  7. package/web/app/immutable/chunks/{Dirmxn0x.js → 3FaPVDTk.js} +1 -1
  8. package/web/app/immutable/chunks/{D6G8WbHL.js → 51Rp6_AF.js} +1 -1
  9. package/web/app/immutable/chunks/{Dj14JHUo.js → 5moVT_HQ.js} +1 -1
  10. package/web/app/immutable/chunks/{B8-Q1tED.js → 6D8I0EJP.js} +1 -1
  11. package/web/app/immutable/chunks/{DW25C9MI.js → 7da8sugr.js} +2 -2
  12. package/web/app/immutable/chunks/{CiMmbOsB.js → 7g_E9v8v.js} +1 -1
  13. package/web/app/immutable/chunks/{DibfmKHg.js → 8MucyzZK.js} +1 -1
  14. package/web/app/immutable/chunks/{f24VwgrA.js → 90dwRRI_.js} +1 -1
  15. package/web/app/immutable/chunks/{B5MrjS7j.js → 96gE90DS.js} +1 -1
  16. package/web/app/immutable/chunks/9KbPq6ne.js +1 -0
  17. package/web/app/immutable/chunks/9bpkKfDs.js +1 -0
  18. package/web/app/immutable/chunks/{UMwTu6TE.js → 9p0DyBPU.js} +1 -1
  19. package/web/app/immutable/chunks/{No1eCFy3.js → B-4NNXpn.js} +1 -1
  20. package/web/app/immutable/chunks/{D6dlPeEM.js → B0-WaGMs.js} +1 -1
  21. package/web/app/immutable/chunks/{B8V-jGiS.js → B0SuIES7.js} +1 -1
  22. package/web/app/immutable/chunks/{BAKPnd3w.js → B2w13ngc.js} +1 -1
  23. package/web/app/immutable/chunks/{p7SBTgaC.js → B3WV7a-V.js} +1 -1
  24. package/web/app/immutable/chunks/{-tAyw6ob.js → B3zWdyp-.js} +1 -1
  25. package/web/app/immutable/chunks/{C6mS8uZB.js → B50rrLDJ.js} +1 -1
  26. package/web/app/immutable/chunks/{Bg_lZIRf.js → B6ERx__s.js} +2 -2
  27. package/web/app/immutable/chunks/{BmkXo3Yq.js → B6q3uVQG.js} +1 -1
  28. package/web/app/immutable/chunks/{GuiAAF9e.js → B7ZVMWBx.js} +1 -1
  29. package/web/app/immutable/chunks/{B265Nxi3.js → B91a7NqB.js} +1 -1
  30. package/web/app/immutable/chunks/{L_tYoUCb.js → B9ZFoPLo.js} +1 -1
  31. package/web/app/immutable/chunks/{Cgxwerkr.js → B9bXgFyu.js} +2 -2
  32. package/web/app/immutable/chunks/{c5QZsH9t.js → B9qXV8kb.js} +1 -1
  33. package/web/app/immutable/chunks/{C_KuQ05a.js → BAwmUXtg.js} +1 -1
  34. package/web/app/immutable/chunks/{BxoyDHGw.js → BB2DpGJV.js} +1 -1
  35. package/web/app/immutable/chunks/{C7Zl7z5c.js → BBrT6DIB.js} +1 -1
  36. package/web/app/immutable/chunks/{CO5zWp8I.js → BFPO9C1I.js} +1 -1
  37. package/web/app/immutable/chunks/{CfiKUG8A.js → BGm3f58g.js} +1 -1
  38. package/web/app/immutable/chunks/{iN763416.js → BIsdYrnK.js} +1 -1
  39. package/web/app/immutable/chunks/{3o8kzB3n.js → BM2XSA6g.js} +1 -1
  40. package/web/app/immutable/chunks/{BxEf7uwl.js → BMF9dBr3.js} +1 -1
  41. package/web/app/immutable/chunks/{B4WuQori.js → BMWq5Cem.js} +1 -1
  42. package/web/app/immutable/chunks/{DA5opfEp.js → BPjvgJzJ.js} +1 -1
  43. package/web/app/immutable/chunks/{CsD5HG3r.js → BUDFO3oC.js} +1 -1
  44. package/web/app/immutable/chunks/{Cq88mLGj.js → BUchcLc3.js} +3 -3
  45. package/web/app/immutable/chunks/BWu0YXkV.js +1 -0
  46. package/web/app/immutable/chunks/{Dp-6l6dc.js → BXMl8g0k.js} +1 -1
  47. package/web/app/immutable/chunks/{CqcqWJoa.js → BY98dnH8.js} +1 -1
  48. package/web/app/immutable/chunks/{DqWLkzGY.js → BZ1Q38PM.js} +1 -1
  49. package/web/app/immutable/chunks/{BjfHx7zJ.js → BbHdeR3v.js} +1 -1
  50. package/web/app/immutable/chunks/BcQ6Rg0V.js +10 -0
  51. package/web/app/immutable/chunks/{WGwfzXjP.js → BcUHkjB6.js} +1 -1
  52. package/web/app/immutable/chunks/{D96pHovR.js → Bf16PEz1.js} +1 -1
  53. package/web/app/immutable/chunks/{BqRWw-wJ.js → BfSTFUKA.js} +1 -1
  54. package/web/app/immutable/chunks/{C3upI-xJ.js → BgZpMc5-.js} +1 -1
  55. package/web/app/immutable/chunks/{u2aKD69u.js → BgjaD_Yy.js} +1 -1
  56. package/web/app/immutable/chunks/{KEaRLIGy.js → BhcBqtJg.js} +1 -1
  57. package/web/app/immutable/chunks/{Bs9K_x5H.js → BkPSRIlH.js} +1 -1
  58. package/web/app/immutable/chunks/{Dlk4BhFg.js → BnG797lq.js} +1 -1
  59. package/web/app/immutable/chunks/{CDK_hSiv.js → BotfI-oJ.js} +1 -1
  60. package/web/app/immutable/chunks/{EK6zOAHM.js → BsOWc0fD.js} +1 -1
  61. package/web/app/immutable/chunks/{DzB2TE-q.js → BtI19qHa.js} +40 -40
  62. package/web/app/immutable/chunks/{DizKilK3.js → Bwa_PJLB.js} +2 -2
  63. package/web/app/immutable/chunks/{BwfxdDPw.js → Byb6yuNY.js} +1 -1
  64. package/web/app/immutable/chunks/{6Bqipt1r.js → C-LBvoL7.js} +1 -1
  65. package/web/app/immutable/chunks/{ZxEOlEA2.js → C1IZMhCT.js} +1 -1
  66. package/web/app/immutable/chunks/{ozVAo4aX.js → C1JG3JxG.js} +1 -1
  67. package/web/app/immutable/chunks/{CApA6QD2.js → C1dPOfxb.js} +4 -4
  68. package/web/app/immutable/chunks/{BYChQVmd.js → C2BnXWav.js} +1 -1
  69. package/web/app/immutable/chunks/{DCRuihKm.js → C2jYl_tm.js} +2 -2
  70. package/web/app/immutable/chunks/{CkA2ItLw.js → C3Cs4xcH.js} +1 -1
  71. package/web/app/immutable/chunks/{-Q8WHsT1.js → C3KL0Dob.js} +2 -2
  72. package/web/app/immutable/chunks/{518Fef2L.js → C3kvbgti.js} +1 -1
  73. package/web/app/immutable/chunks/{C4QKwtCH.js → C429ViPJ.js} +1 -1
  74. package/web/app/immutable/chunks/{CWdKrGNN.js → C4ItHUxb.js} +1 -1
  75. package/web/app/immutable/chunks/{Cg871q2J.js → C56HY_cI.js} +1 -1
  76. package/web/app/immutable/chunks/{DATzIj-C.js → C5H3ErAr.js} +1 -1
  77. package/web/app/immutable/chunks/{_SYFiE9N.js → C7Q9MjK0.js} +1 -1
  78. package/web/app/immutable/chunks/{IK5u1LkS.js → C8ZC1xrW.js} +1 -1
  79. package/web/app/immutable/chunks/{cfdblcWY.js → C91EC830.js} +1 -1
  80. package/web/app/immutable/chunks/{CHKnj_kH.js → C9fVl7VH.js} +1 -1
  81. package/web/app/immutable/chunks/{Bty1UglO.js → CAXPT_Gw.js} +1 -1
  82. package/web/app/immutable/chunks/{DC8keNAk.js → CCjzzCpy.js} +1 -1
  83. package/web/app/immutable/chunks/{D51XIZYq.js → CDLANF8s.js} +1 -1
  84. package/web/app/immutable/chunks/{MEqItsKn.js → CE-gn8fg.js} +1 -1
  85. package/web/app/immutable/chunks/{BYq9VtBF.js → CENp25rd.js} +1 -1
  86. package/web/app/immutable/chunks/{3vWQiXY2.js → CEOk8g-Q.js} +3 -3
  87. package/web/app/immutable/chunks/{Du0DJF2z.js → CEl8yEuC.js} +1 -1
  88. package/web/app/immutable/chunks/{B5YNqIIm.js → CIeXUP7u.js} +1 -1
  89. package/web/app/immutable/chunks/{DzbS0qCL.js → CKjysSbd.js} +1 -1
  90. package/web/app/immutable/chunks/{u8znU8zy.js → CLUxyZqF.js} +1 -1
  91. package/web/app/immutable/chunks/{BHt4i6xN.js → CPIZev3Z.js} +1 -1
  92. package/web/app/immutable/chunks/{B9YYIjUd.js → CQlHJWbs.js} +3 -3
  93. package/web/app/immutable/chunks/{BiQUDh4s.js → CQvGDYQV.js} +1 -1
  94. package/web/app/immutable/chunks/{DsGUBv3k.js → CQwOMyxz.js} +1 -1
  95. package/web/app/immutable/chunks/{yFcbscNn.js → CRdOY_2z.js} +1 -1
  96. package/web/app/immutable/chunks/{lzAd2Up3.js → CS3H-hA4.js} +1 -1
  97. package/web/app/immutable/chunks/{DKHY8q_S.js → CTP1vzdq.js} +1 -1
  98. package/web/app/immutable/chunks/{nTGBknlr.js → CTYV2WCR.js} +1 -1
  99. package/web/app/immutable/chunks/{CRZZ_hOy.js → CW0Mb2k4.js} +1 -1
  100. package/web/app/immutable/chunks/{B2Ym4lhl.js → CYkPVUDx.js} +1 -1
  101. package/web/app/immutable/chunks/{W0L8GDXP.js → C_1zy40-.js} +1 -1
  102. package/web/app/immutable/chunks/{Do2giiGP.js → CaCH7xka.js} +1 -1
  103. package/web/app/immutable/chunks/{Bygq9d8w.js → CaVcxIX_.js} +1 -1
  104. package/web/app/immutable/chunks/{RWObpdxy.js → Cb9atCGq.js} +1 -1
  105. package/web/app/immutable/chunks/{DZYWuj4L.js → CdDve0EN.js} +1 -1
  106. package/web/app/immutable/chunks/{CmrjfWYI.js → Ce1_P2yR.js} +1 -1
  107. package/web/app/immutable/chunks/{C8y9EItt.js → Chp6TQgb.js} +1 -1
  108. package/web/app/immutable/chunks/{tZyAiGvb.js → ClIBKxjv.js} +1 -1
  109. package/web/app/immutable/chunks/{OtomGvb3.js → CmAb18no.js} +1 -1
  110. package/web/app/immutable/chunks/{Yyy6gahW.js → CmbyIv2W.js} +1 -1
  111. package/web/app/immutable/chunks/{BaujsV9k.js → Cppy6ZYG.js} +1 -1
  112. package/web/app/immutable/chunks/{BhSvmxU-.js → Cpw-AI-k.js} +4 -4
  113. package/web/app/immutable/chunks/{7dpPwFPi.js → CqEyPGwj.js} +1 -1
  114. package/web/app/immutable/chunks/{BTrqJIJZ.js → Cq_r_CYV.js} +1 -1
  115. package/web/app/immutable/chunks/{CFUZ-wx4.js → CqhHB0m1.js} +3 -3
  116. package/web/app/immutable/chunks/{D8UBdXB2.js → CtCH4W1N.js} +1 -1
  117. package/web/app/immutable/chunks/{Z0_LIT6x.js → CteMcmUe.js} +2 -2
  118. package/web/app/immutable/chunks/{FzlZUztb.js → CttA-M7l.js} +1 -1
  119. package/web/app/immutable/chunks/{C9dAybnM.js → Cxb8aRlA.js} +2 -2
  120. package/web/app/immutable/chunks/{C0cGUVCr.js → Cxs-r6qH.js} +1 -1
  121. package/web/app/immutable/chunks/{DbZ5HUqx.js → CzMfcD76.js} +2 -2
  122. package/web/app/immutable/chunks/{DAJnPbZk.js → CzRvdM50.js} +4 -4
  123. package/web/app/immutable/chunks/{Dac_vP74.js → D14F6Zen.js} +1 -1
  124. package/web/app/immutable/chunks/{iHxbYHJ6.js → D1Kvaw2U.js} +1 -1
  125. package/web/app/immutable/chunks/{DTuql3Rj.js → D32iIfZB.js} +1 -1
  126. package/web/app/immutable/chunks/{D_Xpj-6r.js → D5TRf27k.js} +1 -1
  127. package/web/app/immutable/chunks/{Djp7mdlG.js → D6x1PvJt.js} +1 -1
  128. package/web/app/immutable/chunks/{DY-t7Was.js → D8bef7T8.js} +1 -1
  129. package/web/app/immutable/chunks/{Bvi-fRGz.js → DA3JhNUa.js} +1 -1
  130. package/web/app/immutable/chunks/{BRJQPxpd.js → DBOkAv2-.js} +1 -1
  131. package/web/app/immutable/chunks/{fiz8N_zQ.js → DCL0Px6m.js} +1 -1
  132. package/web/app/immutable/chunks/{5c25JTI1.js → DCzWLn9w.js} +1 -1
  133. package/web/app/immutable/chunks/{DrIA1Azf.js → DDxtqhsd.js} +1 -1
  134. package/web/app/immutable/chunks/{CY4fyoCV.js → DEe4pSnF.js} +1 -1
  135. package/web/app/immutable/chunks/{Dsr4GELp.js → DFUCAM2K.js} +1 -1
  136. package/web/app/immutable/chunks/{CBB3lnfZ.js → DGP-y2GB.js} +3 -3
  137. package/web/app/immutable/chunks/{DDfr81XI.js → DGSdOlov.js} +1 -1
  138. package/web/app/immutable/chunks/{BP5uGGO_.js → DHLXX1td.js} +1 -1
  139. package/web/app/immutable/chunks/{BypvqIQM.js → DHbAORA3.js} +1 -1
  140. package/web/app/immutable/chunks/{CqnrQ6ti.js → DITUyjV2.js} +3 -3
  141. package/web/app/immutable/chunks/{B4SiDSWP.js → DI_O2uCQ.js} +1 -1
  142. package/web/app/immutable/chunks/{Ctbo6mXV.js → DJcj8WvN.js} +1 -1
  143. package/web/app/immutable/chunks/{CG-tM1HG.js → DLS35Cs2.js} +2 -2
  144. package/web/app/immutable/chunks/{Cngzlos4.js → DMVD9ZWm.js} +1 -1
  145. package/web/app/immutable/chunks/{BpcUO3Xs.js → DOAyQZ8n.js} +1 -1
  146. package/web/app/immutable/chunks/{CnZI1GOS.js → DQZ6hbu0.js} +1 -1
  147. package/web/app/immutable/chunks/{SqlvGXMi.js → DT_iJHxn.js} +1 -1
  148. package/web/app/immutable/chunks/{CHLX1QZz.js → DXn0DuET.js} +1 -1
  149. package/web/app/immutable/chunks/{eElW3aeh.js → DZ84MPQO.js} +1 -1
  150. package/web/app/immutable/chunks/{BXCVSrGo.js → D_Fe9jJy.js} +1 -1
  151. package/web/app/immutable/chunks/{BIQB3Kx5.js → DaLNZosE.js} +1 -1
  152. package/web/app/immutable/chunks/{DPCOdXX2.js → DbD3dAy_.js} +1 -1
  153. package/web/app/immutable/chunks/{C0LshS-P.js → Dc0NoKVI.js} +1 -1
  154. package/web/app/immutable/chunks/{C0o77pad.js → Dd6jkKNK.js} +2 -2
  155. package/web/app/immutable/chunks/{Bv1ckDXI.js → DggzSry-.js} +1 -1
  156. package/web/app/immutable/chunks/{BNVrbjR5.js → DgiZ-0Sp.js} +2 -2
  157. package/web/app/immutable/chunks/{B-MmNWOm.js → DhQSNgxc.js} +1 -1
  158. package/web/app/immutable/chunks/{QeBH-DWE.js → Dhy-QJgd.js} +1 -1
  159. package/web/app/immutable/chunks/{KYuLFpkq.js → DiNBgjb1.js} +1 -1
  160. package/web/app/immutable/chunks/{Dql2ogGT.js → Dj8digI5.js} +1 -1
  161. package/web/app/immutable/chunks/{C1EvfTg-.js → DjNVz8pO.js} +1 -1
  162. package/web/app/immutable/chunks/{6-uYidyP.js → DkDSK_05.js} +3 -3
  163. package/web/app/immutable/chunks/{DCK8dPAL.js → DkME16PR.js} +1 -1
  164. package/web/app/immutable/chunks/{j65te9ZT.js → Dl2c_Q4j.js} +1 -1
  165. package/web/app/immutable/chunks/{BWbkCnfm.js → Dl4B5sLX.js} +1 -1
  166. package/web/app/immutable/chunks/{BmTMWrby.js → DlUZpQ7U.js} +1 -1
  167. package/web/app/immutable/chunks/{CLkfOjAo.js → DnNC4gf3.js} +3 -3
  168. package/web/app/immutable/chunks/{CSRYV6LQ.js → Dnp239cR.js} +1 -1
  169. package/web/app/immutable/chunks/{BfojStRz.js → DpPV7WHr.js} +1 -1
  170. package/web/app/immutable/chunks/{BP3Sccje.js → DpX9aeiZ.js} +1 -1
  171. package/web/app/immutable/chunks/{B_JCVgq0.js → DqH-hVUa.js} +1 -1
  172. package/web/app/immutable/chunks/{Dr8j8hDa.js → DqMZWY-u.js} +2 -2
  173. package/web/app/immutable/chunks/{BZC6DuKQ.js → Dqhi5681.js} +1 -1
  174. package/web/app/immutable/chunks/{Cqa6LF3b.js → DrWDRmYR.js} +1 -1
  175. package/web/app/immutable/chunks/{BYdTf9Vr.js → DsCz_Hld.js} +1 -1
  176. package/web/app/immutable/chunks/{DrxfcnSy.js → DsffLoT8.js} +1 -1
  177. package/web/app/immutable/chunks/{CP9Lq5G_.js → DtekCANZ.js} +1 -1
  178. package/web/app/immutable/chunks/{ClJhkXR5.js → DwDabzpx.js} +1 -1
  179. package/web/app/immutable/chunks/{BPL5Fo2b.js → Dx3nOa5s.js} +1 -1
  180. package/web/app/immutable/chunks/{BacafptN.js → DyIsX23v.js} +4 -4
  181. package/web/app/immutable/chunks/{BcpfdNy8.js → FITmaVUJ.js} +1 -1
  182. package/web/app/immutable/chunks/{Bj84UPYb.js → FoSxZj2s.js} +1 -1
  183. package/web/app/immutable/chunks/{CAvYeStH.js → JvS7MGpw.js} +1 -1
  184. package/web/app/immutable/chunks/{DQ_mNIfK.js → L0wFy8_j.js} +1 -1
  185. package/web/app/immutable/chunks/{D8ohaX19.js → NE3LtfEb.js} +1 -1
  186. package/web/app/immutable/chunks/{CpJb1fZG.js → NaXnyxXD.js} +1 -1
  187. package/web/app/immutable/chunks/{B_kMSQKD.js → NqwdDVdt.js} +1 -1
  188. package/web/app/immutable/chunks/{B2DRKAdQ.js → Q16zd2xh.js} +1 -1
  189. package/web/app/immutable/chunks/{C4JbSg3f.js → SB0XkB7s.js} +1 -1
  190. package/web/app/immutable/chunks/{BKPEtXUT.js → SDBQMo24.js} +1 -1
  191. package/web/app/immutable/chunks/{DaFpSJap.js → SSdhXyvx.js} +1 -1
  192. package/web/app/immutable/chunks/{CwTtJpch.js → SnC5sLK-.js} +1 -1
  193. package/web/app/immutable/chunks/{CMEtJ5i1.js → SwH0lZVC.js} +1 -1
  194. package/web/app/immutable/chunks/{CbqxWBi7.js → T-y84UQ-.js} +1 -1
  195. package/web/app/immutable/chunks/{S845NCb3.js → VxaCN40t.js} +1 -1
  196. package/web/app/immutable/chunks/{C4LrSRW3.js → Y3x17kvu.js} +1 -1
  197. package/web/app/immutable/chunks/{BxJ6X-Sl.js → ZNxS70ti.js} +1 -1
  198. package/web/app/immutable/chunks/{ClMg21pU.js → ZtnoAnS2.js} +1 -1
  199. package/web/app/immutable/chunks/{tr-2J8Mf.js → _LtUY0jS.js} +1 -1
  200. package/web/app/immutable/chunks/{DwL1A1su.js → _WGu_9si.js} +1 -1
  201. package/web/app/immutable/chunks/{PIgqsYsQ.js → _Z48PZPG.js} +1 -1
  202. package/web/app/immutable/chunks/{DtF9DVpp.js → _szCylN8.js} +1 -1
  203. package/web/app/immutable/chunks/{CwtLM6uA.js → amTgh_yM.js} +1 -1
  204. package/web/app/immutable/chunks/{WiA7_4AK.js → aoCeefP4.js} +1 -1
  205. package/web/app/immutable/chunks/{OFhgRaUm.js → bq2jN3Y4.js} +1 -1
  206. package/web/app/immutable/chunks/{CDjpuJh0.js → c6a4q1y9.js} +1 -1
  207. package/web/app/immutable/chunks/{Cx37GTsM.js → cWnGUUZk.js} +1 -1
  208. package/web/app/immutable/chunks/{D37getya.js → ceYukiuF.js} +1 -1
  209. package/web/app/immutable/chunks/{BaW_cM4B.js → i2uLOz57.js} +1 -1
  210. package/web/app/immutable/chunks/{BeOwB_6G.js → iDB1itc7.js} +1 -1
  211. package/web/app/immutable/chunks/{-afdnSwu.js → lFCyJLs0.js} +1 -1
  212. package/web/app/immutable/chunks/{CJtViYfh.js → lQcc1B6x.js} +1 -1
  213. package/web/app/immutable/chunks/{DT3Kx0Qe.js → lzc_ALaY.js} +1 -1
  214. package/web/app/immutable/chunks/{CmVBRNuA.js → m2kIPDiE.js} +1 -1
  215. package/web/app/immutable/chunks/{CjTo2K46.js → nA0tsFRt.js} +1 -1
  216. package/web/app/immutable/chunks/{B2nCyo89.js → pQ6IdBCz.js} +1 -1
  217. package/web/app/immutable/chunks/{BSKFIBj2.js → ram0Xoqf.js} +1 -1
  218. package/web/app/immutable/chunks/{CCqqosml.js → rpEVAvPW.js} +1 -1
  219. package/web/app/immutable/chunks/{CSVgdt55.js → sABlNrvu.js} +1 -1
  220. package/web/app/immutable/chunks/{DMV7vEM7.js → tV0w-z-Q.js} +1 -1
  221. package/web/app/immutable/chunks/{DFi1P2MD.js → veocPVpA.js} +1 -1
  222. package/web/app/immutable/chunks/{hHMYoFyG.js → wjh5cuBI.js} +1 -1
  223. package/web/app/immutable/chunks/{BTv8uh2C.js → xGj0i83D.js} +6 -6
  224. package/web/app/immutable/entry/{app.Cqjdbldk.js → app.oKB02DpO.js} +2 -2
  225. package/web/app/immutable/entry/start.MWx9NKvl.js +1 -0
  226. package/web/app/immutable/nodes/{0.CIMKJ2v2.js → 0.Cj75U9Pb.js} +1 -1
  227. package/web/app/immutable/nodes/{1.C-zZe4mL.js → 1.COmRB5Gs.js} +1 -1
  228. package/web/app/immutable/nodes/{10.CRicXMMy.js → 10.B-EGmrBP.js} +5 -5
  229. package/web/app/immutable/nodes/{11.CFkPUf9W.js → 11.CHJVqhXh.js} +1 -1
  230. package/web/app/immutable/nodes/{13.CCKyw-_o.js → 13.C6TyTlAm.js} +1 -1
  231. package/web/app/immutable/nodes/{14.BD92xFv4.js → 14.CHiqNDyF.js} +1 -1
  232. package/web/app/immutable/nodes/{15.BDAlg-ra.js → 15.DvvqcqqW.js} +1 -1
  233. package/web/app/immutable/nodes/{16.CVCm-nfj.js → 16.Dyi9KYXl.js} +1 -1
  234. package/web/app/immutable/nodes/{17.CjKvJw8X.js → 17.CH042Yj8.js} +1 -1
  235. package/web/app/immutable/nodes/{18.DDY8Eqsn.js → 18.DVg5DSa7.js} +1 -1
  236. package/web/app/immutable/nodes/{19.DJgRbiNE.js → 19.CFGkesVY.js} +2 -2
  237. package/web/app/immutable/nodes/{2.Dl71tIky.js → 2.BSKohF8j.js} +4 -4
  238. package/web/app/immutable/nodes/{20.CLsq1QLL.js → 20.Byg15mRq.js} +1 -1
  239. package/web/app/immutable/nodes/{3.DNld1BNY.js → 3.CgM283V9.js} +1 -1
  240. package/web/app/immutable/nodes/{4.Dqn6Xii_.js → 4.pSSQL5ZR.js} +1 -1
  241. package/web/app/immutable/nodes/{5.B0BP_LYC.js → 5.gjcZy0Yo.js} +1 -1
  242. package/web/app/immutable/nodes/{6.NwMlYZya.js → 6.mfPH3Xl6.js} +1 -1
  243. package/web/app/immutable/nodes/{7.CP-QZto7.js → 7.hkLeTg6x.js} +1 -1
  244. package/web/app/immutable/nodes/{8.BsQgGFet.js → 8.CwwxHkuu.js} +1 -1
  245. package/web/app/immutable/nodes/{9.DY6xrFrM.js → 9.VYVO4dZo.js} +4 -4
  246. package/web/app/version.json +1 -1
  247. package/web/index.html +12 -12
  248. package/web/app/immutable/chunks/BIVeXMBl.js +0 -1
  249. package/web/app/immutable/chunks/D-zjf2Af.js +0 -1
  250. package/web/app/immutable/chunks/DH5O4f99.js +0 -1
  251. package/web/app/immutable/chunks/pUxZXv-3.js +0 -10
  252. package/web/app/immutable/entry/start.D0BpS8PF.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./tr-2J8Mf.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./Dsr4GELp.js";import{bO as Ea,b$ as La,dH as Ma}from"./BaujsV9k.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./EK6zOAHM.js";import{m as sr}from"./BmTMWrby.js";import{f as Te}from"./FzlZUztb.js";import{h as Ua}from"./DCRuihKm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./fiz8N_zQ.js";import{c as Xa}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{$ as Ya}from"./DzB2TE-q.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./DTuql3Rj.js";import{M as Qa}from"./CFUZ-wx4.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./QeBH-DWE.js";import{M as Bt}from"./CDK_hSiv.js";import{V as eo}from"./CqcqWJoa.js";import{bT as to,b7 as ro}from"./BqRWw-wJ.js";import{g as ao}from"./yFcbscNn.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./CO5zWp8I.js";import{b as lo,h as so}from"./BxEf7uwl.js";import{t as co}from"./BfojStRz.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
1
+ import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./_LtUY0jS.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./DFUCAM2K.js";import{bO as Ea,b$ as La,dH as Ma}from"./Cppy6ZYG.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./BsOWc0fD.js";import{m as sr}from"./DlUZpQ7U.js";import{f as Te}from"./CttA-M7l.js";import{h as Ua}from"./C2jYl_tm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./DCL0Px6m.js";import{c as Xa}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{$ as Ya}from"./BtI19qHa.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./D32iIfZB.js";import{M as Qa}from"./CqhHB0m1.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./Dhy-QJgd.js";import{M as Bt}from"./BotfI-oJ.js";import{V as eo}from"./BY98dnH8.js";import{bT as to,b7 as ro}from"./BfSTFUKA.js";import{g as ao}from"./CRdOY_2z.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./BFPO9C1I.js";import{b as lo,h as so}from"./BMF9dBr3.js";import{t as co}from"./DpPV7WHr.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
2
2
  `).map(u=>u.split(",").map(w=>w.trim()));var bt={get filePath(){return ee()},set filePath(t){ee(t),ce()},get fileContent(){return P()},set fileContent(t=""){P(t),ce()},get sourceUrl(){return O()},set sourceUrl(t){O(t),ce()},get language(){return ae()},set language(t){ae(t),ce()},get isBinary(){return Ee()},set isBinary(t){Ee(t),ce()},get allowDownload(){return ye()},set allowDownload(t=!0){ye(t),ce()},get onDownload(){return be()},set onDownload(t){be(t),ce()},get downloading(){return oe()},set downloading(t=!1){oe(t),ce()},$set:Yt,$on:(t,o)=>Gt(_,t,o)},me=Lo();ut("blur",Lr,a);var Me=F(me);{var tt=t=>{var o=Po(),u=F(o),w=F(u);re(w);var $=g(w,2);{let Pe=i(()=>d.editor_fileViewer_rotate_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:J,get title(){return e(Pe)},children:(Ae,Ye)=>{dt(Ae,{get icon(){return Va},size:"sm"})},$$slots:{default:!0}})}var E=g($,4);{let Pe=i(()=>d.editor_fileViewer_copyImage_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ft,get title(){return e(Pe)},children:(Ae,Ye)=>{var rt=Ue(),Ge=ve(rt);{var kt=Fe=>{dt(Fe,{get icon(){return za},size:"sm",class:"text-green-500"})},Vt=Fe=>{dt(Fe,{get icon(){return Aa},size:"sm"})};Y(Ge,Fe=>{e(W)?Fe(kt):Fe(Vt,-1)})}s(Ae,rt)},$$slots:{default:!0}})}var V=g(E,2);{let Pe=i(()=>!ye()||oe()),Ae=i(()=>d.editor_fileViewer_download_tooltip());Te(V,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(Pe)},get title(){return e(Ae)},children:(Ye,rt)=>{dt(Ye,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var T=g(V,2),K=C(T,!0);k(u);var L=g(u,2),he=C(L);k(o),I(Pe=>{m(K,e(B)),Kt(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(L,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(he,"src",Pe),Qe(he,"alt",e(B)),jt(he,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100}) rotate(${e(xe)??""}deg); transition: transform 0.2s;`)},[()=>y()]),yt("pointerdown",L,l),yt("pointermove",L,q),yt("pointerup",L,v),ut("pointercancel",L,v),ut("lostpointercapture",L,v),s(t,o)},_e=t=>{var o=yo(),u=F(o),w=F(u);re(w);var $=g(w,2);{let L=i(()=>!ye()||oe()),he=i(()=>d.editor_fileViewer_download_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(L)},get title(){return e(he)},children:(Pe,Ae)=>{dt(Pe,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var E=g($,2),V=C(E,!0);k(u);var T=g(u,2),K=C(T);k(o),I(L=>{m(V,e(B)),Kt(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(T,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(K,"src",L),Qe(K,"alt",e(B)),jt(K,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100});`)},[()=>N()]),yt("pointerdown",T,l),yt("pointermove",T,q),yt("pointerup",T,v),ut("pointercancel",T,v),ut("lostpointercapture",T,v),s(t,o)},Re=t=>{const o=i(G);var u=Ue(),w=ve(u);Mr(w,()=>ee()+e(o),$=>{Wr($,{get sourceUrl(){return e(o)},get fileName(){return e(B)},get allowDownload(){return ye()},get downloading(){return oe()},onDownload:ne})}),s(t,u)},Qt=t=>{var o=$o(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=F($),V=g(E);k($),k(o),I((T,K)=>{m(w,e(B)),Qe(E,"src",T),m(V,` ${K??""}`)},[()=>y(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,o)},$t=t=>{var o=Io(),u=g(F(o),2),w=C(u,!0),$=g(u,2);{let E=i(()=>!ye()||oe());Te($,{size:"sm",variant:"secondary",onclick:ne,get disabled(){return e(E)},children:(V,T)=>{var K=ko(),L=ve(K);dt(L,{get icon(){return Ot},size:"sm",class:"mr-2"});var he=g(L);I(Pe=>m(he,` ${Pe??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(V,K)},$$slots:{default:!0}})}k(o),I(E=>m(w,E),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,o)},er=t=>{{let o=i(()=>vt(P().toString()));fr(t,{get value(){return e(o)},language:"json",get fileName(){return ee()},lineNumbers:!0,readOnly:!0})}},tr=t=>{const o=i(()=>pt(P().toString()));var u=Do(),w=F(u),$=F(w),E=F($);Ut(E,23,()=>e(o)[0]||[],(T,K)=>`header-${K}-${T}`,(T,K)=>{var L=So(),he=C(L,!0);I(()=>m(he,e(K))),s(T,L)}),k(E),k($);var V=g($);Ut(V,23,()=>e(o).slice(1),(T,K)=>`row-${K}`,(T,K,L)=>{var he=Fo();Ut(he,23,()=>e(K),(Pe,Ae)=>`cell-${e(L)}-${Ae}`,(Pe,Ae)=>{var Ye=Co(),rt=C(Ye,!0);I(()=>m(rt,e(Ae))),s(Pe,Ye)}),k(he),s(T,he)}),k(V),k(w),k(u),s(t,u)},Xe=t=>{var o=To(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_archive_label()]),s(t,o)},ze=t=>{var o=Eo(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_binary_label()]),s(t,o)},rr=t=>{{let o=i(()=>P().toString());fr(t,{get value(){return e(o)},get language(){return ae()},get fileName(){return ee()},lineNumbers:!0,highlightActiveLine:!0})}};Y(Me,t=>{e(U)==="image"?t(tt):e(U)==="svg"?t(_e,1):e(U)==="video"?t(Re,2):e(U)==="audio"?t(Qt,3):e(U)==="pdf"?t($t,4):e(U)==="json"?t(er,5):e(U)==="csv"?t(tr,6):e(U)==="archive"?t(Xe,7):e(U)==="binary"?t(ze,8):t(rr,-1)})}return k(me),s(A,me),Zt(bt)}ia(["pointerdown","pointermove","pointerup"]);const Mo=/access denied|permission denied|outside (?:the )?workspace/i,Ro=/file not found|no such file or directory/i;function jo(A){return Mo.test(A)?"access-denied":A===d.files_read_notFound_error()||Ro.test(A)?"not-found":"generic"}function Uo(A){switch(A){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var Vo=x("<!> <!>",1),zo=x("<!> <!> <!>",1),Ao=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),Tr=x('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),Wo=x('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),Er=x('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),No=x('<div class="flex items-center gap-3"><!> <!></div>'),Bo=x('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Ho=x('<p class="text-xs"> </p>'),Oo=x("<li><!></li>"),qo=x('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Ko=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),Xo=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),Yo=x('<div class="h-full overflow-auto p-4"><!></div>'),Go=x("<div><!></div>"),Jo=x('<iframe sandbox="" referrerpolicy="no-referrer"></iframe>'),Zo=x('<div class="absolute inset-0 flex items-center justify-center text-subtle" role="status"> </div>'),Qo=x('<div class="relative size-full"><!> <!> <!></div>');function ei(A,_){if(new.target)return Xt({component:ei,...A});Jt(_,!0);const re=()=>ge(tr,"$workspace",W),Be=()=>ge(D,"$fileContentStore",W),ee=()=>ge(fe,"$fileLoadingStore",W),P=()=>ge(J,"$fileSavingStore",W),O=()=>ge(ne,"$fileErrorStore",W),ae=()=>ge(ft,"$fileErrorInfoStore",W),Ee=()=>ge(vt,"$homeView$",W),ye=()=>ge(pt,"$fileNotFoundCandidatesStore",W),be=()=>ge(bt,"$isFileBinaryStore",W),oe=()=>ge(me,"$isFileDirtyStore",W),et=()=>ge(Me,"$fileLastUpdatedStore",W),U=()=>ge(tt,"$ftChanges$",W),B=()=>ge(er,"$gutterRead$",W),pe=()=>ge(Ke,"$lineWrapping",W),xe=()=>ge(ue,"$diffIndicators",W),Le=()=>ge(Qt,"$rootMediaPreview",W),[W,$e]=pr(),Ce=(r,n=sa)=>{var b=Or,S=qr;{let le=i(()=>xe()?e(rt):[]),ke=i(()=>n()&&v());Rr(fr(r,{get value(){return b()},set value(Z){S(Z)},get language(){return e(or)},get readOnly(){return e(y)},get fileName(){return a().filePath},get workspaceId(){return l()},get filePath(){return a().filePath},get lineWrapping(){return pe()},get lineChanges(){return e(le)},get jumpTo(){return e(kt)},get externalContentVersion(){return e(Pe)},get isPanelFocused(){return e(ke)}}),Z=>c(Ye,Z,!0),()=>e(Ye))}},qe=r=>{var n=Vo(),b=ve(n);{var S=Z=>{var He=Ue(),Je=ve(He);Nt(Je,()=>Bt,(nt,Tt)=>{Tt(nt,{get icon(){return Ba},get label(){return e(Ae)},disabled:!0})}),s(Z,He)};Y(b,Z=>{!e(It)&&!e(y)&&!e(L)&&Z(S)})}var le=g(b,2);{var ke=Z=>{{let He=i(()=>e(_t)?d.ui_viewSettings_htmlPreview_label():void 0),Je=i(()=>!e(We)),nt=i(()=>!e(y)&&!e(We));eo(Z,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(wr)},get previewLabel(){return e(He)},get previewEnabled(){return e(Fe)},onTogglePreview:()=>c(Fe,!e(Fe)),get showWrap(){return e(Je)},get wrapEnabled(){return pe()},onToggleWrap:()=>R.dispatch(_a()),get showDiff(){return e(nt)},get diffEnabled(){return xe()},onToggleDiff:()=>R.dispatch(ma())})}};Y(le,Z=>{a().filePath&&!e(It)&&!e(L)&&Z(ke)})}s(r,n)},Ve=r=>{var n=Ue(),b=ve(n);{var S=le=>{var ke=zo(),Z=ve(ke);{var He=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_goToChanges_tooltip());Nt(ht,()=>Bt,(Lt,Mt)=>{Mt(Lt,{get icon(){return Oa},get label(){return e(Et)},onclick:Gr})})}s(Oe,at)};Y(Z,Oe=>{e(Hr)&&Oe(He)})}var Je=g(Z,2);{var nt=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_downloadFile_label()),Lt=i(()=>!e(Ct)||e(mt));Nt(ht,()=>Bt,(Mt,ir)=>{ir(Mt,{get icon(){return Ot},get label(){return e(Et)},onclick:At,get disabled(){return e(Lt)}})})}s(Oe,at)};Y(Je,Oe=>{e(it)&&Oe(nt)})}var Tt=g(Je,2);{let Oe=i(()=>d.layout_fileTab_deleteFile_tooltip());Nt(Tt,()=>Bt,(at,ht)=>{ht(at,{get icon(){return Ha},get label(){return e(Oe)},onclick:Jr,destructive:!0})})}s(le,ke)};Y(b,le=>{a().filePath&&!e(It)&&!e(y)&&le(S)})}s(r,n)},Ke=to(),ue=ro();let a=de(_,"tab",7),l=de(_,"workspaceId",7),q=de(_,"isActive",7),v=de(_,"isPanelFocused",7);se(()=>{const r=l();if(!(!q()||!r||e(f)))return R.dispatch(ua(r,"files")),()=>R.dispatch(fa(r,"files"))});const f=i(()=>typeof a().data?.gitRootId=="string"?a().data.gitRootId:void 0),ie=i(()=>typeof a().data?.gitRootPath=="string"?a().data.gitRootPath:void 0),y=i(()=>!!e(f)),G=i(()=>a().filePath?ja(a().filePath,e(f)):a().filePath),N=na(e(G));se(()=>{N.set(e(G))});const D=$a(l(),N),fe=ka(l(),N),J=Ia(l(),N),ne=Sa(l(),N),ft=Ca(l(),N),vt=co(l()),pt=Fa(l(),N),bt=Da(l(),N),me=Sr(l(),N),Me=Ta(l(),N),tt=Ea(l()),_e=ya(),Re=crypto.randomUUID(),Qt=Ar(Re),$t=`file-gutter:${crypto.randomUUID()}`,er=La(l(),$t),tr=Ma(l()),Xe=i(()=>re()?.worktreePath||re()?.repositoryPath||re()?.path||null),ze=i(Be),rr=io();se(()=>{e(ze)!==null&&e(ze)!==void 0&&rr?.markContentLoaded()});const t=i(ee),o=i(P),u=i(O),w=i(()=>e(u)?jo(e(u)):"generic"),$=i(()=>e(u)?lo(ae()):null);let E=j(0),V=!1;se(()=>{const r=Ee();if(!r||r.unavailable){V=!1;return}e($)&&!V&&(V=!0,ur(()=>Ht(E)))});const T=5,K=i(()=>(ye()??[]).slice(0,T)),L=i(be),he=i(oe),Pe=i(et),Ae=i(()=>e(o)?d.ui_saveIndicator_saving_tooltip():e(he)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let Ye=j(null),rt=j(la([])),Ge=j(null),kt=j(void 0),Vt=j(void 0),Fe=j(!0),gr=j(null);se(()=>{const r=a().data?.line,n=a().data?.jumpTimestamp;!r||n!==void 0&&n===e(Vt)||(c(Vt,n,!0),c(kt,{line:r},!0),c(Fe,!1))});const gt=i(()=>e(f)?Cr(a().filePath,e(ie)):null),It=i(()=>e(f)?!e(gt):!!(a().filePath&&(Ga(a().filePath)||e(Xe)&&Ja(a().filePath,e(Xe))))),St=i(()=>a().filePath&&e(Xe)?dr(a().filePath)?a().filePath:`${e(Xe)}/${a().filePath}`:null),xt=i(()=>!!a().filePath&&/\.pdf$/i.test(a().filePath)),Pt=i(()=>!!a().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(a().filePath)),it=i(()=>l()&&/^[A-Za-z0-9._-]+$/.test(l())?Cr(a().filePath,e(Xe)):null),Nr=i(()=>!e(f)&&e(it)?e(it).split("/").slice(0,-1).join("/"):void 0),ar=i(()=>e(xt)||e(Pt)?e(it):null),mr=i(()=>e(f)&&e(Pt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[a().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);se(()=>{if(!q()||!e(f)||!e(gt)||!e(mr))return;const r=crypto.randomUUID();return R.dispatch(Ur(Re,r,l(),e(gt),{gitRootId:e(f),mimeType:e(mr)})),()=>R.dispatch(Vr(Re,r))});let mt=j(!1);const Ct=i(()=>!!e(it)&&!e(t)&&(!e(Pt)||e(Ge)===e(it))),_r=i(()=>e(Ge)&&l()?`workspace-file://${l()}/${e(Ge).split("/").map(encodeURIComponent).join("/")}`:null),or=i(()=>a().filePath?ga(a().filePath):"plaintext"),hr=i(()=>e(or)==="markdown"),_t=i(()=>/\.html?$/i.test(a().filePath??""));let Ft=j(void 0);const zt=i(()=>e(Ft)?.source===e(ze)),wr=i(()=>e(hr)||e(_t)&&!(e(zt)&&e(Ft)?.document===null)),We=i(()=>e(wr)&&e(Fe));se(()=>{if(!q()||!e(_t)||!e(We)||e(L)||e(u))return;const r=e(ze);if(!(r===null||e(zt)))return fo(r,n=>{c(Ft,{source:r,document:n}),n===null&&c(Fe,!1)})}),se(()=>{e(_t)&&!e(We)&&a().filePath&&c(gr,a().filePath,!0)}),se(()=>{if(!e(_t)||!e(We)||!q()||!v())return;function r(n){const b=n.detail?.line;b&&(c(kt,{line:b},!0),c(Fe,!1))}return window.addEventListener("workspace:go-to-line",r),()=>window.removeEventListener("workspace:go-to-line",r)}),se(()=>{if(!q()||e(xt)||e(f))return;const r=e(ar),n=a().filePath,b=l(),S=a().id;if(c(Ge,null),!r||!n||!b)return;let le=!1;const ke=()=>!le&&l()===b&&a().id===S&&a().filePath===n;return(async()=>{let Z=!1;try{Z=(await Ua("file.stat",{workspaceId:b,path:r}))?.isFile===!0}catch{}if(!ke())return;if(Z){c(Ge,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){c(Ge,r,!0);return}const{candidates:He,truncated:Je}=await Ya(b,r);if(ke()){if(!Je&&He.length===1){R.dispatch(yr(b,n,He[0],S));return}c(Ge,r,!0)}})(),()=>{le=!0}});function Br(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const Dt=i(()=>e(y)||!a().filePath?null:U().find(r=>Br(r,a().filePath))??null),Hr=i(()=>!!e(Dt));se(()=>{if(e(y))return;const r=l(),n=a().filePath,b=e(Xe);return()=>{if(!r||!n)return;const S=lr.select(R.state,r,n);if(S?.kind!=="editable-text")return;const le=nr(S.localContent),ke=Sr.select(R.state,r,n),Z=dr(n)?n:b?`${b}/${n}`:null;ke&&Z&&R.dispatch($r(r,n,Z,le))}}),se(()=>{const r=a().filePath,n=e(St),b=l();if(e(E),!q())return;const S=!e(f)&&!!r&&dr(r)&&!e(Xe);r&&b&&!e(It)&&!e(Pt)&&!e(xt)&&!S&&(e(f)&&e(gt)&&e(G)?R.dispatch(kr(b,e(G),n??r,{gitRoot:{id:e(f),relativePath:e(gt)}})):R.dispatch(kr(b,r,n??r)))});function Or(){return e(ze)??""}function qr(r){e(y)||e(L)||!a().filePath||!l()||!e(St)||R.dispatch(Pa(l(),a().filePath,nr(r)))}function Kr(){if(e(y)||e(L)||!a().filePath||!e(St)||e(ze)===null||e(o))return;const r=lr.select(R.state,l(),a().filePath);r?.kind==="editable-text"&&R.dispatch($r(l(),a().filePath,e(St),nr(r.localContent)))}function Xr(r){const n=a().filePath;!n||!l()||(R.dispatch(xa(l(),n)),R.dispatch(yr(l(),n,r,a().id)))}se(()=>{const r=a().filePath,n=e(Dt);if(!r||!n){c(rt,[],!0);return}if(!q())return;const b=l(),S=crypto.randomUUID();return R.dispatch(va(b,$t,S,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{R.dispatch(pa(b,$t,S))}}),se(()=>{const r=B(),n=r?.result?.kind==="diffs"?r.result.chunks:[],b=n.find(S=>S.file===a().filePath)??n[0];c(rt,b?Za(b.chunks.map(S=>({oldStart:S.oldStart,oldLines:S.oldLines,newStart:S.newStart,newLines:S.newLines,lines:S.lines.map(le=>(le.type===Ir.Addition?"+":le.type===Ir.Deletion?"-":" ")+le.content)}))):[],!0)});function Yr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),b=ke=>oo(r,ao(ke),n);if(b("editor.save")){r.preventDefault(),e(he)&&!e(o)&&Kr();return}const S=b("editor.undo")?"undo":b("editor.redo")?"redo":b("editor.toggle-task-list")?"toggle-task-list":b("editor.copy")?"copy":b("editor.select-all")?"select-all":null;if(!S||e(y)&&S!=="copy"&&S!=="select-all")return;S!=="toggle-task-list"&&e(Ye)?.runShortcut(S)&&r.preventDefault()}function Gr(r){if(!a().filePath||!e(Dt))return;const n=r?.metaKey||r?.ctrlKey||!1,S=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;R.dispatch(ba(l(),e(Dt),{filePath:a().filePath,changeId:e(Dt).id,openInAdjacentPanel:n,sourcePanelId:S}))}async function At(){const r=e(it);if(!(e(y)||!r||!l()||!e(Ct)||e(mt))){c(mt,!0);try{const n=await Ra(l(),r,e(Xe));!n?.success&&!n?.canceled&&sr.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{sr.error(d.layout_fileTab_downloadFailed_error())}finally{c(mt,!1)}}}function Jr(){const r=e(St);if(e(y)||!a().filePath||!l()||!r)return;const n=ha(lr.select(R.state,l(),a().filePath));if(!n){sr.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}R.dispatch(wa(l(),a().filePath,{absolutePath:r,tabId:a().id,snapshot:n}))}se(()=>{if(!_e||!q())return;const r={isDirty:!e(y)&&e(he),isSaving:!e(y)&&e(o)};ur(()=>{_e.registerActions({display:qe,actions:Ve}),_e.registerState(r)})});var Zr={get tab(){return a()},set tab(r){a(r),ce()},get workspaceId(){return l()},set workspaceId(r){l(r),ce()},get isActive(){return q()},set isActive(r){q(r),ce()},get isPanelFocused(){return v()},set isPanelFocused(r){v(r),ce()},$set:Yt,$on:(r,n)=>Gt(_,r,n)},br=Ue();ut("keydown",Lr,r=>q()&&Yr(r));var Qr=ve(br);{var ea=r=>{var n=Ue(),b=ve(n);Mr(b,()=>a().filePath,S=>{var le=Ue(),ke=ve(le);{var Z=h=>{var p=Ao(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0);k(p),I(te=>{m(X,te),m(je,a().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(h,p)},He=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(gt)},get gitRootId(){return e(f)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Je=h=>{var p=Ue(),M=ve(p);{var X=te=>{var Ie=Tr(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_errorLoading_label()]),s(te,Ie)},z=te=>{qt(te,{get filePath(){return a().filePath},get sourceUrl(){return Le().url},allowDownload:!1})},je=te=>{var Ie=Wo(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_preparing_label()]),s(te,Ie)};Y(M,te=>{Le()?.error?te(X):Le()?.url?te(z,1):te(je,-1)})}s(h,p)},nt=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(ar)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Tt=h=>{var p=Tr(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.file_pdf_load_error()]),s(h,p)},Oe=h=>{{let p=i(()=>e(Ge)??a().filePath),M=i(()=>!e(y)&&e(Ct));qt(h,{get filePath(){return e(p)},get sourceUrl(){return e(_r)},onDownload:At,get allowDownload(){return e(M)},get downloading(){return e(mt)}})}},at=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)},ht=h=>{var p=Bo(),M=F(p);Ut(M,20,()=>[...Array(20).keys()],X=>X,(X,z)=>{var je=No(),te=F(je);Fr(te,{class:"h-3 w-8 shrink-0"});var Ie=g(te,2);Fr(Ie,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),k(je),s(X,je)}),k(M),k(p),s(h,p)},Et=h=>{{let p=i(()=>so(e($)));no(h,{get view(){return e(p)}})}},Lt=h=>{var p=Ko(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=Q=>{var lt=Ho(),Ze=C(lt,!0);I(()=>m(Ze,e(u))),s(Q,lt)};Y(te,Q=>{e(w)==="generic"&&Q(Ie)})}var H=g(te,2);{var we=Q=>{var lt=qo(),Ze=ve(lt),Rt=C(Ze,!0),Wt=g(Ze,2);Ut(Wt,20,()=>e(K),wt=>wt,(wt,De)=>{var Se=Oo(),Ne=F(Se);Te(Ne,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Xr(De),children:(st,xr)=>{ot();var Pr=ct();I(()=>m(Pr,De)),s(st,Pr)},$$slots:{default:!0}}),k(Se),s(wt,Se)}),k(Wt),I(wt=>m(Rt,wt),[()=>d.layout_fileTab_didYouMean_label()]),s(Q,lt)};Y(H,Q=>{e(K).length>0&&Q(we)})}k(p),I(Q=>{m(X,Q),m(je,a().filePath)},[()=>Uo(e(w))]),s(h,p)},Mt=h=>{var p=Xo(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=H=>{{let we=i(()=>!e(Ct)||e(mt));Te(H,{variant:"secondary",size:"sm",onclick:At,get disabled(){return e(we)},children:(Q,lt)=>{ot();var Ze=ct();I(Rt=>m(Ze,Rt),[()=>d.layout_fileTab_downloadFile_label()]),s(Q,Ze)},$$slots:{default:!0}})}};Y(te,H=>{!e(y)&&e(it)&&H(Ie)})}k(p),I(H=>{m(X,H),m(je,a().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(h,p)},ir=h=>{const p=i(()=>a().filePath?.toLowerCase().endsWith(".svg"));var M=Ue(),X=ve(M);{var z=H=>{{let we=i(()=>a().filePath||""),Q=i(()=>!e(y)&&e(Ct));qt(H,{get filePath(){return e(we)},get fileContent(){return e(ze)},get language(){return e(or)},get isBinary(){return e(L)},onDownload:At,get allowDownload(){return e(Q)},get downloading(){return e(mt)}})}},je=H=>{var we=Yo(),Q=F(we);Qa(Q,{get content(){return e(ze)},get workspaceId(){return l()},get relativeMediaBase(){return e(Nr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),k(we),s(H,we)},te=H=>{var we=Qo(),Q=F(we);{var lt=De=>{var Se=Go();let Ne;var st=F(Se);Ce(st,()=>!e(We)),k(Se),I(()=>{Ne=Kt(Se,1,"size-full",null,Ne,{invisible:e(We)}),Se.inert=e(We)}),s(De,Se)};Y(Q,De=>{(!e(We)||e(gr)===a().filePath)&&De(lt)})}var Ze=g(Q,2);{var Rt=De=>{const Se=i(()=>e(We)&&e(zt));var Ne=Jo();let st;I(xr=>{Qe(Ne,"title",xr),Qe(Ne,"srcdoc",e(Ft).document),st=Kt(Ne,1,"absolute inset-0 block size-full border-0 bg-background",null,st,{invisible:!e(Se)}),Ne.inert=!e(Se)},[()=>d.ui_viewSettings_htmlPreview_label()]),s(De,Ne)};Y(Ze,De=>{e(Ft)?.document!=null&&De(Rt)})}var Wt=g(Ze,2);{var wt=De=>{var Se=Zo(),Ne=C(Se,!0);I(st=>m(Ne,st),[()=>d.layout_fileTab_preparing_label()]),s(De,Se)};Y(Wt,De=>{e(We)&&!e(zt)&&De(wt)})}k(we),s(H,we)},Ie=H=>{Ce(H,()=>!0)};Y(X,H=>{e(p)?H(z):e(hr)&&e(We)?H(je,1):e(_t)?H(te,2):H(Ie,-1)})}s(h,M)},ra=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)};Y(ke,h=>{e(It)?h(Z):e(f)&&e(xt)&&e(gt)?h(He,1):e(f)&&e(Pt)?h(Je,2):e(xt)&&e(ar)?h(nt,3):e(xt)?h(Tt,4):e(_r)?h(Oe,5):e(Pt)?h(at,6):e(t)&&(!e(_t)||e(ze)===null)?h(ht,7):e($)?h(Et,8):e(u)?h(Lt,9):e(L)?h(Mt,10):e(ze)!==null?h(ir,11):h(ra,-1)})}s(S,le)}),s(r,n)};Y(Qr,r=>{a().filePath&&r(ea)})}s(A,br);var ta=Zt(Zr);return $e(),ta}export{ei as default};
@@ -1 +1 @@
1
- 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{m as ce,N as le,T as de,d as ue,o as pe,w as ge}from"./BmTMWrby.js";import"./3SdAC2_C.js";import{bm as n,_ as he}from"./C0QTy0Sy.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import"./DCRuihKm.js";import{c as V}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{Jv as a,uA as fe,nY as y,nX as k,mp as Se,yX as C,yY as N,yV as be,yU as me,yW as ve,rT as _e,c8 as Ae,c7 as ye,cm as ke,cl as we,n_ as w}from"./tr-2J8Mf.js";import{cU as Ee,cJ as Ce,bJ as Pe,cl as Re,cB as Me,cn as Te,cS as Q,aJ as Ie,c3 as Fe,c_ as De}from"./BaujsV9k.js";import{a as Le,i as Oe}from"./CL3a4Hm1.js";import{i as D}from"./BBWuirRW.js";import{n as xe}from"./C9dAybnM.js";import{x as We,aO as Ne,c as Be,aD as Ge,B as Ve,y as Ue,z as He}from"./DKHY8q_S.js";import{a0 as qe,K as Y,a1 as $e,ay as U,Z as ze,a3 as je,L as Ke,$ as Ze,aA as Qe,x as Ye}from"./DCK8dPAL.js";const Je=5,L=120,Xe=4e3,j=.2,et=.8;function tt(e,t,r=Je){const s=e.length>0?t/(2*e.length):0,i=Xe/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 $=0;for(let F=f;F<b;F+=1)$+=e[F]??0;const z=($/(b-f)/255-j)/(et-j);return Number.isFinite(z)?Math.min(1,Math.max(0,z)):0})}const rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:le,TOAST_COUNTDOWN_CLASS:de,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:ue,notify:ce,notifyMetadata:pe,withToastCountdown:ge},Symbol.toStringTag,{value:"Module"})),Dr=a.createSelector(e=>Ee.select(e)?.capabilities.gitlabCheckout===!0),Lr=a.createSelector(e=>e.gitlabAuth.host),Or=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),xr=a.createSelector(e=>fe(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Nr=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Br=a.createSelector(e=>e.gitlabAuth.isConfigured),Gr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Vr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Ur=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Hr=a.createSelector(e=>e.gitlabAuth.user),qr=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const $r=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}],J=new Set(["pr-reviewer"]),zr="developer";function jr(e){return A.find(t=>t.id===e)}const st=a.createSelector(e=>e.githubAuth.mutationRequestId),it=a.createSelector(e=>e.githubAuth.callbacksCancelled),at=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),nt=a.createSelector(e=>e.githubAuth.statusSettled===!0),ot=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),ct=a.createSelector(e=>e.githubAuth.user),lt=a.createSelector(e=>e.githubAuth.isAuthenticating),dt=a.createSelector(e=>e.githubAuth.deviceFlow),ut=a.createSelector(e=>e.githubAuth.error),Kr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:it,selectGitHubAuthDeviceFlow:dt,selectGitHubAuthError:ut,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:lt,selectGitHubAuthIsDisconnecting:at,selectGitHubAuthMutationRequestId:st,selectGitHubAuthRequiresDaemonAuth:ot,selectGitHubAuthStatusSettled:nt,selectGitHubAuthUser:ct},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function pt(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)&&pt(e.modelOptions,r.modelOptions):!1}const Zr=a.createSelector(e=>e.specialists.bundledSpecialists),gt=a.createSelector(e=>e.specialists.fileSpecialists),Qr=a.createSelector(e=>y(gt.select(e))),Yr=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Jr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Xr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),es=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ts=a.createSelector(e=>e.specialists.specialistsFolderPath),rs=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 O=a.createSelector((e,t)=>!(J.has(t)&&!X.select(e)));function ht(e,t){return t?e:e.filter(r=>!J.has(r.id))}function ft(e,t){return ht(e,t).filter(r=>!r.hidden)}function ss(e,t){return ft(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=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&O.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)&&O.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)&&O.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}),is=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]}),St=a.createSelector((e,t)=>{const r=k(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&&y(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}),as=a.createSelector((e,t)=>St.select(e,t)?.name??null),ns=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),os=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),cs=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ls=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 ds=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)}),us=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!k(e.specialists.fileSpecialists,t)),ps=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=k(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 k(e.specialists.fileSpecialists,t)}),gs=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}),hs=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=k(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}),fs=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 Ce.select(e,o,r);const l=Pe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=k(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:bt.select(e,t)}),bt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:qe.select(e)?Y.select(e):""}),Ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),bs=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Se),ms=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),x=V("Clipboard");async function vs(e){let t;if(Le())try{const r=await Oe("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,x.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 x.error("Browser clipboard write failed",r,{electronError:t}),r}throw x.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _s=a.createSelector(e=>e.directoryPicker.source??"daemon"),As=a.createSelector(e=>e.directoryPicker.listing),ys=a.createSelector(e=>e.directoryPicker.loading),ks=a.createSelector(e=>e.directoryPicker.error),ws=a.createSelector(e=>e.directoryPicker.pathError),Es=a.createSelector(e=>e.directoryPicker.createError),mt=V("WorkspaceValidation");async function Cs(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 vt(s)?At(s):yt(s,t,r)}function vt(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 _t(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 At(e){return _t(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 yt(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(mt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ps(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 Rs(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 Ms(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 Ts(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 Is(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 wt(e){return e===void 0||!kt.includes(e)}function Fs(e){return e.status==="restarting"?"restarting":wt(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 Et(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ds=a.createSelector(e=>e.voiceSettings.isLoading),Ls=a.createSelector(e=>e.voiceSettings.available),Os=a.createSelector(e=>e.voiceSettings.provider),xs=a.createSelector(e=>e.voiceSettings.engine),Ws=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Ns=a.createSelector(e=>e.voiceSettings.keyConfigured),Bs=a.createSelector(e=>e.voiceSettings.vocabulary),Gs=a.createSelector(e=>e.voiceSettings.openaiModel),Vs=a.createSelector(e=>e.voiceSettings.language),Us=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Hs=a.createSelector(e=>e.voiceSettings.inputDeviceId),qs=a.createSelector(e=>e.voiceSettings.inputDevices),$s=a.createSelector(e=>e.voiceSettings.busyProvider),zs=a.createSelector(e=>e.voiceSettings.error),js=a.createSelector(e=>Re.select(e)?"unavailable":Et(e.voiceSettings)),B="intent.voice.inputDevice";let G;function Ct(){if(G!==void 0)return G;try{const e=localStorage.getItem(B);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ks(e){G=e;try{e===null?localStorage.removeItem(B):localStorage.setItem(B,e)}catch{}}let R=null;function Zs(e){R=e}function Qs(){const e=R;return R=null,e}function Pt(){R=null}const Rt=300,Mt=300;class Tt{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??Rt,this.doublePressWindowMs=t.doublePressWindowMs??Mt,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 Ys(e){M=e}function Js(){const e=M;return M=null,e}function It(){M=null}const Ft=66;function Dt(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(tt(g,l.sampleRate))},Ft);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Lt=12e4,Ot=["audio/webm;codecs=opus","audio/webm"];function Xs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Wt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ot.find(e=>MediaRecorder.isTypeSupported(e))}class Nt{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??Lt,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=Wt(),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=Dt(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 Tt({onRecordStart:()=>{E&&Ut(E)},onRecordStop:e=>{ee(E,e)}});function ei(){return p!==null}function ti(){return p}function ri(e){E=e,_+=1,_===1&&I.keyDown()}function si(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Ut(e,t="key"){if(p!==null)return;It(),Pt();const r=new Nt({deviceId:Ct(),onLevels:s=>{p===r&&e.dispatch(me(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(N());return}e.dispatch(be({...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(ve({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(N())}})}function ee(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(N());return}m=t,r.stop()}function ii(){ee(null,Vt)}function ai(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ht=V("HardwareConsoleVoiceSetupToast"),qt="hardware-console-voice-setup";let W=null;function $t(){return W||(W=he(()=>Promise.resolve().then(()=>rt),void 0,import.meta.url).then(e=>e.notify)),W}function zt(){xe("/settings?tab=connections#voice").catch(e=>{Ht.error("Failed to open voice settings from setup toast",e)})}function jt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function ni(){$t().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:qt,action:jt()})})}const oi=a.createSelector(e=>e.externalEditors.selectedAction),Kt=a.createSelector(e=>e.externalEditors.editors),Zt=a.createSelector(e=>{const t=y(Kt.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))]}),ci=a.createSelector(e=>e.externalEditors.editorOrder??[]),li=a.createSelector(e=>e.externalEditors.loading),di=a.createSelector(e=>e.externalEditors.lastFetched),Qt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ui=a.createSelector((e,t)=>{if(!(t?Me.select(e,t):Te.select(e))||_e())return[];const s=Qt.select(e);return Zt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function pi(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 Yt=0;function Jt(e,t){const r=++Yt;return a.dispatch(ye(e,t,r)),r}function gi(e,t,r){a.dispatch(Ae(e,t,r))}async function te(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(ke({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??Jt(e,t)}))).status==="success"}finally{a.dispatch(we(i,o))}}async function hi(e,t,r,s,i){return te(e,t,{kind:"effort",effort:r,previous:s},i)}async function fi(e,t,r,s,i){return te(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Xt=a.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Si=a.createSelector((e,t)=>Xt.select(e,t).some(r=>r.status==="pending")),bi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ie.select(e,t),o=We.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Ne(l),g=c?Be(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&&!Fe.select(e,r)}});function er(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const mi=a.createSelector(e=>$e.select(e)?null:U.select(e)),tr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),vi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),_i=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===tr.select(e)),re=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:De.select(e)),se=a.createSelector((e,t)=>{if(!t)return Y.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 ze.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),ie=a.createSelector((e,t)=>{if(!t)return je.select(e);const r=q.select(e,t),s=se.select(e,t),i=S.select(e,t)?.readiness??{};return re.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ai=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return re.select(e,t).filter(i=>er(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),yi=a.createSelector((e,t)=>t?ie.select(e,t):Ke.select(e)),ki=a.createSelector((e,t)=>v.select(e,t)),wi=a.createSelector((e,t)=>t?!!S.select(e,t):Ze.select(e)),Ei=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=S.select(e,t)?.settings??[],s=se.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:""}),Ci=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):Ve.select(e)),Pi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Ue.select(e)),Ri=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):He.select(e)),Mi=a.createSelector((e,t,r)=>{if(!r)return Qe.select(e,t);const s=q.select(e,r),i=S.select(e,r);return ie.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&Ye(o,i?.readiness[o]?.authenticated))}),Ti=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),rr={},Ii=a.createSelector(e=>e.providerSettings?.profiles?.status??rr),Z={},sr=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Fi=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]}),Di=a.createSelector(e=>e.mcpSettings.loading),Li=a.createSelector(e=>e.mcpSettings.error),Oi=a.createSelector(e=>e.mcpSettings.mutationError??null),xi=a.createSelector(e=>e.mcpSettings.enabled),ir=a.createSelector(e=>e.mcpSettings.disabledServers),ar=a.createSelector(e=>e.mcpSettings.statusMap),nr=a.createSelector(e=>e.mcpSettings.toolsMap),or=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]]:[]}))}),cr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),Wi=a.createSelector((e,t)=>Object.keys(cr.select(e,t))),Ni=a.createSelector(e=>{const t=sr.select(e),r=ar.select(e),s=nr.select(e),i=ir.select(e),o=or.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 Bi=a.createSelector(e=>e.mcpSettings.lastImportedCount),Gi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Vi=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 lr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(lr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ur(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&&dr(t,i.idPattern));return s?{...s,id:t}:void 0}function Ui(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function pr(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 gr=new Set(T.flatMap(e=>e.route?[pr(e.route)]:[])),hr=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Hi(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 gr.has(r)?s?!!ur(s):!0:hr.some(i=>i.test(r))}const qi=["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"],fr=[{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}],$i=Object.fromEntries(fr.map(e=>[e.path,e.defaultValue]));export{Ri as $,Hi as A,Xs as B,Ct as C,zr as D,Jt as E,fr as F,J as G,_t as H,fi as I,gi as J,Et as K,ur as L,Rs as M,Ks as N,Si as O,Xt as P,bi as Q,Zr as R,A as S,es as T,yi as U,se as V,q as W,Ai as X,ie as Y,re as Z,Pi as _,Je as a,sr as a$,Ci as a0,Mi as a1,Ti as a2,wi as a3,Ei as a4,ki as a5,Jr as a6,rs as a7,Es as a8,ks as a9,qr as aA,Lr as aB,xr as aC,Gr as aD,Wr as aE,Br as aF,Or as aG,Hr as aH,Dr as aI,$r as aJ,ps as aK,Qt as aL,Zt as aM,ui as aN,li as aO,ds as aP,us as aQ,di as aR,Vi as aS,Gi as aT,ir as aU,xi as aV,Li as aW,or as aX,Bi as aY,Di as aZ,Oi as a_,As as aa,ys as ab,ws as ac,_s as ad,ci as ae,ls as af,fs as ag,ns as ah,js as ai,os as aj,cs as ak,Qr as al,Xr as am,H as an,it as ao,dt as ap,ut as aq,X as ar,lt as as,at,st as au,ot as av,ct as aw,Nr as ax,Vr as ay,Ur as az,$i as b,Ni as b0,ar as b1,nr as b2,oi as b3,is as b4,Ii as b5,mi as b6,St as b7,bs as b8,ms as b9,Fi as bA,Zs as bB,Ys as bC,ni as bD,Ut as bE,ii as bF,Ms as bG,Ps as bH,Ts as bI,Cs as bJ,jt as bK,vs as bL,hs as ba,Ss as bb,as as bc,gs as bd,v as be,ts as bf,Yr as bg,$s as bh,xs as bi,Hs as bj,qs as bk,Ns as bl,Vs as bm,Gs as bn,Ws as bo,Os as bp,Ls as bq,zs as br,Ds as bs,Bs as bt,Us as bu,S as bv,tr as bw,_i as bx,vi as by,Wi as bz,qi as c,hi as d,ai as e,Pt as f,It as g,Qs as h,Js as i,ss as j,ft as k,ht as l,ti as m,Ui as n,Is as o,Fs as p,jr as q,Kr as r,ri as s,si as t,rt as u,wt as v,er as w,ei as x,pi as y,K as z};
1
+ 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{m as ce,N as le,T as de,d as ue,o as pe,w as ge}from"./DlUZpQ7U.js";import"./3SdAC2_C.js";import{bm as n,_ as he}from"./C0QTy0Sy.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import"./C2jYl_tm.js";import{c as V}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{Jv as a,uA as fe,nY as y,nX as k,mp as Se,yX as C,yY as N,yV as be,yU as me,yW as ve,rT as _e,c8 as Ae,c7 as ye,cm as ke,cl as we,n_ as w}from"./_LtUY0jS.js";import{cU as Ee,cJ as Ce,bJ as Pe,cl as Re,cB as Me,cn as Te,cS as Q,aJ as Ie,c3 as Fe,c_ as De}from"./Cppy6ZYG.js";import{a as Le,i as Oe}from"./CL3a4Hm1.js";import{i as D}from"./BBWuirRW.js";import{n as xe}from"./Cxb8aRlA.js";import{x as We,aO as Ne,c as Be,aD as Ge,B as Ve,y as Ue,z as He}from"./CTP1vzdq.js";import{a0 as qe,K as Y,a1 as $e,ay as U,Z as ze,a3 as je,L as Ke,$ as Ze,aA as Qe,x as Ye}from"./DkME16PR.js";const Je=5,L=120,Xe=4e3,j=.2,et=.8;function tt(e,t,r=Je){const s=e.length>0?t/(2*e.length):0,i=Xe/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 $=0;for(let F=f;F<b;F+=1)$+=e[F]??0;const z=($/(b-f)/255-j)/(et-j);return Number.isFinite(z)?Math.min(1,Math.max(0,z)):0})}const rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:le,TOAST_COUNTDOWN_CLASS:de,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:ue,notify:ce,notifyMetadata:pe,withToastCountdown:ge},Symbol.toStringTag,{value:"Module"})),Dr=a.createSelector(e=>Ee.select(e)?.capabilities.gitlabCheckout===!0),Lr=a.createSelector(e=>e.gitlabAuth.host),Or=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),xr=a.createSelector(e=>fe(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Nr=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Br=a.createSelector(e=>e.gitlabAuth.isConfigured),Gr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Vr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Ur=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Hr=a.createSelector(e=>e.gitlabAuth.user),qr=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const $r=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}],J=new Set(["pr-reviewer"]),zr="developer";function jr(e){return A.find(t=>t.id===e)}const st=a.createSelector(e=>e.githubAuth.mutationRequestId),it=a.createSelector(e=>e.githubAuth.callbacksCancelled),at=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),nt=a.createSelector(e=>e.githubAuth.statusSettled===!0),ot=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),ct=a.createSelector(e=>e.githubAuth.user),lt=a.createSelector(e=>e.githubAuth.isAuthenticating),dt=a.createSelector(e=>e.githubAuth.deviceFlow),ut=a.createSelector(e=>e.githubAuth.error),Kr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:it,selectGitHubAuthDeviceFlow:dt,selectGitHubAuthError:ut,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:lt,selectGitHubAuthIsDisconnecting:at,selectGitHubAuthMutationRequestId:st,selectGitHubAuthRequiresDaemonAuth:ot,selectGitHubAuthStatusSettled:nt,selectGitHubAuthUser:ct},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function pt(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)&&pt(e.modelOptions,r.modelOptions):!1}const Zr=a.createSelector(e=>e.specialists.bundledSpecialists),gt=a.createSelector(e=>e.specialists.fileSpecialists),Qr=a.createSelector(e=>y(gt.select(e))),Yr=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Jr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Xr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),es=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ts=a.createSelector(e=>e.specialists.specialistsFolderPath),rs=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 O=a.createSelector((e,t)=>!(J.has(t)&&!X.select(e)));function ht(e,t){return t?e:e.filter(r=>!J.has(r.id))}function ft(e,t){return ht(e,t).filter(r=>!r.hidden)}function ss(e,t){return ft(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=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&O.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)&&O.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)&&O.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}),is=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]}),St=a.createSelector((e,t)=>{const r=k(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&&y(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}),as=a.createSelector((e,t)=>St.select(e,t)?.name??null),ns=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),os=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),cs=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ls=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 ds=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)}),us=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!k(e.specialists.fileSpecialists,t)),ps=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=k(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 k(e.specialists.fileSpecialists,t)}),gs=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}),hs=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=k(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}),fs=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 Ce.select(e,o,r);const l=Pe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=k(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:bt.select(e,t)}),bt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:qe.select(e)?Y.select(e):""}),Ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),bs=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Se),ms=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),x=V("Clipboard");async function vs(e){let t;if(Le())try{const r=await Oe("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,x.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 x.error("Browser clipboard write failed",r,{electronError:t}),r}throw x.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _s=a.createSelector(e=>e.directoryPicker.source??"daemon"),As=a.createSelector(e=>e.directoryPicker.listing),ys=a.createSelector(e=>e.directoryPicker.loading),ks=a.createSelector(e=>e.directoryPicker.error),ws=a.createSelector(e=>e.directoryPicker.pathError),Es=a.createSelector(e=>e.directoryPicker.createError),mt=V("WorkspaceValidation");async function Cs(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 vt(s)?At(s):yt(s,t,r)}function vt(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 _t(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 At(e){return _t(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 yt(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(mt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ps(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 Rs(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 Ms(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 Ts(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 Is(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 wt(e){return e===void 0||!kt.includes(e)}function Fs(e){return e.status==="restarting"?"restarting":wt(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 Et(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ds=a.createSelector(e=>e.voiceSettings.isLoading),Ls=a.createSelector(e=>e.voiceSettings.available),Os=a.createSelector(e=>e.voiceSettings.provider),xs=a.createSelector(e=>e.voiceSettings.engine),Ws=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Ns=a.createSelector(e=>e.voiceSettings.keyConfigured),Bs=a.createSelector(e=>e.voiceSettings.vocabulary),Gs=a.createSelector(e=>e.voiceSettings.openaiModel),Vs=a.createSelector(e=>e.voiceSettings.language),Us=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Hs=a.createSelector(e=>e.voiceSettings.inputDeviceId),qs=a.createSelector(e=>e.voiceSettings.inputDevices),$s=a.createSelector(e=>e.voiceSettings.busyProvider),zs=a.createSelector(e=>e.voiceSettings.error),js=a.createSelector(e=>Re.select(e)?"unavailable":Et(e.voiceSettings)),B="intent.voice.inputDevice";let G;function Ct(){if(G!==void 0)return G;try{const e=localStorage.getItem(B);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ks(e){G=e;try{e===null?localStorage.removeItem(B):localStorage.setItem(B,e)}catch{}}let R=null;function Zs(e){R=e}function Qs(){const e=R;return R=null,e}function Pt(){R=null}const Rt=300,Mt=300;class Tt{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??Rt,this.doublePressWindowMs=t.doublePressWindowMs??Mt,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 Ys(e){M=e}function Js(){const e=M;return M=null,e}function It(){M=null}const Ft=66;function Dt(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(tt(g,l.sampleRate))},Ft);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Lt=12e4,Ot=["audio/webm;codecs=opus","audio/webm"];function Xs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Wt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ot.find(e=>MediaRecorder.isTypeSupported(e))}class Nt{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??Lt,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=Wt(),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=Dt(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 Tt({onRecordStart:()=>{E&&Ut(E)},onRecordStop:e=>{ee(E,e)}});function ei(){return p!==null}function ti(){return p}function ri(e){E=e,_+=1,_===1&&I.keyDown()}function si(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Ut(e,t="key"){if(p!==null)return;It(),Pt();const r=new Nt({deviceId:Ct(),onLevels:s=>{p===r&&e.dispatch(me(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(N());return}e.dispatch(be({...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(ve({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(N())}})}function ee(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(N());return}m=t,r.stop()}function ii(){ee(null,Vt)}function ai(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ht=V("HardwareConsoleVoiceSetupToast"),qt="hardware-console-voice-setup";let W=null;function $t(){return W||(W=he(()=>Promise.resolve().then(()=>rt),void 0,import.meta.url).then(e=>e.notify)),W}function zt(){xe("/settings?tab=connections#voice").catch(e=>{Ht.error("Failed to open voice settings from setup toast",e)})}function jt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function ni(){$t().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:qt,action:jt()})})}const oi=a.createSelector(e=>e.externalEditors.selectedAction),Kt=a.createSelector(e=>e.externalEditors.editors),Zt=a.createSelector(e=>{const t=y(Kt.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))]}),ci=a.createSelector(e=>e.externalEditors.editorOrder??[]),li=a.createSelector(e=>e.externalEditors.loading),di=a.createSelector(e=>e.externalEditors.lastFetched),Qt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ui=a.createSelector((e,t)=>{if(!(t?Me.select(e,t):Te.select(e))||_e())return[];const s=Qt.select(e);return Zt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function pi(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 Yt=0;function Jt(e,t){const r=++Yt;return a.dispatch(ye(e,t,r)),r}function gi(e,t,r){a.dispatch(Ae(e,t,r))}async function te(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(ke({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??Jt(e,t)}))).status==="success"}finally{a.dispatch(we(i,o))}}async function hi(e,t,r,s,i){return te(e,t,{kind:"effort",effort:r,previous:s},i)}async function fi(e,t,r,s,i){return te(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Xt=a.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Si=a.createSelector((e,t)=>Xt.select(e,t).some(r=>r.status==="pending")),bi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ie.select(e,t),o=We.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Ne(l),g=c?Be(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&&!Fe.select(e,r)}});function er(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const mi=a.createSelector(e=>$e.select(e)?null:U.select(e)),tr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),vi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),_i=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===tr.select(e)),re=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:De.select(e)),se=a.createSelector((e,t)=>{if(!t)return Y.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 ze.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),ie=a.createSelector((e,t)=>{if(!t)return je.select(e);const r=q.select(e,t),s=se.select(e,t),i=S.select(e,t)?.readiness??{};return re.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ai=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return re.select(e,t).filter(i=>er(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),yi=a.createSelector((e,t)=>t?ie.select(e,t):Ke.select(e)),ki=a.createSelector((e,t)=>v.select(e,t)),wi=a.createSelector((e,t)=>t?!!S.select(e,t):Ze.select(e)),Ei=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=S.select(e,t)?.settings??[],s=se.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:""}),Ci=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):Ve.select(e)),Pi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Ue.select(e)),Ri=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):He.select(e)),Mi=a.createSelector((e,t,r)=>{if(!r)return Qe.select(e,t);const s=q.select(e,r),i=S.select(e,r);return ie.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&Ye(o,i?.readiness[o]?.authenticated))}),Ti=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),rr={},Ii=a.createSelector(e=>e.providerSettings?.profiles?.status??rr),Z={},sr=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Fi=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]}),Di=a.createSelector(e=>e.mcpSettings.loading),Li=a.createSelector(e=>e.mcpSettings.error),Oi=a.createSelector(e=>e.mcpSettings.mutationError??null),xi=a.createSelector(e=>e.mcpSettings.enabled),ir=a.createSelector(e=>e.mcpSettings.disabledServers),ar=a.createSelector(e=>e.mcpSettings.statusMap),nr=a.createSelector(e=>e.mcpSettings.toolsMap),or=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]]:[]}))}),cr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),Wi=a.createSelector((e,t)=>Object.keys(cr.select(e,t))),Ni=a.createSelector(e=>{const t=sr.select(e),r=ar.select(e),s=nr.select(e),i=ir.select(e),o=or.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 Bi=a.createSelector(e=>e.mcpSettings.lastImportedCount),Gi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Vi=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 lr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(lr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ur(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&&dr(t,i.idPattern));return s?{...s,id:t}:void 0}function Ui(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function pr(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 gr=new Set(T.flatMap(e=>e.route?[pr(e.route)]:[])),hr=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Hi(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 gr.has(r)?s?!!ur(s):!0:hr.some(i=>i.test(r))}const qi=["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"],fr=[{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}],$i=Object.fromEntries(fr.map(e=>[e.path,e.defaultValue]));export{Ri as $,Hi as A,Xs as B,Ct as C,zr as D,Jt as E,fr as F,J as G,_t as H,fi as I,gi as J,Et as K,ur as L,Rs as M,Ks as N,Si as O,Xt as P,bi as Q,Zr as R,A as S,es as T,yi as U,se as V,q as W,Ai as X,ie as Y,re as Z,Pi as _,Je as a,sr as a$,Ci as a0,Mi as a1,Ti as a2,wi as a3,Ei as a4,ki as a5,Jr as a6,rs as a7,Es as a8,ks as a9,qr as aA,Lr as aB,xr as aC,Gr as aD,Wr as aE,Br as aF,Or as aG,Hr as aH,Dr as aI,$r as aJ,ps as aK,Qt as aL,Zt as aM,ui as aN,li as aO,ds as aP,us as aQ,di as aR,Vi as aS,Gi as aT,ir as aU,xi as aV,Li as aW,or as aX,Bi as aY,Di as aZ,Oi as a_,As as aa,ys as ab,ws as ac,_s as ad,ci as ae,ls as af,fs as ag,ns as ah,js as ai,os as aj,cs as ak,Qr as al,Xr as am,H as an,it as ao,dt as ap,ut as aq,X as ar,lt as as,at,st as au,ot as av,ct as aw,Nr as ax,Vr as ay,Ur as az,$i as b,Ni as b0,ar as b1,nr as b2,oi as b3,is as b4,Ii as b5,mi as b6,St as b7,bs as b8,ms as b9,Fi as bA,Zs as bB,Ys as bC,ni as bD,Ut as bE,ii as bF,Ms as bG,Ps as bH,Ts as bI,Cs as bJ,jt as bK,vs as bL,hs as ba,Ss as bb,as as bc,gs as bd,v as be,ts as bf,Yr as bg,$s as bh,xs as bi,Hs as bj,qs as bk,Ns as bl,Vs as bm,Gs as bn,Ws as bo,Os as bp,Ls as bq,zs as br,Ds as bs,Bs as bt,Us as bu,S as bv,tr as bw,_i as bx,vi as by,Wi as bz,qi as c,hi as d,ai as e,Pt as f,It as g,Qs as h,Js as i,ss as j,ft as k,ht as l,ti as m,Ui as n,Is as o,Fs as p,jr as q,Kr as r,ri as s,si as t,rt as u,wt as v,er as w,ei as x,pi as y,K as z};
@@ -1 +1 @@
1
- import"./3SdAC2_C.js";import{p as r}from"./BTv8uh2C.js";const t={get error(){return r.error},get params(){return r.params},get state(){return r.state},get status(){return r.status},get url(){return r.url}},s=t;export{s as p};
1
+ import"./3SdAC2_C.js";import{p as r}from"./xGj0i83D.js";const t={get error(){return r.error},get params(){return r.params},get state(){return r.state},get status(){return r.status},get url(){return r.url}},s=t;export{s as p};
@@ -1 +1 @@
1
- import{Jv as o,mh as L,nX as E,nA as C,JA as W}from"./tr-2J8Mf.js";import{w as z}from"./Dms_DO28.js";import{dH as H,dL as f}from"./BaujsV9k.js";const a=o.createSelector((t,e)=>t.fileExplorer.byWorkspaceId[e]??L),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),M=o.createSelector((t,e)=>a.select(t,e).isLoading),R=o.createSelector((t,e)=>a.select(t,e).isInitialized),q=o.createSelector((t,e)=>a.select(t,e).error),B=o.createSelector((t,e)=>a.select(t,e).fileCount),K=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||""}),O=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 V=o.createSelector((t,e,s)=>a.select(t,e).expandedPaths.includes(s)),X=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),v=C(s.nodes,n.children,p,y),{agentFileEdits:I,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 v.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=I[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{q as a,B as b,K as c,O as d,R as e,M as f,J as g,G as h,D as i,a as j,U as k,Q as l,V as m,X as n,T as o,g as s};
1
+ import{Jv as o,mh as L,nX as E,nA as C,JA as W}from"./_LtUY0jS.js";import{w as z}from"./Dms_DO28.js";import{dH as H,dL as f}from"./Cppy6ZYG.js";const a=o.createSelector((t,e)=>t.fileExplorer.byWorkspaceId[e]??L),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),M=o.createSelector((t,e)=>a.select(t,e).isLoading),R=o.createSelector((t,e)=>a.select(t,e).isInitialized),q=o.createSelector((t,e)=>a.select(t,e).error),B=o.createSelector((t,e)=>a.select(t,e).fileCount),K=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||""}),O=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 V=o.createSelector((t,e,s)=>a.select(t,e).expandedPaths.includes(s)),X=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),v=C(s.nodes,n.children,p,y),{agentFileEdits:I,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 v.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=I[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{q as a,B as b,K as c,O as d,R as e,M as f,J as g,G as h,D as i,a as j,U as k,Q as l,V as m,X as n,T as o,g as s};
@@ -1 +1 @@
1
- import{Jv as s}from"./tr-2J8Mf.js";import{bm as r}from"./C0QTy0Sy.js";import{l as t,m as c}from"./CE7dsja4.js";const u=s.createSelector((a,e)=>e?a.workspaceCreateProgress.byProgressId[e]??null:null);function o(a){const e=a?.match(/\((\d+)\/(\d+)\)/);return e?{current:Number(e[1]),total:Number(e[2])}:null}function n(a){const e=a?.match(/^Updating (\S+) from (\S+?)(?:\.\.\.|…)?$/);return e?{base:e[1],remote:e[2]}:null}function i(a){const e=a?.match(/^Starting agent on (.+?)(?:\.\.\.|…)$/);return e?e[1]:null}function _(a){switch(a.phase){case"cache":return r.workspace_compactInitializer_progressCache_label();case"base-refresh":{const e=n(a.message);return e?r.workspace_compactInitializer_progressBaseRefresh_label(e):r.workspace_compactInitializer_progressBaseRefreshGeneric_label()}case"counting":return r.workspace_compactInitializer_progressCounting_label();case"compressing":return r.workspace_compactInitializer_progressCompressing_label();case"receiving":return r.workspace_compactInitializer_progressReceiving_label();case"resolving":return r.workspace_compactInitializer_progressResolving_label();case"checkout":return r.workspace_compactInitializer_progressCheckout_label();case"submodules":{const e=o(a.message);return e?r.workspace_compactInitializer_progressSubmodulesCounted_label({current:t(e.current),total:t(e.total)}):r.workspace_compactInitializer_progressSubmodules_label()}case"cow-copy":return r.workspace_compactInitializer_progressCowCopy_label();case"worktree":return r.workspace_compactInitializer_progressWorktree_label();case"finalizing":return r.workspace_compactInitializer_progressFinalizing_label();case"agent":{const e=i(a.message);return e?r.workspace_compactInitializer_progressAgent_label({machine:e}):r.workspace_compactInitializer_progressAgentGeneric_label()}case"complete":return r.workspace_compactInitializer_stageAlmostReady_label();case"starting":default:return r.workspace_compactInitializer_stagePreparing_label()}}function g(a){const e=Math.min(Math.max(a,0),100);return c(e/100,{style:"percent",maximumFractionDigits:0})}export{_ as c,g as f,u as s};
1
+ import{Jv as s}from"./_LtUY0jS.js";import{bm as r}from"./C0QTy0Sy.js";import{l as t,m as c}from"./CE7dsja4.js";const u=s.createSelector((a,e)=>e?a.workspaceCreateProgress.byProgressId[e]??null:null);function o(a){const e=a?.match(/\((\d+)\/(\d+)\)/);return e?{current:Number(e[1]),total:Number(e[2])}:null}function n(a){const e=a?.match(/^Updating (\S+) from (\S+?)(?:\.\.\.|…)?$/);return e?{base:e[1],remote:e[2]}:null}function i(a){const e=a?.match(/^Starting agent on (.+?)(?:\.\.\.|…)$/);return e?e[1]:null}function _(a){switch(a.phase){case"cache":return r.workspace_compactInitializer_progressCache_label();case"base-refresh":{const e=n(a.message);return e?r.workspace_compactInitializer_progressBaseRefresh_label(e):r.workspace_compactInitializer_progressBaseRefreshGeneric_label()}case"counting":return r.workspace_compactInitializer_progressCounting_label();case"compressing":return r.workspace_compactInitializer_progressCompressing_label();case"receiving":return r.workspace_compactInitializer_progressReceiving_label();case"resolving":return r.workspace_compactInitializer_progressResolving_label();case"checkout":return r.workspace_compactInitializer_progressCheckout_label();case"submodules":{const e=o(a.message);return e?r.workspace_compactInitializer_progressSubmodulesCounted_label({current:t(e.current),total:t(e.total)}):r.workspace_compactInitializer_progressSubmodules_label()}case"cow-copy":return r.workspace_compactInitializer_progressCowCopy_label();case"worktree":return r.workspace_compactInitializer_progressWorktree_label();case"finalizing":return r.workspace_compactInitializer_progressFinalizing_label();case"agent":{const e=i(a.message);return e?r.workspace_compactInitializer_progressAgent_label({machine:e}):r.workspace_compactInitializer_progressAgentGeneric_label()}case"complete":return r.workspace_compactInitializer_stageAlmostReady_label();case"starting":default:return r.workspace_compactInitializer_stagePreparing_label()}}function g(a){const e=Math.min(Math.max(a,0),100);return c(e/100,{style:"percent",maximumFractionDigits:0})}export{_ as c,g as f,u as s};
@@ -1 +1 @@
1
- import{bo as z,bs as I,a7 as O,ay as x,W as y,aD as S,a5 as Q,bf as j,bA as q,bn as E,c9 as G,aA as r,aB as J}from"./3SdAC2_C.js";import{t as K,bo as a,bw as L,b as M,bp as N}from"./C0QTy0Sy.js";import{b as R}from"./7UPrdiE9.js";import"./QeBH-DWE.js";import{i as U}from"./bhKPSdq4.js";import{t as w}from"./CrD0jtXE.js";import{a as V}from"./BP5uGGO_.js";import{az as T,av as n,aQ as X}from"./FzlZUztb.js";import{F as Y}from"./CDjpuJh0.js";var Z=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]),$=J("<button><!></button>");function A(v,t){const _=z();if(new.target)return K({component:A,...v});I(t,!0);let p=a(t,"children",7),l=a(t,"child",7),i=a(t,"id",23,()=>T(_)),d=a(t,"ref",15,null),c=a(t,"type",7,"button"),f=a(t,"disabled",7,!1),u=a(t,"openOnHover",7,!1),g=a(t,"openDelay",7,700),m=a(t,"closeDelay",7,300),B=N(t,Z);const h=V.create({id:n(()=>i()),ref:n(()=>d(),e=>d(e)),disabled:n(()=>!!f()),openOnHover:n(()=>u()),openDelay:n(()=>g()),closeDelay:n(()=>m())}),D=G(()=>X(B,h.props,{type:c()}));var C={get children(){return p()},set children(e){p(e),r()},get child(){return l()},set child(e){l(e),r()},get id(){return i()},set id(e=T(_)){i(e),r()},get ref(){return d()},set ref(e=null){d(e),r()},get type(){return c()},set type(e="button"){c(e),r()},get disabled(){return f()},set disabled(e=!1){f(e),r()},get openOnHover(){return u()},set openOnHover(e=!1){u(e),r()},get openDelay(){return g()},set openDelay(e=700){g(e),r()},get closeDelay(){return m()},set closeDelay(e=300){m(e),r()},$set:L,$on:(e,P)=>M(t,e,P)};return Y(v,{get id(){return i()},get ref(){return h.opts.ref},children:(e,P)=>{var H=O(),F=x(H);{var W=s=>{var o=O(),b=x(o);w(b,l,()=>({props:S(D)})),y(s,o)},k=s=>{var o=$();R(o,()=>({...S(D)}));var b=Q(o);w(b,()=>p()??j),q(o),y(s,o)};U(F,s=>{l()?s(W):s(k,-1)})}y(e,H)},$$slots:{default:!0}}),E(C)}const de=A;export{A as P,de as T};
1
+ import{bo as z,bs as I,a7 as O,ay as x,W as y,aD as S,a5 as Q,bf as j,bA as q,bn as E,c9 as G,aA as r,aB as J}from"./3SdAC2_C.js";import{t as K,bo as a,bw as L,b as M,bp as N}from"./C0QTy0Sy.js";import{b as R}from"./7UPrdiE9.js";import"./Dhy-QJgd.js";import{i as U}from"./bhKPSdq4.js";import{t as w}from"./CrD0jtXE.js";import{a as V}from"./DHLXX1td.js";import{az as T,av as n,aQ as X}from"./CttA-M7l.js";import{F as Y}from"./c6a4q1y9.js";var Z=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]),$=J("<button><!></button>");function A(v,t){const _=z();if(new.target)return K({component:A,...v});I(t,!0);let p=a(t,"children",7),l=a(t,"child",7),i=a(t,"id",23,()=>T(_)),d=a(t,"ref",15,null),c=a(t,"type",7,"button"),f=a(t,"disabled",7,!1),u=a(t,"openOnHover",7,!1),g=a(t,"openDelay",7,700),m=a(t,"closeDelay",7,300),B=N(t,Z);const h=V.create({id:n(()=>i()),ref:n(()=>d(),e=>d(e)),disabled:n(()=>!!f()),openOnHover:n(()=>u()),openDelay:n(()=>g()),closeDelay:n(()=>m())}),D=G(()=>X(B,h.props,{type:c()}));var C={get children(){return p()},set children(e){p(e),r()},get child(){return l()},set child(e){l(e),r()},get id(){return i()},set id(e=T(_)){i(e),r()},get ref(){return d()},set ref(e=null){d(e),r()},get type(){return c()},set type(e="button"){c(e),r()},get disabled(){return f()},set disabled(e=!1){f(e),r()},get openOnHover(){return u()},set openOnHover(e=!1){u(e),r()},get openDelay(){return g()},set openDelay(e=700){g(e),r()},get closeDelay(){return m()},set closeDelay(e=300){m(e),r()},$set:L,$on:(e,P)=>M(t,e,P)};return Y(v,{get id(){return i()},get ref(){return h.opts.ref},children:(e,P)=>{var H=O(),F=x(H);{var W=s=>{var o=O(),b=x(o);w(b,l,()=>({props:S(D)})),y(s,o)},k=s=>{var o=$();R(o,()=>({...S(D)}));var b=Q(o);w(b,()=>p()??j),q(o),y(s,o)};U(F,s=>{l()?s(W):s(k,-1)})}y(e,H)},$$slots:{default:!0}}),E(C)}const de=A;export{A as P,de as T};
@@ -1,4 +1,4 @@
1
- import{k as qa,s as fa}from"./wqIK2bns.js";import{p as ma,g as Ct,I as Wa,X as Ka,e as Nn}from"./B6S6VNu7.js";import{aB as Qa,cW as Ga,A as Va,a_ as xn,bZ as Xa,v as Ya}from"./BqRWw-wJ.js";import{bm as c,t as Pt,bo as w,bw as Tt,b as Rt,bq as qn,bs as Re,br as Ja}from"./C0QTy0Sy.js";import{bo as Wn,bs as Ot,a5 as O,bl as U,bS as b,bA as $,b_ as x,aD as e,W as l,ay as H,a7 as Oe,bO as L,bn as Lt,c9 as u,aA as k,aB as _,ca as ze,bH as h,b$ as Kt,bV as le,cd as Mt,br as va,be as un,c5 as Za,bi as En,bj as er,bf as hn,am as ta,ax as na,ai as tr,aj as nr,c0 as ar}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{t as _a}from"./CrD0jtXE.js";import{e as rr}from"./BFEzojY2.js";import{s as q,g as en,f as ve,b as sr}from"./7UPrdiE9.js";import{a as or,n as ha}from"./DLwWVKiF.js";import{r as ir,o as lr,A as aa,L as dr}from"./BNVrbjR5.js";import{t as Dn}from"./DAsc1V4f.js";import{R as ra}from"./BmTMWrby.js";import{I as ba}from"./BAKPnd3w.js";import"./A9niI_uA.js";import{aO as wn,cN as ur,ax as cr,aM as pr,cH as gr,cI as fr,as as mr,au as vr,aC as _r,aI as hr,s as br,O as wr,e8 as kr,X as xr,cy as yr,c4 as $r}from"./BaujsV9k.js";import{Jv as J,cp as zn,cn as wa,cq as kn,ru as Ar,DU as Sr,fU as ka,DZ as Ir,bE as Cr,A3 as Pr,mO as sa,uq as Tr,ct as Rr,u$ as oa,nK as Or,DE as Lr,DX as Nr,cb as Er}from"./tr-2J8Mf.js";import{A as Dr,b as Mr}from"./BYq9VtBF.js";import{y as Fr}from"./Bqd7fdCF.js";import{l as zr}from"./BcpfdNy8.js";import{f as ia}from"./KEaRLIGy.js";import{h as Br,g as jr}from"./DA5opfEp.js";import{o as Hr,S as Ur}from"./CLkfOjAo.js";import"./CJ4Z96pe.js";import{ae as qr,ah as Wr,f as Mn,a1 as Kr}from"./FzlZUztb.js";import{h as Qr,F as la}from"./DCRuihKm.js";import"./lJeex2Gh.js";import{C as Gr,k as Vr,j as Xr,i as Yr}from"./fiz8N_zQ.js";import{L as Jr}from"./CmrjfWYI.js";import{c as de}from"./CUkDMZwP.js";import{c as Bn,b as da,d as jn,a as Hn,A as xa}from"./GuiAAF9e.js";import{l as Wt,b as Zr}from"./CE7dsja4.js";import{F as es,bc as ts}from"./cfdblcWY.js";import{D as ns}from"./C4JbSg3f.js";import{b as as}from"./No1eCFy3.js";import{T as rs}from"./CRZZ_hOy.js";import"./BWYuMy_r.js";import{cl as ya,cP as ss,cO as os,bR as is,M as ls,F as yn,b5 as ds,au as us,aK as cs,aG as ps,cT as gs,be as fs,aA as ms,aL as vs,b1 as _s,ah as ua,a8 as hs,c6 as bs,ag as ws,cF as ks,an as xs,cS as ys,aD as $s}from"./U9jJmfYa.js";import{b as As}from"./Dn334wJv.js";import"./QeBH-DWE.js";import{S as bn}from"./tZyAiGvb.js";import{E as Ss}from"./c5QZsH9t.js";import"./Bsh6nUhU.js";import{f as Is}from"./DvUGkiYP.js";import{P as Cs}from"./D51XIZYq.js";import{b as Ps,P as Ts}from"./BP5uGGO_.js";import{h as Rs,H as Os,g as Ls}from"./eElW3aeh.js";const Ns=80,Es=10,Ds=new Qa(Ga,{renderer:{html({text:a}){return Va(a)},image({tokens:a}){return this.parser.parseInline(a)}}});function Kn(a){const n=document.createElement("template");n.innerHTML=Ds.parseInline(a,{async:!1});for(const o of n.content.querySelectorAll("br"))o.replaceWith(" ");return(n.content.textContent??"").replace(/\s+/g," ").trim()}function Ft(a){return a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`+([^`]*?)`+/g,"$1").replace(/<[^>]+>/g,"").replace(/\\([\\`*_[\]{}()#+\-.!>])/g,"$1").replace(/[*~]/g,"").replace(/(^|[^A-Za-z0-9])_+/g,"$1").replace(/_+([^A-Za-z0-9]|$)/g,"$1").replace(/\s+/g," ").trim()}function Un(a,n){return a.slice(n).replace(/^(?:[ \t]*(?:\r\n|\n|\r))+/,"")}function Sn(a,n){return!n||n.length>Ns||n.split(/\s+/).length>Es||/[.!?;]$/.test(n)?!1:!/^[ \t]*(?:[-+*][ \t]+|\d+[.)][ \t]+|>|```|~~~|\|)/.test(a)}function tl(a){const o=a.trim().match(/^\*\*([^\r\n]+)\*\*$/);if(!o)return null;const i=Ft(o[1]);return Sn(o[0],i)?i:null}function Qn(a,n=!1,o=!0){const i=a.match(/^(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",r=a.slice(i.length).match(/^\*\*([^\r\n]+)\*\*[ \t]*(?:(?:\r\n|\n|\r)|$)/);if(!r)return null;if(n){const v=r[1],f=v.match(/\\+$/)?.[0].length??0;if(v!==v.trim()||v.includes("**")||v.startsWith("*")||v.endsWith("*")||f%2!==0)return null}const p=Ft(r[1]);return Sn(r[0],p)?{title:n&&o?Kn(r[1]):p,body:Un(a,i.length+r[0].length)}:null}function ca(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0),d=i.heading?{body:i.body}:Qn(o,!0,!1);if(!d)return null;n.push(o.slice(0,o.length-d.body.length)),o=d.body}return n.length?n:null}function nl(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0,Kn),d=i.heading?{title:i.heading,body:i.body}:Qn(o,!0);if(!d)return null;n.push(d.title),o=d.body}return n.length?n:null}function al(a){const n=Fs(a),o=[];let i=a;for(n.heading&&(o.push({title:n.heading,body:""}),i=n.body);i;){const d=Qn(i);if(!d||d.body.length>=i.length)break;o.push({title:d.title,body:""}),i=d.body}if(o.length===0){const d=a.trim(),r=Ft(d);return!d.includes(`
1
+ import{k as qa,s as fa}from"./1VDAs3Ud.js";import{p as ma,g as Ct,I as Wa,X as Ka,e as Nn}from"./B6S6VNu7.js";import{aB as Qa,cW as Ga,A as Va,a_ as xn,bZ as Xa,v as Ya}from"./BfSTFUKA.js";import{bm as c,t as Pt,bo as w,bw as Tt,b as Rt,bq as qn,bs as Re,br as Ja}from"./C0QTy0Sy.js";import{bo as Wn,bs as Ot,a5 as O,bl as U,bS as b,bA as $,b_ as x,aD as e,W as l,ay as H,a7 as Oe,bO as L,bn as Lt,c9 as u,aA as k,aB as _,ca as ze,bH as h,b$ as Kt,bV as le,cd as Mt,br as va,be as un,c5 as Za,bi as En,bj as er,bf as hn,am as ta,ax as na,ai as tr,aj as nr,c0 as ar}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{t as _a}from"./CrD0jtXE.js";import{e as rr}from"./BFEzojY2.js";import{s as q,g as en,f as ve,b as sr}from"./7UPrdiE9.js";import{a as or,n as ha}from"./DLwWVKiF.js";import{r as ir,o as lr,A as aa,L as dr}from"./DgiZ-0Sp.js";import{t as Dn}from"./DAsc1V4f.js";import{R as ra}from"./DlUZpQ7U.js";import{I as ba}from"./B2w13ngc.js";import"./A9niI_uA.js";import{aO as wn,cN as ur,ax as cr,aM as pr,cH as gr,cI as fr,as as mr,au as vr,aC as _r,aI as hr,s as br,O as wr,e8 as kr,X as xr,cy as yr,c4 as $r}from"./Cppy6ZYG.js";import{Jv as J,cp as zn,cn as wa,cq as kn,ru as Ar,DU as Sr,fU as ka,DZ as Ir,bE as Cr,A3 as Pr,mO as sa,uq as Tr,ct as Rr,u$ as oa,nK as Or,DE as Lr,DX as Nr,cb as Er}from"./_LtUY0jS.js";import{A as Dr,b as Mr}from"./CENp25rd.js";import{y as Fr}from"./Bqd7fdCF.js";import{l as zr}from"./FITmaVUJ.js";import{f as ia}from"./BhcBqtJg.js";import{h as Br,g as jr}from"./BPjvgJzJ.js";import{o as Hr,S as Ur}from"./DnNC4gf3.js";import"./CJ4Z96pe.js";import{ae as qr,ah as Wr,f as Mn,a1 as Kr}from"./CttA-M7l.js";import{h as Qr,F as la}from"./C2jYl_tm.js";import"./lJeex2Gh.js";import{C as Gr,k as Vr,j as Xr,i as Yr}from"./DCL0Px6m.js";import{L as Jr}from"./Ce1_P2yR.js";import{c as de}from"./CUkDMZwP.js";import{c as Bn,b as da,d as jn,a as Hn,A as xa}from"./B7ZVMWBx.js";import{l as Wt,b as Zr}from"./CE7dsja4.js";import{F as es,bc as ts}from"./C91EC830.js";import{D as ns}from"./SB0XkB7s.js";import{b as as}from"./B-4NNXpn.js";import{T as rs}from"./CW0Mb2k4.js";import"./BWYuMy_r.js";import{cl as ya,cP as ss,cO as os,bR as is,M as ls,F as yn,b5 as ds,au as us,aK as cs,aG as ps,cT as gs,be as fs,aA as ms,aL as vs,b1 as _s,ah as ua,a8 as hs,c6 as bs,ag as ws,cF as ks,an as xs,cS as ys,aD as $s}from"./U9jJmfYa.js";import{b as As}from"./Dn334wJv.js";import"./Dhy-QJgd.js";import{S as bn}from"./ClIBKxjv.js";import{E as Ss}from"./B9qXV8kb.js";import"./Bsh6nUhU.js";import{f as Is}from"./DvUGkiYP.js";import{P as Cs}from"./CDLANF8s.js";import{b as Ps,P as Ts}from"./DHLXX1td.js";import{h as Rs,H as Os,g as Ls}from"./DZ84MPQO.js";const Ns=80,Es=10,Ds=new Qa(Ga,{renderer:{html({text:a}){return Va(a)},image({tokens:a}){return this.parser.parseInline(a)}}});function Kn(a){const n=document.createElement("template");n.innerHTML=Ds.parseInline(a,{async:!1});for(const o of n.content.querySelectorAll("br"))o.replaceWith(" ");return(n.content.textContent??"").replace(/\s+/g," ").trim()}function Ft(a){return a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`+([^`]*?)`+/g,"$1").replace(/<[^>]+>/g,"").replace(/\\([\\`*_[\]{}()#+\-.!>])/g,"$1").replace(/[*~]/g,"").replace(/(^|[^A-Za-z0-9])_+/g,"$1").replace(/_+([^A-Za-z0-9]|$)/g,"$1").replace(/\s+/g," ").trim()}function Un(a,n){return a.slice(n).replace(/^(?:[ \t]*(?:\r\n|\n|\r))+/,"")}function Sn(a,n){return!n||n.length>Ns||n.split(/\s+/).length>Es||/[.!?;]$/.test(n)?!1:!/^[ \t]*(?:[-+*][ \t]+|\d+[.)][ \t]+|>|```|~~~|\|)/.test(a)}function tl(a){const o=a.trim().match(/^\*\*([^\r\n]+)\*\*$/);if(!o)return null;const i=Ft(o[1]);return Sn(o[0],i)?i:null}function Qn(a,n=!1,o=!0){const i=a.match(/^(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",r=a.slice(i.length).match(/^\*\*([^\r\n]+)\*\*[ \t]*(?:(?:\r\n|\n|\r)|$)/);if(!r)return null;if(n){const v=r[1],f=v.match(/\\+$/)?.[0].length??0;if(v!==v.trim()||v.includes("**")||v.startsWith("*")||v.endsWith("*")||f%2!==0)return null}const p=Ft(r[1]);return Sn(r[0],p)?{title:n&&o?Kn(r[1]):p,body:Un(a,i.length+r[0].length)}:null}function ca(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0),d=i.heading?{body:i.body}:Qn(o,!0,!1);if(!d)return null;n.push(o.slice(0,o.length-d.body.length)),o=d.body}return n.length?n:null}function nl(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0,Kn),d=i.heading?{title:i.heading,body:i.body}:Qn(o,!0);if(!d)return null;n.push(d.title),o=d.body}return n.length?n:null}function al(a){const n=Fs(a),o=[];let i=a;for(n.heading&&(o.push({title:n.heading,body:""}),i=n.body);i;){const d=Qn(i);if(!d||d.body.length>=i.length)break;o.push({title:d.title,body:""}),i=d.body}if(o.length===0){const d=a.trim(),r=Ft(d);return!d.includes(`
2
2
  `)&&Sn(d,r)?[{title:r,body:""}]:d?[{title:null,body:d}]:[]}return o[o.length-1].body=i.trim(),o}function Ms(a){const n=a.replace(/^ {0,3}/,"");return!/^(?:\s|>|`{3}|~{3}|(?:[-+*]|\d+[.)])(?:[ \t]|$)|#{1,6}(?:[ \t]|$)|<|\[[^\]]*\]:)/.test(n)&&!/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})$/.test(n)}function Gn(a,n=!1,o=Ft){const i=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",d=a.slice(i.length);if(n&&/^(?: {4}| {0,3}\t)/.test(d))return{heading:null,body:a};const r=d.match(/^[ \t]{0,3}#{1,6}[ \t]+([^\r\n]*?)(?:[ \t]+#+)?[ \t]*(?:\r\n|\n|\r|$)/);if(r&&Ft(r[1]))return{heading:o(r[1]),body:Un(a,i.length+r[0].length)};const p=d.match(/^([^\r\n]+)(?:\r\n|\n|\r)([ \t]{0,3})(?:=+|-+)[ \t]*(?:\r\n|\n|\r|$)/);return p&&(!n||Ms(p[1])&&!p[2].includes(" "))&&Ft(p[1])?{heading:o(p[1]),body:Un(a,i.length+p[0].length)}:{heading:null,body:a}}function Fs(a,{preserveInlineText:n=!1}={}){const o=n?Kn:Ft,i=Gn(a,!1,o);if(i.heading)return i;const d=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",p=a.slice(d.length).match(/^([^\r\n]+)(?:\r\n|\n|\r)(?:[ \t]*(?:\r\n|\n|\r))+/);if(p){const v=Ft(p[1]),f=a.slice(d.length+p[0].length);if(f.trim()&&Sn(p[1],v))return{heading:o(p[1]),body:f}}return{heading:null,body:a}}const Qt="[--operational-row-inline-padding:var(--chat-operational-row-inline-padding,0.5rem)] [--operational-leading-slot-size:1.25rem] [--operational-leading-half-slot-size:0.625rem] [--operational-leading-gap:var(--chat-operational-leading-gap,0.5rem)]",rl="type-body font-family-child font-normal text-muted-foreground",sl=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ol=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1.5`,il=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1`,ll=`${Qt} relative min-w-0 max-w-full`,dl=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ul=`${Qt} operational-group-child-row ml-2 min-w-0 w-[calc(100%-0.5rem)] max-w-[calc(100%-0.5rem)]`,cl="pt-6",pl="text-muted-foreground",gl="text-muted-foreground",$a="font-normal text-muted-foreground",fl="tool-call-container group relative block w-full min-w-0 max-w-full overflow-hidden type-body font-family-child font-normal text-muted-foreground",ml="h-[16px]! w-[16px]! shrink-0",vl=`${Qt} relative grid h-7 w-full min-w-0 max-w-full grid-cols-[var(--operational-leading-slot-size)_minmax(0,1fr)_auto] items-center gap-[var(--operational-leading-gap)] overflow-hidden rounded-md px-[var(--operational-row-inline-padding)] type-body transition-colors duration-[var(--motion-fast)] motion-reduce:transition-none`,_l=`a11y-ignore pointer-events-none flex size-[var(--operational-leading-slot-size)] min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center [&_svg]:size-[16px]! ${$a}`,hl=`type-body block min-w-0 max-w-full truncate overflow-hidden text-ellipsis whitespace-nowrap border-0 bg-transparent p-0 text-left ${$a}`,bl="type-body flex min-w-0 shrink-0 items-center gap-1 whitespace-nowrap",wl="h-[16px]! w-[16px]! shrink-0 opacity-60 transition-transform duration-[var(--motion-fast)] motion-reduce:transition-none";function kl(a){return qa(a,{axis:"y",duration:ma()?0:150})}function cn(a){return a.type==="thinking"||a.type==="tool_use"||a.type==="content_group"}function xl(a){const n=a?.[0];return!n||cn(n)?"":"pt-4"}function yl(a,n,o=()=>!0){const i=a[n];if(!i||!o(i)||!cn(i))return!1;let d=n-1;for(;d>=0&&!o(a[d]);)d-=1;return d>=0&&cn(a[d])}function $l(a,n,o=()=>!0,i=!1){const d=a[n];if(!d||!o(d))return"";let r=n-1;for(;r>=0&&!o(a[r]);)r-=1;if(r<0)return"";const p=a[r];if(p.type==="thinking"&&d.type==="thinking")return i||ca(p.text??p.content??"")!==null&&ca(d.text??d.content??"")!==null?"":"pt-14";const v=cn(p),f=cn(d);return v&&f?"":p.type==="thinking"&&!f?"pt-6":v||f?"pt-4":"pt-1"}const Al="shrink-0 whitespace-nowrap text-ui text-subtle focus-visible:outline-none focus-visible:text-foreground";function zs(a){if(a?.status==="halted")return c.agent_node_halted_label();if(a?.status==="resuming")return c.agent_node_resuming_label();if(a?.placement?.target==="remote"||Fr(a?.placement?.target)){if(a.placementError)return c.remoteAgent_status_failed();if(a.cloudStart)return c.remoteAgent_status_starting();if(a.effectiveIsolation==="pending")return a.setup?.state==="pending"?c.remoteAgent_status_preparingCheckout():a.setup?.state==="running"?c.remoteAgent_status_runningSetup():c.remoteAgent_status_starting()}if(a?.placement&&a.effectiveIsolation==="pending")return c.agent_node_provisioning_label()}var Bs=_('<span class="owner-fill block h-full svelte-sxf8s9"></span>'),js=_('<span class="shrink-0 text-xs text-muted-foreground"> </span>'),Hs=_('<span class="flex items-center gap-2"><span class="group-key size-1.5 shrink-0 rounded-full svelte-sxf8s9"></span> <span class="min-w-0 flex-1"> </span> <!> <span> </span></span>'),Us=_('<dd class="col-span-2 pl-[1.125rem] text-xs text-muted-foreground wrap-anywhere"> </dd>'),qs=_(`<div class="grid grid-cols-[1fr_auto] items-baseline gap-x-3 py-0.5 text-sm"><dt class="relative min-w-0 pl-[1.125rem] wrap-anywhere before:absolute before:top-2 before:left-0 before:size-1 before:rounded-full before:bg-muted-foreground before:content-['']"> </dt> <dd> </dd> <!></div>`),Ws=_('<dl class="ml-3.5 text-foreground"></dl>'),Fn=_("<!> <!>",1),Ks=_('<span class="flex items-center gap-2"><span class="min-w-0 flex-1"> </span> <span class="shrink-0 tabular-nums text-muted-foreground"> </span></span>'),Qs=_('<div class="min-w-0"><dt class="truncate text-sm text-foreground"> </dt> <dd class="text-xs text-muted-foreground wrap-anywhere"> </dd></div>'),Gs=_('<dl class="ml-3.5 flex flex-col gap-2"></dl>'),Vs=_('<section class="min-w-0" data-testid="prompt-breakdown"><div class="mb-3 flex items-baseline justify-between gap-3"><h3 class="text-sm font-medium"> </h3> <span class="shrink-0 text-sm tabular-nums text-muted-foreground"> </span></div> <div class="owner-strip mb-2 flex h-1.5 w-full overflow-hidden svelte-sxf8s9" role="img"></div> <!></section>');function Aa(a,n){const o=Wn();if(new.target)return Pt({component:Aa,...a});Ot(n,!0);let i=w(n,"breakdown",7);const d="type-body font-normal text-foreground data-[state=open]:font-normal";function r(T){return Zr(T,{maximumFractionDigits:T<1e4?1:0})}function p(T){return T==="native"?c.agent_contextBreakdown_owner_native_label():T==="intent"?c.agent_contextBreakdown_owner_intent_label():c.agent_contextBreakdown_owner_user_label()}const v=u(()=>i().owners.map(T=>c.agent_contextBreakdown_ownerShare_label({owner:p(T.owner),tokens:r(T.estTokens)})).join(", "));var f={get breakdown(){return i()},set breakdown(T){i(T),k()},$set:Tt,$on:(T,m)=>Rt(n,T,m)},S=Vs(),y=O(S),g=O(y),E=U(g,!0),F=b(g,2),Ce=U(F,!0);$(y);var D=b(y,2);Ct(D,21,()=>i().owners,T=>T.owner,(T,m)=>{var me=Bs();let ue;x(()=>{q(me,"data-owner",e(m).owner),ue=en(me,"",ue,{"flex-grow":e(m).share})}),l(T,me)}),$(D);var P=b(D,2);return de(P,()=>xa,(T,m)=>{m(T,{type:"multiple",children:(me,ue)=>{var R=Fn(),_e=H(R);Ct(_e,17,()=>i().groups,pe=>pe.kind,(pe,G)=>{var W=Oe(),ne=H(W);de(ne,()=>Bn,(ge,Fe)=>{Fe(ge,{get value(){return e(G).kind},get"data-prompt-group"(){return e(G).kind},children:(ot,Q)=>{var I=Fn(),ae=H(I);de(ae,()=>da,(he,N)=>{N(he,{level:4,children:(Le,Y)=>{var K=Oe(),Z=H(K);de(Z,()=>jn,(V,oe)=>{oe(V,{inset:!1,class:d,children:(ee,Ne)=>{var be=Hs(),je=O(be),et=b(je,2),ut=U(et,!0),tt=b(et,2);{var at=ct=>{var Nt=js(),yt=U(Nt,!0);x(X=>L(yt,X),[()=>c.agent_contextBreakdown_notCounted_label()]),l(ct,Nt)};M(tt,ct=>{e(G).kind==="native"&&ct(at)})}var Ee=b(tt,2),Gt=U(Ee,!0);$(be),x((ct,Nt)=>{q(je,"data-kind",e(G).kind),L(ut,ct),ve(Ee,1,`shrink-0 tabular-nums ${e(G).kind==="native"?"text-muted-foreground":""}`),L(Gt,Nt)},[()=>p(e(G).kind),()=>r(e(G).estTokens)]),l(ee,be)},$$slots:{default:!0}})}),l(Le,K)},$$slots:{default:!0}})});var Be=b(ae,2);de(Be,()=>Hn,(he,N)=>{N(he,{inset:!1,children:(Le,Y)=>{var K=Ws();Ct(K,21,()=>e(G).rows,Z=>Z.key,(Z,V)=>{var oe=qs(),ee=O(oe),Ne=U(ee,!0),be=b(ee,2),je=U(be,!0),et=b(be,2);{var ut=tt=>{var at=Us(),Ee=U(at,!0);x(()=>L(Ee,e(V).hint)),l(tt,at)};M(et,tt=>{e(V).hint&&tt(ut)})}$(oe),x(tt=>{L(Ne,e(V).label),ve(be,1,`tabular-nums ${e(V).counted?"":"text-muted-foreground"}`),L(je,tt)},[()=>r(e(V).estTokens)]),l(Z,oe)}),$(K),l(Le,K)},$$slots:{default:!0}})}),l(ot,I)},$$slots:{default:!0}})}),l(pe,W)});var ce=b(_e,2);{var xe=pe=>{var G=Oe(),W=H(G);de(W,()=>Bn,(ne,ge)=>{ge(ne,{value:"hidden-skills",class:"mt-1",children:(Fe,ot)=>{var Q=Fn(),I=H(Q);de(I,()=>da,(Be,he)=>{he(Be,{level:4,children:(N,Le)=>{var Y=Oe(),K=H(Y);de(K,()=>jn,(Z,V)=>{V(Z,{inset:!1,class:d,children:(oe,ee)=>{var Ne=Ks(),be=O(Ne),je=U(be,!0),et=b(be,2),ut=U(et,!0);$(Ne),x((tt,at)=>{L(je,tt),L(ut,at)},[()=>c.agent_contextBreakdown_hiddenSkills_title(),()=>Wt(i().hiddenSkills.length)]),l(oe,Ne)},$$slots:{default:!0}})}),l(N,Y)},$$slots:{default:!0}})});var ae=b(I,2);de(ae,()=>Hn,(Be,he)=>{he(Be,{inset:!1,children:(N,Le)=>{var Y=Gs();Ct(Y,21,()=>i().hiddenSkills,K=>K.name,(K,Z)=>{var V=Qs(),oe=O(V),ee=U(oe,!0),Ne=b(oe,2),be=U(Ne,!0);$(V),x(je=>{L(ee,e(Z).name),L(be,je)},[()=>[e(Z).detail,e(Z).fix].filter(Boolean).join(" · ")]),l(K,V)}),$(Y),l(N,Y)},$$slots:{default:!0}})}),l(Fe,Q)},$$slots:{default:!0}})}),l(pe,G)};M(ce,pe=>{i().hiddenSkills.length>0&&pe(xe)})}l(me,R)},$$slots:{default:!0}})}),$(S),x((T,m)=>{q(S,"aria-labelledby",`${o}-title`),q(g,"id",`${o}-title`),L(E,T),L(Ce,m),q(D,"aria-label",e(v))},[()=>c.agent_contextBreakdown_title(),()=>c.agent_contextBreakdown_tokens_label({tokens:r(i().estTokens)})]),l(a,S),Lt(f)}const Xs=["intent","user"],Ys=["systemPrompt","toolDescription","provider"],Js=["native","user","intent"],$n=a=>typeof a=="object"&&a!==null&&!Array.isArray(a),An=a=>typeof a=="number"&&Number.isFinite(a)&&a>=0,Zs=a=>a==="intent"||a==="user";function eo(a,n){if(!$n(a))return null;const{id:o,label:i,owner:d,location:r,chars:p,estTokens:v,controlHint:f}=a;if(typeof o!="string"||typeof i!="string"||!Zs(d)||typeof r!="string"||!Ys.includes(r)||!An(p)||!An(v))return null;const S=$n(f)&&typeof f.text=="string"&&f.text;return{key:`${n}:${o}`,id:o,label:i,owner:d,chars:p,estTokens:v,counted:r!=="provider",...S?{hint:S}:{}}}function to(a){if(!$n(a))return null;const{name:n,reason:o,detail:i,fix:d}=a;return[n,o,i,d].some(r=>typeof r!="string")?null:{name:n,reason:o,detail:i,fix:d}}function no(a){if(!$n(a)||a.available!==!0)return null;const{totalChars:n,estTokens:o,sections:i,hiddenSkills:d}=a;if(!An(n)||!An(o)||!Array.isArray(i)||!Array.isArray(d))return null;const r=i.map(eo).filter(f=>f!==null).sort((f,S)=>S.chars-f.chars),p=Xs.map(f=>{const S=r.filter(g=>g.counted&&g.owner===f),y=S.reduce((g,E)=>g+E.chars,0);return{owner:f,chars:y,estTokens:S.reduce((g,E)=>g+E.estTokens,0),share:n>0?y/n:0}}).filter(f=>f.chars>0),v=Js.map(f=>{const S=r.filter(y=>f==="native"?!y.counted:y.counted&&y.owner===f);return{kind:f,chars:S.reduce((y,g)=>y+g.chars,0),estTokens:S.reduce((y,g)=>y+g.estTokens,0),rows:S}}).filter(f=>f.rows.length>0);return{totalChars:n,estTokens:o,rows:r,groups:v,owners:p,hiddenSkills:d.map(to).filter(f=>f!==null)}}async function ao(a){try{const n=await Qr("agent.getSession",{agentId:a});return no(n?.session?.promptBreakdown)}catch{return null}}const pa=es.map(a=>({key:a.path.replace(/^agentFeatures\./,""),label:a.label,description:a.description}));function ro(a){const n=a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase().trim();return n.charAt(0).toUpperCase()+n.slice(1)}function so(a){const n=a??{},o=pa.map(r=>({key:r.key,label:r.label(),description:r.description(),enabled:n[r.key]===!0,known:!0})),i=new Set(pa.map(r=>r.key)),d=[];for(const[r,p]of Object.entries(n))i.has(r)||d.push({key:r,label:ro(r),description:null,enabled:p===!0,known:!1});return d.sort((r,p)=>r.label.localeCompare(p.label)),o.concat(d)}var oo=_('<div class="mb-6 border-b border-border pb-6"><!></div>'),io=_("<span> </span>"),lo=_('<!> <span class="sr-only"> </span>',1),uo=_('<div role="listitem" class="text-xs text-subtle" aria-hidden="true">—</div>'),co=_('<section class="min-w-0"><h4 class="text-sm font-medium mb-3"> </h4> <div role="list" class="space-y-2"></div></section>'),po=_('<div class="@container"><!> <section><h3 class="text-sm font-medium"> </h3> <p class="mb-4 mt-1 text-sm text-muted-foreground"> </p> <div class="grid grid-cols-1 gap-6 @min-[28rem]:grid-cols-2" data-testid="harness-features-list"></div></section></div>');function Sa(a,n){const o=Wn();if(new.target)return Pt({component:Sa,...a});Ot(n,!0);let i=w(n,"open",15,!1),d=w(n,"static",7,!1),r=w(n,"version",7),p=w(n,"features",7,null),v=w(n,"agentId",7),f=w(n,"breakdown",7),S=le(null);const y=u(()=>f()===void 0&&!!v());ze(()=>{if(!i()||!e(y)||!v())return;const D=v();let P=!0;return ao(D).then(T=>{P&&h(S,{agentId:D,view:T},!0)}),()=>{P=!1}});const g=u(()=>f()!==void 0?f():e(y)&&e(S)&&e(S).agentId===v()?e(S).view:null),E=u(()=>so(p())),F=u(()=>[{enabled:!0,label:c.chat_shared_valueOn_label(),rows:e(E).filter(D=>D.enabled)},{enabled:!1,label:c.chat_shared_valueOff_label(),rows:e(E).filter(D=>!D.enabled)}]);var Ce={get open(){return i()},set open(D=!1){i(D),k()},get static(){return d()},set static(D=!1){d(D),k()},get version(){return r()},set version(D){r(D),k()},get features(){return p()},set features(D=null){p(D),k()},get agentId(){return v()},set agentId(D){v(D),k()},get breakdown(){return f()},set breakdown(D){f(D),k()},$set:Tt,$on:(D,P)=>Rt(n,D,P)};{let D=u(()=>c.chat_harnessFeaturesModal_title({version:r()}));Gr(a,{get static(){return d()},get title(){return e(D)},size:"wide",get open(){return i()},set open(P){i(P)},children:(P,T)=>{var m=po(),me=O(m);{var ue=W=>{var ne=oo(),ge=O(ne);Aa(ge,{get breakdown(){return e(g)}}),$(ne),l(W,ne)};M(me,W=>{e(g)&&W(ue)})}var R=b(me,2),_e=O(R),ce=U(_e,!0),xe=b(_e,2),pe=U(xe,!0),G=b(xe,2);Ct(G,21,()=>e(F),W=>W.enabled,(W,ne)=>{var ge=co(),Fe=O(ge),ot=U(Fe,!0),Q=b(Fe,2);Ct(Q,21,()=>e(ne).rows,I=>I.key,(I,ae)=>{Jr(I,{role:"listitem",class:"min-h-0 px-0 py-0 [&_.truncate]:whitespace-normal","data-testid":"harness-feature-state",get"data-feature"(){return e(ae).key},get"data-enabled"(){return e(ae).enabled},title:he=>{var N=Oe(),Le=H(N);{var Y=Z=>{var V=lo(),oe=H(V);qr(oe,{get content(){return e(ae).description},side:"top",size:"sm",children:(be,je)=>{var et=io(),ut=U(et,!0);x(()=>L(ut,e(ae).label)),l(be,et)},$$slots:{default:!0}});var ee=b(oe,2),Ne=U(ee,!0);x(()=>L(Ne,e(ae).description)),l(Z,V)},K=Z=>{var V=Kt();x(()=>L(V,e(ae).label)),l(Z,V)};M(Le,Z=>{e(ae).description?Z(Y):Z(K,-1)})}l(he,N)},$$slots:{title:!0}})},I=>{var ae=uo();l(I,ae)}),$(Q),$(ge),x(()=>{q(ge,"aria-label",e(ne).label),L(ot,e(ne).label)}),l(W,ge)}),$(G),$(R),$(m),x((W,ne)=>{q(R,"aria-labelledby",`${o}-capabilities`),q(_e,"id",`${o}-capabilities`),L(ce,W),L(pe,ne)},[()=>c.chat_harnessFeaturesModal_capabilities_title(),()=>c.chat_harnessFeaturesModal_description()]),l(P,m)},$$slots:{default:!0}})}return Lt(Ce)}var go=_('<p role="alert" class="type-body text-danger"> </p>');function Ia(a,n){if(new.target)return Pt({component:Ia,...a});Ot(n,!0);const o=()=>Re(g,"$outcome$",i),[i,d]=qn();let r=w(n,"open",15,!1),p=w(n,"agentName",7),v=w(n,"workspaceId",7),f=w(n,"agentId",7);const S=crypto.randomUUID(),y=Mt(""),g=xn(y,S),E=u(()=>o()?.workspaceId===v()&&o().agentId===f()?o():void 0),F=u(()=>e(E)?.status==="pending"),Ce=u(()=>e(E)?.status==="failed"?e(E).error:"");ze(()=>{const m=v();return f(),y.set(m),()=>J.dispatch(zn(m,S))}),ze(()=>{e(E)?.status==="succeeded"&&(r(!1),J.dispatch(wa(v(),S,e(E).requestId)))});function D(){const m=xn.select(J.state,v(),S);m?.agentId===f()&&m.status==="pending"||J.dispatch(kn(v(),S,crypto.randomUUID(),f(),{kind:"retire"}))}var P={get open(){return r()},set open(m=!1){r(m),k()},get agentName(){return p()},set agentName(m){p(m),k()},get workspaceId(){return v()},set workspaceId(m){v(m),k()},get agentId(){return f()},set agentId(m){f(m),k()},$set:Tt,$on:(m,me)=>Rt(n,m,me)};{const m=ce=>{var xe=Oe(),pe=H(xe);{var G=W=>{var ne=go(),ge=U(ne,!0);x(()=>L(ge,e(Ce))),l(W,ne)};M(pe,W=>{e(Ce)&&W(G)})}l(ce,xe)};let me=u(()=>c.modals_retireAgent_title()),ue=u(()=>c.modals_retireAgent_description({name:p()})),R=u(()=>c.modals_retireAgent_confirm_label()),_e=u(()=>c.modals_bulkActionConfirm_cancel_label());ns(a,{get title(){return e(me)},get description(){return e(ue)},get confirmLabel(){return e(R)},get cancelLabel(){return e(_e)},focusSubmit:!1,focusCancel:!0,get busy(){return e(F)},onConfirm:D,get open(){return r()},set open(ce){r(ce)},details:m,$$slots:{details:!0}})}var T=Lt(P);return d(),T}function fo({agentName:a,specialist:n}){const o=n?`{ topLevel: true, specialist: ${JSON.stringify(n)} }`:"{ topLevel: true }",i=n?`and keep the same specialist (${JSON.stringify(n)})`:"and, if you were created with a specialist, pass that exact same `specialist` value in the options";return`Please replace yourself with a fresh top-level agent and run a gradual, coordinated hand-off:
3
3
 
4
4
  1. Create your replacement now: call \`ws.agent.create(${JSON.stringify(a)}, kickoffMessage, ${o})\`. The first argument must be your EXACT current name (${JSON.stringify(a)}) ${i}. Write the kickoff message as a thorough context hand-off: the overall goal, the current state of the work, key notes and files, decisions already made, and open threads.
@@ -1 +1 @@
1
- import{bm as n,t as L,bo as i,bw as x,b as B}from"./C0QTy0Sy.js";import{bs as K,a5 as Q,bS as U,bA as D,b_ as N,aD as f,W as I,bn as P,c9 as A,aA as u,aB as q}from"./3SdAC2_C.js";import{i as E}from"./bhKPSdq4.js";import{f as V,s as _,g as H}from"./7UPrdiE9.js";import{d as R,A as j,a as J}from"./wl2qP2wF.js";import{aL as M}from"./DKHY8q_S.js";import{nK as T,i as m}from"./tr-2J8Mf.js";import{e8 as G,O as X,N as Y}from"./BaujsV9k.js";function Z(e){switch(e){case"running":return n.layout_activeCard_running_header();case"responding":return n.agentOverview_hierarchyGraph_statusResponding_label();case"unread":return n.layout_activeCard_unread_header();case"completed":return n.agentOverview_hierarchyGraph_statusCompleted_label();case"failed":return n.agentOverview_hierarchyGraph_statusFailed_label();case"question":return n.chat_questionWizard_title();case"waiting":return n.agentOverview_hierarchyGraph_statusWaiting_label();case"needs-permission":return n.events_activity_agentAskedPermission_label();case"attention-discussion":return n.chat_agentCard_attentionDiscussion_label();case"attention-blocker":return n.chat_agentCard_attentionBlocker_label();case"idle":return n.agentOverview_hierarchyGraph_statusIdle_label()}}var $=q('<span class="agent-avatar-unread-dot svelte-v6mebl" data-avatar-unread-dot=""></span>'),ee=q('<span role="img" data-agent-avatar-with-state="" data-agent-avatar-surface=""><!> <!></span>');function te(e,a){if(new.target)return L({component:te,...e});K(a,!0);let d=i(a,"agentId",7),l=i(a,"specialist",7,null),o=i(a,"icon",7,null),v=i(a,"provider",7,void 0),c=i(a,"variant",7,R),g=i(a,"size",7,void 0),r=i(a,"state",7,"idle"),h=i(a,"class",7,"");const w=A(()=>Z(r())),y=A(()=>g()??J[c()].surface),p=A(()=>g()===void 0);var O={get agentId(){return d()},set agentId(t){d(t),u()},get specialist(){return l()},set specialist(t=null){l(t),u()},get icon(){return o()},set icon(t=null){o(t),u()},get provider(){return v()},set provider(t=void 0){v(t),u()},get variant(){return c()},set variant(t=R){c(t),u()},get size(){return g()},set size(t=void 0){g(t),u()},get state(){return r()},set state(t="idle"){r(t),u()},get class(){return h()},set class(t=""){h(t),u()},$set:x,$on:(t,b)=>B(a,t,b)},s=ee();let C;var k=Q(s);j(k,{get agentId(){return d()},get specialist(){return l()},get icon(){return o()},get provider(){return v()},get variant(){return c()},get size(){return g()}});var W=U(k,2);{var F=t=>{var b=$();I(t,b)};E(W,t=>{r()==="unread"&&t(F)})}return D(s),N(()=>{V(s,1,`agent-avatar-with-state agent-avatar-with-state--${r()??""} ${h()??""}`,"svelte-v6mebl"),_(s,"aria-label",f(w)),_(s,"title",f(w)),_(s,"data-avatar-state",r()),_(s,"data-avatar-variant",f(p)?c():void 0),C=H(s,"",C,{width:f(p)?void 0:`${f(y)}px`,height:f(p)?void 0:`${f(y)}px`})}),I(e,s),P(O)}function S(e){return X(e)}function ae(e){return Y(e)}function z(e,a={}){const{hasUnread:d=!1,isActive:l=!1,isCompleted:o=!1,isFailed:v=!1,hasQuestion:c=!1,hasPermissionRequest:g=!1,attentionKind:r=null}=a;return o&&!S(e)?"completed":v||e.status===m.Error||e.status==="failed"?"failed":c?"question":g?"needs-permission":r==="discussion"?"attention-discussion":r==="blocker"?"attention-blocker":ae(e)?"waiting":S(e)?"running":d&&!l?"unread":"idle"}function ce(e,a={}){if(!e)return z({},a);const d=T(e),l=e.status===m.Completed||String(e.status).toLowerCase()==="completed",o=e.status===m.Error||e.status===m.Deleted||String(e.status).toLowerCase()==="failed";return z(G(e),{...a,hasQuestion:M(e)||a.hasQuestion===!0,hasUnread:a.hasUnread??e.hasUnread,isCompleted:a.isCompleted??l,isFailed:a.isFailed??o,attentionKind:a.attentionKind??d?.kind??null})}function ge(e){return e?S(G(e)):!1}export{te as A,z as a,ce as b,Z as g,ge as i};
1
+ import{bm as n,t as L,bo as i,bw as x,b as B}from"./C0QTy0Sy.js";import{bs as K,a5 as Q,bS as U,bA as D,b_ as N,aD as f,W as I,bn as P,c9 as A,aA as u,aB as q}from"./3SdAC2_C.js";import{i as E}from"./bhKPSdq4.js";import{f as V,s as _,g as H}from"./7UPrdiE9.js";import{d as R,A as j,a as J}from"./wl2qP2wF.js";import{aL as M}from"./CTP1vzdq.js";import{nK as T,i as m}from"./_LtUY0jS.js";import{e8 as G,O as X,N as Y}from"./Cppy6ZYG.js";function Z(e){switch(e){case"running":return n.layout_activeCard_running_header();case"responding":return n.agentOverview_hierarchyGraph_statusResponding_label();case"unread":return n.layout_activeCard_unread_header();case"completed":return n.agentOverview_hierarchyGraph_statusCompleted_label();case"failed":return n.agentOverview_hierarchyGraph_statusFailed_label();case"question":return n.chat_questionWizard_title();case"waiting":return n.agentOverview_hierarchyGraph_statusWaiting_label();case"needs-permission":return n.events_activity_agentAskedPermission_label();case"attention-discussion":return n.chat_agentCard_attentionDiscussion_label();case"attention-blocker":return n.chat_agentCard_attentionBlocker_label();case"idle":return n.agentOverview_hierarchyGraph_statusIdle_label()}}var $=q('<span class="agent-avatar-unread-dot svelte-v6mebl" data-avatar-unread-dot=""></span>'),ee=q('<span role="img" data-agent-avatar-with-state="" data-agent-avatar-surface=""><!> <!></span>');function te(e,a){if(new.target)return L({component:te,...e});K(a,!0);let d=i(a,"agentId",7),l=i(a,"specialist",7,null),o=i(a,"icon",7,null),v=i(a,"provider",7,void 0),c=i(a,"variant",7,R),g=i(a,"size",7,void 0),r=i(a,"state",7,"idle"),h=i(a,"class",7,"");const w=A(()=>Z(r())),y=A(()=>g()??J[c()].surface),p=A(()=>g()===void 0);var O={get agentId(){return d()},set agentId(t){d(t),u()},get specialist(){return l()},set specialist(t=null){l(t),u()},get icon(){return o()},set icon(t=null){o(t),u()},get provider(){return v()},set provider(t=void 0){v(t),u()},get variant(){return c()},set variant(t=R){c(t),u()},get size(){return g()},set size(t=void 0){g(t),u()},get state(){return r()},set state(t="idle"){r(t),u()},get class(){return h()},set class(t=""){h(t),u()},$set:x,$on:(t,b)=>B(a,t,b)},s=ee();let C;var k=Q(s);j(k,{get agentId(){return d()},get specialist(){return l()},get icon(){return o()},get provider(){return v()},get variant(){return c()},get size(){return g()}});var W=U(k,2);{var F=t=>{var b=$();I(t,b)};E(W,t=>{r()==="unread"&&t(F)})}return D(s),N(()=>{V(s,1,`agent-avatar-with-state agent-avatar-with-state--${r()??""} ${h()??""}`,"svelte-v6mebl"),_(s,"aria-label",f(w)),_(s,"title",f(w)),_(s,"data-avatar-state",r()),_(s,"data-avatar-variant",f(p)?c():void 0),C=H(s,"",C,{width:f(p)?void 0:`${f(y)}px`,height:f(p)?void 0:`${f(y)}px`})}),I(e,s),P(O)}function S(e){return X(e)}function ae(e){return Y(e)}function z(e,a={}){const{hasUnread:d=!1,isActive:l=!1,isCompleted:o=!1,isFailed:v=!1,hasQuestion:c=!1,hasPermissionRequest:g=!1,attentionKind:r=null}=a;return o&&!S(e)?"completed":v||e.status===m.Error||e.status==="failed"?"failed":c?"question":g?"needs-permission":r==="discussion"?"attention-discussion":r==="blocker"?"attention-blocker":ae(e)?"waiting":S(e)?"running":d&&!l?"unread":"idle"}function ce(e,a={}){if(!e)return z({},a);const d=T(e),l=e.status===m.Completed||String(e.status).toLowerCase()==="completed",o=e.status===m.Error||e.status===m.Deleted||String(e.status).toLowerCase()==="failed";return z(G(e),{...a,hasQuestion:M(e)||a.hasQuestion===!0,hasUnread:a.hasUnread??e.hasUnread,isCompleted:a.isCompleted??l,isFailed:a.isFailed??o,attentionKind:a.attentionKind??d?.kind??null})}function ge(e){return e?S(G(e)):!1}export{te as A,z as a,ce as b,Z as g,ge as i};