decocms 4.541.0 → 4.542.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-HI4PJ-HL.js → ActiveShapeUtils-CTNIR1uo.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-Pu-QR8hS.js → AlertCircle-Hdww5hle.js} +1 -1
  3. package/dist/client/assets/{AreaChart-DJ3vI97z.js → AreaChart-C_-vf7HG.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CiCYDVFq.js → ArrowLeft-BdhX_ELF.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-bMBjrwqG.js → ArrowUp-B0V8Iire.js} +1 -1
  6. package/dist/client/assets/{BarChart-DW5fB9sQ.js → BarChart-CGQa-jmR.js} +1 -1
  7. package/dist/client/assets/{Building02-BejNykWR.js → Building02-CIOqUK8u.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-BfqGbR2p.js → CartesianChart-CJ4c9OjY.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-1g-OhB34.js → CategoricalChart-B7pVoKsa.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-CiBrtkwP.js → CheckCircle-Oy-r5wrn.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Bb_Zani-.js → ChevronSelectorVertical-4o-RZGZG.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-D3pnxmNi.js → ChevronUp-yEhXqYsc.js} +1 -1
  13. package/dist/client/assets/{Copy01-BEOZtg79.js → Copy01-DZu9JdFR.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-C2H6wRye.js → CreditCard01-e2iuA4b6.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-DddKhPwC.js → DotsVertical-2jz8M_Ab.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-CUSRsGW6.js → ErrorBarContext-pdbVvNIr.js} +1 -1
  17. package/dist/client/assets/{Globe04-CR7aWwIq.js → Globe04-Dv-Q1UFe.js} +1 -1
  18. package/dist/client/assets/{Image01-D9f6XNAl.js → Image01-Csw8Eb7F.js} +1 -1
  19. package/dist/client/assets/{Key01-BGQzZTLx.js → Key01-nj-094nh.js} +1 -1
  20. package/dist/client/assets/{Link01-_AjEk0aG.js → Link01-DIQIHWyZ.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-BeLPonYT.js → LinkBroken01-DiqXlFxy.js} +1 -1
  22. package/dist/client/assets/{Minus-DRtjDVr0.js → Minus-DGpW2R_Y.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CMcPb3p-.js → Monitor01-6lmVgqwN.js} +1 -1
  24. package/dist/client/assets/{Play-Bon9Nn-R.js → Play-Bw1hrhzw.js} +1 -1
  25. package/dist/client/assets/{Plus-DZ8OV5bq.js → Plus-BQ-ZwSoF.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-CduNCTtx.js → ReferenceLine-D96IaFnI.js} +1 -1
  27. package/dist/client/assets/{SearchMd-Coxjt-Zl.js → SearchMd-CcFldd9q.js} +1 -1
  28. package/dist/client/assets/{Sector-CNB3zVjr.js → Sector-Lv3mbSoh.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-CeVNpa4z.js → ShoppingBag01-Dt2W1jQn.js} +1 -1
  30. package/dist/client/assets/{Sun-E-EbUc0n.js → Sun-BCEy54hJ.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-B8-pBEhT.js → SwitchHorizontal01-ZVZ1PW_K.js} +1 -1
  32. package/dist/client/assets/{Tool01-CkZTily1.js → Tool01-DamUcObd.js} +1 -1
  33. package/dist/client/assets/{Trash01-C8OxhBl3.js → Trash01-CA_m_Fs0.js} +1 -1
  34. package/dist/client/assets/{Upload01-Bt37Plwz.js → Upload01-COlXo8Rs.js} +1 -1
  35. package/dist/client/assets/{UserSquare-D7fSnIn3.js → UserSquare-TWw3zsr7.js} +1 -1
  36. package/dist/client/assets/{Users01-DVEy527M.js → Users01-CqKKJKeH.js} +1 -1
  37. package/dist/client/assets/{XClose-Bvl4KGPV.js → XClose-BLrzcEcC.js} +1 -1
  38. package/dist/client/assets/Zap-CbyRjfWs.js +1 -0
  39. package/dist/client/assets/{ZoomOut-9x8WuC5l.js → ZoomOut-C8TxwIPG.js} +1 -1
  40. package/dist/client/assets/{access-gate-DaxHYIBB.js → access-gate-RZ9GSyUJ.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-CjJZP05X.js → add-connection-dialog-BVaDiahz.js} +1 -1
  42. package/dist/client/assets/agent-analytics-Cdw0YBIV.js +2 -0
  43. package/dist/client/assets/agent-app-CgNxZEzb.js +1 -0
  44. package/dist/client/assets/agent-assets-C6qXUWEv.js +1 -0
  45. package/dist/client/assets/{agent-automation-CI0Nub-n.js → agent-automation-N0vyewKq.js} +2 -2
  46. package/dist/client/assets/agent-automations-U4KLp_Jm.js +1 -0
  47. package/dist/client/assets/agent-calendar-VlbI2j-J.js +1 -0
  48. package/dist/client/assets/agent-connect-sources-DzR95Lay.js +1 -0
  49. package/dist/client/assets/agent-deck-SnZhc8k8.js +1 -0
  50. package/dist/client/assets/agent-e2e-7b8bEJgs.js +1 -0
  51. package/dist/client/assets/agent-experiments-DqhQbvgt.js +1 -0
  52. package/dist/client/assets/agent-file-qAGeJ5wq.js +1 -0
  53. package/dist/client/assets/agent-hosting-ZktfT8aB.js +1 -0
  54. package/dist/client/assets/agent-icon-rBB7-3Iv.js +1 -0
  55. package/dist/client/assets/agent-library-5yOHhp5F.js +1 -0
  56. package/dist/client/assets/agent-library-file-Cj3Cwkh2.js +1 -0
  57. package/dist/client/assets/agent-monitor-Bywg_SMe.js +1 -0
  58. package/dist/client/assets/agent-overview-C1fHYueD.js +1 -0
  59. package/dist/client/assets/{agent-releases-CEzBKX-V.js → agent-releases-BUlnts0m.js} +2 -2
  60. package/dist/client/assets/agent-settings-CQR-A0mU.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-Du4tKYJz.js → agent-site-editor-BxGyQ1GG.js} +2 -2
  62. package/dist/client/assets/agent-site-editor-code-lC9bSMmG.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-Bshm0mLR.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-DnlcRwFX.js +1 -0
  65. package/dist/client/assets/agent-view-DbVFezEQ.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-B04R8Znt.js → agent-view-guard-CrSlBYGa.js} +1 -1
  67. package/dist/client/assets/agents-list-DQMpcCgV.js +1 -0
  68. package/dist/client/assets/{ai-providers-aETP-f64.js → ai-providers-DmJhCIXK.js} +1 -1
  69. package/dist/client/assets/{alert-BF8n9shl.js → alert-Bg73iQHm.js} +1 -1
  70. package/dist/client/assets/{analytics-sections-SZXfO52-.js → analytics-sections-COL0BtKA.js} +1 -1
  71. package/dist/client/assets/api-keys-l4aX0wsP.js +1 -0
  72. package/dist/client/assets/{api-keys-CiBjRrwV.js → api-keys-yf9_DOP2.js} +1 -1
  73. package/dist/client/assets/app-editor-BoAUsCRl.js +1 -0
  74. package/dist/client/assets/{asset-utils-7zQmpZtP.js → asset-utils-BrDvPrYv.js} +1 -1
  75. package/dist/client/assets/{auth-Dt9DGFhA.js → auth-DPUc_dnx.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-APuNzDqf.js → auth-catchall-3vQklB_P.js} +1 -1
  77. package/dist/client/assets/{auth-entry-Dt8D4c49.js → auth-entry-DzHbwDpa.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-DKGBUJmn.js → auth-split-layout-CrNUjCQ4.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-CzFtziag.js → authenticate-and-persist-oauth-RWTag1bK.js} +1 -1
  80. package/dist/client/assets/automation-list-row-DJWeWPbv.js +1 -0
  81. package/dist/client/assets/{automation-runs-rp2R5GSb.js → automation-runs-C9XEPlIV.js} +1 -1
  82. package/dist/client/assets/automations-Dhk5JOxd.js +1 -0
  83. package/dist/client/assets/{autosend-BYljpA5c.js → autosend-Bw00xJf9.js} +1 -1
  84. package/dist/client/assets/{badge-CMgWUKiX.js → badge-BWAFo8iB.js} +1 -1
  85. package/dist/client/assets/{block-document-ClAOKgf4.js → block-document-D_ARyc6Z.js} +3 -3
  86. package/dist/client/assets/{blocks-preview-workspace-context-DQj4RBd8.js → blocks-preview-workspace-context-Bhzld3G9.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-CQydf1x6.js → blocks-tab-states-Bujj2Oag.js} +1 -1
  88. package/dist/client/assets/{blog-schema-BOqVZaeF.js → blog-schema-B3FO_Ydd.js} +1 -1
  89. package/dist/client/assets/{buckets-qwGMsdZj.js → buckets-D-TerXqE.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-B2MxMIfa.js → build-improve-prompt-doc-D_iuDFLq.js} +1 -1
  91. package/dist/client/assets/{calendar-gk2fXc2c.js → calendar-BRFOK1aQ.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-D2UF4Aw2.js → capability-load-error-BNI4R8XO.js} +1 -1
  93. package/dist/client/assets/category-editor-bZgzbes6.js +1 -0
  94. package/dist/client/assets/{cdn-tab-BJ_vvsuv.js → cdn-tab-BqJVJvQQ.js} +1 -1
  95. package/dist/client/assets/{chart-orNTiDQv.js → chart-Q09A7KSZ.js} +1 -1
  96. package/dist/client/assets/{chat-context-Cbn1d2gD.js → chat-context-DR3uLV2w.js} +1 -1
  97. package/dist/client/assets/{chat-draft-Dz-8ZkTL.js → chat-draft-CKNXk7gm.js} +1 -1
  98. package/dist/client/assets/{checkbox-CA6aWe75.js → checkbox-b8t24adl.js} +1 -1
  99. package/dist/client/assets/choose-editor-TtuwIl9O.js +1 -0
  100. package/dist/client/assets/{cli-auth-success-BwZvMY9K.js → cli-auth-success-Dt-ivrkY.js} +1 -1
  101. package/dist/client/assets/{client-icons-BokFUC05.js → client-icons-3S2BKupf.js} +1 -1
  102. package/dist/client/assets/cms-settings-editor-CoL1CtIi.js +1 -0
  103. package/dist/client/assets/{collapsible-DMa5aTxw.js → collapsible-BHetx99z.js} +1 -1
  104. package/dist/client/assets/collection-detail-C551YHre.js +1 -0
  105. package/dist/client/assets/{collection-display-button-CO0G5HBN.js → collection-display-button-BjEhoX6t.js} +1 -1
  106. package/dist/client/assets/{collection-search-BtpA2Lei.js → collection-search-2lwiZ_Gf.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-zNmZhsyo.js → collection-table-wrapper-TIbTouTp.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-CSXR7UYb.js → collection-tabs-DNvFQjqm.js} +1 -1
  109. package/dist/client/assets/{combobox-BwKhFDqj.js → combobox-CMpxb7Mm.js} +1 -1
  110. package/dist/client/assets/{command-lP5P8rqX.js → command-CermhoTd.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-CvFB8u3v.js → companion-mcps-section-CM4OIzwX.js} +1 -1
  112. package/dist/client/assets/{companions-core-DzyeM-yJ.js → companions-core-PpXpxfgQ.js} +1 -1
  113. package/dist/client/assets/{config-B8-1YX-t.js → config-VQsUFgqz.js} +1 -1
  114. package/dist/client/assets/{connect-D2iiXOSY.js → connect-BfWqzz_9.js} +1 -1
  115. package/dist/client/assets/{connect-layout-HGVTLejY.js → connect-layout-F601-RNu.js} +1 -1
  116. package/dist/client/assets/{connect-source-dialog-DXGOBfjT.js → connect-source-dialog-CBx-6nzq.js} +1 -1
  117. package/dist/client/assets/{connection-Cn9FrEsZ.js → connection-DrOf5a8e.js} +1 -1
  118. package/dist/client/assets/{connection-card-DlWLwRKA.js → connection-card-CZBuUPP_.js} +1 -1
  119. package/dist/client/assets/connection-detail-DPF8YmLk.js +1 -0
  120. package/dist/client/assets/{connection-form-helpers-DdDJu97E.js → connection-form-helpers-D3sfjZA_.js} +1 -1
  121. package/dist/client/assets/connections-lrErrE5H.js +1 -0
  122. package/dist/client/assets/{content-tab-B-LNJbd9.js → content-tab-DruH5Km_.js} +8 -8
  123. package/dist/client/assets/context-DmRBBX5q.js +1 -0
  124. package/dist/client/assets/{context-menu-gvTbM_VP.js → context-menu-Biz9RPI-.js} +1 -1
  125. package/dist/client/assets/{context-shell-BdVWw-gN.js → context-shell-CnZGomwI.js} +3 -3
  126. package/dist/client/assets/{core.esm-M1IJOkIH.js → core.esm-Dennsttt.js} +1 -1
  127. package/dist/client/assets/{create-organization-dialog-DNvzT5i-.js → create-organization-dialog-wSFwPaJG.js} +1 -1
  128. package/dist/client/assets/{daily-pulse-DOHhxMy1.js → daily-pulse-A6f95wwZ.js} +1 -1
  129. package/dist/client/assets/discover-DU-Rzely.js +1 -0
  130. package/dist/client/assets/{domain-settings-DRphZ3mS.js → domain-settings-Bnb_ZtIt.js} +1 -1
  131. package/dist/client/assets/{drawer-Bsnw19SA.js → drawer-CuUzaTfw.js} +1 -1
  132. package/dist/client/assets/{editor-Z7h3tdjo.js → editor-CJ37wKUc.js} +1 -1
  133. package/dist/client/assets/{editor-classes-CIysMLqw.js → editor-classes-yEQ_KPvG.js} +1 -1
  134. package/dist/client/assets/{empty-state-EpAwETL4.js → empty-state-DXBACaDC.js} +1 -1
  135. package/dist/client/assets/{empty-state-CEJi6IVu.js → empty-state-DhRsvQHO.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-BKBmpbQS.js → experiments-tab-Bx6GaOJU.js} +1 -1
  137. package/dist/client/assets/{experiments-tab-choice-EKyQNqty.js → experiments-tab-choice-B1sDnY5T.js} +1 -1
  138. package/dist/client/assets/{extract-connection-data-CGOVIYLF.js → extract-connection-data-DOpfeyzI.js} +1 -1
  139. package/dist/client/assets/{feature-gate-DXCleAqA.js → feature-gate-FbVbvaij.js} +1 -1
  140. package/dist/client/assets/{feature-paywall-4QJAn2z5.js → feature-paywall-CdkGt72v.js} +1 -1
  141. package/dist/client/assets/file-explorer-BfjvwZGe.js +2 -0
  142. package/dist/client/assets/{file-preview-CCmllyvi.js → file-preview-CpUVcTEC.js} +1 -1
  143. package/dist/client/assets/{file-share-button-DbPRyXAD.js → file-share-button-BFGgw9L9.js} +1 -1
  144. package/dist/client/assets/{file-type-icon-CiMMiUYO.js → file-type-icon-BkRHeWVz.js} +1 -1
  145. package/dist/client/assets/folder-icon-CEWb3RvH.js +1 -0
  146. package/dist/client/assets/{form-Bk9ymCIS.js → form-RFg7ydwN.js} +1 -1
  147. package/dist/client/assets/{general-Cr_ASK52.js → general-CCnErHaD.js} +1 -1
  148. package/dist/client/assets/{github-icon-EmEurWMX.js → github-icon-CfOxQ_kk.js} +1 -1
  149. package/dist/client/assets/github-repo-scope-CiKlF-H0.js +1 -0
  150. package/dist/client/assets/{held-block-view-BDu8bj-6.js → held-block-view-B1ZTgtaf.js} +3 -3
  151. package/dist/client/assets/home-d4IkLgAU.js +1 -0
  152. package/dist/client/assets/{hosted-publish-feedback-C3S_f767.js → hosted-publish-feedback-CaaC9Yio.js} +1 -1
  153. package/dist/client/assets/{icon-button-CcHZO8e6.js → icon-button-DUX8uev-.js} +1 -1
  154. package/dist/client/assets/{index-Bek871Hp.js → index-AhdOdumU.js} +1 -1
  155. package/dist/client/assets/{index-DGAfs5q1.js → index-BN1wxwBE.js} +1 -1
  156. package/dist/client/assets/{index-DvPTtoj9.js → index-BU3lM1Xe.js} +1 -1
  157. package/dist/client/assets/{index-CcyUawfW.js → index-CYvmYTza.js} +1 -1
  158. package/dist/client/assets/{index-CRt26OMk.js → index-CaPLCDO_.js} +1 -1
  159. package/dist/client/assets/{index-Bd1JsEWx.js → index-CuP8z21G.js} +1 -1
  160. package/dist/client/assets/{index-LISCRMKT.js → index-Cw6ilRLN.js} +5 -5
  161. package/dist/client/assets/{index-D_GgrLpt.js → index-DF_kVaV9.js} +1 -1
  162. package/dist/client/assets/{index-DMN6-ViK.js → index-DiHVaqTW.js} +2 -2
  163. package/dist/client/assets/{index-BaOc9Ezz.js → index-DiqyTQYB.js} +1 -1
  164. package/dist/client/assets/{index-BGKyyvyC.js → index-DnZM2vOx.js} +1 -1
  165. package/dist/client/assets/{index-DMJwbqhe.js → index-GbZ7cHim.js} +1 -1
  166. package/dist/client/assets/{index-KxuowPl9.js → index-KnmovUVi.js} +1 -1
  167. package/dist/client/assets/{index-Rjs_bdr_.js → index-ZjFFuBzo.js} +1 -1
  168. package/dist/client/assets/index-_wqQ3Hkr.css +1 -0
  169. package/dist/client/assets/{index-KpWMq2p9.js → index-nea5NUvS.js} +1 -1
  170. package/dist/client/assets/{index-redirect-C_c-8-0u.js → index-redirect-D8gnMr4D.js} +1 -1
  171. package/dist/client/assets/{infiniteQueryObserver-DGdbL4U6.js → infiniteQueryObserver-r2g3Rufl.js} +1 -1
  172. package/dist/client/assets/{infra-billing-CkpqPi0H.js → infra-billing-xKdFu2DK.js} +1 -1
  173. package/dist/client/assets/{input-BhbajINs.js → input-B3t37gB5.js} +1 -1
  174. package/dist/client/assets/{input-Cgw3HqQu.js → input-BiNlRIkN.js} +3 -3
  175. package/dist/client/assets/{integration-icon-msZhQ6E3.js → integration-icon-BvuUEHwl.js} +1 -1
  176. package/dist/client/assets/{jira-icon-C8kN-yG2.js → jira-icon-C17_Jc2B.js} +1 -1
  177. package/dist/client/assets/{label-BfYbFBpZ.js → label-DvonkoXD.js} +1 -1
  178. package/dist/client/assets/{layout-DFaNAdKK.js → layout-BiaPlBt-.js} +1 -1
  179. package/dist/client/assets/{legacy-agents-deep-BQflSkhZ.js → legacy-agents-deep-DV5Zxfa8.js} +1 -1
  180. package/dist/client/assets/{legacy-main-redirect-DaGWGhtf.js → legacy-main-redirect-3QdAqV_c.js} +1 -1
  181. package/dist/client/assets/library-DNyXivcG.js +1 -0
  182. package/dist/client/assets/{library-tab-4UasD5Mp.js → library-tab-Nfz-0YaQ.js} +3 -3
  183. package/dist/client/assets/{login-DtccMmUF.js → login-bITsid_u.js} +1 -1
  184. package/dist/client/assets/{markdown-CGLGjJUn.js → markdown-Bnq_rauO.js} +1 -1
  185. package/dist/client/assets/{mcp-app-renderer-BmH0oH65.js → mcp-app-renderer-D9bP7Uyj.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-D5bTwzBt.js → mcp-oauth-B1sQYgh4.js} +1 -1
  187. package/dist/client/assets/{mcp-oauth-CDHHl2AY.js → mcp-oauth-zW9MaFGn.js} +1 -1
  188. package/dist/client/assets/{members-CqaIW0DL.js → members-CXI65xvm.js} +1 -1
  189. package/dist/client/assets/{memory-DoZ_Hb59.js → memory-C-guhabj.js} +1 -1
  190. package/dist/client/assets/{mini-report-page-CWBsLXpy.js → mini-report-page-C9o2eyOe.js} +1 -1
  191. package/dist/client/assets/mock-board-BShoWwXR.js +81 -0
  192. package/dist/client/assets/{monaco-editor-B_hB8uvI.js → monaco-editor-DP1-rJ0v.js} +1 -1
  193. package/dist/client/assets/monitoring-CqLCuFHk.js +1 -0
  194. package/dist/client/assets/{monitoring-stats-row-va93h-kh.js → monitoring-stats-row-BRnhkE0A.js} +1 -1
  195. package/dist/client/assets/{multi-select-DqoGBuJR.js → multi-select-ID8vWjv8.js} +1 -1
  196. package/dist/client/assets/{mustache-YJnhKKzZ.js → mustache-nJjvu1VV.js} +1 -1
  197. package/dist/client/assets/{named-rule-uses-B5UiiWoJ.js → named-rule-uses-BHC4DlIQ.js} +1 -1
  198. package/dist/client/assets/{new-project-dialog-BrtI6GgZ.js → new-project-dialog-4twV8Y4C.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-IxBLpV6t.js → oauth-callback-ai-provider-Da3_ca8D.js} +1 -1
  200. package/dist/client/assets/{oauth-callback-DvCUGRkg.js → oauth-callback-h0NUpdOX.js} +1 -1
  201. package/dist/client/assets/{onboarding-CqirqsHd.js → onboarding-CvFXVvAB.js} +1 -1
  202. package/dist/client/assets/openai-conversation-9-S9iWS8.js +3 -0
  203. package/dist/client/assets/{optimistic-project-sidebar-views-CPWt9LH6.js → optimistic-project-sidebar-views-B65im_4W.js} +1 -1
  204. package/dist/client/assets/{order-monitor-day-or-R9J0S.js → order-monitor-day-GXa0K2fU.js} +1 -1
  205. package/dist/client/assets/{organization-choice-CeZ3suN4.js → organization-choice-DKpl7kTn.js} +1 -1
  206. package/dist/client/assets/{orgs-iTHfKpGx.js → orgs-Dt-LNqWF.js} +1 -1
  207. package/dist/client/assets/{page-seo-form-CdFLhDD2.js → page-seo-form-DzjOyYJI.js} +1 -1
  208. package/dist/client/assets/{pair-B_hske_9.js → pair-BwKW0A4I.js} +1 -1
  209. package/dist/client/assets/{parse-sections-rTJ9Vxva.js → parse-sections-C3Hmwt0I.js} +1 -1
  210. package/dist/client/assets/plan-BJIbgrS0.js +1 -0
  211. package/dist/client/assets/{plan-ladder-ROI7a8rc.js → plan-ladder-DIPGMFy3.js} +1 -1
  212. package/dist/client/assets/{plan-usage-card-DmpNxqNF.js → plan-usage-card-OrJ6ndWB.js} +1 -1
  213. package/dist/client/assets/{popover-D6dCz_8d.js → popover-N-Tbv2Q_.js} +1 -1
  214. package/dist/client/assets/post-calendar-BN2880sO.js +1 -0
  215. package/dist/client/assets/{post-editor-C9guOY0S.js → post-editor-SZ0T52l-.js} +2 -2
  216. package/dist/client/assets/{preview-content-DFI0aQf4.js → preview-content-BrY4N22Q.js} +1 -1
  217. package/dist/client/assets/{preview-dialog-D2HjzZ1B.js → preview-dialog-DNkXNQe2.js} +1 -1
  218. package/dist/client/assets/{preview-panel-0VJe1FDB.js → preview-panel-BeRdNuZC.js} +1 -1
  219. package/dist/client/assets/{preview-tab-CpG9tuu6.js → preview-tab-EJWXb_JS.js} +3 -3
  220. package/dist/client/assets/{product-picker-dialog-CFjl9WR-.js → product-picker-dialog-DJW0OQ7t.js} +1 -1
  221. package/dist/client/assets/{profile-CY0p7UGQ.js → profile-p2CkJE0T.js} +1 -1
  222. package/dist/client/assets/project-app-view-C_EMPbo0.js +1 -0
  223. package/dist/client/assets/project-apps-CbCNo3Qh.js +1 -0
  224. package/dist/client/assets/{project-feed-Cqb3oD2R.js → project-feed-BOoFoesM.js} +1 -1
  225. package/dist/client/assets/{project-icon-As9MoCET.js → project-icon-BRvDYuEF.js} +1 -1
  226. package/dist/client/assets/project-reports-Ckw4gPRj.js +1 -0
  227. package/dist/client/assets/project-tasks-DIs0LJKu.js +1 -0
  228. package/dist/client/assets/projects-DxaWyr4c.js +1 -0
  229. package/dist/client/assets/{projects-empty-state-B4wHwi2Z.js → projects-empty-state-q_kUg5xI.js} +1 -1
  230. package/dist/client/assets/{prompts-f4GajLV5.js → prompts-ORkU8nSR.js} +1 -1
  231. package/dist/client/assets/{provision-repo-scoped-github-connection-lckxpDHD.js → provision-repo-scoped-github-connection-DoOuHltS.js} +1 -1
  232. package/dist/client/assets/record-editor-C9Hk9gzX.js +1 -0
  233. package/dist/client/assets/redirect-editor-DTFg1kOc.js +1 -0
  234. package/dist/client/assets/{releases-api-kH_Ed6eO.js → releases-api-MmQe-HE4.js} +1 -1
  235. package/dist/client/assets/{reports-D2UCpDap.js → reports-C3nGzDLE.js} +1 -1
  236. package/dist/client/assets/reports-DpW566Gg.js +1 -0
  237. package/dist/client/assets/reports-onboarding-D8qOl7n6.js +1 -0
  238. package/dist/client/assets/reports-tab-BRsFQ8_g.js +2 -0
  239. package/dist/client/assets/{repositories-DzOMkV9O.js → repositories-DWS1FNsz.js} +1 -1
  240. package/dist/client/assets/repositories-rpqjpzkl.js +1 -0
  241. package/dist/client/assets/{repository-binding-N72ZtnJ7.js → repository-binding-PeMGXqSl.js} +1 -1
  242. package/dist/client/assets/{repository-import-picker-CNVRTxph.js → repository-import-picker-BMJ3biNs.js} +1 -1
  243. package/dist/client/assets/{repository-picker-CW0SaV-m.js → repository-picker-XiErYA7B.js} +1 -1
  244. package/dist/client/assets/{require-capability-C2GXhzLq.js → require-capability-42JNP4Dw.js} +1 -1
  245. package/dist/client/assets/{required-auth-layout-BwkU_8aI.js → required-auth-layout-DsfiOlyN.js} +1 -1
  246. package/dist/client/assets/{reset-password-gBMO6F0r.js → reset-password-CsAEO5bw.js} +1 -1
  247. package/dist/client/assets/{resizable-WR3fdR8J.js → resizable-XQP8BK4_.js} +1 -1
  248. package/dist/client/assets/{resolve-tab-icon-DS-pAijm.js → resolve-tab-icon-CguQjH43.js} +1 -1
  249. package/dist/client/assets/{review-settings-DcaJvbTX.js → review-settings-U2xSoSbC.js} +1 -1
  250. package/dist/client/assets/roles-DZFrq3cC.js +1 -0
  251. package/dist/client/assets/route-BeAt5Jxq.js +1 -0
  252. package/dist/client/assets/route-C-GIqs4Z.js +1 -0
  253. package/dist/client/assets/route-DKXnO--k.js +1 -0
  254. package/dist/client/assets/{sandbox-lifecycle-context-BBDd5Vd6.js → sandbox-lifecycle-context-DB7MI-hA.js} +1 -1
  255. package/dist/client/assets/{schema-C2dfCTpF.js → schema-CB30E7Gi.js} +1 -1
  256. package/dist/client/assets/{schema-cjQbFYEA.js → schema-DGh8triY.js} +1 -1
  257. package/dist/client/assets/{scroll-area-DYvdRQ3X.js → scroll-area-BhjyScQp.js} +1 -1
  258. package/dist/client/assets/{search-input-DfJJHgak.js → search-input-CnMfC6Ib.js} +1 -1
  259. package/dist/client/assets/{search-toggle-K39LDgc3.js → search-toggle-BsT7rhT7.js} +1 -1
  260. package/dist/client/assets/{secret-picker-COEpc_Br.js → secret-picker-DRe1iXLV.js} +1 -1
  261. package/dist/client/assets/{secrets-DpnxLirI.js → secrets-Cm-nUiVG.js} +1 -1
  262. package/dist/client/assets/{section-array-field-cPwKvhUj.js → section-array-field-CowajgIO.js} +1 -1
  263. package/dist/client/assets/{sections-DQYOsFQr.js → sections-DN1XjEty.js} +1 -1
  264. package/dist/client/assets/sections-editor-KyiXwNg4.js +1 -0
  265. package/dist/client/assets/{select-Ce8n-RXJ.js → select-IRnWfSEI.js} +1 -1
  266. package/dist/client/assets/{select-model-DrlCeL1J.js → select-model-_tURUtw8.js} +1 -1
  267. package/dist/client/assets/seo-editor-DQuBtXMq.js +1 -0
  268. package/dist/client/assets/{separator-CMPRlDqA.js → separator-AD4s_4vt.js} +1 -1
  269. package/dist/client/assets/settings-tab-Cyi9Dt5w.js +1 -0
  270. package/dist/client/assets/{sheet-C1Iz_daC.js → sheet-CLT2kz10.js} +1 -1
  271. package/dist/client/assets/shell-layout-CdKs-SVX.js +1 -0
  272. package/dist/client/assets/{site-draft-actions-Cwq-m4rQ.js → site-draft-actions-K5CCMVX6.js} +1 -1
  273. package/dist/client/assets/{site-draft-view-BGk8W1nm.js → site-draft-view-Dzca4Bar.js} +2 -2
  274. package/dist/client/assets/site-editor-B1tNbOKR.js +1 -0
  275. package/dist/client/assets/{site-editor-toast-BZwEeugO.js → site-editor-toast-MdEv_oKc.js} +1 -1
  276. package/dist/client/assets/skills-DIJP95gf.js +1 -0
  277. package/dist/client/assets/{slider-BRlhk1I_.js → slider-BOLJxYF2.js} +1 -1
  278. package/dist/client/assets/{sortable.esm-DfWQuMf-.js → sortable.esm-CIFqofWL.js} +1 -1
  279. package/dist/client/assets/{sso-Bl0_X14P.js → sso-DqMDaenE.js} +1 -1
  280. package/dist/client/assets/{suggestion-C79o6bsf.js → suggestion-tz-f65fQ.js} +1 -1
  281. package/dist/client/assets/{switch-B5fLkk4G.js → switch-D45dHrK3.js} +1 -1
  282. package/dist/client/assets/{symbol-AaQxOm0Y.js → symbol-Femlxd_m.js} +1 -1
  283. package/dist/client/assets/{synced-repos-Bes2Akem.js → synced-repos-45QejDcI.js} +1 -1
  284. package/dist/client/assets/{tab-icon-glyph-X9RKDulT.js → tab-icon-glyph-pt4s2Grb.js} +1 -1
  285. package/dist/client/assets/{table-CR0vxly9.js → table-Daq1_j7m.js} +1 -1
  286. package/dist/client/assets/{tabs-BeQ3GpBj.js → tabs-DBG72Yee.js} +1 -1
  287. package/dist/client/assets/{task-assignee-avatar-BxtkZ6j_.js → task-assignee-avatar-DrrfJr__.js} +1 -1
  288. package/dist/client/assets/{task-board-DfACAZyY.js → task-board-DSKYQnUa.js} +1 -1
  289. package/dist/client/assets/{task-route-CEMyrZwM.js → task-route-D46EYWzc.js} +1 -1
  290. package/dist/client/assets/{task-status-CwtxChqi.js → task-status-CJpXljEZ.js} +1 -1
  291. package/dist/client/assets/taskboard-analytics-COtnoUXH.js +1 -0
  292. package/dist/client/assets/{tasks-5giK8VZS.js → tasks-D5O8k4au.js} +3 -3
  293. package/dist/client/assets/tasks-Dkj9k49d.js +1 -0
  294. package/dist/client/assets/{textarea-1B6eWYpg.js → textarea-B3VJ1IVc.js} +1 -1
  295. package/dist/client/assets/thread-analytics-yTtiboMK.js +1 -0
  296. package/dist/client/assets/{thread-intent-ptqgtSKo.js → thread-intent-CAWCzeoG.js} +1 -1
  297. package/dist/client/assets/{thread-route-CCN9I68_.js → thread-route-BZQyZ1gL.js} +1 -1
  298. package/dist/client/assets/thread-route-C3He_naw.js +1 -0
  299. package/dist/client/assets/{thread-sheet-body-Opalk3rB.js → thread-sheet-body-vk26kAGI.js} +1 -1
  300. package/dist/client/assets/{time-range-picker-D-3pTVaL.js → time-range-picker-Dwtk68FK.js} +1 -1
  301. package/dist/client/assets/{toggle-group-DhjHoFhg.js → toggle-group-BtOmVjMF.js} +1 -1
  302. package/dist/client/assets/{tool-namespace-EPn7Kyb1.js → tool-namespace-COirY7s5.js} +1 -1
  303. package/dist/client/assets/{toolbar-icon-button-DOtu5VNi.js → toolbar-icon-button-as98rium.js} +1 -1
  304. package/dist/client/assets/{tooltip-DiW2ytsS.js → tooltip-g1j6c67B.js} +1 -1
  305. package/dist/client/assets/{tooltipContext-Boh-kskS.js → tooltipContext-CLvPoHx0.js} +1 -1
  306. package/dist/client/assets/{track-DDsr4-8X.js → track-CbG7q0Jx.js} +1 -1
  307. package/dist/client/assets/{types-CAqly_33.js → types-C_kLVB_R.js} +1 -1
  308. package/dist/client/assets/{url-slug-BimzZyel.js → url-slug-DFbBJdJJ.js} +1 -1
  309. package/dist/client/assets/{usage-stats-DyqnqVDM.js → usage-stats-CO_PzmjR.js} +1 -1
  310. package/dist/client/assets/{use-ai-providers-DGRaKYBP.js → use-ai-providers-UYArMe6s.js} +1 -1
  311. package/dist/client/assets/{use-apply-named-rule-TltIMgYp.js → use-apply-named-rule-DjUylbM_.js} +1 -1
  312. package/dist/client/assets/{use-automations-DcNzV0FS.js → use-automations-fhgNtkrI.js} +1 -1
  313. package/dist/client/assets/{use-autosave-DQJxV1eg.js → use-autosave-VNB60wel.js} +1 -1
  314. package/dist/client/assets/{use-chat-layout-state-lg3L3DSm.js → use-chat-layout-state-uzyWoT7E.js} +1 -1
  315. package/dist/client/assets/{use-clock-tick-BXkjZk4h.js → use-clock-tick-Bbl4jizB.js} +1 -1
  316. package/dist/client/assets/{use-cms-publish-actions-Cg-2YJOJ.js → use-cms-publish-actions-Oa0EZQ0t.js} +1 -1
  317. package/dist/client/assets/{use-connect-companion-FMSyv7iG.js → use-connect-companion-BinIX0nI.js} +1 -1
  318. package/dist/client/assets/{use-connection-DZPkoV0a.js → use-connection-BeEdNRHa.js} +1 -1
  319. package/dist/client/assets/{use-copy-Bb3ge3Jw.js → use-copy-Dk3cEiBB.js} +1 -1
  320. package/dist/client/assets/{use-create-virtual-mcp-CFxxMtOW.js → use-create-virtual-mcp-CcnOX0WT.js} +1 -1
  321. package/dist/client/assets/{use-date-fns-locale-DTg1snyT.js → use-date-fns-locale-CpjJIfQT.js} +1 -1
  322. package/dist/client/assets/{use-debounced-autosave-DKsafE_B.js → use-debounced-autosave-QN0_xGaq.js} +1 -1
  323. package/dist/client/assets/{use-debounced-value-DBl2u8Ax.js → use-debounced-value-Cg3pn3hJ.js} +1 -1
  324. package/dist/client/assets/{use-deco-credits-CHyZsaQg.js → use-deco-credits-C5r8tKZH.js} +1 -1
  325. package/dist/client/assets/{use-decopilot-events-ChnGZu8F.js → use-decopilot-events-D7GIEyuu.js} +1 -1
  326. package/dist/client/assets/{use-delete-connection-Txpqn3lI.js → use-delete-connection-Cx5vGSZR.js} +1 -1
  327. package/dist/client/assets/{use-deployment-admin-Do6VU3ed.js → use-deployment-admin-DVUkJw7-.js} +1 -1
  328. package/dist/client/assets/{use-entitlements-9vbVfq68.js → use-entitlements-C4tNpLNZ.js} +1 -1
  329. package/dist/client/assets/{use-fast-preview-draft-url-CXQ7cT85.js → use-fast-preview-draft-url-C2yv-JdA.js} +1 -1
  330. package/dist/client/assets/{use-file-configs-Dn7YLM4Z.js → use-file-configs-C8WLQuJ_.js} +1 -1
  331. package/dist/client/assets/{use-inbox-feed-BZyJNQXN.js → use-inbox-feed-CmYEHjcJ.js} +1 -1
  332. package/dist/client/assets/{use-infinite-scroll-CB0WyAlc.js → use-infinite-scroll-dtUi5Sm6.js} +1 -1
  333. package/dist/client/assets/{use-join-requests-CW_FogGu.js → use-join-requests-CACMdSxj.js} +1 -1
  334. package/dist/client/assets/{use-main-panel-tabs-BtH_KnVM.js → use-main-panel-tabs-6UM-eEDy.js} +1 -1
  335. package/dist/client/assets/{use-mcp-auth-status-CKDFCOAa.js → use-mcp-auth-status-nCZ8OnbU.js} +1 -1
  336. package/dist/client/assets/{use-mcp-client-0e8NRgfT.js → use-mcp-client-CvhC1TIJ.js} +1 -1
  337. package/dist/client/assets/{use-mcp-prompts-B2c7TGKV.js → use-mcp-prompts-BWsIl6wX.js} +1 -1
  338. package/dist/client/assets/{use-mcp-tools-BWk4AICK.js → use-mcp-tools-I_UsR8Xf.js} +1 -1
  339. package/dist/client/assets/{use-mobile-BJBInbLU.js → use-mobile-CKqq0hw6.js} +1 -1
  340. package/dist/client/assets/{use-move-blocks-sjThA1Ew.js → use-move-blocks-D5l0lx5X.js} +1 -1
  341. package/dist/client/assets/{use-navigate-to-agent-CpRnIp1k.js → use-navigate-to-agent-X54xBbs-.js} +1 -1
  342. package/dist/client/assets/{use-org-fs-B8r-1D4b.js → use-org-fs-wk2PRaOo.js} +1 -1
  343. package/dist/client/assets/{use-org-repo-syncs-Dq0Qf-et.js → use-org-repo-syncs-ON_B-I08.js} +1 -1
  344. package/dist/client/assets/{use-org-sso-DVHlBcmx.js → use-org-sso-1YltyqLi.js} +1 -1
  345. package/dist/client/assets/{use-organization-roles-DYmDerrq.js → use-organization-roles-CxgWGtCR.js} +1 -1
  346. package/dist/client/assets/{use-organization-settings-CK8r9oqu.js → use-organization-settings-BFBXS4UG.js} +1 -1
  347. package/dist/client/assets/{use-panel-navigate-CnrhnUVG.js → use-panel-navigate-DzWclIwL.js} +1 -1
  348. package/dist/client/assets/{use-project-native-view-presence-DnAEbSTa.js → use-project-native-view-presence-B8VDwbCS.js} +1 -1
  349. package/dist/client/assets/{use-project-scope-LiKIXaiK.js → use-project-scope-Bq5GrrDd.js} +1 -1
  350. package/dist/client/assets/{use-recent-apps-Dbpw5TB5.js → use-recent-apps-DBlZNiUD.js} +1 -1
  351. package/dist/client/assets/{use-releases-ClTQL_RZ.js → use-releases-Dth9LHEU.js} +1 -1
  352. package/dist/client/assets/{use-reports-diagnostic-DVwMPgD_.js → use-reports-diagnostic-Do0xVL-L.js} +1 -1
  353. package/dist/client/assets/{use-sandbox-events-BAik2LAS.js → use-sandbox-events-vz4ehPML.js} +1 -1
  354. package/dist/client/assets/{use-secrets-ZlehcjzW.js → use-secrets-Byq7_LZ0.js} +1 -1
  355. package/dist/client/assets/{use-section-preview-base-CLumQxEU.js → use-section-preview-base-Bi-N531T.js} +1 -1
  356. package/dist/client/assets/{use-session-runtime-PX0UU1rX.js → use-session-runtime-C29BLCO5.js} +1 -1
  357. package/dist/client/assets/{use-sidebar-collapsed-ByUss2bb.js → use-sidebar-collapsed-CC40xbK2.js} +1 -1
  358. package/dist/client/assets/{use-tags-CeuMPNMY.js → use-tags-DsgZua5i.js} +1 -1
  359. package/dist/client/assets/{use-task-board-analytics-DzVWF5Q4.js → use-task-board-analytics-BTfxOx5Z.js} +1 -1
  360. package/dist/client/assets/{use-task-board-events-Cuq4HTGo.js → use-task-board-events-BQ73Mjf5.js} +1 -1
  361. package/dist/client/assets/{use-task-board-item-prs-BZA4s0mM.js → use-task-board-item-prs-D1aN1p6d.js} +1 -1
  362. package/dist/client/assets/use-task-board-prompts-CaMiqHjx.js +1 -0
  363. package/dist/client/assets/{use-task-metadata-De52Dfmg.js → use-task-metadata-RAKFvADU.js} +1 -1
  364. package/dist/client/assets/{use-thread-analytics-HQsRrHEt.js → use-thread-analytics-UYwynn2f.js} +1 -1
  365. package/dist/client/assets/{use-thread-outputs-BT4PyLKe.js → use-thread-outputs-DsSeydeQ.js} +1 -1
  366. package/dist/client/assets/useInfiniteQuery-qZeYk4so.js +1 -0
  367. package/dist/client/assets/{useQueries-nk-gppMK.js → useQueries-BxilFdP8.js} +1 -1
  368. package/dist/client/assets/useSuspenseInfiniteQuery-CTPa_bH3.js +1 -0
  369. package/dist/client/assets/{users-CLgvJMnS.js → users-CfzZpC_f.js} +1 -1
  370. package/dist/client/assets/{utils-BDRBqTP5.js → utils-CFwQd3Dj.js} +1 -1
  371. package/dist/client/assets/variant-calendar-DAzhjaCK.js +1 -0
  372. package/dist/client/assets/{variant-matcher-override-D6IszGLS.js → variant-matcher-override-KA8G6wne.js} +1 -1
  373. package/dist/client/assets/{view-header-Ce7a2voT.js → view-header-D4T3g6Y4.js} +1 -1
  374. package/dist/client/assets/{virtual-mcp-C5JzNRIg.js → virtual-mcp-CJAqxDe2.js} +1 -1
  375. package/dist/client/assets/{watch-sse-pool-CBQ2__fw.js → watch-sse-pool-BxinXtVa.js} +1 -1
  376. package/dist/client/index.html +2 -2
  377. package/dist/server/server.js +2 -2
  378. package/package.json +1 -1
  379. package/dist/client/assets/agent-analytics-BEKl1X8N.js +0 -2
  380. package/dist/client/assets/agent-app-8j-E-hT5.js +0 -1
  381. package/dist/client/assets/agent-assets-DQ6hVD8p.js +0 -1
  382. package/dist/client/assets/agent-automations-DzkmpBZa.js +0 -1
  383. package/dist/client/assets/agent-calendar-BC2tVvZL.js +0 -1
  384. package/dist/client/assets/agent-connect-sources-Dh7wTbNs.js +0 -1
  385. package/dist/client/assets/agent-deck-07no_3NQ.js +0 -1
  386. package/dist/client/assets/agent-e2e-Ds3Fe2AE.js +0 -1
  387. package/dist/client/assets/agent-experiments-DofmmJcd.js +0 -1
  388. package/dist/client/assets/agent-file-6W_Gnaal.js +0 -1
  389. package/dist/client/assets/agent-hosting-vZ66b5t2.js +0 -1
  390. package/dist/client/assets/agent-icon-Co7E9kYl.js +0 -1
  391. package/dist/client/assets/agent-library-R2xLquH1.js +0 -1
  392. package/dist/client/assets/agent-library-file-BXlKOL8M.js +0 -1
  393. package/dist/client/assets/agent-monitor-BoyNxcz1.js +0 -1
  394. package/dist/client/assets/agent-overview-CSwJW27z.js +0 -1
  395. package/dist/client/assets/agent-settings-BGDVCihC.js +0 -1
  396. package/dist/client/assets/agent-site-editor-code-FDZ6QYUh.js +0 -2
  397. package/dist/client/assets/agent-site-editor-content-kP1qC2rB.js +0 -1
  398. package/dist/client/assets/agent-site-editor-preview-DmkFZKpC.js +0 -1
  399. package/dist/client/assets/agent-view-CH596Gq0.js +0 -1
  400. package/dist/client/assets/agents-list-CBfEPAhK.js +0 -1
  401. package/dist/client/assets/api-keys-9pHr3QlX.js +0 -1
  402. package/dist/client/assets/app-editor-BVC0eWvP.js +0 -1
  403. package/dist/client/assets/automation-list-row-BvcdSOir.js +0 -1
  404. package/dist/client/assets/automations-C2DGayAE.js +0 -1
  405. package/dist/client/assets/category-editor-BaE2uAd6.js +0 -1
  406. package/dist/client/assets/choose-editor-C2L8nFMF.js +0 -1
  407. package/dist/client/assets/cms-settings-editor-DTAdiNDN.js +0 -1
  408. package/dist/client/assets/collection-detail-tC_GRfYF.js +0 -1
  409. package/dist/client/assets/column-rules-C63NCpq3.js +0 -3
  410. package/dist/client/assets/connection-detail-C98bDTVH.js +0 -1
  411. package/dist/client/assets/connections-C6M8AgjO.js +0 -1
  412. package/dist/client/assets/context-CPd4zSV0.js +0 -1
  413. package/dist/client/assets/discover-COhVLrYW.js +0 -1
  414. package/dist/client/assets/file-explorer-Bd3gIXGV.js +0 -2
  415. package/dist/client/assets/folder-icon-rxpoDvAE.js +0 -1
  416. package/dist/client/assets/github-repo-scope-ByTYKy_L.js +0 -1
  417. package/dist/client/assets/home-DGMtvNuq.js +0 -1
  418. package/dist/client/assets/index-By_-wb1N.css +0 -1
  419. package/dist/client/assets/library-CdfdY0qf.js +0 -1
  420. package/dist/client/assets/mock-board-piOcYIBD.js +0 -81
  421. package/dist/client/assets/monitoring-3dbLT4OM.js +0 -1
  422. package/dist/client/assets/openai-conversation-DGR8tfoH.js +0 -3
  423. package/dist/client/assets/plan-CKUD-2iO.js +0 -1
  424. package/dist/client/assets/post-calendar-DkrNCJu_.js +0 -1
  425. package/dist/client/assets/project-app-view-Cf1gd22p.js +0 -1
  426. package/dist/client/assets/project-apps-X2VfH52k.js +0 -1
  427. package/dist/client/assets/project-reports-BVlytfOe.js +0 -1
  428. package/dist/client/assets/project-tasks-BGW3O_F5.js +0 -1
  429. package/dist/client/assets/projects-oKJE7kAY.js +0 -1
  430. package/dist/client/assets/record-editor-BOGjSPiY.js +0 -1
  431. package/dist/client/assets/redirect-editor-DxMUngFX.js +0 -1
  432. package/dist/client/assets/reports-N81wb4Wq.js +0 -1
  433. package/dist/client/assets/reports-onboarding-CljQnv9P.js +0 -1
  434. package/dist/client/assets/reports-tab-CSx5fOj6.js +0 -2
  435. package/dist/client/assets/repositories-DL-11--e.js +0 -1
  436. package/dist/client/assets/roles-Brhhqsw3.js +0 -1
  437. package/dist/client/assets/route-BmSXOav-.js +0 -1
  438. package/dist/client/assets/route-C51vZk3q.js +0 -1
  439. package/dist/client/assets/route-D_u0Bw_R.js +0 -1
  440. package/dist/client/assets/sections-editor-p5iYgj5l.js +0 -1
  441. package/dist/client/assets/seo-editor-BtHI4gWU.js +0 -1
  442. package/dist/client/assets/settings-tab-qkoZ5Hhk.js +0 -1
  443. package/dist/client/assets/shell-layout-DUwEP5qi.js +0 -1
  444. package/dist/client/assets/site-editor-DBH3tuRQ.js +0 -1
  445. package/dist/client/assets/skills-CmU0q2d6.js +0 -1
  446. package/dist/client/assets/taskboard-analytics-nTEghmrx.js +0 -1
  447. package/dist/client/assets/tasks-sE4UNYKk.js +0 -1
  448. package/dist/client/assets/thread-analytics-DRVZv6bu.js +0 -1
  449. package/dist/client/assets/thread-route-BnB8pcK6.js +0 -1
  450. package/dist/client/assets/useInfiniteQuery-ChletbBT.js +0 -1
  451. package/dist/client/assets/useSuspenseInfiniteQuery-BJjYTjXx.js +0 -1
  452. package/dist/client/assets/variant-calendar-DOQE-pkF.js +0 -1
@@ -1 +1 @@
1
- import{c as w,j as s,b as B,h8 as Q,l as D,E as me,r as q,d as xe,hj as Z,aC as pe}from"./index-LISCRMKT.js";import{b as J,C as ee}from"./chart-orNTiDQv.js";import{e as he,a as ge,b as W,T as je,d as be,c as ye}from"./table-CR0vxly9.js";import{i as ve}from"./AlertCircle-Pu-QR8hS.js";import{i as ke,n as Ne}from"./ArrowUp-bMBjrwqG.js";import{u as Se,a1 as Ce,aq as we,a9 as $e}from"./agent-icon-Co7E9kYl.js";import{a as te,T as se}from"./toggle-group-DhjHoFhg.js";import{B as Y}from"./badge-CMgWUKiX.js";import{l as ne,c as Te,b as De,S as Oe}from"./config-B8-1YX-t.js";import{a as G,B as U}from"./BarChart-DW5fB9sQ.js";import{C as H,X as P,Y as V}from"./CartesianChart-BfqGbR2p.js";import{a as Ie,A as Be}from"./AreaChart-DJ3vI97z.js";function le(a){const e=w.c(8),{href:t,className:d,children:o}=a,c=xe();let r;e[0]!==t||e[1]!==c?(r=n=>{!t||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||(n.preventDefault(),c({href:t}))},e[0]=t,e[1]=c,e[2]=r):r=e[2];let l;return e[3]!==o||e[4]!==d||e[5]!==t||e[6]!==r?(l=s.jsx("a",{href:t,className:d,onClick:r,children:o}),e[3]=o,e[4]=d,e[5]=t,e[6]=r,e[7]=l):l=e[7],l}const L=(a,e,t)=>a&&e?()=>a({drill:e,label:t}):void 0,F="cursor-pointer text-left transition-colors hover:bg-accent focus-ring",E=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],A={fontSize:11,fill:"var(--muted-foreground)",opacity:.7};function ae(a){const e=Math.abs(a);return e<60?`${Math.round(a)}s`:e<3600?`${Math.round(a/60)}m`:e<86400?`${(a/3600).toFixed(1)}h`:`${(a/86400).toFixed(1)}d`}function M(a,e){return a===null||Number.isNaN(a)?"—":e==="s"?ae(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function X(a,e){return e==="s"?ae(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const re=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Le=/^\d{4}-\d{2}-\d{2}$/;function Me(a,e){return typeof a=="number"?M(a,e):Le.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):re.test(a)?Z(a):a}function _(a){const e=w.c(20),{title:t,value:d,caption:o,aside:c,children:r,onClick:l}=a,n=l?"button":"section",i=l?"button":void 0,u=l&&F;let f;e[0]!==u?(f=D("surface flex h-full w-full flex-col gap-6 px-4 pt-4 pb-5",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==t?(x=s.jsx("h3",{className:"text-sm text-foreground/70",children:t}),e[2]=t,e[3]=x):x=e[3];let m;e[4]!==d?(m=d!==void 0&&s.jsx("span",{className:"tnum text-4xl font-normal text-foreground",children:d}),e[4]=d,e[5]=m):m=e[5];let h;e[6]!==o||e[7]!==x||e[8]!==m?(h=s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[x,m,o]}),e[6]=o,e[7]=x,e[8]=m,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h,c]}),e[10]=c,e[11]=h,e[12]=p):p=e[12];let j;return e[13]!==n||e[14]!==r||e[15]!==l||e[16]!==i||e[17]!==f||e[18]!==p?(j=s.jsxs(n,{type:i,onClick:l,className:f,children:[p,r]}),e[13]=n,e[14]=r,e[15]=l,e[16]=i,e[17]=f,e[18]=p,e[19]=j):j=e[19],j}function ie(a){const e=w.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=ne(t,d),e[0]=t,e[1]=d,e[2]=o):o=e[2];const{label:c,visual:r}=o,l=r.icon;let n;e[3]!==l||e[4]!==r.iconClassName?(n=s.jsx(l,{className:r.iconClassName}),e[3]=l,e[4]=r.iconClassName,e[5]=n):n=e[5];let i;return e[6]!==c||e[7]!==n?(i=s.jsxs(Y,{variant:"muted",children:[n,c]}),e[6]=c,e[7]=n,e[8]=i):i=e[8],i}function R(a){const e=w.c(2),{children:t}=a;let d;return e[0]!==t?(d=s.jsx("div",{className:"flex h-20 items-center justify-center text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=d):d=e[1],d}function _e(a){const e=w.c(21),{value:t,previous:d,unit:o,better:c}=a,r=B();if(t===null||d===null||d===void 0){let p;e[0]!==r?(p=r("taskBoard.analytics.noPrior"),e[0]=r,e[1]=p):p=e[1];let j;return e[2]!==p?(j=s.jsx("span",{className:"text-meta",children:p}),e[2]=p,e[3]=j):j=e[3],j}const l=Math.round((t-d)*10)/10,n=c==="down"?l<0:l>0;let i;e[4]!==l||e[5]!==r||e[6]!==o?(i=o==="%"?r("taskBoard.analytics.points",{n:String(Math.abs(l))}):M(Math.abs(l),o),e[4]=l,e[5]=r,e[6]=o,e[7]=i):i=e[7];const u=i;let f;e[8]!==u||e[9]!==c||e[10]!==l||e[11]!==n||e[12]!==r?(f=l===0?r("taskBoard.analytics.unchanged"):s.jsxs("span",{className:D("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ke,{size:12}):s.jsx(Ne,{size:12}),u]}),e[8]=u,e[9]=c,e[10]=l,e[11]=n,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==r?(x=r("taskBoard.analytics.vsPrevious"),e[14]=r,e[15]=x):x=e[15];let m;e[16]!==x?(m=s.jsx("span",{children:x}),e[16]=x,e[17]=m):m=e[17];let h;return e[18]!==f||e[19]!==m?(h=s.jsxs("span",{className:"text-meta inline-flex items-center gap-1",children:[f,m]}),e[18]=f,e[19]=m,e[20]=h):h=e[20],h}const Re={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",5:"lg:grid-cols-5",6:"lg:grid-cols-3",9:"lg:grid-cols-3"};function Ae(a){const e=w.c(10),{section:t,onDrill:d}=a,o=Re[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=D("grid grid-cols-2 gap-4",o),e[0]=o,e[1]=c):c=e[1];let r;if(e[2]!==d||e[3]!==t.values){let n;e[5]!==d?(n=i=>s.jsx(_,{title:i.label,value:M(i.value,i.unit),onClick:L(d,i.drill,i.label),caption:s.jsxs(s.Fragment,{children:[i.detail&&s.jsx("span",{className:"text-sm text-muted-foreground",children:i.detail}),i.previous!==void 0&&s.jsx(_e,{value:i.value,previous:i.previous,unit:i.unit,better:i.better})]})},i.label),e[5]=d,e[6]=n):n=e[6],r=t.values.map(n),e[2]=d,e[3]=t.values,e[4]=r}else r=e[4];let l;return e[7]!==c||e[8]!==r?(l=s.jsx("div",{className:c,children:r}),e[7]=c,e[8]=r,e[9]=l):l=e[9],l}function Ke(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ee(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Fe(a,e,t){const d=new Map(a.map(l=>[String(l.t??"").slice(0,10),l])),o=new Date(`${t.from.slice(0,10)}T00:00:00.000Z`),c=t.to.slice(0,10),r=[];for(;o.toISOString().slice(0,10)<=c;){const l=o.toISOString().slice(0,10);r.push(d.get(l)??{t:o.toISOString(),...Object.fromEntries(e.map(n=>[n,0]))}),o.setUTCDate(o.getUTCDate()+1)}return r}function oe(a){const e=w.c(17),{active:t,payload:d,unit:o,nameOf:c}=a,r=c===void 0?String:c;if(!t||!d?.length)return null;const l=d[0]?.payload,n=l?.t;let i;e[0]!==l?.label||e[1]!==n?(i=typeof n=="string"?new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"}):String(l?.label??""),e[0]=l?.label,e[1]=n,e[2]=i):i=e[2];let u;e[3]!==i?(u=s.jsx("div",{className:"mb-1 text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=u):u=e[4];let f;if(e[5]!==r||e[6]!==d||e[7]!==o){let h;e[9]!==r||e[10]!==o?(h=p=>s.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:p.color}}),s.jsx("span",{className:"text-muted-foreground",children:r(String(p.dataKey))}),s.jsx("span",{className:"tnum ml-auto pl-3 font-medium",children:M(typeof p.value=="number"?p.value:null,o)})]},String(p.dataKey)),e[9]=r,e[10]=o,e[11]=h):h=e[11],f=d.map(h),e[5]=r,e[6]=d,e[7]=o,e[8]=f}else f=e[8];let x;e[12]!==f?(x=s.jsx("div",{className:"flex flex-col gap-1",children:f}),e[12]=f,e[13]=x):x=e[13];let m;return e[14]!==u||e[15]!==x?(m=s.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[u,x]}),e[14]=u,e[15]=x,e[16]=m):m=e[16],m}function ze(a){const e=w.c(27),{section:t,range:d}=a,o=B(),c=t.unit??void 0,r=c!=="%"&&c!=="s";let l;if(e[0]!==r||e[1]!==d||e[2]!==t.points||e[3]!==t.title||e[4]!==o||e[5]!==c){const n=Ke(t.points),i=r?Ee(t.points,n):n,u=y=>E[n.indexOf(y)%E.length],f=Object.fromEntries(i.map(y=>[y,{label:y,color:u(y)}])),m=(r&&d?Fe(t.points,n,d):t.points).map(Ge);let h;if(e[7]!==t.title){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=/\W+/g,e[9]=y):y=e[9],h=t.title.replace(y,"-"),e[7]=t.title,e[8]=h}else h=e[8];const p=`analytics-${h}`;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[10]=j):j=e[10];const v=j;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=k):k=e[11];const b=k;let $;e[12]!==c?($=c==="%"?[0,100]:[0,"auto"],e[12]=c,e[13]=$):$=e[13];const S=c!==void 0;let g;e[14]!==c?(g=y=>X(y,c),e[14]=c,e[15]=g):g=e[15];let C;e[16]!==$||e[17]!==S||e[18]!==g?(C=s.jsx(V,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,domain:$,allowDecimals:S,tickFormatter:g,width:48,tickCount:5}),e[16]=$,e[17]=S,e[18]=g,e[19]=C):C=e[19];const O=C;let T;e[20]!==r?(T=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=T):T=e[21];let I;e[22]!==c?(I=y=>{const{active:z,payload:fe}=y;return s.jsx(oe,{active:z,payload:fe,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==T?(N=s.jsx(ee,{cursor:T,content:I}),e[24]=I,e[25]=T,e[26]=N):N=e[26];const K=N;l=s.jsx(_,{title:t.title,aside:i.length>1&&s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:i.map(y=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(y)}}),y]},y))}),children:m.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:f,children:r?s.jsxs(G,{data:m,margin:{left:0,right:0,top:8},children:[v,b,O,K,i.map((y,z)=>s.jsx(U,{dataKey:y,stackId:"day",fill:u(y),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},y))]}):s.jsxs(Ie,{data:m,margin:{left:0,right:0,top:8},children:[i.length===1&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:u(i[0]??""),stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:u(i[0]??""),stopOpacity:0})]})}),v,b,O,K,i.map(y=>s.jsx(Be,{type:"linear",dataKey:y,stroke:u(y),strokeWidth:2,fill:i.length===1?`url(#${p})`:"none",dot:m.length===1?{r:4}:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},connectNulls:!0,animationDuration:300},y))]})})}),e[0]=r,e[1]=d,e[2]=t.points,e[3]=t.title,e[4]=o,e[5]=c,e[6]=l}else l=e[6];return l}function Ge(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function ce(a){const e=w.c(25),{label:t,note:d,share:o,value:c,fill:r,color:l,onClick:n}=a,i=n?"button":"div",u=n?"button":void 0;let f;e[0]!==n?(f=n&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2"),e[0]=n,e[1]=f):f=e[1];let x;e[2]!==f?(x=D("flex h-10 w-full items-center gap-3",f),e[2]=f,e[3]=x):x=e[3];let m;e[4]!==d?(m=d&&s.jsx("span",{className:"text-meta ml-2",children:d}),e[4]=d,e[5]=m):m=e[5];let h;e[6]!==t||e[7]!==m?(h=s.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:[t,m]}),e[6]=t,e[7]=m,e[8]=h):h=e[8];const p=`${Math.max(0,Math.min(100,r))}%`;let j;e[9]!==l||e[10]!==p?(j=s.jsx("span",{className:"h-1.5 w-20 shrink-0 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:p,backgroundColor:l}})}),e[9]=l,e[10]=p,e[11]=j):j=e[11];let v;e[12]!==o?(v=o!==void 0&&s.jsx("span",{className:"tnum w-16 shrink-0 text-right text-sm text-foreground/40",children:o}),e[12]=o,e[13]=v):v=e[13];let k;e[14]!==c?(k=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=k):k=e[15];let b;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==v||e[23]!==k?(b=s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:s.jsxs(i,{type:u,onClick:n,className:x,children:[h,j,v,k]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=v,e[23]=k,e[24]=b):b=e[24],b}function Ue(a){const e=w.c(17),{section:t,onDrill:d}=a,o=B(),c=t.stages[0]?.value??0,r=t.stages.at(-1)?.value??0;let l;e[0]!==r||e[1]!==c?(l=c?`${Math.round(100*r/c)}%`:"—",e[0]=r,e[1]=c,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==c||e[5]!==o?(n=c>0&&s.jsx("span",{className:"text-meta",children:o("taskBoard.analytics.funnelCaption",{end:String(r),start:String(c)})}),e[3]=r,e[4]=c,e[5]=o,e[6]=n):n=e[6];let i;e[7]!==d||e[8]!==t.stages||e[9]!==c||e[10]!==o?(i=c===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("ol",{className:"flex flex-col",children:t.stages.map((f,x)=>{const m=t.stages[x-1]?.value,h=m===void 0?0:m-f.value;return s.jsx(ce,{label:f.label,note:h>0?o("taskBoard.analytics.dropped",{n:String(h)}):void 0,share:`${Math.round(100*f.value/c)}%`,value:f.value.toLocaleString(),fill:100*f.value/c,color:"var(--chart-2)",onClick:L(d,f.drill,f.label)},f.label)})}),e[7]=d,e[8]=t.stages,e[9]=c,e[10]=o,e[11]=i):i=e[11];let u;return e[12]!==t.title||e[13]!==l||e[14]!==n||e[15]!==i?(u=s.jsx(_,{title:t.title,value:l,caption:n,children:i}),e[12]=t.title,e[13]=l,e[14]=n,e[15]=i,e[16]=u):u=e[16],u}function He(a){const e=w.c(19),{section:t,onDrill:d}=a,o=B();let c;e[0]!==t.bars?(c=Math.max(0,...t.bars.map(Pe)),e[0]=t.bars,e[1]=c):c=e[1];const r=c;let l;e[2]!==t.total?.value?(l=t.total?.value.toLocaleString(),e[2]=t.total?.value,e[3]=l):l=e[3];let n;e[4]!==t.total?(n=t.total&&s.jsx("span",{className:"text-meta",children:t.total.label}),e[4]=t.total,e[5]=n):n=e[5];let i;e[6]!==t.unit?(i=t.unit&&s.jsx("span",{className:"text-meta",children:t.unit}),e[6]=t.unit,e[7]=i):i=e[7];let u;e[8]!==r||e[9]!==d||e[10]!==t.bars||e[11]!==o?(u=t.bars.length===0?s.jsx(R,{children:o("taskBoard.analytics.nobodyStepped")}):s.jsx("ul",{className:"flex flex-col",children:t.bars.map(x=>s.jsx(ce,{label:x.label,note:x.note,share:x.detail,value:x.value.toLocaleString(),fill:r?100*x.value/r:0,color:"var(--chart-1)",onClick:L(d,x.drill,x.label)},x.label))}),e[8]=r,e[9]=d,e[10]=t.bars,e[11]=o,e[12]=u):u=e[12];let f;return e[13]!==t.title||e[14]!==l||e[15]!==n||e[16]!==i||e[17]!==u?(f=s.jsx(_,{title:t.title,value:l,caption:n,aside:i,children:u}),e[13]=t.title,e[14]=l,e[15]=n,e[16]=i,e[17]=u,e[18]=f):f=e[18],f}function Pe(a){return a.value}function Ve(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Xe=new Set(["Org ID","Task ID"]),Ye=new Set(["Run outcome","Failure kind","Moved in by","State"]),Qe=new Set(["Error","Signature"]),We=new Set(["Org","Orgs"]);function qe(a){const e=w.c(32),{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:r}=a,l=B(),n=t.columns.indexOf("Org");let i;e[0]!==n||e[1]!==t.columns||e[2]!==d?(i=d&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=d,e[3]=i):i=e[3];const u=i,f=t.columns.indexOf("Task ID");let x;e[4]!==t.columns||e[5]!==c||e[6]!==f?(x=c&&f>=0?t.columns.indexOf("Task"):-1,e[4]=t.columns,e[5]=c,e[6]=f,e[7]=x):x=e[7];const m=x,h=t.columns;let p,j;if(e[8]!==r||e[9]!==n||e[10]!==t.columns||e[11]!==t.drills||e[12]!==t.rows||e[13]!==t.title||e[14]!==t.units||e[15]!==o||e[16]!==l||e[17]!==m||e[18]!==c||e[19]!==f||e[20]!==u){j=Symbol.for("react.early_return_sentinel");e:{let v;e[23]!==o?(v=S=>{const{c:g}=S;return!Xe.has(g)&&(o!==!1||!We.has(g))},e[23]=o,e[24]=v):v=e[24];const k=h.map(st).filter(v).sort(tt);let b;e[25]!==t.rows?(b=S=>{const{j:g}=S,C=t.rows.map(O=>O[g]).filter(et);return C.length>0&&C.every(Je)},e[25]=t.rows,e[26]=b):b=e[26];const $=new Set(k.filter(b).map(Ze));if(t.rows.length===1&&k.every(S=>{const{c:g}=S;return $.has(g)})){let S;e[27]!==t.rows[0]?(S=t.rows[0]??[],e[27]=t.rows[0],e[28]=S):S=e[28];const g=S;let C;e[29]!==g||e[30]!==t.units?(C=O=>{const{c:T,j:I}=O,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:T}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[T]):"—"})]},T)},e[29]=g,e[30]=t.units,e[31]=C):C=e[31],j=s.jsx(Q,{title:t.title,children:s.jsx("dl",{className:"surface grid px-4 pt-4 pb-5 grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-[repeat(auto-fill,minmax(120px,1fr))]",children:k.map(C)})});break e}p=s.jsx(Q,{title:t.title,children:t.rows.length===0?s.jsx("p",{className:"surface px-4 py-4 text-sm text-muted-foreground",children:l("taskBoard.analytics.nothingToShow")}):s.jsx("div",{className:"surface max-h-[480px] overflow-auto",children:s.jsxs(he,{variant:"flush",children:[s.jsx(ge,{children:s.jsx(W,{children:k.map(S=>{const{c:g}=S;return s.jsx(je,{className:D("whitespace-nowrap first:pl-4 last:pr-4",$.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(be,{children:t.rows.map((S,g)=>s.jsx(W,{children:k.map((C,O)=>{const{c:T,j:I}=C,N=S[I],K=m===I?S[f]:null,y=O===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(ye,{className:D("max-w-md truncate text-sm first:pl-4 last:pr-4",$.has(T)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Ve(String(S[n]),String(N)),target:"_blank",rel:"noreferrer",className:"focus-ring inline-flex items-center gap-1 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[l("taskBoard.analytics.openChat"),s.jsx(me,{size:12})]}):y?s.jsx("button",{type:"button",onClick:y,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(le,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):T==="Lane"&&typeof N=="string"?s.jsx(ie,{lane:N}):T==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(de,{drill:`priority:${N.toLowerCase()}`}),N]}):Ye.has(T)?s.jsx(Y,{variant:"muted",children:String(N)}):Qe.has(T)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:D("tnum",typeof N=="string"&&re.test(N)&&"text-muted-foreground"),children:Me(N,t.units?.[T])})},T)})},`${t.title}-${g}`))})]})})})}e[8]=r,e[9]=n,e[10]=t.columns,e[11]=t.drills,e[12]=t.rows,e[13]=t.title,e[14]=t.units,e[15]=o,e[16]=l,e[17]=m,e[18]=c,e[19]=f,e[20]=u,e[21]=p,e[22]=j}else p=e[21],j=e[22];return j!==Symbol.for("react.early_return_sentinel")?j:p}function Ze(a){const{c:e}=a;return e}function Je(a){return typeof a=="number"}function et(a){return a!==null}function tt(a,e){return+(e.c==="Task")-+(a.c==="Task")}function st(a,e){return{c:a,j:e}}function Tt(a){const e=w.c(17),{section:t,taskHref:d}=a,o=B();let c;e[0]!==t.columns?(c=i=>t.columns.indexOf(i),e[0]=t.columns,e[1]=c):c=e[1];const r=c;if(t.rows.length===0){let i;e[2]!==o?(i=o("taskBoard.analytics.nothingToShow"),e[2]=o,e[3]=i):i=e[3];let u;return e[4]!==i?(u=s.jsx(R,{children:i}),e[4]=i,e[5]=u):u=e[5],u}let l;if(e[6]!==r||e[7]!==t.rows||e[8]!==o||e[9]!==d){let i;e[11]!==r||e[12]!==o||e[13]!==d?(i=u=>{const f=String(u[r("Task ID")]??""),x=u[r("Lane")],m=u[r("Picked up")],h=Number(u[r("Actions by people")]??0),p=Number(u[r("Failed QA")]??0),j=[typeof m=="string"?Z(m):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),v=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm text-foreground",children:String(u[r("Task")]??"")}),s.jsx("span",{className:"text-meta truncate",children:j.join(" · ")})]}),p>0&&s.jsxs(Y,{variant:"muted",children:[s.jsx(ve,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(ie,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(le,{href:d(f),className:D(F,"flex items-center gap-3 rounded-md p-2"),children:v}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:v})},f)},e[11]=r,e[12]=o,e[13]=d,e[14]=i):i=e[14],l=t.rows.map(i),e[6]=r,e[7]=t.rows,e[8]=o,e[9]=d,e[10]=l}else l=e[10];let n;return e[15]!==l?(n=s.jsx("ul",{className:"flex flex-col",children:l}),e[15]=l,e[16]=n):n=e[16],n}const nt={Type:$e,Priority:we,Tag:Ce,Sprint:Se,"Brief by":pe};function de(a){const e=w.c(10),{drill:t}=a;let d;e[0]!==t?(d=(t??"").split("&")[0]?.split(":")??[],e[0]=t,e[1]=d):d=e[1];const[o,c]=d;let r,l,n;if(e[2]!==o||e[3]!==c){n=Symbol.for("react.early_return_sentinel");e:{const u=o==="type"?Object.entries(Te).find(x=>{const[m]=x;return m===c})?.[1]:o==="priority"?Object.entries(De).find(x=>{const[m]=x;return m===c})?.[1]:void 0;if(!u){n=null;break e}r=u.icon,l=D("size-3.5 shrink-0",u.iconClassName)}e[2]=o,e[3]=c,e[4]=r,e[5]=l,e[6]=n}else r=e[4],l=e[5],n=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[7]!==r||e[8]!==l?(i=s.jsx(r,{className:l}),e[7]=r,e[8]=l,e[9]=i):i=e[9],i}function lt(a){const e=w.c(11),{value:t,metric:d,color:o}=a,c=t??0,r=`${d.unit==="%"?Math.min(100,c):0}%`;let l;e[0]!==o||e[1]!==r?(l=s.jsx("span",{className:"h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:r,backgroundColor:o}})}),e[0]=o,e[1]=r,e[2]=l):l=e[2];const n=t??null;let i;e[3]!==d.unit||e[4]!==n?(i=M(n,d.unit),e[3]=d.unit,e[4]=n,e[5]=i):i=e[5];let u;e[6]!==i?(u=s.jsx("span",{className:"tnum w-12 shrink-0 text-right text-sm text-foreground",children:i}),e[6]=i,e[7]=u):u=e[7];let f;return e[8]!==l||e[9]!==u?(f=s.jsxs("span",{className:"flex items-center gap-2",children:[l,u]}),e[8]=l,e[9]=u,e[10]=f):f=e[10],f}function at(a){const e=w.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=q.useState(t.dimensions[0]?.label??"");let l;e[0]!==c||e[1]!==t.dimensions?(l=t.dimensions.find(m=>m.label===c)??t.dimensions[0],e[0]=c,e[1]=t.dimensions,e[2]=l):l=e[2];const n=l,i=`minmax(0,1fr) 56px repeat(${t.metrics.length}, minmax(96px, 168px))`;let u;e[3]!==n?.label||e[4]!==t.dimensions?(u=t.dimensions.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n?.label??"",onValueChange:m=>m&&r(m),children:t.dimensions.map(it)}),e[3]=n?.label,e[4]=t.dimensions,e[5]=u):u=e[5];let f;e[6]!==i||e[7]!==n||e[8]!==d||e[9]!==t.metrics||e[10]!==o?(f=!n||n.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"text-meta grid items-center gap-4 border-b border-border/50 pb-2",style:{gridTemplateColumns:i},children:[s.jsx("span",{children:n.label}),s.jsx("span",{className:"text-right",children:o("taskBoard.analytics.tasks")}),t.metrics.map(rt)]}),n.rows.map(m=>{const h=L(d,m.drill,m.label),p=h?"button":"div";return s.jsxs(p,{type:h?"button":void 0,onClick:h,className:D("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2")),style:{gridTemplateColumns:i},children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm text-foreground",children:[s.jsx(de,{drill:m.drill}),s.jsx("span",{className:"truncate",children:m.label})]}),s.jsx("span",{className:"tnum text-right text-sm text-muted-foreground",children:m.count.toLocaleString()}),t.metrics.map(j=>s.jsx(lt,{value:m.values[j.key],metric:j,color:j.better==="up"?"var(--success)":"var(--destructive)"},j.key))]},m.label)})]}),e[6]=i,e[7]=n,e[8]=d,e[9]=t.metrics,e[10]=o,e[11]=f):f=e[11];let x;return e[12]!==t.title||e[13]!==u||e[14]!==f?(x=s.jsx(_,{title:t.title,aside:u,children:f}),e[12]=t.title,e[13]=u,e[14]=f,e[15]=x):x=e[15],x}function rt(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function it(a){const e=nt[a.label];return s.jsxs(se,{value:a.label,children:[e&&s.jsx(e,{}),a.label]},a.label)}const ue=3;function ot(a){const e=w.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=q.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(b=>b.key===c)??t.metrics[0],e[0]=c,e[1]=t.metrics,e[2]=l):l=e[2];const n=l;if(!n)return null;const i=n.better==="up"?"var(--success)":"var(--destructive)";let u;e[3]!==t.cols||e[4]!==t.rows?(u=t.rows.length===t.cols.length&&t.rows.every((b,$)=>t.cols[$]===b),e[3]=t.cols,e[4]=t.rows,e[5]=u):u=e[5];const f=u,x=`minmax(96px, 1fr) repeat(${t.cols.length}, minmax(72px, 1fr))`,m=t.title;let h;e[6]!==o?(h=o("taskBoard.analytics.matrixCaption",{n:String(ue)}),e[6]=o,e[7]=h):h=e[7];let p;e[8]!==h?(p=s.jsx("span",{className:"text-meta",children:h}),e[8]=h,e[9]=p):p=e[9];let j;e[10]!==n.key||e[11]!==t.metrics?(j=t.metrics.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n.key,onValueChange:b=>b&&r(b),children:t.metrics.map(dt)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let v;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==f||e[18]!==o||e[19]!==i?(v=t.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"grid min-w-fit gap-1",style:{gridTemplateColumns:x},children:[s.jsxs("span",{className:"text-meta self-end pb-1",children:[t.rowLabel," / ",t.colLabel]}),t.cols.map(ct),t.rows.map((b,$)=>s.jsx(ut,{row:b,section:t,metric:n,tint:i,onDrill:d,upTo:f?$:void 0},b))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=f,e[18]=o,e[19]=i,e[20]=v):v=e[20];let k;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==v?(k=s.jsx(_,{title:m,caption:p,aside:j,children:v}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=v,e[25]=k):k=e[25],k}function ct(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function dt(a){return s.jsx(se,{value:a.key,children:a.label},a.key)}function ut(a){const e=w.c(22),{row:t,section:d,metric:o,tint:c,onDrill:r,upTo:l}=a,n=B();let i;e[0]!==t?(i=s.jsx("span",{className:"flex items-center truncate pr-2 text-sm text-foreground",children:t}),e[0]=t,e[1]=i):i=e[1];let u;if(e[2]!==o||e[3]!==r||e[4]!==t||e[5]!==d.cells||e[6]!==d.cols||e[7]!==n||e[8]!==c||e[9]!==l){let x;e[11]!==o||e[12]!==r||e[13]!==t||e[14]!==d.cells||e[15]!==n||e[16]!==c||e[17]!==l?(x=(m,h)=>{if(l!==void 0&&h>l)return s.jsx("span",{},m);const p=d.cells.find(b=>b.row===t&&b.col===m),j=p?.values[o.key]??null;if(!p)return s.jsx("span",{className:"flex h-14 items-center justify-center rounded-md bg-muted/40 text-sm text-muted-foreground",children:"—"},m);const v=j===null?0:Math.min(100,o.unit==="%"?j:0),k=L(r,p.drill,t===m?t:`${t} · ${m}`);return s.jsxs("button",{type:"button",onClick:k,disabled:!k,className:D("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",k&&"cursor-pointer hover:opacity-80",p.count<ue&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+v*.5)}%, var(--muted))`},children:[s.jsx("span",{className:"tnum text-sm font-medium text-foreground",children:M(j,o.unit)}),s.jsx("span",{className:"text-meta",children:p.count===1?n("taskBoard.analytics.drillCountOne"):n("taskBoard.analytics.drillCount",{n:String(p.count)})})]},m)},e[11]=o,e[12]=r,e[13]=t,e[14]=d.cells,e[15]=n,e[16]=c,e[17]=l,e[18]=x):x=e[18],u=d.cols.map(x),e[2]=o,e[3]=r,e[4]=t,e[5]=d.cells,e[6]=d.cols,e[7]=n,e[8]=c,e[9]=l,e[10]=u}else u=e[10];let f;return e[19]!==i||e[20]!==u?(f=s.jsxs(s.Fragment,{children:[i,u]}),e[19]=i,e[20]=u,e[21]=f):f=e[21],f}function ft(){const a=w.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?ne(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function mt(a){const e=w.c(21),{section:t,onDrill:d}=a,o=B(),c=ft(),r=t.unit??void 0,l=t.layout==="stacked";let n;if(e[0]!==c||e[1]!==d||e[2]!==t.baseline||e[3]!==t.categories||e[4]!==t.keys||e[5]!==t.title||e[6]!==l||e[7]!==o||e[8]!==r){let i;e[10]!==t.baseline?(i=g=>g!==t.baseline,e[10]=t.baseline,e[11]=i):i=e[11];const u=t.keys.filter(i),f=g=>g===t.baseline?"var(--border)":E[u.indexOf(g)%E.length]??"",x=Object.fromEntries(t.keys.map(g=>[g,{label:c(g),color:f(g)}]));let m;e[12]!==t.categories?(m=t.categories.map(pt),e[12]=t.categories,e[13]=m):m=e[13];const h=m;let p;e[14]!==d||e[15]!==t.categories?(p=g=>{const C=t.categories[g];C&&L(d,C.drill,C.label)?.()},e[14]=d,e[15]=t.categories,e[16]=p):p=e[16];const j=p,v=t.categories.some(xt)&&!!d,k=l?Math.max(120,t.categories.length*44+32):220;let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b={fill:"var(--muted)",opacity:.4},e[17]=b):b=e[17];let $;e[18]!==c||e[19]!==r?($=s.jsx(ee,{cursor:b,content:g=>{const{active:C,payload:O}=g;return s.jsx(oe,{active:C,payload:O,unit:r,nameOf:c})}}),e[18]=c,e[19]=r,e[20]=$):$=e[20];const S=$;n=s.jsx(_,{title:t.title,aside:s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:t.keys.map(g=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:f(g)}}),c(g)]},g))}),children:h.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"w-full",style:{height:k},config:x,children:l?s.jsxs(G,{data:h,layout:"vertical",margin:{left:0,right:8,top:0},children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,horizontal:!1}),s.jsx(P,{type:"number",axisLine:!1,tickLine:!1,tick:A,tickFormatter:g=>X(g,r)}),s.jsx(V,{type:"category",dataKey:"label",axisLine:!1,tickLine:!1,tick:A,width:72}),S,t.keys.map((g,C)=>s.jsx(U,{dataKey:g,stackId:"all",fill:f(g),maxBarSize:22,radius:C===t.keys.length-1?[0,4,4,0]:0,animationDuration:300},g))]}):s.jsxs(G,{data:h,margin:{left:0,right:0,top:8},barGap:4,barCategoryGap:"28%",children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,tickMargin:8}),s.jsx(V,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,allowDecimals:r!==void 0,tickFormatter:g=>X(g,r),width:48}),S,t.keys.map(g=>s.jsx(U,{dataKey:g,fill:f(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:D(v&&"cursor-pointer"),onClick:(C,O)=>j(O)},g))]})})}),e[0]=c,e[1]=d,e[2]=t.baseline,e[3]=t.categories,e[4]=t.keys,e[5]=t.title,e[6]=l,e[7]=o,e[8]=r,e[9]=n}else n=e[9];return n}function xt(a){return a.drill}function pt(a){return{label:a.label,...a.values}}function Dt(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function Ot(a){const e=w.c(27),{section:t,threadLinks:d,showOrg:o,taskHref:c,range:r,onDrill:l}=a;switch(t.kind){case"stat":{let n;return e[0]!==l||e[1]!==t?(n=s.jsx(Ae,{section:t,onDrill:l}),e[0]=l,e[1]=t,e[2]=n):n=e[2],n}case"series":{let n;return e[3]!==r||e[4]!==t?(n=s.jsx(ze,{section:t,range:r}),e[3]=r,e[4]=t,e[5]=n):n=e[5],n}case"funnel":{let n;return e[6]!==l||e[7]!==t?(n=s.jsx(Ue,{section:t,onDrill:l}),e[6]=l,e[7]=t,e[8]=n):n=e[8],n}case"bars":{let n;return e[9]!==l||e[10]!==t?(n=s.jsx(He,{section:t,onDrill:l}),e[9]=l,e[10]=t,e[11]=n):n=e[11],n}case"breakdown":{let n;return e[12]!==l||e[13]!==t?(n=s.jsx(at,{section:t,onDrill:l}),e[12]=l,e[13]=t,e[14]=n):n=e[14],n}case"matrix":{let n;return e[15]!==l||e[16]!==t?(n=s.jsx(ot,{section:t,onDrill:l}),e[15]=l,e[16]=t,e[17]=n):n=e[17],n}case"categories":{let n;return e[18]!==l||e[19]!==t?(n=s.jsx(mt,{section:t,onDrill:l}),e[18]=l,e[19]=t,e[20]=n):n=e[20],n}case"table":{let n;return e[21]!==l||e[22]!==t||e[23]!==o||e[24]!==c||e[25]!==d?(n=s.jsx(qe,{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:l}),e[21]=l,e[22]=t,e[23]=o,e[24]=c,e[25]=d,e[26]=n):n=e[26],n}default:return t}}export{A,Tt as D,_ as M,Ot as S,Dt as s};
1
+ import{c as w,j as s,b as B,h8 as Q,l as D,E as me,r as q,d as xe,hj as Z,aC as pe}from"./index-Cw6ilRLN.js";import{b as J,C as ee}from"./chart-Q09A7KSZ.js";import{e as he,a as ge,b as W,T as je,d as be,c as ye}from"./table-Daq1_j7m.js";import{i as ve}from"./AlertCircle-Hdww5hle.js";import{i as ke,n as Ne}from"./ArrowUp-B0V8Iire.js";import{u as Se,a1 as Ce,aq as we,a9 as $e}from"./agent-icon-rBB7-3Iv.js";import{a as te,T as se}from"./toggle-group-BtOmVjMF.js";import{B as Y}from"./badge-BWAFo8iB.js";import{l as ne,c as Te,b as De,S as Oe}from"./config-VQsUFgqz.js";import{a as G,B as U}from"./BarChart-CGQa-jmR.js";import{C as H,X as P,Y as V}from"./CartesianChart-CJ4c9OjY.js";import{a as Ie,A as Be}from"./AreaChart-C_-vf7HG.js";function le(a){const e=w.c(8),{href:t,className:d,children:o}=a,c=xe();let r;e[0]!==t||e[1]!==c?(r=n=>{!t||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||(n.preventDefault(),c({href:t}))},e[0]=t,e[1]=c,e[2]=r):r=e[2];let l;return e[3]!==o||e[4]!==d||e[5]!==t||e[6]!==r?(l=s.jsx("a",{href:t,className:d,onClick:r,children:o}),e[3]=o,e[4]=d,e[5]=t,e[6]=r,e[7]=l):l=e[7],l}const L=(a,e,t)=>a&&e?()=>a({drill:e,label:t}):void 0,F="cursor-pointer text-left transition-colors hover:bg-accent focus-ring",E=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],A={fontSize:11,fill:"var(--muted-foreground)",opacity:.7};function ae(a){const e=Math.abs(a);return e<60?`${Math.round(a)}s`:e<3600?`${Math.round(a/60)}m`:e<86400?`${(a/3600).toFixed(1)}h`:`${(a/86400).toFixed(1)}d`}function M(a,e){return a===null||Number.isNaN(a)?"—":e==="s"?ae(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function X(a,e){return e==="s"?ae(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const re=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Le=/^\d{4}-\d{2}-\d{2}$/;function Me(a,e){return typeof a=="number"?M(a,e):Le.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):re.test(a)?Z(a):a}function _(a){const e=w.c(20),{title:t,value:d,caption:o,aside:c,children:r,onClick:l}=a,n=l?"button":"section",i=l?"button":void 0,u=l&&F;let f;e[0]!==u?(f=D("surface flex h-full w-full flex-col gap-6 px-4 pt-4 pb-5",u),e[0]=u,e[1]=f):f=e[1];let x;e[2]!==t?(x=s.jsx("h3",{className:"text-sm text-foreground/70",children:t}),e[2]=t,e[3]=x):x=e[3];let m;e[4]!==d?(m=d!==void 0&&s.jsx("span",{className:"tnum text-4xl font-normal text-foreground",children:d}),e[4]=d,e[5]=m):m=e[5];let h;e[6]!==o||e[7]!==x||e[8]!==m?(h=s.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[x,m,o]}),e[6]=o,e[7]=x,e[8]=m,e[9]=h):h=e[9];let p;e[10]!==c||e[11]!==h?(p=s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h,c]}),e[10]=c,e[11]=h,e[12]=p):p=e[12];let j;return e[13]!==n||e[14]!==r||e[15]!==l||e[16]!==i||e[17]!==f||e[18]!==p?(j=s.jsxs(n,{type:i,onClick:l,className:f,children:[p,r]}),e[13]=n,e[14]=r,e[15]=l,e[16]=i,e[17]=f,e[18]=p,e[19]=j):j=e[19],j}function ie(a){const e=w.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=ne(t,d),e[0]=t,e[1]=d,e[2]=o):o=e[2];const{label:c,visual:r}=o,l=r.icon;let n;e[3]!==l||e[4]!==r.iconClassName?(n=s.jsx(l,{className:r.iconClassName}),e[3]=l,e[4]=r.iconClassName,e[5]=n):n=e[5];let i;return e[6]!==c||e[7]!==n?(i=s.jsxs(Y,{variant:"muted",children:[n,c]}),e[6]=c,e[7]=n,e[8]=i):i=e[8],i}function R(a){const e=w.c(2),{children:t}=a;let d;return e[0]!==t?(d=s.jsx("div",{className:"flex h-20 items-center justify-center text-sm text-muted-foreground",children:t}),e[0]=t,e[1]=d):d=e[1],d}function _e(a){const e=w.c(21),{value:t,previous:d,unit:o,better:c}=a,r=B();if(t===null||d===null||d===void 0){let p;e[0]!==r?(p=r("taskBoard.analytics.noPrior"),e[0]=r,e[1]=p):p=e[1];let j;return e[2]!==p?(j=s.jsx("span",{className:"text-meta",children:p}),e[2]=p,e[3]=j):j=e[3],j}const l=Math.round((t-d)*10)/10,n=c==="down"?l<0:l>0;let i;e[4]!==l||e[5]!==r||e[6]!==o?(i=o==="%"?r("taskBoard.analytics.points",{n:String(Math.abs(l))}):M(Math.abs(l),o),e[4]=l,e[5]=r,e[6]=o,e[7]=i):i=e[7];const u=i;let f;e[8]!==u||e[9]!==c||e[10]!==l||e[11]!==n||e[12]!==r?(f=l===0?r("taskBoard.analytics.unchanged"):s.jsxs("span",{className:D("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ke,{size:12}):s.jsx(Ne,{size:12}),u]}),e[8]=u,e[9]=c,e[10]=l,e[11]=n,e[12]=r,e[13]=f):f=e[13];let x;e[14]!==r?(x=r("taskBoard.analytics.vsPrevious"),e[14]=r,e[15]=x):x=e[15];let m;e[16]!==x?(m=s.jsx("span",{children:x}),e[16]=x,e[17]=m):m=e[17];let h;return e[18]!==f||e[19]!==m?(h=s.jsxs("span",{className:"text-meta inline-flex items-center gap-1",children:[f,m]}),e[18]=f,e[19]=m,e[20]=h):h=e[20],h}const Re={1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",5:"lg:grid-cols-5",6:"lg:grid-cols-3",9:"lg:grid-cols-3"};function Ae(a){const e=w.c(10),{section:t,onDrill:d}=a,o=Re[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=D("grid grid-cols-2 gap-4",o),e[0]=o,e[1]=c):c=e[1];let r;if(e[2]!==d||e[3]!==t.values){let n;e[5]!==d?(n=i=>s.jsx(_,{title:i.label,value:M(i.value,i.unit),onClick:L(d,i.drill,i.label),caption:s.jsxs(s.Fragment,{children:[i.detail&&s.jsx("span",{className:"text-sm text-muted-foreground",children:i.detail}),i.previous!==void 0&&s.jsx(_e,{value:i.value,previous:i.previous,unit:i.unit,better:i.better})]})},i.label),e[5]=d,e[6]=n):n=e[6],r=t.values.map(n),e[2]=d,e[3]=t.values,e[4]=r}else r=e[4];let l;return e[7]!==c||e[8]!==r?(l=s.jsx("div",{className:c,children:r}),e[7]=c,e[8]=r,e[9]=l):l=e[9],l}function Ke(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ee(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Fe(a,e,t){const d=new Map(a.map(l=>[String(l.t??"").slice(0,10),l])),o=new Date(`${t.from.slice(0,10)}T00:00:00.000Z`),c=t.to.slice(0,10),r=[];for(;o.toISOString().slice(0,10)<=c;){const l=o.toISOString().slice(0,10);r.push(d.get(l)??{t:o.toISOString(),...Object.fromEntries(e.map(n=>[n,0]))}),o.setUTCDate(o.getUTCDate()+1)}return r}function oe(a){const e=w.c(17),{active:t,payload:d,unit:o,nameOf:c}=a,r=c===void 0?String:c;if(!t||!d?.length)return null;const l=d[0]?.payload,n=l?.t;let i;e[0]!==l?.label||e[1]!==n?(i=typeof n=="string"?new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"}):String(l?.label??""),e[0]=l?.label,e[1]=n,e[2]=i):i=e[2];let u;e[3]!==i?(u=s.jsx("div",{className:"mb-1 text-xs text-muted-foreground",children:i}),e[3]=i,e[4]=u):u=e[4];let f;if(e[5]!==r||e[6]!==d||e[7]!==o){let h;e[9]!==r||e[10]!==o?(h=p=>s.jsxs("div",{className:"flex items-center gap-1.5 text-xs",children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:p.color}}),s.jsx("span",{className:"text-muted-foreground",children:r(String(p.dataKey))}),s.jsx("span",{className:"tnum ml-auto pl-3 font-medium",children:M(typeof p.value=="number"?p.value:null,o)})]},String(p.dataKey)),e[9]=r,e[10]=o,e[11]=h):h=e[11],f=d.map(h),e[5]=r,e[6]=d,e[7]=o,e[8]=f}else f=e[8];let x;e[12]!==f?(x=s.jsx("div",{className:"flex flex-col gap-1",children:f}),e[12]=f,e[13]=x):x=e[13];let m;return e[14]!==u||e[15]!==x?(m=s.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[u,x]}),e[14]=u,e[15]=x,e[16]=m):m=e[16],m}function ze(a){const e=w.c(27),{section:t,range:d}=a,o=B(),c=t.unit??void 0,r=c!=="%"&&c!=="s";let l;if(e[0]!==r||e[1]!==d||e[2]!==t.points||e[3]!==t.title||e[4]!==o||e[5]!==c){const n=Ke(t.points),i=r?Ee(t.points,n):n,u=y=>E[n.indexOf(y)%E.length],f=Object.fromEntries(i.map(y=>[y,{label:y,color:u(y)}])),m=(r&&d?Fe(t.points,n,d):t.points).map(Ge);let h;if(e[7]!==t.title){let y;e[9]===Symbol.for("react.memo_cache_sentinel")?(y=/\W+/g,e[9]=y):y=e[9],h=t.title.replace(y,"-"),e[7]=t.title,e[8]=h}else h=e[8];const p=`analytics-${h}`;let j;e[10]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[10]=j):j=e[10];const v=j;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=k):k=e[11];const b=k;let $;e[12]!==c?($=c==="%"?[0,100]:[0,"auto"],e[12]=c,e[13]=$):$=e[13];const S=c!==void 0;let g;e[14]!==c?(g=y=>X(y,c),e[14]=c,e[15]=g):g=e[15];let C;e[16]!==$||e[17]!==S||e[18]!==g?(C=s.jsx(V,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,domain:$,allowDecimals:S,tickFormatter:g,width:48,tickCount:5}),e[16]=$,e[17]=S,e[18]=g,e[19]=C):C=e[19];const O=C;let T;e[20]!==r?(T=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=T):T=e[21];let I;e[22]!==c?(I=y=>{const{active:z,payload:fe}=y;return s.jsx(oe,{active:z,payload:fe,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==T?(N=s.jsx(ee,{cursor:T,content:I}),e[24]=I,e[25]=T,e[26]=N):N=e[26];const K=N;l=s.jsx(_,{title:t.title,aside:i.length>1&&s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:i.map(y=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(y)}}),y]},y))}),children:m.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:f,children:r?s.jsxs(G,{data:m,margin:{left:0,right:0,top:8},children:[v,b,O,K,i.map((y,z)=>s.jsx(U,{dataKey:y,stackId:"day",fill:u(y),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},y))]}):s.jsxs(Ie,{data:m,margin:{left:0,right:0,top:8},children:[i.length===1&&s.jsx("defs",{children:s.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:u(i[0]??""),stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:u(i[0]??""),stopOpacity:0})]})}),v,b,O,K,i.map(y=>s.jsx(Be,{type:"linear",dataKey:y,stroke:u(y),strokeWidth:2,fill:i.length===1?`url(#${p})`:"none",dot:m.length===1?{r:4}:!1,activeDot:{r:4,stroke:"var(--background)",strokeWidth:2},connectNulls:!0,animationDuration:300},y))]})})}),e[0]=r,e[1]=d,e[2]=t.points,e[3]=t.title,e[4]=o,e[5]=c,e[6]=l}else l=e[6];return l}function Ge(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function ce(a){const e=w.c(25),{label:t,note:d,share:o,value:c,fill:r,color:l,onClick:n}=a,i=n?"button":"div",u=n?"button":void 0;let f;e[0]!==n?(f=n&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2"),e[0]=n,e[1]=f):f=e[1];let x;e[2]!==f?(x=D("flex h-10 w-full items-center gap-3",f),e[2]=f,e[3]=x):x=e[3];let m;e[4]!==d?(m=d&&s.jsx("span",{className:"text-meta ml-2",children:d}),e[4]=d,e[5]=m):m=e[5];let h;e[6]!==t||e[7]!==m?(h=s.jsxs("span",{className:"min-w-0 flex-1 truncate text-sm text-muted-foreground",children:[t,m]}),e[6]=t,e[7]=m,e[8]=h):h=e[8];const p=`${Math.max(0,Math.min(100,r))}%`;let j;e[9]!==l||e[10]!==p?(j=s.jsx("span",{className:"h-1.5 w-20 shrink-0 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:p,backgroundColor:l}})}),e[9]=l,e[10]=p,e[11]=j):j=e[11];let v;e[12]!==o?(v=o!==void 0&&s.jsx("span",{className:"tnum w-16 shrink-0 text-right text-sm text-foreground/40",children:o}),e[12]=o,e[13]=v):v=e[13];let k;e[14]!==c?(k=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=k):k=e[15];let b;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==v||e[23]!==k?(b=s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:s.jsxs(i,{type:u,onClick:n,className:x,children:[h,j,v,k]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=v,e[23]=k,e[24]=b):b=e[24],b}function Ue(a){const e=w.c(17),{section:t,onDrill:d}=a,o=B(),c=t.stages[0]?.value??0,r=t.stages.at(-1)?.value??0;let l;e[0]!==r||e[1]!==c?(l=c?`${Math.round(100*r/c)}%`:"—",e[0]=r,e[1]=c,e[2]=l):l=e[2];let n;e[3]!==r||e[4]!==c||e[5]!==o?(n=c>0&&s.jsx("span",{className:"text-meta",children:o("taskBoard.analytics.funnelCaption",{end:String(r),start:String(c)})}),e[3]=r,e[4]=c,e[5]=o,e[6]=n):n=e[6];let i;e[7]!==d||e[8]!==t.stages||e[9]!==c||e[10]!==o?(i=c===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("ol",{className:"flex flex-col",children:t.stages.map((f,x)=>{const m=t.stages[x-1]?.value,h=m===void 0?0:m-f.value;return s.jsx(ce,{label:f.label,note:h>0?o("taskBoard.analytics.dropped",{n:String(h)}):void 0,share:`${Math.round(100*f.value/c)}%`,value:f.value.toLocaleString(),fill:100*f.value/c,color:"var(--chart-2)",onClick:L(d,f.drill,f.label)},f.label)})}),e[7]=d,e[8]=t.stages,e[9]=c,e[10]=o,e[11]=i):i=e[11];let u;return e[12]!==t.title||e[13]!==l||e[14]!==n||e[15]!==i?(u=s.jsx(_,{title:t.title,value:l,caption:n,children:i}),e[12]=t.title,e[13]=l,e[14]=n,e[15]=i,e[16]=u):u=e[16],u}function He(a){const e=w.c(19),{section:t,onDrill:d}=a,o=B();let c;e[0]!==t.bars?(c=Math.max(0,...t.bars.map(Pe)),e[0]=t.bars,e[1]=c):c=e[1];const r=c;let l;e[2]!==t.total?.value?(l=t.total?.value.toLocaleString(),e[2]=t.total?.value,e[3]=l):l=e[3];let n;e[4]!==t.total?(n=t.total&&s.jsx("span",{className:"text-meta",children:t.total.label}),e[4]=t.total,e[5]=n):n=e[5];let i;e[6]!==t.unit?(i=t.unit&&s.jsx("span",{className:"text-meta",children:t.unit}),e[6]=t.unit,e[7]=i):i=e[7];let u;e[8]!==r||e[9]!==d||e[10]!==t.bars||e[11]!==o?(u=t.bars.length===0?s.jsx(R,{children:o("taskBoard.analytics.nobodyStepped")}):s.jsx("ul",{className:"flex flex-col",children:t.bars.map(x=>s.jsx(ce,{label:x.label,note:x.note,share:x.detail,value:x.value.toLocaleString(),fill:r?100*x.value/r:0,color:"var(--chart-1)",onClick:L(d,x.drill,x.label)},x.label))}),e[8]=r,e[9]=d,e[10]=t.bars,e[11]=o,e[12]=u):u=e[12];let f;return e[13]!==t.title||e[14]!==l||e[15]!==n||e[16]!==i||e[17]!==u?(f=s.jsx(_,{title:t.title,value:l,caption:n,aside:i,children:u}),e[13]=t.title,e[14]=l,e[15]=n,e[16]=i,e[17]=u,e[18]=f):f=e[18],f}function Pe(a){return a.value}function Ve(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Xe=new Set(["Org ID","Task ID"]),Ye=new Set(["Run outcome","Failure kind","Moved in by","State"]),Qe=new Set(["Error","Signature"]),We=new Set(["Org","Orgs"]);function qe(a){const e=w.c(32),{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:r}=a,l=B(),n=t.columns.indexOf("Org");let i;e[0]!==n||e[1]!==t.columns||e[2]!==d?(i=d&&n>=0?t.columns.indexOf("Thread"):-1,e[0]=n,e[1]=t.columns,e[2]=d,e[3]=i):i=e[3];const u=i,f=t.columns.indexOf("Task ID");let x;e[4]!==t.columns||e[5]!==c||e[6]!==f?(x=c&&f>=0?t.columns.indexOf("Task"):-1,e[4]=t.columns,e[5]=c,e[6]=f,e[7]=x):x=e[7];const m=x,h=t.columns;let p,j;if(e[8]!==r||e[9]!==n||e[10]!==t.columns||e[11]!==t.drills||e[12]!==t.rows||e[13]!==t.title||e[14]!==t.units||e[15]!==o||e[16]!==l||e[17]!==m||e[18]!==c||e[19]!==f||e[20]!==u){j=Symbol.for("react.early_return_sentinel");e:{let v;e[23]!==o?(v=S=>{const{c:g}=S;return!Xe.has(g)&&(o!==!1||!We.has(g))},e[23]=o,e[24]=v):v=e[24];const k=h.map(st).filter(v).sort(tt);let b;e[25]!==t.rows?(b=S=>{const{j:g}=S,C=t.rows.map(O=>O[g]).filter(et);return C.length>0&&C.every(Je)},e[25]=t.rows,e[26]=b):b=e[26];const $=new Set(k.filter(b).map(Ze));if(t.rows.length===1&&k.every(S=>{const{c:g}=S;return $.has(g)})){let S;e[27]!==t.rows[0]?(S=t.rows[0]??[],e[27]=t.rows[0],e[28]=S):S=e[28];const g=S;let C;e[29]!==g||e[30]!==t.units?(C=O=>{const{c:T,j:I}=O,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:T}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[T]):"—"})]},T)},e[29]=g,e[30]=t.units,e[31]=C):C=e[31],j=s.jsx(Q,{title:t.title,children:s.jsx("dl",{className:"surface grid px-4 pt-4 pb-5 grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-[repeat(auto-fill,minmax(120px,1fr))]",children:k.map(C)})});break e}p=s.jsx(Q,{title:t.title,children:t.rows.length===0?s.jsx("p",{className:"surface px-4 py-4 text-sm text-muted-foreground",children:l("taskBoard.analytics.nothingToShow")}):s.jsx("div",{className:"surface max-h-[480px] overflow-auto",children:s.jsxs(he,{variant:"flush",children:[s.jsx(ge,{children:s.jsx(W,{children:k.map(S=>{const{c:g}=S;return s.jsx(je,{className:D("whitespace-nowrap first:pl-4 last:pr-4",$.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(be,{children:t.rows.map((S,g)=>s.jsx(W,{children:k.map((C,O)=>{const{c:T,j:I}=C,N=S[I],K=m===I?S[f]:null,y=O===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(ye,{className:D("max-w-md truncate text-sm first:pl-4 last:pr-4",$.has(T)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Ve(String(S[n]),String(N)),target:"_blank",rel:"noreferrer",className:"focus-ring inline-flex items-center gap-1 text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:[l("taskBoard.analytics.openChat"),s.jsx(me,{size:12})]}):y?s.jsx("button",{type:"button",onClick:y,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(le,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):T==="Lane"&&typeof N=="string"?s.jsx(ie,{lane:N}):T==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(de,{drill:`priority:${N.toLowerCase()}`}),N]}):Ye.has(T)?s.jsx(Y,{variant:"muted",children:String(N)}):Qe.has(T)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:D("tnum",typeof N=="string"&&re.test(N)&&"text-muted-foreground"),children:Me(N,t.units?.[T])})},T)})},`${t.title}-${g}`))})]})})})}e[8]=r,e[9]=n,e[10]=t.columns,e[11]=t.drills,e[12]=t.rows,e[13]=t.title,e[14]=t.units,e[15]=o,e[16]=l,e[17]=m,e[18]=c,e[19]=f,e[20]=u,e[21]=p,e[22]=j}else p=e[21],j=e[22];return j!==Symbol.for("react.early_return_sentinel")?j:p}function Ze(a){const{c:e}=a;return e}function Je(a){return typeof a=="number"}function et(a){return a!==null}function tt(a,e){return+(e.c==="Task")-+(a.c==="Task")}function st(a,e){return{c:a,j:e}}function Tt(a){const e=w.c(17),{section:t,taskHref:d}=a,o=B();let c;e[0]!==t.columns?(c=i=>t.columns.indexOf(i),e[0]=t.columns,e[1]=c):c=e[1];const r=c;if(t.rows.length===0){let i;e[2]!==o?(i=o("taskBoard.analytics.nothingToShow"),e[2]=o,e[3]=i):i=e[3];let u;return e[4]!==i?(u=s.jsx(R,{children:i}),e[4]=i,e[5]=u):u=e[5],u}let l;if(e[6]!==r||e[7]!==t.rows||e[8]!==o||e[9]!==d){let i;e[11]!==r||e[12]!==o||e[13]!==d?(i=u=>{const f=String(u[r("Task ID")]??""),x=u[r("Lane")],m=u[r("Picked up")],h=Number(u[r("Actions by people")]??0),p=Number(u[r("Failed QA")]??0),j=[typeof m=="string"?Z(m):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),v=s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm text-foreground",children:String(u[r("Task")]??"")}),s.jsx("span",{className:"text-meta truncate",children:j.join(" · ")})]}),p>0&&s.jsxs(Y,{variant:"muted",children:[s.jsx(ve,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(ie,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(le,{href:d(f),className:D(F,"flex items-center gap-3 rounded-md p-2"),children:v}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:v})},f)},e[11]=r,e[12]=o,e[13]=d,e[14]=i):i=e[14],l=t.rows.map(i),e[6]=r,e[7]=t.rows,e[8]=o,e[9]=d,e[10]=l}else l=e[10];let n;return e[15]!==l?(n=s.jsx("ul",{className:"flex flex-col",children:l}),e[15]=l,e[16]=n):n=e[16],n}const nt={Type:$e,Priority:we,Tag:Ce,Sprint:Se,"Brief by":pe};function de(a){const e=w.c(10),{drill:t}=a;let d;e[0]!==t?(d=(t??"").split("&")[0]?.split(":")??[],e[0]=t,e[1]=d):d=e[1];const[o,c]=d;let r,l,n;if(e[2]!==o||e[3]!==c){n=Symbol.for("react.early_return_sentinel");e:{const u=o==="type"?Object.entries(Te).find(x=>{const[m]=x;return m===c})?.[1]:o==="priority"?Object.entries(De).find(x=>{const[m]=x;return m===c})?.[1]:void 0;if(!u){n=null;break e}r=u.icon,l=D("size-3.5 shrink-0",u.iconClassName)}e[2]=o,e[3]=c,e[4]=r,e[5]=l,e[6]=n}else r=e[4],l=e[5],n=e[6];if(n!==Symbol.for("react.early_return_sentinel"))return n;let i;return e[7]!==r||e[8]!==l?(i=s.jsx(r,{className:l}),e[7]=r,e[8]=l,e[9]=i):i=e[9],i}function lt(a){const e=w.c(11),{value:t,metric:d,color:o}=a,c=t??0,r=`${d.unit==="%"?Math.min(100,c):0}%`;let l;e[0]!==o||e[1]!==r?(l=s.jsx("span",{className:"h-1.5 min-w-0 flex-1 overflow-hidden rounded-full bg-muted",children:s.jsx("span",{className:"block h-full rounded-full",style:{width:r,backgroundColor:o}})}),e[0]=o,e[1]=r,e[2]=l):l=e[2];const n=t??null;let i;e[3]!==d.unit||e[4]!==n?(i=M(n,d.unit),e[3]=d.unit,e[4]=n,e[5]=i):i=e[5];let u;e[6]!==i?(u=s.jsx("span",{className:"tnum w-12 shrink-0 text-right text-sm text-foreground",children:i}),e[6]=i,e[7]=u):u=e[7];let f;return e[8]!==l||e[9]!==u?(f=s.jsxs("span",{className:"flex items-center gap-2",children:[l,u]}),e[8]=l,e[9]=u,e[10]=f):f=e[10],f}function at(a){const e=w.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=q.useState(t.dimensions[0]?.label??"");let l;e[0]!==c||e[1]!==t.dimensions?(l=t.dimensions.find(m=>m.label===c)??t.dimensions[0],e[0]=c,e[1]=t.dimensions,e[2]=l):l=e[2];const n=l,i=`minmax(0,1fr) 56px repeat(${t.metrics.length}, minmax(96px, 168px))`;let u;e[3]!==n?.label||e[4]!==t.dimensions?(u=t.dimensions.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n?.label??"",onValueChange:m=>m&&r(m),children:t.dimensions.map(it)}),e[3]=n?.label,e[4]=t.dimensions,e[5]=u):u=e[5];let f;e[6]!==i||e[7]!==n||e[8]!==d||e[9]!==t.metrics||e[10]!==o?(f=!n||n.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("div",{className:"text-meta grid items-center gap-4 border-b border-border/50 pb-2",style:{gridTemplateColumns:i},children:[s.jsx("span",{children:n.label}),s.jsx("span",{className:"text-right",children:o("taskBoard.analytics.tasks")}),t.metrics.map(rt)]}),n.rows.map(m=>{const h=L(d,m.drill,m.label),p=h?"button":"div";return s.jsxs(p,{type:h?"button":void 0,onClick:h,className:D("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&D(F,"-mx-2 w-[calc(100%+1rem)] rounded-md px-2")),style:{gridTemplateColumns:i},children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm text-foreground",children:[s.jsx(de,{drill:m.drill}),s.jsx("span",{className:"truncate",children:m.label})]}),s.jsx("span",{className:"tnum text-right text-sm text-muted-foreground",children:m.count.toLocaleString()}),t.metrics.map(j=>s.jsx(lt,{value:m.values[j.key],metric:j,color:j.better==="up"?"var(--success)":"var(--destructive)"},j.key))]},m.label)})]}),e[6]=i,e[7]=n,e[8]=d,e[9]=t.metrics,e[10]=o,e[11]=f):f=e[11];let x;return e[12]!==t.title||e[13]!==u||e[14]!==f?(x=s.jsx(_,{title:t.title,aside:u,children:f}),e[12]=t.title,e[13]=u,e[14]=f,e[15]=x):x=e[15],x}function rt(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function it(a){const e=nt[a.label];return s.jsxs(se,{value:a.label,children:[e&&s.jsx(e,{}),a.label]},a.label)}const ue=3;function ot(a){const e=w.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=q.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(b=>b.key===c)??t.metrics[0],e[0]=c,e[1]=t.metrics,e[2]=l):l=e[2];const n=l;if(!n)return null;const i=n.better==="up"?"var(--success)":"var(--destructive)";let u;e[3]!==t.cols||e[4]!==t.rows?(u=t.rows.length===t.cols.length&&t.rows.every((b,$)=>t.cols[$]===b),e[3]=t.cols,e[4]=t.rows,e[5]=u):u=e[5];const f=u,x=`minmax(96px, 1fr) repeat(${t.cols.length}, minmax(72px, 1fr))`,m=t.title;let h;e[6]!==o?(h=o("taskBoard.analytics.matrixCaption",{n:String(ue)}),e[6]=o,e[7]=h):h=e[7];let p;e[8]!==h?(p=s.jsx("span",{className:"text-meta",children:h}),e[8]=h,e[9]=p):p=e[9];let j;e[10]!==n.key||e[11]!==t.metrics?(j=t.metrics.length>1&&s.jsx(te,{type:"single",variant:"segmented",size:"sm",value:n.key,onValueChange:b=>b&&r(b),children:t.metrics.map(dt)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let v;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==f||e[18]!==o||e[19]!==i?(v=t.rows.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("div",{className:"grid min-w-fit gap-1",style:{gridTemplateColumns:x},children:[s.jsxs("span",{className:"text-meta self-end pb-1",children:[t.rowLabel," / ",t.colLabel]}),t.cols.map(ct),t.rows.map((b,$)=>s.jsx(ut,{row:b,section:t,metric:n,tint:i,onDrill:d,upTo:f?$:void 0},b))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=f,e[18]=o,e[19]=i,e[20]=v):v=e[20];let k;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==v?(k=s.jsx(_,{title:m,caption:p,aside:j,children:v}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=v,e[25]=k):k=e[25],k}function ct(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function dt(a){return s.jsx(se,{value:a.key,children:a.label},a.key)}function ut(a){const e=w.c(22),{row:t,section:d,metric:o,tint:c,onDrill:r,upTo:l}=a,n=B();let i;e[0]!==t?(i=s.jsx("span",{className:"flex items-center truncate pr-2 text-sm text-foreground",children:t}),e[0]=t,e[1]=i):i=e[1];let u;if(e[2]!==o||e[3]!==r||e[4]!==t||e[5]!==d.cells||e[6]!==d.cols||e[7]!==n||e[8]!==c||e[9]!==l){let x;e[11]!==o||e[12]!==r||e[13]!==t||e[14]!==d.cells||e[15]!==n||e[16]!==c||e[17]!==l?(x=(m,h)=>{if(l!==void 0&&h>l)return s.jsx("span",{},m);const p=d.cells.find(b=>b.row===t&&b.col===m),j=p?.values[o.key]??null;if(!p)return s.jsx("span",{className:"flex h-14 items-center justify-center rounded-md bg-muted/40 text-sm text-muted-foreground",children:"—"},m);const v=j===null?0:Math.min(100,o.unit==="%"?j:0),k=L(r,p.drill,t===m?t:`${t} · ${m}`);return s.jsxs("button",{type:"button",onClick:k,disabled:!k,className:D("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",k&&"cursor-pointer hover:opacity-80",p.count<ue&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+v*.5)}%, var(--muted))`},children:[s.jsx("span",{className:"tnum text-sm font-medium text-foreground",children:M(j,o.unit)}),s.jsx("span",{className:"text-meta",children:p.count===1?n("taskBoard.analytics.drillCountOne"):n("taskBoard.analytics.drillCount",{n:String(p.count)})})]},m)},e[11]=o,e[12]=r,e[13]=t,e[14]=d.cells,e[15]=n,e[16]=c,e[17]=l,e[18]=x):x=e[18],u=d.cols.map(x),e[2]=o,e[3]=r,e[4]=t,e[5]=d.cells,e[6]=d.cols,e[7]=n,e[8]=c,e[9]=l,e[10]=u}else u=e[10];let f;return e[19]!==i||e[20]!==u?(f=s.jsxs(s.Fragment,{children:[i,u]}),e[19]=i,e[20]=u,e[21]=f):f=e[21],f}function ft(){const a=w.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?ne(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function mt(a){const e=w.c(21),{section:t,onDrill:d}=a,o=B(),c=ft(),r=t.unit??void 0,l=t.layout==="stacked";let n;if(e[0]!==c||e[1]!==d||e[2]!==t.baseline||e[3]!==t.categories||e[4]!==t.keys||e[5]!==t.title||e[6]!==l||e[7]!==o||e[8]!==r){let i;e[10]!==t.baseline?(i=g=>g!==t.baseline,e[10]=t.baseline,e[11]=i):i=e[11];const u=t.keys.filter(i),f=g=>g===t.baseline?"var(--border)":E[u.indexOf(g)%E.length]??"",x=Object.fromEntries(t.keys.map(g=>[g,{label:c(g),color:f(g)}]));let m;e[12]!==t.categories?(m=t.categories.map(pt),e[12]=t.categories,e[13]=m):m=e[13];const h=m;let p;e[14]!==d||e[15]!==t.categories?(p=g=>{const C=t.categories[g];C&&L(d,C.drill,C.label)?.()},e[14]=d,e[15]=t.categories,e[16]=p):p=e[16];const j=p,v=t.categories.some(xt)&&!!d,k=l?Math.max(120,t.categories.length*44+32):220;let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b={fill:"var(--muted)",opacity:.4},e[17]=b):b=e[17];let $;e[18]!==c||e[19]!==r?($=s.jsx(ee,{cursor:b,content:g=>{const{active:C,payload:O}=g;return s.jsx(oe,{active:C,payload:O,unit:r,nameOf:c})}}),e[18]=c,e[19]=r,e[20]=$):$=e[20];const S=$;n=s.jsx(_,{title:t.title,aside:s.jsx("ul",{className:"flex flex-wrap justify-end gap-x-3 gap-y-1",children:t.keys.map(g=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:f(g)}}),c(g)]},g))}),children:h.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(J,{role:"img","aria-label":t.title,className:"w-full",style:{height:k},config:x,children:l?s.jsxs(G,{data:h,layout:"vertical",margin:{left:0,right:8,top:0},children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,horizontal:!1}),s.jsx(P,{type:"number",axisLine:!1,tickLine:!1,tick:A,tickFormatter:g=>X(g,r)}),s.jsx(V,{type:"category",dataKey:"label",axisLine:!1,tickLine:!1,tick:A,width:72}),S,t.keys.map((g,C)=>s.jsx(U,{dataKey:g,stackId:"all",fill:f(g),maxBarSize:22,radius:C===t.keys.length-1?[0,4,4,0]:0,animationDuration:300},g))]}):s.jsxs(G,{data:h,margin:{left:0,right:0,top:8},barGap:4,barCategoryGap:"28%",children:[s.jsx(H,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,tickMargin:8}),s.jsx(V,{orientation:"right",axisLine:!1,tickLine:!1,tick:A,allowDecimals:r!==void 0,tickFormatter:g=>X(g,r),width:48}),S,t.keys.map(g=>s.jsx(U,{dataKey:g,fill:f(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:D(v&&"cursor-pointer"),onClick:(C,O)=>j(O)},g))]})})}),e[0]=c,e[1]=d,e[2]=t.baseline,e[3]=t.categories,e[4]=t.keys,e[5]=t.title,e[6]=l,e[7]=o,e[8]=r,e[9]=n}else n=e[9];return n}function xt(a){return a.drill}function pt(a){return{label:a.label,...a.values}}function Dt(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function Ot(a){const e=w.c(27),{section:t,threadLinks:d,showOrg:o,taskHref:c,range:r,onDrill:l}=a;switch(t.kind){case"stat":{let n;return e[0]!==l||e[1]!==t?(n=s.jsx(Ae,{section:t,onDrill:l}),e[0]=l,e[1]=t,e[2]=n):n=e[2],n}case"series":{let n;return e[3]!==r||e[4]!==t?(n=s.jsx(ze,{section:t,range:r}),e[3]=r,e[4]=t,e[5]=n):n=e[5],n}case"funnel":{let n;return e[6]!==l||e[7]!==t?(n=s.jsx(Ue,{section:t,onDrill:l}),e[6]=l,e[7]=t,e[8]=n):n=e[8],n}case"bars":{let n;return e[9]!==l||e[10]!==t?(n=s.jsx(He,{section:t,onDrill:l}),e[9]=l,e[10]=t,e[11]=n):n=e[11],n}case"breakdown":{let n;return e[12]!==l||e[13]!==t?(n=s.jsx(at,{section:t,onDrill:l}),e[12]=l,e[13]=t,e[14]=n):n=e[14],n}case"matrix":{let n;return e[15]!==l||e[16]!==t?(n=s.jsx(ot,{section:t,onDrill:l}),e[15]=l,e[16]=t,e[17]=n):n=e[17],n}case"categories":{let n;return e[18]!==l||e[19]!==t?(n=s.jsx(mt,{section:t,onDrill:l}),e[18]=l,e[19]=t,e[20]=n):n=e[20],n}case"table":{let n;return e[21]!==l||e[22]!==t||e[23]!==o||e[24]!==c||e[25]!==d?(n=s.jsx(qe,{section:t,threadLinks:d,showOrg:o,taskHref:c,onDrill:l}),e[21]=l,e[22]=t,e[23]=o,e[24]=c,e[25]=d,e[26]=n):n=e[26],n}default:return t}}export{A,Tt as D,_ as M,Ot as S,Dt as s};
@@ -0,0 +1 @@
1
+ import{c as o,j as r}from"./index-Cw6ilRLN.js";import{O as e}from"./api-keys-yf9_DOP2.js";import{R as m}from"./require-capability-42JNP4Dw.js";import"./AlertCircle-Hdww5hle.js";import"./Copy01-DZu9JdFR.js";import"./Key01-nj-094nh.js";import"./Plus-BQ-ZwSoF.js";import"./Trash01-CA_m_Fs0.js";import"./empty-state-DXBACaDC.js";import"./label-DvonkoXD.js";import"./use-mcp-client-CvhC1TIJ.js";import"./auth-DPUc_dnx.js";import"./access-gate-RZ9GSyUJ.js";import"./capability-load-error-BNI4R8XO.js";function d(){const t=o.c(1);let i;return t[0]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(m,{capability:"api-keys:manage",area:"api-keys",children:r.jsx(e,{})}),t[0]=i):i=t[0],i}export{d as default};
@@ -1 +1 @@
1
- import{c as S,a4 as R,R as Q,K as Y,m as ce,q as U,e as V,j as i,hH as de,b as z,r as $,h8 as me,gm as J,aS as ue,aR as fe,aO as ge,aM as pe,aN as ye,aQ as xe,aP as he,bm as je,B as w,t as q,fT as Ke,x as W,aY as X,w as Z,I as ee,y as te,v as se,D as ie}from"./index-LISCRMKT.js";import{i as Ce}from"./AlertCircle-Pu-QR8hS.js";import{a as De}from"./Copy01-BEOZtg79.js";import{i as ne}from"./Key01-BGQzZTLx.js";import{s as le}from"./Plus-DZ8OV5bq.js";import{s as Ae}from"./Trash01-C8OxhBl3.js";import{E as Se}from"./empty-state-EpAwETL4.js";import{L as be}from"./label-BfYbFBpZ.js";import{u as H}from"./use-mcp-client-0e8NRgfT.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function we(t){const e=S.c(11),{org:a}=R();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Q,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function _e(){const t=S.c(11),{org:e}=R();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=S.c(11),{org:e}=R();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=S.c(6),{error:a}=t,r=z();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Ce,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Pe(t){const e=S.c(20),{apiKey:a,onDelete:r}=t,l=z();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(ne,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(w,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:r,"aria-label":m,children:f}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let u;return e[17]!==d||e[18]!==g?(u=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=u):u=e[19],u}function Ee(t){const e=S.c(15),{onCreate:a}=t,r=z();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ne,{}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==r?(n=r("settings.apiKeys.emptyDescription"),e[3]=r,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(le,{size:14}),e[5]=c):c=e[5];let o;e[6]!==r?(o=r("settings.apiKeys.newKey"),e[6]=r,e[7]=o):o=e[7];let d;e[8]!==a||e[9]!==o?(d=i.jsxs(w,{onClick:a,size:"sm",children:[c,o]}),e[8]=a,e[9]=o,e[10]=d):d=e[10];let m;return e[11]!==s||e[12]!==n||e[13]!==d?(m=i.jsx(Ke,{children:i.jsx(Se,{size:"inline",icon:l,title:s,description:n,children:d})}),e[11]=s,e[12]=n,e[13]=d,e[14]=m):m=e[14],m}function Ne(t){const e=S.c(40),{createdKey:a,onClose:r}=t,l=z(),s=a!==null;let n;e[0]!==r?(n=b=>!b&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(W,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(X,{children:d}),e[8]=d,e[9]=m):m=e[9];let f;e[10]!==o||e[11]!==m?(f=i.jsxs(Z,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=f):f=e[12];const g=a?.key??"";let u;e[13]!==g?(u=i.jsx(ee,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(De,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(w,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==u?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[u,x]}),e[24]=x,e[25]=u,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(te,{children:i.jsx(w,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let D;e[32]!==h||e[33]!==K||e[34]!==f?(D=i.jsxs(se,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=D):D=e[35];let A;return e[36]!==s||e[37]!==D||e[38]!==n?(A=i.jsx(ie,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=A):A=e[39],A}function Te(t){const e=S.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=z(),[n,c]=$.useState(""),o=_e();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(f=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=f):f=e[7];const g=f;let u;e[8]!==m||e[9]!==r?(u=F=>{F?r(F):m()},e[8]=m,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(W,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(X,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(Z,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(be,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=F=>c(F.target.value),e[26]=D):D=e[26];let A;e[27]!==s?(A=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=A):A=e[28];let b;e[29]!==n||e[30]!==A?(b=i.jsx(ee,{id:"api-key-name",value:n,onChange:D,placeholder:A,autoComplete:"off",required:!0}),e[29]=n,e[30]=A,e[31]=b):b=e[31];let _;e[32]!==K||e[33]!==b?(_=i.jsxs("div",{className:"space-y-1.5",children:[K,b]}),e[32]=K,e[33]=b,e[34]=_):_=e[34];const re=o.isPending;let v;e[35]!==s?(v=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=v):v=e[36];let P;e[37]!==o.isPending||e[38]!==m||e[39]!==v?(P=i.jsx(w,{type:"button",variant:"outline",onClick:m,disabled:re,children:v}),e[37]=o.isPending,e[38]=m,e[39]=v,e[40]=P):P=e[40];let E;e[41]!==o.isPending||e[42]!==n?(E=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=E):E=e[43];let N;e[44]!==o.isPending||e[45]!==s?(N=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=N):N=e[46];let T;e[47]!==E||e[48]!==N?(T=i.jsx(w,{type:"submit",disabled:E,children:N}),e[47]=E,e[48]=N,e[49]=T):T=e[49];let k;e[50]!==P||e[51]!==T?(k=i.jsxs(te,{children:[P,T]}),e[50]=P,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==_||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[_,k]}),e[53]=g,e[54]=_,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(se,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let O;return e[60]!==a||e[61]!==L||e[62]!==u?(O=i.jsx(ie,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=O):O=e[63],O}function ke(){const t=z(),{data:e,isLoading:a,error:r}=we(),l=ve(),[s,n]=$.useState(!1),[c,o]=$.useState(null),[d,m]=$.useState(null),f=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(u){q.error(u instanceof Error?u.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(w,{onClick:()=>n(!0),size:"sm",children:[i.jsx(le,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&f.length===0?i.jsx(ae,{error:r}):f.length===0?i.jsx(Ee,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:f.map(u=>i.jsx(Pe,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Te,{open:s,onOpenChange:n,onCreated:o}),i.jsx(Ne,{createdKey:c,onClose:()=>o(null)}),i.jsx(ue,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(fe,{children:[i.jsxs(ge,{children:[i.jsx(pe,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(ye,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.cancelButton")}),i.jsx(je,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Ie,children:i.jsx(ke,{})}),t[0]=e):e=t[0],e}function Ie(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{ke as A,Ye as O,we as a,_e as u};
1
+ import{c as S,a4 as R,R as Q,K as Y,m as ce,q as U,e as V,j as i,hH as de,b as z,r as $,h8 as me,gm as J,aS as ue,aR as fe,aO as ge,aM as pe,aN as ye,aQ as xe,aP as he,bm as je,B as w,t as q,fT as Ke,x as W,aY as X,w as Z,I as ee,y as te,v as se,D as ie}from"./index-Cw6ilRLN.js";import{i as Ce}from"./AlertCircle-Hdww5hle.js";import{a as De}from"./Copy01-DZu9JdFR.js";import{i as ne}from"./Key01-nj-094nh.js";import{s as le}from"./Plus-BQ-ZwSoF.js";import{s as Ae}from"./Trash01-CA_m_Fs0.js";import{E as Se}from"./empty-state-DXBACaDC.js";import{L as be}from"./label-DvonkoXD.js";import{u as H}from"./use-mcp-client-CvhC1TIJ.js";function M(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function we(t){const e=S.c(11),{org:a}=R();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:Q,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=H(r);let s;e[3]!==a.id?(s=Y.apiKeysList(a.id),e[3]=a.id,e[4]=s):s=e[4];let n;e[5]!==l?(n=async()=>{const d=await l.callTool({name:"API_KEY_LIST",arguments:{}});return M(d,"Failed to list API keys").items},e[5]=l,e[6]=n):n=e[6];const c=t?.enabled??!0;let o;return e[7]!==s||e[8]!==n||e[9]!==c?(o={queryKey:s,queryFn:n,staleTime:3e4,enabled:c},e[7]=s,e[8]=n,e[9]=c,e[10]=o):o=e[10],ce(o)}function _e(){const t=S.c(11),{org:e}=R();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_CREATE",arguments:{name:o.name,permissions:o.permissions??{"*":["*"]}}});return M(d,"Failed to create API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ve(){const t=S.c(11),{org:e}=R();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:Q,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=H(a),l=U();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return M(d,"Failed to delete API key")},t[3]=r,t[4]=s):s=t[4];let n;t[5]!==e.id||t[6]!==l?(n=()=>{l.invalidateQueries({queryKey:Y.apiKeysList(e.id)})},t[5]=e.id,t[6]=l,t[7]=n):n=t[7];let c;return t[8]!==s||t[9]!==n?(c={mutationFn:s,onSuccess:n},t[8]=s,t[9]=n,t[10]=c):c=t[10],V(c)}function ae(t){const e=S.c(6),{error:a}=t,r=z();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(Ce,{size:16}),e[0]=l):l=e[0];let s;e[1]!==a.message||e[2]!==r?(s=r("settings.apiKeys.failedToLoadError",{error:a.message}),e[1]=a.message,e[2]=r,e[3]=s):s=e[3];let n;return e[4]!==s?(n=i.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[l,i.jsx("span",{className:"text-sm font-medium",children:s})]}),e[4]=s,e[5]=n):n=e[5],n}function Pe(t){const e=S.c(20),{apiKey:a,onDelete:r}=t,l=z();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=i.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:i.jsx(ne,{size:16,className:"text-muted-foreground"})}),e[0]=s):s=e[0];let n;e[1]!==a.name?(n=i.jsx("span",{className:"font-medium text-sm truncate block",children:a.name}),e[1]=a.name,e[2]=n):n=e[2];let c;e[3]!==a.createdAt||e[4]!==l?(c=l("settings.apiKeys.createdAt",{date:new Date(a.createdAt).toLocaleDateString()}),e[3]=a.createdAt,e[4]=l,e[5]=c):c=e[5];let o;e[6]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:c}),e[6]=c,e[7]=o):o=e[7];let d;e[8]!==n||e[9]!==o?(d=i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s,i.jsxs("div",{className:"min-w-0",children:[n,o]})]}),e[8]=n,e[9]=o,e[10]=d):d=e[10];let m;e[11]!==l?(m=l("settings.apiKeys.deleteKey"),e[11]=l,e[12]=m):m=e[12];let f;e[13]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx(Ae,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(w,{variant:"ghost-destructive",size:"icon",className:"shrink-0",onClick:r,"aria-label":m,children:f}),e[14]=r,e[15]=m,e[16]=g):g=e[16];let u;return e[17]!==d||e[18]!==g?(u=i.jsxs("li",{className:"flex items-center justify-between gap-4 px-4 py-3",children:[d,g]}),e[17]=d,e[18]=g,e[19]=u):u=e[19],u}function Ee(t){const e=S.c(15),{onCreate:a}=t,r=z();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ne,{}),e[0]=l):l=e[0];let s;e[1]!==r?(s=r("settings.apiKeys.emptyTitle"),e[1]=r,e[2]=s):s=e[2];let n;e[3]!==r?(n=r("settings.apiKeys.emptyDescription"),e[3]=r,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsx(le,{size:14}),e[5]=c):c=e[5];let o;e[6]!==r?(o=r("settings.apiKeys.newKey"),e[6]=r,e[7]=o):o=e[7];let d;e[8]!==a||e[9]!==o?(d=i.jsxs(w,{onClick:a,size:"sm",children:[c,o]}),e[8]=a,e[9]=o,e[10]=d):d=e[10];let m;return e[11]!==s||e[12]!==n||e[13]!==d?(m=i.jsx(Ke,{children:i.jsx(Se,{size:"inline",icon:l,title:s,description:n,children:d})}),e[11]=s,e[12]=n,e[13]=d,e[14]=m):m=e[14],m}function Ne(t){const e=S.c(40),{createdKey:a,onClose:r}=t,l=z(),s=a!==null;let n;e[0]!==r?(n=b=>!b&&r(),e[0]=r,e[1]=n):n=e[1];let c;e[2]!==l?(c=l("settings.apiKeys.createdTitle"),e[2]=l,e[3]=c):c=e[3];let o;e[4]!==c?(o=i.jsx(W,{children:c}),e[4]=c,e[5]=o):o=e[5];let d;e[6]!==l?(d=l("settings.apiKeys.createdDescription"),e[6]=l,e[7]=d):d=e[7];let m;e[8]!==d?(m=i.jsx(X,{children:d}),e[8]=d,e[9]=m):m=e[9];let f;e[10]!==o||e[11]!==m?(f=i.jsxs(Z,{children:[o,m]}),e[10]=o,e[11]=m,e[12]=f):f=e[12];const g=a?.key??"";let u;e[13]!==g?(u=i.jsx(ee,{readOnly:!0,value:g,className:"font-mono text-xs"}),e[13]=g,e[14]=u):u=e[14];let p;e[15]!==a||e[16]!==l?(p=()=>{a&&(navigator.clipboard?.writeText(a.key),q.success(l("settings.apiKeys.copied")))},e[15]=a,e[16]=l,e[17]=p):p=e[17];let y;e[18]!==l?(y=l("settings.apiKeys.copyKey"),e[18]=l,e[19]=y):y=e[19];let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=i.jsx(De,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(w,{type:"button",variant:"outline",size:"icon",onClick:p,"aria-label":y,children:C}),e[21]=p,e[22]=y,e[23]=x):x=e[23];let h;e[24]!==x||e[25]!==u?(h=i.jsxs("div",{className:"flex items-center gap-2",children:[u,x]}),e[24]=x,e[25]=u,e[26]=h):h=e[26];let j;e[27]!==l?(j=l("settings.apiKeys.done"),e[27]=l,e[28]=j):j=e[28];let K;e[29]!==r||e[30]!==j?(K=i.jsx(te,{children:i.jsx(w,{onClick:r,children:j})}),e[29]=r,e[30]=j,e[31]=K):K=e[31];let D;e[32]!==h||e[33]!==K||e[34]!==f?(D=i.jsxs(se,{className:"sm:max-w-lg",children:[f,h,K]}),e[32]=h,e[33]=K,e[34]=f,e[35]=D):D=e[35];let A;return e[36]!==s||e[37]!==D||e[38]!==n?(A=i.jsx(ie,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=A):A=e[39],A}function Te(t){const e=S.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=z(),[n,c]=$.useState(""),o=_e();let d;e[0]!==r?(d=function(){c(""),r(!1)},e[0]=r,e[1]=d):d=e[1];const m=d;let f;e[2]!==o||e[3]!==m||e[4]!==n||e[5]!==l||e[6]!==s?(f=async function(oe){if(oe.preventDefault(),!!n.trim())try{const B=await o.mutateAsync({name:n.trim()});m(),l(B)}catch(B){const G=B;q.error(G instanceof Error?G.message:s("settings.apiKeys.failedToCreateKey"))}},e[2]=o,e[3]=m,e[4]=n,e[5]=l,e[6]=s,e[7]=f):f=e[7];const g=f;let u;e[8]!==m||e[9]!==r?(u=F=>{F?r(F):m()},e[8]=m,e[9]=r,e[10]=u):u=e[10];let p;e[11]!==s?(p=s("settings.apiKeys.newKeyTitle"),e[11]=s,e[12]=p):p=e[12];let y;e[13]!==p?(y=i.jsx(W,{children:p}),e[13]=p,e[14]=y):y=e[14];let C;e[15]!==s?(C=s("settings.apiKeys.newKeyDescription"),e[15]=s,e[16]=C):C=e[16];let x;e[17]!==C?(x=i.jsx(X,{children:C}),e[17]=C,e[18]=x):x=e[18];let h;e[19]!==y||e[20]!==x?(h=i.jsxs(Z,{children:[y,x]}),e[19]=y,e[20]=x,e[21]=h):h=e[21];let j;e[22]!==s?(j=s("settings.apiKeys.nameLabel"),e[22]=s,e[23]=j):j=e[23];let K;e[24]!==j?(K=i.jsx(be,{htmlFor:"api-key-name",children:j}),e[24]=j,e[25]=K):K=e[25];let D;e[26]===Symbol.for("react.memo_cache_sentinel")?(D=F=>c(F.target.value),e[26]=D):D=e[26];let A;e[27]!==s?(A=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=A):A=e[28];let b;e[29]!==n||e[30]!==A?(b=i.jsx(ee,{id:"api-key-name",value:n,onChange:D,placeholder:A,autoComplete:"off",required:!0}),e[29]=n,e[30]=A,e[31]=b):b=e[31];let _;e[32]!==K||e[33]!==b?(_=i.jsxs("div",{className:"space-y-1.5",children:[K,b]}),e[32]=K,e[33]=b,e[34]=_):_=e[34];const re=o.isPending;let v;e[35]!==s?(v=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=v):v=e[36];let P;e[37]!==o.isPending||e[38]!==m||e[39]!==v?(P=i.jsx(w,{type:"button",variant:"outline",onClick:m,disabled:re,children:v}),e[37]=o.isPending,e[38]=m,e[39]=v,e[40]=P):P=e[40];let E;e[41]!==o.isPending||e[42]!==n?(E=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=E):E=e[43];let N;e[44]!==o.isPending||e[45]!==s?(N=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=N):N=e[46];let T;e[47]!==E||e[48]!==N?(T=i.jsx(w,{type:"submit",disabled:E,children:N}),e[47]=E,e[48]=N,e[49]=T):T=e[49];let k;e[50]!==P||e[51]!==T?(k=i.jsxs(te,{children:[P,T]}),e[50]=P,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==_||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[_,k]}),e[53]=g,e[54]=_,e[55]=k,e[56]=I):I=e[56];let L;e[57]!==I||e[58]!==h?(L=i.jsxs(se,{className:"sm:max-w-lg",children:[h,I]}),e[57]=I,e[58]=h,e[59]=L):L=e[59];let O;return e[60]!==a||e[61]!==L||e[62]!==u?(O=i.jsx(ie,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=O):O=e[63],O}function ke(){const t=z(),{data:e,isLoading:a,error:r}=we(),l=ve(),[s,n]=$.useState(!1),[c,o]=$.useState(null),[d,m]=$.useState(null),f=e??[];async function g(){if(d)try{await l.mutateAsync(d.id),q.success(t("settings.apiKeys.keyDeleted",{name:d.name}))}catch(u){q.error(u instanceof Error?u.message:t("settings.apiKeys.failedToDeleteKey"))}finally{m(null)}}return i.jsxs(me,{title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(w,{onClick:()=>n(!0),size:"sm",children:[i.jsx(le,{size:14}),t("settings.apiKeys.newKey")]}):void 0,children:[a?i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("p",{className:"px-4 py-3 text-xs text-muted-foreground",children:t("settings.apiKeys.loading")})}):r&&f.length===0?i.jsx(ae,{error:r}):f.length===0?i.jsx(Ee,{onCreate:()=>n(!0)}):i.jsx(J,{className:"gap-0 overflow-hidden p-0",children:i.jsx("ul",{className:"divide-y divide-border",children:f.map(u=>i.jsx(Pe,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Te,{open:s,onOpenChange:n,onCreated:o}),i.jsx(Ne,{createdKey:c,onClose:()=>o(null)}),i.jsx(ue,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(fe,{children:[i.jsxs(ge,{children:[i.jsx(pe,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(ye,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.cancelButton")}),i.jsx(je,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Ye(){const t=S.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Ie,children:i.jsx(ke,{})}),t[0]=e):e=t[0],e}function Ie(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{ke as A,Ye as O,we as a,_e as u};
@@ -0,0 +1 @@
1
+ import{c as je,j as s,b as Ke,r as A,ax as Ne,l as Re,h as Te,t as he}from"./index-Cw6ilRLN.js";import{u as Ce}from"./chat-context-DR3uLV2w.js";import{S as Fe}from"./scroll-area-BhjyScQp.js";import{u as Ie,A as Pe}from"./use-section-preview-base-Bi-N531T.js";import{o as Me,ax as $e}from"./parse-sections-C3Hmwt0I.js";import{H as Oe,d as Ue,u as Ve,v as ze,F as Le,w as qe,a as Ge,t as He,G as De}from"./held-block-view-B1ZTgtaf.js";import{n as Ze,r as Je}from"./content-tab-DruH5Km_.js";import"./use-panel-navigate-DzWclIwL.js";import"./thread-route-BZQyZ1gL.js";import"./use-project-scope-Bq5GrrDd.js";import"./repository-binding-PeMGXqSl.js";import"./use-mcp-client-CvhC1TIJ.js";import"./auth-DPUc_dnx.js";import"./autosend-Bw00xJf9.js";import"./thread-intent-CAWCzeoG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BxinXtVa.js";import"./task-board-DSKYQnUa.js";import"./schema-CB30E7Gi.js";import"./slugify-CEUa2lfQ.js";import"./use-entitlements-C4tNpLNZ.js";import"./use-ai-providers-UYArMe6s.js";import"./location-V0VwTJTt.js";import"./use-decopilot-events-D7GIEyuu.js";import"./use-organization-settings-BFBXS4UG.js";import"./index-BdQq_4o_.js";import"./UserSquare-TWw3zsr7.js";import"./agent-icon-rBB7-3Iv.js";import"./AlertCircle-Hdww5hle.js";import"./Tool01-DamUcObd.js";import"./ArrowUp-B0V8Iire.js";import"./ArrowLeft-BdhX_ELF.js";import"./LinkBroken01-DiqXlFxy.js";import"./ShoppingBag01-Dt2W1jQn.js";import"./ZoomOut-C8TxwIPG.js";import"./Building02-CIOqUK8u.js";import"./CheckCircle-Oy-r5wrn.js";import"./ChevronUp-yEhXqYsc.js";import"./ChevronSelectorVertical-4o-RZGZG.js";import"./Copy01-DZu9JdFR.js";import"./CreditCard01-e2iuA4b6.js";import"./DotsVertical-2jz8M_Ab.js";import"./Image01-Csw8Eb7F.js";import"./Globe04-Dv-Q1UFe.js";import"./SwitchHorizontal01-ZVZ1PW_K.js";import"./Key01-nj-094nh.js";import"./Link01-DIQIHWyZ.js";import"./Minus-DGpW2R_Y.js";import"./Monitor01-6lmVgqwN.js";import"./Sun-BCEy54hJ.js";import"./Play-Bw1hrhzw.js";import"./Plus-BQ-ZwSoF.js";import"./SearchMd-CcFldd9q.js";import"./Trash01-CA_m_Fs0.js";import"./Upload01-COlXo8Rs.js";import"./Users01-CqKKJKeH.js";import"./XClose-BLrzcEcC.js";import"./Zap-CbyRjfWs.js";import"./section-preview-url-7zfngvgW.js";import"./use-session-runtime-C29BLCO5.js";import"./site-editor-toast-MdEv_oKc.js";import"./experiments-tab-choice-B1sDnY5T.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-CFwQd3Dj.js";import"./use-sandbox-events-vz4ehPML.js";import"./sandbox-git-api-DcqI6XE4.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-BwKW0A4I.js";import"./collapsible-BHetx99z.js";import"./use-copy-Dk3cEiBB.js";import"./usage-stats-CO_PzmjR.js";import"./tool-namespace-COirY7s5.js";import"./form-RFg7ydwN.js";import"./label-DvonkoXD.js";import"./utils-CVEq3hMx.js";import"./markdown-Bnq_rauO.js";import"./use-mobile-CKqq0hw6.js";import"./tooltip-g1j6c67B.js";import"./index-nea5NUvS.js";import"./use-clock-tick-Bbl4jizB.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-D9bP7Uyj.js";import"./types-C_kLVB_R.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./shell-layout-CdKs-SVX.js";import"./use-deployment-admin-DVUkJw7-.js";import"./admin-fetch-BhTJlAsX.js";import"./command-CermhoTd.js";import"./index-DiqyTQYB.js";import"./integration-icon-BvuUEHwl.js";import"./project-icon-BRvDYuEF.js";import"./new-project-dialog-4twV8Y4C.js";import"./repository-import-picker-BMJ3biNs.js";import"./use-navigate-to-agent-X54xBbs-.js";import"./repository-picker-XiErYA7B.js";import"./github-icon-CfOxQ_kk.js";import"./useInfiniteQuery-qZeYk4so.js";import"./infiniteQueryObserver-r2g3Rufl.js";import"./collection-search-2lwiZ_Gf.js";import"./use-debounced-value-Cg3pn3hJ.js";import"./required-auth-layout-DsfiOlyN.js";import"./use-org-sso-1YltyqLi.js";import"./sheet-CLT2kz10.js";import"./use-connection-BeEdNRHa.js";import"./use-mcp-prompts-BWsIl6wX.js";import"./use-thread-outputs-DsSeydeQ.js";import"./file-type-icon-BkRHeWVz.js";import"./section-array-field-CowajgIO.js";import"./alert-Bg73iQHm.js";import"./blocks-tab-states-Bujj2Oag.js";import"./slider-BOLJxYF2.js";import"./index-CuP8z21G.js";import"./tooltipContext-CLvPoHx0.js";import"./CategoricalChart-B7pVoKsa.js";import"./index-GbZ7cHim.js";import"./ActiveShapeUtils-CTNIR1uo.js";import"./Sector-Lv3mbSoh.js";import"./symbol-Femlxd_m.js";import"./empty-state-DhRsvQHO.js";import"./switch-D45dHrK3.js";import"./textarea-B3VJ1IVc.js";import"./popover-N-Tbv2Q_.js";import"./monaco-editor-DP1-rJ0v.js";import"./editor-CJ37wKUc.js";import"./calendar-BRFOK1aQ.js";import"./select-IRnWfSEI.js";import"./editor-classes-yEQ_KPvG.js";import"./core.esm-Dennsttt.js";import"./sortable.esm-CIFqofWL.js";import"./toggle-group-BtOmVjMF.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-CMpxb7Mm.js";import"./search-input-CnMfC6Ib.js";import"./tabs-DBG72Yee.js";import"./use-file-configs-C8WLQuJ_.js";import"./asset-utils-BrDvPrYv.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./view-header-D4T3g6Y4.js";import"./use-cms-publish-actions-Oa0EZQ0t.js";import"./hosted-publish-feedback-CaaC9Yio.js";import"./mustache-nJjvu1VV.js";import"./sandbox-lifecycle-context-DB7MI-hA.js";import"./checkbox-b8t24adl.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-D5l0lx5X.js";import"./badge-BWAFo8iB.js";import"./empty-state-DXBACaDC.js";import"./collection-table-wrapper-TIbTouTp.js";import"./table-Daq1_j7m.js";function Qe(t,e){const m=(t.title||t.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),o=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",r=Ze(e,o);return{blockKey:r,data:{__resolveType:t.resolveType,name:r}}}function Lr(t){const e=je.c(9),m=t.saveGuard?void 0:t.block!==void 0;let o;e[0]!==t?(o=s.jsx(We,{...t}),e[0]=t,e[1]=o):o=e[1];let r;return e[2]!==t.blockKey||e[3]!==t.branch||e[4]!==t.orgSlug||e[5]!==t.virtualMcpId||e[6]!==m||e[7]!==o?(r=s.jsx(Oe,{orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,blockKey:t.blockKey,present:m,children:o}),e[2]=t.blockKey,e[3]=t.branch,e[4]=t.orgSlug,e[5]=t.virtualMcpId,e[6]=m,e[7]=o,e[8]=r):r=e[8],r}function We(t){const e=je.c(88),{orgSlug:m,virtualMcpId:o,branch:r,blockKey:n,block:h,meta:p,decofile:d,title:Be,excludeFields:D,schemaPending:be,previewBaseUrl:ve,notice:Z,saveGuard:J,persistDefaults:Q}=t,W=be===void 0?!1:be,X=ve===void 0?null:ve,Y=Ce()?.taskId??null,l=Ke();let N;e[0]!==r||e[1]!==X||e[2]!==o?(N={virtualMcpId:o,branch:r,sandboxUrl:X},e[0]=r,e[1]=X,e[2]=o,e[3]=N):N=e[3];const b=Ie(N),u=typeof h?.__resolveType=="string"?h.__resolveType:"";let R;e[4]!==D||e[5]!==p||e[6]!==u?(R=Je(u,p,D),e[4]=D,e[5]=p,e[6]=u,e[7]=R):R=e[7];const v=R;let T;e[8]!==v?(T=!!v&&Object.keys(v.properties??{}).length>0,e[8]=v,e[9]=T):T=e[9];const ee=T,ge=Be??(h?Me(n,h,p):n);let C;e[10]!==r||e[11]!==m||e[12]!==o?(C={orgSlug:m,virtualMcpId:o,branch:r},e[10]=r,e[11]=m,e[12]=o,e[13]=C):C=e[13];let F;e[14]!==J?(F={guard:J,holdsCopy:!0},e[14]=J,e[15]=F):F=e[15];const{save:te,flush:oe,isPending:re}=Ue(C,F);let I;e[16]!==r||e[17]!==m||e[18]!==o?(I={orgSlug:m,virtualMcpId:o,branch:r},e[16]=r,e[17]=m,e[18]=o,e[19]=I):I=e[19];const g=Ve(I);let P;e[20]!==g||e[21]!==l?(P=Ge((i,a)=>g.mutate({blockKey:i,data:a},{onError:c=>he.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:c.message}))})),e[20]=g,e[21]=l,e[22]=P):P=e[22];const ie=P,[we,_e]=A.useState(n),[se,Se]=A.useState(null),[me,ye]=A.useState(0);let M;e[23]===Symbol.for("react.memo_cache_sentinel")?(M=[],e[23]=M):M=e[23];const[S,ke]=A.useState(M),[ae,f]=A.useState(!1),$=A.useRef(null);we!==n&&(_e(n),Se(null),ye(Ye),ke([]));let O;e[24]!==h?(O=h??{},e[24]=h,e[25]=O):O=e[25];const le=O;let y;e[26]!==se?(y=se??{},e[26]=se,e[27]=y):y=e[27];let U;e[28]!==le||e[29]!==y?(U={...le,...y},e[28]=le,e[29]=y,e[30]=U):U=e[30];const ne=U;let V;e[31]!==n||e[32]!==u||e[33]!==te?(V=i=>{const a=i;Se(a),te(n,{...a,__resolveType:u})},e[31]=n,e[32]=u,e[33]=te,e[34]=V):V=e[34];const pe=V;let z;e[35]===Symbol.for("react.memo_cache_sentinel")?(z=i=>{ke(i)},e[35]=z):z=e[35];const K=z;let L;e[36]!==d||e[37]!==oe||e[38]!==g||e[39]!==l?(L=async(i,a)=>{try{const{blockKey:c,data:x}=Qe(i,d),xe=await g.mutateAsync({blockKey:c,data:x});He(xe)||he.success(l("sandbox.appEditor.createdSection",{name:c})),a({__resolveType:c}),oe()}catch(c){const x=c,xe=x instanceof Error?x.message:l("sandbox.appEditor.failedAddSection");throw he.error(xe),x}},e[36]=d,e[37]=oe,e[38]=g,e[39]=l,e[40]=L):L=e[40];const k=L;let q;e[41]!==f?(q=i=>{$.current=i.append,f(!0)},e[41]=f,e[42]=q):q=e[42];const ce=q;let G;e[43]!==k||e[44]!==f?(G=async i=>{const a=$.current;if(a)try{await k(i,c=>{a(c),f(!1),$.current=null})}catch{}},e[43]=k,e[44]=f,e[45]=G):G=e[45];const de=G,ue=S.length>0?[ge,...S]:[],Ee="flex h-full flex-col",Ae="flex h-12 shrink-0 items-center justify-between border-b px-6",fe=ue.length>0?s.jsx("nav",{"aria-label":l("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:ue.map((i,a)=>{const c=a===ue.length-1,x=ze(i);return s.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[a>0&&s.jsx(Ne,{className:"size-3 shrink-0 text-muted-foreground/60"}),s.jsx("button",{type:"button",onClick:()=>{K(a===0?[]:Le(S,a)),ye(Xe)},title:x,className:Re("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",c?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:x})]},`${x}-${a}`)})}):s.jsx("span",{className:"text-sm font-medium",children:ge});let j;e[46]!==re?(j=s.jsx(De,{isPending:re,isError:!1}),e[46]=re,e[47]=j):j=e[47];let B;e[48]!==fe||e[49]!==j?(B=s.jsxs("div",{className:Ae,children:[fe,j]}),e[48]=fe,e[49]=j,e[50]=B):B=e[50];let w;e[51]!==n||e[52]!==r||e[53]!==S||e[54]!==d||e[55]!==ne||e[56]!==me||e[57]!==k||e[58]!==K||e[59]!==pe||e[60]!==ce||e[61]!==ee||e[62]!==p||e[63]!==m||e[64]!==Q||e[65]!==u||e[66]!==ie||e[67]!==v||e[68]!==W||e[69]!==b||e[70]!==l||e[71]!==Y||e[72]!==o?(w=ee?s.jsx(qe,{schema:v,value:ne,onChange:pe,persistDefaults:Q,basePath:"",breadcrumbPath:S,onBreadcrumbChange:K,decofile:d,meta:p,onSaveReferencedBlock:ie,previewBaseUrl:b,onAddSectionItem:k,onRequestAddSection:ce,sandbox:{orgSlug:m,virtualMcpId:o,branch:r,threadId:Y}},`${n}:${me}`):W?s.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[s.jsx(Te,{className:"size-4"}),l("sandbox.appEditor.loadingSchema")]}):s.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:l($e(p,u)?"sandbox.appEditor.noEditableSchema":"sandbox.appEditor.schemaAwaitsBuild")}),e[51]=n,e[52]=r,e[53]=S,e[54]=d,e[55]=ne,e[56]=me,e[57]=k,e[58]=K,e[59]=pe,e[60]=ce,e[61]=ee,e[62]=p,e[63]=m,e[64]=Q,e[65]=u,e[66]=ie,e[67]=v,e[68]=W,e[69]=b,e[70]=l,e[71]=Y,e[72]=o,e[73]=w):w=e[73];let _;e[74]!==Z||e[75]!==w?(_=s.jsx(Fe,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:s.jsx("div",{className:"px-6 py-6",children:s.jsxs("div",{className:"mx-auto max-w-xl",children:[Z,w]})})}),e[74]=Z,e[75]=w,e[76]=_):_=e[76];let E;e[77]!==ae||e[78]!==d||e[79]!==de||e[80]!==p||e[81]!==b||e[82]!==f?(E=b&&s.jsx(Pe,{open:ae,onOpenChange:i=>{f(i),i||($.current=null)},meta:p,decofile:d,previewBaseUrl:b,onSelect:i=>{de(i)}}),e[77]=ae,e[78]=d,e[79]=de,e[80]=p,e[81]=b,e[82]=f,e[83]=E):E=e[83];let H;return e[84]!==B||e[85]!==_||e[86]!==E?(H=s.jsxs("div",{className:Ee,children:[B,_,E]}),e[84]=B,e[85]=_,e[86]=E,e[87]=H):H=e[87],H}function Xe(t){return t+1}function Ye(t){return t+1}export{Lr as AppEditor};
@@ -1 +1 @@
1
- import{c as u,a4 as d,e as g,ap as m,K as I,q as O}from"./index-LISCRMKT.js";import{u as $}from"./useInfiniteQuery-ChletbBT.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
1
+ import{c as u,a4 as d,e as g,ap as m,K as I,q as O}from"./index-Cw6ilRLN.js";import{u as $}from"./useInfiniteQuery-qZeYk4so.js";function T(e){const t=u.c(17),{org:s}=d(),c=m();let i,n,o,l;t[0]!==s.id||t[1]!==e.configId||t[2]!==e.imageOnly||t[3]!==e.search?(n=e.search?.trim()||void 0,i=e.imageOnly??!1,l=$,o=I.filePickerObjects(s.id,e.configId,n,i),t[0]=s.id,t[1]=e.configId,t[2]=e.imageOnly,t[3]=e.search,t[4]=i,t[5]=n,t[6]=o,t[7]=l):(i=t[4],n=t[5],o=t[6],l=t[7]);const r=e.enabled!==!1&&!!e.configId;let a;t[8]!==i||t[9]!==e.configId||t[10]!==n||t[11]!==c?(a=async y=>{const{pageParam:p}=y;return await c.call("FILE_OBJECTS_LIST",{configId:e.configId,cursor:p??void 0,search:n,imageOnly:i||void 0})},t[8]=i,t[9]=e.configId,t[10]=n,t[11]=c,t[12]=a):a=t[12];let f;return t[13]!==o||t[14]!==r||t[15]!==a?(f={queryKey:o,enabled:r,staleTime:3e4,initialPageParam:null,queryFn:a,getNextPageParam:h},t[13]=o,t[14]=r,t[15]=a,t[16]=f):f=t[16],l(f)}function h(e){return e.nextCursor??void 0}function E(){const e=u.c(2),{org:t}=d();let s;return e[0]!==t?(s={mutationFn:async c=>{const i=c.file.type||"application/octet-stream",n=await fetch(`/api/${encodeURIComponent(t.slug)}/file-configs/${encodeURIComponent(c.configId)}/upload?filename=${encodeURIComponent(c.file.name)}`,{method:"POST",headers:{"Content-Type":i},body:c.file});if(!n.ok){const o=await n.text().catch(x);let l=`${n.status} ${n.statusText}`;try{const r=JSON.parse(o);r.message&&(l=r.message)}catch{o&&(l=o.slice(0,200))}throw new Error(`Upload failed: ${l}`)}return await n.json()}},e[0]=t,e[1]=s):s=e[1],g(s)}function x(){return""}function F(){const e=u.c(8),{org:t}=d(),s=m(),c=O();let i;e[0]!==s?(i=l=>s.call("FILE_OBJECT_DELETE",l),e[0]=s,e[1]=i):i=e[1];let n;e[2]!==t||e[3]!==c?(n=(l,r)=>{c.invalidateQueries({queryKey:I.filePickerObjectsByConfig(t.id,r.configId)})},e[2]=t,e[3]=c,e[4]=n):n=e[4];let o;return e[5]!==i||e[6]!==n?(o={mutationFn:i,onSuccess:n},e[5]=i,e[6]=n,e[7]=o):o=e[7],g(o)}function w(e){return/\.(png|jpe?g|gif|webp|svg|avif|bmp)$/i.test(e)}function S(e){const t=e.lastIndexOf(".");return t<0||t===e.length-1?"file":e.slice(t+1).toLowerCase()}function v(e){const t=e.split("/");return t[t.length-1]??e}function _(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{E as a,v as b,F as c,S as e,_ as f,w as i,T as u};
@@ -1 +1 @@
1
- import{c9 as v,ca as $,cb as W,cc as H,cd as D,ce as y,cf as V,cg as x,ch as L,ci as j,cj as q,ck as N,cl as B,cm as Z,cn as F}from"./index-LISCRMKT.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof v||n instanceof $)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return j.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return q.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
1
+ import{c9 as v,ca as $,cb as W,cc as H,cd as D,ce as y,cf as V,cg as x,ch as L,ci as j,cj as q,ck as N,cl as B,cm as Z,cn as F}from"./index-Cw6ilRLN.js";function G(e){const t=typeof e=="string"?new URL(e):new URL(e.href);return t.hash="",t}function J({requestedResource:e,configuredResource:t}){const n=typeof e=="string"?new URL(e):new URL(e.href),r=typeof t=="string"?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length<r.pathname.length)return!1;const a=n.pathname.endsWith("/")?n.pathname:n.pathname+"/",i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/";return a.startsWith(i)}class pe extends Error{constructor(t){super(t??"Unauthorized")}}function Y(e){return["client_secret_basic","client_secret_post","none"].includes(e)}const p="code",_="S256";function K(e,t){const n=e.client_secret!==void 0;return"token_endpoint_auth_method"in e&&e.token_endpoint_auth_method&&Y(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?"client_secret_basic":"none":n&&t.includes("client_secret_basic")?"client_secret_basic":n&&t.includes("client_secret_post")?"client_secret_post":t.includes("none")?"none":n?"client_secret_post":"none"}function Q(e,t,n,r){const{client_id:a,client_secret:i}=t;switch(e){case"client_secret_basic":X(a,i,n);return;case"client_secret_post":ee(a,i,r);return;case"none":te(a,r);return;default:throw new Error(`Unsupported client authentication method: ${e}`)}}function X(e,t,n){if(!t)throw new Error("client_secret_basic authentication requires a client_secret");const r=btoa(`${e}:${t}`);n.set("Authorization",`Basic ${r}`)}function ee(e,t,n){n.set("client_id",e),t&&n.set("client_secret",t)}function te(e,t){t.set("client_id",e)}async function M(e){const t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{const r=B.parse(JSON.parse(n)),{error:a,error_description:i,error_uri:s}=r,o=Z[a]||y;return new o(i||"",s)}catch(r){const a=`${t?`HTTP ${t}: `:""}Invalid OAuth error response: ${r}. Raw body: ${n}`;return new y(a)}}async function _e(e,t){try{return await U(e,t)}catch(n){if(n instanceof v||n instanceof $)return await e.invalidateCredentials?.("all"),await U(e,t);if(n instanceof W)return await e.invalidateCredentials?.("tokens"),await U(e,t);throw n}}async function U(e,{serverUrl:t,authorizationCode:n,scope:r,resourceMetadataUrl:a,fetchFn:i}){const s=await e.discoveryState?.();let o,c,u,h=a;if(!h&&s?.resourceMetadataUrl&&(h=new URL(s.resourceMetadataUrl)),s?.authorizationServerUrl){if(c=s.authorizationServerUrl,o=s.resourceMetadata,u=s.authorizationServerMetadata??await P(c,{fetchFn:i}),!o)try{o=await T(t,{resourceMetadataUrl:h},i)}catch{}(u!==s.authorizationServerMetadata||o!==s.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}else{const l=await ce(t,{resourceMetadataUrl:h,fetchFn:i});c=l.authorizationServerUrl,u=l.authorizationServerMetadata,o=l.resourceMetadata,await e.saveDiscoveryState?.({authorizationServerUrl:String(c),resourceMetadataUrl:h?.toString(),resourceMetadata:o,authorizationServerMetadata:u})}const f=await re(t,e,o),A=r||o?.scopes_supported?.join(" ")||e.clientMetadata.scope;let d=await Promise.resolve(e.clientInformation());if(!d){if(n!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");const l=u?.client_id_metadata_document_supported===!0,w=e.clientMetadataUrl;if(w&&!ne(w))throw new H(`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${w}`);if(l&&w)d={client_id:w},await e.saveClientInformation?.(d);else{if(!e.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");const S=await de(c,{metadata:u,clientMetadata:e.clientMetadata,scope:A,fetchFn:i});await e.saveClientInformation(S),d=S}}const C=!e.redirectUrl;if(n!==void 0||C){const l=await he(e,c,{metadata:u,resource:f,authorizationCode:n,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}const k=await e.tokens();if(k?.refresh_token)try{const l=await le(c,{metadata:u,clientInformation:d,refreshToken:k.refresh_token,resource:f,addClientAuthentication:e.addClientAuthentication,fetchFn:i});return await e.saveTokens(l),"AUTHORIZED"}catch(l){if(!(!(l instanceof D)||l instanceof y))throw l}const z=e.state?await e.state():void 0,{authorizationUrl:b,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:z,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(b),"REDIRECT"}function ne(e){if(!e)return!1;try{const t=new URL(e);return t.protocol==="https:"&&t.pathname!=="/"}catch{return!1}}async function re(e,t,n){const r=G(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!J({requestedResource:r,configuredResource:n.resource}))throw new Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}function Ue(e){const t=e.headers.get("WWW-Authenticate");if(!t)return{};const[n,r]=t.split(" ");if(n.toLowerCase()!=="bearer"||!r)return{};const a=m(e,"resource_metadata")||void 0;let i;if(a)try{i=new URL(a)}catch{}const s=m(e,"scope")||void 0,o=m(e,"error")||void 0;return{resourceMetadataUrl:i,scope:s,error:o}}function m(e,t){const n=e.headers.get("WWW-Authenticate");if(!n)return null;const r=new RegExp(`${t}=(?:"([^"]+)"|([^\\s,]+))`),a=n.match(r);return a?a[1]||a[2]:null}async function T(e,t,n=fetch){const r=await ie(e,"oauth-protected-resource",n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.body?.cancel(),new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!r.ok)throw await r.body?.cancel(),new Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return j.parse(await r.json())}async function R(e,t,n=fetch){try{return await n(e,{headers:t})}catch(r){if(r instanceof TypeError)return t?R(e,void 0,n):void 0;throw r}}function ae(e,t="",n={}){return t.endsWith("/")&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function E(e,t,n=fetch){return await R(e,{"MCP-Protocol-Version":t},n)}function oe(e,t){return!e||e.status>=400&&e.status<500&&t!=="/"}async function ie(e,t,n,r){const a=new URL(e),i=r?.protocolVersion??L;let s;if(r?.metadataUrl)s=new URL(r.metadataUrl);else{const c=ae(t,a.pathname);s=new URL(c,r?.metadataServerUrl??a),s.search=a.search}let o=await E(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await E(c,i,n)}return o}function se(e){const t=typeof e=="string"?new URL(e):e,n=t.pathname!=="/",r=[];if(!n)return r.push({url:new URL("/.well-known/oauth-authorization-server",t.origin),type:"oauth"}),r.push({url:new URL("/.well-known/openid-configuration",t.origin),type:"oidc"}),r;let a=t.pathname;return a.endsWith("/")&&(a=a.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${a}`,t.origin),type:"oauth"}),r.push({url:new URL(`/.well-known/openid-configuration${a}`,t.origin),type:"oidc"}),r.push({url:new URL(`${a}/.well-known/openid-configuration`,t.origin),type:"oidc"}),r}async function P(e,{fetchFn:t=fetch,protocolVersion:n=L}={}){const r={"MCP-Protocol-Version":n,Accept:"application/json"},a=se(e);for(const{url:i,type:s}of a){const o=await R(i,r,t);if(o){if(!o.ok){if(await o.body?.cancel(),o.status>=400&&o.status<500)continue;throw new Error(`HTTP ${o.status} trying to load ${s==="oauth"?"OAuth":"OpenID provider"} metadata from ${i}`)}return s==="oauth"?V.parse(await o.json()):x.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await T(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||(r=String(new URL("/",e)));const a=await P(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:a,resourceMetadata:n}}async function ue(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:a,state:i,resource:s}){let o;if(t){if(o=new URL(t.authorization_endpoint),!t.response_types_supported.includes(p))throw new Error(`Incompatible auth server: does not support response type ${p}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(_))throw new Error(`Incompatible auth server: does not support code challenge method ${_}`)}else o=new URL("/authorize",e);const c=await N(),u=c.code_verifier,h=c.code_challenge;return o.searchParams.set("response_type",p),o.searchParams.set("client_id",n.client_id),o.searchParams.set("code_challenge",h),o.searchParams.set("code_challenge_method",_),o.searchParams.set("redirect_uri",String(r)),i&&o.searchParams.set("state",i),a&&o.searchParams.set("scope",a),a?.includes("offline_access")&&o.searchParams.append("prompt","consent"),s&&o.searchParams.set("resource",s.href),{authorizationUrl:o,codeVerifier:u}}function O(e,t,n){return new URLSearchParams({grant_type:"authorization_code",code:e,code_verifier:t,redirect_uri:String(n)})}async function g(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:a,resource:i,fetchFn:s}){const o=t?.token_endpoint?new URL(t.token_endpoint):new URL("/token",e),c=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"});if(i&&n.set("resource",i.href),a)await a(c,n,o,t);else if(r){const h=t?.token_endpoint_auth_methods_supported??[],f=K(r,h);Q(f,r,c,n)}const u=await(s??fetch)(o,{method:"POST",headers:c,body:n});if(!u.ok)throw await M(u);return F.parse(await u.json())}async function me(e,{metadata:t,clientInformation:n,authorizationCode:r,codeVerifier:a,redirectUri:i,resource:s,addClientAuthentication:o,fetchFn:c}){const u=O(r,a,i);return g(e,{metadata:t,tokenRequestParams:u,clientInformation:n,addClientAuthentication:o,resource:s,fetchFn:c})}async function le(e,{metadata:t,clientInformation:n,refreshToken:r,resource:a,addClientAuthentication:i,fetchFn:s}){const o=new URLSearchParams({grant_type:"refresh_token",refresh_token:r}),c=await g(e,{metadata:t,tokenRequestParams:o,clientInformation:n,addClientAuthentication:i,resource:a,fetchFn:s});return{refresh_token:r,...c}}async function he(e,t,{metadata:n,resource:r,authorizationCode:a,fetchFn:i}={}){const s=e.clientMetadata.scope;let o;if(e.prepareTokenRequest&&(o=await e.prepareTokenRequest(s)),!o){if(!a)throw new Error("Either provider.prepareTokenRequest() or authorizationCode is required");if(!e.redirectUrl)throw new Error("redirectUrl is required for authorization_code flow");const u=await e.codeVerifier();o=O(a,u,e.redirectUrl)}const c=await e.clientInformation();return g(t,{metadata:n,tokenRequestParams:o,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:i})}async function de(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:a}){let i;if(t){if(!t.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(t.registration_endpoint)}else i=new URL("/register",e);const s=await(a??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...n,...r!==void 0?{scope:r}:{}})});if(!s.ok)throw await M(s);return q.parse(await s.json())}export{pe as U,P as a,_e as b,Ue as c,T as d,me as e};
@@ -1 +1 @@
1
- import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-LISCRMKT.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
1
+ import{c as r,f as l,j as t,S as m,A as o,g as f,N as x}from"./index-Cw6ilRLN.js";function h(){const e=r.c(1),a=window.location.pathname+window.location.search;let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(x,{to:"/login",search:{next:a},replace:!0}),e[0]=n):n=e[0],n}function u(){const e=r.c(5);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/auth/$pathname"},e[0]=a):a=e[0];const{pathname:n}=l(a);if(n==="accept-invitation"){let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(m,{children:t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:"accept-invitation"})})}),e[1]=s):s=e[1];let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsxs(t.Fragment,{children:[s,t.jsx(f,{children:t.jsx(h,{})})]}),e[2]=i):i=e[2],i}let c;return e[3]!==n?(c=t.jsx("main",{className:"container mx-auto flex grow flex-col items-center justify-center gap-3 self-center p-4 md:p-6",children:t.jsx(o,{pathname:n})}),e[3]=n,e[4]=c):c=e[4],c}export{u as default};
@@ -1 +1 @@
1
- import{a as $,a3 as Ne,r as b,e as ae,C as W,j as t,l as x,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-LISCRMKT.js";import{e as qe}from"./backoff-CrEUbyZT.js";import{d as De}from"./delay-CnY5UFtP.js";class Pe extends Error{constructor(e,o){super(`Retrying exceeded the maxAttempts (${o}).`),this.name="RetryError",this.cause=e}}async function ze(i,e){const{multiplier:o=2,maxTimeout:l=6e4,maxAttempts:w=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(w)||w<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${w}`);if(!Number.isFinite(o)||o<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${o}`);if(Number.isNaN(l)||l<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${l}`);if(Number.isNaN(g)||g<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${g}`);if(g>l)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${g}', 'maxTimeout=${l}'`);if(Number.isNaN(r)||r<0||r>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${r}`);let P=0;for(;;){d?.throwIfAborted();try{return await i()}catch(A){if(!u(A))throw A;if(P+1>=w)throw new Pe(A,w);const O=qe(l,g,P,o,r);await De(O,d?{signal:d}:void 0)}P++}}const Ae={submitEmailPassword:({mode:i,email:e,password:o,name:l})=>i==="sign_up"?$.signUp.email({email:e,password:o,name:l||""}):$.signIn.email({email:e,password:o}),requestPasswordReset:({email:i,redirectTo:e})=>$.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>$.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>$.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>$.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>$.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ie="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Be={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ve({redirectUrl:i,callbackUrl:e="/",title:o,subtitle:l,brand:w,copy:g,variant:r="default",allowedSocialProviders:u,allowPassword:d=!0,onAuthEvent:P,actions:A}){const{emailAndPassword:O,resetPassword:S,emailOtp:E,socialProviders:F}=Ne(),j={...Ae,...A},h=s=>{try{P?.(s)}catch{}},p=r==="compact",Z=u?F.providers.filter(s=>u.includes(s.name)):F.providers,ee=F.enabled&&Z.length>0,ne=O.enabled&&(d||!E.enabled&&!ee),te=F.enabled&&F.providers.length>0&&!ee&&!E.enabled&&!ne?F.providers:Z,I=F.enabled&&te.length>0,C=O.enabled&&(d||!E.enabled&&!I),[c,N]=b.useState(""),[_,f]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[M,de]=b.useState(!1),[ce,_e]=b.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[y,U]=b.useState(""),[he,pe]=b.useState(!1),[ke,me]=b.useState(null),a={...Be,...g},Y=b.useId(),q=`${Y}-email`,D=`${Y}-email-error`,fe=`${Y}-name`,xe=`${Y}-password`,be=`${Y}-otp`,v=ce==="signUp",R=ce==="forgotPassword",k=ce==="emailOtp",J=ae({mutationFn:async({email:s,password:n,name:L})=>{try{const H=await j.submitEmailPassword({mode:v?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(v?a.signUpFailed:a.signInFailed));return H}catch(H){throw H instanceof Error?H:new Error(a.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:v?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:v?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),W(v?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const n=await j.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||a.resetEmailFailed);return n},onSuccess:()=>{W("password_reset_requested"),pe(!0)},onError:s=>{W("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),z=ae({mutationFn:async({email:s})=>{const n=await j.sendOtp({email:s});if(n.error)throw new Error(n.error.message||a.otpSendFailed);return n},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),W("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),B=ae({mutationFn:async({email:s,otp:n})=>{const L=await j.submitOtp({email:s,otp:n});if(L.error)throw new Error(L.error.message||a.invalidCode);return L},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),se=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),ue=()=>{c.trim()&&!se(c)&&U(a.invalidEmail)},Le=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}J.mutate({email:c,password:_,name:re})},Oe=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail);return}K.mutate({email:c})},Re=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}z.mutate({email:c})},Te=s=>{s.preventDefault(),B.mutate({email:c,otp:oe})},V=s=>n=>{s(n.target.value),we&&J.reset(),ve&&K.reset(),ye&&(z.reset(),B.reset()),s===N&&y&&U("")},Q=s=>{_e(s),ge(""),le(""),de(!1),U(""),pe(!1),me(null),J.reset(),K.reset(),z.reset(),B.reset()},m=J.isPending||K.isPending||z.isPending||B.isPending,we=J.error,ve=K.error,ye=z.error||B.error,T=v?c.trim()&&_.trim()&&re.trim():R?c.trim():k?M?oe.trim():c.trim():c.trim()&&_.trim(),$e=s=>{if(!s)return null;const n=s.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?a.invalidEmailOrPassword:n.includes("already exists")||n.includes("409")?a.accountExists:n.includes("network")||n.includes("fetch")?a.networkError:n.includes("rate limit")||n.includes("429")?a.tooManyAttempts:n.includes("invalid")&&n.includes("otp")?a.invalidOrExpiredCode:s.message||a.genericError},Ee=we||ve||ye||ke,We=async s=>{h({type:"started",method:"social",provider:s}),me(null);try{const n=await j.socialSignIn({provider:s,callbackURL:i??e});if(n.error)throw new Error(n.error.message||a.authenticationFailed)}catch(n){const L=n instanceof Error?n.message:String(n);h({type:"failed",method:"social",provider:s,stage:"redirect",error:L}),W("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},Me=R?a.resetPasswordTitle:k&&M?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&M?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:x("grid w-full",p?"gap-5":"gap-10"),children:[w??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:x("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:Me}),Se&&t.jsx("p",{className:x("text-muted-foreground",p?"text-sm leading-5":"text-base leading-6"),children:Se})]}),Ee&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:$e(Ee)}),he&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:a.resetEmailSent}),!R&&!(k&&M)&&I&&t.jsx("div",{className:"grid gap-2",children:te.map(s=>t.jsxs(X,{type:"button",variant:"outline",size:p?"lg":"xl",disabled:m,onClick:()=>{We(s.name)},className:"w-full gap-3",children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:x("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),a.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!R&&!(k&&M)&&I&&(C||E.enabled)&&t.jsxs("div",{className:x("flex items-center gap-2.5",p?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:x("text-muted-foreground",p?"text-sm":"text-base"),children:a.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),k&&E.enabled&&t.jsx(t.Fragment,{children:M?t.jsxs("form",{onSubmit:Te,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:be,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.verificationCodeLabel}),t.jsx(G,{id:be,type:"text",placeholder:a.enterCodePlaceholder,value:oe,onChange:V(le),required:!0,disabled:m,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.verifying:a.verify}),t.jsx("button",{type:"button",onClick:()=>{de(!1),le(""),z.reset(),B.reset()},disabled:m,className:x("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",p&&"sm:col-span-2"),children:a.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:q,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:a.emailPlaceholder,value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive",children:y})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.sending:a.sendCode})]})}),R&&C&&!he&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsx(X,{type:"submit",disabled:m||!T,className:"w-full font-semibold",size:"xl",children:m?a.sending:a.sendResetLink})]}),!R&&!k&&C&&t.jsxs("form",{onSubmit:Le,className:"grid gap-5",children:[v&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:fe,className:"block text-sm font-medium text-foreground mb-2",children:a.nameLabel}),t.jsx(G,{id:fe,type:"text",placeholder:a.namePlaceholder,value:re,onChange:V(ge),required:!0,disabled:m,autoComplete:"name",className:"h-11"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:xe,className:"block text-sm font-medium text-foreground",children:a.passwordLabel}),!v&&S.enabled&&t.jsx("button",{type:"button",onClick:()=>Q("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:a.forgotPassword})]}),t.jsx(G,{id:xe,type:"password",placeholder:"••••••••",value:_,onChange:V(f),required:!0,disabled:m,autoComplete:v?"new-password":"current-password",className:"h-11"})]}),t.jsx("div",{className:x("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",T?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:x("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:x("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?v?a.creatingAccount:a.signingIn:a.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:R?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.backToSignIn}):k&&C?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.signInWithPassword}):!k&&C?t.jsxs(t.Fragment,{children:[v?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(v?"signIn":"signUp"),disabled:m,className:ie,children:v?a.signIn:a.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>Q("emailOtp"),disabled:m,className:ie,children:a.signInWithEmailCode})]})]}):null})]})}class je{constructor(e){this.response=e}response}function He(i){return i.startsWith("/")&&!i.startsWith("//")&&!i.startsWith("/\\")?i:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,w]=b.useState(null),g=b.useEffectEvent(r=>{try{e?.(r)}catch{}});return b.useEffect(()=>{let r=!1;return(async()=>{g({type:"started",method:"local"});try{let u;try{u=await ze(async()=>{const d=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(d.status>=500)throw new je(d);return d},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(d){if(d instanceof Pe&&d.cause instanceof je)u=d.cause.response;else throw d}if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d?.error||o("common.authEntry.autoLoginFailed"))}r||(g({type:"succeeded",method:"local"}),window.location.href=He(i))}catch(u){r||(g({type:"failed",method:"local",stage:"authenticate",error:u instanceof Error?u.message:String(u)}),w(u instanceof Error?u.message:o("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),l?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:o("common.authEntry.autoLoginFailedWithError",{error:l})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:o("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function Fe(){const i=Ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Ue,{size:"lg",label:"Signing in"})}),i[0]=e):e=i[0],e}function Ye({callbackURL:i,providerId:e,ssoSignIn:o,onAuthEvent:l}){const w=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{w({type:"started",method:"sso",provider:e});try{const r=await g({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){w({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(Fe,{})}function Xe(i){const e=Ie.c(25),{callbackUrl:o,redirectUrl:l,allowAutoLogin:w,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=w===void 0?!0:w,j=Ce(),{sso:h,emailAndPassword:p,magicLink:Z,emailOtp:ee,socialProviders:ne,localMode:te}=Ne(),I=l||o;let C;e[0]!==E?(C=E?{onAuthenticated:E}:void 0,e[0]=E,e[1]=C):C=e[1];const c=C;if(te&&F){let f;return e[2]!==S||e[3]!==I?(f=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=f):f=e[4],f}if(h.enabled){let f;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(f=t.jsx(Ye,{callbackURL:I,providerId:h.providerId,ssoSignIn:Ae.ssoSignIn,onAuthEvent:S}),e[5]=S,e[6]=I,e[7]=h.providerId,e[8]=f):f=e[8],f}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let f;return e[9]!==O||e[10]!==A||e[11]!==u||e[12]!==o||e[13]!==c||e[14]!==d||e[15]!==S||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==P?(f=t.jsx(Ve,{redirectUrl:l,callbackUrl:o,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,actions:c}),e[9]=O,e[10]=A,e[11]=u,e[12]=o,e[13]=c,e[14]=d,e[15]=S,e[16]=l,e[17]=r,e[18]=g,e[19]=P,e[20]=f):f=e[20],f}let N;e[21]!==j?(N=j("common.authEntry.noLoginOptions"),e[21]=j,e[22]=N):N=e[22];let _;return e[23]!==N?(_=t.jsx("div",{children:N}),e[23]=N,e[24]=_):_=e[24],_}export{Fe as A,Xe as a};
1
+ import{a as $,a3 as Ne,r as b,e as ae,C as W,j as t,l as x,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-Cw6ilRLN.js";import{e as qe}from"./backoff-CrEUbyZT.js";import{d as De}from"./delay-CnY5UFtP.js";class Pe extends Error{constructor(e,o){super(`Retrying exceeded the maxAttempts (${o}).`),this.name="RetryError",this.cause=e}}async function ze(i,e){const{multiplier:o=2,maxTimeout:l=6e4,maxAttempts:w=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(w)||w<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${w}`);if(!Number.isFinite(o)||o<1)throw new RangeError(`Cannot retry as 'multiplier' must be a finite number >= 1: current value is ${o}`);if(Number.isNaN(l)||l<=0)throw new RangeError(`Cannot retry as 'maxTimeout' must be a positive number: current value is ${l}`);if(Number.isNaN(g)||g<0)throw new RangeError(`Cannot retry as 'minTimeout' must be >= 0: current value is ${g}`);if(g>l)throw new RangeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${g}', 'maxTimeout=${l}'`);if(Number.isNaN(r)||r<0||r>1)throw new RangeError(`Cannot retry as 'jitter' must be between 0 and 1: current value is ${r}`);let P=0;for(;;){d?.throwIfAborted();try{return await i()}catch(A){if(!u(A))throw A;if(P+1>=w)throw new Pe(A,w);const O=qe(l,g,P,o,r);await De(O,d?{signal:d}:void 0)}P++}}const Ae={submitEmailPassword:({mode:i,email:e,password:o,name:l})=>i==="sign_up"?$.signUp.email({email:e,password:o,name:l||""}):$.signIn.email({email:e,password:o}),requestPasswordReset:({email:i,redirectTo:e})=>$.requestPasswordReset({email:i,redirectTo:e}),sendOtp:({email:i})=>$.emailOtp.sendVerificationOtp({email:i,type:"sign-in"}),submitOtp:({email:i,otp:e})=>$.signIn.emailOtp({email:i,otp:e}),socialSignIn:({provider:i,callbackURL:e})=>$.signIn.social({provider:i,callbackURL:e}),ssoSignIn:({providerId:i,callbackURL:e})=>$.signIn.sso({providerId:i,callbackURL:e}),onAuthenticated:i=>{window.location.href=i}},ie="font-medium text-[#8CAA25] hover:underline disabled:opacity-50",Be={signUpFailed:"Sign up failed",signInFailed:"Sign in failed",authenticationFailed:"Authentication failed",resetEmailFailed:"Failed to send reset email",otpSendFailed:"Failed to send code",invalidCode:"Invalid code",invalidEmail:"Invalid email address",invalidEmailOrPassword:"Invalid email or password. Please try again.",accountExists:"An account with this email already exists. Try signing in instead.",networkError:"Network error. Please check your connection and try again.",tooManyAttempts:"Too many attempts. Please wait a moment and try again.",invalidOrExpiredCode:"Invalid or expired code. Please try again.",genericError:"An error occurred. Please try again.",resetPasswordTitle:"Reset your password",verificationCodeTitle:"Enter verification code",welcomeTitle:"Welcome to deco",resetPasswordSubtitle:"We'll send you a reset link",codeSentTo:i=>`Code sent to ${i}`,defaultSubtitle:"Sign in or create a new account",resetEmailSent:"Check your email for a password reset link.",continueWith:i=>`Continue with ${i}`,divider:"or",emailLabel:"Email",emailPlaceholder:"Email address",sending:"Sending...",sendCode:"Send code",verificationCodeLabel:"Verification code",enterCodePlaceholder:"Enter code",verifying:"Verifying...",verify:"Verify",useDifferentEmail:"Use a different email",sendResetLink:"Send reset link",nameLabel:"Name",namePlaceholder:"Your name",passwordLabel:"Password",forgotPassword:"Forgot password?",creatingAccount:"Creating account...",signingIn:"Signing in...",continue:"Continue",backToSignIn:"Back to sign in",signInWithPassword:"Sign in with password instead",alreadyHaveAccount:"Already have an account? ",dontHaveAccount:"Don't have an account? ",signIn:"Sign in",signUp:"Sign up",signInWithEmailCode:"Sign in with email code"};function Ve({redirectUrl:i,callbackUrl:e="/",title:o,subtitle:l,brand:w,copy:g,variant:r="default",allowedSocialProviders:u,allowPassword:d=!0,onAuthEvent:P,actions:A}){const{emailAndPassword:O,resetPassword:S,emailOtp:E,socialProviders:F}=Ne(),j={...Ae,...A},h=s=>{try{P?.(s)}catch{}},p=r==="compact",Z=u?F.providers.filter(s=>u.includes(s.name)):F.providers,ee=F.enabled&&Z.length>0,ne=O.enabled&&(d||!E.enabled&&!ee),te=F.enabled&&F.providers.length>0&&!ee&&!E.enabled&&!ne?F.providers:Z,I=F.enabled&&te.length>0,C=O.enabled&&(d||!E.enabled&&!I),[c,N]=b.useState(""),[_,f]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[M,de]=b.useState(!1),[ce,_e]=b.useState(()=>E.enabled?"emailOtp":globalThis.localStorage?.getItem("hasLoggedIn")!=="true"?"signUp":"signIn"),[y,U]=b.useState(""),[he,pe]=b.useState(!1),[ke,me]=b.useState(null),a={...Be,...g},Y=b.useId(),q=`${Y}-email`,D=`${Y}-email-error`,fe=`${Y}-name`,xe=`${Y}-password`,be=`${Y}-otp`,v=ce==="signUp",R=ce==="forgotPassword",k=ce==="emailOtp",J=ae({mutationFn:async({email:s,password:n,name:L})=>{try{const H=await j.submitEmailPassword({mode:v?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(v?a.signUpFailed:a.signInFailed));return H}catch(H){throw H instanceof Error?H:new Error(a.authenticationFailed)}},onMutate:()=>{h({type:"started",method:"email_password",mode:v?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:v?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),W(v?"user_signup_failed":"user_signin_failed",{error:s instanceof Error?s.message:String(s)})}}),K=ae({mutationFn:async({email:s})=>{const n=await j.requestPasswordReset({email:s,redirectTo:"/reset-password"});if(n.error)throw new Error(n.error.message||a.resetEmailFailed);return n},onSuccess:()=>{W("password_reset_requested"),pe(!0)},onError:s=>{W("password_reset_request_failed",{error:s instanceof Error?s.message:String(s)})}}),z=ae({mutationFn:async({email:s})=>{const n=await j.sendOtp({email:s});if(n.error)throw new Error(n.error.message||a.otpSendFailed);return n},onMutate:()=>{h({type:"started",method:"email_otp"})},onSuccess:()=>{h({type:"otp_sent",method:"email_otp"}),W("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_send_failed",{error:s instanceof Error?s.message:String(s)})}}),B=ae({mutationFn:async({email:s,otp:n})=>{const L=await j.submitOtp({email:s,otp:n});if(L.error)throw new Error(L.error.message||a.invalidCode);return L},onMutate:()=>{h({type:"otp_submitted",method:"email_otp"})},onSuccess:()=>{h({type:"succeeded",method:"email_otp"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_otp",stage:"verify_otp",error:s instanceof Error?s.message:String(s)}),W("email_otp_verify_failed",{error:s instanceof Error?s.message:String(s)})}}),se=s=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s),ue=()=>{c.trim()&&!se(c)&&U(a.invalidEmail)},Le=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_password",mode:v?"sign_up":"sign_in",stage:"validation",error:"invalid_email"});return}J.mutate({email:c,password:_,name:re})},Oe=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail);return}K.mutate({email:c})},Re=s=>{if(s.preventDefault(),!se(c)){U(a.invalidEmail),h({type:"failed",method:"email_otp",stage:"validation",error:"invalid_email"});return}z.mutate({email:c})},Te=s=>{s.preventDefault(),B.mutate({email:c,otp:oe})},V=s=>n=>{s(n.target.value),we&&J.reset(),ve&&K.reset(),ye&&(z.reset(),B.reset()),s===N&&y&&U("")},Q=s=>{_e(s),ge(""),le(""),de(!1),U(""),pe(!1),me(null),J.reset(),K.reset(),z.reset(),B.reset()},m=J.isPending||K.isPending||z.isPending||B.isPending,we=J.error,ve=K.error,ye=z.error||B.error,T=v?c.trim()&&_.trim()&&re.trim():R?c.trim():k?M?oe.trim():c.trim():c.trim()&&_.trim(),$e=s=>{if(!s)return null;const n=s.message.toLowerCase();return n.includes("unauthorized")||n.includes("401")?a.invalidEmailOrPassword:n.includes("already exists")||n.includes("409")?a.accountExists:n.includes("network")||n.includes("fetch")?a.networkError:n.includes("rate limit")||n.includes("429")?a.tooManyAttempts:n.includes("invalid")&&n.includes("otp")?a.invalidOrExpiredCode:s.message||a.genericError},Ee=we||ve||ye||ke,We=async s=>{h({type:"started",method:"social",provider:s}),me(null);try{const n=await j.socialSignIn({provider:s,callbackURL:i??e});if(n.error)throw new Error(n.error.message||a.authenticationFailed)}catch(n){const L=n instanceof Error?n.message:String(n);h({type:"failed",method:"social",provider:s,stage:"redirect",error:L}),W("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},Me=R?a.resetPasswordTitle:k&&M?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&M?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:x("grid w-full",p?"gap-5":"gap-10"),children:[w??t.jsxs("div",{children:[t.jsx("img",{src:"/logos/deco logo.svg",alt:"Deco",className:"h-12 w-12 dark:hidden"}),t.jsx("img",{src:"/logos/deco logo negative.svg",alt:"Deco",className:"h-12 w-12 hidden dark:block"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h1",{className:x("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:Me}),Se&&t.jsx("p",{className:x("text-muted-foreground",p?"text-sm leading-5":"text-base leading-6"),children:Se})]}),Ee&&t.jsx("div",{role:"alert",className:"rounded-xl bg-destructive/10 p-3 text-sm text-destructive text-center",children:$e(Ee)}),he&&t.jsx("div",{role:"status",className:"rounded-xl bg-success/10 p-3 text-sm text-success text-center",children:a.resetEmailSent}),!R&&!(k&&M)&&I&&t.jsx("div",{className:"grid gap-2",children:te.map(s=>t.jsxs(X,{type:"button",variant:"outline",size:p?"lg":"xl",disabled:m,onClick:()=>{We(s.name)},className:"w-full gap-3",children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:x("h-5 w-5",s.name==="github"&&"dark:invert"),"aria-hidden":"true"}),a.continueWith(s.name.charAt(0).toUpperCase()+s.name.slice(1))]},s.name))}),!R&&!(k&&M)&&I&&(C||E.enabled)&&t.jsxs("div",{className:x("flex items-center gap-2.5",p?"my-0":"-my-4"),children:[t.jsx("div",{className:"h-px flex-1 bg-border"}),t.jsx("span",{className:x("text-muted-foreground",p?"text-sm":"text-base"),children:a.divider}),t.jsx("div",{className:"h-px flex-1 bg-border"})]}),k&&E.enabled&&t.jsx(t.Fragment,{children:M?t.jsxs("form",{onSubmit:Te,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:be,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.verificationCodeLabel}),t.jsx(G,{id:be,type:"text",placeholder:a.enterCodePlaceholder,value:oe,onChange:V(le),required:!0,disabled:m,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",className:"h-11"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.verifying:a.verify}),t.jsx("button",{type:"button",onClick:()=>{de(!1),le(""),z.reset(),B.reset()},disabled:m,className:x("mt-1 text-sm text-muted-foreground transition-colors hover:text-foreground",p&&"sm:col-span-2"),children:a.useDifferentEmail})]}):t.jsxs("form",{onSubmit:Re,className:x("grid gap-2",p&&"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start"),children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx("label",{htmlFor:q,className:x("text-sm font-medium text-foreground",p&&"sr-only"),children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:a.emailPlaceholder,value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive",children:y})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:x(p?"sm:w-auto":"w-full"),children:m?a.sending:a.sendCode})]})}),R&&C&&!he&&t.jsxs("form",{onSubmit:Oe,className:"grid gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsx(X,{type:"submit",disabled:m||!T,className:"w-full font-semibold",size:"xl",children:m?a.sending:a.sendResetLink})]}),!R&&!k&&C&&t.jsxs("form",{onSubmit:Le,className:"grid gap-5",children:[v&&t.jsxs("div",{children:[t.jsx("label",{htmlFor:fe,className:"block text-sm font-medium text-foreground mb-2",children:a.nameLabel}),t.jsx(G,{id:fe,type:"text",placeholder:a.namePlaceholder,value:re,onChange:V(ge),required:!0,disabled:m,autoComplete:"name",className:"h-11"})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:q,className:"block text-sm font-medium text-foreground mb-2",children:a.emailLabel}),t.jsx(G,{id:q,type:"email",placeholder:"you@example.com",value:c,onChange:V(N),onBlur:ue,required:!0,disabled:m,autoComplete:"email","aria-invalid":!!y,"aria-describedby":y?D:void 0,className:"h-11"}),y&&t.jsx("p",{id:D,role:"alert",className:"text-xs text-destructive mt-1.5",children:y})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{htmlFor:xe,className:"block text-sm font-medium text-foreground",children:a.passwordLabel}),!v&&S.enabled&&t.jsx("button",{type:"button",onClick:()=>Q("forgotPassword"),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:a.forgotPassword})]}),t.jsx(G,{id:xe,type:"password",placeholder:"••••••••",value:_,onChange:V(f),required:!0,disabled:m,autoComplete:v?"new-password":"current-password",className:"h-11"})]}),t.jsx("div",{className:x("overflow-hidden transition-all duration-300 ease-[cubic-bezier(0.075,0.82,0.165,1)]",T?"max-h-[100px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2"),children:t.jsx("div",{className:x("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:x("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?v?a.creatingAccount:a.signingIn:a.continue})})})]}),t.jsx("div",{className:"text-sm text-muted-foreground",children:R?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.backToSignIn}):k&&C?t.jsx("button",{type:"button",onClick:()=>Q("signIn"),disabled:m,className:ie,children:a.signInWithPassword}):!k&&C?t.jsxs(t.Fragment,{children:[v?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(v?"signIn":"signUp"),disabled:m,className:ie,children:v?a.signIn:a.signUp}),E.enabled&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-2",children:"·"}),t.jsx("button",{type:"button",onClick:()=>Q("emailOtp"),disabled:m,className:ie,children:a.signInWithEmailCode})]})]}):null})]})}class je{constructor(e){this.response=e}response}function He(i){return i.startsWith("/")&&!i.startsWith("//")&&!i.startsWith("/\\")?i:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,w]=b.useState(null),g=b.useEffectEvent(r=>{try{e?.(r)}catch{}});return b.useEffect(()=>{let r=!1;return(async()=>{g({type:"started",method:"local"});try{let u;try{u=await ze(async()=>{const d=await fetch("/api/auth/custom/local-session",{method:"POST",credentials:"include"});if(d.status>=500)throw new je(d);return d},{maxAttempts:5,minTimeout:1e3,maxTimeout:1e4,multiplier:2,jitter:0})}catch(d){if(d instanceof Pe&&d.cause instanceof je)u=d.cause.response;else throw d}if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error(d?.error||o("common.authEntry.autoLoginFailed"))}r||(g({type:"succeeded",method:"local"}),window.location.href=He(i))}catch(u){r||(g({type:"failed",method:"local",stage:"authenticate",error:u instanceof Error?u.message:String(u)}),w(u instanceof Error?u.message:o("common.authEntry.autoLoginFailed")))}})(),()=>{r=!0}},[i]),l?t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive mb-2",children:o("common.authEntry.autoLoginFailedWithError",{error:l})}),t.jsx("p",{className:"text-muted-foreground text-sm",children:o("common.authEntry.tryRestartingServer")})]})}):t.jsx(Fe,{})}function Fe(){const i=Ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex min-h-screen items-center justify-center",children:t.jsx(Ue,{size:"lg",label:"Signing in"})}),i[0]=e):e=i[0],e}function Ye({callbackURL:i,providerId:e,ssoSignIn:o,onAuthEvent:l}){const w=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{w({type:"started",method:"sso",provider:e});try{const r=await g({providerId:e,callbackURL:i});if(r.error)throw new Error(r.error.message||"SSO redirect failed")}catch(r){w({type:"failed",method:"sso",provider:e,stage:"redirect",error:r instanceof Error?r.message:String(r)})}})()},[e,i]),t.jsx(Fe,{})}function Xe(i){const e=Ie.c(25),{callbackUrl:o,redirectUrl:l,allowAutoLogin:w,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=w===void 0?!0:w,j=Ce(),{sso:h,emailAndPassword:p,magicLink:Z,emailOtp:ee,socialProviders:ne,localMode:te}=Ne(),I=l||o;let C;e[0]!==E?(C=E?{onAuthenticated:E}:void 0,e[0]=E,e[1]=C):C=e[1];const c=C;if(te&&F){let f;return e[2]!==S||e[3]!==I?(f=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=f):f=e[4],f}if(h.enabled){let f;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(f=t.jsx(Ye,{callbackURL:I,providerId:h.providerId,ssoSignIn:Ae.ssoSignIn,onAuthEvent:S}),e[5]=S,e[6]=I,e[7]=h.providerId,e[8]=f):f=e[8],f}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let f;return e[9]!==O||e[10]!==A||e[11]!==u||e[12]!==o||e[13]!==c||e[14]!==d||e[15]!==S||e[16]!==l||e[17]!==r||e[18]!==g||e[19]!==P?(f=t.jsx(Ve,{redirectUrl:l,callbackUrl:o,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,actions:c}),e[9]=O,e[10]=A,e[11]=u,e[12]=o,e[13]=c,e[14]=d,e[15]=S,e[16]=l,e[17]=r,e[18]=g,e[19]=P,e[20]=f):f=e[20],f}let N;e[21]!==j?(N=j("common.authEntry.noLoginOptions"),e[21]=j,e[22]=N):N=e[22];let _;return e[23]!==N?(_=t.jsx("div",{children:N}),e[23]=N,e[24]=_):_=e[24],_}export{Fe as A,Xe as a};
@@ -1 +1 @@
1
- import{c as g,l as p,j as f}from"./index-LISCRMKT.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
1
+ import{c as g,l as p,j as f}from"./index-Cw6ilRLN.js";function w(b){const e=g.c(20),{children:m,visual:r,align:j}=b,d=(j===void 0?"center":j)==="fill",x=d?"min-h-[100dvh] md:min-h-screen":"min-h-screen";let l;e[0]!==x?(l=p("flex w-full",x),e[0]=x,e[1]=l):l=e[1];const h=d?"h-[100dvh] justify-start pt-4 pb-8 md:h-auto":"justify-center py-6";let t;e[2]!==h?(t=p("flex flex-1 flex-col items-center bg-sidebar px-6 md:justify-center md:px-10 md:py-10",h),e[2]=h,e[3]=t):t=e[3];const u=d&&"flex min-h-0 flex-1 flex-col md:block md:flex-none";let s;e[4]!==u?(s=p("w-full max-w-[440px]",u),e[4]=u,e[5]=s):s=e[5];let i;e[6]!==m||e[7]!==s?(i=f.jsx("div",{className:s,children:m}),e[6]=m,e[7]=s,e[8]=i):i=e[8];let n;e[9]!==t||e[10]!==i?(n=f.jsx("section",{className:t,children:i}),e[9]=t,e[10]=i,e[11]=n):n=e[11];let c;e[12]!==r?(c=r??f.jsx("img",{src:"/onboarding-placeholder.png",alt:"",className:"absolute inset-0 h-full w-full object-cover"}),e[12]=r,e[13]=c):c=e[13];let a;e[14]!==c?(a=f.jsx("aside",{className:"relative hidden flex-1 overflow-hidden bg-muted md:flex",children:c}),e[14]=c,e[15]=a):a=e[15];let o;return e[16]!==a||e[17]!==l||e[18]!==n?(o=f.jsxs("main",{className:l,children:[n,a]}),e[16]=a,e[17]=l,e[18]=n,e[19]=o):o=e[19],o}export{w as A};
@@ -1 +1 @@
1
- import{a as u}from"./mcp-oauth-D5bTwzBt.js";import{i as p}from"./mcp-oauth-CDHHl2AY.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await p({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await u({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
1
+ import{a as u}from"./mcp-oauth-B1sQYgh4.js";import{i as p}from"./mcp-oauth-zW9MaFGn.js";async function k({connectionId:n,orgId:s,orgSlug:o,persistFallback:r}){const c=new URL(`/api/${o}/mcp/${n}`,window.location.origin),i=await p({url:c.href,token:null,orgId:s});if(!i.supportsOAuth||i.isAuthenticated)return{ran:!1,ok:!0,error:null};const{token:t,tokenInfo:e,error:a}=await u({connectionId:n,orgSlug:o,scope:"offline_access"});if(a||!t)return{ran:!0,ok:!1,error:a??"no token received"};if(e)try{(await fetch(`/api/${o}/connections/${n}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:e.accessToken,refreshToken:e.refreshToken,expiresIn:e.expiresIn,scope:e.scope,clientId:e.clientId,clientSecret:e.clientSecret,tokenEndpoint:e.tokenEndpoint})})).ok||await r(t)}catch{await r(t)}else await r(t);return{ran:!0,ok:!0,error:null}}export{k as a};
@@ -0,0 +1 @@
1
+ import{c as J,b as U,r as ee,l as G,j as t,V as te,B as se,Z as ie,Y as ne,X as ae,aM as oe,aN as le,aO as re,aP as ce,bm as me,aQ as ue,aR as de,aS as fe}from"./index-Cw6ilRLN.js";import{B as ge}from"./badge-BWAFo8iB.js";import{A as xe,V as pe}from"./agent-icon-rBB7-3Iv.js";import{i as he}from"./DotsVertical-2jz8M_Ab.js";import{s as je}from"./Trash01-CA_m_Fs0.js";import{i as we}from"./Zap-CbyRjfWs.js";import{c as _e}from"./repository-binding-PeMGXqSl.js";import{a as ve}from"./use-automations-fhgNtkrI.js";function ze(c){const e=J.c(89),{automation:s,showAgent:o,onClick:n}=c,i=U(),{remove:a}=ve(),[r,H]=ee.useState(!1),l=_e(o?s.virtual_mcp_id:void 0);let E;e[0]!==s.id||e[1]!==a?(E=()=>{a.mutate(s.id),H(!1)},e[0]=s.id,e[1]=a,e[2]=E):E=e[2];const Q=E;let F;e[3]!==n?(F=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=F):F=e[4];const X=F,Y=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==Y?(u=G("inline-block size-2 rounded-full shrink-0",Y),e[5]=Y,e[6]=u):u=e[6];const Z=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==Z?(d=i(Z),e[7]=i,e[8]=Z,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=t.jsx("span",{className:u,"aria-label":d}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let g;e[13]!==l?.icon||e[14]!==l?.title||e[15]!==s.name||e[16]!==o?(g=o&&t.jsx(xe,{icon:l?.icon??null,name:l?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=l?.icon,e[14]=l?.title,e[15]=s.name,e[16]=o,e[17]=g):g=e[17];let x;e[18]!==s.name?(x=t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:s.name}),e[18]=s.name,e[19]=x):x=e[19];let p;e[20]!==s.system_key||e[21]!==i?(p=s.system_key&&t.jsx(ge,{variant:"muted",children:i("automations.builtin.badge")}),e[20]=s.system_key,e[21]=i,e[22]=p):p=e[22];let h;e[23]!==l||e[24]!==o?(h=o&&l&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",l.title]}),e[23]=l,e[24]=o,e[25]=h):h=e[25];let j;e[26]!==p||e[27]!==h||e[28]!==x?(j=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[x,p,h]}),e[26]=p,e[27]=h,e[28]=x,e[29]=j):j=e[29];let w;e[30]!==s.nearest_next_run_at||e[31]!==s.trigger_count?(w=t.jsx(De,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[30]=s.nearest_next_run_at,e[31]=s.trigger_count,e[32]=w):w=e[32];let _;e[33]!==j||e[34]!==w?(_=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[j,w]}),e[33]=j,e[34]=w,e[35]=_):_=e[35];const q=s.system_key&&"invisible";let v;e[36]!==q?(v=G("shrink-0",q),e[36]=q,e[37]=v):v=e[37];let $;e[38]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(te,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"icon",className:"opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(he,{size:16})})}),e[38]=$):$=e[38];let K,V;e[39]===Symbol.for("react.memo_cache_sentinel")?(K=m=>{m.stopPropagation(),H(!0)},V=t.jsx(je,{size:16}),e[39]=K,e[40]=V):(K=e[39],V=e[40]);let y;e[41]!==i?(y=i("automations.automationListRow.delete"),e[41]=i,e[42]=y):y=e[42];let A;e[43]!==y?(A=t.jsxs(ie,{children:[$,t.jsx(ne,{align:"end",children:t.jsxs(ae,{variant:"destructive",onClick:K,children:[V,y]})})]}),e[43]=y,e[44]=A):A=e[44];let D;e[45]!==v||e[46]!==A?(D=t.jsx("div",{onClick:Ae,onKeyDown:ye,role:"presentation",className:v,children:A}),e[45]=v,e[46]=A,e[47]=D):D=e[47];let R;e[48]!==X||e[49]!==n||e[50]!==_||e[51]!==D||e[52]!==f||e[53]!==g?(R=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:X,className:"group w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-accent transition-colors cursor-pointer focus-ring",children:[f,g,_,D]}),e[48]=X,e[49]=n,e[50]=_,e[51]=D,e[52]=f,e[53]=g,e[54]=R):R=e[54];let N;e[55]!==i?(N=i("automations.automationListRow.deleteTitle"),e[55]=i,e[56]=N):N=e[56];let k;e[57]!==N?(k=t.jsx(oe,{children:N}),e[57]=N,e[58]=k):k=e[58];let b;e[59]!==s.name||e[60]!==i?(b=i("automations.automationListRow.deleteDescription",{name:s.name}),e[59]=s.name,e[60]=i,e[61]=b):b=e[61];let L;e[62]!==b?(L=t.jsx(le,{children:b}),e[62]=b,e[63]=L):L=e[63];let C;e[64]!==k||e[65]!==L?(C=t.jsxs(re,{children:[k,L]}),e[64]=k,e[65]=L,e[66]=C):C=e[66];let P;e[67]!==i?(P=i("automations.automationListRow.cancel"),e[67]=i,e[68]=P):P=e[68];let T;e[69]!==P?(T=t.jsx(ce,{children:P}),e[69]=P,e[70]=T):T=e[70];const W=a.isPending;let z;e[71]!==i?(z=i("automations.automationListRow.deleteButton"),e[71]=i,e[72]=z):z=e[72];let B;e[73]!==Q||e[74]!==a.isPending||e[75]!==z?(B=t.jsx(me,{onClick:Q,disabled:W,variant:"destructive",children:z}),e[73]=Q,e[74]=a.isPending,e[75]=z,e[76]=B):B=e[76];let M;e[77]!==T||e[78]!==B?(M=t.jsxs(ue,{children:[T,B]}),e[77]=T,e[78]=B,e[79]=M):M=e[79];let S;e[80]!==C||e[81]!==M?(S=t.jsxs(de,{children:[C,M]}),e[80]=C,e[81]=M,e[82]=S):S=e[82];let O;e[83]!==r||e[84]!==S?(O=t.jsx(fe,{open:r,onOpenChange:H,children:S}),e[83]=r,e[84]=S,e[85]=O):O=e[85];let I;return e[86]!==R||e[87]!==O?(I=t.jsxs(t.Fragment,{children:[R,O]}),e[86]=R,e[87]=O,e[88]=I):I=e[88],I}function ye(c){return c.stopPropagation()}function Ae(c){return c.stopPropagation()}function De(c){const e=J.c(8),{triggerCount:s,nextRunAt:o}=c,n=U();if(s===0){let a;e[0]!==n?(a=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==a?(r=t.jsx("span",{className:"text-xs text-muted-foreground",children:a}),e[2]=a,e[3]=r):r=e[3],r}let i;return e[4]!==o||e[5]!==n||e[6]!==s?(i=t.jsx("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground min-w-0",children:o?t.jsxs(t.Fragment,{children:[t.jsx(pe,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.nextRun",{date:new Date(o).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(we,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:s===1?n("automations.automationListRow.triggersOne"):n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=o,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{ze as A};
@@ -1 +1 @@
1
- import{c as V,r as ot,b as X,a4 as it,R as rt,ap as ct,b4 as ut,K as tt,j as s,l as mt,m as dt,gm as ft}from"./index-LISCRMKT.js";import{u as xt}from"./useInfiniteQuery-ChletbBT.js";import{u as pt}from"./use-connection-DZPkoV0a.js";import{u as gt}from"./use-mcp-client-0e8NRgfT.js";import{b as ht}from"./repository-binding-N72ZtnJ7.js";import{b as Rt,a as jt}from"./sheet-C1Iz_daC.js";import{e as Nt,a as bt,b as st,T as G,d as Tt,c as Q}from"./table-CR0vxly9.js";import{E as et}from"./empty-state-CEJi6IVu.js";import{u as St}from"./use-infinite-scroll-CB0WyAlc.js";import{g as vt}from"./task-status-CwtxChqi.js";import{e as Ct}from"./use-automations-DcNzV0FS.js";import{T as It,f as at,a as nt}from"./thread-sheet-body-Opalk3rB.js";function wt(c){const t=V.c(15),[i,r]=ot.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,l=a!==-1?c[a]:null,n=l!==null;let o,C;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=u=>r(u),C=()=>r(null),t[3]=o,t[4]=C):(o=t[3],C=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let d;return t[9]!==a||t[10]!==l||t[11]!==n||t[12]!==f||t[13]!==x?(d={selected:l,index:a,isOpen:n,select:o,close:C,prev:f,next:x},t[9]=a,t[10]=l,t[11]=n,t[12]=f,t[13]=x,t[14]=d):d=t[14],d}const W=50;function Y(c){const t=V.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let l;t[2]!==r?(l=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=l):l=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let o;return t[6]!==a||t[7]!==l||t[8]!==n?(o=s.jsxs(ft,{className:"pt-4 px-4 pb-5 gap-1",children:[a,l,n]}),t[6]=a,t[7]=l,t[8]=n,t[9]=o):o=t[9],o}function yt(c){const t=V.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:l}=Ct(i,r),n=a?.runs,o=a?.usage;let C;t[0]!==n?(C=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=C):C=t[1];const f=C;let x;t[2]!==e||t[3]!==o?(x=o&&o.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:o.sampledRuns}):void 0,t[2]=e,t[3]=o,t[4]=x):x=t[4];const d=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==l||t[8]!==n?.total?(g=l?"…":n?.total.toLocaleString()??"0",t[7]=l,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const y=l?"…":f;let I;t[19]!==T||t[20]!==y?(I=s.jsx(Y,{title:T,value:y}),t[19]=T,t[20]=y,t[21]=I):I=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==l||t[25]!==o?.totalTokens?(p=l?"…":at(o?.totalTokens??0),t[24]=l,t[25]=o?.totalTokens,t[26]=p):p=t[26];let w;t[27]!==S||t[28]!==p||t[29]!==d?(w=s.jsx(Y,{title:S,value:p,subtitle:d}),t[27]=S,t[28]=p,t[29]=d,t[30]=w):w=t[30];let m;t[31]!==e?(m=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=m):m=t[32];let j;t[33]!==l||t[34]!==o?(j=l?"…":o&&o.costUsd>0?nt(o.costUsd):"—",t[33]=l,t[34]=o,t[35]=j):j=t[35];let v;t[36]!==m||t[37]!==j||t[38]!==d?(v=s.jsx(Y,{title:m,value:j,subtitle:d}),t[36]=m,t[37]=j,t[38]=d,t[39]=v):v=t[39];let N;return t[40]!==w||t[41]!==v||t[42]!==R||t[43]!==I?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,I,w,v]}),t[40]=w,t[41]=v,t[42]=R,t[43]=I,t[44]=N):N=t[44],N}function _t(c){const t=V.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,l=X();let n,o;if(t[0]!==i.created_at){const k=new Date(i.created_at);n=k.toLocaleDateString("en-US",{month:"short",day:"numeric"}),o=k.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=o}else n=t[1],o=t[2];const C=o;let f,x,d,u,g,h,R,T,y,I,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==l){const k=vt(i.status),U=k.icon;x=st,y=a,I="h-14 cursor-pointer hover:bg-accent transition-colors border-b-0",S=e,t[19]!==i.title?(d=s.jsx(Q,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=d):d=t[20],f=Q,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:k.iconClassName}),u=mt("text-sm",k.labelColor),g=l(k.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=l,t[8]=f,t[9]=x,t[10]=d,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=y,t[17]=I,t[18]=S}else f=t[8],x=t[9],d=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],y=t[16],I=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let w;t[24]!==p||t[25]!==h||t[26]!==R?(w=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=w):w=t[27];let m;t[28]!==f||t[29]!==w||t[30]!==T?(m=s.jsx(f,{className:T,children:w}),t[28]=f,t[29]=w,t[30]=T,t[31]=m):m=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(Q,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let _;t[38]!==N?(_=s.jsx(Q,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=_):_=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let P;t[42]!==C?(P=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:C}),t[42]=C,t[43]=P):P=t[43];let E;t[44]!==D||t[45]!==P?(E=s.jsxs(Q,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,P]}),t[44]=D,t[45]=P,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==d||t[49]!==m||t[50]!==v||t[51]!==_||t[52]!==E||t[53]!==y||t[54]!==I||t[55]!==S?($=s.jsxs(x,{ref:y,className:I,onClick:S,children:[d,m,v,_,E]}),t[47]=x,t[48]=d,t[49]=m,t[50]=v,t[51]=_,t[52]=E,t[53]=y,t[54]=I,t[55]=S,t[56]=$):$=t[56],$}function Vt(c){const t=V.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:l,locator:n}=it();let o;t[0]!==l.id||t[1]!==l.slug?(o={connectionId:rt,orgId:l.id,orgSlug:l.slug},t[0]=l.id,t[1]=l.slug,t[2]=o):o=t[2];const C=gt(o),f=ct(),x=pt(),d=ht(),{data:u}=ut(),g=r.length>0;let h;t[3]!==i||t[4]!==l.id||t[5]!==r?(h=tt.automationRuns(l.id,i,r),t[3]=i,t[4]=l.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,lt=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:lt,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:y,fetchNextPage:I,hasNextPage:S,isFetchingNextPage:p,isLoading:w}=xt(T);let m,j,v,N;t[14]!==y?.pages||t[15]!==n||t[16]!==e?(m=(y?.pages??[]).flatMap(Dt),N=m.map(kt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=y?.pages,t[15]=n,t[16]=e,t[17]=m,t[18]=j,t[19]=v,t[20]=N):(m=t[17],j=t[18],v=t[19],N=t[20]);let _;t[21]!==e||t[22]!==f||t[23]!==N?(_=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=_):_=t[24];const D=N.length>0;let P;t[25]!==j||t[26]!==_||t[27]!==D?(P={queryKey:j,queryFn:_,enabled:D,staleTime:3e4},t[25]=j,t[26]=_,t[27]=D,t[28]=P):P=t[28];const{data:E}=v(P);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(Pt)),t[29]=E?.items,t[30]=$):$=t[30];const k=$;let U;t[31]!==I||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&I()},t[31]=I,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=St(U,S??!1,p),b=wt(m),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(yt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==w||t[40]!==Z||t[41]!==m||t[42]!==b||t[43]!==a||t[44]!==k?(O=g?w?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):m.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(Nt,{className:"w-full border-collapse",children:[s.jsx(bt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 font-normal text-meta",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 font-normal text-meta",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 font-normal text-meta text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 font-normal text-meta text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 font-normal text-meta",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(Tt,{children:m.map((M,J)=>s.jsx(_t,{run:M,usage:k.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===m.length-1?Z:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=w,t[40]=Z,t[41]=m,t[42]=b,t[43]=a,t[44]=k,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==d||t[53]!==C||t[54]!==n||t[55]!==u||t[56]!==m||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(It,{thread:B,client:C,locator:n,connections:x,virtualMcps:d,members:u,nav:{index:b.index,total:m.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=d,t[53]=C,t[54]=n,t[55]=u,t[56]=m,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(jt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(Rt,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let z;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(z=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=z):z=t[72],z}function Pt(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function kt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Vt as A,wt as u};
1
+ import{c as V,r as ot,b as X,a4 as it,R as rt,ap as ct,b4 as ut,K as tt,j as s,l as mt,m as dt,gm as ft}from"./index-Cw6ilRLN.js";import{u as xt}from"./useInfiniteQuery-qZeYk4so.js";import{u as pt}from"./use-connection-BeEdNRHa.js";import{u as gt}from"./use-mcp-client-CvhC1TIJ.js";import{b as ht}from"./repository-binding-PeMGXqSl.js";import{b as Rt,a as jt}from"./sheet-CLT2kz10.js";import{e as Nt,a as bt,b as st,T as G,d as Tt,c as Q}from"./table-Daq1_j7m.js";import{E as et}from"./empty-state-DhRsvQHO.js";import{u as St}from"./use-infinite-scroll-dtUi5Sm6.js";import{g as vt}from"./task-status-CJpXljEZ.js";import{e as Ct}from"./use-automations-fhgNtkrI.js";import{T as It,f as at,a as nt}from"./thread-sheet-body-vk26kAGI.js";function wt(c){const t=V.c(15),[i,r]=ot.useState(null);let e;t[0]!==c||t[1]!==i?(e=i!==null?c.findIndex(u=>u.id===i):-1,t[0]=c,t[1]=i,t[2]=e):e=t[2];const a=e,l=a!==-1?c[a]:null,n=l!==null;let o,C;t[3]===Symbol.for("react.memo_cache_sentinel")?(o=u=>r(u),C=()=>r(null),t[3]=o,t[4]=C):(o=t[3],C=t[4]);let f,x;t[5]!==a||t[6]!==c?(f=()=>{const u=c[a-1];a>0&&u&&r(u.id)},x=()=>{const u=c[a+1];a!==-1&&u&&r(u.id)},t[5]=a,t[6]=c,t[7]=f,t[8]=x):(f=t[7],x=t[8]);let d;return t[9]!==a||t[10]!==l||t[11]!==n||t[12]!==f||t[13]!==x?(d={selected:l,index:a,isOpen:n,select:o,close:C,prev:f,next:x},t[9]=a,t[10]=l,t[11]=n,t[12]=f,t[13]=x,t[14]=d):d=t[14],d}const W=50;function Y(c){const t=V.c(10),{title:i,value:r,subtitle:e}=c;let a;t[0]!==i?(a=s.jsx("span",{className:"text-sm text-foreground/70",children:i}),t[0]=i,t[1]=a):a=t[1];let l;t[2]!==r?(l=s.jsx("span",{className:"text-3xl font-normal tabular-nums",children:r}),t[2]=r,t[3]=l):l=t[3];let n;t[4]!==e?(n=e&&s.jsx("span",{className:"text-xs text-muted-foreground",children:e}),t[4]=e,t[5]=n):n=t[5];let o;return t[6]!==a||t[7]!==l||t[8]!==n?(o=s.jsxs(ft,{className:"pt-4 px-4 pb-5 gap-1",children:[a,l,n]}),t[6]=a,t[7]=l,t[8]=n,t[9]=o):o=t[9],o}function yt(c){const t=V.c(45),{automationId:i,range:r}=c,e=X(),{data:a,isLoading:l}=Ct(i,r),n=a?.runs,o=a?.usage;let C;t[0]!==n?(C=n&&n.total>0?`${Math.round(n.completed/n.total*100)}%`:"—",t[0]=n,t[1]=C):C=t[1];const f=C;let x;t[2]!==e||t[3]!==o?(x=o&&o.truncated?e("automations.automationRuns.lastRunsSubtitle",{count:o.sampledRuns}):void 0,t[2]=e,t[3]=o,t[4]=x):x=t[4];const d=x;let u;t[5]!==e?(u=e("automations.automationRuns.runsTitle"),t[5]=e,t[6]=u):u=t[6];let g;t[7]!==l||t[8]!==n?.total?(g=l?"…":n?.total.toLocaleString()??"0",t[7]=l,t[8]=n?.total,t[9]=g):g=t[9];let h;t[10]!==n||t[11]!==e?(h=n?`${n.completed} ${e("automations.automationRuns.ok")} · ${n.failed} ${e("automations.automationRuns.failed")}${n.inProgress>0?` · ${n.inProgress} ${e("automations.automationRuns.running")}`:""}`:void 0,t[10]=n,t[11]=e,t[12]=h):h=t[12];let R;t[13]!==u||t[14]!==g||t[15]!==h?(R=s.jsx(Y,{title:u,value:g,subtitle:h}),t[13]=u,t[14]=g,t[15]=h,t[16]=R):R=t[16];let T;t[17]!==e?(T=e("automations.automationRuns.successRateTitle"),t[17]=e,t[18]=T):T=t[18];const y=l?"…":f;let I;t[19]!==T||t[20]!==y?(I=s.jsx(Y,{title:T,value:y}),t[19]=T,t[20]=y,t[21]=I):I=t[21];let S;t[22]!==e?(S=e("automations.automationRuns.tokensTitle"),t[22]=e,t[23]=S):S=t[23];let p;t[24]!==l||t[25]!==o?.totalTokens?(p=l?"…":at(o?.totalTokens??0),t[24]=l,t[25]=o?.totalTokens,t[26]=p):p=t[26];let w;t[27]!==S||t[28]!==p||t[29]!==d?(w=s.jsx(Y,{title:S,value:p,subtitle:d}),t[27]=S,t[28]=p,t[29]=d,t[30]=w):w=t[30];let m;t[31]!==e?(m=e("automations.automationRuns.costTitle"),t[31]=e,t[32]=m):m=t[32];let j;t[33]!==l||t[34]!==o?(j=l?"…":o&&o.costUsd>0?nt(o.costUsd):"—",t[33]=l,t[34]=o,t[35]=j):j=t[35];let v;t[36]!==m||t[37]!==j||t[38]!==d?(v=s.jsx(Y,{title:m,value:j,subtitle:d}),t[36]=m,t[37]=j,t[38]=d,t[39]=v):v=t[39];let N;return t[40]!==w||t[41]!==v||t[42]!==R||t[43]!==I?(N=s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[R,I,w,v]}),t[40]=w,t[41]=v,t[42]=R,t[43]=I,t[44]=N):N=t[44],N}function _t(c){const t=V.c(57),{run:i,usage:r,onClick:e,lastRowRef:a}=c,l=X();let n,o;if(t[0]!==i.created_at){const k=new Date(i.created_at);n=k.toLocaleDateString("en-US",{month:"short",day:"numeric"}),o=k.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),t[0]=i.created_at,t[1]=n,t[2]=o}else n=t[1],o=t[2];const C=o;let f,x,d,u,g,h,R,T,y,I,S;if(t[3]!==a||t[4]!==e||t[5]!==i.status||t[6]!==i.title||t[7]!==l){const k=vt(i.status),U=k.icon;x=st,y=a,I="h-14 cursor-pointer hover:bg-accent transition-colors border-b-0",S=e,t[19]!==i.title?(d=s.jsx(Q,{className:"min-w-0 pr-2 pl-4 md:pr-4",children:s.jsx("div",{className:"font-medium text-foreground truncate",children:i.title})}),t[19]=i.title,t[20]=d):d=t[20],f=Q,T="w-28 px-3",h="flex items-center gap-1.5",R=s.jsx(U,{size:14,className:k.iconClassName}),u=mt("text-sm",k.labelColor),g=l(k.labelKey),t[3]=a,t[4]=e,t[5]=i.status,t[6]=i.title,t[7]=l,t[8]=f,t[9]=x,t[10]=d,t[11]=u,t[12]=g,t[13]=h,t[14]=R,t[15]=T,t[16]=y,t[17]=I,t[18]=S}else f=t[8],x=t[9],d=t[10],u=t[11],g=t[12],h=t[13],R=t[14],T=t[15],y=t[16],I=t[17],S=t[18];let p;t[21]!==u||t[22]!==g?(p=s.jsx("span",{className:u,children:g}),t[21]=u,t[22]=g,t[23]=p):p=t[23];let w;t[24]!==p||t[25]!==h||t[26]!==R?(w=s.jsxs("div",{className:h,children:[R,p]}),t[24]=p,t[25]=h,t[26]=R,t[27]=w):w=t[27];let m;t[28]!==f||t[29]!==w||t[30]!==T?(m=s.jsx(f,{className:T,children:w}),t[28]=f,t[29]=w,t[30]=T,t[31]=m):m=t[31];let j;t[32]!==r?(j=r?at(r.totalTokens):"—",t[32]=r,t[33]=j):j=t[33];let v;t[34]!==j?(v=s.jsx(Q,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:j}),t[34]=j,t[35]=v):v=t[35];let N;t[36]!==r?(N=r&&r.costUsd>0?nt(r.costUsd):"—",t[36]=r,t[37]=N):N=t[37];let _;t[38]!==N?(_=s.jsx(Q,{className:"w-24 px-3 text-right tabular-nums text-muted-foreground",children:N}),t[38]=N,t[39]=_):_=t[39];let D;t[40]!==n?(D=s.jsx("div",{children:n}),t[40]=n,t[41]=D):D=t[41];let P;t[42]!==C?(P=s.jsx("div",{className:"text-xs text-muted-foreground/60",children:C}),t[42]=C,t[43]=P):P=t[43];let E;t[44]!==D||t[45]!==P?(E=s.jsxs(Q,{className:"w-32 px-3 pr-5 text-muted-foreground",children:[D,P]}),t[44]=D,t[45]=P,t[46]=E):E=t[46];let $;return t[47]!==x||t[48]!==d||t[49]!==m||t[50]!==v||t[51]!==_||t[52]!==E||t[53]!==y||t[54]!==I||t[55]!==S?($=s.jsxs(x,{ref:y,className:I,onClick:S,children:[d,m,v,_,E]}),t[47]=x,t[48]=d,t[49]=m,t[50]=v,t[51]=_,t[52]=E,t[53]=y,t[54]=I,t[55]=S,t[56]=$):$=t[56],$}function Vt(c){const t=V.c(73),{automationId:i,triggerIds:r,range:e}=c,a=X(),{org:l,locator:n}=it();let o;t[0]!==l.id||t[1]!==l.slug?(o={connectionId:rt,orgId:l.id,orgSlug:l.slug},t[0]=l.id,t[1]=l.slug,t[2]=o):o=t[2];const C=gt(o),f=ct(),x=pt(),d=ht(),{data:u}=ut(),g=r.length>0;let h;t[3]!==i||t[4]!==l.id||t[5]!==r?(h=tt.automationRuns(l.id,i,r),t[3]=i,t[4]=l.id,t[5]=r,t[6]=h):h=t[6];let R;t[7]!==f||t[8]!==r?(R=async M=>{const{pageParam:J}=M,lt=J===void 0?0:J;return await f.call("COLLECTION_THREADS_LIST",{limit:W,offset:lt,where:{trigger_ids:r}})},t[7]=f,t[8]=r,t[9]=R):R=t[9];let T;t[10]!==g||t[11]!==h||t[12]!==R?(T={queryKey:h,queryFn:R,initialPageParam:0,getNextPageParam:Et,enabled:g,staleTime:3e4},t[10]=g,t[11]=h,t[12]=R,t[13]=T):T=t[13];const{data:y,fetchNextPage:I,hasNextPage:S,isFetchingNextPage:p,isLoading:w}=xt(T);let m,j,v,N;t[14]!==y?.pages||t[15]!==n||t[16]!==e?(m=(y?.pages??[]).flatMap(Dt),N=m.map(kt),v=dt,j=tt.monitoringThreadUsage(n,JSON.stringify({ids:N,...e})),t[14]=y?.pages,t[15]=n,t[16]=e,t[17]=m,t[18]=j,t[19]=v,t[20]=N):(m=t[17],j=t[18],v=t[19],N=t[20]);let _;t[21]!==e||t[22]!==f||t[23]!==N?(_=async()=>await f.call("MONITORING_THREAD_USAGE",{threadIds:N,...e.startDate?{startDate:e.startDate}:{},...e.endDate?{endDate:e.endDate}:{}}),t[21]=e,t[22]=f,t[23]=N,t[24]=_):_=t[24];const D=N.length>0;let P;t[25]!==j||t[26]!==_||t[27]!==D?(P={queryKey:j,queryFn:_,enabled:D,staleTime:3e4},t[25]=j,t[26]=_,t[27]=D,t[28]=P):P=t[28];const{data:E}=v(P);let $;t[29]!==E?.items?($=new Map((E?.items??[]).map(Pt)),t[29]=E?.items,t[30]=$):$=t[30];const k=$;let U;t[31]!==I||t[32]!==S||t[33]!==p?(U=()=>{S&&!p&&I()},t[31]=I,t[32]=S,t[33]=p,t[34]=U):U=t[34];const Z=St(U,S??!1,p),b=wt(m),B=b.selected;let L;t[35]!==i||t[36]!==e?(L=s.jsx(yt,{automationId:i,range:e}),t[35]=i,t[36]=e,t[37]=L):L=t[37];let O;t[38]!==g||t[39]!==w||t[40]!==Z||t[41]!==m||t[42]!==b||t[43]!==a||t[44]!==k?(O=g?w?s.jsx("div",{className:"py-16 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingRuns")}):m.length===0?s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noRunsTitle"),description:a("automations.automationRuns.noRunsDescription")})}):s.jsxs(Nt,{className:"w-full border-collapse",children:[s.jsx(bt,{className:"border-b-0",children:s.jsxs(st,{className:"h-9 hover:bg-transparent border-b border-border",children:[s.jsx(G,{className:"pl-4 font-normal text-meta",children:a("automations.automationRuns.runHeader")}),s.jsx(G,{className:"w-28 px-3 font-normal text-meta",children:a("automations.automationRuns.statusHeader")}),s.jsx(G,{className:"w-24 px-3 font-normal text-meta text-right",children:a("automations.automationRuns.tokensHeader")}),s.jsx(G,{className:"w-24 px-3 font-normal text-meta text-right",children:a("automations.automationRuns.costHeader")}),s.jsx(G,{className:"w-32 px-3 pr-5 font-normal text-meta",children:a("automations.automationRuns.startedHeader")})]})}),s.jsx(Tt,{children:m.map((M,J)=>s.jsx(_t,{run:M,usage:k.get(M.id),onClick:()=>b.select(M.id),lastRowRef:J===m.length-1?Z:void 0},M.id))})]}):s.jsx("div",{className:"py-16",children:s.jsx(et,{title:a("automations.automationRuns.noStartersTitle"),description:a("automations.automationRuns.noStartersDescription")})}),t[38]=g,t[39]=w,t[40]=Z,t[41]=m,t[42]=b,t[43]=a,t[44]=k,t[45]=O):O=t[45];let A;t[46]!==p||t[47]!==a?(A=p&&s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:a("automations.automationRuns.loadingMore")}),t[46]=p,t[47]=a,t[48]=A):A=t[48];let H;t[49]!==b?(H=M=>{M||b.close()},t[49]=b,t[50]=H):H=t[50];let K;t[51]!==x||t[52]!==d||t[53]!==C||t[54]!==n||t[55]!==u||t[56]!==m||t[57]!==B||t[58]!==b.index||t[59]!==b.next||t[60]!==b.prev?(K=B&&s.jsx(It,{thread:B,client:C,locator:n,connections:x,virtualMcps:d,members:u,nav:{index:b.index,total:m.length,onPrev:b.prev,onNext:b.next}}),t[51]=x,t[52]=d,t[53]=C,t[54]=n,t[55]=u,t[56]=m,t[57]=B,t[58]=b.index,t[59]=b.next,t[60]=b.prev,t[61]=K):K=t[61];let q;t[62]!==K?(q=s.jsx(jt,{className:"sm:max-w-2xl flex flex-col p-0 gap-0",children:K}),t[62]=K,t[63]=q):q=t[63];let F;t[64]!==b.isOpen||t[65]!==H||t[66]!==q?(F=s.jsx(Rt,{open:b.isOpen,onOpenChange:H,children:q}),t[64]=b.isOpen,t[65]=H,t[66]=q,t[67]=F):F=t[67];let z;return t[68]!==L||t[69]!==O||t[70]!==A||t[71]!==F?(z=s.jsxs("div",{className:"flex flex-col gap-5",children:[L,O,A,F]}),t[68]=L,t[69]=O,t[70]=A,t[71]=F,t[72]=z):z=t[72],z}function Pt(c){return[c.threadId,{calls:c.calls,inputTokens:c.inputTokens,outputTokens:c.outputTokens,totalTokens:c.totalTokens,costUsd:c.costUsd}]}function kt(c){return c.id}function Dt(c){return c.items??[]}function Et(c,t){const i=c,r=t;if(!((i?.items?.length??0)<W))return r.length*W}export{Vt as A,wt as u};
@@ -0,0 +1 @@
1
+ import{c as k,j as e,b as $,a4 as D,d as M,r as q,n as d,B as V,gW as W,C as R}from"./index-Cw6ilRLN.js";import{s as F}from"./Plus-BQ-ZwSoF.js";import{i as S}from"./Zap-CbyRjfWs.js";import{S as G}from"./search-input-CnMfC6Ib.js";import{E as T}from"./empty-state-DhRsvQHO.js";import{u as H}from"./use-automations-fhgNtkrI.js";import{u as J}from"./use-navigate-to-agent-X54xBbs-.js";import{A as K}from"./automation-list-row-DJWeWPbv.js";import{b as O}from"./repository-binding-PeMGXqSl.js";import{R as Q}from"./require-capability-42JNP4Dw.js";import"./SearchMd-CcFldd9q.js";import"./use-mcp-client-CvhC1TIJ.js";import"./auth-DPUc_dnx.js";import"./thread-intent-CAWCzeoG.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BxinXtVa.js";import"./task-board-DSKYQnUa.js";import"./schema-CB30E7Gi.js";import"./slugify-CEUa2lfQ.js";import"./badge-BWAFo8iB.js";import"./agent-icon-rBB7-3Iv.js";import"./AlertCircle-Hdww5hle.js";import"./Tool01-DamUcObd.js";import"./ArrowUp-B0V8Iire.js";import"./ArrowLeft-BdhX_ELF.js";import"./LinkBroken01-DiqXlFxy.js";import"./ShoppingBag01-Dt2W1jQn.js";import"./ZoomOut-C8TxwIPG.js";import"./Building02-CIOqUK8u.js";import"./CheckCircle-Oy-r5wrn.js";import"./ChevronUp-yEhXqYsc.js";import"./ChevronSelectorVertical-4o-RZGZG.js";import"./UserSquare-TWw3zsr7.js";import"./Copy01-DZu9JdFR.js";import"./CreditCard01-e2iuA4b6.js";import"./DotsVertical-2jz8M_Ab.js";import"./Image01-Csw8Eb7F.js";import"./Globe04-Dv-Q1UFe.js";import"./SwitchHorizontal01-ZVZ1PW_K.js";import"./Key01-nj-094nh.js";import"./Link01-DIQIHWyZ.js";import"./Minus-DGpW2R_Y.js";import"./Monitor01-6lmVgqwN.js";import"./Sun-BCEy54hJ.js";import"./Play-Bw1hrhzw.js";import"./Trash01-CA_m_Fs0.js";import"./Upload01-COlXo8Rs.js";import"./Users01-CqKKJKeH.js";import"./XClose-BLrzcEcC.js";import"./access-gate-RZ9GSyUJ.js";import"./capability-load-error-BNI4R8XO.js";function U(){const t=k.c(20),o=$(),{org:c}=D(),{data:y}=H(void 0),g=y===void 0?[]:y,E=O(),P=J(),f=M(),[x,z]=q.useState(""),h=x.toLowerCase(),A=new Map(E.map(X)),b=g.filter(i=>{if(!h||i.name.toLowerCase().includes(h))return!0;if(i.virtual_mcp_id){const l=A.get(i.virtual_mcp_id);if(l&&l.title.toLowerCase().includes(h))return!0}return!1}),B=(i,l)=>{const N=l&&A.has(l)?l:W(c.id);R("automations_list_row_clicked",{automation_id:i,agent_id:N,source:"settings_automations"}),P(N,{panel:`automation:${i}`})};let p;t[0]!==f||t[1]!==c.slug?(p=()=>{R("automations_empty_state_browse_agents_clicked"),f({to:"/$org/settings/projects",params:{org:c.slug}})},t[0]=f,t[1]=c.slug,t[2]=p):p=t[2];const L=p,j=d,v=d,C=d;let s;t[3]!==o?(s=o("settings.automations.pageTitle"),t[3]=o,t[4]=s):s=t[4];let r;t[5]!==s?(r=e.jsx(d.Title,{children:s}),t[5]=s,t[6]=r):r=t[6];const w=g.length>0&&e.jsx(G,{value:x,onChange:z,placeholder:o("settings.automations.searchPlaceholder"),className:"w-full md:w-[375px]"});let n;t[7]!==r||t[8]!==w?(n=e.jsxs("div",{className:"flex flex-col gap-6",children:[r,w]}),t[7]=r,t[8]=w,t[9]=n):n=t[9];const _=g.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.emptyTitle"),description:o("settings.automations.emptyDescription"),actions:e.jsxs(V,{size:"sm",onClick:L,children:[e.jsx(F,{size:14}),o("settings.automations.browseAgentsButton")]})})}):b.length===0?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx(T,{image:e.jsx(S,{size:48,className:"text-muted-foreground"}),title:o("settings.automations.noResultsTitle"),description:o("settings.automations.noResultsDescription",{search:x})})}):e.jsx("div",{className:"mt-6 flex flex-col divide-y divide-border overflow-hidden rounded-xl bg-card shadow-edge",children:b.map(i=>e.jsx(K,{automation:i,showAgent:!0,onClick:()=>B(i.id,i.virtual_mcp_id)},i.id))});let a;t[10]!==C.Container||t[11]!==n||t[12]!==_?(a=e.jsxs(C.Container,{children:[n,_]}),t[10]=C.Container,t[11]=n,t[12]=_,t[13]=a):a=t[13];let m;t[14]!==v.Content||t[15]!==a?(m=e.jsx(v.Content,{children:a}),t[14]=v.Content,t[15]=a,t[16]=m):m=t[16];let u;return t[17]!==j||t[18]!==m?(u=e.jsx(j,{children:m}),t[17]=j,t[18]=m,t[19]=u):u=t[19],u}function X(t){return[t.id,t]}function Ut(){const t=k.c(1);let o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=e.jsx(Q,{capability:"automations:manage",area:"automations",children:e.jsx(U,{})}),t[0]=o):o=t[0],o}export{Ut as default};