decocms 4.508.5 → 4.509.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 (382) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-hXW1kRcE.js → ActiveShapeUtils-BXDRD_Kb.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-D-2plD68.js → AlertCircle-DahXyAVP.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CLSR0bTN.js → AreaChart-Ck3zIQtR.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-H_5A5Gr5.js → ArrowLeft-DhEv8Brb.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D7-4gYyo.js → ArrowUp-BtwUXzUq.js} +1 -1
  6. package/dist/client/assets/{BarChart-BXhJ7fMZ.js → BarChart-DABQXmtk.js} +1 -1
  7. package/dist/client/assets/{Building02-Ctqbg0eK.js → Building02-BXXzFFFu.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-BeIwja-9.js → CategoricalChart-IWO4IrBB.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BCSEWiqx.js → CheckCircle-DQWHbSdB.js} +1 -1
  10. package/dist/client/assets/{ChevronSelectorVertical-D_0iGG6d.js → ChevronSelectorVertical-fr0U0iWC.js} +1 -1
  11. package/dist/client/assets/{ChevronUp-CZwSTYLx.js → ChevronUp-BDGWe90X.js} +1 -1
  12. package/dist/client/assets/{Copy01-CJKub2_o.js → Copy01--nUw7Bkt.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-DD9EJ9xU.js → CreditCard01-DucLeUqU.js} +1 -1
  14. package/dist/client/assets/{DotsVertical-Mertu_bp.js → DotsVertical-CbSs5p_8.js} +1 -1
  15. package/dist/client/assets/{ErrorBarContext-B0YkPhgE.js → ErrorBarContext-WH7XJfon.js} +1 -1
  16. package/dist/client/assets/{Globe04-_fp1uYqG.js → Globe04-D97qZmfR.js} +1 -1
  17. package/dist/client/assets/{Image01-CMp-2bfg.js → Image01-CnYFBoF2.js} +1 -1
  18. package/dist/client/assets/{Key01-B3dXN-Y7.js → Key01-De3w1Z8c.js} +1 -1
  19. package/dist/client/assets/{Link01-DPKsL39W.js → Link01-D8741jKt.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-MgsRpWo_.js → LinkBroken01-Td7XUgIR.js} +1 -1
  21. package/dist/client/assets/{Monitor01-B-njRpwx.js → Monitor01-iXRq_BRo.js} +1 -1
  22. package/dist/client/assets/{Play-yJIE0YnV.js → Play-D33JURoh.js} +1 -1
  23. package/dist/client/assets/{Plus-D1ujaH4P.js → Plus-DGYbX9gS.js} +1 -1
  24. package/dist/client/assets/{SearchMd-CvTMXZGD.js → SearchMd-COO_vo_G.js} +1 -1
  25. package/dist/client/assets/{Sector-B2G9aCqg.js → Sector-DyJZXvkl.js} +1 -1
  26. package/dist/client/assets/{ShoppingBag01-P4qRpuf7.js → ShoppingBag01-77wosjDB.js} +1 -1
  27. package/dist/client/assets/{Sun-BO4JpKlT.js → Sun-DeoRX0vn.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-GtnLThsz.js → SwitchHorizontal01-BkM0p0t8.js} +1 -1
  29. package/dist/client/assets/{Tool01-wa7smXXA.js → Tool01-DDJCqOS5.js} +1 -1
  30. package/dist/client/assets/{Trash01-ChpqYbJ5.js → Trash01-mIeseU4c.js} +1 -1
  31. package/dist/client/assets/{Upload01-BS2FlEXW.js → Upload01-Qu0NG2Hb.js} +1 -1
  32. package/dist/client/assets/{User01-BxtEyOFP.js → User01-CaKkJjqE.js} +1 -1
  33. package/dist/client/assets/{UserSquare-BXbZgf1v.js → UserSquare-BnEG1vAj.js} +1 -1
  34. package/dist/client/assets/{Users01-fW9b6DmN.js → Users01-D_oPvcgd.js} +1 -1
  35. package/dist/client/assets/{XAxis-CiK4FE53.js → XAxis-dPLaQ_s-.js} +1 -1
  36. package/dist/client/assets/{XClose-o28PhQrm.js → XClose-Cwc6SpBI.js} +1 -1
  37. package/dist/client/assets/{ZoomOut-DilnRbYe.js → ZoomOut-D9qcy1LI.js} +1 -1
  38. package/dist/client/assets/{access-gate-DjCsf0Fn.js → access-gate-CPPlMbo5.js} +1 -1
  39. package/dist/client/assets/{add-connection-dialog-Dd0MPW8q.js → add-connection-dialog-DRWjeuc5.js} +1 -1
  40. package/dist/client/assets/{agent-analytics-De-Il6xG.js → agent-analytics-Nb0HrH5Z.js} +1 -1
  41. package/dist/client/assets/agent-app-B2qSL9oc.js +1 -0
  42. package/dist/client/assets/{agent-assets-DoGxTSQf.js → agent-assets-C6w2i-hY.js} +1 -1
  43. package/dist/client/assets/{agent-automation-CWZ5MU2M.js → agent-automation-bHzv4XqG.js} +1 -1
  44. package/dist/client/assets/{agent-automations-BrZnB64u.js → agent-automations-D9UDzD1A.js} +1 -1
  45. package/dist/client/assets/{agent-connect-sources-BGnBcpqN.js → agent-connect-sources-D7aP2elw.js} +1 -1
  46. package/dist/client/assets/agent-deck-DDotN0AT.js +1 -0
  47. package/dist/client/assets/{agent-e2e-CObdKEhh.js → agent-e2e-DtqeqzHL.js} +1 -1
  48. package/dist/client/assets/{agent-experiments-BnrLrWAI.js → agent-experiments-BR5nrOOp.js} +1 -1
  49. package/dist/client/assets/{agent-file-BKf5W0N3.js → agent-file-_7o0XBSa.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-TclQ-hec.js → agent-hosting-0ei8QAsk.js} +1 -1
  51. package/dist/client/assets/{agent-icon-2gpOTQkx.js → agent-icon-BoeBuKNE.js} +1 -1
  52. package/dist/client/assets/agent-library-C27Vz_hh.js +1 -0
  53. package/dist/client/assets/agent-library-file-CYLUWoyo.js +1 -0
  54. package/dist/client/assets/{agent-monitor-CT2I8Nss.js → agent-monitor-BuJjWZ4Q.js} +1 -1
  55. package/dist/client/assets/{agent-overview-B533nx0V.js → agent-overview-Cv7ZnB3O.js} +1 -1
  56. package/dist/client/assets/{agent-releases-V0JuDV2R.js → agent-releases-D7f8eR_p.js} +1 -1
  57. package/dist/client/assets/agent-settings-mQZHtZBC.js +1 -0
  58. package/dist/client/assets/{agent-site-editor-hrhFNpsc.js → agent-site-editor-CM-uyUVN.js} +1 -1
  59. package/dist/client/assets/agent-site-editor-code-5LnggK5j.js +2 -0
  60. package/dist/client/assets/agent-site-editor-content-Bii6lvtx.js +1 -0
  61. package/dist/client/assets/agent-site-editor-preview-D3Z1UwWS.js +1 -0
  62. package/dist/client/assets/agent-view-CwhdhHZO.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-DeUqKRVd.js → agent-view-guard-mT_xWeY_.js} +1 -1
  64. package/dist/client/assets/{agents-list-D52MXlei.js → agents-list-CWC6MInt.js} +1 -1
  65. package/dist/client/assets/{ai-providers-d1tex92N.js → ai-providers-C19LEVID.js} +1 -1
  66. package/dist/client/assets/{alert-DdIEyN02.js → alert-CDan7S6Z.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-7mrPWx4-.js → alert-dialog-DYJD4QnY.js} +1 -1
  68. package/dist/client/assets/{analytics-sections-x64NA-v9.js → analytics-sections-BfRzRbCg.js} +1 -1
  69. package/dist/client/assets/{api-keys-DDiOk1xU.js → api-keys-D2UISU63.js} +1 -1
  70. package/dist/client/assets/api-keys-Di5U5myY.js +1 -0
  71. package/dist/client/assets/{app-editor-BVC_i6D9.js → app-editor-DIZmBZpP.js} +1 -1
  72. package/dist/client/assets/{asset-utils-DTmB3p5M.js → asset-utils-DS09SEqB.js} +1 -1
  73. package/dist/client/assets/{auth-51drWU9x.js → auth-BmkbjTIT.js} +1 -1
  74. package/dist/client/assets/{auth-catchall-BA7lTAD6.js → auth-catchall-Bzvb9awD.js} +1 -1
  75. package/dist/client/assets/{auth-entry-BIPEnVhH.js → auth-entry-BwdGUEFH.js} +1 -1
  76. package/dist/client/assets/{auth-split-layout-2tsdGI-Y.js → auth-split-layout-DAgFhymt.js} +1 -1
  77. package/dist/client/assets/{authenticate-and-persist-oauth-BObXpjW7.js → authenticate-and-persist-oauth-Ze4JtB7Z.js} +1 -1
  78. package/dist/client/assets/{automation-list-row-DvE0Tb6_.js → automation-list-row-Bg4MdgHM.js} +1 -1
  79. package/dist/client/assets/{automation-runs-BrvXp5xI.js → automation-runs-svq9BzA3.js} +1 -1
  80. package/dist/client/assets/{automations-5OwoHi29.js → automations-jZo-B4sp.js} +1 -1
  81. package/dist/client/assets/{autosend-bCA2jLWu.js → autosend-CnbTsArw.js} +1 -1
  82. package/dist/client/assets/{avatar-DxU_Qfsb.js → avatar-Dmj5HWBE.js} +1 -1
  83. package/dist/client/assets/{badge-bf_kmzeT.js → badge-immHUAWH.js} +1 -1
  84. package/dist/client/assets/{block-document-8kF3JQ6O.js → block-document-D6gKano6.js} +1 -1
  85. package/dist/client/assets/{blocks-preview-workspace-context-CsrNXYdY.js → blocks-preview-workspace-context-Cezj7GYR.js} +1 -1
  86. package/dist/client/assets/{blocks-tab-states-DPEM7Om6.js → blocks-tab-states-DCHA2WOp.js} +3 -3
  87. package/dist/client/assets/{blog-schema-BAVY2dFM.js → blog-schema-BIiCcoze.js} +1 -1
  88. package/dist/client/assets/{board-analytics-CTT1q3_p.js → board-analytics-B8p782R5.js} +1 -1
  89. package/dist/client/assets/{buckets-a91CXckh.js → buckets-BI0ldLX0.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-DTR8hwq6.js → build-improve-prompt-doc-BoaUmUhj.js} +1 -1
  91. package/dist/client/assets/{calendar-DUMOgysv.js → calendar-CRF7p67d.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-u2H-eGao.js → capability-load-error-DO7kCx-s.js} +1 -1
  93. package/dist/client/assets/{category-editor--4-w2BwN.js → category-editor-C6bBb5Vn.js} +1 -1
  94. package/dist/client/assets/{chart-7wylDbu4.js → chart-K4c5R1FG.js} +1 -1
  95. package/dist/client/assets/{chat-context-B0Aat-dR.js → chat-context-rrAFSxTj.js} +1 -1
  96. package/dist/client/assets/{chat-draft-N_2yWfLy.js → chat-draft-Bwa3MWgo.js} +1 -1
  97. package/dist/client/assets/{checkbox-B2OkH7HB.js → checkbox-uF4YjfhT.js} +1 -1
  98. package/dist/client/assets/{choose-editor-CQg71sPP.js → choose-editor-DYw4ub5x.js} +1 -1
  99. package/dist/client/assets/{cli-auth-success-zCnuKimC.js → cli-auth-success-V1WPEpuO.js} +1 -1
  100. package/dist/client/assets/{client-icons-D4oQWiPN.js → client-icons-DNIlaWXl.js} +1 -1
  101. package/dist/client/assets/cms-settings-editor-Bz3KyZn7.js +1 -0
  102. package/dist/client/assets/{collapsible-CThwzxzb.js → collapsible--AfpE5go.js} +1 -1
  103. package/dist/client/assets/{collection-detail-gNhr9yke.js → collection-detail-9UHByug3.js} +1 -1
  104. package/dist/client/assets/{collection-display-button-B8Suk1kH.js → collection-display-button-LMAfjLFG.js} +1 -1
  105. package/dist/client/assets/{collection-search-B9NRCuDt.js → collection-search-CPxmcakk.js} +1 -1
  106. package/dist/client/assets/{collection-table-wrapper-BAHMyRqv.js → collection-table-wrapper-o2xqaLhj.js} +1 -1
  107. package/dist/client/assets/{collection-tabs-DP6T5Wck.js → collection-tabs-DegnmUnF.js} +1 -1
  108. package/dist/client/assets/{column-rules-BaqH9XB-.js → column-rules-CKnNbyhE.js} +1 -1
  109. package/dist/client/assets/{combobox-BM_yhrFm.js → combobox-BpeKD1mn.js} +1 -1
  110. package/dist/client/assets/{command-CnIYQTfR.js → command-Chzo6Cke.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-nfEMwDNI.js → companion-mcps-section-Bddc-iNh.js} +1 -1
  112. package/dist/client/assets/config-CRQVbMEt.js +1 -0
  113. package/dist/client/assets/{connect-47hq8W-H.js → connect-D9lRnIuC.js} +1 -1
  114. package/dist/client/assets/{connect-layout-CfwS1zDx.js → connect-layout-BVB4H_8u.js} +1 -1
  115. package/dist/client/assets/{connection-CGdx0xOO.js → connection-DTZxpsQt.js} +1 -1
  116. package/dist/client/assets/{connection-card-C_kbWssc.js → connection-card-0mJkScEF.js} +1 -1
  117. package/dist/client/assets/{connection-detail-DM5963sl.js → connection-detail-D7-yp5Ev.js} +1 -1
  118. package/dist/client/assets/{connection-form-helpers-DJWBYTHW.js → connection-form-helpers-i14UVHFH.js} +1 -1
  119. package/dist/client/assets/{connections-B-pHjJlQ.js → connections-DdTsKfHq.js} +1 -1
  120. package/dist/client/assets/{content-tab-DD2BJqrE.js → content-tab-7vnFy3YT.js} +3 -3
  121. package/dist/client/assets/{context-D8rXihjF.js → context-D6nhNoNB.js} +1 -1
  122. package/dist/client/assets/{context-menu-CZl6VIdy.js → context-menu-4j4tHFq_.js} +1 -1
  123. package/dist/client/assets/{core.esm-D4GiYu9N.js → core.esm-DRhkSXSs.js} +1 -1
  124. package/dist/client/assets/{create-organization-dialog-J8HBVqct.js → create-organization-dialog-CYelX0XL.js} +1 -1
  125. package/dist/client/assets/{daily-pulse-DveAzfRl.js → daily-pulse-YX7XoVIO.js} +1 -1
  126. package/dist/client/assets/{discover-Bg9vo-Lm.js → discover-BEidOuNM.js} +1 -1
  127. package/dist/client/assets/{domain-settings-Dvm1qyJQ.js → domain-settings-CFX7bt8N.js} +1 -1
  128. package/dist/client/assets/{drawer-CDiz76QL.js → drawer-E-YtUU5Z.js} +1 -1
  129. package/dist/client/assets/{editor-DJi6FAMO.js → editor-RC0haEQH.js} +1 -1
  130. package/dist/client/assets/{editor-classes-OhEF-7rB.js → editor-classes-yn_rxE9_.js} +1 -1
  131. package/dist/client/assets/{empty-state-Dle2RfPB.js → empty-state-DuFAzlGV.js} +1 -1
  132. package/dist/client/assets/{empty-state-GDp-FJ53.js → empty-state-KyjcIuIc.js} +1 -1
  133. package/dist/client/assets/{extract-connection-data-BAC9aj1c.js → extract-connection-data-BTyrbYGa.js} +1 -1
  134. package/dist/client/assets/{feature-gate-CVXAPW36.js → feature-gate-B_1YF4S7.js} +1 -1
  135. package/dist/client/assets/{feature-paywall-Cnhhg7Eu.js → feature-paywall-Dt-F60U6.js} +1 -1
  136. package/dist/client/assets/{file-explorer-BVuD67U0.js → file-explorer-DncbYvHY.js} +1 -1
  137. package/dist/client/assets/{file-preview-BSboogEn.js → file-preview-C4f2If4C.js} +1 -1
  138. package/dist/client/assets/{file-share-button-Bsxyt6H1.js → file-share-button-BfwFwrIq.js} +1 -1
  139. package/dist/client/assets/{file-type-icon-B_xAgef1.js → file-type-icon-BLPYW-jR.js} +1 -1
  140. package/dist/client/assets/flat-project--v2Mbmfa.js +1 -0
  141. package/dist/client/assets/{folder-icon-CUh2Y0uc.js → folder-icon-Owh7PMLU.js} +1 -1
  142. package/dist/client/assets/{form-B3JjDNl0.js → form-CGraaEAE.js} +1 -1
  143. package/dist/client/assets/{general-DGkVuhtY.js → general-B8kjKLNB.js} +1 -1
  144. package/dist/client/assets/{home-B2Vohx6Q.js → home-Dx1t2Khy.js} +1 -1
  145. package/dist/client/assets/{hosted-publish-feedback-L1KjD-PZ.js → hosted-publish-feedback-Cwu2Dq_h.js} +1 -1
  146. package/dist/client/assets/{icon-button-CO6DPeSm.js → icon-button-DzQcGwuH.js} +1 -1
  147. package/dist/client/assets/{index-DfWUjlnd.js → index-6ugH9LLC.js} +1 -1
  148. package/dist/client/assets/{index-nI8IxwWQ.js → index-B0kSzh8i.js} +1 -1
  149. package/dist/client/assets/{index-Dtdlaxf0.js → index-B8bjocUj.js} +1 -1
  150. package/dist/client/assets/{index-vINK1DyA.js → index-C0hkRsN1.js} +1 -1
  151. package/dist/client/assets/{index-ChzmwfRS.js → index-Cm1qyBQK.js} +1 -1
  152. package/dist/client/assets/index-Cyt4kGm3.js +81 -0
  153. package/dist/client/assets/{index-XwYm4B4Q.js → index-D1wK1rEb.js} +1 -1
  154. package/dist/client/assets/{index-CT-xO5mU.js → index-DjeyX30Y.js} +31 -31
  155. package/dist/client/assets/{index-Vwji1Kz7.js → index-Dq2Ct6xz.js} +1 -1
  156. package/dist/client/assets/{index-D1ebKbYg.js → index-DzRPrtcp.js} +1 -1
  157. package/dist/client/assets/{index-DZv1G8tY.js → index-JzMEORR7.js} +1 -1
  158. package/dist/client/assets/{index-Cwl4zuYK.js → index-OKHpYAkN.js} +1 -1
  159. package/dist/client/assets/{index-CE9tu-r6.js → index-g2Ln0Y-8.js} +1 -1
  160. package/dist/client/assets/{index-ORNG9QCn.js → index-kYoyh7tP.js} +1 -1
  161. package/dist/client/assets/{index-BsNqCvYj.js → index-pzoXR2-o.js} +1 -1
  162. package/dist/client/assets/{index-redirect-DvHCeECh.js → index-redirect-qrvoNgUJ.js} +1 -1
  163. package/dist/client/assets/{infiniteQueryObserver-etTNdPT4.js → infiniteQueryObserver-xRaoCF8T.js} +1 -1
  164. package/dist/client/assets/{infra-billing-BkykIyAX.js → infra-billing-OlN7szns.js} +1 -1
  165. package/dist/client/assets/{input-CQAcg-xS.js → input-Cy31fgjy.js} +3 -3
  166. package/dist/client/assets/{input-76YEArNF.js → input-bijwqhpk.js} +1 -1
  167. package/dist/client/assets/{integration-icon-BObA6Fjt.js → integration-icon-D_TcwvU-.js} +1 -1
  168. package/dist/client/assets/{jira-icon-9vq_h9FR.js → jira-icon-BGjUPAaC.js} +1 -1
  169. package/dist/client/assets/{label-BrluvNII.js → label-CYvkczUc.js} +1 -1
  170. package/dist/client/assets/{layout-eAQRyL4D.js → layout-DFmoYAPP.js} +1 -1
  171. package/dist/client/assets/{legacy-agents-deep-muRDdXJB.js → legacy-agents-deep-B1uAmBP6.js} +1 -1
  172. package/dist/client/assets/{legacy-main-redirect-DGsPfjOd.js → legacy-main-redirect-BJIaLbHQ.js} +1 -1
  173. package/dist/client/assets/library-D4ZRZPVd.js +1 -0
  174. package/dist/client/assets/{library-tab-D9ChwWUA.js → library-tab-BOLOjdKv.js} +1 -1
  175. package/dist/client/assets/{login-CEaB1wc8.js → login-aAtYURyn.js} +1 -1
  176. package/dist/client/assets/{markdown-nbU4fZeV.js → markdown-c54w-PBR.js} +1 -1
  177. package/dist/client/assets/{mcp-app-renderer-DtaX8HKa.js → mcp-app-renderer-DzUa0fqQ.js} +1 -1
  178. package/dist/client/assets/{mcp-oauth-CvxcEkO0.js → mcp-oauth-BJIzp1EQ.js} +1 -1
  179. package/dist/client/assets/{mcp-oauth-CybeVIZU.js → mcp-oauth-l-3wO0u2.js} +1 -1
  180. package/dist/client/assets/{members-Dz48oPpV.js → members-Bm_dXN3q.js} +1 -1
  181. package/dist/client/assets/{memory-CGUcSvZe.js → memory-CTLW_5ha.js} +1 -1
  182. package/dist/client/assets/{mini-report-page-BxlPdKbE.js → mini-report-page-DgZoblky.js} +1 -1
  183. package/dist/client/assets/{mock-board-CS00U3gT.js → mock-board-wZ9eyEn0.js} +1 -1
  184. package/dist/client/assets/{monaco-editor-ODYkz4CG.js → monaco-editor-AjJjPJFH.js} +1 -1
  185. package/dist/client/assets/{monitoring-stats-row-D7qZPBXm.js → monitoring-stats-row-C1FgUwoY.js} +1 -1
  186. package/dist/client/assets/{multi-select-Bi228wk1.js → multi-select-CeQsu_AX.js} +1 -1
  187. package/dist/client/assets/{mustache-CkqnHD0g.js → mustache-C3q0PlLG.js} +1 -1
  188. package/dist/client/assets/{new-project-dialog-7kQTdhST.js → new-project-dialog-CzCoTy3M.js} +1 -1
  189. package/dist/client/assets/{oauth-callback-ai-provider-DN7XzrLe.js → oauth-callback-ai-provider-CavLmaDk.js} +1 -1
  190. package/dist/client/assets/{oauth-callback-Ckd2uxM1.js → oauth-callback-faM6kHoM.js} +1 -1
  191. package/dist/client/assets/{onboarding-DEEDxZr0.js → onboarding--HTHFBjf.js} +1 -1
  192. package/dist/client/assets/{openai-conversation-CljoGEp6.js → openai-conversation-IjaByevn.js} +1 -1
  193. package/dist/client/assets/{optimistic-project-sidebar-views-BUIwO7EF.js → optimistic-project-sidebar-views-BLXripGn.js} +1 -1
  194. package/dist/client/assets/order-monitor-day-0QgbwowT.js +1 -0
  195. package/dist/client/assets/{organization-choice-Dhrc9AXA.js → organization-choice-BH8z7D14.js} +1 -1
  196. package/dist/client/assets/{orgs-DqV5tPQQ.js → orgs-Cd8IzfNg.js} +1 -1
  197. package/dist/client/assets/{page-seo-form-DmMCQKDa.js → page-seo-form-Blbhh5CI.js} +1 -1
  198. package/dist/client/assets/{pair-hGCBj6Bf.js → pair-B6zSQFD4.js} +1 -1
  199. package/dist/client/assets/{plan-ladder-wuxoEN_M.js → plan-ladder-CJm-5l4g.js} +1 -1
  200. package/dist/client/assets/{popover-Dl582i02.js → popover-DkAu8oBQ.js} +1 -1
  201. package/dist/client/assets/{post-calendar-anXdgj_D.js → post-calendar-DtI-lv3J.js} +1 -1
  202. package/dist/client/assets/{post-editor-CRAxNzps.js → post-editor-DsYvI5UU.js} +1 -1
  203. package/dist/client/assets/{preview-content-BOom7IQb.js → preview-content-D72q-FTE.js} +1 -1
  204. package/dist/client/assets/{preview-dialog-RgHQnlrS.js → preview-dialog-DvZXsyEM.js} +1 -1
  205. package/dist/client/assets/{preview-panel-DVGy_q7c.js → preview-panel-Ds2TdctL.js} +1 -1
  206. package/dist/client/assets/{preview-tab-CpfWq70w.js → preview-tab-C5lDvsj-.js} +3 -3
  207. package/dist/client/assets/{product-picker-dialog-O3J75hti.js → product-picker-dialog-Cq4kY83j.js} +1 -1
  208. package/dist/client/assets/{profile-D9R1xPjc.js → profile-Cd1NVkWe.js} +1 -1
  209. package/dist/client/assets/{project-app-view-UiyiJ74V.js → project-app-view-C0FjKFlG.js} +1 -1
  210. package/dist/client/assets/{project-feed-D8Lw9t8m.js → project-feed-DyssmNVT.js} +1 -1
  211. package/dist/client/assets/{project-icon-BnNtl5g5.js → project-icon-BTJptOhj.js} +1 -1
  212. package/dist/client/assets/project-reports-PoqU8cmr.js +1 -0
  213. package/dist/client/assets/project-tasks--h66ZBfo.js +1 -0
  214. package/dist/client/assets/{projects-BTJqRyn4.js → projects-23Pc0s1a.js} +1 -1
  215. package/dist/client/assets/{projects-empty-state-CmDeezno.js → projects-empty-state-V728nY_w.js} +1 -1
  216. package/dist/client/assets/{prompts-C5zrM2Gd.js → prompts-nWEdazrj.js} +1 -1
  217. package/dist/client/assets/record-editor-tRleK8Fx.js +1 -0
  218. package/dist/client/assets/{redirect-editor-BIykewpN.js → redirect-editor-Bkhc0Rz5.js} +1 -1
  219. package/dist/client/assets/reports-B0yI1lG7.js +1 -0
  220. package/dist/client/assets/{reports-CiWmlzUJ.js → reports-BXtM5enn.js} +1 -1
  221. package/dist/client/assets/{reports-onboarding-bzLvsSIR.js → reports-onboarding-CX0lDqiN.js} +1 -1
  222. package/dist/client/assets/{reports-tab-DRs7zEuP.js → reports-tab-DXqCM1YP.js} +2 -2
  223. package/dist/client/assets/{repositories-b_fQzdNU.js → repositories-C7pC7wW7.js} +1 -1
  224. package/dist/client/assets/{repository-binding-D6iSPygW.js → repository-binding-CxxK4zqI.js} +1 -1
  225. package/dist/client/assets/{repository-import-picker-Cq7RkZz7.js → repository-import-picker-B9K3XzJv.js} +1 -1
  226. package/dist/client/assets/{repository-picker-DP_aC1SX.js → repository-picker-6S2RKx3o.js} +1 -1
  227. package/dist/client/assets/{require-capability-DBdY5Dkx.js → require-capability-Zm5W4hin.js} +1 -1
  228. package/dist/client/assets/{required-auth-layout-BeKmZATl.js → required-auth-layout-CpqRIzPD.js} +1 -1
  229. package/dist/client/assets/{reset-password-DKUxFK7V.js → reset-password-CTeQx-lW.js} +1 -1
  230. package/dist/client/assets/{resizable-D3Qsp-bc.js → resizable-xAkYm4i8.js} +1 -1
  231. package/dist/client/assets/{resolve-tab-icon-BV6oV-jC.js → resolve-tab-icon-C9wuMh4a.js} +1 -1
  232. package/dist/client/assets/{review-settings-Dh-dLavU.js → review-settings-BWiN3Jk9.js} +1 -1
  233. package/dist/client/assets/{roles-VhSYL0QR.js → roles-Znh7kobn.js} +1 -1
  234. package/dist/client/assets/{route-H82xw26H.js → route-BRm2VDLI.js} +1 -1
  235. package/dist/client/assets/route-DW1jw329.js +1 -0
  236. package/dist/client/assets/{route-x75aoHBC.js → route-DtXNF5Gy.js} +1 -1
  237. package/dist/client/assets/{sandbox-lifecycle-context-CrgjmH-d.js → sandbox-lifecycle-context-CfQP3IMz.js} +1 -1
  238. package/dist/client/assets/{schema-Dn8UxKpn.js → schema-B__wWe94.js} +1 -1
  239. package/dist/client/assets/{schema-DUdL_Acl.js → schema-C33Vhfks.js} +1 -1
  240. package/dist/client/assets/{scroll-area-Cl3gT6jK.js → scroll-area-D_8jILgS.js} +1 -1
  241. package/dist/client/assets/{search-input-DN2LZoYh.js → search-input-R3ZKEGlG.js} +1 -1
  242. package/dist/client/assets/{search-toggle-BsPfb2Uw.js → search-toggle-K246naLM.js} +1 -1
  243. package/dist/client/assets/{secret-ciphertext-GReF-ueC.js → secret-ciphertext-PmXQgPBi.js} +1 -1
  244. package/dist/client/assets/{secret-picker-CnxN1mqa.js → secret-picker-BuxCGGBU.js} +1 -1
  245. package/dist/client/assets/{secrets-DbnmA3JM.js → secrets-B2fnexCs.js} +1 -1
  246. package/dist/client/assets/{sections-editor-DD-4JFuT.js → sections-editor-B0hoUxCL.js} +1 -1
  247. package/dist/client/assets/{select-CTDMYNay.js → select-DB9aGezp.js} +1 -1
  248. package/dist/client/assets/{select-model-Dwv9d6Zz.js → select-model-BJFqJs1C.js} +1 -1
  249. package/dist/client/assets/{seo-editor-D_O_PFSr.js → seo-editor-CP-xh6fI.js} +1 -1
  250. package/dist/client/assets/{separator-BUlLfoWt.js → separator-YjrrgHOt.js} +1 -1
  251. package/dist/client/assets/{settings-tab-H1rGpC7y.js → settings-tab-CksnDewe.js} +1 -1
  252. package/dist/client/assets/{sheet-CsM7IsIZ.js → sheet-CZLBR4F9.js} +1 -1
  253. package/dist/client/assets/{shell-layout-Dm_OFDNO.js → shell-layout-D1m8Ud7v.js} +1 -1
  254. package/dist/client/assets/site-editor-CL_bu0T5.js +1 -0
  255. package/dist/client/assets/{site-editor-toast-BLu5nEtB.js → site-editor-toast-BQ9NvsaW.js} +1 -1
  256. package/dist/client/assets/{skills-DrnvbQY8.js → skills-DyZsyfj2.js} +1 -1
  257. package/dist/client/assets/{slider-d81-zJBG.js → slider-DdPswVEW.js} +1 -1
  258. package/dist/client/assets/{sortable.esm-DS1h28ed.js → sortable.esm-Isyn3z-p.js} +1 -1
  259. package/dist/client/assets/{sso-BtHHFAhj.js → sso-Cvd6woaA.js} +1 -1
  260. package/dist/client/assets/{suggestion-BGfqApUm.js → suggestion-DE6bI3IJ.js} +1 -1
  261. package/dist/client/assets/{switch-l6r2CgOr.js → switch-D2ouDY9l.js} +1 -1
  262. package/dist/client/assets/{symbol-DnAz7Geg.js → symbol-B2Jv7pNm.js} +1 -1
  263. package/dist/client/assets/{synced-repos-CgB0u0P9.js → synced-repos-KFK4TBEs.js} +1 -1
  264. package/dist/client/assets/{tab-icon-glyph-BSLtOBev.js → tab-icon-glyph-DOxVWCXX.js} +1 -1
  265. package/dist/client/assets/{table-DbeU8fyk.js → table-Bz_X_DZW.js} +1 -1
  266. package/dist/client/assets/{tabs-Dn19urh6.js → tabs-B1JWlBeb.js} +1 -1
  267. package/dist/client/assets/task-board-By-HtbvB.js +1 -0
  268. package/dist/client/assets/{task-route-yFp98Tim.js → task-route-DzEedpiF.js} +1 -1
  269. package/dist/client/assets/{task-status-D5Di_zGz.js → task-status-Br0QwLu4.js} +1 -1
  270. package/dist/client/assets/taskboard-analytics-CzdeI0TB.js +1 -0
  271. package/dist/client/assets/{tasks-Dn6Fadf-.js → tasks-Cg5BZBqa.js} +3 -3
  272. package/dist/client/assets/tasks-q6DdylR5.js +1 -0
  273. package/dist/client/assets/{textarea-BsQtSRL4.js → textarea-Bi1WfesL.js} +1 -1
  274. package/dist/client/assets/{thread-analytics-gD3FhCVT.js → thread-analytics-CFe--CHd.js} +1 -1
  275. package/dist/client/assets/{thread-intent-BGiWtT9b.js → thread-intent-BOV3kZsu.js} +1 -1
  276. package/dist/client/assets/{thread-route-Cz2hnjbe.js → thread-route-JnLnAmDR.js} +1 -1
  277. package/dist/client/assets/{thread-route-2Zw5ZOx8.js → thread-route-sK6jRpGi.js} +1 -1
  278. package/dist/client/assets/{thread-sheet-body-EN7mims4.js → thread-sheet-body-CeK8x29F.js} +1 -1
  279. package/dist/client/assets/{time-range-picker-DG0be51Y.js → time-range-picker-DyaWyYvU.js} +1 -1
  280. package/dist/client/assets/{toggle-group-BiaXSMqv.js → toggle-group-BJrK4ohL.js} +1 -1
  281. package/dist/client/assets/{tool-namespace-CAIbvQDB.js → tool-namespace-WGvCHGNT.js} +1 -1
  282. package/dist/client/assets/{toolbar-icon-button-8xLbHjb9.js → toolbar-icon-button-B-Am6G4N.js} +1 -1
  283. package/dist/client/assets/{tooltip-7apN1qsW.js → tooltip-BjOKp_yY.js} +1 -1
  284. package/dist/client/assets/{tooltipContext-C2oFeeD5.js → tooltipContext-ECoG_0bD.js} +1 -1
  285. package/dist/client/assets/{track-CJ6wQpWk.js → track-DMHTeO-g.js} +1 -1
  286. package/dist/client/assets/{types-B3o00suf.js → types-B38bkUuB.js} +1 -1
  287. package/dist/client/assets/{url-slug-AciVwxZY.js → url-slug-B9BgQNZP.js} +1 -1
  288. package/dist/client/assets/{usage-stats-Dfveygkj.js → usage-stats-Moh6ZFcL.js} +1 -1
  289. package/dist/client/assets/{use-ai-providers-CIqdkSUR.js → use-ai-providers-BvJFsA-n.js} +1 -1
  290. package/dist/client/assets/{use-app-takeover-Dv5fp7cY.js → use-app-takeover-B8WKIuje.js} +1 -1
  291. package/dist/client/assets/{use-automations-DGrWINYU.js → use-automations-BubilfJF.js} +1 -1
  292. package/dist/client/assets/{use-autosave-DhALRW1Z.js → use-autosave-DQrtP9Mp.js} +1 -1
  293. package/dist/client/assets/{use-chat-navigation-Bto6Rcca.js → use-chat-navigation-CiTJZYhQ.js} +1 -1
  294. package/dist/client/assets/{use-clock-tick-By2kqq-3.js → use-clock-tick-B9hlRyLN.js} +1 -1
  295. package/dist/client/assets/{use-connect-companion-Dm9-c3zd.js → use-connect-companion-CXJy1zaK.js} +1 -1
  296. package/dist/client/assets/{use-connection-CYWKqRYC.js → use-connection-UjMngEYa.js} +1 -1
  297. package/dist/client/assets/{use-content-sync-C3U3146m.js → use-content-sync-BUixoW2Z.js} +1 -1
  298. package/dist/client/assets/{use-copy-BjH1FU0j.js → use-copy-CiztYm1v.js} +1 -1
  299. package/dist/client/assets/{use-create-virtual-mcp-CbMt6_vX.js → use-create-virtual-mcp-VpFuCKnd.js} +1 -1
  300. package/dist/client/assets/{use-date-fns-locale-DSY8JG1j.js → use-date-fns-locale-CylZqXHz.js} +1 -1
  301. package/dist/client/assets/{use-debounced-autosave-VJaoBOYA.js → use-debounced-autosave-m7eQVRqS.js} +1 -1
  302. package/dist/client/assets/{use-debounced-value-q8sYO17j.js → use-debounced-value-Bhl_Rv5_.js} +1 -1
  303. package/dist/client/assets/{use-deco-credits-XYO4fopb.js → use-deco-credits-FY205R6D.js} +1 -1
  304. package/dist/client/assets/{use-decopilot-events-c6aEriA4.js → use-decopilot-events-CPfnofl0.js} +1 -1
  305. package/dist/client/assets/{use-delete-connection-B8C9IUKL.js → use-delete-connection-DvVJpeEf.js} +1 -1
  306. package/dist/client/assets/{use-deployment-admin-_69zcMM5.js → use-deployment-admin-BzV2yqA3.js} +1 -1
  307. package/dist/client/assets/{use-ensure-project-folder-BSTkwTqx.js → use-ensure-project-folder-BgUOAmYE.js} +1 -1
  308. package/dist/client/assets/{use-fast-preview-draft-url-Hspq63Bq.js → use-fast-preview-draft-url-CrL4FQJ6.js} +1 -1
  309. package/dist/client/assets/{use-file-configs-BgqM6apf.js → use-file-configs-jGTNrkK9.js} +1 -1
  310. package/dist/client/assets/{use-infinite-scroll-zA1vHSDv.js → use-infinite-scroll-DlTIfPFo.js} +1 -1
  311. package/dist/client/assets/{use-join-requests-CSZR45Rh.js → use-join-requests-C4TcA439.js} +1 -1
  312. package/dist/client/assets/{use-main-panel-tabs-DQU9Drsd.js → use-main-panel-tabs-CN3dklj2.js} +1 -1
  313. package/dist/client/assets/{use-mcp-auth-status-6Hup2mMI.js → use-mcp-auth-status-DM-ErC_Q.js} +1 -1
  314. package/dist/client/assets/{use-mcp-client-Cv85PJpG.js → use-mcp-client-mxUa3Lsm.js} +1 -1
  315. package/dist/client/assets/{use-mcp-prompts-aALcivOD.js → use-mcp-prompts-CX-ziSXI.js} +1 -1
  316. package/dist/client/assets/{use-mcp-tools-D5NzpH6L.js → use-mcp-tools-D1zqQRh2.js} +1 -1
  317. package/dist/client/assets/{use-members-lQfr5LSq.js → use-members-C1a4SbHs.js} +1 -1
  318. package/dist/client/assets/{use-mobile-BXydQ0yv.js → use-mobile-BIczRvEw.js} +1 -1
  319. package/dist/client/assets/{use-navigate-to-agent-B-SZ4-r5.js → use-navigate-to-agent-B9ba7keg.js} +1 -1
  320. package/dist/client/assets/{use-open-billing-url-DB_yalzC.js → use-open-billing-url-BVUCpaHN.js} +1 -1
  321. package/dist/client/assets/{use-org-auth-client-CMWVQK83.js → use-org-auth-client-DLu7wwJ8.js} +1 -1
  322. package/dist/client/assets/{use-org-fs-C0Ksj3qD.js → use-org-fs-BPZLK6VF.js} +1 -1
  323. package/dist/client/assets/{use-org-repo-syncs-C-qsjsAJ.js → use-org-repo-syncs-DmycgZxS.js} +1 -1
  324. package/dist/client/assets/{use-org-sso-DOHFNgSV.js → use-org-sso-B42vh3r9.js} +1 -1
  325. package/dist/client/assets/{use-organization-roles-BbFM2_FD.js → use-organization-roles-DbvmpvPK.js} +1 -1
  326. package/dist/client/assets/{use-organization-settings-B1smoLtY.js → use-organization-settings-BzX4Hzqv.js} +1 -1
  327. package/dist/client/assets/{use-panel-navigate-Bn01w_Hx.js → use-panel-navigate-BfsxK4kz.js} +1 -1
  328. package/dist/client/assets/{use-project-native-view-presence-CFLUF0Qf.js → use-project-native-view-presence-CR46zKPn.js} +1 -1
  329. package/dist/client/assets/{use-project-scope-BF0yZckc.js → use-project-scope-DgHI5Sbx.js} +1 -1
  330. package/dist/client/assets/{use-recent-apps-B4ud4bag.js → use-recent-apps-n8Amcz5l.js} +1 -1
  331. package/dist/client/assets/{use-releases-BUpm7ncP.js → use-releases-BVZsPPMC.js} +1 -1
  332. package/dist/client/assets/{use-reports-diagnostic-VrRXHvbv.js → use-reports-diagnostic-CevaUKdb.js} +1 -1
  333. package/dist/client/assets/{use-secrets-Bu0k0RrL.js → use-secrets-BDWaWfBZ.js} +1 -1
  334. package/dist/client/assets/{use-section-preview-base-CHZVDRwb.js → use-section-preview-base-L5lcG5Wr.js} +1 -1
  335. package/dist/client/assets/{use-tags-DxtJAsCR.js → use-tags-CswC4qUA.js} +1 -1
  336. package/dist/client/assets/{use-task-board-analytics-BG0H9zCy.js → use-task-board-analytics-C545b4DS.js} +1 -1
  337. package/dist/client/assets/{use-task-board-events-BWWqXmZc.js → use-task-board-events-BX2b5wi0.js} +1 -1
  338. package/dist/client/assets/{use-task-board-item-prs-zzkJb4HW.js → use-task-board-item-prs-BLXk8Qod.js} +1 -1
  339. package/dist/client/assets/{use-task-board-items-BCPpXr-q.js → use-task-board-items-l56DZZX-.js} +1 -1
  340. package/dist/client/assets/{use-task-metadata-MAFDGrlB.js → use-task-metadata-DIMUC10R.js} +1 -1
  341. package/dist/client/assets/{use-thread-analytics-B7Cb0iiH.js → use-thread-analytics-Dtf6wTh1.js} +1 -1
  342. package/dist/client/assets/{use-thread-outputs-KSvYehUL.js → use-thread-outputs-Dcvv4FKQ.js} +1 -1
  343. package/dist/client/assets/useInfiniteQuery-DtOl_zc5.js +1 -0
  344. package/dist/client/assets/{useQueries-CyVTCr9q.js → useQueries-2wm2Ardx.js} +1 -1
  345. package/dist/client/assets/useSuspenseInfiniteQuery-CgXIqx6r.js +1 -0
  346. package/dist/client/assets/{users-BOIy3x9W.js → users-CwwQJETL.js} +1 -1
  347. package/dist/client/assets/{utils-B5k90hLJ.js → utils-BnDAp2xW.js} +1 -1
  348. package/dist/client/assets/{variant-calendar-SUTJzVzn.js → variant-calendar-NVbPJ00u.js} +1 -1
  349. package/dist/client/assets/{variant-draft-pointer-D4YpxoPE.js → variant-draft-pointer-CDHruVa9.js} +1 -1
  350. package/dist/client/assets/{view-mode-toggle-DBgxPdz8.js → view-mode-toggle-S2UksSN5.js} +1 -1
  351. package/dist/client/assets/{virtual-mcp-SNhYn6sa.js → virtual-mcp-DugkGZOU.js} +1 -1
  352. package/dist/client/assets/{watch-sse-pool-DjF3RHhV.js → watch-sse-pool-DuKj9dUB.js} +1 -1
  353. package/dist/client/index.html +1 -1
  354. package/dist/server/server.js +1 -1
  355. package/package.json +1 -1
  356. package/dist/client/assets/agent-app-Up_QBSxH.js +0 -1
  357. package/dist/client/assets/agent-deck-BbK3fHwc.js +0 -1
  358. package/dist/client/assets/agent-library-file-CrCAOA39.js +0 -1
  359. package/dist/client/assets/agent-library-h_6C8rPz.js +0 -1
  360. package/dist/client/assets/agent-settings-D8SQ2v4q.js +0 -1
  361. package/dist/client/assets/agent-site-editor-code-BmzYclFK.js +0 -2
  362. package/dist/client/assets/agent-site-editor-content-E9taurPz.js +0 -1
  363. package/dist/client/assets/agent-site-editor-preview-CeGzwlhY.js +0 -1
  364. package/dist/client/assets/agent-view-H44BT6Z_.js +0 -1
  365. package/dist/client/assets/api-keys-BeKH4V3B.js +0 -1
  366. package/dist/client/assets/cms-settings-editor-Cb-kOAs5.js +0 -1
  367. package/dist/client/assets/config-BWhGUBX_.js +0 -1
  368. package/dist/client/assets/flat-project-CJ2D_Q9C.js +0 -1
  369. package/dist/client/assets/index-LFEwJn7D.js +0 -81
  370. package/dist/client/assets/library-r0cXsVYt.js +0 -1
  371. package/dist/client/assets/order-monitor-day-BZ5hHMPc.js +0 -1
  372. package/dist/client/assets/project-reports-CmHeXUcl.js +0 -1
  373. package/dist/client/assets/project-tasks-CTXxuDri.js +0 -1
  374. package/dist/client/assets/record-editor-bEwE5xiL.js +0 -1
  375. package/dist/client/assets/reports-DxyqlhkR.js +0 -1
  376. package/dist/client/assets/route-DVwEq84O.js +0 -1
  377. package/dist/client/assets/site-editor-DH--4LuI.js +0 -1
  378. package/dist/client/assets/task-board-CI0FIG6Y.js +0 -1
  379. package/dist/client/assets/taskboard-analytics-DNqvMJ9d.js +0 -1
  380. package/dist/client/assets/tasks-B5Ta9prN.js +0 -1
  381. package/dist/client/assets/useInfiniteQuery-2O3uSnGt.js +0 -1
  382. package/dist/client/assets/useSuspenseInfiniteQuery-BHRAstD8.js +0 -1
@@ -1 +1 @@
1
- import{t as y,c as S,d as j,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{F as x}from"./index-CT-xO5mU.js";let F={};function T(){return F}function W(e){const a=y(e),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+e-+t}function P(e,...a){const t=S.bind(null,e||a.find(o=>typeof o=="object"));return a.map(t)}function v(e,a){const t=+y(e)-+y(a);return t<0?-1:t>0?1:t}function $(e){return S(e,Date.now())}function C(e,a,t){const[o,n]=P(t?.in,e,a),s=o.getFullYear()-n.getFullYear(),i=o.getMonth()-n.getMonth();return s*12+i}function X(e,a){const t=y(e,a?.in);return t.setHours(23,59,59,999),t}function q(e,a){const t=y(e,a?.in),o=t.getMonth();return t.setFullYear(t.getFullYear(),o+1,0),t.setHours(23,59,59,999),t}function z(e,a){const t=y(e,a?.in);return+X(t,a)==+q(t,a)}function A(e,a,t){const[o,n,s]=P(t?.in,e,e,a),i=v(n,s),r=Math.abs(C(n,s));if(r<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*r);let l=v(n,s)===-i;z(o)&&r===1&&v(o,s)===1&&(l=!1);const u=i*(r-+l);return u===0?0:u}const O={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},N=(e,a,t)=>{let o;const n=O[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",a.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+o:o+" ago":o};function b(e){return(a={})=>{const t=a.width?String(a.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const V={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Y={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_={date:b({formats:V,defaultWidth:"full"}),time:b({formats:Y,defaultWidth:"full"}),dateTime:b({formats:H,defaultWidth:"full"})},L={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E=(e,a,t,o)=>L[e];function m(e){return(a,t)=>{const o=t?.context?String(t.context):"standalone";let n;if(o==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,r=t?.width?String(t.width):i;n=e.formattingValues[r]||e.formattingValues[i]}else{const i=e.defaultWidth,r=t?.width?String(t.width):e.defaultWidth;n=e.values[r]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(a):a;return n[s]}}const R={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},I={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Q={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},J={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K=(e,a)=>{const t=Number(e),o=t%100;if(o>20||o<10)switch(o%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},G={ordinalNumber:K,era:m({values:R,defaultWidth:"wide"}),quarter:m({values:I,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:Q,defaultWidth:"wide"}),day:m({values:J,defaultWidth:"wide"}),dayPeriod:m({values:B,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})};function c(e){return(a,t={})=>{const o=t.width,n=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=a.match(n);if(!s)return null;const i=s[0],r=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?ee(r,w=>w.test(i)):Z(r,w=>w.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;const h=a.slice(i.length);return{value:u,rest:h}}}function Z(e,a){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&a(e[t]))return t}function ee(e,a){for(let t=0;t<e.length;t++)if(a(e[t]))return t}function k(e){return(a,t={})=>{const o=a.match(e.matchPattern);if(!o)return null;const n=o[0],s=a.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const r=a.slice(n.length);return{value:i,rest:r}}}const te=/^(\d+)(th|st|nd|rd)?/i,ae=/\d+/i,ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oe={any:[/^b/i,/^(a|c)/i]},re={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ie={any:[/1/i,/2/i,/3/i,/4/i]},se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},de={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ue={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ce={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},le={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},he={ordinalNumber:k({matchPattern:te,parsePattern:ae,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),quarter:c({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ie,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:se,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),day:c({matchPatterns:ue,defaultMatchWidth:"wide",parsePatterns:me,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:le,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:N,formatLong:_,formatRelative:E,localize:G,match:he,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ge(e,a,t){const o=T(),n=t?.locale??o.locale??fe,s=2520,i=v(e,a);if(isNaN(i))throw new RangeError("Invalid time value");const r=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[l,u]=P(t?.in,...i>0?[a,e]:[e,a]),h=j(u,l),w=(W(u)-W(l))/1e3,d=Math.round((h-w)/60);let g;if(d<2)return t?.includeSeconds?h<5?n.formatDistance("lessThanXSeconds",5,r):h<10?n.formatDistance("lessThanXSeconds",10,r):h<20?n.formatDistance("lessThanXSeconds",20,r):h<40?n.formatDistance("halfAMinute",0,r):h<60?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",1,r):d===0?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",d,r);if(d<45)return n.formatDistance("xMinutes",d,r);if(d<90)return n.formatDistance("aboutXHours",1,r);if(d<D){const f=Math.round(d/60);return n.formatDistance("aboutXHours",f,r)}else{if(d<s)return n.formatDistance("xDays",1,r);if(d<M){const f=Math.round(d/D);return n.formatDistance("xDays",f,r)}else if(d<M*2)return g=Math.round(d/M),n.formatDistance("aboutXMonths",g,r)}if(g=A(u,l),g<12){const f=Math.round(d/M);return n.formatDistance("xMonths",f,r)}else{const f=g%12,p=Math.trunc(g/12);return f<3?n.formatDistance("aboutXYears",p,r):f<9?n.formatDistance("overXYears",p,r):n.formatDistance("almostXYears",p+1,r)}}function Je(e,a){return ge(e,$(e),a)}const be={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ye=(e,a,t)=>{let o;const n=be[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",String(a)),t?.addSuffix?t.comparison&&t.comparison>0?"em "+o:"há "+o:o},we={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Me={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ve={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pe={date:b({formats:we,defaultWidth:"full"}),time:b({formats:Me,defaultWidth:"full"}),dateTime:b({formats:ve,defaultWidth:"full"})},Pe={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},De=(e,a,t,o)=>{const n=Pe[e];return typeof n=="function"?n(a):n},We={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Se={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ke={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},je={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},xe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Fe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Te=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Te,era:m({values:We,defaultWidth:"wide"}),quarter:m({values:Se,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:ke,defaultWidth:"wide"}),day:m({values:je,defaultWidth:"wide"}),dayPeriod:m({values:xe,defaultWidth:"wide",formattingValues:Fe,defaultFormattingWidth:"wide"})},Ce=/^(\d+)[ºªo]?/i,Xe=/\d+/i,qe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},ze={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Ae={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},Ne={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Ve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Ye={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},He={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},_e={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Le={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Ee={ordinalNumber:k({matchPattern:Ce,parsePattern:Xe,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:qe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),quarter:c({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any"}),day:c({matchPatterns:Ye,defaultMatchWidth:"wide",parsePatterns:He,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:_e,defaultMatchWidth:"any",parsePatterns:Le,defaultParseWidth:"any"})},Re={code:"pt-BR",formatDistance:ye,formatLong:pe,formatRelative:De,localize:$e,match:Ee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Be(){const[e]=x();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,T as g,P as n,Be as u};
1
+ import{t as y,c as S,d as j,b as D,e as M}from"./differenceInSeconds-C3x8sHUj.js";import{F as x}from"./index-DjeyX30Y.js";let F={};function T(){return F}function W(e){const a=y(e),t=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return t.setUTCFullYear(a.getFullYear()),+e-+t}function P(e,...a){const t=S.bind(null,e||a.find(o=>typeof o=="object"));return a.map(t)}function v(e,a){const t=+y(e)-+y(a);return t<0?-1:t>0?1:t}function $(e){return S(e,Date.now())}function C(e,a,t){const[o,n]=P(t?.in,e,a),s=o.getFullYear()-n.getFullYear(),i=o.getMonth()-n.getMonth();return s*12+i}function X(e,a){const t=y(e,a?.in);return t.setHours(23,59,59,999),t}function q(e,a){const t=y(e,a?.in),o=t.getMonth();return t.setFullYear(t.getFullYear(),o+1,0),t.setHours(23,59,59,999),t}function z(e,a){const t=y(e,a?.in);return+X(t,a)==+q(t,a)}function A(e,a,t){const[o,n,s]=P(t?.in,e,e,a),i=v(n,s),r=Math.abs(C(n,s));if(r<1)return 0;n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*r);let l=v(n,s)===-i;z(o)&&r===1&&v(o,s)===1&&(l=!1);const u=i*(r-+l);return u===0?0:u}const O={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},N=(e,a,t)=>{let o;const n=O[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",a.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+o:o+" ago":o};function b(e){return(a={})=>{const t=a.width?String(a.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}const V={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Y={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},H={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},_={date:b({formats:V,defaultWidth:"full"}),time:b({formats:Y,defaultWidth:"full"}),dateTime:b({formats:H,defaultWidth:"full"})},L={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},E=(e,a,t,o)=>L[e];function m(e){return(a,t)=>{const o=t?.context?String(t.context):"standalone";let n;if(o==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,r=t?.width?String(t.width):i;n=e.formattingValues[r]||e.formattingValues[i]}else{const i=e.defaultWidth,r=t?.width?String(t.width):e.defaultWidth;n=e.values[r]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(a):a;return n[s]}}const R={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},I={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Q={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},J={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},B={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},U={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K=(e,a)=>{const t=Number(e),o=t%100;if(o>20||o<10)switch(o%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},G={ordinalNumber:K,era:m({values:R,defaultWidth:"wide"}),quarter:m({values:I,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:Q,defaultWidth:"wide"}),day:m({values:J,defaultWidth:"wide"}),dayPeriod:m({values:B,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})};function c(e){return(a,t={})=>{const o=t.width,n=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=a.match(n);if(!s)return null;const i=s[0],r=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?ee(r,w=>w.test(i)):Z(r,w=>w.test(i));let u;u=e.valueCallback?e.valueCallback(l):l,u=t.valueCallback?t.valueCallback(u):u;const h=a.slice(i.length);return{value:u,rest:h}}}function Z(e,a){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&a(e[t]))return t}function ee(e,a){for(let t=0;t<e.length;t++)if(a(e[t]))return t}function k(e){return(a,t={})=>{const o=a.match(e.matchPattern);if(!o)return null;const n=o[0],s=a.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=t.valueCallback?t.valueCallback(i):i;const r=a.slice(n.length);return{value:i,rest:r}}}const te=/^(\d+)(th|st|nd|rd)?/i,ae=/\d+/i,ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oe={any:[/^b/i,/^(a|c)/i]},re={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ie={any:[/1/i,/2/i,/3/i,/4/i]},se={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},de={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ue={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},me={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ce={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},le={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},he={ordinalNumber:k({matchPattern:te,parsePattern:ae,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:ne,defaultMatchWidth:"wide",parsePatterns:oe,defaultParseWidth:"any"}),quarter:c({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ie,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:se,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),day:c({matchPatterns:ue,defaultMatchWidth:"wide",parsePatterns:me,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:ce,defaultMatchWidth:"any",parsePatterns:le,defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:N,formatLong:_,formatRelative:E,localize:G,match:he,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ge(e,a,t){const o=T(),n=t?.locale??o.locale??fe,s=2520,i=v(e,a);if(isNaN(i))throw new RangeError("Invalid time value");const r=Object.assign({},t,{addSuffix:t?.addSuffix,comparison:i}),[l,u]=P(t?.in,...i>0?[a,e]:[e,a]),h=j(u,l),w=(W(u)-W(l))/1e3,d=Math.round((h-w)/60);let g;if(d<2)return t?.includeSeconds?h<5?n.formatDistance("lessThanXSeconds",5,r):h<10?n.formatDistance("lessThanXSeconds",10,r):h<20?n.formatDistance("lessThanXSeconds",20,r):h<40?n.formatDistance("halfAMinute",0,r):h<60?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",1,r):d===0?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",d,r);if(d<45)return n.formatDistance("xMinutes",d,r);if(d<90)return n.formatDistance("aboutXHours",1,r);if(d<D){const f=Math.round(d/60);return n.formatDistance("aboutXHours",f,r)}else{if(d<s)return n.formatDistance("xDays",1,r);if(d<M){const f=Math.round(d/D);return n.formatDistance("xDays",f,r)}else if(d<M*2)return g=Math.round(d/M),n.formatDistance("aboutXMonths",g,r)}if(g=A(u,l),g<12){const f=Math.round(d/M);return n.formatDistance("xMonths",f,r)}else{const f=g%12,p=Math.trunc(g/12);return f<3?n.formatDistance("aboutXYears",p,r):f<9?n.formatDistance("overXYears",p,r):n.formatDistance("almostXYears",p+1,r)}}function Je(e,a){return ge(e,$(e),a)}const be={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},ye=(e,a,t)=>{let o;const n=be[e];return typeof n=="string"?o=n:a===1?o=n.one:o=n.other.replace("{{count}}",String(a)),t?.addSuffix?t.comparison&&t.comparison>0?"em "+o:"há "+o:o},we={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},Me={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ve={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pe={date:b({formats:we,defaultWidth:"full"}),time:b({formats:Me,defaultWidth:"full"}),dateTime:b({formats:ve,defaultWidth:"full"})},Pe={lastWeek:e=>{const a=e.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},De=(e,a,t,o)=>{const n=Pe[e];return typeof n=="function"?n(a):n},We={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},Se={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},ke={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},je={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},xe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Fe={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Te=(e,a)=>{const t=Number(e);return a?.unit==="week"?t+"ª":t+"º"},$e={ordinalNumber:Te,era:m({values:We,defaultWidth:"wide"}),quarter:m({values:Se,defaultWidth:"wide",argumentCallback:e=>e-1}),month:m({values:ke,defaultWidth:"wide"}),day:m({values:je,defaultWidth:"wide"}),dayPeriod:m({values:xe,defaultWidth:"wide",formattingValues:Fe,defaultFormattingWidth:"wide"})},Ce=/^(\d+)[ºªo]?/i,Xe=/\d+/i,qe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},ze={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},Ae={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Oe={any:[/1/i,/2/i,/3/i,/4/i]},Ne={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Ve={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},Ye={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},He={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},_e={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},Le={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},Ee={ordinalNumber:k({matchPattern:Ce,parsePattern:Xe,valueCallback:e=>parseInt(e,10)}),era:c({matchPatterns:qe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),quarter:c({matchPatterns:Ae,defaultMatchWidth:"wide",parsePatterns:Oe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:c({matchPatterns:Ne,defaultMatchWidth:"wide",parsePatterns:Ve,defaultParseWidth:"any"}),day:c({matchPatterns:Ye,defaultMatchWidth:"wide",parsePatterns:He,defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:_e,defaultMatchWidth:"any",parsePatterns:Le,defaultParseWidth:"any"})},Re={code:"pt-BR",formatDistance:ye,formatLong:pe,formatRelative:De,localize:$e,match:Ee,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Be(){const[e]=x();return e.language==="pt-BR"?Re:void 0}export{W as a,fe as e,Je as f,T as g,P as n,Be as u};
@@ -1 +1 @@
1
- import{r as t}from"./index-CT-xO5mU.js";function f({save:u,delayMs:n=1e3}){const r=t.useRef(u);r.current=u;const e=t.useRef(null),c=()=>{r.current().catch(()=>{})},o=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,c()},n)},s=()=>(e.current&&(clearTimeout(e.current),e.current=null),r.current());return t.useEffect(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null,c())},[]),{schedule:o,flush:s}}export{f as u};
1
+ import{r as t}from"./index-DjeyX30Y.js";function f({save:u,delayMs:n=1e3}){const r=t.useRef(u);r.current=u;const e=t.useRef(null),c=()=>{r.current().catch(()=>{})},o=()=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,c()},n)},s=()=>(e.current&&(clearTimeout(e.current),e.current=null),r.current());return t.useEffect(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null,c())},[]),{schedule:o,flush:s}}export{f as u};
@@ -1 +1 @@
1
- import{c as m,r as n}from"./index-CT-xO5mU.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
1
+ import{c as m,r as n}from"./index-DjeyX30Y.js";function p(e,o){const t=m.c(4),[s,u]=n.useState(e);let c,r;return t[0]!==o||t[1]!==e?(c=()=>{const i=setTimeout(()=>u(e),o);return()=>clearTimeout(i)},r=[e,o],t[0]=o,t[1]=e,t[2]=c,t[3]=r):(c=t[2],r=t[3]),n.useEffect(c,r),s}export{p as u};
@@ -1 +1 @@
1
- import{a2 as C,a9 as I,m as g,K,r as S,y as b}from"./index-CT-xO5mU.js";import{u as m}from"./use-ai-providers-CIqdkSUR.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
1
+ import{a2 as C,a9 as I,m as g,K,r as S,y as b}from"./index-DjeyX30Y.js";import{u as m}from"./use-ai-providers-BvJFsA-n.js";const a=new Map;function w(){const{org:n}=C(),c=I(),s=m(),o=s.find(t=>t.providerId==="deco"),{data:i,isLoading:d,refetch:l,isFetching:u}=g({queryKey:K.aiProviderCredits(n.id,"deco"),enabled:!!o,staleTime:6e4,queryFn:async()=>{try{return await c.call("AI_PROVIDER_CREDITS",{providerId:"deco"})}catch{return null}}}),e=i?.balanceCents??null,p=e!=null?e/100:null,r=S.useRef(new Map);if(e!=null){const t=a.get(n.id);r.current.get(n.id)&&t!=null&&e>t&&b("credits_topped_up_detected",{organization_id:n.id,delta_cents:e-t,previous_balance_cents:t,new_balance_cents:e}),a.set(n.id,e),r.current.set(n.id,!0)}const y=!!o,f=e!=null&&e>0,_=e!=null&&e===0,h=e!=null&&e===200,v=s.length>0&&s.every(t=>t.providerId==="deco");return{hasDecoKey:y,decoKeyId:o?.id??null,balanceCents:e,balanceDollars:p,hasCredits:f,isZeroBalance:_,isInitialFreeCredit:h,hasOnlyDecoProvider:v,isLoading:d,isFetching:u,refetch:l}}export{w as u};
@@ -1 +1 @@
1
- import{c as h,dU as I,K as T,m as P,dV as x,ao as M,r as l}from"./index-CT-xO5mU.js";import{m as D}from"./thread-intent-BGiWtT9b.js";import{D as E}from"./watch-sse-pool-DjF3RHhV.js";const O=1e6;function C(e,t,n){n>0&&e.setQueryData(T.aiPlanEntitlements(t),r=>{if(!r?.usage)return r;const s=r.usage;if(!s.limitMicros||s.usedMicros===null)return r;const u=s.usedMicros+n*O,o=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:o,state:o>=1?"exhausted":o>=.8?"warn":"ok"}}})}function g(){return x()?.plansEnabled===!0}function d(){const e=h.c(8),t=I(),n=t?.org.slug,r=g();let s;e[0]!==t?.org.id?(s=T.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=s):s=e[1];const u=!!n&&r;let o;e[2]!==n?(o=()=>M(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==u||e[6]!==o?(a={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:o},e[4]=s,e[5]=u,e[6]=o,e[7]=a):a=e[7],P(a)}function U(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function w(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function K(){const e=h.c(4),t=g(),{isSuccess:n,data:r}=d(),s=r?.features?.model_choice;let u;return e[0]!==n||e[1]!==t||e[2]!==s?(u=_({plansEnabled:t,isSuccess:n,modelChoice:s}),e[0]=n,e[1]=t,e[2]=s,e[3]=u):u=e[3],u}function _({plansEnabled:e,isSuccess:t,modelChoice:n}){return e?t&&n===!0:!0}function L(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const b=()=>0;function j(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a};const S=l.useRef(null),m=l.useRef(r),p=l.useRef(t);(!S.current||m.current!==r||p.current!==t)&&(m.current=r,p.current=t,S.current=R=>{if(!r||!t)return()=>{};const k=y=>{let c;try{c=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&c.subject!==i.taskId)){switch(c.type){case E.STEP:i.onStep?.(c);break;case E.FINISH:i.onFinish?.(c);break;case E.THREAD_STATUS:i.onTaskStatus?.(c);break}R()}};return D.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(S.current,b,b)}export{d as a,j as b,K as c,C as d,U as e,w as f,L as g,g as u};
1
+ import{c as h,dU as I,K as T,m as P,dV as x,ao as M,r as l}from"./index-DjeyX30Y.js";import{m as D}from"./thread-intent-BOV3kZsu.js";import{D as E}from"./watch-sse-pool-DuKj9dUB.js";const O=1e6;function C(e,t,n){n>0&&e.setQueryData(T.aiPlanEntitlements(t),r=>{if(!r?.usage)return r;const s=r.usage;if(!s.limitMicros||s.usedMicros===null)return r;const u=s.usedMicros+n*O,o=Math.min(1,u/s.limitMicros);return{...r,usage:{...s,usedMicros:u,percent:o,state:o>=1?"exhausted":o>=.8?"warn":"ok"}}})}function g(){return x()?.plansEnabled===!0}function d(){const e=h.c(8),t=I(),n=t?.org.slug,r=g();let s;e[0]!==t?.org.id?(s=T.aiPlanEntitlements(t?.org.id??"none"),e[0]=t?.org.id,e[1]=s):s=e[1];const u=!!n&&r;let o;e[2]!==n?(o=()=>M(n,"AI_PLAN_ENTITLEMENTS",{providerId:"deco"}),e[2]=n,e[3]=o):o=e[3];let a;return e[4]!==s||e[5]!==u||e[6]!==o?(a={queryKey:s,enabled:u,staleTime:6e4,retry:1,queryFn:o},e[4]=s,e[5]=u,e[6]=o,e[7]=a):a=e[7],P(a)}function U(e){const{data:t}=d();return!e||!t?!0:t.features[e]===!0}function w(){const e=g(),{isPending:t,fetchStatus:n}=d();return!e||n==="idle"||n==="paused"?!0:!t}function K(){const e=h.c(4),t=g(),{isSuccess:n,data:r}=d(),s=r?.features?.model_choice;let u;return e[0]!==n||e[1]!==t||e[2]!==s?(u=_({plansEnabled:t,isSuccess:n,modelChoice:s}),e[0]=n,e[1]=t,e[2]=s,e[3]=u):u=e[3],u}function _({plansEnabled:e,isSuccess:t,modelChoice:n}){return e?t&&n===!0:!0}function L(){const{data:e}=d();if(e?.usage?.state!=="exhausted")return!1;const t=e.credits?.remainingUsd??null;return!(t!==null&&t>0)}const b=()=>0;function j(e){const{orgSlug:t,taskId:n,enabled:r=!0,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a}=e,f=l.useRef({taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a});f.current={taskId:n,onStep:s,onFinish:u,onTaskStatus:o,onReconnect:a};const S=l.useRef(null),m=l.useRef(r),p=l.useRef(t);(!S.current||m.current!==r||p.current!==t)&&(m.current=r,p.current=t,S.current=R=>{if(!r||!t)return()=>{};const k=y=>{let c;try{c=JSON.parse(y.data)}catch{return}const i=f.current;if(!(i.taskId&&c.subject!==i.taskId)){switch(c.type){case E.STEP:i.onStep?.(c);break;case E.FINISH:i.onFinish?.(c);break;case E.THREAD_STATUS:i.onTaskStatus?.(c);break}R()}};return D.subscribe(t,k,()=>f.current.onReconnect?.())}),l.useSyncExternalStore(S.current,b,b)}export{d as a,j as b,K as c,C as d,U as e,w as f,L as g,g as u};
@@ -1 +1 @@
1
- import{c as oe,b as le,j as n,a2 as se,o as ie,a9 as ce,r as re,t as Y,eB as ae,fN as de,fO as fe}from"./index-CT-xO5mU.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-7mrPWx4-.js";function ue(Q){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=Q,t=le(),K=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const k=s.mode==="deleting"&&s.connection.title;let o;e[8]!==k?(o=n.jsx("span",{className:"font-medium text-foreground",children:k}),e[8]=k,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(X,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==K||e[32]!==j||e[33]!==f?(p=n.jsx(ne,{open:K,onOpenChange:f,children:j}),e[31]=K,e[32]=j,e[33]=f,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let O;e[39]!==E?(O=n.jsx(z,{children:E}),e[39]=E,e[40]=O):O=e[40];let v;e[41]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=v):v=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==M?(y=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==v||e[50]!==y||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[v," ",y," ",S," ",T,"."]}),e[49]=v,e[50]=y,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let L;e[58]!==A||e[59]!==F?(L=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=L):L=e[60];let b;e[61]!==O||e[62]!==L?(b=n.jsxs(V,{children:[O,L]}),e[61]=O,e[62]=L,e[63]=b):b=e[63];let I;e[64]!==t?(I=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=I):I=e[65];let R;e[66]!==I?(R=n.jsx(X,{children:I}),e[66]=I,e[67]=R):R=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let q;e[70]!==c||e[71]!==U?(q=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:U}),e[70]=c,e[71]=U,e[72]=q):q=e[72];let $;e[73]!==R||e[74]!==q?($=n.jsxs(ee,{children:[R,q]}),e[73]=R,e[74]=q,e[75]=$):$=e[75];let w;e[76]!==b||e[77]!==$?(w=n.jsxs(te,{children:[b,$]}),e[76]=b,e[77]=$,e[78]=w):w=e[78];let H;e[79]!==J||e[80]!==N||e[81]!==w?(H=n.jsx(ne,{open:J,onOpenChange:N,children:w}),e[79]=J,e[80]=N,e[81]=w,e[82]=H):H=e[82];let B;return e[83]!==p||e[84]!==H?(B=n.jsxs(n.Fragment,{children:[p,H]}),e[83]=p,e[84]=H,e[85]=B):B=e[85],B}function De({onSuccess:Q}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{ae(s,e.id)},K=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===fe&&l.queryKey[3]===o})},f=o=>{t(),K(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),Q?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
1
+ import{c as oe,b as le,j as n,a2 as se,o as ie,a9 as ce,r as re,t as Y,eB as ae,fN as de,fO as fe}from"./index-DjeyX30Y.js";import{A as z,a as G,b as V,c as X,g as Z,d as ee,e as te,f as ne}from"./alert-dialog-DYJD4QnY.js";function ue(Q){const e=oe.c(86),{deleteState:s,cancelDelete:a,confirmDelete:d,confirmForceDelete:c}=Q,t=le(),K=s.mode==="deleting";let f;e[0]!==a?(f=W=>{W||a()},e[0]=a,e[1]=f):f=e[1];let u;e[2]!==t?(u=t("common.deleteConnectionDialogs.title"),e[2]=t,e[3]=u):u=e[3];let D;e[4]!==u?(D=n.jsx(z,{children:u}),e[4]=u,e[5]=D):D=e[5];let C;e[6]!==t?(C=t("common.deleteConnectionDialogs.description"),e[6]=t,e[7]=C):C=e[7];const k=s.mode==="deleting"&&s.connection.title;let o;e[8]!==k?(o=n.jsx("span",{className:"font-medium text-foreground",children:k}),e[8]=k,e[9]=o):o=e[9];let l;e[10]!==C||e[11]!==o?(l=n.jsxs(G,{children:[C," ",o,"."]}),e[10]=C,e[11]=o,e[12]=l):l=e[12];let i;e[13]!==D||e[14]!==l?(i=n.jsxs(V,{children:[D,l]}),e[13]=D,e[14]=l,e[15]=i):i=e[15];let m;e[16]!==t?(m=t("common.deleteConnectionDialogs.cancel"),e[16]=t,e[17]=m):m=e[17];let r;e[18]!==m?(r=n.jsx(X,{children:m}),e[18]=m,e[19]=r):r=e[19];let g;e[20]!==t?(g=t("common.deleteConnectionDialogs.delete"),e[20]=t,e[21]=g):g=e[21];let x;e[22]!==d||e[23]!==g?(x=n.jsx(Z,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:g}),e[22]=d,e[23]=g,e[24]=x):x=e[24];let h;e[25]!==r||e[26]!==x?(h=n.jsxs(ee,{children:[r,x]}),e[25]=r,e[26]=x,e[27]=h):h=e[27];let j;e[28]!==h||e[29]!==i?(j=n.jsxs(te,{children:[i,h]}),e[28]=h,e[29]=i,e[30]=j):j=e[30];let p;e[31]!==K||e[32]!==j||e[33]!==f?(p=n.jsx(ne,{open:K,onOpenChange:f,children:j}),e[31]=K,e[32]=j,e[33]=f,e[34]=p):p=e[34];const J=s.mode==="force-deleting";let N;e[35]!==a?(N=W=>{W||a()},e[35]=a,e[36]=N):N=e[36];let E;e[37]!==t?(E=t("common.deleteConnectionDialogs.forceDeleteTitle"),e[37]=t,e[38]=E):E=e[38];let O;e[39]!==E?(O=n.jsx(z,{children:E}),e[39]=E,e[40]=O):O=e[40];let v;e[41]!==t?(v=t("common.deleteConnectionDialogs.forceDeleteDescription"),e[41]=t,e[42]=v):v=e[42];const M=s.mode==="force-deleting"&&s.connection.title;let y;e[43]!==M?(y=n.jsx("span",{className:"font-medium text-foreground",children:M}),e[43]=M,e[44]=y):y=e[44];let S;e[45]!==t?(S=t("common.deleteConnectionDialogs.isUsedByAgents"),e[45]=t,e[46]=S):S=e[46];const P=s.mode==="force-deleting"&&s.agentNames;let T;e[47]!==P?(T=n.jsx("span",{className:"font-medium text-foreground",children:P}),e[47]=P,e[48]=T):T=e[48];let A;e[49]!==v||e[50]!==y||e[51]!==S||e[52]!==T?(A=n.jsxs("p",{children:[v," ",y," ",S," ",T,"."]}),e[49]=v,e[50]=y,e[51]=S,e[52]=T,e[53]=A):A=e[53];let _;e[54]!==t?(_=t("common.deleteConnectionDialogs.forceDeleteWarning"),e[54]=t,e[55]=_):_=e[55];let F;e[56]!==_?(F=n.jsx("p",{className:"mt-2",children:_}),e[56]=_,e[57]=F):F=e[57];let L;e[58]!==A||e[59]!==F?(L=n.jsx(G,{asChild:!0,children:n.jsxs("div",{children:[A,F]})}),e[58]=A,e[59]=F,e[60]=L):L=e[60];let b;e[61]!==O||e[62]!==L?(b=n.jsxs(V,{children:[O,L]}),e[61]=O,e[62]=L,e[63]=b):b=e[63];let I;e[64]!==t?(I=t("common.deleteConnectionDialogs.cancel"),e[64]=t,e[65]=I):I=e[65];let R;e[66]!==I?(R=n.jsx(X,{children:I}),e[66]=I,e[67]=R):R=e[67];let U;e[68]!==t?(U=t("common.deleteConnectionDialogs.deleteAnyway"),e[68]=t,e[69]=U):U=e[69];let q;e[70]!==c||e[71]!==U?(q=n.jsx(Z,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:U}),e[70]=c,e[71]=U,e[72]=q):q=e[72];let $;e[73]!==R||e[74]!==q?($=n.jsxs(ee,{children:[R,q]}),e[73]=R,e[74]=q,e[75]=$):$=e[75];let w;e[76]!==b||e[77]!==$?(w=n.jsxs(te,{children:[b,$]}),e[76]=b,e[77]=$,e[78]=w):w=e[78];let H;e[79]!==J||e[80]!==N||e[81]!==w?(H=n.jsx(ne,{open:J,onOpenChange:N,children:w}),e[79]=J,e[80]=N,e[81]=w,e[82]=H):H=e[82];let B;return e[83]!==p||e[84]!==H?(B=n.jsxs(n.Fragment,{children:[p,H]}),e[83]=p,e[84]=H,e[85]=B):B=e[85],B}function De({onSuccess:Q}={}){const{org:e}=se(),s=ie(),a=ce(),[d,c]=re.useState({mode:"idle"}),t=()=>{ae(s,e.id)},K=o=>{de(o),s.invalidateQueries({predicate:l=>l.queryKey[1]===fe&&l.queryKey[3]===o})},f=o=>{t(),K(o),Y.success("Connection deleted successfully"),c({mode:"idle"}),Q?.()};return{deleteState:d,requestDelete:o=>{c({mode:"deleting",connection:o})},cancelDelete:()=>{c({mode:"idle"})},confirmDelete:async()=>{if(d.mode!=="deleting")return;const o=d.connection;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o.id}),f(o.id)}catch(l){const i=l instanceof Error?l.message:String(l),m=i.replace(/^Error:\s*/,"");try{const r=JSON.parse(m);if(r.code==="CONNECTION_IN_USE"&&r.agentNames){c({mode:"force-deleting",connection:o,agentNames:r.agentNames.map(g=>`"${g}"`).join(", ")});return}}catch{}Y.error(`Failed to delete connection: ${i}`)}},confirmForceDelete:async()=>{if(d.mode!=="force-deleting")return;const o=d.connection.id;c({mode:"idle"});try{await a.call("COLLECTION_CONNECTIONS_DELETE",{id:o,force:!0}),f(o)}catch(l){const i=l instanceof Error?l.message:String(l);Y.error(`Failed to delete connection: ${i}`)}}}}export{ue as D,De as u};
@@ -1 +1 @@
1
- import{c as s,m,K as c}from"./index-CT-xO5mU.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
1
+ import{c as s,m,K as c}from"./index-DjeyX30Y.js";function l(){const e=s.c(5);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:c.deploymentAdminMe(),queryFn:d,staleTime:1/0,retry:2},e[0]=t):t=e[0];const{data:a,isLoading:i}=m(t),r=a==="admin",o=a==="unverified";let n;return e[1]!==i||e[2]!==r||e[3]!==o?(n={isAdmin:r,loading:i,needsEmailVerification:o},e[1]=i,e[2]=r,e[3]=o,e[4]=n):n=e[4],n}async function d(){const e=await fetch("/api/_admin/me",{credentials:"include"});if(e.status>=500)throw new Error(`admin/me request failed: ${e.status}`);return e.ok?"admin":(await e.json().catch(u)).error==="email_not_verified"?"unverified":"denied"}function u(){return{}}export{l as u};
@@ -1 +1 @@
1
- import{c as o,a2 as n,o as m,K as E,m as I,ao as T,dX as f}from"./index-CT-xO5mU.js";import{k as F,m as N,H as y}from"./location-BjlyegC2.js";import{o as P}from"./use-org-fs-C0Ksj3qD.js";function g(i){const e=o.c(14),{org:s}=n(),r=m();let l;e[0]!==s.id||e[1]!==i?(l=E.projectFolderEnsure(s.id,i?.id??"",i?F(i):""),e[0]=s.id,e[1]=i,e[2]=l):l=e[2];let t;e[3]!==s.id||e[4]!==s.slug||e[5]!==i?.id||e[6]!==r?(t=async()=>{const u=await T(s.slug,"PROJECT_FOLDER_ENSURE",{id:i?.id??""});return u.created&&(P(r,s.id,y),f(r,s.id,"VIRTUAL_MCP")),u},e[3]=s.id,e[4]=s.slug,e[5]=i?.id,e[6]=r,e[7]=t):t=e[7];let a;e[8]!==i?(a=!!i&&!N(i),e[8]=i,e[9]=a):a=e[9];let d;e[10]!==l||e[11]!==t||e[12]!==a?(d={queryKey:l,queryFn:t,enabled:a,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,retry:!1},e[10]=l,e[11]=t,e[12]=a,e[13]=d):d=e[13],I(d)}export{g as u};
1
+ import{c as o,a2 as n,o as m,K as E,m as I,ao as T,dX as f}from"./index-DjeyX30Y.js";import{k as F,m as N,H as y}from"./location-BjlyegC2.js";import{o as P}from"./use-org-fs-BPZLK6VF.js";function g(i){const e=o.c(14),{org:s}=n(),r=m();let l;e[0]!==s.id||e[1]!==i?(l=E.projectFolderEnsure(s.id,i?.id??"",i?F(i):""),e[0]=s.id,e[1]=i,e[2]=l):l=e[2];let t;e[3]!==s.id||e[4]!==s.slug||e[5]!==i?.id||e[6]!==r?(t=async()=>{const u=await T(s.slug,"PROJECT_FOLDER_ENSURE",{id:i?.id??""});return u.created&&(P(r,s.id,y),f(r,s.id,"VIRTUAL_MCP")),u},e[3]=s.id,e[4]=s.slug,e[5]=i?.id,e[6]=r,e[7]=t):t=e[7];let a;e[8]!==i?(a=!!i&&!N(i),e[8]=i,e[9]=a):a=e[9];let d;e[10]!==l||e[11]!==t||e[12]!==a?(d={queryKey:l,queryFn:t,enabled:a,staleTime:Number.POSITIVE_INFINITY,gcTime:Number.POSITIVE_INFINITY,retry:!1},e[10]=l,e[11]=t,e[12]=a,e[13]=d):d=e[13],I(d)}export{g as u};
@@ -1 +1 @@
1
- import{c as s}from"./index-CT-xO5mU.js";import{w as v,c as d}from"./section-preview-url-7zfngvgW.js";import{u as h,ak as w,al as P}from"./site-editor-toast-BLu5nEtB.js";import{a as b}from"./input-CQAcg-xS.js";function g(e){const t=s.c(3),i=b(e?.virtualMcpId).runtime==="cms",r=h(e?.virtualMcpId,e?.branch),n=r.kind==="protocol"&&r.source==="github",o=w(e),u=P(n?e:null);if(!e||!i)return null;if(n)return u;let l;return t[0]!==o||t[1]!==e?(l=o?d({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function I(e){const t=s.c(11);let i;t[0]!==e?(i=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=i):i=t[1];const r=g(i),n=e?.previewServerUrl??null;let o=null;if(n)try{let f;t[2]!==n?(f=new URL(n),t[2]=n,t[3]=f):f=t[3],o=f.host}catch{o=null}let u;t[4]!==r||t[5]!==e||t[6]!==n?(u=e&&n&&r?v(new URL(e.path,n).toString(),r):null,t[4]=r,t[5]=e,t[6]=n,t[7]=u):u=t[7];const l=u;let c;return t[8]!==o||t[9]!==l?(c={url:l,host:o},t[8]=o,t[9]=l,t[10]=c):c=t[10],c}export{g as a,I as u};
1
+ import{c as s}from"./index-DjeyX30Y.js";import{w as v,c as d}from"./section-preview-url-7zfngvgW.js";import{u as h,ak as w,al as P}from"./site-editor-toast-BQ9NvsaW.js";import{a as b}from"./input-Cy31fgjy.js";function g(e){const t=s.c(3),i=b(e?.virtualMcpId).runtime==="cms",r=h(e?.virtualMcpId,e?.branch),n=r.kind==="protocol"&&r.source==="github",o=w(e),u=P(n?e:null);if(!e||!i)return null;if(n)return u;let l;return t[0]!==o||t[1]!==e?(l=o?d({...e,...o}):null,t[0]=o,t[1]=e,t[2]=l):l=t[2],l}function I(e){const t=s.c(11);let i;t[0]!==e?(i=e?{orgSlug:e.orgSlug,virtualMcpId:e.virtualMcpId,branch:e.branch}:null,t[0]=e,t[1]=i):i=t[1];const r=g(i),n=e?.previewServerUrl??null;let o=null;if(n)try{let f;t[2]!==n?(f=new URL(n),t[2]=n,t[3]=f):f=t[3],o=f.host}catch{o=null}let u;t[4]!==r||t[5]!==e||t[6]!==n?(u=e&&n&&r?v(new URL(e.path,n).toString(),r):null,t[4]=r,t[5]=e,t[6]=n,t[7]=u):u=t[7];const l=u;let c;return t[8]!==o||t[9]!==l?(c={url:l,host:o},t[8]=o,t[9]=l,t[10]=c):c=t[10],c}export{g as a,I as u};
@@ -1 +1 @@
1
- import{c as r,a2 as f,a9 as d,K as C,m as E,R as I,o as F,e as g}from"./index-CT-xO5mU.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
1
+ import{c as r,a2 as f,a9 as d,K as C,m as E,R as I,o as F,e as g}from"./index-DjeyX30Y.js";function q(){const e=r.c(7),{org:t}=f(),o=d();let n;e[0]!==t.id?(n=C.fileConfigs(t.id),e[0]=t.id,e[1]=n):n=e[1];let i;e[2]!==o?(i=()=>o.call("FILE_CONFIG_LIST",{}),e[2]=o,e[3]=i):i=e[3];let s;e[4]!==n||e[5]!==i?(s={queryKey:n,staleTime:6e4,queryFn:i},e[4]=n,e[5]=i,e[6]=s):s=e[6];const{data:l}=I(s);return l.configs}function _(e){const t=r.c(10);let o;t[0]!==e?(o=e===void 0?{}:e,t[0]=e,t[1]=o):o=t[1];const{enabled:n}=o,i=n===void 0?!0:n,{org:s}=f(),l=d();let u;t[2]!==s.id?(u=C.fileConfigs(s.id),t[2]=s.id,t[3]=u):u=t[3];const y=i&&!!s.id;let c;t[4]!==l?(c=()=>l.call("FILE_CONFIG_LIST",{}),t[4]=l,t[5]=c):c=t[5];let a;return t[6]!==u||t[7]!==y||t[8]!==c?(a={queryKey:u,enabled:y,staleTime:6e4,queryFn:c},t[6]=u,t[7]=y,t[8]=c,t[9]=a):a=t[9],E(a)}function L(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_CREATE",{...u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}function S(){const e=r.c(8),{org:t}=f(),o=d(),n=F();let i;e[0]!==o?(i=u=>o.call("FILE_CONFIG_DELETE",{id:u}),e[0]=o,e[1]=i):i=e[1];let s;e[2]!==t||e[3]!==n?(s=()=>{n.invalidateQueries({queryKey:C.fileConfigs(t.id)})},e[2]=t,e[3]=n,e[4]=s):s=e[4];let l;return e[5]!==i||e[6]!==s?(l={mutationFn:i,onSuccess:s},e[5]=i,e[6]=s,e[7]=l):l=e[7],g(l)}export{q as a,L as b,S as c,_ as u};
@@ -1 +1 @@
1
- import{r as e}from"./index-CT-xO5mU.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
1
+ import{r as e}from"./index-DjeyX30Y.js";function v(n,u,c=!1,s){const r=e.useRef(null),o=e.useRef(null),f=e.useRef(n),i=e.useRef(u),R=e.useRef(c),l=e.useRef(s);f.current=n,i.current=u,R.current=c,l.current=s;const[p]=e.useState(()=>t=>{o.current=t,r.current&&(r.current.disconnect(),r.current=null),t&&queueMicrotask(()=>{if(o.current!==t)return;const a=new IntersectionObserver(x=>{x[0]?.isIntersecting&&i.current&&!R.current&&f.current()},{root:l.current?.current??null,rootMargin:"0px 0px 200px 0px"});a.observe(t),r.current=a})});return p}export{v as u};
@@ -1 +1 @@
1
- import{r as L,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,a9 as K,ax as W,m as X}from"./index-CT-xO5mU.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-B3JjDNl0.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-CTDMYNay.js";import{T as re}from"./textarea-BsQtSRL4.js";import{u as ae}from"./use-org-auth-client-CMWVQK83.js";import{u as le}from"./use-organization-roles-BbFM2_FD.js";const ce=H().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),b=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:x.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:x.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:b}=W(),r=b||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
1
+ import{r as L,a2 as q,o as Q,a as V,aE as z,b as B,e as T,y as F,t as S,K as M,j as t,D as G,p as U,q as Z,s as k,v as Y,w as $,B as P,aG as H,c as J,a9 as K,ax as W,m as X}from"./index-DjeyX30Y.js";import{a as _,F as A,b as N,c as ee,d as I,f as O}from"./form-CGraaEAE.js";import{S as se,b as te,a as ie,d as ne,c as oe}from"./select-DB9aGezp.js";import{T as re}from"./textarea-Bi1WfesL.js";import{u as ae}from"./use-org-auth-client-DLu7wwJ8.js";import{u as le}from"./use-organization-roles-DbvmpvPK.js";const ce=H().email("Invalid email address");function me(e){if(!e.trim())return[];const d=e.split(/[,;\n]/).map(c=>c.trim().toLowerCase()).filter(c=>c.length>0);return Array.from(new Set(d))}function ve({trigger:e}){const[d,c]=L.useState(!1),{locator:h}=q(),b=ae(),r=Q(),{data:m}=V.useSession(),l=m?.user?.email,{roles:g,isLoading:u}=le(),f=g.filter(n=>n.role!=="owner"),o=z({mode:"onChange",defaultValues:{emailsText:"",role:"user"}}),E=o.watch("emailsText"),j=o.watch("role"),p=me(E).filter(n=>{const s=ce.safeParse(n).success,a=!l||n!==l.toLowerCase();return s&&a}),i=B(),x=T({mutationFn:async({emails:n,role:s})=>{if(!s)throw new Error(i("common.inviteMemberDialog.errorSelectRole"));const a=await Promise.allSettled(n.map(async y=>{const R=await b.organization.inviteMember({email:y,role:s});if(R.error)throw new Error(R.error.message);return R.data})),w=a.filter(y=>y.status==="rejected");if(w.length>0)throw new Error(i("common.inviteMemberDialog.errorFailedInvite",{count:w.length}));return a},onSuccess:(n,{emails:s,role:a})=>{F("member_invited",{count:s.length,role:a}),r.invalidateQueries({queryKey:M.members(h)}),r.invalidateQueries({queryKey:M.invitations(h)}),S.success(s.length===1?i("common.inviteMemberDialog.successSingle"):i("common.inviteMemberDialog.successMultiple",{count:s.length})),o.reset({emailsText:"",role:"user"}),c(!1)},onError:(n,{emails:s,role:a})=>{F("member_invite_failed",{count:s.length,role:a,error:n instanceof Error?n.message:String(n)}),S.error(n instanceof Error?n.message:i("common.inviteMemberDialog.errorGeneric"))}}),D=n=>{if(p.length===0){S.error(i("common.inviteMemberDialog.errorNoValidEmail"));return}if(!n.role){S.error(i("common.inviteMemberDialog.errorSelectRole"));return}x.mutate({emails:p,role:n.role})},v=p.length>0&&!!j;return t.jsxs(G,{open:d,onOpenChange:c,children:[t.jsx(U,{asChild:!0,children:e}),t.jsxs(Z,{className:"sm:max-w-lg",children:[t.jsx(k,{children:t.jsx(Y,{children:i("common.inviteMemberDialog.title")})}),t.jsx(_,{...o,children:t.jsxs("form",{onSubmit:o.handleSubmit(D),className:"space-y-4",children:[t.jsx(A,{control:o.control,name:"emailsText",render:({field:n})=>t.jsxs(N,{children:[t.jsx(ee,{children:i("common.inviteMemberDialog.emailLabel")}),t.jsx(I,{children:t.jsx(re,{...n,disabled:x.isPending,placeholder:i("common.inviteMemberDialog.emailPlaceholder"),className:"min-h-[120px] resize-none"})}),t.jsx(O,{})]})}),t.jsx(A,{control:o.control,name:"role",render:({field:n})=>t.jsxs(N,{children:[t.jsx(I,{children:t.jsxs(se,{value:n.value,onValueChange:n.onChange,disabled:x.isPending||u,children:[t.jsx(te,{className:"w-full",children:t.jsx(ie,{placeholder:i("common.inviteMemberDialog.roleSelectPlaceholder")})}),t.jsx(ne,{children:f.map(s=>{const a=[];return s.isBuiltin||(s.allowsAllStaticPermissions?a.push(i("common.inviteMemberDialog.permFullOrgAccess")):s.staticPermissionCount&&s.staticPermissionCount>0&&a.push(i("common.inviteMemberDialog.permOrgPerms",{count:s.staticPermissionCount})),s.allowsAllConnections?a.push(i("common.inviteMemberDialog.permAllConnections")):s.connectionCount&&s.connectionCount>0&&a.push(i("common.inviteMemberDialog.permConnections",{count:s.connectionCount})),(s.connectionCount!==0||s.allowsAllConnections)&&(s.allowsAllTools?a.push(i("common.inviteMemberDialog.permAllTools")):s.toolCount&&s.toolCount>0&&a.push(i("common.inviteMemberDialog.permTools",{count:s.toolCount})))),t.jsx(oe,{value:s.role,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:s.label}),!s.isBuiltin&&a.length>0&&t.jsx("span",{className:"text-xs text-muted-foreground",children:a.join(", ")})]})},s.role)})})]})}),t.jsx(O,{})]})}),t.jsxs($,{children:[t.jsx(P,{variant:"outline",onClick:()=>{o.reset({emailsText:"",role:"user"}),c(!1)},type:"button",disabled:x.isPending,children:i("common.inviteMemberDialog.cancelButton")}),t.jsx(P,{type:"submit",disabled:x.isPending||!v,children:x.isPending?i("common.inviteMemberDialog.invitingButton"):i("common.inviteMemberDialog.inviteButton",{count:p.length||0})})]})]})})]})]})}function xe(){const e=J.c(10),{org:d}=q(),c=K(),{capabilities:h,isPrivileged:b}=W(),r=b||!!h["members:manage"];let m;e[0]!==d.id?(m=M.organizationJoinRequests(d.id),e[0]=d.id,e[1]=m):m=e[1];let l;e[2]!==c?(l=()=>c.call("ORGANIZATION_JOIN_REQUEST_LIST",{}),e[2]=c,e[3]=l):l=e[3];const g=!!d.id&&r;let u;e[4]!==m||e[5]!==l||e[6]!==g?(u={queryKey:m,queryFn:l,enabled:g},e[4]=m,e[5]=l,e[6]=g,e[7]=u):u=e[7];const{data:f}=X(u);let o;return e[8]!==f?.requests?(o=f?.requests??[],e[8]=f?.requests,e[9]=o):o=e[9],o}function be(){const e=J.c(29),{org:d,locator:c}=q(),h=K(),b=Q(),r=B();let m;e[0]!==c||e[1]!==d||e[2]!==b?(m=()=>{b.invalidateQueries({queryKey:M.organizationJoinRequests(d.id)}),b.invalidateQueries({queryKey:M.members(c)})},e[0]=c,e[1]=d,e[2]=b,e[3]=m):m=e[3];const l=m;let g;e[4]!==h?(g=v=>h.call("ORGANIZATION_JOIN_REQUEST_APPROVE",{requestId:v}),e[4]=h,e[5]=g):g=e[5];let u;e[6]!==l||e[7]!==r?(u=()=>{l(),S.success(r("settings.joinRequestsSection.approved"))},e[6]=l,e[7]=r,e[8]=u):u=e[8];let f;e[9]!==r?(f=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.approveFailed")),e[9]=r,e[10]=f):f=e[10];let o;e[11]!==g||e[12]!==u||e[13]!==f?(o={mutationFn:g,onSuccess:u,onError:f},e[11]=g,e[12]=u,e[13]=f,e[14]=o):o=e[14];const E=T(o);let j;e[15]!==h?(j=v=>h.call("ORGANIZATION_JOIN_REQUEST_DENY",{requestId:v}),e[15]=h,e[16]=j):j=e[16];let C;e[17]!==l||e[18]!==r?(C=()=>{l(),S.success(r("settings.joinRequestsSection.denied"))},e[17]=l,e[18]=r,e[19]=C):C=e[19];let p;e[20]!==r?(p=v=>S.error(v instanceof Error?v.message:r("settings.joinRequestsSection.denyFailed")),e[20]=r,e[21]=p):p=e[21];let i;e[22]!==j||e[23]!==C||e[24]!==p?(i={mutationFn:j,onSuccess:C,onError:p},e[22]=j,e[23]=C,e[24]=p,e[25]=i):i=e[25];const x=T(i);let D;return e[26]!==E||e[27]!==x?(D={approve:E,deny:x},e[26]=E,e[27]=x,e[28]=D):D=e[28],D}export{ve as I,be as a,xe as u};
@@ -1 +1 @@
1
- import{c as Ue,b as He,u as Le,a2 as Oe,ff as Be,fg as Ke,fh as le,fi as de,al as $e,aj as me,fj as We,fk as qe,r as Y,dW as Qe,M as pe,fl as _e,fm as ze}from"./index-CT-xO5mU.js";import{l as Ge,n as Je,u as Xe,c as Ye,o as Ze,a as F,q as et,v as tt}from"./use-project-native-view-presence-CFLUF0Qf.js";import{b as at}from"./agent-icon-2gpOTQkx.js";import{i as ot}from"./Monitor01-B-njRpwx.js";import{u as nt}from"./use-connection-CYWKqRYC.js";import{a as st}from"./use-mcp-client-Cv85PJpG.js";import{u as it}from"./use-mcp-tools-D5NzpH6L.js";import{a as ct}from"./repository-binding-D6iSPygW.js";import{g as rt}from"./types-B3o00suf.js";import{t as lt}from"./utils-CVEq3hMx.js";import{u as dt}from"./index-Cwl4zuYK.js";import{F as ue}from"./file-type-icon-B_xAgef1.js";import{a as mt,u as pt}from"./use-panel-navigate-Bn01w_Hx.js";import{r as Z}from"./resolve-tab-icon-BV6oV-jC.js";import{u as ut}from"./use-task-metadata-MAFDGrlB.js";import{r as ft}from"./preview-source-BsRLGWUP.js";import{i as bt,r as Tt,s as vt}from"./shell-layout-Dm_OFDNO.js";import{a as It}from"./input-CQAcg-xS.js";import{u as Pt}from"./use-organization-settings-B1smoLtY.js";import{u as kt}from"./use-project-scope-BF0yZckc.js";import{c as yt}from"./chat-context-B0Aat-dR.js";import{r as gt}from"./virtual-mcp-SNhYn6sa.js";function Gt(o){const e=Ue.c(35),d=He(),{openPanel:f,closePanel:x}=mt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=pt(),te=Ge(),i=ct(o.virtualMcpId),T=ut(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=yt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,I=T?.expanded_tools??[],P=Pt(),{scopeId:Te,project:ve}=kt(),k=Je(Te,ve,i),y=Xe(k.project);Ye(k.project?.id);const ae=Ze(k.resolvedScopeId,F(k.project?.metadata),y.presence);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={includeVirtual:!0},e[1]=g):g=e[1];const p=nt(g),Ie=dt(),E=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(w=ft({threadId:o.taskId,sandboxBranch:E,agentHasRepo:F(i?.metadata),threadHasRepo:F(T)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=w):w=e[7];const Pe=w,U=Ie.lifecycle.phase==="running",{runtime:ke,resolved:oe}=It(o.virtualMcpId),H=!!r&&U;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=st({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&U;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ye}=it(V),se=r&&U?(ye?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:lt(t.name),icon:null})):[],B=se[0],ge=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,we=gt(m),ie={assets:y.assetsPending,siteAccess:y.siteAccessPending,releases:y.releasesPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(Vt)}:null}),he=u||m?{defaultMainView:u,tabs:c.map(ht)}:null,C=Tt({hasSource:Pe==="repo"||P,runtime:ke,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=u?.type,ce=et(Ce,ae,ie,C,oe),K=ce?le(null):Me,Se=tt(M,ae,ie),je=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||je||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const Ne=S,W=new Map;for(const t of I){const s=me(t.appId,t.toolName);W.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ge){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);W.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const q=We(a),Q=q?q.key.split("/").pop()??q.key:null,Ae=Q?[{id:a,title:Q,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:Q,...t})}}]:[],j=qe(a),De=j?[{id:a,title:(j.path.split("/").pop()??j.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(j.path.startsWith("pages/")?at:ot,t)}}]:[],_=Qe(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=bt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:Ne(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const xe=[...Fe,...Ae,...De,...Re,...c.map(N),...Array.from(W.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=xe.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),Ee=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=Ee===A;let D;e[19]!==a||e[20]!==x||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==P?(D=t=>{if(vt({reportsOnly:P,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:wt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?x():f(s.tabId)},e[19]=a,e[20]=x,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=P,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==I||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:I,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=I,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!rt(o._meta)}export{Gt as u};
1
+ import{c as Ue,b as He,u as Le,a2 as Oe,ff as Be,fg as Ke,fh as le,fi as de,al as $e,aj as me,fj as We,fk as qe,r as Y,dW as Qe,M as pe,fl as _e,fm as ze}from"./index-DjeyX30Y.js";import{l as Ge,n as Je,u as Xe,c as Ye,o as Ze,a as F,q as et,v as tt}from"./use-project-native-view-presence-CR46zKPn.js";import{b as at}from"./agent-icon-BoeBuKNE.js";import{i as ot}from"./Monitor01-iXRq_BRo.js";import{u as nt}from"./use-connection-UjMngEYa.js";import{a as st}from"./use-mcp-client-mxUa3Lsm.js";import{u as it}from"./use-mcp-tools-D1zqQRh2.js";import{a as ct}from"./repository-binding-CxxK4zqI.js";import{g as rt}from"./types-B38bkUuB.js";import{t as lt}from"./utils-CVEq3hMx.js";import{u as dt}from"./index-OKHpYAkN.js";import{F as ue}from"./file-type-icon-BLPYW-jR.js";import{a as mt,u as pt}from"./use-panel-navigate-BfsxK4kz.js";import{r as Z}from"./resolve-tab-icon-C9wuMh4a.js";import{u as ut}from"./use-task-metadata-DIMUC10R.js";import{r as ft}from"./preview-source-BsRLGWUP.js";import{i as bt,r as Tt,s as vt}from"./shell-layout-D1m8Ud7v.js";import{a as It}from"./input-Cy31fgjy.js";import{u as Pt}from"./use-organization-settings-BzX4Hzqv.js";import{u as kt}from"./use-project-scope-DgHI5Sbx.js";import{c as yt}from"./chat-context-rrAFSxTj.js";import{r as gt}from"./virtual-mcp-DugkGZOU.js";function Gt(o){const e=Ue.c(35),d=He(),{openPanel:f,closePanel:x}=mt();let b;e[0]===Symbol.for("react.memo_cache_sentinel")?(b={strict:!1},e[0]=b):b=e[0];const fe=Le(b),ee=pt(),te=Ge(),i=ct(o.virtualMcpId),T=ut(o.taskId),{org:n}=Oe(),{currentBranch:be,activeTask:v}=yt(),m=i?.metadata.ui?.layout??null,c=m?.tabs??[],r=i?.id?Be(i.id):null,I=T?.expanded_tools??[],P=Pt(),{scopeId:Te,project:ve}=kt(),k=Je(Te,ve,i),y=Xe(k.project);Ye(k.project?.id);const ae=Ze(k.resolvedScopeId,F(k.project?.metadata),y.presence);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g={includeVirtual:!0},e[1]=g):g=e[1];const p=nt(g),Ie=dt(),E=v?.branch??be;let w;e[2]!==v?.metadata||e[3]!==o.taskId||e[4]!==i?.metadata||e[5]!==T||e[6]!==E?(w=ft({threadId:o.taskId,sandboxBranch:E,agentHasRepo:F(i?.metadata),threadHasRepo:F(T)||F(v?.metadata)}),e[2]=v?.metadata,e[3]=o.taskId,e[4]=i?.metadata,e[5]=T,e[6]=E,e[7]=w):w=e[7];const Pe=w,U=Ie.lifecycle.phase==="running",{runtime:ke,resolved:oe}=It(o.virtualMcpId),H=!!r&&U;let h;e[8]!==H?(h={enabled:H},e[8]=H,e[9]=h):h=e[9];const ne=st({connectionId:r,orgId:n.id,orgSlug:n.slug},h),L=ne,O=!!ne&&U;let V;e[10]!==L||e[11]!==O?(V={client:L,enabled:O},e[10]=L,e[11]=O,e[12]=V):V=e[12];const{data:ye}=it(V),se=r&&U?(ye?.tools??[]).filter(Mt).map(t=>({connectionId:r,toolName:t.name,label:lt(t.name),icon:null})):[],B=se[0],ge=B?se:[],u=B&&r?{type:"ext-apps",id:r,toolName:B.toolName}:m?.defaultMainView??null,we=gt(m),ie={assets:y.assetsPending,siteAccess:y.siteAccessPending,releases:y.releasesPending},{activeTab:M,mainOpen:l}=Ke({panelTabId:ee,mainPanelParam:fe.mainpanel,routeDefaultMain:te,metadata:u||m?{defaultMainView:u,tabs:c.map(Vt)}:null}),he=u||m?{defaultMainView:u,tabs:c.map(ht)}:null,C=Tt({hasSource:Pe==="repo"||P,runtime:ke,cmsMode:we}),Ve=C.includes("content"),Me=le(he),Ce=u?.type,ce=et(Ce,ae,ie,C,oe),K=ce?le(null):Me,Se=tt(M,ae,ie),je=!C.includes("code")&&oe&&de(M)!==null,a=!ee&&!te&&ce||M==="content"&&!Ve||je||Se?K:M,$=$e(a);let S;e[13]!==d?(S=t=>d(t==="site-editor"?"common.mainPanelTabs.preview":t==="content"?"common.mainPanelTabs.content":"common.mainPanelTabs.code"),e[13]=d,e[14]=S):S=e[14];const Ne=S,W=new Map;for(const t of I){const s=me(t.appId,t.toolName);W.set(s,{id:s,title:t.toolName,appId:t.appId,iconKey:t.toolName})}for(const t of ge){if(t.toolName==="fetch_assets")continue;const s=me(t.connectionId,t.toolName);W.set(s,{id:s,title:t.label||t.toolName,appId:t.connectionId,iconKey:t.toolName,iconUrl:t.icon??null})}const q=We(a),Q=q?q.key.split("/").pop()??q.key:null,Ae=Q?[{id:a,title:Q,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:Q,...t})}}]:[],j=qe(a),De=j?[{id:a,title:(j.path.split("/").pop()??j.path).replace(/\.html$/i,""),kind:"file",icon:{kind:"component",Component:t=>Y.createElement(j.path.startsWith("pages/")?at:ot,t)}}]:[],_=Qe(a),z=_?_.path.split("/").pop()??_.path:null,Re=z?[{id:a,title:z,kind:"file",icon:{kind:"component",Component:t=>Y.createElement(ue,{filename:z,...t})}}]:[],Fe=bt(a)?C.map(t=>({id:t==="code"&&de(a)?a:t,title:Ne(t),kind:"system",icon:Z({tabId:t,kind:"system",connections:p})})):[];let N;e[15]!==p?(N=t=>({id:_e(t.id),title:t.title,kind:"agent",icon:Z({tabId:t.id,kind:"agent",appId:t.view.appId,connections:p})}),e[15]=p,e[16]=N):N=e[16];const xe=[...Fe,...Ae,...De,...Re,...c.map(N),...Array.from(W.values()).map(t=>({id:t.id,title:t.title,kind:"expanded",icon:Z({tabId:t.iconKey,kind:"expanded",appId:t.appId,iconUrl:t.iconUrl,connections:p})}))],re=new Set,G=xe.filter(t=>re.has(t.id)?!1:(re.add(t.id),!0)),Ee=o.virtualMcpId;let A;e[17]!==n.id?(A=pe(n.id),e[17]=n.id,e[18]=A):A=e[18];const J=Ee===A;let D;e[19]!==a||e[20]!==x||e[21]!==l||e[22]!==J||e[23]!==f||e[24]!==n.id||e[25]!==P?(D=t=>{if(vt({reportsOnly:P,onReportAgent:J,tabId:t})){f(t,{virtualmcpid:pe(n.id),search:wt});return}const s=ze({clickedId:t,activeTab:a,mainOpen:l});"close"in s?x():f(s.tabId)},e[19]=a,e[20]=x,e[21]=l,e[22]=J,e[23]=f,e[24]=n.id,e[25]=P,e[26]=D):D=e[26];const X=D;let R;return e[27]!==a||e[28]!==$||e[29]!==I||e[30]!==c||e[31]!==l||e[32]!==X||e[33]!==G?(R={activeTab:a,mainOpen:l,setActiveTab:X,layoutTabs:c,expandedTools:I,automationTabParsed:$,tabs:G},e[27]=a,e[28]=$,e[29]=I,e[30]=c,e[31]=l,e[32]=X,e[33]=G,e[34]=R):R=e[34],R}function wt(o){return{...o,thread:void 0}}function ht(o){return{id:o.id}}function Vt(o){return{id:o.id}}function Mt(o){return!!rt(o._meta)}export{Gt as u};
@@ -1 +1 @@
1
- import{c as b,b as k,a3 as N,aW as S,j as o,a2 as $,K as A,R as L}from"./index-CT-xO5mU.js";import{B as g}from"./badge-bf_kmzeT.js";import{c as v,T,a as I,b as R}from"./tooltip-7apN1qsW.js";import{g as _}from"./types-B3o00suf.js";import{s as H}from"./Image01-CMp-2bfg.js";import{q as P,aR as U}from"./agent-icon-2gpOTQkx.js";import{i as w}from"./mcp-oauth-CybeVIZU.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:H,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:P,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=R,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,Y as u};
1
+ import{c as b,b as k,a3 as N,aW as S,j as o,a2 as $,K as A,R as L}from"./index-DjeyX30Y.js";import{B as g}from"./badge-immHUAWH.js";import{c as v,T,a as I,b as R}from"./tooltip-BjOKp_yY.js";import{g as _}from"./types-B38bkUuB.js";import{s as H}from"./Image01-CnYFBoF2.js";import{q as P,aR as U}from"./agent-icon-BoeBuKNE.js";import{i as w}from"./mcp-oauth-l-3wO0u2.js";const O=[{key:"readOnlyHint",labelKey:"tools.toolsList.readOnly",Icon:H,variant:"secondary"},{key:"destructiveHint",labelKey:"tools.toolsList.destructive",Icon:N,variant:"destructive"},{key:"idempotentHint",labelKey:"tools.toolsList.idempotent",Icon:S,variant:"secondary"},{key:"openWorldHint",labelKey:"tools.toolsList.openWorld",Icon:P,variant:"outline"}];function Q(y){const e=b.c(22),{annotations:c,_meta:r}=y,t=k();let l;e[0]!==r?(l=_(r),e[0]=r,e[1]=l):l=e[1];const i=!!l;let s,n,a,u,d;if(e[2]!==c||e[3]!==i||e[4]!==t){d=Symbol.for("react.early_return_sentinel");e:{const x=c?O.filter(h=>c[h.key]===!0):[];if(x.length===0&&!i){d=null;break e}s=R,n="flex gap-1 flex-nowrap",e[10]!==i||e[11]!==t?(a=i&&o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:"secondary",className:"size-6 p-1",children:o.jsx(U,{})})}),o.jsx(I,{children:t("tools.toolsList.interactive")})]}),e[10]=i,e[11]=t,e[12]=a):a=e[12];let f;e[13]!==t?(f=h=>{const{labelKey:j,Icon:C,variant:K}=h;return o.jsxs(v,{children:[o.jsx(T,{asChild:!0,children:o.jsx(g,{asChild:!0,variant:K,className:"size-6 p-1",children:o.jsx(C,{})})}),o.jsx(I,{children:t(j)})]},j)},e[13]=t,e[14]=f):f=e[14],u=x.map(f)}e[2]=c,e[3]=i,e[4]=t,e[5]=s,e[6]=n,e[7]=a,e[8]=u,e[9]=d}else s=e[5],n=e[6],a=e[7],u=e[8],d=e[9];if(d!==Symbol.for("react.early_return_sentinel"))return d;let m;e[15]!==n||e[16]!==a||e[17]!==u?(m=o.jsxs("div",{className:n,children:[a,u]}),e[15]=n,e[16]=a,e[17]=u,e[18]=m):m=e[18];let p;return e[19]!==s||e[20]!==m?(p=o.jsx(s,{children:m}),e[19]=s,e[20]=m,e[21]=p):p=e[21],p}function Y(y){const e=b.c(11),{connectionId:c}=y,{org:r}=$();let t,l,i;e[0]!==c||e[1]!==r.slug?(t=new URL(`/api/${r.slug}/mcp/${c}`,window.location.origin),i=L,l=A.isMCPAuthenticated(t.href,null),e[0]=c,e[1]=r.slug,e[2]=t,e[3]=l,e[4]=i):(t=e[2],l=e[3],i=e[4]);let s;e[5]!==t||e[6]!==r.id?(s=()=>w({url:t.href,token:null,orgId:r.id}),e[5]=t,e[6]=r.id,e[7]=s):s=e[7];let n;e[8]!==l||e[9]!==s?(n={queryKey:l,queryFn:s},e[8]=l,e[9]=s,e[10]=n):n=e[10];const{data:a}=i(n);return a}export{Q as T,Y as u};
@@ -1,4 +1,4 @@
1
- import{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bk as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,bb as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-CT-xO5mU.js";import{U as P,b as H,c as J}from"./auth-51drWU9x.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const U=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function ut(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
1
+ import{ca as ce,cb as le,cc as ue,cd as de,ce as he,cf as m,cg as g,ch as fe,ci as pe,cj as me,ck as M,cl as _e,cm as F,cn as we,co as q,cp as ge,cq as D,cr as Te,cs as ye,ct as ke,cu as z,cv as ve,cw as Se,cx as Ce,cy as ee,cz as be,cA as Re,cB as Ie,bk as Ee,cC as qe,cD as Pe,cE as A,cF as $e,cG as Me,cH as Ae,cI as He,cJ as Oe,cK as xe,cL as Ne,cM as Ue,cN as je,cO as Fe,cP as De,cQ as Le,cR as Ve,bb as V,cS as Qe,cT as N,K as te,J as ze,c as se,R as Je,m as We}from"./index-DjeyX30Y.js";import{U as P,b as H,c as J}from"./auth-BmkbjTIT.js";function x(a){return!!a._zod}function b(a,e){return x(a)?ce(a,e):a.safeParse(e)}function re(a){if(!a)return;let e;if(x(a)?e=a._zod?.def?.shape:e=a.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function Ke(a){if(x(a)){const o=a._zod?.def;if(o){if(o.value!==void 0)return o.value;if(Array.isArray(o.values)&&o.values.length>0)return o.values[0]}}const t=a._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}const s=a.value;if(s!==void 0)return s}function R(a){return a==="completed"||a==="failed"||a==="cancelled"}function W(a){const t=re(a)?.method;if(!t)throw new Error("Schema is missing a method literal");const s=Ke(t);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function K(a,e){const t=b(a,e);if(!t.success)throw t.error;return t.data}const Ge=6e4;class Be{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(le,t=>{this._oncancel(t)}),this.setNotificationHandler(ue,t=>{this._onprogress(t)}),this.setRequestHandler(de,t=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(he,async(t,s)=>{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(fe,async(t,s)=>{const r=async()=>{const o=t.params.taskId;if(this._taskMessageQueue){let i;for(;i=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(i.type==="response"||i.type==="error"){const u=i.message,p=u.id,l=this._requestResolvers.get(p);if(l)if(this._requestResolvers.delete(p),i.type==="response")l(u);else{const h=u,f=new m(h.error.code,h.error.message,h.error.data);l(f)}else{const h=i.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${p}`))}continue}await this._transport?.send(i.message,{relatedRequestId:s.requestId})}}const n=await this._taskStore.getTask(o,s.sessionId);if(!n)throw new m(g.InvalidParams,`Task not found: ${o}`);if(!R(n.status))return await this._waitForTaskUpdate(o,s.signal),await r();if(R(n.status)){const i=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...i,_meta:{...i._meta,[q]:{taskId:o}}}}return await r()};return await r()}),this.setRequestHandler(pe,async(t,s)=>{try{const{tasks:r,nextCursor:o}=await this._taskStore.listTasks(t.params?.cursor,s.sessionId);return{tasks:r,nextCursor:o,_meta:{}}}catch(r){throw new m(g.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(me,async(t,s)=>{try{const r=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!r)throw new m(g.InvalidParams,`Task not found: ${t.params.taskId}`);if(R(r.status))throw new m(g.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(t.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(t.params.taskId);const o=await this._taskStore.getTask(t.params.taskId,s.sessionId);if(!o)throw new m(g.InvalidParams,`Task not found after cancellation: ${t.params.taskId}`);return{_meta:{},...o}}catch(r){throw r instanceof m?r:new m(g.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,s,r,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:r})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const s=Date.now()-t.startTime;if(t.maxTotalTimeout&&s>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),m.fromError(g.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:s});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};const s=this.transport?.onerror;this._transport.onerror=o=>{s?.(o),this._onerror(o)};const r=this._transport?.onmessage;this._transport.onmessage=(o,n)=>{r?.(o,n),M(o)||_e(o)?this._onresponse(o):F(o)?this._onrequest(o,n):we(o)?this._onnotification(o):this._onerror(new Error(`Unknown message type: ${JSON.stringify(o)}`))},await this._transport.start()}_onclose(){const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const s of this._timeoutInfo.values())clearTimeout(s.timeoutId);this._timeoutInfo.clear();for(const s of this._requestHandlerAbortControllers.values())s.abort();this._requestHandlerAbortControllers.clear();const t=m.fromError(g.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const s of e.values())s(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){const t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(e,t){const s=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,o=e.params?._meta?.[q]?.taskId;if(s===void 0){const l={jsonrpc:"2.0",id:e.id,error:{code:g.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:l,timestamp:Date.now()},r?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):r?.send(l).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}const n=new AbortController;this._requestHandlerAbortControllers.set(e.id,n);const i=ge(e.params)?e.params.task:void 0,u=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,p={signal:n.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(n.signal.aborted)return;const h={relatedRequestId:e.id};o&&(h.relatedTask={taskId:o}),await this.notification(l,h)},sendRequest:async(l,h,f)=>{if(n.signal.aborted)throw new m(g.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:e.id};o&&!w.relatedTask&&(w.relatedTask={taskId:o});const y=w.relatedTask?.taskId??o;return y&&u&&await u.updateTaskStatus(y,"input_required"),await this.request(l,h,w)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:o,taskStore:u,taskRequestedTtl:i?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{i&&this.assertTaskHandlerCapability(e.method)}).then(()=>s(e,p)).then(async l=>{if(n.signal.aborted)return;const h={result:l,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)},async l=>{if(n.signal.aborted)return;const h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:g.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:h,timestamp:Date.now()},r?.sessionId):await r?.send(h)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===n&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:t,...s}=e.params,r=Number(t),o=this._progressHandlers.get(r);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const n=this._responseHandlers.get(r),i=this._timeoutInfo.get(r);if(i&&n&&i.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(u){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),n(u);return}o(s)}_onresponse(e){const t=Number(e.id),s=this._requestResolvers.get(t);if(s){if(this._requestResolvers.delete(t),M(e))s(e);else{const n=new m(e.error.code,e.error.message,e.error.data);s(n)}return}const r=this._responseHandlers.get(t);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let o=!1;if(M(e)&&e.result&&typeof e.result=="object"){const n=e.result;if(n.task&&typeof n.task=="object"){const i=n.task;typeof i.taskId=="string"&&(o=!0,this._taskProgressTokens.set(i.taskId,t))}}if(o||this._progressHandlers.delete(t),M(e))r(e);else{const n=m.fromError(e.error.code,e.error.message,e.error.data);r(n)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,s){const{task:r}=s??{};if(!r){try{yield{type:"result",result:await this.request(e,t,s)}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}return}let o;try{const n=await this.request(e,D,s);if(n.task)o=n.task.taskId,yield{type:"taskCreated",task:n.task};else throw new m(g.InternalError,"Task creation did not return a task");for(;;){const i=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:i},R(i.status)){i.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)}:i.status==="failed"?yield{type:"error",error:new m(g.InternalError,`Task ${o} failed`)}:i.status==="cancelled"&&(yield{type:"error",error:new m(g.InternalError,`Task ${o} was cancelled`)});return}if(i.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},t,s)};return}const u=i.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(p=>setTimeout(p,u)),s?.signal?.throwIfAborted()}}catch(n){yield{type:"error",error:n instanceof m?n:new m(g.InternalError,String(n))}}}request(e,t,s){const{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n,task:i,relatedTask:u}=s??{};return new Promise((p,l)=>{const h=c=>{l(c)};if(!this._transport){h(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),i&&this.assertTaskCapability(e.method)}catch(c){h(c);return}s?.signal?.throwIfAborted();const f=this._requestMessageId++,w={...e,jsonrpc:"2.0",id:f};s?.onprogress&&(this._progressHandlers.set(f,s.onprogress),w.params={...e.params,_meta:{...e.params?._meta||{},progressToken:f}}),i&&(w.params={...w.params,task:i}),u&&(w.params={...w.params,_meta:{...w.params?._meta||{},[q]:u}});const y=c=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(c)}},{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(v=>this._onerror(new Error(`Failed to send cancellation: ${v}`)));const _=c instanceof m?c:new m(g.RequestTimeout,String(c));l(_)};this._responseHandlers.set(f,c=>{if(!s?.signal?.aborted){if(c instanceof Error)return l(c);try{const _=b(t,c.result);_.success?p(_.data):l(_.error)}catch(_){l(_)}}}),s?.signal?.addEventListener("abort",()=>{y(s?.signal?.reason)});const T=s?.timeout??Ge,k=()=>y(m.fromError(g.RequestTimeout,"Request timed out",{timeout:T}));this._setupTimeout(f,T,s?.maxTotalTimeout,k,s?.resetTimeoutOnProgress??!1);const d=u?.taskId;if(d){const c=_=>{const v=this._responseHandlers.get(f);v?v(_):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,c),this._enqueueTaskMessage(d,{type:"request",message:w,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(f),l(_)})}else this._transport.send(w,{relatedRequestId:r,resumptionToken:o,onresumptiontoken:n}).catch(c=>{this._cleanupTimeout(f),l(c)})})}async getTask(e,t){return this.request({method:"tasks/get",params:e},Te,t)}async getTaskResult(e,t,s){return this.request({method:"tasks/result",params:e},t,s)}async listTasks(e,t){return this.request({method:"tasks/list",params:e},ye,t)}async cancelTask(e,t){return this.request({method:"tasks/cancel",params:e},ke,t)}async notification(e,t){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const s=t?.relatedTask?.taskId;if(s){const i={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[q]:t.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:i,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};t?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[q]:t.relatedTask}}}),this._transport?.send(i,t).catch(u=>this._onerror(u))});return}let n={...e,jsonrpc:"2.0"};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[q]:t.relatedTask}}}),await this._transport.send(n,t)}setRequestHandler(e,t){const s=W(e);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(r,o)=>{const n=K(e,r);return Promise.resolve(t(n,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){const s=W(e);this._notificationHandlers.set(s,r=>{const o=K(e,r);return Promise.resolve(t(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,s){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,s,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(e,t);for(const r of s)if(r.type==="request"&&F(r.message)){const o=r.message.id,n=this._requestResolvers.get(o);n?(n(new m(g.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let s=this._options?.defaultTaskPollInterval??1e3;try{const r=await this._taskStore?.getTask(e);r?.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,o)=>{if(t.aborted){o(new m(g.InvalidRequest,"Request cancelled"));return}const n=setTimeout(r,s);t.addEventListener("abort",()=>{clearTimeout(n),o(new m(g.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,t){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async r=>{if(!e)throw new Error("No request provided");return await s.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async r=>{const o=await s.getTask(r,t);if(!o)throw new m(g.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(r,o,n)=>{await s.storeTaskResult(r,o,n,t);const i=await s.getTask(r,t);if(i){const u=z.parse({method:"notifications/tasks/status",params:i});await this.notification(u),R(i.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>s.getTaskResult(r,t),updateTaskStatus:async(r,o,n)=>{const i=await s.getTask(r,t);if(!i)throw new m(g.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(R(i.status))throw new m(g.InvalidParams,`Cannot update task "${r}" from terminal status "${i.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(r,o,n,t);const u=await s.getTask(r,t);if(u){const p=z.parse({method:"notifications/tasks/status",params:u});await this.notification(p),R(u.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>s.listTasks(r,t)}}}function G(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Ze(a,e){const t={...a};for(const s in e){const r=s,o=e[r];if(o===void 0)continue;const n=t[r];G(n)&&G(o)?t[r]={...n,...o}:t[r]=o}return t}var Ye=Se();const Xe=ve(Ye);function et(){const a=new Xe({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return Ce(a),a}class tt{constructor(e){this._ajv=e??et()}getValidator(e){const t="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return s=>t(s)?{valid:!0,data:s,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}}class st{constructor(e){this._client=e}async*callToolStream(e,t=ee,s){const r=this._client,o={...s,task:s?.task??(r.isToolTask(e.name)?{}:void 0)},n=r.requestStream({method:"tools/call",params:e},t,o),i=r.getToolOutputValidator(e.name);for await(const u of n){if(u.type==="result"&&i){const p=u.result;if(!p.structuredContent&&!p.isError){yield{type:"error",error:new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(p.structuredContent)try{const l=i(p.structuredContent);if(!l.valid){yield{type:"error",error:new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${l.errorMessage}`)};return}}catch(l){if(l instanceof m){yield{type:"error",error:l};return}yield{type:"error",error:new m(g.InvalidParams,`Failed to validate structured content: ${l instanceof Error?l.message:String(l)}`)};return}}yield u}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,s){return this._client.getTaskResult({taskId:e},t,s)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,s){return this._client.requestStream(e,t,s)}}function rt(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!a.tools?.call)throw new Error(`${t} does not support task creation for tools/call (required for ${e})`);break}}function ot(a,e,t){if(!a)throw new Error(`${t} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!a.sampling?.createMessage)throw new Error(`${t} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!a.elicitation?.create)throw new Error(`${t} does not support task creation for elicitation/create (required for ${e})`);break}}function O(a,e){if(!(!a||e===null||typeof e!="object")){if(a.type==="object"&&a.properties&&typeof a.properties=="object"){const t=e,s=a.properties;for(const r of Object.keys(s)){const o=s[r];t[r]===void 0&&Object.prototype.hasOwnProperty.call(o,"default")&&(t[r]=o.default),t[r]!==void 0&&O(o,t[r])}}if(Array.isArray(a.anyOf))for(const t of a.anyOf)typeof t!="boolean"&&O(t,e);if(Array.isArray(a.oneOf))for(const t of a.oneOf)typeof t!="boolean"&&O(t,e)}}function at(a){if(!a)return{supportsFormMode:!1,supportsUrlMode:!1};const e=a.form!==void 0,t=a.url!==void 0;return{supportsFormMode:e||!e&&!t,supportsUrlMode:t}}let nt=class extends Be{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new tt,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler("tools",be,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler("prompts",Re,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler("resources",Ie,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||(this._experimental={tasks:new st(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Ze(this._capabilities,e)}setRequestHandler(e,t){const r=re(e)?.method;if(!r)throw new Error("Schema is missing a method literal");let o;if(x(r)){const i=r;o=i._zod?.def?.value??i.value}else{const i=r;o=i._def?.value??i.value}if(typeof o!="string")throw new Error("Schema method literal must be a string");const n=o;if(n==="elicitation/create"){const i=async(u,p)=>{const l=b(je,u);if(!l.success){const c=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid elicitation request: ${c}`)}const{params:h}=l.data;h.mode=h.mode??"form";const{supportsFormMode:f,supportsUrlMode:w}=at(this._capabilities.elicitation);if(h.mode==="form"&&!f)throw new m(g.InvalidParams,"Client does not support form-mode elicitation requests");if(h.mode==="url"&&!w)throw new m(g.InvalidParams,"Client does not support URL-mode elicitation requests");const y=await Promise.resolve(t(u,p));if(h.task){const c=b(D,y);if(!c.success){const _=c.error instanceof Error?c.error.message:String(c.error);throw new m(g.InvalidParams,`Invalid task creation result: ${_}`)}return c.data}const T=b(Fe,y);if(!T.success){const c=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid elicitation result: ${c}`)}const k=T.data,d=h.mode==="form"?h.requestedSchema:void 0;if(h.mode==="form"&&k.action==="accept"&&k.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{O(d,k.content)}catch{}return k};return super.setRequestHandler(e,i)}if(n==="sampling/createMessage"){const i=async(u,p)=>{const l=b(De,u);if(!l.success){const k=l.error instanceof Error?l.error.message:String(l.error);throw new m(g.InvalidParams,`Invalid sampling request: ${k}`)}const{params:h}=l.data,f=await Promise.resolve(t(u,p));if(h.task){const k=b(D,f);if(!k.success){const d=k.error instanceof Error?k.error.message:String(k.error);throw new m(g.InvalidParams,`Invalid task creation result: ${d}`)}return k.data}const y=h.tools||h.toolChoice?Le:Ve,T=b(y,f);if(!T.success){const k=T.error instanceof Error?T.error.message:String(T.error);throw new m(g.InvalidParams,`Invalid sampling result: ${k}`)}return T.data};return super.setRequestHandler(e,i)}return super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{const s=await this.request({method:"initialize",params:{protocolVersion:Ee,capabilities:this._capabilities,clientInfo:this._clientInfo}},qe,t);if(s===void 0)throw new Error(`Server sent invalid initialize result: ${s}`);if(!Pe.includes(s.protocolVersion))throw new Error(`Server's protocol version is not supported: ${s.protocolVersion}`);this._serverCapabilities=s.capabilities,this._serverVersion=s.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(s.protocolVersion),this._instructions=s.instructions,await this.notification({method:"notifications/initialized"}),this._pendingListChangedConfig&&(this._setupListChangedHandlers(this._pendingListChangedConfig),this._pendingListChangedConfig=void 0)}catch(s){throw this.close(),s}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case"logging/setLevel":if(!this._serverCapabilities?.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._serverCapabilities?.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!this._serverCapabilities?.resources)throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._serverCapabilities?.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!this._serverCapabilities?.completions)throw new Error(`Server does not support completions (required for ${e})`);break}}assertNotificationCapability(e){switch(e){case"notifications/roots/list_changed":if(!this._capabilities.roots?.listChanged)throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Client does not support tasks capability (required for ${e})`);break}}assertTaskCapability(e){rt(this._serverCapabilities?.tasks?.requests,e,"Server")}assertTaskHandlerCapability(e){this._capabilities&&ot(this._capabilities.tasks?.requests,e,"Client")}async ping(e){return this.request({method:"ping"},A,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},$e,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},A,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},Me,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},Ae,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},He,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},Oe,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},xe,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},A,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},A,t)}async callTool(e,t=ee,s){if(this.isToolTaskRequired(e.name))throw new m(g.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);const r=await this.request({method:"tools/call",params:e},t,s),o=this.getToolOutputValidator(e.name);if(o){if(!r.structuredContent&&!r.isError)throw new m(g.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{const n=o(r.structuredContent);if(!n.valid)throw new m(g.InvalidParams,`Structured content does not match the tool's output schema: ${n.errorMessage}`)}catch(n){throw n instanceof m?n:new m(g.InvalidParams,`Failed to validate structured content: ${n instanceof Error?n.message:String(n)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(const t of e){if(t.outputSchema){const r=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,r)}const s=t.execution?.taskSupport;(s==="required"||s==="optional")&&this._cachedKnownTaskTools.add(t.name),s==="required"&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const s=await this.request({method:"tools/list",params:e},Ne,t);return this.cacheToolMetadata(s.tools),s}_setupListChangedHandler(e,t,s,r){const o=Ue.safeParse(s);if(!o.success)throw new Error(`Invalid ${e} listChanged options: ${o.error.message}`);if(typeof s.onChanged!="function")throw new Error(`Invalid ${e} listChanged options: onChanged must be a function`);const{autoRefresh:n,debounceMs:i}=o.data,{onChanged:u}=s,p=async()=>{if(!n){u(null,null);return}try{const h=await r();u(null,h)}catch(h){const f=h instanceof Error?h:new Error(String(h));u(f,null)}},l=()=>{if(i){const h=this._listChangedDebounceTimers.get(e);h&&clearTimeout(h);const f=setTimeout(p,i);this._listChangedDebounceTimers.set(e,f)}else p()};this.setNotificationHandler(t,l)}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}};const U=a=>[{type:"text",text:a}];function it(a){const e=V(a,typeof window<"u"?window.location.origin:void 0);if(!e)throw new Error("RestSelfClient requires either studioUrl or a browser environment.");const t={"Content-Type":"application/json",Accept:"application/json",...a.token?{Authorization:`Bearer ${a.token}`}:{}},s=u=>new URL(`/api/${encodeURIComponent(a.orgSlug)}${u}`,e).href,r=async u=>{let p;try{p=await fetch(s(`/tools/${encodeURIComponent(u.name)}`),{method:"POST",headers:t,credentials:"include",body:JSON.stringify(u.arguments??{})})}catch(h){const f=h instanceof Error?h.message:"Network error";return{content:U(f),isError:!0}}if(!p.ok){let h=`${u.name} failed (${p.status})`;try{const f=await p.json();f?.error&&(h=f.error)}catch{}return{content:U(h),isError:!0}}const l=await p.json().catch(()=>({}));return{content:U(typeof l=="string"?l:JSON.stringify(l)),structuredContent:l}},o=async()=>{const u=await fetch(s("/tools"),{method:"GET",headers:t,credentials:"include"});return u.ok?await u.json():{tools:[]}},n=u=>()=>Promise.reject(new Error(`RestSelfClient: ${u} is not supported over REST for the self connection`));return{callTool:r,listTools:o,listPrompts:n("listPrompts"),getPrompt:n("getPrompt"),listResources:n("listResources"),readResource:n("readResource"),listResourceTemplates:n("listResourceTemplates"),close:()=>Promise.resolve(),toJSON:()=>a.toJSONString}}function L(a){return a?a instanceof Headers?Object.fromEntries(a.entries()):Array.isArray(a)?Object.fromEntries(a):{...a}:{}}function ct(a=fetch,e){return e?async(t,s)=>{const r={...e,...s,headers:s?.headers?{...L(e.headers),...L(s.headers)}:e.headers};return a(t,r)}:a}class B extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}const Z=10,lt=13,I=32;function j(a){}function ut(a){if(typeof a=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:e=j,onError:t=j,onRetry:s=j,onComment:r}=a,o=[];let n=!0,i,u="",p=0,l;function h(d){if(n&&(n=!1,d.charCodeAt(0)===239&&d.charCodeAt(1)===187&&d.charCodeAt(2)===191&&(d=d.slice(3))),o.length===0){const v=f(d);v!==""&&o.push(v);return}if(d.indexOf(`
2
2
  `)===-1&&d.indexOf("\r")===-1){o.push(d);return}o.push(d);const c=o.join("");o.length=0;const _=f(c);_!==""&&o.push(_)}function f(d){let c=0;if(d.indexOf("\r")===-1){let _=d.indexOf(`
3
3
  `,c);for(;_!==-1;){if(c===_){p>0&&e({id:i,event:l,data:u}),i=void 0,u="",p=0,l=void 0,c=_+1,_=d.indexOf(`
4
4
  `,c);continue}const v=d.charCodeAt(c);if(Y(d,c,v)){const S=d.charCodeAt(c+5)===I?c+6:c+5,C=d.slice(S,_);if(p===0&&d.charCodeAt(_+1)===Z){e({id:i,event:l,data:C}),i=void 0,u="",l=void 0,c=_+2,_=d.indexOf(`
@@ -1 +1 @@
1
- import{c as l,m as u,cf as m,cg as f,R as y,K as n}from"./index-CT-xO5mU.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
1
+ import{c as l,m as u,cf as m,cg as f,R as y,K as n}from"./index-DjeyX30Y.js";async function c(r){if(!r.getServerCapabilities()?.prompts)return{prompts:[]};try{return await r.listPrompts()}catch(t){if(t instanceof m&&t.code===f.MethodNotFound)return{prompts:[]};throw t}}async function b(r,e,t){if(!r.getServerCapabilities()?.prompts)throw new Error("Prompts capability not supported");return await r.getPrompt({name:e,arguments:t??{}})}function g(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],y(a)}function q(r){const e=l.c(12);let t,s;e[0]!==r?({client:t,...s}=r,e[0]=r,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let i;e[3]!==t?(i=n.mcpPromptsList(t),e[3]=t,e[4]=i):i=e[4];let o;e[5]!==t?(o=()=>c(t),e[5]=t,e[6]=o):o=e[6];const p=s.staleTime??3e4;let a;return e[7]!==s||e[8]!==i||e[9]!==o||e[10]!==p?(a={...s,queryKey:i,queryFn:o,staleTime:p,retry:!1},e[7]=s,e[8]=i,e[9]=o,e[10]=p,e[11]=a):a=e[11],u(a)}export{q as a,b as g,c as l,g as u};
@@ -1 +1 @@
1
- import{c as f,R as p,m as q,K as m}from"./index-CT-xO5mU.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
1
+ import{c as f,R as p,m as q,K as m}from"./index-DjeyX30Y.js";function C(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],p(o)}function g(n){const e=f.c(12);let t,s;e[0]!==n?({client:t,...s}=n,e[0]=n,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let l;e[3]!==t?(l=m.mcpToolsList(t),e[3]=t,e[4]=l):l=e[4];let i;e[5]!==t?(i=async()=>await t.listTools(),e[5]=t,e[6]=i):i=e[6];const r=s.staleTime??3e4;let o;return e[7]!==s||e[8]!==l||e[9]!==i||e[10]!==r?(o={...s,queryKey:l,queryFn:i,staleTime:r,retry:!1},e[7]=s,e[8]=l,e[9]=i,e[10]=r,e[11]=o):o=e[11],q(o)}function L(n){const e=f.c(21);let t,s,l,i;e[0]!==n?({client:t,toolName:i,toolArguments:l,...s}=n,e[0]=n,e[1]=t,e[2]=s,e[3]=l,e[4]=i):(t=e[1],s=e[2],l=e[3],i=e[4]);let r,o,u;if(e[5]!==t||e[6]!==s||e[7]!==l||e[8]!==i){const T=JSON.stringify(l??{});u=p,r=s,o=m.mcpToolCall(t,i,T),e[5]=t,e[6]=s,e[7]=l,e[8]=i,e[9]=r,e[10]=o,e[11]=u}else r=e[9],o=e[10],u=e[11];let a;e[12]!==t||e[13]!==l||e[14]!==i?(a=async()=>await t.callTool({name:i,arguments:l}),e[12]=t,e[13]=l,e[14]=i,e[15]=a):a=e[15];const y=s.staleTime??3e4;let c;return e[16]!==r||e[17]!==o||e[18]!==a||e[19]!==y?(c={...r,queryKey:o,queryFn:a,staleTime:y,retry:!1},e[16]=r,e[17]=o,e[18]=a,e[19]=y,e[20]=c):c=e[20],u(c)}export{C as a,L as b,g as u};
@@ -1 +1 @@
1
- import{c,a2 as m,m as b,R as M,K as f}from"./index-CT-xO5mU.js";import{u as y}from"./use-org-auth-client-CMWVQK83.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],M(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],b(l)}export{d as a,q as u};
1
+ import{c,a2 as m,m as b,R as M,K as f}from"./index-DjeyX30Y.js";import{u as y}from"./use-org-auth-client-DLu7wwJ8.js";const p=300*1e3;function d(){const t=c.c(7),{locator:e}=m(),o=y();let r;t[0]!==e?(r=f.members(e),t[0]=e,t[1]=r):r=t[1];let s;t[2]!==o?(s=()=>o.organization.listMembers(),t[2]=o,t[3]=s):s=t[3];let n;return t[4]!==r||t[5]!==s?(n={queryKey:r,queryFn:s},t[4]=r,t[5]=s,t[6]=n):n=t[6],M(n)}function q(t){const e=c.c(10);let o;e[0]!==t?(o=t===void 0?{}:t,e[0]=t,e[1]=o):o=e[1];const{enabled:r}=o,s=r===void 0?!0:r,{locator:n}=m(),a=y();let u;e[2]!==n?(u=f.members(n),e[2]=n,e[3]=u):u=e[3];let i;e[4]!==a?(i=()=>a.organization.listMembers(),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==s||e[7]!==u||e[8]!==i?(l={queryKey:u,queryFn:i,staleTime:p,enabled:s},e[6]=s,e[7]=u,e[8]=i,e[9]=l):l=e[9],b(l)}export{d as a,q as u};
@@ -1 +1 @@
1
- import{r as s}from"./index-CT-xO5mU.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
1
+ import{r as s}from"./index-DjeyX30Y.js";const n=768,r=`(max-width: ${n-1}px)`;function o(e){const t=globalThis.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}const a=()=>globalThis.innerWidth<n,c=()=>!1;function h(){return s.useSyncExternalStore(o,a,c)}export{h as u};
@@ -1 +1 @@
1
- import{c as b,m as S,K as E,ao as P,a2 as A,d as Q,o as G,a as H,ab as k,d6 as C,d7 as F,db as D}from"./index-CT-xO5mU.js";import{r as _,h as N,g as B,d as I,i as V,j as Y}from"./repository-binding-D6iSPygW.js";import{h as x,u as z,d as v,w as J}from"./thread-intent-BGiWtT9b.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=x(t.metadata?.runtime);return n===null||n===e}function j(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||$(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function he(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function W(t,e,n,a,s,r){return s?j(t,e,n,a,r?.baseBranch)??void 0:j(t,e,n,a)??void 0}const X=6e4,O=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function Z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function fe(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=l):l=e[15];let f;return e[16]!==i||e[17]!==u||e[18]!==l?(f={queryKey:i,queryFn:u,enabled:l,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=l,e[19]=f):f=e[19],S(f)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==o||e[14]!==i||e[15]!==u?(l={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=l):l=e[16],S(l)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=B(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=z(),u=oe(void 0,null),l=k();let f;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==o?.user?.id?(f=(d,c,T)=>{if(l&&!c?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const h=c?.panel??"overview";if(C(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&B(m)),w=!c?.runtime,L=w?void 0:W(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&c?.runtime&&J(sessionStorage,a,R,{runtime:c.runtime}),F(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=o?.user?.id,t[8]=f):f=t[8];const g=f;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,c)=>{if(C(c?.panel??"overview").kind==="org-destination")return g(d,c,void 0);const T=r.find(h=>h.id===d);if(c?.runtime)return g(d,c,c.runtime);if(T)return g(d,c,v(T.metadata));Y(s,n).then(h=>h.find(m=>m.id===d)).catch(ue).then(h=>g(d,c,h?v(h.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=k();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,W as c,me as d,M as e,he as f,ge as g,fe as h,U as p,be as u};
1
+ import{c as b,m as S,K as E,ao as P,a2 as A,d as Q,o as G,a as H,ab as k,d6 as C,d7 as F,db as D}from"./index-DjeyX30Y.js";import{r as _,h as N,g as B,d as I,i as V,j as Y}from"./repository-binding-CxxK4zqI.js";import{h as x,u as z,d as v,w as J}from"./thread-intent-BOV3kZsu.js";function $(t,e){if(!e)return!0;if(t.partial)return!1;const n=x(t.metadata?.runtime);return n===null||n===e}function j(t,e,n,a,s){let r=null;for(const o of t)o.virtual_mcp_id===e&&o.created_by===n&&(o.hidden||$(o,a)&&(s&&o.branch===s||(!r||o.updated_at>r.updated_at)&&(r=o)));return r}function he(t,e,n,a){return t.find(s=>!s.hidden&&s.virtual_mcp_id===e&&s.created_by===n&&s.title==="New chat"&&!s.harness_id&&$(s,a))}function W(t,e,n,a,s,r){return s?j(t,e,n,a,r?.baseBranch)??void 0:j(t,e,n,a)??void 0}const X=6e4,O=3e4;function q(t){return{number:t.number,title:t.title,body:t.body,state:t.state==="open"?"open":"closed",merged:t.state==="merged",mergedAt:t.mergedAt,base:t.base,head:t.head,headSha:t.headSha,headRepoFullName:t.headRepoPath,htmlUrl:t.url,author:t.author,changedFiles:t.changedFiles}}function Z(t){return{id:t.id,name:t.name,status:t.state==="running"?"in_progress":t.state,conclusion:t.conclusion,htmlUrl:t.url??"",durationMs:t.durationMs}}function U(t){const{orgSlug:e,target:n,owner:a,repo:s,branch:r}=t;return{queryKey:E.githubPrState(e,_(n),a,s,r),queryFn:()=>P(e,"CHANGE_REQUEST_STATE",{...n,branch:r}),enabled:!!r&&N(n)&&!!a&&!!s,refetchInterval:X,refetchIntervalInBackground:!1,staleTime:O}}function M(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:ee},e[2]=n,e[3]=a):a=e[3],S(a)}function ee(t){return t.changeRequest?q(t.changeRequest):null}function fe(t){const e=b.c(4);let n;e[0]!==t?(n=U(t),e[0]=t,e[1]=n):n=e[1];let a;return e[2]!==n?(a={...n,select:te},e[2]=n,e[3]=a):a=e[3],S(a)}function te(t){return t.changeRequest?.state==="open"?t.changeRequest.checkRuns.map(Z):[]}const ne=5*6e4;function ge(t){const e=b.c(20),{orgSlug:n,target:a,owner:s,repo:r,base:o}=t;let i;e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==r||e[4]!==a?(i=E.githubLastPublishedPr(n,_(a),s,r,o),e[0]=o,e[1]=n,e[2]=s,e[3]=r,e[4]=a,e[5]=i):i=e[5];let u;e[6]!==o||e[7]!==n||e[8]!==a?(u=()=>P(n,"CHANGE_REQUEST_LAST_MERGED",{...a,base:o}),e[6]=o,e[7]=n,e[8]=a,e[9]=u):u=e[9];let l;e[10]!==t.enabled||e[11]!==o||e[12]!==s||e[13]!==r||e[14]!==a?(l=(t.enabled??!0)&&!!o&&N(a)&&!!s&&!!r,e[10]=t.enabled,e[11]=o,e[12]=s,e[13]=r,e[14]=a,e[15]=l):l=e[15];let f;return e[16]!==i||e[17]!==u||e[18]!==l?(f={queryKey:i,queryFn:u,enabled:l,staleTime:ne,select:ae},e[16]=i,e[17]=u,e[18]=l,e[19]=f):f=e[19],S(f)}function ae(t){return t.changeRequest?q(t.changeRequest):null}const se=50;function me(t){const e=b.c(17),{orgSlug:n,target:a,owner:s,repo:r}=t;let o;e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==a?(o=E.githubOpenPrs(n,_(a),s,r),e[0]=n,e[1]=s,e[2]=r,e[3]=a,e[4]=o):o=e[4];let i;e[5]!==n||e[6]!==a?(i=()=>P(n,"CHANGE_REQUEST_LIST_OPEN",{...a,limit:se}),e[5]=n,e[6]=a,e[7]=i):i=e[7];let u;e[8]!==t.enabled||e[9]!==s||e[10]!==r||e[11]!==a?(u=(t.enabled??!0)&&N(a)&&!!s&&!!r,e[8]=t.enabled,e[9]=s,e[10]=r,e[11]=a,e[12]=u):u=e[12];let l;return e[13]!==o||e[14]!==i||e[15]!==u?(l={queryKey:o,queryFn:i,enabled:u,staleTime:O,select:re},e[13]=o,e[14]=i,e[15]=u,e[16]=l):l=e[16],S(l)}function re(t){return t.changeRequests.map(q)}function oe(t,e){const{org:n}=A(),a=B(t);return M({orgId:n.id,orgSlug:n.slug,target:I(a),owner:a?.owner??"",repo:a?.name??"",branch:e??null}).data?.base??"main"}const ie=[];function be(){const t=b.c(14),e=Q(),{org:n,locator:a}=A(),s=G(),r=V(),{data:o}=H.useSession(),i=z(),u=oe(void 0,null),l=k();let f;t[0]!==u||t[1]!==r||t[2]!==a||t[3]!==i?.threads||t[4]!==e||t[5]!==n.slug||t[6]!==l||t[7]!==o?.user?.id?(f=(d,c,T)=>{if(l&&!c?.panel){e({to:"/$org/projects",params:{org:n.slug},search:y=>({...y,project:d,virtualmcpid:void 0,view:void 0})});return}const h=c?.panel??"overview";if(C(h).kind==="org-destination"){F(e,{tabId:h,org:n.slug,agentId:d,replace:!1});return}const m=(r??[]).find(y=>y.id===d),K=!!(m&&B(m)),w=!c?.runtime,L=w?void 0:W(i?.threads.get()??ie,d,o?.user?.id,T??(m?v(m.metadata):void 0),K,{baseBranch:u}),R=w?void 0:L?.id??crypto.randomUUID();R&&!L&&c?.runtime&&J(sessionStorage,a,R,{runtime:c.runtime}),F(e,{tabId:h,org:n.slug,agentId:d,search:()=>R?{thread:R}:{},replace:!1})},t[0]=u,t[1]=r,t[2]=a,t[3]=i?.threads,t[4]=e,t[5]=n.slug,t[6]=l,t[7]=o?.user?.id,t[8]=f):f=t[8];const g=f;let p;return t[9]!==r||t[10]!==g||t[11]!==n||t[12]!==s?(p=(d,c)=>{if(C(c?.panel??"overview").kind==="org-destination")return g(d,c,void 0);const T=r.find(h=>h.id===d);if(c?.runtime)return g(d,c,c.runtime);if(T)return g(d,c,v(T.metadata));Y(s,n).then(h=>h.find(m=>m.id===d)).catch(ue).then(h=>g(d,c,h?v(h.metadata):void 0))},t[9]=r,t[10]=g,t[11]=n,t[12]=s,t[13]=p):p=t[13],p}function ue(){}function pe(){const t=b.c(3),{org:e}=A(),n=k();let a;return t[0]!==e.slug||t[1]!==n?(a=(s,r)=>{if(n&&!r)return{to:"/$org/projects",params:{org:e.slug},search:i=>({...i,project:s,virtualmcpid:void 0,view:void 0})};const o=D({tabId:r??"overview",org:e.slug,agentId:s});return{to:o.to,params:o.params,search:o.search}},t[0]=e.slug,t[1]=n,t[2]=a):a=t[2],a}export{pe as a,oe as b,W as c,me as d,M as e,he as f,ge as g,fe as h,U as p,be as u};
@@ -1 +1 @@
1
- import{c as l,a9 as f,b as p,e as T,t as m}from"./index-CT-xO5mU.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
1
+ import{c as l,a9 as f,b as p,e as T,t as m}from"./index-DjeyX30Y.js";function g(t,u){const s=l.c(9),i=f(),a=p();let e;s[0]!==i||s[1]!==t?(e=async r=>{const{url:c}=await i.call(t,t==="ORGANIZATION_BILLING_CHECKOUT_START"&&r?{planId:r}:{});return c},s[0]=i,s[1]=t,s[2]=e):e=s[2];let n;s[3]!==u||s[4]!==a?(n=r=>m.error(a(u,{message:r.message})),s[3]=u,s[4]=a,s[5]=n):n=s[5];let o;return s[6]!==e||s[7]!==n?(o={mutationFn:e,onSuccess:_,onError:n},s[6]=e,s[7]=n,s[8]=o):o=s[8],T(o)}function _(t){return window.open(t,"_blank","noopener,noreferrer")}export{g as u};
@@ -1 +1 @@
1
- import{c as x,a2 as j,a as i}from"./index-CT-xO5mU.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};
1
+ import{c as x,a2 as j,a as i}from"./index-DjeyX30Y.js";function A(){const e=x.c(32),{org:O}=j(),o=O.id;let z;e[0]!==o?(z=R=>(f=>i.organization[R]({...f??{},organizationId:o})),e[0]=o,e[1]=z):z=e[1];const t=z;let M;e[2]!==o?(M=R=>(f=>{const y={...f??{}},h=y.query??{};return y.query={...h,organizationId:o},i.organization[R](y)}),e[2]=o,e[3]=M):M=e[3];const n=M;let a,r;e[4]!==n?(a=n("listMembers"),r=n("listRoles"),e[4]=n,e[5]=a,e[6]=r):(a=e[5],r=e[6]);let l,s,c,g,u,m,d,v,b;e[7]!==t?(g=t("inviteMember"),u=t("removeMember"),m=t("updateMemberRole"),d=t("addMember"),v=t("createRole"),b=t("updateRole"),l=t("deleteRole"),s=t("cancelInvitation"),c=t("update"),e[7]=t,e[8]=l,e[9]=s,e[10]=c,e[11]=g,e[12]=u,e[13]=m,e[14]=d,e[15]=v,e[16]=b):(l=e[8],s=e[9],c=e[10],g=e[11],u=e[12],m=e[13],d=e[14],v=e[15],b=e[16]);let p;e[17]!==n?(p=n("getActiveMember"),e[17]=n,e[18]=p):p=e[18];let I;return e[19]!==l||e[20]!==s||e[21]!==c||e[22]!==p||e[23]!==a||e[24]!==r||e[25]!==g||e[26]!==u||e[27]!==m||e[28]!==d||e[29]!==v||e[30]!==b?(I={organization:{listMembers:a,listRoles:r,inviteMember:g,removeMember:u,updateMemberRole:m,addMember:d,createRole:v,updateRole:b,deleteRole:l,cancelInvitation:s,update:c,getActiveMember:p,acceptInvitation:i.organization.acceptInvitation,rejectInvitation:i.organization.rejectInvitation,getInvitation:i.organization.getInvitation,list:i.organization.list,create:i.organization.create,getFullOrganization:i.organization.getFullOrganization}},e[19]=l,e[20]=s,e[21]=c,e[22]=p,e[23]=a,e[24]=r,e[25]=g,e[26]=u,e[27]=m,e[28]=d,e[29]=v,e[30]=b,e[31]=I):I=e[31],I}export{A as u};