decocms 4.451.0 → 4.451.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/dist/client/assets/{AlertCircle-DrwoGJpd.js → AlertCircle-DDHQi3fm.js} +1 -1
  2. package/dist/client/assets/{AreaChart-BAAHWXOl.js → AreaChart-xcCkJdeX.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DKYwT7KB.js → ArrowLeft-CIsJnvjF.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-NsPNRi9p.js → ArrowUp-CtvQk6Vg.js} +1 -1
  5. package/dist/client/assets/{Building02-DlH3FV2M.js → Building02-BVSXudo-.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-8XeONUcg.js → CartesianChart-YXdY8HHd.js} +1 -1
  7. package/dist/client/assets/{Check-BcGsLSsp.js → Check-Cf-cMW3t.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-iXm3h-fF.js → CheckCircle-BemNEpVg.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-BAvbedXO.js → ChevronUp-B79uJeZN.js} +1 -1
  10. package/dist/client/assets/{Copy01-C_KnfAlj.js → Copy01-DluK-JtU.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-B7CL5INn.js → CreditCard01-BzBUMTax.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-wjfpXF6W.js → DotsVertical-COzw8ydu.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-JpptrruU.js → ErrorBarContext-CICGscAV.js} +1 -1
  14. package/dist/client/assets/{Image01-BVwA4uCp.js → Image01-DnRAAkhy.js} +1 -1
  15. package/dist/client/assets/{Key01-C3aJH3VU.js → Key01-DXvy1NNO.js} +1 -1
  16. package/dist/client/assets/{Line-CE2RR3X9.js → Line-DooN19Jn.js} +1 -1
  17. package/dist/client/assets/{Link01-BezCCi1I.js → Link01-iwXPIeVc.js} +1 -1
  18. package/dist/client/assets/{LinkBroken01-CYAPpruG.js → LinkBroken01-ChSpe7Cq.js} +1 -1
  19. package/dist/client/assets/{LinkExternal01-D_cGFYPK.js → LinkExternal01-BVDnNs6j.js} +1 -1
  20. package/dist/client/assets/{Monitor01-R0RI8JD-.js → Monitor01-BLZH5esy.js} +1 -1
  21. package/dist/client/assets/{Palette-Bh_thK5-.js → Palette-CaKXG6S_.js} +1 -1
  22. package/dist/client/assets/{Plus-GNsqHUli.js → Plus-DjsQQqpw.js} +1 -1
  23. package/dist/client/assets/{SearchMd-DeSQISfo.js → SearchMd-oXON6Mge.js} +1 -1
  24. package/dist/client/assets/{Sector-CPFqrWxD.js → Sector-Df4GIa0t.js} +1 -1
  25. package/dist/client/assets/{ShoppingBag01-P4dMHDVk.js → ShoppingBag01-DktiI11o.js} +1 -1
  26. package/dist/client/assets/{Sun-7PdNidQ5.js → Sun-BWosC3Su.js} +1 -1
  27. package/dist/client/assets/{Tool01-CWjV8YTI.js → Tool01-BchdJG2X.js} +1 -1
  28. package/dist/client/assets/{Trash01-BJ_e57Kj.js → Trash01-BfnCKCGB.js} +1 -1
  29. package/dist/client/assets/{Upload01-3jf5OQDv.js → Upload01-CNtxqXvb.js} +1 -1
  30. package/dist/client/assets/{User01-CN7JcgS_.js → User01-DXNh3TnB.js} +1 -1
  31. package/dist/client/assets/{UserSquare-CEkD4_s5.js → UserSquare-DZJwwd71.js} +1 -1
  32. package/dist/client/assets/{Users01-B-RFC-RT.js → Users01-DAfCqIN7.js} +1 -1
  33. package/dist/client/assets/{X-DvEbwZ22.js → X-C52mq3mn.js} +1 -1
  34. package/dist/client/assets/{XAxis-DdJd7RhS.js → XAxis-DgLHWAdH.js} +1 -1
  35. package/dist/client/assets/{XClose-eArhRgkd.js → XClose-BqRoe3QG.js} +1 -1
  36. package/dist/client/assets/{ZoomOut-B5FfXkUf.js → ZoomOut-BlDSjKri.js} +1 -1
  37. package/dist/client/assets/{access-gate-Cno0bRAg.js → access-gate-DbBQLMiF.js} +1 -1
  38. package/dist/client/assets/{add-connection-dialog-BRrDiP3N.js → add-connection-dialog-Bll7Vib1.js} +1 -1
  39. package/dist/client/assets/{agent-analytics-ZqkZ1GcW.js → agent-analytics-DRKGLO_x.js} +1 -1
  40. package/dist/client/assets/agent-app-DI84JCkP.js +1 -0
  41. package/dist/client/assets/{agent-assets-2FdntYeU.js → agent-assets-D9BHI5EW.js} +1 -1
  42. package/dist/client/assets/{agent-automation-DeOilbKj.js → agent-automation-ClR5yW20.js} +1 -1
  43. package/dist/client/assets/{agent-automations-CU5BfClm.js → agent-automations-CCiWhcgf.js} +1 -1
  44. package/dist/client/assets/{agent-connect-sources-BlWCNkZ9.js → agent-connect-sources-DFTkcmVS.js} +1 -1
  45. package/dist/client/assets/agent-deck-CgsUwnay.js +1 -0
  46. package/dist/client/assets/{agent-e2e-Dp5CImx5.js → agent-e2e-pbVC7Vx7.js} +1 -1
  47. package/dist/client/assets/{agent-experiments-CT9FOKqn.js → agent-experiments-_aODOZpq.js} +1 -1
  48. package/dist/client/assets/{agent-file-BWzZimsi.js → agent-file-DtN8kaxY.js} +1 -1
  49. package/dist/client/assets/{agent-git-C1iinKRI.js → agent-git-BCddyL27.js} +1 -1
  50. package/dist/client/assets/{agent-hosting-BsslI9uH.js → agent-hosting-CgLWSfX9.js} +1 -1
  51. package/dist/client/assets/{agent-icon-CfuzWIKW.js → agent-icon-DEoEcQYL.js} +1 -1
  52. package/dist/client/assets/agent-library-BMVOMtwg.js +1 -0
  53. package/dist/client/assets/agent-library-file-Bs_Ov692.js +1 -0
  54. package/dist/client/assets/{agent-monitor-C2aIDenY.js → agent-monitor-YUBiIydT.js} +1 -1
  55. package/dist/client/assets/{agent-overview-DDbsx1gU.js → agent-overview-HCAO8obL.js} +1 -1
  56. package/dist/client/assets/agent-settings-JOvgc7kq.js +1 -0
  57. package/dist/client/assets/{agent-site-editor-xt5GtnuW.js → agent-site-editor-DH5igdCT.js} +1 -1
  58. package/dist/client/assets/agent-site-editor-code-De-iSok_.js +2 -0
  59. package/dist/client/assets/{agent-site-editor-content-Cboi32wv.js → agent-site-editor-content-Ch2WC4sl.js} +7 -7
  60. package/dist/client/assets/{agent-site-editor-preview-C9chmhlV.js → agent-site-editor-preview-BBSy8s7P.js} +3 -3
  61. package/dist/client/assets/agent-view-BtBtSuEv.js +1 -0
  62. package/dist/client/assets/{agent-view-guard-Vq5CpblU.js → agent-view-guard-BYimT8Jz.js} +1 -1
  63. package/dist/client/assets/{agents-list-L_NaMW9r.js → agents-list-C434Mp2b.js} +1 -1
  64. package/dist/client/assets/{ai-providers-C1Gld-NP.js → ai-providers-DINDBcoG.js} +1 -1
  65. package/dist/client/assets/{alert-DSDuF6qI.js → alert-_Nu0OQ4m.js} +1 -1
  66. package/dist/client/assets/{alert-dialog-BbSmZoVi.js → alert-dialog-D9wz_Poi.js} +1 -1
  67. package/dist/client/assets/{analytics-sections-B7erlEU9.js → analytics-sections-_zTIyETq.js} +1 -1
  68. package/dist/client/assets/api-keys-2hDzDTH9.js +1 -0
  69. package/dist/client/assets/{api-keys-DJHmuI-k.js → api-keys-tqQH4z9A.js} +1 -1
  70. package/dist/client/assets/app-editor-BqD9kpqg.js +1 -0
  71. package/dist/client/assets/{asset-utils-CiYXoNyJ.js → asset-utils-WUpNFBXm.js} +1 -1
  72. package/dist/client/assets/{auth-5kOh9gsa.js → auth-DDdLUET9.js} +1 -1
  73. package/dist/client/assets/{auth-catchall-DxlXq7tK.js → auth-catchall-mR81Birw.js} +1 -1
  74. package/dist/client/assets/{auth-entry-Exunf2v5.js → auth-entry-DCUAgWIX.js} +1 -1
  75. package/dist/client/assets/{auth-split-layout-BAIpdvCx.js → auth-split-layout-FX4F99rm.js} +1 -1
  76. package/dist/client/assets/{authenticate-and-persist-oauth-IbhNDJn9.js → authenticate-and-persist-oauth-Bb2l090x.js} +1 -1
  77. package/dist/client/assets/{automation-list-row-BGPK9DDr.js → automation-list-row-SxUdqZJz.js} +1 -1
  78. package/dist/client/assets/{automation-runs-79Bdx95q.js → automation-runs-Cw-2J5pa.js} +1 -1
  79. package/dist/client/assets/{automations-DEsgrDFl.js → automations-DXUfchhU.js} +1 -1
  80. package/dist/client/assets/{autosend-CsHrH9Xo.js → autosend-CeDtnxlk.js} +1 -1
  81. package/dist/client/assets/{avatar-CrasAAzq.js → avatar-BeFEVdWT.js} +1 -1
  82. package/dist/client/assets/{badge-BrDXjbHd.js → badge-Dw0XHZAq.js} +1 -1
  83. package/dist/client/assets/block-document-HhERskFc.js +3 -0
  84. package/dist/client/assets/{blocks-preview-workspace-context-DAcrAS0Y.js → blocks-preview-workspace-context-BqdqlnAP.js} +1 -1
  85. package/dist/client/assets/{blog-schema-CpOSYi5o.js → blog-schema-Bzw5lTdw.js} +1 -1
  86. package/dist/client/assets/{buckets-CJHv6B92.js → buckets-C_vclPuO.js} +1 -1
  87. package/dist/client/assets/{build-improve-prompt-doc-Dp9hBbaC.js → build-improve-prompt-doc-DG46Mbz-.js} +1 -1
  88. package/dist/client/assets/{calendar-DJbd_Mk0.js → calendar-BGvJ_APz.js} +1 -1
  89. package/dist/client/assets/{capability-load-error-B8JQAANB.js → capability-load-error-m8D5eiRW.js} +1 -1
  90. package/dist/client/assets/category-editor-BoAaFme1.js +1 -0
  91. package/dist/client/assets/{chart-CrYOX1s7.js → chart-AQf5J0lZ.js} +1 -1
  92. package/dist/client/assets/{chat-context-CbVc7tEo.js → chat-context-DHGUafJ4.js} +1 -1
  93. package/dist/client/assets/{chat-draft-DCJfKWx2.js → chat-draft-Du6X8nKJ.js} +1 -1
  94. package/dist/client/assets/{checkbox-C68xjrg5.js → checkbox-D-g_vU3W.js} +1 -1
  95. package/dist/client/assets/{choose-editor-9DBH_8WX.js → choose-editor-DJMezn9k.js} +1 -1
  96. package/dist/client/assets/{claim-phase-copy-C42LUZgr.js → claim-phase-copy-BTrkr4bY.js} +1 -1
  97. package/dist/client/assets/{cli-auth-success-CQ-Ph_Z8.js → cli-auth-success-M_9Lwmu5.js} +1 -1
  98. package/dist/client/assets/{client-icons-B2afUpOp.js → client-icons-Do1roBGh.js} +1 -1
  99. package/dist/client/assets/{collapsible-BouI-hE9.js → collapsible-DUefED3P.js} +1 -1
  100. package/dist/client/assets/{collection-detail-BIyd346E.js → collection-detail-CuQUNXH_.js} +1 -1
  101. package/dist/client/assets/{collection-display-button-CJGrnpdv.js → collection-display-button-CMHxbURQ.js} +1 -1
  102. package/dist/client/assets/{collection-search-FRa3rbYr.js → collection-search-CKxipBbw.js} +1 -1
  103. package/dist/client/assets/{collection-table-wrapper-CWM8G_TB.js → collection-table-wrapper-CN227TJm.js} +1 -1
  104. package/dist/client/assets/{collection-tabs-JVe-o8Om.js → collection-tabs-z-VIWVMA.js} +1 -1
  105. package/dist/client/assets/{column-rules-D2GeNGaF.js → column-rules-BOkclOCh.js} +1 -1
  106. package/dist/client/assets/{combobox-BYzyVsfP.js → combobox-D_pkyBdU.js} +1 -1
  107. package/dist/client/assets/{command-DA3SiBwF.js → command-B-LkMxT6.js} +1 -1
  108. package/dist/client/assets/{companion-mcps-section-nJ90DS7n.js → companion-mcps-section-BPWHNlmG.js} +1 -1
  109. package/dist/client/assets/{config-CiQU6gsO.js → config-F8FEDZHV.js} +1 -1
  110. package/dist/client/assets/{connect-BfDqgAhE.js → connect-CSAnQalo.js} +1 -1
  111. package/dist/client/assets/{connect-layout-D9lxOI4T.js → connect-layout-CSKeZ95g.js} +1 -1
  112. package/dist/client/assets/{connection-B1RIZdkW.js → connection-Da57b2wi.js} +1 -1
  113. package/dist/client/assets/{connection-card-CBKnCj0k.js → connection-card-UvAhqwBj.js} +1 -1
  114. package/dist/client/assets/{connection-detail-DCoDGHIg.js → connection-detail-C-Hcx_Z9.js} +1 -1
  115. package/dist/client/assets/{connection-form-helpers-CTzk01jW.js → connection-form-helpers-DyaTkO-i.js} +1 -1
  116. package/dist/client/assets/{connections-g7AYRhCW.js → connections-B2s4aP98.js} +1 -1
  117. package/dist/client/assets/{context-CtvGGIuc.js → context-BPEjFj2c.js} +1 -1
  118. package/dist/client/assets/{context-menu-BHpyeRN3.js → context-menu-D65fsibc.js} +1 -1
  119. package/dist/client/assets/{create-organization-dialog-DM0EVF-D.js → create-organization-dialog-rmBJe-TK.js} +1 -1
  120. package/dist/client/assets/{daily-pulse-BOdn-UxC.js → daily-pulse-39bOcAjW.js} +1 -1
  121. package/dist/client/assets/{decopilot-BEZXwH2l.js → decopilot-CDg-MCtI.js} +1 -1
  122. package/dist/client/assets/{device-hint-Bcob3UqV.js → device-hint-BckoyQwI.js} +1 -1
  123. package/dist/client/assets/{dialog-BJny2srB.js → dialog-C9YQM7Rb.js} +1 -1
  124. package/dist/client/assets/{discover-Be00RGyY.js → discover-B4mPS-t0.js} +1 -1
  125. package/dist/client/assets/{domain-settings-ChkNgBLE.js → domain-settings-C5SxoG2E.js} +1 -1
  126. package/dist/client/assets/{download-app-dialog-CYxTt_wl.js → download-app-dialog-D3HwAGf1.js} +1 -1
  127. package/dist/client/assets/{drawer-ugS5r2iQ.js → drawer-BbtvDSmI.js} +1 -1
  128. package/dist/client/assets/{editor-BFX6ra4l.js → editor-DiFPb_7W.js} +1 -1
  129. package/dist/client/assets/{empty-state-CrLuHHe8.js → empty-state-ChIdoRAZ.js} +1 -1
  130. package/dist/client/assets/{empty-state-BgjT33mH.js → empty-state-Jq3vDmCi.js} +1 -1
  131. package/dist/client/assets/{extract-connection-data-DzRM76JF.js → extract-connection-data-0OXYM8zm.js} +1 -1
  132. package/dist/client/assets/{feature-gate-D5RLRNV5.js → feature-gate-DyX-49Cz.js} +1 -1
  133. package/dist/client/assets/{feature-paywall-BOUIyLME.js → feature-paywall-CMm2o9Ho.js} +1 -1
  134. package/dist/client/assets/{file-explorer-WHZll4h4.js → file-explorer-BsD7GHt-.js} +1 -1
  135. package/dist/client/assets/{file-preview-C0y1VI3d.js → file-preview-DG7_swxk.js} +1 -1
  136. package/dist/client/assets/{file-share-button-BIJj7BbT.js → file-share-button-d423tG-P.js} +1 -1
  137. package/dist/client/assets/{file-type-icon-CvWWoRAO.js → file-type-icon-Zo3jfkM-.js} +1 -1
  138. package/dist/client/assets/flat-project-DUdVe5OD.js +1 -0
  139. package/dist/client/assets/{folder-icon-CMZRw_lE.js → folder-icon-DrGtPSK9.js} +1 -1
  140. package/dist/client/assets/{form-BsbEXxEk.js → form-CYA-1Wz9.js} +1 -1
  141. package/dist/client/assets/{gateway-client-DPQb-ray.js → gateway-client-DE4QITdV.js} +1 -1
  142. package/dist/client/assets/{general-DcmU5ljh.js → general-C_08074W.js} +1 -1
  143. package/dist/client/assets/{home-Cluz7ZcZ.js → home-HCpI5IEw.js} +1 -1
  144. package/dist/client/assets/{icon-button-Cpld4nrH.js → icon-button-Cag62vyF.js} +1 -1
  145. package/dist/client/assets/{index-CMWyW-nP.js → index-BGzd8qMa.js} +1 -1
  146. package/dist/client/assets/{index-C5LlvZFc.js → index-BiuSAlzd.js} +6 -6
  147. package/dist/client/assets/{index-B7-3R-Wc.js → index-BxwNVsQv.js} +1 -1
  148. package/dist/client/assets/{index-DR8phzsm.js → index-C-HKqiI5.js} +1 -1
  149. package/dist/client/assets/{index-BmjSoeeS.js → index-C9yvlucI.js} +1 -1
  150. package/dist/client/assets/{index-Bnq5a3RF.js → index-CFxmc0DR.js} +1 -1
  151. package/dist/client/assets/{index-DnCv4gDA.js → index-D3bKcVsq.js} +1 -1
  152. package/dist/client/assets/{index-svk4_uTN.js → index-DBg3Da4o.js} +1 -1
  153. package/dist/client/assets/{index-Dm8tF0P6.js → index-DX971x0F.js} +1 -1
  154. package/dist/client/assets/{index-LUzyiStE.js → index-Dm3Ro6iT.js} +1 -1
  155. package/dist/client/assets/{index-CFVUUkFw.js → index-DzWyHXO2.js} +1 -1
  156. package/dist/client/assets/{index-BnLwnO1e.js → index-LffHYdj2.js} +1 -1
  157. package/dist/client/assets/{index-CeE78dnN.js → index-UAWA_mBS.js} +1 -1
  158. package/dist/client/assets/{index-BsSf6-Tp.js → index-cj3FPIlo.js} +1 -1
  159. package/dist/client/assets/{index-CMxk_Q0b.js → index-qFmYqkwW.js} +3 -3
  160. package/dist/client/assets/{index-redirect-2EYYlLWV.js → index-redirect-Cms0d9Rf.js} +1 -1
  161. package/dist/client/assets/{infiniteQueryObserver-DS3r5RyQ.js → infiniteQueryObserver-B7-m24Hr.js} +1 -1
  162. package/dist/client/assets/{infra-billing-BP0k6gQd.js → infra-billing-BD4W3COQ.js} +1 -1
  163. package/dist/client/assets/{input-NPHEwu7D.js → input-B5d33h6X.js} +1 -1
  164. package/dist/client/assets/{input-DtRnGymn.js → input-CYlwvkm5.js} +3 -3
  165. package/dist/client/assets/{input-BYbHl7fH.js → input-CpjWxr53.js} +1 -1
  166. package/dist/client/assets/{integration-icon-Db99lv2a.js → integration-icon-BcFb9WXn.js} +1 -1
  167. package/dist/client/assets/{label-DFV1EjGx.js → label-BmSaj4OS.js} +1 -1
  168. package/dist/client/assets/{layout-DT9fBwIn.js → layout-DKTnWTMe.js} +1 -1
  169. package/dist/client/assets/{legacy-agents-deep-CB9Z2QQP.js → legacy-agents-deep-CbFqRQlc.js} +1 -1
  170. package/dist/client/assets/{legacy-main-redirect-DL_OU_ve.js → legacy-main-redirect-1k1KX6mL.js} +1 -1
  171. package/dist/client/assets/library-D9RnFFGm.js +1 -0
  172. package/dist/client/assets/{library-tab-zwg8I-zT.js → library-tab-rskkU2DA.js} +1 -1
  173. package/dist/client/assets/{login-B_u9hKdd.js → login-BUVWJTBG.js} +1 -1
  174. package/dist/client/assets/{markdown-BNkxJvOO.js → markdown-D5RcIxaz.js} +1 -1
  175. package/dist/client/assets/{mcp-app-renderer-BEPdGRWf.js → mcp-app-renderer-4bTrB0jF.js} +1 -1
  176. package/dist/client/assets/{mcp-oauth-B9fQInjX.js → mcp-oauth-C-EEuNZg.js} +1 -1
  177. package/dist/client/assets/{members-BDa5FNmm.js → members-CWz-dF_G.js} +1 -1
  178. package/dist/client/assets/{memory-DLlNfrtQ.js → memory-BfINHUTl.js} +1 -1
  179. package/dist/client/assets/{message-templates-BfVwoNvk.js → message-templates-Cq847r4U.js} +1 -1
  180. package/dist/client/assets/{mini-report-page-Ci8p_7Qc.js → mini-report-page-BxFxCQ_x.js} +1 -1
  181. package/dist/client/assets/{mock-board-CWXm4av0.js → mock-board-BFAIWkA7.js} +1 -1
  182. package/dist/client/assets/{monaco-editor-D29Kd2Kr.js → monaco-editor-DrtzucP0.js} +1 -1
  183. package/dist/client/assets/{monitoring-stats-row-slQbN1nA.js → monitoring-stats-row-DWbeH1RS.js} +1 -1
  184. package/dist/client/assets/{multi-select-W9MlzeC1.js → multi-select-BidbKgY6.js} +1 -1
  185. package/dist/client/assets/{mustache-BgbWTbKV.js → mustache-Dy9IxQRw.js} +1 -1
  186. package/dist/client/assets/{new-project-dialog-CJlermXp.js → new-project-dialog-Dj5TFcCk.js} +1 -1
  187. package/dist/client/assets/{oauth-callback-BuGfhU-z.js → oauth-callback-Diqg-5tw.js} +1 -1
  188. package/dist/client/assets/{oauth-callback-ai-provider-BAJwl5IS.js → oauth-callback-ai-provider-DdjEQJSy.js} +1 -1
  189. package/dist/client/assets/{onboarding-kTCKp428.js → onboarding-BiJRVogp.js} +1 -1
  190. package/dist/client/assets/{openai-conversation-C-yPKbTo.js → openai-conversation-Cssz-znB.js} +1 -1
  191. package/dist/client/assets/{optimistic-project-sidebar-views-CIecA9o-.js → optimistic-project-sidebar-views-Bl6nsH4A.js} +1 -1
  192. package/dist/client/assets/{org-file-open-context-C7-ltXbm.js → org-file-open-context-CTyFwctz.js} +1 -1
  193. package/dist/client/assets/{organization-choice-D3SzAbEY.js → organization-choice-BtNQMYzV.js} +1 -1
  194. package/dist/client/assets/{orgs-BGO2o2om.js → orgs-BYnZJx1z.js} +1 -1
  195. package/dist/client/assets/{page-seo-form-syG_NsyC.js → page-seo-form-RJHH5jjR.js} +1 -1
  196. package/dist/client/assets/{pair-BXahrBJ-.js → pair-PmQIQCBI.js} +1 -1
  197. package/dist/client/assets/{plan-ladder-jHsL2xiU.js → plan-ladder-BbGn-NgZ.js} +1 -1
  198. package/dist/client/assets/{popover-98ItoIiE.js → popover-DwQhmYZx.js} +1 -1
  199. package/dist/client/assets/{post-calendar-DA7gf-iD.js → post-calendar-u9yIz1ap.js} +1 -1
  200. package/dist/client/assets/post-editor-zwUoRB_d.js +2 -0
  201. package/dist/client/assets/{preview-content-B3SrY9U6.js → preview-content-YklxPrDD.js} +1 -1
  202. package/dist/client/assets/{preview-dialog-DtE8hySm.js → preview-dialog-B6-Ghng-.js} +1 -1
  203. package/dist/client/assets/{profile-BqkkPgHb.js → profile-DZ3TYytY.js} +1 -1
  204. package/dist/client/assets/{project-app-view-DJNcLbfl.js → project-app-view-B13_tHdE.js} +1 -1
  205. package/dist/client/assets/{project-feed-5oGhucIT.js → project-feed-CuWJElvp.js} +1 -1
  206. package/dist/client/assets/{project-icon-ss5TCI0R.js → project-icon-C1TVO88N.js} +1 -1
  207. package/dist/client/assets/project-reports-hbeMiS7q.js +1 -0
  208. package/dist/client/assets/project-tasks-DcinQO1a.js +1 -0
  209. package/dist/client/assets/{projects-empty-state-AWojsVAU.js → projects-empty-state-BBcr5xLl.js} +1 -1
  210. package/dist/client/assets/{projects-C0NE_8ue.js → projects-qlg8VwGy.js} +1 -1
  211. package/dist/client/assets/{prompts-CkLT7Pp3.js → prompts-IW4xrems.js} +1 -1
  212. package/dist/client/assets/record-editor-DZiiw2X4.js +1 -0
  213. package/dist/client/assets/{redirect-editor-Co-NnhcC.js → redirect-editor-Djr6TkEe.js} +1 -1
  214. package/dist/client/assets/{reports-BZp0upxy.js → reports-DD_aD-uv.js} +1 -1
  215. package/dist/client/assets/reports-RkncIczX.js +1 -0
  216. package/dist/client/assets/{reports-onboarding-BBsNQaBV.js → reports-onboarding-Btv0f8sO.js} +1 -1
  217. package/dist/client/assets/{reports-tab-yZ-nVssc.js → reports-tab-DoBMpRJD.js} +2 -2
  218. package/dist/client/assets/{repositories-DuKOCOxg.js → repositories-ZgvcUEvA.js} +1 -1
  219. package/dist/client/assets/{repository-binding-BzfYTDYg.js → repository-binding-CQsr_3Zk.js} +1 -1
  220. package/dist/client/assets/{repository-import-picker-BZ4SbZxQ.js → repository-import-picker-D6vKdpbU.js} +1 -1
  221. package/dist/client/assets/{repository-picker-Bzznh2XU.js → repository-picker-DnfKLU2E.js} +1 -1
  222. package/dist/client/assets/{require-capability-ZVnNGQoT.js → require-capability-B1clucXi.js} +1 -1
  223. package/dist/client/assets/{required-auth-layout-DanliwF9.js → required-auth-layout-5x9XYN7k.js} +1 -1
  224. package/dist/client/assets/{reset-password-DW3qLKpy.js → reset-password-JId6yrpe.js} +1 -1
  225. package/dist/client/assets/{resizable-DywAIc1-.js → resizable-00FuDjCF.js} +1 -1
  226. package/dist/client/assets/{resolve-tab-icon-C5M35tEP.js → resolve-tab-icon-Bi-w5DjE.js} +1 -1
  227. package/dist/client/assets/{review-settings-Cu2P77Gp.js → review-settings-IzuHTtkG.js} +1 -1
  228. package/dist/client/assets/{rich-text-link-control-DGgBIkoQ.js → rich-text-link-control-B3wmUrSm.js} +1 -1
  229. package/dist/client/assets/{roles-55Tdfjs_.js → roles-6EAMaiCw.js} +1 -1
  230. package/dist/client/assets/{route-BSEkxVC-.js → route-Bp7poLJJ.js} +1 -1
  231. package/dist/client/assets/route-DLd5XMus.js +1 -0
  232. package/dist/client/assets/{route-BvV_LTTA.js → route-DcKDacvo.js} +1 -1
  233. package/dist/client/assets/{runnable-block-editor-246vsgYp.js → runnable-block-editor-BPu9lbHb.js} +2 -2
  234. package/dist/client/assets/{sandbox-lifecycle-context-BvXjf7rx.js → sandbox-lifecycle-context-_l6ILxBR.js} +1 -1
  235. package/dist/client/assets/{schema-DvFu1ToO.js → schema-CepQKFSq.js} +1 -1
  236. package/dist/client/assets/{scroll-area-DaBuMKS9.js → scroll-area-BNMPUKzn.js} +1 -1
  237. package/dist/client/assets/{search-input--Cs2kN0G.js → search-input-DroJjkYC.js} +1 -1
  238. package/dist/client/assets/{search-toggle-C3WefJ2y.js → search-toggle-Vpxqce5X.js} +1 -1
  239. package/dist/client/assets/{secret-picker-CEdXEQdI.js → secret-picker-CIV9Pyxx.js} +1 -1
  240. package/dist/client/assets/{secrets-CqHQ9R62.js → secrets-Ddw-OUj-.js} +1 -1
  241. package/dist/client/assets/{sections-editor-BBgqWNXJ.js → sections-editor-B6DapFds.js} +1 -1
  242. package/dist/client/assets/{select-BlojSjop.js → select-QknS4jya.js} +1 -1
  243. package/dist/client/assets/{select-model-qkZsSZ-s.js → select-model-MWiJU5BO.js} +1 -1
  244. package/dist/client/assets/{seo-editor-vSFjIyB8.js → seo-editor-BmySIXEZ.js} +1 -1
  245. package/dist/client/assets/{separator-DVd2LxRQ.js → separator-C5QeX-ze.js} +1 -1
  246. package/dist/client/assets/{settings-tab-BB1cUOmY.js → settings-tab-pWdRgoZd.js} +1 -1
  247. package/dist/client/assets/{sheet-DhV5S-lN.js → sheet-CuQcjl8J.js} +1 -1
  248. package/dist/client/assets/{shell-layout-BCgx5xUt.js → shell-layout-DgCL-aOA.js} +1 -1
  249. package/dist/client/assets/{skills-CGor4YeE.js → skills-C9HRCrz7.js} +1 -1
  250. package/dist/client/assets/{sso-DT447B-z.js → sso-eRxfAwx6.js} +1 -1
  251. package/dist/client/assets/{suggestion-20OWsU93.js → suggestion-CUAhSpKi.js} +1 -1
  252. package/dist/client/assets/{switch-CMfc7QV5.js → switch-WI6sluFx.js} +1 -1
  253. package/dist/client/assets/{synced-repos-mHQN0OHN.js → synced-repos-B7M4g-ab.js} +1 -1
  254. package/dist/client/assets/{tab-icon-glyph-Cv2jvczH.js → tab-icon-glyph-BUy8eStz.js} +1 -1
  255. package/dist/client/assets/{table-Dh5pobpb.js → table-DahiKrUr.js} +1 -1
  256. package/dist/client/assets/{tabs-BQf21wqw.js → tabs-mZ2AJpie.js} +1 -1
  257. package/dist/client/assets/{task-board-DGnwsIns.js → task-board-Cg5OuTdd.js} +1 -1
  258. package/dist/client/assets/{task-route-T3lqK1Fh.js → task-route-CcdO9T8s.js} +1 -1
  259. package/dist/client/assets/{task-status-BXB-vdW8.js → task-status--I5ZFulR.js} +1 -1
  260. package/dist/client/assets/{taskboard-analytics-DorE9nZU.js → taskboard-analytics-CwIKc_CA.js} +1 -1
  261. package/dist/client/assets/{tasks-DJSTWu0I.js → tasks-Cx199_rB.js} +1 -1
  262. package/dist/client/assets/tasks-DQZjFSh-.js +1 -0
  263. package/dist/client/assets/{textarea-CVYfh0wC.js → textarea-IAy-ownU.js} +1 -1
  264. package/dist/client/assets/{thread-analytics-DnKw3wA2.js → thread-analytics-DoucYhij.js} +1 -1
  265. package/dist/client/assets/{thread-button-DLBvXKcS.js → thread-button-BS5hFLVf.js} +1 -1
  266. package/dist/client/assets/{thread-intent-Cc5BAaIc.js → thread-intent-ags1XWir.js} +1 -1
  267. package/dist/client/assets/{thread-route-BfHTBheT.js → thread-route-Cbe9daAp.js} +1 -1
  268. package/dist/client/assets/{thread-route-CmSAw42O.js → thread-route-SwwHxRrN.js} +1 -1
  269. package/dist/client/assets/{thread-sheet-body-tvi3Cu-i.js → thread-sheet-body-BzLo18UG.js} +1 -1
  270. package/dist/client/assets/{toggle-group-D_XfPgvt.js → toggle-group-C7J6hm1X.js} +1 -1
  271. package/dist/client/assets/{toolbar-icon-button-CUSdjojs.js → toolbar-icon-button-MH5hFCTi.js} +1 -1
  272. package/dist/client/assets/{tooltip-66nc6La-.js → tooltip-rVl8jzih.js} +1 -1
  273. package/dist/client/assets/{track-C-MP37D4.js → track-D9Kj7slb.js} +1 -1
  274. package/dist/client/assets/{types-Ch9SdRcv.js → types-B77htmoi.js} +1 -1
  275. package/dist/client/assets/{usage-stats-yiZ6SKAb.js → usage-stats-B9NCjY7p.js} +1 -1
  276. package/dist/client/assets/{use-ai-providers-M9Gfv9f8.js → use-ai-providers-BBj3hH0A.js} +1 -1
  277. package/dist/client/assets/{use-automations-CY_zEchX.js → use-automations-BMeSuYUl.js} +1 -1
  278. package/dist/client/assets/{use-autosave-Cn0WfmQ8.js → use-autosave-DddhIIlH.js} +1 -1
  279. package/dist/client/assets/{use-chat-layout-state-EbMrj1Yk.js → use-chat-layout-state-CcLE4xPO.js} +1 -1
  280. package/dist/client/assets/{use-clock-tick-Db61eAzB.js → use-clock-tick-WbPH8S5J.js} +1 -1
  281. package/dist/client/assets/{use-connect-companion-DxqzImGI.js → use-connect-companion-ooa0I2Ht.js} +1 -1
  282. package/dist/client/assets/{use-connection-aogXB8HT.js → use-connection-BJVimXqv.js} +1 -1
  283. package/dist/client/assets/{use-copy-B1c_EBRx.js → use-copy-XLZP4Fnf.js} +1 -1
  284. package/dist/client/assets/{use-create-virtual-mcp-CV_Qkq--.js → use-create-virtual-mcp-P_mw-sB2.js} +1 -1
  285. package/dist/client/assets/{use-date-fns-locale-B2cpFjnp.js → use-date-fns-locale-D1z6vY0T.js} +1 -1
  286. package/dist/client/assets/{use-debounced-autosave-CNHp8gYO.js → use-debounced-autosave-DM7h6lLt.js} +1 -1
  287. package/dist/client/assets/{use-debounced-value-C3ROkLpe.js → use-debounced-value-PqnB6cMC.js} +1 -1
  288. package/dist/client/assets/{use-deco-credits-u3-i822p.js → use-deco-credits-CWMvx_aN.js} +1 -1
  289. package/dist/client/assets/{use-decopilot-events-DSjzPVBT.js → use-decopilot-events-B_Wj2FDs.js} +1 -1
  290. package/dist/client/assets/{use-delete-connection-DUF2NW3l.js → use-delete-connection-Ct_NbrFe.js} +1 -1
  291. package/dist/client/assets/{use-deployment-admin-Cc2a3wOb.js → use-deployment-admin-BrRZ5JXH.js} +1 -1
  292. package/dist/client/assets/{use-fast-preview-draft-url-ClRKZFue.js → use-fast-preview-draft-url-Ckawo-Vn.js} +1 -1
  293. package/dist/client/assets/{use-file-configs-CF1-8iPu.js → use-file-configs-BCUJhrSS.js} +1 -1
  294. package/dist/client/assets/{use-infinite-scroll-DwjxrCBI.js → use-infinite-scroll-DOZLICG8.js} +1 -1
  295. package/dist/client/assets/{use-join-requests-CX1Z0mNX.js → use-join-requests-LL4W5sq2.js} +1 -1
  296. package/dist/client/assets/{use-main-panel-tabs-D9RE-lnQ.js → use-main-panel-tabs-CUdUAhvy.js} +1 -1
  297. package/dist/client/assets/{use-mcp-auth-status-BoAIHl4N.js → use-mcp-auth-status-D_jLHFPt.js} +1 -1
  298. package/dist/client/assets/{use-mcp-client-B2Vh9Cd7.js → use-mcp-client-5sJCC1_2.js} +1 -1
  299. package/dist/client/assets/{use-mcp-prompts-BBIzvKJ-.js → use-mcp-prompts-5OccjpiV.js} +1 -1
  300. package/dist/client/assets/{use-mcp-tools-BTm2d3TE.js → use-mcp-tools-cj_8qKci.js} +1 -1
  301. package/dist/client/assets/{use-members-C6qHLZqu.js → use-members-C5RWM84Q.js} +1 -1
  302. package/dist/client/assets/{use-mobile-Du3isCXQ.js → use-mobile-D06E6E9A.js} +1 -1
  303. package/dist/client/assets/{use-navigate-to-agent-DeIS5d_A.js → use-navigate-to-agent-2D1RSJEE.js} +1 -1
  304. package/dist/client/assets/use-new-blocks-editor-DxwEKp1u.js +1 -0
  305. package/dist/client/assets/{use-open-billing-url-C43__85H.js → use-open-billing-url-CrzuSkfk.js} +1 -1
  306. package/dist/client/assets/{use-org-auth-client-BBNuWvcV.js → use-org-auth-client-CXExidw4.js} +1 -1
  307. package/dist/client/assets/{use-org-fs-Can_Zv1k.js → use-org-fs-BI2aRf-g.js} +1 -1
  308. package/dist/client/assets/{use-org-repo-syncs-DSCXfgI7.js → use-org-repo-syncs-DhxRO-sX.js} +1 -1
  309. package/dist/client/assets/{use-org-sso-CW6lGteH.js → use-org-sso-C8LeExfy.js} +1 -1
  310. package/dist/client/assets/{use-organization-roles-BawJTbcK.js → use-organization-roles-Z4A7wlo_.js} +1 -1
  311. package/dist/client/assets/{use-organization-settings-Bq69ux21.js → use-organization-settings-0Ql08vCb.js} +1 -1
  312. package/dist/client/assets/{use-panel-navigate-BVY-Wy0A.js → use-panel-navigate-DvFfVppm.js} +1 -1
  313. package/dist/client/assets/{use-project-scope-Cg6fEvSs.js → use-project-scope-DJC0Rmd2.js} +1 -1
  314. package/dist/client/assets/{use-releases-BKi-DdL8.js → use-releases-UqMY8RcZ.js} +1 -1
  315. package/dist/client/assets/{use-reports-diagnostic-6cATxGHb.js → use-reports-diagnostic-zVwryKCp.js} +1 -1
  316. package/dist/client/assets/{use-secrets-BD6_VEse.js → use-secrets-DGDpC9hp.js} +1 -1
  317. package/dist/client/assets/{use-section-preview-base-BGOkvMCT.js → use-section-preview-base-DryOEAAN.js} +1 -1
  318. package/dist/client/assets/{use-session-runtime-XVdydjwY.js → use-session-runtime-Cosw4CCW.js} +1 -1
  319. package/dist/client/assets/{use-tags-BzBCpaxP.js → use-tags-BCCzUzPa.js} +1 -1
  320. package/dist/client/assets/{use-task-board-analytics-OYMnbU1S.js → use-task-board-analytics-CCFQvvsk.js} +1 -1
  321. package/dist/client/assets/{use-task-board-events-j6Gt2_bO.js → use-task-board-events-B2orELe0.js} +1 -1
  322. package/dist/client/assets/{use-task-metadata-BJMv-ITR.js → use-task-metadata-8O-Ga8Wr.js} +1 -1
  323. package/dist/client/assets/{use-thread-analytics-2OqfjnUQ.js → use-thread-analytics-BYmN2LQm.js} +1 -1
  324. package/dist/client/assets/{use-thread-outputs-DqGdi_Az.js → use-thread-outputs-DqnIgfuG.js} +1 -1
  325. package/dist/client/assets/useInfiniteQuery-BAMBgsXo.js +1 -0
  326. package/dist/client/assets/{useQueries-hEYaMROO.js → useQueries-Cdt1TSyJ.js} +1 -1
  327. package/dist/client/assets/useSuspenseInfiniteQuery-B_8hQc1u.js +1 -0
  328. package/dist/client/assets/{users-CVUsc3a5.js → users-BLEnjq5F.js} +1 -1
  329. package/dist/client/assets/{utils-DWTn-3pm.js → utils-BiBoFq--.js} +1 -1
  330. package/dist/client/assets/{variant-calendar-BwZCUSvP.js → variant-calendar-Csv8MReF.js} +1 -1
  331. package/dist/client/assets/{variant-matcher-override-Dv_-MENJ.js → variant-matcher-override-CdOGya1b.js} +1 -1
  332. package/dist/client/assets/{view-mode-toggle-D-i9WhgV.js → view-mode-toggle-D3nXTaNQ.js} +1 -1
  333. package/dist/client/assets/{virtual-mcp-CYrVMkY_.js → virtual-mcp-DUyYKScq.js} +1 -1
  334. package/dist/client/index.html +1 -1
  335. package/dist/server/cli.js +1 -1
  336. package/dist/server/server.js +1 -1
  337. package/package.json +1 -1
  338. package/dist/client/assets/agent-app-DrzBZfr1.js +0 -1
  339. package/dist/client/assets/agent-deck-CMkJu0nT.js +0 -1
  340. package/dist/client/assets/agent-library-BnziJi08.js +0 -1
  341. package/dist/client/assets/agent-library-file-Cf4X2sXR.js +0 -1
  342. package/dist/client/assets/agent-settings-CXCG6lM5.js +0 -1
  343. package/dist/client/assets/agent-site-editor-code-BA8Iz10L.js +0 -2
  344. package/dist/client/assets/agent-view-CWGAdnJH.js +0 -1
  345. package/dist/client/assets/api-keys-bQee7GZd.js +0 -1
  346. package/dist/client/assets/app-editor-BUUQAodh.js +0 -1
  347. package/dist/client/assets/block-document-CWFqlSnH.js +0 -3
  348. package/dist/client/assets/category-editor-DdyY6pMr.js +0 -1
  349. package/dist/client/assets/flat-project-DklPJ7ot.js +0 -1
  350. package/dist/client/assets/library-DVDKWOCj.js +0 -1
  351. package/dist/client/assets/post-editor-DJSWFkVZ.js +0 -2
  352. package/dist/client/assets/project-reports-BLn_609q.js +0 -1
  353. package/dist/client/assets/project-tasks-B2djFoeX.js +0 -1
  354. package/dist/client/assets/record-editor-DyjHgKTD.js +0 -1
  355. package/dist/client/assets/reports-z77dCvga.js +0 -1
  356. package/dist/client/assets/route-efW7oDD1.js +0 -1
  357. package/dist/client/assets/tasks-BCug_duM.js +0 -1
  358. package/dist/client/assets/use-new-blocks-editor-Bq5-foqH.js +0 -1
  359. package/dist/client/assets/useInfiniteQuery-DpDVtLXw.js +0 -1
  360. package/dist/client/assets/useSuspenseInfiniteQuery-Exur-lii.js +0 -1
@@ -1 +1 @@
1
- import{c as M,r as I,j as s,ak as G,l as h,I as H,F as q,ag as X,H as U,G as Z,B as S,b as J}from"./index-C5LlvZFc.js";import{a as K}from"./agent-icon-CfuzWIKW.js";import{w as _}from"./editor-BFX6ra4l.js";import{g as Q}from"./utils-DWTn-3pm.js";const V={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},E=1114111;function oe(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,n)=>{if(n.startsWith("#x")||n.startsWith("#X")){const i=Number.parseInt(n.slice(2),16);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}if(n.startsWith("#")){const i=Number.parseInt(n.slice(1),10);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}return V[n]??e}):""}function Y(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const ee=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function P(t){const e=M.c(10),{height:n}=t,i=J();let o;e[0]!==n?(o={height:n},e[0]=n,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=ee.map(te),e[2]=a):a=e[2];let c;e[3]!==i?(c=i("thread.publishDialog.openingComparison"),e[3]=i,e[4]=c):c=e[4];let l;e[5]!==c?(l=s.jsx("div",{className:"flex items-center justify-center pt-1 text-[11px] text-muted-foreground",children:c}),e[5]=c,e[6]=l):l=e[6];let d;return e[7]!==o||e[8]!==l?(d=s.jsxs("div",{style:o,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[a,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9],d}function te(t,e){return s.jsxs("div",{className:h("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[s.jsx("div",{className:h("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),s.jsx("div",{className:h("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const T={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},se={...T,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function ce(t){const e=M.c(11),{diff:n,emptyMessage:i,rowClassName:o,onDiscardFile:a,hideFileRows:c,editorHeight:l}=t,d=i===void 0?"No file changes in the working tree":i,p=o===void 0?"px-6":o,w=c===void 0?!1:c,m=l===void 0?"380px":l,[y,B]=I.useState(null),[N,j]=I.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Y(),e[0]=g):g=e[0];const $=g;if(!n||Object.keys(n.diffs).length===0){let f;return e[1]!==d?(f=s.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:d}),e[1]=d,e[2]=f):f=e[2],f}let x;return e[3]!==n.diffs||e[4]!==N||e[5]!==m||e[6]!==y||e[7]!==w||e[8]!==a||e[9]!==p?(x=s.jsx("div",{className:"divide-y",children:Object.entries(n.diffs).map(f=>{const[r,L]=f,{from:k,to:D}=L,R=y===r,W=k===null,z=D===null,v=r.startsWith("/")?r.slice(1):r,b=v.lastIndexOf("/"),C=b>=0?v.slice(b+1):v,F=b>=0?v.slice(0,b):null,O=Q(r),A=W?"bg-success":z?"bg-destructive":"bg-warning";return w?s.jsx("div",{children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:se})},r):s.jsxs("div",{children:[s.jsxs("div",{className:h("flex items-center gap-3 py-3 hover:bg-muted/30",p),children:[s.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>B(R?null:r),children:s.jsx(G,{className:h("h-3.5 w-3.5 transition-transform",R&&"rotate-90")})}),s.jsx("div",{className:h("h-2.5 w-2.5 shrink-0 rounded-full",A)}),s.jsx(K,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:C}),F&&s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),a?s.jsxs(H,{children:[s.jsx(q,{asChild:!0,children:s.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:s.jsx(X,{className:"h-3.5 w-3.5"})})}),s.jsx(U,{align:"end",children:s.jsx(Z,{className:"text-destructive focus:text-destructive",onSelect:()=>j(r),children:"Discard changes"})})]}):null]}),N===r&&a?s.jsxs("div",{className:h("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",p),children:[s.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",s.jsx("span",{className:"font-medium",children:C}),"? This cannot be undone."]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>j(null),children:"Cancel"}),s.jsx(S,{type:"button",size:"sm",className:"h-7 bg-destructive px-2 text-xs text-destructive-foreground hover:bg-destructive/90",onClick:()=>{j(null),a(r)},children:"Discard"})]})]}):null,R&&s.jsx("div",{className:"border-t",children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:T})})]},r)})}),e[3]=n.diffs,e[4]=N,e[5]=m,e[6]=y,e[7]=w,e[8]=a,e[9]=p,e[10]=x):x=e[10],x}const u="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function le(t){return`Reopen PR #${t.prNumber}. ${u}`}function de(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${u}`}function ue(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${u}`}function he(t){return`Re-run the \`${t.checkName}\` check on PR #${t.prNumber}. If an empty commit is needed to retrigger CI, create and push one. ${u}`}function me(t){const e=(t.failingChecks??[]).map(n=>`\`${n}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${u}`}function fe(t){return`Mark PR #${t.prNumber} ready for review. ${u}`}function pe(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${u}`}function ge(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${u}`}export{ce as G,le as a,ge as b,de as c,oe as d,he as e,me as f,fe as m,pe as r,ue as s};
1
+ import{c as M,r as I,j as s,ak as G,l as h,I as H,F as q,ag as X,H as U,G as Z,B as S,b as J}from"./index-BiuSAlzd.js";import{a as K}from"./agent-icon-DEoEcQYL.js";import{w as _}from"./editor-DiFPb_7W.js";import{g as Q}from"./utils-BiBoFq--.js";const V={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},E=1114111;function oe(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,n)=>{if(n.startsWith("#x")||n.startsWith("#X")){const i=Number.parseInt(n.slice(2),16);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}if(n.startsWith("#")){const i=Number.parseInt(n.slice(1),10);return!Number.isFinite(i)||i>E?e:String.fromCodePoint(i)}return V[n]??e}):""}function Y(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const ee=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function P(t){const e=M.c(10),{height:n}=t,i=J();let o;e[0]!==n?(o={height:n},e[0]=n,e[1]=o):o=e[1];let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=ee.map(te),e[2]=a):a=e[2];let c;e[3]!==i?(c=i("thread.publishDialog.openingComparison"),e[3]=i,e[4]=c):c=e[4];let l;e[5]!==c?(l=s.jsx("div",{className:"flex items-center justify-center pt-1 text-[11px] text-muted-foreground",children:c}),e[5]=c,e[6]=l):l=e[6];let d;return e[7]!==o||e[8]!==l?(d=s.jsxs("div",{style:o,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[a,l]}),e[7]=o,e[8]=l,e[9]=d):d=e[9],d}function te(t,e){return s.jsxs("div",{className:h("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[s.jsx("div",{className:h("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),s.jsx("div",{className:h("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const T={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},se={...T,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function ce(t){const e=M.c(11),{diff:n,emptyMessage:i,rowClassName:o,onDiscardFile:a,hideFileRows:c,editorHeight:l}=t,d=i===void 0?"No file changes in the working tree":i,p=o===void 0?"px-6":o,w=c===void 0?!1:c,m=l===void 0?"380px":l,[y,B]=I.useState(null),[N,j]=I.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Y(),e[0]=g):g=e[0];const $=g;if(!n||Object.keys(n.diffs).length===0){let f;return e[1]!==d?(f=s.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:d}),e[1]=d,e[2]=f):f=e[2],f}let x;return e[3]!==n.diffs||e[4]!==N||e[5]!==m||e[6]!==y||e[7]!==w||e[8]!==a||e[9]!==p?(x=s.jsx("div",{className:"divide-y",children:Object.entries(n.diffs).map(f=>{const[r,L]=f,{from:k,to:D}=L,R=y===r,W=k===null,z=D===null,v=r.startsWith("/")?r.slice(1):r,b=v.lastIndexOf("/"),C=b>=0?v.slice(b+1):v,F=b>=0?v.slice(0,b):null,O=Q(r),A=W?"bg-success":z?"bg-destructive":"bg-warning";return w?s.jsx("div",{children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:se})},r):s.jsxs("div",{children:[s.jsxs("div",{className:h("flex items-center gap-3 py-3 hover:bg-muted/30",p),children:[s.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>B(R?null:r),children:s.jsx(G,{className:h("h-3.5 w-3.5 transition-transform",R&&"rotate-90")})}),s.jsx("div",{className:h("h-2.5 w-2.5 shrink-0 rounded-full",A)}),s.jsx(K,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:C}),F&&s.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:F}),a?s.jsxs(H,{children:[s.jsx(q,{asChild:!0,children:s.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:s.jsx(X,{className:"h-3.5 w-3.5"})})}),s.jsx(U,{align:"end",children:s.jsx(Z,{className:"text-destructive focus:text-destructive",onSelect:()=>j(r),children:"Discard changes"})})]}):null]}),N===r&&a?s.jsxs("div",{className:h("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",p),children:[s.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",s.jsx("span",{className:"font-medium",children:C}),"? This cannot be undone."]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsx(S,{type:"button",variant:"ghost",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>j(null),children:"Cancel"}),s.jsx(S,{type:"button",size:"sm",className:"h-7 bg-destructive px-2 text-xs text-destructive-foreground hover:bg-destructive/90",onClick:()=>{j(null),a(r)},children:"Discard"})]})]}):null,R&&s.jsx("div",{className:"border-t",children:s.jsx(_,{original:k??"",modified:D??"",language:O,theme:$,height:m,loading:s.jsx(P,{height:m}),options:T})})]},r)})}),e[3]=n.diffs,e[4]=N,e[5]=m,e[6]=y,e[7]=w,e[8]=a,e[9]=p,e[10]=x):x=e[10],x}const u="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function le(t){return`Reopen PR #${t.prNumber}. ${u}`}function de(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${u}`}function ue(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${u}`}function he(t){return`Re-run the \`${t.checkName}\` check on PR #${t.prNumber}. If an empty commit is needed to retrigger CI, create and push one. ${u}`}function me(t){const e=(t.failingChecks??[]).map(n=>`\`${n}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${u}`}function fe(t){return`Mark PR #${t.prNumber} ready for review. ${u}`}function pe(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${u}`}function ge(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${u}`}export{ce as G,le as a,ge as b,de as c,oe as d,he as e,me as f,fe as m,pe as r,ue as s};
@@ -1 +1 @@
1
- import{c as R,l as h,j as s}from"./index-C5LlvZFc.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
1
+ import{c as R,l as h,j as s}from"./index-BiuSAlzd.js";function E($){const e=R.c(34),{generating:l,className:N}=$;let t;e[0]!==N?(t=h("pointer-events-none rounded-xl border border-border bg-background shadow-lg",N),e[0]=N,e[1]=t):t=e[1];let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",className:"stroke-muted"}),e[2]=p):p=e[2];const v=l?"75.4":"22",k=l?"stroke-muted":"stroke-success";let a;e[3]!==k?(a=h("transition-[stroke-dashoffset] duration-1000 ease-out",k),e[3]=k,e[4]=a):a=e[4];let i;e[5]!==v||e[6]!==a?(i=s.jsxs("svg",{viewBox:"0 0 32 32",className:"size-9 shrink-0 -rotate-90",children:[p,s.jsx("circle",{cx:"16",cy:"16",r:"12",fill:"none",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"75.4",strokeDashoffset:v,className:a})]}),e[5]=v,e[6]=a,e[7]=i):i=e[7];const w=l&&"animate-pulse";let c;e[8]!==w?(c=h("h-1.5 w-full rounded-full bg-muted",w),e[8]=w,e[9]=c):c=e[9];let r;e[10]!==c?(r=s.jsx("div",{className:c}),e[10]=c,e[11]=r):r=e[11];const y=l&&"animate-pulse";let n;e[12]!==y?(n=h("h-1.5 w-2/3 rounded-full bg-muted",y),e[12]=y,e[13]=n):n=e[13];let o;e[14]!==n?(o=s.jsx("div",{className:n}),e[14]=n,e[15]=o):o=e[15];let d;e[16]!==o||e[17]!==r?(d=s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[r,o]}),e[16]=o,e[17]=r,e[18]=d):d=e[18];let f;e[19]!==d||e[20]!==i?(f=s.jsxs("div",{className:"flex items-center gap-2.5",children:[i,d]}),e[19]=d,e[20]=i,e[21]=f):f=e[21];let g;e[22]===Symbol.for("react.memo_cache_sentinel")?(g=[7,10,5,9,6,8],e[22]=g):g=e[22];let m;e[23]!==l?(m=s.jsx("div",{className:"flex h-10 items-end gap-1.5",children:g.map((_,b)=>s.jsx("div",{style:{height:`${_*4}px`},className:h("flex-1 rounded-sm",l?"animate-pulse bg-muted":b%2===0?"bg-success/70":"bg-success/30")},`bar-${b}`))}),e[23]=l,e[24]=m):m=e[24];let u;e[25]!==l?(u=s.jsx("div",{className:"flex flex-col gap-1.5",children:["w-full","w-5/6","w-full","w-2/3","w-full"].map((_,b)=>s.jsx("div",{className:h("h-1.5 rounded-full bg-muted",_,l&&"animate-pulse")},`line-${b}`))}),e[25]=l,e[26]=u):u=e[26];let x;e[27]!==f||e[28]!==m||e[29]!==u?(x=s.jsxs("div",{className:"flex h-full flex-col gap-3 p-4",children:[f,m,u]}),e[27]=f,e[28]=m,e[29]=u,e[30]=x):x=e[30];let j;return e[31]!==t||e[32]!==x?(j=s.jsx("div",{"aria-hidden":!0,className:t,children:x}),e[31]=t,e[32]=x,e[33]=j):j=e[33],j}export{E as M};
@@ -1 +1 @@
1
- import{c as p,r as c,fd as f,j as o,E as h,fe as m}from"./index-C5LlvZFc.js";function w(l){const e=p.c(5),{seed:s,children:i}=l;let r;e[0]!==s?(r=()=>{const u=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return s(u),u},e[0]=s,e[1]=r):r=e[1];const[n]=c.useState(r);let a;return e[2]!==i||e[3]!==n?(a=o.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:o.jsx(h,{fallback:null,children:o.jsx(c.Suspense,{fallback:null,children:o.jsx(m,{client:n,children:i})})})}),e[2]=i,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function t(l,e,s,i,r,n){return{id:l,organizationId:"preview",title:e,description:null,repositoryId:null,status:s,priority:r,type:i,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[t("p1","Fix checkout shipping estimate","todo","bug","high",1),t("p2","Add size guide to product page","todo","feature","medium",2),t("p3","Compress hero images","todo","chore","low",3),t("p4","Rewrite category descriptions","in_progress","feature","medium",4),t("p5","Audit broken redirects","in_progress","chore","high",5),t("p6","New arrivals landing page","in_review","feature","high",6),t("p7","Speed up search results","done","chore","medium",7),t("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
1
+ import{c as p,r as c,fd as f,j as o,E as h,fe as m}from"./index-BiuSAlzd.js";function w(l){const e=p.c(5),{seed:s,children:i}=l;let r;e[0]!==s?(r=()=>{const u=new f({defaultOptions:{queries:{staleTime:1/0,gcTime:1/0,retry:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchInterval:!1}}});return s(u),u},e[0]=s,e[1]=r):r=e[1];const[n]=c.useState(r);let a;return e[2]!==i||e[3]!==n?(a=o.jsx("div",{"aria-hidden":"true",inert:!0,className:"pointer-events-none absolute inset-0 select-none overflow-hidden",children:o.jsx(h,{fallback:null,children:o.jsx(c.Suspense,{fallback:null,children:o.jsx(m,{client:n,children:i})})})}),e[2]=i,e[3]=n,e[4]=a):a=e[4],a}const d=new Date().toISOString();function t(l,e,s,i,r,n){return{id:l,organizationId:"preview",title:e,description:null,repositoryId:null,status:s,priority:r,type:i,assigneeId:null,assignedBy:null,repo:null,dueDate:null,sortOrder:n,keySeq:n,externalUrl:null,previewRoutes:[],source:null,retryAttempts:0,reviewCycleStartedAt:null,threads:[],tags:[],reviewVerdicts:[],statusSince:null,createdBy:"preview",createdAt:d,updatedBy:"preview",updatedAt:d}}function y(){return{items:[t("p1","Fix checkout shipping estimate","todo","bug","high",1),t("p2","Add size guide to product page","todo","feature","medium",2),t("p3","Compress hero images","todo","chore","low",3),t("p4","Rewrite category descriptions","in_progress","feature","medium",4),t("p5","Audit broken redirects","in_progress","chore","high",5),t("p6","New arrivals landing page","in_review","feature","high",6),t("p7","Speed up search results","done","chore","medium",7),t("p8","Black Friday banner","done","feature","urgent",8)],repos:[],columns:[]}}export{w as P,y as m};
@@ -1,4 +1,4 @@
1
- import{r as m,j as c,h as I,c as k,aL as v}from"./index-C5LlvZFc.js";import{l as L,c as S,F as $}from"./editor-BFX6ra4l.js";import{d as K}from"./backoff-8mStPHYB.js";S();async function D(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
1
+ import{r as m,j as c,h as I,c as k,aL as v}from"./index-BiuSAlzd.js";import{l as L,c as S,F as $}from"./editor-DiFPb_7W.js";import{d as K}from"./backoff-8mStPHYB.js";S();async function D(e){const t=e.getModel();if(!t)throw new Error("[Monaco] No model found in editor");const n=t.getValue(),i=n.replace(/export default (async )?function/,"export default $1function __default")+`
2
2
  type __ExpandRecursively<T> = T extends (...args: infer A) => infer R
3
3
  ? (...args: __ExpandRecursively<A>) => __ExpandRecursively<R>
4
4
  : T extends object
@@ -1 +1 @@
1
- import{r as f,f2 as lt,c as Ne,l as Ie,j as I}from"./index-C5LlvZFc.js";import{C as Ae,d as Pe}from"./chart-CrYOX1s7.js";import{a5 as xe,ap as ot,aq as st,ar as ct,as as ut,P as ue,al as fe,$ as ve,h as dt,J as Se,a as $,at as ft,a9 as vt,s as ee,b as mt,f as J,g as Q,j as Te,k as Re,au as Fe,av as pt,aw as ht,l as Ee,ax as xt,ay as Oe,n as gt,L as le,p as yt,r as bt,D as ge,u as $e,R as kt,S as It,m as At,Z as ye,o as We,q as Pt,t as St,y as Et,v as Ot,az as Bt,z as oe,H as Ge,G as Ct,aA as jt,aB as wt,aC as Be,aD as Ve,aE as Mt,aF as Ue,K as Dt,N as Lt,O as R,T as _t,U as zt,V as Kt,aG as Nt,Q as Tt,am as Ce,a0 as Rt,a1 as Ft,C as je,Y as we}from"./CartesianChart-8XeONUcg.js";import{X as Me}from"./XAxis-DdJd7RhS.js";import{s as G,b as V,A as $t,a as Wt}from"./AreaChart-BAAHWXOl.js";import{a as Gt,S as Vt}from"./ErrorBarContext-JpptrruU.js";var be=t=>null;be.displayName="Cell";var Ye=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ot({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},Xe=t=>{var e=xe();return(a,r)=>i=>{t?.(a,r,i),e(st())}},qe=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ct({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},De=(t,e,a)=>{var r=a??t;if(!ue(r))return fe(r,e,0)},Ut=(t,e,a)=>{var r={},i=t.filter(ut),n=t.filter(l=>l.stackId==null),c=i.reduce((l,o)=>{var u=l[o.stackId];return u==null&&(u=[]),u.push(o),l[o.stackId]=u,l},r),s=Object.entries(c).map(l=>{var o,[u,v]=l,x=v.map(g=>g.dataKey),p=De(e,a,(o=v[0])===null||o===void 0?void 0:o.barSize);return{stackId:u,dataKeys:x,barSize:p}}),m=n.map(l=>{var o=[l.dataKey].filter(v=>v!=null),u=De(e,a,l.barSize);return{stackId:void 0,dataKeys:o,barSize:u}});return[...s,...m]};function Le(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function ie(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Le(Object(a),!0).forEach(function(r){Yt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Le(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Yt(t,e,a){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Xt(t){var e=qt(t,"string");return typeof e=="symbol"?e:e+""}function qt(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ht(t,e,a,r,i){var n,c=r.length;if(!(c<1)){var s=fe(t,a,0,!0),m,l=[];if(ve((n=r[0])===null||n===void 0?void 0:n.barSize)){var o=!1,u=a/c,v=r.reduce((h,y)=>h+(y.barSize||0),0);v+=(c-1)*s,v>=a&&(v-=(c-1)*s,s=0),v>=a&&u>0&&(o=!0,u*=.9,v=c*u);var x=(a-v)/2>>0,p={offset:x-s,size:0};m=r.reduce((h,y)=>{var k,C={stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:p.offset+p.size+s,size:o?u:(k=y.barSize)!==null&&k!==void 0?k:0}},A=[...h,C];return p=C.position,A},l)}else{var g=fe(e,a,0,!0);a-2*g-(c-1)*s<=0&&(s=0);var b=(a-2*g-(c-1)*s)/c;b>1&&(b>>=0);var d=ve(i)?Math.min(b,i):b;m=r.reduce((h,y,k)=>[...h,{stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:g+(b+s)*k+(b-d)/2,size:d}}],l)}return m}}var Zt=(t,e,a,r,i,n,c)=>{var s=ue(c)?e:c,m=Ht(a,r,i!==n?i:n,t,s);return i!==n&&m!=null&&(m=m.map(l=>ie(ie({},l),{},{position:ie(ie({},l.position),{},{offset:l.position.offset-i/2})}))),m},Jt=(t,e)=>{var a=dt(e);if(!(!t||a==null||e==null)){var{stackId:r}=e;if(r!=null){var i=t[r];if(i){var{stackedData:n}=i;if(n)return n.find(c=>c.key===a)}}}},Qt=(t,e)=>{if(!(t==null||e==null)){var a=t.find(r=>r.stackId===e.stackId&&e.dataKey!=null&&r.dataKeys.includes(e.dataKey));if(a!=null)return a.position}};function ea(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&ve(t.zIndex)?t.zIndex:e}var ta="Invariant failed";function aa(t,e){throw new Error(ta)}function me(){return me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},me.apply(null,arguments)}function ke(t){return f.createElement(Gt,me({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var ra=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Se(e))return e;var n=Se(r)||ue(r);return n?e(r,i):(n||aa(),a)}},na=(t,e,a)=>a,ia=(t,e)=>e,ae=$([Re,ia],(t,e)=>t.filter(a=>a.type==="bar").find(a=>a.id===e)),la=$([ae],t=>t?.maxBarSize),oa=(t,e,a,r)=>r,sa=$([ee,Re,G,V,na],(t,e,a,r,i)=>e.filter(n=>t==="horizontal"?n.xAxisId===a:n.yAxisId===r).filter(n=>n.isPanorama===i).filter(n=>n.hide===!1).filter(n=>n.type==="bar")),ca=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null))return r==="horizontal"?Ee(t,"yAxis",n,a):Ee(t,"xAxis",i,a)},ua=(t,e)=>{var a=ee(t),r=G(t,e),i=V(t,e);if(!(r==null||i==null))return a==="horizontal"?Oe(t,"xAxis",r):Oe(t,"yAxis",i)},da=$([sa,xt,ua],Ut),fa=(t,e,a)=>{var r,i,n=ae(t,e);if(n==null)return 0;var c=G(t,e),s=V(t,e);if(c==null||s==null)return 0;var m=ee(t),l=Fe(t),{maxBarSize:o}=n,u=ue(o)?l:o,v,x;return m==="horizontal"?(v=J(t,"xAxis",c,a),x=Q(t,"xAxis",c,a)):(v=J(t,"yAxis",s,a),x=Q(t,"yAxis",s,a)),(r=(i=Te(v,x,!0))!==null&&i!==void 0?i:u)!==null&&r!==void 0?r:0},He=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null)){var c,s;return r==="horizontal"?(c=J(t,"xAxis",i,a),s=Q(t,"xAxis",i,a)):(c=J(t,"yAxis",n,a),s=Q(t,"yAxis",n,a)),Te(c,s)}},va=$([da,Fe,pt,ht,fa,He,la],Zt),ma=(t,e,a)=>{var r=G(t,e);if(r!=null)return J(t,"xAxis",r,a)},pa=(t,e,a)=>{var r=V(t,e);if(r!=null)return J(t,"yAxis",r,a)},ha=(t,e,a)=>{var r=G(t,e);if(r!=null)return Q(t,"xAxis",r,a)},xa=(t,e,a)=>{var r=V(t,e);if(r!=null)return Q(t,"yAxis",r,a)},ga=$([va,ae],Qt),ya=$([ca,ae],Jt),ba=$([ft,vt,ma,pa,ha,xa,ga,ee,mt,He,ya,ae,oa],(t,e,a,r,i,n,c,s,m,l,o,u,v)=>{var{chartData:x,dataStartIndex:p,dataEndIndex:g}=m;if(!(u==null||c==null||e==null||s!=="horizontal"&&s!=="vertical"||a==null||r==null||i==null||n==null||l==null)){var{data:b}=u,d;if(b!=null&&b.length>0?d=b:d=x?.slice(p,g+1),d!=null)return Xa({layout:s,barSettings:u,pos:c,parentViewBox:e,bandSize:l,xAxis:a,yAxis:r,xAxisTicks:i,yAxisTicks:n,stackedData:o,displayedData:d,offset:t,cells:v,dataStartIndex:p})}}),ka=["index"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},pe.apply(null,arguments)}function Ia(t,e){if(t==null)return{};var a,r,i=Aa(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function Aa(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var Ze=f.createContext(void 0),Pa=t=>{var e=f.useContext(Ze);if(e!=null)return e.stackId;if(t!=null)return gt(t)},Sa=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ea=t=>{var e=f.useContext(Ze);if(e!=null){var{stackId:a}=e;return"url(#".concat(Sa(a,t),")")}},Je=t=>{var{index:e}=t,a=Ia(t,ka),r=Ea(e);return f.createElement(le,pe({className:"recharts-bar-stack-layer",clipPath:r},a))},Oa=["onMouseEnter","onMouseLeave","onClick"],Ba=["value","background","tooltipPosition"],Ca=["id"],ja=["onMouseEnter","onClick","onMouseLeave"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},F.apply(null,arguments)}function _e(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function M(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(a),!0).forEach(function(r){wa(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_e(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function wa(t,e,a){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ma(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function se(t,e){if(t==null)return{};var a,r,i=La(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function La(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var _a=t=>{var{dataKey:e,name:a,fill:r,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:r,value:We(a,e),payload:t}]},za=f.memo(t=>{var{dataKey:e,stroke:a,strokeWidth:r,fill:i,name:n,hide:c,unit:s,tooltipType:m,id:l}=t,o={dataDefinedOnItem:void 0,getPosition:St,settings:{stroke:a,strokeWidth:r,fill:i,dataKey:e,nameKey:void 0,name:We(n,e),hide:c,type:m,color:i,unit:s,graphicalItemId:l}};return f.createElement(Pt,{tooltipEntrySettings:o})});function Ka(t){var e=oe(Ve),{data:a,dataKey:r,background:i,allOtherBarProps:n}=t,{onMouseEnter:c,onMouseLeave:s,onClick:m}=n,l=se(n,Oa),o=Ye(c,r,n.id),u=Xe(s),v=qe(m,r,n.id);if(!i||a==null)return null;var x=Mt(i);return f.createElement(ye,{zIndex:ea(i,ge.barBackground)},a.map((p,g)=>{var{value:b,background:d,tooltipPosition:h}=p,y=se(p,Ba);if(!d)return null;var k=o(p,g),C=u(p,g),A=v(p,g),P=M(M(M(M(M({option:i,isActive:String(g)===e},y),{},{fill:"#eee"},d),x),Ue(l,p,g)),{},{onMouseEnter:k,onMouseLeave:C,onClick:A,dataKey:r,index:g,className:"recharts-bar-background-rectangle"});return f.createElement(ke,F({key:"background-bar-".concat(g)},P))}))}function Na(t){var{showLabels:e,children:a,rects:r}=t,i=r?.map(n=>{var c={x:n.x,y:n.y,width:n.width,lowerWidth:n.width,upperWidth:n.width,height:n.height};return M(M({},c),{},{value:n.value,payload:n.payload,parentViewBox:n.parentViewBox,viewBox:c,fill:n.fill})});return f.createElement(zt,{value:e?i:void 0},a)}function Ta(t){var{shape:e,activeBar:a,baseProps:r,entry:i,index:n,dataKey:c}=t,s=oe(Ve),m=oe(Nt),l=a&&String(i.originalDataIndex)===s&&(m==null||c===m),[o,u]=f.useState(!1),[v,x]=f.useState(!1);f.useEffect(()=>{var y;return l?(u(!0),y=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(y)}},[l]);var p=f.useCallback(()=>{l||u(!1)},[l]),g=l&&v,b=l||o,d;l?a===!0?d=e:d=a:d=e;var h=f.createElement(ke,F({},r,{name:String(r.name)},i,{isActive:g,option:d,index:n,dataKey:c,onTransitionEnd:p}));return b?f.createElement(ye,{zIndex:ge.activeBar},f.createElement(Je,{index:i.originalDataIndex},h)):h}function Ra(t){var{shape:e,baseProps:a,entry:r,index:i,dataKey:n}=t;return f.createElement(ke,F({},a,{name:String(a.name)},r,{isActive:!1,option:e,index:i,dataKey:n}))}function Fa(t){var e,{data:a,props:r}=t,i=(e=Kt(r))!==null&&e!==void 0?e:{},{id:n}=i,c=se(i,Ca),{shape:s,dataKey:m,activeBar:l}=r,{onMouseEnter:o,onClick:u,onMouseLeave:v}=r,x=se(r,ja),p=Ye(o,m,n),g=Xe(v),b=qe(u,m,n);return a?f.createElement(f.Fragment,null,a.map((d,h)=>f.createElement(Je,F({index:d.originalDataIndex,key:"rectangle-".concat(d?.x,"-").concat(d?.y,"-").concat(d?.value,"-").concat(h),className:"recharts-bar-rectangle"},Ue(x,d,h),{onMouseEnter:p(d,h),onMouseLeave:g(d,h),onClick:b(d,h)}),l?f.createElement(Ta,{shape:s,activeBar:l,baseProps:c,entry:d,index:h,dataKey:m}):f.createElement(Ra,{shape:s,baseProps:c,entry:d,index:h,dataKey:m})))):null}function $a(t){var{props:e,previousRectanglesRef:a}=t,{data:r,layout:i,isAnimationActive:n,animationBegin:c,animationDuration:s,animationEasing:m,onAnimationEnd:l,onAnimationStart:o}=e,u=a.current,v=Dt(e,"recharts-bar-"),[x,p]=f.useState(!1),g=!x,b=f.useCallback(()=>{typeof l=="function"&&l(),p(!1)},[l]),d=f.useCallback(()=>{typeof o=="function"&&o(),p(!0)},[o]);return f.createElement(Na,{showLabels:g,rects:r},f.createElement(Lt,{animationId:v,begin:c,duration:s,isActive:n,easing:m,onAnimationEnd:b,onAnimationStart:d,key:v},h=>{var y=h===1?r:r?.map((k,C)=>{var A=u&&u[C];if(A)return M(M({},k),{},{x:R(A.x,k.x,h),y:R(A.y,k.y,h),width:R(A.width,k.width,h),height:R(A.height,k.height,h)});if(i==="horizontal"){var P=R(0,k.height,h),w=R(k.stackedBarStart,k.y,h);return M(M({},k),{},{y:w,height:P})}var j=R(0,k.width,h),S=R(k.stackedBarStart,k.x,h);return M(M({},k),{},{width:j,x:S})});return h>0&&(a.current=y??null),y==null?null:f.createElement(le,null,f.createElement(Fa,{props:e,data:y}))}),f.createElement(_t,{label:e.label}),e.children)}function Wa(t){var e=f.useRef(null);return f.createElement($a,{previousRectanglesRef:e,props:t})}var Qe=0,Ga=(t,e)=>{var a=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:a,errorVal:Ge(t,e)}};class Va extends f.PureComponent{render(){var{hide:e,data:a,dataKey:r,className:i,xAxisId:n,yAxisId:c,needClip:s,background:m,id:l}=this.props;if(e||a==null)return null;var o=lt("recharts-bar",i),u=l;return f.createElement(le,{className:o,id:l},s&&f.createElement("defs",null,f.createElement(Ct,{clipPathId:u,xAxisId:n,yAxisId:c})),f.createElement(le,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(u,")"):void 0},f.createElement(Ka,{data:a,dataKey:r,background:m,allOtherBarProps:this.props}),f.createElement(Wa,this.props)))}}var Ua={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Qe,xAxisId:0,yAxisId:0,zIndex:ge.bar};function Ya(t){var{xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o}=t,{needClip:u}=Et(e,a),v=Ot(),x=$e(),p=Bt(t.children,be),g=oe(h=>ba(h,t.id,x,p));if(v!=="vertical"&&v!=="horizontal")return null;var b,d=g?.[0];return d==null||d.height==null||d.width==null?b=0:b=v==="vertical"?d.height/2:d.width/2,f.createElement(Vt,{xAxisId:e,yAxisId:a,data:g,dataPointFormatter:Ga,errorBarOffset:b},f.createElement(Va,F({},t,{layout:v,needClip:u,data:g,xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o})))}function Xa(t){var{layout:e,barSettings:{dataKey:a,minPointSize:r,hasCustomShape:i},pos:n,bandSize:c,xAxis:s,yAxis:m,xAxisTicks:l,yAxisTicks:o,stackedData:u,displayedData:v,offset:x,cells:p,parentViewBox:g,dataStartIndex:b}=t,d=e==="horizontal"?m:s,h=u?d.scale.domain():null,y=jt({numericAxis:d}),k=d.scale.map(y);return v.map((C,A)=>{var P,w,j,S,O,K;if(u){var B=u[A+b];if(B==null)return null;P=wt(B,h)}else P=Ge(C,a),Array.isArray(P)||(P=[y,P]);var E=ra(r,Qe)(P[1],A);if(e==="horizontal"){var D,N=m.scale.map(P[0]),L=m.scale.map(P[1]);if(N==null||L==null)return null;w=Be({axis:s,ticks:l,bandSize:c,offset:n.offset,entry:C,index:A}),j=(D=L??N)!==null&&D!==void 0?D:void 0,S=n.size;var _=N-L;if(O=Tt(_)?0:_,K={x:w,y:x.top,width:S,height:x.height},Math.abs(E)>0&&Math.abs(O)<Math.abs(E)){var z=Ce(O||E)*(Math.abs(E)-Math.abs(O));j-=z,O+=z}}else{var T=s.scale.map(P[0]),W=s.scale.map(P[1]);if(T==null||W==null)return null;if(w=T,j=Be({axis:m,ticks:o,bandSize:c,offset:n.offset,entry:C,index:A}),S=W-T,O=n.size,K={x:x.left,y:j,width:x.width,height:O},Math.abs(E)>0&&Math.abs(S)<Math.abs(E)){var U=Ce(S||E)*(Math.abs(E)-Math.abs(S));S+=U}}if(w==null||j==null||S==null||O==null||!i&&(S===0||O===0))return null;var te=M(M({},C),{},{stackedBarStart:k,x:w,y:j,width:S,height:O,value:u?P:P[1],payload:C,background:K,tooltipPosition:{x:w+S/2,y:j+O/2},parentViewBox:g,originalDataIndex:A},p&&p[A]&&p[A].props);return te}).filter(Boolean)}function qa(t){var e=bt(t,Ua),a=Pa(e.stackId),r=$e();return f.createElement(kt,{id:e.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement(It,{legendPayload:_a(e)}),f.createElement(za,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:i}),f.createElement(At,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:a,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:r,hasCustomShape:e.shape!=null}),f.createElement(ye,{zIndex:e.zIndex},f.createElement(Ya,F({},e,{id:i})))))}var et=f.memo(qa,yt);et.displayName="Bar";var Ha=["axis","item"],Za=f.forwardRef((t,e)=>f.createElement(Rt,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ha,tooltipPayloadSearcher:Ft,categoricalChartProps:t,ref:e}));const tt=60*1e3,ce=60*tt,Ja=24*ce,at=25*ce;function he(t,e){if(t.length===0)return 0;const a=[...t].sort((i,n)=>i-n),r=Math.max(0,Math.min(a.length-1,Math.ceil(e*a.length)-1));return a[r]??0}function Qa(t,e){return e<=at?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function er(t,e){const a=e-t;return a<=ce?Math.max(1,Math.min(60,Math.ceil(a/tt))):a<=at?Math.max(1,Math.min(25,Math.ceil(a/ce))):Math.max(1,Math.min(31,Math.ceil(a/Ja)))}function tr(t,e,a,r){const i=e.getTime(),n=a.getTime(),c=Math.max(1,n-i),s=er(i,n),m=Math.max(1,Math.floor(c/s)),l=[];for(let o=0;o<s;o++){const u=new Date(i+o*m);l.push({t:u.toISOString(),ts:u.getTime(),label:Qa(u,c),calls:0,errors:0,durations:[]})}for(const o of t){const u=new Date(o.timestamp).getTime(),v=Math.floor((u-i)/m),x=Math.max(0,Math.min(s-1,v)),p=l[x];p&&(p.calls+=1,o.isError&&(p.errors+=1),Number.isFinite(o.durationMs)&&p.durations.push(o.durationMs))}return l.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((u,v)=>u+v,0)/o.durations.length:0),p50:Math.round(he(o.durations,.5)),p95:Math.round(he(o.durations,.95))}))}function sr(t,e,a,r,i){const n=r??t.length,c=i??t.filter(u=>u.isError).length,s=t.map(u=>u.durationMs),m=s.length>0?s.reduce((u,v)=>u+v,0)/s.length:0,l=he(s,.95),o=tr(t,e.startDate,e.endDate);return{totalCalls:n,totalErrors:c,avgDurationMs:m,p95DurationMs:l,data:o}}function ze(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Ke(t){const e=Ne.c(19),{active:a,payload:r,dataKey:i,colorVar:n}=t;if(!a||!r?.length)return null;const c=r[0],s=c?.payload?.t??"";let m;e[0]!==c?.payload?.label||e[1]!==s?(m=s?new Date(s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):c?.payload?.label??"",e[0]=c?.payload?.label,e[1]=s,e[2]=m):m=e[2];const l=m,o=c?.value,u=typeof o=="number"?o:0,v=i==="avg"||i==="p50"||i==="p95",x=i==="costUsd";let p;e[3]!==x||e[4]!==v||e[5]!==u?(p=x?`$${u.toFixed(u<1?4:2)}`:v?u>=1e4?`${(u/1e3).toFixed(1)}s`:`${Math.round(u)}ms`:u.toLocaleString(),e[3]=x,e[4]=v,e[5]=u,e[6]=p):p=e[6];const g=p;let b;e[7]!==l?(b=I.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:l}),e[7]=l,e[8]=b):b=e[8];let d;e[9]!==n?(d=I.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:n}}),e[9]=n,e[10]=d):d=e[10];let h;e[11]!==g?(h=I.jsx("span",{className:"text-xs font-medium tabular-nums",children:g}),e[11]=g,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=I.jsxs("div",{className:"flex items-center gap-1.5",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let k;return e[16]!==b||e[17]!==y?(k=I.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[b,y]}),e[16]=b,e[17]=y,e[18]=k):k=e[18],k}function cr(t){const e=Ne.c(85),{data:a,dataKey:r,colorNum:i,chartHeight:n,variant:c,ariaLabel:s}=t,m=c===void 0?"bar":c,l=`var(--chart-${i})`,o=`kpi-gradient-${r}-${i}`,u=Math.max(...a.map(B=>B[r]??0),0);if(m==="area"){let B;e[0]!==n?(B=Ie(n,"w-full"),e[0]=n,e[1]=B):B=e[1];let E;e[2]!==l||e[3]!==r?(E={label:r,color:l},e[2]=l,e[3]=r,e[4]=E):E=e[4];let D;e[5]!==r||e[6]!==E?(D={[r]:E},e[5]=r,e[6]=E,e[7]=D):D=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N={left:0,right:-12,top:8,bottom:8},e[8]=N):N=e[8];let L,_;e[9]!==l?(L=I.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.2}),_=I.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:0}),e[9]=l,e[10]=L,e[11]=_):(L=e[10],_=e[11]);let z;e[12]!==o||e[13]!==L||e[14]!==_?(z=I.jsx("defs",{children:I.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[L,_]})}),e[12]=o,e[13]=L,e[14]=_,e[15]=z):z=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[16]=T):T=e[16];let W;e[17]===Symbol.for("react.memo_cache_sentinel")?(W=I.jsx(Me,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),e[17]=W):W=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[18]=U):U=e[18];const te=u>0?"auto":10;let Y;e[19]!==te?(Y=I.jsx(we,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ze,width:40,domain:[0,te],tickCount:5}),e[19]=te,e[20]=Y):Y=e[20];let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re={stroke:"var(--border)",strokeDasharray:"4 4"},e[21]=re):re=e[21];let X;e[22]!==l||e[23]!==r?(X=I.jsx(Ae,{cursor:re,content:rt=>{const{active:nt,payload:it}=rt;return I.jsx(Ke,{active:nt,payload:it,dataKey:r,colorVar:l})}}),e[22]=l,e[23]=r,e[24]=X):X=e[24];const de=`url(#${o})`;let q;e[25]!==l?(q={r:4,fill:l,stroke:"var(--background)",strokeWidth:2},e[25]=l,e[26]=q):q=e[26];let H;e[27]!==l||e[28]!==r||e[29]!==de||e[30]!==q?(H=I.jsx($t,{type:"linear",dataKey:r,stroke:l,strokeWidth:2,fill:de,animationDuration:300,dot:!1,activeDot:q}),e[27]=l,e[28]=r,e[29]=de,e[30]=q,e[31]=H):H=e[31];let Z;e[32]!==a||e[33]!==Y||e[34]!==X||e[35]!==H||e[36]!==z?(Z=I.jsxs(Wt,{data:a,margin:N,children:[z,T,W,Y,X,H]}),e[32]=a,e[33]=Y,e[34]=X,e[35]=H,e[36]=z,e[37]=Z):Z=e[37];let ne;return e[38]!==s||e[39]!==Z||e[40]!==B||e[41]!==D?(ne=I.jsx(Pe,{role:"img","aria-label":s,className:B,config:D,children:Z}),e[38]=s,e[39]=Z,e[40]=B,e[41]=D,e[42]=ne):ne=e[42],ne}let v;e[43]!==n?(v=Ie(n,"w-full"),e[43]=n,e[44]=v):v=e[44];let x;e[45]!==l||e[46]!==r?(x={label:r,color:l},e[45]=l,e[46]=r,e[47]=x):x=e[47];let p;e[48]!==r||e[49]!==x?(p={[r]:x},e[48]=r,e[49]=x,e[50]=p):p=e[50];let g,b;e[51]===Symbol.for("react.memo_cache_sentinel")?(g={left:0,right:-12,top:8,bottom:8},b=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[51]=g,e[52]=b):(g=e[51],b=e[52]);let d;e[53]===Symbol.for("react.memo_cache_sentinel")?(d={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[53]=d):d=e[53];const h=a.length<=6?0:Math.floor(a.length/6);let y;e[54]!==h?(y=I.jsx(Me,{dataKey:"label",axisLine:!1,tickLine:!1,tick:d,interval:h,tickMargin:8}),e[54]=h,e[55]=y):y=e[55];let k;e[56]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[56]=k):k=e[56];const C=u>0?"auto":10;let A;e[57]!==C?(A=I.jsx(we,{orientation:"right",axisLine:!1,tickLine:!1,tick:k,tickFormatter:ze,width:40,domain:[0,C],tickCount:5}),e[57]=C,e[58]=A):A=e[58];let P;e[59]===Symbol.for("react.memo_cache_sentinel")?(P={fill:"var(--muted)",opacity:.3},e[59]=P):P=e[59];let w;e[60]!==l||e[61]!==r?(w=I.jsx(Ae,{cursor:P,content:B=>{const{active:E,payload:D}=B;return I.jsx(Ke,{active:E,payload:D,dataKey:r,colorVar:l})}}),e[60]=l,e[61]=r,e[62]=w):w=e[62];let j;if(e[63]!==l||e[64]!==a||e[65]!==r){let B;e[67]!==l||e[68]!==r?(B=(E,D)=>I.jsx(be,{fill:(E[r]??0)===0?"var(--muted-foreground)":l,fillOpacity:(E[r]??0)===0?.15:.85},`cell-${D}`),e[67]=l,e[68]=r,e[69]=B):B=e[69],j=a.map(B),e[63]=l,e[64]=a,e[65]=r,e[66]=j}else j=e[66];let S;e[70]!==l||e[71]!==r||e[72]!==j?(S=I.jsx(et,{dataKey:r,fill:l,radius:0,minPointSize:1,children:j}),e[70]=l,e[71]=r,e[72]=j,e[73]=S):S=e[73];let O;e[74]!==a||e[75]!==A||e[76]!==w||e[77]!==S||e[78]!==y?(O=I.jsxs(Za,{data:a,margin:g,children:[b,y,A,w,S]}),e[74]=a,e[75]=A,e[76]=w,e[77]=S,e[78]=y,e[79]=O):O=e[79];let K;return e[80]!==s||e[81]!==O||e[82]!==v||e[83]!==p?(K=I.jsx(Pe,{role:"img","aria-label":s,className:v,config:p,children:O}),e[80]=s,e[81]=O,e[82]=v,e[83]=p,e[84]=K):K=e[84],K}export{Za as B,be as C,cr as K,et as a,sr as c};
1
+ import{r as f,f2 as lt,c as Ne,l as Ie,j as I}from"./index-BiuSAlzd.js";import{C as Ae,d as Pe}from"./chart-AQf5J0lZ.js";import{a5 as xe,ap as ot,aq as st,ar as ct,as as ut,P as ue,al as fe,$ as ve,h as dt,J as Se,a as $,at as ft,a9 as vt,s as ee,b as mt,f as J,g as Q,j as Te,k as Re,au as Fe,av as pt,aw as ht,l as Ee,ax as xt,ay as Oe,n as gt,L as le,p as yt,r as bt,D as ge,u as $e,R as kt,S as It,m as At,Z as ye,o as We,q as Pt,t as St,y as Et,v as Ot,az as Bt,z as oe,H as Ge,G as Ct,aA as jt,aB as wt,aC as Be,aD as Ve,aE as Mt,aF as Ue,K as Dt,N as Lt,O as R,T as _t,U as zt,V as Kt,aG as Nt,Q as Tt,am as Ce,a0 as Rt,a1 as Ft,C as je,Y as we}from"./CartesianChart-YXdY8HHd.js";import{X as Me}from"./XAxis-DgLHWAdH.js";import{s as G,b as V,A as $t,a as Wt}from"./AreaChart-xcCkJdeX.js";import{a as Gt,S as Vt}from"./ErrorBarContext-CICGscAV.js";var be=t=>null;be.displayName="Cell";var Ye=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ot({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},Xe=t=>{var e=xe();return(a,r)=>i=>{t?.(a,r,i),e(st())}},qe=(t,e,a)=>{var r=xe();return(i,n)=>c=>{t?.(i,n,c),r(ct({activeIndex:String(n),activeDataKey:e,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:a}))}},De=(t,e,a)=>{var r=a??t;if(!ue(r))return fe(r,e,0)},Ut=(t,e,a)=>{var r={},i=t.filter(ut),n=t.filter(l=>l.stackId==null),c=i.reduce((l,o)=>{var u=l[o.stackId];return u==null&&(u=[]),u.push(o),l[o.stackId]=u,l},r),s=Object.entries(c).map(l=>{var o,[u,v]=l,x=v.map(g=>g.dataKey),p=De(e,a,(o=v[0])===null||o===void 0?void 0:o.barSize);return{stackId:u,dataKeys:x,barSize:p}}),m=n.map(l=>{var o=[l.dataKey].filter(v=>v!=null),u=De(e,a,l.barSize);return{stackId:void 0,dataKeys:o,barSize:u}});return[...s,...m]};function Le(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function ie(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Le(Object(a),!0).forEach(function(r){Yt(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Le(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Yt(t,e,a){return(e=Xt(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Xt(t){var e=qt(t,"string");return typeof e=="symbol"?e:e+""}function qt(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ht(t,e,a,r,i){var n,c=r.length;if(!(c<1)){var s=fe(t,a,0,!0),m,l=[];if(ve((n=r[0])===null||n===void 0?void 0:n.barSize)){var o=!1,u=a/c,v=r.reduce((h,y)=>h+(y.barSize||0),0);v+=(c-1)*s,v>=a&&(v-=(c-1)*s,s=0),v>=a&&u>0&&(o=!0,u*=.9,v=c*u);var x=(a-v)/2>>0,p={offset:x-s,size:0};m=r.reduce((h,y)=>{var k,C={stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:p.offset+p.size+s,size:o?u:(k=y.barSize)!==null&&k!==void 0?k:0}},A=[...h,C];return p=C.position,A},l)}else{var g=fe(e,a,0,!0);a-2*g-(c-1)*s<=0&&(s=0);var b=(a-2*g-(c-1)*s)/c;b>1&&(b>>=0);var d=ve(i)?Math.min(b,i):b;m=r.reduce((h,y,k)=>[...h,{stackId:y.stackId,dataKeys:y.dataKeys,position:{offset:g+(b+s)*k+(b-d)/2,size:d}}],l)}return m}}var Zt=(t,e,a,r,i,n,c)=>{var s=ue(c)?e:c,m=Ht(a,r,i!==n?i:n,t,s);return i!==n&&m!=null&&(m=m.map(l=>ie(ie({},l),{},{position:ie(ie({},l.position),{},{offset:l.position.offset-i/2})}))),m},Jt=(t,e)=>{var a=dt(e);if(!(!t||a==null||e==null)){var{stackId:r}=e;if(r!=null){var i=t[r];if(i){var{stackedData:n}=i;if(n)return n.find(c=>c.key===a)}}}},Qt=(t,e)=>{if(!(t==null||e==null)){var a=t.find(r=>r.stackId===e.stackId&&e.dataKey!=null&&r.dataKeys.includes(e.dataKey));if(a!=null)return a.position}};function ea(t,e){return t&&typeof t=="object"&&"zIndex"in t&&typeof t.zIndex=="number"&&ve(t.zIndex)?t.zIndex:e}var ta="Invariant failed";function aa(t,e){throw new Error(ta)}function me(){return me=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},me.apply(null,arguments)}function ke(t){return f.createElement(Gt,me({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},t))}var ra=function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Se(e))return e;var n=Se(r)||ue(r);return n?e(r,i):(n||aa(),a)}},na=(t,e,a)=>a,ia=(t,e)=>e,ae=$([Re,ia],(t,e)=>t.filter(a=>a.type==="bar").find(a=>a.id===e)),la=$([ae],t=>t?.maxBarSize),oa=(t,e,a,r)=>r,sa=$([ee,Re,G,V,na],(t,e,a,r,i)=>e.filter(n=>t==="horizontal"?n.xAxisId===a:n.yAxisId===r).filter(n=>n.isPanorama===i).filter(n=>n.hide===!1).filter(n=>n.type==="bar")),ca=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null))return r==="horizontal"?Ee(t,"yAxis",n,a):Ee(t,"xAxis",i,a)},ua=(t,e)=>{var a=ee(t),r=G(t,e),i=V(t,e);if(!(r==null||i==null))return a==="horizontal"?Oe(t,"xAxis",r):Oe(t,"yAxis",i)},da=$([sa,xt,ua],Ut),fa=(t,e,a)=>{var r,i,n=ae(t,e);if(n==null)return 0;var c=G(t,e),s=V(t,e);if(c==null||s==null)return 0;var m=ee(t),l=Fe(t),{maxBarSize:o}=n,u=ue(o)?l:o,v,x;return m==="horizontal"?(v=J(t,"xAxis",c,a),x=Q(t,"xAxis",c,a)):(v=J(t,"yAxis",s,a),x=Q(t,"yAxis",s,a)),(r=(i=Te(v,x,!0))!==null&&i!==void 0?i:u)!==null&&r!==void 0?r:0},He=(t,e,a)=>{var r=ee(t),i=G(t,e),n=V(t,e);if(!(i==null||n==null)){var c,s;return r==="horizontal"?(c=J(t,"xAxis",i,a),s=Q(t,"xAxis",i,a)):(c=J(t,"yAxis",n,a),s=Q(t,"yAxis",n,a)),Te(c,s)}},va=$([da,Fe,pt,ht,fa,He,la],Zt),ma=(t,e,a)=>{var r=G(t,e);if(r!=null)return J(t,"xAxis",r,a)},pa=(t,e,a)=>{var r=V(t,e);if(r!=null)return J(t,"yAxis",r,a)},ha=(t,e,a)=>{var r=G(t,e);if(r!=null)return Q(t,"xAxis",r,a)},xa=(t,e,a)=>{var r=V(t,e);if(r!=null)return Q(t,"yAxis",r,a)},ga=$([va,ae],Qt),ya=$([ca,ae],Jt),ba=$([ft,vt,ma,pa,ha,xa,ga,ee,mt,He,ya,ae,oa],(t,e,a,r,i,n,c,s,m,l,o,u,v)=>{var{chartData:x,dataStartIndex:p,dataEndIndex:g}=m;if(!(u==null||c==null||e==null||s!=="horizontal"&&s!=="vertical"||a==null||r==null||i==null||n==null||l==null)){var{data:b}=u,d;if(b!=null&&b.length>0?d=b:d=x?.slice(p,g+1),d!=null)return Xa({layout:s,barSettings:u,pos:c,parentViewBox:e,bandSize:l,xAxis:a,yAxis:r,xAxisTicks:i,yAxisTicks:n,stackedData:o,displayedData:d,offset:t,cells:v,dataStartIndex:p})}}),ka=["index"];function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},pe.apply(null,arguments)}function Ia(t,e){if(t==null)return{};var a,r,i=Aa(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function Aa(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var Ze=f.createContext(void 0),Pa=t=>{var e=f.useContext(Ze);if(e!=null)return e.stackId;if(t!=null)return gt(t)},Sa=(t,e)=>"recharts-bar-stack-clip-path-".concat(t,"-").concat(e),Ea=t=>{var e=f.useContext(Ze);if(e!=null){var{stackId:a}=e;return"url(#".concat(Sa(a,t),")")}},Je=t=>{var{index:e}=t,a=Ia(t,ka),r=Ea(e);return f.createElement(le,pe({className:"recharts-bar-stack-layer",clipPath:r},a))},Oa=["onMouseEnter","onMouseLeave","onClick"],Ba=["value","background","tooltipPosition"],Ca=["id"],ja=["onMouseEnter","onClick","onMouseLeave"];function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},F.apply(null,arguments)}function _e(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),a.push.apply(a,r)}return a}function M(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?_e(Object(a),!0).forEach(function(r){wa(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):_e(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function wa(t,e,a){return(e=Ma(e))in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function Ma(t){var e=Da(t,"string");return typeof e=="symbol"?e:e+""}function Da(t,e){if(typeof t!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function se(t,e){if(t==null)return{};var a,r,i=La(t,e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);for(r=0;r<n.length;r++)a=n[r],e.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(i[a]=t[a])}return i}function La(t,e){if(t==null)return{};var a={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;a[r]=t[r]}return a}var _a=t=>{var{dataKey:e,name:a,fill:r,legendType:i,hide:n}=t;return[{inactive:n,dataKey:e,type:i,color:r,value:We(a,e),payload:t}]},za=f.memo(t=>{var{dataKey:e,stroke:a,strokeWidth:r,fill:i,name:n,hide:c,unit:s,tooltipType:m,id:l}=t,o={dataDefinedOnItem:void 0,getPosition:St,settings:{stroke:a,strokeWidth:r,fill:i,dataKey:e,nameKey:void 0,name:We(n,e),hide:c,type:m,color:i,unit:s,graphicalItemId:l}};return f.createElement(Pt,{tooltipEntrySettings:o})});function Ka(t){var e=oe(Ve),{data:a,dataKey:r,background:i,allOtherBarProps:n}=t,{onMouseEnter:c,onMouseLeave:s,onClick:m}=n,l=se(n,Oa),o=Ye(c,r,n.id),u=Xe(s),v=qe(m,r,n.id);if(!i||a==null)return null;var x=Mt(i);return f.createElement(ye,{zIndex:ea(i,ge.barBackground)},a.map((p,g)=>{var{value:b,background:d,tooltipPosition:h}=p,y=se(p,Ba);if(!d)return null;var k=o(p,g),C=u(p,g),A=v(p,g),P=M(M(M(M(M({option:i,isActive:String(g)===e},y),{},{fill:"#eee"},d),x),Ue(l,p,g)),{},{onMouseEnter:k,onMouseLeave:C,onClick:A,dataKey:r,index:g,className:"recharts-bar-background-rectangle"});return f.createElement(ke,F({key:"background-bar-".concat(g)},P))}))}function Na(t){var{showLabels:e,children:a,rects:r}=t,i=r?.map(n=>{var c={x:n.x,y:n.y,width:n.width,lowerWidth:n.width,upperWidth:n.width,height:n.height};return M(M({},c),{},{value:n.value,payload:n.payload,parentViewBox:n.parentViewBox,viewBox:c,fill:n.fill})});return f.createElement(zt,{value:e?i:void 0},a)}function Ta(t){var{shape:e,activeBar:a,baseProps:r,entry:i,index:n,dataKey:c}=t,s=oe(Ve),m=oe(Nt),l=a&&String(i.originalDataIndex)===s&&(m==null||c===m),[o,u]=f.useState(!1),[v,x]=f.useState(!1);f.useEffect(()=>{var y;return l?(u(!0),y=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(y)}},[l]);var p=f.useCallback(()=>{l||u(!1)},[l]),g=l&&v,b=l||o,d;l?a===!0?d=e:d=a:d=e;var h=f.createElement(ke,F({},r,{name:String(r.name)},i,{isActive:g,option:d,index:n,dataKey:c,onTransitionEnd:p}));return b?f.createElement(ye,{zIndex:ge.activeBar},f.createElement(Je,{index:i.originalDataIndex},h)):h}function Ra(t){var{shape:e,baseProps:a,entry:r,index:i,dataKey:n}=t;return f.createElement(ke,F({},a,{name:String(a.name)},r,{isActive:!1,option:e,index:i,dataKey:n}))}function Fa(t){var e,{data:a,props:r}=t,i=(e=Kt(r))!==null&&e!==void 0?e:{},{id:n}=i,c=se(i,Ca),{shape:s,dataKey:m,activeBar:l}=r,{onMouseEnter:o,onClick:u,onMouseLeave:v}=r,x=se(r,ja),p=Ye(o,m,n),g=Xe(v),b=qe(u,m,n);return a?f.createElement(f.Fragment,null,a.map((d,h)=>f.createElement(Je,F({index:d.originalDataIndex,key:"rectangle-".concat(d?.x,"-").concat(d?.y,"-").concat(d?.value,"-").concat(h),className:"recharts-bar-rectangle"},Ue(x,d,h),{onMouseEnter:p(d,h),onMouseLeave:g(d,h),onClick:b(d,h)}),l?f.createElement(Ta,{shape:s,activeBar:l,baseProps:c,entry:d,index:h,dataKey:m}):f.createElement(Ra,{shape:s,baseProps:c,entry:d,index:h,dataKey:m})))):null}function $a(t){var{props:e,previousRectanglesRef:a}=t,{data:r,layout:i,isAnimationActive:n,animationBegin:c,animationDuration:s,animationEasing:m,onAnimationEnd:l,onAnimationStart:o}=e,u=a.current,v=Dt(e,"recharts-bar-"),[x,p]=f.useState(!1),g=!x,b=f.useCallback(()=>{typeof l=="function"&&l(),p(!1)},[l]),d=f.useCallback(()=>{typeof o=="function"&&o(),p(!0)},[o]);return f.createElement(Na,{showLabels:g,rects:r},f.createElement(Lt,{animationId:v,begin:c,duration:s,isActive:n,easing:m,onAnimationEnd:b,onAnimationStart:d,key:v},h=>{var y=h===1?r:r?.map((k,C)=>{var A=u&&u[C];if(A)return M(M({},k),{},{x:R(A.x,k.x,h),y:R(A.y,k.y,h),width:R(A.width,k.width,h),height:R(A.height,k.height,h)});if(i==="horizontal"){var P=R(0,k.height,h),w=R(k.stackedBarStart,k.y,h);return M(M({},k),{},{y:w,height:P})}var j=R(0,k.width,h),S=R(k.stackedBarStart,k.x,h);return M(M({},k),{},{width:j,x:S})});return h>0&&(a.current=y??null),y==null?null:f.createElement(le,null,f.createElement(Fa,{props:e,data:y}))}),f.createElement(_t,{label:e.label}),e.children)}function Wa(t){var e=f.useRef(null);return f.createElement($a,{previousRectanglesRef:e,props:t})}var Qe=0,Ga=(t,e)=>{var a=Array.isArray(t.value)?t.value[1]:t.value;return{x:t.x,y:t.y,value:a,errorVal:Ge(t,e)}};class Va extends f.PureComponent{render(){var{hide:e,data:a,dataKey:r,className:i,xAxisId:n,yAxisId:c,needClip:s,background:m,id:l}=this.props;if(e||a==null)return null;var o=lt("recharts-bar",i),u=l;return f.createElement(le,{className:o,id:l},s&&f.createElement("defs",null,f.createElement(Ct,{clipPathId:u,xAxisId:n,yAxisId:c})),f.createElement(le,{className:"recharts-bar-rectangles",clipPath:s?"url(#clipPath-".concat(u,")"):void 0},f.createElement(Ka,{data:a,dataKey:r,background:m,allOtherBarProps:this.props}),f.createElement(Wa,this.props)))}}var Ua={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Qe,xAxisId:0,yAxisId:0,zIndex:ge.bar};function Ya(t){var{xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o}=t,{needClip:u}=Et(e,a),v=Ot(),x=$e(),p=Bt(t.children,be),g=oe(h=>ba(h,t.id,x,p));if(v!=="vertical"&&v!=="horizontal")return null;var b,d=g?.[0];return d==null||d.height==null||d.width==null?b=0:b=v==="vertical"?d.height/2:d.width/2,f.createElement(Vt,{xAxisId:e,yAxisId:a,data:g,dataPointFormatter:Ga,errorBarOffset:b},f.createElement(Va,F({},t,{layout:v,needClip:u,data:g,xAxisId:e,yAxisId:a,hide:r,legendType:i,minPointSize:n,activeBar:c,animationBegin:s,animationDuration:m,animationEasing:l,isAnimationActive:o})))}function Xa(t){var{layout:e,barSettings:{dataKey:a,minPointSize:r,hasCustomShape:i},pos:n,bandSize:c,xAxis:s,yAxis:m,xAxisTicks:l,yAxisTicks:o,stackedData:u,displayedData:v,offset:x,cells:p,parentViewBox:g,dataStartIndex:b}=t,d=e==="horizontal"?m:s,h=u?d.scale.domain():null,y=jt({numericAxis:d}),k=d.scale.map(y);return v.map((C,A)=>{var P,w,j,S,O,K;if(u){var B=u[A+b];if(B==null)return null;P=wt(B,h)}else P=Ge(C,a),Array.isArray(P)||(P=[y,P]);var E=ra(r,Qe)(P[1],A);if(e==="horizontal"){var D,N=m.scale.map(P[0]),L=m.scale.map(P[1]);if(N==null||L==null)return null;w=Be({axis:s,ticks:l,bandSize:c,offset:n.offset,entry:C,index:A}),j=(D=L??N)!==null&&D!==void 0?D:void 0,S=n.size;var _=N-L;if(O=Tt(_)?0:_,K={x:w,y:x.top,width:S,height:x.height},Math.abs(E)>0&&Math.abs(O)<Math.abs(E)){var z=Ce(O||E)*(Math.abs(E)-Math.abs(O));j-=z,O+=z}}else{var T=s.scale.map(P[0]),W=s.scale.map(P[1]);if(T==null||W==null)return null;if(w=T,j=Be({axis:m,ticks:o,bandSize:c,offset:n.offset,entry:C,index:A}),S=W-T,O=n.size,K={x:x.left,y:j,width:x.width,height:O},Math.abs(E)>0&&Math.abs(S)<Math.abs(E)){var U=Ce(S||E)*(Math.abs(E)-Math.abs(S));S+=U}}if(w==null||j==null||S==null||O==null||!i&&(S===0||O===0))return null;var te=M(M({},C),{},{stackedBarStart:k,x:w,y:j,width:S,height:O,value:u?P:P[1],payload:C,background:K,tooltipPosition:{x:w+S/2,y:j+O/2},parentViewBox:g,originalDataIndex:A},p&&p[A]&&p[A].props);return te}).filter(Boolean)}function qa(t){var e=bt(t,Ua),a=Pa(e.stackId),r=$e();return f.createElement(kt,{id:e.id,type:"bar"},i=>f.createElement(f.Fragment,null,f.createElement(It,{legendPayload:_a(e)}),f.createElement(za,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,unit:e.unit,tooltipType:e.tooltipType,id:i}),f.createElement(At,{type:"bar",id:i,data:void 0,xAxisId:e.xAxisId,yAxisId:e.yAxisId,zAxisId:0,dataKey:e.dataKey,stackId:a,hide:e.hide,barSize:e.barSize,minPointSize:e.minPointSize,maxBarSize:e.maxBarSize,isPanorama:r,hasCustomShape:e.shape!=null}),f.createElement(ye,{zIndex:e.zIndex},f.createElement(Ya,F({},e,{id:i})))))}var et=f.memo(qa,yt);et.displayName="Bar";var Ha=["axis","item"],Za=f.forwardRef((t,e)=>f.createElement(Rt,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Ha,tooltipPayloadSearcher:Ft,categoricalChartProps:t,ref:e}));const tt=60*1e3,ce=60*tt,Ja=24*ce,at=25*ce;function he(t,e){if(t.length===0)return 0;const a=[...t].sort((i,n)=>i-n),r=Math.max(0,Math.min(a.length-1,Math.ceil(e*a.length)-1));return a[r]??0}function Qa(t,e){return e<=at?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})}function er(t,e){const a=e-t;return a<=ce?Math.max(1,Math.min(60,Math.ceil(a/tt))):a<=at?Math.max(1,Math.min(25,Math.ceil(a/ce))):Math.max(1,Math.min(31,Math.ceil(a/Ja)))}function tr(t,e,a,r){const i=e.getTime(),n=a.getTime(),c=Math.max(1,n-i),s=er(i,n),m=Math.max(1,Math.floor(c/s)),l=[];for(let o=0;o<s;o++){const u=new Date(i+o*m);l.push({t:u.toISOString(),ts:u.getTime(),label:Qa(u,c),calls:0,errors:0,durations:[]})}for(const o of t){const u=new Date(o.timestamp).getTime(),v=Math.floor((u-i)/m),x=Math.max(0,Math.min(s-1,v)),p=l[x];p&&(p.calls+=1,o.isError&&(p.errors+=1),Number.isFinite(o.durationMs)&&p.durations.push(o.durationMs))}return l.map(o=>({t:o.t,ts:o.ts,label:o.label,calls:o.calls,errors:o.errors,errorRate:o.calls>0?o.errors/o.calls*100:0,avg:Math.round(o.durations.length>0?o.durations.reduce((u,v)=>u+v,0)/o.durations.length:0),p50:Math.round(he(o.durations,.5)),p95:Math.round(he(o.durations,.95))}))}function sr(t,e,a,r,i){const n=r??t.length,c=i??t.filter(u=>u.isError).length,s=t.map(u=>u.durationMs),m=s.length>0?s.reduce((u,v)=>u+v,0)/s.length:0,l=he(s,.95),o=tr(t,e.startDate,e.endDate);return{totalCalls:n,totalErrors:c,avgDurationMs:m,p95DurationMs:l,data:o}}function ze(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:String(t)}function Ke(t){const e=Ne.c(19),{active:a,payload:r,dataKey:i,colorVar:n}=t;if(!a||!r?.length)return null;const c=r[0],s=c?.payload?.t??"";let m;e[0]!==c?.payload?.label||e[1]!==s?(m=s?new Date(s).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):c?.payload?.label??"",e[0]=c?.payload?.label,e[1]=s,e[2]=m):m=e[2];const l=m,o=c?.value,u=typeof o=="number"?o:0,v=i==="avg"||i==="p50"||i==="p95",x=i==="costUsd";let p;e[3]!==x||e[4]!==v||e[5]!==u?(p=x?`$${u.toFixed(u<1?4:2)}`:v?u>=1e4?`${(u/1e3).toFixed(1)}s`:`${Math.round(u)}ms`:u.toLocaleString(),e[3]=x,e[4]=v,e[5]=u,e[6]=p):p=e[6];const g=p;let b;e[7]!==l?(b=I.jsx("div",{className:"text-[11px] text-muted-foreground mb-1",children:l}),e[7]=l,e[8]=b):b=e[8];let d;e[9]!==n?(d=I.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:n}}),e[9]=n,e[10]=d):d=e[10];let h;e[11]!==g?(h=I.jsx("span",{className:"text-xs font-medium tabular-nums",children:g}),e[11]=g,e[12]=h):h=e[12];let y;e[13]!==d||e[14]!==h?(y=I.jsxs("div",{className:"flex items-center gap-1.5",children:[d,h]}),e[13]=d,e[14]=h,e[15]=y):y=e[15];let k;return e[16]!==b||e[17]!==y?(k=I.jsxs("div",{className:"rounded-lg border bg-background px-3 py-2 shadow-md",children:[b,y]}),e[16]=b,e[17]=y,e[18]=k):k=e[18],k}function cr(t){const e=Ne.c(85),{data:a,dataKey:r,colorNum:i,chartHeight:n,variant:c,ariaLabel:s}=t,m=c===void 0?"bar":c,l=`var(--chart-${i})`,o=`kpi-gradient-${r}-${i}`,u=Math.max(...a.map(B=>B[r]??0),0);if(m==="area"){let B;e[0]!==n?(B=Ie(n,"w-full"),e[0]=n,e[1]=B):B=e[1];let E;e[2]!==l||e[3]!==r?(E={label:r,color:l},e[2]=l,e[3]=r,e[4]=E):E=e[4];let D;e[5]!==r||e[6]!==E?(D={[r]:E},e[5]=r,e[6]=E,e[7]=D):D=e[7];let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N={left:0,right:-12,top:8,bottom:8},e[8]=N):N=e[8];let L,_;e[9]!==l?(L=I.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.2}),_=I.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:0}),e[9]=l,e[10]=L,e[11]=_):(L=e[10],_=e[11]);let z;e[12]!==o||e[13]!==L||e[14]!==_?(z=I.jsx("defs",{children:I.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[L,_]})}),e[12]=o,e[13]=L,e[14]=_,e[15]=z):z=e[15];let T;e[16]===Symbol.for("react.memo_cache_sentinel")?(T=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[16]=T):T=e[16];let W;e[17]===Symbol.for("react.memo_cache_sentinel")?(W=I.jsx(Me,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),e[17]=W):W=e[17];let U;e[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[18]=U):U=e[18];const te=u>0?"auto":10;let Y;e[19]!==te?(Y=I.jsx(we,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ze,width:40,domain:[0,te],tickCount:5}),e[19]=te,e[20]=Y):Y=e[20];let re;e[21]===Symbol.for("react.memo_cache_sentinel")?(re={stroke:"var(--border)",strokeDasharray:"4 4"},e[21]=re):re=e[21];let X;e[22]!==l||e[23]!==r?(X=I.jsx(Ae,{cursor:re,content:rt=>{const{active:nt,payload:it}=rt;return I.jsx(Ke,{active:nt,payload:it,dataKey:r,colorVar:l})}}),e[22]=l,e[23]=r,e[24]=X):X=e[24];const de=`url(#${o})`;let q;e[25]!==l?(q={r:4,fill:l,stroke:"var(--background)",strokeWidth:2},e[25]=l,e[26]=q):q=e[26];let H;e[27]!==l||e[28]!==r||e[29]!==de||e[30]!==q?(H=I.jsx($t,{type:"linear",dataKey:r,stroke:l,strokeWidth:2,fill:de,animationDuration:300,dot:!1,activeDot:q}),e[27]=l,e[28]=r,e[29]=de,e[30]=q,e[31]=H):H=e[31];let Z;e[32]!==a||e[33]!==Y||e[34]!==X||e[35]!==H||e[36]!==z?(Z=I.jsxs(Wt,{data:a,margin:N,children:[z,T,W,Y,X,H]}),e[32]=a,e[33]=Y,e[34]=X,e[35]=H,e[36]=z,e[37]=Z):Z=e[37];let ne;return e[38]!==s||e[39]!==Z||e[40]!==B||e[41]!==D?(ne=I.jsx(Pe,{role:"img","aria-label":s,className:B,config:D,children:Z}),e[38]=s,e[39]=Z,e[40]=B,e[41]=D,e[42]=ne):ne=e[42],ne}let v;e[43]!==n?(v=Ie(n,"w-full"),e[43]=n,e[44]=v):v=e[44];let x;e[45]!==l||e[46]!==r?(x={label:r,color:l},e[45]=l,e[46]=r,e[47]=x):x=e[47];let p;e[48]!==r||e[49]!==x?(p={[r]:x},e[48]=r,e[49]=x,e[50]=p):p=e[50];let g,b;e[51]===Symbol.for("react.memo_cache_sentinel")?(g={left:0,right:-12,top:8,bottom:8},b=I.jsx(je,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),e[51]=g,e[52]=b):(g=e[51],b=e[52]);let d;e[53]===Symbol.for("react.memo_cache_sentinel")?(d={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[53]=d):d=e[53];const h=a.length<=6?0:Math.floor(a.length/6);let y;e[54]!==h?(y=I.jsx(Me,{dataKey:"label",axisLine:!1,tickLine:!1,tick:d,interval:h,tickMargin:8}),e[54]=h,e[55]=y):y=e[55];let k;e[56]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},e[56]=k):k=e[56];const C=u>0?"auto":10;let A;e[57]!==C?(A=I.jsx(we,{orientation:"right",axisLine:!1,tickLine:!1,tick:k,tickFormatter:ze,width:40,domain:[0,C],tickCount:5}),e[57]=C,e[58]=A):A=e[58];let P;e[59]===Symbol.for("react.memo_cache_sentinel")?(P={fill:"var(--muted)",opacity:.3},e[59]=P):P=e[59];let w;e[60]!==l||e[61]!==r?(w=I.jsx(Ae,{cursor:P,content:B=>{const{active:E,payload:D}=B;return I.jsx(Ke,{active:E,payload:D,dataKey:r,colorVar:l})}}),e[60]=l,e[61]=r,e[62]=w):w=e[62];let j;if(e[63]!==l||e[64]!==a||e[65]!==r){let B;e[67]!==l||e[68]!==r?(B=(E,D)=>I.jsx(be,{fill:(E[r]??0)===0?"var(--muted-foreground)":l,fillOpacity:(E[r]??0)===0?.15:.85},`cell-${D}`),e[67]=l,e[68]=r,e[69]=B):B=e[69],j=a.map(B),e[63]=l,e[64]=a,e[65]=r,e[66]=j}else j=e[66];let S;e[70]!==l||e[71]!==r||e[72]!==j?(S=I.jsx(et,{dataKey:r,fill:l,radius:0,minPointSize:1,children:j}),e[70]=l,e[71]=r,e[72]=j,e[73]=S):S=e[73];let O;e[74]!==a||e[75]!==A||e[76]!==w||e[77]!==S||e[78]!==y?(O=I.jsxs(Za,{data:a,margin:g,children:[b,y,A,w,S]}),e[74]=a,e[75]=A,e[76]=w,e[77]=S,e[78]=y,e[79]=O):O=e[79];let K;return e[80]!==s||e[81]!==O||e[82]!==v||e[83]!==p?(K=I.jsx(Pe,{role:"img","aria-label":s,className:v,config:p,children:O}),e[80]=s,e[81]=O,e[82]=v,e[83]=p,e[84]=K):K=e[84],K}export{Za as B,be as C,cr as K,et as a,sr as c};
@@ -1 +1 @@
1
- import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-C5LlvZFc.js";import{B as re}from"./badge-BrDXjbHd.js";import{C as ce}from"./checkbox-C68xjrg5.js";import{t as de}from"./ChevronUp-BAvbedXO.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-DA3SiBwF.js";import{a as be,b as Ne,P as ye}from"./popover-98ItoIiE.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
1
+ import{c as fe,r as Z,l as he,j as t,B as pe}from"./index-BiuSAlzd.js";import{B as re}from"./badge-Dw0XHZAq.js";import{C as ce}from"./checkbox-D-g_vU3W.js";import{t as de}from"./ChevronUp-B79uJeZN.js";import{C as xe,a as ge,b as me,c as ve,e as je,f as Ce}from"./command-B-LkMxT6.js";import{a as be,b as Ne,P as ye}from"./popover-DwQhmYZx.js";const we=[];function Ae(o){const e=fe.c(72),{options:n,onValueChange:i,defaultValue:ee,placeholder:te,variant:se,animation:le,maxCount:ae,modalPopover:ne,asChild:ie,className:J,disabled:oe,onSearchChange:P}=o,d=ee===void 0?we:ee,Y=te===void 0?"Select items":te,V=se===void 0?"default":se,_=le===void 0?0:le,k=ae===void 0?3:ae,F=ne===void 0?!1:ne,G=ie===void 0?!1:ie,L=oe===void 0?!1:oe,[s,S]=Z.useState(d),[q,E]=Z.useState(!1);let O,B;e[0]!==d||e[1]!==s?(B=()=>{JSON.stringify(s)!==JSON.stringify(d)&&S(d)},O=[d,s],e[0]=d,e[1]=s,e[2]=O,e[3]=B):(O=e[2],B=e[3]),Z.useEffect(B,O);let D;e[4]!==i||e[5]!==s?(D=l=>{if(l.key==="Enter")E(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const a=[...s];a.pop(),S(a),i(a)}},e[4]=i,e[5]=s,e[6]=D):D=e[6];const H=D;let I;e[7]!==i||e[8]!==s?(I=l=>{const a=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];S(a),i(a)},e[7]=i,e[8]=s,e[9]=I):I=e[9];const c=I;let A;e[10]!==i?(A=()=>{S([]),i([])},e[10]=i,e[11]=A):A=e[11];const Q=A;let R;e[12]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{E(Ve)},e[12]=R):R=e[12];const ue=R;let T;e[13]!==Q||e[14]!==i||e[15]!==n||e[16]!==s.length?(T=()=>{if(s.length===n.length)Q();else{const l=n.map(Pe);S(l),i(l)}},e[13]=Q,e[14]=i,e[15]=n,e[16]=s.length,e[17]=T):T=e[17];const r=T;let m;e[18]!==G?(m=G?{}:{variant:"outline"},e[18]=G,e[19]=m):m=e[19];let u;e[20]!==J?(u=he("border-input data-[placeholder]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full max-w-xs items-center justify-between gap-2 border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[2px] disabled:cursor-not-allowed disabled:opacity-50 h-10 min-h-10",J),e[20]=J,e[21]=u):u=e[21];let f;e[22]!==_||e[23]!==k||e[24]!==n||e[25]!==Y||e[26]!==s||e[27]!==V?(f=s.length>0?t.jsxs("div",{className:"flex items-center justify-between w-full min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[s.slice(0,k).map(l=>{const a=n.find(X=>X.value===l),w=a?.icon;return t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"max-w-24",style:{animationDuration:`${_}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:a?.label})]},l)}),s.length>k&&t.jsxs(re,{variant:V==="default"?"default":"secondary",className:"flex-shrink-0",style:{animationDuration:`${_}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(de,{size:20,className:"shrink-0 opacity-50"})})]}):t.jsxs("div",{className:"flex items-center justify-between w-full",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:Y}),t.jsx(de,{size:20,className:"shrink-0 opacity-50"})]}),e[22]=_,e[23]=k,e[24]=n,e[25]=Y,e[26]=s,e[27]=V,e[28]=f):f=e[28];let h;e[29]!==L||e[30]!==m||e[31]!==u||e[32]!==f?(h=t.jsx(be,{asChild:!0,children:t.jsx(pe,{ref:null,...m,onClick:ue,className:u,disabled:L,children:f})}),e[29]=L,e[30]=m,e[31]=u,e[32]=f,e[33]=h):h=e[33];let K;e[34]===Symbol.for("react.memo_cache_sentinel")?(K=()=>E(!1),e[34]=K):K=e[34];const U=!P;let p;e[35]!==H||e[36]!==P?(p=t.jsx(xe,{placeholder:"Search...",onKeyDown:H,onValueChange:P,className:"rounded-t-xl"}),e[35]=H,e[36]=P,e[37]=p):p=e[37];let M;e[38]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(ge,{children:"No results found."}),e[38]=M):M=e[38];let x;e[39]!==r?(x=()=>{r()},e[39]=r,e[40]=x):x=e[40];let g;e[41]!==r?(g=l=>{l.stopPropagation(),r()},e[41]=r,e[42]=g):g=e[42];const W=s.length===n.length&&n.length>0;let v;e[43]!==W||e[44]!==r?(v=t.jsx(ce,{checked:W,onCheckedChange:r,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:Se}),e[43]=W,e[44]=r,e[45]=v):v=e[45];let $;e[46]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"(Select All)"}),e[46]=$):$=e[46];let j;e[47]!==g||e[48]!==v?(j=t.jsxs("div",{className:"flex items-center w-full",onClick:g,children:[v,$]}),e[47]=g,e[48]=v,e[49]=j):j=e[49];let C;e[50]!==x||e[51]!==j?(C=t.jsx(me,{onSelect:x,className:"cursor-pointer",children:j},"all"),e[50]=x,e[51]=j,e[52]=C):C=e[52];let b;if(e[53]!==n||e[54]!==s||e[55]!==c){let l;e[57]!==s||e[58]!==c?(l=a=>{const w=s.includes(a.value);return t.jsx(me,{onSelect:()=>{c(a)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:X=>{X.stopPropagation(),c(a)},children:[t.jsx(ce,{checked:w,onCheckedChange:()=>{c(a)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:ke}),a.icon&&t.jsx(a.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:a.label})]})},a.value)},e[57]=s,e[58]=c,e[59]=l):l=e[59],b=n.map(l),e[53]=n,e[54]=s,e[55]=c,e[56]=b}else b=e[56];let N;e[60]!==C||e[61]!==b?(N=t.jsxs(ve,{className:"rounded-b-xl",children:[M,t.jsxs(je,{children:[C,b]})]}),e[60]=C,e[61]=b,e[62]=N):N=e[62];let y;e[63]!==U||e[64]!==p||e[65]!==N?(y=t.jsx(Ne,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:K,children:t.jsxs(Ce,{shouldFilter:U,className:"rounded-xl",children:[p,N]})}),e[63]=U,e[64]=p,e[65]=N,e[66]=y):y=e[66];let z;return e[67]!==q||e[68]!==F||e[69]!==h||e[70]!==y?(z=t.jsxs(ye,{open:q,onOpenChange:E,modal:F,children:[h,y]}),e[67]=q,e[68]=F,e[69]=h,e[70]=y,e[71]=z):z=e[71],z}function ke(o){return o.stopPropagation()}function Se(o){return o.stopPropagation()}function Pe(o){return o.value}function Ve(o){return!o}export{Ae as M};
@@ -1,4 +1,4 @@
1
- import{o as B,e as z,K as O,b as F,r as J,j as w,B as q,t as U}from"./index-C5LlvZFc.js";import{u as V}from"./use-session-runtime-XVdydjwY.js";import{u as _,z as H,A as $,B as G,y as L,q as Y}from"./claim-phase-copy-C42LUZgr.js";import{h as X,n as Z,i as I}from"./runnable-block-editor-246vsgYp.js";import{o as M}from"./sandbox-git-api-B1R0585s.js";import{u as ee}from"./chat-context-CbVc7tEo.js";import{b as te}from"./sandbox-url-D3mC8qhT.js";import{a as re}from"./utils-DWTn-3pm.js";import{i as se}from"./CheckCircle-iXm3h-fF.js";import{a as ne}from"./Copy01-C_KnfAlj.js";import{D as ae,b as ie,c as oe,d as ce}from"./dialog-BJny2srB.js";import{M as ue}from"./monaco-editor-D29Kd2Kr.js";function Qe({orgSlug:s,virtualMcpId:e,branch:t}){const r=B(),a=ee()?.taskId??null,n=X(e),i=V(e).runtime==="cms",{url:o}=_(e),c=Z({orgSlug:s,virtualMcpId:e,branch:t,localPreviewUrl:o});return z({mutationKey:Y(s,e,t),scope:L(s,e,t),mutationFn:async({blockKey:u})=>{if(o)return{ok:!0,existed:!0};if(i){const h=await H({orgSlug:s,virtualMcpId:e,branch:t},{delete:[u]});return $(r,{orgSlug:s,virtualMcpId:e,branch:t},h),await r.invalidateQueries({queryKey:M({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const f=I(n,re(u)),l=await fetch(te({orgSlug:s,virtualMcpId:e,branch:t,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():G(l,"Delete")},onMutate:async({blockKey:u})=>{const f=O.decofile(c);await r.cancelQueries({queryKey:f});const l=r.getQueryData(f),h=!!l&&u in l,C=l?.[u];return r.setQueryData(f,b=>{if(!b)return b;const{[u]:p,...g}=b;return g}),{queryKey:f,blockKey:u,hadKey:h,previousValue:C}},onError:(u,f,l)=>{l&&r.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h)},onSuccess:()=>{r.invalidateQueries({queryKey:O.liveMeta(s,e,t)})}})}function We({open:s,onOpenChange:e,pageKey:t,decofile:r,onSave:a}){const n=F(),i=r[t],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[u,f]=J.useState(!1),[l,h]=J.useState(c),[C,b]=J.useState(!1),p=!a||o,g=l!==c,d=()=>{navigator.clipboard.writeText(l).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},v=async m=>{if(!a||C)return;let S;try{S=JSON.parse(m)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}b(!0);try{await a(S),U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(E){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:E instanceof Error?E.message:String(E)}))}finally{b(!1)}};return w.jsx(ae,{open:s,onOpenChange:e,children:w.jsxs(ie,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[w.jsxs(oe,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[w.jsx(ce,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),w.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[w.jsxs(q,{variant:"ghost",size:"sm",onClick:d,className:"h-7 gap-1.5 text-xs",children:[u?w.jsx(se,{size:12}):w.jsx(ne,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!p&&w.jsx(q,{size:"sm",onClick:()=>v(l),disabled:!g||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?w.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):w.jsx("div",{className:"min-h-0 flex-1 py-2",children:w.jsx(ue,{code:c,language:"json",readOnly:p,height:"100%",onChange:m=>h(m??""),onSave:m=>{v(m)}})})]})})}var le=Object.prototype.toString,j=Array.isArray||function(e){return le.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function fe(s){return j(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var he=RegExp.prototype.test;function de(s,e){return he.call(s,e)}var ve=/\S/;function ye(s){return!de(ve,s)}var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function we(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ge[t]})}var me=/\s*/,Ee=/\s+/,Q=/\s*=/,xe=/\s*\}/,be=/#|\^|\/|>|\{|&|=|!/;function ke(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function f(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var l,h,C;function b(k){if(typeof k=="string"&&(k=k.split(Ee,2)),!j(k)||k.length!==2)throw new Error("Invalid tags: "+k);l=new RegExp(N(k[0])+"\\s*"),h=new RegExp("\\s*"+N(k[1])),C=new RegExp("\\s*"+N("}"+k[1]))}b(e||x.tags);for(var p=new R(s),g,d,v,m,S,E;!p.eos();){if(g=p.pos,v=p.scanUntil(l),v)for(var T=0,W=v.length;T<W;++T)m=v.charAt(T),ye(m)?(n.push(a.length),c+=m):(o=!0,t=!0,c+=" "),a.push(["text",m,g,g+1]),g+=1,m===`
1
+ import{o as B,e as z,K as O,b as F,r as J,j as w,B as q,t as U}from"./index-BiuSAlzd.js";import{u as V}from"./use-session-runtime-Cosw4CCW.js";import{u as _,z as H,A as $,B as G,y as L,q as Y}from"./claim-phase-copy-BTrkr4bY.js";import{h as X,n as Z,i as I}from"./runnable-block-editor-BPu9lbHb.js";import{o as M}from"./sandbox-git-api-B1R0585s.js";import{u as ee}from"./chat-context-DHGUafJ4.js";import{b as te}from"./sandbox-url-D3mC8qhT.js";import{a as re}from"./utils-BiBoFq--.js";import{i as se}from"./CheckCircle-BemNEpVg.js";import{a as ne}from"./Copy01-DluK-JtU.js";import{D as ae,b as ie,c as oe,d as ce}from"./dialog-C9YQM7Rb.js";import{M as ue}from"./monaco-editor-DrtzucP0.js";function Qe({orgSlug:s,virtualMcpId:e,branch:t}){const r=B(),a=ee()?.taskId??null,n=X(e),i=V(e).runtime==="cms",{url:o}=_(e),c=Z({orgSlug:s,virtualMcpId:e,branch:t,localPreviewUrl:o});return z({mutationKey:Y(s,e,t),scope:L(s,e,t),mutationFn:async({blockKey:u})=>{if(o)return{ok:!0,existed:!0};if(i){const h=await H({orgSlug:s,virtualMcpId:e,branch:t},{delete:[u]});return $(r,{orgSlug:s,virtualMcpId:e,branch:t},h),await r.invalidateQueries({queryKey:M({orgSlug:s,virtualMcpId:e,branch:t,threadId:a})}),{ok:!0,existed:!0}}const f=I(n,re(u)),l=await fetch(te({orgSlug:s,virtualMcpId:e,branch:t,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():G(l,"Delete")},onMutate:async({blockKey:u})=>{const f=O.decofile(c);await r.cancelQueries({queryKey:f});const l=r.getQueryData(f),h=!!l&&u in l,C=l?.[u];return r.setQueryData(f,b=>{if(!b)return b;const{[u]:p,...g}=b;return g}),{queryKey:f,blockKey:u,hadKey:h,previousValue:C}},onError:(u,f,l)=>{l&&r.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h)},onSuccess:()=>{r.invalidateQueries({queryKey:O.liveMeta(s,e,t)})}})}function We({open:s,onOpenChange:e,pageKey:t,decofile:r,onSave:a}){const n=F(),i=r[t],o=i===void 0,c=o?"":JSON.stringify(i,null,2),[u,f]=J.useState(!1),[l,h]=J.useState(c),[C,b]=J.useState(!1),p=!a||o,g=l!==c,d=()=>{navigator.clipboard.writeText(l).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)})},v=async m=>{if(!a||C)return;let S;try{S=JSON.parse(m)}catch{U.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}b(!0);try{await a(S),U.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(E){U.error(n("sectionsEditor.pageJsonDialog.saveError",{error:E instanceof Error?E.message:String(E)}))}finally{b(!1)}};return w.jsx(ae,{open:s,onOpenChange:e,children:w.jsxs(ie,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[w.jsxs(oe,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[w.jsx(ce,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),w.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[w.jsxs(q,{variant:"ghost",size:"sm",onClick:d,className:"h-7 gap-1.5 text-xs",children:[u?w.jsx(se,{size:12}):w.jsx(ne,{size:12}),n(u?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!p&&w.jsx(q,{size:"sm",onClick:()=>v(l),disabled:!g||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),o?w.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):w.jsx("div",{className:"min-h-0 flex-1 py-2",children:w.jsx(ue,{code:c,language:"json",readOnly:p,height:"100%",onChange:m=>h(m??""),onSave:m=>{v(m)}})})]})})}var le=Object.prototype.toString,j=Array.isArray||function(e){return le.call(e)==="[object Array]"};function K(s){return typeof s=="function"}function fe(s){return j(s)?"array":typeof s}function N(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function pe(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var he=RegExp.prototype.test;function de(s,e){return he.call(s,e)}var ve=/\S/;function ye(s){return!de(ve,s)}var ge={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function we(s){return String(s).replace(/[&<>"'`=\/]/g,function(t){return ge[t]})}var me=/\s*/,Ee=/\s+/,Q=/\s*=/,xe=/\s*\}/,be=/#|\^|\/|>|\{|&|=|!/;function ke(s,e){if(!s)return[];var t=!1,r=[],a=[],n=[],i=!1,o=!1,c="",u=0;function f(){if(i&&!o)for(;n.length;)delete a[n.pop()];else n=[];i=!1,o=!1}var l,h,C;function b(k){if(typeof k=="string"&&(k=k.split(Ee,2)),!j(k)||k.length!==2)throw new Error("Invalid tags: "+k);l=new RegExp(N(k[0])+"\\s*"),h=new RegExp("\\s*"+N(k[1])),C=new RegExp("\\s*"+N("}"+k[1]))}b(e||x.tags);for(var p=new R(s),g,d,v,m,S,E;!p.eos();){if(g=p.pos,v=p.scanUntil(l),v)for(var T=0,W=v.length;T<W;++T)m=v.charAt(T),ye(m)?(n.push(a.length),c+=m):(o=!0,t=!0,c+=" "),a.push(["text",m,g,g+1]),g+=1,m===`
2
2
  `&&(f(),c="",u=0,t=!1);if(!p.scan(l))break;if(i=!0,d=p.scan(be)||"name",p.scan(me),d==="="?(v=p.scanUntil(Q),p.scan(Q),p.scanUntil(h)):d==="{"?(v=p.scanUntil(C),p.scan(xe),p.scanUntil(h),d="&"):v=p.scanUntil(h),!p.scan(h))throw new Error("Unclosed tag at "+p.pos);if(d==">"?S=[d,v,g,p.pos,c,u,t]:S=[d,v,g,p.pos],u++,a.push(S),d==="#"||d==="^")r.push(S);else if(d==="/"){if(E=r.pop(),!E)throw new Error('Unopened section "'+v+'" at '+g);if(E[1]!==v)throw new Error('Unclosed section "'+E[1]+'" at '+g)}else d==="name"||d==="{"||d==="&"?o=!0:d==="="&&b(v)}if(f(),E=r.pop(),E)throw new Error('Unclosed section "'+E[1]+'" at '+p.pos);return Se(Ce(a))}function Ce(s){for(var e=[],t,r,a=0,n=s.length;a<n;++a)t=s[a],t&&(t[0]==="text"&&r&&r[0]==="text"?(r[1]+=t[1],r[3]=t[3]):(e.push(t),r=t));return e}function Se(s){for(var e=[],t=e,r=[],a,n,i=0,o=s.length;i<o;++i)switch(a=s[i],a[0]){case"#":case"^":t.push(a),r.push(a),t=a[4]=[];break;case"/":n=r.pop(),n[5]=a[2],t=r.length>0?r[r.length-1][4]:e;break;default:t.push(a)}return e}function R(s){this.string=s,this.tail=s,this.pos=0}R.prototype.eos=function(){return this.tail===""};R.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};R.prototype.scanUntil=function(e){var t=this.tail.search(e),r;switch(t){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=r.length,r};function D(s,e){this.view=s,this.cache={".":this.view},this.parent=e}D.prototype.push=function(e){return new D(e,this)};D.prototype.lookup=function(e){var t=this.cache,r;if(t.hasOwnProperty(e))r=t[e];else{for(var a=this,n,i,o,c=!1;a;){if(e.indexOf(".")>0)for(n=a.view,i=e.split("."),o=0;n!=null&&o<i.length;)o===i.length-1&&(c=A(n,i[o])||pe(n,i[o])),n=n[i[o++]];else n=a.view[e],c=A(a.view,e);if(c){r=n;break}a=a.parent}t[e]=r}return K(r)&&(r=r.call(this.view)),r};function y(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}y.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};y.prototype.parse=function(e,t){var r=this.templateCache,a=e+":"+(t||x.tags).join(":"),n=typeof r<"u",i=n?r.get(a):void 0;return i==null&&(i=ke(e,t),n&&r.set(a,i)),i};y.prototype.render=function(e,t,r,a){var n=this.getConfigTags(a),i=this.parse(e,n),o=t instanceof D?t:new D(t,void 0);return this.renderTokens(i,o,r,e,a)};y.prototype.renderTokens=function(e,t,r,a,n){for(var i="",o,c,u,f=0,l=e.length;f<l;++f)u=void 0,o=e[f],c=o[0],c==="#"?u=this.renderSection(o,t,r,a,n):c==="^"?u=this.renderInverted(o,t,r,a,n):c===">"?u=this.renderPartial(o,t,r,n):c==="&"?u=this.unescapedValue(o,t):c==="name"?u=this.escapedValue(o,t,n):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(i+=u);return i};y.prototype.renderSection=function(e,t,r,a,n){var i=this,o="",c=t.lookup(e[1]);function u(h){return i.render(h,t,r,n)}if(c){if(j(c))for(var f=0,l=c.length;f<l;++f)o+=this.renderTokens(e[4],t.push(c[f]),r,a,n);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(e[4],t.push(c),r,a,n);else if(K(c)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(t.view,a.slice(e[3],e[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(e[4],t,r,a,n);return o}};y.prototype.renderInverted=function(e,t,r,a,n){var i=t.lookup(e[1]);if(!i||j(i)&&i.length===0)return this.renderTokens(e[4],t,r,a,n)};y.prototype.indentPartial=function(e,t,r){for(var a=t.replace(/[^ \t]/g,""),n=e.split(`
3
3
  `),i=0;i<n.length;i++)n[i].length&&(i>0||!r)&&(n[i]=a+n[i]);return n.join(`
4
4
  `)};y.prototype.renderPartial=function(e,t,r,a){if(r){var n=this.getConfigTags(a),i=K(r)?r(e[1]):r[e[1]];if(i!=null){var o=e[6],c=e[5],u=e[4],f=i;c==0&&u&&(f=this.indentPartial(i,u,o));var l=this.parse(f,n);return this.renderTokens(l,t,r,f,a)}}};y.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(r!=null)return r};y.prototype.escapedValue=function(e,t,r){var a=this.getConfigEscape(r)||x.escape,n=t.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===x.escape?String(n):a(n)};y.prototype.rawValue=function(e){return e[1]};y.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};y.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var x={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(s){P.templateCache=s},get templateCache(){return P.templateCache}},P=new y;x.clearCache=function(){return P.clearCache()};x.parse=function(e,t){return P.parse(e,t)};x.render=function(e,t,r,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+fe(e)+'" was given as the first argument for mustache#render(template, view, partials)');return P.render(e,t,r,a)};x.escape=we;x.Scanner=R;x.Context=D;x.Writer=y;export{We as P,x as m,Qe as u};
@@ -1 +1 @@
1
- import{c as y,j as t,r as w,q as _,b as S,B as N,l as M,t as K}from"./index-C5LlvZFc.js";import{i as A}from"./ArrowLeft-DKYwT7KB.js";import{s as R}from"./Plus-GNsqHUli.js";import{D as E,b as T,c as V,d as $,h as B}from"./dialog-BJny2srB.js";import{I as F}from"./input-NPHEwu7D.js";import{L as H}from"./label-DFV1EjGx.js";import{R as L}from"./repository-import-picker-BZ4SbZxQ.js";import{u as O}from"./use-navigate-to-agent-DeIS5d_A.js";import{S as z}from"./thread-intent-Cc5BAaIc.js";import{f as Z}from"./repository-binding-BzfYTDYg.js";const D={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},l={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function q(i){const e=y.c(9),{className:n}=i;let r,o,s,c,a,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...l,opacity:.7}),o=t.jsx("circle",{cx:"22",cy:"18",r:"4",...l,opacity:.8}),s=t.jsx("circle",{cx:"22",cy:"50",r:"4",...l,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...l,opacity:.6}),a=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),u=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...l,opacity:.75}),h=t.jsx("path",{d:"M53 34h32",...l,opacity:.5}),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=a,e[5]=u,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],a=e[4],u=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,a,u,h]}),e[7]=n,e[8]=d):d=e[8],d}function I(i){const e=y.c(4),{className:n}=i;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...l,opacity:.8}),o=t.jsx("path",{d:"M16 28h64",...l,opacity:.5}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let s;return e[2]!==n?(s=t.jsxs("svg",{...D,className:n,children:[r,o]}),e[2]=n,e[3]=s):s=e[3],s}function pe(i){const e=y.c(5),{className:n}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...l}),t.jsx("path",{d:"M46 34h128",...l,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...l,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.22})]}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...l,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...l,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...l,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...l,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...l,opacity:.5})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...l,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...l}),t.jsx("path",{d:"M152 116h26M152 124h16",...l,opacity:.45})]}),e[2]=s):s=e[2];let c;return e[3]!==n?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:n,children:[r,o,s]}),e[3]=n,e[4]=c):c=e[4],c}const b=new z(!1);let k="unknown",P=null;function U(i,e){k=i,P=e?.onCreated??null,_("project_create_clicked",{source:i}),b.set(!0)}function he(){const i=y.c(2),e=w.useSyncExternalStore(b.subscribe,b.get);let n;return i[0]!==e?(n=[e,b.set],i[0]=e,i[1]=n):n=i[1],n}function C(i){const e=P;P=null,e?.(i)}function de(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:q,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:I,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},G=["repository","folder"];function J(i){const e=y.c(25),{path:n,onSelect:r}=i,o=S(),s=W[n],c=s.art;let a;e[0]!==s.art_||e[1]!==s.plate?(a=M("flex h-28 items-center justify-center rounded-lg transition-colors",s.plate,s.art_),e[0]=s.art_,e[1]=s.plate,e[2]=a):a=e[2];let u;e[3]!==c?(u=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==a||e[6]!==u?(h=t.jsx("span",{className:a,children:u}),e[5]=a,e[6]=u,e[7]=h):h=e[7];let d;e[8]!==s.titleKey||e[9]!==o?(d=o(s.titleKey),e[8]=s.titleKey,e[9]=o,e[10]=d):d=e[10];let x;e[11]!==d?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=x):x=e[12];let f;e[13]!==s.hintKey||e[14]!==o?(f=o(s.hintKey),e[13]=s.hintKey,e[14]=o,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let m;e[18]!==x||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[x,j]}),e[18]=x,e[19]=j,e[20]=m):m=e[20];let g;return e[21]!==r||e[22]!==h||e[23]!==m?(g=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 rounded-xl bg-card p-3 text-left card-shadow outline-none transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent/40 focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20 motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[h,m]}),e[21]=r,e[22]=h,e[23]=m,e[24]=g):g=e[24],g}function Q(i){const e=y.c(8),{label:n,children:r,hint:o}=i;let s;e[0]!==n?(s=t.jsx(H,{children:n}),e[0]=n,e[1]=s):s=e[1];let c;e[2]!==o?(c=o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==s||e[6]!==c?(a=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[s,r,c]}),e[4]=r,e[5]=s,e[6]=c,e[7]=a):a=e[7],a}function ue({open:i,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,a]=w.useState(null),[u,h]=w.useState(""),[d,x]=w.useState(null),f=w.useRef(null),j=()=>{a(null),h(""),x(null)},m=()=>{e(!1),j()};if(c==="repository")return t.jsx(L,{open:!0,onOpenChange:p=>{p||m()},onImportComplete:({virtualMcpId:p})=>{p&&(C(p),s(p)),m()}});const g=async()=>{if(o.create.isPending)return;const p=u.trim();if(!p){x(r("projects.new.nameRequired"));return}try{const v=(await o.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;_("project_created",{source:n,path:c}),m(),v&&(C(v),s(v)),K.success(r("projects.new.created",{title:p}))}catch{x(r("projects.new.failed"))}};return t.jsx(E,{open:i,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(T,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(V,{children:[t.jsx($,{children:r("projects.new.title")}),t.jsx(B,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:G.map(p=>t.jsx(J,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),a(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),x(null),g()},children:[t.jsx(Q,{label:r("projects.new.nameLabel"),children:t.jsx(F,{autoFocus:!0,value:u,onChange:p=>h(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),d&&t.jsx("p",{className:"text-sm text-destructive",children:d}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(N,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(A,{size:14}),r("projects.new.back")]}),t.jsx(N,{type:"submit",disabled:o.create.isPending,children:o.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function xe(i){const e=y.c(11),{source:n,variant:r,size:o,label:s}=i,c=r===void 0?"default":r,a=o===void 0?"sm":o,u=S();let h;e[0]!==n?(h=()=>U(n),e[0]=n,e[1]=h):h=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(R,{size:14}),e[2]=d):d=e[2];let x;e[3]!==s||e[4]!==u?(x=s??u("projects.home.newProject"),e[3]=s,e[4]=u,e[5]=x):x=e[5];let f;return e[6]!==a||e[7]!==h||e[8]!==x||e[9]!==c?(f=t.jsxs(N,{size:a,variant:c,onClick:h,children:[d,x]}),e[6]=a,e[7]=h,e[8]=x,e[9]=c,e[10]=f):f=e[10],f}export{pe as E,xe as N,ue as a,de as n,U as o,he as u};
1
+ import{c as y,j as t,r as w,q as _,b as S,B as N,l as M,t as K}from"./index-BiuSAlzd.js";import{i as A}from"./ArrowLeft-CIsJnvjF.js";import{s as R}from"./Plus-DjsQQqpw.js";import{D as E,b as T,c as V,d as $,h as B}from"./dialog-C9YQM7Rb.js";import{I as F}from"./input-B5d33h6X.js";import{L as H}from"./label-BmSaj4OS.js";import{R as L}from"./repository-import-picker-D6vKdpbU.js";import{u as O}from"./use-navigate-to-agent-2D1RSJEE.js";import{S as z}from"./thread-intent-ags1XWir.js";import{f as Z}from"./repository-binding-CQsr_3Zk.js";const D={viewBox:"0 0 96 64",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},l={stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};function q(i){const e=y.c(9),{className:n}=i;let r,o,s,c,a,u,h;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M22 46V22",...l,opacity:.7}),o=t.jsx("circle",{cx:"22",cy:"18",r:"4",...l,opacity:.8}),s=t.jsx("circle",{cx:"22",cy:"50",r:"4",...l,opacity:.8}),c=t.jsx("path",{d:"M22 32h14a6 6 0 0 1 6 6v4",...l,opacity:.6}),a=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),u=t.jsx("path",{d:"M56 22h9l3 4h14a3 3 0 0 1 3 3v20a3 3 0 0 1-3 3H56a3 3 0 0 1-3-3V25a3 3 0 0 1 3-3Z",...l,opacity:.75}),h=t.jsx("path",{d:"M53 34h32",...l,opacity:.5}),e[0]=r,e[1]=o,e[2]=s,e[3]=c,e[4]=a,e[5]=u,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],a=e[4],u=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,a,u,h]}),e[7]=n,e[8]=d):d=e[8],d}function I(i){const e=y.c(4),{className:n}=i;let r,o;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("path",{d:"M16 22a4 4 0 0 1 4-4h14l6 6h20a4 4 0 0 1 4 4v20a4 4 0 0 1-4 4H20a4 4 0 0 1-4-4V22Z",...l,opacity:.8}),o=t.jsx("path",{d:"M16 28h64",...l,opacity:.5}),e[0]=r,e[1]=o):(r=e[0],o=e[1]);let s;return e[2]!==n?(s=t.jsxs("svg",{...D,className:n,children:[r,o]}),e[2]=n,e[3]=s):s=e[3],s}function pe(i){const e=y.c(5),{className:n}=i;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsxs("g",{opacity:.55,children:[t.jsx("rect",{x:"46",y:"16",width:"128",height:"88",rx:"8",...l}),t.jsx("path",{d:"M46 34h128",...l,opacity:.6}),t.jsx("circle",{cx:"56",cy:"25",r:"2",fill:"currentColor",opacity:.6}),t.jsx("circle",{cx:"64",cy:"25",r:"2",fill:"currentColor",opacity:.45}),t.jsx("circle",{cx:"72",cy:"25",r:"2",fill:"currentColor",opacity:.3}),t.jsx("rect",{x:"58",y:"44",width:"104",height:"24",rx:"4",...l,opacity:.5}),t.jsx("rect",{x:"58",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.4}),t.jsx("rect",{x:"95",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.3}),t.jsx("rect",{x:"132",y:"76",width:"30",height:"16",rx:"3",...l,opacity:.22})]}),e[0]=r):r=e[0];let o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsxs("g",{transform:"rotate(-8 44 92)",children:[t.jsx("rect",{x:"22",y:"52",width:"44",height:"76",rx:"8",...l,fill:"var(--color-background)"}),t.jsx("path",{d:"M37 60h14",...l,opacity:.5}),t.jsx("rect",{x:"29",y:"68",width:"30",height:"20",rx:"3",...l,opacity:.45}),t.jsx("path",{d:"M29 96h30M29 104h20",...l,opacity:.35}),t.jsx("rect",{x:"29",y:"112",width:"30",height:"8",rx:"4",...l,opacity:.5})]}),e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("g",{transform:"rotate(10 168 104)",children:[t.jsx("path",{d:"M150 92h30a6 6 0 0 1 6 6v26a6 6 0 0 1-6 6h-30a6 6 0 0 1-6-6V98a6 6 0 0 1 6-6Z",...l,fill:"var(--color-background)"}),t.jsx("circle",{cx:"165",cy:"104",r:"3.5",...l}),t.jsx("path",{d:"M152 116h26M152 124h16",...l,opacity:.45})]}),e[2]=s):s=e[2];let c;return e[3]!==n?(c=t.jsxs("svg",{viewBox:"0 0 220 140",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:n,children:[r,o,s]}),e[3]=n,e[4]=c):c=e[4],c}const b=new z(!1);let k="unknown",P=null;function U(i,e){k=i,P=e?.onCreated??null,_("project_create_clicked",{source:i}),b.set(!0)}function he(){const i=y.c(2),e=w.useSyncExternalStore(b.subscribe,b.get);let n;return i[0]!==e?(n=[e,b.set],i[0]=e,i[1]=n):n=i[1],n}function C(i){const e=P;P=null,e?.(i)}function de(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:q,plate:"bg-chart-5/10 group-hover:bg-chart-5/16",art_:"text-chart-5"},folder:{titleKey:"projects.new.path.folder",hintKey:"projects.new.path.folder.hint",art:I,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},G=["repository","folder"];function J(i){const e=y.c(25),{path:n,onSelect:r}=i,o=S(),s=W[n],c=s.art;let a;e[0]!==s.art_||e[1]!==s.plate?(a=M("flex h-28 items-center justify-center rounded-lg transition-colors",s.plate,s.art_),e[0]=s.art_,e[1]=s.plate,e[2]=a):a=e[2];let u;e[3]!==c?(u=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=u):u=e[4];let h;e[5]!==a||e[6]!==u?(h=t.jsx("span",{className:a,children:u}),e[5]=a,e[6]=u,e[7]=h):h=e[7];let d;e[8]!==s.titleKey||e[9]!==o?(d=o(s.titleKey),e[8]=s.titleKey,e[9]=o,e[10]=d):d=e[10];let x;e[11]!==d?(x=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=x):x=e[12];let f;e[13]!==s.hintKey||e[14]!==o?(f=o(s.hintKey),e[13]=s.hintKey,e[14]=o,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx("span",{className:"text-xs text-muted-foreground",children:f}),e[16]=f,e[17]=j):j=e[17];let m;e[18]!==x||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[x,j]}),e[18]=x,e[19]=j,e[20]=m):m=e[20];let g;return e[21]!==r||e[22]!==h||e[23]!==m?(g=t.jsxs("button",{type:"button",onClick:r,className:"group flex flex-col gap-3 rounded-xl bg-card p-3 text-left card-shadow outline-none transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent/40 focus-visible:border-ring focus-visible:ring-[2px] focus-visible:ring-ring/20 motion-reduce:transition-none motion-reduce:hover:translate-y-0",children:[h,m]}),e[21]=r,e[22]=h,e[23]=m,e[24]=g):g=e[24],g}function Q(i){const e=y.c(8),{label:n,children:r,hint:o}=i;let s;e[0]!==n?(s=t.jsx(H,{children:n}),e[0]=n,e[1]=s):s=e[1];let c;e[2]!==o?(c=o&&t.jsx("p",{className:"text-xs text-muted-foreground",children:o}),e[2]=o,e[3]=c):c=e[3];let a;return e[4]!==r||e[5]!==s||e[6]!==c?(a=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[s,r,c]}),e[4]=r,e[5]=s,e[6]=c,e[7]=a):a=e[7],a}function ue({open:i,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,a]=w.useState(null),[u,h]=w.useState(""),[d,x]=w.useState(null),f=w.useRef(null),j=()=>{a(null),h(""),x(null)},m=()=>{e(!1),j()};if(c==="repository")return t.jsx(L,{open:!0,onOpenChange:p=>{p||m()},onImportComplete:({virtualMcpId:p})=>{p&&(C(p),s(p)),m()}});const g=async()=>{if(o.create.isPending)return;const p=u.trim();if(!p){x(r("projects.new.nameRequired"));return}try{const v=(await o.create.mutateAsync({title:p,description:null,status:"active",pinned:!1,connections:[],metadata:{instructions:null,project:{storeUrl:null},ui:{pinnedViews:null,layout:{defaultMainView:{type:"overview"},chatDefaultOpen:!0}}}}))?.id;_("project_created",{source:n,path:c}),m(),v&&(C(v),s(v)),K.success(r("projects.new.created",{title:p}))}catch{x(r("projects.new.failed"))}};return t.jsx(E,{open:i,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(T,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(V,{children:[t.jsx($,{children:r("projects.new.title")}),t.jsx(B,{children:r(c?"projects.new.step.folder.title":"projects.new.subtitle")})]}),c===null?t.jsx("div",{className:"grid grid-cols-1 gap-3 animate-in fade-in-0 duration-200 sm:grid-cols-2 motion-reduce:animate-none",children:G.map(p=>t.jsx(J,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),a(p)}},p))}):t.jsxs("form",{className:"flex flex-col gap-4 animate-in fade-in-0 slide-in-from-right-2 duration-200 motion-reduce:animate-none",onSubmit:p=>{p.preventDefault(),x(null),g()},children:[t.jsx(Q,{label:r("projects.new.nameLabel"),children:t.jsx(F,{autoFocus:!0,value:u,onChange:p=>h(p.target.value),placeholder:r("projects.new.namePlaceholder")})}),d&&t.jsx("p",{className:"text-sm text-destructive",children:d}),t.jsxs("div",{className:"flex items-center justify-between gap-2 pt-1",children:[t.jsxs(N,{type:"button",variant:"ghost",onClick:()=>j(),children:[t.jsx(A,{size:14}),r("projects.new.back")]}),t.jsx(N,{type:"submit",disabled:o.create.isPending,children:o.create.isPending?r("projects.new.creating"):r("projects.new.create")})]})]})]})})}function xe(i){const e=y.c(11),{source:n,variant:r,size:o,label:s}=i,c=r===void 0?"default":r,a=o===void 0?"sm":o,u=S();let h;e[0]!==n?(h=()=>U(n),e[0]=n,e[1]=h):h=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(R,{size:14}),e[2]=d):d=e[2];let x;e[3]!==s||e[4]!==u?(x=s??u("projects.home.newProject"),e[3]=s,e[4]=u,e[5]=x):x=e[5];let f;return e[6]!==a||e[7]!==h||e[8]!==x||e[9]!==c?(f=t.jsxs(N,{size:a,variant:c,onClick:h,children:[d,x]}),e[6]=a,e[7]=h,e[8]=x,e[9]=c,e[10]=f):f=e[10],f}export{pe as E,xe as N,ue as a,de as n,U as o,he as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-C5LlvZFc.js";import{h as u}from"./mcp-oauth-B9fQInjX.js";import"./auth-5kOh9gsa.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
1
+ import{b as o,r as c,j as e,h as n}from"./index-BiuSAlzd.js";import{h as u}from"./mcp-oauth-C-EEuNZg.js";import"./auth-DDdLUET9.js";function f(){const t=o(),[a,l]=c.useState(null),[r,i]=c.useState(!1);return c.useEffect(()=>{(async()=>{try{const s=await u();if(!s.success){l(s.error||t("routes.oauthCallback.authenticationFailed")),setTimeout(()=>{window.close()},3e3);return}i(!0),setTimeout(()=>{window.close()},1500)}catch(s){l(s instanceof Error?s.message:String(s)),setTimeout(()=>{window.close()},3e3)}})()},[]),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[r&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),!r&&!a&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(n,{className:"size-8 text-primary"})}),a&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:t(a?"routes.oauthCallback.authenticationFailedTitle":r?"routes.oauthCallback.authenticationSuccessfulTitle":"routes.oauthCallback.authenticationInProgressTitle")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:a?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:t("routes.oauthCallback.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:a}),e.jsxs("p",{className:"mt-2",children:[e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]})]}):r?e.jsxs("p",{children:[t("routes.oauthCallback.authenticationComplete"),e.jsx("br",{}),t("routes.oauthCallback.windowClosingAutomatically")]}):e.jsx("p",{children:t("routes.oauthCallback.processingAuthentication")})})]})]})})}export{f as default};
@@ -1 +1 @@
1
- import{b as d,r as a,j as e,h}from"./index-C5LlvZFc.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
1
+ import{b as d,r as a,j as e,h}from"./index-BiuSAlzd.js";function x(){const r=d(),[s,o]=a.useState("loading"),[l,u]=a.useState(null),c=a.useRef(!1);return c.current||(c.current=!0,queueMicrotask(()=>{try{const t=new URLSearchParams(window.location.search),i=t.get("code"),n=t.get("state");if(!i||!n)throw new Error("Missing code or state parameter");if(window.opener)window.opener.postMessage({type:"AI_PROVIDER_OAUTH_CALLBACK",code:i,stateToken:n},window.location.origin),o("success"),setTimeout(()=>window.close(),1500);else throw new Error("No opener window found")}catch(t){console.error("OAuth callback error:",t),u(t instanceof Error?t.message:String(t)),o("error"),setTimeout(()=>window.close(),3e3)}})),e.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-background",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center justify-center gap-8",children:[s==="success"&&e.jsx("img",{src:"/empty-state-success.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),s==="loading"&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx(h,{className:"size-8 text-primary"})}),s==="error"&&e.jsx("img",{src:"/empty-state-error.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx("h2",{className:"text-lg font-medium text-foreground",children:r(s==="error"?"routes.oauthCallbackAiProvider.authFailed":s==="success"?"routes.oauthCallbackAiProvider.authSuccess":"routes.oauthCallbackAiProvider.authInProgress")}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s==="error"?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mb-2",children:r("routes.oauthCallbackAiProvider.errorOccurred")}),e.jsx("p",{className:"text-destructive",children:l}),e.jsx("p",{className:"mt-2",children:r("routes.oauthCallbackAiProvider.windowCloseAuto")})]}):s==="success"?e.jsx("p",{children:r("routes.oauthCallbackAiProvider.authCompleteCloseAuto")}):e.jsx("p",{children:r("routes.oauthCallbackAiProvider.processingAuth")})})]})]})})}export{x as default};
@@ -1 +1 @@
1
- import{c as ie,j as t,a as ye,h as ce,b as de,m as Ce,K as Oe,r as P,B as Ne,e as pe,p as ze,l as ae,t as he}from"./index-C5LlvZFc.js";import{R as Le}from"./required-auth-layout-DanliwF9.js";import{A as se}from"./auth-split-layout-BAIpdvCx.js";import{O as _e}from"./organization-choice-D3SzAbEY.js";import{A as ve}from"./avatar-CrasAAzq.js";import{I as Ee}from"./input-NPHEwu7D.js";import{L as Ae}from"./label-DFV1EjGx.js";import{S as De}from"./switch-CMfc7QV5.js";import{t as Pe}from"./Building02-DlH3FV2M.js";import{i as Re}from"./CheckCircle-iXm3h-fF.js";import{t as Fe,a as Me}from"./Palette-Bh_thK5-.js";import{i as $e}from"./Upload01-3jf5OQDv.js";import"./Plus-GNsqHUli.js";import"./User01-CN7JcgS_.js";const Te=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function lt(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Le,{children:t.jsx(qe,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:s}=i;let a;e[0]!==s||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{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"})]})}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let r;e[5]!==m?(r=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=r):r=e[6];let o;e[7]!==f||e[8]!==r?(o=t.jsxs("div",{className:"space-y-2",children:[f,r]}),e[7]=f,e[8]=r,e[9]=o):o=e[9];let j;return e[10]!==a||e[11]!==o?(j=t.jsxs("div",{className:"grid gap-10",children:[a,o]}),e[10]=a,e[11]=o,e[12]=j):j=e[12],j}function qe(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(se,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let s;return i[1]!==n||i[2]!==m?(s=t.jsx(Ue,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function Ue(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!Te.has(s),f=s.split(".")[0]??"",r=f.charAt(0).toUpperCase()+f.slice(1);let o;e[0]!==r||e[1]!==a||e[2]!==m?(o=a?r:m?.split(" ")[0]??"",e[0]=r,e[1]=a,e[2]=m,e[3]=o):o=e[3];const j=o,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(s),queryFn:Je,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=l):l=e[5],t.jsx(se,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[l,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:s})})]})})}if(u){let l;e[6]!==w?(l=()=>w(),e[6]=w,e[7]=l):l=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==l||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:l,children:d}),e[10]=l,e[11]=d,e[12]=h):h=e[12],t.jsx(se,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:s})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Be),A=N.some(Ke),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let l;e[16]!==m?(l=m?.split(" ")[0]??"",e[16]=m,e[17]=l):l=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==r||e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:l,allowDomainClaim:!1,onBack:d}),e[20]=r,e[21]=s,e[22]=a,e[23]=l,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let l;e[26]!==p||e[27]!==N.length||e[28]!==n?(l=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=l):l=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==l||e[34]!==d?(h=t.jsx(fe,{title:l,description:d}),e[33]=l,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==s||e[40]!==_||e[41]!==O?(C=t.jsx(_e,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ie}),e[38]=N,e[39]=s,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==r||e[56]!==s||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:j}),e[54]=j,e[55]=r,e[56]=s,e[57]=a,e[58]=D):D=e[58],D}function Ie(i,e){window.location.href=`/${e}`}function Ke(i){return i.joinMode==="auto"}function Be(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Je(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:s,allowDomainClaim:a,onBack:f}=i,r=a===void 0?!0:a,o=de(),j=b&&r?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(s),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const l=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(se,{children:t.jsx(Ye,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=l.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||l.error||null;let z;e[22]!==r||e[23]!==O||e[24]!==l||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&r?p.mutate():l.mutate())},e[22]=r,e[23]=O,e[24]=l,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==o?(k=o("routes.onboarding.welcomeTitle"),e[28]=o,e[29]=k):k=e[29];let L;e[30]!==o?(L=o("routes.onboarding.setupDescription"),e[30]=o,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==o?(F=o("routes.onboarding.orgAvatar"),e[35]=o,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==o?(q=o("routes.onboarding.optional"),e[39]=o,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==s||e[47]!==c?(K=(c.trim()||s||"?").charAt(0).toUpperCase(),e[46]=s,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Ge,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==o?(G=o("routes.onboarding.orgName"),e[56]=o,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let re;e[60]===Symbol.for("react.memo_cache_sentinel")?(re=x=>v(x.target.value),e[60]=re):re=e[60];let H;e[61]!==s||e[62]!==o?(H=s||o("routes.onboarding.myOrganizationPlaceholder"),e[61]=s,e[62]=o,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Ee,{id:"org-name",value:c,onChange:re,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==r||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==o?(V=b&&r&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:o("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=r,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=o,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==o?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:o("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=o,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==o?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",o("routes.onboarding.creating")]}):o("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=o,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let oe;e[93]!==f||e[94]!==o?(oe=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:o("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=o,e[95]=oe):oe=e[95];let le;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==oe?(le=t.jsx(se,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,oe]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=oe,e[102]=le):le=e[102],le}function Ge(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:s}=i,a=de(),f=P.useRef(null);let r;e[0]!==n||e[1]!==a?(r=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=r):r=e[2];const o=r;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==s||e[7]!==o?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[6]=s,e[7]=o,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx($e,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==s||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=s,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Fe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0},{icon:Me,labelKey:"routes.onboarding.step.extractingBrand",claimOnly:!1}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ye({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),s=we.filter(o=>b||!o.claimOnly),[a,f]=P.useState(0),r=P.useRef(!1);if(!r.current){r.current=!0;for(let o=1;o<s.length;o++)setTimeout(()=>f(o),Se*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:s.map((o,j)=>{const c=o.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(o.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Re,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},o.labelKey)})})]})}export{lt as default};
1
+ import{c as ie,j as t,a as ye,h as ce,b as de,m as Ce,K as Oe,r as P,B as Ne,e as pe,p as ze,l as ae,t as he}from"./index-BiuSAlzd.js";import{R as Le}from"./required-auth-layout-5x9XYN7k.js";import{A as se}from"./auth-split-layout-FX4F99rm.js";import{O as _e}from"./organization-choice-BtNQMYzV.js";import{A as ve}from"./avatar-BeFEVdWT.js";import{I as Ee}from"./input-B5d33h6X.js";import{L as Ae}from"./label-BmSaj4OS.js";import{S as De}from"./switch-WI6sluFx.js";import{t as Pe}from"./Building02-BVSXudo-.js";import{i as Re}from"./CheckCircle-BemNEpVg.js";import{t as Fe,a as Me}from"./Palette-CaKXG6S_.js";import{i as $e}from"./Upload01-CNtxqXvb.js";import"./Plus-DjsQQqpw.js";import"./User01-DXNh3TnB.js";const Te=new Set(["gmail.com","googlemail.com","outlook.com","hotmail.com","live.com","yahoo.com","yahoo.co.uk","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","zoho.com","yandex.com","mail.com","gmx.com","gmx.net","tutanota.com","fastmail.com"]);function xe(i){return i.toLowerCase().trim().replace(/[^a-z0-9\s_-]+/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function lt(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Le,{children:t.jsx(qe,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:s}=i;let a;e[0]!==s||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:s??"?",shape:"square",size:"base",className:"h-12 w-12"}):t.jsxs(t.Fragment,{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"})]})}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let f;e[3]!==b?(f=t.jsx("h1",{className:"text-2xl font-medium leading-8",children:b}),e[3]=b,e[4]=f):f=e[4];let r;e[5]!==m?(r=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=r):r=e[6];let o;e[7]!==f||e[8]!==r?(o=t.jsxs("div",{className:"space-y-2",children:[f,r]}),e[7]=f,e[8]=r,e[9]=o):o=e[9];let j;return e[10]!==a||e[11]!==o?(j=t.jsxs("div",{className:"grid gap-10",children:[a,o]}),e[10]=a,e[11]=o,e[12]=j):j=e[12],j}function qe(){const i=ie.c(4),{data:e,isPending:b}=ye.useSession();if(b){let a;return i[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(se,{children:t.jsx("div",{className:"flex items-center gap-2",children:t.jsx(ce,{className:"size-3.5 text-muted-foreground"})})}),i[0]=a):a=i[0],a}const m=e?.user?.email??"",n=e?.user?.name;let s;return i[1]!==n||i[2]!==m?(s=t.jsx(Ue,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=s):s=i[3],s}function Ue(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),s=b.split("@")[1]?.toLowerCase()??"",a=!!s&&!Te.has(s),f=s.split(".")[0]??"",r=f.charAt(0).toUpperCase()+f.slice(1);let o;e[0]!==r||e[1]!==a||e[2]!==m?(o=a?r:m?.split(" ")[0]??"",e[0]=r,e[1]=a,e[2]=m,e[3]=o):o=e[3];const j=o,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(s),queryFn:Je,enabled:a});let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=new Set,e[4]=g):g=e[4];const[_,M]=P.useState(g),[$,y]=P.useState(!1);if(v){let l;return e[5]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=l):l=e[5],t.jsx(se,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[l,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:s})})]})})}if(u){let l;e[6]!==w?(l=()=>w(),e[6]=w,e[7]=l):l=e[7];let d;e[8]!==n?(d=n("routes.onboarding.retry"),e[8]=n,e[9]=d):d=e[9];let h;return e[10]!==l||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:l,children:d}),e[10]=l,e[11]=d,e[12]=h):h=e[12],t.jsx(se,{children:t.jsxs("div",{className:"flex flex-col items-start gap-3 py-4",children:[t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checkFailed",{domain:s})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Be),A=N.some(Ke),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let l;e[16]!==m?(l=m?.split(" ")[0]??"",e[16]=m,e[17]=l):l=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==r||e[21]!==s||e[22]!==a||e[23]!==l||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:l,allowDomainClaim:!1,onBack:d}),e[20]=r,e[21]=s,e[22]=a,e[23]=l,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let l;e[26]!==p||e[27]!==N.length||e[28]!==n?(l=p?N.length===1?n("routes.onboarding.accessSingle"):n("routes.onboarding.accessMultiple"):n("routes.onboarding.requestAccess"),e[26]=p,e[27]=N.length,e[28]=n,e[29]=l):l=e[29];let d;e[30]!==p||e[31]!==n?(d=n(p?"routes.onboarding.emailMatchesOrg":"routes.onboarding.emailMatchesOrgApproval"),e[30]=p,e[31]=n,e[32]=d):d=e[32];let h;e[33]!==l||e[34]!==d?(h=t.jsx(fe,{title:l,description:d}),e[33]=l,e[34]=d,e[35]=h):h=e[35];let O;e[36]!==M?(O=R=>M(F=>new Set(F).add(R)),e[36]=M,e[37]=O):O=e[37];let C;e[38]!==N||e[39]!==s||e[40]!==_||e[41]!==O?(C=t.jsx(_e,{organizations:N,domain:s,requestedSlugs:_,onRequestedSlug:O,onJoined:Ie}),e[38]=N,e[39]=s,e[40]=_,e[41]=O,e[42]=C):C=e[42];let z;e[43]!==y?(z=()=>y(!0),e[43]=y,e[44]=z):z=e[44];let E;e[45]!==n?(E=n("routes.onboarding.createNewOrg"),e[45]=n,e[46]=E):E=e[46];let k;e[47]!==E||e[48]!==z?(k=t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:z,children:E}),e[47]=E,e[48]=z,e[49]=k):k=e[49];let L;return e[50]!==k||e[51]!==h||e[52]!==C?(L=t.jsx(se,{children:t.jsxs("div",{className:"grid gap-10",children:[h,C,k]})}),e[50]=k,e[51]=h,e[52]=C,e[53]=L):L=e[53],L}let D;return e[54]!==j||e[55]!==r||e[56]!==s||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:s,domainLabel:r,defaultName:j}),e[54]=j,e[55]=r,e[56]=s,e[57]=a,e[58]=D):D=e[58],D}function Ie(i,e){window.location.href=`/${e}`}function Ke(i){return i.joinMode==="auto"}function Be(i){return i.joinMode==="auto"||i.joinMode==="request"?[{id:i.id,name:i.name,slug:i.slug,logo:i.logo,joinMode:i.joinMode}]:[]}async function Je(){const i=await fetch("/api/auth/custom/domain-lookup",{credentials:"include"});if(!i.ok)throw new Error(`Failed to look up domain (${i.status})`);return i.json()}function be(i){const e=ie.c(103),{isCorporateEmail:b,emailDomain:m,domainLabel:n,defaultName:s,allowDomainClaim:a,onBack:f}=i,r=a===void 0?!0:a,o=de(),j=b&&r?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(s),[u,w]=P.useState(j),[g,_]=P.useState(!0),[M,$]=P.useState(null);let y;e[0]!==g||e[1]!==u||e[2]!==c?(y=async()=>{const x=await fetch("/api/auth/custom/domain-setup",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c.trim()||void 0,logo:u??void 0,claimDomain:g})}),S=await x.json();if(!x.ok||!S.success)throw new Error(S.error||"Failed to set up organization");return S},e[0]=g,e[1]=u,e[2]=c,e[3]=y):y=e[3];let N;e[4]!==g?(N=x=>{if(!x.slug)return;const S=we.filter(ke=>g||!ke.claimOnly).length,ne=Se*(S-1)+800;$(x.slug),setTimeout(()=>{window.location.href=`/${x.slug}`},ne)},e[4]=g,e[5]=N):N=e[5];let A;e[6]!==y||e[7]!==N?(A={mutationFn:y,onSuccess:N},e[6]=y,e[7]=N,e[8]=A):A=e[8];const p=pe(A);let D;e[9]!==u||e[10]!==c?(D={mutationFn:async()=>{const x=c.trim(),S=xe(x);if(!S)throw new Error("Invalid organization name");const ne=await ye.organization.create({name:x,slug:S,...u?{logo:u}:{}});if(ne?.error)throw new Error(ne.error.message||"Failed to create organization");window.location.href=`/${ne?.data?.slug??S}`}},e[9]=u,e[10]=c,e[11]=D):D=e[11];const l=pe(D);if(p.isPending||M){let x;e[12]!==n||e[13]!==c?(x=c.trim()||n,e[12]=n,e[13]=c,e[14]=x):x=e[14];let S;return e[15]!==g||e[16]!==m||e[17]!==u||e[18]!==x?(S=t.jsx(se,{children:t.jsx(Ye,{orgName:x,domain:m,claimDomain:g,logoUrl:u})}),e[15]=g,e[16]=m,e[17]=u,e[18]=x,e[19]=S):S=e[19],S}const d=l.isPending;let h;e[20]!==c?(h=xe(c.trim()),e[20]=c,e[21]=h):h=e[21];const O=!!h,C=p.error||l.error||null;let z;e[22]!==r||e[23]!==O||e[24]!==l||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&r?p.mutate():l.mutate())},e[22]=r,e[23]=O,e[24]=l,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==o?(k=o("routes.onboarding.welcomeTitle"),e[28]=o,e[29]=k):k=e[29];let L;e[30]!==o?(L=o("routes.onboarding.setupDescription"),e[30]=o,e[31]=L):L=e[31];let R;e[32]!==k||e[33]!==L?(R=t.jsx(fe,{title:k,description:L}),e[32]=k,e[33]=L,e[34]=R):R=e[34];let F;e[35]!==o?(F=o("routes.onboarding.orgAvatar"),e[35]=o,e[36]=F):F=e[36];let T;e[37]!==F?(T=t.jsx("p",{className:"text-sm font-medium",children:F}),e[37]=F,e[38]=T):T=e[38];let q;e[39]!==o?(q=o("routes.onboarding.optional"),e[39]=o,e[40]=q):q=e[40];let U;e[41]!==q?(U=t.jsx("p",{className:"text-xs text-muted-foreground",children:q}),e[41]=q,e[42]=U):U=e[42];let I;e[43]!==T||e[44]!==U?(I=t.jsxs("div",{className:"space-y-0.5",children:[T,U]}),e[43]=T,e[44]=U,e[45]=I):I=e[45];let K;e[46]!==s||e[47]!==c?(K=(c.trim()||s||"?").charAt(0).toUpperCase(),e[46]=s,e[47]=c,e[48]=K):K=e[48];const me=d||p.isPending;let B;e[49]!==u||e[50]!==K||e[51]!==me?(B=t.jsx(Ge,{value:u,fallback:K,onChange:w,disabled:me}),e[49]=u,e[50]=K,e[51]=me,e[52]=B):B=e[52];let J;e[53]!==I||e[54]!==B?(J=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[I,B]}),e[53]=I,e[54]=B,e[55]=J):J=e[55];let G;e[56]!==o?(G=o("routes.onboarding.orgName"),e[56]=o,e[57]=G):G=e[57];let Y;e[58]!==G?(Y=t.jsx(Ae,{htmlFor:"org-name",className:"text-sm font-medium shrink-0",children:G}),e[58]=G,e[59]=Y):Y=e[59];let re;e[60]===Symbol.for("react.memo_cache_sentinel")?(re=x=>v(x.target.value),e[60]=re):re=e[60];let H;e[61]!==s||e[62]!==o?(H=s||o("routes.onboarding.myOrganizationPlaceholder"),e[61]=s,e[62]=o,e[63]=H):H=e[63];const ue=d||p.isPending;let Q;e[64]!==c||e[65]!==H||e[66]!==ue?(Q=t.jsx(Ee,{id:"org-name",value:c,onChange:re,placeholder:H,disabled:ue,className:"h-10 max-w-[220px]"}),e[64]=c,e[65]=H,e[66]=ue,e[67]=Q):Q=e[67];let W;e[68]!==Y||e[69]!==Q?(W=t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[Y,Q]}),e[68]=Y,e[69]=Q,e[70]=W):W=e[70];let V;e[71]!==r||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==o?(V=b&&r&&t.jsxs("div",{className:"flex items-center justify-between gap-4 p-4",children:[t.jsxs("div",{className:"space-y-0.5",children:[t.jsx("p",{className:"text-sm font-medium",children:o("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:o("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=r,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=o,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"rounded-xl card-shadow bg-background dark:bg-input/30 divide-y divide-border",children:[J,W,V]}),e[79]=J,e[80]=W,e[81]=V,e[82]=X):X=e[82];let Z;e[83]!==C||e[84]!==o?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:o("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=o,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==o?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",o("routes.onboarding.creating")]}):o("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=o,e[89]=ee):ee=e[89];let te;e[90]!==ge||e[91]!==ee?(te=t.jsx(Ne,{type:"submit",size:"xl",className:"w-full",disabled:ge,children:ee}),e[90]=ge,e[91]=ee,e[92]=te):te=e[92];let oe;e[93]!==f||e[94]!==o?(oe=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:o("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=o,e[95]=oe):oe=e[95];let le;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==oe?(le=t.jsx(se,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,oe]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=oe,e[102]=le):le=e[102],le}function Ge(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:s}=i,a=de(),f=P.useRef(null);let r;e[0]!==n||e[1]!==a?(r=M=>{const $=M.target.files?.[0];if(!$)return;if($.size>2097152){he.error(a("routes.onboarding.imageTooLarge")),f.current&&(f.current.value="");return}const y=new FileReader;y.onerror=()=>he.error(a("routes.onboarding.failedReadImage")),y.onloadend=()=>{y.result&&n(y.result),f.current&&(f.current.value="")},y.readAsDataURL($)},e[0]=n,e[1]=a,e[2]=r):r=e[2];const o=r;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=()=>f.current?.click(),e[3]=j):j=e[3];let c;e[4]!==a?(c=a("routes.onboarding.uploadOrgLogo"),e[4]=a,e[5]=c):c=e[5];let v;e[6]!==s||e[7]!==o?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:o,className:"hidden",disabled:s}),e[6]=s,e[7]=o,e[8]=v):v=e[8];const u=b??void 0;let w;e[9]!==m||e[10]!==u?(w=t.jsx(ve,{url:u,fallback:m,shape:"square",size:"base"}),e[9]=m,e[10]=u,e[11]=w):w=e[11];let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx($e,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==s||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:s,className:"relative rounded-lg overflow-hidden ring-1 ring-border hover:ring-2 hover:ring-ring/40 transition-all disabled:opacity-50 group","aria-label":c,children:[v,w,g]}),e[13]=s,e[14]=c,e[15]=v,e[16]=w,e[17]=_):_=e[17],_}const we=[{icon:Pe,labelKey:"routes.onboarding.step.creatingOrg",claimOnly:!1},{icon:Fe,labelKey:"routes.onboarding.step.claimingDomain",claimOnly:!0},{icon:ze,labelKey:"routes.onboarding.step.enablingAutoJoin",claimOnly:!0},{icon:Me,labelKey:"routes.onboarding.step.extractingBrand",claimOnly:!1}],Se=1500,je=[{bg:"var(--brand-green-light)",fg:"var(--brand-green-dark)"},{bg:"var(--brand-purple-light)",fg:"var(--brand-purple-dark)"},{bg:"var(--brand-yellow-light)",fg:"var(--brand-yellow-dark)"}];function Ye({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),s=we.filter(o=>b||!o.claimOnly),[a,f]=P.useState(0),r=P.useRef(!1);if(!r.current){r.current=!0;for(let o=1;o<s.length;o++)setTimeout(()=>f(o),Se*o)}return t.jsxs("div",{className:"grid gap-10",children:[t.jsx(fe,{title:n("routes.onboarding.settingUp",{orgName:i}),description:n("routes.onboarding.gettingReady",{domain:e}),logoUrl:m??null,logoFallback:i.charAt(0).toUpperCase()||"?"}),t.jsx("ul",{className:"grid gap-5",children:s.map((o,j)=>{const c=o.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(o.labelKey);return t.jsxs("li",{className:"flex items-center gap-4 motion-safe:transition-opacity motion-safe:duration-300 motion-safe:ease-out",style:{opacity:u||v?1:.4},children:[t.jsxs("span",{className:ae("relative grid h-8 w-8 shrink-0 place-items-center rounded-lg","motion-safe:transition-colors motion-safe:duration-300",!u&&(v?"bg-muted text-foreground":"bg-muted text-muted-foreground")),style:u?{backgroundColor:w.bg,color:w.fg}:void 0,children:[t.jsx(Re,{size:16,className:ae("absolute motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",u?"scale-100 opacity-100":"scale-75 opacity-0"),"aria-hidden":"true"}),t.jsx(ce,{className:ae("absolute size-4","motion-safe:transition-opacity motion-safe:duration-200",v?"opacity-100":"opacity-0")}),t.jsx(c,{size:16,className:ae("absolute motion-safe:transition-opacity motion-safe:duration-200",!u&&!v?"opacity-100":"opacity-0"),"aria-hidden":"true"})]}),t.jsx("span",{className:ae("text-base leading-6 motion-safe:transition-colors motion-safe:duration-300",v||u?"text-foreground":"text-muted-foreground"),children:g})]},o.labelKey)})})]})}export{lt as default};
@@ -1,3 +1,3 @@
1
- import{e as J,f as B}from"./input-DtRnGymn.js";import{au as A,av as _,cU as C,aK as U,bL as W}from"./index-C5LlvZFc.js";import"./index-Dm8tF0P6.js";import"./gateway-client-DPQb-ray.js";import"./dialog-BJny2srB.js";import"./X-DvEbwZ22.js";import"./form-BsbEXxEk.js";import"./label-DFV1EjGx.js";import"./input-NPHEwu7D.js";import"./utils-CVEq3hMx.js";import"./org-file-open-context-C7-ltXbm.js";import"./use-mobile-Du3isCXQ.js";import"./use-panel-navigate-BVY-Wy0A.js";import"./thread-route-CmSAw42O.js";import"./use-project-scope-Cg6fEvSs.js";import"./repository-binding-BzfYTDYg.js";import"./use-mcp-client-B2Vh9Cd7.js";import"./auth-5kOh9gsa.js";import"./tooltip-66nc6La-.js";import"./index-CMWyW-nP.js";import"./shell-layout-BCgx5xUt.js";import"./avatar-CrasAAzq.js";import"./User01-CN7JcgS_.js";import"./Building02-DlH3FV2M.js";import"./UserSquare-CEkD4_s5.js";import"./agent-icon-CfuzWIKW.js";import"./AlertCircle-DrwoGJpd.js";import"./Tool01-CWjV8YTI.js";import"./ArrowUp-NsPNRi9p.js";import"./ArrowLeft-DKYwT7KB.js";import"./LinkBroken01-CYAPpruG.js";import"./ShoppingBag01-P4dMHDVk.js";import"./ZoomOut-B5FfXkUf.js";import"./CheckCircle-iXm3h-fF.js";import"./Check-BcGsLSsp.js";import"./ChevronUp-BAvbedXO.js";import"./Copy01-C_KnfAlj.js";import"./CreditCard01-B7CL5INn.js";import"./DotsVertical-wjfpXF6W.js";import"./Image01-BVwA4uCp.js";import"./Palette-Bh_thK5-.js";import"./XClose-eArhRgkd.js";import"./Key01-C3aJH3VU.js";import"./Link01-BezCCi1I.js";import"./LinkExternal01-D_cGFYPK.js";import"./Monitor01-R0RI8JD-.js";import"./Sun-7PdNidQ5.js";import"./Plus-GNsqHUli.js";import"./SearchMd-DeSQISfo.js";import"./Trash01-BJ_e57Kj.js";import"./Upload01-3jf5OQDv.js";import"./Users01-B-RFC-RT.js";import"./download-app-dialog-CYxTt_wl.js";import"./use-clock-tick-Db61eAzB.js";import"./command-DA3SiBwF.js";import"./index-BsSf6-Tp.js";import"./integration-icon-Db99lv2a.js";import"./project-icon-ss5TCI0R.js";import"./new-project-dialog-CJlermXp.js";import"./repository-import-picker-BZ4SbZxQ.js";import"./use-navigate-to-agent-DeIS5d_A.js";import"./thread-intent-Cc5BAaIc.js";import"./backoff-8mStPHYB.js";import"./task-board-DGnwsIns.js";import"./schema-DvFu1ToO.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-Bzznh2XU.js";import"./useInfiniteQuery-DpDVtLXw.js";import"./infiniteQueryObserver-DS3r5RyQ.js";import"./collection-search-FRa3rbYr.js";import"./use-debounced-value-C3ROkLpe.js";import"./use-organization-settings-Bq69ux21.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-DanliwF9.js";import"./autosend-CsHrH9Xo.js";import"./use-org-sso-CW6lGteH.js";import"./chat-draft-DCJfKWx2.js";import"./use-session-runtime-XVdydjwY.js";import"./chat-context-CbVc7tEo.js";import"./use-decopilot-events-DSjzPVBT.js";import"./use-ai-providers-M9Gfv9f8.js";import"./location-DPIrGNp7.js";import"./select-BlojSjop.js";import"./usage-stats-yiZ6SKAb.js";import"./use-copy-B1c_EBRx.js";import"./markdown-BNkxJvOO.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./tabs-BQf21wqw.js";import"./use-deco-credits-u3-i822p.js";import"./toggle-group-D_XfPgvt.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-C43__85H.js";import"./decopilot-BEZXwH2l.js";import"./checkbox-C68xjrg5.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-98ItoIiE.js";import"./drawer-ugS5r2iQ.js";import"./index-BmjSoeeS.js";import"./input-BYbHl7fH.js";import"./suggestion-20OWsU93.js";import"./use-mcp-prompts-BBIzvKJ-.js";import"./use-org-fs-Can_Zv1k.js";import"./question-004-sINsf4GQ.js";import"./use-members-C6qHLZqu.js";import"./use-org-auth-client-BBNuWvcV.js";import"./feature-paywall-BOUIyLME.js";import"./plan-ladder-jHsL2xiU.js";import"./add-connection-dialog-BRrDiP3N.js";import"./extract-connection-data-DzRM76JF.js";import"./metadata-D72DunRR.js";import"./connection-B1RIZdkW.js";import"./connection-card-CBKnCj0k.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-CVYfh0wC.js";import"./use-connection-aogXB8HT.js";import"./connection-form-helpers-CTzk01jW.js";import"./authenticate-and-persist-oauth-IbhNDJn9.js";import"./mcp-oauth-B9fQInjX.js";import"./collection-tabs-JVe-o8Om.js";import"./badge-BrDXjbHd.js";import"./use-infinite-scroll-DwjxrCBI.js";import"./useSuspenseInfiniteQuery-Exur-lii.js";import"./use-task-board-events-j6Gt2_bO.js";import"./use-chat-layout-state-EbMrj1Yk.js";import"./use-file-configs-CF1-8iPu.js";import"./site-slug-DebpOoQq.js";class X{constructor(t,n=4e3){this.onDisconnect=t,this.graceMs=n}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const H=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),K=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(t,n){this.send=t,this.callbacks=n}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,n=Date.now()){if(this.closed)return;const r=H.safeParse(t);if(r.success){const e=r.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:n,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=K.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:n});return}const d=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(t);if(d.success){const e=d.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:_()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[n,r]of this.pending){const a=this.fragments.filter(o=>o.start<r.offset),d=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,r.receivedAt);if(t-d<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-r.receivedAt<3e3)continue;if(this.pending.delete(n),this.delegated.add(n),!p.length){this.publishUpdate({delivery:"announce",delegationId:n,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:n,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:n,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:n,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:n,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const r=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
1
+ import{e as J,f as B}from"./input-CYlwvkm5.js";import{au as A,av as _,cU as C,aK as U,bL as W}from"./index-BiuSAlzd.js";import"./index-DX971x0F.js";import"./gateway-client-DE4QITdV.js";import"./dialog-C9YQM7Rb.js";import"./X-C52mq3mn.js";import"./form-CYA-1Wz9.js";import"./label-BmSaj4OS.js";import"./input-B5d33h6X.js";import"./utils-CVEq3hMx.js";import"./org-file-open-context-CTyFwctz.js";import"./use-mobile-D06E6E9A.js";import"./use-panel-navigate-DvFfVppm.js";import"./thread-route-SwwHxRrN.js";import"./use-project-scope-DJC0Rmd2.js";import"./repository-binding-CQsr_3Zk.js";import"./use-mcp-client-5sJCC1_2.js";import"./auth-DDdLUET9.js";import"./tooltip-rVl8jzih.js";import"./index-BGzd8qMa.js";import"./shell-layout-DgCL-aOA.js";import"./avatar-BeFEVdWT.js";import"./User01-DXNh3TnB.js";import"./Building02-BVSXudo-.js";import"./UserSquare-DZJwwd71.js";import"./agent-icon-DEoEcQYL.js";import"./AlertCircle-DDHQi3fm.js";import"./Tool01-BchdJG2X.js";import"./ArrowUp-CtvQk6Vg.js";import"./ArrowLeft-CIsJnvjF.js";import"./LinkBroken01-ChSpe7Cq.js";import"./ShoppingBag01-DktiI11o.js";import"./ZoomOut-BlDSjKri.js";import"./CheckCircle-BemNEpVg.js";import"./Check-Cf-cMW3t.js";import"./ChevronUp-B79uJeZN.js";import"./Copy01-DluK-JtU.js";import"./CreditCard01-BzBUMTax.js";import"./DotsVertical-COzw8ydu.js";import"./Image01-DnRAAkhy.js";import"./Palette-CaKXG6S_.js";import"./XClose-BqRoe3QG.js";import"./Key01-DXvy1NNO.js";import"./Link01-iwXPIeVc.js";import"./LinkExternal01-BVDnNs6j.js";import"./Monitor01-BLZH5esy.js";import"./Sun-BWosC3Su.js";import"./Plus-DjsQQqpw.js";import"./SearchMd-oXON6Mge.js";import"./Trash01-BfnCKCGB.js";import"./Upload01-CNtxqXvb.js";import"./Users01-DAfCqIN7.js";import"./download-app-dialog-D3HwAGf1.js";import"./use-clock-tick-WbPH8S5J.js";import"./command-B-LkMxT6.js";import"./index-cj3FPIlo.js";import"./integration-icon-BcFb9WXn.js";import"./project-icon-C1TVO88N.js";import"./new-project-dialog-Dj5TFcCk.js";import"./repository-import-picker-D6vKdpbU.js";import"./use-navigate-to-agent-2D1RSJEE.js";import"./thread-intent-ags1XWir.js";import"./backoff-8mStPHYB.js";import"./task-board-Cg5OuTdd.js";import"./schema-CepQKFSq.js";import"./slugify-CEUa2lfQ.js";import"./repository-picker-DnfKLU2E.js";import"./useInfiniteQuery-BAMBgsXo.js";import"./infiniteQueryObserver-B7-m24Hr.js";import"./collection-search-CKxipBbw.js";import"./use-debounced-value-PqnB6cMC.js";import"./use-organization-settings-0Ql08vCb.js";import"./use-is-desktop-app-BNujXJc_.js";import"./required-auth-layout-5x9XYN7k.js";import"./autosend-CeDtnxlk.js";import"./use-org-sso-C8LeExfy.js";import"./chat-draft-Du6X8nKJ.js";import"./use-session-runtime-Cosw4CCW.js";import"./chat-context-DHGUafJ4.js";import"./use-decopilot-events-B_Wj2FDs.js";import"./use-ai-providers-BBj3hH0A.js";import"./location-DPIrGNp7.js";import"./select-QknS4jya.js";import"./usage-stats-B9NCjY7p.js";import"./use-copy-XLZP4Fnf.js";import"./markdown-D5RcIxaz.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./tabs-mZ2AJpie.js";import"./use-deco-credits-CWMvx_aN.js";import"./toggle-group-C7J6hm1X.js";import"./tool-namespace-DmnQIdtF.js";import"./use-open-billing-url-CrzuSkfk.js";import"./decopilot-CDg-MCtI.js";import"./checkbox-D-g_vU3W.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DwQhmYZx.js";import"./drawer-BbtvDSmI.js";import"./index-C9yvlucI.js";import"./input-CpjWxr53.js";import"./suggestion-CUAhSpKi.js";import"./use-mcp-prompts-5OccjpiV.js";import"./use-org-fs-BI2aRf-g.js";import"./question-004-sINsf4GQ.js";import"./use-members-C5RWM84Q.js";import"./use-org-auth-client-CXExidw4.js";import"./feature-paywall-CMm2o9Ho.js";import"./plan-ladder-BbGn-NgZ.js";import"./add-connection-dialog-Bll7Vib1.js";import"./extract-connection-data-0OXYM8zm.js";import"./metadata-D72DunRR.js";import"./connection-Da57b2wi.js";import"./connection-card-UvAhqwBj.js";import"./connection-slug-CITJ0kGN.js";import"./textarea-IAy-ownU.js";import"./use-connection-BJVimXqv.js";import"./connection-form-helpers-DyaTkO-i.js";import"./authenticate-and-persist-oauth-Bb2l090x.js";import"./mcp-oauth-C-EEuNZg.js";import"./collection-tabs-z-VIWVMA.js";import"./badge-Dw0XHZAq.js";import"./use-infinite-scroll-DOZLICG8.js";import"./useSuspenseInfiniteQuery-B_8hQc1u.js";import"./use-task-board-events-B2orELe0.js";import"./use-chat-layout-state-CcLE4xPO.js";import"./use-file-configs-BCUJhrSS.js";import"./site-slug-DebpOoQq.js";class X{constructor(t,n=4e3){this.onDisconnect=t,this.graceMs=n}onDisconnect;graceMs;timer;report(t){if(t==="connected"){clearTimeout(this.timer),this.timer=void 0;return}if(t==="failed"||t==="closed"){clearTimeout(this.timer),this.timer=void 0,this.onDisconnect();return}t==="disconnected"&&!this.timer&&(this.timer=setTimeout(this.onDisconnect,this.graceMs))}dispose(){clearTimeout(this.timer),this.timer=void 0}}const H=A({type:W(["session.input_transcript.delta","session.output_transcript.delta"]),event_id:_(),delta:_(),start_ms:U().nonnegative(),end_ms:U().nonnegative()}),K=A({type:C("session.delegation.created"),offset_ms:U().nonnegative(),delegation:A({id:_(),target:C("client")})});class ${constructor(t,n){this.send=t,this.callbacks=n}send;callbacks;closed=!1;fragments=[];seen=new Set;delegated=new Set;consumed=new Set;pending=new Map;contexts=new Map;awaitingContext=new Map;receive(t,n=Date.now()){if(this.closed)return;const r=H.safeParse(t);if(r.success){const e=r.data;if(this.seen.has(e.event_id))return;this.seen.add(e.event_id);const s=e.type==="session.input_transcript.delta"?"user":"agent";if(this.fragments.push({role:s,text:e.delta,start:e.start_ms,end:e.end_ms,arrivedAt:n,id:e.event_id}),this.fragments.sort((o,i)=>o.start-i.start),this.fragments.length>4e3){this.callbacks.onError();return}this.callbacks.onMessage({role:s,message:e.delta,event_id:e.event_id});return}const a=K.safeParse(t);if(a.success){const{id:e}=a.data.delegation;if(this.delegated.has(e)||this.pending.has(e))return;if(this.delegated.size+this.pending.size>=40){this.callbacks.onError();return}this.pending.set(e,{offset:a.data.offset_ms,receivedAt:n});return}const d=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(t);if(d.success){const e=d.data.client_event_id,s=this.awaitingContext.get(e);this.awaitingContext.delete(e),s&&(s.remaining.delete(e),s.remaining.size===0&&this.send({type:"session.commentary.append",event_id:crypto.randomUUID(),delegation_id:s.delegationId??null,content:"Studio has supplied the complete background result as context for this request. Briefly explain that result, including any failure or required approval. Acceptance or task creation alone does not mean the work completed."}));return}const p=A({type:_()}).safeParse(t);p.success&&p.data.type==="error"&&this.callbacks.onError()}tick(t=Date.now()){if(!this.closed)for(const[n,r]of this.pending){const a=this.fragments.filter(o=>o.start<r.offset),d=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,r.receivedAt);if(t-d<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-r.receivedAt<3e3)continue;if(this.pending.delete(n),this.delegated.add(n),!p.length){this.publishUpdate({delivery:"announce",delegationId:n,text:"No new transcribed request is available. No work was started. Ask the user to repeat the request."});continue}const e=p.map(o=>o.text).join("").trim(),s=[];for(const o of a){if(p.includes(o))continue;const i=s.at(-1);i?.role===o.role?i.text+=o.text:s.push({role:o.role,text:o.text})}if(e.length>J){this.publishUpdate({delivery:"announce",delegationId:n,text:"The spoken request is too long. No work was started. Ask the user to shorten it or continue in text."});continue}for(const o of p)this.consumed.add(o.id);this.callbacks.onDelegate({request:e,delegationId:n,transcript:B(s.map(({role:o,text:i})=>({role:o,text:i.trim()})).filter(({text:o})=>o))}).then(o=>{this.closed||this.publishUpdate({delivery:o.status==="rejected"?"announce":"context",delegationId:n,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:n,text:"Studio could not accept this request. Do not claim work started."})})}}publishUpdate(t){if(this.closed)return;if(t.contextId){if(this.contexts.get(t.contextId)===t.text)return;this.contexts.set(t.contextId,t.text)}const r=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
2
2
  `:`Studio result data:
3
3
  `)+t.text,a=new TextEncoder,d=t.delivery==="announce"&&a.encode(r).length>480,p={remaining:new Set,delegationId:t.delegationId};let e="",s=0;const o=()=>{if(!e)return;const i=crypto.randomUUID();d&&(p.remaining.add(i),this.awaitingContext.set(i,p)),this.send({type:t.delivery==="announce"&&!d?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:t.delegationId??null,content:e}),e="",s=0};for(const i of r){const v=a.encode(i).length;s+v>480&&o(),e+=i,s+=v}o()}close(){this.closed=!0,this.pending.clear(),this.awaitingContext.clear()}}async function go(E,t,n){n.throwIfAborted();const r=new RTCPeerConnection,a=r.createDataChannel("oai-events"),d=document.createElement("audio");d.autoplay=!0;let p,e,s,o,i=!1,v=!1,h,L,O=0,P=0,g,w,y=!1;const I=Promise.withResolvers(),x=Promise.withResolvers();x.promise.catch(()=>{});const b=new $(m=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(m))},t),q=new X(()=>{i||t.onDisconnect()}),M=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(L),n.removeEventListener("abort",T),a.close(),r.close();for(const m of p?.getTracks()??[])m.stop();d.pause(),d.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},T=()=>{M()};n.addEventListener("abort",T,{once:!0});const u=AbortSignal.any([n,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:m})=>{if(!(i||typeof m!="string"))try{const l=JSON.parse(m);typeof l=="object"&&l!==null&&"type"in l&&(l.type==="session.started"&&(v=!0,x.resolve()),l.type==="session.closed"&&(I.resolve(),h||t.onDisconnect())),h||b.receive(l)}catch{t.onError()}},a.onclose=()=>{x.reject(new Error("Voice connection closed")),I.resolve(),!i&&!h&&t.onDisconnect()},r.onconnectionstatechange=()=>{i||q.report(r.connectionState)},r.ontrack=({streams:m,track:l})=>{if(i)return;const D=m[0]??new MediaStream([l]);d.srcObject=D,e??=new AudioContext,s=e.createAnalyser(),s.fftSize=256,o=new Uint8Array(s.fftSize),e.createMediaStreamSource(D).connect(s),e.resume().catch(()=>t.onError()),d.play().catch(()=>t.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let m=0;for(const l of o)m+=((l-128)/128)**2;return Math.min(1,Math.sqrt(m/o.length)*4)}try{const m=navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}).then(c=>{if(i||u.aborted){for(const f of c.getTracks())f.stop();throw new DOMException("Voice connection cancelled","AbortError")}return p=c,c}),l=await Promise.race([m,new Promise((c,f)=>u.addEventListener("abort",()=>f(u.reason),{once:!0}))]);e??=new AudioContext,g=e.createAnalyser(),g.fftSize=256,w=new Uint8Array(g.fftSize),e.createMediaStreamSource(l).connect(g),await e.resume();for(const c of l.getAudioTracks())r.addTrack(c,l);const D=await r.createOffer();await r.setLocalDescription(D),u.throwIfAborted(),r.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{r.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{r.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};r.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=r.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await r.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,n.throwIfAborted(),u.removeEventListener("abort",z),n.removeEventListener("abort",T),t.onConnect(),L=setInterval(()=>{if(i||h)return;if(b.tick(),g&&w&&!y){g.getByteTimeDomainData(w);const f=w.reduce((S,k)=>S+((k-128)/128)**2,0)/w.length;Math.sqrt(f)>.025&&(P=Date.now())}t.onUserSpeaking(!y&&Date.now()-P<400),N()>.02&&(O=Date.now()),t.onModeChange({mode:Date.now()-O<400?"speaking":"listening"})},100),{endSession:()=>(h??=(async()=>{b.close();for(const c of p?.getTracks()??[])c.stop();if(d.pause(),v&&a.readyState==="open"){a.send(JSON.stringify({type:"session.close"}));let c;await Promise.race([I.promise,new Promise(f=>{c=setTimeout(f,3e3)})]),clearTimeout(c)}await M()})(),h),publishUpdate:c=>b.publishUpdate(c),setMicMuted:c=>{y=c;for(const f of p?.getAudioTracks()??[])f.enabled=!y;y&&t.onUserSpeaking(!1)},getOutputVolume:N}}catch(m){throw await M(),m}}export{go as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,X as f,m as S,K as y,o as v}from"./index-C5LlvZFc.js";import{c as d}from"./use-chat-layout-state-EbMrj1Yk.js";function c(e,i){return y.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=S(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=v();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
1
+ import{c as a,X as f,m as S,K as y,o as v}from"./index-BiuSAlzd.js";import{c as d}from"./use-chat-layout-state-CcLE4xPO.js";function c(e,i){return y.optimisticProjectSidebarViews(e,i)}function l(e){return typeof e=="object"&&e!==null}function b(e,i){return e[1]===i&&e[3]==="collection"&&e[4]==="VIRTUAL_MCP"}function P(e,i){if(!l(e))return e;if("item"in e&&l(e.item)&&e.item.id===i.id)return{...e,item:i};if(!("structuredContent"in e)||!l(e.structuredContent))return e;const s=e.structuredContent.items;if(!Array.isArray(s))return e;let r=!1;const t=s.map(n=>!l(n)||n.id!==i.id?n:(r=!0,i));return r?{...e,structuredContent:{...e.structuredContent,items:t}}:e}function x(e,i,s){e.setQueriesData({predicate:r=>b(r.queryKey,i)},r=>P(r,s))}function A(e,i,s){const r=e.getQueriesData({predicate:t=>b(t.queryKey,i)&&t.queryKey[5]===s});for(const[,t]of r)if(t?.item?.id===s)return t.item;return null}function V(e,i,s){return e.getQueryData(c(i,s))??null}function j(e,i){if(i)return{sidebarViews:[...i.views],sidebarViewsVersion:d};const s=e?.sidebarViews;return{sidebarViews:s===null?null:s?[...s]:void 0,sidebarViewsVersion:e?.sidebarViewsVersion}}function K(e,i,s){return i?{sidebarViews:[...i.views],sidebarViewsVersion:d}:s===void 0?{sidebarViews:e.sidebarViews===null?null:e.sidebarViews?[...e.sidebarViews]:void 0,sidebarViewsVersion:e.sidebarViewsVersion}:j(s,null)}function p(e,i,s,r,t){const n=V(e,i,s),o={revision:(n?.revision??0)+1,views:[...r],rollbackViews:n?[...n.rollbackViews]:[...t]};return e.setQueryData(c(i,s),o),{revision:o.revision,views:[...o.views],persistedViews:[...o.rollbackViews]}}function C(e,i,s){const r=V(e,i,s);return r?{revision:r.revision,views:[...r.views],persistedViews:[...r.rollbackViews]}:null}function m(e,i){const s=new Set(e),r=new Set(i);return s.size===r.size&&[...s].every(t=>r.has(t))}function R(e){return e?!m(e.views,e.persistedViews):!1}function k(e,i,s,{snapshot:r,saved:t,authoritativeViews:n}){if(!r)return{settledLatest:!1,reconciledViews:null};const o=V(e,i,s);if(!o||r.revision>o.revision)return{settledLatest:!1,reconciledViews:null};const u=n!==void 0?[...n]:t?[...r.views]:null,w={...o,rollbackViews:u??o.rollbackViews};return w.rollbackViews!==o.rollbackViews&&e.setQueryData(c(i,s),w),r.revision!==o.revision?{settledLatest:!1,reconciledViews:null}:(e.setQueryData(c(i,s),null),{settledLatest:!0,reconciledViews:t?u&&!m(u,r.views)?u:null:[...w.rollbackViews]})}function _(e){const i=a.c(5),{org:s}=f(),r=e??"";let t;i[0]!==s.id||i[1]!==r?(t=c(s.id,r),i[0]=s.id,i[1]=r,i[2]=t):t=i[2];let n;i[3]!==t?(n={queryKey:t,queryFn:O,enabled:!1,staleTime:Number.POSITIVE_INFINITY},i[3]=t,i[4]=n):n=i[4];const{data:o}=S(n);return o?.views}async function O(){return null}function L(e){const i=a.c(4),{org:s}=f(),r=v();let t;return i[0]!==s||i[1]!==r||i[2]!==e?(t={stage:(n,o)=>p(r,s.id,e,n,o),snapshot:()=>C(r,s.id,e),settle:n=>k(r,s.id,e,n)},i[0]=s,i[1]=r,i[2]=e,i[3]=t):t=i[3],t}export{L as a,b,j as i,R as o,K as p,A as r,_ as u,x as w};
@@ -1 +1 @@
1
- import{c as v,d as x,f as h,j as O,r as b,e8 as I}from"./index-C5LlvZFc.js";import{u as P}from"./use-mobile-Du3isCXQ.js";import{a as j}from"./use-panel-navigate-BVY-Wy0A.js";import{a as y}from"./thread-route-CmSAw42O.js";const E=b.createContext(null);function N(a){const e=v.c(12),{children:i}=a,n=x(),c=P(),{openPanel:l}=j();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const m=h(r),p="org"in m&&typeof m.org=="string"?m.org:void 0,u=y()??void 0;let o;e[1]!==c||e[2]!==n||e[3]!==l?(o=d=>{if(!c){l(I(d),{search:F});return}n({to:".",search:g=>({...g,preview:d})})},e[1]=c,e[2]=n,e[3]=l,e[4]=o):o=e[4];const f=o;let t;e[5]!==f||e[6]!==p||e[7]!==u?(t={orgSlug:p,threadId:u,open:f},e[5]=f,e[6]=p,e[7]=u,e[8]=t):t=e[8];let s;return e[9]!==i||e[10]!==t?(s=O.jsx(E.Provider,{value:t,children:i}),e[9]=i,e[10]=t,e[11]=s):s=e[11],s}function F(a){return{...a,preview:void 0}}export{N as O,E as a};
1
+ import{c as v,d as x,f as h,j as O,r as b,e8 as I}from"./index-BiuSAlzd.js";import{u as P}from"./use-mobile-D06E6E9A.js";import{a as j}from"./use-panel-navigate-DvFfVppm.js";import{a as y}from"./thread-route-SwwHxRrN.js";const E=b.createContext(null);function N(a){const e=v.c(12),{children:i}=a,n=x(),c=P(),{openPanel:l}=j();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},e[0]=r):r=e[0];const m=h(r),p="org"in m&&typeof m.org=="string"?m.org:void 0,u=y()??void 0;let o;e[1]!==c||e[2]!==n||e[3]!==l?(o=d=>{if(!c){l(I(d),{search:F});return}n({to:".",search:g=>({...g,preview:d})})},e[1]=c,e[2]=n,e[3]=l,e[4]=o):o=e[4];const f=o;let t;e[5]!==f||e[6]!==p||e[7]!==u?(t={orgSlug:p,threadId:u,open:f},e[5]=f,e[6]=p,e[7]=u,e[8]=t):t=e[8];let s;return e[9]!==i||e[10]!==t?(s=O.jsx(E.Provider,{value:t,children:i}),e[9]=i,e[10]=t,e[11]=s):s=e[11],s}function F(a){return{...a,preview:void 0}}export{N as O,E as a};