decocms 4.542.0 → 4.542.2

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 (413) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-ppN64tl0.js → ActiveShapeUtils-xwm7xTvz.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-RV4AM_8y.js → AlertCircle-BjT7_GFq.js} +1 -1
  3. package/dist/client/assets/{AreaChart-B5eHYCMZ.js → AreaChart-jT3sTbub.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-XO66B9Td.js → ArrowLeft-Par1IdOs.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-DpQ-09y4.js → ArrowUp-At9MqVhB.js} +1 -1
  6. package/dist/client/assets/{BarChart-rvb3yNLn.js → BarChart-BI0I1ki0.js} +1 -1
  7. package/dist/client/assets/{Building02-NRzC_IEp.js → Building02-BV_I3UuJ.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-BVsrzbFJ.js → CartesianChart-CHwcVvKV.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-64zykerQ.js → CategoricalChart-CF0oZQqp.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-CfYD_Bi6.js → CheckCircle-D6xmTIXf.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-C5MARPJN.js → ChevronSelectorVertical-CeHSyaSD.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-xR4eZngE.js → ChevronUp-CNyARDGk.js} +1 -1
  13. package/dist/client/assets/{Copy01-Dy1KrWO0.js → Copy01-DisW4JMo.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-DVN26JVZ.js → CreditCard01-QvSfBZzn.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-CncVW4wJ.js → DotsVertical-wJ46YU2V.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-C5dp8Quc.js → ErrorBarContext-DteLj0IZ.js} +1 -1
  17. package/dist/client/assets/{Globe04-BxFc3HLH.js → Globe04-DK5qhUMj.js} +1 -1
  18. package/dist/client/assets/{Image01-CaawlkVR.js → Image01-CO8HhoHi.js} +1 -1
  19. package/dist/client/assets/{Key01-FaGRi3tG.js → Key01-BDwjIsdK.js} +1 -1
  20. package/dist/client/assets/{Link01-B_YWUHoH.js → Link01-BHgTruNE.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-z_Mm0CSf.js → LinkBroken01-CdMsJVgm.js} +1 -1
  22. package/dist/client/assets/{Minus-yAYwM_Ty.js → Minus-CJDvXjFo.js} +1 -1
  23. package/dist/client/assets/{Monitor01-Bl7f7T5L.js → Monitor01-B3thg2Rr.js} +1 -1
  24. package/dist/client/assets/{Play-OByKGnTy.js → Play-BhU5Ns8x.js} +1 -1
  25. package/dist/client/assets/{Plus-Ccck99Do.js → Plus-BaWg3Fda.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-BxNBuCjR.js → ReferenceLine-NAOdXR_M.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BAGHgvYw.js → SearchMd-B541ufOQ.js} +1 -1
  28. package/dist/client/assets/{Sector-BCmuavOw.js → Sector-DWc-NOYF.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-BhoOjVkp.js → ShoppingBag01-d7aE6vty.js} +1 -1
  30. package/dist/client/assets/{Sun-CZRF_565.js → Sun-wY_Z9VGm.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-Ce37vA9c.js → SwitchHorizontal01-7qdaOYVu.js} +1 -1
  32. package/dist/client/assets/{Tool01-CHLDtlIL.js → Tool01-DwTqd_Nj.js} +1 -1
  33. package/dist/client/assets/{Trash01-BQBP0tUM.js → Trash01-B5_r6iLm.js} +1 -1
  34. package/dist/client/assets/{Upload01-D_q00M49.js → Upload01-BP49pNql.js} +1 -1
  35. package/dist/client/assets/UserSquare-D1neGXtF.js +1 -0
  36. package/dist/client/assets/{Users01-C6bE7RDt.js → Users01-CrLtxwQA.js} +1 -1
  37. package/dist/client/assets/{XClose-BjZnEBvF.js → XClose-DsiXpG7_.js} +1 -1
  38. package/dist/client/assets/{Zap-CHuT8W6R.js → Zap-BB-vOERw.js} +1 -1
  39. package/dist/client/assets/{ZoomOut-CBOWQYet.js → ZoomOut-ZB7MeGmK.js} +1 -1
  40. package/dist/client/assets/{access-gate-BU0Til0A.js → access-gate-BMPZzaLe.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-BB5lDWHR.js → add-connection-dialog-DkTbkwZe.js} +1 -1
  42. package/dist/client/assets/{agent-analytics-DvRSJxx0.js → agent-analytics-DFuVpyFS.js} +1 -1
  43. package/dist/client/assets/agent-app-BI0E5_7n.js +1 -0
  44. package/dist/client/assets/{agent-assets-DtVY4a5g.js → agent-assets-mt6-RxoQ.js} +1 -1
  45. package/dist/client/assets/{agent-automation-DcUA7Zto.js → agent-automation-DPJINZ67.js} +1 -1
  46. package/dist/client/assets/{agent-automations-C9tGxGRj.js → agent-automations-Cl5cbuK-.js} +1 -1
  47. package/dist/client/assets/{agent-calendar-D4_LWZH3.js → agent-calendar-CMljpTSo.js} +1 -1
  48. package/dist/client/assets/{agent-connect-sources-BJ3ZDaf3.js → agent-connect-sources-Ck7orXzL.js} +1 -1
  49. package/dist/client/assets/agent-deck-Nw66gXDM.js +1 -0
  50. package/dist/client/assets/{agent-e2e-Cn5SS6MS.js → agent-e2e-BLatnPC9.js} +1 -1
  51. package/dist/client/assets/agent-experiments-BslAK98v.js +1 -0
  52. package/dist/client/assets/{agent-file-W_Lb3P1H.js → agent-file-cyUqJo5U.js} +1 -1
  53. package/dist/client/assets/{agent-hosting-CP_GZV0j.js → agent-hosting-DFO1UQwH.js} +1 -1
  54. package/dist/client/assets/agent-icon-D-0GvNzG.js +1 -0
  55. package/dist/client/assets/agent-library-BXKmMOCL.js +1 -0
  56. package/dist/client/assets/agent-library-file-D8BDKfA2.js +1 -0
  57. package/dist/client/assets/agent-monitor-D6kjNFa-.js +1 -0
  58. package/dist/client/assets/{agent-overview-BlaBQIjD.js → agent-overview-CckXDLIM.js} +1 -1
  59. package/dist/client/assets/{agent-releases-CAYqdnuz.js → agent-releases-Bfo75_fu.js} +1 -1
  60. package/dist/client/assets/agent-settings-DM6gu80D.js +1 -0
  61. package/dist/client/assets/{agent-site-editor-dBOL06nH.js → agent-site-editor-DEMYd53f.js} +1 -1
  62. package/dist/client/assets/agent-site-editor-code-B7Ja4k0e.js +2 -0
  63. package/dist/client/assets/agent-site-editor-content-BgxmK1MQ.js +1 -0
  64. package/dist/client/assets/agent-site-editor-preview-BxfSe8hZ.js +1 -0
  65. package/dist/client/assets/agent-view-Di5xXloU.js +1 -0
  66. package/dist/client/assets/{agent-view-guard-B4NqxjMv.js → agent-view-guard-BVgIccGF.js} +1 -1
  67. package/dist/client/assets/{agents-list-DYMJQcr6.js → agents-list-Bhp-wRRW.js} +1 -1
  68. package/dist/client/assets/{ai-providers-Ci2k4cWf.js → ai-providers-BZ346tRe.js} +1 -1
  69. package/dist/client/assets/{alert-Bsjmz-OK.js → alert-l5j64Qp_.js} +1 -1
  70. package/dist/client/assets/{analytics-sections-Nw_65a4t.js → analytics-sections-C7Wvx5is.js} +1 -1
  71. package/dist/client/assets/{api-keys-D4BF_tKg.js → api-keys-D1eJSOy-.js} +1 -1
  72. package/dist/client/assets/api-keys-Duet-lJP.js +1 -0
  73. package/dist/client/assets/app-editor-BdTBcszA.js +1 -0
  74. package/dist/client/assets/{asset-utils-BSDCnt-j.js → asset-utils-Cwse7TzX.js} +1 -1
  75. package/dist/client/assets/{auth-CK6AyRu5.js → auth-BZPkjT4-.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-CJTrtQsq.js → auth-catchall-CorB5tw4.js} +1 -1
  77. package/dist/client/assets/{auth-entry-CPeTN7o5.js → auth-entry-iQvrZCC2.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-BGf8-EnP.js → auth-split-layout-BlKheOJZ.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-Bb8BBbsA.js → authenticate-and-persist-oauth-DercrMMu.js} +1 -1
  80. package/dist/client/assets/{automation-list-row-B9IR9kWn.js → automation-list-row-g_Vn0fLf.js} +1 -1
  81. package/dist/client/assets/{automation-runs-DnR9pxm5.js → automation-runs-B-xMEZBF.js} +1 -1
  82. package/dist/client/assets/{automations-Bxg30h3H.js → automations-CXl5dDVa.js} +1 -1
  83. package/dist/client/assets/{autosend-DTWIjCgK.js → autosend-Ci815qQG.js} +1 -1
  84. package/dist/client/assets/{badge-BV7rxTvN.js → badge-iQ-KRbWv.js} +1 -1
  85. package/dist/client/assets/{block-document-CQARMaA2.js → block-document-DLTjHmMQ.js} +3 -3
  86. package/dist/client/assets/{blocks-preview-workspace-context-C2nnj0H9.js → blocks-preview-workspace-context-Cr4NHNVG.js} +1 -1
  87. package/dist/client/assets/blocks-tab-states-Cs7bIWnm.js +1 -0
  88. package/dist/client/assets/{blog-schema-YJUL-tEX.js → blog-schema-UfoKLAgi.js} +1 -1
  89. package/dist/client/assets/{buckets-C4JU-8qW.js → buckets-0IbVUkQA.js} +1 -1
  90. package/dist/client/assets/{build-improve-prompt-doc-Bv3kayMV.js → build-improve-prompt-doc-RrLnbLYj.js} +1 -1
  91. package/dist/client/assets/{calendar-ym6zGcEl.js → calendar-CjBfTyns.js} +1 -1
  92. package/dist/client/assets/{capability-load-error-7V5aWr5c.js → capability-load-error-BciHzJb0.js} +1 -1
  93. package/dist/client/assets/{category-editor-CdId4wR5.js → category-editor-2zcLZItm.js} +1 -1
  94. package/dist/client/assets/{cdn-tab-2DyF7VRR.js → cdn-tab-OEVXJsgd.js} +1 -1
  95. package/dist/client/assets/{chart-eh3rIFzp.js → chart-D-nB-Kvb.js} +1 -1
  96. package/dist/client/assets/{chat-context-kqrW-XPR.js → chat-context-0CZgd-Gr.js} +1 -1
  97. package/dist/client/assets/{chat-draft-CRTo5XoS.js → chat-draft-DM7nVCQ-.js} +1 -1
  98. package/dist/client/assets/{checkbox-aDQexY19.js → checkbox-DVUVqeGQ.js} +1 -1
  99. package/dist/client/assets/{choose-editor-D9t0sU_N.js → choose-editor-D4MptH6S.js} +1 -1
  100. package/dist/client/assets/{cli-auth-success-BSvz1123.js → cli-auth-success-CcaewW77.js} +1 -1
  101. package/dist/client/assets/{client-icons-DGnfsAP4.js → client-icons-CYPommua.js} +1 -1
  102. package/dist/client/assets/{cms-settings-editor-BCSWQ-Po.js → cms-settings-editor-CnyCQ0VY.js} +1 -1
  103. package/dist/client/assets/{collapsible-Cx6KFD5C.js → collapsible-VIsV7VNH.js} +1 -1
  104. package/dist/client/assets/{collection-detail-ZxhaHEpw.js → collection-detail-DWJ8AxJZ.js} +1 -1
  105. package/dist/client/assets/{collection-display-button-Bswg3uCR.js → collection-display-button-DM4HtPM4.js} +1 -1
  106. package/dist/client/assets/{collection-search-B3vfcK1n.js → collection-search-Dg61rOFc.js} +1 -1
  107. package/dist/client/assets/{collection-table-wrapper-Cs4FMkXQ.js → collection-table-wrapper-Tom29l37.js} +1 -1
  108. package/dist/client/assets/{collection-tabs-BdhCjBRd.js → collection-tabs-Dgf5t1P2.js} +1 -1
  109. package/dist/client/assets/{combobox-DXDZmm8e.js → combobox-BxlWJcmj.js} +1 -1
  110. package/dist/client/assets/{command-De9pJLwH.js → command-DELHBruW.js} +1 -1
  111. package/dist/client/assets/{companion-mcps-section-B-ueLE1c.js → companion-mcps-section-DplrUpp5.js} +1 -1
  112. package/dist/client/assets/{companions-core-DzyeM-yJ.js → companions-core-PpXpxfgQ.js} +1 -1
  113. package/dist/client/assets/{config-Bakd4Y8w.js → config-C7l46kfh.js} +1 -1
  114. package/dist/client/assets/{connect-BMYdSTT8.js → connect-DMjCcT3A.js} +1 -1
  115. package/dist/client/assets/{connect-layout-BpMetD5F.js → connect-layout-BPsq801z.js} +1 -1
  116. package/dist/client/assets/{connect-source-dialog-BkUskMwn.js → connect-source-dialog-C2D2IgRk.js} +1 -1
  117. package/dist/client/assets/{connection-C-NllGni.js → connection-OneH_KYb.js} +1 -1
  118. package/dist/client/assets/{connection-card-DZD_rAWh.js → connection-card-Cn0XDJp5.js} +1 -1
  119. package/dist/client/assets/{connection-detail-BRz9FZ83.js → connection-detail-DviNqCvu.js} +1 -1
  120. package/dist/client/assets/{connection-form-helpers-DmavsUyJ.js → connection-form-helpers-Bky3pLkI.js} +1 -1
  121. package/dist/client/assets/{connections-Cj6HJEn1.js → connections-CnCDDLW4.js} +1 -1
  122. package/dist/client/assets/content-tab-ChaQz5Cw.js +25 -0
  123. package/dist/client/assets/context-Z72cw_0L.js +1 -0
  124. package/dist/client/assets/{context-menu-CiH3Gj0R.js → context-menu-BVx2zw6F.js} +1 -1
  125. package/dist/client/assets/{context-shell-BwT70eIn.js → context-shell-4OlOuHkx.js} +3 -3
  126. package/dist/client/assets/{core.esm-DQyn-kJS.js → core.esm-DtwNC1S6.js} +1 -1
  127. package/dist/client/assets/{create-organization-dialog-CiZys2Ku.js → create-organization-dialog-Bud6wRZH.js} +1 -1
  128. package/dist/client/assets/{daily-pulse-CMy69HGI.js → daily-pulse-CZ6S1sQA.js} +1 -1
  129. package/dist/client/assets/{discover-DQ9dXI7n.js → discover-DTCouleE.js} +1 -1
  130. package/dist/client/assets/{domain-settings-5g_MWfwe.js → domain-settings-CMqaHhTL.js} +1 -1
  131. package/dist/client/assets/{drawer-DDmudFbW.js → drawer-DV7RfSOm.js} +1 -1
  132. package/dist/client/assets/{editor-BqqnxL88.js → editor-C97Kf5Du.js} +1 -1
  133. package/dist/client/assets/{editor-classes-D-ez-qBv.js → editor-classes-Cpizi6Gd.js} +1 -1
  134. package/dist/client/assets/{empty-state-iEpXVBwd.js → empty-state-BaG0Q4po.js} +1 -1
  135. package/dist/client/assets/{empty-state-C7LII3ZM.js → empty-state-DN5hGWOA.js} +1 -1
  136. package/dist/client/assets/{experiments-tab-DGo_lvyv.js → experiments-tab-CaSjZfNk.js} +1 -1
  137. package/dist/client/assets/{experiments-tab-choice-B_rL9_Nx.js → experiments-tab-choice-D7HK8muj.js} +1 -1
  138. package/dist/client/assets/{extract-connection-data-DYwFbKkm.js → extract-connection-data-CMDKUW-r.js} +1 -1
  139. package/dist/client/assets/{feature-gate-E1LoWMx3.js → feature-gate-BCs7uS6R.js} +1 -1
  140. package/dist/client/assets/{feature-paywall-CDMJv8wq.js → feature-paywall-BkfFWoMQ.js} +1 -1
  141. package/dist/client/assets/{file-explorer-CsD267WS.js → file-explorer-D9mAz812.js} +1 -1
  142. package/dist/client/assets/{file-preview-Cj5pBQv2.js → file-preview-BIWzBCIQ.js} +1 -1
  143. package/dist/client/assets/{file-share-button-DOup2WzD.js → file-share-button-Yp1hPdth.js} +1 -1
  144. package/dist/client/assets/{file-type-icon-BgzyV542.js → file-type-icon-BzoA5jiZ.js} +1 -1
  145. package/dist/client/assets/{folder-icon-DY3kBxQc.js → folder-icon-3OVJ0C3s.js} +1 -1
  146. package/dist/client/assets/{form-gDNfP07W.js → form-BeydREbm.js} +1 -1
  147. package/dist/client/assets/{general-CWpdg4Hl.js → general-TShdY8k6.js} +1 -1
  148. package/dist/client/assets/{github-icon-DAxkwypb.js → github-icon-BAVg06aG.js} +1 -1
  149. package/dist/client/assets/github-repo-scope-CiKlF-H0.js +1 -0
  150. package/dist/client/assets/{held-block-view-C3Ird9F-.js → held-block-view-C-gX7MJV.js} +3 -3
  151. package/dist/client/assets/{home-TaMnsEq5.js → home-CaunCGhV.js} +1 -1
  152. package/dist/client/assets/{hosted-publish-feedback-CVQKURab.js → hosted-publish-feedback-DBuxeNUI.js} +1 -1
  153. package/dist/client/assets/{icon-button-CTmBGRaQ.js → icon-button-Dvr6r3yU.js} +1 -1
  154. package/dist/client/assets/{index-Qn_AZuwz.js → index-3W95YvR0.js} +1 -1
  155. package/dist/client/assets/{index-Cjtut9JA.js → index-APWCNDjQ.js} +1 -1
  156. package/dist/client/assets/{index-CXhEXTV0.js → index-B84NhyjS.js} +1 -1
  157. package/dist/client/assets/{index-Cbe7caeT.js → index-Bi4PycPz.js} +1 -1
  158. package/dist/client/assets/{index-DGoeX32I.js → index-C6hJbAJT.js} +1 -1
  159. package/dist/client/assets/{index-CzqNFJgA.js → index-CG3hHrir.js} +1 -1
  160. package/dist/client/assets/{index-15xKR9ar.js → index-CP1LLlUE.js} +1 -1
  161. package/dist/client/assets/{index-ylByMMZI.js → index-Co_Y2KRI.js} +1 -1
  162. package/dist/client/assets/{index-G8_ivZDF.js → index-CvcioybL.js} +1 -1
  163. package/dist/client/assets/{index-lchr3O79.js → index-CzKs4Djn.js} +1 -1
  164. package/dist/client/assets/{index-C-GH7ZUH.js → index-DJkEjMHv.js} +1 -1
  165. package/dist/client/assets/{index-DKRm_nGH.js → index-DXbJEWCl.js} +1 -1
  166. package/dist/client/assets/{index-D3fuewCp.js → index-DslCcy2A.js} +2 -2
  167. package/dist/client/assets/{index-CFDA2Gyk.js → index-Gy88raZj.js} +1 -1
  168. package/dist/client/assets/{index-BWpKrclg.js → index-WgfN4QVP.js} +7 -7
  169. package/dist/client/assets/{index-redirect-COc2iMJs.js → index-redirect-BuSCUFK5.js} +1 -1
  170. package/dist/client/assets/{infiniteQueryObserver-CbIPWgZj.js → infiniteQueryObserver-AJwWz1b5.js} +1 -1
  171. package/dist/client/assets/{infra-billing-gMBDswwS.js → infra-billing-CSDR5i1g.js} +1 -1
  172. package/dist/client/assets/{input-Cf50b9sU.js → input-BqbNJGML.js} +3 -3
  173. package/dist/client/assets/{input-CgS5sNmj.js → input-C9nmuHHZ.js} +1 -1
  174. package/dist/client/assets/{integration-icon-BQ9jVlvt.js → integration-icon-UvPKDtTh.js} +1 -1
  175. package/dist/client/assets/{jira-icon-CzGOnWKo.js → jira-icon-Bmh7OVT1.js} +1 -1
  176. package/dist/client/assets/{label-DzRNwB_s.js → label-Dxzmqh4L.js} +1 -1
  177. package/dist/client/assets/{layout-d2_2jbV9.js → layout-C4nyDmIH.js} +1 -1
  178. package/dist/client/assets/{legacy-agents-deep-CyFzwt79.js → legacy-agents-deep-aq4ok2ss.js} +1 -1
  179. package/dist/client/assets/{legacy-main-redirect-B0hY-Z0B.js → legacy-main-redirect-IAdI4U7x.js} +1 -1
  180. package/dist/client/assets/library-Da5YKyoM.js +1 -0
  181. package/dist/client/assets/{library-tab-cQd24fFO.js → library-tab-CSUDGppR.js} +1 -1
  182. package/dist/client/assets/{login-BB7FreRC.js → login-4UMFaQqs.js} +1 -1
  183. package/dist/client/assets/{markdown-CkZaCBow.js → markdown-NHGOJDhi.js} +1 -1
  184. package/dist/client/assets/{mcp-app-renderer-BVLr3WK6.js → mcp-app-renderer-CGhEZS_Z.js} +1 -1
  185. package/dist/client/assets/{mcp-oauth-KJGfGjkD.js → mcp-oauth-D0k2-sPR.js} +1 -1
  186. package/dist/client/assets/{mcp-oauth-DWlxkjKx.js → mcp-oauth-Due6wImr.js} +1 -1
  187. package/dist/client/assets/{members-BvQ1xqU5.js → members-CNgezQXU.js} +1 -1
  188. package/dist/client/assets/{memory-_Oguj4if.js → memory-BmjdKRyH.js} +1 -1
  189. package/dist/client/assets/{mini-report-page-BC7L0ipE.js → mini-report-page-C4ZquL_-.js} +1 -1
  190. package/dist/client/assets/{mock-board-BC3rEvaU.js → mock-board-CSzfjmM9.js} +3 -3
  191. package/dist/client/assets/{monaco-editor-zzUPRyBn.js → monaco-editor-BDiq_2v4.js} +1 -1
  192. package/dist/client/assets/{monitoring-ilB7hU6H.js → monitoring-DDlo0E0z.js} +1 -1
  193. package/dist/client/assets/{monitoring-stats-row-DZ9HvRuy.js → monitoring-stats-row-BIUtkx4G.js} +1 -1
  194. package/dist/client/assets/{multi-select-D2pKycte.js → multi-select-BzEGbWV5.js} +1 -1
  195. package/dist/client/assets/{mustache-BBgPaDqo.js → mustache-CDuMzcYJ.js} +1 -1
  196. package/dist/client/assets/{named-rule-uses-8PEXqP7W.js → named-rule-uses-BBO-qGhe.js} +1 -1
  197. package/dist/client/assets/{new-project-dialog-Dd5pVssc.js → new-project-dialog-DePwIx8r.js} +1 -1
  198. package/dist/client/assets/{oauth-callback-DIj2YLwh.js → oauth-callback-MEfOlRUI.js} +1 -1
  199. package/dist/client/assets/{oauth-callback-ai-provider-zp6PPNfP.js → oauth-callback-ai-provider-CmQYTORU.js} +1 -1
  200. package/dist/client/assets/{onboarding-CSUeJ8OK.js → onboarding-D-XW6Ll4.js} +1 -1
  201. package/dist/client/assets/{openai-conversation-CT9LWWrS.js → openai-conversation-f0QT3g0s.js} +1 -1
  202. package/dist/client/assets/{optimistic-project-sidebar-views-BhoNMrVo.js → optimistic-project-sidebar-views-BLuXu9p7.js} +1 -1
  203. package/dist/client/assets/{order-monitor-day-D-Ti4NDE.js → order-monitor-day-CUhalAkv.js} +1 -1
  204. package/dist/client/assets/{organization-choice-Bs2Llr3r.js → organization-choice-C88DHbpi.js} +1 -1
  205. package/dist/client/assets/{orgs-Bs_15YVG.js → orgs-BqSj6zly.js} +1 -1
  206. package/dist/client/assets/{page-seo-form-DizfAl8r.js → page-seo-form-bsmuSaAw.js} +1 -1
  207. package/dist/client/assets/{pair-BFVxcKKp.js → pair-Cz07PNwj.js} +1 -1
  208. package/dist/client/assets/parse-sections-CNEwf5xY.js +1 -0
  209. package/dist/client/assets/{plan-_57doTJd.js → plan-BaxzxsmN.js} +1 -1
  210. package/dist/client/assets/{plan-ladder-DVSwNgR2.js → plan-ladder-CPUSwIwK.js} +1 -1
  211. package/dist/client/assets/{plan-usage-card-B64WjIMI.js → plan-usage-card-C2rK33eA.js} +1 -1
  212. package/dist/client/assets/{popover-ClEv7Zyf.js → popover-DqVLkXUD.js} +1 -1
  213. package/dist/client/assets/{post-calendar-CMHuZuip.js → post-calendar-D-B-o5Sk.js} +1 -1
  214. package/dist/client/assets/{post-editor-CqgW2_fW.js → post-editor-wYAwFgD6.js} +1 -1
  215. package/dist/client/assets/{preview-content-BSsfQ6ZE.js → preview-content-SmC2ClvS.js} +1 -1
  216. package/dist/client/assets/{preview-dialog-DBnDC8gE.js → preview-dialog-CKYpQv_g.js} +1 -1
  217. package/dist/client/assets/{preview-panel-DQBuS4_f.js → preview-panel-CUIawUFr.js} +1 -1
  218. package/dist/client/assets/{preview-tab-_86kIh0E.js → preview-tab-gJ-NI33V.js} +3 -3
  219. package/dist/client/assets/{product-picker-dialog-C8oMVTn6.js → product-picker-dialog-BfM9NW4L.js} +1 -1
  220. package/dist/client/assets/{profile-Bsx5sLNH.js → profile-BAzM4QDZ.js} +1 -1
  221. package/dist/client/assets/{project-app-view-C5QghQe6.js → project-app-view-D4za2-JY.js} +1 -1
  222. package/dist/client/assets/{project-apps-oe6VMb11.js → project-apps-B3VLUQHR.js} +1 -1
  223. package/dist/client/assets/{project-feed-DAjFP_Ib.js → project-feed-BMuYP0mY.js} +1 -1
  224. package/dist/client/assets/{project-icon-BKeF243f.js → project-icon-BIzg7YUA.js} +1 -1
  225. package/dist/client/assets/project-reports-DJoAVemp.js +1 -0
  226. package/dist/client/assets/project-tasks-Db93bOVr.js +1 -0
  227. package/dist/client/assets/{projects-BaKJExhs.js → projects-BsvG5EZk.js} +1 -1
  228. package/dist/client/assets/{projects-empty-state-B_kHw_MZ.js → projects-empty-state-BuGy3TU-.js} +1 -1
  229. package/dist/client/assets/{prompts-Br3MvaH9.js → prompts-C_3bA9AB.js} +1 -1
  230. package/dist/client/assets/{provision-repo-scoped-github-connection-lckxpDHD.js → provision-repo-scoped-github-connection-DoOuHltS.js} +1 -1
  231. package/dist/client/assets/record-editor-DavD_m_0.js +1 -0
  232. package/dist/client/assets/redirect-editor-DoeEK1iC.js +1 -0
  233. package/dist/client/assets/{releases-api-DwHPczFb.js → releases-api-DaYlp5Yo.js} +1 -1
  234. package/dist/client/assets/reports-5EubtE8r.js +1 -0
  235. package/dist/client/assets/{reports-iqRQlH1z.js → reports-D9rwlh0Z.js} +1 -1
  236. package/dist/client/assets/{reports-onboarding-Bm9Wvkaq.js → reports-onboarding-CI5-svnj.js} +1 -1
  237. package/dist/client/assets/{reports-tab-DesQ1SQx.js → reports-tab-Dqp0OnYz.js} +2 -2
  238. package/dist/client/assets/repositories-BaY0RDK6.js +1 -0
  239. package/dist/client/assets/{repositories-DUBWep32.js → repositories-pCQtYygJ.js} +1 -1
  240. package/dist/client/assets/{repository-binding-Bpq6heaQ.js → repository-binding-DF6YCWsj.js} +1 -1
  241. package/dist/client/assets/{repository-import-picker-DxJJpcCz.js → repository-import-picker-bneKFCuv.js} +1 -1
  242. package/dist/client/assets/{repository-picker-P8Asvsk4.js → repository-picker-CGoSX3oi.js} +1 -1
  243. package/dist/client/assets/{require-capability-B-uxpRvL.js → require-capability-DbotB2TQ.js} +1 -1
  244. package/dist/client/assets/{required-auth-layout-DYZU5vk_.js → required-auth-layout-BLLWaY3S.js} +1 -1
  245. package/dist/client/assets/{reset-password-Bs_JmNWK.js → reset-password-CYfdP8lX.js} +1 -1
  246. package/dist/client/assets/{resizable-vbjrp9Su.js → resizable-DcAx-gSp.js} +1 -1
  247. package/dist/client/assets/{resolve-tab-icon-CzFxm7IQ.js → resolve-tab-icon-CEtcjh_A.js} +1 -1
  248. package/dist/client/assets/review-settings-BtTYlHnB.js +1 -0
  249. package/dist/client/assets/{roles-C-6Op6OQ.js → roles-wWNA46at.js} +1 -1
  250. package/dist/client/assets/{route-Cr42SuLO.js → route-8T5e9Ewx.js} +1 -1
  251. package/dist/client/assets/{route-Bdui6QXz.js → route-CGePI1fo.js} +1 -1
  252. package/dist/client/assets/route-D_1NyYgH.js +1 -0
  253. package/dist/client/assets/{sandbox-lifecycle-context-D9eDp86x.js → sandbox-lifecycle-context-Bwi5LES5.js} +1 -1
  254. package/dist/client/assets/{schema-DzZBw0EW.js → schema-BUPJBVf-.js} +1 -1
  255. package/dist/client/assets/{schema-Cd1llToh.js → schema-DiDerRAC.js} +1 -1
  256. package/dist/client/assets/{scroll-area-CwuazZb5.js → scroll-area-CiASyTMh.js} +1 -1
  257. package/dist/client/assets/{search-input-D2iQ_3lu.js → search-input-BB0pLu50.js} +1 -1
  258. package/dist/client/assets/{search-toggle-Cw7hl_Xx.js → search-toggle-Ct5urmf5.js} +1 -1
  259. package/dist/client/assets/{secret-picker-Ct1DoTR9.js → secret-picker-DeqIjavS.js} +1 -1
  260. package/dist/client/assets/{secrets-CBPyw7ba.js → secrets-CXa42ggH.js} +1 -1
  261. package/dist/client/assets/{section-array-field-BXLl3jB0.js → section-array-field-DENveGph.js} +1 -1
  262. package/dist/client/assets/{sections-DRD1aU5D.js → sections-Czi5N-nx.js} +1 -1
  263. package/dist/client/assets/sections-editor-CJWiHP8t.js +1 -0
  264. package/dist/client/assets/{select-BMteQTWS.js → select-CFg3KEOq.js} +1 -1
  265. package/dist/client/assets/{select-model-ujDDmA_R.js → select-model-DkYaqcwE.js} +1 -1
  266. package/dist/client/assets/{seo-editor-nXgc_X38.js → seo-editor-C18LAsg1.js} +1 -1
  267. package/dist/client/assets/{separator-l2LsOpLi.js → separator-DlxWQ5-B.js} +1 -1
  268. package/dist/client/assets/settings-tab-CGA_nTpk.js +1 -0
  269. package/dist/client/assets/{sheet-BW-FxyJZ.js → sheet-CA3M7bQp.js} +1 -1
  270. package/dist/client/assets/{shell-layout-BbFvnpcf.js → shell-layout-pSWumg64.js} +1 -1
  271. package/dist/client/assets/{site-draft-actions-9GNFURGo.js → site-draft-actions-B9N3leLY.js} +1 -1
  272. package/dist/client/assets/{site-draft-view-DhCorNAk.js → site-draft-view-Byvdlyo6.js} +2 -2
  273. package/dist/client/assets/site-editor-CqHgEJnK.js +1 -0
  274. package/dist/client/assets/{site-editor-toast-QHleRFN5.js → site-editor-toast-Bz-6LR6r.js} +1 -1
  275. package/dist/client/assets/{skills-ApZ_uT4M.js → skills-DcoNLVNg.js} +1 -1
  276. package/dist/client/assets/{slider-DtzvJZ1j.js → slider-CdizOZzU.js} +1 -1
  277. package/dist/client/assets/{sortable.esm-DNzjY6xb.js → sortable.esm-D_24nW2P.js} +1 -1
  278. package/dist/client/assets/{sso-Con6Y9JD.js → sso-BX8AqSlx.js} +1 -1
  279. package/dist/client/assets/{suggestion-BgdlUdcB.js → suggestion-hz2N0L4f.js} +1 -1
  280. package/dist/client/assets/{switch-Bv0wLEBx.js → switch-nJxNuRWR.js} +1 -1
  281. package/dist/client/assets/{symbol-CJoI4vsX.js → symbol-DnjOGl1B.js} +1 -1
  282. package/dist/client/assets/{synced-repos-Bdx0Lzti.js → synced-repos-CwsMzHsk.js} +1 -1
  283. package/dist/client/assets/{tab-icon-glyph-CSlj-TVq.js → tab-icon-glyph-CyteS_dF.js} +1 -1
  284. package/dist/client/assets/{table-CheWM6KL.js → table-D3Xss2p0.js} +1 -1
  285. package/dist/client/assets/{tabs-CjWwohzM.js → tabs-j1z3THwl.js} +1 -1
  286. package/dist/client/assets/{task-assignee-avatar-DwSiTsoy.js → task-assignee-avatar-ClZ-7JIA.js} +1 -1
  287. package/dist/client/assets/{task-board-L6ZGzY-s.js → task-board-M_qS1rzf.js} +1 -1
  288. package/dist/client/assets/{task-route-D7Tzzgt_.js → task-route-CWCfzbE3.js} +1 -1
  289. package/dist/client/assets/{task-status-FHJjKh4u.js → task-status-CC96IwX7.js} +1 -1
  290. package/dist/client/assets/{taskboard-analytics-kV8i_37N.js → taskboard-analytics-XMzxqkpx.js} +1 -1
  291. package/dist/client/assets/tasks-C8psxVdc.js +1 -0
  292. package/dist/client/assets/{tasks-3fvPlwxK.js → tasks-fO-z4dp1.js} +1 -1
  293. package/dist/client/assets/{textarea-BNvvIWSZ.js → textarea-D-MP0s12.js} +1 -1
  294. package/dist/client/assets/{thread-analytics-DOn_63z0.js → thread-analytics-DZ3xDtzM.js} +1 -1
  295. package/dist/client/assets/{thread-intent-DjvP3GsU.js → thread-intent-DSKhfvxP.js} +1 -1
  296. package/dist/client/assets/{thread-route-BOOkt7de.js → thread-route-D2HAbtZo.js} +1 -1
  297. package/dist/client/assets/{thread-route-B3uNqVbb.js → thread-route-DJFRjF24.js} +1 -1
  298. package/dist/client/assets/{thread-sheet-body-sjcfE700.js → thread-sheet-body-uGXl8WDp.js} +1 -1
  299. package/dist/client/assets/{time-range-picker-BostqQTB.js → time-range-picker-DE6cxBjq.js} +1 -1
  300. package/dist/client/assets/{toggle-group-BAFBdL9F.js → toggle-group-BUfjArPT.js} +1 -1
  301. package/dist/client/assets/{tool-namespace-CG1Oreso.js → tool-namespace-CGxHGKW_.js} +1 -1
  302. package/dist/client/assets/{toolbar-icon-button-CnXJyVJt.js → toolbar-icon-button-B1loXRWd.js} +1 -1
  303. package/dist/client/assets/{tooltip-D2ANqV2w.js → tooltip-CUsEGqy_.js} +1 -1
  304. package/dist/client/assets/{tooltipContext-DvKfbID4.js → tooltipContext-Bj1ILd8M.js} +1 -1
  305. package/dist/client/assets/{track-BA-6upge.js → track-CkX_aW1n.js} +1 -1
  306. package/dist/client/assets/{types-BNmsSext.js → types-D9PXVqqG.js} +1 -1
  307. package/dist/client/assets/{url-slug-DcB6_J0W.js → url-slug-B4ugcdZY.js} +1 -1
  308. package/dist/client/assets/{usage-stats-I2nqy87E.js → usage-stats-qowelp13.js} +1 -1
  309. package/dist/client/assets/{use-ai-providers-BcLfhqAn.js → use-ai-providers-BcdAb8qD.js} +1 -1
  310. package/dist/client/assets/{use-apply-named-rule-CdtINk0A.js → use-apply-named-rule-ByoZP5j7.js} +1 -1
  311. package/dist/client/assets/{use-automations-DX8SlLEI.js → use-automations-BVNZ6rjm.js} +1 -1
  312. package/dist/client/assets/{use-autosave-c4cGzjJa.js → use-autosave-ysdD2930.js} +1 -1
  313. package/dist/client/assets/{use-chat-layout-state-CyqukwDV.js → use-chat-layout-state-B5aaDvob.js} +1 -1
  314. package/dist/client/assets/{use-clock-tick-CXtcWsca.js → use-clock-tick-Cfukw61c.js} +1 -1
  315. package/dist/client/assets/{use-cms-publish-actions-BDOdjoX5.js → use-cms-publish-actions-DZ9irs8o.js} +1 -1
  316. package/dist/client/assets/{use-connect-companion-pjD5dMZl.js → use-connect-companion-BO5TLspT.js} +1 -1
  317. package/dist/client/assets/{use-connection-CZNQu-z2.js → use-connection-FqHna8PS.js} +1 -1
  318. package/dist/client/assets/{use-copy-Bq-mz0ld.js → use-copy-CXZDMarr.js} +1 -1
  319. package/dist/client/assets/{use-create-virtual-mcp-BVwiobb2.js → use-create-virtual-mcp-Dzh7EwRz.js} +1 -1
  320. package/dist/client/assets/{use-date-fns-locale-CLYhNSnw.js → use-date-fns-locale-DDFXCn-E.js} +1 -1
  321. package/dist/client/assets/{use-debounced-autosave-Cxe8yde_.js → use-debounced-autosave-DnB6ruCU.js} +1 -1
  322. package/dist/client/assets/{use-debounced-value-CqLWq6L2.js → use-debounced-value-QixculIP.js} +1 -1
  323. package/dist/client/assets/{use-deco-credits-C26dK60_.js → use-deco-credits-CvKHRGmx.js} +1 -1
  324. package/dist/client/assets/{use-decopilot-events-Dg011Qgn.js → use-decopilot-events-fL28TEHC.js} +1 -1
  325. package/dist/client/assets/{use-delete-connection-DzeFDNj4.js → use-delete-connection-DmHzYgl9.js} +1 -1
  326. package/dist/client/assets/{use-deployment-admin-COukxauw.js → use-deployment-admin-DIOIJKFZ.js} +1 -1
  327. package/dist/client/assets/{use-entitlements-Bxptpo8e.js → use-entitlements-BkqxE18N.js} +1 -1
  328. package/dist/client/assets/{use-fast-preview-draft-url-DWrGmO4E.js → use-fast-preview-draft-url-BRikkUIY.js} +1 -1
  329. package/dist/client/assets/{use-file-configs-DAoix9gu.js → use-file-configs-hWnpGnBU.js} +1 -1
  330. package/dist/client/assets/{use-inbox-feed-CEHyMhUC.js → use-inbox-feed-DIzfN-6Y.js} +1 -1
  331. package/dist/client/assets/{use-infinite-scroll-CojsIRJO.js → use-infinite-scroll-B2Dxfw4r.js} +1 -1
  332. package/dist/client/assets/{use-join-requests-GMVGPaSk.js → use-join-requests-D7tVSsO6.js} +1 -1
  333. package/dist/client/assets/{use-main-panel-tabs-DXx3VvH2.js → use-main-panel-tabs-Dtx52M7M.js} +1 -1
  334. package/dist/client/assets/{use-mcp-auth-status-CvV54_ol.js → use-mcp-auth-status-DT-19LwX.js} +1 -1
  335. package/dist/client/assets/{use-mcp-client-zIBQco5Q.js → use-mcp-client-DXdlNn5q.js} +1 -1
  336. package/dist/client/assets/{use-mcp-prompts-XayY9yfQ.js → use-mcp-prompts-ClNBkSao.js} +1 -1
  337. package/dist/client/assets/{use-mcp-tools-BmZF8fTN.js → use-mcp-tools-DgRM7NRr.js} +1 -1
  338. package/dist/client/assets/{use-mobile-CoPLJ8cu.js → use-mobile-BRzk8D-v.js} +1 -1
  339. package/dist/client/assets/{use-move-blocks-Ck5rS_vn.js → use-move-blocks-BwtieMWH.js} +1 -1
  340. package/dist/client/assets/{use-navigate-to-agent-DqWY18b4.js → use-navigate-to-agent-Mx6A78it.js} +1 -1
  341. package/dist/client/assets/{use-org-fs-B4wvUwJj.js → use-org-fs-DRPPAr_0.js} +1 -1
  342. package/dist/client/assets/{use-org-repo-syncs-D-0WnIj6.js → use-org-repo-syncs-zLVhA-m3.js} +1 -1
  343. package/dist/client/assets/{use-org-sso-sTi3oL5_.js → use-org-sso-CK8bP20u.js} +1 -1
  344. package/dist/client/assets/{use-organization-roles-DXXkhsvq.js → use-organization-roles-BFEFwfPv.js} +1 -1
  345. package/dist/client/assets/{use-organization-settings-D_5fr-OI.js → use-organization-settings-CHtyXny0.js} +1 -1
  346. package/dist/client/assets/{use-panel-navigate-nriEb2Qz.js → use-panel-navigate-BrmvjTvw.js} +1 -1
  347. package/dist/client/assets/{use-project-native-view-presence-Bdl4n5BM.js → use-project-native-view-presence-fZL342dS.js} +1 -1
  348. package/dist/client/assets/{use-project-scope-CdqclLu1.js → use-project-scope-5fuCx2a_.js} +1 -1
  349. package/dist/client/assets/{use-recent-apps-6oU0G5sy.js → use-recent-apps-DIC3oGRR.js} +1 -1
  350. package/dist/client/assets/{use-releases-CjPNvHz7.js → use-releases-DMLz_29m.js} +1 -1
  351. package/dist/client/assets/{use-reports-diagnostic-CbLn3JeW.js → use-reports-diagnostic-CDXaLKrf.js} +1 -1
  352. package/dist/client/assets/use-sandbox-events-CcwyGMD7.js +2 -0
  353. package/dist/client/assets/{use-secrets-DMgYR7J2.js → use-secrets-B0fPW93u.js} +1 -1
  354. package/dist/client/assets/{use-section-preview-base-CJSLbEeV.js → use-section-preview-base-BLJOom-F.js} +1 -1
  355. package/dist/client/assets/{use-session-runtime-HJpkQoy0.js → use-session-runtime-BIoEtecA.js} +1 -1
  356. package/dist/client/assets/{use-sidebar-collapsed-DGKLEITN.js → use-sidebar-collapsed-BToAgS1l.js} +1 -1
  357. package/dist/client/assets/{use-tags-C5S50qhF.js → use-tags-BBUfpZ3Q.js} +1 -1
  358. package/dist/client/assets/{use-task-board-analytics-BhLHNvA-.js → use-task-board-analytics-CP7ZTaMB.js} +1 -1
  359. package/dist/client/assets/{use-task-board-events-CWQQpnEy.js → use-task-board-events-CyzOoXYa.js} +1 -1
  360. package/dist/client/assets/{use-task-board-item-prs-a7ezuDRL.js → use-task-board-item-prs-xIRkPDuE.js} +1 -1
  361. package/dist/client/assets/{use-task-board-prompts-DonCfR5m.js → use-task-board-prompts-Hjgi7ATn.js} +1 -1
  362. package/dist/client/assets/{use-task-metadata-MAOPH7xT.js → use-task-metadata-DVialv3C.js} +1 -1
  363. package/dist/client/assets/{use-thread-analytics-B2fKyMxQ.js → use-thread-analytics-DKL46-sK.js} +1 -1
  364. package/dist/client/assets/{use-thread-outputs-vH0sJUqm.js → use-thread-outputs-CuLm_Mfb.js} +1 -1
  365. package/dist/client/assets/useInfiniteQuery-CrT95xA_.js +1 -0
  366. package/dist/client/assets/{useQueries-Qve4MUYw.js → useQueries-Ddak2P0w.js} +1 -1
  367. package/dist/client/assets/useSuspenseInfiniteQuery-Cy44049I.js +1 -0
  368. package/dist/client/assets/{users-DHtbHEKw.js → users-wgAbpnD0.js} +1 -1
  369. package/dist/client/assets/{utils-BoR7m7ir.js → utils-DdcTGJDK.js} +1 -1
  370. package/dist/client/assets/{variant-calendar-DSZCP6Sl.js → variant-calendar-DkBZGo-3.js} +1 -1
  371. package/dist/client/assets/{variant-matcher-override-Cvh79vYa.js → variant-matcher-override-D8SSg_Q7.js} +1 -1
  372. package/dist/client/assets/{view-header-DTW0kjf6.js → view-header-CAPGAS4q.js} +1 -1
  373. package/dist/client/assets/{virtual-mcp-RiqyMxQd.js → virtual-mcp-a8UorXJw.js} +1 -1
  374. package/dist/client/assets/{watch-sse-pool-6veZzsu7.js → watch-sse-pool-CH4G2Sl-.js} +1 -1
  375. package/dist/client/index.html +1 -1
  376. package/dist/server/server.js +41 -41
  377. package/package.json +1 -1
  378. package/dist/client/assets/UserSquare-BSsT3MHy.js +0 -1
  379. package/dist/client/assets/agent-app-B0uhmcWv.js +0 -1
  380. package/dist/client/assets/agent-deck-CACa1iZR.js +0 -1
  381. package/dist/client/assets/agent-experiments-TwOhraCy.js +0 -1
  382. package/dist/client/assets/agent-icon-nQ1AH9dU.js +0 -1
  383. package/dist/client/assets/agent-library-BvH-Q75b.js +0 -1
  384. package/dist/client/assets/agent-library-file-BC8zk1Dl.js +0 -1
  385. package/dist/client/assets/agent-monitor-UYQNblqG.js +0 -1
  386. package/dist/client/assets/agent-settings-Lu1EqGNe.js +0 -1
  387. package/dist/client/assets/agent-site-editor-code-BAyfkSPu.js +0 -2
  388. package/dist/client/assets/agent-site-editor-content-CKgCOX3-.js +0 -1
  389. package/dist/client/assets/agent-site-editor-preview-B9oFLAt2.js +0 -1
  390. package/dist/client/assets/agent-view-D-sscasX.js +0 -1
  391. package/dist/client/assets/api-keys-D_tuzPJP.js +0 -1
  392. package/dist/client/assets/app-editor-hRLD7Ehq.js +0 -1
  393. package/dist/client/assets/blocks-tab-states-DhR3pyff.js +0 -1
  394. package/dist/client/assets/content-tab-DkKuIDyy.js +0 -22
  395. package/dist/client/assets/context-C2r290S4.js +0 -1
  396. package/dist/client/assets/github-repo-scope-ByTYKy_L.js +0 -1
  397. package/dist/client/assets/library-CS74d8fl.js +0 -1
  398. package/dist/client/assets/parse-sections-BVn3AvAz.js +0 -1
  399. package/dist/client/assets/project-reports-uzkOMqSE.js +0 -1
  400. package/dist/client/assets/project-tasks-jNTlksUk.js +0 -1
  401. package/dist/client/assets/record-editor-B5oAS_5D.js +0 -1
  402. package/dist/client/assets/redirect-editor-CSg_SJ3I.js +0 -1
  403. package/dist/client/assets/reports-CL4pYm69.js +0 -1
  404. package/dist/client/assets/repositories-C-WO-gxz.js +0 -1
  405. package/dist/client/assets/review-settings-CsHCgNLm.js +0 -1
  406. package/dist/client/assets/route-BlJ-TDEK.js +0 -1
  407. package/dist/client/assets/sections-editor-B628EbZ4.js +0 -1
  408. package/dist/client/assets/settings-tab-Cj4D3Abl.js +0 -1
  409. package/dist/client/assets/site-editor-8rMP2pUf.js +0 -1
  410. package/dist/client/assets/tasks-BImUOCfZ.js +0 -1
  411. package/dist/client/assets/use-sandbox-events-C3mgE5Ut.js +0 -2
  412. package/dist/client/assets/useInfiniteQuery-CFafSHXd.js +0 -1
  413. package/dist/client/assets/useSuspenseInfiniteQuery-D_oVQ9bL.js +0 -1
@@ -1 +1 @@
1
- import{c as lt,l as J,j as l}from"./index-BWpKrclg.js";import{C as Q,b as Z}from"./chart-eh3rIFzp.js";import{C as tt,X as et,Y as at}from"./CartesianChart-BVsrzbFJ.js";import{A as mt,a as ut}from"./AreaChart-B5eHYCMZ.js";import{C as dt}from"./tooltipContext-DvKfbID4.js";import{B as ht,a as pt}from"./BarChart-rvb3yNLn.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.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((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ut,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(dt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
1
+ import{c as lt,l as J,j as l}from"./index-WgfN4QVP.js";import{C as Q,b as Z}from"./chart-D-nB-Kvb.js";import{C as tt,X as et,Y as at}from"./CartesianChart-CHwcVvKV.js";import{A as mt,a as ut}from"./AreaChart-jT3sTbub.js";import{C as dt}from"./tooltipContext-Bj1ILd8M.js";import{B as ht,a as pt}from"./BarChart-BI0I1ki0.js";const it=60*1e3,P=60*it,xt=24*P,st=25*P;function q(s,t){if(s.length===0)return 0;const r=[...s].sort((f,c)=>f-c),e=Math.max(0,Math.min(r.length-1,Math.ceil(t*r.length)-1));return r[e]??0}function gt(s,t){return t<=st?s.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString([],{month:"short",day:"numeric"})}function yt(s,t){const r=t-s;return r<=P?Math.max(1,Math.min(60,Math.ceil(r/it))):r<=st?Math.max(1,Math.min(25,Math.ceil(r/P))):Math.max(1,Math.min(31,Math.ceil(r/xt)))}function kt(s,t,r,e){const f=t.getTime(),c=r.getTime(),h=Math.max(1,c-f),n=yt(f,c),g=Math.max(1,Math.floor(h/n)),a=[];for(let o=0;o<n;o++){const i=new Date(f+o*g);a.push({t:i.toISOString(),ts:i.getTime(),label:gt(i,h),calls:0,errors:0,durations:[]})}for(const o of s){const i=new Date(o.timestamp).getTime(),m=Math.floor((i-f)/g),x=Math.max(0,Math.min(n-1,m)),u=a[x];u&&(u.calls+=1,o.isError&&(u.errors+=1),Number.isFinite(o.durationMs)&&u.durations.push(o.durationMs))}return a.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((i,m)=>i+m,0)/o.durations.length:0),p50:Math.round(q(o.durations,.5)),p95:Math.round(q(o.durations,.95))}))}function Ct(s,t,r,e,f){const c=e??s.length,h=f??s.filter(i=>i.isError).length,n=s.map(i=>i.durationMs),g=n.length>0?n.reduce((i,m)=>i+m,0)/n.length:0,a=q(n,.95),o=kt(s,t.startDate,t.endDate);return{totalCalls:c,totalErrors:h,avgDurationMs:g,p95DurationMs:a,data:o}}function ot(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}function rt(s){const t=lt.c(19),{active:r,payload:e,dataKey:f,colorVar:c}=s;if(!r||!e?.length)return null;const h=e[0],n=h?.payload?.t??"";let g;t[0]!==h?.payload?.label||t[1]!==n?(g=n?new Date(n).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):h?.payload?.label??"",t[0]=h?.payload?.label,t[1]=n,t[2]=g):g=t[2];const a=g,o=h?.value,i=typeof o=="number"?o:0,m=f==="avg"||f==="p50"||f==="p95",x=f==="costUsd";let u;t[3]!==x||t[4]!==m||t[5]!==i?(u=x?`$${i.toFixed(i<1?4:2)}`:m?i>=1e4?`${(i/1e3).toFixed(1)}s`:`${Math.round(i)}ms`:i.toLocaleString(),t[3]=x,t[4]=m,t[5]=i,t[6]=u):u=t[6];const S=u;let y;t[7]!==a?(y=l.jsx("div",{className:"text-2xs text-muted-foreground mb-1",children:a}),t[7]=a,t[8]=y):y=t[8];let k;t[9]!==c?(k=l.jsx("div",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:c}}),t[9]=c,t[10]=k):k=t[10];let v;t[11]!==S?(v=l.jsx("span",{className:"text-xs font-medium tabular-nums",children:S}),t[11]=S,t[12]=v):v=t[12];let p;t[13]!==k||t[14]!==v?(p=l.jsxs("div",{className:"flex items-center gap-1.5",children:[k,v]}),t[13]=k,t[14]=v,t[15]=p):p=t[15];let j;return t[16]!==y||t[17]!==p?(j=l.jsxs("div",{className:"rounded-lg bg-popover px-3 py-2 shadow-soft",children:[y,p]}),t[16]=y,t[17]=p,t[18]=j):j=t[18],j}function Lt(s){const t=lt.c(85),{data:r,dataKey:e,colorNum:f,chartHeight:c,variant:h,ariaLabel:n}=s,g=h===void 0?"bar":h,a=`var(--chart-${f})`,o=`kpi-gradient-${e}-${f}`,i=Math.max(...r.map(d=>d[e]??0),0);if(g==="area"){let d;t[0]!==c?(d=J(c,"w-full"),t[0]=c,t[1]=d):d=t[1];let M;t[2]!==a||t[3]!==e?(M={label:e,color:a},t[2]=a,t[3]=e,t[4]=M):M=t[4];let b;t[5]!==e||t[6]!==M?(b={[e]:M},t[5]=e,t[6]=M,t[7]=b):b=t[7];let I;t[8]===Symbol.for("react.memo_cache_sentinel")?(I={left:0,right:-12,top:8,bottom:8},t[8]=I):I=t[8];let $,O;t[9]!==a?($=l.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.2}),O=l.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:0}),t[9]=a,t[10]=$,t[11]=O):($=t[10],O=t[11]);let w;t[12]!==o||t[13]!==$||t[14]!==O?(w=l.jsx("defs",{children:l.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[$,O]})}),t[12]=o,t[13]=$,t[14]=O,t[15]=w):w=t[15];let R;t[16]===Symbol.for("react.memo_cache_sentinel")?(R=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[16]=R):R=t[16];let V;t[17]===Symbol.for("react.memo_cache_sentinel")?(V=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:11,fill:"var(--muted-foreground)",opacity:.7},interval:"preserveStartEnd",tickMargin:8}),t[17]=V):V=t[17];let U;t[18]===Symbol.for("react.memo_cache_sentinel")?(U={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[18]=U):U=t[18];const W=i>0?"auto":10;let E;t[19]!==W?(E=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:U,tickFormatter:ot,width:40,domain:[0,W],tickCount:5}),t[19]=W,t[20]=E):E=t[20];let Y;t[21]===Symbol.for("react.memo_cache_sentinel")?(Y={stroke:"var(--border)",strokeDasharray:"4 4"},t[21]=Y):Y=t[21];let T;t[22]!==a||t[23]!==e?(T=l.jsx(Q,{cursor:Y,content:nt=>{const{active:ct,payload:ft}=nt;return l.jsx(rt,{active:ct,payload:ft,dataKey:e,colorVar:a})}}),t[22]=a,t[23]=e,t[24]=T):T=t[24];const X=`url(#${o})`;let z;t[25]!==a?(z={r:4,fill:a,stroke:"var(--background)",strokeWidth:2},t[25]=a,t[26]=z):z=t[26];let A;t[27]!==a||t[28]!==e||t[29]!==X||t[30]!==z?(A=l.jsx(mt,{type:"linear",dataKey:e,stroke:a,strokeWidth:2,fill:X,animationDuration:300,dot:!1,activeDot:z}),t[27]=a,t[28]=e,t[29]=X,t[30]=z,t[31]=A):A=t[31];let B;t[32]!==r||t[33]!==E||t[34]!==T||t[35]!==A||t[36]!==w?(B=l.jsxs(ut,{data:r,margin:I,children:[w,R,V,E,T,A]}),t[32]=r,t[33]=E,t[34]=T,t[35]=A,t[36]=w,t[37]=B):B=t[37];let H;return t[38]!==n||t[39]!==B||t[40]!==d||t[41]!==b?(H=l.jsx(Z,{role:"img","aria-label":n,className:d,config:b,children:B}),t[38]=n,t[39]=B,t[40]=d,t[41]=b,t[42]=H):H=t[42],H}let m;t[43]!==c?(m=J(c,"w-full"),t[43]=c,t[44]=m):m=t[44];let x;t[45]!==a||t[46]!==e?(x={label:e,color:a},t[45]=a,t[46]=e,t[47]=x):x=t[47];let u;t[48]!==e||t[49]!==x?(u={[e]:x},t[48]=e,t[49]=x,t[50]=u):u=t[50];let S,y;t[51]===Symbol.for("react.memo_cache_sentinel")?(S={left:0,right:-12,top:8,bottom:8},y=l.jsx(tt,{strokeDasharray:"4 4",stroke:"var(--border)",strokeOpacity:.5,vertical:!1}),t[51]=S,t[52]=y):(S=t[51],y=t[52]);let k;t[53]===Symbol.for("react.memo_cache_sentinel")?(k={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[53]=k):k=t[53];const v=r.length<=6?0:Math.floor(r.length/6);let p;t[54]!==v?(p=l.jsx(et,{dataKey:"label",axisLine:!1,tickLine:!1,tick:k,interval:v,tickMargin:8}),t[54]=v,t[55]=p):p=t[55];let j;t[56]===Symbol.for("react.memo_cache_sentinel")?(j={fontSize:11,fill:"var(--muted-foreground)",opacity:.7},t[56]=j):j=t[56];const G=i>0?"auto":10;let _;t[57]!==G?(_=l.jsx(at,{orientation:"right",axisLine:!1,tickLine:!1,tick:j,tickFormatter:ot,width:40,domain:[0,G],tickCount:5}),t[57]=G,t[58]=_):_=t[58];let K;t[59]===Symbol.for("react.memo_cache_sentinel")?(K={fill:"var(--muted)",opacity:.3},t[59]=K):K=t[59];let C;t[60]!==a||t[61]!==e?(C=l.jsx(Q,{cursor:K,content:d=>{const{active:M,payload:b}=d;return l.jsx(rt,{active:M,payload:b,dataKey:e,colorVar:a})}}),t[60]=a,t[61]=e,t[62]=C):C=t[62];let L;if(t[63]!==a||t[64]!==r||t[65]!==e){let d;t[67]!==a||t[68]!==e?(d=(M,b)=>l.jsx(dt,{fill:(M[e]??0)===0?"var(--muted-foreground)":a,fillOpacity:(M[e]??0)===0?.15:.85},`cell-${b}`),t[67]=a,t[68]=e,t[69]=d):d=t[69],L=r.map(d),t[63]=a,t[64]=r,t[65]=e,t[66]=L}else L=t[66];let D;t[70]!==a||t[71]!==e||t[72]!==L?(D=l.jsx(ht,{dataKey:e,fill:a,radius:0,minPointSize:1,children:L}),t[70]=a,t[71]=e,t[72]=L,t[73]=D):D=t[73];let N;t[74]!==r||t[75]!==_||t[76]!==C||t[77]!==D||t[78]!==p?(N=l.jsxs(pt,{data:r,margin:S,children:[y,p,_,C,D]}),t[74]=r,t[75]=_,t[76]=C,t[77]=D,t[78]=p,t[79]=N):N=t[79];let F;return t[80]!==n||t[81]!==N||t[82]!==m||t[83]!==u?(F=l.jsx(Z,{role:"img","aria-label":n,className:m,config:u,children:N}),t[80]=n,t[81]=N,t[82]=m,t[83]=u,t[84]=F):F=t[84],F}export{Lt as K,Ct as c};
@@ -1 +1 @@
1
- import{c as ie,r as U,l as ce,j as t}from"./index-BWpKrclg.js";import{B as le}from"./badge-BV7rxTvN.js";import{C as ne}from"./checkbox-aDQexY19.js";import{t as ae}from"./ChevronUp-xR4eZngE.js";import{e as de,C as me,b as oe,c as ue,a as fe,d as he}from"./command-De9pJLwH.js";import{a as xe,b as pe,P as ge}from"./popover-ClEv7Zyf.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=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 n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
1
+ import{c as ie,r as U,l as ce,j as t}from"./index-WgfN4QVP.js";import{B as le}from"./badge-iQ-KRbWv.js";import{C as ne}from"./checkbox-DVUVqeGQ.js";import{t as ae}from"./ChevronUp-CNyARDGk.js";import{e as de,C as me,b as oe,c as ue,a as fe,d as he}from"./command-DELHBruW.js";import{a as xe,b as pe,P as ge}from"./popover-DqVLkXUD.js";const ve=[];function Ve(r){const e=ie.c(68),{options:a,onValueChange:o,defaultValue:W,placeholder:X,animation:Z,maxCount:ee,modalPopover:te,className:M,disabled:se,onSearchChange:S}=r,d=W===void 0?ve:W,$=X===void 0?"Select items":X,P=Z===void 0?0:Z,k=ee===void 0?3:ee,J=te===void 0?!1:te,Y=se===void 0?!1:se,[s,y]=U.useState(d),[F,_]=U.useState(!1);let V,E;e[0]!==d||e[1]!==s?(V=()=>{JSON.stringify(s)!==JSON.stringify(d)&&y(d)},E=[d,s],e[0]=d,e[1]=s,e[2]=V,e[3]=E):(V=e[2],E=e[3]),U.useEffect(V,E);let O;e[4]!==o||e[5]!==s?(O=l=>{if(l.key==="Enter")_(!0);else if(l.key==="Backspace"&&!l.currentTarget.value){const n=[...s];n.pop(),y(n),o(n)}},e[4]=o,e[5]=s,e[6]=O):O=e[6];const G=O;let D;e[7]!==o||e[8]!==s?(D=l=>{const n=s.includes(l.value)?s.filter(w=>w!==l.value):[...s,l.value];y(n),o(n)},e[7]=o,e[8]=s,e[9]=D):D=e[9];const c=D;let I;e[10]!==o?(I=()=>{y([]),o([])},e[10]=o,e[11]=I):I=e[11];const L=I;let z;e[12]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{_(Ne)},e[12]=z):z=e[12];const re=z;let A;e[13]!==L||e[14]!==o||e[15]!==a||e[16]!==s.length?(A=()=>{if(s.length===a.length)L();else{const l=a.map(Ce);y(l),o(l)}},e[13]=L,e[14]=o,e[15]=a,e[16]=s.length,e[17]=A):A=e[17];const i=A;let m;e[18]!==M?(m=ce("focus-ring aria-invalid:bg-destructive/10 aria-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] flex h-[var(--studio-control-height,2.25rem)] w-full max-w-xs items-center justify-between gap-2 rounded-[var(--studio-control-radius,var(--radius-lg))] bg-[var(--studio-input-background)] pr-3 pl-1.5 text-sm shadow-edge transition-[background-color,box-shadow] hover:bg-sidebar disabled:pointer-events-none disabled:text-subtle-foreground",M),e[18]=M,e[19]=m):m=e[19];let u;e[20]!==P||e[21]!==k||e[22]!==a||e[23]!==$||e[24]!==s?(u=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 n=a.find(Q=>Q.value===l),w=n?.icon;return t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card max-w-28",style:{animationDuration:`${P}s`},children:[w&&t.jsx(w,{className:"h-3 w-3 shrink-0"}),t.jsx("span",{className:"truncate",children:n?.label})]},l)}),s.length>k&&t.jsxs(le,{variant:"outline",size:"lg",className:"bg-card flex-shrink-0",style:{animationDuration:`${P}s`},children:["+",s.length-k]})]}),t.jsx("div",{className:"flex items-center shrink-0 ml-2",children:t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})})]}):t.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[t.jsx("span",{className:"text-subtle-foreground pl-1.5 text-sm",children:$}),t.jsx(ae,{className:"text-muted-foreground size-3.5 shrink-0"})]}),e[20]=P,e[21]=k,e[22]=a,e[23]=$,e[24]=s,e[25]=u):u=e[25];let f;e[26]!==Y||e[27]!==m||e[28]!==u?(f=t.jsx(xe,{asChild:!0,children:t.jsx("button",{type:"button",onClick:re,className:m,disabled:Y,children:u})}),e[26]=Y,e[27]=m,e[28]=u,e[29]=f):f=e[29];let R;e[30]===Symbol.for("react.memo_cache_sentinel")?(R=()=>_(!1),e[30]=R):R=e[30];const q=!S;let h;e[31]!==G||e[32]!==S?(h=t.jsx(de,{placeholder:"Search...",onKeyDown:G,onValueChange:S,className:"rounded-t-xl"}),e[31]=G,e[32]=S,e[33]=h):h=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(me,{children:"No results found."}),e[34]=T):T=e[34];let x;e[35]!==i?(x=()=>{i()},e[35]=i,e[36]=x):x=e[36];let p;e[37]!==i?(p=l=>{l.stopPropagation(),i()},e[37]=i,e[38]=p):p=e[38];const H=s.length===a.length&&a.length>0;let g;e[39]!==H||e[40]!==i?(g=t.jsx(ne,{checked:H,onCheckedChange:i,className:"mr-2 [&_svg]:!text-primary-foreground",onClick:be}),e[39]=H,e[40]=i,e[41]=g):g=e[41];let B;e[42]===Symbol.for("react.memo_cache_sentinel")?(B=t.jsx("span",{children:"(Select All)"}),e[42]=B):B=e[42];let v;e[43]!==p||e[44]!==g?(v=t.jsxs("div",{className:"flex items-center w-full",onClick:p,children:[g,B]}),e[43]=p,e[44]=g,e[45]=v):v=e[45];let j;e[46]!==x||e[47]!==v?(j=t.jsx(oe,{onSelect:x,className:"cursor-pointer",children:v},"all"),e[46]=x,e[47]=v,e[48]=j):j=e[48];let b;if(e[49]!==a||e[50]!==s||e[51]!==c){let l;e[53]!==s||e[54]!==c?(l=n=>{const w=s.includes(n.value);return t.jsx(oe,{onSelect:()=>{c(n)},className:"cursor-pointer",children:t.jsxs("div",{className:"flex items-center w-full",onClick:Q=>{Q.stopPropagation(),c(n)},children:[t.jsx(ne,{checked:w,onCheckedChange:()=>{c(n)},className:"mr-2 [&_svg]:!text-primary-foreground",onClick:je}),n.icon&&t.jsx(n.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:n.label})]})},n.value)},e[53]=s,e[54]=c,e[55]=l):l=e[55],b=a.map(l),e[49]=a,e[50]=s,e[51]=c,e[52]=b}else b=e[52];let C;e[56]!==j||e[57]!==b?(C=t.jsxs(ue,{className:"rounded-b-xl",children:[T,t.jsxs(fe,{children:[j,b]})]}),e[56]=j,e[57]=b,e[58]=C):C=e[58];let N;e[59]!==q||e[60]!==h||e[61]!==C?(N=t.jsx(pe,{className:"w-auto p-0 max-w-xs rounded-xl",align:"start",onEscapeKeyDown:R,children:t.jsxs(he,{shouldFilter:q,className:"rounded-xl",children:[h,C]})}),e[59]=q,e[60]=h,e[61]=C,e[62]=N):N=e[62];let K;return e[63]!==F||e[64]!==J||e[65]!==f||e[66]!==N?(K=t.jsxs(ge,{open:F,onOpenChange:_,modal:J,children:[f,N]}),e[63]=F,e[64]=J,e[65]=f,e[66]=N,e[67]=K):K=e[67],K}function je(r){return r.stopPropagation()}function be(r){return r.stopPropagation()}function Ce(r){return r.value}function Ne(r){return!r}export{Ve as M};
@@ -1,4 +1,4 @@
1
- import{q as H,b as W,e as z,K,c as V,j as m,r as J,D as $,v as G,w as L,x as Y,B as O,t as N}from"./index-BWpKrclg.js";import{u as X}from"./use-session-runtime-HJpkQoy0.js";import{o as Z,c as _,u as I,D as M,N as ee,P as te,R as re,al as se,W as ne,H as ae,F as oe,G as ie,a0 as ce,$ as ue,q as le,J as fe}from"./site-editor-toast-QHleRFN5.js";import{s as pe}from"./sandbox-git-api-DcqI6XE4.js";import{u as he}from"./chat-context-kqrW-XPR.js";import{F as de,H as ve}from"./blocks-tab-states-DhR3pyff.js";import{t as B,u as ye}from"./held-block-view-C3Ird9F-.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{d as we}from"./utils-BoR7m7ir.js";import{i as me}from"./CheckCircle-CfYD_Bi6.js";import{a as xe}from"./Copy01-Dy1KrWO0.js";import{MonacoCodeEditor as Ee}from"./monaco-editor-zzUPRyBn.js";function _e({orgSlug:s,virtualMcpId:e,branch:r}){const t=H(),a=he()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:c}=_(e),u=I(e,r),p=u.kind==="protocol"?u:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(c)return{ok:!0,existed:!0};if(o){const h=await ce({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return ue(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:pe({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=le(n,we(i)),l=await fetch(ge({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():fe(l,"Delete")},x=W(),C=z({mutationKey:ie(s,e,r),scope:oe(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(p?.source==="github"){const h=l?.();try{await de({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ve)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ne(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):ae({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:u,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...b}=E;return b}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),S=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(S(i),f),mutateAsync:(i,f)=>C.mutateAsync(S(i),f)}}function ke({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],c=o===void 0,u=c?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(u),[C,S]=J.useState(!1),i=!a||c,f=y!==u,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}S(!0);try{const w=await a(E);B(w)||N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{S(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(G,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(L,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(Y,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(me,{size:12}):m.jsx(xe,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),c?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(Ee,{code:u,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Ie(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ye(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=u=>n.mutateAsync({blockKey:t.pageKey,data:u}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let c;return e[7]!==t||e[8]!==o?(c=m.jsx(ke,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=c):c=e[9],c}var Ce=Object.prototype.toString,j=Array.isArray||function(e){return Ce.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Se(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Pe=RegExp.prototype.test;function je(s,e){return Pe.call(s,e)}var be=/\S/;function Te(s){return!je(be,s)}var Re={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Ke(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Re[r]})}var Je=/\s*/,Ne=/\s+/,Q=/\s*=/,Ue=/\s*\}/,qe=/#|\^|\/|>|\{|&|=|!/;function Oe(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,c=!1,u="",p=0;function d(){if(o&&!c)for(;n.length;)delete a[n.pop()];else n=[];o=!1,c=!1}var y,x,C;function S(D){if(typeof D=="string"&&(D=D.split(Ne,2)),!j(D)||D.length!==2)throw new Error("Invalid tags: "+D);y=new RegExp(U(D[0])+"\\s*"),x=new RegExp("\\s*"+U(D[1])),C=new RegExp("\\s*"+U("}"+D[1]))}S(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var b=0,F=h.length;b<F;++b)v=h.charAt(b),Te(v)?(n.push(a.length),u+=v):(c=!0,r=!0,u+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
1
+ import{q as H,b as W,e as z,K,c as V,j as m,r as J,D as $,v as G,w as L,x as Y,B as O,t as N}from"./index-WgfN4QVP.js";import{u as X}from"./use-session-runtime-BIoEtecA.js";import{o as Z,c as _,u as I,D as M,N as ee,P as te,R as re,al as se,W as ne,H as ae,F as oe,G as ie,a0 as ce,$ as ue,q as le,J as fe}from"./site-editor-toast-Bz-6LR6r.js";import{s as pe}from"./sandbox-git-api-DcqI6XE4.js";import{u as he}from"./chat-context-0CZgd-Gr.js";import{F as de,H as ve}from"./blocks-tab-states-Cs7bIWnm.js";import{t as B,u as ye}from"./held-block-view-C-gX7MJV.js";import{b as ge}from"./sandbox-url-D3mC8qhT.js";import{d as we}from"./utils-DdcTGJDK.js";import{i as me}from"./CheckCircle-D6xmTIXf.js";import{a as xe}from"./Copy01-DisW4JMo.js";import{MonacoCodeEditor as Ee}from"./monaco-editor-BDiq_2v4.js";function _e({orgSlug:s,virtualMcpId:e,branch:r}){const t=H(),a=he()?.taskId??null,n=Z(e),o=X(e).runtime==="cms",{url:c}=_(e),u=I(e,r),p=u.kind==="protocol"?u:null,d=M({orgSlug:s,virtualMcpId:e,branch:r}),y=async i=>{if(c)return{ok:!0,existed:!0};if(o){const h=await ce({orgSlug:s,virtualMcpId:e,branch:r},{delete:[i]});return ue(t,{orgSlug:s,virtualMcpId:e,branch:r},h),await t.invalidateQueries({queryKey:pe({orgSlug:s,virtualMcpId:e,branch:r,threadId:a})}),{ok:!0,existed:!0}}const f=le(n,we(i)),l=await fetch(ge({orgSlug:s,virtualMcpId:e,branch:r,threadId:a},"unlink"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:f})});return l.ok?l.json():fe(l,"Delete")},x=W(),C=z({mutationKey:ie(s,e,r),scope:oe(s,e,r),mutationFn:async({blockKey:i,base:f,shown:l})=>{if(p?.source==="github"){const h=l?.();try{await de({queryClient:t,backend:p,params:{orgSlug:s,virtualMcpId:e,branch:r},cacheKey:d},{writes:{},deletes:[i]},f&&f.value!==void 0?{[i]:f.value}:void 0,h&&h.value!==void 0?{[i]:h}:void 0)}catch(v){if(v instanceof ve)return{keptTheirs:!0,deleted:!1};throw v}return{ok:!0,existed:!0}}return p?(await ne(t,p,{orgSlug:s,virtualMcpId:e,branch:r},d,{delete:[i]}),{ok:!0,existed:!0}):ae({queryClient:t,orgSlug:s,virtualMcpId:e,branch:r,backend:u,cacheKey:d},{kind:"edit",write:()=>y(i)})},onMutate:async({blockKey:i})=>{const f=K.decofile(d);await t.cancelQueries({queryKey:f});const l=t.getQueryData(f),h=!!l&&i in l,v=l?.[i];return t.setQueryData(f,E=>{if(!E)return E;const{[i]:w,...b}=E;return b}),{queryKey:f,blockKey:i,hadKey:h,previousValue:v}},onError:(i,f,l)=>{te(x,i),l&&(p?.source==="github"&&(re(i)||i instanceof se)||t.setQueryData(l.queryKey,h=>l.hadKey?{...h??{},[l.blockKey]:l.previousValue}:h))},onSuccess:i=>{if(B(i)){ee(x,!1);return}t.invalidateQueries({queryKey:K.liveMeta(s,e,r)})}}),S=i=>{if(i.base)return i;const f=t.getQueryData(K.decofile(d));return f?{...i,base:{value:f[i.blockKey]}}:i};return{...C,mutate:(i,f)=>C.mutate(S(i),f),mutateAsync:(i,f)=>C.mutateAsync(S(i),f)}}function ke({open:s,onOpenChange:e,pageKey:r,decofile:t,onSave:a}){const n=W(),o=t[r],c=o===void 0,u=c?"":JSON.stringify(o,null,2),[p,d]=J.useState(!1),[y,x]=J.useState(u),[C,S]=J.useState(!1),i=!a||c,f=y!==u,l=()=>{navigator.clipboard.writeText(y).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)})},h=async v=>{if(!a||C)return;let E;try{E=JSON.parse(v)}catch{N.error(n("sectionsEditor.pageJsonDialog.invalidJsonError"));return}S(!0);try{const w=await a(E);B(w)||N.success(n("sectionsEditor.pageJsonDialog.saveSuccess")),e(!1)}catch(w){N.error(n("sectionsEditor.pageJsonDialog.saveError",{error:w instanceof Error?w.message:String(w)}))}finally{S(!1)}};return m.jsx($,{open:s,onOpenChange:e,children:m.jsxs(G,{className:"flex h-[85vh] w-[95vw] flex-col gap-0 overflow-hidden p-0 sm:max-w-6xl",children:[m.jsxs(L,{className:"shrink-0 px-4 py-3 border-b flex-row items-center justify-between space-y-0",children:[m.jsx(Y,{className:"text-sm font-semibold",children:n("sectionsEditor.pageJsonDialog.title")}),m.jsxs("div",{className:"flex items-center gap-2 mr-8",children:[m.jsxs(O,{variant:"ghost",size:"sm",onClick:l,className:"text-xs",children:[p?m.jsx(me,{size:12}):m.jsx(xe,{size:12}),n(p?"sectionsEditor.pageJsonDialog.copied":"sectionsEditor.pageJsonDialog.copy")]}),!i&&m.jsx(O,{size:"sm",onClick:()=>h(y),disabled:!f||C,className:"h-7 text-xs",children:n(C?"sectionsEditor.pageJsonDialog.saving":"sectionsEditor.pageJsonDialog.save")})]})]}),c?m.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",n("sectionsEditor.pageJsonDialog.pageNotFound")]}):m.jsx("div",{className:"min-h-0 flex-1 py-2",children:m.jsx(Ee,{code:u,language:"json",readOnly:i,height:"100%",onChange:v=>x(v??""),onSave:v=>{h(v)}})})]})})}function Ie(s){const e=V.c(10);let r,t;e[0]!==s?({params:r,...t}=s,e[0]=s,e[1]=r,e[2]=t):(r=e[1],t=e[2]);let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a={holdsCopy:!0},e[3]=a):a=e[3];const n=ye(r,a);let o;e[4]!==t.pageKey||e[5]!==n?(o=u=>n.mutateAsync({blockKey:t.pageKey,data:u}),e[4]=t.pageKey,e[5]=n,e[6]=o):o=e[6];let c;return e[7]!==t||e[8]!==o?(c=m.jsx(ke,{...t,onSave:o}),e[7]=t,e[8]=o,e[9]=c):c=e[9],c}var Ce=Object.prototype.toString,j=Array.isArray||function(e){return Ce.call(e)==="[object Array]"};function q(s){return typeof s=="function"}function De(s){return j(s)?"array":typeof s}function U(s){return s.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function A(s,e){return s!=null&&typeof s=="object"&&e in s}function Se(s,e){return s!=null&&typeof s!="object"&&s.hasOwnProperty&&s.hasOwnProperty(e)}var Pe=RegExp.prototype.test;function je(s,e){return Pe.call(s,e)}var be=/\S/;function Te(s){return!je(be,s)}var Re={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};function Ke(s){return String(s).replace(/[&<>"'`=\/]/g,function(r){return Re[r]})}var Je=/\s*/,Ne=/\s+/,Q=/\s*=/,Ue=/\s*\}/,qe=/#|\^|\/|>|\{|&|=|!/;function Oe(s,e){if(!s)return[];var r=!1,t=[],a=[],n=[],o=!1,c=!1,u="",p=0;function d(){if(o&&!c)for(;n.length;)delete a[n.pop()];else n=[];o=!1,c=!1}var y,x,C;function S(D){if(typeof D=="string"&&(D=D.split(Ne,2)),!j(D)||D.length!==2)throw new Error("Invalid tags: "+D);y=new RegExp(U(D[0])+"\\s*"),x=new RegExp("\\s*"+U(D[1])),C=new RegExp("\\s*"+U("}"+D[1]))}S(e||k.tags);for(var i=new R(s),f,l,h,v,E,w;!i.eos();){if(f=i.pos,h=i.scanUntil(y),h)for(var b=0,F=h.length;b<F;++b)v=h.charAt(b),Te(v)?(n.push(a.length),u+=v):(c=!0,r=!0,u+=" "),a.push(["text",v,f,f+1]),f+=1,v===`
2
2
  `&&(d(),u="",p=0,r=!1);if(!i.scan(y))break;if(o=!0,l=i.scan(qe)||"name",i.scan(Je),l==="="?(h=i.scanUntil(Q),i.scan(Q),i.scanUntil(x)):l==="{"?(h=i.scanUntil(C),i.scan(Ue),i.scanUntil(x),l="&"):h=i.scanUntil(x),!i.scan(x))throw new Error("Unclosed tag at "+i.pos);if(l==">"?E=[l,h,f,i.pos,u,p,r]:E=[l,h,f,i.pos],p++,a.push(E),l==="#"||l==="^")t.push(E);else if(l==="/"){if(w=t.pop(),!w)throw new Error('Unopened section "'+h+'" at '+f);if(w[1]!==h)throw new Error('Unclosed section "'+w[1]+'" at '+f)}else l==="name"||l==="{"||l==="&"?c=!0:l==="="&&S(h)}if(d(),w=t.pop(),w)throw new Error('Unclosed section "'+w[1]+'" at '+i.pos);return Qe(Ae(a))}function Ae(s){for(var e=[],r,t,a=0,n=s.length;a<n;++a)r=s[a],r&&(r[0]==="text"&&t&&t[0]==="text"?(t[1]+=r[1],t[3]=r[3]):(e.push(r),t=r));return e}function Qe(s){for(var e=[],r=e,t=[],a,n,o=0,c=s.length;o<c;++o)switch(a=s[o],a[0]){case"#":case"^":r.push(a),t.push(a),r=a[4]=[];break;case"/":n=t.pop(),n[5]=a[2],r=t.length>0?t[t.length-1][4]:e;break;default:r.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 r=this.tail.match(e);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};R.prototype.scanUntil=function(e){var r=this.tail.search(e),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function P(s,e){this.view=s,this.cache={".":this.view},this.parent=e}P.prototype.push=function(e){return new P(e,this)};P.prototype.lookup=function(e){var r=this.cache,t;if(r.hasOwnProperty(e))t=r[e];else{for(var a=this,n,o,c,u=!1;a;){if(e.indexOf(".")>0)for(n=a.view,o=e.split("."),c=0;n!=null&&c<o.length;)c===o.length-1&&(u=A(n,o[c])||Se(n,o[c])),n=n[o[c++]];else n=a.view[e],u=A(a.view,e);if(u){t=n;break}a=a.parent}r[e]=t}return q(t)&&(t=t.call(this.view)),t};function g(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}g.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};g.prototype.parse=function(e,r){var t=this.templateCache,a=e+":"+(r||k.tags).join(":"),n=typeof t<"u",o=n?t.get(a):void 0;return o==null&&(o=Oe(e,r),n&&t.set(a,o)),o};g.prototype.render=function(e,r,t,a){var n=this.getConfigTags(a),o=this.parse(e,n),c=r instanceof P?r:new P(r,void 0);return this.renderTokens(o,c,t,e,a)};g.prototype.renderTokens=function(e,r,t,a,n){for(var o="",c,u,p,d=0,y=e.length;d<y;++d)p=void 0,c=e[d],u=c[0],u==="#"?p=this.renderSection(c,r,t,a,n):u==="^"?p=this.renderInverted(c,r,t,a,n):u===">"?p=this.renderPartial(c,r,t,n):u==="&"?p=this.unescapedValue(c,r):u==="name"?p=this.escapedValue(c,r,n):u==="text"&&(p=this.rawValue(c)),p!==void 0&&(o+=p);return o};g.prototype.renderSection=function(e,r,t,a,n){var o=this,c="",u=r.lookup(e[1]);function p(x){return o.render(x,r,t,n)}if(u){if(j(u))for(var d=0,y=u.length;d<y;++d)c+=this.renderTokens(e[4],r.push(u[d]),t,a,n);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")c+=this.renderTokens(e[4],r.push(u),t,a,n);else if(q(u)){if(typeof a!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(r.view,a.slice(e[3],e[5]),p),u!=null&&(c+=u)}else c+=this.renderTokens(e[4],r,t,a,n);return c}};g.prototype.renderInverted=function(e,r,t,a,n){var o=r.lookup(e[1]);if(!o||j(o)&&o.length===0)return this.renderTokens(e[4],r,t,a,n)};g.prototype.indentPartial=function(e,r,t){for(var a=r.replace(/[^ \t]/g,""),n=e.split(`
3
3
  `),o=0;o<n.length;o++)n[o].length&&(o>0||!t)&&(n[o]=a+n[o]);return n.join(`
4
4
  `)};g.prototype.renderPartial=function(e,r,t,a){if(t){var n=this.getConfigTags(a),o=q(t)?t(e[1]):t[e[1]];if(o!=null){var c=e[6],u=e[5],p=e[4],d=o;u==0&&p&&(d=this.indentPartial(o,p,c));var y=this.parse(d,n);return this.renderTokens(y,r,t,d,a)}}};g.prototype.unescapedValue=function(e,r){var t=r.lookup(e[1]);if(t!=null)return t};g.prototype.escapedValue=function(e,r,t){var a=this.getConfigEscape(t)||k.escape,n=r.lookup(e[1]);if(n!=null)return typeof n=="number"&&a===k.escape?String(n):a(n)};g.prototype.rawValue=function(e){return e[1]};g.prototype.getConfigTags=function(e){return j(e)?e:e&&typeof e=="object"?e.tags:void 0};g.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!j(e))return e.escape};var k={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){T.templateCache=s},get templateCache(){return T.templateCache}},T=new g;k.clearCache=function(){return T.clearCache()};k.parse=function(e,r){return T.parse(e,r)};k.render=function(e,r,t,a){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+De(e)+'" was given as the first argument for mustache#render(template, view, partials)');return T.render(e,r,t,a)};k.escape=Ke;k.Scanner=R;k.Context=P;k.Writer=g;export{ke as P,Ie as S,k as m,_e as u};
@@ -1 +1 @@
1
- import{ap as h,aq as B,ar as R,ai as E,am as V,g as C,p as O,ab as x,w as A,N as P,d as j}from"./parse-sections-BVn3AvAz.js";function W(e,n){const t=n.pages===1?e("sectionsEditor.namedRuleUses.countPageOne"):n.pages>1?e("sectionsEditor.namedRuleUses.countPages",{count:String(n.pages)}):null,o=n.sections===1?e("sectionsEditor.namedRuleUses.countSectionOne"):n.sections>1?e("sectionsEditor.namedRuleUses.countSections",{count:String(n.sections)}):null,s=t&&o?e("sectionsEditor.namedRuleUses.countBoth",{pages:t,sections:o}):t??o;return s?{places:s,one:n.pages+n.sections===1}:null}const v=()=>({weak:new WeakMap,strong:new Map,has:!1}),k=new Map;function d(e,n,t){let o=k.get(e)??v();k.set(e,o);for(const s of n){const i=typeof s=="object"&&s!==null||typeof s=="function";let a=i?o.weak.get(s):o.strong.get(s);a||(a=v(),i?o.weak.set(s,a):o.strong.set(s,a)),o=a}return o.has||(o.value=t(),o.has=!0),o.value}function D(e){return d("uses",[e.decofile,e.meta,e.changeCount,e.sides],()=>L(e))}function L(e){const n=h(e.decofile,e.meta),t=e.changeCount===0?e.decofile:e.sides?B(e.decofile,e.sides):null;if(t===null)return{refs:R(n,n),published:null};const o=t===e.decofile?n:h(t,e.meta);return{refs:R(n,o),published:t}}const F=e=>e.length===0||e.length===1&&e[0]==="section";function _(e){const n=e[0]==="section"?e.slice(1):e;return n[0]==="variants"&&typeof n[1]=="number"?n[1]:void 0}function w(e,n){return n&&F(e)?n.index:_(e)}function z(e,n,t){if(e==="section"){const f=w(t?.containerPath??n,t);return f===void 0?{}:{variant:f}}const o=t?.containerPath??n;if(o[0]!=="sections")return{};if(t&&o.length===1)return{pageVariant:t.index};let s=o.slice(1),i;s[0]==="variants"&&typeof s[1]=="number"&&(i=s[1],s=s.slice(2),s[0]==="value"&&(s=s.slice(1)),s[0]==="value"&&(s=s.slice(1)));const a=i===void 0?{}:{pageVariant:i},[c,...u]=s;if(typeof c!="number")return a;a.section=c;const r=w(u,t);return r!==void 0&&(a.variant=r),a}function I(e,n,t,o,s){const i=r=>U(r,e,o,s),a=[],c=new Set,u=r=>{const f=y(r);c.has(f)||(c.add(f),a.push(r))};if(t===null){for(const r of e.refs[n].wholeBlock)u({blockKey:r.blockKey,...i(r.blockKey),wholeBlock:!0,state:r.state});return g(a)}for(const r of e.refs[n].byName.get(t)??[]){if(r.savedRule)continue;const f=i(r.blockKey),l=z(f.blockKind,r.path,r.variant),b=f.blockKind==="page"?q(r.blockKey,l,r.state,e,o):void 0;u({blockKey:r.blockKey,...f,...r.variant?{variant:r.variant.index+1}:{},...b?{section:b}:{},focus:l,wholeBlock:!1,state:r.state})}return g(a)}function y(e){const n=e.focus??{};return[e.blockKey,n.pageVariant??"",n.section??"",e.variant??"",e.wholeBlock].join("#")}function q(e,n,t,o,s){if(n.section===void 0)return;const i=t!=="removed-in-draft"&&e in s?s:o.published??s,a=C(i,e,n.pageVariant??0),c=O(a,i,!0)[n.section];return c?c.variantOf??c.label:void 0}function U(e,n,t,o){const s=t[e]??(n.published?n.published[e]:void 0),i=x(e,s,o);if(i)return{blockKind:"page",title:i.name,path:i.path};const a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{blockKind:"section",title:A(H(e),a)}}function g(e){const n=t=>t.state==="removed-in-draft"?1:0;return e.sort((t,o)=>n(t)-n(o)||t.title.localeCompare(o.title)||(t.focus?.pageVariant??0)-(o.focus?.pageVariant??0)||(t.focus?.section??0)-(o.focus?.section??0)||(t.variant??0)-(o.variant??0))}function m(e,n,t){return d("missing",[e,t,n],()=>{const o=E(t,n);if(o.kind==="conflict")return[];const s=[];for(const[i,a]of e.refs[n].byName)V(o,i)||a.some(c=>c.state!=="removed-in-draft")&&s.push(i);return s})}function G(e,n,t,o){return K(e,n,t,o).rows}function J(e,n,t,o){return K(e,n,t,o).names}function K(e,n,t,o){return d("missingRows",[e,t,o,n],()=>{const s=[],i=new Set;let a=0;for(const c of m(e,n,t)){let u=!1;for(const r of I(e,n,c,t,o)){if(r.state==="removed-in-draft")continue;u=!0;const f=y(r);i.has(f)||(i.add(f),s.push(r))}u&&a++}return{rows:g(s),names:a}})}function N(e){return P.filter(n=>j(e,n)==="available")}function p(e,n){return D({decofile:e,meta:n,changeCount:0,sides:void 0})}function Q(e,n){return d("blocksUsingMissing",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o)for(const a of m(s,i,e))for(const c of s.refs[i].byName.get(a)??[]){const u=t.get(c.blockKey)??[];u.includes(i)||u.push(i),t.set(c.blockKey,u)}return t})}function X(e,n){return d("missingUseCounts",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o){const a=new Set;let c=0;for(const r of m(s,i,e)){let f=!1;for(const l of s.refs[i].byName.get(r)??[])l.savedRule||(a.add(l.blockKey),f=!0);f&&c++}const u=M(a,s,e,n);u.pages+u.sections>0&&t.set(i,{...u,names:c})}return t})}function Y(e,n,t){return S(e,n,t).size}function Z(e,n,t,o){const s=p(e,n);return M(S(s,t,o),s,e,n)}function S(e,n,t){const o=new Set;for(const s of e.refs[n].byName.get(t)??[])s.savedRule||s.state==="removed-in-draft"||o.add(s.blockKey);return o}function M(e,n,t,o){const s={pages:0,sections:0};for(const i of e)U(i,n,t,o).blockKind==="page"?s.pages++:s.sections++;return s}function H(e){try{return decodeURIComponent(e)}catch{return e}}export{y as a,Q as b,Z as c,D as d,G as e,J as f,I as g,Y as h,X as m,W as n};
1
+ import{aq as h,ar as B,as as R,aj as E,an as V,g as C,p as O,ac as x,x as A,N as j,d as P}from"./parse-sections-CNEwf5xY.js";function W(e,n){const t=n.pages===1?e("sectionsEditor.namedRuleUses.countPageOne"):n.pages>1?e("sectionsEditor.namedRuleUses.countPages",{count:String(n.pages)}):null,o=n.sections===1?e("sectionsEditor.namedRuleUses.countSectionOne"):n.sections>1?e("sectionsEditor.namedRuleUses.countSections",{count:String(n.sections)}):null,s=t&&o?e("sectionsEditor.namedRuleUses.countBoth",{pages:t,sections:o}):t??o;return s?{places:s,one:n.pages+n.sections===1}:null}const v=()=>({weak:new WeakMap,strong:new Map,has:!1}),k=new Map;function d(e,n,t){let o=k.get(e)??v();k.set(e,o);for(const s of n){const i=typeof s=="object"&&s!==null||typeof s=="function";let a=i?o.weak.get(s):o.strong.get(s);a||(a=v(),i?o.weak.set(s,a):o.strong.set(s,a)),o=a}return o.has||(o.value=t(),o.has=!0),o.value}function D(e){return d("uses",[e.decofile,e.meta,e.changeCount,e.sides],()=>L(e))}function L(e){const n=h(e.decofile,e.meta),t=e.changeCount===0?e.decofile:e.sides?B(e.decofile,e.sides):null;if(t===null)return{refs:R(n,n),published:null};const o=t===e.decofile?n:h(t,e.meta);return{refs:R(n,o),published:t}}const F=e=>e.length===0||e.length===1&&e[0]==="section";function _(e){const n=e[0]==="section"?e.slice(1):e;return n[0]==="variants"&&typeof n[1]=="number"?n[1]:void 0}function y(e,n){return n&&F(e)?n.index:_(e)}function z(e,n,t){if(e==="section"){const f=y(t?.containerPath??n,t);return f===void 0?{}:{variant:f}}const o=t?.containerPath??n;if(o[0]!=="sections")return{};if(t&&o.length===1)return{pageVariant:t.index};let s=o.slice(1),i;s[0]==="variants"&&typeof s[1]=="number"&&(i=s[1],s=s.slice(2),s[0]==="value"&&(s=s.slice(1)),s[0]==="value"&&(s=s.slice(1)));const a=i===void 0?{}:{pageVariant:i},[c,...u]=s;if(typeof c!="number")return a;a.section=c;const r=y(u,t);return r!==void 0&&(a.variant=r),a}function I(e,n,t,o,s){const i=r=>U(r,e,o,s),a=[],c=new Set,u=r=>{const f=w(r);c.has(f)||(c.add(f),a.push(r))};if(t===null){for(const r of e.refs[n].wholeBlock)u({blockKey:r.blockKey,...i(r.blockKey),wholeBlock:!0,state:r.state});return g(a)}for(const r of e.refs[n].byName.get(t)??[]){if(r.savedRule)continue;const f=i(r.blockKey),l=z(f.blockKind,r.path,r.variant),b=f.blockKind==="page"?q(r.blockKey,l,r.state,e,o):void 0;u({blockKey:r.blockKey,...f,...r.variant?{variant:r.variant.index+1}:{},...b?{section:b}:{},focus:l,wholeBlock:!1,state:r.state})}return g(a)}function w(e){const n=e.focus??{};return[e.blockKey,n.pageVariant??"",n.section??"",e.variant??"",e.wholeBlock].join("#")}function q(e,n,t,o,s){if(n.section===void 0)return;const i=t!=="removed-in-draft"&&e in s?s:o.published??s,a=C(i,e,n.pageVariant??0),c=O(a,i,!0)[n.section];return c?c.variantOf??c.label:void 0}function U(e,n,t,o){const s=t[e]??(n.published?n.published[e]:void 0),i=x(e,s,o);if(i)return{blockKind:"page",title:i.name,path:i.path};const a=s&&typeof s=="object"&&!Array.isArray(s)?s:{};return{blockKind:"section",title:A(H(e),a)}}function g(e){const n=t=>t.state==="removed-in-draft"?1:0;return e.sort((t,o)=>n(t)-n(o)||t.title.localeCompare(o.title)||(t.focus?.pageVariant??0)-(o.focus?.pageVariant??0)||(t.focus?.section??0)-(o.focus?.section??0)||(t.variant??0)-(o.variant??0))}function m(e,n,t){return d("missing",[e,t,n],()=>{const o=E(t,n);if(o.kind==="conflict")return[];const s=[];for(const[i,a]of e.refs[n].byName)V(o,i)||a.some(c=>c.state!=="removed-in-draft")&&s.push(i);return s})}function G(e,n,t,o){return K(e,n,t,o).rows}function J(e,n,t,o){return K(e,n,t,o).names}function K(e,n,t,o){return d("missingRows",[e,t,o,n],()=>{const s=[],i=new Set;let a=0;for(const c of m(e,n,t)){let u=!1;for(const r of I(e,n,c,t,o)){if(r.state==="removed-in-draft")continue;u=!0;const f=w(r);i.has(f)||(i.add(f),s.push(r))}u&&a++}return{rows:g(s),names:a}})}function N(e){return j.filter(n=>P(e,n)==="available")}function p(e,n){return D({decofile:e,meta:n,changeCount:0,sides:void 0})}function Q(e,n){return d("blocksUsingMissing",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o)for(const a of m(s,i,e))for(const c of s.refs[i].byName.get(a)??[]){const u=t.get(c.blockKey)??[];u.includes(i)||u.push(i),t.set(c.blockKey,u)}return t})}function X(e,n){return d("missingUseCounts",[e,n],()=>{const t=new Map,o=N(n);if(o.length===0)return t;const s=p(e,n);for(const i of o){const a=new Set;let c=0;for(const r of m(s,i,e)){let f=!1;for(const l of s.refs[i].byName.get(r)??[])l.savedRule||(a.add(l.blockKey),f=!0);f&&c++}const u=M(a,s,e,n);u.pages+u.sections>0&&t.set(i,{...u,names:c})}return t})}function Y(e,n,t){return S(e,n,t).size}function Z(e,n,t,o){const s=p(e,n);return M(S(s,t,o),s,e,n)}function S(e,n,t){const o=new Set;for(const s of e.refs[n].byName.get(t)??[])s.savedRule||s.state==="removed-in-draft"||o.add(s.blockKey);return o}function M(e,n,t,o){const s={pages:0,sections:0};for(const i of e)U(i,n,t,o).blockKind==="page"?s.pages++:s.sections++;return s}function H(e){try{return decodeURIComponent(e)}catch{return e}}export{w as a,Q as b,Z as c,D as d,G as e,J as f,I as g,Y as h,X as m,W as n};
@@ -1 +1 @@
1
- import{c as y,j as t,r as w,C as _,b as S,B as N,D as M,v as K,w as A,x as R,aY as E,I as T,l as V,t as $}from"./index-BWpKrclg.js";import{i as B}from"./ArrowLeft-XO66B9Td.js";import{s as F}from"./Plus-Ccck99Do.js";import{L as H}from"./label-DzRNwB_s.js";import{R as L}from"./repository-import-picker-DxJJpcCz.js";import{u as O}from"./use-navigate-to-agent-DqWY18b4.js";import{S as z}from"./thread-intent-DjvP3GsU.js";import{d as Z}from"./repository-binding-Bpq6heaQ.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 I(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,x,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}),i=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),x=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]=i,e[5]=x,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],x=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,x,h]}),e[7]=n,e[8]=d):d=e[8],d}function q(a){const e=y.c(4),{className:n}=a;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 ie(a){const e=y.c(5),{className:n}=a;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 v=new z(!1);let k="unknown",P=null;function U(a,e){k=a,P=e?.onCreated??null,_("project_create_clicked",{source:a}),v.set(!0)}function le(){const a=y.c(2),e=w.useSyncExternalStore(v.subscribe,v.get);let n;return a[0]!==e?(n=[e,v.set],a[0]=e,a[1]=n):n=a[1],n}function C(a){const e=P;P=null,e?.(a)}function pe(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:I,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:q,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},Y=["repository","folder"];function G(a){const e=y.c(25),{path:n,onSelect:r}=a,o=S(),s=W[n],c=s.art;let i;e[0]!==s.art_||e[1]!==s.plate?(i=V("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]=i):i=e[2];let x;e[3]!==c?(x=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=x):x=e[4];let h;e[5]!==i||e[6]!==x?(h=t.jsx("span",{className:i,children:x}),e[5]=i,e[6]=x,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 u;e[11]!==d?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=u):u=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]!==u||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[u,j]}),e[18]=u,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 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent 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 J(a){const e=y.c(8),{label:n,children:r,hint:o}=a;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 i;return e[4]!==r||e[5]!==s||e[6]!==c?(i=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]=i):i=e[7],i}function he({open:a,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,i]=w.useState(null),[x,h]=w.useState(""),[d,u]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),u(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=x.trim();if(!p){u(r("projects.new.nameRequired"));return}try{const b=(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(),b&&(C(b),s(b)),$.success(r("projects.new.created",{title:p}))}catch{u(r("projects.new.failed"))}};return t.jsx(M,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(K,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(A,{children:[t.jsx(R,{children:r("projects.new.title")}),t.jsx(E,{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:Y.map(p=>t.jsx(G,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),i(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(),u(null),g()},children:[t.jsx(J,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:x,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(B,{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 de(a){const e=y.c(11),{source:n,variant:r,size:o,label:s}=a,c=r===void 0?"default":r,i=o===void 0?"sm":o,x=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(F,{size:14}),e[2]=d):d=e[2];let u;e[3]!==s||e[4]!==x?(u=s??x("projects.home.newProject"),e[3]=s,e[4]=x,e[5]=u):u=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==u||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,u]}),e[6]=i,e[7]=h,e[8]=u,e[9]=c,e[10]=f):f=e[10],f}export{ie as E,de as N,he as a,pe as n,U as o,le as u};
1
+ import{c as y,j as t,r as w,C as _,b as S,B as N,D as M,v as K,w as A,x as R,aY as E,I as T,l as V,t as $}from"./index-WgfN4QVP.js";import{i as B}from"./ArrowLeft-Par1IdOs.js";import{s as F}from"./Plus-BaWg3Fda.js";import{L as H}from"./label-Dxzmqh4L.js";import{R as L}from"./repository-import-picker-bneKFCuv.js";import{u as O}from"./use-navigate-to-agent-Mx6A78it.js";import{S as z}from"./thread-intent-DSKhfvxP.js";import{d as Z}from"./repository-binding-DF6YCWsj.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 I(a){const e=y.c(9),{className:n}=a;let r,o,s,c,i,x,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}),i=t.jsx("circle",{cx:"42",cy:"46",r:"4",...l,opacity:.7}),x=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]=i,e[5]=x,e[6]=h):(r=e[0],o=e[1],s=e[2],c=e[3],i=e[4],x=e[5],h=e[6]);let d;return e[7]!==n?(d=t.jsxs("svg",{...D,className:n,children:[r,o,s,c,i,x,h]}),e[7]=n,e[8]=d):d=e[8],d}function q(a){const e=y.c(4),{className:n}=a;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 ie(a){const e=y.c(5),{className:n}=a;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 v=new z(!1);let k="unknown",P=null;function U(a,e){k=a,P=e?.onCreated??null,_("project_create_clicked",{source:a}),v.set(!0)}function le(){const a=y.c(2),e=w.useSyncExternalStore(v.subscribe,v.get);let n;return a[0]!==e?(n=[e,v.set],a[0]=e,a[1]=n):n=a[1],n}function C(a){const e=P;P=null,e?.(a)}function pe(){return k}const W={repository:{titleKey:"projects.new.path.repository",hintKey:"projects.new.path.repository.hint",art:I,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:q,plate:"bg-chart-1/10 group-hover:bg-chart-1/16",art_:"text-chart-1"}},Y=["repository","folder"];function G(a){const e=y.c(25),{path:n,onSelect:r}=a,o=S(),s=W[n],c=s.art;let i;e[0]!==s.art_||e[1]!==s.plate?(i=V("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]=i):i=e[2];let x;e[3]!==c?(x=t.jsx(c,{className:"h-20"}),e[3]=c,e[4]=x):x=e[4];let h;e[5]!==i||e[6]!==x?(h=t.jsx("span",{className:i,children:x}),e[5]=i,e[6]=x,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 u;e[11]!==d?(u=t.jsx("span",{className:"text-sm font-medium text-foreground",children:d}),e[11]=d,e[12]=u):u=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]!==u||e[19]!==j?(m=t.jsxs("span",{className:"flex flex-col gap-0.5 px-1 pb-1",children:[u,j]}),e[18]=u,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 surface p-3 text-left focus-ring transition-[transform,background-color] duration-200 hover:-translate-y-0.5 hover:bg-accent 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 J(a){const e=y.c(8),{label:n,children:r,hint:o}=a;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 i;return e[4]!==r||e[5]!==s||e[6]!==c?(i=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]=i):i=e[7],i}function he({open:a,onOpenChange:e,source:n="org_home"}){const r=S(),o=Z(),s=O(),[c,i]=w.useState(null),[x,h]=w.useState(""),[d,u]=w.useState(null),f=w.useRef(null),j=()=>{i(null),h(""),u(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=x.trim();if(!p){u(r("projects.new.nameRequired"));return}try{const b=(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(),b&&(C(b),s(b)),$.success(r("projects.new.created",{title:p}))}catch{u(r("projects.new.failed"))}};return t.jsx(M,{open:a,onOpenChange:p=>{p?e(!0):m()},children:t.jsxs(K,{className:"sm:max-w-3xl",ref:f,onOpenAutoFocus:p=>{p.preventDefault(),f.current?.focus()},children:[t.jsxs(A,{children:[t.jsx(R,{children:r("projects.new.title")}),t.jsx(E,{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:Y.map(p=>t.jsx(G,{path:p,onSelect:()=>{_("project_create_path_selected",{source:n,path:p}),i(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(),u(null),g()},children:[t.jsx(J,{label:r("projects.new.nameLabel"),children:t.jsx(T,{autoFocus:!0,value:x,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(B,{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 de(a){const e=y.c(11),{source:n,variant:r,size:o,label:s}=a,c=r===void 0?"default":r,i=o===void 0?"sm":o,x=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(F,{size:14}),e[2]=d):d=e[2];let u;e[3]!==s||e[4]!==x?(u=s??x("projects.home.newProject"),e[3]=s,e[4]=x,e[5]=u):u=e[5];let f;return e[6]!==i||e[7]!==h||e[8]!==u||e[9]!==c?(f=t.jsxs(N,{size:i,variant:c,onClick:h,children:[d,u]}),e[6]=i,e[7]=h,e[8]=u,e[9]=c,e[10]=f):f=e[10],f}export{ie as E,de as N,he as a,pe as n,U as o,le as u};
@@ -1 +1 @@
1
- import{b as o,r as c,j as e,h as n}from"./index-BWpKrclg.js";import{h as u}from"./mcp-oauth-DWlxkjKx.js";import"./auth-CK6AyRu5.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-WgfN4QVP.js";import{h as u}from"./mcp-oauth-Due6wImr.js";import"./auth-BZPkjT4-.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-BWpKrclg.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-WgfN4QVP.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,o as ve,z as ze,I as Le,l as ae,t as he}from"./index-BWpKrclg.js";import{R as _e}from"./required-auth-layout-DYZU5vk_.js";import{A as oe}from"./auth-split-layout-BGf8-EnP.js";import{O as Ee}from"./organization-choice-Bs2Llr3r.js";import{L as Ae}from"./label-DzRNwB_s.js";import{S as De}from"./switch-Bv0wLEBx.js";import{t as Pe}from"./Building02-NRzC_IEp.js";import{i as Re}from"./CheckCircle-CfYD_Bi6.js";import{t as Fe}from"./Globe04-BxFc3HLH.js";import{i as Me}from"./Upload01-D_q00M49.js";import"./Plus-Ccck99Do.js";const $e=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 it(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",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]=o,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 l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){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(oe,{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 o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,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 r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=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]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{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:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=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]=r):r=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]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,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]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,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(oe,{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]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(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 Be(){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:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[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 r=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(oe,{children:t.jsx(Ge,{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=r.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||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,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]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,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]!==s?(q=s("routes.onboarding.optional"),e[39]=s,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]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,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(Je,{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]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,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 le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,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(Le,{id:"org-name",value:c,onChange:le,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]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&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:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface 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]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,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 se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=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]=l):l=e[2];const s=l;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]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,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(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,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]=o,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}],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 Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}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:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.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})]},s.labelKey)})})]})}export{it 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,o as ve,z as ze,I as Le,l as ae,t as he}from"./index-WgfN4QVP.js";import{R as _e}from"./required-auth-layout-BLLWaY3S.js";import{A as oe}from"./auth-split-layout-BlKheOJZ.js";import{O as Ee}from"./organization-choice-C88DHbpi.js";import{L as Ae}from"./label-Dxzmqh4L.js";import{S as De}from"./switch-nJxNuRWR.js";import{t as Pe}from"./Building02-BV_I3UuJ.js";import{i as Re}from"./CheckCircle-D6xmTIXf.js";import{t as Fe}from"./Globe04-DK5qhUMj.js";import{i as Me}from"./Upload01-BP49pNql.js";import"./Plus-BaWg3Fda.js";const $e=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 it(){const i=ie.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(_e,{children:t.jsx(Te,{})}),i[0]=e):e=i[0],e}function fe(i){const e=ie.c(13),{title:b,description:m,logoUrl:n,logoFallback:o}=i;let a;e[0]!==o||e[1]!==n?(a=t.jsx("div",{children:n?t.jsx(ve,{url:n,fallback:o??"?",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]=o,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 l;e[5]!==m?(l=t.jsx("p",{className:"text-base text-muted-foreground leading-6",children:m}),e[5]=m,e[6]=l):l=e[6];let s;e[7]!==f||e[8]!==l?(s=t.jsxs("div",{className:"space-y-2",children:[f,l]}),e[7]=f,e[8]=l,e[9]=s):s=e[9];let j;return e[10]!==a||e[11]!==s?(j=t.jsxs("div",{className:"grid gap-10",children:[a,s]}),e[10]=a,e[11]=s,e[12]=j):j=e[12],j}function Te(){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(oe,{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 o;return i[1]!==n||i[2]!==m?(o=t.jsx(qe,{email:m,userName:n}),i[1]=n,i[2]=m,i[3]=o):o=i[3],o}function qe(i){const e=ie.c(59),{email:b,userName:m}=i,n=de(),o=b.split("@")[1]?.toLowerCase()??"",a=!!o&&!$e.has(o),f=o.split(".")[0]??"",l=f.charAt(0).toUpperCase()+f.slice(1);let s;e[0]!==l||e[1]!==a||e[2]!==m?(s=a?l:m?.split(" ")[0]??"",e[0]=l,e[1]=a,e[2]=m,e[3]=s):s=e[3];const j=s,{data:c,isLoading:v,isError:u,refetch:w}=Ce({queryKey:Oe.domainLookup(o),queryFn:Be,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 r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(ce,{className:"size-3.5 text-muted-foreground"}),e[5]=r):r=e[5],t.jsx(oe,{children:t.jsxs("div",{className:"flex items-center gap-2 py-4",children:[r,t.jsx("span",{className:"text-sm text-muted-foreground",children:n("routes.onboarding.checking",{domain:o})})]})})}if(u){let r;e[6]!==w?(r=()=>w(),e[6]=w,e[7]=r):r=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]!==r||e[11]!==d?(h=t.jsx(Ne,{variant:"outline",size:"sm",onClick:r,children:d}),e[10]=r,e[11]=d,e[12]=h):h=e[12],t.jsx(oe,{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:o})}),h]})})}let N,A;e[13]!==c?.organizations?(N=(c?.organizations??[]).flatMap(Ke),A=N.some(Ie),e[13]=c?.organizations,e[14]=N,e[15]=A):(N=e[14],A=e[15]);const p=A;if($){let r;e[16]!==m?(r=m?.split(" ")[0]??"",e[16]=m,e[17]=r):r=e[17];let d;e[18]!==y?(d=()=>y(!1),e[18]=y,e[19]=d):d=e[19];let h;return e[20]!==l||e[21]!==o||e[22]!==a||e[23]!==r||e[24]!==d?(h=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:r,allowDomainClaim:!1,onBack:d}),e[20]=l,e[21]=o,e[22]=a,e[23]=r,e[24]=d,e[25]=h):h=e[25],h}if(N.length>0){let r;e[26]!==p||e[27]!==N.length||e[28]!==n?(r=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]=r):r=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]!==r||e[34]!==d?(h=t.jsx(fe,{title:r,description:d}),e[33]=r,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]!==o||e[40]!==_||e[41]!==O?(C=t.jsx(Ee,{organizations:N,domain:o,requestedSlugs:_,onRequestedSlug:O,onJoined:Ue}),e[38]=N,e[39]=o,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(oe,{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]!==l||e[56]!==o||e[57]!==a?(D=t.jsx(be,{isCorporateEmail:a,emailDomain:o,domainLabel:l,defaultName:j}),e[54]=j,e[55]=l,e[56]=o,e[57]=a,e[58]=D):D=e[58],D}function Ue(i,e){window.location.href=`/${e}`}function Ie(i){return i.joinMode==="auto"}function Ke(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 Be(){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:o,allowDomainClaim:a,onBack:f}=i,l=a===void 0?!0:a,s=de(),j=b&&l?`https://www.google.com/s2/favicons?domain=${m}&sz=128`:null,[c,v]=P.useState(o),[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 r=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(oe,{children:t.jsx(Ge,{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=r.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||r.error||null;let z;e[22]!==l||e[23]!==O||e[24]!==r||e[25]!==p||e[26]!==b?(z=x=>{x.preventDefault(),O&&(b&&l?p.mutate():r.mutate())},e[22]=l,e[23]=O,e[24]=r,e[25]=p,e[26]=b,e[27]=z):z=e[27];const E=z;let k;e[28]!==s?(k=s("routes.onboarding.welcomeTitle"),e[28]=s,e[29]=k):k=e[29];let L;e[30]!==s?(L=s("routes.onboarding.setupDescription"),e[30]=s,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]!==s?(F=s("routes.onboarding.orgAvatar"),e[35]=s,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]!==s?(q=s("routes.onboarding.optional"),e[39]=s,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]!==o||e[47]!==c?(K=(c.trim()||o||"?").charAt(0).toUpperCase(),e[46]=o,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(Je,{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]!==s?(G=s("routes.onboarding.orgName"),e[56]=s,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 le;e[60]===Symbol.for("react.memo_cache_sentinel")?(le=x=>v(x.target.value),e[60]=le):le=e[60];let H;e[61]!==o||e[62]!==s?(H=o||s("routes.onboarding.myOrganizationPlaceholder"),e[61]=o,e[62]=s,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(Le,{id:"org-name",value:c,onChange:le,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]!==l||e[72]!==g||e[73]!==p.isPending||e[74]!==m||e[75]!==b||e[76]!==d||e[77]!==s?(V=b&&l&&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:s("routes.onboarding.allowSignups",{domain:m})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("routes.onboarding.allowSignupsDescription",{domain:m})})]}),t.jsx(De,{checked:g,onCheckedChange:_,disabled:d||p.isPending})]}),e[71]=l,e[72]=g,e[73]=p.isPending,e[74]=m,e[75]=b,e[76]=d,e[77]=s,e[78]=V):V=e[78];let X;e[79]!==J||e[80]!==W||e[81]!==V?(X=t.jsxs("div",{className:"surface 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]!==s?(Z=C&&t.jsx("p",{className:"text-xs text-destructive",children:C instanceof Error?C.message:s("routes.onboarding.failedCreateOrg")}),e[83]=C,e[84]=s,e[85]=Z):Z=e[85];const ge=!O||d||p.isPending;let ee;e[86]!==p.isPending||e[87]!==d||e[88]!==s?(ee=d||p.isPending?t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ce,{className:"size-3.5"})," ",s("routes.onboarding.creating")]}):s("routes.onboarding.continue"),e[86]=p.isPending,e[87]=d,e[88]=s,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 se;e[93]!==f||e[94]!==s?(se=f&&t.jsx("button",{type:"button",className:"text-sm text-muted-foreground hover:text-foreground transition-colors text-center",onClick:f,children:s("routes.onboarding.seeAvailableOrgs")}),e[93]=f,e[94]=s,e[95]=se):se=e[95];let re;return e[96]!==E||e[97]!==R||e[98]!==X||e[99]!==Z||e[100]!==te||e[101]!==se?(re=t.jsx(oe,{children:t.jsxs("form",{onSubmit:E,className:"grid gap-10",children:[R,X,Z,te,se]})}),e[96]=E,e[97]=R,e[98]=X,e[99]=Z,e[100]=te,e[101]=se,e[102]=re):re=e[102],re}function Je(i){const e=ie.c(18),{value:b,fallback:m,onChange:n,disabled:o}=i,a=de(),f=P.useRef(null);let l;e[0]!==n||e[1]!==a?(l=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]=l):l=e[2];const s=l;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]!==o||e[7]!==s?(v=t.jsx("input",{ref:f,type:"file",accept:"image/*",onChange:s,className:"hidden",disabled:o}),e[6]=o,e[7]=s,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(Me,{size:14,className:"text-white"})}),e[12]=g):g=e[12];let _;return e[13]!==o||e[14]!==c||e[15]!==v||e[16]!==w?(_=t.jsxs("button",{type:"button",onClick:j,disabled:o,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]=o,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}],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 Ge({orgName:i,domain:e,claimDomain:b,logoUrl:m}){const n=de(),o=we.filter(s=>b||!s.claimOnly),[a,f]=P.useState(0),l=P.useRef(!1);if(!l.current){l.current=!0;for(let s=1;s<o.length;s++)setTimeout(()=>f(s),Se*s)}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:o.map((s,j)=>{const c=s.icon,v=j===a,u=j<a,w=je[j%je.length],g=n(s.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})]},s.labelKey)})})]})}export{it as default};
@@ -1,3 +1,3 @@
1
- import{e as J,f as B}from"./input-Cf50b9sU.js";import{aK as A,aL as _,e1 as C,b9 as U,cT as W}from"./index-BWpKrclg.js";import"./usage-stats-I2nqy87E.js";import"./tool-namespace-CG1Oreso.js";import"./form-gDNfP07W.js";import"./label-DzRNwB_s.js";import"./utils-CVEq3hMx.js";import"./markdown-CkZaCBow.js";import"./use-copy-Bq-mz0ld.js";import"./Copy01-Dy1KrWO0.js";import"./ZoomOut-CBOWQYet.js";import"./location-V0VwTJTt.js";import"./use-mobile-CoPLJ8cu.js";import"./use-panel-navigate-nriEb2Qz.js";import"./thread-route-BOOkt7de.js";import"./use-project-scope-CdqclLu1.js";import"./repository-binding-Bpq6heaQ.js";import"./use-mcp-client-zIBQco5Q.js";import"./auth-CK6AyRu5.js";import"./tooltip-D2ANqV2w.js";import"./index-lchr3O79.js";import"./agent-icon-nQ1AH9dU.js";import"./AlertCircle-RV4AM_8y.js";import"./Tool01-CHLDtlIL.js";import"./ArrowUp-DpQ-09y4.js";import"./ArrowLeft-XO66B9Td.js";import"./LinkBroken01-z_Mm0CSf.js";import"./ShoppingBag01-BhoOjVkp.js";import"./Building02-NRzC_IEp.js";import"./CheckCircle-CfYD_Bi6.js";import"./ChevronUp-xR4eZngE.js";import"./ChevronSelectorVertical-C5MARPJN.js";import"./UserSquare-BSsT3MHy.js";import"./CreditCard01-DVN26JVZ.js";import"./DotsVertical-CncVW4wJ.js";import"./Image01-CaawlkVR.js";import"./Globe04-BxFc3HLH.js";import"./SwitchHorizontal01-Ce37vA9c.js";import"./Key01-FaGRi3tG.js";import"./Link01-B_YWUHoH.js";import"./Minus-yAYwM_Ty.js";import"./Monitor01-Bl7f7T5L.js";import"./Sun-CZRF_565.js";import"./Play-OByKGnTy.js";import"./Plus-Ccck99Do.js";import"./SearchMd-BAGHgvYw.js";import"./Trash01-BQBP0tUM.js";import"./Upload01-D_q00M49.js";import"./Users01-C6bE7RDt.js";import"./XClose-BjZnEBvF.js";import"./Zap-CHuT8W6R.js";import"./use-entitlements-Bxptpo8e.js";import"./chat-context-kqrW-XPR.js";import"./autosend-DTWIjCgK.js";import"./thread-intent-DjvP3GsU.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-6veZzsu7.js";import"./task-board-L6ZGzY-s.js";import"./schema-DzZBw0EW.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-BcLfhqAn.js";import"./use-decopilot-events-Dg011Qgn.js";import"./use-organization-settings-D_5fr-OI.js";import"./icon-button-CTmBGRaQ.js";import"./file-type-icon-BgzyV542.js";import"./chat-draft-CRTo5XoS.js";import"./use-session-runtime-HJpkQoy0.js";import"./select-BMteQTWS.js";import"./index-BdQq_4o_.js";import"./tabs-CjWwohzM.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-C26dK60_.js";import"./toggle-group-BAFBdL9F.js";import"./index-G8_ivZDF.js";import"./checkbox-aDQexY19.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-ClEv7Zyf.js";import"./drawer-DDmudFbW.js";import"./input-CgS5sNmj.js";import"./suggestion-BgdlUdcB.js";import"./use-mcp-prompts-XayY9yfQ.js";import"./use-org-fs-B4wvUwJj.js";import"./useInfiniteQuery-CFafSHXd.js";import"./infiniteQueryObserver-CbIPWgZj.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-CDMJv8wq.js";import"./plan-ladder-DVSwNgR2.js";import"./add-connection-dialog-BB5lDWHR.js";import"./collection-search-B3vfcK1n.js";import"./extract-connection-data-DYwFbKkm.js";import"./metadata-D72DunRR.js";import"./connection-C-NllGni.js";import"./url-slug-DcB6_J0W.js";import"./connection-card-DZD_rAWh.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-BQ9jVlvt.js";import"./textarea-BNvvIWSZ.js";import"./use-connection-CZNQu-z2.js";import"./schema-Cd1llToh.js";import"./connection-form-helpers-DmavsUyJ.js";import"./authenticate-and-persist-oauth-Bb8BBbsA.js";import"./mcp-oauth-KJGfGjkD.js";import"./mcp-oauth-DWlxkjKx.js";import"./collection-tabs-BdhCjBRd.js";import"./badge-BV7rxTvN.js";import"./use-infinite-scroll-CojsIRJO.js";import"./useSuspenseInfiniteQuery-D_oVQ9bL.js";import"./use-task-board-events-CWQQpnEy.js";import"./use-chat-layout-state-CyqukwDV.js";class X{constructor(t,r=4e3){this.onDisconnect=t,this.graceMs=r}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,r){this.send=t,this.callbacks=r}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,r=Date.now()){if(this.closed)return;const n=H.safeParse(t);if(n.success){const e=n.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:r,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:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(t);if(m.success){const e=m.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[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!p.length){this.publishUpdate({delivery:"announce",delegationId:r,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:r,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:r,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:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,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 n=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
1
+ import{e as J,f as B}from"./input-BqbNJGML.js";import{aK as A,aL as _,e1 as C,b9 as U,cT as W}from"./index-WgfN4QVP.js";import"./usage-stats-qowelp13.js";import"./tool-namespace-CGxHGKW_.js";import"./form-BeydREbm.js";import"./label-Dxzmqh4L.js";import"./utils-CVEq3hMx.js";import"./markdown-NHGOJDhi.js";import"./use-copy-CXZDMarr.js";import"./Copy01-DisW4JMo.js";import"./ZoomOut-ZB7MeGmK.js";import"./location-V0VwTJTt.js";import"./use-mobile-BRzk8D-v.js";import"./use-panel-navigate-BrmvjTvw.js";import"./thread-route-D2HAbtZo.js";import"./use-project-scope-5fuCx2a_.js";import"./repository-binding-DF6YCWsj.js";import"./use-mcp-client-DXdlNn5q.js";import"./auth-BZPkjT4-.js";import"./tooltip-CUsEGqy_.js";import"./index-CzKs4Djn.js";import"./agent-icon-D-0GvNzG.js";import"./AlertCircle-BjT7_GFq.js";import"./Tool01-DwTqd_Nj.js";import"./ArrowUp-At9MqVhB.js";import"./ArrowLeft-Par1IdOs.js";import"./LinkBroken01-CdMsJVgm.js";import"./ShoppingBag01-d7aE6vty.js";import"./Building02-BV_I3UuJ.js";import"./CheckCircle-D6xmTIXf.js";import"./ChevronUp-CNyARDGk.js";import"./ChevronSelectorVertical-CeHSyaSD.js";import"./UserSquare-D1neGXtF.js";import"./CreditCard01-QvSfBZzn.js";import"./DotsVertical-wJ46YU2V.js";import"./Image01-CO8HhoHi.js";import"./Globe04-DK5qhUMj.js";import"./SwitchHorizontal01-7qdaOYVu.js";import"./Key01-BDwjIsdK.js";import"./Link01-BHgTruNE.js";import"./Minus-CJDvXjFo.js";import"./Monitor01-B3thg2Rr.js";import"./Sun-wY_Z9VGm.js";import"./Play-BhU5Ns8x.js";import"./Plus-BaWg3Fda.js";import"./SearchMd-B541ufOQ.js";import"./Trash01-B5_r6iLm.js";import"./Upload01-BP49pNql.js";import"./Users01-CrLtxwQA.js";import"./XClose-DsiXpG7_.js";import"./Zap-BB-vOERw.js";import"./use-entitlements-BkqxE18N.js";import"./chat-context-0CZgd-Gr.js";import"./autosend-Ci815qQG.js";import"./thread-intent-DSKhfvxP.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-CH4G2Sl-.js";import"./task-board-M_qS1rzf.js";import"./schema-BUPJBVf-.js";import"./slugify-CEUa2lfQ.js";import"./use-ai-providers-BcdAb8qD.js";import"./use-decopilot-events-fL28TEHC.js";import"./use-organization-settings-CHtyXny0.js";import"./icon-button-Dvr6r3yU.js";import"./file-type-icon-BzoA5jiZ.js";import"./chat-draft-DM7nVCQ-.js";import"./use-session-runtime-BIoEtecA.js";import"./select-CFg3KEOq.js";import"./index-BdQq_4o_.js";import"./tabs-j1z3THwl.js";import"./active-indicator-CCMhAsc_.js";import"./use-deco-credits-CvKHRGmx.js";import"./toggle-group-BUfjArPT.js";import"./index-CvcioybL.js";import"./checkbox-DVUVqeGQ.js";import"./ai-providers-logos-DD3qZ33J.js";import"./popover-DqVLkXUD.js";import"./drawer-DV7RfSOm.js";import"./input-C9nmuHHZ.js";import"./suggestion-hz2N0L4f.js";import"./use-mcp-prompts-ClNBkSao.js";import"./use-org-fs-DRPPAr_0.js";import"./useInfiniteQuery-CrT95xA_.js";import"./infiniteQueryObserver-AJwWz1b5.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-BkfFWoMQ.js";import"./plan-ladder-CPUSwIwK.js";import"./add-connection-dialog-DkTbkwZe.js";import"./collection-search-Dg61rOFc.js";import"./extract-connection-data-CMDKUW-r.js";import"./metadata-D72DunRR.js";import"./connection-OneH_KYb.js";import"./url-slug-B4ugcdZY.js";import"./connection-card-Cn0XDJp5.js";import"./connection-slug-CITJ0kGN.js";import"./integration-icon-UvPKDtTh.js";import"./textarea-D-MP0s12.js";import"./use-connection-FqHna8PS.js";import"./schema-DiDerRAC.js";import"./connection-form-helpers-Bky3pLkI.js";import"./authenticate-and-persist-oauth-DercrMMu.js";import"./mcp-oauth-D0k2-sPR.js";import"./mcp-oauth-Due6wImr.js";import"./collection-tabs-Dgf5t1P2.js";import"./badge-iQ-KRbWv.js";import"./use-infinite-scroll-B2Dxfw4r.js";import"./useSuspenseInfiniteQuery-Cy44049I.js";import"./use-task-board-events-CyzOoXYa.js";import"./use-chat-layout-state-B5aaDvob.js";class X{constructor(t,r=4e3){this.onDisconnect=t,this.graceMs=r}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,r){this.send=t,this.callbacks=r}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,r=Date.now()){if(this.closed)return;const n=H.safeParse(t);if(n.success){const e=n.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:r,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:r});return}const m=A({type:C("session.thinking.appended"),client_event_id:_()}).safeParse(t);if(m.success){const e=m.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[r,n]of this.pending){const a=this.fragments.filter(o=>o.start<n.offset),m=a.reduce((o,i)=>i.role==="user"?Math.max(o,i.arrivedAt):o,n.receivedAt);if(t-m<500)continue;const p=a.filter(o=>o.role==="user"&&!this.consumed.has(o.id));if(!p.length&&t-n.receivedAt<3e3)continue;if(this.pending.delete(r),this.delegated.add(r),!p.length){this.publishUpdate({delivery:"announce",delegationId:r,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:r,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:r,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:r,text:JSON.stringify(o)})}).catch(()=>{this.publishUpdate({delivery:"announce",delegationId:r,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 n=(t.contextId?`Updated ${t.contextId} data, superseding earlier values:
2
2
  `:`Studio result data:
3
3
  `)+t.text,a=new TextEncoder,m=t.delivery==="announce"&&a.encode(n).length>480,p={remaining:new Set,delegationId:t.delegationId};let e="",s=0;const o=()=>{if(!e)return;const i=crypto.randomUUID();m&&(p.remaining.add(i),this.awaitingContext.set(i,p)),this.send({type:t.delivery==="announce"&&!m?"session.commentary.append":"session.thinking.append",event_id:i,delegation_id:t.delegationId??null,content:e}),e="",s=0};for(const i of n){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 Ye(E,t,r){r.throwIfAborted();const n=new RTCPeerConnection,a=n.createDataChannel("oai-events"),m=document.createElement("audio");m.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 $(d=>{!i&&a.readyState==="open"&&a.send(JSON.stringify(d))},t),q=new X(()=>{i||t.onDisconnect()}),T=async()=>{if(!i){i=!0,q.dispose(),b.close(),clearInterval(L),r.removeEventListener("abort",M),a.close(),n.close();for(const d of p?.getTracks()??[])d.stop();m.pause(),m.srcObject=null,e&&e.state!=="closed"&&await e.close().catch(()=>{})}},M=()=>{T()};r.addEventListener("abort",M,{once:!0});const u=AbortSignal.any([r,AbortSignal.timeout(3e4)]),j=x.promise,z=()=>x.reject(u.reason);u.addEventListener("abort",z,{once:!0}),j.catch(()=>{}),a.onmessage=({data:d})=>{if(!(i||typeof d!="string"))try{const l=JSON.parse(d);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()},n.onconnectionstatechange=()=>{i||q.report(n.connectionState)},n.ontrack=({streams:d,track:l})=>{if(i)return;const D=d[0]??new MediaStream([l]);m.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()),m.play().catch(()=>t.onError())};function N(){if(!s||!o||i)return 0;s.getByteTimeDomainData(o);let d=0;for(const l of o)d+=((l-128)/128)**2;return Math.min(1,Math.sqrt(d/o.length)*4)}try{const d=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([d,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())n.addTrack(c,l);const D=await n.createOffer();await n.setLocalDescription(D),u.throwIfAborted(),n.iceGatheringState!=="complete"&&await new Promise((c,f)=>{const S=()=>{n.iceGatheringState==="complete"&&(R(),c())},k=()=>{R(),f(u.reason)},R=()=>{n.removeEventListener("icegatheringstatechange",S),u.removeEventListener("abort",k)};n.addEventListener("icegatheringstatechange",S),u.addEventListener("abort",k,{once:!0}),S(),u.aborted&&k()});const V=n.localDescription?.sdp;if(!V)throw new Error("Missing voice offer");const G=await E(V,u);return await n.setRemoteDescription({type:"answer",sdp:G.sdp}),await j,r.throwIfAborted(),u.removeEventListener("abort",z),r.removeEventListener("abort",M),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(m.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 T()})(),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(d){throw await T(),d}}export{Ye as startOpenAIConversation};
@@ -1 +1 @@
1
- import{c as a,a4 as f,m as S,K as y,q as v}from"./index-BWpKrclg.js";import{a as d}from"./use-project-native-view-presence-Bdl4n5BM.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,a4 as f,m as S,K as y,q as v}from"./index-WgfN4QVP.js";import{a as d}from"./use-project-native-view-presence-fZL342dS.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};