decocms 4.425.0 → 4.425.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/dist/client/assets/{AlertCircle-CQU3FO2-.js → AlertCircle-DsOSKvzV.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Caz7K4-P.js → AreaChart-DtLzG-fG.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-r9k0gxde.js → ArrowLeft-2lm_J3QC.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-CJiUKB0e.js → ArrowRight-A-Nw2bpi.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D1uaoIEr.js → ArrowUp-CAUQitV-.js} +1 -1
  6. package/dist/client/assets/{CartesianChart-CsM3ceFL.js → CartesianChart-DpAzR_jq.js} +1 -1
  7. package/dist/client/assets/{Check-soPAeKca.js → Check-CMF2Ywph.js} +1 -1
  8. package/dist/client/assets/{CheckCircle-BdRkKVcj.js → CheckCircle-Brn-seMk.js} +1 -1
  9. package/dist/client/assets/{ChevronUp-B4upaCys.js → ChevronUp-D_quOjFH.js} +1 -1
  10. package/dist/client/assets/{Copy01-Ck1CQt9c.js → Copy01-Dd4ky6ZP.js} +1 -1
  11. package/dist/client/assets/{CreditCard01-C5LQldm8.js → CreditCard01-DFpHESd1.js} +1 -1
  12. package/dist/client/assets/{DotsVertical-DMsZySzr.js → DotsVertical-kOg4pODr.js} +1 -1
  13. package/dist/client/assets/{ErrorBarContext-bwtijj2s.js → ErrorBarContext-3WQQZLF0.js} +1 -1
  14. package/dist/client/assets/{Image01-AxefwT4b.js → Image01-BdsDNVox.js} +1 -1
  15. package/dist/client/assets/{Key01-V9W0a2Yy.js → Key01-BUAFoCLq.js} +1 -1
  16. package/dist/client/assets/{Line-CPF3zU9K.js → Line-BuTAHyrm.js} +1 -1
  17. package/dist/client/assets/{Link01-C9tHLmLh.js → Link01-CMEXeVpO.js} +1 -1
  18. package/dist/client/assets/{LinkExternal01-CkkaHQ43.js → LinkExternal01-ZFH-yoZN.js} +1 -1
  19. package/dist/client/assets/{Monitor01-DYA_QMf2.js → Monitor01-C2krU25E.js} +1 -1
  20. package/dist/client/assets/{Palette-Bk3UCvKx.js → Palette-D5d1Mblr.js} +1 -1
  21. package/dist/client/assets/{Plus-kHt_8stA.js → Plus-Dc5RtznQ.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DFB2ha4T.js → SearchMd-B30D9ndg.js} +1 -1
  23. package/dist/client/assets/{Sector-D22gYKYq.js → Sector-64WXTvD4.js} +1 -1
  24. package/dist/client/assets/{ShoppingBag01-IkLiZTCG.js → ShoppingBag01-DouihxuQ.js} +1 -1
  25. package/dist/client/assets/{Sun-CttdH4aG.js → Sun-CepnW0AC.js} +1 -1
  26. package/dist/client/assets/{Tool01-BVUW3itu.js → Tool01-gx1zwKcn.js} +1 -1
  27. package/dist/client/assets/{Trash01-CKOL_3ja.js → Trash01-DliBU2bP.js} +1 -1
  28. package/dist/client/assets/{Upload01-DlR8CSo4.js → Upload01-CQpa1a9n.js} +1 -1
  29. package/dist/client/assets/{User01-dc7WIl5M.js → User01-Dd4e-mIA.js} +1 -1
  30. package/dist/client/assets/{UserSquare-D1bS09Fm.js → UserSquare-DcFHmf0l.js} +1 -1
  31. package/dist/client/assets/{Users01-BaIVzoZ3.js → Users01-BYc5DjwP.js} +1 -1
  32. package/dist/client/assets/{X-Dp6J1NZk.js → X-AdrRw9Zp.js} +1 -1
  33. package/dist/client/assets/{XAxis-B8-Lgf5y.js → XAxis-hKxnHq9P.js} +1 -1
  34. package/dist/client/assets/{XClose-CVE8Vs6Q.js → XClose-DXJf2S1e.js} +1 -1
  35. package/dist/client/assets/{ZoomOut-ekFDVqJi.js → ZoomOut-Bqjt8gJB.js} +1 -1
  36. package/dist/client/assets/{access-gate-DVZHCUBi.js → access-gate-DTSTiQp3.js} +1 -1
  37. package/dist/client/assets/{add-connection-dialog-B-zUvMaq.js → add-connection-dialog-CjgmjJ6J.js} +1 -1
  38. package/dist/client/assets/agent-analytics-fW6DiN0D.js +2 -0
  39. package/dist/client/assets/agent-app-DRnmexWH.js +1 -0
  40. package/dist/client/assets/agent-assets-B6OCthBz.js +1 -0
  41. package/dist/client/assets/{agent-automation-Bj4sGNvm.js → agent-automation-D7w4sgBL.js} +2 -2
  42. package/dist/client/assets/agent-automations-VE77sb9q.js +1 -0
  43. package/dist/client/assets/agent-connect-sources-CR98SBRp.js +1 -0
  44. package/dist/client/assets/agent-deck-BLtrAz-G.js +1 -0
  45. package/dist/client/assets/agent-e2e-Ci2-1Esx.js +1 -0
  46. package/dist/client/assets/agent-experiments-D6lI5uOj.js +1 -0
  47. package/dist/client/assets/agent-file-B4Bf8NCP.js +1 -0
  48. package/dist/client/assets/{agent-git-BcKeYOTv.js → agent-git-AczEwwiL.js} +2 -2
  49. package/dist/client/assets/agent-hosting-C6G_0vSx.js +1 -0
  50. package/dist/client/assets/{agent-icon-C8wu-T9B.js → agent-icon-B1JUa-pK.js} +1 -1
  51. package/dist/client/assets/agent-library-E0JwHCSU.js +1 -0
  52. package/dist/client/assets/agent-library-file-D_y5O75S.js +1 -0
  53. package/dist/client/assets/agent-monitor-Dzcb37so.js +1 -0
  54. package/dist/client/assets/agent-overview-DCqvGj5y.js +1 -0
  55. package/dist/client/assets/agent-settings-CMwvE0uk.js +1 -0
  56. package/dist/client/assets/{agent-site-editor-BManvh2p.js → agent-site-editor-X06x49vI.js} +2 -2
  57. package/dist/client/assets/agent-site-editor-code-DJgbb6tV.js +2 -0
  58. package/dist/client/assets/{agent-site-editor-content-DVWOt-Lp.js → agent-site-editor-content-DQrj-VH4.js} +3 -3
  59. package/dist/client/assets/{agent-site-editor-preview-DqrFB9eA.js → agent-site-editor-preview-BrzBbshQ.js} +3 -3
  60. package/dist/client/assets/{agent-view-guard-DP6rr7-6.js → agent-view-guard-CjENDk5e.js} +1 -1
  61. package/dist/client/assets/agent-view-xIFnsvl0.js +1 -0
  62. package/dist/client/assets/{agents-list-BHJZEiO4.js → agents-list-C33TJcHC.js} +1 -1
  63. package/dist/client/assets/{ai-providers-BU1J8_R5.js → ai-providers-ZZ74aECC.js} +1 -1
  64. package/dist/client/assets/{alert-B_aVDXWu.js → alert-BKTGsFI8.js} +1 -1
  65. package/dist/client/assets/{alert-dialog-DJcNPQjm.js → alert-dialog-CIK2aHDv.js} +1 -1
  66. package/dist/client/assets/{analytics-sections-BXAEbLgR.js → analytics-sections-BZtSP0aA.js} +1 -1
  67. package/dist/client/assets/api-keys-D6HBMlIA.js +1 -0
  68. package/dist/client/assets/{api-keys-yyXIMQJI.js → api-keys-Kd3P9EQb.js} +1 -1
  69. package/dist/client/assets/app-editor-TQLa1Eqc.js +1 -0
  70. package/dist/client/assets/{asset-utils-BV839mqx.js → asset-utils-vxXtnPR8.js} +1 -1
  71. package/dist/client/assets/{auth-i4uSZxqM.js → auth-DS4Lo40d.js} +1 -1
  72. package/dist/client/assets/{auth-catchall-B38U7kv-.js → auth-catchall-DQwnE0NC.js} +1 -1
  73. package/dist/client/assets/{auth-entry-CKSK4iYs.js → auth-entry-DEh9VZst.js} +1 -1
  74. package/dist/client/assets/{auth-split-layout-D02-xSkU.js → auth-split-layout-DXgubjLw.js} +1 -1
  75. package/dist/client/assets/{authenticate-and-persist-oauth-D-PqEdfN.js → authenticate-and-persist-oauth-l_mXF0Cq.js} +1 -1
  76. package/dist/client/assets/{automation-list-row-Cj0lVdtQ.js → automation-list-row-DfjGMZpb.js} +1 -1
  77. package/dist/client/assets/{automation-runs-BNfzkXtY.js → automation-runs-CJ4TbZzx.js} +1 -1
  78. package/dist/client/assets/{automations-CcA3VvLO.js → automations-ELL00rba.js} +1 -1
  79. package/dist/client/assets/{autosend-BgamBAXS.js → autosend-C7EnJZLv.js} +1 -1
  80. package/dist/client/assets/{avatar-By9-J1G7.js → avatar-D5EBeZdt.js} +1 -1
  81. package/dist/client/assets/{badge-BLmau0Ea.js → badge-C7LZnr1G.js} +1 -1
  82. package/dist/client/assets/{block-document-DNf3E-rZ.js → block-document-mPXjkoGO.js} +1 -1
  83. package/dist/client/assets/{blocks-preview-workspace-context-Dp3GVv9B.js → blocks-preview-workspace-context-D2DgzWT_.js} +1 -1
  84. package/dist/client/assets/{buckets-CfOh79gF.js → buckets-CpKCcO2O.js} +1 -1
  85. package/dist/client/assets/{build-improve-prompt-doc-bnw-geKz.js → build-improve-prompt-doc-BA847z9G.js} +1 -1
  86. package/dist/client/assets/{calendar-C_3zvYnn.js → calendar-yvfvBAzS.js} +1 -1
  87. package/dist/client/assets/{capability-load-error-_sxFuxMW.js → capability-load-error-DwYWnWZk.js} +1 -1
  88. package/dist/client/assets/category-editor-BO67rgf7.js +1 -0
  89. package/dist/client/assets/{chart-DUDR_GLh.js → chart-Dv1JamW3.js} +1 -1
  90. package/dist/client/assets/{chat-context-DSOY14Dl.js → chat-context-fDVt7FJu.js} +1 -1
  91. package/dist/client/assets/{chat-draft-Db3gWleH.js → chat-draft-ldhGGrhS.js} +1 -1
  92. package/dist/client/assets/{checkbox-YgstniWn.js → checkbox-DKFzy_UI.js} +1 -1
  93. package/dist/client/assets/{choose-editor-Cvv0YS80.js → choose-editor-cP_2mN1n.js} +1 -1
  94. package/dist/client/assets/{claim-phase-copy-Byy3Q6us.js → claim-phase-copy-DAgG3vfo.js} +1 -1
  95. package/dist/client/assets/{cli-auth-success-CF33WEDl.js → cli-auth-success-D-t1ynTi.js} +1 -1
  96. package/dist/client/assets/{client-icons-3lGatXeB.js → client-icons-BXC5XYwX.js} +1 -1
  97. package/dist/client/assets/{collapsible-Pi90xi-e.js → collapsible-aZePgHKd.js} +1 -1
  98. package/dist/client/assets/{collection-detail-DHdecaB7.js → collection-detail-B6UBhveh.js} +1 -1
  99. package/dist/client/assets/{collection-display-button-Cb5VEBCx.js → collection-display-button-DwhCq88V.js} +1 -1
  100. package/dist/client/assets/{collection-search-CZPfBwnt.js → collection-search-CBSxLm5u.js} +1 -1
  101. package/dist/client/assets/{collection-table-wrapper-CR8wWqYX.js → collection-table-wrapper-uO2T9X8L.js} +1 -1
  102. package/dist/client/assets/{collection-tabs-CDyR4kzk.js → collection-tabs-DIB_pPlJ.js} +1 -1
  103. package/dist/client/assets/{combobox-BIrYGyuF.js → combobox-VNs66YBC.js} +1 -1
  104. package/dist/client/assets/{command-DxWpNp1x.js → command-BaUKjhoV.js} +1 -1
  105. package/dist/client/assets/{companion-mcps-section-BT3BpapS.js → companion-mcps-section-he2WjNhc.js} +1 -1
  106. package/dist/client/assets/{config-BfXHrI3c.js → config-DJlvAMtq.js} +1 -1
  107. package/dist/client/assets/{connect-BaV0v-Tu.js → connect-BzB4yRL7.js} +1 -1
  108. package/dist/client/assets/{connect-layout-BUm5geCN.js → connect-layout-DHjsvqYK.js} +1 -1
  109. package/dist/client/assets/{connection-sgm4TBxZ.js → connection-CnIXOjL9.js} +1 -1
  110. package/dist/client/assets/{connection-card-KlghLDwU.js → connection-card-Y1Y6409W.js} +1 -1
  111. package/dist/client/assets/{connection-detail-DclD8xq_.js → connection-detail-DryX9zB1.js} +1 -1
  112. package/dist/client/assets/{connection-form-helpers-i009QpGu.js → connection-form-helpers-abhaYYBG.js} +1 -1
  113. package/dist/client/assets/{connections-_X80BGGI.js → connections-CcwW96QT.js} +1 -1
  114. package/dist/client/assets/context--OKYBRk9.js +1 -0
  115. package/dist/client/assets/{create-organization-dialog-DhSGIMf_.js → create-organization-dialog-hS_wxzxv.js} +1 -1
  116. package/dist/client/assets/{decopilot-ZxSRkfiB.js → decopilot-BBx7_EFV.js} +1 -1
  117. package/dist/client/assets/{dialog-1dafL4bi.js → dialog-BgtCSZyf.js} +1 -1
  118. package/dist/client/assets/discover-DGG2hRLO.js +1 -0
  119. package/dist/client/assets/{domain-settings-CGpwkGbK.js → domain-settings-CVryaoxH.js} +1 -1
  120. package/dist/client/assets/{download-app-dialog-BcCXsaD8.js → download-app-dialog-BRX0Ra47.js} +1 -1
  121. package/dist/client/assets/{drawer-wrrjDRlR.js → drawer-BvFRhiv1.js} +1 -1
  122. package/dist/client/assets/{editor-BiYdYoAb.js → editor-DuOWmHoR.js} +1 -1
  123. package/dist/client/assets/{empty-state-Ck9uwtW-.js → empty-state-DB_SzRO6.js} +1 -1
  124. package/dist/client/assets/{empty-state-LYCOTuMl.js → empty-state-DKbbnCTb.js} +1 -1
  125. package/dist/client/assets/{extract-connection-data-Cm7kjryi.js → extract-connection-data-BRwBq3vf.js} +1 -1
  126. package/dist/client/assets/{feature-gate-VDho3P9i.js → feature-gate-BAIgZZXB.js} +1 -1
  127. package/dist/client/assets/{feature-paywall-O59PQJQ4.js → feature-paywall-Cwbvr67l.js} +1 -1
  128. package/dist/client/assets/{file-explorer-M_603rD8.js → file-explorer-CvMyNQBS.js} +1 -1
  129. package/dist/client/assets/{file-preview-DNv-TeY5.js → file-preview-OVrIjHIJ.js} +1 -1
  130. package/dist/client/assets/{file-share-button-CcJT8SCR.js → file-share-button-BoRqU7Iz.js} +1 -1
  131. package/dist/client/assets/{file-type-icon-buBDg-03.js → file-type-icon-Cejgy7H6.js} +1 -1
  132. package/dist/client/assets/flat-project-bym3Cc-H.js +1 -0
  133. package/dist/client/assets/{folder-icon-Da9ULcDI.js → folder-icon-CbqDLq4k.js} +1 -1
  134. package/dist/client/assets/{form-D5LPXjPj.js → form-Bwkg8Jqa.js} +1 -1
  135. package/dist/client/assets/{gateway-client-CeKj8qiL.js → gateway-client-DFxhiMGP.js} +1 -1
  136. package/dist/client/assets/{general-BPN087Lc.js → general-B4Sba9xG.js} +1 -1
  137. package/dist/client/assets/home-BrA_nbiq.js +1 -0
  138. package/dist/client/assets/index-6m6OXOoa.css +1 -0
  139. package/dist/client/assets/{index-H2LrQn17.js → index-B0GFQJYa.js} +1 -1
  140. package/dist/client/assets/{index-Ct9y-yVl.js → index-B9N7VFXz.js} +1 -1
  141. package/dist/client/assets/{index-CY8bQG9C.js → index-BXGaeoRo.js} +1 -1
  142. package/dist/client/assets/{index-DJzoBp2L.js → index-BqvCOs8v.js} +1 -1
  143. package/dist/client/assets/{index-D5-xqq3P.js → index-BzEAzC8-.js} +1 -1
  144. package/dist/client/assets/{index-D8akGTh4.js → index-C1l5ueXX.js} +1 -1
  145. package/dist/client/assets/{index-w4vR7oJd.js → index-CeJmvQn1.js} +3 -3
  146. package/dist/client/assets/{index-LgfzCRc4.js → index-D2sx2hj-.js} +1 -1
  147. package/dist/client/assets/{index-DFK3AqOd.js → index-D6WmSRmP.js} +1 -1
  148. package/dist/client/assets/{index-D3__nJJk.js → index-DJT_L8S6.js} +1 -1
  149. package/dist/client/assets/{index-CeFrI_-f.js → index-DUoAE5ST.js} +8 -8
  150. package/dist/client/assets/{index-D88JS0Yx.js → index-Ddpg7S6U.js} +1 -1
  151. package/dist/client/assets/{index-MebkKt8H.js → index-Dvm5L9kf.js} +1 -1
  152. package/dist/client/assets/{index-CBLynFUh.js → index-T9qmd0M1.js} +1 -1
  153. package/dist/client/assets/{index-redirect-DNJpUKHR.js → index-redirect-B7v6IA8J.js} +1 -1
  154. package/dist/client/assets/{index-Do5wILaI.js → index-t3GQvgTK.js} +1 -1
  155. package/dist/client/assets/{infiniteQueryObserver-DX9QHkGe.js → infiniteQueryObserver-boyhd8Uv.js} +1 -1
  156. package/dist/client/assets/{infra-billing-CJc_xWtO.js → infra-billing-CFIs1f7C.js} +1 -1
  157. package/dist/client/assets/{input-C2XryqlS.js → input-2vHFydNN.js} +1 -1
  158. package/dist/client/assets/{input-BLNFqzUM.js → input-Je7SXM19.js} +3 -3
  159. package/dist/client/assets/{input-CQlMbJrR.js → input-yIPgkwGw.js} +1 -1
  160. package/dist/client/assets/{integration-icon-60YSBd47.js → integration-icon-DsxYi58j.js} +1 -1
  161. package/dist/client/assets/{label-CTaphTs2.js → label-B5D3oXM0.js} +1 -1
  162. package/dist/client/assets/{last-preview-page-vt2OtvKU.js → last-preview-page-DiM8XiC2.js} +1 -1
  163. package/dist/client/assets/{layout-COlkqmIQ.js → layout-DzG-pOmM.js} +1 -1
  164. package/dist/client/assets/{legacy-agents-deep-Ctzjouqt.js → legacy-agents-deep-BhJ-RJKs.js} +1 -1
  165. package/dist/client/assets/{legacy-main-redirect-BaZYUmuc.js → legacy-main-redirect-k4k6oSNR.js} +1 -1
  166. package/dist/client/assets/library-C9HSbHdS.js +1 -0
  167. package/dist/client/assets/{library-tab-D4iQdrlE.js → library-tab-C3VxGFW1.js} +1 -1
  168. package/dist/client/assets/{login-QNIhU9dz.js → login-DJ6MsBjC.js} +1 -1
  169. package/dist/client/assets/{markdown-Ck-11dhN.js → markdown-Cuay45B5.js} +1 -1
  170. package/dist/client/assets/{mcp-app-renderer-BemaHPoe.js → mcp-app-renderer-Bz2q_atZ.js} +1 -1
  171. package/dist/client/assets/{mcp-oauth-DA7uY-37.js → mcp-oauth-BH0jXemG.js} +1 -1
  172. package/dist/client/assets/{members-BEhHXB0V.js → members-Ap41EyVo.js} +1 -1
  173. package/dist/client/assets/{message-templates-CX1OJ7C8.js → message-templates-X_EVv61O.js} +1 -1
  174. package/dist/client/assets/{mini-report-page-s_c2MmRH.js → mini-report-page-bRBLtGfH.js} +1 -1
  175. package/dist/client/assets/{mock-board-DPOuVqy_.js → mock-board-CYjTVJug.js} +1 -1
  176. package/dist/client/assets/{monaco-editor-CyLZqoPt.js → monaco-editor-BBA-2xe3.js} +1 -1
  177. package/dist/client/assets/{monitoring-stats-row-pkJdXLku.js → monitoring-stats-row-CjCgF20M.js} +1 -1
  178. package/dist/client/assets/{multi-select-CtEcT2Fm.js → multi-select-X-tz_9Eq.js} +1 -1
  179. package/dist/client/assets/{mustache-BIygiTUj.js → mustache-BgYmPFKE.js} +1 -1
  180. package/dist/client/assets/{new-project-dialog-BJkFsBCH.js → new-project-dialog-utK5AYOj.js} +1 -1
  181. package/dist/client/assets/{oauth-callback-DLIV3MGz.js → oauth-callback-C0ONc_Lk.js} +1 -1
  182. package/dist/client/assets/{oauth-callback-ai-provider-r46g0CGE.js → oauth-callback-ai-provider-E9B5w96T.js} +1 -1
  183. package/dist/client/assets/{onboarding-BdNB509_.js → onboarding-qhebZmKN.js} +1 -1
  184. package/dist/client/assets/openai-conversation-BaDnTpHn.js +3 -0
  185. package/dist/client/assets/{optimistic-project-sidebar-views-CTxHKwky.js → optimistic-project-sidebar-views-Bz7bGQe2.js} +1 -1
  186. package/dist/client/assets/{org-file-open-context-CNhQ4sPa.js → org-file-open-context-BJfMfMA3.js} +1 -1
  187. package/dist/client/assets/{organization-choice-ClD3tqal.js → organization-choice-Ogfn3N9-.js} +1 -1
  188. package/dist/client/assets/{orgs-bdVnOGJG.js → orgs-DUk_RkTf.js} +1 -1
  189. package/dist/client/assets/{page-seo-form-B0GpL4jq.js → page-seo-form-BbLnwvLC.js} +1 -1
  190. package/dist/client/assets/{pair-BqbLIj1t.js → pair-9c3wI9G4.js} +1 -1
  191. package/dist/client/assets/{plan-ladder-HHjxIVXp.js → plan-ladder-C5HBBt9O.js} +1 -1
  192. package/dist/client/assets/{popover-Dp4MK1ls.js → popover-LjbxD4kl.js} +1 -1
  193. package/dist/client/assets/post-calendar-BZuYHwNt.js +1 -0
  194. package/dist/client/assets/{post-editor-C1RmWFY5.js → post-editor-Cp_zmM1c.js} +2 -2
  195. package/dist/client/assets/{preview-content-CNIJYNak.js → preview-content-YLQa-MEQ.js} +1 -1
  196. package/dist/client/assets/{preview-dialog-C7esJb4w.js → preview-dialog-CYmFwkaw.js} +1 -1
  197. package/dist/client/assets/{profile-CXYVNdpP.js → profile-DjS7rPQX.js} +1 -1
  198. package/dist/client/assets/{project-app-view-CDgS0ywj.js → project-app-view-CDoexz4k.js} +1 -1
  199. package/dist/client/assets/project-feed-BIMko2yg.js +1 -0
  200. package/dist/client/assets/{project-icon-BY9kpN8_.js → project-icon-6NFCCRCG.js} +1 -1
  201. package/dist/client/assets/project-reports-DyRmdIDr.js +1 -0
  202. package/dist/client/assets/project-tasks-B_guST6M.js +1 -0
  203. package/dist/client/assets/{projects-empty-state-DfwkZhS9.js → projects-empty-state-B10a1M4B.js} +1 -1
  204. package/dist/client/assets/{projects-evwU_QXd.js → projects-s9YGF9Lu.js} +1 -1
  205. package/dist/client/assets/{prompts-CyLjyHbX.js → prompts-DbdYfdfQ.js} +1 -1
  206. package/dist/client/assets/record-editor-B6ATpNPy.js +1 -0
  207. package/dist/client/assets/redirect-editor-HlsJRCq9.js +1 -0
  208. package/dist/client/assets/{reports-BM-fsbYD.js → reports-BxsnFrLQ.js} +1 -1
  209. package/dist/client/assets/reports-DFP-qw8N.js +1 -0
  210. package/dist/client/assets/{reports-onboarding-BkOfNX6c.js → reports-onboarding-CsJ6--w4.js} +1 -1
  211. package/dist/client/assets/{reports-tab-akHTbMf0.js → reports-tab-Wktq9_sa.js} +2 -2
  212. package/dist/client/assets/{repositories-BhXqf3Sh.js → repositories-bXU3gUAH.js} +1 -1
  213. package/dist/client/assets/{repository-binding-Bye6exhX.js → repository-binding-B_NhY5XW.js} +1 -1
  214. package/dist/client/assets/{repository-import-picker-9N2XFQro.js → repository-import-picker-R1iARtfq.js} +1 -1
  215. package/dist/client/assets/{repository-picker-Hvr1qnSW.js → repository-picker-AmyIhwMY.js} +1 -1
  216. package/dist/client/assets/{require-capability-BikcW72U.js → require-capability-CE5MPnLW.js} +1 -1
  217. package/dist/client/assets/{required-auth-layout-DWm1sqaG.js → required-auth-layout-SykeHPol.js} +1 -1
  218. package/dist/client/assets/{reset-password-DBUxrz7S.js → reset-password-C9pPnrCB.js} +1 -1
  219. package/dist/client/assets/{resizable-xSdhf8k8.js → resizable-D-ZGQzkV.js} +1 -1
  220. package/dist/client/assets/{resolve-tab-icon-BViYoAOc.js → resolve-tab-icon-DNP2Pr3y.js} +1 -1
  221. package/dist/client/assets/{review-settings-CxdhHh4I.js → review-settings-CgbME_-p.js} +1 -1
  222. package/dist/client/assets/{rich-text-link-control-DNolPdT4.js → rich-text-link-control-1OzevT91.js} +1 -1
  223. package/dist/client/assets/{roles-CTJqjtAt.js → roles-B4-k5tdW.js} +1 -1
  224. package/dist/client/assets/route-BI7WVCqk.js +1 -0
  225. package/dist/client/assets/route-InImFr8T.js +1 -0
  226. package/dist/client/assets/route-f38UIBNa.js +1 -0
  227. package/dist/client/assets/{runnable-block-editor-D_v3Y6XS.js → runnable-block-editor-lWMI5Iat.js} +1 -1
  228. package/dist/client/assets/{sandbox-lifecycle-context-YRF_Tndn.js → sandbox-lifecycle-context-C-6m-zOX.js} +1 -1
  229. package/dist/client/assets/{schema-Dx8S5UKv.js → schema-CBdf6nVq.js} +1 -1
  230. package/dist/client/assets/{scroll-area-Ni1BHDLk.js → scroll-area-BtQLVih8.js} +1 -1
  231. package/dist/client/assets/{search-input-C2C6IDR9.js → search-input-BbRzOQHT.js} +1 -1
  232. package/dist/client/assets/{search-toggle-XrzCP3HU.js → search-toggle-ZwfKdVlS.js} +1 -1
  233. package/dist/client/assets/{secret-picker-MfuGbD7z.js → secret-picker-DSwFEi4y.js} +1 -1
  234. package/dist/client/assets/{secrets-BKa3uo1t.js → secrets-DTYS0xGf.js} +1 -1
  235. package/dist/client/assets/sections-editor-CKzkLSPE.js +1 -0
  236. package/dist/client/assets/{select-CKIWskoO.js → select-BqWleZPz.js} +1 -1
  237. package/dist/client/assets/{select-model-By0BbJXF.js → select-model-xT6PieCV.js} +1 -1
  238. package/dist/client/assets/seo-editor-C1si73zi.js +1 -0
  239. package/dist/client/assets/{separator-5ldU5iPA.js → separator-DL6IkOSl.js} +1 -1
  240. package/dist/client/assets/settings-tab-DYkQoTuQ.js +5 -0
  241. package/dist/client/assets/{sheet-CAco8v5i.js → sheet-Bd039v18.js} +1 -1
  242. package/dist/client/assets/{shell-layout-Dc8bj9Qy.js → shell-layout-C8-wrHjg.js} +1 -1
  243. package/dist/client/assets/{skills-CL3xHerv.js → skills-jyfkbBvw.js} +1 -1
  244. package/dist/client/assets/{sso-8H5cn8Jj.js → sso-XXxqJPKX.js} +1 -1
  245. package/dist/client/assets/{suggestion-Bk-rJje-.js → suggestion-B9XVxEmh.js} +1 -1
  246. package/dist/client/assets/{switch-DwueOTYO.js → switch-Ief2Eh48.js} +1 -1
  247. package/dist/client/assets/{synced-repos-CNdTZ24Q.js → synced-repos-DebeUuwF.js} +1 -1
  248. package/dist/client/assets/{tab-icon-glyph-h36dkcJK.js → tab-icon-glyph-BX5R1J_a.js} +1 -1
  249. package/dist/client/assets/{table-hEbek0Ft.js → table-KDJXUCBA.js} +1 -1
  250. package/dist/client/assets/{tabs-CdtjXlat.js → tabs-BRLOXiKA.js} +1 -1
  251. package/dist/client/assets/{task-board-X-0Zbika.js → task-board-BoLv4xpd.js} +1 -1
  252. package/dist/client/assets/{task-route-DR9eVvuK.js → task-route-Bf_mrHm9.js} +1 -1
  253. package/dist/client/assets/{task-status-Dt_MbhgH.js → task-status-CfiPoIDl.js} +1 -1
  254. package/dist/client/assets/taskboard-analytics-CPac4bBU.js +1 -0
  255. package/dist/client/assets/tasks-B_OUV33u.js +1 -0
  256. package/dist/client/assets/{tasks-DFiZjBSg.js → tasks-DyYINS8s.js} +1 -1
  257. package/dist/client/assets/{textarea-3tXmq-Wc.js → textarea-CVlc5gDB.js} +1 -1
  258. package/dist/client/assets/thread-analytics-BLC_N0Cy.js +1 -0
  259. package/dist/client/assets/thread-button-C3p-T2Sx.js +1 -0
  260. package/dist/client/assets/{thread-intent-Y1VdgKwx.js → thread-intent-CqtUmKwo.js} +1 -1
  261. package/dist/client/assets/{thread-route-BRshsfjF.js → thread-route-B6BPC0Ck.js} +1 -1
  262. package/dist/client/assets/{thread-route-CvFAwFyQ.js → thread-route-Dyu25GDz.js} +1 -1
  263. package/dist/client/assets/{thread-sheet-body-CuFuqQDP.js → thread-sheet-body-CgovWoIK.js} +1 -1
  264. package/dist/client/assets/{toggle-group-BBUMgsw-.js → toggle-group-DiLzg8Oz.js} +1 -1
  265. package/dist/client/assets/{toolbar-icon-button-DMjHAwX1.js → toolbar-icon-button-BYksvIS3.js} +1 -1
  266. package/dist/client/assets/{tooltip-CCq3uglU.js → tooltip-DR03IHA1.js} +1 -1
  267. package/dist/client/assets/{track-BQopacYb.js → track-BS0KNS0z.js} +1 -1
  268. package/dist/client/assets/{types-By6vVcI1.js → types-LTX_QS_n.js} +1 -1
  269. package/dist/client/assets/{usage-stats-CUGPskaJ.js → usage-stats-C51kdK-O.js} +1 -1
  270. package/dist/client/assets/{use-ai-providers-BdgkW-rz.js → use-ai-providers-CoMpro3i.js} +1 -1
  271. package/dist/client/assets/{use-automations-DRY01_uG.js → use-automations-DJNilpnc.js} +1 -1
  272. package/dist/client/assets/{use-autosave-BKedxvfh.js → use-autosave-BdgUy-0v.js} +1 -1
  273. package/dist/client/assets/use-chat-layout-state-_HZU5xG7.js +1 -0
  274. package/dist/client/assets/{use-connect-companion-BQlD5V75.js → use-connect-companion-Bv9Pb3sO.js} +1 -1
  275. package/dist/client/assets/{use-connection-B1Onu2Kt.js → use-connection-Dqt9FsoJ.js} +1 -1
  276. package/dist/client/assets/{use-copy-DmHXHCnz.js → use-copy-Cq1WnAZO.js} +1 -1
  277. package/dist/client/assets/{use-create-virtual-mcp-fQ6K6_pG.js → use-create-virtual-mcp-D0ynfXjq.js} +1 -1
  278. package/dist/client/assets/{use-date-fns-locale-C185nROT.js → use-date-fns-locale-D8lzkql1.js} +1 -1
  279. package/dist/client/assets/{use-debounced-autosave-BRJCxv7e.js → use-debounced-autosave-DcBd_wy0.js} +1 -1
  280. package/dist/client/assets/{use-debounced-value-yPMYT1PN.js → use-debounced-value-CQlodPiq.js} +1 -1
  281. package/dist/client/assets/{use-deco-credits-CrxCz8CE.js → use-deco-credits-DKE8CKUB.js} +1 -1
  282. package/dist/client/assets/{use-decopilot-events-CypL9wDE.js → use-decopilot-events-CRlKPkfk.js} +1 -1
  283. package/dist/client/assets/{use-delete-connection-BM3IJ70N.js → use-delete-connection-CTCZXhIi.js} +1 -1
  284. package/dist/client/assets/{use-deployment-admin-DeIDIzSg.js → use-deployment-admin-BDx0zwoX.js} +1 -1
  285. package/dist/client/assets/{use-fast-preview-draft-url-DGgr9dv2.js → use-fast-preview-draft-url--h9Tv0zG.js} +1 -1
  286. package/dist/client/assets/{use-file-configs-CLG1iL92.js → use-file-configs-Dm5QQPiU.js} +1 -1
  287. package/dist/client/assets/{use-infinite-scroll-9-lAGo5q.js → use-infinite-scroll-CQNm1p1Z.js} +1 -1
  288. package/dist/client/assets/{use-join-requests-BhpyUEa7.js → use-join-requests-Bygz0bo8.js} +1 -1
  289. package/dist/client/assets/use-main-panel-tabs-BhuNnd2h.js +1 -0
  290. package/dist/client/assets/{use-mcp-auth-status-e-d864j-.js → use-mcp-auth-status-CSk5HQ_I.js} +1 -1
  291. package/dist/client/assets/{use-mcp-client-CFwJWbBp.js → use-mcp-client-BUxJmD4z.js} +1 -1
  292. package/dist/client/assets/{use-mcp-prompts-Dt5SCeuL.js → use-mcp-prompts-BbeFHvZR.js} +1 -1
  293. package/dist/client/assets/{use-mcp-tools-Ddw8pP4s.js → use-mcp-tools-Bbmi6C0T.js} +1 -1
  294. package/dist/client/assets/{use-members-o--3mm1V.js → use-members-D5SND9MM.js} +1 -1
  295. package/dist/client/assets/{use-mobile-BcAqan0X.js → use-mobile-DPqh4jRn.js} +1 -1
  296. package/dist/client/assets/{use-navigate-to-agent-CjjoA5M6.js → use-navigate-to-agent-D9zMng25.js} +1 -1
  297. package/dist/client/assets/use-new-blocks-editor-D6z95MNv.js +1 -0
  298. package/dist/client/assets/{use-open-billing-url-m1RP8Kag.js → use-open-billing-url-BvxQsl9r.js} +1 -1
  299. package/dist/client/assets/{use-org-auth-client-DEUGdiVk.js → use-org-auth-client--nyW1O8e.js} +1 -1
  300. package/dist/client/assets/{use-org-fs-BSupMC3v.js → use-org-fs-DSuvAHdS.js} +1 -1
  301. package/dist/client/assets/{use-org-repo-syncs-O-NtvfvJ.js → use-org-repo-syncs-DNj_tgaw.js} +1 -1
  302. package/dist/client/assets/{use-org-sso-C8eq4Vdd.js → use-org-sso-DzOXFkj8.js} +1 -1
  303. package/dist/client/assets/{use-organization-roles-reY1_o4k.js → use-organization-roles-DN9XQYP6.js} +1 -1
  304. package/dist/client/assets/{use-organization-settings-DiTNcxQS.js → use-organization-settings-BrhF1m2_.js} +1 -1
  305. package/dist/client/assets/{use-panel-navigate-CFUA8opi.js → use-panel-navigate-DSVmT0jD.js} +1 -1
  306. package/dist/client/assets/{use-project-scope-nSXqOJGj.js → use-project-scope-Bo2r-DyF.js} +1 -1
  307. package/dist/client/assets/use-recent-apps-BB5-9Ae6.js +1 -0
  308. package/dist/client/assets/{use-releases-BbGaY8US.js → use-releases-DVJxEffL.js} +1 -1
  309. package/dist/client/assets/{use-reports-diagnostic-BT8MtXS3.js → use-reports-diagnostic-BnOhK7Bb.js} +1 -1
  310. package/dist/client/assets/{use-secrets-FJu3iWhY.js → use-secrets-DRwQEz1S.js} +1 -1
  311. package/dist/client/assets/{use-section-preview-base-CxPC0M-d.js → use-section-preview-base-B_v6WwFH.js} +1 -1
  312. package/dist/client/assets/{use-session-runtime-CNsfPJpj.js → use-session-runtime-DSwirXrC.js} +1 -1
  313. package/dist/client/assets/{use-tags-BXGxCIku.js → use-tags-DlHH4Qi1.js} +1 -1
  314. package/dist/client/assets/{use-task-board-analytics-DNKSgirc.js → use-task-board-analytics-CUnizIez.js} +1 -1
  315. package/dist/client/assets/{use-task-board-events-C7j5aBlD.js → use-task-board-events-4sCrjL4g.js} +1 -1
  316. package/dist/client/assets/{use-task-metadata-D3Ciwarw.js → use-task-metadata-DcX45smp.js} +1 -1
  317. package/dist/client/assets/{use-thread-analytics-D27BLIsa.js → use-thread-analytics-C1PD-wKd.js} +1 -1
  318. package/dist/client/assets/{use-thread-outputs-D0UmTPT7.js → use-thread-outputs-DXHpolX2.js} +1 -1
  319. package/dist/client/assets/useInfiniteQuery-DK0olIK3.js +1 -0
  320. package/dist/client/assets/{useQueries-CrAKGEfH.js → useQueries-D5KYPRzB.js} +1 -1
  321. package/dist/client/assets/useSuspenseInfiniteQuery-CoicqEC4.js +1 -0
  322. package/dist/client/assets/{users-CQYodV6R.js → users-DwbIuW3C.js} +1 -1
  323. package/dist/client/assets/{utils-D94emI8J.js → utils-VHhyqMwa.js} +1 -1
  324. package/dist/client/assets/variant-calendar-Nce7TSd8.js +1 -0
  325. package/dist/client/assets/{variant-matcher-override-BFWepI_H.js → variant-matcher-override-D18XaBSZ.js} +1 -1
  326. package/dist/client/assets/{view-mode-toggle-a9S8LD9H.js → view-mode-toggle-CqfMj8Tg.js} +1 -1
  327. package/dist/client/assets/{virtual-mcp-BC9jxxUg.js → virtual-mcp-CfWdBZM2.js} +1 -1
  328. package/dist/client/index.html +2 -2
  329. package/dist/server/cli.js +1 -1
  330. package/dist/server/server.js +1 -1
  331. package/package.json +1 -1
  332. package/dist/client/assets/agent-analytics-BHngg3aN.js +0 -2
  333. package/dist/client/assets/agent-app-eih7qmuw.js +0 -1
  334. package/dist/client/assets/agent-assets-CojSmNaz.js +0 -1
  335. package/dist/client/assets/agent-automations-BQwnmsqe.js +0 -1
  336. package/dist/client/assets/agent-connect-sources-DC_snIij.js +0 -1
  337. package/dist/client/assets/agent-deck-BHvHS_x2.js +0 -1
  338. package/dist/client/assets/agent-e2e-BScuCsCp.js +0 -1
  339. package/dist/client/assets/agent-experiments-0ZSUWJyV.js +0 -1
  340. package/dist/client/assets/agent-file-A2jLB4uh.js +0 -1
  341. package/dist/client/assets/agent-hosting-C03IBXsD.js +0 -1
  342. package/dist/client/assets/agent-library-Bndr3ZTh.js +0 -1
  343. package/dist/client/assets/agent-library-file-DHNrLn15.js +0 -1
  344. package/dist/client/assets/agent-monitor-C2UpDGeU.js +0 -1
  345. package/dist/client/assets/agent-overview-vGVfOmzC.js +0 -1
  346. package/dist/client/assets/agent-settings-CKUunA9x.js +0 -1
  347. package/dist/client/assets/agent-site-editor-code-DNEtxYix.js +0 -2
  348. package/dist/client/assets/agent-view-Eu0cDk5o.js +0 -1
  349. package/dist/client/assets/api-keys-DTPxsqpA.js +0 -1
  350. package/dist/client/assets/app-editor-OxAoUr_m.js +0 -1
  351. package/dist/client/assets/category-editor-BX5BNfiN.js +0 -1
  352. package/dist/client/assets/context-CHxPejUn.js +0 -1
  353. package/dist/client/assets/discover-1nnz5mE8.js +0 -1
  354. package/dist/client/assets/flat-project-DxrfpqU8.js +0 -1
  355. package/dist/client/assets/home-R2M47XKc.js +0 -1
  356. package/dist/client/assets/index-DFBQfnNq.css +0 -1
  357. package/dist/client/assets/library-CpDr8cUt.js +0 -1
  358. package/dist/client/assets/match-site-slug-config-D3fUJ6vX.js +0 -1
  359. package/dist/client/assets/openai-conversation-Bidm8HKX.js +0 -3
  360. package/dist/client/assets/post-calendar-DVsOpmKX.js +0 -1
  361. package/dist/client/assets/project-feed-DsVk1K7o.js +0 -1
  362. package/dist/client/assets/project-reports-DKz6hsTO.js +0 -1
  363. package/dist/client/assets/project-tasks-DEHeH6xm.js +0 -1
  364. package/dist/client/assets/record-editor-BG6JZBAo.js +0 -1
  365. package/dist/client/assets/redirect-editor-BSixOpkn.js +0 -1
  366. package/dist/client/assets/reports-DQHzs4c2.js +0 -1
  367. package/dist/client/assets/route-C4g7C29_.js +0 -1
  368. package/dist/client/assets/route-iDn0dH_W.js +0 -1
  369. package/dist/client/assets/route-mD1G8miY.js +0 -1
  370. package/dist/client/assets/sections-editor-DQXGqVXO.js +0 -1
  371. package/dist/client/assets/seo-editor-BI6yz1SI.js +0 -1
  372. package/dist/client/assets/settings-tab-DjCUiptn.js +0 -5
  373. package/dist/client/assets/taskboard-analytics-DGE69gm2.js +0 -1
  374. package/dist/client/assets/tasks-DEV8yvUO.js +0 -1
  375. package/dist/client/assets/thread-analytics-Batrg_G6.js +0 -1
  376. package/dist/client/assets/thread-button-1m1VWTYv.js +0 -1
  377. package/dist/client/assets/use-chat-layout-state-ffnO3cas.js +0 -1
  378. package/dist/client/assets/use-main-panel-tabs-Ex0Ebdb5.js +0 -1
  379. package/dist/client/assets/use-new-blocks-editor-DqR1bcfV.js +0 -1
  380. package/dist/client/assets/use-project-native-view-presence-xh82wo73.js +0 -1
  381. package/dist/client/assets/useInfiniteQuery-DXdUQ48R.js +0 -1
  382. package/dist/client/assets/useSuspenseInfiniteQuery-BmynEKtw.js +0 -1
  383. package/dist/client/assets/variant-calendar-Dfcw4asd.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aL as kr,c as B,o as Mn,m as Q0,K as Q9,b as u9,j as r,l as H,B as h9,Z as Pn,aE as Nr,e as In,r as I,t as A9,aM as Tr,aN as J9,n as _r,aK as Fn,F as ce,af as Le,G as N9,H as G9,I as H9,aO as de,aJ as Ie,aI as Cr,h as x0,aP as Er,E as wr,aQ as Ar,ao as Rr,ap as Mr}from"./index-CeFrI_-f.js";import{u as Ke}from"./use-session-runtime-CNsfPJpj.js";import{u as Ge,H as Pr,g as On,I as D9,J as Dn,r as F9,K as Ir,b as b9,P as X9,L as e0,N as I0,M as S9,O as Ft,Q as u0,C as Fr,w as Or,x as Dr,y as $r,t as zr,l as Br,T as $n,m as zn,U as Ot,V as Vr,W as Ur,X as Bn,Y as _0,k as Kr,Z as Gr,v as Hr,_ as qr,$ as Yr,a0 as Wr}from"./claim-phase-copy-Byy3Q6us.js";import{e as Vn}from"./backoff-8mStPHYB.js";import{a8 as Jr,a9 as Zr,aa as Qr,ab as Xr,ac as ei,ad as ti,ae as ni,af as si,Y as ri,ag as Un,ah as ue,x as ii,ai as Kn,a3 as A0,W as oi,w as ai,b as l0,aj as li,ak as Dt,al as ci,a7 as Li,F as di,am as ui,an as fi}from"./agent-icon-C8wu-T9B.js";import{i as Gn}from"./Sun-CttdH4aG.js";import{S as $t}from"./sandbox-start-errors-BK_aDCyt.js";import{G as mi}from"./pair-BqbLIj1t.js";import{i as q9}from"./Check-soPAeKca.js";import{i as He,c as pi,d as hi,e as gi,b as xi}from"./Tool01-BVUW3itu.js";import{C as fe,a as me,b as K9,e as f0,c as pe,f as qe,d as yi}from"./command-DxWpNp1x.js";import{a as F0,b as O0,P as D0}from"./popover-Dp4MK1ls.js";import{s as vi,a as bi,b as ji}from"./utils-D94emI8J.js";import{u as Hn}from"./chat-context-DSOY14Dl.js";import{n as qn}from"./LinkExternal01-CkkaHQ43.js";import{i as Yn}from"./X-Dp6J1NZk.js";import{S as Wn}from"./scroll-area-Ni1BHDLk.js";import{T as _9,a as C9,b as E9}from"./tooltip-CCq3uglU.js";import{a as Ye,f as Si}from"./repository-binding-Bye6exhX.js";import{M as Jn}from"./monaco-editor-CyLZqoPt.js";import{C as ki}from"./calendar-C_3zvYnn.js";import{I as R9}from"./input-CQlMbJrR.js";import{T as Ni}from"./textarea-3tXmq-Wc.js";import{L as $9}from"./label-CTaphTs2.js";import{u as T9}from"./use-new-blocks-editor-DqR1bcfV.js";import{i as Ti}from"./XClose-CVE8Vs6Q.js";import{s as y0}from"./Plus-kHt_8stA.js";import{E as s0,M as _i,m as Ci,g as $0,u as Ei,s as wi,a as Ai,b as Ri}from"./index-CBLynFUh.js";import{S as he,b as ge,a as xe,d as ye,c as m0}from"./select-CKIWskoO.js";import{b as Mi}from"./Palette-Bk3UCvKx.js";import{T as M9,R as Pi,u as We,C as Je,a as Ze,b as p0,s as Qe,K as Xe,P as et,D as tt,c as nt,S as st,v as rt,d as it,e as X0}from"./rich-text-link-control-DNolPdT4.js";import{S as ot}from"./switch-DwueOTYO.js";import{a as ve}from"./Copy01-Ck1CQt9c.js";import{s as Ii,a as h0}from"./Image01-AxefwT4b.js";import{s as r0}from"./Trash01-CKOL_3ja.js";import{t as z0}from"./ChevronUp-B4upaCys.js";import{d as N0,a as Zn}from"./UserSquare-D1bS09Fm.js";import{C as Fi}from"./combobox-BIrYGyuF.js";import{A as Oi,a as Di,b as $i,c as zi,g as Bi,d as Vi,e as Ui,f as Ki}from"./alert-dialog-DJcNPQjm.js";import{d as at,h as lt,c as ct,e as Qn,b as Lt,D as dt}from"./dialog-1dafL4bi.js";import{b as ut}from"./sandbox-url-D3mC8qhT.js";import{b as Fe}from"./ZoomOut-ekFDVqJi.js";import{i as B0}from"./Upload01-DlR8CSo4.js";import{i as Xn}from"./AlertCircle-CQU3FO2-.js";import{i as es}from"./DotsVertical-DMsZySzr.js";import{S as Gi}from"./search-input-C2C6IDR9.js";import{T as Hi,a as qi,c as Yi,b as Wi}from"./tabs-CdtjXlat.js";import{u as Ji}from"./use-debounced-value-yPMYT1PN.js";import{u as Zi,a as ts}from"./use-file-configs-CLG1iL92.js";import{u as Qi,a as ft,i as ns,e as Xi,b as zt,f as e1}from"./asset-utils-BV839mqx.js";import{m as ss}from"./match-site-slug-config-D3fUJ6vX.js";import{a as t1,T as n1}from"./toggle-group-BBUMgsw-.js";import{g as s1,f as r1}from"./thread-intent-Y1VdgKwx.js";import{o as i1}from"./sandbox-git-api-B1R0585s.js";const mt=kr("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),o1="website/loaders/secret.ts",a1=["website/actions/secrets/encrypt.ts","$live/actions/secrets/encrypt.ts"],l1=/^(?:[0-9a-f]{2})*$/i;function R0(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function pt(t){return typeof t=="string"&&l1.test(t)}class c1 extends Error{constructor(e){super(`Secret at "${e}" is not encrypted. Re-enter it in the Secret field so it is encrypted before saving.`),this.path=e,this.name="PlaintextSecretError"}path}function Oe(t,e=""){if(Array.isArray(t))return t.map((s,i)=>Oe(s,`${e}/${i}`));if(!t||typeof t!="object")return t;const n=Object.entries(t);if(R0(t)){const s=t.encrypted;if(s!==void 0&&!pt(s))throw new c1(e||"/");return Object.fromEntries(n.filter(([i])=>i!=="value"))}return Object.fromEntries(n.map(([s,i])=>[s,Oe(i,`${e}/${s}`)]))}function ht(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function Bt(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function rs(t,e){return ut(t,e)}function L1(t,e){return ut(t,"preview-fetch",{path:e})}function d1(t){return rs(t,"preview-invoke")}function V4(t){return rs(t,"catalog-invoke")}function is(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function u1(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&is(n))return n}return null}function os(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??u1();return n&&is(n)?new URL(e,n).toString():L1(t,e)}function f1(t){return os(t,"/.decofile")}function m1(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function Vt(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function as(t,e){const n=ut(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=m1(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const a=new Error(`Failed to read ${e}: ${s.status}`);throw a.status=s.status,a}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(vi(o.content))}}catch{return{kind:"unavailable"}}}async function p1(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function gt(t){return Ye(t)?.metadata?.runtime?.path??null}function ls(t){const e=`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`;return t.localPreviewUrl?`${e}:local:${t.localPreviewUrl}`:e}function U4(t,e){const n=B.c(16),{url:s}=Ge(t?.virtualMcpId),i=!!s,o=t?ls({...t,localPreviewUrl:s}):"",a=e?.fetchEnabled??!0,l=gt(t?.virtualMcpId),c=Ke(t?.virtualMcpId).runtime==="cms",L=Mn(),d=Q9.decofile(o);let u;n[0]!==c||n[1]!==a||n[2]!==i||n[3]!==s||n[4]!==l||n[5]!==t||n[6]!==L?(u=async()=>{if(i){const v=await fetch(new URL("/.decofile",s).toString(),{cache:"no-store"}).catch(x1),k=v?.ok?Bt(await v.text()):null;if(k)return k;const j=new Error("decofile unavailable (local tunnel unreachable)");throw j.status=502,j}if(c)return Pr(L,t);const p=()=>as(t,ht(l,".deco/blocks.gen.json"));if(a){const v=await fetch(f1(t),{cache:"no-store"}).catch(g1);if(v?.ok){const x=Bt(await v.text());if(x)return x}const k=await p();if(k.kind==="data")return k.data;const j=new Error(`Failed to fetch decofile: ${v?.status??"network error"}`);throw j.status=Vt({liveOk:!!v?.ok,liveStatus:v?.status,committedAbsent:k.kind==="absent"}),j}const g=await p();if(g.kind==="data")return g.data;const h=new Error("decofile unavailable (preview down, no committed snapshot)");throw h.status=Vt({liveOk:!1,committedAbsent:g.kind==="absent"}),h},n[0]=c,n[1]=a,n[2]=i,n[3]=s,n[4]=l,n[5]=t,n[6]=L,n[7]=u):u=n[7];const f=!!t;let y;n[8]!==c||n[9]!==i?(y=(p,g)=>{if(c||i)return p<3;const h=g.status;return h!==502&&h!==404&&p<2},n[8]=c,n[9]=i,n[10]=y):y=n[10];let m;return n[11]!==d||n[12]!==u||n[13]!==f||n[14]!==y?(m={queryKey:d,queryFn:u,enabled:f,staleTime:3e4,retry:y,retryDelay:h1},n[11]=d,n[12]=u,n[13]=f,n[14]=y,n[15]=m):m=n[15],Q0(m)}function h1(t){return Vn(5e3,1e3,t,2,0)}function g1(){return null}function x1(){return null}const y1=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function v1(t){return t.includes("matchers")||t.includes("Match")}function cs(t,e){const n=t.__resolveType;return typeof n!="string"||!n||y1.has(n)?!1:e?Ir(e,n):v1(n)}function b1(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!D9(s)||Dn(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;cs(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function v0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!D9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:cs(i,n)}function j1(t,e,n){return v0(t,e,n)?t?.__resolveType??null:null}function Ls(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(v0(t,e,n)){const a=e[s]??{},l=a.__resolveType??s,{__resolveType:c,name:L,...d}=a;return{resolveType:l,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function ds(t,e,n){const s=Ls(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function xt(t,e,n){if(t)return v0(t,e,n)?ds(t,e,n):t}function T0(t,e,n,s){if(!t)return"Default";if(v0(t,e,s)){const i=t.__resolveType??"",o=e[i];return On(i,o)}return n(t)}function S1(t,e,n){return{__resolveType:t,...e,name:n}}function k1(t){return{__resolveType:t}}function N1(t,e,n){const s=Ls(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function T1(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=F9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function _1(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function C1(t){return Q9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function K4(t,e){const n=B.c(21),{url:s}=Ge(t?.virtualMcpId),i=!!s,o=i||(e?.fetchEnabled??!0),a=s??t?.previewUrl,l=gt(t?.virtualMcpId),{previewServerUrl:c,runtime:L}=Ke(t?.virtualMcpId),d=!i&&L==="cms";let u;n[0]!==t||n[1]!==a||n[2]!==c?(u=t?C1({...t,previewUrl:a,productionUrl:c}):Q9.liveMeta(""),n[0]=t,n[1]=a,n[2]=c,n[3]=u):u=n[3];let f;n[4]!==d||n[5]!==o||n[6]!==i||n[7]!==l||n[8]!==t||n[9]!==a||n[10]!==c?(f=async()=>{const h=w1,v=()=>d?p1(t):as(t,ht(l,".deco/meta.gen.json")),k=i&&a?[{kind:"live",baseUrl:a}]:_1({fetchEnabled:o,previewUrl:a,productionUrl:c,fastPreviewActive:d});for(const x of k){if(x.kind==="committed"){const S=await v();if(S.kind==="data")return S.data;continue}const b=await h(x.baseUrl);if(b)return b}const j=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw j.status=502,j},n[4]=d,n[5]=o,n[6]=i,n[7]=l,n[8]=t,n[9]=a,n[10]=c,n[11]=f):f=n[11];const y=!!t,m=e?.refetchInterval;let p;n[12]!==d||n[13]!==i?(p=(h,v)=>(d||i||v.status!==502)&&h<3,n[12]=d,n[13]=i,n[14]=p):p=n[14];let g;return n[15]!==u||n[16]!==f||n[17]!==y||n[18]!==m||n[19]!==p?(g={queryKey:u,queryFn:f,enabled:y,refetchInterval:m,refetchIntervalInBackground:!1,staleTime:3e5,retry:p,retryDelay:E1},n[15]=u,n[16]=f,n[17]=y,n[18]=m,n[19]=p,n[20]=g):g=n[20],Q0(g)}function E1(t){return Vn(5e3,1e3,t,2,0)}async function w1(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(A1);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function A1(){return null}function Ee(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function G4(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=b9(i);if(!o&&i!==""&&D9(i)&&i in e)return{index:s,resolveType:i,label:Ee(i,s,e),isLazy:!1,isSavedBlock:!0};const a=o?n.section:void 0,l=o?a?.__resolveType??"":i;if(l===X9||l===e0){const L=o?a:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===I0){const y=d[0]?.value??{};let m=y.__resolveType??"";const p=b9(m);let g=y;if(p){const h=y.section;m=h?.__resolveType??m,h&&(g=h)}if(m===X9||m===e0){const v=(Array.isArray(g.variants)?g.variants:[])[0]?.value?.__resolveType,k=v?S9(v):"Section";return{index:s,resolveType:i,label:`Variants of ${k}`,variantOf:k,isHidden:!0,isLazy:p}}return m!==""&&D9(m)&&m in e?{index:s,resolveType:i,label:Ee(m,s,e),isHidden:!0,isLazy:p,isSavedBlock:!0}:{index:s,resolveType:i,label:S9(m)||`Section ${s+1}`,isHidden:!0,isLazy:p}}const u=d[0]?.value?.__resolveType,f=u?S9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,variantOf:f,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&D9(c)&&c in e?{index:s,resolveType:i,label:Ee(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:S9(c)||`Section ${s+1}`,isLazy:o}})}function us(t){const e=t.__resolveType??"";return b9(e)?t.section??t:t}function ee(t){const i=(b9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==I0?null:i?.value??null}function H4(t){const e=us(t);return{__resolveType:e0,variants:[{value:e,rule:{__resolveType:I0}}]}}function q4(t){const e=t.__resolveType??"";if(!e)return null;if(b9(e))return t.section??null;const n=ee(t);return n?b9(n.__resolveType??"")?n:{__resolveType:Ft,section:us(n)}:{__resolveType:Ft,section:t}}function G0(t){const e=t.__resolveType??"";if(!e)return null;if(b9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function Y4(t){const e=ee(t);if(e)return G0(e);if(b9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=ee(s);return G0(i||s)}return G0(t)}function W4(t){return ee(t)}const R1=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function yt(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:R1.includes(e)||e.includes("always")}function M1(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>yt(s.rule));return n!==-1?n:e.length-1}function J4(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=M1(n),o=s[i]?.value;if(!o)return null;const a=structuredClone(o);return e.isLazy?{...t,section:a}:a}function fs(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function Z4(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function Q4(t,e){const n=t.__resolveType??"";if(!n)return null;if(b9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function P1(t,e){const n=t.__resolveType??"";return b9(n)?{...t,section:e}:e}function I1(t,e,n){return e.isLazy?{...t,section:n}:n}function X4(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:P1(o,n)},{...t,variants:s}}function e5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function t5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function n5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function s5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function De(t){return{rule:u0(),value:structuredClone(t)}}function ms(t,e){return{...e,__resolveType:e0,variants:t}}function r5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function F1(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=fs(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function O1(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=F1(t,e);if(!s)return null;const i=ms([De(s),De(s)]);return e.isLazy?{...t,section:i}:i}function i5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=fs(t,e);if(!i)return null;const o=i.variants??[],a=o[o.length-1]?.value;if(!a)return null;const l=ms([...o,De(a)],i);return{section:I1(t,e,l),newVariantIndex:o.length}}const s=O1(t,e);return s?{section:s,newVariantIndex:1}:null}function be(t){return t.anyOfRefs?.some(e=>e.resolveType!==X9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function D1(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===e0&&Array.isArray(e.variants)}function te(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===X9}function $1(t){if(!te(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function z1(t,e){if(!te(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:u0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function o5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function a5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const a=o[n];return Array.isArray(a?.value)?a.value:[]}}return[]}function B1(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>T0(c.rule,e,n)),a=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),l={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=a[d]??1;let f=d;return u>1&&(l[d]=(l[d]??0)+1,f=`${d} ${l[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function k0(t){return{rule:u0(),value:t}}function L0(t,e){return{...e,__resolveType:X9,variants:t}}function l5(t,e){const n=structuredClone(e);if(Array.isArray(t))return L0([k0(t),k0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?L0([...s.variants,k0(n)],s):null}return L0([k0([]),k0(n)])}function c5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function L5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function d5(t,e){if(e.length===0)return L0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!yt(s))return L0(e,t);if(Array.isArray(n?.value))return n.value}return L0(e,t)}function V1(t,e,n){const s=[];for(const[o,a]of Object.entries(t))o!==e&&s.push(a);const i=new Set;for(;s.length>0;){const o=s.pop();if(!(!o||typeof o!="object")&&!i.has(o)){if(i.add(o),Array.isArray(o)){for(const a of o)s.push(a);continue}n(o);for(const a of Object.values(o))s.push(a)}}}function u5(t,e,n){if(!e)return 0;let s=0;return V1(t,e,i=>{i.__resolveType===e&&v0(i,t,n)&&s++}),s}const U1={provision:0,cloning:1,install:2,dev:3};function K1(t){return U1[t.step]}const Ut=48,ps=28,hs=3,G1=(()=>{const t=[];let e=0;for(let n=0;n<Ut;n++)n===ps?t.push(null):(t.push(e/(Ut-1)*hs),e++);return t})();function H1(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function q1(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Fr[e.kind].long:n[t.step]}const O9="bg-foreground/[0.05]",P9="bg-foreground/[0.09]",Y1=Array.from({length:35},()=>Math.random()*1.8),W1=Array.from({length:35},()=>Math.random()<.4);function J1(t){const e=B.c(31),{progress:n,claimPhase:s}=t,i=u9();let o;e[0]!==n?(o=K1(n),e[0]=n,e[1]=o):o=e[1];const a=o;let l;e[2]!==s||e[3]!==n||e[4]!==i?(l=q1(n,s,H1(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=l):l=e[5];const c=l;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(mi,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Z1,{}),e[10]=f):f=e[10];let y;e[11]!==a?(y=r.jsx(H0,{phase:0,current:a,children:f}),e[11]=a,e[12]=y):y=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(X1,{}),e[13]=m):m=e[13];let p;e[14]!==a?(p=r.jsx(H0,{phase:1,current:a,children:m}),e[14]=a,e[15]=p):p=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(eo,{}),e[16]=g):g=e[16];let h;e[17]!==a?(h=r.jsx(H0,{phase:2,current:a,children:g}),e[17]=a,e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(no,{}),e[19]=v):v=e[19];let k;e[20]!==a?(k=r.jsx(H0,{phase:3,current:a,children:v}),e[20]=a,e[21]=k):k=e[21];let j;e[22]!==h||e[23]!==k||e[24]!==y||e[25]!==p?(j=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[y,p,h,k]}),e[22]=h,e[23]=k,e[24]=y,e[25]=p,e[26]=j):j=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
1
+ import{aL as kr,c as B,o as Mn,m as Q0,K as Q9,b as u9,j as r,l as H,B as h9,Z as Pn,aE as Nr,e as In,r as I,t as A9,aM as Tr,aN as J9,n as _r,aK as Fn,F as ce,af as Le,G as N9,H as G9,I as H9,aO as de,aJ as Ie,aI as Cr,h as x0,aP as Er,E as wr,aQ as Ar,ao as Rr,ap as Mr}from"./index-DUoAE5ST.js";import{u as Ke}from"./use-session-runtime-DSwirXrC.js";import{u as Ge,H as Pr,g as On,I as D9,J as Dn,r as F9,K as Ir,b as b9,P as X9,L as e0,N as I0,M as S9,O as Ft,Q as u0,C as Fr,w as Or,x as Dr,y as $r,t as zr,l as Br,T as $n,m as zn,U as Ot,V as Vr,W as Ur,X as Bn,Y as _0,k as Kr,Z as Gr,v as Hr,_ as qr,$ as Yr,a0 as Wr}from"./claim-phase-copy-DAgG3vfo.js";import{e as Vn}from"./backoff-8mStPHYB.js";import{a8 as Jr,a9 as Zr,aa as Qr,ab as Xr,ac as ei,ad as ti,ae as ni,af as si,Y as ri,ag as Un,ah as ue,x as ii,ai as Kn,a3 as A0,W as oi,w as ai,b as l0,aj as li,ak as Dt,al as ci,a7 as Li,F as di,am as ui,an as fi}from"./agent-icon-B1JUa-pK.js";import{i as Gn}from"./Sun-CepnW0AC.js";import{S as $t}from"./sandbox-start-errors-BK_aDCyt.js";import{G as mi}from"./pair-9c3wI9G4.js";import{i as q9}from"./Check-CMF2Ywph.js";import{i as He,c as pi,d as hi,e as gi,b as xi}from"./Tool01-gx1zwKcn.js";import{C as fe,a as me,b as K9,e as f0,c as pe,f as qe,d as yi}from"./command-BaUKjhoV.js";import{a as F0,b as O0,P as D0}from"./popover-LjbxD4kl.js";import{s as vi,a as bi,b as ji}from"./utils-VHhyqMwa.js";import{u as Hn}from"./chat-context-fDVt7FJu.js";import{n as qn}from"./LinkExternal01-ZFH-yoZN.js";import{i as Yn}from"./X-AdrRw9Zp.js";import{S as Wn}from"./scroll-area-BtQLVih8.js";import{T as _9,a as C9,b as E9}from"./tooltip-DR03IHA1.js";import{a as Ye,f as Si}from"./repository-binding-B_NhY5XW.js";import{M as Jn}from"./monaco-editor-BBA-2xe3.js";import{C as ki}from"./calendar-yvfvBAzS.js";import{I as R9}from"./input-yIPgkwGw.js";import{T as Ni}from"./textarea-CVlc5gDB.js";import{L as $9}from"./label-B5D3oXM0.js";import{u as T9}from"./use-new-blocks-editor-D6z95MNv.js";import{i as Ti}from"./XClose-DXJf2S1e.js";import{s as y0}from"./Plus-Dc5RtznQ.js";import{E as s0,M as _i,m as Ci,g as $0,u as Ei,s as wi,a as Ai,b as Ri}from"./index-T9qmd0M1.js";import{S as he,b as ge,a as xe,d as ye,c as m0}from"./select-BqWleZPz.js";import{b as Mi}from"./Palette-D5d1Mblr.js";import{T as M9,R as Pi,u as We,C as Je,a as Ze,b as p0,s as Qe,K as Xe,P as et,D as tt,c as nt,S as st,v as rt,d as it,e as X0}from"./rich-text-link-control-1OzevT91.js";import{S as ot}from"./switch-Ief2Eh48.js";import{a as ve}from"./Copy01-Dd4ky6ZP.js";import{s as Ii,a as h0}from"./Image01-BdsDNVox.js";import{s as r0}from"./Trash01-DliBU2bP.js";import{t as z0}from"./ChevronUp-D_quOjFH.js";import{d as N0,a as Zn}from"./UserSquare-DcFHmf0l.js";import{C as Fi}from"./combobox-VNs66YBC.js";import{A as Oi,a as Di,b as $i,c as zi,g as Bi,d as Vi,e as Ui,f as Ki}from"./alert-dialog-CIK2aHDv.js";import{d as at,h as lt,c as ct,e as Qn,b as Lt,D as dt}from"./dialog-BgtCSZyf.js";import{b as ut}from"./sandbox-url-D3mC8qhT.js";import{b as Fe}from"./ZoomOut-Bqjt8gJB.js";import{i as B0}from"./Upload01-CQpa1a9n.js";import{i as Xn}from"./AlertCircle-DsOSKvzV.js";import{i as es}from"./DotsVertical-kOg4pODr.js";import{S as Gi}from"./search-input-BbRzOQHT.js";import{T as Hi,a as qi,c as Yi,b as Wi}from"./tabs-BRLOXiKA.js";import{u as Ji}from"./use-debounced-value-CQlodPiq.js";import{u as Zi,a as ts}from"./use-file-configs-Dm5QQPiU.js";import{u as Qi,a as ft,i as ns,e as Xi,b as zt,f as e1}from"./asset-utils-vxXtnPR8.js";import{b as ss}from"./use-chat-layout-state-_HZU5xG7.js";import{a as t1,T as n1}from"./toggle-group-DiLzg8Oz.js";import{g as s1,f as r1}from"./thread-intent-CqtUmKwo.js";import{o as i1}from"./sandbox-git-api-B1R0585s.js";const mt=kr("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),o1="website/loaders/secret.ts",a1=["website/actions/secrets/encrypt.ts","$live/actions/secrets/encrypt.ts"],l1=/^(?:[0-9a-f]{2})*$/i;function R0(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t.__resolveType;return typeof e=="string"&&(e.endsWith("/secret.ts")||e.includes("loaders/secret"))}function pt(t){return typeof t=="string"&&l1.test(t)}class c1 extends Error{constructor(e){super(`Secret at "${e}" is not encrypted. Re-enter it in the Secret field so it is encrypted before saving.`),this.path=e,this.name="PlaintextSecretError"}path}function Oe(t,e=""){if(Array.isArray(t))return t.map((s,i)=>Oe(s,`${e}/${i}`));if(!t||typeof t!="object")return t;const n=Object.entries(t);if(R0(t)){const s=t.encrypted;if(s!==void 0&&!pt(s))throw new c1(e||"/");return Object.fromEntries(n.filter(([i])=>i!=="value"))}return Object.fromEntries(n.map(([s,i])=>[s,Oe(i,`${e}/${s}`)]))}function ht(t,e){const n=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return n?`${n}/${e}`:e}function Bt(t){let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||Array.isArray(e)?null:e}function rs(t,e){return ut(t,e)}function L1(t,e){return ut(t,"preview-fetch",{path:e})}function d1(t){return rs(t,"preview-invoke")}function V4(t){return rs(t,"catalog-invoke")}function is(t){try{const{hostname:e}=new URL(t);return e==="localhost"||e.endsWith(".localhost")||e==="127.0.0.1"||e==="::1"}catch{return!1}}function u1(){if(typeof document>"u")return null;const t=Array.from(document.querySelectorAll("iframe"));for(const e of t){const n=e.getAttribute("src");if(n&&is(n))return n}return null}function os(t,e){const n=t.previewUrl??t.getFallbackPreviewUrl?.()??u1();return n&&is(n)?new URL(e,n).toString():L1(t,e)}function f1(t){return os(t,"/.decofile")}function m1(t){return t===400?"absent":t===404?"unavailable":t>=200&&t<300?"ok":"error"}function Vt(t){return t.liveOk||t.committedAbsent?404:t.liveStatus??502}async function as(t,e){const n=ut(t,"read"),s=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,full:!0})}),i=m1(s.status);if(i==="absent")return{kind:"absent"};if(i==="unavailable")return{kind:"unavailable"};if(i==="error"){const a=new Error(`Failed to read ${e}: ${s.status}`);throw a.status=s.status,a}const o=await s.json();if(typeof o.content!="string")return{kind:"unavailable"};try{return{kind:"data",data:JSON.parse(vi(o.content))}}catch{return{kind:"unavailable"}}}async function p1(t){const e=`/api/${t.orgSlug}/decofile/${encodeURIComponent(t.virtualMcpId)}/${encodeURIComponent(t.branch)}/meta`,n=await fetch(e,{cache:"no-store"});if(n.status===404)return{kind:"absent"};if(!n.ok){const s=new Error(`Failed to read committed meta: ${n.status}`);throw s.status=n.status,s}try{return{kind:"data",data:await n.json()}}catch{return{kind:"unavailable"}}}function gt(t){return Ye(t)?.metadata?.runtime?.path??null}function ls(t){const e=`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`;return t.localPreviewUrl?`${e}:local:${t.localPreviewUrl}`:e}function U4(t,e){const n=B.c(16),{url:s}=Ge(t?.virtualMcpId),i=!!s,o=t?ls({...t,localPreviewUrl:s}):"",a=e?.fetchEnabled??!0,l=gt(t?.virtualMcpId),c=Ke(t?.virtualMcpId).runtime==="cms",L=Mn(),d=Q9.decofile(o);let u;n[0]!==c||n[1]!==a||n[2]!==i||n[3]!==s||n[4]!==l||n[5]!==t||n[6]!==L?(u=async()=>{if(i){const v=await fetch(new URL("/.decofile",s).toString(),{cache:"no-store"}).catch(x1),k=v?.ok?Bt(await v.text()):null;if(k)return k;const j=new Error("decofile unavailable (local tunnel unreachable)");throw j.status=502,j}if(c)return Pr(L,t);const p=()=>as(t,ht(l,".deco/blocks.gen.json"));if(a){const v=await fetch(f1(t),{cache:"no-store"}).catch(g1);if(v?.ok){const x=Bt(await v.text());if(x)return x}const k=await p();if(k.kind==="data")return k.data;const j=new Error(`Failed to fetch decofile: ${v?.status??"network error"}`);throw j.status=Vt({liveOk:!!v?.ok,liveStatus:v?.status,committedAbsent:k.kind==="absent"}),j}const g=await p();if(g.kind==="data")return g.data;const h=new Error("decofile unavailable (preview down, no committed snapshot)");throw h.status=Vt({liveOk:!1,committedAbsent:g.kind==="absent"}),h},n[0]=c,n[1]=a,n[2]=i,n[3]=s,n[4]=l,n[5]=t,n[6]=L,n[7]=u):u=n[7];const f=!!t;let y;n[8]!==c||n[9]!==i?(y=(p,g)=>{if(c||i)return p<3;const h=g.status;return h!==502&&h!==404&&p<2},n[8]=c,n[9]=i,n[10]=y):y=n[10];let m;return n[11]!==d||n[12]!==u||n[13]!==f||n[14]!==y?(m={queryKey:d,queryFn:u,enabled:f,staleTime:3e4,retry:y,retryDelay:h1},n[11]=d,n[12]=u,n[13]=f,n[14]=y,n[15]=m):m=n[15],Q0(m)}function h1(t){return Vn(5e3,1e3,t,2,0)}function g1(){return null}function x1(){return null}const y1=new Set(["website/pages/Page.tsx","$live/pages/LivePage.tsx"]);function v1(t){return t.includes("matchers")||t.includes("Match")}function cs(t,e){const n=t.__resolveType;return typeof n!="string"||!n||y1.has(n)?!1:e?Ir(e,n):v1(n)}function b1(t,e){const n=[];for(const[s,i]of Object.entries(e)){if(s.includes("/")||!D9(s)||Dn(s)||!i||typeof i!="object"||Array.isArray(i))continue;const o=i;cs(o,t)&&n.push({blockKey:s,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return n.sort((s,i)=>(s.name??s.blockKey).localeCompare(i.name??i.blockKey))}function v0(t,e,n){if(!t)return!1;const s=t.__resolveType;if(typeof s!="string"||!D9(s)||!Object.hasOwn(e,s))return!1;const i=e[s];return!i||typeof i!="object"||Array.isArray(i)?!1:cs(i,n)}function j1(t,e,n){return v0(t,e,n)?t?.__resolveType??null:null}function Ls(t,e,n){if(!t)return null;const s=t.__resolveType??"";if(!s)return null;if(v0(t,e,n)){const a=e[s]??{},l=a.__resolveType??s,{__resolveType:c,name:L,...d}=a;return{resolveType:l,data:d,blockKey:s}}const{__resolveType:i,...o}=t;return{resolveType:s,data:o}}function ds(t,e,n){const s=Ls(t,e,n);return s?{__resolveType:s.resolveType,...s.data}:{__resolveType:""}}function xt(t,e,n){if(t)return v0(t,e,n)?ds(t,e,n):t}function T0(t,e,n,s){if(!t)return"Default";if(v0(t,e,s)){const i=t.__resolveType??"",o=e[i];return On(i,o)}return n(t)}function S1(t,e,n){return{__resolveType:t,...e,name:n}}function k1(t){return{__resolveType:t}}function N1(t,e,n){const s=Ls(t,e,n);return s?{resolveType:s.resolveType,formValue:s.data}:{resolveType:"",formValue:{}}}function T1(t,e){const n={__resolveType:t};if(!t||!e)return n;const s=F9(t,e),i=s?.type==="inline-union"?s.inlineUnionBranches?.[0]?.discriminators:void 0;return i?{...n,...i}:n}function _1(t){const e=[];return t.fastPreviewActive?e.push({kind:"committed"}):(t.fetchEnabled&&t.previewUrl&&e.push({kind:"live",baseUrl:t.previewUrl}),e.push({kind:"committed"})),t.productionUrl&&e.push({kind:"production",baseUrl:t.productionUrl}),e}function C1(t){return Q9.liveMeta(t.orgSlug,t.virtualMcpId,t.branch,t.previewUrl??"",t.productionUrl??"")}function K4(t,e){const n=B.c(21),{url:s}=Ge(t?.virtualMcpId),i=!!s,o=i||(e?.fetchEnabled??!0),a=s??t?.previewUrl,l=gt(t?.virtualMcpId),{previewServerUrl:c,runtime:L}=Ke(t?.virtualMcpId),d=!i&&L==="cms";let u;n[0]!==t||n[1]!==a||n[2]!==c?(u=t?C1({...t,previewUrl:a,productionUrl:c}):Q9.liveMeta(""),n[0]=t,n[1]=a,n[2]=c,n[3]=u):u=n[3];let f;n[4]!==d||n[5]!==o||n[6]!==i||n[7]!==l||n[8]!==t||n[9]!==a||n[10]!==c?(f=async()=>{const h=w1,v=()=>d?p1(t):as(t,ht(l,".deco/meta.gen.json")),k=i&&a?[{kind:"live",baseUrl:a}]:_1({fetchEnabled:o,previewUrl:a,productionUrl:c,fastPreviewActive:d});for(const x of k){if(x.kind==="committed"){const S=await v();if(S.kind==="data")return S.data;continue}const b=await h(x.baseUrl);if(b)return b}const j=new Error("live meta unavailable (dev server down, no committed snapshot, no production fallback)");throw j.status=502,j},n[4]=d,n[5]=o,n[6]=i,n[7]=l,n[8]=t,n[9]=a,n[10]=c,n[11]=f):f=n[11];const y=!!t,m=e?.refetchInterval;let p;n[12]!==d||n[13]!==i?(p=(h,v)=>(d||i||v.status!==502)&&h<3,n[12]=d,n[13]=i,n[14]=p):p=n[14];let g;return n[15]!==u||n[16]!==f||n[17]!==y||n[18]!==m||n[19]!==p?(g={queryKey:u,queryFn:f,enabled:y,refetchInterval:m,refetchIntervalInBackground:!1,staleTime:3e5,retry:p,retryDelay:E1},n[15]=u,n[16]=f,n[17]=y,n[18]=m,n[19]=p,n[20]=g):g=n[20],Q0(g)}function E1(t){return Vn(5e3,1e3,t,2,0)}async function w1(t){const e=new URL("/live/_meta",t).href,n=await fetch(e,{cache:"no-store"}).catch(A1);if(!n?.ok)return null;try{return await n.json()}catch{return null}}function A1(){return null}function Ee(t,e,n){const s=n[t];return typeof s?.name=="string"&&s.name||t.replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase())||`Section ${e+1}`}function G4(t,e){return t.map((n,s)=>{const i=n.__resolveType??"",o=b9(i);if(!o&&i!==""&&D9(i)&&i in e)return{index:s,resolveType:i,label:Ee(i,s,e),isLazy:!1,isSavedBlock:!0};const a=o?n.section:void 0,l=o?a?.__resolveType??"":i;if(l===X9||l===e0){const L=o?a:n,d=Array.isArray(L?.variants)?L.variants:[];if(d.length===1&&(d[0]?.rule?.__resolveType??"")===I0){const y=d[0]?.value??{};let m=y.__resolveType??"";const p=b9(m);let g=y;if(p){const h=y.section;m=h?.__resolveType??m,h&&(g=h)}if(m===X9||m===e0){const v=(Array.isArray(g.variants)?g.variants:[])[0]?.value?.__resolveType,k=v?S9(v):"Section";return{index:s,resolveType:i,label:`Variants of ${k}`,variantOf:k,isHidden:!0,isLazy:p}}return m!==""&&D9(m)&&m in e?{index:s,resolveType:i,label:Ee(m,s,e),isHidden:!0,isLazy:p,isSavedBlock:!0}:{index:s,resolveType:i,label:S9(m)||`Section ${s+1}`,isHidden:!0,isLazy:p}}const u=d[0]?.value?.__resolveType,f=u?S9(u):"Section";return{index:s,resolveType:i,label:`Variants of ${f}`,variantOf:f,isMultivariate:!0,isLazy:o}}const c=o?n.section?.__resolveType??i:i;return o&&c!==""&&D9(c)&&c in e?{index:s,resolveType:i,label:Ee(c,s,e),isLazy:!0,isSavedBlock:!0}:{index:s,resolveType:i,label:S9(c)||`Section ${s+1}`,isLazy:o}})}function us(t){const e=t.__resolveType??"";return b9(e)?t.section??t:t}function ee(t){const i=(b9(t.__resolveType??"")?t.section:t)?.variants?.[0];return i?.rule?.__resolveType!==I0?null:i?.value??null}function H4(t){const e=us(t);return{__resolveType:e0,variants:[{value:e,rule:{__resolveType:I0}}]}}function q4(t){const e=t.__resolveType??"";if(!e)return null;if(b9(e))return t.section??null;const n=ee(t);return n?b9(n.__resolveType??"")?n:{__resolveType:Ft,section:us(n)}:{__resolveType:Ft,section:t}}function G0(t){const e=t.__resolveType??"";if(!e)return null;if(b9(e)){const n=t.section,s=n?.__resolveType??"";return!s||!n?null:{resolveType:s,data:n}}return{resolveType:e,data:t}}function Y4(t){const e=ee(t);if(e)return G0(e);if(b9(t.__resolveType??"")){const s=t.section;if(!s)return null;const i=ee(s);return G0(i||s)}return G0(t)}function W4(t){return ee(t)}const R1=["website/matchers/always.ts","$live/matchers/MatchAlways.ts"];function yt(t){if(!t)return!1;const e=t.__resolveType??"";return e===""?Object.keys(t).length===0:R1.includes(e)||e.includes("always")}function M1(t){const e=t.variants??[];if(e.length===0)return-1;const n=e.findIndex(s=>yt(s.rule));return n!==-1?n:e.length-1}function J4(t,e,n){const s=n.variants??[];if(s.length===0)return null;const i=M1(n),o=s[i]?.value;if(!o)return null;const a=structuredClone(o);return e.isLazy?{...t,section:a}:a}function fs(t,e){return e.isMultivariate?e.isLazy?t.section??null:t:null}function Z4(t,e){return Array.isArray(t.variants)?t.variants.map((n,s)=>({label:e(n.rule)||`Variant ${s+1}`,value:n.value??{},rule:n.rule})):[]}function Q4(t,e){const n=t.__resolveType??"";if(!n)return null;if(b9(n)){const s=t.section??t,i=s.__resolveType??n;if(!i.includes("/")&&i in e){const o=e[i]??{};return{data:{...o},resolveType:o.__resolveType??i}}return{data:{...s},resolveType:i}}if(!n.includes("/")&&n in e){const s=e[n]??{};return{data:{...s},resolveType:s.__resolveType??n}}return{data:{...t},resolveType:n}}function P1(t,e){const n=t.__resolveType??"";return b9(n)?{...t,section:e}:e}function I1(t,e,n){return e.isLazy?{...t,section:n}:n}function X4(t,e,n){const s=[...t.variants??[]],i=s[e];if(!i)return t;const o=i.value??{};return s[e]={...i,value:P1(o,n)},{...t,variants:s}}function e5(t,e,n){const s=[...t.variants??[]];return s[e]?(s[e]={...s[e],rule:n},{...t,variants:s}):t}function t5(t,e){const n=[...t.variants??[]],s=n[e];return s?(n.splice(e+1,0,structuredClone(s)),{...t,variants:n}):t}function n5(t,e,n){const s=[...t.variants??[]];if(e===n||e<0||n<0||e>=s.length||n>=s.length)return t;const[i]=s.splice(e,1);return i?(s.splice(n,0,i),{...t,variants:s}):t}function s5(t,e){const n=[...t.variants??[]];return n.length<=1?null:(n.splice(e,1),{...t,variants:n})}function De(t){return{rule:u0(),value:structuredClone(t)}}function ms(t,e){return{...e,__resolveType:e0,variants:t}}function r5(t){return t.isHidden!==!0&&t.isSavedBlock!==!0}function F1(t,e){if(e.isHidden)return null;if(e.isMultivariate){const s=fs(t,e)?.variants??[],i=s[s.length-1]?.value;return i?structuredClone(i):null}if(e.isLazy){const n=t.section;return n?structuredClone(n):null}return structuredClone(t)}function O1(t,e,n){if(e.isMultivariate||e.isHidden)return null;const s=F1(t,e);if(!s)return null;const i=ms([De(s),De(s)]);return e.isLazy?{...t,section:i}:i}function i5(t,e,n){if(e.isHidden||e.isSavedBlock)return null;if(e.isMultivariate){const i=fs(t,e);if(!i)return null;const o=i.variants??[],a=o[o.length-1]?.value;if(!a)return null;const l=ms([...o,De(a)],i);return{section:I1(t,e,l),newVariantIndex:o.length}}const s=O1(t,e);return s?{section:s,newVariantIndex:1}:null}function be(t){return t.anyOfRefs?.some(e=>e.resolveType!==X9?!1:e.schema?.properties?.variants?.items?.properties?.value?.type==="array")??!1}function D1(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;const e=t;return e.__resolveType===e0&&Array.isArray(e.variants)}function te(t){return!t||typeof t!="object"||Array.isArray(t)?!1:t.__resolveType===X9}function $1(t){if(!te(t))return null;const e=t.variants;if(!Array.isArray(e))return null;const n=e[0]?.value;return Array.isArray(n)?n:null}function z1(t,e){if(!te(t))return e;const n=structuredClone(t),s=[...n.variants??[]];return s.length===0?s.push({rule:u0(),value:e}):s[0]={...s[0],value:e},{...n,variants:s}}function o5(t,e){const s=t[e]?.sections;if(!s||Array.isArray(s))return 1;const i=s;return Array.isArray(i.variants)?i.variants.length:1}function a5(t,e,n){const i=t[e]?.sections;if(Array.isArray(i))return n===0?i:[];if(i&&typeof i=="object"){const o=i.variants;if(Array.isArray(o)){const a=o[n];return Array.isArray(a?.value)?a.value:[]}}return[]}function B1(t,e,n){if(Array.isArray(t))return[{label:"Default",sections:t}];if(t&&typeof t=="object"){const s=t;if(Array.isArray(s.variants)){const i=s.variants,o=i.map(c=>T0(c.rule,e,n)),a=o.reduce((c,L)=>(c[L]=(c[L]??0)+1,c),{}),l={};return i.map((c,L)=>{const d=o[L]??`Variant ${L+1}`,u=a[d]??1;let f=d;return u>1&&(l[d]=(l[d]??0)+1,f=`${d} ${l[d]}`),{label:f||`Variant ${L+1}`,sections:Array.isArray(c.value)?c.value:[],rule:c.rule}})}}return[]}function k0(t){return{rule:u0(),value:t}}function L0(t,e){return{...e,__resolveType:X9,variants:t}}function l5(t,e){const n=structuredClone(e);if(Array.isArray(t))return L0([k0(t),k0(n)]);if(t&&typeof t=="object"){const s=t;return Array.isArray(s.variants)?L0([...s.variants,k0(n)],s):null}return L0([k0([]),k0(n)])}function c5(t){const e=t.variants;return Array.isArray(e)?e.length-1:1}function L5(t,e){const n=t[e];if(!n)return null;const s=[...t];return s.splice(e+1,0,structuredClone(n)),s}function d5(t,e){if(e.length===0)return L0([],t);if(e.length===1){const n=e[0],s=n?.rule;if(!yt(s))return L0(e,t);if(Array.isArray(n?.value))return n.value}return L0(e,t)}function V1(t,e,n){const s=[];for(const[o,a]of Object.entries(t))o!==e&&s.push(a);const i=new Set;for(;s.length>0;){const o=s.pop();if(!(!o||typeof o!="object")&&!i.has(o)){if(i.add(o),Array.isArray(o)){for(const a of o)s.push(a);continue}n(o);for(const a of Object.values(o))s.push(a)}}}function u5(t,e,n){if(!e)return 0;let s=0;return V1(t,e,i=>{i.__resolveType===e&&v0(i,t,n)&&s++}),s}const U1={provision:0,cloning:1,install:2,dev:3};function K1(t){return U1[t.step]}const Ut=48,ps=28,hs=3,G1=(()=>{const t=[];let e=0;for(let n=0;n<Ut;n++)n===ps?t.push(null):(t.push(e/(Ut-1)*hs),e++);return t})();function H1(t){return{provision:t("sandbox.bootingVisual.phaseProvision"),cloning:t("sandbox.bootingVisual.phaseCloning"),install:t("sandbox.bootingVisual.phaseInstall"),dev:t("sandbox.bootingVisual.phaseDev")}}function q1(t,e,n){return t.step==="provision"&&e!=null&&e.kind!=="ready"&&e.kind!=="failed"?Fr[e.kind].long:n[t.step]}const O9="bg-foreground/[0.05]",P9="bg-foreground/[0.09]",Y1=Array.from({length:35},()=>Math.random()*1.8),W1=Array.from({length:35},()=>Math.random()<.4);function J1(t){const e=B.c(31),{progress:n,claimPhase:s}=t,i=u9();let o;e[0]!==n?(o=K1(n),e[0]=n,e[1]=o):o=e[1];const a=o;let l;e[2]!==s||e[3]!==n||e[4]!==i?(l=q1(n,s,H1(i)),e[2]=s,e[3]=n,e[4]=i,e[5]=l):l=e[5];const c=l;let L;e[6]===Symbol.for("react.memo_cache_sentinel")?(L=r.jsx(mi,{}),e[6]=L):L=e[6];const d=`${n.step}-${c}`;let u;e[7]!==c||e[8]!==d?(u=r.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-foreground/10 bg-background px-3.5 py-1.5 shadow-[0_4px_20px_-4px_rgb(0_0_0_/_0.12)]",children:[L,r.jsxs("span",{className:"animate-in fade-in text-[13px] font-medium text-foreground/85 duration-500",children:[c,"…"]},d)]}),e[7]=c,e[8]=d,e[9]=u):u=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(Z1,{}),e[10]=f):f=e[10];let y;e[11]!==a?(y=r.jsx(H0,{phase:0,current:a,children:f}),e[11]=a,e[12]=y):y=e[12];let m;e[13]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(X1,{}),e[13]=m):m=e[13];let p;e[14]!==a?(p=r.jsx(H0,{phase:1,current:a,children:m}),e[14]=a,e[15]=p):p=e[15];let g;e[16]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(eo,{}),e[16]=g):g=e[16];let h;e[17]!==a?(h=r.jsx(H0,{phase:2,current:a,children:g}),e[17]=a,e[18]=h):h=e[18];let v;e[19]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(no,{}),e[19]=v):v=e[19];let k;e[20]!==a?(k=r.jsx(H0,{phase:3,current:a,children:v}),e[20]=a,e[21]=k):k=e[21];let j;e[22]!==h||e[23]!==k||e[24]!==y||e[25]!==p?(j=r.jsxs("div",{className:"relative aspect-[4/3] w-[min(78%,560px)]",children:[y,p,h,k]}),e[22]=h,e[23]=k,e[24]=y,e[25]=p,e[26]=j):j=e[26];let x;e[27]===Symbol.for("react.memo_cache_sentinel")?(x=r.jsx("style",{children:`
2
2
  @keyframes vm-pulse-soft {
3
3
  0%, 100% { opacity: 0.25; }
4
4
  50% { opacity: 1; }
@@ -1,2 +1,2 @@
1
- import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-CeFrI_-f.js";import{u as Le}from"./use-mcp-client-CFwJWbBp.js";import{u as Ue}from"./use-session-runtime-CNsfPJpj.js";import{u as Re,b as Oe}from"./chat-context-DSOY14Dl.js";import{u as Be}from"./thread-intent-Y1VdgKwx.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./repository-binding-Bye6exhX.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=X(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=X(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=X();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class Xe{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const je=1e3,Ge=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=ye(),a=X(),V=Re()?.taskId??null,[j,y]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,E]=o.useState({kind:"unknown"}),[G,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Xe,v.current.set(d,S)),S};o.useEffect(()=>{if(y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);y(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
1
+ import{o as X,r as o,ds as Ce,dq as De,c as Pe,e as Ae,d3 as ee,X as ye,j as Ee,K as M,z as _e}from"./index-DUoAE5ST.js";import{u as Le}from"./use-mcp-client-BUxJmD4z.js";import{u as Ue}from"./use-session-runtime-DSwirXrC.js";import{u as Re,b as Oe}from"./chat-context-fDVt7FJu.js";import{u as Be}from"./thread-intent-CqtUmKwo.js";import{e as ge}from"./backoff-8mStPHYB.js";import{b as Ne}from"./sandbox-url-D3mC8qhT.js";import{a as Fe}from"./repository-binding-B_NhY5XW.js";import{d as $e}from"./sandbox-start-errors-BK_aDCyt.js";function Ke(e,t){const n=X(t);return Ve({filters:{...e,status:"pending"}},n).length}function fe(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function Ve(e={},t){const n=X(t).getMutationCache(),s=o.useRef(e),u=o.useRef(null);return u.current===null&&(u.current=fe(n,e)),o.useEffect(()=>{s.current=e}),o.useSyncExternalStore(o.useCallback(c=>n.subscribe(()=>{const a=Ce(u.current,fe(n,s.current));u.current!==a&&(u.current=a,De.schedule(c))}),[n]),()=>u.current,()=>u.current)}async function qe(e,t,n){const s=await e.callTool({name:t,arguments:n});if(s.isError){const u=s.content?.[0]?.text??`Tool ${t} failed without a message`;throw new Error(u)}return s}const be=["SANDBOX_START"],W=new Map,He=e=>`${e.virtualMcpId}::${e.branch??""}`,Qe=e=>e.message.includes("retry shortly"),ie=new Set,le={mark:(e,t)=>ie.add(`${e}::${t}`),clear:(e,t)=>ie.delete(`${e}::${t}`),isStopped:(e,t)=>ie.has(`${e}::${t}`)};function Ye(e,t){const n=X();return Ae({mutationKey:be,retry:(s,u)=>Qe(u)&&s<6,retryDelay:s=>ge(5e3,500,s,2,0),mutationFn:async s=>{s.branch&&le.clear(s.virtualMcpId,s.branch);const u=He(s),c=W.get(u);if(c)return c;const a=(async()=>(await qe(e,"SANDBOX_START",s)).structuredContent)();W.set(u,a);try{return await a}finally{W.get(u)===a&&W.delete(u)}},onSuccess:()=>{ee(n),t?.onStarted?.()}})}function Rt(e,t){const n=Pe.c(3);let s;return n[0]!==t||n[1]!==e?(s={mutationKey:be,predicate:c=>{if(!e)return!1;const a=c.state.variables;return!a||a.virtualMcpId!==e?!1:(a.branch??"")===(t??"")}},n[0]=t,n[1]=e,n[2]=s):s=n[2],Ke(s)>0}function Se(e){return e==="installing"||e==="install-failed"||e==="starting"||e==="start-failed"||e==="running"||e==="crashed"}const Me={phase:null,lifecycle:{phase:"idle"},status:{state:"running"},branch:{kind:"unknown"},notFound:!1,scripts:[],activeProcesses:[],getBuffer:()=>"",hasData:()=>!1,subscribeChunks:()=>()=>{},subscribeReload:()=>()=>{}},ve=o.createContext(Me),me=16384;class Xe{data="";append(t){this.data+=t,this.data.length>me&&(this.data=this.data.slice(this.data.length-me))}get(){return this.data}clear(){this.data=""}}const je=1e3,Ge=3e4,Ie=3e3,he=["lifecycle","status","tasks","scripts","branch","reload","file-changed"],pe="log";function Je(e){if(!e)return null;try{return new URL("/_sandbox/events",e).href}catch{return null}}function We(e){return e===404}async function ze(e){try{const t=await fetch(e,{headers:{Accept:"text/event-stream"},cache:"no-store",signal:AbortSignal.timeout(Ie)});return await t.body?.cancel().catch(()=>{}),We(t.status)}catch{return!1}}function gt({virtualMcpId:e,branch:t,previewUrl:n=null,enabled:s=!0,children:u}){const{org:c}=ye(),a=X(),V=Re()?.taskId??null,[j,y]=o.useState(null),[te,b]=o.useState({phase:"idle"}),[ne,U]=o.useState({state:"running"}),[re,E]=o.useState({kind:"unknown"}),[G,h]=o.useState(!1),[k,q]=o.useState([]),[se,R]=o.useState([]),[,H]=o.useState(0),v=o.useRef(new Map),O=o.useRef(new Set),w=o.useRef(new Set),C=o.useRef(null),p=Je(n),Q=Fe(e)?.metadata?.runtime?.selected==="deno",_=d=>{let S=v.current.get(d);return S||(S=new Xe,v.current.set(d,S)),S};o.useEffect(()=>{if(y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),C.current=null,h(!1),q([]),R([]),v.current.clear(),!e||!t||!s)return;const d=Ne({orgSlug:c.slug,virtualMcpId:e,branch:t,threadId:V??null},"events");let S=!1,D=0,L=null,T=null,P=null,g=null,m=null,A=null;const I=r=>{try{const i=JSON.parse(r.data);y(i),i.kind!=="failed"&&(h(!1),D=0),i.kind==="ready"&&ae()}catch(i){console.warn("[vm-events] bad phase payload",i)}},B=()=>{h(!0),y(null),b({phase:"idle"}),U({state:"running"}),E({kind:"unknown"}),q([]),R([]),v.current.clear()},Y=r=>{try{const i=JSON.parse(r.data);if(typeof i.data!="string")return;D=0;const f=i.data.replace(/\r?\n/g,`\r
2
2
  `);_(i.source).append(f);for(const l of O.current)try{l(i.source,f)}catch{}H(l=>l+1)}catch{}},J=r=>{const i=r.type;try{const f=JSON.parse(r.data);switch(D=0,i){case"lifecycle":{const l=f;b(l.state);const F=`${c.slug}/${e}/${t}`;if(Se(l.state.phase)&&!(A&&Se(A))){ee(a,c.id);const K=M.decofile(F);a.getQueryData(K)===void 0&&a.invalidateQueries({queryKey:K})}l.state.phase==="running"&&A!=="running"&&(ee(a,c.id),a.invalidateQueries({queryKey:M.decofile(F)}),a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})),A=l.state.phase;const $=l.state.phase==="running"?l.state.port:null,ce=C.current;if(C.current=$,ce!==null&&$!==null&&ce!==$)for(const K of w.current)try{K()}catch{}return}case"status":U(f);return;case"tasks":{const F=f.active.map($=>$.logName??"").filter(Boolean);R(F);return}case"scripts":q(f.scripts);return;case"branch":{const l=f.meta;E(l);return}case"reload":for(const l of w.current)try{l()}catch{}return;case"file-changed":{const{path:l}=f,F=`${c.slug}/${e}/${t}`;if(l.startsWith(".deco/")||l.includes("/.deco/")){if(!(A==="running"))return;P&&clearTimeout(P),P=setTimeout(()=>{if(P=null,a.invalidateQueries({queryKey:M.decofile(F)}),Q)for(const K of w.current)try{K()}catch{}},500)}else T&&clearTimeout(T),T=setTimeout(()=>{T=null,a.invalidateQueries({queryKey:M.liveMeta(c.slug,e,t)})},1e3);return}}}catch{}};function N(){if(S)return;const r=new EventSource(d);g=r,r.onopen=()=>{},r.onerror=()=>{g===r&&r.readyState===EventSource.CLOSED&&x("studio")},r.addEventListener("phase",I),r.addEventListener("gone",B),r.addEventListener(pe,Y);for(const i of he)r.addEventListener(i,J)}function ae(){if(S||!p||m)return;const r=new EventSource(p);m=r;let i=!1;r.onopen=()=>{if(S||m!==r)return;i=!0,D=0;const f=g;g=null,f?.close()},r.onerror=()=>{m===r&&r.readyState===EventSource.CLOSED&&ue(r,i)},r.addEventListener(pe,Y);for(const f of he)r.addEventListener(f,J)}async function ue(r,i){const f=p?await ze(p):!1;if(!(S||m!==r)){if(r.close(),m=null,f){B(),g||N();return}i&&x("direct")}}function x(r){if(S||L)return;const i=ge(Ge,je,D,2,0);D++,L=setTimeout(()=>{if(L=null,!S){if(r==="direct"){m?.close(),m=null,ae();return}g?.close(),g=null,N()}},i)}return N(),()=>{S=!0,g?.close(),m?.close(),L&&clearTimeout(L),T&&clearTimeout(T),P&&clearTimeout(P)}},[e,t,c.slug,c.id,s,V,p,a,Q]);const oe={phase:j,lifecycle:te,status:ne,branch:re,notFound:G,scripts:k,activeProcesses:se,getBuffer:d=>v.current.get(d)?.get()??"",hasData:d=>(v.current.get(d)?.get().length??0)>0,subscribeChunks:d=>(O.current.add(d),()=>{O.current.delete(d)}),subscribeReload:d=>(w.current.add(d),()=>{w.current.delete(d)})};return Ee.jsx(ve,{value:oe,children:u})}function de(){return o.use(ve)}function bt(e){const{subscribeChunks:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t((c,a)=>{n.current?.(c,a)}),[t])}function vt(e){const{subscribeReload:t}=de(),n=o.useRef(e);n.current=e,o.useEffect(()=>t(()=>{n.current?.()}),[t])}function Ze(e){return e.appPaused||e.userStopped?{kind:"suspended"}:e.startError&&!e.previewUrl?{kind:"errored",error:e.startError}:e.previewUrl?{kind:"iframe",previewUrl:e.previewUrl}:{kind:"starting"}}function et(e){return e.executionEnabled&&e.sessionRuntime==="sandbox"&&e.hasActiveRepository&&!!e.userId&&!!e.branch&&!e.vmEntry&&!e.userStopped&&!e.isPending&&!e.attempted}function wt(e){return e.threadLoaded&&e.isOwner&&e.hasActiveRepository&&!e.branch&&!e.attempted}function tt(e){return e.executionEnabled&&e.notFound&&!!e.deadVmId&&!e.isPending&&!e.userStopped&&e.deadVmId!==e.lastDeadVmId}function Tt(e){const{agentSandboxMap:t,threadSandboxMap:n,userId:s,branch:u}=e,c=e.ownerId??s;if(!s||!c||!u)return t;const a=n?.[c]?.[u];return a?{...t??{},[s]:{...t?.[s]??{},[u]:a}}:t}function z(e,t,n){const s={virtualMcpId:e};return t&&(s.branch=t),n&&(s.threadId=n),s}const we=2,nt=new Set(["scheduling-timeout","reconciler-error","claim-never-created","unknown"]);function Te(e){return nt.has(e)}function rt(e){return e.executionEnabled&&e.failedReason!==null&&Te(e.failedReason)&&e.attempts<we&&!e.isPending&&!e.userStopped&&!e.alreadyHandled}const st={branch:null,count:0,handled:!1};function ot(e,t){return e.branch===t?e:{branch:t,count:0,handled:!1}}function at(e){return e.mutationError?e.mutationError:e.phase?.kind==="failed"&&!e.startPending&&e.claimRetryExhausted?{code:null,message:e.phase.message}:null}function ut(e){switch(e.kind){case"suspended":return"suspended";case"iframe":return"running";case"starting":return"starting";case"errored":return"errored"}}function xe(e,t){return`${e??""}::${t??""}`}function ct(e){const t=e.vmEntry?.previewUrl??null;return t||(e.seeded?.key===e.key?e.seeded.url:null)}function Z(e){const{data:t,virtualMcpId:n,branch:s}=e;t?.branch&&!s&&e.setCurrentTaskBranch(t.branch),t?.previewUrl&&e.setSeededPreviewUrl({key:xe(n,t.branch??s),url:t.previewUrl})}const it={branch:null,previewState:{kind:"starting"},status:"idle",vmEntry:null,previewUrl:null,userStopped:!1,start:()=>{},stop:async()=>{},restart:async()=>{},retry:()=>{},resume:()=>{}},ke=o.createContext(it);function xt(){return o.use(ke)}function kt({executionEnabled:e,virtualMcpId:t,branch:n,userId:s,hasActiveRepository:u,vmEntry:c,threadId:a,children:V}){const{org:j}=ye(),{setCurrentTaskBranch:y}=Oe(),te=Be(),b=de(),ne=X(),U=Ue(t),re=U.resolved?U.runtime:null,E=Re()?.taskId??null,G=Le({connectionId:_e,orgId:j.id,orgSlug:j.slug}),h=Ye(G,{onStarted:()=>{a&&te?.refreshThreadMetadata(a)}}),{mutate:k,reset:q}=h,[se,R]=o.useState(null),H=o.useRef(new Set),v=o.useRef(null),[O,w]=o.useState(st),C=ot(O,n);C!==O&&w(C);const p=b.phase?.kind==="failed"?b.phase:null,Q=ct({vmEntry:c,seeded:p?null:se,key:xe(t,n)}),_=!!t&&!!n&&le.isStopped(t,n),oe=b.status.state==="paused",d=!p||!Te(p.reason)||C.count>=we,S=at({mutationError:h.isError&&h.error?$e(h.error.message):null,phase:b.phase,startPending:h.isPending,claimRetryExhausted:d}),D=Ze({previewUrl:Q,appPaused:oe,userStopped:_,startError:S}),L=ut(D),T=n??"",P=H.current.has(T),g=et({executionEnabled:e,hasActiveRepository:u,userId:s,branch:n,vmEntry:c,userStopped:_,isPending:h.isPending,attempted:P,sessionRuntime:re});o.useEffect(()=>{if(!g||!t)return;H.current.add(T);const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] auto-start failed:",r)}})},[g,T,n,t,E,k,y,R]);const m=b.notFound?c?.sandboxHandle??null:null,A=tt({executionEnabled:e,notFound:b.notFound,deadVmId:m,lastDeadVmId:v.current,isPending:h.isPending,userStopped:_});o.useEffect(()=>{if(!A||!m||!t)return;v.current=m;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] self-heal failed:",r)}})},[A,m,t,n,E,k,y,R]);const I=rt({executionEnabled:e,failedReason:p?.reason??null,attempts:C.count,isPending:h.isPending,userStopped:_,alreadyHandled:C.handled});o.useEffect(()=>{if(!p){w(r=>r.handled?{...r,handled:!1}:r);return}if(!I||!t)return;w(r=>({...r,handled:!0,count:r.count+1}));const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] claim auto-retry failed:",r)}})},[p,I,t,n,E,k,y,R]);const B=()=>{if(!e||!t)return;const x=z(t,n,E);k(x,{onSuccess:r=>{Z({data:r,virtualMcpId:t,branch:n,setCurrentTaskBranch:y,setSeededPreviewUrl:R})},onError:r=>{console.error("[sandbox-lifecycle] user start failed:",r)}})},Y=async()=>{if(!(!e||!t||!n)&&c){le.mark(t,n);try{await G.callTool({name:"SANDBOX_DELETE",arguments:{virtualMcpId:t,branch:n}})}catch{}ee(ne)}},J=async()=>{await Y(),B()},N=()=>{H.current=new Set,v.current=null,w({branch:n,count:0,handled:!1}),q(),B()},ue={branch:n,previewState:D,status:L,vmEntry:c,previewUrl:Q,userStopped:_,start:B,stop:Y,restart:J,retry:N,resume:N};return Ee.jsx(ke,{value:ue,children:V})}export{gt as S,kt as a,Ye as b,de as c,xt as d,bt as e,vt as f,Ke as g,Tt as o,wt as s,Rt as u};
@@ -1 +1 @@
1
- import{ao as n,bK as t,ap as e,bL as m,bM as p,bN as c,bO as h}from"./index-CeFrI_-f.js";const s=500;n({title:e().max(s),url:e().max(s),icon:e().max(s)});const i=n({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});n({tiers:n({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});const b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(s).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(s).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const v=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function x(a,r){const d=a?.[r];return u.has(r)?d!==!1:d===!0}function w(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(c(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:c(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as O,y as S,w as a,b,x as o};
1
+ import{ao as n,bK as t,ap as e,bL as m,bM as p,bN as c,bO as h}from"./index-DUoAE5ST.js";const s=500;n({title:e().max(s),url:e().max(s),icon:e().max(s)});const i=n({keyId:e().max(s),modelId:e().max(s),title:e().max(s).optional()}).nullable();m(["fast","smart","thinking","image","web_search","deep_research"]);m(["fast","smart","thinking"]);const y=n({tiers:n({fast:i,smart:i,thinking:i,image:i,web_search:i,deep_research:i})});n({tiers:n({fast:i.optional(),smart:i.optional(),thinking:i.optional()})});const b=/^[a-zA-Z0-9.-]+(?::[0-9]+)?$/;n({host:e().min(1).max(s).regex(b).describe("Git host, e.g. 'github.com' (bare hostname, no scheme)."),secretId:e().min(1).max(s).describe("Vault secret id holding the PAT used to authenticate this host.")});n({ids:p(e().max(s)).describe("Ordered list of custom virtual MCP agent ids to show on the home view.")});const v=n({voice_mode:t().optional(),home_task_intake_enabled:t().optional().describe("Show Task mode on the Home composer and allow reports to start tasks."),demo_mode:t().optional().describe("Curated demo org: the commerce connect modal proceeds without a configured required data source."),reports_only:t().optional().describe("Curated Deco Score look: hides agent navigation, the home Customize button, and the Settings/Automations tabs. Defaulted on for orgs created by commerce onboarding."),reviewer_enabled:t().optional().describe("Run the Reviewer on a task's pull request once it's In Review — it reviews the code with the repo's stack-appropriate skills, fixes what it finds on the PR's own branch, then exercises the change on the deploy preview and approves or hands the card to a human."),qa_agent_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),code_reviewer_enabled:t().optional().describe("Deprecated: see reviewer_enabled."),auto_merge:t().optional().describe("When the Reviewer approves a task's pull request, merge it automatically instead of leaving the merge to a human."),auto_resolve_conflicts:t().optional().describe("When an approved pull request can't be merged because it conflicts with its base branch, hand it back to the Super Agent to resolve the conflict (check out the branch, merge the base, push). Unset, it follows `auto_merge`; set it explicitly to run one without the other."),cheap_reviewer_model:t().optional().describe("Run the Reviewer on a cheaper model than the Super Agent that wrote the code. On by default — turning it off trades cost for some review depth."),coding_agent_org_mcps:t().optional().describe("Give a coding-agent run (the claude-code harness in a sandbox) every MCP connection in the org as its own MCP server, on top of the narrow task-run surface it always gets. Off by default: each connection is one more server the agent connects to at session start, and all of their tools land in its context."),coding_agents_claude_code:t().optional().describe("Run chats on a Code Agent (an agent imported from a GitHub repo) with the claude-code harness inside its sandbox, instead of hosted Decopilot. Off by default: it changes the runtime of every such chat, and claude-code flushes whole turns rather than streaming tokens."),auto_assign_report_tasks_to_super_agent:t().optional().describe("When a Deco Score import creates a task board item without an assignee, delegate it to the Super Agent automatically instead of leaving it unassigned."),hosting_enabled:t().optional().describe("Per-site Hosting tab (deployments, domains, deploy outcomes). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),deco_analytics_enabled:t().optional().describe("Per-site Deco Analytics tab (traffic, realtime, usage & limits). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),e2e_enabled:t().optional().describe("Per-site E2E tab (end-to-end test runs). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. `HOSTING_CONTROL_PLANE_GA` opens it (and its peers) to every org at once."),experiments_enabled:t().optional().describe("Per-site Experiments tab (A/B tests + variant results). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org."),monitor_enabled:t().optional().describe("Per-site Monitor tab (CDN Performance + Audience from the stats-lake warehouse). Off by default. deco.cx staff and local dev always see it; this flag is the per-client lever to open it to one external org. Its own deployment-wide switch `MONITOR_GA` opens it to every org at once (independent of the control-plane trio)."),site_create_enabled:t().optional().describe('The "Create a new site" option under New project: generates a GitHub repository from a site template in an account the org connected, and opens it as a project. Off by default, for every org — deco.cx staff included.'),delivery_lanes_enabled:t().optional().describe("Board lanes for shipping: Approved, Merged and Post-deploy Validation sit between In Review and Done, and a merged pull request lands on Merged instead of Done. For teams whose release process continues after the merge. Off by default — with it off the board and the state machine behave exactly as if the lanes did not exist."),new_blocks_editor:t().optional().describe("Use the redesigned blocks editor for every member of the organization. Off by default — the classic editor stays until an admin opts the org in.")}),u=new Set(["reviewer_enabled","cheap_reviewer_model"]);function x(a,r){const d=a?.[r];return u.has(r)?d!==!1:d===!0}function w(a){const r=a?.auto_resolve_conflicts;return typeof r=="boolean"?r:a?.auto_merge===!0}const l=256*1024,f=50,o=500,g=5e3;n({id:e().describe("Brand context ID"),name:e().max(o).describe("Company name"),domain:e().max(o).describe("Company domain (e.g. example.com)"),overview:e().max(g).describe("Company overview / description"),logo:e().max(o).nullable().optional().describe("Logo URL"),favicon:e().max(o).nullable().optional().describe("Favicon URL"),ogImage:e().max(o).nullable().optional().describe("OG image URL"),fonts:n({heading:e().max(o).optional().describe("Font family for headings"),body:e().max(o).optional().describe("Font family for body text"),code:e().max(o).optional().describe("Font family for code / monospace")}).nullable().optional().describe("Font families by semantic role"),colors:n({primary:e().max(o).optional().describe("Primary brand color (hex)"),secondary:e().max(o).optional().describe("Secondary brand color (hex)"),accent:e().max(o).optional().describe("Accent / highlight color (hex)"),background:e().max(o).optional().describe("Background color (hex)"),foreground:e().max(o).optional().describe("Foreground / text color (hex)")}).nullable().optional().describe("Semantic color palette"),images:p(c(e(),h())).max(f).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`images must serialize to at most ${l} bytes`}).describe("Brand images"),metadata:c(e(),h()).nullable().optional().refine(a=>a==null||JSON.stringify(a).length<=l,{message:`metadata must serialize to at most ${l} bytes`}).describe("Extra design tokens (typography, components, spacing, layout, tone, etc.)"),archivedAt:e().nullable().optional().describe("Archive timestamp (null to unarchive)"),isDefault:t().optional().describe("Whether this is the default brand for the organization")});export{u as D,v as O,y as S,w as a,b,x as o};
@@ -1 +1 @@
1
- import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-CeFrI_-f.js";import{e as de}from"./select-CKIWskoO.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
1
+ import{r as d,bm as T,bq as ce,j as b,bo as _,bF as ae,dc as O,bp as C,bz as P,bu as ie,c as F,l as $}from"./index-DUoAE5ST.js";import{e as de}from"./select-BqWleZPz.js";function ue(r,e){return d.useReducer((o,l)=>e[o][l]??o,r)}var U="ScrollArea",[q]=ae(U),[fe,m]=q(U),G=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,type:l="hover",dir:t,scrollHideDelay:n=600,...s}=r,[a,c]=d.useState(null),[u,i]=d.useState(null),[h,f]=d.useState(null),[S,w]=d.useState(null),[A,Y]=d.useState(null),[x,L]=d.useState(0),[M,j]=d.useState(0),[D,y]=d.useState(!1),[N,W]=d.useState(!1),v=T(e,R=>c(R)),p=ce(t);return b.jsx(fe,{scope:o,type:l,dir:p,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:f,scrollbarX:S,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:y,scrollbarY:A,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:W,onCornerWidthChange:L,onCornerHeightChange:j,children:b.jsx(_.div,{dir:p,...s,ref:v,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":M+"px",...r.style}})})});G.displayName=U;var J="ScrollAreaViewport",K=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,children:l,nonce:t,...n}=r,s=m(J,o),a=d.useRef(null),c=T(e,a,s.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t}),b.jsx(_.div,{"data-radix-scroll-area-viewport":"",...n,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...r.style},children:b.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:l})})]})});K.displayName=J;var g="ScrollAreaScrollbar",Q=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:n,onScrollbarYEnabledChange:s}=t,a=r.orientation==="horizontal";return d.useEffect(()=>(a?n(!0):s(!0),()=>{a?n(!1):s(!1)}),[a,n,s]),t.type==="hover"?b.jsx(he,{...l,ref:e,forceMount:o}):t.type==="scroll"?b.jsx(be,{...l,ref:e,forceMount:o}):t.type==="auto"?b.jsx(Z,{...l,ref:e,forceMount:o}):t.type==="always"?b.jsx(V,{...l,ref:e}):null});Q.displayName=g;var he=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),[n,s]=d.useState(!1);return d.useEffect(()=>{const a=t.scrollArea;let c=0;if(a){const u=()=>{window.clearTimeout(c),s(!0)},i=()=>{c=window.setTimeout(()=>s(!1),t.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[t.scrollArea,t.scrollHideDelay]),b.jsx(O,{present:o||n,children:b.jsx(Z,{"data-state":n?"visible":"hidden",...l,ref:e})})}),be=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=m(g,r.__scopeScrollArea),n=r.orientation==="horizontal",s=X(()=>c("SCROLL_END"),100),[a,c]=ue("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return d.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>c("HIDE"),t.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,t.scrollHideDelay,c]),d.useEffect(()=>{const u=t.viewport,i=n?"scrollLeft":"scrollTop";if(u){let h=u[i];const f=()=>{const S=u[i];h!==S&&(c("SCROLL"),s()),h=S};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[t.viewport,n,c,s]),b.jsx(O,{present:o||a!=="hidden",children:b.jsx(V,{"data-state":a==="hidden"?"hidden":"visible",...l,ref:e,onPointerEnter:C(r.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:C(r.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Z=d.forwardRef((r,e)=>{const o=m(g,r.__scopeScrollArea),{forceMount:l,...t}=r,[n,s]=d.useState(!1),a=r.orientation==="horizontal",c=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;s(a?u:i)}},10);return E(o.viewport,c),E(o.content,c),b.jsx(O,{present:l||n,children:b.jsx(V,{"data-state":n?"visible":"hidden",...t,ref:e})})}),V=d.forwardRef((r,e)=>{const{orientation:o="vertical",...l}=r,t=m(g,r.__scopeScrollArea),n=d.useRef(null),s=d.useRef(0),[a,c]=d.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=ne(a.viewport,a.content),i={...l,sizes:a,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>n.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function h(f,S){return ge(f,s.current,a,S)}return o==="horizontal"?b.jsx(Se,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollLeft,S=k(f,a,t.dir);n.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollLeft=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollLeft=h(f,t.dir))}}):o==="vertical"?b.jsx(ve,{...i,ref:e,onThumbPositionChange:()=>{if(t.viewport&&n.current){const f=t.viewport.scrollTop,S=k(f,a);n.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:f=>{t.viewport&&(t.viewport.scrollTop=f)},onDragScroll:f=>{t.viewport&&(t.viewport.scrollTop=h(f))}}):null}),Se=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarXChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"horizontal",...t,ref:u,sizes:o,style:{bottom:0,left:n.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:n.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.x),onDragScroll:i=>r.onDragScroll(i.x),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollLeft+i.deltaX;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollWidth,viewport:n.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:z(s.paddingLeft),paddingEnd:z(s.paddingRight)}})}})}),ve=d.forwardRef((r,e)=>{const{sizes:o,onSizesChange:l,...t}=r,n=m(g,r.__scopeScrollArea),[s,a]=d.useState(),c=d.useRef(null),u=T(e,c,n.onScrollbarYChange);return d.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),b.jsx(re,{"data-orientation":"vertical",...t,ref:u,sizes:o,style:{top:0,right:n.dir==="ltr"?0:void 0,left:n.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":I(o)+"px",...r.style},onThumbPointerDown:i=>r.onThumbPointerDown(i.y),onDragScroll:i=>r.onDragScroll(i.y),onWheelScroll:(i,h)=>{if(n.viewport){const f=n.viewport.scrollTop+i.deltaY;r.onWheelScroll(f),se(f,h)&&i.preventDefault()}},onResize:()=>{c.current&&n.viewport&&s&&l({content:n.viewport.scrollHeight,viewport:n.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:z(s.paddingTop),paddingEnd:z(s.paddingBottom)}})}})}),[me,ee]=q(g),re=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,sizes:l,hasThumb:t,onThumbChange:n,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:i,onResize:h,...f}=r,S=m(g,o),[w,A]=d.useState(null),Y=T(e,v=>A(v)),x=d.useRef(null),L=d.useRef(""),M=S.viewport,j=l.content-l.viewport,D=P(i),y=P(c),N=X(h,10);function W(v){if(x.current){const p=v.clientX-x.current.left,R=v.clientY-x.current.top;u({x:p,y:R})}}return d.useEffect(()=>{const v=p=>{const R=p.target;w?.contains(R)&&D(p,j)};return document.addEventListener("wheel",v,{passive:!1}),()=>document.removeEventListener("wheel",v,{passive:!1})},[M,w,j,D]),d.useEffect(y,[l,y]),E(w,N),E(S.content,N),b.jsx(me,{scope:o,scrollbar:w,hasThumb:t,onThumbChange:P(n),onThumbPointerUp:P(s),onThumbPositionChange:y,onThumbPointerDown:P(a),children:b.jsx(_.div,{...f,ref:Y,style:{position:"absolute",...f.style},onPointerDown:C(r.onPointerDown,v=>{v.button===0&&(v.target.setPointerCapture(v.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),W(v))}),onPointerMove:C(r.onPointerMove,W),onPointerUp:C(r.onPointerUp,v=>{const p=v.target;p.hasPointerCapture(v.pointerId)&&p.releasePointerCapture(v.pointerId),document.body.style.webkitUserSelect=L.current,S.viewport&&(S.viewport.style.scrollBehavior=""),x.current=null})})})}),H="ScrollAreaThumb",oe=d.forwardRef((r,e)=>{const{forceMount:o,...l}=r,t=ee(H,r.__scopeScrollArea);return b.jsx(O,{present:o||t.hasThumb,children:b.jsx(pe,{ref:e,...l})})}),pe=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,style:l,...t}=r,n=m(H,o),s=ee(H,o),{onThumbPositionChange:a}=s,c=T(e,h=>s.onThumbChange(h)),u=d.useRef(void 0),i=X(()=>{u.current&&(u.current(),u.current=void 0)},100);return d.useEffect(()=>{const h=n.viewport;if(h){const f=()=>{if(i(),!u.current){const S=xe(h,a);u.current=S,a()}};return a(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[n.viewport,i,a]),b.jsx(_.div,{"data-state":s.hasThumb?"visible":"hidden",...t,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...l},onPointerDownCapture:C(r.onPointerDownCapture,h=>{const S=h.target.getBoundingClientRect(),w=h.clientX-S.left,A=h.clientY-S.top;s.onThumbPointerDown({x:w,y:A})}),onPointerUp:C(r.onPointerUp,s.onThumbPointerUp)})});oe.displayName=H;var B="ScrollAreaCorner",te=d.forwardRef((r,e)=>{const o=m(B,r.__scopeScrollArea),l=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&l?b.jsx(we,{...r,ref:e}):null});te.displayName=B;var we=d.forwardRef((r,e)=>{const{__scopeScrollArea:o,...l}=r,t=m(B,o),[n,s]=d.useState(0),[a,c]=d.useState(0),u=!!(n&&a);return E(t.scrollbarX,()=>{const i=t.scrollbarX?.offsetHeight||0;t.onCornerHeightChange(i),c(i)}),E(t.scrollbarY,()=>{const i=t.scrollbarY?.offsetWidth||0;t.onCornerWidthChange(i),s(i)}),u?b.jsx(_.div,{...l,ref:e,style:{width:n,height:a,position:"absolute",right:t.dir==="ltr"?0:void 0,left:t.dir==="rtl"?0:void 0,bottom:0,...r.style}}):null});function z(r){return r?parseInt(r,10):0}function ne(r,e){const o=r/e;return isNaN(o)?0:o}function I(r){const e=ne(r.viewport,r.content),o=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=(r.scrollbar.size-o)*e;return Math.max(l,18)}function ge(r,e,o,l="ltr"){const t=I(o),n=t/2,s=e||n,a=t-s,c=o.scrollbar.paddingStart+s,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=l==="ltr"?[0,i]:[i*-1,0];return le([c,u],h)(r)}function k(r,e,o="ltr"){const l=I(e),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=e.scrollbar.size-t,s=e.content-e.viewport,a=n-l,c=o==="ltr"?[0,s]:[s*-1,0],u=de(r,c);return le([0,s],[0,a])(u)}function le(r,e){return o=>{if(r[0]===r[1]||e[0]===e[1])return e[0];const l=(e[1]-e[0])/(r[1]-r[0]);return e[0]+l*(o-r[0])}}function se(r,e){return r>0&&r<e}var xe=(r,e=()=>{})=>{let o={left:r.scrollLeft,top:r.scrollTop},l=0;return(function t(){const n={left:r.scrollLeft,top:r.scrollTop},s=o.left!==n.left,a=o.top!==n.top;(s||a)&&e(),o=n,l=window.requestAnimationFrame(t)})(),()=>window.cancelAnimationFrame(l)};function X(r,e){const o=P(r),l=d.useRef(0);return d.useEffect(()=>()=>window.clearTimeout(l.current),[]),d.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(o,e)},[o,e])}function E(r,e){const o=P(e);ie(()=>{let l=0;if(r){const t=new ResizeObserver(()=>{cancelAnimationFrame(l),l=window.requestAnimationFrame(o)});return t.observe(r),()=>{window.cancelAnimationFrame(l),t.unobserve(r)}}},[r,o])}var Pe=G,Ce=K,Re=te;function _e(r){const e=F.c(21);let o,l,t,n,s;e[0]!==r?({className:l,children:o,hideScrollbar:n,viewportRef:s,...t}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n,e[5]=s):(o=e[1],l=e[2],t=e[3],n=e[4],s=e[5]);const a=n===void 0?!1:n;let c;e[6]!==l?(c=$("relative h-full w-full",l),e[6]=l,e[7]=c):c=e[7];let u;e[8]!==o?(u=b.jsx("div",{className:"flex min-w-0 flex-col",children:o}),e[8]=o,e[9]=u):u=e[9];let i;e[10]!==u||e[11]!==s?(i=b.jsx(Ce,{ref:s,"data-slot":"scroll-area-viewport",className:"h-full w-full overflow-auto rounded-[inherit] outline-none transition-[color,box-shadow] focus-visible:ring-[2px] focus-visible:ring-ring/20",children:u}),e[10]=u,e[11]=s,e[12]=i):i=e[12];let h;e[13]!==a?(h=b.jsx(Ee,{hideScrollbar:a}),e[13]=a,e[14]=h):h=e[14];let f;e[15]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(Re,{}),e[15]=f):f=e[15];let S;return e[16]!==t||e[17]!==c||e[18]!==i||e[19]!==h?(S=b.jsxs(Pe,{"data-slot":"scroll-area",className:c,...t,children:[i,h,f]}),e[16]=t,e[17]=c,e[18]=i,e[19]=h,e[20]=S):S=e[20],S}function Ee(r){const e=F.c(15);let o,l,t,n;e[0]!==r?({className:o,orientation:t,hideScrollbar:n,...l}=r,e[0]=r,e[1]=o,e[2]=l,e[3]=t,e[4]=n):(o=e[1],l=e[2],t=e[3],n=e[4]);const s=t===void 0?"vertical":t,a=n===void 0?!1:n,c=s==="vertical"&&"h-full w-2.5 border-l border-l-transparent",u=s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",i=a&&"hidden";let h;e[5]!==o||e[6]!==c||e[7]!==u||e[8]!==i?(h=$("select-none touch-none p-px transition-colors",c,u,i,o),e[5]=o,e[6]=c,e[7]=u,e[8]=i,e[9]=h):h=e[9];let f;e[10]===Symbol.for("react.memo_cache_sentinel")?(f=b.jsx(oe,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[10]=f):f=e[10];let S;return e[11]!==s||e[12]!==l||e[13]!==h?(S=b.jsx(Q,{"data-slot":"scroll-area-scrollbar",orientation:s,className:h,...l,children:f}),e[11]=s,e[12]=l,e[13]=h,e[14]=S):S=e[14],S}export{_e as S};
@@ -1 +1 @@
1
- import{c as b,l as w,j as a,h as j}from"./index-CeFrI_-f.js";import{i as v}from"./SearchMd-DFB2ha4T.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
1
+ import{c as b,l as w,j as a,h as j}from"./index-DUoAE5ST.js";import{i as v}from"./SearchMd-B30D9ndg.js";function k(f){const e=b.c(17),{value:l,onChange:c,placeholder:m,onKeyDown:u,className:d,isSearching:p,disabled:r}=f,x=m===void 0?"Search...":m,h=r&&"pointer-events-none opacity-50";let t;e[0]!==d||e[1]!==h?(t=w("flex items-center gap-4 rounded-lg bg-[var(--studio-input-background)] px-3 h-8 card-shadow","focus-within:border-ring focus-within:ring-ring/20 focus-within:ring-[2px]","transition-[color,box-shadow]",h,d),e[0]=d,e[1]=h,e[2]=t):t=e[2];let n;e[3]!==p?(n=p?a.jsx(j,{className:"size-4 text-muted-foreground/75 shrink-0"}):a.jsx(v,{size:16,className:"text-muted-foreground/75 shrink-0"}),e[3]=p,e[4]=n):n=e[4];let s;e[5]!==c?(s=g=>c(g.target.value),e[5]=c,e[6]=s):s=e[6];let o;e[7]!==r||e[8]!==u||e[9]!==x||e[10]!==s||e[11]!==l?(o=a.jsx("input",{type:"text",value:l,onChange:s,onKeyDown:u,placeholder:x,disabled:r,className:"flex-1 min-w-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground/50 outline-none"}),e[7]=r,e[8]=u,e[9]=x,e[10]=s,e[11]=l,e[12]=o):o=e[12];let i;return e[13]!==t||e[14]!==n||e[15]!==o?(i=a.jsxs("label",{className:t,children:[n,o]}),e[13]=t,e[14]=n,e[15]=o,e[16]=i):i=e[16],i}export{k as S};
@@ -1 +1 @@
1
- import{c as K,r as C,l as B,j as a}from"./index-CeFrI_-f.js";import{i as I}from"./SearchMd-DFB2ha4T.js";import{i as M}from"./X-Dp6J1NZk.js";import{I as O}from"./index-DJzoBp2L.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
1
+ import{c as K,r as C,l as B,j as a}from"./index-DUoAE5ST.js";import{i as I}from"./SearchMd-B30D9ndg.js";import{i as M}from"./X-AdrRw9Zp.js";import{I as O}from"./index-BqvCOs8v.js";function H(S){const e=K.c(34),{value:t,onChange:s,label:E,placeholder:D,clearLabel:F,expanded:o,className:j}=S,w=E===void 0?"Search":E,d=D===void 0?"Search…":D,y=F===void 0?"Clear search":F,[L,p]=C.useState(t!==""),[R,z]=C.useState(!1),[V,$]=C.useState(t);if(t!==V&&($(t),t===""&&!R&&p(!1)),!L&&!o){let l,g;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=()=>p(!0),g=a.jsx(I,{}),e[0]=l,e[1]=g):(l=e[0],g=e[1]);let v;return e[2]!==w?(v=a.jsx(O,{label:w,tooltipSide:"bottom",variant:"secondary",onClick:l,children:g}),e[2]=w,e[3]=v):v=e[3],v}const _=o?"h-10 w-full px-3":"h-7 w-32 animate-search-expand px-2.5 sm:w-44";let n;e[4]!==j||e[5]!==_?(n=B("inline-flex shrink-0 items-center gap-1.5 overflow-hidden rounded-full bg-card text-card-foreground card-shadow",_,j),e[4]=j,e[5]=_,e[6]=n):n=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(I,{className:"size-4 shrink-0 text-muted-foreground"}),e[7]=x):x=e[7];const k=!o;let r;e[8]!==s?(r=l=>s(l.target.value),e[8]=s,e[9]=r):r=e[9];let h;e[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>z(!0),e[10]=h):h=e[10];let i;e[11]!==t?(i=()=>{z(!1),t===""&&p(!1)},e[11]=t,e[12]=i):i=e[12];let c;e[13]!==s?(c=l=>{l.key==="Escape"&&s("")},e[13]=s,e[14]=c):c=e[14];const N=o?"text-sm":"text-xs";let f;e[15]!==N?(f=B("w-full min-w-0 bg-transparent outline-none placeholder:text-muted-foreground",N),e[15]=N,e[16]=f):f=e[16];let u;e[17]!==d||e[18]!==i||e[19]!==c||e[20]!==f||e[21]!==k||e[22]!==r||e[23]!==t?(u=a.jsx("input",{autoFocus:k,value:t,onChange:r,onFocus:h,onBlur:i,onKeyDown:c,placeholder:d,"aria-label":d,className:f}),e[17]=d,e[18]=i,e[19]=c,e[20]=f,e[21]=k,e[22]=r,e[23]=t,e[24]=u):u=e[24];let m;e[25]!==y||e[26]!==o||e[27]!==s||e[28]!==t?(m=t!==""&&a.jsx("button",{type:"button","aria-label":y,onMouseDown:P,onClick:()=>{s(""),o||p(!1)},className:"shrink-0 text-muted-foreground hover:text-foreground",children:a.jsx(M,{className:"size-3.5"})}),e[25]=y,e[26]=o,e[27]=s,e[28]=t,e[29]=m):m=e[29];let b;return e[30]!==u||e[31]!==m||e[32]!==n?(b=a.jsxs("div",{className:n,children:[x,u,m]}),e[30]=u,e[31]=m,e[32]=n,e[33]=b):b=e[33],b}function P(S){return S.preventDefault()}export{H as S};
@@ -1 +1 @@
1
- import{c as x,b as d,j as l}from"./index-CeFrI_-f.js";import{s as j}from"./User01-dc7WIl5M.js";import{t as E}from"./Users01-BaIVzoZ3.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
1
+ import{c as x,b as d,j as l}from"./index-DUoAE5ST.js";import{s as j}from"./User01-Dd4e-mIA.js";import{t as E}from"./Users01-BYc5DjwP.js";const b=/^[A-Za-z0-9_.-]+$/;function h(u){const e=x.c(15),{field:p,secretById:t}=u,s=d(),n=p.value||"";if(!n)return null;let a;e[0]!==n||e[1]!==t?(a=t.get(n),e[0]=n,e[1]=t,e[2]=a):a=e[2];const c=a;if(!c){let i;e[3]!==n||e[4]!==s?(i=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=i):i=e[5];let f;return e[6]!==i?(f=l.jsx("span",{className:"text-destructive",children:i}),e[6]=i,e[7]=f):f=e[7],f}let o;e[8]!==c.scope?(o=l.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=l.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=l.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(u){const e=x.c(2),{scope:p}=u,t=p==="user"?j:E;let s;return e[0]!==t?(s=l.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{h as S,b as a,N as b};
@@ -1 +1 @@
1
- import{c as j,b as y,j as s,n as C,f6 as $,E as F,r as N,aP as L,B as D,a6 as E,t as _}from"./index-CeFrI_-f.js";import{i as O}from"./AlertCircle-CQU3FO2-.js";import{s as B}from"./Plus-kHt_8stA.js";import{s as A}from"./User01-dc7WIl5M.js";import{t as R}from"./Users01-BaIVzoZ3.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-1dafL4bi.js";import{I as z}from"./input-CQlMbJrR.js";import{L as w}from"./label-CTaphTs2.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-CKIWskoO.js";import{T as W}from"./textarea-3tXmq-Wc.js";import{u as X,a as Y}from"./use-secrets-FJu3iWhY.js";import{R as Z}from"./require-capability-BikcW72U.js";import"./X-Dp6J1NZk.js";import"./index-DFK3AqOd.js";import"./Check-soPAeKca.js";import"./ChevronUp-B4upaCys.js";import"./access-gate-DVZHCUBi.js";import"./capability-load-error-_sxFuxMW.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
1
+ import{c as j,b as y,j as s,n as C,f6 as $,E as F,r as N,aP as L,B as D,a6 as E,t as _}from"./index-DUoAE5ST.js";import{i as O}from"./AlertCircle-DsOSKvzV.js";import{s as B}from"./Plus-Dc5RtznQ.js";import{s as A}from"./User01-Dd4e-mIA.js";import{t as R}from"./Users01-BYc5DjwP.js";import{D as I,b as q,c as V,d as H,h as G,e as J}from"./dialog-BgtCSZyf.js";import{I as z}from"./input-yIPgkwGw.js";import{L as w}from"./label-B5D3oXM0.js";import{S as K,b as M,a as Q,d as U,c as P}from"./select-BqWleZPz.js";import{T as W}from"./textarea-CVlc5gDB.js";import{u as X,a as Y}from"./use-secrets-DRwQEz1S.js";import{R as Z}from"./require-capability-CE5MPnLW.js";import"./X-AdrRw9Zp.js";import"./index-D6WmSRmP.js";import"./Check-CMF2Ywph.js";import"./ChevronUp-D_quOjFH.js";import"./access-gate-DTSTiQp3.js";import"./capability-load-error-DwYWnWZk.js";function ee(t){const e=j.c(6),{error:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(O,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let a;return e[4]!==n?(a=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=a):a=e[5],a}function te(t){const e=j.c(8),{scope:r}=t,i=y(),c=r==="user"?A:R;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const a=n;let l;e[3]!==c?(l=s.jsx(c,{size:12}),e[3]=c,e[4]=l):l=e[4];let o;return e[5]!==a||e[6]!==l?(o=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[l,a]}),e[5]=a,e[6]=l,e[7]=o):o=e[7],o}function T(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(E,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(te,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let a;e[5]!==c||e[6]!==n?(a=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=a):a=e[7];let l;e[8]!==r.description?(l=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=l):l=e[9];let o;e[10]!==a||e[11]!==l?(o=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[a,l]})]}),e[10]=a,e[11]=l,e[12]=o):o=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let m;e[15]!==d?(m=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=m):m=e[16];let x;return e[17]!==o||e[18]!==m?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[o,m]}),e[17]=o,e[18]=m,e[19]=x):x=e[19],x}function se(t){const e=j.c(15),{action:r}=t,i=y();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx("div",{className:"size-12 rounded-full bg-muted flex items-center justify-center",children:s.jsx(E,{size:20,className:"text-muted-foreground"})}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let a;e[3]!==n?(a=s.jsx("p",{className:"font-medium text-sm",children:n}),e[3]=n,e[4]=a):a=e[4];let l;e[5]!==i?(l=i("settings.secrets.emptyDescription"),e[5]=i,e[6]=l):l=e[6];let o;e[7]!==l?(o=s.jsx("p",{className:"text-xs text-muted-foreground mt-1 max-w-sm",children:l}),e[7]=l,e[8]=o):o=e[8];let d;e[9]!==a||e[10]!==o?(d=s.jsxs("div",{children:[a,o]}),e[9]=a,e[10]=o,e[11]=d):d=e[11];let m;return e[12]!==r||e[13]!==d?(m=s.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 p-10 flex flex-col items-center justify-center text-center gap-3",children:[c,d,r]}),e[12]=r,e[13]=d,e[14]=m):m=e[14],m}function k({open:t,onOpenChange:e}){const r=y(),[i,c]=N.useState("organization"),[n,a]=N.useState(""),[l,o]=N.useState(""),[d,m]=N.useState(""),x=Y();function g(){c("organization"),a(""),o(""),m("")}function p(){g(),e(!1)}async function b(u){if(u.preventDefault(),!(!n.trim()||!l))try{await x.mutateAsync({scope:i,name:n.trim(),value:l,description:d.trim()||void 0}),_.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){_.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(I,{open:t,onOpenChange:u=>{u?e(u):p()},children:s.jsxs(q,{className:"sm:max-w-lg",children:[s.jsxs(V,{children:[s.jsx(H,{children:r("settings.secrets.newSecretTitle")}),s.jsx(G,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(K,{value:i,onValueChange:u=>c(u),children:[s.jsx(M,{id:"secret-scope",children:s.jsx(Q,{})}),s.jsxs(U,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(z,{id:"secret-name",value:n,onChange:u=>a(u.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(z,{id:"secret-value",type:"password",value:l,onChange:u=>o(u.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(W,{id:"secret-description",value:d,onChange:u=>m(u.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(J,{children:[s.jsx(D,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(D,{type:"submit",disabled:x.isPending||!n.trim()||!l,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function re(){const t=j.c(34),e=y(),r=X(),[i,c]=N.useState(!1);let n,a;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),a=s.jsx(B,{size:14}),t[0]=n,t[1]=a):(n=t[0],a=t[1]);let l;t[2]!==e?(l=e("settings.secrets.newSecret"),t[2]=e,t[3]=l):l=t[3];let o;t[4]!==l?(o=s.jsx(C.Actions,{children:s.jsxs(D,{size:"sm",onClick:n,children:[a,l]})}),t[4]=l,t[5]=o):o=t[5];const d=o;if(r.length===0){let u;t[6]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(se,{action:!1}),t[6]=u):u=t[6];let f;t[7]!==i?(f=s.jsx(k,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,u,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let m,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const u=r.filter(le),f=r.filter(ce),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let S;t[18]!==r.length||t[19]!==e||t[20]!==h?(S=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=S):S=t[21];let v;t[22]!==S?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:S}),t[22]=S,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(m=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=m):m=t[26],x=u.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:u.map(ie)})]}):null,g=f.length>0?s.jsxs("section",{className:"rounded-2xl border border-border/60 bg-background p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ne)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=m,t[16]=x,t[17]=g}else m=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(k,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let b;return t[29]!==m||t[30]!==x||t[31]!==g||t[32]!==p?(b=s.jsxs(s.Fragment,{children:[m,x,g,p]}),t[29]=m,t[30]=x,t[31]=g,t[32]=p,t[33]=b):b=t[33],b}function ne(t){return s.jsx(T,{secret:t},t.id)}function ie(t){return s.jsx(T,{secret:t},t.id)}function ce(t){return t.scope==="user"}function le(t){return t.scope==="organization"}function ae(){const t=j.c(7),e=y();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(F,{fallback:oe,children:s.jsx(N.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(re,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs($,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function oe(t){const{error:e}=t;return s.jsx(ee,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(Z,{capability:"secrets:manage",area:"secrets",children:s.jsx(ae,{})}),t[0]=e):e=t[0],e}export{ze as default};
@@ -0,0 +1 @@
1
+ import{c as Jt,b as Qt,r as k,l as ne,j as n,aO as po,B as Vt,G as Kt,aJ as ho,I as go,H as vo,o as So,h as yo,t as N,K as bo}from"./index-DUoAE5ST.js";import{u as xo}from"./chat-context-fDVt7FJu.js";import{u as ps}from"./use-new-blocks-editor-D6z95MNv.js";import{J as na,K as _o,L as jo,N as Eo,O as ko,Q as aa,T as wo,U as Ro,V as Vo,W as To,X as No,Y as Cn,Z as Ao,_ as Mo,H as Rt,$ as Cs,a0 as Ks,a1 as xt,D as us,z as ds,a2 as Lt,e as Po,f as Do,j as Co,u as Ko,a3 as Kn,a4 as Bo,a5 as Lo,a6 as Fo,a7 as Io,a8 as Oo,p as is,a9 as zo,C as kt,aa as qt,ab as $o,ac as Ho,ad as tt,ae as Bn,x as Ln,af as Go,ag as As,ah as qo,ai as ls,aj as Fn,ak as In,al as On,am as Ms,I as bt,an as Wt,ao as Wo,ap as Uo,A as Jo,aq as zn,ar as Qo,as as $n,at as Hn,M as Yo,au as Gn,av as lt,aw as Xo,ax as Zo,G as er,ay as tr,d as sr,az as qn,aA as nr,aB as wt,aC as ar,aD as or,aE as rr,aF as Wn,aG as Ut,aH as ir,aI as lr,aJ as cr,aK as ur,aL as dr,aM as mr,aN as fr,aO as Ps,aP as pr,aQ as hr,aR as gr,aS as vr,aT as Sr}from"./runnable-block-editor-lWMI5Iat.js";import{f as yr}from"./repository-binding-B_NhY5XW.js";import{n as br,t as xr}from"./ChevronUp-D_quOjFH.js";import{a3 as oa,b as fs,ag as _r,w as jr,X as Un,F as Jn}from"./agent-icon-B1JUa-pK.js";import{S as Bt}from"./scroll-area-BtQLVih8.js";import{b as ct,T as ut,a as dt}from"./tooltip-DR03IHA1.js";import{m as Er,u as kr,P as wr}from"./mustache-BgYmPFKE.js";import{b as Is,G as Rr,e as Vr,j as Tr,g as Nr,r as cs,X as Qn,Q as Ar}from"./claim-phase-copy-DAgG3vfo.js";import{a as Mr}from"./Copy01-Dd4ky6ZP.js";import{a as Bs,d as ra}from"./UserSquare-DcFHmf0l.js";import{e as Yn}from"./Tool01-gx1zwKcn.js";import{s as Xn}from"./Image01-BdsDNVox.js";import{s as Pr}from"./Plus-Dc5RtznQ.js";import{s as Dr}from"./Trash01-DliBU2bP.js";import{i as Ls}from"./ZoomOut-Bqjt8gJB.js";import{a as Cr,b as Zn,d as Kr,K as Br,P as Lr,u as Fr,C as Ir,s as Or,e as ms,D as zr,c as $r,S as Hr,v as Gr}from"./rich-text-link-control-1OzevT91.js";import{a as qr,P as ea,b as Wr}from"./page-seo-form-BbLnwvLC.js";import{u as Ur,A as Jr}from"./use-section-preview-base-B_v6WwFH.js";import{b as ta,a as Qr}from"./variant-matcher-override-D18XaBSZ.js";import"./use-panel-navigate-DSVmT0jD.js";import"./thread-route-B6BPC0Ck.js";import"./use-project-scope-Bo2r-DyF.js";import"./autosend-C7EnJZLv.js";import"./thread-intent-CqtUmKwo.js";import"./use-mcp-client-BUxJmD4z.js";import"./auth-DS4Lo40d.js";import"./backoff-8mStPHYB.js";import"./task-board-BoLv4xpd.js";import"./schema-CBdf6nVq.js";import"./slugify-CEUa2lfQ.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-decopilot-events-CRlKPkfk.js";import"./use-ai-providers-CoMpro3i.js";import"./location-DBePU4bz.js";import"./use-organization-settings-BrhF1m2_.js";import"./use-session-runtime-DSwirXrC.js";import"./Sun-CepnW0AC.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-9c3wI9G4.js";import"./ArrowRight-A-Nw2bpi.js";import"./Check-CMF2Ywph.js";import"./format-time-CjIPQhCN.js";import"./differenceInSeconds-C3x8sHUj.js";import"./collapsible-aZePgHKd.js";import"./use-copy-Cq1WnAZO.js";import"./usage-stats-C51kdK-O.js";import"./markdown-Cuay45B5.js";import"./dialog-BgtCSZyf.js";import"./X-AdrRw9Zp.js";import"./org-file-open-context-BJfMfMA3.js";import"./use-mobile-DPqh4jRn.js";import"./shell-layout-C8-wrHjg.js";import"./avatar-D5EBeZdt.js";import"./User01-Dd4e-mIA.js";import"./Palette-D5d1Mblr.js";import"./XClose-DXJf2S1e.js";import"./download-app-dialog-BRX0Ra47.js";import"./CheckCircle-Brn-seMk.js";import"./Monitor01-C2krU25E.js";import"./command-BaUKjhoV.js";import"./index-Dvm5L9kf.js";import"./SearchMd-B30D9ndg.js";import"./integration-icon-DsxYi58j.js";import"./project-icon-6NFCCRCG.js";import"./new-project-dialog-utK5AYOj.js";import"./ArrowLeft-2lm_J3QC.js";import"./input-yIPgkwGw.js";import"./label-B5D3oXM0.js";import"./repository-import-picker-R1iARtfq.js";import"./use-navigate-to-agent-D9zMng25.js";import"./repository-picker-AmyIhwMY.js";import"./LinkExternal01-ZFH-yoZN.js";import"./useInfiniteQuery-DK0olIK3.js";import"./infiniteQueryObserver-boyhd8Uv.js";import"./collection-search-CBSxLm5u.js";import"./ShoppingBag01-DouihxuQ.js";import"./use-debounced-value-CQlodPiq.js";import"./required-auth-layout-SykeHPol.js";import"./use-org-sso-DzOXFkj8.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-Bz2q_atZ.js";import"./types-LTX_QS_n.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./gateway-client-DFxhiMGP.js";import"./tool-namespace-DmnQIdtF.js";import"./utils-CVEq3hMx.js";import"./AlertCircle-DsOSKvzV.js";import"./sheet-Bd039v18.js";import"./use-connection-Dqt9FsoJ.js";import"./Link01-CMEXeVpO.js";import"./use-mcp-prompts-BbeFHvZR.js";import"./index-T9qmd0M1.js";import"./form-Bwkg8Jqa.js";import"./use-thread-outputs-DXHpolX2.js";import"./file-type-icon-Cejgy7H6.js";import"./popover-LjbxD4kl.js";import"./utils-VHhyqMwa.js";import"./monaco-editor-BBA-2xe3.js";import"./editor-DuOWmHoR.js";import"./calendar-yvfvBAzS.js";import"./textarea-CVlc5gDB.js";import"./select-BqWleZPz.js";import"./index-D6WmSRmP.js";import"./switch-Ief2Eh48.js";import"./combobox-VNs66YBC.js";import"./alert-dialog-CIK2aHDv.js";import"./sandbox-url-D3mC8qhT.js";import"./Upload01-CQpa1a9n.js";import"./DotsVertical-kOg4pODr.js";import"./search-input-BbRzOQHT.js";import"./tabs-BRLOXiKA.js";import"./use-file-configs-Dm5QQPiU.js";import"./asset-utils-vxXtnPR8.js";import"./use-chat-layout-state-_HZU5xG7.js";import"./site-slug-DebpOoQq.js";import"./toggle-group-DiLzg8Oz.js";import"./sandbox-git-api-B1R0585s.js";import"./ArrowUp-CAUQitV-.js";import"./CreditCard01-DFpHESd1.js";import"./Key01-BUAFoCLq.js";import"./Users01-BYc5DjwP.js";import"./section-preview-url-Csj0_ZDg.js";function Yr(h){return h.schema?.definitions??h.schema?.$defs??{}}function ia(h,e){const c=Yr(e),p=c[btoa(h)];if(!p)return[];const g=[p];if(Array.isArray(p.allOf)){const j=p.allOf.find(E=>typeof E.$ref=="string")?.$ref;if(typeof j=="string"){const E=c[j.replace("#/definitions/","")];E&&g.push(E)}}return g}function Xr(h,e){for(const c of ia(h,e)){const p=typeof c.image=="string"?c.image:void 0;if(p?.includes("{{{"))return p}}function Zr(h,e){if(!e)return;const c=na(h);if(!c)return;const p=Xr(c.resolveType,e);if(!p)return;const g=_o(p,c.data);if(g)return jo(g)}const ei={escape:Eo};function ti(h,e){for(const c of ia(h,e)){const p=typeof c.title=="string"?c.title:void 0;if(p?.includes("{{"))return p}}function si(h,e){if(!e)return;const c=na(h);if(c)try{const p=ti(c.resolveType,e);return p&&Er.render(p,c.data,{},ei).trim()||void 0}catch{return}}function ni(h){const e=Jt.c(13),{icon:c,label:p,className:g}=h;let j;e[0]!==g?(j=ne("size-3.5",g),e[0]=g,e[1]=j):j=e[1];let E;e[2]!==c||e[3]!==j?(E=n.jsx(c,{className:j}),e[2]=c,e[3]=j,e[4]=E):E=e[4];let y;e[5]!==p||e[6]!==E?(y=n.jsx(ut,{asChild:!0,children:n.jsx("span",{role:"img","aria-label":p,className:"shrink-0 cursor-help",children:E})}),e[5]=p,e[6]=E,e[7]=y):y=e[7];let R;e[8]!==p?(R=n.jsx(dt,{className:"max-w-56",children:p}),e[8]=p,e[9]=R):R=e[9];let b;return e[10]!==y||e[11]!==R?(b=n.jsxs(ct,{children:[y,R]}),e[10]=y,e[11]=R,e[12]=b):b=e[12],b}const ai="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function sa(h){return Array.from({length:h},(e,c)=>({id:crypto.randomUUID(),index:c}))}function la(h){return h.map((e,c)=>({...e,index:c}))}function oi(h,e){if(e===h.length)return h;if(e<h.length)return la(h.slice(0,e));const c=Array.from({length:e-h.length},(p,g)=>({id:crypto.randomUUID(),index:h.length+g}));return[...h,...c]}function ca(h){const e=Jt.c(44),{section:c,raw:p,meta:g,decofile:j}=h,E=Qt(),y=ps(),R=c.isSavedBlock===!0,b=c.isMultivariate===!0;let J;e[0]!==g||e[1]!==p?(J=p&&g?Zr(p,g):void 0,e[0]=g,e[1]=p,e[2]=J):J=e[2];const de=J;let Ce;e[3]!==g||e[4]!==b||e[5]!==p||e[6]!==R?(Ce=p&&g&&!R&&!b?si(p,g):void 0,e[3]=g,e[4]=b,e[5]=p,e[6]=R,e[7]=Ce):Ce=e[7];const Ke=Ce;let Ve;e[8]!==j||e[9]!==g||e[10]!==p||e[11]!==c?(Ve=No(p,c,j,g),e[8]=j,e[9]=g,e[10]=p,e[11]=c,e[12]=Ve):Ve=e[12];const ae=Ve;let r;e[13]!==b||e[14]!==p?.__resolveType?(r=!b&&Is(p?.__resolveType??""),e[13]=b,e[14]=p?.__resolveType,e[15]=r):r=e[15];const V=r,he=R?fs:b?oa:ra;let $;e[16]!==b||e[17]!==R?($=R?{color:Rr}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=b,e[17]=R,e[18]=$):$=e[18];const u=$;let O;e[19]!==he||e[20]!==y?(O=y?n.jsxs("span",{className:"relative size-4 shrink-0",children:[n.jsx(he,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),n.jsx(Mo,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):n.jsx(_r,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=he,e[20]=y,e[21]=O):O=e[21];let i;e[22]!==de?(i=de&&n.jsx("img",{src:de,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=de,e[23]=i):i=e[23];let W;e[24]!==y||e[25]!==u?(W=!y&&n.jsx(Bs,{className:"h-4 w-4 shrink-0",style:u}),e[24]=y,e[25]=u,e[26]=W):W=e[26];const G=y?"shrink":"flex-1",Ee=c.isHidden&&"line-through opacity-50";let Te;e[27]!==Ee||e[28]!==G?(Te=ne("min-w-0 truncate text-sm font-medium",G,Ee),e[27]=Ee,e[28]=G,e[29]=Te):Te=e[29];const Ge=Ke??c.label;let xe;e[30]!==Te||e[31]!==Ge?(xe=n.jsx("span",{className:Te,children:Ge}),e[30]=Te,e[31]=Ge,e[32]=xe):xe=e[32];let m;e[33]!==V||e[34]!==y||e[35]!==ae||e[36]!==E?(m=y?n.jsxs(n.Fragment,{children:[V&&n.jsx(ni,{icon:Ls,label:E("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),ae&&n.jsx(Cn,{}),n.jsx("span",{className:"min-w-0 flex-1"})]}):ae&&n.jsx(Cn,{className:"absolute -right-0.5 -top-0.5"}),e[33]=V,e[34]=y,e[35]=ae,e[36]=E,e[37]=m):m=e[37];let M;return e[38]!==xe||e[39]!==m||e[40]!==O||e[41]!==i||e[42]!==W?(M=n.jsxs(n.Fragment,{children:[O,i,W,xe,m]}),e[38]=xe,e[39]=m,e[40]=O,e[41]=i,e[42]=W,e[43]=M):M=e[43],M}const ri="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",ii="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function ua(h,e,c){if(c)return Ao({selected:e});const p=h.isSavedBlock===!0,g=h.isMultivariate===!0;return ne("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":p?ri:g?ii:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Ds(h,e){return ne("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":h?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function li(h){const e=Jt.c(90),{section:c,raw:p,meta:g,decofile:j,sortableId:E,selected:y,onSelect:R,onDelete:b,onDuplicate:J,onMakeReusable:de,onToggleHidden:Ce,onToggleLazy:Ke,onAddVariant:Ve,onDetach:ae}=h,r=Qt(),V=ps(),he=p?Is(p.__resolveType??""):!1,$=c.isHidden===!0,u=he||$;let O;e[0]!==c?(O=aa(c),e[0]=c,e[1]=O):O=e[1];const i=O;let W;e[2]!==E?(W={id:E,animateLayoutChanges:di},e[2]=E,e[3]=W):W=e[3];const{attributes:G,listeners:Ee,setNodeRef:Te,transform:Ge,isDragging:xe}=Fr(W);let m;e[4]!==Ge?(m=Ir.Transform.toString(Ge?{...Ge,x:0}:null),e[4]=Ge,e[5]=m):m=e[5];const M=xe?0:void 0;let qe;e[6]!==m||e[7]!==M?(qe={transform:m,opacity:M},e[6]=m,e[7]=M,e[8]=qe):qe=e[8];const F=qe;let We;e[9]!==c?(We=wo(c),e[9]=c,e[10]=We):We=e[10];const z=We,mt="button",me=0;let Oe;e[11]!==R?(Oe=P=>{(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),R())},e[11]=R,e[12]=Oe):Oe=e[12];const _t=xe?"cursor-grabbing":"cursor-pointer";let Be;e[13]!==V||e[14]!==c||e[15]!==y||e[16]!==_t?(Be=ne("touch-none transition-colors",_t,ua(c,y,V)),e[13]=V,e[14]=c,e[15]=y,e[16]=_t,e[17]=Be):Be=e[17];let oe;e[18]!==j||e[19]!==g||e[20]!==p||e[21]!==c?(oe=n.jsx(ca,{section:c,raw:p,meta:g,decofile:j}),e[18]=j,e[19]=g,e[20]=p,e[21]=c,e[22]=oe):oe=e[22];const re=!V&&!c.isMultivariate&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ne(Ds(u,he)),onClick:P=>{P.stopPropagation(),Ke()},onPointerDown:ui,children:n.jsx(Ls,{className:ne("h-3.5 w-3.5",he&&"text-warning")})})}),n.jsx(dt,{side:"bottom",children:r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ne=V?n.jsx(Ro,{label:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:$,onToggle:Ce,children:$?n.jsx(Yn,{className:"h-3.5 w-3.5"}):n.jsx(Xn,{className:"h-3.5 w-3.5"})}):n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ne(Ds(u,$)),onClick:P=>{P.stopPropagation(),Ce()},onPointerDown:ci,children:$?n.jsx(Yn,{className:"h-3.5 w-3.5"}):n.jsx(Xn,{className:"h-3.5 w-3.5"})})}),n.jsx(dt,{side:"bottom",children:r($?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),B=go,A=Vo;let ie;e[23]!==r?(ie=r("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=r,e[24]=ie):ie=e[24];const ke=ne(Ds(u,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let Ae;e[25]!==A||e[26]!==ie||e[27]!==ke?(Ae=n.jsx(A,{label:ie,classicClassName:ke}),e[25]=A,e[26]=ie,e[27]=ke,e[28]=Ae):Ae=e[28];let we;e[29]!==V||e[30]!==he||e[31]!==Ke||e[32]!==c.isMultivariate||e[33]!==r?(we=V&&!c.isMultivariate&&n.jsxs(n.Fragment,{children:[n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),Ke()},children:[n.jsx(Ls,{className:"h-4 w-4"}),r(he?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),n.jsx(ho,{})]}),e[29]=V,e[30]=he,e[31]=Ke,e[32]=c.isMultivariate,e[33]=r,e[34]=we):we=e[34];let H;e[35]!==J?(H=P=>{P.stopPropagation(),J()},e[35]=J,e[36]=H):H=e[36];let le;e[37]===Symbol.for("react.memo_cache_sentinel")?(le=n.jsx(Mr,{className:"h-4 w-4"}),e[37]=le):le=e[37];let _e;e[38]!==r?(_e=r("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=r,e[39]=_e):_e=e[39];let fe;e[40]!==H||e[41]!==_e?(fe=n.jsxs(Kt,{onClick:H,children:[le,_e]}),e[40]=H,e[41]=_e,e[42]=fe):fe=e[42];let te;e[43]!==V||e[44]!==i||e[45]!==Ve||e[46]!==r?(te=i&&n.jsxs(Kt,{className:ne(!V&&To),onClick:P=>{P.stopPropagation(),Ve()},children:[n.jsx(oa,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=V,e[44]=i,e[45]=Ve,e[46]=r,e[47]=te):te=e[47];let pe;e[48]!==V||e[49]!==z||e[50]!==de||e[51]!==r?(pe=z&&n.jsxs(Kt,{className:ne(!V&&ai),onClick:P=>{P.stopPropagation(),de()},children:[V?n.jsx(fs,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=V,e[49]=z,e[50]=de,e[51]=r,e[52]=pe):pe=e[52];let se;e[53]!==V||e[54]!==ae||e[55]!==c.isMultivariate||e[56]!==c.isSavedBlock||e[57]!==r?(se=c.isSavedBlock===!0&&!c.isMultivariate&&n.jsxs(Kt,{onClick:P=>{P.stopPropagation(),ae()},children:[V?n.jsx(ra,{className:"h-4 w-4"}):n.jsx(Bs,{className:"h-4 w-4"}),r("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=V,e[54]=ae,e[55]=c.isMultivariate,e[56]=c.isSavedBlock,e[57]=r,e[58]=se):se=e[58];let Me;e[59]!==b?(Me=P=>{P.stopPropagation(),b()},e[59]=b,e[60]=Me):Me=e[60];let ge;e[61]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(Dr,{className:"h-4 w-4"}),e[61]=ge):ge=e[61];let Re;e[62]!==r?(Re=r("sectionsEditor.sectionList.deleteMenuItem"),e[62]=r,e[63]=Re):Re=e[63];let je;e[64]!==Me||e[65]!==Re?(je=n.jsxs(Kt,{variant:"destructive",onClick:Me,children:[ge,Re]}),e[64]=Me,e[65]=Re,e[66]=je):je=e[66];let ve;e[67]!==we||e[68]!==fe||e[69]!==te||e[70]!==pe||e[71]!==se||e[72]!==je?(ve=n.jsxs(vo,{align:"end",className:"w-44",children:[we,fe,te,pe,se,je]}),e[67]=we,e[68]=fe,e[69]=te,e[70]=pe,e[71]=se,e[72]=je,e[73]=ve):ve=e[73];let Se;e[74]!==B||e[75]!==Ae||e[76]!==ve?(Se=n.jsxs(B,{children:[Ae,ve]}),e[74]=B,e[75]=Ae,e[76]=ve,e[77]=Se):Se=e[77];let ze;return e[78]!==G||e[79]!==Ee||e[80]!==R||e[81]!==Te||e[82]!==F||e[83]!==Be||e[84]!==oe||e[85]!==re||e[86]!==Ne||e[87]!==Se||e[88]!==Oe?(ze=n.jsxs("div",{ref:Te,style:F,...G,...Ee,role:mt,tabIndex:me,onClick:R,onKeyDown:Oe,className:Be,children:[oe,re,Ne,Se]}),e[78]=G,e[79]=Ee,e[80]=R,e[81]=Te,e[82]=F,e[83]=Be,e[84]=oe,e[85]=re,e[86]=Ne,e[87]=Se,e[88]=Oe,e[89]=ze):ze=e[89],ze}function ci(h){return h.stopPropagation()}function ui(h){return h.stopPropagation()}function di(){return!1}function Fs(h){const e=Jt.c(11),{canAddSection:c,onAddSection:p,className:g,size:j}=h,E=Qt();let y;e[0]!==g?(y=ne("w-full",g),e[0]=g,e[1]=y):y=e[1];const R=!c;let b;e[2]===Symbol.for("react.memo_cache_sentinel")?(b=n.jsx(Pr,{size:14}),e[2]=b):b=e[2];let J;e[3]!==E?(J=E("sectionsEditor.sectionList.addSectionButton"),e[3]=E,e[4]=J):J=e[4];let de;return e[5]!==p||e[6]!==j||e[7]!==y||e[8]!==R||e[9]!==J?(de=n.jsxs(Vt,{type:"button",variant:"outline",size:j,className:y,disabled:R,onClick:p,children:[b,J]}),e[5]=p,e[6]=j,e[7]=y,e[8]=R,e[9]=J,e[10]=de):de=e[10],de}function mi(h){const e=Jt.c(101),{listKey:c,rawSections:p,sections:g,meta:j,decofile:E,selectedIndex:y,onSelect:R,onReorder:b,onDelete:J,onDuplicate:de,onMakeReusable:Ce,onToggleHidden:Ke,onToggleLazy:Ve,onAddVariant:ae,onDetach:r,onAddSection:V,canAddSection:he}=h,$=he===void 0?!0:he,u=Qt(),O=ps();let i;e[0]!==g.length?(i=()=>sa(g.length),e[0]=g.length,e[1]=i):i=e[1];const[W,G]=k.useState(i),[Ee,Te]=k.useState(null),[Ge,xe]=k.useState(c),[m,M]=k.useState(g.length),qe=k.useRef(!1);Ge!==c?(xe(c),M(g.length),G(sa(g.length))):m!==g.length&&(M(g.length),G(Pe=>oi(Pe,g.length)));let F;e[2]===Symbol.for("react.memo_cache_sentinel")?(F={activationConstraint:{distance:8}},e[2]=F):F=e[2];let We;e[3]===Symbol.for("react.memo_cache_sentinel")?(We={coordinateGetter:Or},e[3]=We):We=e[3];const z=Cr(Zn(Lr,F),Zn(Br,We));let mt;e[4]!==W?(mt=W.map(fi),e[4]=W,e[5]=mt):mt=e[5];const me=mt;let Oe;e[6]===Symbol.for("react.memo_cache_sentinel")?(Oe=Pe=>{Te(String(Pe.active.id))},e[6]=Oe):Oe=e[6];const _t=Oe;let Be;e[7]!==me||e[8]!==b?(Be=Pe=>{Te(null);const{active:I,over:C}=Pe;if(!C||I.id===C.id)return;const Le=me.indexOf(String(I.id)),Xe=me.indexOf(String(C.id));Le===-1||Xe===-1||(G(nt=>la(ms([...nt],Le,Xe))),qe.current=!0,requestAnimationFrame(()=>{qe.current=!1}),b?.(Le,Xe))},e[7]=me,e[8]=b,e[9]=Be):Be=e[9];const oe=Be;let re;e[10]===Symbol.for("react.memo_cache_sentinel")?(re=()=>{Te(null)},e[10]=re):re=e[10];const Ne=re;let B,A,ie,ke,Ae,we,H,le,_e,fe,te,pe,se,Me,ge;if(e[11]!==Ee||e[12]!==$||e[13]!==O||e[14]!==E||e[15]!==W||e[16]!==me||e[17]!==oe||e[18]!==j||e[19]!==V||e[20]!==ae||e[21]!==J||e[22]!==r||e[23]!==de||e[24]!==Ce||e[25]!==R||e[26]!==Ke||e[27]!==Ve||e[28]!==p||e[29]!==g||e[30]!==y||e[31]!==z||e[32]!==u){Me=Symbol.for("react.early_return_sentinel");e:{const Pe=I=>{qe.current||R(I)};if(e[48]!==Ee||e[49]!==$||e[50]!==O||e[51]!==W||e[52]!==V||e[53]!==p||e[54]!==g||e[55]!==u){const I=Ee?W.find(C=>C.id===Ee):null;if(ke=I!=null?g[I.index]:null,ie=I!=null?p[I.index]:void 0,W.length===0){let C;e[59]!==u?(C=u("sectionsEditor.sectionList.noSections"),e[59]=u,e[60]=C):C=e[60];let Le;e[61]!==C?(Le=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:C}),e[61]=C,e[62]=Le):Le=e[62];const Xe=Le;let nt;e[63]!==$||e[64]!==O||e[65]!==Xe||e[66]!==V?(nt=O?Xe:n.jsxs("div",{className:"space-y-2",children:[Xe,n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm"})]}),e[63]=$,e[64]=O,e[65]=Xe,e[66]=V,e[67]=nt):nt=e[67],Me=nt;break e}se=ne(I&&"cursor-grabbing"),e[48]=Ee,e[49]=$,e[50]=O,e[51]=W,e[52]=V,e[53]=p,e[54]=g,e[55]=u,e[56]=ie,e[57]=ke,e[58]=se}else ie=e[56],ke=e[57],se=e[58];A=zr,le=z,_e=$r,fe=_t,te=oe,pe=Ne,B=Hr,we=me,H=Gr,ge="space-y-1",Ae=W.map(I=>{const C=g[I.index];return C?n.jsx(li,{sortableId:I.id,section:C,raw:p[I.index],meta:j,decofile:E,selected:y===I.index,onSelect:()=>Pe(I.index),onDelete:()=>J(I.index),onDuplicate:()=>de(I.index),onMakeReusable:()=>Ce(I.index),onToggleHidden:()=>Ke(I.index),onToggleLazy:()=>Ve(I.index),onAddVariant:()=>ae(I.index),onDetach:()=>r(I.index)},I.id):null})}e[11]=Ee,e[12]=$,e[13]=O,e[14]=E,e[15]=W,e[16]=me,e[17]=oe,e[18]=j,e[19]=V,e[20]=ae,e[21]=J,e[22]=r,e[23]=de,e[24]=Ce,e[25]=R,e[26]=Ke,e[27]=Ve,e[28]=p,e[29]=g,e[30]=y,e[31]=z,e[32]=u,e[33]=B,e[34]=A,e[35]=ie,e[36]=ke,e[37]=Ae,e[38]=we,e[39]=H,e[40]=le,e[41]=_e,e[42]=fe,e[43]=te,e[44]=pe,e[45]=se,e[46]=Me,e[47]=ge}else B=e[33],A=e[34],ie=e[35],ke=e[36],Ae=e[37],we=e[38],H=e[39],le=e[40],_e=e[41],fe=e[42],te=e[43],pe=e[44],se=e[45],Me=e[46],ge=e[47];if(Me!==Symbol.for("react.early_return_sentinel"))return Me;let Re;e[68]!==Ae||e[69]!==ge?(Re=n.jsx("div",{className:ge,children:Ae}),e[68]=Ae,e[69]=ge,e[70]=Re):Re=e[70];let je;e[71]!==B||e[72]!==we||e[73]!==H||e[74]!==Re?(je=n.jsx(B,{items:we,strategy:H,children:Re}),e[71]=B,e[72]=we,e[73]=H,e[74]=Re,e[75]=je):je=e[75];let ve;e[76]!==ie||e[77]!==ke||e[78]!==O||e[79]!==E||e[80]!==j?(ve=ke?n.jsx("div",{className:ne("cursor-grabbing shadow-lg ring-1 ring-border/60",ua(ke,!1,O)),children:n.jsx(ca,{section:ke,raw:ie,meta:j,decofile:E})}):null,e[76]=ie,e[77]=ke,e[78]=O,e[79]=E,e[80]=j,e[81]=ve):ve=e[81];let Se;e[82]!==ve?(Se=po.createPortal(n.jsx(Kr,{dropAnimation:ko,children:ve}),document.body),e[82]=ve,e[83]=Se):Se=e[83];let ze;e[84]!==A||e[85]!==le||e[86]!==_e||e[87]!==fe||e[88]!==te||e[89]!==pe||e[90]!==je||e[91]!==Se?(ze=n.jsxs(A,{sensors:le,collisionDetection:_e,onDragStart:fe,onDragEnd:te,onDragCancel:pe,children:[je,Se]}),e[84]=A,e[85]=le,e[86]=_e,e[87]=fe,e[88]=te,e[89]=pe,e[90]=je,e[91]=Se,e[92]=ze):ze=e[92];let P;e[93]!==$||e[94]!==O||e[95]!==V?(P=!O&&n.jsx(Fs,{canAddSection:$,onAddSection:V,size:"sm",className:"mt-2"}),e[93]=$,e[94]=O,e[95]=V,e[96]=P):P=e[96];let st;return e[97]!==se||e[98]!==ze||e[99]!==P?(st=n.jsxs("div",{className:se,children:[ze,P]}),e[97]=se,e[98]=ze,e[99]=P,e[100]=st):st=e[100],st}function fi(h){return h.id}function da(h,e){if(!h?.properties||e===null||typeof e!="object"||Array.isArray(e))return e;const c=e;let p=null;const g=()=>p??={...c};for(const[j,E]of Object.entries(h.properties)){if(!E||j.startsWith("__")||j==="@type")continue;const y=c[j];if(y===void 0){E.default!==void 0&&(g()[j]=E.default);continue}if(pi(E,y)){const R=da(E,y);R!==y&&(g()[j]=R)}}return p??e}function pi(h,e){return h.type==="object"&&h.properties!=null&&e!==null&&typeof e=="object"&&!Array.isArray(e)&&!("__resolveType"in e)}function hi(h,e,c,p){if(!h||typeof h!="object")return{kind:"error",reason:"no-matcher-rule"};const g=e.trim();if(!g)return Rt(h,c,p)?{kind:"inline",blockKey:h.__resolveType??"",inlinedRule:Cs(h,c,p)}:{kind:"noop"};const j=Ks(h,c,p);if(!j)return{kind:"error",reason:"unreadable-rule"};if(j.blockKey)return{kind:"updateBlock",blockKey:j.blockKey,blockData:xt(j.resolveType,j.data,g)};const E=us(g),y=ds(E,c);return y?{kind:"error",reason:"invalid-block-id",message:y}:{kind:"createBlock",blockId:E,blockData:xt(j.resolveType,j.data,g),reference:Lt(E)}}function Cc({orgSlug:h,virtualMcpId:e,branch:c,previewReady:p=!0,previewUrl:g,currentPath:j,activePageBlockKey:E=null,activeGlobalBlockKey:y=null,externalSelection:R,onSaved:b,initialEditSeo:J=!1,onExitSeo:de,onSelectRoot:Ce,onViewJsonFile:Ke,onFocusedBlockChange:Ve,onVariantPreviewOverride:ae}){const r=Qt(),V=xo(),he=V?.taskId??null,$=p?{orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g}:null,{data:u,isLoading:O}=Po($),{data:i,isLoading:W}=Do($),G=ps(),Ee=V?.virtualMcpId,Ge=yr(Ee===e?e:null)?.metadata?.siteSlug??null,xe=Ur({virtualMcpId:e,sandboxUrl:g}),[m,M]=k.useState(null),[qe,F]=k.useState(null),[We,z]=k.useState(null),[mt,me]=k.useState(0),[Oe,_t]=k.useState(void 0),[Be,oe]=k.useState(null),[re,Ne]=k.useState(null),[B,A]=k.useState([]),ie=k.useRef(null),[ke,Ae]=k.useState(B.length);ke!==B.length&&(Ae(B.length),requestAnimationFrame(()=>{ie.current&&(ie.current.scrollTop=0)}));const[we,H]=k.useState(0),[le,_e]=k.useState(null),[fe,te]=k.useState(null),[pe,se]=k.useState(null),[Me,ge]=k.useState(!1),[Re,je]=k.useState(!1),ve=k.useRef(null),[Se,ze]=k.useState(!0),[P,st]=k.useState(!1),[Pe,I]=k.useState(!1),[C,Le]=k.useState(J),[Xe,nt]=k.useState(J);J&&!Xe&&(nt(!0),Le(!0),M(null),F(null),z(null),A([])),!J&&Xe&&nt(!1);const[ma,Yt]=k.useState(null),[Os,hs]=k.useState(void 0),[zs,jt]=k.useState([]),[$s,Ft]=k.useState(0),[Fe,Ue]=k.useState(0),[fa,De]=k.useState(null),[Tt,Ie]=k.useState(null),[Hs,Gs]=k.useState(null),pa=So(),ha=`${h}/${e}/${c}`,Xt=Co({orgSlug:h,virtualMcpId:e,branch:c}),[ga,va]=k.useState(j),[Sa,ya]=k.useState(E),[ba,xa]=k.useState(y);(ga!==j||Sa!==E||ba!==y)&&(queueMicrotask(()=>Xt.flush()),va(j),ya(E),xa(y),M(null),F(null),z(null),me(0),oe(null),Ne(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1),Le(!1),Yt(null),hs(void 0),jt([]),Ft(t=>t+1));const q=Ko({orgSlug:h,virtualMcpId:e,branch:c}),It=sr((t,s)=>{q.mutate({blockKey:t,data:s},{onSuccess:()=>b?.(),onError:a=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),Zt=kr({orgSlug:h,virtualMcpId:e,branch:c}),[Nt,At]=k.useState(!1),Q=k.useRef(null),at=k.useRef(null),ot=k.useRef(null),gs=k.useRef({}),$e=k.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[_a,ja]=k.useState(null);if(!p||O||W)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(yo,{className:"size-5 text-muted-foreground"})});if(!u||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Ea=Vr(u),Y=!!y,Z=Y?null:Tr(Ea,j,E),v=Y?y:Z?.key??null,vs=Y&&y?u[y]:void 0,qs=Y&&y&&vs?Nr(y,vs):Y&&y?y:"",Ot=!Y&&v&&u[v]?u[v]:null,Ss=C&&u&&i&&v&&Z?Kn(u,{kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},i):null,ka=C?Ot?.seo:void 0,es=Os!==void 0?Os:ka,wa=C?Bo(es):void 0,Ws=Ss?.seoTypeOptions??[],Us=C&&i?Lo(i):"",ys=ma??wa??{},ts=C&&Ss?qr(ys,Ss):null,Js=C&&ts&&Fo(es)?cs(ts,i):null,Qs=C?Io(u,i)?.seoData:void 0,ce=Y?[{label:"Default",sections:[{__resolveType:y}]}]:Oo(Ot?.sections,u??{}),Ze=ce.length>1,ee=Math.min(mt,ce.length-1),He=ce[ee],K=He?.sections??[],ye=is(K,u),bs=!Y&&zo(Ot?.sections);if(Y&&y&&Hs!==y){Gs(y);const t=K[0],s=ye[0];if(t&&s){M(0),Ue(0),A([]);const a=kt(t,s,u);a&&(F(a.data),z(a.resolveType),Ie(null),De(null))}}!Y&&Hs!==null&&Gs(null),$e.current={rawSections:K,parsedSections:ye,decofile:u??{},activePageKey:v,pageVariants:ce,variantIndex:ee,sectionVariantIndex:Fe,selectedSectionIndex:m};const Ra=()=>({multivariate:bs,index:ee,variants:ce.map(t=>({rule:t.rule}))}),xs=(t,s)=>{if(!ae)return;if(!v||!bs||t.length<=1){ae(null);return}const a=ta(v,{multivariate:!0,index:s,variants:t},u,i);ae(a.length>0?a:null)},_s=ae&&v&&bs&&Ze&&!O&&!W?v:null;if(_s!==_a&&(ja(_s),_s)){const t=ce.map(a=>({rule:a.rule})),s=ee;queueMicrotask(()=>xs(t,s))}const Mt=(t,s,a)=>{if(!ae)return;if(!v){ae(null);return}const o=Ra(),l=ta(v,o,u,i);if(!t||s<0){ae(l.length>0?l:null);return}const f=Qr({pageKey:v,page:o,sectionIndex:s,sectionLazy:ye[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:u,meta:i}),d=[...l,...f];ae(d.length>0?d:null)},ft=(t,s,a,o=m??-1,l=!1)=>{const f=tt(t,s);if(!f){F(null),z(null),Ie(null),De(null),l&&Mt(null,o,a);return}const x=Bn(f,lt)[a];if(!x){F(null),z(null),Ie(null),De(null),l&&Mt(null,o,a);return}const T=Xo(x.value,u);F(T?.data??null),z(T?.resolveType??null);const{resolveType:S,formValue:_}=qt(x.rule,u,i??void 0);Ie(S),De(_),l&&Mt(f,o,a)},zt=R?.index;if(R!==void 0&&(R?.seq??null)!==Oe&&(_t(R?.seq??null),typeof zt=="number")){const t=K[zt],s=ye[zt];if(t&&s)if(M(zt),Ue(0),A([]),H(a=>a+1),s.isMultivariate)ft(t,s,0,zt);else{const a=kt(t,s,u);a?(F(a.data),z(a.resolveType)):(F(null),z(null)),Ie(null),De(null)}}const $t={orgSlug:h,virtualMcpId:e,branch:c,threadId:he,previewUrl:g??void 0,siteSlug:Ge},ss=We&&i?cs(We,i):null,Je=(t,s)=>{if(!v)return;Q.current&&(clearTimeout(Q.current),Q.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Ut(u,v,t,ee,ce);q.mutate({blockKey:v,data:a},{onSuccess:()=>s?.onSuccess?.()??b?.(),onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},Pt=()=>{Ve?.(null),M(null),I(!1),F(null),z(null),Ue(0),De(null),Ie(null),A([]),H(t=>t+1)},Va=(t,s)=>{Q.current&&clearTimeout(Q.current);const a=$e.current.sectionVariantIndex;Q.current=setTimeout(()=>{const{rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current,S=o[s];if(!S)return;const _=l[s];if(!_)return;if(_.isSavedBlock){const D=hr(S,_);if(!D)return;q.mutate({blockKey:D,data:t},{onSuccess:()=>b?.(),onError:L=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:L.message}))});return}if(!d)return;const w={...f[d]},U=[...o];if(_.isMultivariate){const D=tt(S,_);if(!D||!d)return;const L=gr(D,a,t);U[s]=wt(S,_,L)}else if(_.isHidden){const D=Is(S.__resolveType),L=D?{...S.section}:{...S},ue=Array.isArray(L.variants)?[...L.variants]:[];ue[0]&&(ue[0]={...ue[0],value:t}),L.variants=ue,D?U[s]={...S,section:L}:U[s]=L}else _.isLazy?U[s]={...S,section:t}:U[s]=t;if(x.length>1){const D=w.sections,L=[...D?.variants??[]];L[T]&&(L[T]={...L[T],value:U}),w.sections={...D,variants:L}}else w.sections=U;q.mutate({blockKey:d,data:w},{onSuccess:()=>b?.(),onError:D=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:D.message}))})},Ps)},Ta=t=>{M(t),Ue(0),A([]),H(l=>l+1);const s=K[t],a=ye[t];if(Ve?.(a?.isSavedBlock?a.resolveType??null:null),!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const o=kt(s,a,u);if(!o){F(null),z(null),Ie(null),De(null),Mt(null,t,0);return}F(o.data),z(o.resolveType),Ie(null),De(null),Mt(null,t,0)},Ys=t=>{const s=da(ss,t);F(s),m!==null&&Va(s,m)},js=t=>{if(!v||!u||!i||!Z)return;const s={kind:"page",pageKey:v,pageName:String(Z.name??""),path:String(Z.path??"")},a=Kn(u,s,i);a&&Xt.save(v,()=>{const o=pa.getQueryData(bo.decofile(ha))?.[v];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const l={...o,...gs.current};return gs.current={},t?.raw!==void 0?{...l,seo:t.raw}:t?.inner!==void 0?Wr(s,a,l,t.inner):l})},Xs=(t,s)=>{v&&(gs.current[t]=s,js())},Na=(t,s)=>{if(!v)return;const a=ms([...K],t,s);m!==null&&(m===t?M(s):t<m&&s>=m?M(m-1):t>m&&s<=m&&M(m+1)),Je(a)},Aa=t=>{if(!v)return;const s=K.filter((a,o)=>o!==t);m===t?Pt():m!==null&&m>t&&M(m-1),Je(s)},Ma=t=>{if(!v)return;const s=K[t];if(!s)return;const a=[...K];a.splice(t+1,0,ur(s)),m!==null&&m>t&&M(m+1),Je(a)},Pa=t=>{if(!v)return;const s=K[t],a=ye[t];if(!s||!a)return;const o=a.isHidden?lr(s):cr(s);if(!o)return;const l=[...K];l[t]=o,m===t&&Pt(),Je(l)},Da=t=>{if(!v)return;const s=K[t],a=ye[t];if(!s||!a||a.isMultivariate)return;const o=ir(s);if(!o)return;const l=[...K];l[t]=o,m===t&&Pt(),Je(l)},Ca=t=>{if(!v)return;const s=K[t],a=ye[t];if(!s||!a?.isSavedBlock)return;const o=kt(s,a,u);if(!o?.data)return;const{name:l,...f}=o.data,d=[...K];a.isLazy?d[t]={...s,section:f}:d[t]=f,m===t&&Pt(),Je(d)},Ka=t=>{if(!v)return;const s=[...K,{__resolveType:t.resolveType}],a=s.length-1;Je(s,{onSuccess:()=>{ge(!1),M(a),Ue(0),A([]),H(d=>d+1);const o=s[a],l=is(s,u)[a];if(!o||!l)return;if(l.isMultivariate){ft(o,l,0);return}const f=kt(o,l,u);if(!f){F(null),z(null),Ie(null),De(null);return}F(f.data),z(f.resolveType),Ie(null),De(null)}})},Zs=t=>{ve.current=t.append,ge(!0)},Ba=t=>{const s=ve.current;if(!s){Ka(t);return}s({__resolveType:t.resolveType}),ge(!1),ve.current=null},en=t=>{if(m===null)return;const s=K[m],a=ye[m];!s||!a?.isMultivariate||(Ue(t),A([]),H(o=>o+1),ft(s,a,t,m,!0))},La=t=>{if(m===null||!v)return;const s=K[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const l=or(o,t);if(!l){N.error(r("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const f=[...K];f[m]=wt(s,a,l);const d=l.variants;let x=Fe;t===Fe?x=Math.min(t,d.length-1):t<Fe&&(x=Fe-1),Ue(x),A([]),H(T=>T+1),ft(f[m],a,x),Je(f)},Fa=t=>{if(m===null||!v)return;const s=K[m],a=ye[m];if(!s||!a?.isMultivariate)return;const o=tt(s,a);if(!o)return;const l=rr(o,t),f=[...K];f[m]=wt(s,a,l);const d=t+1;Ue(d),A([]),H(x=>x+1),ft(f[m],a,d),Je(f)},Ia=(t,s)=>{if(m===null||!v||t===s)return;const a=K[m],o=ye[m];if(!a||!o?.isMultivariate)return;const l=tt(a,o);if(!l)return;const f=nr(l,t,s),d=[...K];d[m]=wt(a,o,f);let x=Fe;Fe===t?x=s:t<Fe&&s>=Fe?x=Fe-1:t>Fe&&s<=Fe&&(x=Fe+1),Ue(x),ft(d[m],o,x),Je(d)},Ht=t=>{const s=t??m;if(s===null||!v)return;const a=K[s],o=ye[s];if(!a||!o)return;const l=Zo(a,o);if(!l){N.error(r("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const f=[...K];f[s]=l.section;const d=is(f,u)[s];if(!d?.isMultivariate){N.error(r("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}M(s),Ue(l.newVariantIndex),A([]),H(x=>x+1),ft(l.section,d,l.newVariantIndex,s),Je(f)},tn=()=>{if(m===null||!v)return;const t=K[m],s=ye[m];if(!t||!s?.isMultivariate)return;const a=tt(t,s);if(!a)return;const o=ar(t,s,a);if(!o){N.error(r("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const l=[...K];l[m]=o;const f=is(l,u)[m];if(!f)return;Ue(0),Ie(null),De(null),A([]),H(x=>x+1);const d=kt(o,f,u);d?(F(d.data),z(d.resolveType)):(F(null),z(null)),Mt(null,m,0),Je(l)},Oa=async t=>{if(le===null||!v)return;const s=ds(t,u);if(s){N.error(s);return}const a=K[le],o=ye[le];if(!a||!o)return;const l=kt(a,o,u);if(!l){N.error(r("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const f={...l.data,name:t};try{await q.mutateAsync({blockKey:t,data:f});const d=[...K];d[le]={__resolveType:t},await q.mutateAsync({blockKey:v,data:Ut(u,v,d,ee,ce)}),m===le&&Pt(),_e(null),N.success(r("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),b?.()}catch(d){N.error(d instanceof Error?d.message:r("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},sn=He?.rule;if(Ze&&m===null&&re===null&&sn){const{resolveType:t,formValue:s}=qt(sn,u??{},i??void 0);Ne(t),oe(s)}const Dt=i?$o(i):[],Es=i&&u?Ho(i,u):[],nn=!Y&&!!(xe&&i&&u),an=re&&i?cs(re,i):null,pt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Et=async(t,s)=>{if(!(pr(s,t,i)>0))try{await Zt.mutateAsync({blockKey:t})}catch(a){N.error(a instanceof Error?a.message:r("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},on=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const l={...a[s]},f={...l.sections},d=[...f.variants??[]],x=d[o],T=x?.rule;if(Rt(T,a,i)){const S=T?.__resolveType??"",_=a[S],w=typeof _?.name=="string"?_.name:S,{__resolveType:U,...D}=t;q.mutate({blockKey:S,data:xt(U??"",D,w)},{onSuccess:()=>b?.(),onError:L=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:L.message}))});return}x&&(d[o]={...x,rule:t}),l.sections={...f,variants:d},q.mutate({blockKey:s,data:l},{onSuccess:()=>b?.(),onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Ps)},rn=t=>{Ne(t);const s=t?qn(t,i):{__resolveType:Qn};oe(t?s:{}),on(s)},ln=t=>{const s=t;oe(s);const a=re?{__resolveType:re,...s}:{...s};on(a)},cn=async t=>{pt();const{activePageKey:s,decofile:a,variantIndex:o}=$e.current;if(!s)return;const l=a[s],f=l?.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[o];if(!T)return;const S=bt(T.rule,a,i),_=Lt(t);x[o]={...T,rule:_};const w={...a,[s]:{...l,sections:{...d,variants:x}}},{resolveType:U,formValue:D}=qt(_,w,i??void 0);Ne(U),oe(D);try{await q.mutateAsync({blockKey:s,data:w[s]}),S&&S!==t&&await Et(S,w),b?.()}catch(L){N.error(L instanceof Error?L.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},un=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=$e.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(!d)return;const S=o[s],_=l[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const D=(w.variants??[])[a]?.rule;if(Rt(D,f,i)){const X=D?.__resolveType??"",Ye=f[X],rt=typeof Ye?.name=="string"?Ye.name:X,{__resolveType:St,...it}=t;q.mutate({blockKey:X,data:xt(St??"",it,rt)},{onSuccess:()=>b?.(),onError:yt=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:yt.message}))});return}const L=Wn(w,a,t),ue=[...o];ue[s]=wt(S,_,L);const et=Ut(f,d,ue,T,x);q.mutate({blockKey:d,data:et},{onSuccess:()=>b?.(),onError:X=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:X.message}))})},Ps))},za=t=>{Ie(t);const s=t?qn(t,i):{__resolveType:Qn};De(t?s:{}),un(s)},$a=t=>{const s=t;De(s);const a=Tt?{__resolveType:Tt,...s}:{...s};un(a)},Ha=async t=>{pt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(s===null||!d)return;const S=o[s],_=l[s];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const U=w.variants??[],D=bt(U[a]?.rule,f,i),L=Lt(t),ue=Wn(w,a,L),et=[...o];et[s]=wt(S,_,ue);const X=Ut(f,d,et,T,x),Ye={...f,[d]:X},{resolveType:rt,formValue:St}=qt(L,Ye,i??void 0);Ie(rt),De(St);try{await q.mutateAsync({blockKey:d,data:X}),D&&D!==t&&await Et(D,Ye),b?.()}catch(it){N.error(it instanceof Error?it.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Y&&!Z)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.noPageFound",{currentPath:j})});if(Y&&!vs)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:r("sectionsEditor.sectionsEditor.globalBlockNotFound")});const be=m!==null?ye[m]??null:null,dn=m!==null?K[m]:null,mn=dn&&be?.isMultivariate?tt(dn,be):null,ht=mn?Bn(mn,lt):[],ns=Math.min(Fe,Math.max(ht.length-1,0)),Ct=ht[ns]??null,gt=be?.isMultivariate===!0,ks=m!==null&&be!==null,vt=ks&&(gt||!!(ss&&qe)),Ga=vt&&!Y&&be?.isSavedBlock===!0,Qe=Y||Ga,fn=Y?qs:be?.label??"",qa=Tt&&i?cs(Tt,i):null,pn=(t,s)=>s&&G?`${t} · ${s}`:t,hn=be?be.variantOf??be.label:"",Wa=(()=>{const t=gt&&Ct?Ct.label:null;return t?G?[pn(hn,t)]:[be.label,t]:[be?.label??""]})(),ws=pn(Z?.name??"",Ze?He?.label:null),as=vt&&(!Y||B.length>0)?Y?[qs,...B]:[ws,...Wa,...B]:[],gn=C&&Z?[Z.name,"SEO",...zs]:[],vn=r("sectionsEditor.pageVariantTabs.variantsLabel"),Sn=P&&Z?[Z.name,vn]:Pe&&Z&&be?[ws,hn,vn]:[],os=Sn.length>0?Sn:gn.length>0?gn:Qe?as.length>0?as:[fn]:as.length>0?as:[ws],yn=ks&&!gt&&!be?.isHidden&&!!v,Ua=Qe||!Y&&Ze&&!!He||yn,Ja=ks&&!gt&&!Y&&B.length===0&&!!be&&aa(be)&&!!v,Qa=G&&vt&&!Pe&&gt&&B.length===0&&!!Ct,bn=G&&B.length>0?Ln(B[B.length-1]):null,Ya=B.length>1?Ln(B[B.length-2]):null,xn=Qe?fn:vt?be?.label??"":Z?.name??"",Xa=P||Pe?r("sectionsEditor.pageVariantTabs.variantsLabel"):C?r("sectionsEditor.panelSections.seo"):bn??xn,_n=Pe?be?.variantOf??be?.label??"":P||C?Z?.name??"":bn?Ya??xn:Qe?r("sectionsEditor.sectionsEditor.globalSectionSubtitle"):vt?Z?.name??"":Z?.path??"",Rs=!P&&!Pe&&!C&&!vt&&!Qe,Za=!G&&!C&&!Y&&gt&&B.length===0,Gt=()=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const t=u[v],s=er(t.sections,K);if(!s)return;const a=tr(s);q.mutate({blockKey:v,data:{...t,sections:s}},{onSuccess:()=>{me(a),M(null),F(null),z(null),A([]),oe(null),Ne(null)},onError:o=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})},rs=(t,s,a)=>{if(!v)return;pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const o=u[v],l=o.sections;if(!l||typeof l!="object"||Array.isArray(l))return;const f=l;if(!Array.isArray(f.variants))return;const d=t([...f.variants]);if(!d)return;const x=fr(f,d),T={...u,[v]:{...o,sections:x}};q.mutate({blockKey:v,data:T[v]},{onSuccess:()=>{s?.();const S=typeof a=="string"?[a]:a??[];(async()=>{for(const _ of S)await Et(_,T)})()},onError:S=>N.error(r("sectionsEditor.sectionsEditor.saveFailed",{error:S.message}))})},Vs=t=>{te(null),me(t),M(null),F(null),z(null),A([]);const s=ce[t]?.rule,{resolveType:a,formValue:o}=qt(s,u??{},i??void 0);Ne(a),oe(o),xs(ce.map(l=>({rule:l.rule})),t)},jn=(t,s)=>{if(t===s)return;let a=ee;ee===t?a=s:t<ee&&s>=ee?a=ee-1:t>ee&&s<=ee&&(a=ee+1),me(a);const o=ms(ce.map(l=>({rule:l.rule})),t,s);xs(o,a),rs(l=>ms(l,t,s))},En=t=>{const s=ce[t]?.rule,a=bt(s,u??{},i??void 0);rs(o=>o.length<=1?null:(o.splice(t,1),o),()=>{ce.length-1===1?me(0):t<ee?me(ee-1):t===ee&&me(Math.max(0,t-1)),M(null),F(null),z(null),A([]),oe(null),Ne(null)},a)},eo=()=>{const t=ce.map((s,a)=>({variant:s,index:a})).filter(({variant:s})=>!mr(s.rule)).map(({variant:s})=>bt(s.rule,u??{},i??void 0)).filter(s=>!!s);rs(s=>{const a=vr({variants:s}),o=s[a];return o?[{...o,rule:Ar()}]:null},()=>{me(0),M(null),F(null),z(null),A([]),oe(null),Ne(null),st(!1)},t)},kn=t=>{rs(s=>Sr(s,t),()=>{me(t+1),M(null),F(null),z(null),A([]),oe(null),Ne(null)})},to=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const a=$e.current.activePageKey,o=$e.current.decofile;if(!a)return;const l=o[a],f=l.sections;if(!f||typeof f!="object"||Array.isArray(f))return;const d=f;if(!Array.isArray(d.variants))return;const x=[...d.variants],T=x[t];if(!T?.rule||typeof T.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const S=T.rule,_=s.trim();At(!0);try{if(!_){if(!Rt(S,o,i)){te(null);return}const et=S.__resolveType??"";x[t]={...T,rule:Cs(S,o,i)};const X={...o,[a]:{...l,sections:{...d,variants:x}}};await q.mutateAsync({blockKey:a,data:X[a]}),await Et(et,X),te(null),b?.();return}const w=Ks(S,o,i);if(!w){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(w.blockKey){await q.mutateAsync({blockKey:w.blockKey,data:xt(w.resolveType,w.data,_)}),te(null),b?.();return}const U=us(_),D=ds(U,o);if(D){N.error(D);return}const L=xt(w.resolveType,w.data,_);let ue=null;try{await q.mutateAsync({blockKey:U,data:L}),ue=U,x[t]={...T,rule:Lt(U)},await q.mutateAsync({blockKey:a,data:{...l,sections:{...d,variants:x}}}),ue=null}catch(et){throw ue&&await Zt.mutateAsync({blockKey:ue}).catch(()=>{}),et}te(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:_})),b?.()}catch(w){N.error(w instanceof Error?w.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},so=async(t,s)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{selectedSectionIndex:a,rawSections:o,parsedSections:l,decofile:f,activePageKey:d,pageVariants:x,variantIndex:T}=$e.current;if(a===null||!d)return;const S=o[a],_=l[a];if(!S||!_?.isMultivariate)return;const w=tt(S,_);if(!w)return;const U=w.variants??[],D=U[t];if(!D?.rule||typeof D.rule!="object"){N.error(r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const L=D.rule,ue=s.trim();At(!0);const et=async X=>{const Ye={...w,variants:X},rt=[...o];rt[a]=wt(S,_,Ye);const St=Ut(f,d,rt,T,x);return await q.mutateAsync({blockKey:d,data:St}),{...f,[d]:St}};try{if(!ue){if(!Rt(L,f,i)){se(null);return}const yt=L.__resolveType??"",Dn=[...U];Dn[t]={...D,rule:Cs(L,f,i)};const fo=await et(Dn);await Et(yt,fo),se(null),b?.();return}const X=Ks(L,f,i);if(!X){N.error(r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(X.blockKey){await q.mutateAsync({blockKey:X.blockKey,data:xt(X.resolveType,X.data,ue)}),se(null),b?.();return}const Ye=us(ue),rt=ds(Ye,f);if(rt){N.error(rt);return}const St=xt(X.resolveType,X.data,ue);let it=null;try{await q.mutateAsync({blockKey:Ye,data:St}),it=Ye;const yt=[...U];yt[t]={...D,rule:Lt(Ye)},await et(yt),it=null}catch(yt){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),yt}se(null),N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:ue})),b?.()}catch(X){N.error(X instanceof Error?X.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}},no={rename:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:l}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s],x=d?.rule&&typeof d.rule=="object"?d.rule:void 0,T=async _=>{const w={...t,variants:_};return await q.mutateAsync({blockKey:o,data:w}),{...l,[o]:w}},S=hi(x,a,l,i);if(S.kind!=="noop"){if(S.kind==="error"){N.error(S.reason==="no-matcher-rule"?r("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):S.reason==="unreadable-rule"?r("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):S.message??r("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}At(!0);try{if(S.kind==="inline"){const w=[...f];w[s]={...d,rule:S.inlinedRule};const U=await T(w);await Et(S.blockKey,U),b?.();return}if(S.kind==="updateBlock"){await q.mutateAsync({blockKey:S.blockKey,data:S.blockData}),b?.();return}let _=null;try{await q.mutateAsync({blockKey:S.blockId,data:S.blockData}),_=S.blockId;const w=[...f];w[s]={...d,rule:S.reference},await T(w),_=null}catch(w){throw _&&await Zt.mutateAsync({blockKey:_}).catch(()=>{}),w}N.success(r("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:a.trim()})),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{At(!1)}}},selectGlobal:async(t,s,a)=>{pt(),Q.current&&(clearTimeout(Q.current),Q.current=null);const{activePageKey:o,decofile:l}=$e.current;if(!o)return;const f=Array.isArray(t.variants)?[...t.variants]:[],d=f[s];if(!d)return;const x=bt(d.rule,l,i);f[s]={...d,rule:Lt(a)};const T={...t,variants:f},S={...l,[o]:T};try{await q.mutateAsync({blockKey:o,data:T}),x&&x!==a&&await Et(x,S),b?.()}catch(_){N.error(_ instanceof Error?_.message:r("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}}},wn=()=>{Pt()},Rn=t=>{Yt(t),js({inner:t})},Vn=t=>{hs(t),js({raw:t})},Tn=()=>{Yt(null),jt([])},Nn=()=>Ft(t=>t+1),An=()=>{Xt.flush(),Le(!1),Yt(null),hs(void 0),jt([]),Ft(t=>t+1),de?.()},ao=()=>{st(!1),I(!1),M(null),Le(!0)},oo=()=>{C&&An(),M(null),st(!0)},ro=()=>I(!0),Ts=t=>{if(P&&t===0){st(!1);return}if(Pe&&t<2){I(!1),t===0&&M(null);return}if(C){if(t===0){An();return}if(t===1){jt([]),Ft(a=>a+1);return}jt(zs.slice(0,t-1)),Ft(a=>a+1);return}if(Y){A(B.slice(0,t)),H(a=>a+1);return}if(t===0){wn();return}if(t===1){A([]),H(a=>a+1);return}const s=!G&&gt&&Ct?1:0;if(s===1&&t===2){A([]),H(a=>a+1);return}A(B.slice(0,t-1-s))},Ns=os.length>1?n.jsx("button",{type:"button",onClick:()=>Ts(dr(os.length,{isMultivariateSectionTop:Za})),title:r("sectionsEditor.sectionsEditor.back"),"aria-label":r("sectionsEditor.sectionsEditor.back"),className:ne("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",Qe?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(jr,{className:"size-4"})}):null,io=Qe||vt||C?Ua&&n.jsxs("div",{className:ne("border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!Y&&Ze&&He&&n.jsxs("button",{type:"button",onClick:wn,title:r("sectionsEditor.sectionsEditor.editingInVariant",{variant:He.label}),className:ne("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",qo),children:[n.jsx(Go,{rule:As(He.rule,u??{},i??void 0),matchers:Dt}),n.jsx("span",{className:"max-w-[160px] truncate",children:He.label})]}),n.jsx("div",{className:"flex-1"}),Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),yn&&n.jsx(ls,{onClick:()=>Ht()})]}),Qe&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:r("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Fn,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs,variant:"header"})}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Le(!0),children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"ghost",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>Ke&&v?Ke():je(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(ls,{onClick:Gt})]}),lo=n.jsxs(n.Fragment,{children:[Ze&&v&&n.jsx(In,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:i,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsx(On,{className:"mt-3",children:n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,i??void 0),currentGlobalKey:bt(He?.rule,u??{},i??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})})]}),Mn=n.jsxs(n.Fragment,{children:[n.jsx(Wo,{listKey:`${v??""}:${m??""}`,variants:ht.map((t,s)=>({index:s,label:t.label})),selectedIndex:ns,onSelect:en,onRename:se,onDuplicate:Fa,onDelete:La,onRemoveAll:tn,onReorder:Ia,onAdd:()=>Ht()}),n.jsx(On,{children:n.jsx(Ms,{currentRt:Tt??"",currentLabel:Wt(Ct?.rule,u??{},lt,i??void 0),currentGlobalKey:bt(Ct?.rule,u??{},i??void 0)??void 0,matchers:Dt,globals:Es,onSelect:za,onSelectGlobal:Ha,schema:qa,formValue:fa,onChange:$a,formKey:`${m??"none"}:${ns}:${Tt??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Pn=n.jsx("div",{className:ne(G?"px-2":"p-2 pt-3"),children:n.jsx(mi,{listKey:`${v??""}-${ee}`,rawSections:K,sections:ye,meta:i,decofile:u,selectedIndex:m,onSelect:Ta,onReorder:Na,onDelete:Aa,onDuplicate:Ma,onMakeReusable:_e,onToggleHidden:Pa,onToggleLazy:Da,onAddVariant:Ht,onDetach:Ca,onAddSection:()=>ge(!0),canAddSection:nn})}),co=n.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[v&&Z&&n.jsx(Fn,{pageKey:v,initialName:Z.name,initialPath:Z.path,onFieldChange:Xs}),Ot&&v?n.jsx(ea,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Vn,onInnerChange:Rn,onClearForm:Tn,onBumpFormKey:Nn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),uo=n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ot&&v?n.jsx(ea,{rawSeo:es,innerSeo:ys,defaultResolveType:Us,seoSchema:Js,activeResolveType:ts,seoTypeOptions:Ws,formResetKey:$s,siteDefaultSeo:Qs,onBreadcrumbChange:jt,onPersistRaw:Vn,onInnerChange:Rn,onClearForm:Tn,onBumpFormKey:Nn}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:r("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),mo=n.jsxs(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ze&&v&&n.jsx(In,{listKey:v,variants:ce,activeIndex:ee,decofile:u??{},meta:i,matchers:Dt,onSelect:Vs,onReorder:jn,onRename:te,onDuplicate:kn,onDelete:En,onAdd:Gt}),Ze&&re!==null&&n.jsxs("div",{className:ne("px-3 border-b",Se?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>ze(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-muted/40","aria-expanded":Se,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:r("sectionsEditor.sectionsEditor.variantRule")}),Se?n.jsx(br,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(xr,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),Se&&n.jsx("div",{className:ne("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Ms,{currentRt:re,currentLabel:Wt(He?.rule,u??{},lt,i??void 0),currentGlobalKey:bt(He?.rule,u??{},i??void 0)??void 0,matchers:Dt,globals:Es,onSelect:rn,onSelectGlobal:cn,schema:an,formValue:Be,onChange:ln,formKey:`${ee}:${re??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:u,onSaveReferencedBlock:It,sandbox:$t})})]}),Pn]},"editor-section-list");return n.jsx(Uo,{children:n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!G&&Ns&&n.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:Ns}),(G||os.length>1)&&n.jsx(Jo,{crumbs:os,onSelect:Ts,onSelectRoot:()=>{Xt.flush(),Ce?Ce():Ts(0)}}),n.jsx("div",{className:"shrink-0",children:G?n.jsxs("div",{className:ne("flex items-center gap-2 border-b px-3 py-2.5",Qe&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[G&&Ns,Qe&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(fs,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(dt,{side:"bottom",className:"max-w-[260px]",children:r("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[n.jsx("span",{className:"truncate text-sm font-semibold",children:Xa}),_n&&n.jsx("span",{className:"truncate text-xs text-muted-foreground",children:_n})]}),Rs&&Ze&&He&&n.jsx(zn,{variants:ce,activeIndex:ee,onSelect:Vs,onManage:oo,onRemoveAll:eo}),Qa&&n.jsx(zn,{variants:ht,activeIndex:ns,onSelect:en,onManage:ro,onRemoveAll:tn}),Rs&&!Ze&&n.jsx(ls,{onClick:Gt}),Ja&&n.jsx(ls,{onClick:()=>Ht()}),n.jsx(Qo,{}),Rs&&n.jsxs(n.Fragment,{children:[n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:ao,children:n.jsx(Un,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.editSeo")})]}),!Ke&&n.jsxs(ct,{children:[n.jsx(ut,{asChild:!0,children:n.jsx(Vt,{type:"button",variant:"outline",size:"icon","aria-label":r("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>je(!0),children:n.jsx(Jn,{size:14})})}),n.jsx(dt,{side:"bottom",children:r("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):io}),Pe?n.jsx($n,{onAdd:()=>Ht(),children:Mn},"editor-section-variants"):vt?n.jsxs(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!G&&gt&&ht.length>0&&B.length===0&&Mn,n.jsx(Hn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Ys,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs})]},"editor-section-form"):Y?n.jsx(Bt,{viewportRef:ie,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Hn,{activeSchema:ss,formValue:qe,formResetKey:we,onFormChange:Ys,onBreadcrumbChange:A,breadcrumbPath:B,emptyMessage:r("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:u,onSaveReferencedBlock:It,sandbox:$t,previewBaseUrl:xe,onRequestAddSection:Zs,onVariantMatcherOp:no})},"editor-global-block"):C?G?n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"p-3",children:co})},"editor-seo"):uo:P?n.jsx($n,{onAdd:Gt,children:lo},"editor-variants"):G?n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Bt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"py-2",children:Pn})}),n.jsx("div",{className:"shrink-0 border-t p-2",children:n.jsx(Fs,{canAddSection:nn,onAddSection:()=>ge(!0)})})]},"editor-section-list"):mo,n.jsx(Yo,{open:le!==null,onOpenChange:t=>{t||_e(null)},defaultBlockId:le!==null?us(ye[le]?.label??""):"",isPending:q.isPending,onSubmit:Oa}),xe&&n.jsx(Jr,{open:Me,onOpenChange:t=>{ge(t),t||(ve.current=null)},meta:i,decofile:u,previewBaseUrl:xe,onSelect:Ba}),Re&&v&&u&&n.jsx(wr,{open:Re,onOpenChange:je,pageKey:v,decofile:u}),fe!==null&&n.jsx(Gn,{open:!0,initialName:Rt(ce[fe]?.rule,u??{},i??void 0)?Wt(ce[fe]?.rule,u??{},lt,i??void 0):"",autoLabel:lt(As(ce[fe]?.rule,u??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await to(fe,t)},onOpenChange:t=>{!t&&!Nt&&te(null)}}),pe!==null&&n.jsx(Gn,{open:!0,initialName:Rt(ht[pe]?.rule,u??{},i??void 0)?Wt(ht[pe]?.rule,u??{},lt,i??void 0):"",autoLabel:lt(As(ht[pe]?.rule,u??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await so(pe,t)},onOpenChange:t=>{!t&&!Nt&&se(null)}})]})})}export{Cc as SectionsEditor};