decocms 4.513.1 → 4.513.3

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 (400) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-DLigh1zJ.js → ActiveShapeUtils-CV2gQvF0.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BGsPYuR3.js → AlertCircle-Czw3GOXM.js} +1 -1
  3. package/dist/client/assets/{AreaChart-CzXIOspF.js → AreaChart-BhM70eeA.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-BY0o9p-g.js → ArrowLeft-CBNZ6Kc8.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-BIUPa0Dd.js → ArrowUp-D1TV4x6T.js} +1 -1
  6. package/dist/client/assets/{BarChart-C93WKtUQ.js → BarChart-BV8WJLUg.js} +1 -1
  7. package/dist/client/assets/{Building02-DRJukUHS.js → Building02-BufOoi54.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-Dm7PETVH.js → CartesianChart-ButQNI6T.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-71YzazvL.js → CategoricalChart-CU6wjw2Q.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-BMzfjrcN.js → CheckCircle-C6kHCEBQ.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-OsgtEFsS.js → ChevronSelectorVertical-CREWgR2i.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-gQvBs5Wr.js → ChevronUp-DZ6u-CDn.js} +1 -1
  13. package/dist/client/assets/{Copy01-B6uJ5A3t.js → Copy01-Br8MuAU9.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-CVvsJVHy.js → CreditCard01-BLe5-9IQ.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CRoDrMwf.js → DotsVertical-DgdCLmlp.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-B-ZKQrQu.js → ErrorBarContext-D8FHRXZQ.js} +1 -1
  17. package/dist/client/assets/{Globe04-mgILh7rR.js → Globe04-BkNwdwoM.js} +1 -1
  18. package/dist/client/assets/{Image01-D3cjfdzm.js → Image01-DxuLkpjX.js} +1 -1
  19. package/dist/client/assets/{Key01-DBuAbIfl.js → Key01-Qdm6kw39.js} +1 -1
  20. package/dist/client/assets/{Link01-BkraNRbc.js → Link01-B4M7ojFg.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-COSlZBTJ.js → LinkBroken01-CJN7aOrV.js} +1 -1
  22. package/dist/client/assets/{Monitor01-CSJlATNa.js → Monitor01-CHS3e170.js} +1 -1
  23. package/dist/client/assets/{Play-CS7ZIu7O.js → Play-Da27xlG_.js} +1 -1
  24. package/dist/client/assets/{Plus-Dam4fGJv.js → Plus-D0ucptrV.js} +1 -1
  25. package/dist/client/assets/{ReferenceLine-D2WOwhtk.js → ReferenceLine-CoS52beo.js} +1 -1
  26. package/dist/client/assets/{SearchMd-BmY7B7q3.js → SearchMd-0qnilUuy.js} +1 -1
  27. package/dist/client/assets/{Sector-BZsKaQxF.js → Sector-CKh2L0yG.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-Di2JjyaO.js → ShoppingBag01-DV74WoBV.js} +1 -1
  29. package/dist/client/assets/{Sun-CBRr2mzj.js → Sun-D0O3J2yf.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CVhIGWzI.js → SwitchHorizontal01-Ba0pyLay.js} +1 -1
  31. package/dist/client/assets/{Tool01-C0tA6_WY.js → Tool01-C0454p2c.js} +1 -1
  32. package/dist/client/assets/{Trash01-BWvgZ-My.js → Trash01-CyxedK0n.js} +1 -1
  33. package/dist/client/assets/{Upload01-Ayc3pkY7.js → Upload01-BWpYXx52.js} +1 -1
  34. package/dist/client/assets/{User01-Cv65FqsE.js → User01-Bb04dh7g.js} +1 -1
  35. package/dist/client/assets/{UserSquare-jVbr-XG_.js → UserSquare-B_weldPC.js} +1 -1
  36. package/dist/client/assets/{Users01-C8djc4kj.js → Users01-CNd-hMC8.js} +1 -1
  37. package/dist/client/assets/{XClose-J1FWOmKL.js → XClose-BeqwQ2Ei.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-DOsQL5PZ.js → ZoomOut-DWT1qHXA.js} +1 -1
  39. package/dist/client/assets/{access-gate-CSnpnsDz.js → access-gate-mycOF7cD.js} +1 -1
  40. package/dist/client/assets/{add-connection-dialog-9kRnWMWN.js → add-connection-dialog-BkWp2fK0.js} +1 -1
  41. package/dist/client/assets/{agent-analytics-BksVEHnl.js → agent-analytics-B5byH36W.js} +1 -1
  42. package/dist/client/assets/agent-app-C8Q8eJy6.js +1 -0
  43. package/dist/client/assets/{agent-assets-tvE-HIyg.js → agent-assets-pGTlMleF.js} +1 -1
  44. package/dist/client/assets/{agent-automation-V4FV4x5y.js → agent-automation-D5u89G2_.js} +1 -1
  45. package/dist/client/assets/{agent-automations-Cc2YYUR6.js → agent-automations-C4_XXiyv.js} +1 -1
  46. package/dist/client/assets/{agent-connect-sources-tJKzdDG2.js → agent-connect-sources-C5p-0QMu.js} +1 -1
  47. package/dist/client/assets/agent-deck-XMMtyHjd.js +1 -0
  48. package/dist/client/assets/{agent-e2e-DGsy6V0w.js → agent-e2e-Ce5bkH9z.js} +1 -1
  49. package/dist/client/assets/{agent-experiments-CEmVLVx7.js → agent-experiments-D4NapCfE.js} +1 -1
  50. package/dist/client/assets/agent-file-BNo94gQC.js +1 -0
  51. package/dist/client/assets/{agent-hosting-SI9CUAyr.js → agent-hosting-ftgEMkT0.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BAsaPIPW.js → agent-icon-C0Cpk_fI.js} +1 -1
  53. package/dist/client/assets/agent-library-GkmC1ahU.js +1 -0
  54. package/dist/client/assets/agent-library-file-6MKr5gfE.js +1 -0
  55. package/dist/client/assets/{agent-monitor-BAD4Hlpg.js → agent-monitor-C-1u284m.js} +1 -1
  56. package/dist/client/assets/agent-overview-B5DYE-Ji.js +1 -0
  57. package/dist/client/assets/{agent-releases-BROUPRoA.js → agent-releases-aHzQJT8R.js} +1 -1
  58. package/dist/client/assets/agent-settings-5nByAqOM.js +1 -0
  59. package/dist/client/assets/{agent-site-editor-Bc4JzAtX.js → agent-site-editor-CPMVDSTZ.js} +1 -1
  60. package/dist/client/assets/agent-site-editor-code-0fxD14rb.js +2 -0
  61. package/dist/client/assets/agent-site-editor-content-BN4VoKnm.js +1 -0
  62. package/dist/client/assets/agent-site-editor-preview-BXzeSsT8.js +1 -0
  63. package/dist/client/assets/{agent-view-guard-COE0o9OW.js → agent-view-guard-DNE4CXyR.js} +1 -1
  64. package/dist/client/assets/agent-view-hlAx7Qgd.js +1 -0
  65. package/dist/client/assets/{agents-list-DsnUnijY.js → agents-list-BeohBYvm.js} +1 -1
  66. package/dist/client/assets/{ai-providers-_9Q72ibF.js → ai-providers-BYfFnvED.js} +1 -1
  67. package/dist/client/assets/{alert-dialog-BXsSwOCK.js → alert-dialog-DBOmU5EL.js} +1 -1
  68. package/dist/client/assets/{alert-DVLk8Iin.js → alert-fFwi0Rct.js} +1 -1
  69. package/dist/client/assets/{analytics-sections-CVdZcg3H.js → analytics-sections-BSFzvx60.js} +1 -1
  70. package/dist/client/assets/{api-keys-C5_mr7Dx.js → api-keys-CjBRjWKE.js} +1 -1
  71. package/dist/client/assets/api-keys-Dvm1thDW.js +1 -0
  72. package/dist/client/assets/{app-editor-CAZxpcHR.js → app-editor-9oqlCdGz.js} +1 -1
  73. package/dist/client/assets/{asset-utils-BYeUUuYD.js → asset-utils-DRLxCAgr.js} +1 -1
  74. package/dist/client/assets/{auth-BGlQUcUq.js → auth-BPJq9uZN.js} +1 -1
  75. package/dist/client/assets/{auth-catchall-B57MQTC7.js → auth-catchall-D2arJj-l.js} +1 -1
  76. package/dist/client/assets/{auth-entry-DEDwSnje.js → auth-entry-BUYS1aRG.js} +1 -1
  77. package/dist/client/assets/{auth-split-layout-Bywa1Rdj.js → auth-split-layout-B60d6um2.js} +1 -1
  78. package/dist/client/assets/{authenticate-and-persist-oauth-DawdQrNH.js → authenticate-and-persist-oauth-CEKJsXYr.js} +1 -1
  79. package/dist/client/assets/{automation-list-row-DxgABVkv.js → automation-list-row-BKl9kQg2.js} +1 -1
  80. package/dist/client/assets/{automation-runs-CiiZvO3g.js → automation-runs-Bc4ZG8Cd.js} +1 -1
  81. package/dist/client/assets/{automations-BYa97um_.js → automations-Byx2iIlC.js} +1 -1
  82. package/dist/client/assets/{autosend-C7UE5qBo.js → autosend-BRrz2Y4f.js} +1 -1
  83. package/dist/client/assets/{avatar-D92LQoMs.js → avatar--bVWjvdf.js} +1 -1
  84. package/dist/client/assets/{badge-Qo4xyqqo.js → badge-O9zNBxIS.js} +1 -1
  85. package/dist/client/assets/{block-document-skQMirff.js → block-document-EMb4OAJD.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-C5n4-2zD.js → blocks-preview-workspace-context-CswMFv9v.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-ZrFyRJRO.js → blocks-tab-states-CXGOEMTq.js} +3 -3
  88. package/dist/client/assets/{blog-schema-BLRxEC9n.js → blog-schema-BBgfoIQP.js} +1 -1
  89. package/dist/client/assets/{board-analytics-CUpSvAlz.js → board-analytics-BnyzhqyI.js} +1 -1
  90. package/dist/client/assets/{buckets-BJtJwr6_.js → buckets-CScAlRwn.js} +1 -1
  91. package/dist/client/assets/{build-improve-prompt-doc-8Y6fyKcx.js → build-improve-prompt-doc-DZKU2eq8.js} +1 -1
  92. package/dist/client/assets/{calendar-O9AxJqnv.js → calendar-DsjGYQg2.js} +1 -1
  93. package/dist/client/assets/{capability-load-error-CNqk0tFF.js → capability-load-error-D5sZmG67.js} +1 -1
  94. package/dist/client/assets/{category-editor-Be436pUw.js → category-editor-TdrhQc2d.js} +1 -1
  95. package/dist/client/assets/{chart-D6QCrw1j.js → chart-CdJbyFrF.js} +1 -1
  96. package/dist/client/assets/{chat-context-CHUVtsDo.js → chat-context-Dnn7Mdeu.js} +1 -1
  97. package/dist/client/assets/{chat-draft-DxqHQ-qR.js → chat-draft-QF0rnEVx.js} +1 -1
  98. package/dist/client/assets/{checkbox-D1J9YzHt.js → checkbox-_9cHZuVh.js} +1 -1
  99. package/dist/client/assets/{choose-editor-zF0EkKBL.js → choose-editor-DjeEuPt0.js} +1 -1
  100. package/dist/client/assets/{cli-auth-success-BIVUc0bz.js → cli-auth-success-s_E43D3X.js} +1 -1
  101. package/dist/client/assets/{client-icons-NYHaAc2_.js → client-icons-CnZ15Laz.js} +1 -1
  102. package/dist/client/assets/cms-settings-editor-DLURX7ZR.js +1 -0
  103. package/dist/client/assets/{collapsible-4U8s9Q7m.js → collapsible-CzHslCH_.js} +1 -1
  104. package/dist/client/assets/{collection-detail-DrU7rdOW.js → collection-detail-DRUItL6q.js} +1 -1
  105. package/dist/client/assets/{collection-display-button-BaRotray.js → collection-display-button-BLKqGGaY.js} +1 -1
  106. package/dist/client/assets/{collection-search-Da85q05W.js → collection-search-BiaY0GVT.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-Dnz2lweC.js → collection-table-wrapper-ymUDH0Iy.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-Mlp_Rejx.js → collection-tabs-BLEBGgk-.js} +1 -1
  109. package/dist/client/assets/{column-rules-B6lY_qpw.js → column-rules-B7xl4xQZ.js} +1 -1
  110. package/dist/client/assets/{combobox-BCOMReLT.js → combobox-CdVSN4C-.js} +1 -1
  111. package/dist/client/assets/{coming-soon-page-CvYKECN2.js → coming-soon-page-DU1ARjbb.js} +1 -1
  112. package/dist/client/assets/{command-DEXvL0cT.js → command-BwFTVPCg.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-B8jhQ1lU.js → companion-mcps-section-wyIo_eN7.js} +1 -1
  114. package/dist/client/assets/config-D3pVqIKI.js +1 -0
  115. package/dist/client/assets/{connect-CJaggTPx.js → connect-DBOmX-8C.js} +1 -1
  116. package/dist/client/assets/{connect-layout-cAlAMnNX.js → connect-layout-BI0GOmFg.js} +1 -1
  117. package/dist/client/assets/{connection-vIWlN3YD.js → connection-DdsAVMED.js} +1 -1
  118. package/dist/client/assets/{connection-card-BJdYhmjP.js → connection-card-DquRZmyq.js} +1 -1
  119. package/dist/client/assets/{connection-detail-BW1b2Mg7.js → connection-detail-C2_9jZRg.js} +1 -1
  120. package/dist/client/assets/{connection-form-helpers-CEC9pgiR.js → connection-form-helpers-CppaGv96.js} +1 -1
  121. package/dist/client/assets/{connections-DHSlk7eF.js → connections-CPYwbOBM.js} +1 -1
  122. package/dist/client/assets/{content-tab-D6dlC_eK.js → content-tab-BGK1XaKL.js} +3 -3
  123. package/dist/client/assets/{context-D9Kj70hJ.js → context-D2VrQMS2.js} +1 -1
  124. package/dist/client/assets/{context-menu-BdSGqs_f.js → context-menu-D1SjU6l-.js} +1 -1
  125. package/dist/client/assets/{context-shell-BcUuYMwr.js → context-shell-CKI9uW2C.js} +3 -3
  126. package/dist/client/assets/{core.esm-C_n7cKI9.js → core.esm-DnTbXhD8.js} +1 -1
  127. package/dist/client/assets/{create-organization-dialog-BCynjnXm.js → create-organization-dialog-BIJBsiHg.js} +1 -1
  128. package/dist/client/assets/{daily-pulse-jLaM72aD.js → daily-pulse-Drk3CnaM.js} +1 -1
  129. package/dist/client/assets/{discover-WzG-rd-A.js → discover-BDubv_ZJ.js} +1 -1
  130. package/dist/client/assets/{domain-settings-BctCKhK5.js → domain-settings-CCe7QH7l.js} +1 -1
  131. package/dist/client/assets/{drawer-PNF7GPi2.js → drawer-CTSig7Vj.js} +1 -1
  132. package/dist/client/assets/{editor-DOvs1ZAj.js → editor-B8TTVjFi.js} +1 -1
  133. package/dist/client/assets/{editor-classes-BJdm0od6.js → editor-classes-BUSqIt7e.js} +1 -1
  134. package/dist/client/assets/{empty-state-DRKp6xDi.js → empty-state-DIpCFPkI.js} +1 -1
  135. package/dist/client/assets/{empty-state-Czk_KZf6.js → empty-state-DweMe7pE.js} +1 -1
  136. package/dist/client/assets/{extract-connection-data-B-l9PdV0.js → extract-connection-data-C2M3P64h.js} +1 -1
  137. package/dist/client/assets/{feature-gate-Cfsfll5L.js → feature-gate-hxH8uzOp.js} +1 -1
  138. package/dist/client/assets/{feature-paywall-CpCMXj0j.js → feature-paywall-5JkjVbP-.js} +1 -1
  139. package/dist/client/assets/{file-explorer-B_BhjGuw.js → file-explorer-CsGruqCR.js} +1 -1
  140. package/dist/client/assets/{file-preview-BgeZG3Ut.js → file-preview-ySEcJuT1.js} +1 -1
  141. package/dist/client/assets/{file-share-button-CjByqgRv.js → file-share-button-BcJLFZEu.js} +1 -1
  142. package/dist/client/assets/{file-type-icon-DrKVTY_y.js → file-type-icon-CBmuqe9u.js} +1 -1
  143. package/dist/client/assets/flat-project-CcO2Ar9k.js +1 -0
  144. package/dist/client/assets/{folder-icon-BL3ikPej.js → folder-icon-BbG7eONI.js} +1 -1
  145. package/dist/client/assets/{form-BReygSsa.js → form-CGiGUgzW.js} +1 -1
  146. package/dist/client/assets/{general-ayENLq_6.js → general-40Wry3sr.js} +1 -1
  147. package/dist/client/assets/home-CuekDzCb.js +1 -0
  148. package/dist/client/assets/{hosted-publish-feedback-DJnIOpIA.js → hosted-publish-feedback-Dj41Gksp.js} +1 -1
  149. package/dist/client/assets/{icon-button-BMIQVqVD.js → icon-button-D0a6m1Sz.js} +1 -1
  150. package/dist/client/assets/{index-BPxS5t0S.js → index-BL53jR3y.js} +1 -1
  151. package/dist/client/assets/{index-Bf67UBtK.js → index-BgaKQ-Q-.js} +1 -1
  152. package/dist/client/assets/{index-Dg_sZbJ0.js → index-C1nhsm_w.js} +1 -1
  153. package/dist/client/assets/{index-DYoNho4Y.js → index-C5AhGK9V.js} +5 -5
  154. package/dist/client/assets/{index-CsPw2N1B.js → index-CEYZyBqV.js} +1 -1
  155. package/dist/client/assets/{index-59MGyrbA.js → index-CQodxdYF.js} +1 -1
  156. package/dist/client/assets/{index-DG1Kruym.js → index-Cn8WHbCR.js} +1 -1
  157. package/dist/client/assets/{index-DrCJgI2a.js → index-Ct79h6Jq.js} +1 -1
  158. package/dist/client/assets/{index--jYyuT9F.js → index-DMApSpFV.js} +1 -1
  159. package/dist/client/assets/{index-CPKH5oCf.js → index-DOjuGDiB.js} +1 -1
  160. package/dist/client/assets/{index-CB34n0pr.js → index-DZWoZhT5.js} +1 -1
  161. package/dist/client/assets/{index-DmRWIJlm.js → index-D_cOu6AK.js} +1 -1
  162. package/dist/client/assets/{index-IZZ1QWYx.js → index-FsB7lUoK.js} +1 -1
  163. package/dist/client/assets/{index-BqhDNSVy.js → index-YSmMnHTP.js} +1 -1
  164. package/dist/client/assets/{index-CNWJYHvX.js → index-eirpwNKj.js} +2 -2
  165. package/dist/client/assets/{index-B-_uoizr.js → index-fdN8eXM2.js} +1 -1
  166. package/dist/client/assets/index-pFm7t22i.css +1 -0
  167. package/dist/client/assets/{index-redirect-DZaEKj9N.js → index-redirect-Dk2uc0Gh.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-BZJj1RTX.js → infiniteQueryObserver-47K3Cxqe.js} +1 -1
  169. package/dist/client/assets/{infra-billing-BGzk-gx3.js → infra-billing-CE_ELMRw.js} +1 -1
  170. package/dist/client/assets/{input-DQjMvdWZ.js → input-BH9IvcPC.js} +1 -1
  171. package/dist/client/assets/{input-C14RAevO.js → input-DdEOORL2.js} +3 -3
  172. package/dist/client/assets/{integration-icon-A_JAytZI.js → integration-icon-CKknGZhR.js} +1 -1
  173. package/dist/client/assets/{jira-icon-BaW-JhER.js → jira-icon-DreVKI44.js} +1 -1
  174. package/dist/client/assets/{label-DKrrhY82.js → label-BL4W2KPI.js} +1 -1
  175. package/dist/client/assets/{layout-D0vGvTyD.js → layout-B6GTwWgR.js} +1 -1
  176. package/dist/client/assets/{legacy-agents-deep-DHz8EBj2.js → legacy-agents-deep-h-k8kxkI.js} +1 -1
  177. package/dist/client/assets/{legacy-main-redirect-CXWM5YMx.js → legacy-main-redirect-D6Wq6vr4.js} +1 -1
  178. package/dist/client/assets/library-0gJacikj.js +1 -0
  179. package/dist/client/assets/{library-tab-DkG0GP2E.js → library-tab-6tliBei-.js} +1 -1
  180. package/dist/client/assets/{login-7DjR_ib1.js → login-2dWlgBxu.js} +1 -1
  181. package/dist/client/assets/{markdown-Dkv8vF7I.js → markdown-BjPIZk-u.js} +1 -1
  182. package/dist/client/assets/{mcp-app-renderer-BTmNB3HB.js → mcp-app-renderer-afmtzlAD.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-B26YcM5J.js → mcp-oauth-DJh33UXx.js} +1 -1
  184. package/dist/client/assets/{mcp-oauth-D8hJrLwY.js → mcp-oauth-DqMHjHip.js} +1 -1
  185. package/dist/client/assets/{members-E4TpKIKd.js → members-De3ITOSK.js} +1 -1
  186. package/dist/client/assets/{memory-oZaHxU5s.js → memory-Bd-agrjz.js} +1 -1
  187. package/dist/client/assets/{mini-report-page-BArv5mW4.js → mini-report-page-qugNBWyG.js} +1 -1
  188. package/dist/client/assets/{mock-board-Bwwa0M9R.js → mock-board-DsyG_BKd.js} +1 -1
  189. package/dist/client/assets/{monaco-editor-BqY_G1yM.js → monaco-editor-frZbpSC4.js} +1 -1
  190. package/dist/client/assets/monitoring-D5Nohicc.js +1 -0
  191. package/dist/client/assets/{monitoring-stats-row-DVnv34v6.js → monitoring-stats-row-CbmvtcQ8.js} +1 -1
  192. package/dist/client/assets/{multi-select-Cbl9yFmn.js → multi-select-mMhkiaxx.js} +1 -1
  193. package/dist/client/assets/{mustache-CKwi1qbg.js → mustache-BE_jNzrX.js} +1 -1
  194. package/dist/client/assets/{new-project-dialog-N-lmXyX9.js → new-project-dialog-BMxQGh6T.js} +1 -1
  195. package/dist/client/assets/{oauth-callback-CO5zT2gX.js → oauth-callback-NxseMyYt.js} +1 -1
  196. package/dist/client/assets/{oauth-callback-ai-provider-DUDQxWlr.js → oauth-callback-ai-provider-JHRZj7cm.js} +1 -1
  197. package/dist/client/assets/{onboarding-BTnElaEx.js → onboarding-BNSpsBHl.js} +1 -1
  198. package/dist/client/assets/{openai-conversation-n75eRcLs.js → openai-conversation-B9wySkKU.js} +1 -1
  199. package/dist/client/assets/{optimistic-project-sidebar-views-DQouTCdv.js → optimistic-project-sidebar-views-DqJuR4Ij.js} +1 -1
  200. package/dist/client/assets/{order-monitor-day-04mjD1ep.js → order-monitor-day-DTRXFSPm.js} +1 -1
  201. package/dist/client/assets/{organization-choice-Cp6NuWiL.js → organization-choice-D_pQMc9T.js} +1 -1
  202. package/dist/client/assets/{orgs-ClkY5PpT.js → orgs-CsIZaTyi.js} +1 -1
  203. package/dist/client/assets/{page-seo-form-CPFkTIUJ.js → page-seo-form-DAN_oC73.js} +1 -1
  204. package/dist/client/assets/{pair-B8IyaaR6.js → pair-BERDoCro.js} +1 -1
  205. package/dist/client/assets/plan-N5Xy4KXF.js +1 -0
  206. package/dist/client/assets/{plan-ladder-CsKZpYtk.js → plan-ladder-DL1JtpvS.js} +1 -1
  207. package/dist/client/assets/{popover-D5cvllcj.js → popover-oZJ3oDMA.js} +1 -1
  208. package/dist/client/assets/{post-calendar-BjbOMFj8.js → post-calendar-DfH5svUX.js} +1 -1
  209. package/dist/client/assets/{post-editor-Bkg0zAby.js → post-editor-hWgegmwE.js} +1 -1
  210. package/dist/client/assets/{preview-content-DOlR7Sto.js → preview-content-PTYjaSyC.js} +1 -1
  211. package/dist/client/assets/{preview-dialog-BFeDZCyo.js → preview-dialog-4ft9O22y.js} +1 -1
  212. package/dist/client/assets/{preview-panel-hig46M8n.js → preview-panel-DM51Fpvo.js} +1 -1
  213. package/dist/client/assets/{preview-tab-Db6Udxne.js → preview-tab-CNeiDQgU.js} +3 -3
  214. package/dist/client/assets/{product-picker-dialog-BoRMhmF_.js → product-picker-dialog-BDff_MLx.js} +1 -1
  215. package/dist/client/assets/{profile-DWc7hq2C.js → profile-_0v0w_uk.js} +1 -1
  216. package/dist/client/assets/{project-app-view-D2zjD9lX.js → project-app-view-D_QJpB96.js} +1 -1
  217. package/dist/client/assets/project-apps-BRjQ6ES3.js +1 -0
  218. package/dist/client/assets/{project-feed-rwZLZcmg.js → project-feed-CYGKnY4Q.js} +1 -1
  219. package/dist/client/assets/{project-icon-C5PSWWOk.js → project-icon-D_aSXDOt.js} +1 -1
  220. package/dist/client/assets/project-reports-s2VJkQN9.js +1 -0
  221. package/dist/client/assets/project-tasks-DqRp61Xr.js +1 -0
  222. package/dist/client/assets/{projects-yiMF0-RY.js → projects-BmIdJmG4.js} +1 -1
  223. package/dist/client/assets/{projects-empty-state-BbguoYWh.js → projects-empty-state-BdoV9-x8.js} +1 -1
  224. package/dist/client/assets/{prompts-DpUxXr6K.js → prompts-BSkHwl6y.js} +1 -1
  225. package/dist/client/assets/record-editor-BakkGf1Y.js +1 -0
  226. package/dist/client/assets/{redirect-editor-cabEvZG6.js → redirect-editor-CtFVIrY2.js} +1 -1
  227. package/dist/client/assets/{reports-B_iXvMFR.js → reports-CLhp1Pr5.js} +1 -1
  228. package/dist/client/assets/reports-DzmhhR-x.js +1 -0
  229. package/dist/client/assets/{reports-onboarding-D2u26MsR.js → reports-onboarding-C8PLHLPc.js} +1 -1
  230. package/dist/client/assets/{reports-tab-BaXzi2FM.js → reports-tab-DDrFZP3m.js} +2 -2
  231. package/dist/client/assets/repositories-6gZ6hUD8.js +1 -0
  232. package/dist/client/assets/{repositories-CLCQSYhg.js → repositories-DoNhvU-g.js} +1 -1
  233. package/dist/client/assets/{repository-binding-CGk3ZX0j.js → repository-binding-BNbbDYQQ.js} +1 -1
  234. package/dist/client/assets/{repository-import-picker-BTeoI4rZ.js → repository-import-picker-CMsE5EOk.js} +1 -1
  235. package/dist/client/assets/{repository-picker-CoWZ9iTd.js → repository-picker-DOtWfpYo.js} +1 -1
  236. package/dist/client/assets/{require-capability-D-ZlkNFz.js → require-capability-CBG6rA7o.js} +1 -1
  237. package/dist/client/assets/{required-auth-layout-BtRjrHP0.js → required-auth-layout-Dz1OowhH.js} +1 -1
  238. package/dist/client/assets/{reset-password-5BD1CHP9.js → reset-password-v_UkU5Xg.js} +1 -1
  239. package/dist/client/assets/{resizable-2vxsnemp.js → resizable-CWaYgp8D.js} +1 -1
  240. package/dist/client/assets/{resolve-tab-icon-BernL4Vf.js → resolve-tab-icon-B2EU-8BB.js} +1 -1
  241. package/dist/client/assets/{review-settings-QBVdfldx.js → review-settings-BZhzjgRq.js} +1 -1
  242. package/dist/client/assets/{roles-DOHABx88.js → roles-Y2HKVQnL.js} +1 -1
  243. package/dist/client/assets/{route-DFi5KwM0.js → route-7L_TW384.js} +1 -1
  244. package/dist/client/assets/{route-E8TOccvZ.js → route-DPCqrSJX.js} +1 -1
  245. package/dist/client/assets/route-DXMOqHVl.js +1 -0
  246. package/dist/client/assets/{sandbox-lifecycle-context-D_9evUyh.js → sandbox-lifecycle-context-Pb8-9nPA.js} +1 -1
  247. package/dist/client/assets/{schema-L6FFXvke.js → schema-C1o97tHt.js} +1 -1
  248. package/dist/client/assets/{schema-BEutq4eJ.js → schema-CviV2OeO.js} +1 -1
  249. package/dist/client/assets/{scroll-area-D7vhzfPi.js → scroll-area-D2V3l6oK.js} +1 -1
  250. package/dist/client/assets/{search-input-Dujh_El7.js → search-input-Bq9urCGV.js} +1 -1
  251. package/dist/client/assets/{search-toggle-DnvRupWM.js → search-toggle-DwZ6dTB5.js} +1 -1
  252. package/dist/client/assets/{secret-ciphertext-CQx2VEMI.js → secret-ciphertext-BkXDtxC6.js} +1 -1
  253. package/dist/client/assets/{secret-picker-CPXxDZGW.js → secret-picker-BoK4uSMi.js} +1 -1
  254. package/dist/client/assets/{secrets-DGJVx-Hd.js → secrets-C0qlLAI4.js} +1 -1
  255. package/dist/client/assets/{sections-CJqhzmZf.js → sections-CR_pzMlx.js} +1 -1
  256. package/dist/client/assets/{sections-editor-BtYUAQwb.js → sections-editor-BK3_J9sX.js} +1 -1
  257. package/dist/client/assets/{select-DZhmnwp_.js → select-C5-hj9Ts.js} +1 -1
  258. package/dist/client/assets/{select-model-CMMJURkr.js → select-model-CwXefPFG.js} +1 -1
  259. package/dist/client/assets/{seo-editor-B_llRc49.js → seo-editor-CSy5-rpo.js} +1 -1
  260. package/dist/client/assets/{separator-D1JWkxza.js → separator-BD6ld_rn.js} +1 -1
  261. package/dist/client/assets/settings-tab-DHN7ZjAa.js +1 -0
  262. package/dist/client/assets/{sheet-EBRPi3dD.js → sheet-s29eirRf.js} +1 -1
  263. package/dist/client/assets/{shell-layout-Cng6sPGR.js → shell-layout-DS0Ye6S1.js} +1 -1
  264. package/dist/client/assets/site-editor-BfEYXklV.js +1 -0
  265. package/dist/client/assets/{site-editor-toast-CB9KCYI4.js → site-editor-toast-C5e-1uEv.js} +1 -1
  266. package/dist/client/assets/{skills-t2RbhpKV.js → skills-pQpcosHp.js} +1 -1
  267. package/dist/client/assets/{slider-B1Au3IHI.js → slider-P84DbLvc.js} +1 -1
  268. package/dist/client/assets/{sortable.esm-BMPY9Sd5.js → sortable.esm-DMQ-WncJ.js} +1 -1
  269. package/dist/client/assets/{sso-BCCAXBz3.js → sso-BaZj_16B.js} +1 -1
  270. package/dist/client/assets/{suggestion-BWGM-l4J.js → suggestion-BtCYsnHk.js} +1 -1
  271. package/dist/client/assets/{switch-zkrdrMZj.js → switch-COyvKYHV.js} +1 -1
  272. package/dist/client/assets/{symbol-Dy_rO5Hd.js → symbol-DE4EJv1h.js} +1 -1
  273. package/dist/client/assets/{synced-repos-Ci3QmgG7.js → synced-repos-BchTuYeZ.js} +1 -1
  274. package/dist/client/assets/{tab-icon-glyph-RNaGE4GF.js → tab-icon-glyph-Bd77emAf.js} +1 -1
  275. package/dist/client/assets/{table-WldSmBJB.js → table-E7GbRtTD.js} +1 -1
  276. package/dist/client/assets/{tabs-D6AJgzOF.js → tabs-DWtBgLg_.js} +1 -1
  277. package/dist/client/assets/{task-assignee-avatar-DSa4iRni.js → task-assignee-avatar-DTLURih6.js} +1 -1
  278. package/dist/client/assets/{task-board-Dg8D4L_r.js → task-board-fU-Cl8m2.js} +1 -1
  279. package/dist/client/assets/{task-route-C97BcCaG.js → task-route-DuNmXwWp.js} +1 -1
  280. package/dist/client/assets/{task-status-BYiz6w3h.js → task-status-wpuxJDO5.js} +1 -1
  281. package/dist/client/assets/taskboard-analytics-jASQU8UF.js +1 -0
  282. package/dist/client/assets/{tasks-BugNujmt.js → tasks-B4X2VVxT.js} +1 -1
  283. package/dist/client/assets/tasks-DLjtcYlA.js +1 -0
  284. package/dist/client/assets/{textarea-ynJNuYy7.js → textarea-BDL4MHBS.js} +1 -1
  285. package/dist/client/assets/{thread-analytics-CRzIsQDC.js → thread-analytics-0ZqqwnzE.js} +1 -1
  286. package/dist/client/assets/{thread-intent-DEna0N6y.js → thread-intent-DzC9Ji46.js} +1 -1
  287. package/dist/client/assets/{thread-route-CKIN4nc-.js → thread-route-D0aLhRkR.js} +1 -1
  288. package/dist/client/assets/{thread-route-Bo3gwmaG.js → thread-route-DuRhXh4I.js} +1 -1
  289. package/dist/client/assets/{thread-sheet-body-By8NyP0y.js → thread-sheet-body-VXXOBFly.js} +1 -1
  290. package/dist/client/assets/{time-range-picker-CtXKDXpg.js → time-range-picker-vYJ0Kk8S.js} +1 -1
  291. package/dist/client/assets/{toggle-group-COK-wW8I.js → toggle-group-CRigS0R4.js} +1 -1
  292. package/dist/client/assets/{tool-namespace-rRU5qMc_.js → tool-namespace-DPiptzHh.js} +1 -1
  293. package/dist/client/assets/{toolbar-icon-button-BKHwq05w.js → toolbar-icon-button-uuYUYVtr.js} +1 -1
  294. package/dist/client/assets/{tooltip-BwU3TfFp.js → tooltip-DX3EibzC.js} +1 -1
  295. package/dist/client/assets/{tooltipContext-CAHajv8a.js → tooltipContext-DiSBImQr.js} +1 -1
  296. package/dist/client/assets/{track-BPoEwC0E.js → track-D-YCF_rE.js} +1 -1
  297. package/dist/client/assets/{types-DRalEM3C.js → types-BmDn-Bmr.js} +1 -1
  298. package/dist/client/assets/{url-slug-COrOe0WW.js → url-slug-BjYL2qGa.js} +1 -1
  299. package/dist/client/assets/{usage-stats-XZL_1T4w.js → usage-stats-DViGt9Z5.js} +1 -1
  300. package/dist/client/assets/{use-ai-providers-Cp5F1VcY.js → use-ai-providers-XvM2-sU7.js} +1 -1
  301. package/dist/client/assets/{use-automations-eFmS2FKe.js → use-automations-BP7Qo80Q.js} +1 -1
  302. package/dist/client/assets/{use-autosave-C9nj8WNq.js → use-autosave-DLpdlg6z.js} +1 -1
  303. package/dist/client/assets/{use-chat-layout-state-xTXMyKKk.js → use-chat-layout-state-BEn27bqi.js} +1 -1
  304. package/dist/client/assets/{use-clock-tick-Ea25VUYb.js → use-clock-tick--0G9fYV8.js} +1 -1
  305. package/dist/client/assets/{use-connect-companion-POnaAIsR.js → use-connect-companion-Byfe_uLr.js} +1 -1
  306. package/dist/client/assets/{use-connection-K9rEqDx3.js → use-connection-C4wyl2ru.js} +1 -1
  307. package/dist/client/assets/{use-content-sync-C_a-vn-B.js → use-content-sync-BdbVP04j.js} +1 -1
  308. package/dist/client/assets/{use-copy-B5Nw2ln-.js → use-copy-BS5soA37.js} +1 -1
  309. package/dist/client/assets/{use-create-virtual-mcp-BM5JgPZg.js → use-create-virtual-mcp-Bgr2d-1k.js} +1 -1
  310. package/dist/client/assets/{use-date-fns-locale-CtFSWiK4.js → use-date-fns-locale-D_SHRVT8.js} +1 -1
  311. package/dist/client/assets/{use-debounced-autosave-CpCeYixJ.js → use-debounced-autosave-CteI237O.js} +1 -1
  312. package/dist/client/assets/{use-debounced-value-BOMWTPY3.js → use-debounced-value-DGbphRsM.js} +1 -1
  313. package/dist/client/assets/{use-deco-credits-DR8-Tka6.js → use-deco-credits-B7vnPi2P.js} +1 -1
  314. package/dist/client/assets/{use-decopilot-events-Qf3fSwYr.js → use-decopilot-events-DTU6iW_4.js} +1 -1
  315. package/dist/client/assets/{use-delete-connection-BGCZqvQL.js → use-delete-connection-v7vjwrBf.js} +1 -1
  316. package/dist/client/assets/{use-deployment-admin-Bar4XffR.js → use-deployment-admin-Cr49Ea_9.js} +1 -1
  317. package/dist/client/assets/{use-ensure-project-folder-SxuhSqkI.js → use-ensure-project-folder-BiBJcIU0.js} +1 -1
  318. package/dist/client/assets/{use-fast-preview-draft-url-EV84odfX.js → use-fast-preview-draft-url-CUkbW62G.js} +1 -1
  319. package/dist/client/assets/{use-file-configs-DCrTPP04.js → use-file-configs-dTlYe09H.js} +1 -1
  320. package/dist/client/assets/{use-inbox-feed-bSceDcjX.js → use-inbox-feed-d4Pg1vDp.js} +1 -1
  321. package/dist/client/assets/{use-infinite-scroll-HwZjX02J.js → use-infinite-scroll-DYPYtqG2.js} +1 -1
  322. package/dist/client/assets/{use-join-requests-C5AvVu_b.js → use-join-requests-CgaNoIHU.js} +1 -1
  323. package/dist/client/assets/{use-main-panel-tabs-dd8MU14H.js → use-main-panel-tabs-bEgIKNUF.js} +1 -1
  324. package/dist/client/assets/{use-main-schema-v8-CEMheePi.js → use-main-schema-v8-BpRBE2if.js} +1 -1
  325. package/dist/client/assets/{use-mcp-auth-status-DijdJpV2.js → use-mcp-auth-status-XO9Yp1aB.js} +1 -1
  326. package/dist/client/assets/{use-mcp-client-BqxufeFQ.js → use-mcp-client-DA050uNw.js} +1 -1
  327. package/dist/client/assets/{use-mcp-prompts-x85qdRTs.js → use-mcp-prompts-C_C6tlAY.js} +1 -1
  328. package/dist/client/assets/{use-mcp-tools-C7RNSCm2.js → use-mcp-tools-DDRwYO6T.js} +1 -1
  329. package/dist/client/assets/{use-members-hZfDNsyQ.js → use-members-C4ay671C.js} +1 -1
  330. package/dist/client/assets/{use-mobile-B-6bodzw.js → use-mobile-BsNhhNj1.js} +1 -1
  331. package/dist/client/assets/{use-navigate-to-agent-B4nMFFrr.js → use-navigate-to-agent-y0z5Ii2q.js} +1 -1
  332. package/dist/client/assets/{use-open-billing-url-BnVW18Te.js → use-open-billing-url-B2tbuRiV.js} +1 -1
  333. package/dist/client/assets/{use-org-auth-client-DbZXNKzp.js → use-org-auth-client-Cn5Gs8uE.js} +1 -1
  334. package/dist/client/assets/{use-org-fs-DvrG4oqK.js → use-org-fs-QKl-Epzm.js} +1 -1
  335. package/dist/client/assets/{use-org-repo-syncs-BsfQ-AYu.js → use-org-repo-syncs-DkE7BEdc.js} +1 -1
  336. package/dist/client/assets/{use-org-sso-B5w9Y6-K.js → use-org-sso-fQ5NHD0A.js} +1 -1
  337. package/dist/client/assets/{use-organization-roles-DKryRiui.js → use-organization-roles-DDX-q-Qm.js} +1 -1
  338. package/dist/client/assets/{use-organization-settings-CT_gWjCV.js → use-organization-settings-BAyreMqm.js} +1 -1
  339. package/dist/client/assets/{use-panel-navigate-C5hBMKoK.js → use-panel-navigate-CYHQ9H_T.js} +1 -1
  340. package/dist/client/assets/{use-project-native-view-presence-BTvz93hM.js → use-project-native-view-presence-DG_OsicQ.js} +1 -1
  341. package/dist/client/assets/{use-project-scope-BOmNgUbL.js → use-project-scope-DTa66aFc.js} +1 -1
  342. package/dist/client/assets/{use-recent-apps-DnoPUgq-.js → use-recent-apps-BkiI05bl.js} +1 -1
  343. package/dist/client/assets/{use-releases-xYpnMQ0G.js → use-releases-3QZUJcU8.js} +1 -1
  344. package/dist/client/assets/{use-reports-diagnostic-CrPfCARR.js → use-reports-diagnostic-CFGQSOke.js} +1 -1
  345. package/dist/client/assets/{use-secrets-BK9OUQjp.js → use-secrets-CFDBcYIs.js} +1 -1
  346. package/dist/client/assets/{use-section-preview-base-D-BAP2Kx.js → use-section-preview-base-Bi0fZdk_.js} +1 -1
  347. package/dist/client/assets/{use-sidebar-collapsed-ztBUIrIJ.js → use-sidebar-collapsed-BDC4KJoA.js} +1 -1
  348. package/dist/client/assets/{use-tags-CRZAuKXI.js → use-tags-Ck-mty1R.js} +1 -1
  349. package/dist/client/assets/{use-task-board-analytics-C3khGqxr.js → use-task-board-analytics-K9XTOq2z.js} +1 -1
  350. package/dist/client/assets/{use-task-board-events-CEFK_U8B.js → use-task-board-events-Jz6kbe9R.js} +1 -1
  351. package/dist/client/assets/{use-task-board-item-prs-D_DLSRFh.js → use-task-board-item-prs-BGCAD4bx.js} +1 -1
  352. package/dist/client/assets/{use-task-metadata-DQNI_DYQ.js → use-task-metadata-CkrB-bRy.js} +1 -1
  353. package/dist/client/assets/{use-thread-analytics-CKrVTOjH.js → use-thread-analytics-BNcqqwBS.js} +1 -1
  354. package/dist/client/assets/{use-thread-outputs-fctBbSfO.js → use-thread-outputs-LnnMQYmj.js} +1 -1
  355. package/dist/client/assets/useInfiniteQuery-DhVIMVRh.js +1 -0
  356. package/dist/client/assets/{useQueries-DApBF_hk.js → useQueries-DsTjk3mN.js} +1 -1
  357. package/dist/client/assets/useSuspenseInfiniteQuery-BVpu0vkd.js +1 -0
  358. package/dist/client/assets/{users-B0WV36dy.js → users-CnjGVWpi.js} +1 -1
  359. package/dist/client/assets/{utils-DqDe2PdG.js → utils-CetO33tt.js} +1 -1
  360. package/dist/client/assets/{variant-calendar-Cw6bsyC8.js → variant-calendar-BVQKG7Pz.js} +1 -1
  361. package/dist/client/assets/{variant-draft-pointer-ybS7yl-Y.js → variant-draft-pointer-1XzXcLtg.js} +1 -1
  362. package/dist/client/assets/{view-mode-toggle-B4L0Gqe-.js → view-mode-toggle-BuqrnQGM.js} +1 -1
  363. package/dist/client/assets/{virtual-mcp-m7xS4Fyh.js → virtual-mcp-Ux8j-_02.js} +1 -1
  364. package/dist/client/assets/{watch-sse-pool-BZYzglPJ.js → watch-sse-pool-YHoQCS1I.js} +1 -1
  365. package/dist/client/index.html +2 -2
  366. package/dist/server/server.js +193 -193
  367. package/package.json +1 -1
  368. package/dist/client/assets/agent-app-BvW3NdzM.js +0 -1
  369. package/dist/client/assets/agent-deck-VsdzJHTb.js +0 -1
  370. package/dist/client/assets/agent-file-BS9xNFAD.js +0 -1
  371. package/dist/client/assets/agent-library-DGYQBCM9.js +0 -1
  372. package/dist/client/assets/agent-library-file-DewMMSvO.js +0 -1
  373. package/dist/client/assets/agent-overview-yn0Mx7V2.js +0 -1
  374. package/dist/client/assets/agent-settings-CSFW5nek.js +0 -1
  375. package/dist/client/assets/agent-site-editor-code-MU0whE6U.js +0 -2
  376. package/dist/client/assets/agent-site-editor-content-zSQpYEGg.js +0 -1
  377. package/dist/client/assets/agent-site-editor-preview-txveR_ds.js +0 -1
  378. package/dist/client/assets/agent-view-B4w7PCL8.js +0 -1
  379. package/dist/client/assets/api-keys-DZBvZYm9.js +0 -1
  380. package/dist/client/assets/cms-settings-editor-TWoAtc7Q.js +0 -1
  381. package/dist/client/assets/config-Ujr94uo2.js +0 -1
  382. package/dist/client/assets/flat-project-CoYmpFOt.js +0 -1
  383. package/dist/client/assets/home-Be7m5c5B.js +0 -1
  384. package/dist/client/assets/index-dF7Fpxre.css +0 -1
  385. package/dist/client/assets/library-DgG4D6VI.js +0 -1
  386. package/dist/client/assets/monitoring-Bbj5Lns2.js +0 -1
  387. package/dist/client/assets/plan-BlqG-PLe.js +0 -1
  388. package/dist/client/assets/project-apps-BccHfSJ8.js +0 -1
  389. package/dist/client/assets/project-reports-C5VIbCKB.js +0 -1
  390. package/dist/client/assets/project-tasks-DY-VwdNN.js +0 -1
  391. package/dist/client/assets/record-editor-CgQYmq0a.js +0 -1
  392. package/dist/client/assets/reports-CDdk6ylM.js +0 -1
  393. package/dist/client/assets/repositories-BLczkc5V.js +0 -1
  394. package/dist/client/assets/route-BJz_Tse0.js +0 -1
  395. package/dist/client/assets/settings-tab-BBqyUPly.js +0 -1
  396. package/dist/client/assets/site-editor-BGIwq6Fv.js +0 -1
  397. package/dist/client/assets/taskboard-analytics-DAGovxBg.js +0 -1
  398. package/dist/client/assets/tasks-DAULEt97.js +0 -1
  399. package/dist/client/assets/useInfiniteQuery-DYe2VDkL.js +0 -1
  400. package/dist/client/assets/useSuspenseInfiniteQuery-DrwXhpXt.js +0 -1
@@ -1 +1 @@
1
- import{c as w,j as s,b as B,eo as Q,l as O,z as fe,r as Z,d as me}from"./index-CNWJYHvX.js";import{b as q,C as J}from"./chart-D6QCrw1j.js";import{e as xe,a as pe,b as W,T as he,d as ge,c as je}from"./table-WldSmBJB.js";import{i as be}from"./AlertCircle-BGsPYuR3.js";import{i as ye,n as ve}from"./ArrowUp-BIUPa0Dd.js";import{a6 as ke,a3 as Ne,at as Se,ac as Ce}from"./agent-icon-BAsaPIPW.js";import{s as we}from"./User01-Cv65FqsE.js";import{V as ee}from"./view-mode-toggle-B4L0Gqe-.js";import{e as te}from"./format-time-Cq80KKvY.js";import{B as Y}from"./badge-Qo4xyqqo.js";import{l as se,c as $e,b as De,S as Oe}from"./config-Ujr94uo2.js";import{a as U,B as G}from"./BarChart-C93WKtUQ.js";import{C as H,X as P,Y as V}from"./CartesianChart-Dm7PETVH.js";import{A as Te,a as Ie}from"./AreaChart-CzXIOspF.js";function ne(a){const e=w.c(8),{href:t,className:d,children:o}=a,c=me();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/50 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 le(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"?le(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function X(a,e){return e==="s"?le(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const ae=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Be=/^\d{4}-\d{2}-\d{2}$/;function Le(a,e){return typeof a=="number"?M(a,e):Be.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):ae.test(a)?te(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=O("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 re(a){const e=w.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=se(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 Me(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:O("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ye,{size:12}):s.jsx(ve,{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 _e={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 Re(a){const e=w.c(10),{section:t,onDrill:d}=a,o=_e[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=O("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(Me,{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 Ae(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ke(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Ee(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 ie(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 border bg-background px-3 py-2 shadow-md",children:[u,x]}),e[14]=u,e[15]=x,e[16]=m):m=e[16],m}function Fe(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=Ae(t.points),i=r?Ke(t.points,n):n,u=b=>E[n.indexOf(b)%E.length],f=Object.fromEntries(i.map(b=>[b,{label:b,color:u(b)}])),m=(r&&d?Ee(t.points,n,d):t.points).map(ze);let h;if(e[7]!==t.title){let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=/\W+/g,e[9]=b):b=e[9],h=t.title.replace(b,"-"),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 y=j;let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=v):v=e[11];const k=v;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=b=>X(b,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 T=C;let D;e[20]!==r?(D=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=D):D=e[21];let I;e[22]!==c?(I=b=>{const{active:z,payload:ue}=b;return s.jsx(ie,{active:z,payload:ue,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==D?(N=s.jsx(J,{cursor:D,content:I}),e[24]=I,e[25]=D,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(b=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(b)}}),b]},b))}),children:m.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(q,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:f,children:r?s.jsxs(U,{data:m,margin:{left:0,right:0,top:8},children:[y,k,T,K,i.map((b,z)=>s.jsx(G,{dataKey:b,stackId:"day",fill:u(b),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},b))]}):s.jsxs(Te,{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})]})}),y,k,T,K,i.map(b=>s.jsx(Ie,{type:"linear",dataKey:b,stroke:u(b),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},b))]})})}),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 ze(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function oe(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&&O(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=O("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 y;e[12]!==o?(y=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]=y):y=e[13];let v;e[14]!==c?(v=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=v):v=e[15];let k;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==y||e[23]!==v?(k=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,y,v]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=y,e[23]=v,e[24]=k):k=e[24],k}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(oe,{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 Ge(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(He)),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(oe,{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 He(a){return a.value}function Pe(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Ve=new Set(["Org ID","Task ID"]),Xe=new Set(["Run outcome","Failure kind","Moved in by","State"]),Ye=new Set(["Error","Signature"]),Qe=new Set(["Org","Orgs"]);function We(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 y;e[23]!==o?(y=S=>{const{c:g}=S;return!Ve.has(g)&&(o!==!1||!Qe.has(g))},e[23]=o,e[24]=y):y=e[24];const v=h.map(tt).filter(y).sort(et);let k;e[25]!==t.rows?(k=S=>{const{j:g}=S,C=t.rows.map(T=>T[g]).filter(Je);return C.length>0&&C.every(qe)},e[25]=t.rows,e[26]=k):k=e[26];const $=new Set(v.filter(k).map(Ze));if(t.rows.length===1&&v.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=T=>{const{c:D,j:I}=T,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:D}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[D]):"—"})]},D)},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:v.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(xe,{variant:"flush",children:[s.jsx(pe,{children:s.jsx(W,{children:v.map(S=>{const{c:g}=S;return s.jsx(he,{className:O("whitespace-nowrap first:pl-4 last:pr-4",$.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(ge,{children:t.rows.map((S,g)=>s.jsx(W,{children:v.map((C,T)=>{const{c:D,j:I}=C,N=S[I],K=m===I?S[f]:null,b=T===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(je,{className:O("max-w-md truncate text-sm first:pl-4 last:pr-4",$.has(D)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Pe(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(fe,{size:12})]}):b?s.jsx("button",{type:"button",onClick:b,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(ne,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):D==="Lane"&&typeof N=="string"?s.jsx(re,{lane:N}):D==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ce,{drill:`priority:${N.toLowerCase()}`}),N]}):Xe.has(D)?s.jsx(Y,{variant:"muted",children:String(N)}):Ye.has(D)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:O("tnum",typeof N=="string"&&ae.test(N)&&"text-muted-foreground"),children:Le(N,t.units?.[D])})},D)})},`${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 qe(a){return typeof a=="number"}function Je(a){return a!==null}function et(a,e){return+(e.c==="Task")-+(a.c==="Task")}function tt(a,e){return{c:a,j:e}}function Ot(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"?te(m):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),y=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(be,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(re,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(ne,{href:d(f),className:O(F,"flex items-center gap-3 rounded-md p-2"),children:y}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:y})},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 st={Type:Ce,Priority:Se,Tag:Ne,Sprint:ke,"Brief by":we};function ce(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($e).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=O("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 nt(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 lt(a){const e=w.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.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(ee,{value:n?.label??"",onValueChange:r,options:t.dimensions.map(rt)}),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(at)]}),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:O("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&O(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(ce,{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(nt,{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 at(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function rt(a){const e=st[a.label];return{value:a.label,label:a.label,icon:e?s.jsx(e,{}):void 0}}const de=3;function it(a){const e=w.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(k=>k.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((k,$)=>t.cols[$]===k),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(de)}),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(ee,{value:n.key,onValueChange:r,options:t.metrics.map(ct)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let y;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==f||e[18]!==o||e[19]!==i?(y=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(ot),t.rows.map((k,$)=>s.jsx(dt,{row:k,section:t,metric:n,tint:i,onDrill:d,upTo:f?$:void 0},k))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=f,e[18]=o,e[19]=i,e[20]=y):y=e[20];let v;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==y?(v=s.jsx(_,{title:m,caption:p,aside:j,children:y}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=y,e[25]=v):v=e[25],v}function ot(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function ct(a){return{value:a.key,label:a.label}}function dt(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(k=>k.row===t&&k.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 y=j===null?0:Math.min(100,o.unit==="%"?j:0),v=L(r,p.drill,t===m?t:`${t} · ${m}`);return s.jsxs("button",{type:"button",onClick:v,disabled:!v,className:O("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",v&&"cursor-pointer hover:opacity-80",p.count<de&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+y*.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 ut(){const a=w.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?se(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function ft(a){const e=w.c(21),{section:t,onDrill:d}=a,o=B(),c=ut(),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(xt),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,y=t.categories.some(mt)&&!!d,v=l?Math.max(120,t.categories.length*44+32):220;let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k={fill:"var(--muted)",opacity:.4},e[17]=k):k=e[17];let $;e[18]!==c||e[19]!==r?($=s.jsx(J,{cursor:k,content:g=>{const{active:C,payload:T}=g;return s.jsx(ie,{active:C,payload:T,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(q,{role:"img","aria-label":t.title,className:"w-full",style:{height:v},config:x,children:l?s.jsxs(U,{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(G,{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(U,{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(G,{dataKey:g,fill:f(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:O(y&&"cursor-pointer"),onClick:(C,T)=>j(T)},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 mt(a){return a.drill}function xt(a){return{label:a.label,...a.values}}function Tt(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function It(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(Re,{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(Fe,{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(Ge,{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(lt,{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(it,{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(ft,{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(We,{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{Ot as D,It as S,Tt as s};
1
+ import{c as w,j as s,b as B,eo as Q,l as O,z as fe,r as Z,d as me}from"./index-eirpwNKj.js";import{b as q,C as J}from"./chart-CdJbyFrF.js";import{e as xe,a as pe,b as W,T as he,d as ge,c as je}from"./table-E7GbRtTD.js";import{i as be}from"./AlertCircle-Czw3GOXM.js";import{i as ye,n as ve}from"./ArrowUp-D1TV4x6T.js";import{a6 as ke,a3 as Ne,at as Se,ac as Ce}from"./agent-icon-C0Cpk_fI.js";import{s as we}from"./User01-Bb04dh7g.js";import{V as ee}from"./view-mode-toggle-BuqrnQGM.js";import{e as te}from"./format-time-Cq80KKvY.js";import{B as Y}from"./badge-O9zNBxIS.js";import{l as se,c as $e,b as De,S as Oe}from"./config-D3pVqIKI.js";import{a as U,B as G}from"./BarChart-BV8WJLUg.js";import{C as H,X as P,Y as V}from"./CartesianChart-ButQNI6T.js";import{A as Te,a as Ie}from"./AreaChart-BhM70eeA.js";function ne(a){const e=w.c(8),{href:t,className:d,children:o}=a,c=me();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/50 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 le(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"?le(a):e==="%"?`${Math.round(a*10)/10}%`:e==="USD"?`$${a.toFixed(2)}`:a.toLocaleString()}function X(a,e){return e==="s"?le(a):e==="%"?`${a}%`:e==="USD"?`$${a}`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const ae=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/,Be=/^\d{4}-\d{2}-\d{2}$/;function Le(a,e){return typeof a=="number"?M(a,e):Be.test(a)?new Date(`${a}T12:00:00Z`).toLocaleDateString(void 0,{month:"short",day:"numeric"}):ae.test(a)?te(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=O("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 re(a){const e=w.c(9),{lane:t}=a,d=B();let o;e[0]!==t||e[1]!==d?(o=se(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 Me(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:O("inline-flex items-center gap-0.5 font-medium",c&&(n?"text-success":"text-destructive")),children:[l>0?s.jsx(ye,{size:12}):s.jsx(ve,{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 _e={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 Re(a){const e=w.c(10),{section:t,onDrill:d}=a,o=_e[t.values.length]??"lg:grid-cols-4";let c;e[0]!==o?(c=O("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(Me,{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 Ae(a){return Array.from(new Set(a.flatMap(e=>Object.keys(e)))).filter(e=>e!=="t").sort()}function Ke(a,e){const t=e.filter(d=>a.some(o=>typeof o[d]=="number"&&o[d]!==0));return t.length>0?t:e}function Ee(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 ie(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 border bg-background px-3 py-2 shadow-md",children:[u,x]}),e[14]=u,e[15]=x,e[16]=m):m=e[16],m}function Fe(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=Ae(t.points),i=r?Ke(t.points,n):n,u=b=>E[n.indexOf(b)%E.length],f=Object.fromEntries(i.map(b=>[b,{label:b,color:u(b)}])),m=(r&&d?Ee(t.points,n,d):t.points).map(ze);let h;if(e[7]!==t.title){let b;e[9]===Symbol.for("react.memo_cache_sentinel")?(b=/\W+/g,e[9]=b):b=e[9],h=t.title.replace(b,"-"),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 y=j;let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=s.jsx(P,{dataKey:"label",axisLine:!1,tickLine:!1,tick:A,minTickGap:24,tickMargin:8}),e[11]=v):v=e[11];const k=v;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=b=>X(b,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 T=C;let D;e[20]!==r?(D=r?{fill:"var(--muted)",opacity:.4}:{stroke:"var(--border)",strokeDasharray:"4 4"},e[20]=r,e[21]=D):D=e[21];let I;e[22]!==c?(I=b=>{const{active:z,payload:ue}=b;return s.jsx(ie,{active:z,payload:ue,unit:c})},e[22]=c,e[23]=I):I=e[23];let N;e[24]!==I||e[25]!==D?(N=s.jsx(J,{cursor:D,content:I}),e[24]=I,e[25]=D,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(b=>s.jsxs("li",{className:"text-meta flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:u(b)}}),b]},b))}),children:m.length===0?s.jsx(R,{children:o("taskBoard.analytics.noDataInRange")}):s.jsx(q,{role:"img","aria-label":t.title,className:"h-[140px] w-full md:h-[180px]",config:f,children:r?s.jsxs(U,{data:m,margin:{left:0,right:0,top:8},children:[y,k,T,K,i.map((b,z)=>s.jsx(G,{dataKey:b,stackId:"day",fill:u(b),maxBarSize:24,radius:z===i.length-1?[4,4,0,0]:0,animationDuration:300},b))]}):s.jsxs(Te,{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})]})}),y,k,T,K,i.map(b=>s.jsx(Ie,{type:"linear",dataKey:b,stroke:u(b),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},b))]})})}),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 ze(a){return{...a,label:new Date(String(a.t??"")).toLocaleDateString(void 0,{month:"short",day:"numeric"})}}function oe(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&&O(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=O("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 y;e[12]!==o?(y=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]=y):y=e[13];let v;e[14]!==c?(v=s.jsx("span",{className:"tnum w-8 shrink-0 text-right text-sm text-foreground",children:c}),e[14]=c,e[15]=v):v=e[15];let k;return e[16]!==i||e[17]!==n||e[18]!==u||e[19]!==x||e[20]!==h||e[21]!==j||e[22]!==y||e[23]!==v?(k=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,y,v]})}),e[16]=i,e[17]=n,e[18]=u,e[19]=x,e[20]=h,e[21]=j,e[22]=y,e[23]=v,e[24]=k):k=e[24],k}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(oe,{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 Ge(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(He)),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(oe,{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 He(a){return a.value}function Pe(a,e){return`/${encodeURIComponent(a)}/${encodeURIComponent(e)}`}const Ve=new Set(["Org ID","Task ID"]),Xe=new Set(["Run outcome","Failure kind","Moved in by","State"]),Ye=new Set(["Error","Signature"]),Qe=new Set(["Org","Orgs"]);function We(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 y;e[23]!==o?(y=S=>{const{c:g}=S;return!Ve.has(g)&&(o!==!1||!Qe.has(g))},e[23]=o,e[24]=y):y=e[24];const v=h.map(tt).filter(y).sort(et);let k;e[25]!==t.rows?(k=S=>{const{j:g}=S,C=t.rows.map(T=>T[g]).filter(Je);return C.length>0&&C.every(qe)},e[25]=t.rows,e[26]=k):k=e[26];const $=new Set(v.filter(k).map(Ze));if(t.rows.length===1&&v.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=T=>{const{c:D,j:I}=T,N=g[I];return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("dt",{className:"text-meta",children:D}),s.jsx("dd",{className:"tnum text-2xl text-foreground",children:typeof N=="number"?M(N,t.units?.[D]):"—"})]},D)},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:v.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(xe,{variant:"flush",children:[s.jsx(pe,{children:s.jsx(W,{children:v.map(S=>{const{c:g}=S;return s.jsx(he,{className:O("whitespace-nowrap first:pl-4 last:pr-4",$.has(g)&&"text-right"),children:g==="Thread"?"":g},g)})})}),s.jsx(ge,{children:t.rows.map((S,g)=>s.jsx(W,{children:v.map((C,T)=>{const{c:D,j:I}=C,N=S[I],K=m===I?S[f]:null,b=T===0?L(r,t.drills?.[g]??void 0,String(N??"")):void 0;return s.jsx(je,{className:O("max-w-md truncate text-sm first:pl-4 last:pr-4",$.has(D)&&"text-right"),children:N==null?s.jsx("span",{className:"text-muted-foreground",children:"—"}):I===u?s.jsxs("a",{href:Pe(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(fe,{size:12})]}):b?s.jsx("button",{type:"button",onClick:b,className:"focus-ring text-left text-foreground underline-offset-2 hover:underline",children:String(N)}):K?s.jsx(ne,{href:c?.(String(K)),className:"focus-ring text-foreground underline-offset-2 hover:underline",children:String(N)}):D==="Lane"&&typeof N=="string"?s.jsx(re,{lane:N}):D==="Priority"&&typeof N=="string"?s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ce,{drill:`priority:${N.toLowerCase()}`}),N]}):Xe.has(D)?s.jsx(Y,{variant:"muted",children:String(N)}):Ye.has(D)?s.jsx("span",{title:String(N),className:"font-mono text-xs text-muted-foreground",children:String(N)}):s.jsx("span",{className:O("tnum",typeof N=="string"&&ae.test(N)&&"text-muted-foreground"),children:Le(N,t.units?.[D])})},D)})},`${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 qe(a){return typeof a=="number"}function Je(a){return a!==null}function et(a,e){return+(e.c==="Task")-+(a.c==="Task")}function tt(a,e){return{c:a,j:e}}function Ot(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"?te(m):null,h>0&&o(h===1?"taskBoard.analytics.humanActionsOne":"taskBoard.analytics.humanActions",{n:String(h)})].filter(Boolean),y=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(be,{className:"text-destructive"}),p===1?o("taskBoard.analytics.failedQa"):o("taskBoard.analytics.failedQaTimes",{n:String(p)})]}),typeof x=="string"&&s.jsx(re,{lane:x})]});return s.jsx("li",{className:"border-b border-border/50 last:border-b-0",children:d?s.jsx(ne,{href:d(f),className:O(F,"flex items-center gap-3 rounded-md p-2"),children:y}):s.jsx("div",{className:"flex items-center gap-3 p-2",children:y})},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 st={Type:Ce,Priority:Se,Tag:Ne,Sprint:ke,"Brief by":we};function ce(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($e).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=O("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 nt(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 lt(a){const e=w.c(16),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.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(ee,{value:n?.label??"",onValueChange:r,options:t.dimensions.map(rt)}),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(at)]}),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:O("grid h-11 items-center gap-4 border-b border-border/50 last:border-b-0",h&&O(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(ce,{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(nt,{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 at(a){return s.jsx("span",{className:"text-right",children:a.label},a.key)}function rt(a){const e=st[a.label];return{value:a.label,label:a.label,icon:e?s.jsx(e,{}):void 0}}const de=3;function it(a){const e=w.c(26),{section:t,onDrill:d}=a,o=B(),[c,r]=Z.useState(t.metrics[0]?.key??"");let l;e[0]!==c||e[1]!==t.metrics?(l=t.metrics.find(k=>k.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((k,$)=>t.cols[$]===k),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(de)}),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(ee,{value:n.key,onValueChange:r,options:t.metrics.map(ct)}),e[10]=n.key,e[11]=t.metrics,e[12]=j):j=e[12];let y;e[13]!==x||e[14]!==n||e[15]!==d||e[16]!==t||e[17]!==f||e[18]!==o||e[19]!==i?(y=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(ot),t.rows.map((k,$)=>s.jsx(dt,{row:k,section:t,metric:n,tint:i,onDrill:d,upTo:f?$:void 0},k))]})}),e[13]=x,e[14]=n,e[15]=d,e[16]=t,e[17]=f,e[18]=o,e[19]=i,e[20]=y):y=e[20];let v;return e[21]!==t.title||e[22]!==p||e[23]!==j||e[24]!==y?(v=s.jsx(_,{title:m,caption:p,aside:j,children:y}),e[21]=t.title,e[22]=p,e[23]=j,e[24]=y,e[25]=v):v=e[25],v}function ot(a){return s.jsx("span",{className:"text-meta self-end pb-1 text-center",children:a},a)}function ct(a){return{value:a.key,label:a.label}}function dt(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(k=>k.row===t&&k.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 y=j===null?0:Math.min(100,o.unit==="%"?j:0),v=L(r,p.drill,t===m?t:`${t} · ${m}`);return s.jsxs("button",{type:"button",onClick:v,disabled:!v,className:O("flex h-14 flex-col items-center justify-center rounded-md transition-opacity focus-ring",v&&"cursor-pointer hover:opacity-80",p.count<de&&"opacity-50"),style:{backgroundColor:`color-mix(in oklch, ${c} ${Math.round(8+y*.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 ut(){const a=w.c(2),e=B();let t;return a[0]!==e?(t=d=>Object.hasOwn(Oe,d)?se(d,e).label:d,a[0]=e,a[1]=t):t=a[1],t}function ft(a){const e=w.c(21),{section:t,onDrill:d}=a,o=B(),c=ut(),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(xt),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,y=t.categories.some(mt)&&!!d,v=l?Math.max(120,t.categories.length*44+32):220;let k;e[17]===Symbol.for("react.memo_cache_sentinel")?(k={fill:"var(--muted)",opacity:.4},e[17]=k):k=e[17];let $;e[18]!==c||e[19]!==r?($=s.jsx(J,{cursor:k,content:g=>{const{active:C,payload:T}=g;return s.jsx(ie,{active:C,payload:T,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(q,{role:"img","aria-label":t.title,className:"w-full",style:{height:v},config:x,children:l?s.jsxs(U,{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(G,{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(U,{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(G,{dataKey:g,fill:f(g),maxBarSize:32,radius:[4,4,0,0],animationDuration:300,className:O(y&&"cursor-pointer"),onClick:(C,T)=>j(T)},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 mt(a){return a.drill}function xt(a){return{label:a.label,...a.values}}function Tt(a){return a.kind==="funnel"||a.kind==="bars"?"half":"full"}function It(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(Re,{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(Fe,{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(Ge,{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(lt,{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(it,{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(ft,{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(We,{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{Ot as D,It as S,Tt as s};
@@ -1 +1 @@
1
- import{c as A,a2 as Q,J as R,K as Y,m as ce,o as W,e as U,j as i,g0 as de,b as F,r as O,eo as me,eW as J,B as v,t as q,v as V,aM as X,s as Z,I as ee,w as te,q as se,D as ie}from"./index-CNWJYHvX.js";import{i as ue}from"./AlertCircle-BGsPYuR3.js";import{a as fe}from"./Copy01-B6uJ5A3t.js";import{i as ne}from"./Key01-DBuAbIfl.js";import{s as le}from"./Plus-Dam4fGJv.js";import{s as ge}from"./Trash01-BWvgZ-My.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as De}from"./alert-dialog-BXsSwOCK.js";import{L as be}from"./label-DKrrhY82.js";import{u as M}from"./use-mcp-client-BqxufeFQ.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(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 H(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 Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=W();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 H(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],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=W();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(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],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ue,{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 Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();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(ge,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive 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 we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(ne,{size:20,className:"text-muted-foreground"})}),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]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(le,{size:14}),e[12]=m):m=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==f?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,f]}),e[15]=a,e[16]=f,e[17]=g):g=e[17];let u;return e[18]!==d||e[19]!==g?(u=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=u):u=e[20],u}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&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(V,{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(fe,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{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(v,{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 b;return e[36]!==s||e[37]!==D||e[38]!==n?(b=i.jsx(ie,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=b):b=e[39],b}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();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=z=>{z?r(z):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(V,{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=z=>c(z.target.value),e[26]=D):D=e[26];let b;e[27]!==s?(b=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=b):b=e[28];let S;e[29]!==n||e[30]!==b?(S=i.jsx(ee,{id:"api-key-name",value:n,onChange:D,placeholder:b,autoComplete:"off",required:!0}),e[29]=n,e[30]=b,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(te,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,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 $;return e[60]!==a||e[61]!==L||e[62]!==u?($=i.jsx(ie,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.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,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(v,{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(we,{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(Ne,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(De,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Qe(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Qe as O,Ae as a,Se as u};
1
+ import{c as A,a2 as Q,J as R,K as Y,m as ce,o as W,e as U,j as i,g0 as de,b as F,r as O,eo as me,eW as J,B as v,t as q,v as V,aM as X,s as Z,I as ee,w as te,q as se,D as ie}from"./index-eirpwNKj.js";import{i as ue}from"./AlertCircle-Czw3GOXM.js";import{a as fe}from"./Copy01-Br8MuAU9.js";import{i as ne}from"./Key01-Qdm6kw39.js";import{s as le}from"./Plus-D0ucptrV.js";import{s as ge}from"./Trash01-CyxedK0n.js";import{f as pe,e as ye,b as xe,A as he,a as je,d as Ke,c as Ce,g as De}from"./alert-dialog-DBOmU5EL.js";import{L as be}from"./label-BL4W2KPI.js";import{u as M}from"./use-mcp-client-DA050uNw.js";function H(t,e){if(t?.isError)throw new Error(t.content?.[0]?.text??e);if(!t.structuredContent)throw new Error(e);return t.structuredContent}function Ae(t){const e=A.c(11),{org:a}=Q();let r;e[0]!==a.id||e[1]!==a.slug?(r={connectionId:R,orgId:a.id,orgSlug:a.slug},e[0]=a.id,e[1]=a.slug,e[2]=r):r=e[2];const l=M(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 H(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 Se(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=W();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 H(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],U(c)}function ve(){const t=A.c(11),{org:e}=Q();let a;t[0]!==e.id||t[1]!==e.slug?(a={connectionId:R,orgId:e.id,orgSlug:e.slug},t[0]=e.id,t[1]=e.slug,t[2]=a):a=t[2];const r=M(a),l=W();let s;t[3]!==r?(s=async o=>{const d=await r.callTool({name:"API_KEY_DELETE",arguments:{keyId:o}});return H(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],U(c)}function ae(t){const e=A.c(6),{error:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(ue,{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 Ne(t){const e=A.c(20),{apiKey:a,onDelete:r}=t,l=F();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(ge,{size:14}),e[13]=f):f=e[13];let g;e[14]!==r||e[15]!==m?(g=i.jsx(v,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive 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 we(t){const e=A.c(21),{onCreate:a}=t,r=F();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:i.jsx(ne,{size:20,className:"text-muted-foreground"})}),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]!==s?(n=i.jsx("p",{className:"font-medium text-sm",children:s}),e[3]=s,e[4]=n):n=e[4];let c;e[5]!==r?(c=r("settings.apiKeys.emptyDescription"),e[5]=r,e[6]=c):c=e[6];let o;e[7]!==c?(o=i.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:c}),e[7]=c,e[8]=o):o=e[8];let d;e[9]!==n||e[10]!==o?(d=i.jsxs("div",{children:[n,o]}),e[9]=n,e[10]=o,e[11]=d):d=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=i.jsx(le,{size:14}),e[12]=m):m=e[12];let f;e[13]!==r?(f=r("settings.apiKeys.newKey"),e[13]=r,e[14]=f):f=e[14];let g;e[15]!==a||e[16]!==f?(g=i.jsxs(v,{onClick:a,size:"sm",className:"mt-2",children:[m,f]}),e[15]=a,e[16]=f,e[17]=g):g=e[17];let u;return e[18]!==d||e[19]!==g?(u=i.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[l,d,g]}),e[18]=d,e[19]=g,e[20]=u):u=e[20],u}function _e(t){const e=A.c(40),{createdKey:a,onClose:r}=t,l=F(),s=a!==null;let n;e[0]!==r?(n=S=>!S&&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(V,{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(fe,{size:14}),e[20]=C):C=e[20];let x;e[21]!==p||e[22]!==y?(x=i.jsx(v,{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(v,{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 b;return e[36]!==s||e[37]!==D||e[38]!==n?(b=i.jsx(ie,{open:s,onOpenChange:n,children:D}),e[36]=s,e[37]=D,e[38]=n,e[39]=b):b=e[39],b}function Pe(t){const e=A.c(64),{open:a,onOpenChange:r,onCreated:l}=t,s=F(),[n,c]=O.useState(""),o=Se();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=z=>{z?r(z):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(V,{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=z=>c(z.target.value),e[26]=D):D=e[26];let b;e[27]!==s?(b=s("settings.apiKeys.namePlaceholder"),e[27]=s,e[28]=b):b=e[28];let S;e[29]!==n||e[30]!==b?(S=i.jsx(ee,{id:"api-key-name",value:n,onChange:D,placeholder:b,autoComplete:"off",required:!0}),e[29]=n,e[30]=b,e[31]=S):S=e[31];let N;e[32]!==K||e[33]!==S?(N=i.jsxs("div",{className:"space-y-1.5",children:[K,S]}),e[32]=K,e[33]=S,e[34]=N):N=e[34];const re=o.isPending;let w;e[35]!==s?(w=s("settings.apiKeys.cancelButton"),e[35]=s,e[36]=w):w=e[36];let _;e[37]!==o.isPending||e[38]!==m||e[39]!==w?(_=i.jsx(v,{type:"button",variant:"outline",onClick:m,disabled:re,children:w}),e[37]=o.isPending,e[38]=m,e[39]=w,e[40]=_):_=e[40];let P;e[41]!==o.isPending||e[42]!==n?(P=o.isPending||!n.trim(),e[41]=o.isPending,e[42]=n,e[43]=P):P=e[43];let E;e[44]!==o.isPending||e[45]!==s?(E=o.isPending?s("settings.apiKeys.creatingButton"):s("settings.apiKeys.createButton"),e[44]=o.isPending,e[45]=s,e[46]=E):E=e[46];let T;e[47]!==P||e[48]!==E?(T=i.jsx(v,{type:"submit",disabled:P,children:E}),e[47]=P,e[48]=E,e[49]=T):T=e[49];let k;e[50]!==_||e[51]!==T?(k=i.jsxs(te,{children:[_,T]}),e[50]=_,e[51]=T,e[52]=k):k=e[52];let I;e[53]!==g||e[54]!==N||e[55]!==k?(I=i.jsxs("form",{onSubmit:g,className:"space-y-4",children:[N,k]}),e[53]=g,e[54]=N,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 $;return e[60]!==a||e[61]!==L||e[62]!==u?($=i.jsx(ie,{open:a,onOpenChange:u,children:L}),e[60]=a,e[61]=L,e[62]=u,e[63]=$):$=e[63],$}function Ee(){const t=F(),{data:e,isLoading:a,error:r}=Ae(),l=ve(),[s,n]=O.useState(!1),[c,o]=O.useState(null),[d,m]=O.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,{headerClassName:"px-0",title:t("settings.apiKeys.sectionTitle"),description:t("settings.apiKeys.sectionDescription"),actions:f.length>0?i.jsxs(v,{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(we,{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(Ne,{apiKey:u,onDelete:()=>m(u)},u.id))})}),i.jsx(Pe,{open:s,onOpenChange:n,onCreated:o}),i.jsx(_e,{createdKey:c,onClose:()=>o(null)}),i.jsx(pe,{open:d!==null,onOpenChange:u=>{u||m(null)},children:i.jsxs(ye,{children:[i.jsxs(xe,{children:[i.jsx(he,{children:t("settings.apiKeys.deleteTitle",{name:d?.name??""})}),i.jsx(je,{children:t("settings.apiKeys.deleteDescription")})]}),i.jsxs(Ke,{children:[i.jsx(Ce,{children:t("settings.apiKeys.cancelButton")}),i.jsx(De,{onClick:g,children:t("settings.apiKeys.deleteKey")})]})]})})]})}function Qe(){const t=A.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx(de,{group:"connect",errorFallback:Te,children:i.jsx(Ee,{})}),t[0]=e):e=t[0],e}function Te(t){const{error:e}=t;return i.jsx(ae,{error:e??new Error("Failed to load API keys")})}export{Ee as A,Qe as O,Ae as a,Se as u};
@@ -0,0 +1 @@
1
+ import{c as o,j as r}from"./index-eirpwNKj.js";import{O as e}from"./api-keys-CjBRjWKE.js";import{R as m}from"./require-capability-CBG6rA7o.js";import"./AlertCircle-Czw3GOXM.js";import"./Copy01-Br8MuAU9.js";import"./Key01-Qdm6kw39.js";import"./Plus-D0ucptrV.js";import"./Trash01-CyxedK0n.js";import"./alert-dialog-DBOmU5EL.js";import"./label-BL4W2KPI.js";import"./use-mcp-client-DA050uNw.js";import"./auth-BPJq9uZN.js";import"./access-gate-mycOF7cD.js";import"./capability-load-error-D5sZmG67.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 Et,b as Nt,r as E,j as o,av as Rt,l as Kt,h as Tt,t as xt}from"./index-CNWJYHvX.js";import{u as Ct}from"./chat-context-CHUVtsDo.js";import{S as Ft}from"./scroll-area-D7vhzfPi.js";import{u as Pt,A as Ot}from"./use-section-preview-base-D-BAP2Kx.js";import{A as Ut,ay as $t}from"./secret-ciphertext-CQx2VEMI.js";import{j as It,u as zt,A as Lt,J as Vt,D as qt,a as Dt,K as Mt}from"./blocks-tab-states-ZrFyRJRO.js";import{n as Zt,r as Gt}from"./content-tab-D6dlC_eK.js";import"./use-panel-navigate-C5hBMKoK.js";import"./thread-route-CKIN4nc-.js";import"./use-project-scope-BOmNgUbL.js";import"./repository-binding-CGk3ZX0j.js";import"./use-mcp-client-BqxufeFQ.js";import"./auth-BGlQUcUq.js";import"./autosend-C7UE5qBo.js";import"./thread-intent-DEna0N6y.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-BZYzglPJ.js";import"./task-board-Dg8D4L_r.js";import"./schema-BEutq4eJ.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-Qf3fSwYr.js";import"./use-ai-providers-Cp5F1VcY.js";import"./location-BjlyegC2.js";import"./use-organization-settings-CT_gWjCV.js";import"./index-BdQq_4o_.js";import"./UserSquare-jVbr-XG_.js";import"./agent-icon-BAsaPIPW.js";import"./AlertCircle-BGsPYuR3.js";import"./Tool01-C0tA6_WY.js";import"./ArrowUp-BIUPa0Dd.js";import"./ArrowLeft-BY0o9p-g.js";import"./LinkBroken01-COSlZBTJ.js";import"./ShoppingBag01-Di2JjyaO.js";import"./ZoomOut-DOsQL5PZ.js";import"./Building02-DRJukUHS.js";import"./CheckCircle-BMzfjrcN.js";import"./ChevronUp-gQvBs5Wr.js";import"./ChevronSelectorVertical-OsgtEFsS.js";import"./Copy01-B6uJ5A3t.js";import"./CreditCard01-CVvsJVHy.js";import"./DotsVertical-CRoDrMwf.js";import"./Image01-D3cjfdzm.js";import"./Globe04-mgILh7rR.js";import"./SwitchHorizontal01-CVhIGWzI.js";import"./Key01-DBuAbIfl.js";import"./Link01-BkraNRbc.js";import"./Monitor01-CSJlATNa.js";import"./Sun-CBRr2mzj.js";import"./Play-CS7ZIu7O.js";import"./Plus-Dam4fGJv.js";import"./SearchMd-BmY7B7q3.js";import"./Trash01-BWvgZ-My.js";import"./Upload01-Ayc3pkY7.js";import"./User01-Cv65FqsE.js";import"./Users01-C8djc4kj.js";import"./XClose-J1FWOmKL.js";import"./section-preview-url-7zfngvgW.js";import"./input-C14RAevO.js";import"./usage-stats-XZL_1T4w.js";import"./tool-namespace-rRU5qMc_.js";import"./form-BReygSsa.js";import"./label-DKrrhY82.js";import"./utils-CVEq3hMx.js";import"./markdown-Dkv8vF7I.js";import"./use-copy-B5Nw2ln-.js";import"./use-mobile-B-6bodzw.js";import"./tooltip-BwU3TfFp.js";import"./index-CB34n0pr.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./icon-button-BMIQVqVD.js";import"./file-type-icon-DrKVTY_y.js";import"./shell-layout-Cng6sPGR.js";import"./avatar-D92LQoMs.js";import"./use-clock-tick-Ea25VUYb.js";import"./command-DEXvL0cT.js";import"./index-DrCJgI2a.js";import"./integration-icon-A_JAytZI.js";import"./project-icon-C5PSWWOk.js";import"./new-project-dialog-N-lmXyX9.js";import"./repository-import-picker-BTeoI4rZ.js";import"./use-navigate-to-agent-B4nMFFrr.js";import"./repository-picker-CoWZ9iTd.js";import"./useInfiniteQuery-DYe2VDkL.js";import"./infiniteQueryObserver-BZJj1RTX.js";import"./collection-search-Da85q05W.js";import"./use-debounced-value-BOMWTPY3.js";import"./required-auth-layout-BtRjrHP0.js";import"./use-org-sso-B5w9Y6-K.js";import"./chat-draft-DxqHQ-qR.js";import"./select-DZhmnwp_.js";import"./tabs-D6AJgzOF.js";import"./use-deco-credits-DR8-Tka6.js";import"./toggle-group-COK-wW8I.js";import"./use-open-billing-url-BnVW18Te.js";import"./index-IZZ1QWYx.js";import"./checkbox-D1J9YzHt.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-D5cvllcj.js";import"./drawer-PNF7GPi2.js";import"./input-DQjMvdWZ.js";import"./suggestion-BWGM-l4J.js";import"./use-mcp-prompts-x85qdRTs.js";import"./use-org-fs-DvrG4oqK.js";import"./question-004-sINsf4GQ.js";import"./use-members-hZfDNsyQ.js";import"./use-org-auth-client-DbZXNKzp.js";import"./feature-paywall-CpCMXj0j.js";import"./plan-ladder-CsKZpYtk.js";import"./add-connection-dialog-9kRnWMWN.js";import"./extract-connection-data-B-l9PdV0.js";import"./metadata-D72DunRR.js";import"./connection-vIWlN3YD.js";import"./url-slug-COrOe0WW.js";import"./connection-card-BJdYhmjP.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-ynJNuYy7.js";import"./use-connection-K9rEqDx3.js";import"./schema-L6FFXvke.js";import"./connection-form-helpers-CEC9pgiR.js";import"./authenticate-and-persist-oauth-DawdQrNH.js";import"./mcp-oauth-B26YcM5J.js";import"./mcp-oauth-D8hJrLwY.js";import"./collection-tabs-Mlp_Rejx.js";import"./badge-Qo4xyqqo.js";import"./use-infinite-scroll-HwZjX02J.js";import"./useSuspenseInfiniteQuery-DrwXhpXt.js";import"./use-task-board-events-CEFK_U8B.js";import"./use-chat-layout-state-xTXMyKKk.js";import"./site-editor-toast-CB9KCYI4.js";import"./use-main-schema-v8-CEMheePi.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-DqDe2PdG.js";import"./index-CPKH5oCf.js";import"./pair-B8IyaaR6.js";import"./collapsible-4U8s9Q7m.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BTmNB3HB.js";import"./types-DRalEM3C.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-EBRPi3dD.js";import"./use-thread-outputs-fctBbSfO.js";import"./sandbox-git-api-CRxdlhrN.js";import"./alert-DVLk8Iin.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./switch-zkrdrMZj.js";import"./monaco-editor-BqY_G1yM.js";import"./editor-DOvs1ZAj.js";import"./calendar-O9AxJqnv.js";import"./editor-classes-BJdm0od6.js";import"./core.esm-C_n7cKI9.js";import"./sortable.esm-BMPY9Sd5.js";import"./view-mode-toggle-B4L0Gqe-.js";import"./combobox-BCOMReLT.js";import"./alert-dialog-BXsSwOCK.js";import"./search-input-Dujh_El7.js";import"./use-file-configs-DCrTPP04.js";import"./asset-utils-BYeUUuYD.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./empty-state-DRKp6xDi.js";import"./mustache-CKwi1qbg.js";import"./use-content-sync-C_a-vn-B.js";import"./sandbox-lifecycle-context-D_9evUyh.js";import"./empty-state-Czk_KZf6.js";function Ht(c,t){const m=(c.title||c.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),s=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",r=Zt(t,s);return{blockKey:r,data:{__resolveType:c.resolveType,name:r}}}function ei(c){const t=Et.c(88),{orgSlug:m,virtualMcpId:s,branch:r,blockKey:a,block:h,meta:n,decofile:d,title:kt,excludeFields:G,schemaPending:ht,previewBaseUrl:bt,notice:H,saveGuard:J,persistDefaults:Q}=c,W=ht===void 0?!1:ht,X=bt===void 0?null:bt,Y=Ct()?.taskId??null,p=Nt();let R;t[0]!==r||t[1]!==X||t[2]!==s?(R={virtualMcpId:s,branch:r,sandboxUrl:X},t[0]=r,t[1]=X,t[2]=s,t[3]=R):R=t[3];const b=Pt(R),u=typeof h?.__resolveType=="string"?h.__resolveType:"";let K;t[4]!==G||t[5]!==n||t[6]!==u?(K=Gt(u,n,G),t[4]=G,t[5]=n,t[6]=u,t[7]=K):K=t[7];const v=K;let T;t[8]!==v?(T=!!v&&Object.keys(v.properties??{}).length>0,t[8]=v,t[9]=T):T=t[9];const tt=T,vt=kt??(h?Ut(a,h,n):a);let C;t[10]!==r||t[11]!==m||t[12]!==s?(C={orgSlug:m,virtualMcpId:s,branch:r},t[10]=r,t[11]=m,t[12]=s,t[13]=C):C=t[13];let F;t[14]!==J?(F={guard:J},t[14]=J,t[15]=F):F=t[15];const{save:et,flush:ot,isPending:rt}=It(C,F);let P;t[16]!==r||t[17]!==m||t[18]!==s?(P={orgSlug:m,virtualMcpId:s,branch:r},t[16]=r,t[17]=m,t[18]=s,t[19]=P):P=t[19];const g=zt(P);let O;t[20]!==g||t[21]!==p?(O=Dt((e,i)=>g.mutate({blockKey:e,data:i},{onError:l=>xt.error(p("sectionsEditor.sectionsEditor.saveFailed",{error:l.message}))})),t[20]=g,t[21]=p,t[22]=O):O=t[22];const it=O,[jt,Bt]=E.useState(a),[st,gt]=E.useState(null),[mt,St]=E.useState(0);let U;t[23]===Symbol.for("react.memo_cache_sentinel")?(U=[],t[23]=U):U=t[23];const[S,yt]=E.useState(U),[pt,f]=E.useState(!1),$=E.useRef(null);jt!==a&&(Bt(a),gt(null),St(Qt),yt([]));let I;t[24]!==h?(I=h??{},t[24]=h,t[25]=I):I=t[25];const at=I;let y;t[26]!==st?(y=st??{},t[26]=st,t[27]=y):y=t[27];let z;t[28]!==at||t[29]!==y?(z={...at,...y},t[28]=at,t[29]=y,t[30]=z):z=t[30];const nt=z;let L;t[31]!==a||t[32]!==u||t[33]!==et?(L=e=>{const i=e;gt(i),et(a,{...i,__resolveType:u})},t[31]=a,t[32]=u,t[33]=et,t[34]=L):L=t[34];const lt=L;let V;t[35]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{yt(e)},t[35]=V):V=t[35];const N=V;let q;t[36]!==d||t[37]!==ot||t[38]!==g||t[39]!==p?(q=async(e,i)=>{try{const{blockKey:l,data:x}=Ht(e,d);await g.mutateAsync({blockKey:l,data:x}),xt.success(p("sandbox.appEditor.createdSection",{name:l})),i({__resolveType:l}),ot()}catch(l){const x=l,At=x instanceof Error?x.message:p("sandbox.appEditor.failedAddSection");throw xt.error(At),x}},t[36]=d,t[37]=ot,t[38]=g,t[39]=p,t[40]=q):q=t[40];const k=q;let D;t[41]!==f?(D=e=>{$.current=e.append,f(!0)},t[41]=f,t[42]=D):D=t[42];const ct=D;let M;t[43]!==k||t[44]!==f?(M=async e=>{const i=$.current;if(i)try{await k(e,l=>{i(l),f(!1),$.current=null})}catch{}},t[43]=k,t[44]=f,t[45]=M):M=t[45];const dt=M,ut=S.length>0?[vt,...S]:[],_t="flex h-full flex-col",wt="flex h-12 shrink-0 items-center justify-between border-b px-6",ft=ut.length>0?o.jsx("nav",{"aria-label":p("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:ut.map((e,i)=>{const l=i===ut.length-1,x=Lt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&o.jsx(Rt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{N(i===0?[]:Vt(S,i)),St(Jt)},title:x,className:Kt("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",l?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:x})]},`${x}-${i}`)})}):o.jsx("span",{className:"text-sm font-medium",children:vt});let j;t[46]!==rt?(j=o.jsx(Mt,{isPending:rt,isError:!1}),t[46]=rt,t[47]=j):j=t[47];let B;t[48]!==ft||t[49]!==j?(B=o.jsxs("div",{className:wt,children:[ft,j]}),t[48]=ft,t[49]=j,t[50]=B):B=t[50];let _;t[51]!==a||t[52]!==r||t[53]!==S||t[54]!==d||t[55]!==nt||t[56]!==mt||t[57]!==k||t[58]!==N||t[59]!==lt||t[60]!==ct||t[61]!==tt||t[62]!==n||t[63]!==m||t[64]!==Q||t[65]!==u||t[66]!==it||t[67]!==v||t[68]!==W||t[69]!==b||t[70]!==p||t[71]!==Y||t[72]!==s?(_=tt?o.jsx(qt,{schema:v,value:nt,onChange:lt,persistDefaults:Q,basePath:"",breadcrumbPath:S,onBreadcrumbChange:N,decofile:d,meta:n,onSaveReferencedBlock:it,previewBaseUrl:b,onAddSectionItem:k,onRequestAddSection:ct,sandbox:{orgSlug:m,virtualMcpId:s,branch:r,threadId:Y}},`${a}:${mt}`):W?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Tt,{className:"size-4"}),p("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:p($t(n,u)?"sandbox.appEditor.noEditableSchema":"sandbox.appEditor.schemaAwaitsBuild")}),t[51]=a,t[52]=r,t[53]=S,t[54]=d,t[55]=nt,t[56]=mt,t[57]=k,t[58]=N,t[59]=lt,t[60]=ct,t[61]=tt,t[62]=n,t[63]=m,t[64]=Q,t[65]=u,t[66]=it,t[67]=v,t[68]=W,t[69]=b,t[70]=p,t[71]=Y,t[72]=s,t[73]=_):_=t[73];let w;t[74]!==H||t[75]!==_?(w=o.jsx(Ft,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsxs("div",{className:"mx-auto max-w-xl",children:[H,_]})})}),t[74]=H,t[75]=_,t[76]=w):w=t[76];let A;t[77]!==pt||t[78]!==d||t[79]!==dt||t[80]!==n||t[81]!==b||t[82]!==f?(A=b&&o.jsx(Ot,{open:pt,onOpenChange:e=>{f(e),e||($.current=null)},meta:n,decofile:d,previewBaseUrl:b,onSelect:e=>{dt(e)}}),t[77]=pt,t[78]=d,t[79]=dt,t[80]=n,t[81]=b,t[82]=f,t[83]=A):A=t[83];let Z;return t[84]!==B||t[85]!==w||t[86]!==A?(Z=o.jsxs("div",{className:_t,children:[B,w,A]}),t[84]=B,t[85]=w,t[86]=A,t[87]=Z):Z=t[87],Z}function Jt(c){return c+1}function Qt(c){return c+1}export{ei as AppEditor};
1
+ import{c as Et,b as Nt,r as E,j as o,av as Rt,l as Kt,h as Tt,t as xt}from"./index-eirpwNKj.js";import{u as Ct}from"./chat-context-Dnn7Mdeu.js";import{S as Ft}from"./scroll-area-D2V3l6oK.js";import{u as Pt,A as Ot}from"./use-section-preview-base-Bi0fZdk_.js";import{A as Ut,ay as $t}from"./secret-ciphertext-BkXDtxC6.js";import{j as It,u as zt,A as Lt,J as Vt,D as qt,a as Dt,K as Mt}from"./blocks-tab-states-CXGOEMTq.js";import{n as Zt,r as Gt}from"./content-tab-BGK1XaKL.js";import"./use-panel-navigate-CYHQ9H_T.js";import"./thread-route-D0aLhRkR.js";import"./use-project-scope-DTa66aFc.js";import"./repository-binding-BNbbDYQQ.js";import"./use-mcp-client-DA050uNw.js";import"./auth-BPJq9uZN.js";import"./autosend-BRrz2Y4f.js";import"./thread-intent-DzC9Ji46.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-YHoQCS1I.js";import"./task-board-fU-Cl8m2.js";import"./schema-CviV2OeO.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-DTU6iW_4.js";import"./use-ai-providers-XvM2-sU7.js";import"./location-BjlyegC2.js";import"./use-organization-settings-BAyreMqm.js";import"./index-BdQq_4o_.js";import"./UserSquare-B_weldPC.js";import"./agent-icon-C0Cpk_fI.js";import"./AlertCircle-Czw3GOXM.js";import"./Tool01-C0454p2c.js";import"./ArrowUp-D1TV4x6T.js";import"./ArrowLeft-CBNZ6Kc8.js";import"./LinkBroken01-CJN7aOrV.js";import"./ShoppingBag01-DV74WoBV.js";import"./ZoomOut-DWT1qHXA.js";import"./Building02-BufOoi54.js";import"./CheckCircle-C6kHCEBQ.js";import"./ChevronUp-DZ6u-CDn.js";import"./ChevronSelectorVertical-CREWgR2i.js";import"./Copy01-Br8MuAU9.js";import"./CreditCard01-BLe5-9IQ.js";import"./DotsVertical-DgdCLmlp.js";import"./Image01-DxuLkpjX.js";import"./Globe04-BkNwdwoM.js";import"./SwitchHorizontal01-Ba0pyLay.js";import"./Key01-Qdm6kw39.js";import"./Link01-B4M7ojFg.js";import"./Monitor01-CHS3e170.js";import"./Sun-D0O3J2yf.js";import"./Play-Da27xlG_.js";import"./Plus-D0ucptrV.js";import"./SearchMd-0qnilUuy.js";import"./Trash01-CyxedK0n.js";import"./Upload01-BWpYXx52.js";import"./User01-Bb04dh7g.js";import"./Users01-CNd-hMC8.js";import"./XClose-BeqwQ2Ei.js";import"./section-preview-url-7zfngvgW.js";import"./input-DdEOORL2.js";import"./usage-stats-DViGt9Z5.js";import"./tool-namespace-DPiptzHh.js";import"./form-CGiGUgzW.js";import"./label-BL4W2KPI.js";import"./utils-CVEq3hMx.js";import"./markdown-BjPIZk-u.js";import"./use-copy-BS5soA37.js";import"./use-mobile-BsNhhNj1.js";import"./tooltip-DX3EibzC.js";import"./index-DZWoZhT5.js";import"./format-time-Cq80KKvY.js";import"./differenceInSeconds-C3x8sHUj.js";import"./icon-button-D0a6m1Sz.js";import"./file-type-icon-CBmuqe9u.js";import"./shell-layout-DS0Ye6S1.js";import"./avatar--bVWjvdf.js";import"./use-clock-tick--0G9fYV8.js";import"./command-BwFTVPCg.js";import"./index-Ct79h6Jq.js";import"./integration-icon-CKknGZhR.js";import"./project-icon-D_aSXDOt.js";import"./new-project-dialog-BMxQGh6T.js";import"./repository-import-picker-CMsE5EOk.js";import"./use-navigate-to-agent-y0z5Ii2q.js";import"./repository-picker-DOtWfpYo.js";import"./useInfiniteQuery-DhVIMVRh.js";import"./infiniteQueryObserver-47K3Cxqe.js";import"./collection-search-BiaY0GVT.js";import"./use-debounced-value-DGbphRsM.js";import"./required-auth-layout-Dz1OowhH.js";import"./use-org-sso-fQ5NHD0A.js";import"./chat-draft-QF0rnEVx.js";import"./select-C5-hj9Ts.js";import"./tabs-DWtBgLg_.js";import"./use-deco-credits-B7vnPi2P.js";import"./toggle-group-CRigS0R4.js";import"./use-open-billing-url-B2tbuRiV.js";import"./index-FsB7lUoK.js";import"./checkbox-_9cHZuVh.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-oZJ3oDMA.js";import"./drawer-CTSig7Vj.js";import"./input-BH9IvcPC.js";import"./suggestion-BtCYsnHk.js";import"./use-mcp-prompts-C_C6tlAY.js";import"./use-org-fs-QKl-Epzm.js";import"./question-004-sINsf4GQ.js";import"./use-members-C4ay671C.js";import"./use-org-auth-client-Cn5Gs8uE.js";import"./feature-paywall-5JkjVbP-.js";import"./plan-ladder-DL1JtpvS.js";import"./add-connection-dialog-BkWp2fK0.js";import"./extract-connection-data-C2M3P64h.js";import"./metadata-D72DunRR.js";import"./connection-DdsAVMED.js";import"./url-slug-BjYL2qGa.js";import"./connection-card-DquRZmyq.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-BDL4MHBS.js";import"./use-connection-C4wyl2ru.js";import"./schema-C1o97tHt.js";import"./connection-form-helpers-CppaGv96.js";import"./authenticate-and-persist-oauth-CEKJsXYr.js";import"./mcp-oauth-DJh33UXx.js";import"./mcp-oauth-DqMHjHip.js";import"./collection-tabs-BLEBGgk-.js";import"./badge-O9zNBxIS.js";import"./use-infinite-scroll-DYPYtqG2.js";import"./useSuspenseInfiniteQuery-BVpu0vkd.js";import"./use-task-board-events-Jz6kbe9R.js";import"./use-chat-layout-state-BEn27bqi.js";import"./site-editor-toast-C5e-1uEv.js";import"./use-main-schema-v8-BpRBE2if.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-CetO33tt.js";import"./index-DOjuGDiB.js";import"./pair-BERDoCro.js";import"./collapsible-CzHslCH_.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-afmtzlAD.js";import"./types-BmDn-Bmr.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./sheet-s29eirRf.js";import"./use-thread-outputs-LnnMQYmj.js";import"./sandbox-git-api-CRxdlhrN.js";import"./alert-fFwi0Rct.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./switch-COyvKYHV.js";import"./monaco-editor-frZbpSC4.js";import"./editor-B8TTVjFi.js";import"./calendar-DsjGYQg2.js";import"./editor-classes-BUSqIt7e.js";import"./core.esm-DnTbXhD8.js";import"./sortable.esm-DMQ-WncJ.js";import"./view-mode-toggle-BuqrnQGM.js";import"./combobox-CdVSN4C-.js";import"./alert-dialog-DBOmU5EL.js";import"./search-input-Bq9urCGV.js";import"./use-file-configs-dTlYe09H.js";import"./asset-utils-DRLxCAgr.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./empty-state-DIpCFPkI.js";import"./mustache-BE_jNzrX.js";import"./use-content-sync-BdbVP04j.js";import"./sandbox-lifecycle-context-Pb8-9nPA.js";import"./empty-state-DweMe7pE.js";function Ht(c,t){const m=(c.title||c.resolveType.split("/").pop()||"").replace(/\.(tsx?|jsx?)$/,"").replace(/[^A-Za-z0-9_-]/g,""),s=/^[A-Za-z]/.test(m)&&m.length>0?m:"Section",r=Zt(t,s);return{blockKey:r,data:{__resolveType:c.resolveType,name:r}}}function ei(c){const t=Et.c(88),{orgSlug:m,virtualMcpId:s,branch:r,blockKey:a,block:h,meta:n,decofile:d,title:kt,excludeFields:G,schemaPending:ht,previewBaseUrl:bt,notice:H,saveGuard:J,persistDefaults:Q}=c,W=ht===void 0?!1:ht,X=bt===void 0?null:bt,Y=Ct()?.taskId??null,p=Nt();let R;t[0]!==r||t[1]!==X||t[2]!==s?(R={virtualMcpId:s,branch:r,sandboxUrl:X},t[0]=r,t[1]=X,t[2]=s,t[3]=R):R=t[3];const b=Pt(R),u=typeof h?.__resolveType=="string"?h.__resolveType:"";let K;t[4]!==G||t[5]!==n||t[6]!==u?(K=Gt(u,n,G),t[4]=G,t[5]=n,t[6]=u,t[7]=K):K=t[7];const v=K;let T;t[8]!==v?(T=!!v&&Object.keys(v.properties??{}).length>0,t[8]=v,t[9]=T):T=t[9];const tt=T,vt=kt??(h?Ut(a,h,n):a);let C;t[10]!==r||t[11]!==m||t[12]!==s?(C={orgSlug:m,virtualMcpId:s,branch:r},t[10]=r,t[11]=m,t[12]=s,t[13]=C):C=t[13];let F;t[14]!==J?(F={guard:J},t[14]=J,t[15]=F):F=t[15];const{save:et,flush:ot,isPending:rt}=It(C,F);let P;t[16]!==r||t[17]!==m||t[18]!==s?(P={orgSlug:m,virtualMcpId:s,branch:r},t[16]=r,t[17]=m,t[18]=s,t[19]=P):P=t[19];const g=zt(P);let O;t[20]!==g||t[21]!==p?(O=Dt((e,i)=>g.mutate({blockKey:e,data:i},{onError:l=>xt.error(p("sectionsEditor.sectionsEditor.saveFailed",{error:l.message}))})),t[20]=g,t[21]=p,t[22]=O):O=t[22];const it=O,[jt,Bt]=E.useState(a),[st,gt]=E.useState(null),[mt,St]=E.useState(0);let U;t[23]===Symbol.for("react.memo_cache_sentinel")?(U=[],t[23]=U):U=t[23];const[S,yt]=E.useState(U),[pt,f]=E.useState(!1),$=E.useRef(null);jt!==a&&(Bt(a),gt(null),St(Qt),yt([]));let I;t[24]!==h?(I=h??{},t[24]=h,t[25]=I):I=t[25];const at=I;let y;t[26]!==st?(y=st??{},t[26]=st,t[27]=y):y=t[27];let z;t[28]!==at||t[29]!==y?(z={...at,...y},t[28]=at,t[29]=y,t[30]=z):z=t[30];const nt=z;let L;t[31]!==a||t[32]!==u||t[33]!==et?(L=e=>{const i=e;gt(i),et(a,{...i,__resolveType:u})},t[31]=a,t[32]=u,t[33]=et,t[34]=L):L=t[34];const lt=L;let V;t[35]===Symbol.for("react.memo_cache_sentinel")?(V=e=>{yt(e)},t[35]=V):V=t[35];const N=V;let q;t[36]!==d||t[37]!==ot||t[38]!==g||t[39]!==p?(q=async(e,i)=>{try{const{blockKey:l,data:x}=Ht(e,d);await g.mutateAsync({blockKey:l,data:x}),xt.success(p("sandbox.appEditor.createdSection",{name:l})),i({__resolveType:l}),ot()}catch(l){const x=l,At=x instanceof Error?x.message:p("sandbox.appEditor.failedAddSection");throw xt.error(At),x}},t[36]=d,t[37]=ot,t[38]=g,t[39]=p,t[40]=q):q=t[40];const k=q;let D;t[41]!==f?(D=e=>{$.current=e.append,f(!0)},t[41]=f,t[42]=D):D=t[42];const ct=D;let M;t[43]!==k||t[44]!==f?(M=async e=>{const i=$.current;if(i)try{await k(e,l=>{i(l),f(!1),$.current=null})}catch{}},t[43]=k,t[44]=f,t[45]=M):M=t[45];const dt=M,ut=S.length>0?[vt,...S]:[],_t="flex h-full flex-col",wt="flex h-12 shrink-0 items-center justify-between border-b px-6",ft=ut.length>0?o.jsx("nav",{"aria-label":p("sandbox.appEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:ut.map((e,i)=>{const l=i===ut.length-1,x=Lt(e);return o.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[i>0&&o.jsx(Rt,{className:"size-3 shrink-0 text-muted-foreground/60"}),o.jsx("button",{type:"button",onClick:()=>{N(i===0?[]:Vt(S,i)),St(Jt)},title:x,className:Kt("min-w-0 truncate rounded-lg px-1 py-0.5 text-left transition-colors",l?"font-medium text-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:x})]},`${x}-${i}`)})}):o.jsx("span",{className:"text-sm font-medium",children:vt});let j;t[46]!==rt?(j=o.jsx(Mt,{isPending:rt,isError:!1}),t[46]=rt,t[47]=j):j=t[47];let B;t[48]!==ft||t[49]!==j?(B=o.jsxs("div",{className:wt,children:[ft,j]}),t[48]=ft,t[49]=j,t[50]=B):B=t[50];let _;t[51]!==a||t[52]!==r||t[53]!==S||t[54]!==d||t[55]!==nt||t[56]!==mt||t[57]!==k||t[58]!==N||t[59]!==lt||t[60]!==ct||t[61]!==tt||t[62]!==n||t[63]!==m||t[64]!==Q||t[65]!==u||t[66]!==it||t[67]!==v||t[68]!==W||t[69]!==b||t[70]!==p||t[71]!==Y||t[72]!==s?(_=tt?o.jsx(qt,{schema:v,value:nt,onChange:lt,persistDefaults:Q,basePath:"",breadcrumbPath:S,onBreadcrumbChange:N,decofile:d,meta:n,onSaveReferencedBlock:it,previewBaseUrl:b,onAddSectionItem:k,onRequestAddSection:ct,sandbox:{orgSlug:m,virtualMcpId:s,branch:r,threadId:Y}},`${a}:${mt}`):W?o.jsxs("div",{className:"flex flex-col items-center gap-2 py-6 text-center text-xs text-muted-foreground",children:[o.jsx(Tt,{className:"size-4"}),p("sandbox.appEditor.loadingSchema")]}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:p($t(n,u)?"sandbox.appEditor.noEditableSchema":"sandbox.appEditor.schemaAwaitsBuild")}),t[51]=a,t[52]=r,t[53]=S,t[54]=d,t[55]=nt,t[56]=mt,t[57]=k,t[58]=N,t[59]=lt,t[60]=ct,t[61]=tt,t[62]=n,t[63]=m,t[64]=Q,t[65]=u,t[66]=it,t[67]=v,t[68]=W,t[69]=b,t[70]=p,t[71]=Y,t[72]=s,t[73]=_):_=t[73];let w;t[74]!==H||t[75]!==_?(w=o.jsx(Ft,{className:"min-h-0 min-w-0 flex-1 [&_[data-slot=scroll-area-viewport]>div]:!block",children:o.jsx("div",{className:"px-6 py-6",children:o.jsxs("div",{className:"mx-auto max-w-xl",children:[H,_]})})}),t[74]=H,t[75]=_,t[76]=w):w=t[76];let A;t[77]!==pt||t[78]!==d||t[79]!==dt||t[80]!==n||t[81]!==b||t[82]!==f?(A=b&&o.jsx(Ot,{open:pt,onOpenChange:e=>{f(e),e||($.current=null)},meta:n,decofile:d,previewBaseUrl:b,onSelect:e=>{dt(e)}}),t[77]=pt,t[78]=d,t[79]=dt,t[80]=n,t[81]=b,t[82]=f,t[83]=A):A=t[83];let Z;return t[84]!==B||t[85]!==w||t[86]!==A?(Z=o.jsxs("div",{className:_t,children:[B,w,A]}),t[84]=B,t[85]=w,t[86]=A,t[87]=Z):Z=t[87],Z}function Jt(c){return c+1}function Qt(c){return c+1}export{ei as AppEditor};
@@ -1 +1 @@
1
- import{c as u,a2 as d,e as g,an as m,K as I,o as O}from"./index-CNWJYHvX.js";import{u as $}from"./useInfiniteQuery-DYe2VDkL.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,a2 as d,e as g,an as m,K as I,o as O}from"./index-eirpwNKj.js";import{u as $}from"./useInfiniteQuery-DhVIMVRh.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{bc as v,bd as $,be as W,bf as H,bg as D,bh as y,bi as V,bj as q,bk as E,bl as x,bm as j,bn as N,bo as B,bp as Z,bq as F}from"./index-CNWJYHvX.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 L(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 T(c,{fetchFn:i}),!o)try{o=await M(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 O=!e.redirectUrl;if(n!==void 0||O){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 C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 M(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 x.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 b(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??E;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 b(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await b(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 T(e,{fetchFn:t=fetch,protocolVersion:n=E}={}){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()):q.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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 T(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 P(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 L(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=P(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=P(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 L(s);return j.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,M as d,me as e};
1
+ import{bc as v,bd as $,be as W,bf as H,bg as D,bh as y,bi as V,bj as q,bk as E,bl as x,bm as j,bn as N,bo as B,bp as Z,bq as F}from"./index-eirpwNKj.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 L(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 T(c,{fetchFn:i}),!o)try{o=await M(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 O=!e.redirectUrl;if(n!==void 0||O){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 C=e.state?await e.state():void 0,{authorizationUrl:z,codeVerifier:I}=await ue(c,{metadata:u,clientInformation:d,state:C,redirectUrl:e.redirectUrl,scope:A,resource:f});return await e.saveCodeVerifier(I),await e.redirectToAuthorization(z),"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 M(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 x.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 b(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??E;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 b(s,i,n);if(!r?.metadataUrl&&oe(o,a.pathname)){const c=new URL(`/.well-known/${t}`,a);o=await b(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 T(e,{fetchFn:t=fetch,protocolVersion:n=E}={}){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()):q.parse(await o.json())}}}async function ce(e,t){let n,r;try{n=await M(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 T(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 P(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 L(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=P(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=P(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 L(s);return j.parse(await s.json())}export{pe as U,T as a,_e as b,Ue as c,M 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-CNWJYHvX.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-eirpwNKj.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 $,a1 as Ne,r as b,e as ae,y as M,j as t,l as f,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-CNWJYHvX.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:v=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(v)||v<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${v}`);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>=v)throw new Pe(A,v);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:v,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(""),[_,x]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[W,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`,w=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:w?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(w?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:w?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:w?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:w?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),M(w?"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:()=>{M("password_reset_requested"),pe(!0)},onError:s=>{M("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"}),M("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),M("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)}),M("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:w?"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),ve&&J.reset(),we&&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,ve=J.error,we=K.error,ye=z.error||B.error,T=w?c.trim()&&_.trim()&&re.trim():R?c.trim():k?W?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=ve||we||ye||ke,Me=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}),M("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},We=R?a.resetPasswordTitle:k&&W?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&W?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:f("grid w-full",p?"gap-5":"gap-10"),children:[v??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:f("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:We}),Se&&t.jsx("p",{className:f("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&&W)&&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:()=>{Me(s.name)},className:f("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50 rounded-lg",p?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:f("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&&W)&&I&&(C||E.enabled)&&t.jsxs("div",{className:f("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:f("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:W?t.jsxs("form",{onSubmit:Te,className:f("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:f("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 rounded-lg"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:f(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:f("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:f("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:f("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 rounded-lg"}),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:f(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 rounded-lg"}),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:[w&&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 rounded-lg"})]}),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 rounded-lg"}),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}),!w&&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(x),required:!0,disabled:m,autoComplete:w?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:f("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:f("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:f("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?w?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:[w?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(w?"signIn":"signUp"),disabled:m,className:ie,children:w?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:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,v]=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)}),v(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 v=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{v({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){v({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:v,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=v===void 0?!0:v,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 x;return e[2]!==S||e[3]!==I?(x=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=x):x=e[4],x}if(h.enabled){let x;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(x=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]=x):x=e[8],x}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let x;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?(x=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]=x):x=e[20],x}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 $,a1 as Ne,r as b,e as ae,y as M,j as t,l as f,B as X,I as G,c as Ie,b as Ce,h as Ue}from"./index-eirpwNKj.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:v=5,minTimeout:g=1e3,jitter:r=1,isRetriable:u=()=>!0,signal:d}=e??{};if(!Number.isInteger(v)||v<1)throw new RangeError(`Cannot retry as 'maxAttempts' must be a positive integer: current value is ${v}`);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>=v)throw new Pe(A,v);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:v,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(""),[_,x]=b.useState(""),[re,ge]=b.useState(""),[oe,le]=b.useState(""),[W,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`,w=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:w?"sign_up":"sign_in",email:s,password:n,name:L});if(H.error)throw new Error(H.error.message||(w?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:w?"sign_up":"sign_in"})},onSuccess:()=>{h({type:"succeeded",method:"email_password",mode:w?"sign_up":"sign_in"}),globalThis.localStorage?.setItem("hasLoggedIn","true"),j.onAuthenticated(i??e)},onError:s=>{h({type:"failed",method:"email_password",mode:w?"sign_up":"sign_in",stage:"authenticate",error:s instanceof Error?s.message:String(s)}),M(w?"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:()=>{M("password_reset_requested"),pe(!0)},onError:s=>{M("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"}),M("email_otp_sent"),de(!0)},onError:s=>{h({type:"failed",method:"email_otp",stage:"send_otp",error:s instanceof Error?s.message:String(s)}),M("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)}),M("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:w?"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),ve&&J.reset(),we&&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,ve=J.error,we=K.error,ye=z.error||B.error,T=w?c.trim()&&_.trim()&&re.trim():R?c.trim():k?W?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=ve||we||ye||ke,Me=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}),M("social_signin_failed",{provider:s,error:L}),me(n instanceof Error?n:new Error(L))}},We=R?a.resetPasswordTitle:k&&W?a.verificationCodeTitle:o??a.welcomeTitle,Se=R?a.resetPasswordSubtitle:k&&W?a.codeSentTo(c):l===void 0?a.defaultSubtitle:l;return t.jsxs("div",{className:f("grid w-full",p?"gap-5":"gap-10"),children:[v??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:f("font-medium",p?"text-xl leading-7":"text-2xl leading-8"),children:We}),Se&&t.jsx("p",{className:f("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&&W)&&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:()=>{Me(s.name)},className:f("flex w-full items-center justify-center gap-3 bg-background px-3 text-sm font-medium text-foreground card-shadow transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50 rounded-lg",p?"h-11":"h-12"),children:[s.icon&&t.jsx("img",{src:s.icon,alt:"",className:f("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&&W)&&I&&(C||E.enabled)&&t.jsxs("div",{className:f("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:f("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:W?t.jsxs("form",{onSubmit:Te,className:f("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:f("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 rounded-lg"})]}),t.jsx(X,{type:"submit",size:p?"lg":"xl",disabled:m||!T,className:f(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:f("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:f("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:f("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 rounded-lg"}),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:f(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 rounded-lg"}),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:[w&&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 rounded-lg"})]}),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 rounded-lg"}),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}),!w&&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(x),required:!0,disabled:m,autoComplete:w?"new-password":"current-password",className:"h-11 rounded-lg"})]}),t.jsx("div",{className:f("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:f("p-1",!T&&"pointer-events-none"),children:t.jsx(X,{type:"submit",disabled:m||!T,className:f("w-full font-semibold"),size:"xl","aria-hidden":!T,children:m?w?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:[w?a.alreadyHaveAccount:a.dontHaveAccount,t.jsx("button",{type:"button",onClick:()=>Q(w?"signIn":"signUp"),disabled:m,className:ie,children:w?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:"/"}function Ge({redirectTo:i,onAuthEvent:e}){const o=Ce(),[l,v]=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)}),v(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 v=b.useEffectEvent(r=>{try{l?.(r)}catch{}}),g=b.useEffectEvent(o);return b.useEffect(()=>{(async()=>{v({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){v({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:v,title:g,subtitle:r,brand:u,copy:d,variant:P,allowedSocialProviders:A,allowPassword:O,onAuthEvent:S,onAuthenticated:E}=i,F=v===void 0?!0:v,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 x;return e[2]!==S||e[3]!==I?(x=t.jsx(Ge,{redirectTo:I,onAuthEvent:S}),e[2]=S,e[3]=I,e[4]=x):x=e[4],x}if(h.enabled){let x;return e[5]!==S||e[6]!==I||e[7]!==h.providerId?(x=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]=x):x=e[8],x}if(p.enabled||Z.enabled||ee.enabled||ne.enabled){let x;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?(x=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]=x):x=e[20],x}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-CNWJYHvX.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-eirpwNKj.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-B26YcM5J.js";import{i as p}from"./mcp-oauth-D8hJrLwY.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-DJh33UXx.js";import{i as p}from"./mcp-oauth-DqMHjHip.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 +1 @@
1
- import{c as W,b as Y,r as ee,l as Q,j as t,T as te,B as se,X as ie,V as ne,U as oe}from"./index-CNWJYHvX.js";import{B as ae}from"./badge-Qo4xyqqo.js";import{A as re,a as le,b as ce,c as me,g as ue,d as de,e as fe,f as ge}from"./alert-dialog-BXsSwOCK.js";import{A as xe,aC as pe}from"./agent-icon-BAsaPIPW.js";import{i as he}from"./DotsVertical-CRoDrMwf.js";import{s as je}from"./Trash01-BWvgZ-My.js";import{i as ve}from"./ZoomOut-DOsQL5PZ.js";import{c as we}from"./repository-binding-CGk3ZX0j.js";import{a as _e}from"./use-automations-eFmS2FKe.js";function Be(c){const e=W.c(89),{automation:s,showAgent:a,onClick:n}=c,i=Y(),{remove:o}=_e(),[l,H]=ee.useState(!1),r=we(a?s.virtual_mcp_id:void 0);let F;e[0]!==s.id||e[1]!==o?(F=()=>{o.mutate(s.id),H(!1)},e[0]=s.id,e[1]=o,e[2]=F):F=e[2];const U=F;let $;e[3]!==n?($=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=$):$=e[4];const X=$,q=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==q?(u=Q("inline-block size-2 rounded-full shrink-0",q),e[5]=q,e[6]=u):u=e[6];const G=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==G?(d=i(G),e[7]=i,e[8]=G,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]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,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(ae,{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]!==r||e[24]!==a?(h=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[23]=r,e[24]=a,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 v;e[30]!==s.nearest_next_run_at||e[31]!==s.trigger_count?(v=t.jsx(Ae,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[30]=s.nearest_next_run_at,e[31]=s.trigger_count,e[32]=v):v=e[32];let w;e[33]!==j||e[34]!==v?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[j,v]}),e[33]=j,e[34]=v,e[35]=w):w=e[35];const J=s.system_key&&"invisible";let _;e[36]!==J?(_=Q("shrink-0",J),e[36]=J,e[37]=_):_=e[37];let K;e[38]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(te,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(he,{size:16})})}),e[38]=K):K=e[38];let O,I;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=m=>{m.stopPropagation(),H(!0)},I=t.jsx(je,{size:16}),e[39]=O,e[40]=I):(O=e[39],I=e[40]);let b;e[41]!==i?(b=i("automations.automationListRow.delete"),e[41]=i,e[42]=b):b=e[42];let y;e[43]!==b?(y=t.jsxs(ie,{children:[K,t.jsx(ne,{align:"end",children:t.jsxs(oe,{variant:"destructive",onClick:O,children:[I,b]})})]}),e[43]=b,e[44]=y):y=e[44];let A;e[45]!==_||e[46]!==y?(A=t.jsx("div",{onClick:ye,onKeyDown:be,role:"presentation",className:_,children:y}),e[45]=_,e[46]=y,e[47]=A):A=e[47];let D;e[48]!==X||e[49]!==n||e[50]!==w||e[51]!==A||e[52]!==f||e[53]!==g?(D=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:X,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,A]}),e[48]=X,e[49]=n,e[50]=w,e[51]=A,e[52]=f,e[53]=g,e[54]=D):D=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(re,{children:N}),e[57]=N,e[58]=k):k=e[58];let R;e[59]!==s.name||e[60]!==i?(R=i("automations.automationListRow.deleteDescription",{name:s.name}),e[59]=s.name,e[60]=i,e[61]=R):R=e[61];let C;e[62]!==R?(C=t.jsx(le,{children:R}),e[62]=R,e[63]=C):C=e[63];let L;e[64]!==k||e[65]!==C?(L=t.jsxs(ce,{children:[k,C]}),e[64]=k,e[65]=C,e[66]=L):L=e[66];let T;e[67]!==i?(T=i("automations.automationListRow.cancel"),e[67]=i,e[68]=T):T=e[68];let P;e[69]!==T?(P=t.jsx(me,{children:T}),e[69]=T,e[70]=P):P=e[70];const Z=o.isPending;let z;e[71]!==i?(z=i("automations.automationListRow.deleteButton"),e[71]=i,e[72]=z):z=e[72];let B;e[73]!==U||e[74]!==o.isPending||e[75]!==z?(B=t.jsx(ue,{onClick:U,disabled:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:z}),e[73]=U,e[74]=o.isPending,e[75]=z,e[76]=B):B=e[76];let M;e[77]!==P||e[78]!==B?(M=t.jsxs(de,{children:[P,B]}),e[77]=P,e[78]=B,e[79]=M):M=e[79];let S;e[80]!==L||e[81]!==M?(S=t.jsxs(fe,{children:[L,M]}),e[80]=L,e[81]=M,e[82]=S):S=e[82];let E;e[83]!==l||e[84]!==S?(E=t.jsx(ge,{open:l,onOpenChange:H,children:S}),e[83]=l,e[84]=S,e[85]=E):E=e[85];let V;return e[86]!==D||e[87]!==E?(V=t.jsxs(t.Fragment,{children:[D,E]}),e[86]=D,e[87]=E,e[88]=V):V=e[88],V}function be(c){return c.stopPropagation()}function ye(c){return c.stopPropagation()}function Ae(c){const e=W.c(8),{triggerCount:s,nextRunAt:a}=c,n=Y();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||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:a?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(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ve,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Be as A};
1
+ import{c as W,b as Y,r as ee,l as Q,j as t,T as te,B as se,X as ie,V as ne,U as oe}from"./index-eirpwNKj.js";import{B as ae}from"./badge-O9zNBxIS.js";import{A as re,a as le,b as ce,c as me,g as ue,d as de,e as fe,f as ge}from"./alert-dialog-DBOmU5EL.js";import{A as xe,aC as pe}from"./agent-icon-C0Cpk_fI.js";import{i as he}from"./DotsVertical-DgdCLmlp.js";import{s as je}from"./Trash01-CyxedK0n.js";import{i as ve}from"./ZoomOut-DWT1qHXA.js";import{c as we}from"./repository-binding-BNbbDYQQ.js";import{a as _e}from"./use-automations-BP7Qo80Q.js";function Be(c){const e=W.c(89),{automation:s,showAgent:a,onClick:n}=c,i=Y(),{remove:o}=_e(),[l,H]=ee.useState(!1),r=we(a?s.virtual_mcp_id:void 0);let F;e[0]!==s.id||e[1]!==o?(F=()=>{o.mutate(s.id),H(!1)},e[0]=s.id,e[1]=o,e[2]=F):F=e[2];const U=F;let $;e[3]!==n?($=m=>{m.target===m.currentTarget&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),n())},e[3]=n,e[4]=$):$=e[4];const X=$,q=s.active&&s.trigger_count>0?"bg-success":"bg-muted-foreground/40";let u;e[5]!==q?(u=Q("inline-block size-2 rounded-full shrink-0",q),e[5]=q,e[6]=u):u=e[6];const G=s.active&&s.trigger_count>0?"automations.automationListRow.ariaActive":s.active?"automations.automationListRow.ariaNoTriggers":"automations.automationListRow.ariaPaused";let d;e[7]!==i||e[8]!==G?(d=i(G),e[7]=i,e[8]=G,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]!==r?.icon||e[14]!==r?.title||e[15]!==s.name||e[16]!==a?(g=a&&t.jsx(xe,{icon:r?.icon??null,name:r?.title??s.name,size:"xs",className:"shrink-0"}),e[13]=r?.icon,e[14]=r?.title,e[15]=s.name,e[16]=a,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(ae,{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]!==r||e[24]!==a?(h=a&&r&&t.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["· ",r.title]}),e[23]=r,e[24]=a,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 v;e[30]!==s.nearest_next_run_at||e[31]!==s.trigger_count?(v=t.jsx(Ae,{triggerCount:s.trigger_count,nextRunAt:s.nearest_next_run_at}),e[30]=s.nearest_next_run_at,e[31]=s.trigger_count,e[32]=v):v=e[32];let w;e[33]!==j||e[34]!==v?(w=t.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-0.5",children:[j,v]}),e[33]=j,e[34]=v,e[35]=w):w=e[35];const J=s.system_key&&"invisible";let _;e[36]!==J?(_=Q("shrink-0",J),e[36]=J,e[37]=_):_=e[37];let K;e[38]===Symbol.for("react.memo_cache_sentinel")?(K=t.jsx(te,{asChild:!0,children:t.jsx(se,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:t.jsx(he,{size:16})})}),e[38]=K):K=e[38];let O,I;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=m=>{m.stopPropagation(),H(!0)},I=t.jsx(je,{size:16}),e[39]=O,e[40]=I):(O=e[39],I=e[40]);let b;e[41]!==i?(b=i("automations.automationListRow.delete"),e[41]=i,e[42]=b):b=e[42];let y;e[43]!==b?(y=t.jsxs(ie,{children:[K,t.jsx(ne,{align:"end",children:t.jsxs(oe,{variant:"destructive",onClick:O,children:[I,b]})})]}),e[43]=b,e[44]=y):y=e[44];let A;e[45]!==_||e[46]!==y?(A=t.jsx("div",{onClick:ye,onKeyDown:be,role:"presentation",className:_,children:y}),e[45]=_,e[46]=y,e[47]=A):A=e[47];let D;e[48]!==X||e[49]!==n||e[50]!==w||e[51]!==A||e[52]!==f||e[53]!==g?(D=t.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:X,className:"group w-full flex items-center gap-3 px-4 py-3 border-b border-border text-left hover:bg-muted/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[f,g,w,A]}),e[48]=X,e[49]=n,e[50]=w,e[51]=A,e[52]=f,e[53]=g,e[54]=D):D=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(re,{children:N}),e[57]=N,e[58]=k):k=e[58];let R;e[59]!==s.name||e[60]!==i?(R=i("automations.automationListRow.deleteDescription",{name:s.name}),e[59]=s.name,e[60]=i,e[61]=R):R=e[61];let C;e[62]!==R?(C=t.jsx(le,{children:R}),e[62]=R,e[63]=C):C=e[63];let L;e[64]!==k||e[65]!==C?(L=t.jsxs(ce,{children:[k,C]}),e[64]=k,e[65]=C,e[66]=L):L=e[66];let T;e[67]!==i?(T=i("automations.automationListRow.cancel"),e[67]=i,e[68]=T):T=e[68];let P;e[69]!==T?(P=t.jsx(me,{children:T}),e[69]=T,e[70]=P):P=e[70];const Z=o.isPending;let z;e[71]!==i?(z=i("automations.automationListRow.deleteButton"),e[71]=i,e[72]=z):z=e[72];let B;e[73]!==U||e[74]!==o.isPending||e[75]!==z?(B=t.jsx(ue,{onClick:U,disabled:Z,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:z}),e[73]=U,e[74]=o.isPending,e[75]=z,e[76]=B):B=e[76];let M;e[77]!==P||e[78]!==B?(M=t.jsxs(de,{children:[P,B]}),e[77]=P,e[78]=B,e[79]=M):M=e[79];let S;e[80]!==L||e[81]!==M?(S=t.jsxs(fe,{children:[L,M]}),e[80]=L,e[81]=M,e[82]=S):S=e[82];let E;e[83]!==l||e[84]!==S?(E=t.jsx(ge,{open:l,onOpenChange:H,children:S}),e[83]=l,e[84]=S,e[85]=E):E=e[85];let V;return e[86]!==D||e[87]!==E?(V=t.jsxs(t.Fragment,{children:[D,E]}),e[86]=D,e[87]=E,e[88]=V):V=e[88],V}function be(c){return c.stopPropagation()}function ye(c){return c.stopPropagation()}function Ae(c){const e=W.c(8),{triggerCount:s,nextRunAt:a}=c,n=Y();if(s===0){let o;e[0]!==n?(o=n("automations.automationListRow.noTriggers"),e[0]=n,e[1]=o):o=e[1];let l;return e[2]!==o?(l=t.jsx("span",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=l):l=e[3],l}let i;return e[4]!==a||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:a?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(a).toLocaleString()})})]}):t.jsxs(t.Fragment,{children:[t.jsx(ve,{size:12,className:"shrink-0"}),t.jsx("span",{className:"truncate",children:n("automations.automationListRow.triggers",{count:s})})]})}),e[4]=a,e[5]=n,e[6]=s,e[7]=i):i=e[7],i}export{Be as A};