decocms 4.363.1 → 4.364.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (350) hide show
  1. package/dist/client/assets/{AlertCircle-CgERhdh6.js → AlertCircle-EniJtD8E.js} +1 -1
  2. package/dist/client/assets/{AreaChart-kU4sTinA.js → AreaChart-DZpAPo6a.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-BVx6AQzq.js → ArrowLeft-Clu1mSdY.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DZQert3q.js → ArrowRight-Cu8UuHNR.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-lpfNBlP2.js → ArrowUp-C0eratGp.js} +1 -1
  6. package/dist/client/assets/{Check-DClZtAIP.js → Check-BWpBE9uf.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BGqFZ8sM.js → CheckCircle-cinYKmPU.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-BNfU55ld.js → ChevronRight-DzRB-rdO.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-ilm76_0p.js → ChevronSelectorVertical-BiIbFU31.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CbF1Gmeo.js → ChevronUp-DGrguvGW.js} +1 -1
  11. package/dist/client/assets/{Copy01-DiITYBuR.js → Copy01-DayLu0dF.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-Zpy-4Wu9.js → CreditCard01-4OsjIT5f.js} +1 -1
  13. package/dist/client/assets/{Database01-zcGUPFsG.js → Database01-2gG_9E30.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-LmkOTjL4.js → DotsVertical-CucJCL9y.js} +1 -1
  15. package/dist/client/assets/{Download01-C4blLpML.js → Download01-BC2rKbuh.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-KbkdtIBU.js → ErrorBarContext-CRh7XbJc.js} +1 -1
  17. package/dist/client/assets/{Eye-Cd7v-liN.js → Eye-dnrP5DkM.js} +1 -1
  18. package/dist/client/assets/{File02-CceuR6rF.js → File02-BhckHV8N.js} +1 -1
  19. package/dist/client/assets/{GitBranch01-Dil6c2wv.js → GitBranch01-BBn4dN5f.js} +1 -1
  20. package/dist/client/assets/{Globe01-BVji6jXS.js → Globe01-SLAc63wC.js} +1 -1
  21. package/dist/client/assets/{HardDrive-B4UY5qYp.js → HardDrive-FlnOYA_8.js} +1 -1
  22. package/dist/client/assets/{Image01-CpXdMb8x.js → Image01-BrHSH-Vi.js} +1 -1
  23. package/dist/client/assets/{Key01-BsAAVoJx.js → Key01-CKcg8G1v.js} +1 -1
  24. package/dist/client/assets/{Link01-OqB-2yPE.js → Link01-3t9JrUgl.js} +1 -1
  25. package/dist/client/assets/{LinkExternal01-DobnLseV.js → LinkExternal01-Cp7uxK1i.js} +1 -1
  26. package/dist/client/assets/{Monitor01-BTqHf-K4.js → Monitor01-BUruMK2r.js} +1 -1
  27. package/dist/client/assets/{Package-CCkk0w5h.js → Package-CdfyZYxN.js} +1 -1
  28. package/dist/client/assets/{Palette-BBWt8owf.js → Palette-CglyAOTg.js} +1 -1
  29. package/dist/client/assets/{Play-CPeIBqH_.js → Play-rnw1eV52.js} +1 -1
  30. package/dist/client/assets/{Plus-DaErdsG1.js → Plus-Bxp02MWl.js} +1 -1
  31. package/dist/client/assets/{Printer-BG6NfeSZ.js → Printer-fz_zwxfT.js} +1 -1
  32. package/dist/client/assets/{SearchLg-DxQfk550.js → SearchLg-FC9suxna.js} +1 -1
  33. package/dist/client/assets/{SearchMd-BNXjQ2BV.js → SearchMd-DRRptSJN.js} +1 -1
  34. package/dist/client/assets/{Sector-D2wxgDkd.js → Sector-CJIPfQ5Z.js} +1 -1
  35. package/dist/client/assets/{Settings02-DL8f5fN1.js → Settings02-D2oiGU4q.js} +1 -1
  36. package/dist/client/assets/{Share07-D1Sv14jA.js → Share07-D_kiq5Fr.js} +1 -1
  37. package/dist/client/assets/{Shield01-BsobIEfQ.js → Shield01-CjyLhqlS.js} +1 -1
  38. package/dist/client/assets/{Stars01-f37Q7vDf.js → Stars01-COChWymR.js} +1 -1
  39. package/dist/client/assets/{Sun-DjKz3VjB.js → Sun-nKOZMh9n.js} +1 -1
  40. package/dist/client/assets/{SwitchHorizontal01-BIyO34Jw.js → SwitchHorizontal01-CxlKjkIX.js} +1 -1
  41. package/dist/client/assets/{Tool01-D6HOM_aJ.js → Tool01-BnKd95Y1.js} +1 -1
  42. package/dist/client/assets/{Tool02-BrfQeZRx.js → Tool02-C_xRWqQk.js} +1 -1
  43. package/dist/client/assets/{Trash01-DQjprOwc.js → Trash01-DqUm2RRh.js} +1 -1
  44. package/dist/client/assets/{TrendUp01-DIz6JZwT.js → TrendUp01-PFzYDizC.js} +1 -1
  45. package/dist/client/assets/{Upload01-BDeLrRhf.js → Upload01-CqWnAR1-.js} +1 -1
  46. package/dist/client/assets/{User01-B8a5ssx2.js → User01-BJoNdkjl.js} +1 -1
  47. package/dist/client/assets/{UserSquare-yIpHwPSn.js → UserSquare-CCDsU001.js} +1 -1
  48. package/dist/client/assets/{Users01-BCRhQsCX.js → Users01-DSQPwtP5.js} +1 -1
  49. package/dist/client/assets/{Users03-DWh3D2_T.js → Users03-CRtXqa1Q.js} +1 -1
  50. package/dist/client/assets/{XCircle-DudPVYQR.js → XCircle-9Cb0khfg.js} +1 -1
  51. package/dist/client/assets/{XClose-DpDcHm9Y.js → XClose-Cw4b4Uag.js} +1 -1
  52. package/dist/client/assets/{Zap-C5eiFR0N.js → Zap-ChVc0p76.js} +1 -1
  53. package/dist/client/assets/{ZoomOut-DdupjPFF.js → ZoomOut-BXPGwF_O.js} +1 -1
  54. package/dist/client/assets/{access-gate-Dnh0JyKy.js → access-gate-BZbNb1lq.js} +1 -1
  55. package/dist/client/assets/{add-connection-dialog-BSihy3_s.js → add-connection-dialog-s1GRGQ63.js} +1 -1
  56. package/dist/client/assets/{agent-analytics-C1OAYjbt.js → agent-analytics-C4aHsqYV.js} +1 -1
  57. package/dist/client/assets/agent-app-CzbKRw1_.js +1 -0
  58. package/dist/client/assets/{agent-assets-vYQq8qui.js → agent-assets-B6lPIA_2.js} +1 -1
  59. package/dist/client/assets/{agent-automation-BPNX454_.js → agent-automation-Bmdy2mNK.js} +1 -1
  60. package/dist/client/assets/{agent-automations-BLOXID0N.js → agent-automations-5exIOZ--.js} +1 -1
  61. package/dist/client/assets/{agent-connect-sources-BzEccd4r.js → agent-connect-sources-ozaEzrP4.js} +1 -1
  62. package/dist/client/assets/agent-deck-D5-mvZ5i.js +1 -0
  63. package/dist/client/assets/{agent-e2e-DM8adI3E.js → agent-e2e-s-Nk1F2Y.js} +1 -1
  64. package/dist/client/assets/agent-file-DkGApBvp.js +1 -0
  65. package/dist/client/assets/{agent-git-DarQSTRH.js → agent-git-Bu3r6tWp.js} +1 -1
  66. package/dist/client/assets/{agent-hosting-Dnr2S-TT.js → agent-hosting-CdYzW_dA.js} +1 -1
  67. package/dist/client/assets/{agent-icon-vDfwuZu4.js → agent-icon-DrlilhFJ.js} +1 -1
  68. package/dist/client/assets/agent-library-file-CK85m8fH.js +1 -0
  69. package/dist/client/assets/{agent-monitor-DpaaBIhL.js → agent-monitor-DEQ-34KF.js} +1 -1
  70. package/dist/client/assets/{agent-overview-D9IrP622.js → agent-overview-BQIF-rwN.js} +1 -1
  71. package/dist/client/assets/agent-settings-gb3smN_4.js +1 -0
  72. package/dist/client/assets/{agent-site-editor-DTFbZmEY.js → agent-site-editor-DtPpWjDD.js} +1 -1
  73. package/dist/client/assets/agent-site-editor-code-DkcL_YVi.js +2 -0
  74. package/dist/client/assets/{agent-site-editor-content-BE26aik7.js → agent-site-editor-content-6zQLGSyR.js} +2 -2
  75. package/dist/client/assets/{agent-site-editor-preview-ki_D8wtP.js → agent-site-editor-preview-D8mxBZIU.js} +3 -3
  76. package/dist/client/assets/agent-view-D9WzU94g.js +1 -0
  77. package/dist/client/assets/{agent-view-guard-DomQyuot.js → agent-view-guard-nj1TYVsk.js} +1 -1
  78. package/dist/client/assets/{agents-list-B0vnsITA.js → agents-list-hiZ_XS0O.js} +1 -1
  79. package/dist/client/assets/{ai-providers-CxaMjUP7.js → ai-providers-oY9ilqJZ.js} +1 -1
  80. package/dist/client/assets/{alert-DcFgIKLk.js → alert-D-emvPaG.js} +1 -1
  81. package/dist/client/assets/{alert-dialog-CiKfgw9r.js → alert-dialog-BE9ltHtr.js} +1 -1
  82. package/dist/client/assets/{api-keys-CEPWE1iS.js → api-keys-4NMR09V3.js} +1 -1
  83. package/dist/client/assets/api-keys-BQayHq-8.js +1 -0
  84. package/dist/client/assets/app-editor-DeI0TeES.js +1 -0
  85. package/dist/client/assets/{asset-utils-DJXdpjr9.js → asset-utils-CR65HphV.js} +1 -1
  86. package/dist/client/assets/{auth-ksbj4Esa.js → auth-RjDDTUUT.js} +1 -1
  87. package/dist/client/assets/{auth-catchall-DV5KEwZ2.js → auth-catchall-qxwSZGuB.js} +1 -1
  88. package/dist/client/assets/{auth-entry-Fe8qT_kq.js → auth-entry-ddblLMjc.js} +1 -1
  89. package/dist/client/assets/{auth-split-layout-CFJK_BXW.js → auth-split-layout-oGs_kK_4.js} +1 -1
  90. package/dist/client/assets/{authenticate-and-persist-oauth-DMvGjBUE.js → authenticate-and-persist-oauth-DXlrPDSv.js} +1 -1
  91. package/dist/client/assets/{automation-list-row-CkrObNhq.js → automation-list-row-XibuWgpW.js} +1 -1
  92. package/dist/client/assets/{automation-runs-C-5kRp10.js → automation-runs-nZP284NC.js} +1 -1
  93. package/dist/client/assets/automations-CDxxuCym.js +1 -0
  94. package/dist/client/assets/{autosend-BzUVLyEq.js → autosend-HdosN86x.js} +1 -1
  95. package/dist/client/assets/{avatar-CW4PxBuN.js → avatar-DcDvs8Zz.js} +1 -1
  96. package/dist/client/assets/{badge-C5Ilvf_J.js → badge-DJpaBl8u.js} +1 -1
  97. package/dist/client/assets/{block-document-Zfk-C1Kp.js → block-document-LCYQj9PJ.js} +1 -1
  98. package/dist/client/assets/{breadcrumb-BajFgW5V.js → breadcrumb-BOAVRiAa.js} +1 -1
  99. package/dist/client/assets/{buckets-CyNocIPE.js → buckets-Ze5fok7v.js} +1 -1
  100. package/dist/client/assets/{build-improve-prompt-doc-BrRLOIlw.js → build-improve-prompt-doc-Dn9xs_5X.js} +1 -1
  101. package/dist/client/assets/{bulk-category-panel-e217-dmm.js → bulk-category-panel-D-Hh71MB.js} +1 -1
  102. package/dist/client/assets/{calendar-DGiOuDgZ.js → calendar-DTnssie4.js} +1 -1
  103. package/dist/client/assets/{capability-load-error-DFv8gs5U.js → capability-load-error-CJ3e1sqb.js} +1 -1
  104. package/dist/client/assets/{cards-XHNjVWeh.js → cards-DTFINi5r.js} +1 -1
  105. package/dist/client/assets/category-editor-4KcN0JRt.js +1 -0
  106. package/dist/client/assets/{chart-C7CmtzOp.js → chart-Jb0gHMLD.js} +1 -1
  107. package/dist/client/assets/{chat-context-HB_KOUNM.js → chat-context-CXknhaDs.js} +1 -1
  108. package/dist/client/assets/{checkbox-Dg_GkeBT.js → checkbox-D8Ab2Vb-.js} +1 -1
  109. package/dist/client/assets/{choose-editor-DO1mGCL1.js → choose-editor-Chy2VB_F.js} +1 -1
  110. package/dist/client/assets/{cli-auth-success-e-RADpiN.js → cli-auth-success-B27gos5d.js} +1 -1
  111. package/dist/client/assets/{client-icons-tt6oaVA2.js → client-icons-CoIMqlIz.js} +1 -1
  112. package/dist/client/assets/{collapsible-CycyYnXe.js → collapsible-DH_CZdwE.js} +1 -1
  113. package/dist/client/assets/{collection-detail-DhtfN_Wl.js → collection-detail-D8Sq0PzS.js} +1 -1
  114. package/dist/client/assets/{collection-display-button-BRbx9UhH.js → collection-display-button-P_aK73Om.js} +1 -1
  115. package/dist/client/assets/{collection-search-j4HjYlys.js → collection-search-CzGq8Uso.js} +1 -1
  116. package/dist/client/assets/{collection-table-wrapper-0LZ9BKlr.js → collection-table-wrapper-ChqJqpKo.js} +1 -1
  117. package/dist/client/assets/{collection-tabs-Bc9QOlJ8.js → collection-tabs-BLgGMB42.js} +1 -1
  118. package/dist/client/assets/{command-BpjWfGyr.js → command-B6LMVdkQ.js} +1 -1
  119. package/dist/client/assets/{command-palette-store-D19nXDNm.js → command-palette-store-BwHku_Zt.js} +1 -1
  120. package/dist/client/assets/{commerce-onboarding-CdG4FfWS.js → commerce-onboarding-EmIMFBqV.js} +1 -1
  121. package/dist/client/assets/{companion-mcps-section-CVcicsr9.js → companion-mcps-section-BszDkkOp.js} +1 -1
  122. package/dist/client/assets/{connect-COU6F3Do.js → connect-CM-97gwN.js} +1 -1
  123. package/dist/client/assets/{connect-layout-Bl-ol5HH.js → connect-layout-C_MQVbrT.js} +1 -1
  124. package/dist/client/assets/{connection-By77bjvj.js → connection-OmoYXqZk.js} +1 -1
  125. package/dist/client/assets/{connection-card-Br8jDKgZ.js → connection-card-Cy-GdKQl.js} +1 -1
  126. package/dist/client/assets/{connection-detail-vVdPGlxv.js → connection-detail-CuBiFvjK.js} +1 -1
  127. package/dist/client/assets/{connection-form-helpers-CFXh6BoJ.js → connection-form-helpers-D3hdN_Pk.js} +1 -1
  128. package/dist/client/assets/{connections-BBNFmXEe.js → connections-BnO49Vti.js} +1 -1
  129. package/dist/client/assets/{create-organization-dialog-CRl8hry2.js → create-organization-dialog--p2RMsV5.js} +1 -1
  130. package/dist/client/assets/{decode-html-entities-Cf7wUEql.js → decode-html-entities-DDqE27I4.js} +1 -1
  131. package/dist/client/assets/{decopilot-sse-pool-D2Qtyl-A.js → decopilot-sse-pool-CfYFArSW.js} +1 -1
  132. package/dist/client/assets/{dialog-DJBpjJnY.js → dialog-otnvxVN0.js} +1 -1
  133. package/dist/client/assets/{discover-y7BsppSE.js → discover-BZKxvY_j.js} +1 -1
  134. package/dist/client/assets/{domain-settings-B_cuGCF0.js → domain-settings-QORwmdcG.js} +1 -1
  135. package/dist/client/assets/{download-app-dialog-DYhv8XsJ.js → download-app-dialog-BqNRF4Sn.js} +1 -1
  136. package/dist/client/assets/{drawer-B5NRhNfW.js → drawer-s7gtDrb4.js} +1 -1
  137. package/dist/client/assets/{dropdown-menu-DzwCPltk.js → dropdown-menu-BxKUbUkE.js} +1 -1
  138. package/dist/client/assets/{editor-BHnwprUT.js → editor-DCxsAs7o.js} +1 -1
  139. package/dist/client/assets/{empty-state-CJ95hR0w.js → empty-state-CL4F2BS4.js} +1 -1
  140. package/dist/client/assets/{empty-state-CXolWOTn.js → empty-state-Cz1DkYZE.js} +1 -1
  141. package/dist/client/assets/{extract-connection-data-B1nPGa4h.js → extract-connection-data-CqGCTPdZ.js} +1 -1
  142. package/dist/client/assets/{file-explorer-Dj1zqDxa.js → file-explorer-Uvp7ogK8.js} +1 -1
  143. package/dist/client/assets/{file-preview-kRDXQYfi.js → file-preview-18IJQMnU.js} +1 -1
  144. package/dist/client/assets/{file-share-button-P5GnoZYM.js → file-share-button-Cef5f1VZ.js} +1 -1
  145. package/dist/client/assets/{file-type-icon-Cg81au_Z.js → file-type-icon-DGllFDOf.js} +1 -1
  146. package/dist/client/assets/{folder-icon-Bey_C_xd.js → folder-icon-p8jB76CU.js} +1 -1
  147. package/dist/client/assets/{form-EGCuUtdG.js → form-KjPevg0A.js} +1 -1
  148. package/dist/client/assets/{general-BJ_Ksgnn.js → general-t-IB2WC3.js} +1 -1
  149. package/dist/client/assets/{github-icon-CiNkodR8.js → github-icon-D51q_6S8.js} +1 -1
  150. package/dist/client/assets/{home-Cmddezu3.js → home-Bhl8U_ph.js} +1 -1
  151. package/dist/client/assets/{hooks-Bb9SArul.js → hooks-BhviOOpn.js} +1 -1
  152. package/dist/client/assets/{hooks-BSkeWBV7.js → hooks-k1OxvonE.js} +1 -1
  153. package/dist/client/assets/{index-6GXqHE0w.js → index-B3yBTWEk.js} +4 -4
  154. package/dist/client/assets/{index-BVRQ9yUZ.js → index-Bwc7J041.js} +1 -1
  155. package/dist/client/assets/{index-CY40-aHW.js → index-C1N-CFMR.js} +1 -1
  156. package/dist/client/assets/{index-BaItIL-_.js → index-C7WIaN4y.js} +1 -1
  157. package/dist/client/assets/{index-DCQ3taiG.js → index-CRCvoACn.js} +1 -1
  158. package/dist/client/assets/{index-B9bOVdMd.js → index-D4YJGrDI.js} +3 -3
  159. package/dist/client/assets/{index-hC6VOnUm.js → index-DD-r2o4M.js} +1 -1
  160. package/dist/client/assets/{index-CUa7fAjf.js → index-DOk05MCp.js} +1 -1
  161. package/dist/client/assets/{index-B7ENeoW4.js → index-DlQKfvnq.js} +1 -1
  162. package/dist/client/assets/{index-Cu77hgR2.js → index-DqX9hbqM.js} +1 -1
  163. package/dist/client/assets/{index-Dg14Zpi9.js → index-fTs6ROSj.js} +1 -1
  164. package/dist/client/assets/{index-qEipD_7S.js → index-m01im2kT.js} +1 -1
  165. package/dist/client/assets/{index-redirect-BRL1uQPT.js → index-redirect-e7Kr1hOd.js} +1 -1
  166. package/dist/client/assets/{index-cEqwHhEg.js → index-w1d_dmEj.js} +1 -1
  167. package/dist/client/assets/{index-9FQARZdh.js → index-xVQnUsdi.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-C7FrFXuf.js → infiniteQueryObserver-DgAoAIrN.js} +1 -1
  169. package/dist/client/assets/{infra-billing-B0e93_qz.js → infra-billing-B2HwpfSN.js} +1 -1
  170. package/dist/client/assets/{input-D8xrvlz-.js → input-BnbYz5_9.js} +1 -1
  171. package/dist/client/assets/{input-BRqLi1TH.js → input-DxAgQLPa.js} +1 -1
  172. package/dist/client/assets/{input-TvernbmY.js → input-HFOrJf5B.js} +1 -1
  173. package/dist/client/assets/{integration-icon-B6H5J7sl.js → integration-icon-BPwWRlNG.js} +1 -1
  174. package/dist/client/assets/{invite-member-dialog-CsolElt3.js → invite-member-dialog-vPcEYe6v.js} +1 -1
  175. package/dist/client/assets/{label-aWEsDmHM.js → label-CqlSWrLn.js} +1 -1
  176. package/dist/client/assets/{layout-CAwe_kK2.js → layout-aU1eoqDA.js} +1 -1
  177. package/dist/client/assets/{legacy-agents-deep-DJ_t0QLc.js → legacy-agents-deep-CpKjJlPs.js} +1 -1
  178. package/dist/client/assets/{legacy-main-redirect-CySqEohs.js → legacy-main-redirect-ZPChWdtD.js} +1 -1
  179. package/dist/client/assets/{library-DRmbr8Ht.js → library-uYIcEGdr.js} +1 -1
  180. package/dist/client/assets/{login-DQDbHhI7.js → login-CfxNz6kc.js} +1 -1
  181. package/dist/client/assets/{markdown-CBvmi8AF.js → markdown-B1038zFJ.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-BQ7hPzlx.js → mcp-app-renderer-Cb8Ud-E7.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-DhRKpyTH.js → mcp-oauth-D6isOO_s.js} +1 -1
  184. package/dist/client/assets/{members-NHaXKGgP.js → members-DHLsomPg.js} +1 -1
  185. package/dist/client/assets/{mini-report-page-BcG9QHwQ.js → mini-report-page-iTjakIrU.js} +1 -1
  186. package/dist/client/assets/{monaco-editor-C5zvkMO4.js → monaco-editor-WNMTPDp9.js} +1 -1
  187. package/dist/client/assets/{monitoring-stats-row-CWqusnLf.js → monitoring-stats-row-B_mR1zw-.js} +1 -1
  188. package/dist/client/assets/{multi-select-CvACpZbb.js → multi-select-D54pM3d4.js} +1 -1
  189. package/dist/client/assets/{mustache-DQXz9E52.js → mustache-r9snVmI4.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-BHJTnNxG.js → oauth-callback-GAK1H0Is.js} +1 -1
  191. package/dist/client/assets/{oauth-callback-ai-provider-wF0_7wc5.js → oauth-callback-ai-provider-sdaHeEFx.js} +1 -1
  192. package/dist/client/assets/{onboarding-20FUHLvO.js → onboarding-BKPW4du6.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-DKtRXqQ0.js → optimistic-project-sidebar-views-yrtk59Mo.js} +1 -1
  194. package/dist/client/assets/{org-layout-DRrVivAL.js → org-layout-BNIg984j.js} +1 -1
  195. package/dist/client/assets/{organization-choice-BmSYuBSE.js → organization-choice-DvXG7tgx.js} +1 -1
  196. package/dist/client/assets/{orgs-1ZlqeM-y.js → orgs-NTyzCYi-.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-Cpi2Oike.js → page-seo-form-DAkbVQPg.js} +1 -1
  198. package/dist/client/assets/{pair-CD8Vxcvs.js → pair-C08OPQNP.js} +1 -1
  199. package/dist/client/assets/{popover-Ci-k968-.js → popover-DIqZ2IKF.js} +1 -1
  200. package/dist/client/assets/{post-calendar-CgTLYrrU.js → post-calendar-DuH_hA9y.js} +1 -1
  201. package/dist/client/assets/{post-editor-DyayPm7u.js → post-editor-BAf6FqSQ.js} +1 -1
  202. package/dist/client/assets/{preview-content-DhEgigNG.js → preview-content-B5xB74fu.js} +1 -1
  203. package/dist/client/assets/{preview-dialog-CKWnRekk.js → preview-dialog-b2QyOGzU.js} +1 -1
  204. package/dist/client/assets/{primitives-1lR28duD.js → primitives-4_D03rJK.js} +1 -1
  205. package/dist/client/assets/{profile-DixSbE4L.js → profile-COT-hKKD.js} +1 -1
  206. package/dist/client/assets/{project-app-view-DBHiU3Rg.js → project-app-view-DJ_q7UHg.js} +1 -1
  207. package/dist/client/assets/{project-feed-boKgu_TR.js → project-feed-DJ_jJM3E.js} +1 -1
  208. package/dist/client/assets/{project-icon-DIXBuD-A.js → project-icon-Bl3bXnhv.js} +1 -1
  209. package/dist/client/assets/project-reports-q4w3pT5T.js +1 -0
  210. package/dist/client/assets/project-tasks-DqlAyIfE.js +1 -0
  211. package/dist/client/assets/{prompts-BROxvafI.js → prompts-CI44HEcf.js} +1 -1
  212. package/dist/client/assets/record-editor-n0M7yiQw.js +1 -0
  213. package/dist/client/assets/redirect-editor-CK3YSOdb.js +1 -0
  214. package/dist/client/assets/registry-DkzCUqTc.js +2 -0
  215. package/dist/client/assets/{registry-layout-BUEF9YqP.js → registry-layout-CvRfdld3.js} +1 -1
  216. package/dist/client/assets/{reports-B1C9NU2m.js → reports-C-eaYxW3.js} +1 -1
  217. package/dist/client/assets/reports-C2LVTrmJ.js +1 -0
  218. package/dist/client/assets/{reports-tab-uLMivl2p.js → reports-tab-qffeKlGd.js} +2 -2
  219. package/dist/client/assets/repositories-ao250fUH.js +1 -0
  220. package/dist/client/assets/{repository-import-picker-DVnadPZ8.js → repository-import-picker-Bg_h8YsG.js} +1 -1
  221. package/dist/client/assets/repository-picker-BDWGy2xY.js +1 -0
  222. package/dist/client/assets/{require-capability-DSFKKTc-.js → require-capability-CmR_46yt.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-DMNBbcf3.js → required-auth-layout-BEc3NUsQ.js} +1 -1
  224. package/dist/client/assets/{reset-password-GCDcBOjo.js → reset-password-BlF157J6.js} +1 -1
  225. package/dist/client/assets/{review-settings-VwYzzjCc.js → review-settings-BBciVvfB.js} +1 -1
  226. package/dist/client/assets/{rich-text-link-control-C6A8Q9Jd.js → rich-text-link-control-CrwbAR31.js} +1 -1
  227. package/dist/client/assets/{roles-PgEO9KN-.js → roles-CuHUTdKb.js} +1 -1
  228. package/dist/client/assets/{runnable-block-editor-Db2XbJYi.js → runnable-block-editor-2CMWc-S3.js} +1 -1
  229. package/dist/client/assets/{sandbox-lifecycle-context-DxbfUbxP.js → sandbox-lifecycle-context-CXd9Um8u.js} +1 -1
  230. package/dist/client/assets/{schema-Cnskrzk1.js → schema-BQbhQoxs.js} +1 -1
  231. package/dist/client/assets/{scroll-area-CaE3a4_T.js → scroll-area-BgZjjLM3.js} +1 -1
  232. package/dist/client/assets/{search-input-lFP9sD3O.js → search-input-uXtJ6IU8.js} +1 -1
  233. package/dist/client/assets/{secrets-BU_daRxy.js → secrets-C1mCKV1g.js} +1 -1
  234. package/dist/client/assets/{sections-editor-D-W8vM7g.js → sections-editor-Bv2odcBq.js} +1 -1
  235. package/dist/client/assets/{select-Ce9NznPv.js → select-Bc5UZb4n.js} +1 -1
  236. package/dist/client/assets/{select-model-CjTijsS7.js → select-model-BDGEzt-Y.js} +1 -1
  237. package/dist/client/assets/{seo-editor-O94He1NF.js → seo-editor-DJw3ydvJ.js} +1 -1
  238. package/dist/client/assets/settings-layout-DlH0gQXK.js +1 -0
  239. package/dist/client/assets/{settings-sidebar-BcAe-WS4.js → settings-sidebar-DswZBMwm.js} +1 -1
  240. package/dist/client/assets/{settings-tab-Cg5CqTki.js → settings-tab-Ru2atFmZ.js} +1 -1
  241. package/dist/client/assets/{shell-controls-gkZZS07l.js → shell-controls-DkLEUvEw.js} +1 -1
  242. package/dist/client/assets/{shell-layout-C3IRibnI.js → shell-layout-1dFmVwYI.js} +1 -1
  243. package/dist/client/assets/{skill-preview-MIddvDZe.js → skill-preview-CGe8kUoa.js} +1 -1
  244. package/dist/client/assets/{skills-hRnVKZ5K.js → skills-BGdKR-aF.js} +1 -1
  245. package/dist/client/assets/{sso-BePH_NId.js → sso-M-OsbEtw.js} +1 -1
  246. package/dist/client/assets/{store-CqeIEwHN.js → store-BY4ZRY7y.js} +1 -1
  247. package/dist/client/assets/store-registry-DQHLJpOA.js +2 -0
  248. package/dist/client/assets/{switch-D5GcuD9Z.js → switch-CJ5Ir2Zx.js} +1 -1
  249. package/dist/client/assets/{synced-repos-Cnp4m7yg.js → synced-repos-9D-CfhL7.js} +1 -1
  250. package/dist/client/assets/{table-O0SpY8ZO.js → table-Di_WRNkb.js} +1 -1
  251. package/dist/client/assets/{tabs-DQoXHeZr.js → tabs-DV8akPGb.js} +1 -1
  252. package/dist/client/assets/{task-board-DyZE7mH1.js → task-board-CXsHf2Zn.js} +1 -1
  253. package/dist/client/assets/{task-route-CayeX6cv.js → task-route-D79aS9d_.js} +1 -1
  254. package/dist/client/assets/{task-status-CyTozLxL.js → task-status-DIr_2V94.js} +1 -1
  255. package/dist/client/assets/tasks-C6DyE2q-.js +1 -0
  256. package/dist/client/assets/{tasks-Da-h-zLm.js → tasks-CiIHA5f1.js} +1 -1
  257. package/dist/client/assets/{textarea-BpFOmm9_.js → textarea-CneoU2lJ.js} +1 -1
  258. package/dist/client/assets/{thread-intent-AJKohiRy.js → thread-intent-DVKldCEq.js} +1 -1
  259. package/dist/client/assets/{thread-route-CEvVLI2K.js → thread-route-CKY-dKC0.js} +1 -1
  260. package/dist/client/assets/{thread-sheet-body-Bs4b4fMK.js → thread-sheet-body-CcUGPZXB.js} +1 -1
  261. package/dist/client/assets/{toggle-group-Cs1yIHkK.js → toggle-group-9HQCpj-q.js} +1 -1
  262. package/dist/client/assets/{tool-namespace-ySa3S1AM.js → tool-namespace-BVMQcKlk.js} +1 -1
  263. package/dist/client/assets/{toolbar-DOOz2W24.js → toolbar-D0oe2g2b.js} +1 -1
  264. package/dist/client/assets/{toolbar-icon-button-Dp-AbzNZ.js → toolbar-icon-button-EOE8J-Ai.js} +1 -1
  265. package/dist/client/assets/{track-Dns1NpdC.js → track-BzMi8kcZ.js} +1 -1
  266. package/dist/client/assets/{types-C1gRrnQe.js → types-Csu6Ims7.js} +1 -1
  267. package/dist/client/assets/{usage-stats-D5mXC24B.js → usage-stats-BNse37Wk.js} +1 -1
  268. package/dist/client/assets/{use-ai-providers-Bg_y9f3x.js → use-ai-providers-qnkcjapR.js} +1 -1
  269. package/dist/client/assets/{use-automations-BI_yIok-.js → use-automations-CYOC_eS5.js} +1 -1
  270. package/dist/client/assets/{use-autosave-BB0U2eiK.js → use-autosave-CCprSQ13.js} +1 -1
  271. package/dist/client/assets/{use-commerce-diagnostic-DqKipeip.js → use-commerce-diagnostic-mdvL2BW-.js} +1 -1
  272. package/dist/client/assets/{use-connect-companion-Mci4Y6hu.js → use-connect-companion-2fL060lG.js} +1 -1
  273. package/dist/client/assets/{use-connection-DCUpGmsb.js → use-connection-DCLPda2h.js} +1 -1
  274. package/dist/client/assets/{use-copy-GVBAvo9n.js → use-copy-14DzRp8J.js} +1 -1
  275. package/dist/client/assets/{use-create-virtual-mcp-CizXpVyQ.js → use-create-virtual-mcp-DoCSQs95.js} +1 -1
  276. package/dist/client/assets/{use-date-fns-locale-CcPpBz8y.js → use-date-fns-locale-DYzMvrWB.js} +1 -1
  277. package/dist/client/assets/{use-debounced-autosave-wCEzYUZh.js → use-debounced-autosave-BRAVEUZc.js} +1 -1
  278. package/dist/client/assets/{use-debounced-value-D0SYNQsR.js → use-debounced-value-Cud3o3Fq.js} +1 -1
  279. package/dist/client/assets/{use-deco-credits-DjxZxHMq.js → use-deco-credits-rwNQ1gMg.js} +1 -1
  280. package/dist/client/assets/{use-decopilot-events-zpeu2MCG.js → use-decopilot-events-DYRVevWg.js} +1 -1
  281. package/dist/client/assets/{use-delete-connection-B-DNpbCU.js → use-delete-connection-ueGIYWMK.js} +1 -1
  282. package/dist/client/assets/{use-deployment-admin-Dpkh4HgH.js → use-deployment-admin-D6IzoXV0.js} +1 -1
  283. package/dist/client/assets/{use-file-configs-B1FdrMZJ.js → use-file-configs-BwD1CaWo.js} +1 -1
  284. package/dist/client/assets/{use-infinite-scroll-BXOEU8Y7.js → use-infinite-scroll-DkLPxlOu.js} +1 -1
  285. package/dist/client/assets/{use-join-requests-1Ow065Yq.js → use-join-requests-DTGTfD21.js} +1 -1
  286. package/dist/client/assets/{use-main-panel-tabs-CeyJWpQP.js → use-main-panel-tabs-EW6rbxam.js} +1 -1
  287. package/dist/client/assets/{use-mcp-auth-status-CSQiZCDG.js → use-mcp-auth-status-CPh3Lmzs.js} +1 -1
  288. package/dist/client/assets/{use-mcp-client-Bq-mjhw3.js → use-mcp-client-DsJzBus3.js} +1 -1
  289. package/dist/client/assets/{use-mcp-prompts-CWmeNLXn.js → use-mcp-prompts-i0LZ2nQA.js} +1 -1
  290. package/dist/client/assets/{use-mcp-tools-DGdyHn8U.js → use-mcp-tools-Dc3F6Krl.js} +1 -1
  291. package/dist/client/assets/{use-members-Dnee1tF2.js → use-members-C0MdJrYz.js} +1 -1
  292. package/dist/client/assets/{use-navigate-to-agent-Drdqs1cr.js → use-navigate-to-agent-Bbq0oQ0Y.js} +1 -1
  293. package/dist/client/assets/{use-open-billing-url-Cju1isPI.js → use-open-billing-url-DvTk9GH0.js} +1 -1
  294. package/dist/client/assets/{use-org-auth-client-CVFBkaiI.js → use-org-auth-client-4o0wRx2Q.js} +1 -1
  295. package/dist/client/assets/{use-org-fs-DG1oJieK.js → use-org-fs-BEoPvlnI.js} +1 -1
  296. package/dist/client/assets/{use-org-notice-PUfO84YR.js → use-org-notice-CXYMfMUq.js} +1 -1
  297. package/dist/client/assets/{use-org-sso-uleG21Aq.js → use-org-sso-CdSz0xa8.js} +1 -1
  298. package/dist/client/assets/{use-organization-roles-yO3kgQbK.js → use-organization-roles-DzWM9Nv-.js} +1 -1
  299. package/dist/client/assets/{use-organization-settings-DrJN-E78.js → use-organization-settings-BAVHurZk.js} +1 -1
  300. package/dist/client/assets/{use-panel-navigate-CCqZdv2O.js → use-panel-navigate-Byvx0cbx.js} +1 -1
  301. package/dist/client/assets/{use-project-native-view-presence-01L5j4lu.js → use-project-native-view-presence-D-AyEulW.js} +1 -1
  302. package/dist/client/assets/{use-project-scope-DZ9tacAx.js → use-project-scope-B2cuvtTy.js} +1 -1
  303. package/dist/client/assets/{use-registry-connections-cro5WL6A.js → use-registry-connections-DikbDR8w.js} +1 -1
  304. package/dist/client/assets/{use-secrets-w6G8jtp4.js → use-secrets-D-c1ciPZ.js} +1 -1
  305. package/dist/client/assets/{use-section-preview-base-lro_p1nx.js → use-section-preview-base-CwIWGkgy.js} +1 -1
  306. package/dist/client/assets/{use-session-runtime-TS34dEJv.js → use-session-runtime-BHahDP0E.js} +1 -1
  307. package/dist/client/assets/{use-status-sounds-DQ2pMmh0.js → use-status-sounds-CnCb1h48.js} +1 -1
  308. package/dist/client/assets/{use-tags-B6zE47mm.js → use-tags-C2LhenRb.js} +1 -1
  309. package/dist/client/assets/{use-task-metadata-C4MfiHBQ.js → use-task-metadata-CB3EJ29f.js} +1 -1
  310. package/dist/client/assets/{use-thread-outputs-CpCqTMOi.js → use-thread-outputs-9oZhiYbB.js} +1 -1
  311. package/dist/client/assets/{use-view-mode-B9wUn2ad.js → use-view-mode-BvOL5I4W.js} +1 -1
  312. package/dist/client/assets/{use-virtual-mcp-CMlCV8Oj.js → use-virtual-mcp-Bk09OpEg.js} +1 -1
  313. package/dist/client/assets/useInfiniteQuery-GKCP1c_7.js +1 -0
  314. package/dist/client/assets/{useQueries-C6OAJOs7.js → useQueries-qr8TAkZc.js} +1 -1
  315. package/dist/client/assets/useSuspenseInfiniteQuery-DmEiIBI4.js +1 -0
  316. package/dist/client/assets/{users-CYflDdFv.js → users-C1ExMDuM.js} +1 -1
  317. package/dist/client/assets/{utils-B-5U5Z26.js → utils-B14U8IKK.js} +1 -1
  318. package/dist/client/assets/{variant-calendar-BsFwTl3D.js → variant-calendar-urd0wE-3.js} +1 -1
  319. package/dist/client/assets/{variant-matcher-override-CRlEf4IL.js → variant-matcher-override-DvY-JiuY.js} +1 -1
  320. package/dist/client/assets/{view-mode-toggle-kY4gR8CN.js → view-mode-toggle-swSorpD7.js} +1 -1
  321. package/dist/client/assets/{virtual-mcp-CKi1xJsO.js → virtual-mcp-DGQbDtgM.js} +1 -1
  322. package/dist/client/index.html +1 -1
  323. package/dist/server/cli.js +678 -668
  324. package/dist/server/migrate.js +171 -161
  325. package/dist/server/server.js +418 -418
  326. package/package.json +1 -1
  327. package/dist/client/assets/agent-app-62cavSHy.js +0 -1
  328. package/dist/client/assets/agent-deck-DVW32bsA.js +0 -1
  329. package/dist/client/assets/agent-file-C7nywZCe.js +0 -1
  330. package/dist/client/assets/agent-library-file-D4p-8dXS.js +0 -1
  331. package/dist/client/assets/agent-settings-CxGAsqqN.js +0 -1
  332. package/dist/client/assets/agent-site-editor-code-Dcgjtfwk.js +0 -2
  333. package/dist/client/assets/agent-view-DYYYDEW_.js +0 -1
  334. package/dist/client/assets/api-keys-DoGNEUpY.js +0 -1
  335. package/dist/client/assets/app-editor-CRjlYU-M.js +0 -1
  336. package/dist/client/assets/automations-CKhgbURI.js +0 -1
  337. package/dist/client/assets/category-editor-zLRtagcy.js +0 -1
  338. package/dist/client/assets/project-reports-ChLta7_v.js +0 -1
  339. package/dist/client/assets/project-tasks-nUWazd1g.js +0 -1
  340. package/dist/client/assets/record-editor-FqHaN2k4.js +0 -1
  341. package/dist/client/assets/redirect-editor-CWYZom_C.js +0 -1
  342. package/dist/client/assets/registry-C3_EEMj-.js +0 -2
  343. package/dist/client/assets/reports-BY7Ca1Ey.js +0 -1
  344. package/dist/client/assets/repositories-BgD13VwL.js +0 -1
  345. package/dist/client/assets/repository-picker-BGpoa_g_.js +0 -1
  346. package/dist/client/assets/settings-layout-CWQI71Tg.js +0 -1
  347. package/dist/client/assets/store-registry-BCokMLik.js +0 -2
  348. package/dist/client/assets/tasks-DGTMeQBa.js +0 -1
  349. package/dist/client/assets/useInfiniteQuery-CM35R0yt.js +0 -1
  350. package/dist/client/assets/useSuspenseInfiniteQuery-DWyGwvh9.js +0 -1
@@ -1,4 +1,4 @@
1
- import{K as ks,c as H,m as es,b as be,r as O,l as _e,j as h,h as gt,I as ut,au as Bi,$ as ls,E as Li,d as ji,u as Ii,f as ri,a as hs,n as Lc,M as Do,U as Ju,O as jc,a6 as Je,B as Pe,ap as Zu,aq as Ei,a7 as Ze,a9 as Qe,t as Xe,av as Qu,o as Cs,aw as ef,ax as tf,a8 as Oi,ay as No,az as sf,z as rf,v as nf,F as Ic,e as Pn,x as of,ac as Mo,aA as af,aB as lf,ar as cf,y as Ia,k as hf,aC as df,aD as uf,R as Oc,aE as ff,N as pf}from"./index-6GXqHE0w.js";import{C as ht,w as _f,u as zc}from"./use-main-panel-tabs-CeyJWpQP.js";import{a as mf,u as gf}from"./use-organization-settings-DrJN-E78.js";import{b as ds,u as Bo,a as zi,c as $c,d as vf,e as bf,s as Sf}from"./chat-context-HB_KOUNM.js";import{u as ni}from"./use-session-runtime-TS34dEJv.js";import{u as yf}from"./use-ai-providers-Bg_y9f3x.js";import{i as Lo}from"./AlertCircle-CgERhdh6.js";import{i as jo}from"./CheckCircle-BGqFZ8sM.js";import{W as En,A as Ri,T as xf,o as Fc,Z as jr,_ as Hc,$ as Io,G as wf,a0 as Wc,a1 as Cf,a2 as kf,a3 as Pf,a4 as Ef,k as Rf,a5 as Tf,n as Af}from"./agent-icon-vDfwuZu4.js";import{i as Df}from"./XCircle-DudPVYQR.js";import{s as Oa}from"./XClose-DpDcHm9Y.js";import{a as us,b as Nf,u as Uc}from"./use-virtual-mcp-CMlCV8Oj.js";import{I as Kc}from"./integration-icon-B6H5J7sl.js";import{c as Mf}from"./usage-stats-D5mXC24B.js";import{t as $s,n as Bf}from"./ChevronUp-CbF1Gmeo.js";import{O as Lf,u as jf}from"./pair-CD8Vxcvs.js";import{u as If,a as Of}from"./use-thread-outputs-CpCqTMOi.js";import{u as zf}from"./use-deco-credits-DjxZxHMq.js";import{i as $f}from"./command-palette-store-D19nXDNm.js";import{b as Rn,f as Ff,c as Hf}from"./use-project-scope-DZ9tacAx.js";import{d as Oo,a as Wf,c as Uf}from"./thread-intent-AJKohiRy.js";import{u as zo,a as Ir,b as Kf,c as $o}from"./hooks-BSkeWBV7.js";import{p as qf,a as qc,b as Vf,c as Vc,d as Gf,e as Fo,f as Yf,g as Xf}from"./use-navigate-to-agent-Drdqs1cr.js";import{u as Or,c as Gc,a as Yc,d as Jf,e as Zf,o as Qf,s as ep,f as tp,g as sp,h as ip}from"./sandbox-lifecycle-context-DxbfUbxP.js";import{u as rp}from"./use-status-sounds-DQ2pMmh0.js";import{E as Xc}from"./empty-state-CXolWOTn.js";import{b as np,c as $i,a as Jc,u as Zc,r as op,d as ap}from"./thread-route-CEvVLI2K.js";import{a as lp,u as Ho,b as Qc,c as eh}from"./use-panel-navigate-CCqZdv2O.js";import{r as th,a as Ut,h as sh,b as ih,g as Wo}from"./github-repo-C0igpkr9.js";import{r as cp}from"./serial-task-queue-CGOeQgpr.js";import{T as hp}from"./toolbar-DOOz2W24.js";import{i as dp}from"./Share07-D1Sv14jA.js";import{b as up,c as rh,S as fp,d as pp}from"./select-Ce9NznPv.js";import{i as nh,s as _p}from"./source-system-tabs-CnEGUb4r.js";import{a as mp}from"./Package-CCkk0w5h.js";import{L as Uo,a as gp}from"./legacy-main-redirect-CySqEohs.js";import{L as vp}from"./preview-dialog-CKWnRekk.js";import{O as bp}from"./markdown-CBvmi8AF.js";import{u as oh}from"./use-is-desktop-app-BNujXJc_.js";import{p as Sp}from"./virtual-mcp-CKi1xJsO.js";import{b as za}from"./sandbox-url-D3mC8qhT.js";import{i as Sr}from"./Play-CPeIBqH_.js";import{c as Ko,D as qo,b as Vo,a as yr}from"./dropdown-menu-DzwCPltk.js";import{a as zr,b as Fi,P as Hi,c as yp}from"./popover-Ci-k968-.js";import{s as ah}from"./Plus-DaErdsG1.js";import{i as xp,a as wp}from"./UserSquare-yIpHwPSn.js";import{p as lh,I as ch,T as xr}from"./toolbar-icon-button-Dp-AbzNZ.js";import{L as hh}from"./anchors-yqDzZN4K.js";import{G as dh}from"./github-icon-CiNkodR8.js";import{D as Go,b as Yo,d as Cp,h as kp,c as Pp}from"./dialog-DJBpjJnY.js";import{T as uh}from"./textarea-BpFOmm9_.js";import{s as Xo}from"./Eye-Cd7v-liN.js";import{i as fh}from"./Globe01-BVji6jXS.js";import{a as ph}from"./format-time-BtXRrtv4.js";import{i as Jo}from"./ChevronRight-BNfU55ld.js";import{i as Ep}from"./Printer-BG6NfeSZ.js";import{s as _h}from"./Trash01-DQjprOwc.js";import{i as mh,G as gh,f as wi,p as Rp,r as vh,d as Tn,a as bh,b as cr,c as Tp,e as Ap,g as Sh,n as Dp,h as Np,j as Mp,k as Bp,l as Zo,m as Lp,o as yh,s as xh,q as jp,t as Ip,u as Op,v as zp,w as $a,x as $p,y as Fp,z as Zr,A as Hp,B as Wp,C as Up,D as Kp,E as qp,F as Vp,H as Gp,I as Fa}from"./decode-html-entities-Cf7wUEql.js";import{b as Yp}from"./utils-B-5U5Z26.js";import{u as $r,f as Xp}from"./shell-layout-C3IRibnI.js";import{u as Jp}from"./use-mcp-client-Bq-mjhw3.js";import{I as Zp}from"./input-TvernbmY.js";import{c as wh,a as Ch,T as wr,b as Ha}from"./tabs-DQoXHeZr.js";import{i as Qp}from"./ArrowRight-DZQert3q.js";import{i as An}from"./GitBranch01-Dil6c2wv.js";import{t as e_}from"./Stars01-f37Q7vDf.js";import{c as kh,d as Ph,b as Eh,f as Rh,g as Th,e as Ah,a as Dh,A as Nh}from"./alert-dialog-CiKfgw9r.js";import{e as Dn,C as Nn,a as Mn,c as Mh,d as Bh,b as Lh}from"./command-BpjWfGyr.js";import{i as t_}from"./DotsVertical-LmkOTjL4.js";import{i as s_}from"./Tool01-D6HOM_aJ.js";import{u as i_}from"./use-debounced-value-D0SYNQsR.js";import{u as r_}from"./useInfiniteQuery-CM35R0yt.js";import{i as n_}from"./Tool02-BrfQeZRx.js";import{a as o_,T as a_}from"./toggle-group-Cs1yIHkK.js";import{i as jh}from"./Zap-C5eiFR0N.js";import{g as l_,S as c_}from"./task-status-CyTozLxL.js";function Qo(t){return`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`}function h_(t,e,s){return["decofile-write",t,e,s]}function ea(t){return`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}`}async function Ih(t,e){const s=await t.json().catch(()=>({}));throw new Error(s.error??`${e} failed (${t.status})`)}function d_(t,e,s){t.setQueryData(ks.decofileDraft(Qo(e)),s)}function u_(t){const e=H.c(4);let s;e[0]!==t?(s=ks.decofileDraft(t?Qo(t):""),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==s?(i={queryKey:s,enabled:!1,queryFn:f_,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},e[2]=s,e[3]=i):i=e[3];const{data:r}=es(i);return r??null}async function f_(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Lw(t,e){const s=await fetch(ea(e),{cache:"no-store"});if(!s.ok){const r=new Error(`Failed to fetch decofile: ${s.status}`);throw r.status=s.status,r}const i=await s.json();return i.token&&d_(t,e,{version:i.version,token:i.token,apiHost:i.apiHost??window.location.host}),i.decofile}const p_=2880*60*1e3;function __(t,e,s=p_){if(!t)return!1;const i=new Date(t).getTime();return Number.isNaN(i)?!1:e-i>s}async function m_(t){const e=await fetch(`${ea(t)}/status`,{cache:"no-store"});return e.ok?await e.json():Ih(e,"Status")}function g_(t){return{queryKey:ks.decofileStatus(Qo(t)),queryFn:()=>m_(t),staleTime:3e4}}async function jw(t,e){const s=await fetch(ea(t),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!s.ok)return Ih(s,"Save");const i=await s.json();return{...i,apiHost:i.apiHost??window.location.host}}function v_({isThreadLocked:t,hasCloudProviderKeys:e}){return t?!1:!e}function b_(){const t=H.c(3),e=yf(),i=ds()?.isThreadLocked??!1,r=e.length>0;let n;return t[0]!==i||t[1]!==r?(n=v_({isThreadLocked:i,hasCloudProviderKeys:r}),t[0]=i,t[1]=r,t[2]=n):n=t[2],n}function li(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qr(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function S_(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function y_(t){const e=H.c(4),{items:s}=t;let i;e[0]!==s?(i=s.map(x_),e[0]=s,e[1]=i):i=e[1];let r;return e[2]!==i?(r=h.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:i}),e[2]=i,e[3]=r):r=e[3],r}function x_(t){return h.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),h.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function w_(t){const e=H.c(33),{userTokens:s,assistantTokens:i,otherTokens:r}=t,n=be(),o=s+i+r,a=o>0?s/o*100:0,c=o>0?i/o*100:0,l=o>0?r/o*100:0;let u;e[0]!==a?(u=a>0&&h.jsx("div",{className:"h-full bg-chart-1",style:{width:`${a}%`}}),e[0]=a,e[1]=u):u=e[1];let d;e[2]!==c?(d=c>0&&h.jsx("div",{className:"h-full bg-chart-2",style:{width:`${c}%`}}),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==l?(f=l>0&&h.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==u||e[7]!==d||e[8]!==f?(p=h.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[u,d,f]}),e[6]=u,e[7]=d,e[8]=f,e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=_):_=e[10];let g;e[11]!==n||e[12]!==a?(g=n("chat.contextPanel.userPercent",{pct:a.toFixed(1)}),e[11]=n,e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=h.jsxs("div",{className:"flex items-center gap-1.5",children:[_,h.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[14]=g,e[15]=v):v=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=b):b=e[16];let k;e[17]!==c||e[18]!==n?(k=n("chat.contextPanel.assistantPercent",{pct:c.toFixed(1)}),e[17]=c,e[18]=n,e[19]=k):k=e[19];let w;e[20]!==k?(w=h.jsxs("div",{className:"flex items-center gap-1.5",children:[b,h.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[20]=k,e[21]=w):w=e[21];let S;e[22]!==l||e[23]!==r||e[24]!==n?(S=r>0&&h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=r,e[24]=n,e[25]=S):S=e[25];let m;e[26]!==w||e[27]!==S||e[28]!==v?(m=h.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,w,S]}),e[26]=w,e[27]=S,e[28]=v,e[29]=m):m=e[29];let x;return e[30]!==m||e[31]!==p?(x=h.jsxs("div",{className:"flex flex-col gap-2",children:[p,m]}),e[30]=m,e[31]=p,e[32]=x):x=e[32],x}function C_(t){const e=H.c(14),{agentId:s,isError:i}=t,r=us(s),n=be();let o;e[0]!==r?.title||e[1]!==n?(o=r?.title??n("chat.subtask.subtaskNoun"),e[0]=r?.title,e[1]=n,e[2]=o):o=e[2];const a=o,c=r?.icon??null;let l;e[3]!==c||e[4]!==a?(l=h.jsx(Kc,{icon:c,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=c,e[4]=a,e[5]=l):l=e[5];const u=i?"text-destructive":"text-foreground";let d;e[6]!==u?(d=_e("shrink-0 font-medium",u),e[6]=u,e[7]=d):d=e[7];let f;e[8]!==a||e[9]!==d?(f=h.jsx("span",{className:d,children:a}),e[8]=a,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==l||e[12]!==f?(p=h.jsxs(h.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=p):p=e[13],p}function k_(t){const e=H.c(12),{isError:s}=t,i=be();let r;e[0]!==i?(r=i("chat.contextPanel.subtask"),e[0]=i,e[1]=r):r=e[1];const n=r;let o;e[2]!==n?(o=h.jsx(Kc,{icon:null,name:n,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=n,e[3]=o):o=e[3];const a=s?"text-destructive":"text-foreground";let c;e[4]!==a?(c=_e("shrink-0 font-medium",a),e[4]=a,e[5]=c):c=e[5];let l;e[6]!==n||e[7]!==c?(l=h.jsx("span",{className:c,children:n}),e[6]=n,e[7]=c,e[8]=l):l=e[8];let u;return e[9]!==o||e[10]!==l?(u=h.jsxs(h.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=u):u=e[11],u}function P_(t){const e=H.c(18),{part:s}=t,i=s.input?.agent_id,r=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,n=s.state==="output-error",o=s.state==="approval-requested";let a;e[0]!==n?(a=h.jsx(k_,{isError:n}),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==i||e[3]!==n?(c=h.jsx(C_,{agentId:i,isError:n}),e[2]=i,e[3]=n,e[4]=c):c=e[4];let l;e[5]!==a||e[6]!==c?(l=h.jsx(O.Suspense,{fallback:a,children:c}),e[5]=a,e[6]=c,e[7]=l):l=e[7];let u;e[8]!==s.input?(u=s.input?.prompt&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=u):u=e[9];let d;e[10]!==o||e[11]!==n||e[12]!==r?(d=h.jsx("span",{className:"ml-auto shrink-0",children:r?h.jsx(gt,{className:"size-3 text-muted-foreground"}):n?h.jsx(Df,{size:12,className:"text-destructive"}):o?h.jsx(Lo,{size:12,className:"text-warning"}):h.jsx(jo,{size:12,className:"text-success"})}),e[10]=o,e[11]=n,e[12]=r,e[13]=d):d=e[13];let f;return e[14]!==l||e[15]!==u||e[16]!==d?(f=h.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,u,d]}),e[14]=l,e[15]=u,e[16]=d,e[17]=f):f=e[17],f}function E_(t){const e=H.c(78),{onClose:s,back:i,className:r}=t,n=be(),[o,a]=O.useState(null),{messages:c}=Bo(),{activeTask:l}=zi(),{selectedModel:u,selectedVirtualMcp:d}=$c();let f,p,_,g,v,b,k,w;if(e[0]!==l||e[1]!==i||e[2]!==r||e[3]!==c||e[4]!==s||e[5]!==o?.id||e[6]!==u||e[7]!==d?.title||e[8]!==n){w=Symbol.for("react.early_return_sentinel");e:{const x=Mf(c),y=[...c].reverse().find(O_),C=y?.metadata?.usage,N=y?.metadata?.modelLimits?.contextWindow??u?.limits?.contextWindow??null,T=C?.contextTokens??0,R=N&&N>0?(T/N*100).toFixed(1):null,E=c;let P;e[17]!==E?(P=E.filter(I_).reduce(j_,0),e[17]=E,e[18]=P):P=e[18];const A=P,M=c;let L;e[19]!==M?(L=M.filter(L_).reduce(B_,0),e[19]=M,e[20]=L):L=e[20];const B=L,D=Math.max(0,x.totalTokens-A-B),j=c[0],K=c.at(-1),z=j?.metadata?.created_at??l?.created_at,G=K?.metadata?.created_at??l?.updated_at,I=c.filter(M_),V=c.flatMap(D_),$=u?.modelId?S_(u.modelId):"—",ee=d?.title??"Super Agent",se=[{label:n("chat.contextPanel.sessionLabel"),value:l?.title??n("chat.contextPanel.newChat")},{label:n("chat.contextPanel.messagesLabel"),value:I.length},{label:n("chat.contextPanel.agentLabel"),value:ee},{label:n("chat.contextPanel.modelLabel"),value:$},{label:n("chat.contextPanel.contextLimitLabel"),value:N?li(N):"—"},{label:n("chat.contextPanel.sessionTokensLabel"),value:x.totalTokens>0?li(x.totalTokens):"0"},{label:n("chat.contextPanel.usageLabel"),value:R!==null?`${R}%`:"—"},{label:n("chat.contextPanel.inputTokensLabel"),value:x.inputTokens>0?li(x.inputTokens):"0"},{label:n("chat.contextPanel.outputTokensLabel"),value:x.outputTokens>0?li(x.outputTokens):"0"},{label:n("chat.contextPanel.reasoningTokensLabel"),value:x.reasoningTokens>0?li(x.reasoningTokens):"0"},{label:n("chat.contextPanel.costLabel"),value:x.cost>0?`$${x.cost<.001?x.cost.toFixed(6):x.cost.toFixed(4)}`:"$0.00"},{label:n("chat.contextPanel.sessionCreatedLabel"),value:Qr(z)},{label:n("chat.contextPanel.lastActivityLabel"),value:Qr(G)}];if(!l&&I.length===0){let q;e[21]!==r?(q=_e("flex flex-col h-full w-full border-l border-border bg-background",r),e[21]=r,e[22]=q):q=e[22];let F;e[23]!==n?(F=n("chat.contextPanel.title"),e[23]=n,e[24]=F):F=e[24];let Q;e[25]!==F?(Q=h.jsx("span",{className:"text-sm font-medium text-foreground",children:F}),e[25]=F,e[26]=Q):Q=e[26];let he;e[27]!==i?(he=i?h.jsx(En,{size:14,className:"text-muted-foreground"}):h.jsx(Oa,{size:14,className:"text-muted-foreground"}),e[27]=i,e[28]=he):he=e[28];let ue;e[29]!==s||e[30]!==he?(ue=h.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:he}),e[29]=s,e[30]=he,e[31]=ue):ue=e[31];let fe;e[32]!==Q||e[33]!==ue?(fe=h.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[Q,ue]}),e[32]=Q,e[33]=ue,e[34]=fe):fe=e[34];let ne;e[35]!==n?(ne=n("chat.contextPanel.emptyState"),e[35]=n,e[36]=ne):ne=e[36];let ce;e[37]!==ne?(ce=h.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:h.jsx("p",{className:"text-xs text-muted-foreground",children:ne})}),e[37]=ne,e[38]=ce):ce=e[38];let de;e[39]!==q||e[40]!==fe||e[41]!==ce?(de=h.jsxs("div",{className:q,children:[fe,ce]}),e[39]=q,e[40]=fe,e[41]=ce,e[42]=de):de=e[42],w=de;break e}e[43]!==r?(b=_e("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[43]=r,e[44]=b):b=e[44];let ie;e[45]!==n?(ie=n("chat.contextPanel.title"),e[45]=n,e[46]=ie):ie=e[46];let Y;e[47]!==ie?(Y=h.jsx("span",{className:"text-sm font-medium text-foreground",children:ie}),e[47]=ie,e[48]=Y):Y=e[48];let Z;e[49]!==i?(Z=i?h.jsx(En,{size:14}):h.jsx(Oa,{size:14}),e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==s||e[52]!==Z?(X=h.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:Z}),e[51]=s,e[52]=Z,e[53]=X):X=e[53],e[54]!==Y||e[55]!==X?(k=h.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[Y,X]}),e[54]=Y,e[55]=X,e[56]=k):k=e[56],f="flex flex-col gap-8 p-6",p=V.length>0&&h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.subtasksSection")}),h.jsx("div",{className:"flex flex-col gap-1",children:V.map(A_)})]}),_=h.jsx(y_,{items:se});let U;e[57]!==n?(U=n("chat.contextPanel.contextBreakdownSection"),e[57]=n,e[58]=U):U=e[58];let J;e[59]!==U?(J=h.jsx("span",{className:"text-xs text-muted-foreground",children:U}),e[59]=U,e[60]=J):J=e[60];let ae;e[61]!==B||e[62]!==D||e[63]!==A?(ae=h.jsx(w_,{userTokens:A,assistantTokens:B,otherTokens:D}),e[61]=B,e[62]=D,e[63]=A,e[64]=ae):ae=e[64],e[65]!==J||e[66]!==ae?(g=h.jsxs("div",{className:"flex flex-col gap-3",children:[J,ae]}),e[65]=J,e[66]=ae,e[67]=g):g=e[67],v=I.length>0&&h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.rawMessagesSection")}),h.jsx("div",{className:"flex flex-col gap-1",children:I.map(q=>{const F=q.metadata?.created_at,Q=o?.id===q.id;return h.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[h.jsxs("button",{type:"button",onClick:()=>a(Q?null:q),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:_e("shrink-0 font-medium",q.role==="user"?"text-chart-1":"text-chart-2"),children:q.role}),h.jsx("span",{className:"text-muted-foreground",children:"•"}),h.jsx("span",{className:"truncate text-muted-foreground font-mono",children:q.id})]}),F&&h.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:Qr(F)})]}),Q&&h.jsxs(h.Fragment,{children:[q.role==="assistant"&&(()=>{const he=q.metadata?._request;if(!he)return null;const ue=he.systemSections??[],fe=Math.max(1,...ue.map(T_)),ne=ue.reduce(R_,0);return h.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-medium text-foreground",children:n("chat.contextPanel.requestLabel")}),h.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[he.activeTools??0," / ",he.tools??0," ",n("chat.contextPanel.toolsActive")]})]}),ue.length>0&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"text-muted-foreground",children:[n("chat.contextPanel.systemPromptLabel")," ",h.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ne/4).toLocaleString()," ",n("chat.contextPanel.tokAbbrev")]})]}),ue.map((ce,de)=>{const le=ce.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${de}`,re=ce.chars/fe*100,ge=Math.round(ce.chars/4);return h.jsxs("div",{className:"space-y-0.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"font-mono text-foreground truncate",children:le}),h.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",ge.toLocaleString()," ",n("chat.contextPanel.tokAbbrev")]})]}),h.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${re}%`}})})]},de)})]})]})})(),h.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(q,null,2)})]})]},q.id)})})]})}e[0]=l,e[1]=i,e[2]=r,e[3]=c,e[4]=s,e[5]=o?.id,e[6]=u,e[7]=d?.title,e[8]=n,e[9]=f,e[10]=p,e[11]=_,e[12]=g,e[13]=v,e[14]=b,e[15]=k,e[16]=w}else f=e[9],p=e[10],_=e[11],g=e[12],v=e[13],b=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let S;e[68]!==f||e[69]!==p||e[70]!==_||e[71]!==g||e[72]!==v?(S=h.jsxs("div",{className:f,children:[p,_,g,v]}),e[68]=f,e[69]=p,e[70]=_,e[71]=g,e[72]=v,e[73]=S):S=e[73];let m;return e[74]!==b||e[75]!==k||e[76]!==S?(m=h.jsxs("div",{className:b,children:[k,S]}),e[74]=b,e[75]=k,e[76]=S,e[77]=m):m=e[77],m}function R_(t,e){return t+e.chars}function T_(t){return t.chars}function A_(t,e){return h.jsx(P_,{part:t},e)}function D_(t){return(t.parts??[]).filter(N_)}function N_(t){return t.type==="tool-subtask"}function M_(t){return t.role!=="system"}function B_(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function L_(t){return t.role==="assistant"}function j_(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function I_(t){return t.role==="user"}function O_(t){return t.role==="assistant"&&t.metadata?.usage}function z_(t){const e=H.c(21),{onOpenContextPanel:s}=t,{org:i}=ut(),{selectedVirtualMcp:r}=$c();let n;e[0]!==i.id?(n=Bi(i.id),e[0]=i.id,e[1]=n):n=e[1];const a=r??n,l=us(a.id)??a,u=l.title??"Super Agent",d=l.icon??null,f=l.description??null;let p;e[2]!==d||e[3]!==u?(p=h.jsx(Ri,{icon:d,name:u,size:"lg"}),e[2]=d,e[3]=u,e[4]=p):p=e[4];let _;e[5]!==u?(_=h.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:u}),e[5]=u,e[6]=_):_=e[6];let g;e[7]!==f?(g=f?h.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=g):g=e[8];let v;e[9]!==_||e[10]!==g?(v=h.jsxs("div",{className:"space-y-1.5",children:[_,g]}),e[9]=_,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p||e[13]!==v?(b=h.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[p,v]}),e[12]=p,e[13]=v,e[14]=b):b=e[14];let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(ht.IceBreakers,{className:"pb-3"}),e[15]=k):k=e[15];let w;e[16]!==s?(w=h.jsxs(ht.Footer,{children:[k,h.jsx(ht.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=w):w=e[17];let S;return e[18]!==b||e[19]!==w?(S=h.jsxs(h.Fragment,{children:[b,w]}),e[18]=b,e[19]=w,e[20]=S):S=e[20],S}function Wa(t){const e=H.c(17),{outputs:s,collapsed:i,onToggle:r,variant:n}=t,o=n==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let a;e[0]!==o?(a=_e(o),e[0]=o,e[1]=a):a=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=c):c=e[2];const l=i&&"-rotate-90";let u;e[3]!==l?(u=_e("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=u):u=e[4];let d;e[5]!==u?(d=h.jsx($s,{className:u}),e[5]=u,e[6]=d):d=e[6];let f;e[7]!==r||e[8]!==d?(f=h.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[c,d]}),e[7]=r,e[8]=d,e[9]=f):f=e[9];let p;e[10]!==i||e[11]!==s?(p=!i&&h.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map($_)}),e[10]=i,e[11]=s,e[12]=p):p=e[12];let _;return e[13]!==a||e[14]!==f||e[15]!==p?(_=h.jsxs("div",{className:a,children:[f,p]}),e[13]=a,e[14]=f,e[15]=p,e[16]=_):_=e[16],_}function $_(t){return h.jsx(Lf,{file:t},t.key)}function F_(){const t=H.c(13),e=ds()?.taskId??null,s=If();let i;t[0]!==s?(i={enabled:s},t[0]=s,t[1]=i):i=t[1];const{data:r}=Of(e,i),[n,o]=O.useState(!1),[a,c]=O.useState(!0);if(!e||!r||r.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(W_),t[2]=l):l=t[2];let u;t[3]!==n||t[4]!==r?(u=h.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:h.jsx(Wa,{variant:"card",outputs:r,collapsed:n,onToggle:l})}),t[3]=n,t[4]=r,t[5]=u):u=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=()=>c(H_),t[6]=d):d=t[6];let f;t[7]!==a||t[8]!==r?(f=h.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:h.jsx(Wa,{variant:"bar",outputs:r,collapsed:a,onToggle:d})}),t[7]=a,t[8]=r,t[9]=f):f=t[9];let p;return t[10]!==u||t[11]!==f?(p=h.jsxs(h.Fragment,{children:[u,f]}),t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function H_(t){return!t}function W_(t){return!t}function U_(){const t=H.c(31),{org:e}=ut(),s=ds(),{isChatEmpty:i}=Bo(),[r,n]=O.useState("chat"),o=zf(),a=b_(),{runtime:c}=ni(s?.virtualMcpId);if(a&&c!=="cms"){let T;return t[0]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(ht,{className:"animate-in fade-in-0 duration-200",children:h.jsx(ht.Main,{className:"flex flex-col items-center",children:h.jsx(ht.EmptyState,{children:h.jsx(ht.NoAiProviderEmptyState,{})})})}),t[0]=T):T=t[0],T}let u;t[1]!==o.hasDecoKey||t[2]!==o.hasOnlyDecoProvider||t[3]!==o.isLoading||t[4]!==o.isZeroBalance||t[5]!==i||t[6]!==e?(u=o.hasDecoKey&&o.isZeroBalance&&o.hasOnlyDecoProvider&&!o.isLoading&&i&&!_f(e.id),t[1]=o.hasDecoKey,t[2]=o.hasOnlyDecoProvider,t[3]=o.isLoading,t[4]=o.isZeroBalance,t[5]=i,t[6]=e,t[7]=u):u=t[7];const d=u;let f;t[8]!==d?(f=d&&h.jsx(ht.CreditsEmptyState,{}),t[8]=d,t[9]=f):f=t[9];const p=r!=="chat"?!0:void 0,_=r!=="chat",g=r!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let v;t[10]!==g?(v=_e("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",g),t[10]=g,t[11]=v):v=t[11];let b;t[12]!==i||t[13]!==c?(b=i&&c!=="cms"?h.jsx(z_,{onOpenContextPanel:()=>n("context")}):h.jsxs(h.Fragment,{children:[h.jsxs(ht.Main,{className:"relative flex flex-col overflow-hidden @container",children:[h.jsx(F_,{}),h.jsx("div",{className:"min-h-0 flex-1",children:h.jsx(ht.Messages,{})})]}),h.jsx(ht.Footer,{children:h.jsx(ht.Input,{onOpenContextPanel:()=>n("context")})})]}),t[12]=i,t[13]=c,t[14]=b):b=t[14];let k;t[15]!==p||t[16]!==_||t[17]!==v||t[18]!==b?(k=h.jsx("div",{inert:p,"aria-hidden":_,className:v,children:b}),t[15]=p,t[16]=_,t[17]=v,t[18]=b,t[19]=k):k=t[19];const w=r!=="context"?!0:void 0,S=r!=="context",m=r==="context"?"opacity-100":"opacity-0 pointer-events-none";let x;t[20]!==m?(x=_e("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",m),t[20]=m,t[21]=x):x=t[21];let y;t[22]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(E_,{back:!0,onClose:()=>n("chat")}),t[22]=y):y=t[22];let C;t[23]!==x||t[24]!==w||t[25]!==S?(C=h.jsx("div",{inert:w,"aria-hidden":S,className:x,children:y}),t[23]=x,t[24]=w,t[25]=S,t[26]=C):C=t[26];let N;return t[27]!==f||t[28]!==C||t[29]!==k?(N=h.jsxs(ht,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[f,k,C]}),t[27]=f,t[28]=C,t[29]=k,t[30]=N):N=t[30],N}function Oh(){const t=H.c(7),e=be();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let i;t[2]!==s?(i=h.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=i):i=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(ls,{children:h.jsx(U_,{})}),t[4]=r):r=t[4];let n;return t[5]!==i?(n=h.jsx(Li,{fallback:i,children:r}),t[5]=i,t[6]=n):n=t[6],n}function K_(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function ta(t){return t?.name||t?.email?.split("@")[0]||void 0}function ti(t){const e=K_(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function zh(t){return!!t.harness_id||!!t.title&&t.title!=="New chat"}function q_(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}function V_(t){return t.sidePanelOpen||t.mainOpen?t:{...t,sidePanelOpen:!0}}function G_(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",i=t.mainPanelParam??(t.panelNamed||!!t.routeDefaultMain||!s),r=t.routeDefaultMain?!1:s||t.entityMetadata?.chatDefaultOpen===!0||t.threadHasMessages===!0,n=t.sidePanelParamPresent?t.sidePanelParamValue===!0:r;return V_({sidePanelOpen:n,mainOpen:i})}function Ua(t,e){switch(t.type){case"toggleSidePanel":return e.sidePanelOpen?e.mainOpen?{sidepanel:!1}:null:{sidepanel:!0};case"toggleMain":return e.mainOpen?{mainpanel:!1,sidepanel:!0}:{mainpanel:!0};case"openSidePanel":return e.sidePanelOpen?null:{sidepanel:!0}}}function Y_(t){return t.sidePanelOpen&&t.mainOpen?{side:33,main:67}:t.sidePanelOpen?{side:100,main:0}:t.mainOpen?{side:0,main:100}:{side:0,main:0}}function X_(t){const{sidePanelOpen:e,mainOpen:s}=t.visibility;return e&&(t.sidePanelParamPresent||!s)?"chat":s?"main":"chat"}function J_(t){return t==="main"?{sidepanel:!1,mainpanel:!0}:{sidepanel:!0,mainpanel:!1}}function Z_(t,e){const s=ji(),i=np(),r=Ii({strict:!1}),n=ri({strict:!1}),{create:o}=zo(),{threads:a}=Ir(),{virtualMcpId:c,isAgentRoute:l}=e,u=lp(),d=Ho(),f=$i(),p=O.useRef(crypto.randomUUID()),{threadId:_,providerKey:g}=q_({routeThreadId:f,fallbackKey:p.current}),v=_!=null?a.find(N=>N.id===_):void 0,{sidePanelOpen:b,mainOpen:k}=G_({entityMetadata:t,mainPanelParam:r.mainpanel,panelNamed:d!==void 0,sidePanelParamPresent:r.sidepanel!==void 0,sidePanelParamValue:r.sidepanel,routeDefaultMain:u,threadHasMessages:v?zh(v):!1}),w={sidePanelOpen:b,mainOpen:k},S=l&&n.taskId!==void 0?{virtualmcpid:c}:{},m=(N,T)=>{s({to:".",search:R=>({...R,...N}),replace:T?.replace??!1})},x=()=>{const N=Ua({type:"toggleMain"},w);N&&m(N,{replace:!0})},y=()=>{const N=Ua({type:"toggleSidePanel"},w);N&&m(N,{replace:!0})},C=async()=>{const N=crypto.randomUUID(),T=a.find(R=>R.id===_)?.branch??null;try{await o({id:N,virtual_mcp_id:c,...T?{branch:T}:{}})}catch{}i(N,()=>({...S}))};return{threadId:_,providerKey:g,sidePanelOpen:b,mainOpen:k,sidePanelParamPresent:r.sidepanel!==void 0,toggleMain:x,toggleSidePanel:y,createNewTask:C}}function Q_(t){const e=H.c(10),{org:s}=ut(),i=Kf(),{data:r}=hs.useSession(),n=r?.user?.id,o=t?.id??null,a=!!t&&!!n&&!!t.created_by&&t.created_by!==n;let c;e[0]!==s.id||e[1]!==o?(c=ks.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=c):c=e[2];const l=!!i&&!!o&&a;let u;e[3]!==i||e[4]!==o?(u=async()=>(await i?.refreshThreadMetadata(o??""),!0),e[3]=i,e[4]=o,e[5]=u):u=e[5];let d;e[6]!==c||e[7]!==l||e[8]!==u?(d={queryKey:c,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:u},e[6]=c,e[7]=l,e[8]=u,e[9]=d):d=e[9],es(d)}function em(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function tm(t,e){return t.filter(s=>s.branch!==e)}function sm(t,e,s){return t.map(i=>i.branch===e?{...i,name:s}:i)}const Ka=["orange","violet","blue","pink","amber","teal"];function hr(t){return Ka[t%Ka.length]}function Bn(t,e){const s=`${e} `,i=t.reduce((r,n)=>{if(!n.name.startsWith(s))return r;const o=Number(n.name.slice(s.length));return Number.isInteger(o)&&o>r?o:r},0);return`${e} ${i+1}`}const im={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function en(t){return t&&im[t]||"bg-muted-foreground"}function Fr(t){const e=H.c(26),s=us(t),i=Nf(),{org:r}=ut(),n=Lc();let o;e[0]!==s?.metadata?.releases?(o=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=o):o=e[1];const a=o;let c;e[2]!==r||e[3]!==t?(c=m=>m[1]===r.id&&m[3]==="collection"&&m[4]==="VIRTUAL_MCP"&&m[5]===t,e[2]=r,e[3]=t,e[4]=c):c=e[4];const l=c;let u;e[5]!==l||e[6]!==n||e[7]!==a?(u=()=>{for(const[,m]of n.getQueriesData({predicate:x=>l(x.queryKey)}))if(m?.item)return m.item.metadata?.releases??[];return a},e[5]=l,e[6]=n,e[7]=a,e[8]=u):u=e[8];const d=u;let f;e[9]!==i||e[10]!==l||e[11]!==n||e[12]!==d||e[13]!==t?(f=m=>cp(`vm-releases:${t}`,async()=>{const x=d(),y=m(x);if(y!==x){n.setQueriesData({predicate:C=>l(C.queryKey)},C=>C?.item?{item:{...C.item,metadata:{...C.item.metadata,releases:y}}}:C);try{await i.update.mutateAsync({id:t,data:{metadata:{releases:y}}})}catch(C){const N=C;throw n.invalidateQueries({predicate:T=>l(T.queryKey)}),N}}}),e[9]=i,e[10]=l,e[11]=n,e[12]=d,e[13]=t,e[14]=f):f=e[14];const p=f;let _;e[15]!==p?(_=m=>p(x=>em(x,m)),e[15]=p,e[16]=_):_=e[16];const g=_;let v;e[17]!==p?(v=(m,x)=>p(y=>sm(y,m,x)),e[17]=p,e[18]=v):v=e[18];const b=v;let k;e[19]!==p?(k=m=>p(x=>tm(x,m)),e[19]=p,e[20]=k):k=e[20];const w=k;let S;return e[21]!==g||e[22]!==w||e[23]!==a||e[24]!==b?(S={releases:a,createRelease:g,renameRelease:b,deleteRelease:w},e[21]=g,e[22]=w,e[23]=a,e[24]=b,e[25]=S):S=e[25],S}function rm(t,e){const s=getComputedStyle(t),i=parseFloat(s.fontSize);return e*i}function nm(t,e){const s=getComputedStyle(t.ownerDocument.documentElement),i=parseFloat(s.fontSize);return e*i}function om(t){return t/100*window.innerHeight}function am(t){return t/100*window.innerWidth}function lm(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function mi({groupSize:t,panelElement:e,styleProp:s}){let i;const[r,n]=lm(s);switch(n){case"%":{i=r/100*t;break}case"px":{i=r;break}case"rem":{i=nm(e,r);break}case"em":{i=rm(e,r);break}case"vh":{i=om(r);break}case"vw":{i=am(r);break}}return i}function vt(t){return parseFloat(t.toFixed(3))}function si({group:t}){const{orientation:e,panels:s}=t;return s.reduce((i,r)=>(i+=e==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i),0)}function Ln(t){const{panels:e}=t,s=si({group:t});return s===0?e.map(i=>({groupResizeBehavior:i.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:i.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:i.panelConstraints.disabled,minSize:0,maxSize:100,panelId:i.id})):e.map(i=>{const{element:r,panelConstraints:n}=i;let o=0;if(n.collapsedSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.collapsedSize});o=vt(u/s*100)}let a;if(n.defaultSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.defaultSize});a=vt(u/s*100)}let c=0;if(n.minSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.minSize});c=vt(u/s*100)}let l=100;if(n.maxSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.maxSize});l=vt(u/s*100)}return{groupResizeBehavior:n.groupResizeBehavior,collapsedSize:o,collapsible:n.collapsible===!0,defaultSize:a,disabled:n.disabled,minSize:c,maxSize:l,panelId:i.id}})}function De(t,e="Assertion error"){if(!t)throw Error(e)}function jn(t,e){return Array.from(e).sort(t==="horizontal"?cm:hm)}function cm(t,e){const s=t.element.offsetLeft-e.element.offsetLeft;return s!==0?s:t.element.offsetWidth-e.element.offsetWidth}function hm(t,e){const s=t.element.offsetTop-e.element.offsetTop;return s!==0?s:t.element.offsetHeight-e.element.offsetHeight}function $h(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function Fh(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function dm({orientation:t,rects:e,targetRect:s}){const i={x:s.x+s.width/2,y:s.y+s.height/2};let r,n=Number.MAX_VALUE;for(const o of e){const{x:a,y:c}=Fh(i,o),l=t==="horizontal"?a:c;l<n&&(n=l,r=o)}return De(r,"No rect found"),r}let Zi;function um(){return Zi===void 0&&(typeof matchMedia=="function"?Zi=!!matchMedia("(pointer:coarse)").matches:Zi=!1),Zi}function Hh(t){const{element:e,orientation:s,panels:i,separators:r}=t,n=jn(s,Array.from(e.children).filter($h).map(_=>({element:_}))).map(({element:_})=>_),o=[];let a=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let _=-1;for(const g of n)g.hasAttribute("data-panel")&&(_++,g.hasAttribute("data-disabled")||(d++,l===-1&&(l=_),u=_))}if(d>1){let _=-1;for(const g of n)if(g.hasAttribute("data-panel")){_++;const v=i.find(b=>b.element===g);if(v){if(f){const b=f.element.getBoundingClientRect(),k=g.getBoundingClientRect();let w;if(c){const S=s==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),m=s==="horizontal"?new DOMRect(k.left,k.top,0,k.height):new DOMRect(k.left,k.top,k.width,0);switch(p.length){case 0:{w=[S,m];break}case 1:{const x=p[0],y=dm({orientation:s,rects:[b,k],targetRect:x.element.getBoundingClientRect()});w=[x,y===b?m:S];break}default:{w=p;break}}}else p.length?w=p:w=[s==="horizontal"?new DOMRect(b.right,k.top,k.left-b.right,k.height):new DOMRect(k.left,b.bottom,k.width,k.top-b.bottom)];for(const S of w){let m="width"in S?S:S.element.getBoundingClientRect();const x=um()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(m.width<x){const C=x-m.width;m=new DOMRect(m.x-C/2,m.y,m.width+C,m.height)}if(m.height<x){const C=x-m.height;m=new DOMRect(m.x,m.y-C/2,m.width,m.height+C)}const y=_<=l||_>u;!a&&!y&&o.push({group:t,groupSize:si({group:t}),panels:[f,v],separator:"width"in S?void 0:S,rect:m}),a=!1}}c=!1,f=v,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(a=!0);const v=r.find(b=>b.element===g);v?p.push(v):(f=void 0,p=[])}else c=!0}return o}class Wh{#e={};addListener(e,s){const i=this.#e[e];return i===void 0?this.#e[e]=[s]:i.includes(s)||i.push(s),()=>{this.removeListener(e,s)}}emit(e,s){const i=this.#e[e];if(i!==void 0)if(i.length===1)i[0].call(null,s);else{let r=!1,n=null;const o=Array.from(i);for(let a=0;a<o.length;a++){const c=o[a];try{c.call(null,s)}catch(l){n===null&&(r=!0,n=l)}}if(r)throw n}}removeAllListeners(){this.#e={}}removeListener(e,s){const i=this.#e[e];if(i!==void 0){const r=i.indexOf(s);r>=0&&i.splice(r,1)}}}let Zs={cursorFlags:0,state:"inactive"};const sa=new Wh;function Ls(){return Zs}function fm(t){return sa.addListener("change",t)}function pm(t){const e=Zs,s={...Zs};s.cursorFlags=t,Zs=s,sa.emit("change",{prev:e,next:s})}function Qs(t){const e=Zs;Zs=t,sa.emit("change",{prev:e,next:t})}const _m=t=>t,tn=()=>{},Uh=1,Kh=2,qh=4,Vh=8,qa=3,Va=12;let Qi;function Ga(){return Qi===void 0&&(Qi=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Qi=!0)),Qi}function mm({cursorFlags:t,groups:e,state:s}){let i=0,r=0;switch(s){case"active":case"hover":e.forEach(n=>{if(!n.mutableState.disableCursor)switch(n.orientation){case"horizontal":{i++;break}case"vertical":{r++;break}}})}if(!(i===0&&r===0)){switch(s){case"active":{if(t&&Ga()){const n=(t&Uh)!==0,o=(t&Kh)!==0,a=(t&qh)!==0,c=(t&Vh)!==0;if(n)return a?"se-resize":c?"ne-resize":"e-resize";if(o)return a?"sw-resize":c?"nw-resize":"w-resize";if(a)return"s-resize";if(c)return"n-resize"}break}}return Ga()?i>0&&r>0?"move":i>0?"ew-resize":"ns-resize":i>0&&r>0?"grab":i>0?"col-resize":"row-resize"}}const Ya=new WeakMap;function ia(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:s}=Ya.get(t)??{};s===void 0&&(s=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&(Object.isExtensible(t.adoptedStyleSheets)?t.adoptedStyleSheets.push(s):t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]));const i=Ls();switch(i.state){case"active":case"hover":{const r=mm({cursorFlags:i.cursorFlags,groups:i.hitRegions.map(o=>o.group),state:i.state}),n=`*, *:hover {cursor: ${r} !important; }`;if(e===n)return;e=n,r?s.cssRules.length===0?s.insertRule(n):s.replaceSync(n):s.cssRules.length===1&&s.deleteRule(0);break}case"inactive":{e=void 0,s.cssRules.length===1&&s.deleteRule(0);break}}Ya.set(t,{prevStyle:e,styleSheet:s})}let Xt=new Map;const Gh=new Wh;function gm(t){Xt=new Map(Xt),Xt.delete(t)}function Xa(t,e){for(const[s]of Xt)if(s.id===t)return s}function xs(t,e){for(const[s,i]of Xt)if(s.id===t)return i;if(e)throw Error(`Could not find data for Group with id ${t}`)}function Fs(){return Xt}function ra(t,e){return Gh.addListener("groupChange",s=>{s.group.id===t&&e(s)})}function cs(t,e,s){const i=Xt.get(t);Xt=new Map(Xt),Xt.set(t,e),Gh.emit("groupChange",{group:t,isUserInteraction:s?.isUserInteraction===!0,prev:i,next:e})}function Yh(t){const e=Ls();let s=!1;return e.state==="active"&&(Qs({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(ia(t),s=!0,e.hitRegions.forEach(i=>{const r=xs(i.group.id,!0);cs(i.group,r,{isUserInteraction:!0})}))),s}function Ja(t){t.defaultPrevented||Yh(t.currentTarget)}function vm(t,e,s){let i,r={x:1/0,y:1/0};for(const n of e){const o=Fh(s,n.rect);switch(t){case"horizontal":{o.x<=r.x&&(i=n,r=o);break}case"vertical":{o.y<=r.y&&(i=n,r=o);break}}}return i?{distance:r,hitRegion:i}:void 0}function bm(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Sm(t,e){if(t===e)throw new Error("Cannot compare node with itself");const s={a:el(t),b:el(e)};let i;for(;s.a.at(-1)===s.b.at(-1);)i=s.a.pop(),s.b.pop();De(i,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Qa(Za(s.a)),b:Qa(Za(s.b))};if(r.a===r.b){const n=i.childNodes,o={a:s.a.at(-1),b:s.b.at(-1)};let a=n.length;for(;a--;){const c=n[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const ym=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function xm(t){const e=getComputedStyle(Xh(t)??t).display;return e==="flex"||e==="inline-flex"}function wm(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||xm(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||ym.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Za(t){let e=t.length;for(;e--;){const s=t[e];if(De(s,"Missing node"),wm(s))return s}return null}function Qa(t){return t&&Number(getComputedStyle(t).zIndex)||0}function el(t){const e=[];for(;t;)e.push(t),t=Xh(t);return e}function Xh(t){const{parentNode:e}=t;return bm(e)?e.host:e}function Cm(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function km({groupElement:t,hitRegion:e,pointerEventTarget:s}){if(!$h(s)||s.contains(t)||t.contains(s))return!0;if(Sm(s,t)>0){let i=s;for(;i;){if(i.contains(t))return!0;if(Cm(i.getBoundingClientRect(),e))return!1;i=i.parentElement}}return!0}function na(t,e){const s=[];return e.forEach((i,r)=>{if(r.disabled)return;const n=Hh(r),o=vm(r.orientation,n,{x:t.clientX,y:t.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&km({groupElement:r.element,hitRegion:o.hitRegion.rect,pointerEventTarget:t.target})&&s.push(o.hitRegion)}),s}function Pm(t,e){if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!=e[s])return!1;return!0}function pt(t,e,s=0){return Math.abs(vt(t)-vt(e))<=s}function Yt(t,e){return pt(t,e)?0:t>e?1:-1}function Xs({overrideDisabledPanels:t,panelConstraints:e,prevSize:s,size:i}){const{collapsedSize:r=0,collapsible:n,disabled:o,maxSize:a=100,minSize:c=0}=e;if(o&&!t)return s;if(Yt(i,c)<0)if(n){const l=(r+c)/2;Yt(i,l)<0?i=r:i=c}else i=c;return i=Math.min(a,i),i=vt(i),i}function Ti({delta:t,initialLayout:e,panelConstraints:s,pivotIndices:i,prevLayout:r,trigger:n}){if(pt(t,0))return e;const o=n==="imperative-api",a=Object.values(e),c=Object.values(r),l=[...a],[u,d]=i;De(u!=null,"Invalid first pivot index"),De(d!=null,"Invalid second pivot index");let f=0;switch(n){case"keyboard":{{const g=t<0?d:u,v=s[g];De(v,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:k,minSize:w=0}=v;if(k){const S=a[g];if(De(S!=null,`Previous layout not found for panel index ${g}`),pt(S,b)){const m=w-S;Yt(m,Math.abs(t))>0&&(t=t<0?0-m:m)}}}{const g=t<0?u:d,v=s[g];De(v,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:k,minSize:w=0}=v;if(k){const S=a[g];if(De(S!=null,`Previous layout not found for panel index ${g}`),pt(S,w)){const m=S-b;Yt(m,Math.abs(t))>0&&(t=t<0?0-m:m)}}}break}default:{const g=t<0?d:u,v=s[g];De(v,`Panel constraints not found for index ${g}`);const b=a[g],{collapsible:k,collapsedSize:w,minSize:S}=v;if(k&&Yt(b,S)<0)if(t>0){const m=S-w,x=m/2,y=b+t;Yt(y,S)<0&&(t=Yt(t,x)<=0?0:m)}else{const m=S-w,x=100-m/2,y=b-t;Yt(y,S)<0&&(t=Yt(100+t,x)>0?0:-m)}break}}{const g=t<0?1:-1;let v=t<0?d:u,b=0;for(;;){const w=a[v];De(w!=null,`Previous layout not found for panel index ${v}`);const S=Xs({overrideDisabledPanels:o,panelConstraints:s[v],prevSize:w,size:100})-w;if(b+=S,v+=g,v<0||v>=s.length)break}const k=Math.min(Math.abs(t),Math.abs(b));t=t<0?0-k:k}{let g=t<0?u:d;for(;g>=0&&g<s.length;){const v=Math.abs(t)-Math.abs(f),b=a[g];De(b!=null,`Previous layout not found for panel index ${g}`);const k=b-v,w=Xs({overrideDisabledPanels:o,panelConstraints:s[g],prevSize:b,size:k});if(!pt(b,w)&&(f+=b-w,l[g]=w,f.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?g--:g++}}if(Pm(c,l))return r;{const g=t<0?d:u,v=a[g];De(v!=null,`Previous layout not found for panel index ${g}`);const b=v+f,k=Xs({overrideDisabledPanels:o,panelConstraints:s[g],prevSize:v,size:b});if(l[g]=k,!pt(k,b)){let w=b-k,S=t<0?d:u;for(;S>=0&&S<s.length;){const m=l[S];De(m!=null,`Previous layout not found for panel index ${S}`);const x=m+w,y=Xs({overrideDisabledPanels:o,panelConstraints:s[S],prevSize:m,size:x});if(pt(m,y)||(w-=y-m,l[S]=y),pt(w,0))break;t>0?S--:S++}}}const p=Object.values(l).reduce((g,v)=>v+g,0);if(!pt(p,100,.1))return r;const _=Object.keys(r);return l.reduce((g,v,b)=>(g[_[b]]=v,g),{})}function js(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(e[s]===void 0||Yt(t[s],e[s])!==0)return!1;return!0}function Is({layout:t,panelConstraints:e}){const s=Object.values(t),i=[...s],r=i.reduce((a,c)=>a+c,0);if(i.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${i.map(a=>`${a}%`).join(", ")}`);if(!pt(r,100)&&i.length>0)for(let a=0;a<e.length;a++){const c=i[a];De(c!=null,`No layout data found for index ${a}`);const l=100/r*c;i[a]=l}let n=0;for(let a=0;a<e.length;a++){const c=s[a];De(c!=null,`No layout data found for index ${a}`);const l=i[a];De(l!=null,`No layout data found for index ${a}`);const u=Xs({overrideDisabledPanels:!0,panelConstraints:e[a],prevSize:c,size:l});l!=u&&(n+=l-u,i[a]=u)}if(!pt(n,0))for(let a=0;a<e.length;a++){const c=i[a];De(c!=null,`No layout data found for index ${a}`);const l=c+n,u=Xs({overrideDisabledPanels:!0,panelConstraints:e[a],prevSize:c,size:l});if(c!==u&&(n-=u-c,i[a]=u,pt(n,0)))break}const o=Object.keys(t);return i.reduce((a,c,l)=>(a[o[l]]=c,a),{})}function Jh({groupId:t,panelId:e}){const s=()=>{const c=Fs();for(const[l,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:_}]of c)if(l.id===t)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:l,groupSize:p,layout:f,separatorToPanels:_};throw Error(`Group ${t} not found`)},i=()=>{const c=s().derivedPanelConstraints.find(l=>l.panelId===e);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${e}`)},r=()=>{const c=s().group.panels.find(l=>l.id===e);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},n=()=>{const c=s().layout[e];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},o=({nextSize:c,panels:l,prevLayout:u,derivedPanelConstraints:d})=>{const f=n(),p=l.findIndex(v=>v.id===e),_=p===0,g=p===l.length-1;if(g&&c<f&&(_||l.slice(0,p).every((v,b)=>{const k=d[b];return k?.collapsible&&pt(k.collapsedSize,u[k.panelId])}))){const v=l.slice(0,p).reduce((b,k)=>b+u[k.id],0);return{...u,[e]:vt(100-v)}}return Ti({delta:g?f-c:c-f,initialLayout:u,panelConstraints:d,pivotIndices:g?[p-1,p]:[p,p+1],prevLayout:u,trigger:"imperative-api"})},a=c=>{const l=n();if(c===l)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:p,layout:_,separatorToPanels:g}=s(),v=o({nextSize:c,panels:f.panels,prevLayout:_,derivedPanelConstraints:d}),b=Is({layout:v,panelConstraints:d});js(_,b)||cs(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:c,collapsedSize:l}=i(),{mutableValues:u}=r(),d=n();c&&d!==l&&(u.expandToSize=d,a(l))},expand:()=>{const{collapsible:c,collapsedSize:l,minSize:u}=i(),{mutableValues:d}=r(),f=n();if(c&&f===l){let p=d.expandToSize??u;p===0&&(p=1),a(p)}},getSize:()=>{const{group:c}=s(),l=n(),{element:u}=r(),d=c.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:l,inPixels:d}},isCollapsed:()=>{const{collapsible:c,collapsedSize:l}=i(),u=n();return c&&pt(l,u)},resize:c=>{const{group:l}=s(),{element:u}=r(),d=si({group:l}),f=mi({groupSize:d,panelElement:u,styleProp:c}),p=vt(f/d*100);a(p)}}}function tl(t){if(t.defaultPrevented)return;const e=Fs();na(t,e).forEach(s=>{if(s.separator&&!s.separator.disableDoubleClick){const i=s.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(i){const r=i.panelConstraints.defaultSize,n=Jh({groupId:s.group.id,panelId:i.id});n&&r!==void 0&&(n.resize(r),t.preventDefault())}}})}function dr(t){const e=Fs();for(const[s]of e)if(s.separators.some(i=>i.element===t))return s;throw Error("Could not find parent Group for separator element")}function Zh({groupId:t}){const e=()=>{const s=Fs();for(const[i,r]of s)if(i.id===t)return{group:i,...r};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:s,layout:i}=e();return s?{}:i},setLayout(s){const{defaultLayoutDeferred:i,derivedPanelConstraints:r,group:n,groupSize:o,layout:a,separatorToPanels:c}=e(),l=Is({layout:s,panelConstraints:r});return i?a:(js(a,l)||cs(n,{defaultLayoutDeferred:i,derivedPanelConstraints:r,groupSize:o,layout:l,separatorToPanels:c}),l)}}}function Rs(t,e){const s=dr(t),i=xs(s.id,!0),r=s.separators.find(u=>u.element===t);De(r,"Matching separator not found");const n=i.separatorToPanels.get(r);De(n,"Matching panels not found");const o=n.map(u=>s.panels.indexOf(u)),a=Zh({groupId:s.id}).getLayout(),c=Ti({delta:e,initialLayout:a,panelConstraints:i.derivedPanelConstraints,pivotIndices:o,prevLayout:a,trigger:"keyboard"}),l=Is({layout:c,panelConstraints:i.derivedPanelConstraints});js(a,l)||cs(s,{defaultLayoutDeferred:i.defaultLayoutDeferred,derivedPanelConstraints:i.derivedPanelConstraints,groupSize:i.groupSize,layout:l,separatorToPanels:i.separatorToPanels},{isUserInteraction:!0})}function sl(t){if(t.defaultPrevented)return;const e=t.currentTarget,s=dr(e);if(!s.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),s.orientation==="vertical"&&Rs(e,5);break}case"ArrowLeft":{t.preventDefault(),s.orientation==="horizontal"&&Rs(e,-5);break}case"ArrowRight":{t.preventDefault(),s.orientation==="horizontal"&&Rs(e,5);break}case"ArrowUp":{t.preventDefault(),s.orientation==="vertical"&&Rs(e,-5);break}case"End":{t.preventDefault(),Rs(e,100);break}case"Enter":{t.preventDefault();const i=dr(e),r=xs(i.id,!0),{derivedPanelConstraints:n,layout:o,separatorToPanels:a}=r,c=i.separators.find(f=>f.element===e);De(c,"Matching separator not found");const l=a.get(c);De(l,"Matching panels not found");const u=l[0],d=n.find(f=>f.panelId===u.id);if(De(d,"Panel metadata not found"),d.collapsible){const f=o[u.id],p=d.collapsedSize===f?i.mutableState.expandedPanelSizes[u.id]??d.minSize:d.collapsedSize;Rs(e,p-f)}break}case"F6":{t.preventDefault();const i=dr(e).separators.map(o=>o.element),r=Array.from(i).findIndex(o=>o===t.currentTarget);De(r!==null,"Index not found");const n=t.shiftKey?r>0?r-1:i.length-1:r+1<i.length?r+1:0;i[n].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Rs(e,-100);break}}}function il(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=Fs(),s=na(t,e),i=new Map;let r=!1;s.forEach(n=>{n.separator&&(r||(r=!0,n.separator.element.focus({focusVisible:!1,preventScroll:!0})));const o=e.get(n.group);o&&i.set(n.group,o.layout)}),Qs({cursorFlags:0,hitRegions:s,initialLayoutMap:i,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),s.length&&t.preventDefault()}function Qh({document:t,event:e,hitRegions:s,initialLayoutMap:i,mountedGroups:r,pointerDownAtPoint:n,prevCursorFlags:o}){let a=0;s.forEach(l=>{const{group:u,groupSize:d}=l,{orientation:f,panels:p}=u,{disableCursor:_}=u.mutableState;let g=0;n?f==="horizontal"?g=(e.clientX-n.x)/d*100:g=(e.clientY-n.y)/d*100:f==="horizontal"?g=e.clientX<0?-100:100:g=e.clientY<0?-100:100;const v=i.get(u),b=r.get(u);if(!v||!b)return;const{defaultLayoutDeferred:k,derivedPanelConstraints:w,groupSize:S,layout:m,separatorToPanels:x}=b;if(w&&m&&x){const y=Ti({delta:g,initialLayout:v,panelConstraints:w,pivotIndices:l.panels.map(C=>p.indexOf(C)),prevLayout:m,trigger:"mouse-or-touch"});if(js(y,m)){if(g!==0&&!_)switch(f){case"horizontal":{a|=g<0?Uh:Kh;break}case"vertical":{a|=g<0?qh:Vh;break}}}else cs(l.group,{defaultLayoutDeferred:k,derivedPanelConstraints:w,groupSize:S,layout:y,separatorToPanels:x})}});let c=0;e.movementX===0?c|=o&qa:c|=a&qa,e.movementY===0?c|=o&Va:c|=a&Va,pm(c),ia(t)}function rl(t){const e=Fs(),s=Ls();s.state==="active"&&Qh({document:t.currentTarget,event:t,hitRegions:s.hitRegions,initialLayoutMap:s.initialLayoutMap,mountedGroups:e,prevCursorFlags:s.cursorFlags})}function nl(t){if(t.defaultPrevented)return;const e=Ls(),s=Fs();switch(e.state){case"active":{if(t.buttons===0){Qs({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(i=>{const r=xs(i.group.id,!0);cs(i.group,r,{isUserInteraction:!0})});return}for(const i of e.hitRegions)if(i.separator){const{element:r}=i.separator;r.hasPointerCapture?.(t.pointerId)||r.setPointerCapture?.(t.pointerId)}Qh({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:s,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const i=na(t,s);i.length===0?e.state!=="inactive"&&Qs({cursorFlags:0,state:"inactive"}):Qs({cursorFlags:0,hitRegions:i,state:"hover"}),ia(t.currentTarget);break}}}function ol(t){t.relatedTarget instanceof HTMLIFrameElement&&Ls().state==="hover"&&Qs({cursorFlags:0,state:"inactive"})}function al(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||Yh(t.currentTarget)&&t.preventDefault()}function ll(t){let e=0,s=0;const i={};for(const n of t)if(n.defaultSize!==void 0){e++;const o=vt(n.defaultSize);s+=o,i[n.panelId]=o}else i[n.panelId]=void 0;const r=t.length-e;if(r!==0){const n=vt((100-s)/r);for(const o of t)o.defaultSize===void 0&&(i[o.panelId]=n)}return i}function Em(t,e,s){if(!s[0])return;const i=t.panels.find(c=>c.element===e);if(!i||!i.onResize)return;const r=si({group:t}),n=t.orientation==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,o=i.mutableValues.prevSize,a={asPercentage:vt(n/r*100),inPixels:n};i.mutableValues.prevSize=a,i.onResize(a,i.id,o)}function Rm(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Tm({group:t,nextGroupSize:e,prevGroupSize:s,prevLayout:i}){if(s<=0||e<=0||s===e)return i;let r=0,n=0,o=!1;const a=new Map,c=[];for(const d of t.panels){const f=i[d.id]??0;if(d.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){o=!0;const p=f/100*s,_=vt(p/e*100);a.set(d.id,_),r+=_}else c.push(d.id),n+=f}if(!o||c.length===0)return i;const l=100-r,u={...i};if(a.forEach((d,f)=>{u[f]=d}),n>0)for(const d of c){const f=i[d]??0;u[d]=vt(f/n*l)}else{const d=vt(l/c.length);for(const f of c)u[f]=d}return u}function Am(t,e){const s=t.map(r=>r.id),i=Object.keys(e);if(s.length!==i.length)return!1;for(const r of s)if(!i.includes(r))return!1;return!0}const Ks=new Map;function Dm(t){let e=!0;De(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const s=t.element.ownerDocument.defaultView.ResizeObserver,i=new Set,r=new Set,n=new s(_=>{for(const g of _){const{borderBoxSize:v,target:b}=g;if(b===t.element){if(e){const k=si({group:t});if(k===0)return;const w=xs(t.id);if(!w)return;const S=Ln(t),m=w.defaultLayoutDeferred?ll(S):w.layout,x=Tm({group:t,nextGroupSize:k,prevGroupSize:w.groupSize,prevLayout:m}),y=Is({layout:x,panelConstraints:S});if(!w.defaultLayoutDeferred&&js(w.layout,y)&&Rm(w.derivedPanelConstraints,S)&&w.groupSize===k)return;cs(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,groupSize:k,layout:y,separatorToPanels:w.separatorToPanels})}}else Em(t,b,v)}});n.observe(t.element),t.panels.forEach(_=>{De(!i.has(_.id),`Panel ids must be unique; id "${_.id}" was used more than once`),i.add(_.id),_.onResize&&n.observe(_.element)});const o=si({group:t}),a=Ln(t),c=t.panels.map(({id:_})=>_).join(",");let l=t.mutableState.defaultLayout;l&&(Am(t.panels,l)||(l=void 0));const u=t.mutableState.layouts[c]??l??ll(a),d=Is({layout:u,panelConstraints:a}),f=t.element.ownerDocument;Ks.set(f,(Ks.get(f)??0)+1);const p=new Map;return Hh(t).forEach(_=>{_.separator&&p.set(_.separator,_.panels)}),cs(t,{defaultLayoutDeferred:o===0,derivedPanelConstraints:a,groupSize:o,layout:d,separatorToPanels:p}),t.separators.forEach(_=>{De(!r.has(_.id),`Separator ids must be unique; id "${_.id}" was used more than once`),r.add(_.id),_.element.addEventListener("keydown",sl)}),Ks.get(f)===1&&(f.addEventListener("contextmenu",Ja,!0),f.addEventListener("dblclick",tl,!0),f.addEventListener("pointerdown",il,!0),f.addEventListener("pointerleave",rl),f.addEventListener("pointermove",nl),f.addEventListener("pointerout",ol),f.addEventListener("pointerup",al,!0)),function(){e=!1,Ks.set(f,Math.max(0,(Ks.get(f)??0)-1)),gm(t),t.separators.forEach(_=>{_.element.removeEventListener("keydown",sl)}),Ks.get(f)||(f.removeEventListener("contextmenu",Ja,!0),f.removeEventListener("dblclick",tl,!0),f.removeEventListener("pointerdown",il,!0),f.removeEventListener("pointerleave",rl),f.removeEventListener("pointermove",nl),f.removeEventListener("pointerout",ol),f.removeEventListener("pointerup",al,!0)),n.disconnect()}}function Nm(){const[t,e]=O.useState({}),s=O.useCallback(()=>e({}),[]);return[t,s]}function oa(t){const e=O.useId();return`${t??e}`}const Hs=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Ci(t){const e=O.useRef(t);return Hs(()=>{e.current=t},[t]),O.useCallback((...s)=>e.current?.(...s),[e])}function aa(...t){return Ci(e=>{t.forEach(s=>{if(s)switch(typeof s){case"function":{s(e);break}case"object":{s.current=e;break}}})})}function la(t){const e=O.useRef({...t});return Hs(()=>{for(const s in t)e.current[s]=t[s]},[t]),e.current}const ed=O.createContext(null);function Mm(t,e){const s=O.useRef({getLayout:()=>({}),setLayout:_m});O.useImperativeHandle(e,()=>s.current,[]),Hs(()=>{Object.assign(s.current,Zh({groupId:t}))})}function td({children:t,className:e,defaultLayout:s,disableCursor:i,disabled:r,elementRef:n,groupRef:o,id:a,onLayoutChange:c,onLayoutChanged:l,orientation:u="horizontal",resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){const _=O.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=Ci(R=>{js(_.current.onLayoutChange,R)||(_.current.onLayoutChange=R,c?.(R))}),v=Ci((R,E)=>{js(_.current.onLayoutChanged,R)||(_.current.onLayoutChanged=R,l?.(R,{isUserInteraction:E}))}),b=oa(a),k=O.useRef(null),[w,S]=Nm(),m=O.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),x=aa(k,n);Mm(b,o);const y=Ci((R,E)=>{const P=Ls(),A=Xa(R),M=xs(R);if(M){let L=!1;return P.state==="active"&&(L=P.hitRegions.some(B=>B.group===A)),{flexGrow:M.layout[E]??1,pointerEvents:L?"none":void 0}}if(s?.[E])return{flexGrow:s?.[E]}}),C=la({defaultLayout:s,disableCursor:i}),N=O.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:y,id:b,orientation:u,registerPanel:R=>{const E=m.current;return E.panels=jn(u,[...E.panels,R]),S(),()=>{E.panels=E.panels.filter(P=>P!==R),S()}},registerSeparator:R=>{const E=m.current;return E.separators=jn(u,[...E.separators,R]),S(),()=>{E.separators=E.separators.filter(P=>P!==R),S()}},updatePanelProps:(R,{disabled:E})=>{const P=m.current.panels.find(L=>L.id===R);P&&(P.panelConstraints.disabled=E);const A=Xa(b),M=xs(b);A&&M&&cs(A,{...M,derivedPanelConstraints:Ln(A)})},updateSeparatorProps:(R,{disabled:E,disableDoubleClick:P})=>{const A=m.current.separators.find(M=>M.id===R);A&&(A.disabled=E,A.disableDoubleClick=P)}}),[y,b,S,u,C]),T=O.useRef(null);return Hs(()=>{const R=k.current;if(R===null)return;const E=m.current;let P;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===E.panels.length){P={};for(const K of E.panels){const z=C.defaultLayout[K.id];z!==void 0&&(P[K.id]=z)}}const A={disabled:!!r,element:R,id:b,mutableState:{defaultLayout:P,disableCursor:!!C.disableCursor,expandedPanelSizes:m.current.lastExpandedPanelSizes,layouts:m.current.layouts},orientation:u,panels:E.panels,resizeTargetMinimumSize:E.resizeTargetMinimumSize,separators:E.separators};T.current=A;const M=Dm(A),{defaultLayoutDeferred:L,derivedPanelConstraints:B,layout:D}=xs(A.id,!0);!L&&B.length>0&&(g(D),v(D,!1));const j=ra(b,K=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:G,layout:I}=K.next;if(z||G.length===0)return;const V=A.panels.map(({id:ee})=>ee).join(",");A.mutableState.layouts[V]=I,G.forEach(ee=>{if(ee.collapsible){const{layout:se}=K.prev??{};if(se){const ie=pt(ee.collapsedSize,I[ee.panelId]),Y=pt(ee.collapsedSize,se[ee.panelId]);ie&&!Y&&(A.mutableState.expandedPanelSizes[ee.panelId]=se[ee.panelId])}}});const $=Ls().state!=="active";g(I),$&&v(I,K.isUserInteraction)});return()=>{T.current=null,M(),j()}},[r,b,v,g,u,w,C]),O.useEffect(()=>{const R=T.current;R&&(R.mutableState.defaultLayout=s,R.mutableState.disableCursor=!!i)}),h.jsx(ed.Provider,{value:N,children:h.jsx("div",{...p,className:e,"data-group":!0,"data-testid":b,id:b,ref:x,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:t})})}td.displayName="Group";function ca(){const t=O.useContext(ed);return De(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function Bm(t,e){const{id:s}=ca(),i=O.useRef({collapse:tn,expand:tn,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tn});O.useImperativeHandle(e,()=>i.current,[]),Hs(()=>{Object.assign(i.current,Jh({groupId:s,panelId:t}))})}function sd({children:t,className:e,collapsedSize:s="0%",collapsible:i=!1,defaultSize:r,disabled:n,elementRef:o,groupResizeBehavior:a="preserve-relative-size",id:c,maxSize:l="100%",minSize:u="0%",onResize:d,panelRef:f,style:p,..._}){const g=!!c,v=oa(c),b=la({disabled:n}),k=O.useRef(null),w=aa(k,o),{getPanelStyles:S,id:m,orientation:x,registerPanel:y,updatePanelProps:C}=ca(),N=d!==null,T=Ci((A,M,L)=>{d?.(A,c,L)});Hs(()=>{const A=k.current;if(A!==null){const M={element:A,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?T:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:s,collapsible:i,defaultSize:r,disabled:b.disabled,maxSize:l,minSize:u}};return y(M)}},[a,s,i,r,N,v,g,l,u,T,y,b]),O.useEffect(()=>{C(v,{disabled:n})},[n,v,C]),Bm(v,f);const R=()=>{const A=S(m,v);if(A)return JSON.stringify(A)},E=O.useSyncExternalStore(A=>ra(m,A),R,R);let P;return E?P=JSON.parse(E):r!==void 0?P={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:P={flexGrow:1},h.jsx("div",{..._,"data-disabled":n||void 0,"data-panel":!0,"data-testid":v,id:v,ref:w,style:{...Lm,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...P},children:h.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:x==="horizontal"?"pan-y":"pan-x"},children:t})})}sd.displayName="Panel";const Lm={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function jm({layout:t,panelConstraints:e,panelId:s,panelIndex:i}){let r,n;const o=t[s],a=e.find(c=>c.panelId===s);if(a){const c=a.maxSize,l=a.collapsible?a.collapsedSize:a.minSize,u=[i,i+1];n=Is({layout:Ti({delta:l-o,initialLayout:t,panelConstraints:e,pivotIndices:u,prevLayout:t}),panelConstraints:e})[s],r=Is({layout:Ti({delta:c-o,initialLayout:t,panelConstraints:e,pivotIndices:u,prevLayout:t}),panelConstraints:e})[s]}return{valueControls:s,valueMax:r,valueMin:n,valueNow:o}}function id({children:t,className:e,disabled:s,disableDoubleClick:i,elementRef:r,id:n,style:o,...a}){const c=oa(n),l=la({disabled:s,disableDoubleClick:i}),[u,d]=O.useState({}),[f,p]=O.useState("inactive"),[_,g]=O.useState(!1),v=O.useRef(null),b=aa(v,r),{disableCursor:k,id:w,orientation:S,registerSeparator:m,updateSeparatorProps:x}=ca(),y=S==="horizontal"?"vertical":"horizontal";Hs(()=>{const T=v.current;if(T!==null){const R={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:T,id:c},E=m(R),P=fm(M=>{p(M.next.state!=="inactive"&&M.next.hitRegions.some(L=>L.separator===R)?M.next.state:"inactive")}),A=ra(w,M=>{const{derivedPanelConstraints:L,layout:B,separatorToPanels:D}=M.next,j=D.get(R);if(j){const K=j[0],z=j.indexOf(K);d(jm({layout:B,panelConstraints:L,panelId:K.id,panelIndex:z}))}});return()=>{P(),A(),E()}}},[w,c,m,l]),O.useEffect(()=>{x(c,{disabled:s,disableDoubleClick:i})},[s,i,c,x]);let C;s&&!k&&(C="not-allowed");let N;return s?N="disabled":f==="active"?N="active":_?N="focus":N=f,h.jsx("div",{...a,"aria-controls":u.valueControls,"aria-disabled":s||void 0,"aria-orientation":y,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:t,className:e,"data-separator":N,"data-testid":c,id:c,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:b,role:"separator",style:{flexBasis:"auto",cursor:C,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:s?void 0:0})}id.displayName="Separator";function Im(t){const e=H.c(10);let s,i,r;e[0]!==t?({className:s,ref:r,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=_e("flex h-full w-full",s),e[4]=s,e[5]=n):n=e[5];let o;return e[6]!==i||e[7]!==r||e[8]!==n?(o=h.jsx(td,{groupRef:r,"data-slot":"resizable-panel-group",className:n,...i}),e[6]=i,e[7]=r,e[8]=n,e[9]=o):o=e[9],o}function cl(t){const e=H.c(10);let s,i,r;e[0]!==t?({ref:i,style:r,...s}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==r?(n={overflow:"hidden",...r},e[4]=r,e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==i||e[8]!==n?(o=h.jsx(sd,{panelRef:i,"data-slot":"resizable-panel",style:n,...s}),e[6]=s,e[7]=i,e[8]=n,e[9]=o):o=e[9],o}function Om(t){const e=H.c(12);let s,i,r;e[0]!==t?({withHandle:r,className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=_e("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",s),e[4]=s,e[5]=n):n=e[5];let o;e[6]!==r?(o=r&&h.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:h.jsx(xf,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==i||e[9]!==n||e[10]!==o?(a=h.jsx(id,{"data-slot":"resizable-handle",className:n,...i,children:o}),e[8]=i,e[9]=n,e[10]=o,e[11]=a):a=e[11],a}function hl(t,e){const s=typeof t=="number"?t:Number(t);return!Number.isFinite(s)||s<=0||s>=100?e:s}function zm(t,e){const s=H.c(8);let i;s[0]!==e?(i=c=>hl(c,e),s[0]=e,s[1]=i):i=s[1];const[r,n]=Do(t,i);let o;s[2]!==e||s[3]!==r?(o=hl(r,e),s[2]=e,s[3]=r,s[4]=o):o=s[4];let a;return s[5]!==n||s[6]!==o?(a=[o,n],s[5]=n,s[6]=o,s[7]=a):a=s[7],a}const $m=33;function Fm(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ju.sidePanelWidth(),t[0]=e):e=t[0],zm(e,$m)}function Hm(t){const e=H.c(1),{activeTab:s}=t;let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(jc,{}),e[0]=i):i=e[0],i}function Wm(){const t=H.c(5),e=Ho()??"overview";let s;t[0]!==e?(s=h.jsx(ls,{children:h.jsx(Hm,{activeTab:e})}),t[0]=e,t[1]=s):s=t[1];let i;return t[2]!==e||t[3]!==s?(i=h.jsx(Li,{children:s},e),t[2]=e,t[3]=s,t[4]=i):i=t[4],i}const Um=new Set(["site-editor","content"]);function Km(t){return t.hasClonableSource&&!t.fastPreviewActive&&t.mainTab!==null&&Um.has(t.mainTab)}const dl=/[\r\n<>]/,qm=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Hr(t){const e=t?.userName?.trim();if(!e||dl.test(e))return null;const s=t?.userEmail?.trim();return!s||dl.test(s)?{userName:e}:qm.test(s)?{userName:e,userEmail:s}:{userName:e}}function Vm(t){return t.split(`
1
+ import{K as ks,c as H,m as es,b as be,r as O,l as _e,j as h,h as gt,I as ut,au as Bi,$ as ls,E as Li,d as ji,u as Ii,f as ri,a as hs,n as Lc,M as Do,U as Ju,O as jc,a6 as Je,B as Pe,ap as Zu,aq as Ei,a7 as Ze,a9 as Qe,t as Xe,av as Qu,o as Cs,aw as ef,ax as tf,a8 as Oi,ay as No,az as sf,z as rf,v as nf,F as Ic,e as Pn,x as of,ac as Mo,aA as af,aB as lf,ar as cf,y as Ia,k as hf,aC as df,aD as uf,R as Oc,aE as ff,N as pf}from"./index-B3yBTWEk.js";import{C as ht,w as _f,u as zc}from"./use-main-panel-tabs-EW6rbxam.js";import{a as mf,u as gf}from"./use-organization-settings-BAVHurZk.js";import{b as ds,u as Bo,a as zi,c as $c,d as vf,e as bf,s as Sf}from"./chat-context-CXknhaDs.js";import{u as ni}from"./use-session-runtime-BHahDP0E.js";import{u as yf}from"./use-ai-providers-qnkcjapR.js";import{i as Lo}from"./AlertCircle-EniJtD8E.js";import{i as jo}from"./CheckCircle-cinYKmPU.js";import{W as En,A as Ri,T as xf,o as Fc,Z as jr,_ as Hc,$ as Io,G as wf,a0 as Wc,a1 as Cf,a2 as kf,a3 as Pf,a4 as Ef,k as Rf,a5 as Tf,n as Af}from"./agent-icon-DrlilhFJ.js";import{i as Df}from"./XCircle-9Cb0khfg.js";import{s as Oa}from"./XClose-Cw4b4Uag.js";import{a as us,b as Nf,u as Uc}from"./use-virtual-mcp-Bk09OpEg.js";import{I as Kc}from"./integration-icon-BPwWRlNG.js";import{c as Mf}from"./usage-stats-BNse37Wk.js";import{t as $s,n as Bf}from"./ChevronUp-DGrguvGW.js";import{O as Lf,u as jf}from"./pair-C08OPQNP.js";import{u as If,a as Of}from"./use-thread-outputs-9oZhiYbB.js";import{u as zf}from"./use-deco-credits-rwNQ1gMg.js";import{i as $f}from"./command-palette-store-BwHku_Zt.js";import{b as Rn,f as Ff,c as Hf}from"./use-project-scope-B2cuvtTy.js";import{d as Oo,a as Wf,c as Uf}from"./thread-intent-DVKldCEq.js";import{u as zo,a as Ir,b as Kf,c as $o}from"./hooks-k1OxvonE.js";import{p as qf,a as qc,b as Vf,c as Vc,d as Gf,e as Fo,f as Yf,g as Xf}from"./use-navigate-to-agent-Bbq0oQ0Y.js";import{u as Or,c as Gc,a as Yc,d as Jf,e as Zf,o as Qf,s as ep,f as tp,g as sp,h as ip}from"./sandbox-lifecycle-context-CXd9Um8u.js";import{u as rp}from"./use-status-sounds-CnCb1h48.js";import{E as Xc}from"./empty-state-Cz1DkYZE.js";import{b as np,c as $i,a as Jc,u as Zc,r as op,d as ap}from"./thread-route-CKY-dKC0.js";import{a as lp,u as Ho,b as Qc,c as eh}from"./use-panel-navigate-Byvx0cbx.js";import{r as th,a as Ut,h as sh,b as ih,g as Wo}from"./github-repo-C0igpkr9.js";import{r as cp}from"./serial-task-queue-CGOeQgpr.js";import{T as hp}from"./toolbar-D0oe2g2b.js";import{i as dp}from"./Share07-D_kiq5Fr.js";import{b as up,c as rh,S as fp,d as pp}from"./select-Bc5UZb4n.js";import{i as nh,s as _p}from"./source-system-tabs-CnEGUb4r.js";import{a as mp}from"./Package-CdfyZYxN.js";import{L as Uo,a as gp}from"./legacy-main-redirect-ZPChWdtD.js";import{L as vp}from"./preview-dialog-b2QyOGzU.js";import{O as bp}from"./markdown-B1038zFJ.js";import{u as oh}from"./use-is-desktop-app-BNujXJc_.js";import{p as Sp}from"./virtual-mcp-DGQbDtgM.js";import{b as za}from"./sandbox-url-D3mC8qhT.js";import{i as Sr}from"./Play-rnw1eV52.js";import{c as Ko,D as qo,b as Vo,a as yr}from"./dropdown-menu-BxKUbUkE.js";import{a as zr,b as Fi,P as Hi,c as yp}from"./popover-DIqZ2IKF.js";import{s as ah}from"./Plus-Bxp02MWl.js";import{i as xp,a as wp}from"./UserSquare-CCDsU001.js";import{p as lh,I as ch,T as xr}from"./toolbar-icon-button-EOE8J-Ai.js";import{L as hh}from"./anchors-yqDzZN4K.js";import{G as dh}from"./github-icon-D51q_6S8.js";import{D as Go,b as Yo,d as Cp,h as kp,c as Pp}from"./dialog-otnvxVN0.js";import{T as uh}from"./textarea-CneoU2lJ.js";import{s as Xo}from"./Eye-dnrP5DkM.js";import{i as fh}from"./Globe01-SLAc63wC.js";import{a as ph}from"./format-time-BtXRrtv4.js";import{i as Jo}from"./ChevronRight-DzRB-rdO.js";import{i as Ep}from"./Printer-fz_zwxfT.js";import{s as _h}from"./Trash01-DqUm2RRh.js";import{i as mh,G as gh,f as wi,p as Rp,r as vh,d as Tn,a as bh,b as cr,c as Tp,e as Ap,g as Sh,n as Dp,h as Np,j as Mp,k as Bp,l as Zo,m as Lp,o as yh,s as xh,q as jp,t as Ip,u as Op,v as zp,w as $a,x as $p,y as Fp,z as Zr,A as Hp,B as Wp,C as Up,D as Kp,E as qp,F as Vp,H as Gp,I as Fa}from"./decode-html-entities-DDqE27I4.js";import{b as Yp}from"./utils-B14U8IKK.js";import{u as $r,f as Xp}from"./shell-layout-1dFmVwYI.js";import{u as Jp}from"./use-mcp-client-DsJzBus3.js";import{I as Zp}from"./input-HFOrJf5B.js";import{c as wh,a as Ch,T as wr,b as Ha}from"./tabs-DV8akPGb.js";import{i as Qp}from"./ArrowRight-Cu8UuHNR.js";import{i as An}from"./GitBranch01-BBn4dN5f.js";import{t as e_}from"./Stars01-COChWymR.js";import{c as kh,d as Ph,b as Eh,f as Rh,g as Th,e as Ah,a as Dh,A as Nh}from"./alert-dialog-BE9ltHtr.js";import{e as Dn,C as Nn,a as Mn,c as Mh,d as Bh,b as Lh}from"./command-B6LMVdkQ.js";import{i as t_}from"./DotsVertical-CucJCL9y.js";import{i as s_}from"./Tool01-BnKd95Y1.js";import{u as i_}from"./use-debounced-value-Cud3o3Fq.js";import{u as r_}from"./useInfiniteQuery-GKCP1c_7.js";import{i as n_}from"./Tool02-C_xRWqQk.js";import{a as o_,T as a_}from"./toggle-group-9HQCpj-q.js";import{i as jh}from"./Zap-ChVc0p76.js";import{g as l_,S as c_}from"./task-status-DIr_2V94.js";function Qo(t){return`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`}function h_(t,e,s){return["decofile-write",t,e,s]}function ea(t){return`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}`}async function Ih(t,e){const s=await t.json().catch(()=>({}));throw new Error(s.error??`${e} failed (${t.status})`)}function d_(t,e,s){t.setQueryData(ks.decofileDraft(Qo(e)),s)}function u_(t){const e=H.c(4);let s;e[0]!==t?(s=ks.decofileDraft(t?Qo(t):""),e[0]=t,e[1]=s):s=e[1];let i;e[2]!==s?(i={queryKey:s,enabled:!1,queryFn:f_,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY},e[2]=s,e[3]=i):i=e[3];const{data:r}=es(i);return r??null}async function f_(){throw new Error("decofileDraft is populated by reads/writes, not fetched")}async function Lw(t,e){const s=await fetch(ea(e),{cache:"no-store"});if(!s.ok){const r=new Error(`Failed to fetch decofile: ${s.status}`);throw r.status=s.status,r}const i=await s.json();return i.token&&d_(t,e,{version:i.version,token:i.token,apiHost:i.apiHost??window.location.host}),i.decofile}const p_=2880*60*1e3;function __(t,e,s=p_){if(!t)return!1;const i=new Date(t).getTime();return Number.isNaN(i)?!1:e-i>s}async function m_(t){const e=await fetch(`${ea(t)}/status`,{cache:"no-store"});return e.ok?await e.json():Ih(e,"Status")}function g_(t){return{queryKey:ks.decofileStatus(Qo(t)),queryFn:()=>m_(t),staleTime:3e4}}async function jw(t,e){const s=await fetch(ea(t),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!s.ok)return Ih(s,"Save");const i=await s.json();return{...i,apiHost:i.apiHost??window.location.host}}function v_({isThreadLocked:t,hasCloudProviderKeys:e}){return t?!1:!e}function b_(){const t=H.c(3),e=yf(),i=ds()?.isThreadLocked??!1,r=e.length>0;let n;return t[0]!==i||t[1]!==r?(n=v_({isThreadLocked:i,hasCloudProviderKeys:r}),t[0]=i,t[1]=r,t[2]=n):n=t[2],n}function li(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Qr(t){if(!t)return"—";const e=typeof t=="string"?new Date(t):t;return isNaN(e.getTime())?"—":e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function S_(t){return t?t.replace(/-\d{8}(?:-[a-z0-9]+)*$/i,"").replace(/-/g," "):"—"}function y_(t){const e=H.c(4),{items:s}=t;let i;e[0]!==s?(i=s.map(x_),e[0]=s,e[1]=i):i=e[1];let r;return e[2]!==i?(r=h.jsx("div",{className:"grid grid-cols-2 gap-x-8 gap-y-6",children:i}),e[2]=i,e[3]=r):r=e[3],r}function x_(t){return h.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[h.jsx("span",{className:"text-xs text-muted-foreground truncate",children:t.label}),h.jsx("span",{className:"text-sm text-foreground tabular-nums truncate",children:t.value})]},t.label)}function w_(t){const e=H.c(33),{userTokens:s,assistantTokens:i,otherTokens:r}=t,n=be(),o=s+i+r,a=o>0?s/o*100:0,c=o>0?i/o*100:0,l=o>0?r/o*100:0;let u;e[0]!==a?(u=a>0&&h.jsx("div",{className:"h-full bg-chart-1",style:{width:`${a}%`}}),e[0]=a,e[1]=u):u=e[1];let d;e[2]!==c?(d=c>0&&h.jsx("div",{className:"h-full bg-chart-2",style:{width:`${c}%`}}),e[2]=c,e[3]=d):d=e[3];let f;e[4]!==l?(f=l>0&&h.jsx("div",{className:"h-full bg-muted-foreground/30",style:{width:`${l}%`}}),e[4]=l,e[5]=f):f=e[5];let p;e[6]!==u||e[7]!==d||e[8]!==f?(p=h.jsxs("div",{className:"flex h-2 w-full overflow-hidden rounded-full bg-muted",children:[u,d,f]}),e[6]=u,e[7]=d,e[8]=f,e[9]=p):p=e[9];let _;e[10]===Symbol.for("react.memo_cache_sentinel")?(_=h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-1 shrink-0"}),e[10]=_):_=e[10];let g;e[11]!==n||e[12]!==a?(g=n("chat.contextPanel.userPercent",{pct:a.toFixed(1)}),e[11]=n,e[12]=a,e[13]=g):g=e[13];let v;e[14]!==g?(v=h.jsxs("div",{className:"flex items-center gap-1.5",children:[_,h.jsx("span",{className:"text-xs text-muted-foreground",children:g})]}),e[14]=g,e[15]=v):v=e[15];let b;e[16]===Symbol.for("react.memo_cache_sentinel")?(b=h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-2 shrink-0"}),e[16]=b):b=e[16];let k;e[17]!==c||e[18]!==n?(k=n("chat.contextPanel.assistantPercent",{pct:c.toFixed(1)}),e[17]=c,e[18]=n,e[19]=k):k=e[19];let w;e[20]!==k?(w=h.jsxs("div",{className:"flex items-center gap-1.5",children:[b,h.jsx("span",{className:"text-xs text-muted-foreground",children:k})]}),e[20]=k,e[21]=w):w=e[21];let S;e[22]!==l||e[23]!==r||e[24]!==n?(S=r>0&&h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2 w-2 rounded-sm bg-muted-foreground/30 shrink-0"}),h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.otherPercent",{pct:l.toFixed(1)})})]}),e[22]=l,e[23]=r,e[24]=n,e[25]=S):S=e[25];let m;e[26]!==w||e[27]!==S||e[28]!==v?(m=h.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[v,w,S]}),e[26]=w,e[27]=S,e[28]=v,e[29]=m):m=e[29];let x;return e[30]!==m||e[31]!==p?(x=h.jsxs("div",{className:"flex flex-col gap-2",children:[p,m]}),e[30]=m,e[31]=p,e[32]=x):x=e[32],x}function C_(t){const e=H.c(14),{agentId:s,isError:i}=t,r=us(s),n=be();let o;e[0]!==r?.title||e[1]!==n?(o=r?.title??n("chat.subtask.subtaskNoun"),e[0]=r?.title,e[1]=n,e[2]=o):o=e[2];const a=o,c=r?.icon??null;let l;e[3]!==c||e[4]!==a?(l=h.jsx(Kc,{icon:c,name:a,size:"xs",className:"size-6 rounded-md shrink-0"}),e[3]=c,e[4]=a,e[5]=l):l=e[5];const u=i?"text-destructive":"text-foreground";let d;e[6]!==u?(d=_e("shrink-0 font-medium",u),e[6]=u,e[7]=d):d=e[7];let f;e[8]!==a||e[9]!==d?(f=h.jsx("span",{className:d,children:a}),e[8]=a,e[9]=d,e[10]=f):f=e[10];let p;return e[11]!==l||e[12]!==f?(p=h.jsxs(h.Fragment,{children:[l,f]}),e[11]=l,e[12]=f,e[13]=p):p=e[13],p}function k_(t){const e=H.c(12),{isError:s}=t,i=be();let r;e[0]!==i?(r=i("chat.contextPanel.subtask"),e[0]=i,e[1]=r):r=e[1];const n=r;let o;e[2]!==n?(o=h.jsx(Kc,{icon:null,name:n,size:"xs",className:"size-6 rounded-md shrink-0"}),e[2]=n,e[3]=o):o=e[3];const a=s?"text-destructive":"text-foreground";let c;e[4]!==a?(c=_e("shrink-0 font-medium",a),e[4]=a,e[5]=c):c=e[5];let l;e[6]!==n||e[7]!==c?(l=h.jsx("span",{className:c,children:n}),e[6]=n,e[7]=c,e[8]=l):l=e[8];let u;return e[9]!==o||e[10]!==l?(u=h.jsxs(h.Fragment,{children:[o,l]}),e[9]=o,e[10]=l,e[11]=u):u=e[11],u}function P_(t){const e=H.c(18),{part:s}=t,i=s.input?.agent_id,r=s.state==="input-streaming"||s.state==="input-available"||s.state==="output-available"&&s.preliminary===!0,n=s.state==="output-error",o=s.state==="approval-requested";let a;e[0]!==n?(a=h.jsx(k_,{isError:n}),e[0]=n,e[1]=a):a=e[1];let c;e[2]!==i||e[3]!==n?(c=h.jsx(C_,{agentId:i,isError:n}),e[2]=i,e[3]=n,e[4]=c):c=e[4];let l;e[5]!==a||e[6]!==c?(l=h.jsx(O.Suspense,{fallback:a,children:c}),e[5]=a,e[6]=c,e[7]=l):l=e[7];let u;e[8]!==s.input?(u=s.input?.prompt&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-muted-foreground/50",children:"·"}),h.jsx("span",{className:"truncate text-muted-foreground",children:s.input.prompt})]}),e[8]=s.input,e[9]=u):u=e[9];let d;e[10]!==o||e[11]!==n||e[12]!==r?(d=h.jsx("span",{className:"ml-auto shrink-0",children:r?h.jsx(gt,{className:"size-3 text-muted-foreground"}):n?h.jsx(Df,{size:12,className:"text-destructive"}):o?h.jsx(Lo,{size:12,className:"text-warning"}):h.jsx(jo,{size:12,className:"text-success"})}),e[10]=o,e[11]=n,e[12]=r,e[13]=d):d=e[13];let f;return e[14]!==l||e[15]!==u||e[16]!==d?(f=h.jsxs("div",{className:"flex items-center gap-2 text-xs min-w-0",children:[l,u,d]}),e[14]=l,e[15]=u,e[16]=d,e[17]=f):f=e[17],f}function E_(t){const e=H.c(78),{onClose:s,back:i,className:r}=t,n=be(),[o,a]=O.useState(null),{messages:c}=Bo(),{activeTask:l}=zi(),{selectedModel:u,selectedVirtualMcp:d}=$c();let f,p,_,g,v,b,k,w;if(e[0]!==l||e[1]!==i||e[2]!==r||e[3]!==c||e[4]!==s||e[5]!==o?.id||e[6]!==u||e[7]!==d?.title||e[8]!==n){w=Symbol.for("react.early_return_sentinel");e:{const x=Mf(c),y=[...c].reverse().find(O_),C=y?.metadata?.usage,N=y?.metadata?.modelLimits?.contextWindow??u?.limits?.contextWindow??null,T=C?.contextTokens??0,R=N&&N>0?(T/N*100).toFixed(1):null,E=c;let P;e[17]!==E?(P=E.filter(I_).reduce(j_,0),e[17]=E,e[18]=P):P=e[18];const A=P,M=c;let L;e[19]!==M?(L=M.filter(L_).reduce(B_,0),e[19]=M,e[20]=L):L=e[20];const B=L,D=Math.max(0,x.totalTokens-A-B),j=c[0],K=c.at(-1),z=j?.metadata?.created_at??l?.created_at,G=K?.metadata?.created_at??l?.updated_at,I=c.filter(M_),V=c.flatMap(D_),$=u?.modelId?S_(u.modelId):"—",ee=d?.title??"Super Agent",se=[{label:n("chat.contextPanel.sessionLabel"),value:l?.title??n("chat.contextPanel.newChat")},{label:n("chat.contextPanel.messagesLabel"),value:I.length},{label:n("chat.contextPanel.agentLabel"),value:ee},{label:n("chat.contextPanel.modelLabel"),value:$},{label:n("chat.contextPanel.contextLimitLabel"),value:N?li(N):"—"},{label:n("chat.contextPanel.sessionTokensLabel"),value:x.totalTokens>0?li(x.totalTokens):"0"},{label:n("chat.contextPanel.usageLabel"),value:R!==null?`${R}%`:"—"},{label:n("chat.contextPanel.inputTokensLabel"),value:x.inputTokens>0?li(x.inputTokens):"0"},{label:n("chat.contextPanel.outputTokensLabel"),value:x.outputTokens>0?li(x.outputTokens):"0"},{label:n("chat.contextPanel.reasoningTokensLabel"),value:x.reasoningTokens>0?li(x.reasoningTokens):"0"},{label:n("chat.contextPanel.costLabel"),value:x.cost>0?`$${x.cost<.001?x.cost.toFixed(6):x.cost.toFixed(4)}`:"$0.00"},{label:n("chat.contextPanel.sessionCreatedLabel"),value:Qr(z)},{label:n("chat.contextPanel.lastActivityLabel"),value:Qr(G)}];if(!l&&I.length===0){let q;e[21]!==r?(q=_e("flex flex-col h-full w-full border-l border-border bg-background",r),e[21]=r,e[22]=q):q=e[22];let F;e[23]!==n?(F=n("chat.contextPanel.title"),e[23]=n,e[24]=F):F=e[24];let Q;e[25]!==F?(Q=h.jsx("span",{className:"text-sm font-medium text-foreground",children:F}),e[25]=F,e[26]=Q):Q=e[26];let he;e[27]!==i?(he=i?h.jsx(En,{size:14,className:"text-muted-foreground"}):h.jsx(Oa,{size:14,className:"text-muted-foreground"}),e[27]=i,e[28]=he):he=e[28];let ue;e[29]!==s||e[30]!==he?(ue=h.jsx("button",{type:"button",onClick:s,className:"flex size-6 items-center justify-center rounded hover:bg-accent transition-colors",children:he}),e[29]=s,e[30]=he,e[31]=ue):ue=e[31];let fe;e[32]!==Q||e[33]!==ue?(fe=h.jsxs("div",{className:"h-11 px-4 flex items-center justify-between shrink-0 border-b border-border/50",children:[Q,ue]}),e[32]=Q,e[33]=ue,e[34]=fe):fe=e[34];let ne;e[35]!==n?(ne=n("chat.contextPanel.emptyState"),e[35]=n,e[36]=ne):ne=e[36];let ce;e[37]!==ne?(ce=h.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:h.jsx("p",{className:"text-xs text-muted-foreground",children:ne})}),e[37]=ne,e[38]=ce):ce=e[38];let de;e[39]!==q||e[40]!==fe||e[41]!==ce?(de=h.jsxs("div",{className:q,children:[fe,ce]}),e[39]=q,e[40]=fe,e[41]=ce,e[42]=de):de=e[42],w=de;break e}e[43]!==r?(b=_e("flex flex-col h-full w-full border-l border-border bg-background overflow-y-auto",r),e[43]=r,e[44]=b):b=e[44];let ie;e[45]!==n?(ie=n("chat.contextPanel.title"),e[45]=n,e[46]=ie):ie=e[46];let Y;e[47]!==ie?(Y=h.jsx("span",{className:"text-sm font-medium text-foreground",children:ie}),e[47]=ie,e[48]=Y):Y=e[48];let Z;e[49]!==i?(Z=i?h.jsx(En,{size:14}):h.jsx(Oa,{size:14}),e[49]=i,e[50]=Z):Z=e[50];let X;e[51]!==s||e[52]!==Z?(X=h.jsx("button",{type:"button",onClick:s,className:"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:Z}),e[51]=s,e[52]=Z,e[53]=X):X=e[53],e[54]!==Y||e[55]!==X?(k=h.jsxs("div",{className:"flex h-11 shrink-0 items-center justify-between border-b border-border/50 px-4",children:[Y,X]}),e[54]=Y,e[55]=X,e[56]=k):k=e[56],f="flex flex-col gap-8 p-6",p=V.length>0&&h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.subtasksSection")}),h.jsx("div",{className:"flex flex-col gap-1",children:V.map(A_)})]}),_=h.jsx(y_,{items:se});let U;e[57]!==n?(U=n("chat.contextPanel.contextBreakdownSection"),e[57]=n,e[58]=U):U=e[58];let J;e[59]!==U?(J=h.jsx("span",{className:"text-xs text-muted-foreground",children:U}),e[59]=U,e[60]=J):J=e[60];let ae;e[61]!==B||e[62]!==D||e[63]!==A?(ae=h.jsx(w_,{userTokens:A,assistantTokens:B,otherTokens:D}),e[61]=B,e[62]=D,e[63]=A,e[64]=ae):ae=e[64],e[65]!==J||e[66]!==ae?(g=h.jsxs("div",{className:"flex flex-col gap-3",children:[J,ae]}),e[65]=J,e[66]=ae,e[67]=g):g=e[67],v=I.length>0&&h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("span",{className:"text-xs text-muted-foreground",children:n("chat.contextPanel.rawMessagesSection")}),h.jsx("div",{className:"flex flex-col gap-1",children:I.map(q=>{const F=q.metadata?.created_at,Q=o?.id===q.id;return h.jsxs("div",{className:"rounded-md border border-border/50 overflow-hidden",children:[h.jsxs("button",{type:"button",onClick:()=>a(Q?null:q),className:"flex items-center justify-between gap-2 px-3 py-2 text-xs hover:bg-accent/50 w-full text-left cursor-pointer",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:_e("shrink-0 font-medium",q.role==="user"?"text-chart-1":"text-chart-2"),children:q.role}),h.jsx("span",{className:"text-muted-foreground",children:"•"}),h.jsx("span",{className:"truncate text-muted-foreground font-mono",children:q.id})]}),F&&h.jsx("span",{className:"shrink-0 text-muted-foreground tabular-nums",children:Qr(F)})]}),Q&&h.jsxs(h.Fragment,{children:[q.role==="assistant"&&(()=>{const he=q.metadata?._request;if(!he)return null;const ue=he.systemSections??[],fe=Math.max(1,...ue.map(T_)),ne=ue.reduce(R_,0);return h.jsxs("div",{className:"border-t border-border/50 px-3 py-2.5 text-xs space-y-2.5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-medium text-foreground",children:n("chat.contextPanel.requestLabel")}),h.jsxs("span",{className:"text-muted-foreground tabular-nums",children:[he.activeTools??0," / ",he.tools??0," ",n("chat.contextPanel.toolsActive")]})]}),ue.length>0&&h.jsxs("div",{className:"space-y-1.5",children:[h.jsxs("div",{className:"text-muted-foreground",children:[n("chat.contextPanel.systemPromptLabel")," ",h.jsxs("span",{className:"tabular-nums",children:["~",Math.round(ne/4).toLocaleString()," ",n("chat.contextPanel.tokAbbrev")]})]}),ue.map((ce,de)=>{const le=ce.preview.match(/^<([a-z-]+)/i)?.[1]??`section ${de}`,re=ce.chars/fe*100,ge=Math.round(ce.chars/4);return h.jsxs("div",{className:"space-y-0.5",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2",children:[h.jsx("span",{className:"font-mono text-foreground truncate",children:le}),h.jsxs("span",{className:"text-muted-foreground tabular-nums shrink-0",children:["~",ge.toLocaleString()," ",n("chat.contextPanel.tokAbbrev")]})]}),h.jsx("div",{className:"h-1 w-full rounded-full bg-muted overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-chart-3",style:{width:`${re}%`}})})]},de)})]})]})})(),h.jsx("pre",{className:"text-xs font-mono bg-muted px-3 py-2 overflow-auto whitespace-pre-wrap break-all border-t border-border/50 max-h-64",children:JSON.stringify(q,null,2)})]})]},q.id)})})]})}e[0]=l,e[1]=i,e[2]=r,e[3]=c,e[4]=s,e[5]=o?.id,e[6]=u,e[7]=d?.title,e[8]=n,e[9]=f,e[10]=p,e[11]=_,e[12]=g,e[13]=v,e[14]=b,e[15]=k,e[16]=w}else f=e[9],p=e[10],_=e[11],g=e[12],v=e[13],b=e[14],k=e[15],w=e[16];if(w!==Symbol.for("react.early_return_sentinel"))return w;let S;e[68]!==f||e[69]!==p||e[70]!==_||e[71]!==g||e[72]!==v?(S=h.jsxs("div",{className:f,children:[p,_,g,v]}),e[68]=f,e[69]=p,e[70]=_,e[71]=g,e[72]=v,e[73]=S):S=e[73];let m;return e[74]!==b||e[75]!==k||e[76]!==S?(m=h.jsxs("div",{className:b,children:[k,S]}),e[74]=b,e[75]=k,e[76]=S,e[77]=m):m=e[77],m}function R_(t,e){return t+e.chars}function T_(t){return t.chars}function A_(t,e){return h.jsx(P_,{part:t},e)}function D_(t){return(t.parts??[]).filter(N_)}function N_(t){return t.type==="tool-subtask"}function M_(t){return t.role!=="system"}function B_(t,e){const s=e.metadata?.usage;return t+(s?.outputTokens??0)}function L_(t){return t.role==="assistant"}function j_(t,e){const s=e.metadata?.usage;return t+(s?.inputTokens??0)}function I_(t){return t.role==="user"}function O_(t){return t.role==="assistant"&&t.metadata?.usage}function z_(t){const e=H.c(21),{onOpenContextPanel:s}=t,{org:i}=ut(),{selectedVirtualMcp:r}=$c();let n;e[0]!==i.id?(n=Bi(i.id),e[0]=i.id,e[1]=n):n=e[1];const a=r??n,l=us(a.id)??a,u=l.title??"Super Agent",d=l.icon??null,f=l.description??null;let p;e[2]!==d||e[3]!==u?(p=h.jsx(Ri,{icon:d,name:u,size:"lg"}),e[2]=d,e[3]=u,e[4]=p):p=e[4];let _;e[5]!==u?(_=h.jsx("h2",{className:"text-2xl font-semibold tracking-tight text-foreground",children:u}),e[5]=u,e[6]=_):_=e[6];let g;e[7]!==f?(g=f?h.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-balance",children:f}):null,e[7]=f,e[8]=g):g=e[8];let v;e[9]!==_||e[10]!==g?(v=h.jsxs("div",{className:"space-y-1.5",children:[_,g]}),e[9]=_,e[10]=g,e[11]=v):v=e[11];let b;e[12]!==p||e[13]!==v?(b=h.jsxs("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-4 px-6 text-center overflow-hidden",children:[p,v]}),e[12]=p,e[13]=v,e[14]=b):b=e[14];let k;e[15]===Symbol.for("react.memo_cache_sentinel")?(k=h.jsx(ht.IceBreakers,{className:"pb-3"}),e[15]=k):k=e[15];let w;e[16]!==s?(w=h.jsxs(ht.Footer,{children:[k,h.jsx(ht.Input,{onOpenContextPanel:s})]}),e[16]=s,e[17]=w):w=e[17];let S;return e[18]!==b||e[19]!==w?(S=h.jsxs(h.Fragment,{children:[b,w]}),e[18]=b,e[19]=w,e[20]=S):S=e[20],S}function Wa(t){const e=H.c(17),{outputs:s,collapsed:i,onToggle:r,variant:n}=t,o=n==="card"?"rounded-xl border border-border bg-muted/95 shadow-sm backdrop-blur-sm":"border-b border-border bg-background";let a;e[0]!==o?(a=_e(o),e[0]=o,e[1]=a):a=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=h.jsx("span",{className:"text-sm font-medium text-foreground",children:"Files in this task"}),e[2]=c):c=e[2];const l=i&&"-rotate-90";let u;e[3]!==l?(u=_e("size-4 text-muted-foreground transition-transform",l),e[3]=l,e[4]=u):u=e[4];let d;e[5]!==u?(d=h.jsx($s,{className:u}),e[5]=u,e[6]=d):d=e[6];let f;e[7]!==r||e[8]!==d?(f=h.jsxs("button",{type:"button",onClick:r,className:"flex w-full items-center justify-between px-3 py-2.5 text-left",children:[c,d]}),e[7]=r,e[8]=d,e[9]=f):f=e[9];let p;e[10]!==i||e[11]!==s?(p=!i&&h.jsx("div",{className:"flex max-h-72 flex-col gap-1.5 overflow-y-auto px-2 pb-2",children:s.map($_)}),e[10]=i,e[11]=s,e[12]=p):p=e[12];let _;return e[13]!==a||e[14]!==f||e[15]!==p?(_=h.jsxs("div",{className:a,children:[f,p]}),e[13]=a,e[14]=f,e[15]=p,e[16]=_):_=e[16],_}function $_(t){return h.jsx(Lf,{file:t},t.key)}function F_(){const t=H.c(13),e=ds()?.taskId??null,s=If();let i;t[0]!==s?(i={enabled:s},t[0]=s,t[1]=i):i=t[1];const{data:r}=Of(e,i),[n,o]=O.useState(!1),[a,c]=O.useState(!0);if(!e||!r||r.length===0)return null;let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>o(W_),t[2]=l):l=t[2];let u;t[3]!==n||t[4]!==r?(u=h.jsx("div",{className:"absolute top-2 right-2 z-10 hidden w-72 @[1280px]:block",children:h.jsx(Wa,{variant:"card",outputs:r,collapsed:n,onToggle:l})}),t[3]=n,t[4]=r,t[5]=u):u=t[5];let d;t[6]===Symbol.for("react.memo_cache_sentinel")?(d=()=>c(H_),t[6]=d):d=t[6];let f;t[7]!==a||t[8]!==r?(f=h.jsx("div",{className:"shrink-0 @[1280px]:hidden",children:h.jsx(Wa,{variant:"bar",outputs:r,collapsed:a,onToggle:d})}),t[7]=a,t[8]=r,t[9]=f):f=t[9];let p;return t[10]!==u||t[11]!==f?(p=h.jsxs(h.Fragment,{children:[u,f]}),t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function H_(t){return!t}function W_(t){return!t}function U_(){const t=H.c(31),{org:e}=ut(),s=ds(),{isChatEmpty:i}=Bo(),[r,n]=O.useState("chat"),o=zf(),a=b_(),{runtime:c}=ni(s?.virtualMcpId);if(a&&c!=="cms"){let T;return t[0]===Symbol.for("react.memo_cache_sentinel")?(T=h.jsx(ht,{className:"animate-in fade-in-0 duration-200",children:h.jsx(ht.Main,{className:"flex flex-col items-center",children:h.jsx(ht.EmptyState,{children:h.jsx(ht.NoAiProviderEmptyState,{})})})}),t[0]=T):T=t[0],T}let u;t[1]!==o.hasDecoKey||t[2]!==o.hasOnlyDecoProvider||t[3]!==o.isLoading||t[4]!==o.isZeroBalance||t[5]!==i||t[6]!==e?(u=o.hasDecoKey&&o.isZeroBalance&&o.hasOnlyDecoProvider&&!o.isLoading&&i&&!_f(e.id),t[1]=o.hasDecoKey,t[2]=o.hasOnlyDecoProvider,t[3]=o.isLoading,t[4]=o.isZeroBalance,t[5]=i,t[6]=e,t[7]=u):u=t[7];const d=u;let f;t[8]!==d?(f=d&&h.jsx(ht.CreditsEmptyState,{}),t[8]=d,t[9]=f):f=t[9];const p=r!=="chat"?!0:void 0,_=r!=="chat",g=r!=="chat"?"opacity-0 pointer-events-none":"opacity-100";let v;t[10]!==g?(v=_e("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",g),t[10]=g,t[11]=v):v=t[11];let b;t[12]!==i||t[13]!==c?(b=i&&c!=="cms"?h.jsx(z_,{onOpenContextPanel:()=>n("context")}):h.jsxs(h.Fragment,{children:[h.jsxs(ht.Main,{className:"relative flex flex-col overflow-hidden @container",children:[h.jsx(F_,{}),h.jsx("div",{className:"min-h-0 flex-1",children:h.jsx(ht.Messages,{})})]}),h.jsx(ht.Footer,{children:h.jsx(ht.Input,{onOpenContextPanel:()=>n("context")})})]}),t[12]=i,t[13]=c,t[14]=b):b=t[14];let k;t[15]!==p||t[16]!==_||t[17]!==v||t[18]!==b?(k=h.jsx("div",{inert:p,"aria-hidden":_,className:v,children:b}),t[15]=p,t[16]=_,t[17]=v,t[18]=b,t[19]=k):k=t[19];const w=r!=="context"?!0:void 0,S=r!=="context",m=r==="context"?"opacity-100":"opacity-0 pointer-events-none";let x;t[20]!==m?(x=_e("absolute inset-0 flex flex-col transition-opacity duration-100 ease-out",m),t[20]=m,t[21]=x):x=t[21];let y;t[22]===Symbol.for("react.memo_cache_sentinel")?(y=h.jsx(E_,{back:!0,onClose:()=>n("chat")}),t[22]=y):y=t[22];let C;t[23]!==x||t[24]!==w||t[25]!==S?(C=h.jsx("div",{inert:w,"aria-hidden":S,className:x,children:y}),t[23]=x,t[24]=w,t[25]=S,t[26]=C):C=t[26];let N;return t[27]!==f||t[28]!==C||t[29]!==k?(N=h.jsxs(ht,{className:"relative overflow-hidden animate-in fade-in-0 duration-200",children:[f,k,C]}),t[27]=f,t[28]=C,t[29]=k,t[30]=N):N=t[30],N}function Oh(){const t=H.c(7),e=be();let s;t[0]!==e?(s=e("agentShellLayout.agentShellLayout.chatLoadingError"),t[0]=e,t[1]=s):s=t[1];let i;t[2]!==s?(i=h.jsx("div",{role:"alert",className:"flex h-full flex-1 items-center justify-center text-sm text-muted-foreground",children:s}),t[2]=s,t[3]=i):i=t[3];let r;t[4]===Symbol.for("react.memo_cache_sentinel")?(r=h.jsx(ls,{children:h.jsx(U_,{})}),t[4]=r):r=t[4];let n;return t[5]!==i?(n=h.jsx(Li,{fallback:i,children:r}),t[5]=i,t[6]=n):n=t[6],n}function K_(t){return(t??"").normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"user"}function ta(t){return t?.name||t?.email?.split("@")[0]||void 0}function ti(t){const e=K_(t),s=Date.now().toString(36).split("").reverse().join("");return`${e}-${s}`}function zh(t){return!!t.harness_id||!!t.title&&t.title!=="New chat"}function q_(t){return{threadId:t.routeThreadId,providerKey:t.routeThreadId??t.fallbackKey}}function V_(t){return t.sidePanelOpen||t.mainOpen?t:{...t,sidePanelOpen:!0}}function G_(t){const e=t.entityMetadata?.defaultMainView??null,s=e==null||e.type==="chat",i=t.mainPanelParam??(t.panelNamed||!!t.routeDefaultMain||!s),r=t.routeDefaultMain?!1:s||t.entityMetadata?.chatDefaultOpen===!0||t.threadHasMessages===!0,n=t.sidePanelParamPresent?t.sidePanelParamValue===!0:r;return V_({sidePanelOpen:n,mainOpen:i})}function Ua(t,e){switch(t.type){case"toggleSidePanel":return e.sidePanelOpen?e.mainOpen?{sidepanel:!1}:null:{sidepanel:!0};case"toggleMain":return e.mainOpen?{mainpanel:!1,sidepanel:!0}:{mainpanel:!0};case"openSidePanel":return e.sidePanelOpen?null:{sidepanel:!0}}}function Y_(t){return t.sidePanelOpen&&t.mainOpen?{side:33,main:67}:t.sidePanelOpen?{side:100,main:0}:t.mainOpen?{side:0,main:100}:{side:0,main:0}}function X_(t){const{sidePanelOpen:e,mainOpen:s}=t.visibility;return e&&(t.sidePanelParamPresent||!s)?"chat":s?"main":"chat"}function J_(t){return t==="main"?{sidepanel:!1,mainpanel:!0}:{sidepanel:!0,mainpanel:!1}}function Z_(t,e){const s=ji(),i=np(),r=Ii({strict:!1}),n=ri({strict:!1}),{create:o}=zo(),{threads:a}=Ir(),{virtualMcpId:c,isAgentRoute:l}=e,u=lp(),d=Ho(),f=$i(),p=O.useRef(crypto.randomUUID()),{threadId:_,providerKey:g}=q_({routeThreadId:f,fallbackKey:p.current}),v=_!=null?a.find(N=>N.id===_):void 0,{sidePanelOpen:b,mainOpen:k}=G_({entityMetadata:t,mainPanelParam:r.mainpanel,panelNamed:d!==void 0,sidePanelParamPresent:r.sidepanel!==void 0,sidePanelParamValue:r.sidepanel,routeDefaultMain:u,threadHasMessages:v?zh(v):!1}),w={sidePanelOpen:b,mainOpen:k},S=l&&n.taskId!==void 0?{virtualmcpid:c}:{},m=(N,T)=>{s({to:".",search:R=>({...R,...N}),replace:T?.replace??!1})},x=()=>{const N=Ua({type:"toggleMain"},w);N&&m(N,{replace:!0})},y=()=>{const N=Ua({type:"toggleSidePanel"},w);N&&m(N,{replace:!0})},C=async()=>{const N=crypto.randomUUID(),T=a.find(R=>R.id===_)?.branch??null;try{await o({id:N,virtual_mcp_id:c,...T?{branch:T}:{}})}catch{}i(N,()=>({...S}))};return{threadId:_,providerKey:g,sidePanelOpen:b,mainOpen:k,sidePanelParamPresent:r.sidepanel!==void 0,toggleMain:x,toggleSidePanel:y,createNewTask:C}}function Q_(t){const e=H.c(10),{org:s}=ut(),i=Kf(),{data:r}=hs.useSession(),n=r?.user?.id,o=t?.id??null,a=!!t&&!!n&&!!t.created_by&&t.created_by!==n;let c;e[0]!==s.id||e[1]!==o?(c=ks.viewedThreadMetadataRefresh(s.id,o??""),e[0]=s.id,e[1]=o,e[2]=c):c=e[2];const l=!!i&&!!o&&a;let u;e[3]!==i||e[4]!==o?(u=async()=>(await i?.refreshThreadMetadata(o??""),!0),e[3]=i,e[4]=o,e[5]=u):u=e[5];let d;e[6]!==c||e[7]!==l||e[8]!==u?(d={queryKey:c,enabled:l,staleTime:Number.POSITIVE_INFINITY,queryFn:u},e[6]=c,e[7]=l,e[8]=u,e[9]=d):d=e[9],es(d)}function em(t,e){return t.some(s=>s.branch===e.branch)?t:[...t,e]}function tm(t,e){return t.filter(s=>s.branch!==e)}function sm(t,e,s){return t.map(i=>i.branch===e?{...i,name:s}:i)}const Ka=["orange","violet","blue","pink","amber","teal"];function hr(t){return Ka[t%Ka.length]}function Bn(t,e){const s=`${e} `,i=t.reduce((r,n)=>{if(!n.name.startsWith(s))return r;const o=Number(n.name.slice(s.length));return Number.isInteger(o)&&o>r?o:r},0);return`${e} ${i+1}`}const im={orange:"bg-orange-500",violet:"bg-violet-500",blue:"bg-blue-500",pink:"bg-pink-500",amber:"bg-amber-500",teal:"bg-teal-500"};function en(t){return t&&im[t]||"bg-muted-foreground"}function Fr(t){const e=H.c(26),s=us(t),i=Nf(),{org:r}=ut(),n=Lc();let o;e[0]!==s?.metadata?.releases?(o=s?.metadata?.releases??[],e[0]=s?.metadata?.releases,e[1]=o):o=e[1];const a=o;let c;e[2]!==r||e[3]!==t?(c=m=>m[1]===r.id&&m[3]==="collection"&&m[4]==="VIRTUAL_MCP"&&m[5]===t,e[2]=r,e[3]=t,e[4]=c):c=e[4];const l=c;let u;e[5]!==l||e[6]!==n||e[7]!==a?(u=()=>{for(const[,m]of n.getQueriesData({predicate:x=>l(x.queryKey)}))if(m?.item)return m.item.metadata?.releases??[];return a},e[5]=l,e[6]=n,e[7]=a,e[8]=u):u=e[8];const d=u;let f;e[9]!==i||e[10]!==l||e[11]!==n||e[12]!==d||e[13]!==t?(f=m=>cp(`vm-releases:${t}`,async()=>{const x=d(),y=m(x);if(y!==x){n.setQueriesData({predicate:C=>l(C.queryKey)},C=>C?.item?{item:{...C.item,metadata:{...C.item.metadata,releases:y}}}:C);try{await i.update.mutateAsync({id:t,data:{metadata:{releases:y}}})}catch(C){const N=C;throw n.invalidateQueries({predicate:T=>l(T.queryKey)}),N}}}),e[9]=i,e[10]=l,e[11]=n,e[12]=d,e[13]=t,e[14]=f):f=e[14];const p=f;let _;e[15]!==p?(_=m=>p(x=>em(x,m)),e[15]=p,e[16]=_):_=e[16];const g=_;let v;e[17]!==p?(v=(m,x)=>p(y=>sm(y,m,x)),e[17]=p,e[18]=v):v=e[18];const b=v;let k;e[19]!==p?(k=m=>p(x=>tm(x,m)),e[19]=p,e[20]=k):k=e[20];const w=k;let S;return e[21]!==g||e[22]!==w||e[23]!==a||e[24]!==b?(S={releases:a,createRelease:g,renameRelease:b,deleteRelease:w},e[21]=g,e[22]=w,e[23]=a,e[24]=b,e[25]=S):S=e[25],S}function rm(t,e){const s=getComputedStyle(t),i=parseFloat(s.fontSize);return e*i}function nm(t,e){const s=getComputedStyle(t.ownerDocument.documentElement),i=parseFloat(s.fontSize);return e*i}function om(t){return t/100*window.innerHeight}function am(t){return t/100*window.innerWidth}function lm(t){switch(typeof t){case"number":return[t,"px"];case"string":{const e=parseFloat(t);return t.endsWith("%")?[e,"%"]:t.endsWith("px")?[e,"px"]:t.endsWith("rem")?[e,"rem"]:t.endsWith("em")?[e,"em"]:t.endsWith("vh")?[e,"vh"]:t.endsWith("vw")?[e,"vw"]:[e,"%"]}}}function mi({groupSize:t,panelElement:e,styleProp:s}){let i;const[r,n]=lm(s);switch(n){case"%":{i=r/100*t;break}case"px":{i=r;break}case"rem":{i=nm(e,r);break}case"em":{i=rm(e,r);break}case"vh":{i=om(r);break}case"vw":{i=am(r);break}}return i}function vt(t){return parseFloat(t.toFixed(3))}function si({group:t}){const{orientation:e,panels:s}=t;return s.reduce((i,r)=>(i+=e==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,i),0)}function Ln(t){const{panels:e}=t,s=si({group:t});return s===0?e.map(i=>({groupResizeBehavior:i.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:i.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:i.panelConstraints.disabled,minSize:0,maxSize:100,panelId:i.id})):e.map(i=>{const{element:r,panelConstraints:n}=i;let o=0;if(n.collapsedSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.collapsedSize});o=vt(u/s*100)}let a;if(n.defaultSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.defaultSize});a=vt(u/s*100)}let c=0;if(n.minSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.minSize});c=vt(u/s*100)}let l=100;if(n.maxSize!==void 0){const u=mi({groupSize:s,panelElement:r,styleProp:n.maxSize});l=vt(u/s*100)}return{groupResizeBehavior:n.groupResizeBehavior,collapsedSize:o,collapsible:n.collapsible===!0,defaultSize:a,disabled:n.disabled,minSize:c,maxSize:l,panelId:i.id}})}function De(t,e="Assertion error"){if(!t)throw Error(e)}function jn(t,e){return Array.from(e).sort(t==="horizontal"?cm:hm)}function cm(t,e){const s=t.element.offsetLeft-e.element.offsetLeft;return s!==0?s:t.element.offsetWidth-e.element.offsetWidth}function hm(t,e){const s=t.element.offsetTop-e.element.offsetTop;return s!==0?s:t.element.offsetHeight-e.element.offsetHeight}function $h(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.ELEMENT_NODE}function Fh(t,e){return{x:t.x>=e.left&&t.x<=e.right?0:Math.min(Math.abs(t.x-e.left),Math.abs(t.x-e.right)),y:t.y>=e.top&&t.y<=e.bottom?0:Math.min(Math.abs(t.y-e.top),Math.abs(t.y-e.bottom))}}function dm({orientation:t,rects:e,targetRect:s}){const i={x:s.x+s.width/2,y:s.y+s.height/2};let r,n=Number.MAX_VALUE;for(const o of e){const{x:a,y:c}=Fh(i,o),l=t==="horizontal"?a:c;l<n&&(n=l,r=o)}return De(r,"No rect found"),r}let Zi;function um(){return Zi===void 0&&(typeof matchMedia=="function"?Zi=!!matchMedia("(pointer:coarse)").matches:Zi=!1),Zi}function Hh(t){const{element:e,orientation:s,panels:i,separators:r}=t,n=jn(s,Array.from(e.children).filter($h).map(_=>({element:_}))).map(({element:_})=>_),o=[];let a=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let _=-1;for(const g of n)g.hasAttribute("data-panel")&&(_++,g.hasAttribute("data-disabled")||(d++,l===-1&&(l=_),u=_))}if(d>1){let _=-1;for(const g of n)if(g.hasAttribute("data-panel")){_++;const v=i.find(b=>b.element===g);if(v){if(f){const b=f.element.getBoundingClientRect(),k=g.getBoundingClientRect();let w;if(c){const S=s==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),m=s==="horizontal"?new DOMRect(k.left,k.top,0,k.height):new DOMRect(k.left,k.top,k.width,0);switch(p.length){case 0:{w=[S,m];break}case 1:{const x=p[0],y=dm({orientation:s,rects:[b,k],targetRect:x.element.getBoundingClientRect()});w=[x,y===b?m:S];break}default:{w=p;break}}}else p.length?w=p:w=[s==="horizontal"?new DOMRect(b.right,k.top,k.left-b.right,k.height):new DOMRect(k.left,b.bottom,k.width,k.top-b.bottom)];for(const S of w){let m="width"in S?S:S.element.getBoundingClientRect();const x=um()?t.resizeTargetMinimumSize.coarse:t.resizeTargetMinimumSize.fine;if(m.width<x){const C=x-m.width;m=new DOMRect(m.x-C/2,m.y,m.width+C,m.height)}if(m.height<x){const C=x-m.height;m=new DOMRect(m.x,m.y-C/2,m.width,m.height+C)}const y=_<=l||_>u;!a&&!y&&o.push({group:t,groupSize:si({group:t}),panels:[f,v],separator:"width"in S?void 0:S,rect:m}),a=!1}}c=!1,f=v,p=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(a=!0);const v=r.find(b=>b.element===g);v?p.push(v):(f=void 0,p=[])}else c=!0}return o}class Wh{#e={};addListener(e,s){const i=this.#e[e];return i===void 0?this.#e[e]=[s]:i.includes(s)||i.push(s),()=>{this.removeListener(e,s)}}emit(e,s){const i=this.#e[e];if(i!==void 0)if(i.length===1)i[0].call(null,s);else{let r=!1,n=null;const o=Array.from(i);for(let a=0;a<o.length;a++){const c=o[a];try{c.call(null,s)}catch(l){n===null&&(r=!0,n=l)}}if(r)throw n}}removeAllListeners(){this.#e={}}removeListener(e,s){const i=this.#e[e];if(i!==void 0){const r=i.indexOf(s);r>=0&&i.splice(r,1)}}}let Zs={cursorFlags:0,state:"inactive"};const sa=new Wh;function Ls(){return Zs}function fm(t){return sa.addListener("change",t)}function pm(t){const e=Zs,s={...Zs};s.cursorFlags=t,Zs=s,sa.emit("change",{prev:e,next:s})}function Qs(t){const e=Zs;Zs=t,sa.emit("change",{prev:e,next:t})}const _m=t=>t,tn=()=>{},Uh=1,Kh=2,qh=4,Vh=8,qa=3,Va=12;let Qi;function Ga(){return Qi===void 0&&(Qi=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Qi=!0)),Qi}function mm({cursorFlags:t,groups:e,state:s}){let i=0,r=0;switch(s){case"active":case"hover":e.forEach(n=>{if(!n.mutableState.disableCursor)switch(n.orientation){case"horizontal":{i++;break}case"vertical":{r++;break}}})}if(!(i===0&&r===0)){switch(s){case"active":{if(t&&Ga()){const n=(t&Uh)!==0,o=(t&Kh)!==0,a=(t&qh)!==0,c=(t&Vh)!==0;if(n)return a?"se-resize":c?"ne-resize":"e-resize";if(o)return a?"sw-resize":c?"nw-resize":"w-resize";if(a)return"s-resize";if(c)return"n-resize"}break}}return Ga()?i>0&&r>0?"move":i>0?"ew-resize":"ns-resize":i>0&&r>0?"grab":i>0?"col-resize":"row-resize"}}const Ya=new WeakMap;function ia(t){if(t.defaultView===null||t.defaultView===void 0)return;let{prevStyle:e,styleSheet:s}=Ya.get(t)??{};s===void 0&&(s=new t.defaultView.CSSStyleSheet,t.adoptedStyleSheets&&(Object.isExtensible(t.adoptedStyleSheets)?t.adoptedStyleSheets.push(s):t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]));const i=Ls();switch(i.state){case"active":case"hover":{const r=mm({cursorFlags:i.cursorFlags,groups:i.hitRegions.map(o=>o.group),state:i.state}),n=`*, *:hover {cursor: ${r} !important; }`;if(e===n)return;e=n,r?s.cssRules.length===0?s.insertRule(n):s.replaceSync(n):s.cssRules.length===1&&s.deleteRule(0);break}case"inactive":{e=void 0,s.cssRules.length===1&&s.deleteRule(0);break}}Ya.set(t,{prevStyle:e,styleSheet:s})}let Xt=new Map;const Gh=new Wh;function gm(t){Xt=new Map(Xt),Xt.delete(t)}function Xa(t,e){for(const[s]of Xt)if(s.id===t)return s}function xs(t,e){for(const[s,i]of Xt)if(s.id===t)return i;if(e)throw Error(`Could not find data for Group with id ${t}`)}function Fs(){return Xt}function ra(t,e){return Gh.addListener("groupChange",s=>{s.group.id===t&&e(s)})}function cs(t,e,s){const i=Xt.get(t);Xt=new Map(Xt),Xt.set(t,e),Gh.emit("groupChange",{group:t,isUserInteraction:s?.isUserInteraction===!0,prev:i,next:e})}function Yh(t){const e=Ls();let s=!1;return e.state==="active"&&(Qs({cursorFlags:0,state:"inactive"}),e.hitRegions.length>0&&(ia(t),s=!0,e.hitRegions.forEach(i=>{const r=xs(i.group.id,!0);cs(i.group,r,{isUserInteraction:!0})}))),s}function Ja(t){t.defaultPrevented||Yh(t.currentTarget)}function vm(t,e,s){let i,r={x:1/0,y:1/0};for(const n of e){const o=Fh(s,n.rect);switch(t){case"horizontal":{o.x<=r.x&&(i=n,r=o);break}case"vertical":{o.y<=r.y&&(i=n,r=o);break}}}return i?{distance:r,hitRegion:i}:void 0}function bm(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Sm(t,e){if(t===e)throw new Error("Cannot compare node with itself");const s={a:el(t),b:el(e)};let i;for(;s.a.at(-1)===s.b.at(-1);)i=s.a.pop(),s.b.pop();De(i,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Qa(Za(s.a)),b:Qa(Za(s.b))};if(r.a===r.b){const n=i.childNodes,o={a:s.a.at(-1),b:s.b.at(-1)};let a=n.length;for(;a--;){const c=n[a];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const ym=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function xm(t){const e=getComputedStyle(Xh(t)??t).display;return e==="flex"||e==="inline-flex"}function wm(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||xm(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||ym.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Za(t){let e=t.length;for(;e--;){const s=t[e];if(De(s,"Missing node"),wm(s))return s}return null}function Qa(t){return t&&Number(getComputedStyle(t).zIndex)||0}function el(t){const e=[];for(;t;)e.push(t),t=Xh(t);return e}function Xh(t){const{parentNode:e}=t;return bm(e)?e.host:e}function Cm(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function km({groupElement:t,hitRegion:e,pointerEventTarget:s}){if(!$h(s)||s.contains(t)||t.contains(s))return!0;if(Sm(s,t)>0){let i=s;for(;i;){if(i.contains(t))return!0;if(Cm(i.getBoundingClientRect(),e))return!1;i=i.parentElement}}return!0}function na(t,e){const s=[];return e.forEach((i,r)=>{if(r.disabled)return;const n=Hh(r),o=vm(r.orientation,n,{x:t.clientX,y:t.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&km({groupElement:r.element,hitRegion:o.hitRegion.rect,pointerEventTarget:t.target})&&s.push(o.hitRegion)}),s}function Pm(t,e){if(t.length!==e.length)return!1;for(let s=0;s<t.length;s++)if(t[s]!=e[s])return!1;return!0}function pt(t,e,s=0){return Math.abs(vt(t)-vt(e))<=s}function Yt(t,e){return pt(t,e)?0:t>e?1:-1}function Xs({overrideDisabledPanels:t,panelConstraints:e,prevSize:s,size:i}){const{collapsedSize:r=0,collapsible:n,disabled:o,maxSize:a=100,minSize:c=0}=e;if(o&&!t)return s;if(Yt(i,c)<0)if(n){const l=(r+c)/2;Yt(i,l)<0?i=r:i=c}else i=c;return i=Math.min(a,i),i=vt(i),i}function Ti({delta:t,initialLayout:e,panelConstraints:s,pivotIndices:i,prevLayout:r,trigger:n}){if(pt(t,0))return e;const o=n==="imperative-api",a=Object.values(e),c=Object.values(r),l=[...a],[u,d]=i;De(u!=null,"Invalid first pivot index"),De(d!=null,"Invalid second pivot index");let f=0;switch(n){case"keyboard":{{const g=t<0?d:u,v=s[g];De(v,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:k,minSize:w=0}=v;if(k){const S=a[g];if(De(S!=null,`Previous layout not found for panel index ${g}`),pt(S,b)){const m=w-S;Yt(m,Math.abs(t))>0&&(t=t<0?0-m:m)}}}{const g=t<0?u:d,v=s[g];De(v,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:k,minSize:w=0}=v;if(k){const S=a[g];if(De(S!=null,`Previous layout not found for panel index ${g}`),pt(S,w)){const m=S-b;Yt(m,Math.abs(t))>0&&(t=t<0?0-m:m)}}}break}default:{const g=t<0?d:u,v=s[g];De(v,`Panel constraints not found for index ${g}`);const b=a[g],{collapsible:k,collapsedSize:w,minSize:S}=v;if(k&&Yt(b,S)<0)if(t>0){const m=S-w,x=m/2,y=b+t;Yt(y,S)<0&&(t=Yt(t,x)<=0?0:m)}else{const m=S-w,x=100-m/2,y=b-t;Yt(y,S)<0&&(t=Yt(100+t,x)>0?0:-m)}break}}{const g=t<0?1:-1;let v=t<0?d:u,b=0;for(;;){const w=a[v];De(w!=null,`Previous layout not found for panel index ${v}`);const S=Xs({overrideDisabledPanels:o,panelConstraints:s[v],prevSize:w,size:100})-w;if(b+=S,v+=g,v<0||v>=s.length)break}const k=Math.min(Math.abs(t),Math.abs(b));t=t<0?0-k:k}{let g=t<0?u:d;for(;g>=0&&g<s.length;){const v=Math.abs(t)-Math.abs(f),b=a[g];De(b!=null,`Previous layout not found for panel index ${g}`);const k=b-v,w=Xs({overrideDisabledPanels:o,panelConstraints:s[g],prevSize:b,size:k});if(!pt(b,w)&&(f+=b-w,l[g]=w,f.toFixed(3).localeCompare(Math.abs(t).toFixed(3),void 0,{numeric:!0})>=0))break;t<0?g--:g++}}if(Pm(c,l))return r;{const g=t<0?d:u,v=a[g];De(v!=null,`Previous layout not found for panel index ${g}`);const b=v+f,k=Xs({overrideDisabledPanels:o,panelConstraints:s[g],prevSize:v,size:b});if(l[g]=k,!pt(k,b)){let w=b-k,S=t<0?d:u;for(;S>=0&&S<s.length;){const m=l[S];De(m!=null,`Previous layout not found for panel index ${S}`);const x=m+w,y=Xs({overrideDisabledPanels:o,panelConstraints:s[S],prevSize:m,size:x});if(pt(m,y)||(w-=y-m,l[S]=y),pt(w,0))break;t>0?S--:S++}}}const p=Object.values(l).reduce((g,v)=>v+g,0);if(!pt(p,100,.1))return r;const _=Object.keys(r);return l.reduce((g,v,b)=>(g[_[b]]=v,g),{})}function js(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(e[s]===void 0||Yt(t[s],e[s])!==0)return!1;return!0}function Is({layout:t,panelConstraints:e}){const s=Object.values(t),i=[...s],r=i.reduce((a,c)=>a+c,0);if(i.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${i.map(a=>`${a}%`).join(", ")}`);if(!pt(r,100)&&i.length>0)for(let a=0;a<e.length;a++){const c=i[a];De(c!=null,`No layout data found for index ${a}`);const l=100/r*c;i[a]=l}let n=0;for(let a=0;a<e.length;a++){const c=s[a];De(c!=null,`No layout data found for index ${a}`);const l=i[a];De(l!=null,`No layout data found for index ${a}`);const u=Xs({overrideDisabledPanels:!0,panelConstraints:e[a],prevSize:c,size:l});l!=u&&(n+=l-u,i[a]=u)}if(!pt(n,0))for(let a=0;a<e.length;a++){const c=i[a];De(c!=null,`No layout data found for index ${a}`);const l=c+n,u=Xs({overrideDisabledPanels:!0,panelConstraints:e[a],prevSize:c,size:l});if(c!==u&&(n-=u-c,i[a]=u,pt(n,0)))break}const o=Object.keys(t);return i.reduce((a,c,l)=>(a[o[l]]=c,a),{})}function Jh({groupId:t,panelId:e}){const s=()=>{const c=Fs();for(const[l,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:_}]of c)if(l.id===t)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:l,groupSize:p,layout:f,separatorToPanels:_};throw Error(`Group ${t} not found`)},i=()=>{const c=s().derivedPanelConstraints.find(l=>l.panelId===e);if(c!==void 0)return c;throw Error(`Panel constraints not found for Panel ${e}`)},r=()=>{const c=s().group.panels.find(l=>l.id===e);if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},n=()=>{const c=s().layout[e];if(c!==void 0)return c;throw Error(`Layout not found for Panel ${e}`)},o=({nextSize:c,panels:l,prevLayout:u,derivedPanelConstraints:d})=>{const f=n(),p=l.findIndex(v=>v.id===e),_=p===0,g=p===l.length-1;if(g&&c<f&&(_||l.slice(0,p).every((v,b)=>{const k=d[b];return k?.collapsible&&pt(k.collapsedSize,u[k.panelId])}))){const v=l.slice(0,p).reduce((b,k)=>b+u[k.id],0);return{...u,[e]:vt(100-v)}}return Ti({delta:g?f-c:c-f,initialLayout:u,panelConstraints:d,pivotIndices:g?[p-1,p]:[p,p+1],prevLayout:u,trigger:"imperative-api"})},a=c=>{const l=n();if(c===l)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:p,layout:_,separatorToPanels:g}=s(),v=o({nextSize:c,panels:f.panels,prevLayout:_,derivedPanelConstraints:d}),b=Is({layout:v,panelConstraints:d});js(_,b)||cs(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:c,collapsedSize:l}=i(),{mutableValues:u}=r(),d=n();c&&d!==l&&(u.expandToSize=d,a(l))},expand:()=>{const{collapsible:c,collapsedSize:l,minSize:u}=i(),{mutableValues:d}=r(),f=n();if(c&&f===l){let p=d.expandToSize??u;p===0&&(p=1),a(p)}},getSize:()=>{const{group:c}=s(),l=n(),{element:u}=r(),d=c.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:l,inPixels:d}},isCollapsed:()=>{const{collapsible:c,collapsedSize:l}=i(),u=n();return c&&pt(l,u)},resize:c=>{const{group:l}=s(),{element:u}=r(),d=si({group:l}),f=mi({groupSize:d,panelElement:u,styleProp:c}),p=vt(f/d*100);a(p)}}}function tl(t){if(t.defaultPrevented)return;const e=Fs();na(t,e).forEach(s=>{if(s.separator&&!s.separator.disableDoubleClick){const i=s.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(i){const r=i.panelConstraints.defaultSize,n=Jh({groupId:s.group.id,panelId:i.id});n&&r!==void 0&&(n.resize(r),t.preventDefault())}}})}function dr(t){const e=Fs();for(const[s]of e)if(s.separators.some(i=>i.element===t))return s;throw Error("Could not find parent Group for separator element")}function Zh({groupId:t}){const e=()=>{const s=Fs();for(const[i,r]of s)if(i.id===t)return{group:i,...r};throw Error(`Could not find Group with id "${t}"`)};return{getLayout(){const{defaultLayoutDeferred:s,layout:i}=e();return s?{}:i},setLayout(s){const{defaultLayoutDeferred:i,derivedPanelConstraints:r,group:n,groupSize:o,layout:a,separatorToPanels:c}=e(),l=Is({layout:s,panelConstraints:r});return i?a:(js(a,l)||cs(n,{defaultLayoutDeferred:i,derivedPanelConstraints:r,groupSize:o,layout:l,separatorToPanels:c}),l)}}}function Rs(t,e){const s=dr(t),i=xs(s.id,!0),r=s.separators.find(u=>u.element===t);De(r,"Matching separator not found");const n=i.separatorToPanels.get(r);De(n,"Matching panels not found");const o=n.map(u=>s.panels.indexOf(u)),a=Zh({groupId:s.id}).getLayout(),c=Ti({delta:e,initialLayout:a,panelConstraints:i.derivedPanelConstraints,pivotIndices:o,prevLayout:a,trigger:"keyboard"}),l=Is({layout:c,panelConstraints:i.derivedPanelConstraints});js(a,l)||cs(s,{defaultLayoutDeferred:i.defaultLayoutDeferred,derivedPanelConstraints:i.derivedPanelConstraints,groupSize:i.groupSize,layout:l,separatorToPanels:i.separatorToPanels},{isUserInteraction:!0})}function sl(t){if(t.defaultPrevented)return;const e=t.currentTarget,s=dr(e);if(!s.disabled)switch(t.key){case"ArrowDown":{t.preventDefault(),s.orientation==="vertical"&&Rs(e,5);break}case"ArrowLeft":{t.preventDefault(),s.orientation==="horizontal"&&Rs(e,-5);break}case"ArrowRight":{t.preventDefault(),s.orientation==="horizontal"&&Rs(e,5);break}case"ArrowUp":{t.preventDefault(),s.orientation==="vertical"&&Rs(e,-5);break}case"End":{t.preventDefault(),Rs(e,100);break}case"Enter":{t.preventDefault();const i=dr(e),r=xs(i.id,!0),{derivedPanelConstraints:n,layout:o,separatorToPanels:a}=r,c=i.separators.find(f=>f.element===e);De(c,"Matching separator not found");const l=a.get(c);De(l,"Matching panels not found");const u=l[0],d=n.find(f=>f.panelId===u.id);if(De(d,"Panel metadata not found"),d.collapsible){const f=o[u.id],p=d.collapsedSize===f?i.mutableState.expandedPanelSizes[u.id]??d.minSize:d.collapsedSize;Rs(e,p-f)}break}case"F6":{t.preventDefault();const i=dr(e).separators.map(o=>o.element),r=Array.from(i).findIndex(o=>o===t.currentTarget);De(r!==null,"Index not found");const n=t.shiftKey?r>0?r-1:i.length-1:r+1<i.length?r+1:0;i[n].focus({preventScroll:!0});break}case"Home":{t.preventDefault(),Rs(e,-100);break}}}function il(t){if(t.defaultPrevented||t.pointerType==="mouse"&&t.button>0)return;const e=Fs(),s=na(t,e),i=new Map;let r=!1;s.forEach(n=>{n.separator&&(r||(r=!0,n.separator.element.focus({focusVisible:!1,preventScroll:!0})));const o=e.get(n.group);o&&i.set(n.group,o.layout)}),Qs({cursorFlags:0,hitRegions:s,initialLayoutMap:i,pointerDownAtPoint:{x:t.clientX,y:t.clientY},state:"active"}),s.length&&t.preventDefault()}function Qh({document:t,event:e,hitRegions:s,initialLayoutMap:i,mountedGroups:r,pointerDownAtPoint:n,prevCursorFlags:o}){let a=0;s.forEach(l=>{const{group:u,groupSize:d}=l,{orientation:f,panels:p}=u,{disableCursor:_}=u.mutableState;let g=0;n?f==="horizontal"?g=(e.clientX-n.x)/d*100:g=(e.clientY-n.y)/d*100:f==="horizontal"?g=e.clientX<0?-100:100:g=e.clientY<0?-100:100;const v=i.get(u),b=r.get(u);if(!v||!b)return;const{defaultLayoutDeferred:k,derivedPanelConstraints:w,groupSize:S,layout:m,separatorToPanels:x}=b;if(w&&m&&x){const y=Ti({delta:g,initialLayout:v,panelConstraints:w,pivotIndices:l.panels.map(C=>p.indexOf(C)),prevLayout:m,trigger:"mouse-or-touch"});if(js(y,m)){if(g!==0&&!_)switch(f){case"horizontal":{a|=g<0?Uh:Kh;break}case"vertical":{a|=g<0?qh:Vh;break}}}else cs(l.group,{defaultLayoutDeferred:k,derivedPanelConstraints:w,groupSize:S,layout:y,separatorToPanels:x})}});let c=0;e.movementX===0?c|=o&qa:c|=a&qa,e.movementY===0?c|=o&Va:c|=a&Va,pm(c),ia(t)}function rl(t){const e=Fs(),s=Ls();s.state==="active"&&Qh({document:t.currentTarget,event:t,hitRegions:s.hitRegions,initialLayoutMap:s.initialLayoutMap,mountedGroups:e,prevCursorFlags:s.cursorFlags})}function nl(t){if(t.defaultPrevented)return;const e=Ls(),s=Fs();switch(e.state){case"active":{if(t.buttons===0){Qs({cursorFlags:0,state:"inactive"}),e.hitRegions.forEach(i=>{const r=xs(i.group.id,!0);cs(i.group,r,{isUserInteraction:!0})});return}for(const i of e.hitRegions)if(i.separator){const{element:r}=i.separator;r.hasPointerCapture?.(t.pointerId)||r.setPointerCapture?.(t.pointerId)}Qh({document:t.currentTarget,event:t,hitRegions:e.hitRegions,initialLayoutMap:e.initialLayoutMap,mountedGroups:s,pointerDownAtPoint:e.pointerDownAtPoint,prevCursorFlags:e.cursorFlags});break}default:{const i=na(t,s);i.length===0?e.state!=="inactive"&&Qs({cursorFlags:0,state:"inactive"}):Qs({cursorFlags:0,hitRegions:i,state:"hover"}),ia(t.currentTarget);break}}}function ol(t){t.relatedTarget instanceof HTMLIFrameElement&&Ls().state==="hover"&&Qs({cursorFlags:0,state:"inactive"})}function al(t){t.defaultPrevented||t.pointerType==="mouse"&&t.button>0||Yh(t.currentTarget)&&t.preventDefault()}function ll(t){let e=0,s=0;const i={};for(const n of t)if(n.defaultSize!==void 0){e++;const o=vt(n.defaultSize);s+=o,i[n.panelId]=o}else i[n.panelId]=void 0;const r=t.length-e;if(r!==0){const n=vt((100-s)/r);for(const o of t)o.defaultSize===void 0&&(i[o.panelId]=n)}return i}function Em(t,e,s){if(!s[0])return;const i=t.panels.find(c=>c.element===e);if(!i||!i.onResize)return;const r=si({group:t}),n=t.orientation==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,o=i.mutableValues.prevSize,a={asPercentage:vt(n/r*100),inPixels:n};i.mutableValues.prevSize=a,i.onResize(a,i.id,o)}function Rm(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function Tm({group:t,nextGroupSize:e,prevGroupSize:s,prevLayout:i}){if(s<=0||e<=0||s===e)return i;let r=0,n=0,o=!1;const a=new Map,c=[];for(const d of t.panels){const f=i[d.id]??0;if(d.panelConstraints.groupResizeBehavior==="preserve-pixel-size"){o=!0;const p=f/100*s,_=vt(p/e*100);a.set(d.id,_),r+=_}else c.push(d.id),n+=f}if(!o||c.length===0)return i;const l=100-r,u={...i};if(a.forEach((d,f)=>{u[f]=d}),n>0)for(const d of c){const f=i[d]??0;u[d]=vt(f/n*l)}else{const d=vt(l/c.length);for(const f of c)u[f]=d}return u}function Am(t,e){const s=t.map(r=>r.id),i=Object.keys(e);if(s.length!==i.length)return!1;for(const r of s)if(!i.includes(r))return!1;return!0}const Ks=new Map;function Dm(t){let e=!0;De(t.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const s=t.element.ownerDocument.defaultView.ResizeObserver,i=new Set,r=new Set,n=new s(_=>{for(const g of _){const{borderBoxSize:v,target:b}=g;if(b===t.element){if(e){const k=si({group:t});if(k===0)return;const w=xs(t.id);if(!w)return;const S=Ln(t),m=w.defaultLayoutDeferred?ll(S):w.layout,x=Tm({group:t,nextGroupSize:k,prevGroupSize:w.groupSize,prevLayout:m}),y=Is({layout:x,panelConstraints:S});if(!w.defaultLayoutDeferred&&js(w.layout,y)&&Rm(w.derivedPanelConstraints,S)&&w.groupSize===k)return;cs(t,{defaultLayoutDeferred:!1,derivedPanelConstraints:S,groupSize:k,layout:y,separatorToPanels:w.separatorToPanels})}}else Em(t,b,v)}});n.observe(t.element),t.panels.forEach(_=>{De(!i.has(_.id),`Panel ids must be unique; id "${_.id}" was used more than once`),i.add(_.id),_.onResize&&n.observe(_.element)});const o=si({group:t}),a=Ln(t),c=t.panels.map(({id:_})=>_).join(",");let l=t.mutableState.defaultLayout;l&&(Am(t.panels,l)||(l=void 0));const u=t.mutableState.layouts[c]??l??ll(a),d=Is({layout:u,panelConstraints:a}),f=t.element.ownerDocument;Ks.set(f,(Ks.get(f)??0)+1);const p=new Map;return Hh(t).forEach(_=>{_.separator&&p.set(_.separator,_.panels)}),cs(t,{defaultLayoutDeferred:o===0,derivedPanelConstraints:a,groupSize:o,layout:d,separatorToPanels:p}),t.separators.forEach(_=>{De(!r.has(_.id),`Separator ids must be unique; id "${_.id}" was used more than once`),r.add(_.id),_.element.addEventListener("keydown",sl)}),Ks.get(f)===1&&(f.addEventListener("contextmenu",Ja,!0),f.addEventListener("dblclick",tl,!0),f.addEventListener("pointerdown",il,!0),f.addEventListener("pointerleave",rl),f.addEventListener("pointermove",nl),f.addEventListener("pointerout",ol),f.addEventListener("pointerup",al,!0)),function(){e=!1,Ks.set(f,Math.max(0,(Ks.get(f)??0)-1)),gm(t),t.separators.forEach(_=>{_.element.removeEventListener("keydown",sl)}),Ks.get(f)||(f.removeEventListener("contextmenu",Ja,!0),f.removeEventListener("dblclick",tl,!0),f.removeEventListener("pointerdown",il,!0),f.removeEventListener("pointerleave",rl),f.removeEventListener("pointermove",nl),f.removeEventListener("pointerout",ol),f.removeEventListener("pointerup",al,!0)),n.disconnect()}}function Nm(){const[t,e]=O.useState({}),s=O.useCallback(()=>e({}),[]);return[t,s]}function oa(t){const e=O.useId();return`${t??e}`}const Hs=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Ci(t){const e=O.useRef(t);return Hs(()=>{e.current=t},[t]),O.useCallback((...s)=>e.current?.(...s),[e])}function aa(...t){return Ci(e=>{t.forEach(s=>{if(s)switch(typeof s){case"function":{s(e);break}case"object":{s.current=e;break}}})})}function la(t){const e=O.useRef({...t});return Hs(()=>{for(const s in t)e.current[s]=t[s]},[t]),e.current}const ed=O.createContext(null);function Mm(t,e){const s=O.useRef({getLayout:()=>({}),setLayout:_m});O.useImperativeHandle(e,()=>s.current,[]),Hs(()=>{Object.assign(s.current,Zh({groupId:t}))})}function td({children:t,className:e,defaultLayout:s,disableCursor:i,disabled:r,elementRef:n,groupRef:o,id:a,onLayoutChange:c,onLayoutChanged:l,orientation:u="horizontal",resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){const _=O.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=Ci(R=>{js(_.current.onLayoutChange,R)||(_.current.onLayoutChange=R,c?.(R))}),v=Ci((R,E)=>{js(_.current.onLayoutChanged,R)||(_.current.onLayoutChanged=R,l?.(R,{isUserInteraction:E}))}),b=oa(a),k=O.useRef(null),[w,S]=Nm(),m=O.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),x=aa(k,n);Mm(b,o);const y=Ci((R,E)=>{const P=Ls(),A=Xa(R),M=xs(R);if(M){let L=!1;return P.state==="active"&&(L=P.hitRegions.some(B=>B.group===A)),{flexGrow:M.layout[E]??1,pointerEvents:L?"none":void 0}}if(s?.[E])return{flexGrow:s?.[E]}}),C=la({defaultLayout:s,disableCursor:i}),N=O.useMemo(()=>({get disableCursor(){return!!C.disableCursor},getPanelStyles:y,id:b,orientation:u,registerPanel:R=>{const E=m.current;return E.panels=jn(u,[...E.panels,R]),S(),()=>{E.panels=E.panels.filter(P=>P!==R),S()}},registerSeparator:R=>{const E=m.current;return E.separators=jn(u,[...E.separators,R]),S(),()=>{E.separators=E.separators.filter(P=>P!==R),S()}},updatePanelProps:(R,{disabled:E})=>{const P=m.current.panels.find(L=>L.id===R);P&&(P.panelConstraints.disabled=E);const A=Xa(b),M=xs(b);A&&M&&cs(A,{...M,derivedPanelConstraints:Ln(A)})},updateSeparatorProps:(R,{disabled:E,disableDoubleClick:P})=>{const A=m.current.separators.find(M=>M.id===R);A&&(A.disabled=E,A.disableDoubleClick=P)}}),[y,b,S,u,C]),T=O.useRef(null);return Hs(()=>{const R=k.current;if(R===null)return;const E=m.current;let P;if(C.defaultLayout!==void 0&&Object.keys(C.defaultLayout).length===E.panels.length){P={};for(const K of E.panels){const z=C.defaultLayout[K.id];z!==void 0&&(P[K.id]=z)}}const A={disabled:!!r,element:R,id:b,mutableState:{defaultLayout:P,disableCursor:!!C.disableCursor,expandedPanelSizes:m.current.lastExpandedPanelSizes,layouts:m.current.layouts},orientation:u,panels:E.panels,resizeTargetMinimumSize:E.resizeTargetMinimumSize,separators:E.separators};T.current=A;const M=Dm(A),{defaultLayoutDeferred:L,derivedPanelConstraints:B,layout:D}=xs(A.id,!0);!L&&B.length>0&&(g(D),v(D,!1));const j=ra(b,K=>{const{defaultLayoutDeferred:z,derivedPanelConstraints:G,layout:I}=K.next;if(z||G.length===0)return;const V=A.panels.map(({id:ee})=>ee).join(",");A.mutableState.layouts[V]=I,G.forEach(ee=>{if(ee.collapsible){const{layout:se}=K.prev??{};if(se){const ie=pt(ee.collapsedSize,I[ee.panelId]),Y=pt(ee.collapsedSize,se[ee.panelId]);ie&&!Y&&(A.mutableState.expandedPanelSizes[ee.panelId]=se[ee.panelId])}}});const $=Ls().state!=="active";g(I),$&&v(I,K.isUserInteraction)});return()=>{T.current=null,M(),j()}},[r,b,v,g,u,w,C]),O.useEffect(()=>{const R=T.current;R&&(R.mutableState.defaultLayout=s,R.mutableState.disableCursor=!!i)}),h.jsx(ed.Provider,{value:N,children:h.jsx("div",{...p,className:e,"data-group":!0,"data-testid":b,id:b,ref:x,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:t})})}td.displayName="Group";function ca(){const t=O.useContext(ed);return De(t,"Group Context not found; did you render a Panel or Separator outside of a Group?"),t}function Bm(t,e){const{id:s}=ca(),i=O.useRef({collapse:tn,expand:tn,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:tn});O.useImperativeHandle(e,()=>i.current,[]),Hs(()=>{Object.assign(i.current,Jh({groupId:s,panelId:t}))})}function sd({children:t,className:e,collapsedSize:s="0%",collapsible:i=!1,defaultSize:r,disabled:n,elementRef:o,groupResizeBehavior:a="preserve-relative-size",id:c,maxSize:l="100%",minSize:u="0%",onResize:d,panelRef:f,style:p,..._}){const g=!!c,v=oa(c),b=la({disabled:n}),k=O.useRef(null),w=aa(k,o),{getPanelStyles:S,id:m,orientation:x,registerPanel:y,updatePanelProps:C}=ca(),N=d!==null,T=Ci((A,M,L)=>{d?.(A,c,L)});Hs(()=>{const A=k.current;if(A!==null){const M={element:A,id:v,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:N?T:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:s,collapsible:i,defaultSize:r,disabled:b.disabled,maxSize:l,minSize:u}};return y(M)}},[a,s,i,r,N,v,g,l,u,T,y,b]),O.useEffect(()=>{C(v,{disabled:n})},[n,v,C]),Bm(v,f);const R=()=>{const A=S(m,v);if(A)return JSON.stringify(A)},E=O.useSyncExternalStore(A=>ra(m,A),R,R);let P;return E?P=JSON.parse(E):r!==void 0?P={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:P={flexGrow:1},h.jsx("div",{..._,"data-disabled":n||void 0,"data-panel":!0,"data-testid":v,id:v,ref:w,style:{...Lm,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...P},children:h.jsx("div",{className:e,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:x==="horizontal"?"pan-y":"pan-x"},children:t})})}sd.displayName="Panel";const Lm={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function jm({layout:t,panelConstraints:e,panelId:s,panelIndex:i}){let r,n;const o=t[s],a=e.find(c=>c.panelId===s);if(a){const c=a.maxSize,l=a.collapsible?a.collapsedSize:a.minSize,u=[i,i+1];n=Is({layout:Ti({delta:l-o,initialLayout:t,panelConstraints:e,pivotIndices:u,prevLayout:t}),panelConstraints:e})[s],r=Is({layout:Ti({delta:c-o,initialLayout:t,panelConstraints:e,pivotIndices:u,prevLayout:t}),panelConstraints:e})[s]}return{valueControls:s,valueMax:r,valueMin:n,valueNow:o}}function id({children:t,className:e,disabled:s,disableDoubleClick:i,elementRef:r,id:n,style:o,...a}){const c=oa(n),l=la({disabled:s,disableDoubleClick:i}),[u,d]=O.useState({}),[f,p]=O.useState("inactive"),[_,g]=O.useState(!1),v=O.useRef(null),b=aa(v,r),{disableCursor:k,id:w,orientation:S,registerSeparator:m,updateSeparatorProps:x}=ca(),y=S==="horizontal"?"vertical":"horizontal";Hs(()=>{const T=v.current;if(T!==null){const R={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:T,id:c},E=m(R),P=fm(M=>{p(M.next.state!=="inactive"&&M.next.hitRegions.some(L=>L.separator===R)?M.next.state:"inactive")}),A=ra(w,M=>{const{derivedPanelConstraints:L,layout:B,separatorToPanels:D}=M.next,j=D.get(R);if(j){const K=j[0],z=j.indexOf(K);d(jm({layout:B,panelConstraints:L,panelId:K.id,panelIndex:z}))}});return()=>{P(),A(),E()}}},[w,c,m,l]),O.useEffect(()=>{x(c,{disabled:s,disableDoubleClick:i})},[s,i,c,x]);let C;s&&!k&&(C="not-allowed");let N;return s?N="disabled":f==="active"?N="active":_?N="focus":N=f,h.jsx("div",{...a,"aria-controls":u.valueControls,"aria-disabled":s||void 0,"aria-orientation":y,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:t,className:e,"data-separator":N,"data-testid":c,id:c,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:b,role:"separator",style:{flexBasis:"auto",cursor:C,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:s?void 0:0})}id.displayName="Separator";function Im(t){const e=H.c(10);let s,i,r;e[0]!==t?({className:s,ref:r,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=_e("flex h-full w-full",s),e[4]=s,e[5]=n):n=e[5];let o;return e[6]!==i||e[7]!==r||e[8]!==n?(o=h.jsx(td,{groupRef:r,"data-slot":"resizable-panel-group",className:n,...i}),e[6]=i,e[7]=r,e[8]=n,e[9]=o):o=e[9],o}function cl(t){const e=H.c(10);let s,i,r;e[0]!==t?({ref:i,style:r,...s}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==r?(n={overflow:"hidden",...r},e[4]=r,e[5]=n):n=e[5];let o;return e[6]!==s||e[7]!==i||e[8]!==n?(o=h.jsx(sd,{panelRef:i,"data-slot":"resizable-panel",style:n,...s}),e[6]=s,e[7]=i,e[8]=n,e[9]=o):o=e[9],o}function Om(t){const e=H.c(12);let s,i,r;e[0]!==t?({withHandle:r,className:s,...i}=t,e[0]=t,e[1]=s,e[2]=i,e[3]=r):(s=e[1],i=e[2],r=e[3]);let n;e[4]!==s?(n=_e("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90",s),e[4]=s,e[5]=n):n=e[5];let o;e[6]!==r?(o=r&&h.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:h.jsx(xf,{className:"size-2.5"})}),e[6]=r,e[7]=o):o=e[7];let a;return e[8]!==i||e[9]!==n||e[10]!==o?(a=h.jsx(id,{"data-slot":"resizable-handle",className:n,...i,children:o}),e[8]=i,e[9]=n,e[10]=o,e[11]=a):a=e[11],a}function hl(t,e){const s=typeof t=="number"?t:Number(t);return!Number.isFinite(s)||s<=0||s>=100?e:s}function zm(t,e){const s=H.c(8);let i;s[0]!==e?(i=c=>hl(c,e),s[0]=e,s[1]=i):i=s[1];const[r,n]=Do(t,i);let o;s[2]!==e||s[3]!==r?(o=hl(r,e),s[2]=e,s[3]=r,s[4]=o):o=s[4];let a;return s[5]!==n||s[6]!==o?(a=[o,n],s[5]=n,s[6]=o,s[7]=a):a=s[7],a}const $m=33;function Fm(){const t=H.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Ju.sidePanelWidth(),t[0]=e):e=t[0],zm(e,$m)}function Hm(t){const e=H.c(1),{activeTab:s}=t;let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=h.jsx(jc,{}),e[0]=i):i=e[0],i}function Wm(){const t=H.c(5),e=Ho()??"overview";let s;t[0]!==e?(s=h.jsx(ls,{children:h.jsx(Hm,{activeTab:e})}),t[0]=e,t[1]=s):s=t[1];let i;return t[2]!==e||t[3]!==s?(i=h.jsx(Li,{children:s},e),t[2]=e,t[3]=s,t[4]=i):i=t[4],i}const Um=new Set(["site-editor","content"]);function Km(t){return t.hasClonableSource&&!t.fastPreviewActive&&t.mainTab!==null&&Um.has(t.mainTab)}const dl=/[\r\n<>]/,qm=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Hr(t){const e=t?.userName?.trim();if(!e||dl.test(e))return null;const s=t?.userEmail?.trim();return!s||dl.test(s)?{userName:e}:qm.test(s)?{userName:e,userEmail:s}:{userName:e}}function Vm(t){return t.split(`
2
2
  `).filter(e=>!/^Co-authored-by:\s/i.test(e)).join(`
3
3
  `).trimEnd()}function Gm(t){const e=t.userName.trim(),s=t.userEmail?.trim();return s?`Co-authored-by: ${e} <${s}>`:`Co-authored-by: ${e}`}function rd(t,e){const s=Hr(e);if(!s)return t;const i=Vm(t),r=Gm(s);if(i.includes(r))return i;const n=i.trimEnd();return n.length>0?`${n}
4
4
 
@@ -1,4 +1,4 @@
1
- import{r as V,ar as at,c as Q,b as ie,j as i,ex as Ee,ey as Oe,ez as We,I as ge,ac as ke,n as we,b0 as Ve,aF as He,e as Se,ak as qe,am as be,K as ce,t as le,B as re,o as ne,h as Ae,l as ae,m as ct,as as ee,d as dt,E as ut,F as ht}from"./index-6GXqHE0w.js";import{C as mt}from"./checkbox-Dg_GkeBT.js";import{I as xe}from"./input-TvernbmY.js";import{S as ft,b as pt,a as xt,d as gt,c as vt}from"./select-Ce9NznPv.js";import{i as Ye}from"./ArrowLeft-BVx6AQzq.js";import{i as bt}from"./ChevronSelectorVertical-ilm76_0p.js";import{i as yt}from"./Key01-BsAAVoJx.js";import{i as Ge,b as jt,a as St,s as Nt}from"./Settings02-DL8f5fN1.js";import{i as Xe}from"./SearchMd-BNXjQ2BV.js";import{d as _e,u as kt,b as wt}from"./use-ai-providers-Bg_y9f3x.js";import{c as _t}from"./chat-context-HB_KOUNM.js";import{g as Ce}from"./ai-providers-logos-DD3qZ33J.js";import{i as Pe}from"./Monitor01-BTqHf-K4.js";import{i as Ct}from"./AlertCircle-CgERhdh6.js";import{e as Qe,D as It,b as Mt,c as Et,d as Ot,h as At}from"./dialog-DJBpjJnY.js";import{i as Pt}from"./ChevronRight-BNfU55ld.js";import{A as Tt}from"./avatar-CW4PxBuN.js";import{s as Je}from"./Eye-Cd7v-liN.js";import{i as Lt,a as zt,D as Ft}from"./download-app-dialog-DYhv8XsJ.js";import{u as Rt}from"./use-is-desktop-app-BNujXJc_.js";import{b as Kt,a as Dt}from"./Tool01-D6HOM_aJ.js";import{t as Te}from"./ChevronUp-CbF1Gmeo.js";import{a as $t}from"./Image01-CpXdMb8x.js";import{t as Ut}from"./Stars01-f37Q7vDf.js";function pe(n,e,t){let s=t.initialDeps??[],o,l=!0;function c(){var r,u,d;let a;t.key&&((r=t.debug)!=null&&r.call(t))&&(a=Date.now());const m=n();if(!(m.length!==s.length||m.some((f,v)=>s[v]!==f)))return o;s=m;let h;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(h=Date.now()),o=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,v=Math.round((Date.now()-h)*100)/100,k=v/16,S=(j,_)=>{for(j=String(j);j.length<_;)j=" "+j;return j};console.info(`%c⏱ ${S(v,5)} /${S(f,5)} ms`,`
1
+ import{r as V,ar as at,c as Q,b as ie,j as i,ex as Ee,ey as Oe,ez as We,I as ge,ac as ke,n as we,b0 as Ve,aF as He,e as Se,ak as qe,am as be,K as ce,t as le,B as re,o as ne,h as Ae,l as ae,m as ct,as as ee,d as dt,E as ut,F as ht}from"./index-B3yBTWEk.js";import{C as mt}from"./checkbox-D8Ab2Vb-.js";import{I as xe}from"./input-HFOrJf5B.js";import{S as ft,b as pt,a as xt,d as gt,c as vt}from"./select-Bc5UZb4n.js";import{i as Ye}from"./ArrowLeft-Clu1mSdY.js";import{i as bt}from"./ChevronSelectorVertical-BiIbFU31.js";import{i as yt}from"./Key01-CKcg8G1v.js";import{i as Ge,b as jt,a as St,s as Nt}from"./Settings02-D2oiGU4q.js";import{i as Xe}from"./SearchMd-DRRptSJN.js";import{d as _e,u as kt,b as wt}from"./use-ai-providers-qnkcjapR.js";import{c as _t}from"./chat-context-CXknhaDs.js";import{g as Ce}from"./ai-providers-logos-DD3qZ33J.js";import{i as Pe}from"./Monitor01-BUruMK2r.js";import{i as Ct}from"./AlertCircle-EniJtD8E.js";import{e as Qe,D as It,b as Mt,c as Et,d as Ot,h as At}from"./dialog-otnvxVN0.js";import{i as Pt}from"./ChevronRight-DzRB-rdO.js";import{A as Tt}from"./avatar-DcDvs8Zz.js";import{s as Je}from"./Eye-dnrP5DkM.js";import{i as Lt,a as zt,D as Ft}from"./download-app-dialog-BqNRF4Sn.js";import{u as Rt}from"./use-is-desktop-app-BNujXJc_.js";import{b as Kt,a as Dt}from"./Tool01-BnKd95Y1.js";import{t as Te}from"./ChevronUp-DGrguvGW.js";import{a as $t}from"./Image01-BrHSH-Vi.js";import{t as Ut}from"./Stars01-COChWymR.js";function pe(n,e,t){let s=t.initialDeps??[],o,l=!0;function c(){var r,u,d;let a;t.key&&((r=t.debug)!=null&&r.call(t))&&(a=Date.now());const m=n();if(!(m.length!==s.length||m.some((f,v)=>s[v]!==f)))return o;s=m;let h;if(t.key&&((u=t.debug)!=null&&u.call(t))&&(h=Date.now()),o=e(...m),t.key&&((d=t.debug)!=null&&d.call(t))){const f=Math.round((Date.now()-a)*100)/100,v=Math.round((Date.now()-h)*100)/100,k=v/16,S=(j,_)=>{for(j=String(j);j.length<_;)j=" "+j;return j};console.info(`%c⏱ ${S(v,5)} /${S(f,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*k,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(l&&t.skipInitialOnChange)&&t.onChange(o),l=!1,o}return c.updateDeps=r=>{s=r},c}function Le(n,e){if(n===void 0)throw new Error("Unexpected undefined");return n}const Bt=(n,e)=>Math.abs(n-e)<1.01,Wt=(n,e,t)=>{let s;return function(...o){n.clearTimeout(s),s=n.setTimeout(()=>e.apply(this,o),t)}},ze=n=>{const{offsetWidth:e,offsetHeight:t}=n;return{width:e,height:t}},Vt=n=>n,Ht=n=>{const e=Math.max(n.startIndex-n.overscan,0),t=Math.min(n.endIndex+n.overscan,n.count-1),s=[];for(let o=e;o<=t;o++)s.push(o);return s},qt=(n,e)=>{const t=n.scrollElement;if(!t)return;const s=n.targetWindow;if(!s)return;const o=c=>{const{width:r,height:u}=c;e({width:Math.round(r),height:Math.round(u)})};if(o(ze(t)),!s.ResizeObserver)return()=>{};const l=new s.ResizeObserver(c=>{const r=()=>{const u=c[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){o({width:d.inlineSize,height:d.blockSize});return}}o(ze(t))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return l.observe(t,{box:"border-box"}),()=>{l.unobserve(t)}},Fe={passive:!0},Re=typeof window>"u"?!0:"onscrollend"in window,Yt=(n,e)=>{const t=n.scrollElement;if(!t)return;const s=n.targetWindow;if(!s)return;let o=0;const l=n.options.useScrollendEvent&&Re?()=>{}:Wt(s,()=>{e(o,!1)},n.options.isScrollingResetDelay),c=a=>()=>{const{horizontal:m,isRtl:p}=n.options;o=m?t.scrollLeft*(p&&-1||1):t.scrollTop,l(),e(o,a)},r=c(!0),u=c(!1);t.addEventListener("scroll",r,Fe);const d=n.options.useScrollendEvent&&Re;return d&&t.addEventListener("scrollend",u,Fe),()=>{t.removeEventListener("scroll",r),d&&t.removeEventListener("scrollend",u)}},Gt=(n,e,t)=>{if(e?.borderBoxSize){const s=e.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}return n[t.options.horizontal?"offsetWidth":"offsetHeight"]},Xt=(n,{adjustments:e=0,behavior:t},s)=>{var o,l;const c=n+e;(l=(o=s.scrollElement)==null?void 0:o.scrollTo)==null||l.call(o,{[s.options.horizontal?"left":"top"]:c,behavior:t})};class Qt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var t,s,o;return((o=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:o.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(l=>{const c=()=>{const r=l.target,u=this.indexFromElement(r);if(!r.isConnected){this.observer.unobserve(r);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(r,l,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var o;(o=s())==null||o.disconnect(),t=null},observe:o=>{var l;return(l=s())==null?void 0:l.observe(o,{box:"border-box"})},unobserve:o=>{var l;return(l=s())==null?void 0:l.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([s,o])=>{typeof o>"u"&&delete t[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Vt,rangeExtractor:Ht,onChange:()=>{},measureElement:Gt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",...t}},this.notify=t=>{var s,o;(o=(s=this.options).onChange)==null||o.call(s,this,t)},this.maybeNotify=pe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,l)=>{this.scrollAdjustments=0,this.scrollDirection=l?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=l,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,s)=>{const o=new Map,l=new Map;for(let c=s-1;c>=0;c--){const r=t[c];if(o.has(r.lane))continue;const u=l.get(r.lane);if(u==null||r.end>u.end?l.set(r.lane,r):r.end<u.end&&o.set(r.lane,!0),o.size===this.options.lanes)break}return l.size===this.options.lanes?Array.from(l.values()).sort((c,r)=>c.end===r.end?c.index-r.index:c.end-r.end)[0]:void 0},this.getMeasurementOptions=pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,s,o,l,c,r,u)=>(this.prevLanes!==void 0&&this.prevLanes!==r&&(this.lanesChangedFlag=!0),this.prevLanes=r,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:s,scrollMargin:o,getItemKey:l,enabled:c,lanes:r,laneAssignmentMode:u}),{key:!1}),this.getMeasurements=pe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:s,scrollMargin:o,getItemKey:l,enabled:c,lanes:r,laneAssignmentMode:u},d)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const m=this.measurementsCache.slice(0,a),p=new Array(r).fill(void 0);for(let h=0;h<a;h++){const f=m[h];f&&(p[f.lane]=h)}for(let h=a;h<t;h++){const f=l(h),v=this.laneAssignments.get(h);let k,S;const j=u==="estimate"||d.has(f);if(v!==void 0&&this.options.lanes>1){k=v;const w=p[k],x=w!==void 0?m[w]:void 0;S=x?x.end+this.options.gap:s+o}else{const w=this.options.lanes===1?m[h-1]:this.getFurthestMeasurement(m,h);S=w?w.end+this.options.gap:s+o,k=w?w.lane:h%this.options.lanes,this.options.lanes>1&&j&&this.laneAssignments.set(h,k)}const _=d.get(f),I=typeof _=="number"?_:this.options.estimateSize(h),P=S+I;m[h]={index:h,start:S,size:I,end:P,key:f,lane:k},p[k]=h}return this.measurementsCache=m,m},{key:!1,debug:()=>this.options.debug}),this.calculateRange=pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,o,l)=>this.range=t.length>0&&s>0?Jt({measurements:t,outerSize:s,scrollOffset:o,lanes:l}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=pe(()=>{let t=null,s=null;const o=this.calculateRange();return o&&(t=o.startIndex,s=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,o,l,c)=>l===null||c===null?[]:t({startIndex:l,endIndex:c,overscan:s,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,o=t.getAttribute(s);return o?parseInt(o,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(o!==void 0&&this.range){const l=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),c=Math.max(0,o-l),r=Math.min(this.options.count-1,o+l);return t>=c&&t<=r}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((c,r)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(r))});return}const s=this.indexFromElement(t),o=this.options.getItemKey(s),l=this.elementsCache.get(o);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(o,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var o;const l=this.measurementsCache[t];if(!l)return;const c=this.itemSizeCache.get(l.key)??l.size,r=s-c;r!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(l,r,this):l.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(l.index),this.itemSizeCache=new Map(this.itemSizeCache.set(l.key,s)),this.notify(!1))},this.getVirtualItems=pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const o=[];for(let l=0,c=t.length;l<c;l++){const r=t[l],u=s[r];o.push(u)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length!==0)return Le(s[Ze(0,s.length-1,o=>Le(s[o]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,s,o=0)=>{if(!this.scrollElement)return 0;const l=this.getSize(),c=this.getScrollOffset();s==="auto"&&(s=t>=c+l?"end":"start"),s==="center"?t+=(o-l)/2:s==="end"&&(t-=l);const r=this.getMaxScrollOffset();return Math.max(Math.min(r,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getSize(),l=this.getScrollOffset(),c=this.measurementsCache[t];if(!c)return;if(s==="auto")if(c.end>=l+o-this.options.scrollPaddingEnd)s="end";else if(c.start<=l+this.options.scrollPaddingStart)s="start";else return[l,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const r=s==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,s,c.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:o="auto"}={})=>{const l=this.getOffsetForAlignment(t,s),c=this.now();this.scrollState={index:null,align:s,behavior:o,startedAt:c,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const l=this.getOffsetForIndex(t,s);if(!l)return;const[c,r]=l,u=this.now();this.scrollState={index:t,align:r,behavior:o,startedAt:u,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const o=this.getScrollOffset()+t,l=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let o;if(s.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((t=s[s.length-1])==null?void 0:t.end)??0;else{const l=Array(this.options.lanes).fill(null);let c=s.length-1;for(;c>=0&&l.some(r=>r===null);){const r=s[c];l[r.lane]===null&&(l[r.lane]=r.end),c--}o=Math.max(...l.filter(r=>r!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:s,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=s?s[0]:this.scrollState.lastTargetOffset,l=1,c=o!==this.scrollState.lastTargetOffset;if(!c&&Bt(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=l){this.scrollState=null;return}}else this.scrollState.stableFrames=0,c&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Ze=(n,e,t,s)=>{for(;n<=e;){const o=(n+e)/2|0,l=t(o);if(l<s)n=o+1;else if(l>s)e=o-1;else return o}return n>0?n-1:0};function Jt({measurements:n,outerSize:e,scrollOffset:t,lanes:s}){const o=n.length-1,l=u=>n[u].start;if(n.length<=s)return{startIndex:0,endIndex:o};let c=Ze(0,o,l,t),r=c;if(s===1)for(;r<o&&n[r].end<t+e;)r++;else if(s>1){const u=Array(s).fill(0);for(;r<o&&u.some(a=>a<t+e);){const a=n[r];u[a.lane]=a.end,r++}const d=Array(s).fill(t+e);for(;c>=0&&d.some(a=>a>=t);){const a=n[c];d[a.lane]=a.start,c--}c=Math.max(0,c-c%s),r=Math.min(o,r+(s-1-r%s))}return{startIndex:c,endIndex:r}}const Ke=typeof document<"u"?V.useLayoutEffect:V.useEffect;function Zt({useFlushSync:n=!0,...e}){const t=V.useReducer(()=>({}),{})[1],s={...e,onChange:(l,c)=>{var r;n&&c?at.flushSync(t):t(),(r=e.onChange)==null||r.call(e,l,c)}},[o]=V.useState(()=>new Qt(s));return o.setOptions(s),Ke(()=>o._didMount(),[]),Ke(()=>o._willUpdate()),o}function es(n){return Zt({observeElementRect:qt,observeElementOffset:Yt,scrollToFn:Xt,...n})}const et=[{id:"openai",name:"OpenAI",description:"GPT-4, GPT-5, and other OpenAI models",logo:"https://decoims.com/decocms/b51001ef-ae58-4db4-8a75-9e6d2df2dd8e/openai.png",baseUrlPlaceholder:"https://api.openai.com/v1",defaultBaseUrl:"https://api.openai.com/v1",apiKeyRecommended:!0,helpText:"Use your OpenAI API key (starts with sk-)."},{id:"litellm",name:"LiteLLM",description:"Connect to a LiteLLM gateway your team manages",logo:"https://decoims.com/decocms/e974ae05-ad64-4b4a-8444-d9705f019b85/litellm.png",baseUrlPlaceholder:"http://localhost:4000",apiKeyRecommended:!0,helpText:"Point at your LiteLLM proxy. The base URL should be the root of the proxy (we'll append /v1)."},{id:"ollama",name:"Ollama",description:"Run open-source models on your own computer",logo:"https://decoims.com/decocms/2bb2f822-5288-4b7c-a541-dcbef76525a0/ollama.png",baseUrlPlaceholder:"http://localhost:11434",apiKeyRecommended:!1,helpText:"Ollama exposes /v1 by default — no API key required for local use."},{id:"lm-studio",name:"LM Studio",description:"Open models running through LM Studio",logo:"https://decoims.com/decocms/9f0ab1a9-d2d5-4f3e-9de0-aadd4926428d/lmstudio.webp",baseUrlPlaceholder:"http://localhost:1234",apiKeyRecommended:!1,helpText:"Start the local server in LM Studio, then paste its base URL here."},{id:"vllm",name:"vLLM",description:"Connect to your team's self-hosted vLLM server",logo:"https://decoims.com/decocms/b6c60e4f-a4aa-443c-981f-ad0f31640e22/vllm.png",baseUrlPlaceholder:"http://localhost:8000",apiKeyRecommended:!1}];function ye(n){if(n)return et.find(e=>e.id===n)}const De=4;function ve(n){const e=Q.c(8),{logo:t,name:s,description:o,onClick:l}=n;let c;e[0]!==t||e[1]!==s?(c=t?i.jsx("img",{src:t,alt:s,className:"size-8 rounded-md object-contain dark:bg-white dark:p-0.5"}):i.jsx(Tt,{fallback:s.charAt(0),className:"size-8 bg-primary/10 text-primary"}),e[0]=t,e[1]=s,e[2]=c):c=e[2];let r;return e[3]!==o||e[4]!==s||e[5]!==l||e[6]!==c?(r=i.jsx(We,{onClick:l,icon:c,title:s,description:o}),e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=r):r=e[7],r}function tt(n){const e=Q.c(38),{providers:t,onSelect:s,onShowAll:o}=n,l=ie();let c;e[0]!==t?(c=t.find(ns),e[0]=t,e[1]=c):c=e[1];const r=c;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={openrouter:0,llmapi:1,anthropic:2,google:3},e[2]=u):u=e[2];const d=u;let a;if(e[3]!==s||e[4]!==t||e[5]!==l){let I;e[7]===Symbol.for("react.memo_cache_sentinel")?(I=(y,E)=>{const L=d[y.id]??Number.MAX_SAFE_INTEGER,T=d[E.id]??Number.MAX_SAFE_INTEGER;return L-T},e[7]=I):I=e[7];const P=t.filter(is).sort(I);let w;e[8]!==t?(w=t.find(ss),e[8]=t,e[9]=w):w=e[9];const x=w;let N;e[10]===Symbol.for("react.memo_cache_sentinel")?(N=ye("openai"),e[10]=N):N=e[10];const C=N;let M;e[11]!==s?(M=y=>i.jsx(ve,{logo:y.logo,name:y.name,description:y.description,onClick:()=>s({kind:"provider",provider:y})},y.id),e[11]=s,e[12]=M):M=e[12];let g;e[13]!==s||e[14]!==x?(g=x&&C?[i.jsx(ve,{logo:C.logo,name:C.name,description:C.description,onClick:()=>s({kind:"openai-compatible",provider:x,preset:C})},C.id)]:[],e[13]=s,e[14]=x,e[15]=g):g=e[15];let b;e[16]!==s||e[17]!==x||e[18]!==l?(b=x?[...et.filter(ts).map(y=>i.jsx(ve,{logo:y.logo,name:y.name,description:y.description,onClick:()=>s({kind:"openai-compatible",provider:x,preset:y})},y.id)),i.jsx(ve,{logo:x.logo,name:l("settings.aiProviders.customOpenAiCompatible"),description:l("settings.aiProviders.customOpenAiDescription"),onClick:()=>s({kind:"openai-compatible",provider:x,preset:null})},"custom")]:[],e[16]=s,e[17]=x,e[18]=l,e[19]=b):b=e[19],a=[...P.map(M),...g,...b],e[3]=s,e[4]=t,e[5]=l,e[6]=a}else a=e[6];const m=a,p=m.length-De,h=!!o&&p>0;let f;e[20]!==m||e[21]!==h?(f=h?m.slice(0,De):m,e[20]=m,e[21]=h,e[22]=f):f=e[22];const v=f;let k;e[23]!==r||e[24]!==s||e[25]!==l?(k=r&&i.jsx(Ee,{children:i.jsxs("div",{className:"relative rounded-xl border border-violet-400/30 bg-gradient-to-br from-violet-50/50 via-transparent to-lime-50/30 dark:from-violet-950/20 dark:to-lime-950/10 p-1.5",children:[i.jsx("div",{className:"absolute inset-0 rounded-xl bg-gradient-to-br from-violet-400/5 to-lime-400/5 pointer-events-none"}),i.jsx("p",{className:"text-xs font-medium text-violet-700 dark:text-violet-400 mb-1.5 px-2 pt-2 relative",children:l("settings.aiProviders.recommended")}),i.jsx(Oe,{className:"relative",children:i.jsx(ve,{logo:r.logo,name:r.name,description:r.description,onClick:()=>s({kind:"provider",provider:r})})})]})}),e[23]=r,e[24]=s,e[25]=l,e[26]=k):k=e[26];let S;e[27]!==p||e[28]!==o||e[29]!==h||e[30]!==l?(S=h&&i.jsx(We,{onClick:o,title:l(p===1?"settings.aiProviders.moreProvidersSingular":"settings.aiProviders.moreProvidersPlural",{count:p}),action:i.jsx(Pt,{size:16,className:"text-muted-foreground"})}),e[27]=p,e[28]=o,e[29]=h,e[30]=l,e[31]=S):S=e[31];let j;e[32]!==S||e[33]!==v?(j=i.jsx(Ee,{children:i.jsxs(Oe,{children:[v,S]})}),e[32]=S,e[33]=v,e[34]=j):j=e[34];let _;return e[35]!==k||e[36]!==j?(_=i.jsxs("div",{className:"flex flex-col gap-6",children:[k,j]}),e[35]=k,e[36]=j,e[37]=_):_=e[37],_}function ts(n){return n.id!=="openai"}function ss(n){return n.id==="openai-compatible"}function is(n){return n.id!=="deco"&&n.id!=="openai-compatible"}function ns(n){return n.id==="deco"}function ls(n){return qe({label:be().optional(),apiKey:be().min(1,n)})}function os(n){const e=Q.c(91),{providerId:t,onCancel:s,onSuccess:o}=n,{org:l}=ge(),c=ke(),r=we(),[u,d]=V.useState(!1),a=ie();let m;e[0]!==a?(m=Ve(ls(a("settings.connectForms.apiKeyRequired"))),e[0]=a,e[1]=m):m=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p={label:"",apiKey:""},e[2]=p):p=e[2];let h;e[3]!==m?(h={resolver:m,defaultValues:p},e[3]=m,e[4]=h):h=e[4];const{register:f,handleSubmit:v,formState:k}=He(h),{errors:S}=k;let j;e[5]!==t||e[6]!==c||e[7]!==a?(j=async se=>{await c.call("AI_PROVIDER_KEY_CREATE",{providerId:t,label:se.label||a("settings.connectForms.defaultKeyLabel"),apiKey:se.apiKey})},e[5]=t,e[6]=c,e[7]=a,e[8]=j):j=e[8];let _;e[9]!==o||e[10]!==l||e[11]!==r||e[12]!==a?(_=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),le.success(a("settings.connectForms.keySavedSuccess")),o()},e[9]=o,e[10]=l,e[11]=r,e[12]=a,e[13]=_):_=e[13];let I;e[14]!==a?(I=se=>{le.error(a("settings.connectForms.failedSaveKey",{error:se.message}))},e[14]=a,e[15]=I):I=e[15];let P;e[16]!==j||e[17]!==_||e[18]!==I?(P={mutationFn:j,onSuccess:_,onError:I},e[16]=j,e[17]=_,e[18]=I,e[19]=P):P=e[19];const{mutate:w,isPending:x,error:N}=Se(P);let C;e[20]!==w?(C=se=>w(se),e[20]=w,e[21]=C):C=e[21];let M;e[22]!==v||e[23]!==C?(M=v(C),e[22]=v,e[23]=C,e[24]=M):M=e[24];let g;e[25]!==a?(g=a("settings.connectForms.labelField"),e[25]=a,e[26]=g):g=e[26];let b;e[27]!==g?(b=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:g}),e[27]=g,e[28]=b):b=e[28];let y;e[29]!==a?(y=a("settings.connectForms.labelPlaceholder"),e[29]=a,e[30]=y):y=e[30];let E;e[31]!==f?(E=f("label"),e[31]=f,e[32]=E):E=e[32];let L;e[33]!==y||e[34]!==E?(L=i.jsx(xe,{placeholder:y,...E,className:"h-8 text-sm"}),e[33]=y,e[34]=E,e[35]=L):L=e[35];let T;e[36]!==b||e[37]!==L?(T=i.jsxs("div",{className:"space-y-1",children:[b,L]}),e[36]=b,e[37]=L,e[38]=T):T=e[38];let O;e[39]!==a?(O=a("settings.connectForms.apiKeyField"),e[39]=a,e[40]=O):O=e[40];let z;e[41]!==O?(z=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:O}),e[41]=O,e[42]=z):z=e[42];const R=u?"text":"password";let F;e[43]!==f?(F=f("apiKey"),e[43]=f,e[44]=F):F=e[44];let Y;e[45]!==R||e[46]!==F?(Y=i.jsx(xe,{type:R,placeholder:"sk-...",...F,className:"ph-no-capture h-8 text-sm pr-8"}),e[45]=R,e[46]=F,e[47]=Y):Y=e[47];let X;e[48]!==u?(X=()=>d(!u),e[48]=u,e[49]=X):X=e[49];let B;e[50]!==u||e[51]!==a?(B=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[50]=u,e[51]=a,e[52]=B):B=e[52];let H;e[53]!==u?(H=u?i.jsx(Ge,{size:14}):i.jsx(Je,{size:14}),e[53]=u,e[54]=H):H=e[54];let W;e[55]!==X||e[56]!==B||e[57]!==H?(W=i.jsx("button",{type:"button",onClick:X,"aria-label":B,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:H}),e[55]=X,e[56]=B,e[57]=H,e[58]=W):W=e[58];let J;e[59]!==Y||e[60]!==W?(J=i.jsxs("div",{className:"relative",children:[Y,W]}),e[59]=Y,e[60]=W,e[61]=J):J=e[61];let D;e[62]!==S.apiKey?(D=S.apiKey&&i.jsx("p",{className:"text-xs text-destructive",children:S.apiKey.message}),e[62]=S.apiKey,e[63]=D):D=e[63];let $;e[64]!==z||e[65]!==J||e[66]!==D?($=i.jsxs("div",{className:"space-y-1",children:[z,J,D]}),e[64]=z,e[65]=J,e[66]=D,e[67]=$):$=e[67];let G;e[68]!==N?(G=N&&i.jsx("p",{className:"text-xs text-destructive",children:N.message}),e[68]=N,e[69]=G):G=e[69];let A;e[70]!==a?(A=a("settings.connectForms.cancel"),e[70]=a,e[71]=A):A=e[71];let K;e[72]!==x||e[73]!==s||e[74]!==A?(K=i.jsx(re,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:x,children:A}),e[72]=x,e[73]=s,e[74]=A,e[75]=K):K=e[75];let U;e[76]!==x||e[77]!==a?(U=a(x?"settings.connectForms.saving":"settings.connectForms.saveKey"),e[76]=x,e[77]=a,e[78]=U):U=e[78];let q;e[79]!==x||e[80]!==U?(q=i.jsx(re,{type:"submit",size:"sm",disabled:x,children:U}),e[79]=x,e[80]=U,e[81]=q):q=e[81];let Z;e[82]!==K||e[83]!==q?(Z=i.jsxs(Qe,{children:[K,q]}),e[82]=K,e[83]=q,e[84]=Z):Z=e[84];let te;return e[85]!==M||e[86]!==T||e[87]!==$||e[88]!==G||e[89]!==Z?(te=i.jsxs("form",{onSubmit:M,className:"space-y-3",children:[T,$,G,Z]}),e[85]=M,e[86]=T,e[87]=$,e[88]=G,e[89]=Z,e[90]=te):te=e[90],te}function rs(n){return qe({label:be().optional(),baseUrl:be().min(1,n),apiKey:be().optional()})}function as(n){const e=Q.c(109),{preset:t,onCancel:s,onSuccess:o}=n,{org:l}=ge(),c=ke(),r=we(),[u,d]=V.useState(!1),a=ie();let m;e[0]!==a?(m=Ve(rs(a("settings.connectForms.baseUrlRequired"))),e[0]=a,e[1]=m):m=e[1];const p=t?.defaultBaseUrl??"";let h;e[2]!==p?(h={label:"",baseUrl:p,apiKey:""},e[2]=p,e[3]=h):h=e[3];let f;e[4]!==m||e[5]!==h?(f={resolver:m,defaultValues:h},e[4]=m,e[5]=h,e[6]=f):f=e[6];const{register:v,handleSubmit:k,formState:S}=He(f),{errors:j}=S;let _;e[7]!==t||e[8]!==c?(_=async oe=>{const rt=JSON.stringify({baseUrl:oe.baseUrl,apiKey:oe.apiKey||""});await c.call("AI_PROVIDER_KEY_CREATE",{providerId:"openai-compatible",label:oe.label||t?.name||oe.baseUrl,apiKey:rt,...t?{presetId:t.id}:{}})},e[7]=t,e[8]=c,e[9]=_):_=e[9];let I;e[10]!==o||e[11]!==l||e[12]!==r||e[13]!==a?(I=()=>{r.invalidateQueries({queryKey:ce.aiProviderKeys(l.id)}),r.invalidateQueries({queryKey:ce.aiProviders(l.id)}),le.success(a("settings.connectForms.connectionSavedSuccess")),o()},e[10]=o,e[11]=l,e[12]=r,e[13]=a,e[14]=I):I=e[14];let P;e[15]!==a?(P=oe=>{le.error(a("settings.connectForms.failedSaveConnection",{error:oe.message}))},e[15]=a,e[16]=P):P=e[16];let w;e[17]!==_||e[18]!==I||e[19]!==P?(w={mutationFn:_,onSuccess:I,onError:P},e[17]=_,e[18]=I,e[19]=P,e[20]=w):w=e[20];const{mutate:x,isPending:N,error:C}=Se(w);let M;e[21]!==t||e[22]!==a?(M=t?a("settings.connectForms.labelPlaceholderPreset",{name:t.name}):a("settings.connectForms.labelPlaceholderOpenAiCompatible"),e[21]=t,e[22]=a,e[23]=M):M=e[23];const g=M;let b;e[24]!==t?.baseUrlPlaceholder||e[25]!==a?(b=t?.baseUrlPlaceholder??a("settings.connectForms.baseUrlPlaceholder"),e[24]=t?.baseUrlPlaceholder,e[25]=a,e[26]=b):b=e[26];const y=b;let E;e[27]!==x?(E=oe=>x(oe),e[27]=x,e[28]=E):E=e[28];let L;e[29]!==k||e[30]!==E?(L=k(E),e[29]=k,e[30]=E,e[31]=L):L=e[31];let T;e[32]!==a?(T=a("settings.connectForms.labelField"),e[32]=a,e[33]=T):T=e[33];let O;e[34]!==T?(O=i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:T}),e[34]=T,e[35]=O):O=e[35];let z;e[36]!==v?(z=v("label"),e[36]=v,e[37]=z):z=e[37];let R;e[38]!==g||e[39]!==z?(R=i.jsx(xe,{placeholder:g,...z,className:"h-8 text-sm"}),e[38]=g,e[39]=z,e[40]=R):R=e[40];let F;e[41]!==O||e[42]!==R?(F=i.jsxs("div",{className:"space-y-1",children:[O,R]}),e[41]=O,e[42]=R,e[43]=F):F=e[43];let Y;e[44]!==y||e[45]!==j||e[46]!==t?.defaultBaseUrl||e[47]!==v||e[48]!==a?(Y=t?.defaultBaseUrl?i.jsx("input",{type:"hidden",...v("baseUrl")}):i.jsxs("div",{className:"space-y-1",children:[i.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.connectForms.baseUrlField")}),i.jsx(xe,{type:"url",placeholder:y,...v("baseUrl"),className:"h-8 text-sm"}),j.baseUrl&&i.jsx("p",{className:"text-xs text-destructive",children:j.baseUrl.message})]}),e[44]=y,e[45]=j,e[46]=t?.defaultBaseUrl,e[47]=v,e[48]=a,e[49]=Y):Y=e[49];let X;e[50]!==a?(X=a("settings.connectForms.apiKeyField"),e[50]=a,e[51]=X):X=e[51];let B;e[52]!==t?.apiKeyRecommended||e[53]!==a?(B=t?.apiKeyRecommended?a("settings.connectForms.recommended"):a("settings.connectForms.optional"),e[52]=t?.apiKeyRecommended,e[53]=a,e[54]=B):B=e[54];let H;e[55]!==B?(H=i.jsxs("span",{className:"text-muted-foreground/60",children:["(",B,")"]}),e[55]=B,e[56]=H):H=e[56];let W;e[57]!==X||e[58]!==H?(W=i.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:[X," ",H]}),e[57]=X,e[58]=H,e[59]=W):W=e[59];const J=u?"text":"password";let D;e[60]!==v?(D=v("apiKey"),e[60]=v,e[61]=D):D=e[61];let $;e[62]!==J||e[63]!==D?($=i.jsx(xe,{type:J,placeholder:"sk-...",...D,className:"ph-no-capture h-8 text-sm pr-8"}),e[62]=J,e[63]=D,e[64]=$):$=e[64];let G;e[65]!==u?(G=()=>d(!u),e[65]=u,e[66]=G):G=e[66];let A;e[67]!==u||e[68]!==a?(A=a(u?"settings.connectForms.hideApiKey":"settings.connectForms.showApiKey"),e[67]=u,e[68]=a,e[69]=A):A=e[69];let K;e[70]!==u?(K=u?i.jsx(Ge,{size:14}):i.jsx(Je,{size:14}),e[70]=u,e[71]=K):K=e[71];let U;e[72]!==G||e[73]!==A||e[74]!==K?(U=i.jsx("button",{type:"button",onClick:G,"aria-label":A,className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:K}),e[72]=G,e[73]=A,e[74]=K,e[75]=U):U=e[75];let q;e[76]!==$||e[77]!==U?(q=i.jsxs("div",{className:"relative",children:[$,U]}),e[76]=$,e[77]=U,e[78]=q):q=e[78];let Z;e[79]!==W||e[80]!==q?(Z=i.jsxs("div",{className:"space-y-1",children:[W,q]}),e[79]=W,e[80]=q,e[81]=Z):Z=e[81];let te;e[82]!==t?(te=t?.helpText&&i.jsx("p",{className:"text-xs text-muted-foreground",children:t.helpText}),e[82]=t,e[83]=te):te=e[83];let se;e[84]!==C?(se=C&&i.jsx("p",{className:"text-xs text-destructive",children:C.message}),e[84]=C,e[85]=se):se=e[85];let de;e[86]!==a?(de=a("settings.connectForms.cancel"),e[86]=a,e[87]=de):de=e[87];let ue;e[88]!==N||e[89]!==s||e[90]!==de?(ue=i.jsx(re,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:N,children:de}),e[88]=N,e[89]=s,e[90]=de,e[91]=ue):ue=e[91];let he;e[92]!==N||e[93]!==a?(he=a(N?"settings.connectForms.saving":"settings.connectForms.saveConnection"),e[92]=N,e[93]=a,e[94]=he):he=e[94];let me;e[95]!==N||e[96]!==he?(me=i.jsx(re,{type:"submit",size:"sm",disabled:N,children:he}),e[95]=N,e[96]=he,e[97]=me):me=e[97];let fe;e[98]!==ue||e[99]!==me?(fe=i.jsxs(Qe,{children:[ue,me]}),e[98]=ue,e[99]=me,e[100]=fe):fe=e[100];let je;return e[101]!==L||e[102]!==F||e[103]!==Y||e[104]!==Z||e[105]!==te||e[106]!==se||e[107]!==fe?(je=i.jsxs("form",{onSubmit:L,className:"space-y-3",children:[F,Y,Z,te,se,fe]}),e[101]=L,e[102]=F,e[103]=Y,e[104]=Z,e[105]=te,e[106]=se,e[107]=fe,e[108]=je):je=e[108],je}const cs={kind:"closed"};function ds(n,e){switch(e.type){case"open":return n.kind==="closed"?{kind:"grid"}:n;case"close":return{kind:"closed"};case"back":switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return{kind:"grid"};default:return n}case"select-form":return n.kind!=="grid"?n:{kind:"form",providerId:e.providerId,presetId:e.presetId};case"select-oauth":return n.kind!=="grid"?n:{kind:"oauth-pending",providerId:e.providerId,stateToken:e.stateToken};case"oauth-failed":return n.kind==="oauth-pending"?{kind:"grid"}:n;case"select-provision":return n.kind!=="grid"?n:{kind:"provision-pending",providerId:e.providerId};case"provision-error":return n.kind!=="provision-pending"?n:{kind:"provision-error",providerId:n.providerId,error:e.error};case"retry-provision":return n.kind!=="provision-error"?n:{kind:"provision-pending",providerId:n.providerId}}}function us(n){switch(n.kind){case"form":case"oauth-pending":case"provision-pending":case"provision-error":return n.providerId;default:return null}}function hs({open:n,onOpenChange:e,initialProvider:t}){const s=ie(),l=_e()?.providers??[],{org:c}=ge(),r=ke(),u=we(),[d,a]=V.useReducer(ds,cs),m=V.useRef(!1);V.useEffect(()=>{n&&d.kind==="closed"?a({type:"open"}):!n&&d.kind!=="closed"&&a({type:"close"})},[n,d.kind]);const p=()=>{m.current=!1,a({type:"close"}),e(!1)},h=()=>{u.invalidateQueries({queryKey:ce.aiProviderKeys(c.id)}),u.invalidateQueries({queryKey:ce.aiProviders(c.id)})},{mutate:f}=Se({mutationFn:async({providerId:g,code:b,stateToken:y,label:E})=>(await r.call("AI_PROVIDER_OAUTH_EXCHANGE",{providerId:g,code:b,stateToken:y,label:E}),g),onSuccess:g=>{ne("ai_provider_oauth_succeeded",{provider_id:g}),h();const b=l.find(y=>y.id===g);le.success(s("settings.connectProviderDialog.oauthSuccessMessage",{provider:b?.name??s("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(g,b)=>{ne("ai_provider_oauth_failed",{provider_id:b.providerId,error:g.message}),le.error(s("settings.connectProviderDialog.oauthFailedMessage",{error:g.message})),a({type:"oauth-failed"})}}),{mutate:v}=Se({mutationFn:async g=>(await r.call("AI_PROVIDER_PROVISION_KEY",{providerId:g}),g),onSuccess:g=>{ne("ai_provider_provision_succeeded",{provider_id:g}),h();const b=l.find(y=>y.id===g);le.success(s("settings.connectProviderDialog.provisionSuccessMessage",{provider:b?.name??s("settings.connectProviderDialog.defaultProviderName")})),p()},onError:(g,b)=>{ne("ai_provider_provision_failed",{provider_id:b,error:g.message}),a({type:"provision-error",error:g.message})}}),k=async g=>{const{provider:b}=g,y=g.kind==="openai-compatible"?g.preset?.id??null:null,E=b.supportedMethods.includes("oauth-pkce"),L=b.supportedMethods.includes("api-key");if(b.supportsProvision===!0){ne("ai_provider_connect_clicked",{provider_id:b.id,method:"provision"}),a({type:"select-provision",providerId:b.id}),v(b.id);return}if(E){ne("ai_provider_connect_clicked",{provider_id:b.id,method:"oauth-pkce"});try{const O=await r.call("AI_PROVIDER_OAUTH_URL",{providerId:b.id,callbackUrl:`${window.location.origin}/oauth/callback/ai-provider`});if(!O?.url)throw new Error("Invalid response from AI_PROVIDER_OAUTH_URL");a({type:"select-oauth",providerId:b.id,stateToken:O.stateToken}),window.open(O.url,"AiProviderOAuth","width=600,height=700")}catch(O){le.error(s("settings.connectProviderDialog.startOAuthFailedMessage",{error:O instanceof Error?O.message:String(O)}))}return}L&&(ne("ai_provider_connect_clicked",{provider_id:b.id,...y!==null?{preset_id:y}:{},method:"api-key"}),a({type:"select-form",providerId:b.id,presetId:y}))},S=V.useRef(k);S.current=k;const j=V.useRef(t);j.current=t,V.useEffect(()=>{!j.current||d.kind!=="grid"||m.current||(m.current=!0,S.current(j.current))},[d.kind]);const _=d.kind==="oauth-pending"?d.stateToken:null,I=d.kind==="oauth-pending"?d.providerId:null;V.useEffect(()=>{if(d.kind!=="oauth-pending")return;let g=!1;const b=d.stateToken,y=d.providerId,E=T=>{if(T.origin!==window.location.origin||T.data?.type!=="AI_PROVIDER_OAUTH_CALLBACK")return;const{code:O,stateToken:z}=T.data;if(z!==b){le.error(s("settings.connectProviderDialog.securityCheckFailedMessage")),a({type:"oauth-failed"});return}g=!0;const R=l.find(F=>F.id===y);f({providerId:y,code:O,stateToken:b,label:R?.name??y})};window.addEventListener("message",E);const L=setTimeout(()=>{g||(ne("ai_provider_oauth_timeout",{provider_id:y}),a({type:"oauth-failed"}),le.error(s("settings.connectProviderDialog.connectionTimedOutMessage")))},12e4);return()=>{window.removeEventListener("message",E),clearTimeout(L)}},[d.kind,_,I,f]);const P=us(d),w=P?l.find(g=>g.id===P):null,N=(d.kind==="form"&&d.presetId?ye(d.presetId):null)?.name??w?.name??s("settings.connectProviderDialog.defaultTitle"),C=d.kind!=="grid"&&d.kind!=="closed",M=()=>{t?p():a({type:"back"})};return i.jsx(It,{open:d.kind!=="closed",onOpenChange:g=>!g&&p(),children:i.jsxs(Mt,{className:"sm:max-w-md max-h-[90vh] overflow-y-auto",children:[i.jsxs(Et,{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[C&&i.jsx(re,{variant:"ghost",size:"icon","aria-label":s("settings.connectProviderDialog.backButtonLabel"),className:"h-7 w-7",onClick:M,children:i.jsx(Ye,{size:16})}),i.jsx(Ot,{children:N})]}),d.kind==="grid"&&!t&&i.jsx(At,{children:s("settings.connectProviderDialog.gridDescription")})]}),d.kind==="grid"&&!t&&i.jsx(tt,{providers:l,onSelect:k}),d.kind==="form"&&(d.providerId==="openai-compatible"?i.jsx(as,{preset:d.presetId?ye(d.presetId):void 0,onCancel:()=>a({type:"back"}),onSuccess:()=>{h(),p()}}):i.jsx(os,{providerId:d.providerId,onCancel:()=>a({type:"back"}),onSuccess:()=>{h(),p()}})),d.kind==="oauth-pending"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[i.jsx(Ae,{size:"lg"}),i.jsx("p",{className:"text-sm text-muted-foreground text-center",children:s("settings.connectProviderDialog.oauthPendingMessage")})]}),d.kind==="provision-pending"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-8",children:[i.jsx(Ae,{size:"lg"}),i.jsx("p",{className:"text-sm text-muted-foreground",children:s("settings.connectProviderDialog.provisionPendingMessage")})]}),d.kind==="provision-error"&&i.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[i.jsx(Ct,{size:28,className:"text-destructive"}),i.jsx("p",{className:"text-sm text-foreground text-center",children:d.error}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(re,{variant:"outline",size:"sm",onClick:()=>a({type:"back"}),children:s("settings.connectProviderDialog.backButton")}),i.jsx(re,{size:"sm",onClick:()=>{a({type:"retry-provision"}),v(d.providerId)},children:s("settings.connectProviderDialog.retryButton")})]})]})]})})}function ms(){const n=Q.c(7),{org:e}=ge(),t=ke();let s;n[0]!==e.id?(s=ce.defaultBrand(e.id),n[0]=e.id,n[1]=s):s=n[1];let o;n[2]!==t?(o=async()=>{const{items:r}=await t.call("BRAND_CONTEXT_LIST",{});return(Array.isArray(r)?r:[]).find(fs)??null},n[2]=t,n[3]=o):o=n[3];let l;n[4]!==s||n[5]!==o?(l={queryKey:s,queryFn:o},n[4]=s,n[5]=o,n[6]=l):l=n[6];const{data:c}=ct(l);return c??null}function fs(n){return n.isDefault&&!n.archivedAt}function ps(n){const e=n.colors;if(!e)return null;if(Array.isArray(e)){const t=e.find(o=>typeof o=="object"&&o!==null&&"label"in o&&/primary|brand|main/i.test(o.label)),s=t?t.value:e[0]?.value;return typeof s=="string"?s:null}if(typeof e=="object"){const t=e;return t.primary??Object.values(t)[0]??null}return null}function xs(n){const e=Q.c(49);let t;e[0]!==n?(t=n===void 0?{}:n,e[0]=n,e[1]=t):t=e[1];const{title:s,description:o}=t,l=ie(),{org:c}=ge(),r=ms(),[u,d]=V.useState(null),[a,m]=V.useState(!1),[p,h]=V.useState(!1),f=Rt();let v;e[2]!==f?(v=(Lt()||zt())&&!f,e[2]=f,e[3]=v):v=e[3];const k=v,S=_e();let j;e[4]!==S?.providers?(j=S?.providers??[],e[4]=S?.providers,e[5]=j):j=e[5];const _=j,I=c.name;let P;e[6]!==r?(P=r?ps(r):null,e[6]=r,e[7]=P):P=e[7];const w=P,x=r?.favicon??r?.logo??null;let N;e[8]!==I||e[9]!==l||e[10]!==s?(N=s??(I?l("chat.noAiProviderEmptyState.headingWithOrg",{org:I}):l("chat.noAiProviderEmptyState.headingDefault")),e[8]=I,e[9]=l,e[10]=s,e[11]=N):N=e[11];const C=N;let M;e[12]!==o||e[13]!==l?(M=o??l("chat.noAiProviderEmptyState.subtitleDefault"),e[12]=o,e[13]=l,e[14]=M):M=e[14];const g=M,b=!!(x||w);let y;e[15]!==w?(y=w?{backgroundColor:`${w}18`,borderColor:`${w}30`}:void 0,e[15]=w,e[16]=y):y=e[16];const E=y,L=b?"flex items-center justify-center size-14 rounded-2xl border":"flex items-center justify-center size-14 rounded-2xl bg-muted border border-border";let T;e[17]!==L||e[18]!==E||e[19]!==x||e[20]!==k||e[21]!==w||e[22]!==l?(T=x?i.jsx("div",{className:L,style:E,children:i.jsx("img",{src:x,alt:"",className:"size-7 rounded object-contain"})}):k?i.jsx("button",{type:"button",onClick:()=>h(!0),"aria-label":l("downloadApp.openLabel"),className:ae(L,"cursor-pointer transition-colors hover:bg-accent"),style:E,children:i.jsx(Pe,{size:24,style:w?{color:w}:void 0,className:ae(!w&&"text-muted-foreground")})}):i.jsx("div",{className:L,style:E,children:i.jsx(Pe,{size:24,style:w?{color:w}:void 0,className:ae(!w&&"text-muted-foreground")})}),e[17]=L,e[18]=E,e[19]=x,e[20]=k,e[21]=w,e[22]=l,e[23]=T):T=e[23];let O;e[24]!==C?(O=i.jsx("p",{className:"text-xl font-semibold text-foreground tracking-tight",children:C}),e[24]=C,e[25]=O):O=e[25];let z;e[26]!==g?(z=i.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:g}),e[26]=g,e[27]=z):z=e[27];let R;e[28]!==z||e[29]!==O?(R=i.jsxs("div",{className:"space-y-2",children:[O,z]}),e[28]=z,e[29]=O,e[30]=R):R=e[30];let F;e[31]!==R||e[32]!==T?(F=i.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[T,R]}),e[31]=R,e[32]=T,e[33]=F):F=e[33];let Y,X;e[34]===Symbol.for("react.memo_cache_sentinel")?(Y=A=>d(A),X=()=>m(!0),e[34]=Y,e[35]=X):(Y=e[34],X=e[35]);let B;e[36]!==_?(B=i.jsx("div",{className:"w-full",children:i.jsx(tt,{providers:_,onSelect:Y,onShowAll:X})}),e[36]=_,e[37]=B):B=e[37];const H=u!==null||a;let W;e[38]===Symbol.for("react.memo_cache_sentinel")?(W=A=>{A||(d(null),m(!1))},e[38]=W):W=e[38];const J=u??void 0;let D;e[39]!==H||e[40]!==J?(D=i.jsx(hs,{open:H,onOpenChange:W,initialProvider:J}),e[39]=H,e[40]=J,e[41]=D):D=e[41];let $;e[42]!==p?($=i.jsx(Ft,{open:p,onOpenChange:h}),e[42]=p,e[43]=$):$=e[43];let G;return e[44]!==F||e[45]!==B||e[46]!==D||e[47]!==$?(G=i.jsxs("div",{className:"flex flex-col items-center gap-8 w-full max-w-3xl px-4",children:[F,B,D,$]}),e[44]=F,e[45]=B,e[46]=D,e[47]=$,e[48]=G):G=e[48],G}function Ie(n){const e=n.title.includes(": ");return{provider:e?n.title.split(": ")[0]??"":n.modelId.split("/")[0]??"",displayName:e?n.title.split(": ").slice(1).join(": "):n.title}}function gs(n){return n<32e3?{level:1,labelKey:"chat.shared.contextLevelSmall",descriptionKey:"chat.shared.contextLevelSmallDesc"}:n<2e5?{level:2,labelKey:"chat.shared.contextLevelMedium",descriptionKey:"chat.shared.contextLevelMediumDesc"}:n<5e5?{level:3,labelKey:"chat.shared.contextLevelLarge",descriptionKey:"chat.shared.contextLevelLargeDesc"}:{level:4,labelKey:"chat.shared.contextLevelVeryLarge",descriptionKey:"chat.shared.contextLevelVeryLargeDesc"}}const vs=["bg-destructive","bg-warning","bg-success","bg-success"],bs=["text-success","text-warning","text-warning","text-destructive"];function ys(n,e){const t=Math.round(n*.75/1e3),s=t>=1?`${t}K`:`${Math.round(n*.75)}`;return e("chat.shared.approxWords",{wordCount:s})}function js(n){return n<1?{level:1,labelKey:"chat.shared.costLevelCheap"}:n<5?{level:2,labelKey:"chat.shared.costLevelModerate"}:n<15?{level:3,labelKey:"chat.shared.costLevelHigh"}:{level:4,labelKey:"chat.shared.costLevelExpensive"}}const Ss={text:{icon:i.jsx(Dt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityText"},vision:{icon:i.jsx($t,{className:"size-3.5"}),labelKey:"chat.shared.capabilityVision"},image:{icon:i.jsx(jt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityImage"},tools:{icon:i.jsx(Kt,{className:"size-3.5"}),labelKey:"chat.shared.capabilityTools"},reasoning:{icon:i.jsx(Ut,{className:"size-3.5"}),labelKey:"chat.shared.capabilityReasoning"},"web-search":{icon:i.jsx(Xe,{className:"size-3.5"}),labelKey:"chat.shared.capabilityWebSearch"}};function Ns(n){const e=Q.c(10),{capability:t}=n,s=ie(),o=Ss[t];if(o){const u=o.icon;let d;e[0]!==o.labelKey||e[1]!==s?(d=s(o.labelKey),e[0]=o.labelKey,e[1]=s,e[2]=d):d=e[2];let a;return e[3]!==o.icon||e[4]!==d?(a=i.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:[u,d]}),e[3]=o.icon,e[4]=d,e[5]=a):a=e[5],a}let l;e[6]!==t?(l=t.charAt(0).toUpperCase(),e[6]=t,e[7]=l):l=e[7];const c=l+t.slice(1);let r;return e[8]!==c?(r=i.jsx("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground border border-border rounded px-2 py-0.5",children:c}),e[8]=c,e[9]=r):r=e[9],r}function ks(n){const e=Q.c(59),{model:t,compact:s}=n,o=s===void 0?!1:s,l=ie();if(!t){let x;e[0]!==l?(x=l("chat.shared.hoverToPreview"),e[0]=l,e[1]=x):x=e[1];let N;return e[2]!==x?(N=i.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:x}),e[2]=x,e[3]=N):N=e[3],N}const c=t.costs?.input!=null?t.costs.input*1e6:null,r=t.costs?.output!=null?t.costs.output*1e6:null;let u;e[4]!==t?(u=Ie(t),e[4]=t,e[5]=u):u=e[5];const{provider:d,displayName:a}=u;if(o){let x;e[6]!==t.limits||e[7]!==l?(x=t.limits?.contextWindow&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.context")}),i.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[6]=t.limits,e[7]=l,e[8]=x):x=e[8];let N;e[9]!==c||e[10]!==l?(N=c!=null&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.input")}),i.jsxs("span",{className:"text-foreground font-medium",children:["$",c.toFixed(2)," / 1M"]})]}),e[9]=c,e[10]=l,e[11]=N):N=e[11];let C;e[12]!==r||e[13]!==l?(C=r!=null&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.output")}),i.jsxs("span",{className:"text-foreground font-medium",children:["$",r.toFixed(2)," / 1M"]})]}),e[12]=r,e[13]=l,e[14]=C):C=e[14];let M;e[15]!==t.limits||e[16]!==l?(M=t.limits?.maxOutputTokens&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:l("chat.shared.outputLimit")}),i.jsxs("span",{className:"text-foreground font-medium",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]})]}),e[15]=t.limits,e[16]=l,e[17]=M):M=e[17];let g;return e[18]!==x||e[19]!==N||e[20]!==C||e[21]!==M?(g=i.jsxs("div",{className:"flex flex-col gap-2 pt-3 pb-3 px-3 text-xs",children:[x,N,C,M]}),e[18]=x,e[19]=N,e[20]=C,e[21]=M,e[22]=g):g=e[22],g}let m;e[23]!==d?(m=i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:d}),e[23]=d,e[24]=m):m=e[24];let p;e[25]!==t.logo||e[26]!==t.title?(p=t.logo&&i.jsx("img",{src:t.logo,className:"size-6 shrink-0 rounded-md dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[25]=t.logo,e[26]=t.title,e[27]=p):p=e[27];let h;e[28]!==a?(h=i.jsx("p",{className:"text-lg font-semibold leading-snug tracking-tight",children:a}),e[28]=a,e[29]=h):h=e[29];let f;e[30]!==p||e[31]!==h?(f=i.jsxs("div",{className:"flex items-center gap-2.5",children:[p,h]}),e[30]=p,e[31]=h,e[32]=f):f=e[32];let v;e[33]!==t.modelId?(v=i.jsx("p",{className:"text-xs text-muted-foreground/50 font-mono",children:t.modelId}),e[33]=t.modelId,e[34]=v):v=e[34];let k;e[35]!==m||e[36]!==f||e[37]!==v?(k=i.jsxs("div",{className:"flex flex-col gap-1 pt-1 pr-6",children:[m,f,v]}),e[35]=m,e[36]=f,e[37]=v,e[38]=k):k=e[38];let S;e[39]!==t.capabilities?(S=t.capabilities&&t.capabilities.length>0&&i.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pb-4 border-b border-border",children:[...new Set(t.capabilities)].map(ws)}),e[39]=t.capabilities,e[40]=S):S=e[40];let j;e[41]!==t.limits||e[42]!==l?(j=t.limits?.contextWindow&&(()=>{const{level:x,labelKey:N,descriptionKey:C}=gs(t.limits.contextWindow);return i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.contextWindow")}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex items-center gap-0.5",children:[1,2,3,4].map(M=>i.jsx("div",{className:ae("w-2 h-2 rounded-full",M<=x?vs[x-1]:"bg-muted")},M))}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:l(N)}),i.jsxs("span",{className:"text-xs text-muted-foreground",children:["— ",l(C)]})]}),i.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.limits.contextWindow.toLocaleString()," ",l("chat.shared.tokens")]})]})})(),e[41]=t.limits,e[42]=l,e[43]=j):j=e[43];let _;e[44]!==t.limits||e[45]!==l?(_=t.limits?.maxOutputTokens&&i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.outputLimit")}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-sm text-foreground",children:[t.limits.maxOutputTokens.toLocaleString()," ",l("chat.shared.tokens")]}),i.jsx("span",{className:"text-sm text-muted-foreground",children:ys(t.limits.maxOutputTokens,l)})]})]}),e[44]=t.limits,e[45]=l,e[46]=_):_=e[46];let I;e[47]!==c||e[48]!==r||e[49]!==l?(I=(c!=null||r!=null)&&(()=>{const{level:x,labelKey:N}=c!=null?js(c):{level:0,labelKey:null};return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("chat.shared.pricing")}),c!=null&&i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"flex items-center",children:[1,2,3,4].map(C=>i.jsx("span",{className:ae("text-sm font-bold leading-none",C<=x?bs[x-1]:"text-muted-foreground/20"),children:"$"},C))}),i.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:N?l(N):""})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[c!=null&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.input")}),i.jsxs("span",{className:"text-xs text-foreground",children:["$",c.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]}),r!=null&&i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("span",{className:"text-xs text-muted-foreground",children:l("chat.shared.output")}),i.jsxs("span",{className:"text-xs text-foreground",children:["$",r.toFixed(2)," / 1M"," ",l("chat.shared.tokens")]})]})]})]})})(),e[47]=c,e[48]=r,e[49]=l,e[50]=I):I=e[50];let P;e[51]!==j||e[52]!==_||e[53]!==I?(P=i.jsxs("div",{className:"flex flex-col gap-6",children:[j,_,I]}),e[51]=j,e[52]=_,e[53]=I,e[54]=P):P=e[54];let w;return e[55]!==P||e[56]!==k||e[57]!==S?(w=i.jsxs("div",{className:"flex flex-col gap-5 py-1 px-1.5",children:[k,S,P]}),e[55]=P,e[56]=k,e[57]=S,e[58]=w):w=e[58],w}function ws(n){return i.jsx(Ns,{capability:n},n)}function Si(n){const e=Q.c(22),{model:t,placeholder:s,isLoading:o}=n,l=o===void 0?!1:o,c=ie();let r;e[0]!==s||e[1]!==c?(r=s??c("chat.shared.selectModel"),e[0]=s,e[1]=c,e[2]=r):r=e[2];const u=r;if(l){let S;return e[3]===Symbol.for("react.memo_cache_sentinel")?(S=i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(ee,{className:"w-5 h-5 rounded-sm shrink-0"}),i.jsx(ee,{className:"w-16 h-3 hidden md:block"})]}),e[3]=S):S=e[3],S}if(!t){let S;e[4]!==u?(S=i.jsx("span",{className:"text-sm text-muted-foreground",children:u}),e[4]=u,e[5]=S):S=e[5];let j;e[6]===Symbol.for("react.memo_cache_sentinel")?(j=i.jsx(Te,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[6]=j):j=e[6];let _;return e[7]!==S?(_=i.jsxs("div",{className:"flex items-center gap-1.5",children:[S,j]}),e[7]=S,e[8]=_):_=e[8],_}let d;e[9]!==t?(d=Ie(t),e[9]=t,e[10]=d):d=e[10];const{displayName:a}=d;let m;e[11]!==t?(m=Ce(t),e[11]=t,e[12]=m):m=e[12];const p=m;let h;e[13]!==t.title||e[14]!==p?(h=i.jsx("img",{src:p,className:"w-3.5 h-3.5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[13]=t.title,e[14]=p,e[15]=h):h=e[15];let f;e[16]!==a?(f=i.jsx("span",{className:"text-sm truncate whitespace-nowrap text-muted-foreground max-w-[100px] sm:max-w-none",children:a}),e[16]=a,e[17]=f):f=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=i.jsx(Te,{size:14,className:"text-muted-foreground opacity-50 shrink-0"}),e[18]=v):v=e[18];let k;return e[19]!==h||e[20]!==f?(k=i.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden",children:[h,f,v]}),e[19]=h,e[20]=f,e[21]=k):k=e[21],k}const _s=["vision","image","file","audio","video"],st=["image/png","image/jpeg","image/gif","image/webp"],it=["application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];function Me(n){const e=n?.capabilities;return e?_s.some(t=>e.includes(t)):!1}function Ni(n,e){if(!n)return!1;if(n.startsWith("text/"))return!0;const t=e?.capabilities??[],s=t.includes("vision")||t.includes("image"),o=t.includes("file"),l=t.includes("audio"),c=t.includes("video");return!!(s&&st.includes(n)||o&&n==="application/pdf"||l&&n.startsWith("audio/")||c&&n.startsWith("video/")||Me(e)&&it.includes(n))}function ki(n){const e=n?.capabilities??[],t=["text/*"];return(e.includes("vision")||e.includes("image"))&&t.push(...st),e.includes("file")&&t.push("application/pdf"),e.includes("audio")&&t.push("audio/*"),e.includes("video")&&t.push("video/*"),Me(n)&&t.push(...it),t.join(",")}function wi(n){const e=n?.capabilities??[],t=[];return(e.includes("vision")||e.includes("image"))&&t.push("chat.shared.fileTypeImages"),e.includes("file")&&t.push("chat.shared.fileTypePdfs"),e.includes("audio")&&t.push("chat.shared.fileTypeAudio"),e.includes("video")&&t.push("chat.shared.fileTypeVideo"),Me(n)&&t.push("chat.shared.fileTypeOffice"),{parts:t,count:t.length}}const nt=["smarter","faster","cheaper"],Cs={smarter:"chat.decopilot.tierSmarter",faster:"chat.decopilot.tierFaster",cheaper:"chat.decopilot.tierCheaper"},Is=[{tier:"smarter",prefixes:["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","openai/gpt-5.3-codex","google/gemini-3-pro","google/gemini-2.5-pro","cohere/command-r-plus","cohere/command-a"]},{tier:"faster",prefixes:["anthropic/claude-haiku-4.5","anthropic/claude-4.5-haiku","google/gemini-3-flash","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast","x-ai/grok-3","mistralai/mistral-large","mistralai/codestral","mistralai/mistral-medium","minimax/minimax-m1"]},{tier:"cheaper",prefixes:["google/gemini-2.5-flash-lite","google/gemini-2.5-flash","google/gemini-2.0-flash","deepseek/deepseek-v3","openai/gpt-oss-120b","mistralai/mistral-small","mistralai/pixtral","cohere/command-r"]}],Ms=Is.flatMap(({tier:n,prefixes:e})=>e.map(t=>({tier:n,prefix:t}))).sort((n,e)=>e.prefix.length-n.prefix.length),Es="google/gemini-2.5-pro",$e=new Map;function Os(n){const e=$e.get(n);if(e!==void 0)return e;let t=null;if(n.endsWith(":free"))t="cheaper";else for(const{tier:s,prefix:o}of Ms)if(n.startsWith(o)){if(o===Es&&n.length>o.length&&n[o.length]==="-"){const c=n[o.length+1];if(!c||!/\d/.test(c))continue}t=s;break}return $e.set(n,t),t}function Ue(n){const e={smarter:[],faster:[],cheaper:[],other:[]};for(const t of n){const s=Os(t.modelId);e[s??"other"].push(t)}for(const t of Object.keys(e))e[t].sort((s,o)=>s.title.localeCompare(o.title));return e}const lt="studio:model-shortlist:",As=new Set(["anthropic/claude-opus-4.8","anthropic/claude-sonnet-4.6","anthropic/claude-4.6-sonnet","anthropic/claude-sonnet-4.6:extended","openai/gpt-5.3-codex","google/gemini-3-pro-preview","google/gemini-2.5-pro","anthropic/claude-haiku-4.5","anthropic/claude-haiku-4.5-20251001","anthropic/claude-4.5-haiku","google/gemini-3-flash-preview","openai/gpt-5.1-codex-mini","x-ai/grok-code-fast-1","google/gemini-2.5-flash","deepseek/deepseek-v3.2","google/gemini-2.5-flash-lite","openai/gpt-oss-120b:free"]);function Ps(n){try{const e=localStorage.getItem(lt+n);return e?new Set(JSON.parse(e)):null}catch{return null}}function Ts(n,e){localStorage.setItem(lt+n,JSON.stringify([...e]))}function Ls(n){const e=Q.c(21),{model:t,onHover:s}=n;let o;e[0]!==t?(o=Ie(t),e[0]=t,e[1]=o):o=e[1];const{displayName:l,provider:c}=o;let r;e[2]!==t?(r=Ce(t),e[2]=t,e[3]=r):r=e[3];const u=r;let d;e[4]!==t||e[5]!==s?(d=()=>s(t),e[4]=t,e[5]=s,e[6]=d):d=e[6];let a;e[7]!==t.title||e[8]!==u?(a=i.jsx("img",{src:u,className:"w-4 h-4 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[7]=t.title,e[8]=u,e[9]=a):a=e[9];let m;e[10]!==l?(m=i.jsx("span",{className:"text-sm text-foreground leading-tight truncate",children:l}),e[10]=l,e[11]=m):m=e[11];let p;e[12]!==c?(p=i.jsx("span",{className:"text-xs text-muted-foreground/60 leading-tight",children:c}),e[12]=c,e[13]=p):p=e[13];let h;e[14]!==m||e[15]!==p?(h=i.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[m,p]}),e[14]=m,e[15]=p,e[16]=h):h=e[16];let f;return e[17]!==d||e[18]!==a||e[19]!==h?(f=i.jsxs("div",{className:"flex items-center gap-2.5 py-2 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:d,children:[a,h]}),e[17]=d,e[18]=a,e[19]=h,e[20]=f):f=e[20],f}function zs(n){const e=Q.c(16),{error:t,onRetry:s}=n,o=ie();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"bg-destructive/10 p-2 rounded-full",children:i.jsx(ht,{className:"size-5 text-destructive"})}),e[0]=l):l=e[0];const c=o("chat.decopilot.failedToLoadModels");let r;e[1]!==c?(r=i.jsx("p",{className:"text-sm font-medium text-foreground",children:c}),e[1]=c,e[2]=r):r=e[2];const u=t?.message||o("chat.decopilot.couldNotFetchModels"),d=" "+o("chat.decopilot.tryAnotherProviderOrRetry");let a;e[3]!==u||e[4]!==d?(a=i.jsxs("p",{className:"text-xs text-muted-foreground max-w-[260px]",children:[u,d]}),e[3]=u,e[4]=d,e[5]=a):a=e[5];let m;e[6]!==r||e[7]!==a?(m=i.jsxs("div",{className:"flex flex-col gap-1",children:[r,a]}),e[6]=r,e[7]=a,e[8]=m):m=e[8];let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(Nt,{className:"size-3.5"}),e[9]=p):p=e[9];const h=o("chat.decopilot.retry");let f;e[10]!==s||e[11]!==h?(f=i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs(re,{variant:"outline",size:"sm",onClick:s,className:"gap-1.5",children:[p,h]})}),e[10]=s,e[11]=h,e[12]=f):f=e[12];let v;return e[13]!==f||e[14]!==m?(v=i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-4 py-8 text-center",children:[l,m,f]}),e[13]=f,e[14]=m,e[15]=v):v=e[15],v}function Fs(){const n=Q.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:6}).map(Rs)}),n[0]=e):e=n[0],e}function Rs(n,e){return i.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[i.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),i.jsx(ee,{className:"flex-1 h-4"}),i.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function Be(n){const e=Q.c(12),{label:t,models:s,onSelect:o,onHover:l}=n;if(s.length===0)return null;let c;e[0]!==t?(c=i.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:t}),e[0]=t,e[1]=c):c=e[1];let r;if(e[2]!==s||e[3]!==l||e[4]!==o){let d;e[6]!==l||e[7]!==o?(d=a=>i.jsx("button",{type:"button",onClick:()=>o(a),onFocus:()=>l(a),className:"w-full text-left cursor-pointer",children:i.jsx(Ls,{model:a,onHover:l})},a.modelId),e[6]=l,e[7]=o,e[8]=d):d=e[8],r=s.map(d),e[2]=s,e[3]=l,e[4]=o,e[5]=r}else r=e[5];let u;return e[9]!==c||e[10]!==r?(u=i.jsxs("div",{children:[c,r]}),e[9]=c,e[10]=r,e[11]=u):u=e[11],u}function Ne(n,e){return e(n==="other"?"chat.decopilot.tierOther":Cs[n])}function Ks(n){const e=Q.c(21),{model:t,isChecked:s,onToggle:o,onHover:l}=n,[c,r]=V.useState(s);c!==s&&r(s);let u;e[0]!==t?(u=Ce(t),e[0]=t,e[1]=u):u=e[1];const d=u;let a;e[2]!==t||e[3]!==l?(a=()=>l(t),e[2]=t,e[3]=l,e[4]=a):a=e[4];let m;e[5]!==t.modelId||e[6]!==o?(m=()=>{r(Ds),o(t.modelId)},e[5]=t.modelId,e[6]=o,e[7]=m):m=e[7];let p;e[8]!==c||e[9]!==m?(p=i.jsx(mt,{checked:c,onCheckedChange:m}),e[8]=c,e[9]=m,e[10]=p):p=e[10];let h;e[11]!==d||e[12]!==t.title?(h=i.jsx("img",{src:d,className:"w-5 h-5 shrink-0 rounded-sm dark:bg-white dark:rounded-sm dark:p-px",alt:t.title}),e[11]=d,e[12]=t.title,e[13]=h):h=e[13];let f;e[14]!==t.title?(f=i.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:t.title}),e[14]=t.title,e[15]=f):f=e[15];let v;return e[16]!==a||e[17]!==p||e[18]!==h||e[19]!==f?(v=i.jsxs("label",{className:"flex items-center gap-3 min-h-8 py-2.5 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:a,children:[p,h,f]}),e[16]=a,e[17]=p,e[18]=h,e[19]=f,e[20]=v):v=e[20],v}function Ds(n){return!n}function $s(n,e){const t=[];for(const s of nt)if(n[s].length>0){t.push({type:"header",label:Ne(s,e)});for(const o of n[s])t.push({type:"model",model:o})}if(n.other.length>0){t.push({type:"header",label:Ne("other",e)});for(const s of n.other)t.push({type:"model",model:s})}return t}function Us({items:n,shortlistSet:e,onToggle:t,onHover:s}){const o=V.useRef(null),l=es({count:n.length,getScrollElement:()=>o.current,estimateSize:c=>n[c]?.type==="header"?36:44,overscan:6});return i.jsx("div",{ref:o,className:"flex-1 overflow-y-auto",children:i.jsx("div",{className:"relative",style:{height:l.getTotalSize()},children:l.getVirtualItems().map(c=>{const r=n[c.index];return r?i.jsx("div",{"data-index":c.index,ref:l.measureElement,className:"absolute left-0 right-0 top-0 px-0.5",style:{transform:`translateY(${c.start}px)`},children:r.type==="header"?i.jsx("div",{className:"text-xs font-medium text-muted-foreground px-3 pt-3 pb-1",children:r.label}):i.jsx(Ks,{model:r.model,isChecked:e.has(r.model.modelId),onToggle:t,onHover:s})},c.key):null})})})}function Bs(n){const e=Q.c(30),{keyId:t,searchTerm:s,onHover:o,onModelSelect:l,managing:c,onToggleManage:r,filterModels:u}=n,d=ie(),{models:a}=wt(t),m=u?a.filter(u):a.filter(Ws);let p;e[0]!==t?(p=()=>(t?Ps(t):null)??As,e[0]=t,e[1]=p):p=e[1];const[h,f]=V.useState(p),[,v]=V.useTransition();let k;e[2]!==t||e[3]!==v?(k=b=>{t&&v(()=>{f(y=>{const E=new Set(y);return E.has(b)?E.delete(b):E.add(b),Ts(t,E),E})})},e[2]=t,e[3]=v,e[4]=k):k=e[4];const S=k,j=s.toLowerCase().trim(),_=b=>j?b.filter(y=>y.title.toLowerCase().includes(j)||y.modelId.toLowerCase().includes(j)):b;if(c){const b=Ue(_(m)),y=$s(b,d);let E;e[5]!==h?(E=R=>h.has(R.modelId),e[5]=h,e[6]=E):E=e[6];const L=m.filter(E).length;let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=i.jsx(Ye,{size:14}),e[7]=T):T=e[7];let O;e[8]!==d?(O=d("chat.decopilot.back"),e[8]=d,e[9]=O):O=e[9];let z;return e[10]!==r||e[11]!==O?(z=i.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground cursor-pointer",children:[T,O]}),e[10]=r,e[11]=O,e[12]=z):z=e[12],i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[z,i.jsx("span",{className:"text-xs text-muted-foreground",children:d("chat.decopilot.selectedCount",{count:L})})]}),i.jsx(Us,{items:y,shortlistSet:h,onToggle:S,onHover:o})]})}let I;e[13]!==h?(I=b=>h.has(b.modelId),e[13]=h,e[14]=I):I=e[14];const P=m.filter(I),w=P.length>0?P:m,x=Ue(_(w));let N;e[15]!==x||e[16]!==o||e[17]!==l||e[18]!==d?(N=nt.map(b=>i.jsx(Be,{label:Ne(b,d),models:x[b],onSelect:l,onHover:o},b)),e[15]=x,e[16]=o,e[17]=l,e[18]=d,e[19]=N):N=e[19];let C;e[20]!==d?(C=Ne("other",d),e[20]=d,e[21]=C):C=e[21];let M;e[22]!==x.other||e[23]!==o||e[24]!==l||e[25]!==C?(M=i.jsx(Be,{label:C,models:x.other,onSelect:l,onHover:o}),e[22]=x.other,e[23]=o,e[24]=l,e[25]=C,e[26]=M):M=e[26];let g;return e[27]!==N||e[28]!==M?(g=i.jsxs("div",{className:"flex-1 overflow-y-auto px-0.5 pt-1 [touch-action:pan-y]",children:[N,M]}),e[27]=N,e[28]=M,e[29]=g):g=e[29],g}function Ws(n){return n.asyncResearch!==!0}function _i(){const n=Q.c(6);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:i.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[i.jsx(ee,{className:"size-4 shrink-0"}),i.jsx(ee,{className:"flex-1 h-6"}),i.jsx(ee,{className:"w-[140px] h-8 shrink-0"})]})}),n[0]=e):e=n[0];let t;n[1]===Symbol.for("react.memo_cache_sentinel")?(t=i.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[420px] md:min-w-[420px] min-h-0 overflow-hidden",children:[e,i.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:Array.from({length:8}).map(Vs)})]}),n[1]=t):t=n[1];let s;n[2]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsx(ee,{className:"size-6 shrink-0"}),i.jsx(ee,{className:"h-6 w-32"})]}),n[2]=s):s=n[2];let o;n[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[s,i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(ee,{className:"h-6 w-20 rounded-md"}),i.jsx(ee,{className:"h-6 w-24 rounded-md"})]})]}),n[3]=o):o=n[3];let l;n[4]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(ee,{className:"h-4 w-24"}),i.jsx(ee,{className:"h-4 w-32"})]}),n[4]=l):l=n[4];let c;return n[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs("div",{className:"flex flex-col md:flex-row h-full sm:h-[460px] min-h-0",children:[t,i.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:i.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[o,i.jsxs("div",{className:"flex flex-col gap-4",children:[l,i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(ee,{className:"h-4 w-16"}),i.jsx(ee,{className:"h-4 w-40"})]})]})]})})]}),n[5]=c):c=n[5],c}function Vs(n,e){return i.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[i.jsx(ee,{className:"size-5 shrink-0 rounded-sm"}),i.jsx(ee,{className:"flex-1 h-4"}),i.jsx(ee,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function ot(n){const e=Q.c(66),{onClose:t,credentialId:s,onCredentialChange:o,selectedModel:l,onModelChange:c,filterModels:r,compact:u}=n,d=ie(),[a,m]=V.useState(null),[p,h]=V.useState(""),[f,v]=V.useState(!1),k=_e(),S=kt();let j;e[0]!==k?.providers?(j=Object.fromEntries((k?.providers??[]).map(Ys)),e[0]=k?.providers,e[1]=j):j=e[1];const _=j,I=dt(),{org:P}=ge();let w;e[2]!==o?(w=A=>{o(A),m(null)},e[2]=o,e[3]=w):w=e[3];const x=w;let N;e[4]!==s||e[5]!==t||e[6]!==c?(N=A=>{s&&(c(A),h(""),t())},e[4]=s,e[5]=t,e[6]=c,e[7]=N):N=e[7];const C=N;if(S.length===0){const A=!u&&"sm:w-[740px]";let K;e[8]!==A?(K=ae("flex items-center justify-center p-8 w-full",A),e[8]=A,e[9]=K):K=e[9];let U;e[10]===Symbol.for("react.memo_cache_sentinel")?(U=i.jsx(xs,{}),e[10]=U):U=e[10];let q;return e[11]!==K?(q=i.jsx("div",{className:K,children:U}),e[11]=K,e[12]=q):q=e[12],q}const M=u?"sm:h-[420px]":"sm:h-[460px]";let g;e[13]!==M?(g=ae("flex flex-col md:flex-row h-full min-h-0",M),e[13]=M,e[14]=g):g=e[14];const b=u?"w-full":"md:border-r md:w-[420px] md:min-w-[420px]";let y;e[15]!==b?(y=ae("flex-1 flex flex-col min-h-0 overflow-hidden",b),e[15]=b,e[16]=y):y=e[16];let E;e[17]===Symbol.for("react.memo_cache_sentinel")?(E=i.jsx(Xe,{size:16,className:"text-muted-foreground shrink-0"}),e[17]=E):E=e[17];let L;e[18]!==f||e[19]!==d?(L=d(f?"chat.decopilot.searchAllModels":"chat.decopilot.searchForModel"),e[18]=f,e[19]=d,e[20]=L):L=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T=A=>h(A.target.value),e[21]=T):T=e[21];let O;e[22]!==p||e[23]!==L?(O=i.jsx(xe,{autoFocus:!0,type:"text",placeholder:L,value:p,onChange:T,className:"flex-1 min-w-0 border-0 !shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[22]=p,e[23]=L,e[24]=O):O=e[24];let z;e[25]!==s||e[26]!==x||e[27]!==S||e[28]!==_||e[29]!==d?(z=S.length>0&&i.jsxs(ft,{value:s??"",onValueChange:x,children:[i.jsxs(pt,{size:"sm",className:"w-auto max-w-[140px] h-8 shrink-0 gap-1.5 px-2 [&>svg:last-child]:hidden",onClick:qs,children:[i.jsx(xt,{placeholder:d("chat.decopilot.key"),children:(()=>{const A=S.find(te=>te.id===s),K=A?_[A.providerId]:void 0,U=ye(A?.presetId),q=U?.logo??K?.logo,Z=U?.name??K?.name??A?.providerId??"Key";return i.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[q?i.jsx("img",{src:q,alt:Z,className:"w-4 h-4 rounded shrink-0 dark:bg-white dark:rounded-sm dark:p-px"}):i.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary shrink-0",children:Z.slice(0,1).toUpperCase()}),i.jsx("span",{className:"text-xs truncate",children:Z})]})})()}),i.jsx(bt,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),i.jsx(gt,{children:S.map(A=>{const K=_[A.providerId],U=ye(A.presetId),q=U?.logo??K?.logo,Z=U?.name??K?.name??A.providerId;return i.jsx(vt,{value:A.id,children:i.jsxs("div",{className:"flex items-center gap-2",children:[q?i.jsx("img",{src:q,alt:Z,className:"w-4 h-4 rounded dark:bg-white dark:rounded-sm dark:p-px"}):i.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:Z.slice(0,1).toUpperCase()}),i.jsxs("span",{children:[Z," — ",A.label]})]})},A.id)})})]}),e[25]=s,e[26]=x,e[27]=S,e[28]=_,e[29]=d,e[30]=z):z=e[30];let R;e[31]!==O||e[32]!==z?(R=i.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:i.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 pr-12 md:pr-4 cursor-text",children:[E,O,z]})}),e[31]=O,e[32]=z,e[33]=R):R=e[33];let F;e[34]!==s?(F=A=>{const{error:K,resetError:U}=A;return i.jsx(zs,{error:K,onRetry:U,credentialId:s??void 0})},e[34]=s,e[35]=F):F=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=i.jsx(Fs,{}),e[36]=Y):Y=e[36];const X=s??void 0;let B;e[37]===Symbol.for("react.memo_cache_sentinel")?(B=()=>v(Hs),e[37]=B):B=e[37];let H;e[38]!==r||e[39]!==C||e[40]!==f||e[41]!==p||e[42]!==X?(H=i.jsx(V.Suspense,{fallback:Y,children:i.jsx(Bs,{keyId:X,searchTerm:p,onHover:m,onModelSelect:C,managing:f,onToggleManage:B,filterModels:r})}),e[38]=r,e[39]=C,e[40]=f,e[41]=p,e[42]=X,e[43]=H):H=e[43];let W;e[44]!==s||e[45]!==F||e[46]!==H?(W=i.jsx(ut,{fallback:F,children:H},s),e[44]=s,e[45]=F,e[46]=H,e[47]=W):W=e[47];let J;e[48]!==f||e[49]!==I||e[50]!==P||e[51]!==d?(J=!f&&i.jsxs("div",{className:"border-t border-border flex",children:[i.jsxs("button",{type:"button",onClick:()=>V.startTransition(()=>v(!0)),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[i.jsx(St,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageModels")]}),i.jsx("div",{className:"w-px bg-border shrink-0"}),i.jsxs("button",{type:"button",onClick:()=>I({to:"/$org/settings/ai-providers",params:{org:P.slug}}),className:"flex items-center gap-2 flex-1 px-4 py-2.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent cursor-pointer",children:[i.jsx(yt,{className:"size-3.5 shrink-0"}),d("chat.decopilot.manageApiKeys")]})]}),e[48]=f,e[49]=I,e[50]=P,e[51]=d,e[52]=J):J=e[52];let D;e[53]!==R||e[54]!==W||e[55]!==J||e[56]!==y?(D=i.jsxs("div",{className:y,children:[R,W,J]}),e[53]=R,e[54]=W,e[55]=J,e[56]=y,e[57]=D):D=e[57];let $;e[58]!==u||e[59]!==a||e[60]!==l?($=!u&&i.jsx("div",{className:"hidden md:flex md:flex-col md:w-[320px] md:shrink-0 p-3",children:i.jsx(ks,{model:a??l??null})}),e[58]=u,e[59]=a,e[60]=l,e[61]=$):$=e[61];let G;return e[62]!==D||e[63]!==$||e[64]!==g?(G=i.jsxs("div",{className:g,children:[D,$]}),e[62]=D,e[63]=$,e[64]=g,e[65]=G):G=e[65],G}function Hs(n){return!n}function qs(n){return n.stopPropagation()}function Ys(n){return[n.id,n]}function Gs(n){const e=Q.c(12),{onClose:t}=n,{credentialId:s,setCredentialId:o,selectedModel:l,setModel:c}=_t();let r;e[0]!==o?(r=a=>{ne("chat_credential_changed",{credential_id:a}),o(a)},e[0]=o,e[1]=r):r=e[1];let u;e[2]!==s||e[3]!==l?.modelId||e[4]!==c?(u=a=>{s&&(ne("chat_model_changed",{from_model_id:l?.modelId??null,to_model_id:a.modelId,to_model_provider:a.providerId??null,credential_id:s}),c({...a,keyId:s}))},e[2]=s,e[3]=l?.modelId,e[4]=c,e[5]=u):u=e[5];let d;return e[6]!==s||e[7]!==t||e[8]!==l||e[9]!==r||e[10]!==u?(d=i.jsx(ot,{onClose:t,credentialId:s,onCredentialChange:r,selectedModel:l,onModelChange:u}),e[6]=s,e[7]=t,e[8]=l,e[9]=r,e[10]=u,e[11]=d):d=e[11],d}function Xs(n){const e=Q.c(2),{onClose:t}=n;let s;return e[0]!==t?(s=i.jsx(Gs,{onClose:t}),e[0]=t,e[1]=s):s=e[1],s}function Qs(n){const e=Q.c(2);let t;return e[0]!==n?(t=i.jsx(ot,{...n}),e[0]=n,e[1]=t):t=e[1],t}function Ci(n){const e=Q.c(2),{onClose:t}=n;let s;return e[0]!==t?(s=i.jsx(Xs,{onClose:t}),e[0]=t,e[1]=s):s=e[1],s}function Ii(n){const e=Q.c(4);let t;e[0]!==n?({...t}=n,e[0]=n,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(Qs,{...t}),e[2]=t,e[3]=s):s=e[3],s}export{hs as C,Ii as M,xs as N,tt as P,Si as S,_i as a,wi as b,Ci as c,ye as d,ki as g,Ni as i,Me as m};
@@ -1 +1 @@
1
- import{cG as _}from"./index-6GXqHE0w.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
1
+ import{cG as _}from"./index-B3yBTWEk.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};