decocms 4.523.1 → 4.524.0

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 (518) hide show
  1. package/dist/client/assets/{ActiveShapeUtils-3iGXaBcM.js → ActiveShapeUtils-gwLrBsiR.js} +1 -1
  2. package/dist/client/assets/{AlertCircle-BoecRmSu.js → AlertCircle-COLuN3Qe.js} +1 -1
  3. package/dist/client/assets/{AreaChart-MrowY4g3.js → AreaChart-Dud7jvcC.js} +1 -1
  4. package/dist/client/assets/{ArrowLeft-CqjWe78l.js → ArrowLeft-BYNlToA0.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-YHdDe54G.js → ArrowUp-CRFAWnPc.js} +1 -1
  6. package/dist/client/assets/{BarChart-BouCSNlP.js → BarChart-JFNliGSV.js} +1 -1
  7. package/dist/client/assets/{Building02-jY0EsZ3c.js → Building02-DinMBe3_.js} +1 -1
  8. package/dist/client/assets/{CartesianChart-YzghzaT-.js → CartesianChart-Cjgu2ECY.js} +1 -1
  9. package/dist/client/assets/{CategoricalChart-DSicPUkM.js → CategoricalChart-Bx8yFu23.js} +1 -1
  10. package/dist/client/assets/{CheckCircle-Bjd4331B.js → CheckCircle-DCMOdEuL.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-C8DO4Eax.js → ChevronSelectorVertical-Dwu4Nr-2.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-D732cexR.js → ChevronUp-4EkxqYyz.js} +1 -1
  13. package/dist/client/assets/{Copy01-BNgQXLom.js → Copy01-Tog1jA1S.js} +1 -1
  14. package/dist/client/assets/{CreditCard01-BI7UbDnJ.js → CreditCard01-B7MC6SfH.js} +1 -1
  15. package/dist/client/assets/{DotsVertical-B4rKTO-K.js → DotsVertical-qUaZHjqd.js} +1 -1
  16. package/dist/client/assets/{ErrorBarContext-DusfmiIN.js → ErrorBarContext-C1p765z-.js} +1 -1
  17. package/dist/client/assets/{Globe04-BZtelxuk.js → Globe04-CGEgYyKw.js} +1 -1
  18. package/dist/client/assets/{Image01-3jSbcDWw.js → Image01-CW7Pcq-W.js} +1 -1
  19. package/dist/client/assets/{Key01-bgf7_Io3.js → Key01-D_nzK0xg.js} +1 -1
  20. package/dist/client/assets/{Link01-CwY3-TdS.js → Link01-CpcYQ7Qt.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-gZ_Womsg.js → LinkBroken01-Ctb4MZUK.js} +1 -1
  22. package/dist/client/assets/{Minus-Cg_Z4UVA.js → Minus-DoRDGpun.js} +1 -1
  23. package/dist/client/assets/{Monitor01-DfNea12c.js → Monitor01-L9jyZGZ2.js} +1 -1
  24. package/dist/client/assets/{Play-C58uA1z7.js → Play-Du5BNsRy.js} +1 -1
  25. package/dist/client/assets/{Plus-BjxA_ka5.js → Plus-BfnmJh1R.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-kghB-Ev4.js → ReferenceLine-DCCnHWMQ.js} +1 -1
  27. package/dist/client/assets/{SearchMd-BYu5iUPZ.js → SearchMd-JUAl7Zv6.js} +1 -1
  28. package/dist/client/assets/{Sector-B82IN8wU.js → Sector-DL6Ad47o.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-D6PcFAZ3.js → ShoppingBag01-usYkWunw.js} +1 -1
  30. package/dist/client/assets/{Sun-ryrPGG0o.js → Sun-B7TolJAG.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-OacdCVpa.js → SwitchHorizontal01-DcP8c_x_.js} +1 -1
  32. package/dist/client/assets/{Tool01-CcNuzAHc.js → Tool01-Bon-ixH5.js} +1 -1
  33. package/dist/client/assets/{Trash01-B_y6cnc0.js → Trash01-cH2tYIUn.js} +1 -1
  34. package/dist/client/assets/{Upload01-C8k7ObxF.js → Upload01-Bo60o4T6.js} +1 -1
  35. package/dist/client/assets/{UserSquare-DvQcif2z.js → UserSquare-DsAVH788.js} +1 -1
  36. package/dist/client/assets/{Users01-BuIADxiS.js → Users01-Bo_9DitT.js} +1 -1
  37. package/dist/client/assets/{XClose-CE-051ne.js → XClose-DhoOL-T1.js} +1 -1
  38. package/dist/client/assets/{ZoomOut-BBaDHidP.js → ZoomOut-B1U_CHeD.js} +1 -1
  39. package/dist/client/assets/access-gate-CGDwkzkf.js +1 -0
  40. package/dist/client/assets/{add-connection-dialog-CBWhQLk7.js → add-connection-dialog-8gQOdlVv.js} +1 -1
  41. package/dist/client/assets/agent-analytics-Bd5QSkcr.js +1 -0
  42. package/dist/client/assets/agent-app-DSGhLy_N.js +1 -0
  43. package/dist/client/assets/agent-assets-Q4lV98mF.js +1 -0
  44. package/dist/client/assets/agent-automation-Dsupi3DF.js +20 -0
  45. package/dist/client/assets/agent-automations-BonoDEyJ.js +1 -0
  46. package/dist/client/assets/agent-calendar-WpcQ_E3l.js +1 -0
  47. package/dist/client/assets/agent-connect-sources-C0oR1IIZ.js +1 -0
  48. package/dist/client/assets/agent-deck-Y0SX6UB9.js +1 -0
  49. package/dist/client/assets/agent-e2e-nbY2lllw.js +1 -0
  50. package/dist/client/assets/agent-experiments-XS7LGaQh.js +1 -0
  51. package/dist/client/assets/agent-file-DKmgj6b-.js +1 -0
  52. package/dist/client/assets/agent-hosting-BC5YnVoX.js +1 -0
  53. package/dist/client/assets/agent-icon-CVEMdYFU.js +1 -0
  54. package/dist/client/assets/agent-library-CYxkIVFl.js +1 -0
  55. package/dist/client/assets/agent-library-file-DPhxbUtG.js +1 -0
  56. package/dist/client/assets/agent-monitor-C01cwPL-.js +1 -0
  57. package/dist/client/assets/agent-overview-DU1IP4XS.js +1 -0
  58. package/dist/client/assets/agent-releases-BuXXsH8W.js +2 -0
  59. package/dist/client/assets/agent-settings-B7CchDfJ.js +1 -0
  60. package/dist/client/assets/{agent-site-editor-DrsYL7Qi.js → agent-site-editor-DSqJlDXx.js} +2 -2
  61. package/dist/client/assets/agent-site-editor-code-uiPbclqT.js +2 -0
  62. package/dist/client/assets/agent-site-editor-content-B9B2SztQ.js +1 -0
  63. package/dist/client/assets/agent-site-editor-preview-CQGXtn5w.js +1 -0
  64. package/dist/client/assets/agent-view-BNK8YJ86.js +1 -0
  65. package/dist/client/assets/{agent-view-guard-Dw8f_Dem.js → agent-view-guard-Bvqt9A7d.js} +1 -1
  66. package/dist/client/assets/agents-list-BV-RY6eO.js +1 -0
  67. package/dist/client/assets/{ai-providers-DGU07bIw.js → ai-providers-D8opLVHp.js} +2 -2
  68. package/dist/client/assets/{alert-CXq7wXAP.js → alert-CYZdSIKq.js} +1 -1
  69. package/dist/client/assets/analytics-sections-BqhdlzKZ.js +1 -0
  70. package/dist/client/assets/analytics-tab-BWgFTW72.js +2 -0
  71. package/dist/client/assets/api-keys-Dj50tYQ9.js +1 -0
  72. package/dist/client/assets/api-keys-MofJBQfW.js +1 -0
  73. package/dist/client/assets/app-editor-BcJaA3eR.js +1 -0
  74. package/dist/client/assets/{asset-utils-CkfOjXdG.js → asset-utils-DcPLl2K6.js} +1 -1
  75. package/dist/client/assets/{auth-D_mwvS_K.js → auth-CEIITB7d.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-ZO5v_1d8.js → auth-catchall-CEBn1SGS.js} +1 -1
  77. package/dist/client/assets/{auth-entry-B0W-KcwY.js → auth-entry-iXHgBQJV.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-EIGtHpJt.js → auth-split-layout-CsXqgaOS.js} +1 -1
  79. package/dist/client/assets/{authenticate-and-persist-oauth-BNMqjh7K.js → authenticate-and-persist-oauth-CN-ocXe3.js} +1 -1
  80. package/dist/client/assets/automation-list-row-JOMePUFR.js +1 -0
  81. package/dist/client/assets/automation-runs-KPGkDZAM.js +1 -0
  82. package/dist/client/assets/automations-BTtfVGNa.js +1 -0
  83. package/dist/client/assets/{autosend-Rn3iicpQ.js → autosend-CbkP_bEt.js} +1 -1
  84. package/dist/client/assets/{badge-CDGhoWxi.js → badge-DeNt4-FX.js} +1 -1
  85. package/dist/client/assets/{block-document-CwibGNVI.js → block-document-BzAW7wGZ.js} +3 -3
  86. package/dist/client/assets/{blocks-preview-workspace-context-D4YnI8VN.js → blocks-preview-workspace-context-aUwmyorT.js} +1 -1
  87. package/dist/client/assets/blocks-tab-states-PBqE8hLO.js +1 -0
  88. package/dist/client/assets/blog-schema-BYLQdC9S.js +1 -0
  89. package/dist/client/assets/buckets-CFL4z0d-.js +1 -0
  90. package/dist/client/assets/build-improve-prompt-doc-BpkVMxpg.js +2 -0
  91. package/dist/client/assets/{calendar-DlQTMw7m.js → calendar-GMyXKkbA.js} +1 -1
  92. package/dist/client/assets/campaigns-view-iaGM9YLd.js +1 -0
  93. package/dist/client/assets/{capability-load-error-DZqK06os.js → capability-load-error-juzFeQ-_.js} +1 -1
  94. package/dist/client/assets/category-editor-lTx7E71S.js +1 -0
  95. package/dist/client/assets/{cdn-tab-CtqgvIhC.js → cdn-tab-QH34WF_J.js} +1 -1
  96. package/dist/client/assets/{chart-Dh4qH5Sx.js → chart-D9k22T0E.js} +1 -1
  97. package/dist/client/assets/{chat-context-CEf_lJrx.js → chat-context-C56OVvQP.js} +7 -7
  98. package/dist/client/assets/{chat-draft-BWhaChdV.js → chat-draft-DNgi8tda.js} +1 -1
  99. package/dist/client/assets/{checkbox-B-X9akcX.js → checkbox-B6N4ay58.js} +1 -1
  100. package/dist/client/assets/choose-editor-CcEH03W4.js +1 -0
  101. package/dist/client/assets/{cli-auth-success-WALyW8uQ.js → cli-auth-success-CkyWspHU.js} +1 -1
  102. package/dist/client/assets/{client-icons-CrD_By3h.js → client-icons-DyjyTud6.js} +1 -1
  103. package/dist/client/assets/cms-settings-editor-CjDcV3Uq.js +1 -0
  104. package/dist/client/assets/{collapsible-D5FtbLtM.js → collapsible-D3gNdr7N.js} +1 -1
  105. package/dist/client/assets/collection-detail-D66AIxA0.js +1 -0
  106. package/dist/client/assets/collection-display-button-C28fH98T.js +1 -0
  107. package/dist/client/assets/{collection-search-RQehoVFG.js → collection-search-BIuQ3VPN.js} +1 -1
  108. package/dist/client/assets/{collection-table-wrapper-BHmn2oUB.js → collection-table-wrapper-7w5ciWB4.js} +1 -1
  109. package/dist/client/assets/{collection-tabs-BnX5iP1F.js → collection-tabs-m2567Q_Z.js} +1 -1
  110. package/dist/client/assets/{column-rules-B40MgWVZ.js → column-rules-DsLrWs5p.js} +2 -2
  111. package/dist/client/assets/{combobox-C3ljSkZg.js → combobox-BEVN0Tvl.js} +1 -1
  112. package/dist/client/assets/{command-CMb7suOV.js → command-N9BazZHl.js} +1 -1
  113. package/dist/client/assets/{companion-mcps-section-DR1Vwqzz.js → companion-mcps-section-BQyuFD3F.js} +1 -1
  114. package/dist/client/assets/{config-DqTkCyHb.js → config-BmN9tmsx.js} +1 -1
  115. package/dist/client/assets/{connect-DIta94zG.js → connect-CefgSXIv.js} +3 -3
  116. package/dist/client/assets/{connect-layout-0Ai7RfSp.js → connect-layout-CUTmKBkE.js} +1 -1
  117. package/dist/client/assets/connect-source-dialog-CBjVXCAe.js +1 -0
  118. package/dist/client/assets/{connection-DECdok_z.js → connection-CQKYiXol.js} +1 -1
  119. package/dist/client/assets/{connection-card-ygPiujfi.js → connection-card-CvmG6XsV.js} +1 -1
  120. package/dist/client/assets/connection-detail-BloLauxz.js +1 -0
  121. package/dist/client/assets/{connection-form-helpers-WwsXdB5F.js → connection-form-helpers-ytOA1Nl6.js} +1 -1
  122. package/dist/client/assets/connections-BxS3FS9g.js +1 -0
  123. package/dist/client/assets/content-tab-BwyJP-DI.js +22 -0
  124. package/dist/client/assets/context-BakNzIE5.js +1 -0
  125. package/dist/client/assets/{context-menu-DbcS2c7t.js → context-menu-C4h1P6Vl.js} +1 -1
  126. package/dist/client/assets/{context-shell-CIQyklqt.js → context-shell-BxB7W0br.js} +5 -5
  127. package/dist/client/assets/{core.esm-BtSOaBaE.js → core.esm-BYOMVmVh.js} +1 -1
  128. package/dist/client/assets/create-organization-dialog-DqU6G9od.js +1 -0
  129. package/dist/client/assets/{daily-pulse-CH8DO0J_.js → daily-pulse-BlxIy31E.js} +1 -1
  130. package/dist/client/assets/discover-DMRyKZWE.js +1 -0
  131. package/dist/client/assets/{domain-settings-CuqQkLLJ.js → domain-settings-Cj-cRa8T.js} +1 -1
  132. package/dist/client/assets/{drawer-CBUeIn2K.js → drawer-B7ajVnwC.js} +1 -1
  133. package/dist/client/assets/{editor-CxPe-Q-E.js → editor-B7sIq_vQ.js} +1 -1
  134. package/dist/client/assets/{editor-classes-BSm-iwgQ.js → editor-classes-BinXFbFk.js} +1 -1
  135. package/dist/client/assets/{empty-state-BUdzXSg1.js → empty-state-Cc_qF1X6.js} +1 -1
  136. package/dist/client/assets/{empty-state-BzCZ0bf5.js → empty-state-RpLaBfip.js} +1 -1
  137. package/dist/client/assets/experiments-tab-BlgfPezU.js +1 -0
  138. package/dist/client/assets/experiments-tab-choice-DZqY092h.js +1 -0
  139. package/dist/client/assets/{extract-connection-data-DewBd7fP.js → extract-connection-data-ClMH8dL9.js} +1 -1
  140. package/dist/client/assets/{feature-gate-Dof2Z5sB.js → feature-gate-Wo8Dn-M0.js} +1 -1
  141. package/dist/client/assets/{feature-paywall-BQmjnHPQ.js → feature-paywall-C1_xpbwO.js} +1 -1
  142. package/dist/client/assets/file-explorer-DCgzwH3u.js +2 -0
  143. package/dist/client/assets/{file-preview-BnQW8KsX.js → file-preview-DFHvVsCR.js} +1 -1
  144. package/dist/client/assets/{file-share-button-zgq85Ppa.js → file-share-button-DMtXDXf3.js} +2 -2
  145. package/dist/client/assets/{file-type-icon-CnMrgPAl.js → file-type-icon-may_hs3N.js} +1 -1
  146. package/dist/client/assets/{folder-icon-3zXSNb7F.js → folder-icon-DREaQWIx.js} +2 -2
  147. package/dist/client/assets/{form-DWfSZ-uy.js → form-Gz8fbLdb.js} +1 -1
  148. package/dist/client/assets/general-DBULqBSQ.js +1 -0
  149. package/dist/client/assets/held-block-view-DTUWWRfL.js +20 -0
  150. package/dist/client/assets/home-DnXsGhyo.js +1 -0
  151. package/dist/client/assets/{icon-button-DBmNh0NJ.js → icon-button-TQkFyvqB.js} +1 -1
  152. package/dist/client/assets/{index-cD72qupV.js → index-B9NLvHLf.js} +1 -1
  153. package/dist/client/assets/index-BEX8cmtV.js +1 -0
  154. package/dist/client/assets/index-BGcfYf5c.js +4 -0
  155. package/dist/client/assets/index-BNmzMNlZ.js +253 -0
  156. package/dist/client/assets/{index-DipIYjGn.js → index-BNtuHmZB.js} +2 -2
  157. package/dist/client/assets/{index-x6QXFiYo.js → index-C6_m0mjP.js} +1 -1
  158. package/dist/client/assets/{index-BauMDA_C.js → index-CaH8ekvn.js} +1 -1
  159. package/dist/client/assets/{index-CH1yVrTT.js → index-CqFACk2B.js} +3 -3
  160. package/dist/client/assets/{index-DPQJRb2f.js → index-DENKa8lW.js} +6 -6
  161. package/dist/client/assets/{index-Bs2VsSFp.js → index-DNHxXhrW.js} +9 -9
  162. package/dist/client/assets/{index-C6RphnDz.js → index-DgWAoWIc.js} +1 -1
  163. package/dist/client/assets/{index-Nse4lEE5.js → index-DusHyRie.js} +1 -1
  164. package/dist/client/assets/{index-DFiVcvs1.js → index-bf-OLKAU.js} +1 -1
  165. package/dist/client/assets/{index-DdwTulXb.js → index-iynQP1if.js} +1 -1
  166. package/dist/client/assets/{index-CzAA1Ftq.js → index-kd3fyZ9a.js} +1 -1
  167. package/dist/client/assets/{index-redirect-Svh2E4vz.js → index-redirect-DAPRiYQw.js} +1 -1
  168. package/dist/client/assets/{infiniteQueryObserver-BxY60Pl8.js → infiniteQueryObserver-ClGIthQz.js} +1 -1
  169. package/dist/client/assets/{infra-billing-DEwuRVXP.js → infra-billing-Bn8rlKTp.js} +1 -1
  170. package/dist/client/assets/{input-Y4nlSnES.js → input-BS4EACP3.js} +7 -7
  171. package/dist/client/assets/{input-boV3L7bW.js → input-DZSiMfCa.js} +1 -1
  172. package/dist/client/assets/{integration-icon-oEHZLv8F.js → integration-icon-BrTM8z-s.js} +1 -1
  173. package/dist/client/assets/{jira-icon-BkogXsHX.js → jira-icon-CvveHm37.js} +1 -1
  174. package/dist/client/assets/{label-C6V9azY9.js → label-BCxqhVIq.js} +1 -1
  175. package/dist/client/assets/{layout-D4-0fnKG.js → layout-C_-T37yU.js} +1 -1
  176. package/dist/client/assets/legacy-agents-deep-HN0h-Vgf.js +1 -0
  177. package/dist/client/assets/{legacy-main-redirect-DPDO4jzz.js → legacy-main-redirect-HqwAGFUC.js} +1 -1
  178. package/dist/client/assets/library-D2Mrm5WM.js +1 -0
  179. package/dist/client/assets/{login-QwQdytNu.js → login-D25rkjo_.js} +1 -1
  180. package/dist/client/assets/{markdown-DVKH1IaR.js → markdown-P8cO0xLZ.js} +1 -1
  181. package/dist/client/assets/{mcp-app-renderer-DXX6eros.js → mcp-app-renderer-CKUvsXnq.js} +2 -2
  182. package/dist/client/assets/{mcp-oauth-BT1yV9Hn.js → mcp-oauth-C9hLQucs.js} +1 -1
  183. package/dist/client/assets/{mcp-oauth-CP_tf4jd.js → mcp-oauth-DBMA8wIh.js} +1 -1
  184. package/dist/client/assets/members-C_tx9w5g.js +1 -0
  185. package/dist/client/assets/{memory-C50Pawnh.js → memory-CsXGZJq1.js} +2 -2
  186. package/dist/client/assets/{mini-report-page-CAjqwv4W.js → mini-report-page-DGZYey3l.js} +1 -1
  187. package/dist/client/assets/{mock-board-D3aM5LBD.js → mock-board-BWzTY2k-.js} +5 -5
  188. package/dist/client/assets/{monaco-editor-LiopisRR.js → monaco-editor-CBJkBgIU.js} +2 -2
  189. package/dist/client/assets/monitoring-BLnrFAQj.js +1 -0
  190. package/dist/client/assets/{monitoring-stats-row-zg7N0blo.js → monitoring-stats-row-vWHUOUB3.js} +1 -1
  191. package/dist/client/assets/{multi-select-lVxVaMtl.js → multi-select-BNfLnIfI.js} +1 -1
  192. package/dist/client/assets/mustache-Crsi4VAX.js +4 -0
  193. package/dist/client/assets/{named-rule-uses-BeXmyiue.js → named-rule-uses-D5gjZwOp.js} +1 -1
  194. package/dist/client/assets/named-rule-view-BVCpec2I.js +1 -0
  195. package/dist/client/assets/{new-project-dialog-DmsgoraK.js → new-project-dialog-BzJmdXI6.js} +1 -1
  196. package/dist/client/assets/{oauth-callback-Bs2w3d0I.js → oauth-callback-CwZ-b3nE.js} +1 -1
  197. package/dist/client/assets/{oauth-callback-ai-provider-CUCvxuBI.js → oauth-callback-ai-provider-CujNNAU2.js} +1 -1
  198. package/dist/client/assets/onboarding-Csy3KW6h.js +1 -0
  199. package/dist/client/assets/openai-conversation-DJfgyA82.js +3 -0
  200. package/dist/client/assets/{optimistic-project-sidebar-views-C7cacXI0.js → optimistic-project-sidebar-views-XzUayXF_.js} +1 -1
  201. package/dist/client/assets/{order-monitor-day-D34Jke5D.js → order-monitor-day-BUk1fjA6.js} +1 -1
  202. package/dist/client/assets/organization-choice-BG-EMl8L.js +1 -0
  203. package/dist/client/assets/orgs-BOi51Yxa.js +1 -0
  204. package/dist/client/assets/page-seo-form-D4gneorY.js +1 -0
  205. package/dist/client/assets/{pair-71Dh0mlf.js → pair-Dh_1oqHi.js} +8 -8
  206. package/dist/client/assets/parse-sections-B30A8ECY.js +1 -0
  207. package/dist/client/assets/plan-BXu8SQ3T.js +1 -0
  208. package/dist/client/assets/{plan-ladder-DMra4X10.js → plan-ladder-CN5p5ylK.js} +1 -1
  209. package/dist/client/assets/{popover-DClINcvR.js → popover-DauDBkON.js} +1 -1
  210. package/dist/client/assets/post-calendar-Ceopsk1u.js +1 -0
  211. package/dist/client/assets/post-editor-BChaRDNt.js +2 -0
  212. package/dist/client/assets/{preview-content-T_PMJBX-.js → preview-content-BvhoJjFR.js} +1 -1
  213. package/dist/client/assets/{preview-dialog-BZFfGFuX.js → preview-dialog-iRKqzeeN.js} +1 -1
  214. package/dist/client/assets/{preview-panel-DlTtP1Ms.js → preview-panel-DcbhbW1H.js} +1 -1
  215. package/dist/client/assets/preview-tab-ClK0lOMy.js +551 -0
  216. package/dist/client/assets/{product-picker-dialog-BpSOLmzl.js → product-picker-dialog-CsTqbwXT.js} +1 -1
  217. package/dist/client/assets/profile-DE1V4tEF.js +1 -0
  218. package/dist/client/assets/project-app-view-BpeI5cMf.js +1 -0
  219. package/dist/client/assets/{project-apps-Dm5IS3KO.js → project-apps-CNRV3DAE.js} +1 -1
  220. package/dist/client/assets/project-feed-BcaTqzKD.js +1 -0
  221. package/dist/client/assets/{project-icon-DuRHj8pv.js → project-icon-9kbQzXfH.js} +1 -1
  222. package/dist/client/assets/project-reports-DZCmLCmE.js +1 -0
  223. package/dist/client/assets/project-tasks-D6qNETK3.js +1 -0
  224. package/dist/client/assets/projects-Kz2HQD_e.js +1 -0
  225. package/dist/client/assets/{projects-empty-state-QJ0Cx8Z2.js → projects-empty-state-Df7eS0pA.js} +1 -1
  226. package/dist/client/assets/{prompts-C9l1TNag.js → prompts-B4KLkb4I.js} +1 -1
  227. package/dist/client/assets/record-editor-C5XOx_LV.js +1 -0
  228. package/dist/client/assets/redirect-editor-BxKT3ntE.js +1 -0
  229. package/dist/client/assets/releases-api-BDl7LEw1.js +1 -0
  230. package/dist/client/assets/{reports-BOvqWT5T.js → reports-Cp14zg57.js} +1 -1
  231. package/dist/client/assets/reports-DBFNTtm-.js +1 -0
  232. package/dist/client/assets/reports-onboarding-D2UqC4mS.js +1 -0
  233. package/dist/client/assets/reports-tab-C51R-6vi.js +2 -0
  234. package/dist/client/assets/repositories-C77B6dOt.js +1 -0
  235. package/dist/client/assets/repositories-CHKGn0VU.js +1 -0
  236. package/dist/client/assets/repository-binding-BZ7FmJ0X.js +1 -0
  237. package/dist/client/assets/{repository-import-picker-DmCy1J1K.js → repository-import-picker-Bjws7k2-.js} +1 -1
  238. package/dist/client/assets/repository-picker-DkvIZLAj.js +1 -0
  239. package/dist/client/assets/{require-capability-Bij86NMO.js → require-capability-Bm5pde_M.js} +1 -1
  240. package/dist/client/assets/{required-auth-layout-FVugTURm.js → required-auth-layout-Dn8nNstE.js} +1 -1
  241. package/dist/client/assets/{reset-password-DT6AfwVB.js → reset-password-CHMCFAp9.js} +1 -1
  242. package/dist/client/assets/{resizable-DgP86V61.js → resizable-BYZDi11K.js} +1 -1
  243. package/dist/client/assets/{resolve-tab-icon-D9iIIIDe.js → resolve-tab-icon-DLcHhSBW.js} +1 -1
  244. package/dist/client/assets/review-settings-DEFTQSp0.js +1 -0
  245. package/dist/client/assets/roles-BIj8m30-.js +1 -0
  246. package/dist/client/assets/route-CwIKlFpH.js +1 -0
  247. package/dist/client/assets/route-DQxiKHs8.js +1 -0
  248. package/dist/client/assets/route-L2EzRsks.js +1 -0
  249. package/dist/client/assets/{sandbox-lifecycle-context-q0eTvNvQ.js → sandbox-lifecycle-context-DMfngoi-.js} +1 -1
  250. package/dist/client/assets/{schema-CJ53G47b.js → schema-DEyBWI2y.js} +1 -1
  251. package/dist/client/assets/{schema-DNweLWtn.js → schema-DoiqvTL7.js} +1 -1
  252. package/dist/client/assets/{scroll-area-BHIKiLUM.js → scroll-area-Cfsm1vBV.js} +1 -1
  253. package/dist/client/assets/search-input-DBKkXR0y.js +1 -0
  254. package/dist/client/assets/{search-toggle-DzUrEZFD.js → search-toggle-CzYTwp_L.js} +1 -1
  255. package/dist/client/assets/secret-ciphertext-cTA7BSVY.js +1 -0
  256. package/dist/client/assets/secret-picker-CqxG24X7.js +1 -0
  257. package/dist/client/assets/secrets-CtByih4R.js +1 -0
  258. package/dist/client/assets/{sections-DHvRm7bA.js → sections-CCcpB_PT.js} +1 -1
  259. package/dist/client/assets/sections-editor-DpO_mTF7.js +1 -0
  260. package/dist/client/assets/{select-BvUL0HyR.js → select-CTAm_W2d.js} +1 -1
  261. package/dist/client/assets/{select-model-Szkl3757.js → select-model-Cvj2OnbU.js} +1 -1
  262. package/dist/client/assets/seo-editor-BPToAJRY.js +1 -0
  263. package/dist/client/assets/{separator-vlhb1Tzj.js → separator-BeYssz5V.js} +1 -1
  264. package/dist/client/assets/settings-tab-BRtykuoH.js +1 -0
  265. package/dist/client/assets/{sheet-D1CAQsjr.js → sheet-C52S-h6R.js} +1 -1
  266. package/dist/client/assets/shell-layout-DYY0I41_.js +1 -0
  267. package/dist/client/assets/site-draft-actions-DwqQ-cQC.js +12 -0
  268. package/dist/client/assets/site-draft-view-CiKU2Icp.js +2 -0
  269. package/dist/client/assets/site-editor-CuXmo07G.js +1 -0
  270. package/dist/client/assets/site-editor-toast-CT4NtD1f.js +1 -0
  271. package/dist/client/assets/skills-_WDetSCi.js +1 -0
  272. package/dist/client/assets/{slider-EpxmA7ZL.js → slider-rNbrBC-4.js} +1 -1
  273. package/dist/client/assets/{sortable.esm-CpdZxqSN.js → sortable.esm-Cw5kBwgn.js} +1 -1
  274. package/dist/client/assets/sso-DSG3YPMw.js +1 -0
  275. package/dist/client/assets/{suggestion-DqRsSpc-.js → suggestion-Dd_Uy5Bv.js} +2 -2
  276. package/dist/client/assets/{switch-BudKCJf7.js → switch-nUFQi60k.js} +1 -1
  277. package/dist/client/assets/{symbol-CYQiJJdu.js → symbol-C3kEOGZ_.js} +1 -1
  278. package/dist/client/assets/synced-repos-DBmibobg.js +1 -0
  279. package/dist/client/assets/{tab-icon-glyph-BGGv8hr_.js → tab-icon-glyph-Bzpngl6a.js} +1 -1
  280. package/dist/client/assets/{table-Bo_p8Wa3.js → table-CxQHf5NT.js} +1 -1
  281. package/dist/client/assets/{tabs-BTB5YGW1.js → tabs-BwD6LFyC.js} +1 -1
  282. package/dist/client/assets/task-assignee-avatar-Bg9ijzoY.js +1 -0
  283. package/dist/client/assets/{task-board-Ds21WWvc.js → task-board-DreQgJBj.js} +1 -1
  284. package/dist/client/assets/{task-route-BUL4mDi5.js → task-route-B6QYswnx.js} +1 -1
  285. package/dist/client/assets/{task-status-CK5oSIgi.js → task-status-DcCdeelW.js} +1 -1
  286. package/dist/client/assets/taskboard-analytics-C_aUAX7S.js +1 -0
  287. package/dist/client/assets/tasks-CYY9XlJ3.js +4 -0
  288. package/dist/client/assets/tasks-CeouZ3tS.js +1 -0
  289. package/dist/client/assets/{textarea-BS7I3MZL.js → textarea-y7TWtoua.js} +1 -1
  290. package/dist/client/assets/thread-analytics-BD8n1a8E.js +1 -0
  291. package/dist/client/assets/{thread-intent-C0R8BtBw.js → thread-intent-cB2EtHpg.js} +6 -6
  292. package/dist/client/assets/thread-route-Cr5f3jw8.js +1 -0
  293. package/dist/client/assets/{thread-route-yHr3Xqpq.js → thread-route-D01w_vQB.js} +1 -1
  294. package/dist/client/assets/thread-sheet-body-C0IyWshl.js +1 -0
  295. package/dist/client/assets/{time-range-picker-C_RAU_JZ.js → time-range-picker-bp6BeGMC.js} +1 -1
  296. package/dist/client/assets/toggle-group-BIu6qfZV.js +1 -0
  297. package/dist/client/assets/{tool-namespace-B1sVq59x.js → tool-namespace-Crbzrqv8.js} +1 -1
  298. package/dist/client/assets/{toolbar-icon-button-D4YToeEY.js → toolbar-icon-button-ByMmG3VL.js} +1 -1
  299. package/dist/client/assets/{tooltip-CmTwSHYA.js → tooltip-DibJz0Jl.js} +1 -1
  300. package/dist/client/assets/{tooltipContext-C41VBtBA.js → tooltipContext-BzrsG1UN.js} +1 -1
  301. package/dist/client/assets/track-C-8tVJFa.js +1 -0
  302. package/dist/client/assets/{types-05YrcBTZ.js → types-BdOsWOEi.js} +9 -9
  303. package/dist/client/assets/{url-slug-BQQBxd5s.js → url-slug-CPCergXm.js} +1 -1
  304. package/dist/client/assets/{usage-stats-DTNxQXdY.js → usage-stats-DDafRqWC.js} +7 -7
  305. package/dist/client/assets/{use-ai-providers-BdMI1dJ8.js → use-ai-providers-Bsehd5pg.js} +1 -1
  306. package/dist/client/assets/use-apply-named-rule-CeNTU7vM.js +1 -0
  307. package/dist/client/assets/{use-automations-7sML6axw.js → use-automations-BscjsX1o.js} +1 -1
  308. package/dist/client/assets/use-autosave-D0y0c0lt.js +1 -0
  309. package/dist/client/assets/{use-chat-layout-state-DuWKLw_d.js → use-chat-layout-state-DpOxQYv4.js} +1 -1
  310. package/dist/client/assets/{use-clock-tick-Cqy994m5.js → use-clock-tick-jRUiEK1v.js} +1 -1
  311. package/dist/client/assets/{use-connect-companion-B7-Rnq6I.js → use-connect-companion-BGtpVGmA.js} +1 -1
  312. package/dist/client/assets/use-connection-CAR6Cxbr.js +1 -0
  313. package/dist/client/assets/{use-content-sync-DxuiTsAP.js → use-content-sync-bYlxy6np.js} +1 -1
  314. package/dist/client/assets/{use-copy-ByMN8ZBl.js → use-copy-Dpm_jhm-.js} +1 -1
  315. package/dist/client/assets/{use-create-virtual-mcp-UGWMFU-8.js → use-create-virtual-mcp-DcCX7uo7.js} +1 -1
  316. package/dist/client/assets/use-date-fns-locale-hUyExEVb.js +1 -0
  317. package/dist/client/assets/{use-debounced-autosave-DN6l6XR3.js → use-debounced-autosave-By6os5xD.js} +1 -1
  318. package/dist/client/assets/{use-debounced-value-3kPVK8wc.js → use-debounced-value-BtR2lyTj.js} +1 -1
  319. package/dist/client/assets/use-deco-credits-DRIA1g3T.js +1 -0
  320. package/dist/client/assets/{use-decopilot-events-DH9vtuqj.js → use-decopilot-events-C4OBhauN.js} +1 -1
  321. package/dist/client/assets/use-delete-connection-BM5PcuGQ.js +1 -0
  322. package/dist/client/assets/{use-deployment-admin-BlS14Krh.js → use-deployment-admin-BmDeutjQ.js} +1 -1
  323. package/dist/client/assets/{use-fast-preview-draft-url-8Q6wI_7_.js → use-fast-preview-draft-url-BUDoPHon.js} +1 -1
  324. package/dist/client/assets/{use-file-configs-BJwH2-6c.js → use-file-configs-CuVchUT-.js} +1 -1
  325. package/dist/client/assets/{use-inbox-feed-BbsXPNFF.js → use-inbox-feed-Bi03vVLM.js} +1 -1
  326. package/dist/client/assets/{use-infinite-scroll-D-NkL7pd.js → use-infinite-scroll-0YRynoMy.js} +1 -1
  327. package/dist/client/assets/use-join-requests-BhMSzUBO.js +1 -0
  328. package/dist/client/assets/use-main-panel-tabs-QcdwwtJ8.js +1 -0
  329. package/dist/client/assets/{use-mcp-auth-status-SDpJIu0o.js → use-mcp-auth-status-Ddp-NElL.js} +1 -1
  330. package/dist/client/assets/{use-mcp-client-CqNgp7C3.js → use-mcp-client-ClU7gdfw.js} +10 -10
  331. package/dist/client/assets/{use-mcp-prompts-_OL9f0kB.js → use-mcp-prompts-CFFfSPcj.js} +1 -1
  332. package/dist/client/assets/{use-mcp-tools-CzxPUwUO.js → use-mcp-tools-CsGOzrhW.js} +1 -1
  333. package/dist/client/assets/{use-mobile-DpTfSAm7.js → use-mobile-nW9hYb6L.js} +1 -1
  334. package/dist/client/assets/use-move-blocks-BKlQlSno.js +1 -0
  335. package/dist/client/assets/{use-navigate-to-agent-CblBUgFe.js → use-navigate-to-agent-CvuO-uuz.js} +1 -1
  336. package/dist/client/assets/{use-open-billing-url-C8vpSsvJ.js → use-open-billing-url-6zduD8ZA.js} +1 -1
  337. package/dist/client/assets/{use-org-fs-BwLqCU_I.js → use-org-fs-BcT14y41.js} +1 -1
  338. package/dist/client/assets/{use-org-repo-syncs-Cg7khzRw.js → use-org-repo-syncs-BdTpYW4-.js} +1 -1
  339. package/dist/client/assets/{use-org-sso-CXvlVlUi.js → use-org-sso-DdzTjSOo.js} +1 -1
  340. package/dist/client/assets/use-organization-roles-DQlsWqEE.js +1 -0
  341. package/dist/client/assets/{use-organization-settings-R35CeX0x.js → use-organization-settings-DeXdcCtZ.js} +1 -1
  342. package/dist/client/assets/{use-panel-navigate-DcAwEhOb.js → use-panel-navigate-BrjENNrA.js} +1 -1
  343. package/dist/client/assets/{use-project-native-view-presence-B1h5Pugj.js → use-project-native-view-presence-OgGOYaV4.js} +1 -1
  344. package/dist/client/assets/{use-project-scope-COq2XQVT.js → use-project-scope-DryffHrf.js} +1 -1
  345. package/dist/client/assets/{use-recent-apps-DQiepK1I.js → use-recent-apps-CMgGjBH4.js} +1 -1
  346. package/dist/client/assets/{use-releases-CXFA4FcN.js → use-releases-BQePeR_j.js} +1 -1
  347. package/dist/client/assets/use-reports-diagnostic-KZB3C_26.js +1 -0
  348. package/dist/client/assets/{use-sandbox-events-wT6wBZge.js → use-sandbox-events-ClbDdVRn.js} +2 -2
  349. package/dist/client/assets/{use-secrets-Dti2Zjt-.js → use-secrets-Cjihb12f.js} +1 -1
  350. package/dist/client/assets/use-section-preview-base-go9VMYa4.js +1 -0
  351. package/dist/client/assets/use-session-runtime-CQOTzbKn.js +1 -0
  352. package/dist/client/assets/{use-sidebar-collapsed-DCvF-wFz.js → use-sidebar-collapsed-CUSnfCt-.js} +1 -1
  353. package/dist/client/assets/{use-tags-Dkh7i4b9.js → use-tags-CMyUN8Qd.js} +1 -1
  354. package/dist/client/assets/use-task-board-analytics-BWzR51Kh.js +1 -0
  355. package/dist/client/assets/{use-task-board-events-BTnll7tY.js → use-task-board-events-DlFBtyOL.js} +1 -1
  356. package/dist/client/assets/{use-task-board-item-prs-DV52O8jk.js → use-task-board-item-prs-D9Aj6NRX.js} +1 -1
  357. package/dist/client/assets/{use-task-metadata-L677N_ml.js → use-task-metadata-DcdDwiSS.js} +1 -1
  358. package/dist/client/assets/{use-thread-analytics-BZBVj7t2.js → use-thread-analytics-cLhxQI8B.js} +1 -1
  359. package/dist/client/assets/{use-thread-outputs-DkwE9vVN.js → use-thread-outputs-D8Bvo55q.js} +1 -1
  360. package/dist/client/assets/useInfiniteQuery-DWVaUM2t.js +1 -0
  361. package/dist/client/assets/useQueries-B8DPRYfS.js +1 -0
  362. package/dist/client/assets/useSuspenseInfiniteQuery-6Ovi3jRe.js +1 -0
  363. package/dist/client/assets/users-BIP3dsuH.js +1 -0
  364. package/dist/client/assets/{utils-JJWwAhjH.js → utils-DeFulDMz.js} +1 -1
  365. package/dist/client/assets/variant-calendar-C37bfPDk.js +1 -0
  366. package/dist/client/assets/variant-matcher-override-B4pYtxaz.js +1 -0
  367. package/dist/client/assets/{virtual-mcp-DhxG1LUt.js → virtual-mcp-D_aBBfQL.js} +1 -1
  368. package/dist/client/assets/{watch-sse-pool-HmUSWdEg.js → watch-sse-pool-Bk0Yni6j.js} +1 -1
  369. package/dist/client/index.html +1 -1
  370. package/dist/server/server.js +783 -783
  371. package/package.json +1 -1
  372. package/dist/client/assets/User01-B5NngWXw.js +0 -1
  373. package/dist/client/assets/access-gate-CXvtA9IQ.js +0 -1
  374. package/dist/client/assets/agent-analytics-BRVR9Nm7.js +0 -1
  375. package/dist/client/assets/agent-app-Wibq0OFa.js +0 -1
  376. package/dist/client/assets/agent-assets-Bj5Luz-W.js +0 -1
  377. package/dist/client/assets/agent-automation-Dr4Y6VGJ.js +0 -20
  378. package/dist/client/assets/agent-automations-FAc-0hCc.js +0 -1
  379. package/dist/client/assets/agent-calendar-D7DufZS_.js +0 -1
  380. package/dist/client/assets/agent-connect-sources-B2TBus9P.js +0 -1
  381. package/dist/client/assets/agent-deck-BQ7xD_0N.js +0 -1
  382. package/dist/client/assets/agent-e2e-Xz5_DbBd.js +0 -1
  383. package/dist/client/assets/agent-experiments-DMb-JH-W.js +0 -1
  384. package/dist/client/assets/agent-file-jmWEmVy9.js +0 -1
  385. package/dist/client/assets/agent-hosting-Jt1eRL4L.js +0 -1
  386. package/dist/client/assets/agent-icon-D9qv9iJQ.js +0 -1
  387. package/dist/client/assets/agent-library-CYOoJcrp.js +0 -1
  388. package/dist/client/assets/agent-library-file-CHPq6ELL.js +0 -1
  389. package/dist/client/assets/agent-monitor-Bxvs2XHa.js +0 -1
  390. package/dist/client/assets/agent-overview-BNrr8sDt.js +0 -1
  391. package/dist/client/assets/agent-releases-BusIaoNs.js +0 -2
  392. package/dist/client/assets/agent-settings-CCQqUf-q.js +0 -1
  393. package/dist/client/assets/agent-site-editor-code-CX9PY1d_.js +0 -2
  394. package/dist/client/assets/agent-site-editor-content-qNC8jZls.js +0 -1
  395. package/dist/client/assets/agent-site-editor-preview-DhMNzXt9.js +0 -1
  396. package/dist/client/assets/agent-view-CI9h5gAx.js +0 -1
  397. package/dist/client/assets/agents-list-DYyNDxTw.js +0 -1
  398. package/dist/client/assets/alert-dialog-BBFgXAmX.js +0 -7
  399. package/dist/client/assets/analytics-sections-czReTaOZ.js +0 -1
  400. package/dist/client/assets/analytics-tab-C1nax7x3.js +0 -2
  401. package/dist/client/assets/api-keys-f3ViWnh0.js +0 -1
  402. package/dist/client/assets/api-keys-qNGMRqbx.js +0 -1
  403. package/dist/client/assets/app-editor-D1Zrm2TM.js +0 -1
  404. package/dist/client/assets/automation-list-row-CiF6h_o_.js +0 -1
  405. package/dist/client/assets/automation-runs-BqVYPzh9.js +0 -1
  406. package/dist/client/assets/automations-BHFkDeZ2.js +0 -1
  407. package/dist/client/assets/avatar-DsyxJdd5.js +0 -1
  408. package/dist/client/assets/blocks-tab-states-_rQb-3nf.js +0 -1
  409. package/dist/client/assets/blog-schema-hiJ1VvK3.js +0 -1
  410. package/dist/client/assets/buckets-Cgqz5f6M.js +0 -1
  411. package/dist/client/assets/build-improve-prompt-doc-Cx1NA6_T.js +0 -2
  412. package/dist/client/assets/campaigns-view-Bn067WyB.js +0 -1
  413. package/dist/client/assets/category-editor-Co3bRfpu.js +0 -1
  414. package/dist/client/assets/choose-editor-DZmSFlJ2.js +0 -1
  415. package/dist/client/assets/cms-settings-editor-B1PCbkSm.js +0 -1
  416. package/dist/client/assets/collection-detail-DtWJ8lB6.js +0 -1
  417. package/dist/client/assets/collection-display-button-BaC3Lby-.js +0 -1
  418. package/dist/client/assets/connect-source-dialog-DjtB0gt2.js +0 -1
  419. package/dist/client/assets/connection-detail-C9scWK5j.js +0 -1
  420. package/dist/client/assets/connections-BQjNaGS9.js +0 -1
  421. package/dist/client/assets/content-tab-CAW0Bhf6.js +0 -22
  422. package/dist/client/assets/context-ddLbYTQy.js +0 -1
  423. package/dist/client/assets/create-organization-dialog-B1J3dbRj.js +0 -1
  424. package/dist/client/assets/differenceInSeconds-C3x8sHUj.js +0 -1
  425. package/dist/client/assets/discover-DORJ6GMD.js +0 -1
  426. package/dist/client/assets/experiments-tab-WOPYssza.js +0 -1
  427. package/dist/client/assets/experiments-tab-choice-CI25uYfH.js +0 -1
  428. package/dist/client/assets/file-explorer-CtLkW4hH.js +0 -2
  429. package/dist/client/assets/format-time-Cq80KKvY.js +0 -1
  430. package/dist/client/assets/general-CANWkC13.js +0 -1
  431. package/dist/client/assets/home-BFodRKhb.js +0 -1
  432. package/dist/client/assets/index-5D9wIy3o.js +0 -1
  433. package/dist/client/assets/index-BAmB740B.js +0 -243
  434. package/dist/client/assets/index-CkPVfANw.js +0 -4
  435. package/dist/client/assets/legacy-agents-deep-oTGqQAve.js +0 -1
  436. package/dist/client/assets/library-BNLBVJPY.js +0 -1
  437. package/dist/client/assets/members-B1ZJujYN.js +0 -1
  438. package/dist/client/assets/monitoring-B7vBtbj0.js +0 -1
  439. package/dist/client/assets/mustache-D4PpoYZo.js +0 -4
  440. package/dist/client/assets/named-rule-view-BD9ako2G.js +0 -1
  441. package/dist/client/assets/onboarding-BUhC7Axs.js +0 -1
  442. package/dist/client/assets/openai-conversation-D40-j2aL.js +0 -3
  443. package/dist/client/assets/organization-choice-CZm6-Lsp.js +0 -1
  444. package/dist/client/assets/orgs-BzS4vgpT.js +0 -1
  445. package/dist/client/assets/page-seo-form-UBTBjVc2.js +0 -1
  446. package/dist/client/assets/parse-sections-C7SJnlZ7.js +0 -1
  447. package/dist/client/assets/plan-6YWkk0Z5.js +0 -1
  448. package/dist/client/assets/post-calendar-l09Ocu-Z.js +0 -1
  449. package/dist/client/assets/post-editor-B5DakPnS.js +0 -2
  450. package/dist/client/assets/preview-tab-DE5CyvZI.js +0 -551
  451. package/dist/client/assets/profile-l7YzIikv.js +0 -1
  452. package/dist/client/assets/project-app-view-CZ4ncHJw.js +0 -1
  453. package/dist/client/assets/project-feed-B429synm.js +0 -1
  454. package/dist/client/assets/project-reports-BqcstnBp.js +0 -1
  455. package/dist/client/assets/project-tasks-0lrWUpFL.js +0 -1
  456. package/dist/client/assets/projects-s6UXfr6V.js +0 -1
  457. package/dist/client/assets/record-editor-BBAM6dba.js +0 -1
  458. package/dist/client/assets/redirect-editor-Da8bdxGX.js +0 -1
  459. package/dist/client/assets/releases-api-BTCDyPHo.js +0 -1
  460. package/dist/client/assets/reports-CBo7lxtK.js +0 -1
  461. package/dist/client/assets/reports-onboarding-D9oUufsD.js +0 -1
  462. package/dist/client/assets/reports-tab-DT51kjgE.js +0 -2
  463. package/dist/client/assets/repositories-CM9WvII2.js +0 -1
  464. package/dist/client/assets/repositories-bGHlY3pM.js +0 -1
  465. package/dist/client/assets/repository-binding-BgJ8uAoU.js +0 -1
  466. package/dist/client/assets/repository-picker-BvSncDst.js +0 -1
  467. package/dist/client/assets/review-settings-DdYgJGVz.js +0 -1
  468. package/dist/client/assets/roles-CgVcsOdT.js +0 -1
  469. package/dist/client/assets/route-CkFix_vP.js +0 -1
  470. package/dist/client/assets/route-DODiDy-j.js +0 -1
  471. package/dist/client/assets/route-DVi1VWR6.js +0 -1
  472. package/dist/client/assets/runnable-block-editor-dRq9eTzq.js +0 -20
  473. package/dist/client/assets/search-input-BAISJ9LS.js +0 -1
  474. package/dist/client/assets/secret-ciphertext-BoA15qGd.js +0 -1
  475. package/dist/client/assets/secret-picker-Cdv3xW0U.js +0 -1
  476. package/dist/client/assets/secrets-C7hm_npZ.js +0 -1
  477. package/dist/client/assets/sections-editor-DgEGZXcq.js +0 -4
  478. package/dist/client/assets/seo-editor-BLHMI9qj.js +0 -1
  479. package/dist/client/assets/settings-tab-Dx6WgZsi.js +0 -1
  480. package/dist/client/assets/shell-layout-B5jnML3d.js +0 -1
  481. package/dist/client/assets/site-draft-actions-D1d2wytY.js +0 -12
  482. package/dist/client/assets/site-draft-view-DmMlvXzq.js +0 -2
  483. package/dist/client/assets/site-editor-eGFXfzA8.js +0 -1
  484. package/dist/client/assets/site-editor-toast-CGZS9BwD.js +0 -1
  485. package/dist/client/assets/skills-NSxr4Z0X.js +0 -1
  486. package/dist/client/assets/sso-BHFwYob2.js +0 -1
  487. package/dist/client/assets/synced-repos-D-U5QZg2.js +0 -1
  488. package/dist/client/assets/task-assignee-avatar-CAj5yPyc.js +0 -1
  489. package/dist/client/assets/taskboard-analytics-D6UWbvQC.js +0 -1
  490. package/dist/client/assets/tasks-CMUaHBkk.js +0 -4
  491. package/dist/client/assets/tasks-D5WIQI-o.js +0 -1
  492. package/dist/client/assets/thread-analytics-Cqdeb287.js +0 -1
  493. package/dist/client/assets/thread-route-DnoU0Lqn.js +0 -1
  494. package/dist/client/assets/thread-sheet-body-BBHV5kVE.js +0 -1
  495. package/dist/client/assets/toggle-group-BcfSAKQP.js +0 -1
  496. package/dist/client/assets/track-DZvu8ree.js +0 -1
  497. package/dist/client/assets/use-apply-named-rule-pRgVjxXf.js +0 -1
  498. package/dist/client/assets/use-autosave-DMApQf0t.js +0 -1
  499. package/dist/client/assets/use-connection-DQSt0eTw.js +0 -1
  500. package/dist/client/assets/use-date-fns-locale-C0oymQ59.js +0 -1
  501. package/dist/client/assets/use-deco-credits-CT72rZSv.js +0 -1
  502. package/dist/client/assets/use-delete-connection-D5mcm_l_.js +0 -1
  503. package/dist/client/assets/use-join-requests-C-xyNeji.js +0 -1
  504. package/dist/client/assets/use-main-panel-tabs-DvsYVOuQ.js +0 -1
  505. package/dist/client/assets/use-members-CTltnPbx.js +0 -1
  506. package/dist/client/assets/use-move-blocks-YDfVWv8x.js +0 -1
  507. package/dist/client/assets/use-org-auth-client-Bi3e38-G.js +0 -1
  508. package/dist/client/assets/use-organization-roles-zn84F9HK.js +0 -1
  509. package/dist/client/assets/use-reports-diagnostic-Dwax0vDS.js +0 -1
  510. package/dist/client/assets/use-section-preview-base-CFzMfuNP.js +0 -1
  511. package/dist/client/assets/use-session-runtime-Ba_EwQTc.js +0 -1
  512. package/dist/client/assets/use-task-board-analytics-Bqx8wPMm.js +0 -1
  513. package/dist/client/assets/useInfiniteQuery-D-VWsr8W.js +0 -1
  514. package/dist/client/assets/useQueries-jXxHGDMF.js +0 -1
  515. package/dist/client/assets/useSuspenseInfiniteQuery-mJC6qHan.js +0 -1
  516. package/dist/client/assets/users-T5camo9f.js +0 -1
  517. package/dist/client/assets/variant-calendar-BgT-KS6e.js +0 -1
  518. package/dist/client/assets/variant-matcher-override-CgViiiNQ.js +0 -1
@@ -0,0 +1,12 @@
1
+ import{c as M,b as xe,r as q,j as r,B as ye,l as X,K as Et,as as Xs,b4 as Lr,ay as ua,aD as Ur,X as Gt,t as Oe,aM as Ys,aN as Zs,aO as en,aP as tn,bl as sn,aQ as nn,aR as an,aS as rn,V as Ps,Y as js,Z as Ss,a as ks,a4 as Cs,cr as qr,h as Qt,f7 as ha,f8 as ln,bI as zr,bd as Hr,eV as $n,f9 as Kr,b$ as Vr,at as Gr,I as Qr,a7 as Wr,fa as Jr,q as Ns,fb as Xr,eR as Yr,U as fa,m as Tt,eP as on,H as ma,D as pa,x as ba,v as ga,Q as xa,M as va,fc as Zr,bm as ya,a5 as wa,b8 as cn,e as Fn,C as el,R as tl}from"./index-BNmzMNlZ.js";import{S as sl}from"./separator-BeYssz5V.js";import{f as nl,u as Zt,r as Pa,l as ja,c as Sa,b as al}from"./chat-context-C56OVvQP.js";import{u as qt,a9 as rl,c as ka,b as Ca,aa as dn,ab as bs,H as Es,ac as En,ad as ll,ae as il,af as ol,ag as cl,ah as dl,X as ul,ai as hl,D as un,B as Na,aj as fl,ak as Aa,z as ml,w as Ra}from"./site-editor-toast-CT4NtD1f.js";import{L as pl,a as bl}from"./shell-layout-DYY0I41_.js";import{I as Ta}from"./toolbar-icon-button-ByMmG3VL.js";import{P as gl,a as xl,b as vl}from"./popover-DauDBkON.js";import{c as kt,T as Ct,a as Nt,b as As}from"./tooltip-DibJz0Jl.js";import{d as yl,e as wl,c as Pl,C as _n,a as On,b as Ln}from"./command-N9BazZHl.js";import{T as Lt,a as Ia,c as Da}from"./tabs-BwD6LFyC.js";import{t as Ba}from"./ChevronUp-4EkxqYyz.js";import{aH as Rs,H as jl,a as Ma,aI as Sl,b as $a,aJ as Fa,O as kl}from"./agent-icon-CVEMdYFU.js";import{i as Ea}from"./DotsVertical-qUaZHjqd.js";import{b as _a}from"./Tool01-Bon-ixH5.js";import{s as Oa}from"./Plus-BfnmJh1R.js";import{s as Ts}from"./Trash01-cH2tYIUn.js";import{u as hn,r as _s,a as Un,n as Os,g as fn,b as mn}from"./use-releases-BQePeR_j.js";import{k as Cl,d as Nl,j as qn}from"./thread-intent-cB2EtHpg.js";import{h as La,r as Ua,g as Al,f as tt,a as pn,j as qa}from"./repository-binding-BZ7FmJ0X.js";import{u as Rl}from"./use-debounced-value-BtR2lyTj.js";import{u as Tl}from"./use-clock-tick-jRUiEK1v.js";import{u as Il}from"./useInfiniteQuery-DWVaUM2t.js";import{e as Dl,c as Bl,p as Ml,g as za,h as Ha,i as Ka}from"./use-navigate-to-agent-CvuO-uuz.js";import{a as zn}from"./virtual-mcp-D_aBBfQL.js";import{u as Va,c as $l,e as Fl}from"./experiments-tab-choice-DZqY092h.js";import{G as Ga}from"./repository-picker-DkvIZLAj.js";import{u as bn}from"./use-session-runtime-CQOTzbKn.js";import{u as El,c as _l,d as Ol,e as Ll}from"./use-fast-preview-draft-url-BUDoPHon.js";import{a8 as Kt,a9 as Qa,w as gs,l as gn,aa as Wa,ab as Ul,ac as ql,ad as zl,ae as Hl,j as Kl,u as Ft,f as xn,af as Vl}from"./parse-sections-B30A8ECY.js";import"./index-B9NLvHLf.js";import{T as Gl}from"./textarea-y7TWtoua.js";import{i as vn}from"./CheckCircle-DCMOdEuL.js";import{s as xs}from"./Image01-CW7Pcq-W.js";import{p as Ql,H as Wl,h as Jl,k as Xl,n as Yl,r as Zl,a as ei,b as ti,u as si}from"./releases-api-BDl7LEw1.js";import{a as ni,g as ai}from"./UserSquare-DsAVH788.js";import{n as ri,b as li,m as ii}from"./named-rule-uses-D5gjZwOp.js";import{S as oi,e as ci,a as di,R as Ja}from"./secret-ciphertext-cTA7BSVY.js";import{f as yn,b as Xa,r as Is,p as ui,c as Ya,i as wn,d as hi,e as Za,m as fi,h as mi,g as er,j as pi,n as bi,k as gi,l as xi,o as vi,q as Pn,t as yi,u as tr,s as sr,v as Ls}from"./sandbox-git-api-CH_-QFpD.js";import{b as wi,g as Pi}from"./utils-DeFulDMz.js";import{i as ji}from"./Monitor01-L9jyZGZ2.js";import{w as jn,g as Si,D as ki}from"./section-preview-url-7zfngvgW.js";import{w as Sn}from"./device-hint-SeLRi17j.js";import{w as Hn}from"./editor-B7sIq_vQ.js";import{u as nr}from"./use-content-sync-bYlxy6np.js";import{s as ar}from"./save-changes-debug-nBi-n9eV.js";import{u as Ci}from"./use-mcp-client-ClU7gdfw.js";import{u as Ni}from"./use-sandbox-events-ClbDdVRn.js";import{b as Ai,a as Ri}from"./sandbox-lifecycle-context-DMfngoi-.js";import{b as Ti}from"./thread-route-D01w_vQB.js";const Kn=/[\r\n<>]/,Ii=/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;function Ds(t){const e=t?.userName?.trim();if(!e||Kn.test(e))return null;const s=t?.userEmail?.trim();return!s||Kn.test(s)?{userName:e}:Ii.test(s)?{userName:e,userEmail:s}:{userName:e}}function Di(t){return t.split(`
2
+ `).filter(e=>!/^Co-authored-by:\s/i.test(e)).join(`
3
+ `).trimEnd()}function Bi(t){const e=t.userName.trim(),s=t.userEmail?.trim();return s?`Co-authored-by: ${e} <${s}>`:`Co-authored-by: ${e}`}function rr(t,e){const s=Ds(e);if(!s)return t;const a=Di(t),n=Bi(s);if(a.includes(n))return a;const o=a.trimEnd();return o.length>0?`${o}
4
+
5
+ ${n}`:n}function Mi(t,e){const s=t?.trim();return s?rr(s,e):s||void 0}function $i(t){const{value:e,baseBranch:s,releases:a,baseIsDraft:n=!1}=t,o=!n&&!!e&&e===s,c=a.find(i=>i.branch===e);return{isBase:o,current:c,unlisted:!o&&!c&&!!e}}const Fi={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Vn=1114111;function Gn(t){return t?t.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,s)=>{if(s.startsWith("#x")||s.startsWith("#X")){const a=Number.parseInt(s.slice(2),16);return!Number.isFinite(a)||a>Vn?e:String.fromCodePoint(a)}if(s.startsWith("#")){const a=Number.parseInt(s.slice(1),10);return!Number.isFinite(a)||a>Vn?e:String.fromCodePoint(a)}return Fi[s]??e}):""}function Ei(t){const e=M.c(39),{url:s,onSave:a}=t,n=xe(),[o,c]=q.useState(s??"");let l;e[0]!==o?(l=o.trim(),e[0]=o,e[1]=l):l=e[1];const i=l;let u;e[2]!==a||e[3]!==i?(u=()=>a(i?Cl(i):null),e[2]=a,e[3]=i,e[4]=u):u=e[4];const d=u;let h;e[5]!==n?(h=n("thread.branchPicker.localHint"),e[5]=n,e[6]=h):h=e[6];let f;e[7]!==h?(f=r.jsx("p",{className:"text-xs text-muted-foreground",children:h}),e[7]=h,e[8]=f):f=e[8];let p;e[9]!==n?(p=n("thread.branchPicker.localUrlLabel"),e[9]=n,e[10]=p):p=e[10];let m;e[11]!==n?(m=n("thread.branchPicker.localUrlPlaceholder"),e[11]=n,e[12]=m):m=e[12];let b;e[13]===Symbol.for("react.memo_cache_sentinel")?(b=N=>c(N.target.value),e[13]=b):b=e[13];let g;e[14]!==d||e[15]!==i?(g=N=>{N.key==="Enter"&&i&&d()},e[14]=d,e[15]=i,e[16]=g):g=e[16];let x;e[17]!==p||e[18]!==m||e[19]!==g||e[20]!==o?(x=r.jsx("input",{type:"url",inputMode:"url","aria-label":p,placeholder:m,value:o,onChange:b,onKeyDown:g,className:"h-8 w-full rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[17]=p,e[18]=m,e[19]=g,e[20]=o,e[21]=x):x=e[21];let j;e[22]!==a||e[23]!==n||e[24]!==s?(j=s?r.jsx(ye,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive",onClick:()=>a(null),children:n("thread.branchPicker.localTurnOff")}):r.jsx("span",{}),e[22]=a,e[23]=n,e[24]=s,e[25]=j):j=e[25];const y=!i;let v;e[26]!==n?(v=n("thread.branchPicker.save"),e[26]=n,e[27]=v):v=e[27];let P;e[28]!==d||e[29]!==y||e[30]!==v?(P=r.jsx(ye,{size:"sm",disabled:y,onClick:d,children:v}),e[28]=d,e[29]=y,e[30]=v,e[31]=P):P=e[31];let w;e[32]!==j||e[33]!==P?(w=r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[j,P]}),e[32]=j,e[33]=P,e[34]=w):w=e[34];let k;return e[35]!==w||e[36]!==f||e[37]!==x?(k=r.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[f,x,w]}),e[35]=w,e[36]=f,e[37]=x,e[38]=k):k=e[38],k}function _i(t){const e=M.c(8),{virtualMcpId:s,branch:a,serve:n,rowRef:o,onPicked:c}=t,l=qt(s,a),i=!!n.connection,u=i&&l.kind==="protocol"&&l.source==="local";let d;e[0]!==c||e[1]!==n?(d=()=>Oi(n,c),e[0]=c,e[1]=n,e[2]=d):d=e[2];let h;return e[3]!==o||e[4]!==i||e[5]!==u||e[6]!==d?(h=r.jsx(Li,{rowRef:o,selected:i,connected:u,onSelect:d}),e[3]=o,e[4]=i,e[5]=u,e[6]=d,e[7]=h):h=e[7],h}function Oi(t,e){e?.(),!t.connection&&t.set({endpoint:t.lastEndpoint??rl})}function Li(t){const e=M.c(19),{rowRef:s,selected:a,connected:n,onSelect:o}=t,c=xe(),l=a?"bg-accent":"hover:bg-accent";let i;e[0]!==l?(i=X("flex rounded-lg",l),e[0]=l,e[1]=i):i=e[1];let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=r.jsx("span",{"data-testid":"localhost-dot",className:"h-2 w-2 shrink-0 rounded-full bg-foreground"}),e[2]=u):u=e[2];let d;e[3]!==c?(d=c("thread.branchPicker.localhost.label"),e[3]=c,e[4]=d):d=e[4];let h;e[5]!==d?(h=r.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),e[5]=d,e[6]=h):h=e[6];let f;e[7]!==n||e[8]!==c?(f=n&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:c("thread.branchPicker.localhost.connected")}),e[7]=n,e[8]=c,e[9]=f):f=e[9];let p;e[10]!==o||e[11]!==a||e[12]!==h||e[13]!==f?(p=r.jsxs("button",{type:"button","aria-pressed":a,onClick:o,className:"flex w-full min-w-0 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[u,h,f]}),e[10]=o,e[11]=a,e[12]=h,e[13]=f,e[14]=p):p=e[14];let m;return e[15]!==s||e[16]!==i||e[17]!==p?(m=r.jsx("div",{ref:s,className:i,children:p}),e[15]=s,e[16]=i,e[17]=p,e[18]=m):m=e[18],m}const Ui=10080*60*1e3;function qi({sandboxMap:t,userId:e,rawBranches:s,now:a}){const n=new Map;for(const[h,f]of Object.entries(t??{}))for(const[p,m]of Object.entries(f??{})){let b=n.get(p);b||(b={userIds:new Set,lastActiveAt:0},n.set(p,b)),b.userIds.add(h);for(const g of Object.values(m??{})){const x=g?.createdAt??0;x>b.lastActiveAt&&(b.lastActiveAt=x)}}const o=a-Ui,c=[...n.entries()].filter(([,h])=>h.lastActiveAt>=o).sort((h,f)=>f[1].lastActiveAt-h[1].lastActiveAt).map(([h,f])=>({name:h,source:"recent",contributors:[...f.userIds],lastActiveAt:f.lastActiveAt})),l=new Set(c.map(h=>h.name)),i=new Set(Object.keys(t?.[e]??{})),u=[...i].filter(h=>!l.has(h)).sort().map(h=>({name:h,source:"yours"})),d=s.filter(h=>!i.has(h.name)&&!l.has(h.name)).map(h=>({name:h.name,source:"other",author:h.author??null}));return{recent:c,yours:u,others:d}}const zi=100,Hi=50,Ki=300;function Ks(t,e){const s=e.trim().toLowerCase();return s?t.toLowerCase().includes(s):!0}function Vi(t){const e=M.c(39),{orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:c,owner:l,repo:i,search:u,enabled:d}=t,h=u===void 0?"":u,f=d===void 0?!0:d;let p;e[0]!==h?(p=h.trim(),e[0]=h,e[1]=p):p=e[1];const m=p,b=Rl(m,Ki);let g;e[2]!==o?(g=La(o),e[2]=o,e[3]=g):g=e[3];const x=g,j=m.length>0;let y;e[4]!==b||e[5]!==s||e[6]!==a||e[7]!==l||e[8]!==i||e[9]!==o?(y=Et.githubBranchSearch(s,a,Ua(o),l,i,b),e[4]=b,e[5]=s,e[6]=a,e[7]=l,e[8]=i,e[9]=o,e[10]=y):y=e[10];const v=f&&x;let P;e[11]!==b||e[12]!==a||e[13]!==o?(P=J=>{const{pageParam:se}=J;return Xs(a,"REPOSITORY_SEARCH_BRANCHES",{...o,query:b,limit:b?Hi:zi,cursor:se})},e[11]=b,e[12]=a,e[13]=o,e[14]=P):P=e[14];let w;e[15]!==b?(w=J=>b?void 0:J.nextCursor??void 0,e[15]=b,e[16]=w):w=e[16];let k;e[17]!==y||e[18]!==v||e[19]!==P||e[20]!==w?(k={queryKey:y,enabled:v,staleTime:3e4,retry:!1,initialPageParam:null,queryFn:P,getNextPageParam:w},e[17]=y,e[18]=v,e[19]=P,e[20]=w,e[21]=k):k=e[21];const{data:N,isLoading:R,isError:C,isFetching:A,hasNextPage:S,isFetchingNextPage:E,fetchNextPage:$}=Il(k),I=j&&(b!==m||A),T=(N?.pages??[]).flatMap(Gi),D=Tl(6e4),Y=qi({sandboxMap:c,userId:n,rawBranches:T,now:D});let ae;e[22]!==m?(ae=J=>Ks(J.name,m),e[22]=m,e[23]=ae):ae=e[23];const H=Y.recent.filter(ae);let _;e[24]!==m?(_=J=>Ks(J.name,m),e[24]=m,e[25]=_):_=e[25];const z=Y.yours.filter(_),ee=Y.others,Q=N?.pages[0],B=j&&Q&&!I?Math.max(0,Q.totalCount-Q.branches.length):0,ie=!j&&S;let U;e[26]!==$?(U=()=>{$()},e[26]=$,e[27]=U):U=e[27];let oe;return e[28]!==B||e[29]!==C||e[30]!==E||e[31]!==R||e[32]!==I||e[33]!==ee||e[34]!==H||e[35]!==ie||e[36]!==U||e[37]!==z?(oe={recent:H,yours:z,others:ee,isLoading:R,isError:C,isSearching:I,hiddenMatchCount:B,hasMore:ie,isFetchingMore:E,fetchMore:U},e[28]=B,e[29]=C,e[30]=E,e[31]=R,e[32]=I,e[33]=ee,e[34]=H,e[35]=ie,e[36]=U,e[37]=z,e[38]=oe):oe=e[38],oe}function Gi(t){return t.branches}function Qi(t){const e=M.c(239),{virtualMcpId:s,isV8:a,userLabel:n,value:o,baseBranch:c,baseIsDraft:l,orgId:i,orgSlug:u,userId:d,target:h,owner:f,repo:p,sandboxMap:m,onChange:b,onCreateBranch:g,onAdoptBranch:x,disabled:j,spawnsNewChat:y,placement:v}=t,P=a===void 0?!1:a,w=l===void 0?!1:l,k=j===void 0?!1:j,N=y===void 0?!1:y,R=v===void 0?"chat":v,C=xe(),A=R==="header",[S,E]=q.useState(!1),[$,I]=q.useState(!1),[T,D]=q.useState("branches"),[Y,ae]=q.useState(null),[H,_]=q.useState(""),[z,ee]=q.useState(null),Q=q.useRef(null),{releases:B,createRelease:ie,renameRelease:U,deleteRelease:oe}=hn(s),{url:J,setUrl:se,clear:F}=ka(s),te=Ca(s),re=P&&!!te.connection,he=P?te.connection?.endpoint??null:J,G=!!he;let pe;e[0]!==F||e[1]!==P||e[2]!==te?(pe=()=>{F(),P&&te.clear()},e[0]=F,e[1]=P,e[2]=te,e[3]=pe):pe=e[3];const Z=pe;let L;e[4]!==S?(L={enabled:S},e[4]=S,e[5]=L):L=e[5];const{data:K}=Lr(L);let ce;e[6]!==K?.data?.members?(ce=ue=>ue?K?.data?.members?.find(ut=>ut.userId===ue)?.user?.name??void 0:void 0,e[6]=K?.data?.members,e[7]=ce):ce=e[7];const je=ce,fe=B.length>=zn;let Ee;e[8]!==C?(Ee=C("thread.branchPicker.capReached",{max:zn}),e[8]=C,e[9]=Ee):Ee=e[9];const O=Ee;let ne,Le,_e,Ue,mt,st,we,De,$e,Be,Pe,Me,Se,Fe,nt,pt,Re,de,V,ve,ke,Ce,Ne,qe,at,bt,gt,We,Je;if(e[10]!==fe||e[11]!==c||e[12]!==w||e[13]!==O||e[14]!==Z||e[15]!==ie||e[16]!==oe||e[17]!==k||e[18]!==H||e[19]!==A||e[20]!==G||e[21]!==re||e[22]!==x||e[23]!==b||e[24]!==g||e[25]!==S||e[26]!==z||e[27]!==B||e[28]!==U||e[29]!==se||e[30]!==C||e[31]!==d||e[32]!==n||e[33]!==o){const{isBase:ue,current:ut,unlisted:Ht}=$i({value:o,baseBranch:c,releases:B,baseIsDraft:w});Je=Ht;const W=ue?C("thread.branchPicker.live"):ut?.name??C("thread.branchPicker.defaultVersionName");Pe=re?C("thread.branchPicker.localhost.label"):G?C("thread.branchPicker.localLabel"):o?W:C("thread.branchPicker.selectVersion");const be=re?"bg-foreground":G?"bg-special":ue?"bg-success":_s(ut?.color??"orange");let me;e[63]!==Z||e[64]!==b?(me=le=>{Z(),b(le),E(!1)},e[63]=Z,e[64]=b,e[65]=me):me=e[65],Se=me;let Te;e[66]!==C?(Te=le=>{Oe.error(C("thread.branchPicker.saveError"),{description:dn(C,bs(le))})},e[66]=C,e[67]=Te):Te=e[67];const ge=Te;let At;e[68]!==se?(At=le=>{se(le),I(!1),E(!1)},e[68]=se,e[69]=At):At=e[69],st=At;let ts;e[70]!==fe||e[71]!==O||e[72]!==Z||e[73]!==ie||e[74]!==x||e[75]!==b||e[76]!==B||e[77]!==ge||e[78]!==d?(ts=(le,Ot)=>{if(Z(),x){x(le),I(!1),E(!1);return}if(!B.some(Fs=>Fs.branch===le)){if(fe){Oe.error(O);return}ie({branch:le,name:Ot.trim()||le,color:Os(B.length),createdBy:d,createdAt:new Date().toISOString()}).catch(ge)}b(le),I(!1),E(!1)},e[70]=fe,e[71]=O,e[72]=Z,e[73]=ie,e[74]=x,e[75]=b,e[76]=B,e[77]=ge,e[78]=d,e[79]=ts):ts=e[79],we=ts;let ss;e[80]!==fe||e[81]!==O||e[82]!==Z||e[83]!==ie||e[84]!==b||e[85]!==g||e[86]!==B||e[87]!==ge||e[88]!==C||e[89]!==d||e[90]!==n?(ss=()=>{if(fe){Oe.error(O);return}Z();const le=fn(n);ie({branch:le,name:Un(B,C("thread.branchPicker.defaultVersionName")),color:Os(B.length),createdBy:d,createdAt:new Date().toISOString()}).catch(ge),(g??b)(le),E(!1)},e[80]=fe,e[81]=O,e[82]=Z,e[83]=ie,e[84]=b,e[85]=g,e[86]=B,e[87]=ge,e[88]=C,e[89]=d,e[90]=n,e[91]=ss):ss=e[91],Be=ss;let ns;e[92]===Symbol.for("react.memo_cache_sentinel")?(ns=()=>{ae(null),_(""),I(!1),D("branches")},e[92]=ns):ns=e[92];const Or=ns;let as;e[93]===Symbol.for("react.memo_cache_sentinel")?(as=le=>{D(le),I(!0)},e[93]=as):as=e[93],Me=as;let rs;e[94]===Symbol.for("react.memo_cache_sentinel")?(rs=le=>{ae(le.branch),_(le.name)},e[94]=rs):rs=e[94],pt=rs;let ls;e[95]!==H||e[96]!==U||e[97]!==ge?(ls=le=>{const Ot=H.trim();Ot&&U(le,Ot).catch(ge),ae(null),_("")},e[95]=H,e[96]=U,e[97]=ge,e[98]=ls):ls=e[98],Fe=ls;let is;e[99]!==fe||e[100]!==O||e[101]!==ie||e[102]!==H||e[103]!==B.length||e[104]!==ge||e[105]!==d||e[106]!==o?(is=()=>{const le=H.trim();if(le&&o){if(fe){Oe.error(O),ae(null),_("");return}ie({branch:o,name:le,color:Os(B.length),createdBy:d,createdAt:new Date().toISOString()}).catch(ge)}ae(null),_("")},e[99]=fe,e[100]=O,e[101]=ie,e[102]=H,e[103]=B.length,e[104]=ge,e[105]=d,e[106]=o,e[107]=is):is=e[107],nt=is;let os;e[108]===Symbol.for("react.memo_cache_sentinel")?(os=()=>{ae(null),_("")},e[108]=os):os=e[108],De=os;let cs;e[109]!==c||e[110]!==oe||e[111]!==z||e[112]!==Se||e[113]!==B||e[114]!==ge||e[115]!==o?(cs=()=>{const le=z;if(ee(null),!!le){if(le.branch===o){const Ot=B.find(Fs=>Fs.branch!==le.branch);Ot?Se(Ot.branch):c?Se(c):E(!1)}else E(!1);oe(le.branch).catch(ge)}},e[109]=c,e[110]=oe,e[111]=z,e[112]=Se,e[113]=B,e[114]=ge,e[115]=o,e[116]=cs):cs=e[116],$e=cs,mt=gl,gt=S,e[117]!==k?(We=k?void 0:le=>{le||Or(),E(le)},e[117]=k,e[118]=We):We=e[118],Ue=kt,_e=Ct,bt=!0,at="inline-flex min-w-0 shrink",Le=xl,qe=!0,ne=ye,de=pl.branchPicker,V=A?"outline":"ghost",ve=A?"sm":"default",ke=Pe,Ce=k;const $s=A?"text-xs":"text-xs text-muted-foreground hover:text-foreground";e[119]!==$s?(Ne=X("shrink min-w-0 max-w-[220px] gap-2",$s,Ta),e[119]=$s,e[120]=Ne):Ne=e[120],Re=X("h-2 w-2 shrink-0 rounded-full",o||G?be:"bg-muted-foreground"),e[10]=fe,e[11]=c,e[12]=w,e[13]=O,e[14]=Z,e[15]=ie,e[16]=oe,e[17]=k,e[18]=H,e[19]=A,e[20]=G,e[21]=re,e[22]=x,e[23]=b,e[24]=g,e[25]=S,e[26]=z,e[27]=B,e[28]=U,e[29]=se,e[30]=C,e[31]=d,e[32]=n,e[33]=o,e[34]=ne,e[35]=Le,e[36]=_e,e[37]=Ue,e[38]=mt,e[39]=st,e[40]=we,e[41]=De,e[42]=$e,e[43]=Be,e[44]=Pe,e[45]=Me,e[46]=Se,e[47]=Fe,e[48]=nt,e[49]=pt,e[50]=Re,e[51]=de,e[52]=V,e[53]=ve,e[54]=ke,e[55]=Ce,e[56]=Ne,e[57]=qe,e[58]=at,e[59]=bt,e[60]=gt,e[61]=We,e[62]=Je}else ne=e[34],Le=e[35],_e=e[36],Ue=e[37],mt=e[38],st=e[39],we=e[40],De=e[41],$e=e[42],Be=e[43],Pe=e[44],Me=e[45],Se=e[46],Fe=e[47],nt=e[48],pt=e[49],Re=e[50],de=e[51],V=e[52],ve=e[53],ke=e[54],Ce=e[55],Ne=e[56],qe=e[57],at=e[58],bt=e[59],gt=e[60],We=e[61],Je=e[62];let Ae;e[121]!==Re?(Ae=r.jsx("span",{className:Re}),e[121]=Re,e[122]=Ae):Ae=e[122];let rt;e[123]!==Pe?(rt=r.jsx("span",{className:"min-w-0 truncate @max-3xl/panel-header:hidden",children:Pe}),e[123]=Pe,e[124]=rt):rt=e[124];let lt;e[125]!==k?(lt=!k&&r.jsx(Ba,{size:12,className:"opacity-60 shrink-0"}),e[125]=k,e[126]=lt):lt=e[126];let xt;e[127]!==ne||e[128]!==de||e[129]!==V||e[130]!==ve||e[131]!==ke||e[132]!==Ce||e[133]!==Ne||e[134]!==Ae||e[135]!==rt||e[136]!==lt?(xt=r.jsxs(ne,{"data-tour":de,variant:V,size:ve,"aria-label":ke,disabled:Ce,className:Ne,children:[Ae,rt,lt]}),e[127]=ne,e[128]=de,e[129]=V,e[130]=ve,e[131]=ke,e[132]=Ce,e[133]=Ne,e[134]=Ae,e[135]=rt,e[136]=lt,e[137]=xt):xt=e[137];let It;e[138]!==Le||e[139]!==qe||e[140]!==xt?(It=r.jsx(Le,{asChild:qe,children:xt}),e[138]=Le,e[139]=qe,e[140]=xt,e[141]=It):It=e[141];let vt;e[142]!==at||e[143]!==It?(vt=r.jsx("span",{className:at,children:It}),e[142]=at,e[143]=It,e[144]=vt):vt=e[144];let Xe;e[145]!==_e||e[146]!==bt||e[147]!==vt?(Xe=r.jsx(_e,{asChild:bt,children:vt}),e[145]=_e,e[146]=bt,e[147]=vt,e[148]=Xe):Xe=e[148];let Ye;e[149]!==Pe?(Ye=r.jsx(Nt,{children:Pe}),e[149]=Pe,e[150]=Ye):Ye=e[150];let Ze;e[151]!==Ue||e[152]!==Xe||e[153]!==Ye?(Ze=r.jsxs(Ue,{children:[Xe,Ye]}),e[151]=Ue,e[152]=Xe,e[153]=Ye,e[154]=Ze):Ze=e[154];let Dt;e[155]===Symbol.for("react.memo_cache_sentinel")?(Dt=ue=>{ue.preventDefault(),Q.current?.scrollIntoView({block:"nearest"})},e[155]=Dt):Dt=e[155];let it;e[156]!==N||e[157]!==C?(it=N&&r.jsx("p",{className:"px-2 pb-1.5 pt-1 text-xs text-muted-foreground",children:C("thread.branchPicker.newChatHint")}),e[156]=N,e[157]=C,e[158]=it):it=e[158];let yt;e[159]!==st||e[160]!==we||e[161]!==$||e[162]!==T||e[163]!==fe||e[164]!==De||e[165]!==O||e[166]!==Z||e[167]!==Be||e[168]!==je||e[169]!==H||e[170]!==Y||e[171]!==P||e[172]!==G||e[173]!==he||e[174]!==re||e[175]!==S||e[176]!==Me||e[177]!==i||e[178]!==u||e[179]!==f||e[180]!==Se||e[181]!==B||e[182]!==p||e[183]!==m||e[184]!==Fe||e[185]!==nt||e[186]!==te||e[187]!==pt||e[188]!==C||e[189]!==h||e[190]!==J||e[191]!==Je||e[192]!==d||e[193]!==o||e[194]!==s?(yt=$?r.jsx(Ji,{orgId:i,orgSlug:u,userId:d,target:h,owner:f,repo:p,sandboxMap:m,enabled:S,tab:T,onTabChange:D,isV8:P,localUrl:J,onSaveLocal:st,onBack:()=>I(!1),onAdopt:we}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:X("always-scrollbar flex max-h-[min(50vh,20rem)] flex-col overflow-y-auto",P&&"gap-1"),children:[!P&&G&&he&&r.jsx(Wi,{rowRef:Q,url:he,onSelect:()=>Me("local"),onEdit:()=>Me("local"),onTurnOff:()=>Z()}),Je&&o&&(Y===o?r.jsx(Qn,{value:H,onChange:_,onSave:nt,onCancel:De}):r.jsx(Wn,{rowRef:G?void 0:Q,dot:_s("orange"),label:C("thread.branchPicker.defaultVersionName"),branch:o,selected:!G,onSelect:()=>Se(o),onRename:()=>{ae(o),_(Un(B,C("thread.branchPicker.defaultVersionName")))}})),B.map(ue=>Y===ue.branch?r.jsx(Qn,{value:H,onChange:_,onSave:()=>Fe(ue.branch),onCancel:De},ue.branch):r.jsx(Wn,{rowRef:!G&&ue.branch===o?Q:void 0,dot:_s(ue.color),label:ue.name,creator:je(ue.createdBy),branch:ue.branch,selected:!G&&ue.branch===o,onSelect:()=>Se(ue.branch),onRename:()=>pt(ue),onDelete:()=>ee(ue)},ue.branch)),P&&r.jsx(_i,{virtualMcpId:s,branch:o,serve:te,rowRef:re?Q:void 0,onPicked:()=>E(!1)})]}),(Je||B.length>0||P)&&r.jsx("div",{className:"my-1 border-t"}),r.jsxs("button",{type:"button",onClick:()=>{Be()},disabled:fe,className:"flex w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[r.jsx(Oa,{className:"h-4 w-4 shrink-0"}),C("thread.branchPicker.newVersion")]}),fe&&r.jsx("p",{className:"px-2 pb-1 pt-0.5 text-xs text-warning",children:O}),r.jsxs("button",{type:"button",onClick:()=>Me("branches"),className:X("flex w-full items-center justify-between gap-2 rounded-lg px-2 py-2 text-left text-xs text-muted-foreground hover:bg-accent hover:text-foreground",P&&"mt-1"),children:[C("thread.branchPicker.advanced"),r.jsx(ua,{className:"h-4 w-4 shrink-0"})]})]}),e[159]=st,e[160]=we,e[161]=$,e[162]=T,e[163]=fe,e[164]=De,e[165]=O,e[166]=Z,e[167]=Be,e[168]=je,e[169]=H,e[170]=Y,e[171]=P,e[172]=G,e[173]=he,e[174]=re,e[175]=S,e[176]=Me,e[177]=i,e[178]=u,e[179]=f,e[180]=Se,e[181]=B,e[182]=p,e[183]=m,e[184]=Fe,e[185]=nt,e[186]=te,e[187]=pt,e[188]=C,e[189]=h,e[190]=J,e[191]=Je,e[192]=d,e[193]=o,e[194]=s,e[195]=yt):yt=e[195];let ot;e[196]!==it||e[197]!==yt?(ot=r.jsxs(vl,{className:"w-[min(300px,calc(100vw-2rem))] p-1.5",align:"start",onOpenAutoFocus:Dt,children:[it,yt]}),e[196]=it,e[197]=yt,e[198]=ot):ot=e[198];let Bt;e[199]!==mt||e[200]!==gt||e[201]!==We||e[202]!==Ze||e[203]!==ot?(Bt=r.jsxs(mt,{open:gt,onOpenChange:We,children:[Ze,ot]}),e[199]=mt,e[200]=gt,e[201]=We,e[202]=Ze,e[203]=ot,e[204]=Bt):Bt=e[204];const Mt=Bt,_t=z!==null;let $t;e[205]===Symbol.for("react.memo_cache_sentinel")?($t=ue=>{ue||ee(null)},e[205]=$t):$t=e[205];let et;e[206]!==C?(et=C("thread.branchPicker.deleteTitle"),e[206]=C,e[207]=et):et=e[207];let wt;e[208]!==et?(wt=r.jsx(Ys,{children:et}),e[208]=et,e[209]=wt):wt=e[209];let ct;e[210]!==z||e[211]!==C?(ct=z&&C("thread.branchPicker.deleteConfirm",{name:z.name}),e[210]=z,e[211]=C,e[212]=ct):ct=e[212];let Pt;e[213]!==ct?(Pt=r.jsx(Zs,{children:ct}),e[213]=ct,e[214]=Pt):Pt=e[214];let jt;e[215]!==wt||e[216]!==Pt?(jt=r.jsxs(en,{children:[wt,Pt]}),e[215]=wt,e[216]=Pt,e[217]=jt):jt=e[217];let St;e[218]!==C?(St=C("thread.branchPicker.cancel"),e[218]=C,e[219]=St):St=e[219];let ze;e[220]!==St?(ze=r.jsx(tn,{children:St}),e[220]=St,e[221]=ze):ze=e[221];let He;e[222]!==C?(He=C("thread.branchPicker.delete"),e[222]=C,e[223]=He):He=e[223];let Ke;e[224]!==$e||e[225]!==He?(Ke=r.jsx(sn,{onClick:$e,variant:"destructive",children:He}),e[224]=$e,e[225]=He,e[226]=Ke):Ke=e[226];let Ve;e[227]!==ze||e[228]!==Ke?(Ve=r.jsxs(nn,{children:[ze,Ke]}),e[227]=ze,e[228]=Ke,e[229]=Ve):Ve=e[229];let Ge;e[230]!==jt||e[231]!==Ve?(Ge=r.jsxs(an,{children:[jt,Ve]}),e[230]=jt,e[231]=Ve,e[232]=Ge):Ge=e[232];let Qe;e[233]!==_t||e[234]!==Ge?(Qe=r.jsx(rn,{open:_t,onOpenChange:$t,children:Ge}),e[233]=_t,e[234]=Ge,e[235]=Qe):Qe=e[235];let dt;return e[236]!==Mt||e[237]!==Qe?(dt=r.jsxs(r.Fragment,{children:[Mt,Qe]}),e[236]=Mt,e[237]=Qe,e[238]=dt):dt=e[238],dt}function Qn(t){const e=M.c(20),{value:s,onChange:a,onSave:n,onCancel:o}=t,c=xe();let l;e[0]!==c?(l=c("thread.branchPicker.rename"),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==a?(i=m=>a(m.target.value),e[2]=a,e[3]=i):i=e[3];let u;e[4]!==o||e[5]!==n?(u=m=>{m.key==="Enter"&&n(),m.key==="Escape"&&(m.preventDefault(),m.stopPropagation(),o())},e[4]=o,e[5]=n,e[6]=u):u=e[6];let d;e[7]!==l||e[8]!==i||e[9]!==u||e[10]!==s?(d=r.jsx("input",{autoFocus:!0,"aria-label":l,value:s,onChange:i,onKeyDown:u,className:"h-8 flex-1 rounded-md border bg-transparent px-2 text-sm focus-ring"}),e[7]=l,e[8]=i,e[9]=u,e[10]=s,e[11]=d):d=e[11];let h;e[12]!==c?(h=c("thread.branchPicker.save"),e[12]=c,e[13]=h):h=e[13];let f;e[14]!==n||e[15]!==h?(f=r.jsx(ye,{size:"sm",onClick:n,children:h}),e[14]=n,e[15]=h,e[16]=f):f=e[16];let p;return e[17]!==d||e[18]!==f?(p=r.jsxs("div",{className:"flex items-center gap-1.5 p-1",children:[d,f]}),e[17]=d,e[18]=f,e[19]=p):p=e[19],p}function Wn(t){const e=M.c(49),{rowRef:s,dot:a,label:n,creator:o,branch:c,selected:l,onSelect:i,onRename:u,onDelete:d}=t,h=xe(),f=l?"bg-accent":"hover:bg-accent";let p;e[0]!==f?(p=X("group flex items-center rounded-lg",f),e[0]=f,e[1]=p):p=e[1];let m;e[2]!==a?(m=X("h-2 w-2 shrink-0 rounded-full",a),e[2]=a,e[3]=m):m=e[3];let b;e[4]!==m?(b=r.jsx("span",{className:m}),e[4]=m,e[5]=b):b=e[5];let g;e[6]!==o?(g=o&&r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:o}),e[6]=o,e[7]=g):g=e[7];let x;e[8]!==n||e[9]!==g?(x=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[n,g]}),e[8]=n,e[9]=g,e[10]=x):x=e[10];let j;e[11]!==i||e[12]!==l||e[13]!==b||e[14]!==x?(j=r.jsx(Ct,{asChild:!0,children:r.jsxs("button",{type:"button","aria-pressed":l,onClick:i,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[b,x]})}),e[11]=i,e[12]=l,e[13]=b,e[14]=x,e[15]=j):j=e[15];let y;e[16]!==c||e[17]!==h?(y=h("thread.branchPicker.branchTooltip",{branch:c}),e[16]=c,e[17]=h,e[18]=y):y=e[18];let v;e[19]!==y?(v=r.jsx(Nt,{side:"bottom",className:"font-mono text-xs",children:y}),e[19]=y,e[20]=v):v=e[20];let P;e[21]!==j||e[22]!==v?(P=r.jsxs(kt,{children:[j,v]}),e[21]=j,e[22]=v,e[23]=P):P=e[23];let w;e[24]!==h?(w=h("thread.branchPicker.moreActions"),e[24]=h,e[25]=w):w=e[25];let k;e[26]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Ea,{className:"h-4 w-4"}),e[26]=k):k=e[26];let N;e[27]!==w?(N=r.jsx(Ps,{asChild:!0,children:r.jsx(ye,{variant:"ghost",size:"icon","aria-label":w,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:k})}),e[27]=w,e[28]=N):N=e[28];let R;e[29]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(_a,{className:"h-4 w-4"}),e[29]=R):R=e[29];let C;e[30]!==h?(C=h("thread.branchPicker.rename"),e[30]=h,e[31]=C):C=e[31];let A;e[32]!==u||e[33]!==C?(A=r.jsxs(Gt,{onSelect:u,children:[R,C]}),e[32]=u,e[33]=C,e[34]=A):A=e[34];let S;e[35]!==d||e[36]!==h?(S=d&&r.jsxs(Gt,{onSelect:d,className:"text-destructive focus:text-destructive",children:[r.jsx(Ts,{className:"h-4 w-4"}),h("thread.branchPicker.delete")]}),e[35]=d,e[36]=h,e[37]=S):S=e[37];let E;e[38]!==A||e[39]!==S?(E=r.jsxs(js,{align:"end",children:[A,S]}),e[38]=A,e[39]=S,e[40]=E):E=e[40];let $;e[41]!==N||e[42]!==E?($=r.jsxs(Ss,{children:[N,E]}),e[41]=N,e[42]=E,e[43]=$):$=e[43];let I;return e[44]!==s||e[45]!==P||e[46]!==$||e[47]!==p?(I=r.jsxs("div",{ref:s,className:p,children:[P,$]}),e[44]=s,e[45]=P,e[46]=$,e[47]=p,e[48]=I):I=e[48],I}function Wi(t){const e=M.c(40),{rowRef:s,url:a,onSelect:n,onEdit:o,onTurnOff:c}=t,l=xe();let i;try{let A;e[0]!==a?(A=new URL(a),e[0]=a,e[1]=A):A=e[1],i=A.host}catch{i=a}const u=i;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-special"}),e[2]=d):d=e[2];let h;e[3]!==l?(h=l("thread.branchPicker.localLabel"),e[3]=l,e[4]=h):h=e[4];let f;e[5]!==u?(f=r.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground/70",children:u}),e[5]=u,e[6]=f):f=e[6];let p;e[7]!==h||e[8]!==f?(p=r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[h,f]}),e[7]=h,e[8]=f,e[9]=p):p=e[9];let m;e[10]!==n||e[11]!==p?(m=r.jsxs("button",{type:"button","aria-pressed":!0,onClick:n,className:"flex min-w-0 flex-1 items-center gap-2.5 px-2 py-2 text-left text-sm",children:[d,p]}),e[10]=n,e[11]=p,e[12]=m):m=e[12];let b;e[13]!==l?(b=l("thread.branchPicker.moreActions"),e[13]=l,e[14]=b):b=e[14];let g;e[15]===Symbol.for("react.memo_cache_sentinel")?(g=r.jsx(Ea,{className:"h-4 w-4"}),e[15]=g):g=e[15];let x;e[16]!==b?(x=r.jsx(Ps,{asChild:!0,children:r.jsx(ye,{variant:"ghost",size:"icon","aria-label":b,className:"mr-1 h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100",children:g})}),e[16]=b,e[17]=x):x=e[17];let j;e[18]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(_a,{className:"h-4 w-4"}),e[18]=j):j=e[18];let y;e[19]!==l?(y=l("thread.branchPicker.rename"),e[19]=l,e[20]=y):y=e[20];let v;e[21]!==o||e[22]!==y?(v=r.jsxs(Gt,{onSelect:o,children:[j,y]}),e[21]=o,e[22]=y,e[23]=v):v=e[23];let P;e[24]===Symbol.for("react.memo_cache_sentinel")?(P=r.jsx(Ts,{className:"h-4 w-4"}),e[24]=P):P=e[24];let w;e[25]!==l?(w=l("thread.branchPicker.localTurnOff"),e[25]=l,e[26]=w):w=e[26];let k;e[27]!==c||e[28]!==w?(k=r.jsxs(Gt,{onSelect:c,className:"text-destructive focus:text-destructive",children:[P,w]}),e[27]=c,e[28]=w,e[29]=k):k=e[29];let N;e[30]!==v||e[31]!==k?(N=r.jsxs(js,{align:"end",children:[v,k]}),e[30]=v,e[31]=k,e[32]=N):N=e[32];let R;e[33]!==N||e[34]!==x?(R=r.jsxs(Ss,{children:[x,N]}),e[33]=N,e[34]=x,e[35]=R):R=e[35];let C;return e[36]!==s||e[37]!==R||e[38]!==m?(C=r.jsxs("div",{ref:s,className:"group flex items-center rounded-lg bg-accent",children:[m,R]}),e[36]=s,e[37]=R,e[38]=m,e[39]=C):C=e[39],C}function Ji(t){const e=M.c(73),{orgId:s,orgSlug:a,userId:n,target:o,owner:c,repo:l,sandboxMap:i,enabled:u,tab:d,onTabChange:h,isV8:f,localUrl:p,onSaveLocal:m,onBack:b,onAdopt:g}=t,x=xe(),[j,y]=q.useState(""),v=d==="branches"?j:"",P=u&&d==="branches";let w;e[0]!==s||e[1]!==a||e[2]!==c||e[3]!==l||e[4]!==i||e[5]!==v||e[6]!==P||e[7]!==o||e[8]!==n?(w={orgId:s,orgSlug:a,userId:n,target:o,sandboxMap:i,owner:c,repo:l,search:v,enabled:P},e[0]=s,e[1]=a,e[2]=c,e[3]=l,e[4]=i,e[5]=v,e[6]=P,e[7]=o,e[8]=n,e[9]=w):w=e[9];const{recent:k,yours:N,others:R,isLoading:C,hasMore:A,isFetchingMore:S,fetchMore:E}=Vi(w),$=u&&d==="prs";let I;e[10]!==s||e[11]!==a||e[12]!==c||e[13]!==l||e[14]!==$||e[15]!==o?(I={orgId:s,orgSlug:a,target:o,owner:c,repo:l,enabled:$},e[10]=s,e[11]=a,e[12]=c,e[13]=l,e[14]=$,e[15]=o,e[16]=I):I=e[16];const{data:T,isLoading:D}=Dl(I);let Y;if(e[17]!==E||e[18]!==A||e[19]!==S||e[20]!==C||e[21]!==f||e[22]!==p||e[23]!==g||e[24]!==b||e[25]!==m||e[26]!==h||e[27]!==R||e[28]!==c||e[29]!==D||e[30]!==k||e[31]!==l||e[32]!==j||e[33]!==x||e[34]!==T||e[35]!==d||e[36]!==N){const ae=T===void 0?[]:T,H=`${c}/${l}`;let _;e[38]!==H?(_=H.toLowerCase(),e[38]=H,e[39]=_):_=e[39];const z=_;let ee;e[40]!==z?(ee=L=>L.headRepoFullName?.toLowerCase()===z,e[40]=z,e[41]=ee):ee=e[41];const Q=ae.filter(ee);let B;if(e[42]!==R||e[43]!==k||e[44]!==N){const L=new Set;B=[...k,...N,...R].filter(K=>L.has(K.name)?!1:(L.add(K.name),!0)),e[42]=R,e[43]=k,e[44]=N,e[45]=B}else B=e[45];const ie=B;let U;e[46]===Symbol.for("react.memo_cache_sentinel")?(U=r.jsx(jl,{className:"h-4 w-4 shrink-0"}),e[46]=U):U=e[46];let oe;e[47]!==x?(oe=x("thread.branchPicker.advancedBack"),e[47]=x,e[48]=oe):oe=e[48];let J;e[49]!==b||e[50]!==oe?(J=r.jsxs("button",{type:"button",onClick:b,className:"flex items-center gap-1.5 px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground",children:[U,oe]}),e[49]=b,e[50]=oe,e[51]=J):J=e[51];let se;e[52]!==h?(se=L=>{h(L),y("")},e[52]=h,e[53]=se):se=e[53];let F;e[54]!==x?(F=x("thread.branchPicker.branchesTab"),e[54]=x,e[55]=F):F=e[55];let te;e[56]!==F?(te=r.jsx(Lt,{value:"branches",className:"h-6 px-2.5 text-xs",children:F}),e[56]=F,e[57]=te):te=e[57];let re;e[58]!==x?(re=x("thread.branchPicker.prsTab"),e[58]=x,e[59]=re):re=e[59];let he;e[60]!==re?(he=r.jsx(Lt,{value:"prs",className:"h-6 px-2.5 text-xs",children:re}),e[60]=re,e[61]=he):he=e[61];let G;e[62]!==f||e[63]!==x?(G=!f&&r.jsx(Lt,{value:"local",className:"h-6 px-2.5 text-xs",children:x("thread.branchPicker.localTab")}),e[62]=f,e[63]=x,e[64]=G):G=e[64];let pe;e[65]!==te||e[66]!==he||e[67]!==G?(pe=r.jsxs(Ia,{className:"h-auto w-fit justify-start gap-1 bg-accent p-1",variant:"pill",children:[te,he,G]}),e[65]=te,e[66]=he,e[67]=G,e[68]=pe):pe=e[68];let Z;e[69]!==se||e[70]!==pe||e[71]!==d?(Z=r.jsx(Da,{className:"px-2 pt-2 pb-1",value:d,onValueChange:se,children:pe}),e[69]=se,e[70]=pe,e[71]=d,e[72]=Z):Z=e[72],Y=r.jsxs("div",{className:"flex flex-col",children:[J,Z,d==="local"&&!f?r.jsx(Ei,{url:p,onSave:m}):r.jsxs(yl,{filter:d==="branches"?Xi:void 0,children:[r.jsx(wl,{placeholder:x(d==="branches"?"thread.branchPicker.searchBranches":"thread.branchPicker.searchPullRequests"),value:j,onValueChange:y}),r.jsx(Pl,{onScroll:L=>{const K=L.currentTarget;d==="branches"&&K.scrollHeight-K.scrollTop-K.clientHeight<48&&E()},children:d==="branches"?r.jsxs(r.Fragment,{children:[C&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingMore")}),!C&&ie.length===0&&r.jsx(_n,{children:x("thread.branchPicker.noBranchesFound")}),ie.length>0&&r.jsx(On,{children:ie.map(L=>r.jsxs(Ln,{value:L.name,className:"cursor-pointer",onSelect:()=>g(L.name,L.name),children:[r.jsx(Ur,{className:"mr-2 h-4 w-4 shrink-0"}),r.jsx("span",{className:"flex-1 truncate",children:L.name})]},L.name))}),A&&r.jsx("div",{className:"p-2",children:r.jsx(ye,{variant:"ghost",size:"sm",className:"h-7 w-full text-xs",disabled:S,onClick:E,children:x(S?"thread.branchPicker.loadingMore":"thread.branchPicker.loadMoreBranches")})})]}):r.jsxs(r.Fragment,{children:[D&&r.jsx("div",{className:"p-3 text-xs text-muted-foreground",children:x("thread.branchPicker.loadingPullRequests")}),!D&&Q.length===0&&r.jsx(_n,{children:x("thread.branchPicker.noOpenPullRequests")}),Q.length>0&&r.jsx(On,{children:Q.map(L=>r.jsxs(Ln,{value:`#${L.number} ${L.title} ${L.head}`,className:"cursor-pointer",onSelect:()=>g(L.head,Gn(L.title)),children:[r.jsx(Rs,{className:"mr-2 h-4 w-4 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"truncate",children:Gn(L.title)}),r.jsxs("span",{className:"truncate text-xs text-muted-foreground",children:["#",L.number," · ",L.head]})]})]},L.number))})]})})]})]}),e[17]=E,e[18]=A,e[19]=S,e[20]=C,e[21]=f,e[22]=p,e[23]=g,e[24]=b,e[25]=m,e[26]=h,e[27]=R,e[28]=c,e[29]=D,e[30]=k,e[31]=l,e[32]=j,e[33]=x,e[34]=T,e[35]=d,e[36]=N,e[37]=Y}else Y=e[37];return Y}function Xi(t,e){return Ks(t,e)?1:0}function Yi(t){const e=M.c(19),{locked:s,placement:a,value:n,virtualMcpId:o,isV8:c,userLabel:l,baseBranch:i,baseIsDraft:u,onChange:d,onCreateBranch:h,onAdoptBranch:f,orgId:p,orgSlug:m,userId:b,target:g,owner:x,repo:j,sandboxMap:y}=t;let v;return e[0]!==i||e[1]!==u||e[2]!==c||e[3]!==s||e[4]!==f||e[5]!==d||e[6]!==h||e[7]!==p||e[8]!==m||e[9]!==x||e[10]!==a||e[11]!==j||e[12]!==y||e[13]!==g||e[14]!==b||e[15]!==l||e[16]!==n||e[17]!==o?(v=r.jsx(Qi,{virtualMcpId:o,isV8:c,userLabel:l,value:n,baseBranch:i,baseIsDraft:u,orgId:p,orgSlug:m,userId:b,target:g,owner:x,repo:j,sandboxMap:y,onChange:d,onCreateBranch:h,onAdoptBranch:f,spawnsNewChat:s,placement:a}),e[0]=i,e[1]=u,e[2]=c,e[3]=s,e[4]=f,e[5]=d,e[6]=h,e[7]=p,e[8]=m,e[9]=x,e[10]=a,e[11]=j,e[12]=y,e[13]=g,e[14]=b,e[15]=l,e[16]=n,e[17]=o,e[18]=v):v=e[18],v}function Zi(t){const e=M.c(2),{branchPill:s}=t;if(!s)return null;let a;return e[0]!==s?(a=r.jsx(r.Fragment,{children:s}),e[0]=s,e[1]=a):a=e[1],a}function eo(t){const e=M.c(25),{virtualMcp:s,currentBranch:a}=t,n=nl(),o=Zt();let c;e[0]!==n?.messages||e[1]!==o?.isThreadLocked?(c=(n?.messages??[]).length>0||(o?.isThreadLocked??!1),e[0]=n?.messages,e[1]=o?.isThreadLocked,e[2]=c):c=e[2];const l=c,i=o?.setCurrentTaskBranch,u=o?.createTask;let d;e[3]!==o?.activeTask?.metadata||e[4]!==s?.metadata?(d=Nl(s?.metadata)==="cms"&&qn(o?.activeTask?.metadata,s?.metadata)==="sandbox",e[3]=o?.activeTask?.metadata,e[4]=s?.metadata,e[5]=d):d=e[5];const h=d,f=Al(s),p=tt(f),{data:m}=ks.useSession(),b=m?.user;let g;e[6]!==b?(g=mn(b),e[6]=b,e[7]=g):g=e[7];const x=g,j=m?.user?.id??"",{org:y}=Cs(),v=Bl(s,a),P=Va(s?.id);let w;e[8]!==P||e[9]!==o?.activeTask?.metadata||e[10]!==s?.metadata?(w=P==="v8"&&qn(o?.activeTask?.metadata,s?.metadata)==="cms",e[8]=P,e[9]=o?.activeTask?.metadata,e[10]=s?.metadata,e[11]=w):w=e[11];const k=w;let N;e[12]!==u||e[13]!==l||e[14]!==i?(N=T=>{l&&u?u({branch:T}):i&&i(T)},e[12]=u,e[13]=l,e[14]=i,e[15]=N):N=e[15];const R=N;let C;e[16]!==h||e[17]!==u||e[18]!==l||e[19]!==i?(C=T=>{(l||h)&&u?u({branch:T}):i&&i(T)},e[16]=h,e[17]=u,e[18]=l,e[19]=i,e[20]=C):C=e[20];const A=C;let S;e[21]!==u?(S=u?T=>u({runtime:"sandbox",branch:T}):void 0,e[21]=u,e[22]=S):S=e[22];const E=S,$=f&&La(p)?r.jsx(Yi,{userLabel:x,virtualMcpId:s?.id??"",isV8:P==="v8",value:a,baseBranch:v,baseIsDraft:k,orgId:y.id,orgSlug:y.slug,userId:j,target:p,owner:f.owner,repo:f.name,sandboxMap:s?.metadata?.sandboxMap,onChange:R,onCreateBranch:A,onAdoptBranch:E,locked:l,placement:"chat"},`${Ua(p)}:${f.owner}/${f.name}`):null;let I;return e[23]!==$?(I=r.jsx(Zi,{branchPill:$}),e[23]=$,e[24]=I):I=e[24],I}const to=qr("flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function so(t){const e=M.c(11);let s,a,n;e[0]!==t?({className:s,orientation:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==s||e[5]!==a?(o=X(to({orientation:a}),s),e[4]=s,e[5]=a,e[6]=o):o=e[6];let c;return e[7]!==a||e[8]!==n||e[9]!==o?(c=r.jsx("div",{role:"group","data-slot":"button-group","data-orientation":a,className:o,...n}),e[7]=a,e[8]=n,e[9]=o,e[10]=c):c=e[10],c}function no(t){const e=M.c(14),{item:s}=t;let a;e[0]!==s?(a=()=>{s.onSelect()},e[0]=s,e[1]=a):a=e[1];let n;e[2]!==s.disabled||e[3]!==s.icon||e[4]!==s.label||e[5]!==a?(n=r.jsxs(Gt,{disabled:s.disabled,onSelect:a,children:[s.icon,s.label]}),e[2]=s.disabled,e[3]=s.icon,e[4]=s.label,e[5]=a,e[6]=n):n=e[6];const o=n;if(!s.tooltip)return o;let c;e[7]!==o?(c=r.jsx(Ct,{asChild:!0,children:o}),e[7]=o,e[8]=c):c=e[8];let l;e[9]!==s.tooltip?(l=r.jsx(Nt,{side:"right",children:s.tooltip}),e[9]=s.tooltip,e[10]=l):l=e[10];let i;return e[11]!==c||e[12]!==l?(i=r.jsxs(kt,{children:[c,l]}),e[11]=c,e[12]=l,e[13]=i):i=e[13],i}function lr(t){const e=M.c(20),{label:s,onClick:a,variant:n,size:o,disabled:c,loading:l,pulse:i,tooltip:u,icon:d,items:h,menuAriaLabel:f,className:p}=t,m=n===void 0?"default":n,b=o===void 0?"default":o,g=c===void 0?!1:c,x=l===void 0?!1:l,j=i===void 0?!1:i,y=(h?.length??0)>0;let v;if(e[0]!==p||e[1]!==g||e[2]!==y||e[3]!==d||e[4]!==h||e[5]!==s||e[6]!==x||e[7]!==f||e[8]!==a||e[9]!==j||e[10]!==b||e[11]!==u||e[12]!==m){const P=X(Ta,m==="default"&&"focus-visible:inset-ring-current");let w;e[14]!==d||e[15]!==x?(w=x?r.jsx(Qt,{size:"xs"}):d,e[14]=d,e[15]=x,e[16]=w):w=e[16];const k=r.jsxs(ye,{type:"button",variant:m,size:b,disabled:g,"aria-busy":x||void 0,onClick:x?void 0:a,className:X(P,y&&"rounded-r-none border-r border-current/20"),children:[w,s]}),N=j&&"animate-pulse-brightness motion-reduce:animate-none motion-reduce:opacity-80";let R;e[17]!==p||e[18]!==N?(R=X(N,p),e[17]=p,e[18]=N,e[19]=R):R=e[19],v=r.jsxs(so,{className:R,children:[u?r.jsxs(kt,{children:[r.jsx(Ct,{asChild:!0,children:r.jsx("span",{className:X("inline-flex rounded-lg outline-none",P,g&&"cursor-not-allowed"),tabIndex:g?0:void 0,role:g?"button":void 0,"aria-disabled":g||void 0,children:k})}),r.jsx(Nt,{children:u})]}):k,y?r.jsxs(Ss,{children:[r.jsx(Ps,{asChild:!0,children:r.jsx(ye,{type:"button",variant:m,size:b,"aria-label":f,className:X("has-[>svg]:px-2",P),children:r.jsx(Ba,{className:"size-3.5"})})}),r.jsx(js,{align:"end",children:h?.map(ao)})]}):null]}),e[0]=p,e[1]=g,e[2]=y,e[3]=d,e[4]=h,e[5]=s,e[6]=x,e[7]=f,e[8]=a,e[9]=j,e[10]=b,e[11]=u,e[12]=m,e[13]=v}else v=e[13];return v}function ao(t){return r.jsx(no,{item:t},t.key)}async function ro(t){if(t.hosted)return;const e=t.branch;await t.setCurrentTaskBranch(t.nextBranch()),e&&e!==t.baseBranch&&await t.deleteRelease(e)}function lo(t,e,{hosted:s}){return s&&t!==null?t:e}function io(t,e){const s=M.c(11),[a,n]=q.useState(null);let o;s[0]!==a||s[1]!==t||s[2]!==e?(o=lo(a,t,e),s[0]=a,s[1]=t,s[2]=e,s[3]=o):o=s[3];let c;s[4]!==t||s[5]!==e?(c=()=>n(e.hosted?t:null),s[4]=t,s[5]=e,s[6]=c):c=s[6];let l;s[7]===Symbol.for("react.memo_cache_sentinel")?(l=()=>n(null),s[7]=l):l=s[7];let i;return s[8]!==o||s[9]!==c?(i={shown:o,hold:c,release:l},s[8]=o,s[9]=c,s[10]=i):i=s[10],i}function oo({open:t,hosted:e}){return t||e}function ir(t){return Ds({userName:t?.name,userEmail:t?.email})??void 0}function Bs(t){const e=M.c(18),{state:s,header:a,body:n,note:o,gate:c,footer:l}=t,i=s!=="ready";let u;e[0]!==a?(u=r.jsx("div",{className:"space-y-0.5 px-4 py-3",children:a}),e[0]=a,e[1]=u):u=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=r.jsx("div",{className:"border-t"}),e[2]=d):d=e[2];let h;e[3]!==o?(h=o?r.jsx("div",{className:"space-y-1.5 border-t px-4 py-3",children:o}):null,e[3]=o,e[4]=h):h=e[4];let f;e[5]!==n||e[6]!==h?(f=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n,h]}),e[5]=n,e[6]=h,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx("div",{className:"border-t"}),e[8]=p):p=e[8];let m;e[9]!==l?(m=r.jsx("div",{className:"space-y-2 px-4 py-3",children:l}),e[9]=l,e[10]=m):m=e[10];let b;return e[11]!==c||e[12]!==s||e[13]!==i||e[14]!==u||e[15]!==f||e[16]!==m?(b=r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col","data-publish-state":s,"aria-busy":i,children:[u,d,f,c,p,m]}),e[11]=c,e[12]=s,e[13]=i,e[14]=u,e[15]=f,e[16]=m,e[17]=b):b=e[17],b}function Yt(t){const e=M.c(2),{children:s}=t;let a;return e[0]!==s?(a=r.jsx("div",{className:"scroll-fade min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain px-4 pt-3 pb-2 [scrollbar-width:thin]",children:s}),e[0]=s,e[1]=a):a=e[1],a}function or(t){const e=M.c(10);let s,a,n;e[0]!==t?({className:a,children:s,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);let o;e[4]!==a?(o=X("rounded-lg border bg-card px-3 py-2.5",a),e[4]=a,e[5]=o):o=e[5];let c;return e[6]!==s||e[7]!==n||e[8]!==o?(c=r.jsx("div",{className:o,...n,children:s}),e[6]=s,e[7]=n,e[8]=o,e[9]=c):c=e[9],c}function ft(t){const e=M.c(4),{className:s}=t;let a;e[0]!==s?(a=X("animate-pulse rounded bg-muted motion-reduce:animate-none",s),e[0]=s,e[1]=a):a=e[1];let n;return e[2]!==a?(n=r.jsx("div",{className:a}),e[2]=a,e[3]=n):n=e[3],n}function Ut(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(or,{children:r.jsxs("div",{className:"flex items-center gap-2.5",children:[r.jsx(ft,{className:"size-4 rounded-md"}),r.jsx(ft,{className:"h-3 w-24"}),r.jsx(ft,{className:"h-2.5 w-16"}),r.jsx(ft,{className:"ml-auto size-6 rounded"})]})}),t[0]=e):e=t[0],e}async function co(t,e,s){const a=Ds(s.coAuthor),{changeRequest:n}=await Xs(t,"CHANGE_REQUEST_OPEN",{...e,head:s.branch,base:s.base,title:s.title,body:Mi(s.body,a)||void 0});return{number:n.number,htmlUrl:n.url}}class cr extends Error{reason;detail;constructor(e,s){super(s||`Merge refused: ${e}`),this.name="ChangeRequestMergeRefused",this.reason=e,this.detail=s}}async function dr(t,e,s){const a=Ds(s.coAuthor),n=a?rr(s.commitMessage?.trim()??"",a):s.commitMessage?.trim()||void 0,o=await Xs(t,"CHANGE_REQUEST_MERGE",{...e,number:s.number,strategy:"squash",commitTitle:s.commitTitle,commitMessage:n});if(!o.merged)throw new cr(o.reason??"error",o.detail)}function uo(t,e){switch(t){case"conflict":return e("thread.mergeRefused.conflict");case"blocked":return e("thread.mergeRefused.blocked");case"rate_limited":return e("thread.mergeRefused.rateLimited");case"not_found":return e("thread.mergeRefused.notFound");default:return e("thread.mergeRefused.error")}}class Vs extends Error{constructor(){super("The branch changed since these changes were shown"),this.name="PublishHeadMovedError"}}class kn extends Error{constructor(e,s,a){super(e),this.step=s,this.pr=a,this.name="PublishStepError"}step;pr}const vs=255;function ur(t){if(t.length<=vs)return t;const e=t.slice(0,vs-1),s=e.lastIndexOf(" ");return`${(s>0?e.slice(0,s):e).trimEnd()}…`}function ho(t){const e=t.title.trim(),s=t.body.trim(),a=[e,s].filter(Boolean).join(`
6
+
7
+ `);if(e.length>vs)return{title:ur(e),body:a,message:a};const n=e||t.fallbackTitle;return{title:n,body:s||void 0,message:a||n}}function fo(t,e){const s=t.trim().split(`
8
+ `);return ho({title:s[0]??"",body:s.slice(1).join(`
9
+ `),fallbackTitle:e})}function ys(t){return{orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:t.threadId}}function mo(t){return t.fastPreview?{fastPreview:!0}:void 0}async function Us(t,e,s){try{return await s()}catch(a){throw new kn(a instanceof Error?a.message:e,t)}}async function hr(t){const{expectedHeadSha:e,expectedDiffSignature:s}=t;if(!e&&!s)return;const a=await yn(ys(t)).catch(()=>null);if(!a)return;if(e&&a.headSha&&a.headSha!==e)throw new Vs;if(!s)return;const n=await Xa(ys(t),a,t.baseBranch,mo(t)).catch(()=>null);if(n&&Is(n)!==s)throw new Vs}function fr(t,e){return ui(ys(t),e)}function mr(t,e){return co(t.orgSlug,t.target,{branch:t.headBranch,title:e.title,body:e.body,base:t.baseBranch,coAuthor:t.coAuthor})}async function po(t,e,s){await hr(t),await Us("push",s("thread.publishDialog.failedPushChanges"),()=>fr(t,e.message)),await Us("sync",s("thread.publishDialog.failedRebase"),()=>Ya(ys(t),t.baseBranch));const a=await Us("open-pr",s("thread.publishDialog.failedOpenPullRequest"),()=>mr(t,e));try{await dr(t.orgSlug,t.target,{number:a.number,commitTitle:e.title,commitMessage:e.body,coAuthor:t.coAuthor})}catch(n){throw new kn(n instanceof Error?n.message:s("thread.publishDialog.failedMergePullRequest"),"merge",a)}return a}async function bo(t,e){return await hr(t),await fr(t,e.message),mr(t,e)}function Jn(t,e){return t instanceof Vs?{message:e("siteEditor.publish.changedMeanwhile"),pullRequest:null,headMoved:!0}:t instanceof kn&&t.step==="merge"&&t.pr?{message:e("thread.publishDialog.mergeFailed",{prNumber:t.pr.number,message:t.message}),pullRequest:t.pr,headMoved:!1}:{message:t instanceof Error?t.message:e("thread.publishDialog.failedPublish"),pullRequest:null,headMoved:!1}}function go(t,e){Oe.success(e("thread.publishDialog.submittedForReview",{prNumber:t.number}),{action:{label:e("thread.publishDialog.viewOnProvider"),onClick:()=>window.open(t.htmlUrl,"_blank","noopener,noreferrer")}})}function pr(t){return t.kind!=="block"?null:t.namedRule??null}function xo(t,e){const s=e.find(a=>a&&typeof a=="object");return s?zl(s.__resolveType):Wa(t)}const vo=/(?:^|\/)\.deco\/blocks\/([^/]+)\.json$/;function Cn(t){const e=vo.exec(t)?.[1];return e?wi(e):null}function ws(t){if(!t)return null;try{const e=JSON.parse(t);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return null}function yo(t,e){return t===null?"new":e===null?"removed":"edited"}function br(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim();return e?(e.charAt(0).toUpperCase()+e.slice(1)).replace(/\s+[A-Z](?=[a-z])/g,s=>s.toLowerCase()):t}function Vt(t,e,s=!1){if(t&&typeof t=="object"&&!Array.isArray(t)){const a=t.__resolveType;if(typeof a=="string"&&a.trim()){if(s)return zr(a);const o=(a.split("/").pop()??a).replace(/\.[jt]sx?$/,"");return br(o)||o}}return`Section ${e+1}`}function Nn(t){if(ha(t))return t.value??null;const e=t.__resolveType;return typeof e=="string"&&Hr(e)?t.section??null:null}const gr=6;function ms(t,e=0){if(e>gr||!t||typeof t!="object")return[];if(Array.isArray(t))return t.flatMap(n=>ms(n,e+1));const s=t;if(ln(s.__resolveType))return Gs(s).flatMap(n=>ms(n?.value,e+1));const a=Nn(s);return a!==null?ms(a,e+1):[s]}function Gs(t){const e=t?.variants;return Array.isArray(e)?e.map(s=>s&&typeof s=="object"&&!Array.isArray(s)?s:null):[]}function Xn(t){let e=t;for(let s=0;s<gr;s++){if(!e||typeof e!="object"||Array.isArray(e))return null;const a=e;if(ln(a.__resolveType))return a;const n=Nn(a);if(n===null)return null;e=n}return null}function wo(t,e,s){const a=Gs(Xn(t)),n=e?Gs(Xn(e)):[],o=e?Array.from({length:Math.max(a.length,n.length)},(i,u)=>u).filter(i=>!Ms(a[i],n[i])):[],l=[...o.map(i=>a[i]??n[i]),...a.filter((i,u)=>!o.includes(u))].flatMap(i=>ms(i?.value)).map(i=>Vt(i,s,!0));return[...new Set(l)]}function qs(t,e,s,a,n){let o=t,c=!1;for(let i=0;i<4;i++){if(!o||typeof o!="object"||Array.isArray(o)){c=!0;break}const u=o;if(ln(u.__resolveType)){c=!0;break}const d=Nn(u);if(d===null)break;o=d}const l=c?wo(t,n,e):[];return{name:Vt(c?t:o,e,!0),kind:"section",status:s,fields:a,...c?{wrapper:!0}:{},...l.length>0?{held:l}:{}}}function Qs(t,e){const s=t.sections;if(Array.isArray(s))return s.flatMap((a,n)=>a&&typeof a=="object"&&!Array.isArray(a)?[{section:a,basePath:["sections",n]}]:[]);if(s&&typeof s=="object"){const a=s.variants;if(Array.isArray(a))return a.flatMap((n,o)=>{const c=n&&typeof n=="object"&&!Array.isArray(n)?n.value:null,l=e&&ha(c),i=l?c.value:c;if(!Array.isArray(i))return[];const u=l?["sections","variants",o,"value","value"]:["sections","variants",o,"value"];return i.flatMap((d,h)=>d&&typeof d=="object"&&!Array.isArray(d)?[{section:d,basePath:[...u,h]}]:[])})}return[]}function Yn(t){return JSON.stringify(t,(e,s)=>{if(s&&typeof s=="object"&&!Array.isArray(s)){const a=s;return Object.keys(a).sort().reduce((n,o)=>(n[o]=a[o],n),{})}return s})}function Ms(t,e){return t===void 0&&e===void 0?!0:Yn(t)===Yn(e)}function Wt(t,e,s,a=new Set){const n=new Set([...Object.keys(t??{}),...Object.keys(e??{})]),o=[];for(const c of n){if(c.startsWith("__")||a.has(c))continue;const l=t?t[c]:void 0,i=e?e[c]:void 0;Ms(l,i)||o.push({label:br(c),path:[...s,c],from:l,to:i})}return o}const Po=new Set(["sections"]);function An(t,e,s=!1){const a=t?Qs(t,s):[],n=e?Qs(e,s):[],o=[],c=Math.max(a.length,n.length);for(let i=0;i<c;i++){const u=a[i],d=n[i];if(!s){const h=jo(u,d,i);h&&o.push(h);continue}if(u&&d){if(Ms(u.section,d.section))continue;o.push(qs(d.section,i,"edited",Wt(u.section,d.section,d.basePath),u.section))}else d?o.push(qs(d.section,i,"new",[])):u&&o.push(qs(u.section,i,"removed",[]))}const l=Wt(t,e,[],Po);return l.length>0&&o.push({name:"Page settings",kind:"settings",status:"edited",fields:l}),o}function jo(t,e,s){return t&&e?Ms(t.section,e.section)?null:{name:Vt(e.section,s),kind:"section",status:"edited",fields:Wt(t.section,e.section,e.basePath)}:e?{name:Vt(e.section,s),kind:"section",status:"new",fields:[]}:t?{name:Vt(t.section,s),kind:"section",status:"removed",fields:[]}:null}function Ws(t,e){return{kind:"other",blockKey:null,name:t.split("/").pop()??t,pagePath:null,isSiteApp:!1,status:e,filepaths:[t],sections:[],fromJson:null,toJson:null}}function So(t){const e=[],s=[],a=[],n=[];for(const[o,c]of Object.entries(t?.diffs??{})){if(wn(o)){n.push(o);continue}const l=yo(c.from,c.to),i=Cn(o);if(!i){a.push(Ws(o,l));continue}const u=ws(c.from),d=ws(c.to),h=d??u;if(!h){a.push(Ws(o,l));continue}const f=Kt(i,h);if(f){e.push({kind:"page",blockKey:i,name:f.name,pagePath:f.path,isSiteApp:!1,status:l,filepaths:[o],sections:l==="edited"?An(u,d):[],fromJson:u,toJson:d});continue}const p=gn(i,h);s.push({kind:"block",blockKey:i,name:gs(i,h),pagePath:null,isSiteApp:p,status:l,filepaths:[o],sections:l==="edited"?[{name:gs(i,h),kind:"section",status:"edited",fields:Wt(u,d,[])}].filter(m=>m.fields.length>0):[],fromJson:u,toJson:d})}return xr({pages:e,blocks:s,other:a,generated:n})}function zs(t,e){return(t.filepaths[0]??"").localeCompare(e.filepaths[0]??"")}function xr(t){const{pages:e,blocks:s,other:a,generated:n}=t;return e.sort(zs),s.sort(zs),a.sort(zs),{pages:e,blocks:s,other:a,generated:n,count:e.length+s.length+a.length}}function ko(t){return t==="added"?"new":t==="removed"?"removed":"edited"}function vr(t){return t.startsWith("pages-")}function yr(t){const{files:e,lookup:s,diff:a}=t,n=[],o=[],c=[],l=[];for(const i of e){const u=i.path;if(wn(u)){l.push(u);continue}const d=ko(i.status),h=Cn(u);if(!h){c.push(Ws(u,d));continue}const f=a?.diffs[u],p=ws(f?.from??null),m=ws(f?.to??null),b=wr(s,h),g=b??m??p;if((b?Kt(h,b):null)??(!b&&vr(h))){const y=g?Kt(h,g):null;n.push({kind:"page",blockKey:h,name:y?.name??Qa(h),pagePath:y?.path??null,isSiteApp:!1,status:d,filepaths:[u],sections:d==="edited"?An(p,m):[],fromJson:p,toJson:m??(d==="new"?b:null)});continue}const j=gs(h,g??{});o.push({kind:"block",blockKey:h,name:j,pagePath:null,isSiteApp:gn(h,b??{}),status:d,filepaths:[u],sections:d==="edited"?[{name:j,kind:"section",status:"edited",fields:Wt(p,m,[])}].filter(y=>y.fields.length>0):[],fromJson:p,toJson:m})}return xr({pages:n,blocks:o,other:c,generated:l})}function wr(t,e){const s=t?.[e];return s&&typeof s=="object"&&!Array.isArray(s)?s:null}function Co(t,e){return t??e}function Pr(t){return t.length<=1?t[0]??"":`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}const Hs=3;function ds(t){if(t.length<=Hs)return Pr(t);const e=t.length-Hs;return`${t.slice(0,Hs).join(", ")} and ${e} more`}function No(t,e){if(!e){const a=t.sections.filter(n=>n.kind==="section").map(n=>n.name).slice(0,3);return a.length>0?`${t.name} (${a.join(", ")})`:t.name}const s=[...new Set(t.sections.filter(a=>a.kind==="section").flatMap(a=>a.wrapper?a.held??[]:[a.name]))].slice(0,3);return s.length>0?`${t.name} (${s.join(", ")})`:t.name}function Ao(t){const e=pr(t);return e==="experiments"?"A/B tests":e==="campaigns"?"Campaign dates":t.name}function Ro(t){const e=[],s=t.pages.filter(l=>l.status==="edited"),a=t.pages.filter(l=>l.status==="new"),n=t.pages.filter(l=>l.status==="removed");if(s.length>0&&e.push(`updated ${ds(s.map(l=>No(l,!!t.v8)))}`),a.length>0){const l=a.length===1?"page":"pages";e.push(`added the ${ds(a.map(i=>i.name))} ${l}`)}if(n.length>0){const l=n.length===1?"page":"pages";e.push(`removed the ${ds(n.map(i=>i.name))} ${l}`)}const o=t.blocks.map(Ao);if(o.length>0&&e.push(`changed ${ds(o)}`),t.other.length>0){const l=t.other.length===1?"file":"files";e.push(`changed ${t.other.length} ${l}`)}if(e.length===0)return"";const c=Pr(e);return ur(c.charAt(0).toUpperCase()+c.slice(1))}function To(t,e){return t?Qs(t,e).length:0}function Io(t,e=!1){const s={newPageSections:t.kind==="page"&&t.status==="new"?To(t.toJson,e):null,sections:0,settings:!1,fields:0};if(s.newPageSections!==null)return s;for(const a of t.sections){if(a.kind==="settings"){s.settings=!0;continue}t.kind==="page"?s.sections+=1:s.fields+=a.fields.length}return s}const Zn="••••••";function Jt(t){if(Array.isArray(t))return t.map(Jt);if(!t||typeof t!="object")return t;const e=t,s={};for(const[a,n]of Object.entries(e))s[a]=Jt(n);return e.__resolveType===oi&&"ciphertext"in e&&(s.ciphertext=Zn),Vr(e)&&"encrypted"in e&&(s.encrypted=Zn),s}function ea(t){return t.map(e=>({...e,from:Jt(e.from),to:Jt(e.to)}))}function Do(t){const{changes:e,sides:s,lookup:a,meta:n,missingRules:o,missingRuleUses:c,hosted:l}=t,i=[],u=[],d=f=>[...new Set((s?.diagnostics??[]).filter(p=>$n(Kr(p.file))===$n(f)).map(p=>p.side))],h=Object.keys(e).sort((f,p)=>f<p?-1:f>p?1:0);for(const f of h){const p=e[f],m=p.kind==="delete"?"removed":p.baseVersion===null?"new":"edited",b=s?.entries[f],g=b?.before??null,x=b?.after??null,j=wr(a,f),y=j??x??g,v=d(f),P=o?.get(f),w=Wa(f),k=w?c?.get(w):void 0,N={blockKey:f,status:m,filepaths:[],entry:{name:f,version:p.version},...v.length>0?{unreadable:v}:{},...P&&P.length>0?{missingRules:P}:{},...w&&k&&k.pages+k.sections>0?{missingRuleUses:{kind:w,...k}}:{},fromJson:Jt(g),toJson:Jt(x??(m==="new"?j:null))},R=j?Kt(f,j,n):null,C=!j&&y?Kt(f,y,n):null;if(R??C??(!y&&vr(f))){const $=y?Kt(f,y,n):null;i.push({...N,kind:"page",name:$?.name??Qa(f),pagePath:$?.path??null,isSiteApp:!1,sections:m==="edited"?An(g,x,!0).map(I=>({...I,fields:ea(I.fields)})):[]});continue}const A=l?Ul(f,y,j,x,g):null,S=A?ql(A,[y,j,x,g]):gs(f,y??{}),E=xo(f,[j,x,g]);u.push({...N,kind:"block",name:S,...A?{blogKind:A}:{},...E?{namedRule:E}:{},pagePath:null,isSiteApp:gn(f,j??y??{}),sections:m==="edited"?[{name:S,kind:"section",status:"edited",fields:ea(Wt(g,x,[]))}].filter($=>$.fields.length>0):[]})}return{pages:i,blocks:u,other:[],generated:[],count:i.length+u.length,v8:!0}}function Ie(t){return t.filepaths[0]??t.blockKey??t.name}function Bo(t){const e=t.pages+t.sections===1,s=t.names===1;return t.kind==="experiments"?s?e?"thread.publishPopover.missingTestUsesOne":"thread.publishPopover.missingTestUses":e?"thread.publishPopover.missingTestsUsesOne":"thread.publishPopover.missingTestsUses":s?e?"thread.publishPopover.missingCampaignUsesOne":"thread.publishPopover.missingCampaignUses":e?"thread.publishPopover.missingCampaignsUsesOne":"thread.publishPopover.missingCampaignsUses"}function Mo(t,e){return e(t==="new"?"thread.publishPopover.chipNew":t==="removed"?"thread.publishPopover.chipRemoved":"thread.publishPopover.chipEdited")}function $o(t,e){const s=t.kind==="block"?ni:Ma;return r.jsx("span",{title:Mo(t.status,e),className:"flex shrink-0",children:r.jsx(s,{className:X("size-4",t.status==="new"&&"text-brand",t.status==="edited"&&"text-warning",t.status==="removed"&&"text-destructive")})})}function Fo(t,e){if(t.kind==="page")return t.pagePath;if(t.kind!=="block")return null;if(t.blogKind)return Hl(t.blogKind,e);const s=pr(t);return s==="experiments"?e("thread.publishPopover.abTests"):s==="campaigns"?e("thread.publishPopover.campaignDates"):t.isSiteApp?e("thread.publishPopover.siteConfiguration"):e("thread.publishPopover.globalSection")}function Eo(t,e,s){const a=Io(t,s);if(a.newPageSections!==null)return[a.newPageSections===1?e("thread.publishPopover.newPageSectionOne"):e("thread.publishPopover.newPageSections",{count:a.newPageSections})];const n=[];return a.sections===1?n.push(e("thread.publishPopover.sectionChangedOne")):a.sections>1&&n.push(e("thread.publishPopover.sectionsChanged",{count:a.sections})),a.fields===1?n.push(e("thread.publishPopover.fieldChangedOne")):a.fields>1&&n.push(e("thread.publishPopover.fieldsChanged",{count:a.fields})),a.settings&&n.push(e("thread.publishPopover.pageSettingsChanged")),n}function jr(t){const e=M.c(68),{change:s,bodyPending:a,selected:n,onSelect:o,confirming:c,onConfirmingChange:l,onDiscard:i,isPublishing:u,isDiscarding:d,v8:h,alsoChangedOnMain:f}=t,p=a===void 0?!1:a,m=h===void 0?!1:h,b=f===void 0?!1:f,g=xe();let x;e[0]!==s||e[1]!==g?(x=Fo(s,g),e[0]=s,e[1]=g,e[2]=x):x=e[2];const j=x;let y,v,P,w,k,N,R,C;if(e[3]!==p||e[4]!==s||e[5]!==c||e[6]!==j||e[7]!==d||e[8]!==u||e[9]!==l||e[10]!==i||e[11]!==o||e[12]!==n||e[13]!==g||e[14]!==m){const E=Eo(s,g,m);let $;e[23]!==s.missingRules?($=s.missingRules??[],e[23]=s.missingRules,e[24]=$):$=e[24];const I=$,T=s.missingRuleUses,D=T?ri(g,T):null,Y=p&&E.length===0&&s.status==="edited";y=or;const ae=n&&"border-foreground/30 bg-accent hover:bg-secondary-hover";e[25]!==ae?(w=X("cursor-pointer transition-colors hover:bg-accent",ae),e[25]=ae,e[26]=w):w=e[26],e[27]!==s?(k=Ie(s),e[27]=s,e[28]=k):k=e[28],N=o;let H;e[29]!==s||e[30]!==g?(H=$o(s,g),e[29]=s,e[30]=g,e[31]=H):H=e[31];let _;e[32]!==s.name?(_=r.jsx("span",{className:"truncate text-sm font-medium",children:s.name}),e[32]=s.name,e[33]=_):_=e[33];let z;e[34]!==j?(z=j?r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:j}):null,e[34]=j,e[35]=z):z=e[35];let ee;e[36]!==n||e[37]!==_||e[38]!==z?(ee=r.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left","aria-pressed":n,children:[_,z]}),e[36]=n,e[37]=_,e[38]=z,e[39]=ee):ee=e[39];let Q;e[40]!==c||e[41]!==d||e[42]!==u||e[43]!==l||e[44]!==i||e[45]!==g?(Q=c?r.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[r.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground",onClick:B=>{B.stopPropagation(),l(!1)},children:g("thread.publishDialog.cancel")}),r.jsx("button",{type:"button",className:"text-xs font-medium text-destructive disabled:opacity-50",onClick:B=>{B.stopPropagation(),l(!1),i?.()},disabled:d,children:g("thread.publishPopover.discard")})]}):i?r.jsx(As,{children:r.jsxs(kt,{children:[r.jsx(Ct,{asChild:!0,children:r.jsx(ye,{type:"button",variant:"ghost-destructive",size:"icon-xs","aria-label":g("thread.publishPopover.discard"),className:"shrink-0 disabled:pointer-events-auto",onClick:B=>{B.stopPropagation(),l(!0)},disabled:u||d,children:r.jsx(Ts,{className:"size-3.5"})})}),r.jsx(Nt,{children:g("thread.publishPopover.discard")})]})}):null,e[40]=c,e[41]=d,e[42]=u,e[43]=l,e[44]=i,e[45]=g,e[46]=Q):Q=e[46],e[47]!==H||e[48]!==ee||e[49]!==Q?(R=r.jsxs("div",{className:"flex items-center gap-2.5",children:[H,ee,Q]}),e[47]=H,e[48]=ee,e[49]=Q,e[50]=R):R=e[50],C=E.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-muted-foreground",children:E.map(_o)}):Y?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px]",children:r.jsx(ft,{className:"h-4 w-2/3"})}):null,e[51]!==I||e[52]!==g?(v=I.length>0?r.jsx("div",{className:"mt-1 space-y-0.5 pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule",children:I.map(B=>r.jsx("div",{className:"truncate",children:g(B==="experiments"?"thread.publishPopover.missingTest":"thread.publishPopover.missingCampaign")},B))}):null,e[51]=I,e[52]=g,e[53]=v):v=e[53],P=T&&D?r.jsx("div",{className:"mt-1 truncate pl-[26px] text-xs text-foreground","data-testid":"publish-change-missing-rule-uses",children:g(Bo(T),{places:D.places})}):null,e[3]=p,e[4]=s,e[5]=c,e[6]=j,e[7]=d,e[8]=u,e[9]=l,e[10]=i,e[11]=o,e[12]=n,e[13]=g,e[14]=m,e[15]=y,e[16]=v,e[17]=P,e[18]=w,e[19]=k,e[20]=N,e[21]=R,e[22]=C}else y=e[15],v=e[16],P=e[17],w=e[18],k=e[19],N=e[20],R=e[21],C=e[22];let A;e[54]!==b||e[55]!==s.name||e[56]!==g?(A=b?r.jsx("div",{className:"mt-1 pl-[26px] text-xs text-muted-foreground","data-testid":"publish-change-also-changed",children:g("thread.publishPopover.alsoChangedOnMain",{name:s.name})}):null,e[54]=b,e[55]=s.name,e[56]=g,e[57]=A):A=e[57];let S;return e[58]!==y||e[59]!==v||e[60]!==P||e[61]!==A||e[62]!==w||e[63]!==k||e[64]!==N||e[65]!==R||e[66]!==C?(S=r.jsxs(y,{className:w,"data-change-id":k,onClick:N,children:[R,C,v,P,A]}),e[58]=y,e[59]=v,e[60]=P,e[61]=A,e[62]=w,e[63]=k,e[64]=N,e[65]=R,e[66]=C,e[67]=S):S=e[67],S}function _o(t,e){return r.jsx("div",{className:"truncate",children:t},`${e}-${t}`)}function Sr(){const t=M.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={width:-1,height:-1},t[0]=e):e=t[0];const[s,a]=q.useState(e);let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=l=>{if(!l)return;const i=()=>a(d=>d.width===l.clientWidth&&d.height===l.clientHeight?d:{width:l.clientWidth,height:l.clientHeight});i();const u=new ResizeObserver(i);return u.observe(l),()=>u.disconnect()},t[1]=n):n=t[1];const o=n;let c;return t[2]!==s?(c=[s,o],t[2]=s,t[3]=c):c=t[3],c}function Oo(){return document.documentElement.classList.contains("dark")?"vs-dark":"vs"}const Lo=[{width:"w-3/4",tone:"ctx"},{width:"w-1/2",tone:"del"},{width:"w-3/5",tone:"add"},{width:"w-2/5",tone:"ctx"},{width:"w-4/5",tone:"add"},{width:"w-1/2",tone:"ctx"}];function ta(t){const e=M.c(10),{height:s}=t,a=xe();let n;e[0]!==s?(n={height:s},e[0]=s,e[1]=n):n=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=Lo.map(Uo),e[2]=o):o=e[2];let c;e[3]!==a?(c=a("thread.publishDialog.openingComparison"),e[3]=a,e[4]=c):c=e[4];let l;e[5]!==c?(l=r.jsx("div",{className:"flex items-center justify-center pt-1 text-2xs text-muted-foreground",children:c}),e[5]=c,e[6]=l):l=e[6];let i;return e[7]!==n||e[8]!==l?(i=r.jsxs("div",{style:n,className:"flex w-full flex-col gap-1.5 overflow-hidden px-3 py-2",children:[o,l]}),e[7]=n,e[8]=l,e[9]=i):i=e[9],i}function Uo(t,e){return r.jsxs("div",{className:X("flex items-center gap-2 rounded px-1 py-0.5",t.tone==="del"&&"bg-destructive/5",t.tone==="add"&&"bg-success/5"),children:[r.jsx("div",{className:X("h-2 w-4 shrink-0 animate-pulse rounded-sm bg-muted",t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")}),r.jsx("div",{className:X("h-2 animate-pulse rounded-sm bg-muted",t.width,t.tone==="del"&&"bg-destructive/20",t.tone==="add"&&"bg-success/25")})]},e)}const kr={readOnly:!0,renderSideBySide:!1,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:12},qo={...kr,lineNumbersMinChars:3,lineDecorationsWidth:4,folding:!1,glyphMargin:!1,renderOverviewRuler:!1};function zo(t){const e=M.c(11),{diff:s,emptyMessage:a,rowClassName:n,onDiscardFile:o,hideFileRows:c,editorHeight:l}=t,i=a===void 0?"No file changes in the working tree":a,u=n===void 0?"px-6":n,d=c===void 0?!1:c,h=l===void 0?"380px":l,[f,p]=q.useState(null),[m,b]=q.useState(null);let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=Oo(),e[0]=g):g=e[0];const x=g;if(!s||Object.keys(s.diffs).length===0){let y;return e[1]!==i?(y=r.jsx("div",{className:"flex items-center justify-center py-10 text-sm text-muted-foreground",children:i}),e[1]=i,e[2]=y):y=e[2],y}let j;return e[3]!==s.diffs||e[4]!==m||e[5]!==h||e[6]!==f||e[7]!==d||e[8]!==o||e[9]!==u?(j=r.jsx("div",{className:"divide-y",children:Object.entries(s.diffs).map(y=>{const[v,P]=y,{from:w,to:k}=P,N=f===v,R=w===null,C=k===null,A=v.startsWith("/")?v.slice(1):v,S=A.lastIndexOf("/"),E=S>=0?A.slice(S+1):A,$=S>=0?A.slice(0,S):null,I=Pi(v),T=R?"bg-success":C?"bg-destructive":"bg-warning";return d?r.jsx("div",{children:r.jsx(Hn,{original:w??"",modified:k??"",language:I,theme:x,height:h,loading:r.jsx(ta,{height:h}),options:qo})},v):r.jsxs("div",{children:[r.jsxs("div",{className:X("flex items-center gap-3 py-3 hover:bg-accent",u),children:[r.jsx("button",{type:"button",className:"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground transition-transform hover:text-foreground",onClick:()=>p(N?null:v),children:r.jsx(ua,{className:X("h-3.5 w-3.5 transition-transform",N&&"rotate-90")})}),r.jsx("div",{className:X("h-2.5 w-2.5 shrink-0 rounded-full",T)}),r.jsx(Ma,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:E}),$&&r.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:$}),o?r.jsxs(Ss,{children:[r.jsx(Ps,{asChild:!0,children:r.jsx("button",{type:"button",className:"flex h-6 w-6 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-foreground rounded-lg",children:r.jsx(Gr,{className:"h-3.5 w-3.5"})})}),r.jsx(js,{align:"end",children:r.jsx(Gt,{className:"text-destructive focus:text-destructive",onSelect:()=>b(v),children:"Discard changes"})})]}):null]}),m===v&&o?r.jsxs("div",{className:X("flex items-center justify-between gap-3 border-t bg-destructive/5 py-2.5",u),children:[r.jsxs("span",{className:"text-xs text-destructive",children:["Discard all changes to"," ",r.jsx("span",{className:"font-medium",children:E}),"? This cannot be undone."]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(ye,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(null),children:"Cancel"}),r.jsx(ye,{type:"button",variant:"destructive",size:"sm",onClick:()=>{b(null),o(v)},children:"Discard"})]})]}):null,N&&r.jsx("div",{className:"border-t",children:r.jsx(Hn,{original:w??"",modified:k??"",language:I,theme:x,height:h,loading:r.jsx(ta,{height:h}),options:kr})})]},v)})}),e[3]=s.diffs,e[4]=m,e[5]=h,e[6]=f,e[7]=d,e[8]=o,e[9]=u,e[10]=j):j=e[10],j}function Ho(t){if(t.kind!=="block"||t.isSiteApp||!t.blockKey)return null;const e=(t.toJson??t.fromJson)?.__resolveType;return typeof e=="string"&&ci(e)?t.blockKey:null}function Ko(t){return t.kind!=="page"?!0:!t.pagePath||Ft(t.pagePath).length>0}function Vo(t,e){try{return Si(t,Vl,e)}catch{return null}}function Go(t,e,s){if(!e)return;const a=Kl(e,t);if(!a)return null;if(Ft(a.path).length===0||s?.path!==a.path)return a.path;const n=xn(a.path,s.params);return Ft(n).length===0?n:a.path}function Qo(t){return t.sectionKey&&!t.v8?Vo(t.previewServerUrl,t.sectionKey):Jo(t.previewServerUrl,t.path)}function Wo(t,e){if(t.kind!=="page")return"/";const s=t.pagePath;if(!s)return"";if(Ft(s).length===0)return s;if(e?.path!==s)return"";const a=xn(s,e.params);return Ft(a).length===0?a:""}function Jo(t,e){const s=e.trim();if(!s||Ft(s).length>0)return null;try{const a=new URL(t),n=new URL(s.startsWith("/")?s:`/${s}`,a);return n.origin===a.origin?n:null}catch{return null}}function Xo(t,e){return e?.kind==="pointer"&&e.link?jn(t.toString(),e.link):Cr(t,e)}function Cr(t,e){if(!e)return null;if(e.kind==="pointer")return jn(t.toString(),e.pointer);try{return new URL(`${t.pathname}${t.search}`,e.previewUrl).href}catch{return null}}function Yo(t,e,s){return e===null?!1:t!=="other"||s?.kind==="sandbox"}function Zo(t,e){const s=e?t.kind==="page":t.kind!=="other";return{before:s&&t.status==="new"?"new":null,after:s&&t.status==="removed"?"removed":null}}const Nr=q.createContext(!0),ec=["split","before","after","code"];function tc(t){return ec.includes(t)}const Ar={desktop:1280,mobile:412};function sc(t,e){const s=(o,c)=>t.unreadable?.includes(c)?e:o?`${JSON.stringify(o,null,2)}
10
+ `:null,a=t.status==="new"?null:s(t.fromJson,"before"),n=t.status==="removed"?null:s(t.toJson,"after");return a===null&&n===null?{diffs:{}}:t.status==="edited"&&(a===null||n===null)?{diffs:{}}:{diffs:{[Jr(t.entry.name)]:{from:a,to:n}}}}function Rr(t){const e=M.c(76),{change:s,diff:a,bodyPending:n,previewServerUrl:o,draft:c,lastPage:l,v8:i,onReady:u}=t,d=xe(),h=q.use(Nr),f=Ho(s),p=i?null:f,m=i?f:null,b=m?Go(m,i?.blocks,l):void 0,g=m!==null&&b===null,x=Yo(s.kind,o,c)&&(m===null||typeof b=="string"),[j,y]=q.useState(null),v=x?j??"split":"code",[P,w]=q.useState("desktop"),[k,N]=q.useState(null),R=k??(m?b??"":Wo(s,l));let C;e[0]!==s?(C=Ko(s),e[0]=s,e[1]=C):C=e[1];const A=C,S=o?Qo({previewServerUrl:o,sectionKey:f,path:R,v8:!!i}):null,E=S?jn(S.toString(),ki):null,$=S?Cr(S,c):null,I=S?Xo(S,c):null;let T;e[2]!==s||e[3]!==a?.diffs||e[4]!==d?(T=s.entry?sc(s,d("thread.publishCompare.sideUnreadable")):{diffs:Object.fromEntries(s.filepaths.flatMap(O=>{const ne=a?.diffs[O];return ne?[[O,ne]]:[]}))},e[2]=s,e[3]=a?.diffs,e[4]=d,e[5]=T):T=e[5];const D=T;let Y;e[6]!==D.diffs?(Y=Object.keys(D.diffs),e[6]=D.diffs,e[7]=Y):Y=e[7];const ae=Y.length>0;let H;e:{if(p!==null){H=null;break e}if(m!==null){const ne=R.trim();if(!ne){H=null;break e}H=Ft(ne).length>0?d("thread.publishCompare.dynamicHint",{template:ne}):d("thread.publishCompare.blockHint",{path:ne});break e}if(s.kind!=="page"){let ne;e[8]!==d?(ne=d("thread.publishCompare.globalHint"),e[8]=d,e[9]=ne):ne=e[9],H=ne;break e}let O;e[10]!==s.pagePath||e[11]!==d?(O=s.pagePath&&Ft(s.pagePath).length>0?d("thread.publishCompare.dynamicHint",{template:s.pagePath}):null,e[10]=s.pagePath,e[11]=d,e[12]=O):O=e[12],H=O}const _=H,z=Zo(s,!!i),[ee,Q]=q.useState(nc);let B;e[13]===Symbol.for("react.memo_cache_sentinel")?(B=O=>Q(ne=>ne.has(O)?ne:new Set(ne).add(O)),e[13]=B):B=e[13];const ie=B;let U;e[14]!==i?(U=O=>i?r.jsx(lc,{...O,onLoaded:ie}):r.jsx(rc,{...O}),e[14]=i,e[15]=U):U=e[15];const oe=U,se=(x?[z.before==="new"?null:E,z.after==="removed"?null:$].flatMap(O=>O?[Sn(O,P)]:[]):[]).every(O=>ee.has(O));let F;e[16]!==u||e[17]!==se?(F=se&&u?O=>{O&&u()}:void 0,e[16]=u,e[17]=se,e[18]=F):F=e[18];const te=F,re=z.before==="new"?r.jsx(us,{icon:r.jsx(Oa,{className:"size-5 text-brand"}),title:d("thread.publishCompare.newTitle"),description:d("thread.publishCompare.newDescription")}):oe({url:E,device:P,title:d("thread.publishCompare.before"),missing:d("thread.publishCompare.enterPath")}),he=z.after==="removed"?r.jsx(us,{icon:r.jsx(Ts,{className:"size-5 text-destructive"}),title:d("thread.publishCompare.removedTitle"),description:d("thread.publishCompare.removedDescription")}):oe({url:$,device:P,title:d("thread.publishCompare.after"),missing:d(S?"thread.publishCompare.draftUnavailable":"thread.publishCompare.enterPath")});let G;e[19]!==x||e[20]!==y||e[21]!==h||e[22]!==d||e[23]!==v?(G=x||h?r.jsx(Da,{value:v,onValueChange:O=>{tc(O)&&y(O)},children:r.jsxs(Ia,{className:"h-8 w-auto",variant:"pill",children:[x?r.jsxs(r.Fragment,{children:[r.jsx(Lt,{value:"split",className:"px-3 text-xs",children:d("thread.publishCompare.sideBySide")}),r.jsx(Lt,{value:"before",className:"px-3 text-xs",children:d("thread.publishCompare.before")}),r.jsx(Lt,{value:"after",className:"px-3 text-xs",children:d("thread.publishCompare.after")})]}):null,h?r.jsx(Lt,{value:"code",className:"px-3 text-xs",children:d("thread.publishCompare.code")}):null]})}):null,e[19]=x,e[20]=y,e[21]=h,e[22]=d,e[23]=v,e[24]=G):G=e[24];let pe;e[25]!==I||e[26]!==x||e[27]!==s.pagePath||e[28]!==P||e[29]!==R||e[30]!==A||e[31]!==p||e[32]!==w||e[33]!==N||e[34]!==d||e[35]!==v?(pe=x&&v!=="code"?r.jsxs(r.Fragment,{children:[p?null:A?r.jsx(Qr,{value:R,onChange:O=>N(O.target.value),placeholder:s.pagePath??"/","aria-label":d("thread.publishCompare.pathLabel"),className:"h-8 w-56 font-mono text-xs"}):r.jsx("span",{className:"max-w-56 truncate px-1 font-mono text-xs text-muted-foreground",children:R}),r.jsxs("div",{className:"flex items-center rounded-lg border p-0.5",children:[r.jsx(sa,{active:P==="desktop",label:d("thread.publishCompare.desktop"),onClick:()=>w("desktop"),children:r.jsx(ji,{className:"size-3.5"})}),r.jsx(sa,{active:P==="mobile",label:d("thread.publishCompare.mobile"),onClick:()=>w("mobile"),children:r.jsx(Sl,{className:"size-3.5"})})]}),I?r.jsxs("a",{href:I,target:"_blank",rel:"noopener noreferrer",className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[r.jsx(Wr,{className:"size-3.5"}),d("thread.publishCompare.openDraft")]}):null]}):null,e[25]=I,e[26]=x,e[27]=s.pagePath,e[28]=P,e[29]=R,e[30]=A,e[31]=p,e[32]=w,e[33]=N,e[34]=d,e[35]=v,e[36]=pe):pe=e[36];let Z;e[37]!==G||e[38]!==pe?(Z=r.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b bg-background px-4 py-2.5 max-md:pr-12",children:[G,pe]}),e[37]=G,e[38]=pe,e[39]=Z):Z=e[39];let L;e[40]!==x||e[41]!==_||e[42]!==v?(L=_&&x&&v!=="code"?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:_}):null,e[40]=x,e[41]=_,e[42]=v,e[43]=L):L=e[43];let K;e[44]!==g||e[45]!==h||e[46]!==d?(K=g&&h?r.jsx("p",{className:"border-b bg-background px-4 py-1.5 text-2xs text-muted-foreground",children:d("thread.publishCompare.notOnAnyPage")}):null,e[44]=g,e[45]=h,e[46]=d,e[47]=K):K=e[47];let ce;e[48]!==o||e[49]!==h||e[50]!==d||e[51]!==m||e[52]!==b||e[53]!==v?(ce=v==="code"&&!h?m!==null&&b===void 0?r.jsx(ft,{className:"m-4 h-64 rounded"}):o===null?r.jsx(us,{icon:r.jsx(xs,{className:"size-5 text-muted-foreground"}),title:d("thread.publishCompare.previewNotReadyTitle"),description:d("thread.publishCompare.draftUnavailable")}):r.jsx(us,{icon:r.jsx(xs,{className:"size-5 text-muted-foreground"}),title:d("thread.publishCompare.noPreviewTitle"),description:d("thread.publishCompare.noPreviewDescription")}):null,e[48]=o,e[49]=h,e[50]=d,e[51]=m,e[52]=b,e[53]=v,e[54]=ce):ce=e[54];let je;e[55]!==n||e[56]!==ae||e[57]!==D||e[58]!==h||e[59]!==d||e[60]!==v?(je=v==="code"&&h?r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-background [scrollbar-width:thin]",children:ae?r.jsx(zo,{diff:D,hideFileRows:!0,editorHeight:"70vh"}):n?r.jsx(ft,{className:"m-4 h-64 rounded"}):r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:d("thread.publishPopover.detailsUnavailable")})}):null,e[55]=n,e[56]=ae,e[57]=D,e[58]=h,e[59]=d,e[60]=v,e[61]=je):je=e[61];let fe;e[62]!==he||e[63]!==re||e[64]!==x||e[65]!==d||e[66]!==v?(fe=x?r.jsxs("div",{className:X("flex min-h-0 flex-1 gap-3 p-3",v==="code"&&"hidden"),children:[r.jsx(na,{label:d("thread.publishCompare.before"),hidden:v==="after",children:re}),r.jsx(na,{label:d("thread.publishCompare.after"),highlight:!0,hidden:v==="before",children:he})]}):null,e[62]=he,e[63]=re,e[64]=x,e[65]=d,e[66]=v,e[67]=fe):fe=e[67];let Ee;return e[68]!==te||e[69]!==Z||e[70]!==L||e[71]!==K||e[72]!==ce||e[73]!==je||e[74]!==fe?(Ee=r.jsxs("div",{ref:te,className:"flex min-h-0 min-w-0 flex-1 flex-col bg-muted/40",children:[Z,L,K,ce,je,fe]}),e[68]=te,e[69]=Z,e[70]=L,e[71]=K,e[72]=ce,e[73]=je,e[74]=fe,e[75]=Ee):Ee=e[75],Ee}function nc(){return new Set}function sa(t){const e=M.c(8),{active:s,label:a,onClick:n,children:o}=t,c=s&&"bg-accent text-foreground";let l;e[0]!==c?(l=X("flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground",c),e[0]=c,e[1]=l):l=e[1];let i;return e[2]!==s||e[3]!==o||e[4]!==a||e[5]!==n||e[6]!==l?(i=r.jsx("button",{type:"button","aria-label":a,"aria-pressed":s,title:a,onClick:n,className:l,children:o}),e[2]=s,e[3]=o,e[4]=a,e[5]=n,e[6]=l,e[7]=i):i=e[7],i}function na(t){const e=M.c(18),{label:s,highlight:a,hidden:n,children:o}=t,c=a===void 0?!1:a,i=(n===void 0?!1:n)&&"hidden";let u;e[0]!==i?(u=X("flex min-h-0 min-w-0 flex-1 flex-col gap-1.5",i),e[0]=i,e[1]=u):u=e[1];const d=c&&"bg-brand";let h;e[2]!==d?(h=X("size-1.5 rounded-full bg-muted-foreground/50",d),e[2]=d,e[3]=h):h=e[3];let f;e[4]!==h?(f=r.jsx("span",{className:h}),e[4]=h,e[5]=f):f=e[5];let p;e[6]!==s||e[7]!==f?(p=r.jsxs("div",{className:"flex items-center gap-1.5 px-0.5 text-2xs font-medium text-muted-foreground",children:[f,s]}),e[6]=s,e[7]=f,e[8]=p):p=e[8];const m=c&&"border-brand/60";let b;e[9]!==m?(b=X("relative min-h-0 flex-1 overflow-hidden rounded-lg border bg-background",m),e[9]=m,e[10]=b):b=e[10];let g;e[11]!==o||e[12]!==b?(g=r.jsx("div",{className:b,children:o}),e[11]=o,e[12]=b,e[13]=g):g=e[13];let x;return e[14]!==g||e[15]!==u||e[16]!==p?(x=r.jsxs("div",{className:u,children:[p,g]}),e[14]=g,e[15]=u,e[16]=p,e[17]=x):x=e[17],x}function us(t){const e=M.c(10),{icon:s,title:a,description:n}=t;let o;e[0]!==s?(o=r.jsx("div",{className:"mb-1",children:s}),e[0]=s,e[1]=o):o=e[1];let c;e[2]!==a?(c=r.jsx("p",{className:"text-sm font-medium",children:a}),e[2]=a,e[3]=c):c=e[3];let l;e[4]!==n?(l=r.jsx("p",{className:"text-xs text-muted-foreground",children:n}),e[4]=n,e[5]=l):l=e[5];let i;return e[6]!==o||e[7]!==c||e[8]!==l?(i=r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-1 px-6 text-center",children:[o,c,l]}),e[6]=o,e[7]=c,e[8]=l,e[9]=i):i=e[9],i}function ac(t,e){if(!t)return{visibility:"hidden",width:e};const s=Math.min(t.width/e,1);return{left:Math.max((t.width-e*s)/2,0),width:e,height:t.height/s,transform:`scale(${s})`,transformOrigin:"top left"}}function rc(t){const e=M.c(24),{url:s,device:a,title:n,missing:o}=t,[c,l]=Sr(),[i,u]=q.useState(null);if(!s){let w;return e[0]!==o?(w=r.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=w):w=e[1],w}let d;e[2]!==a||e[3]!==s?(d=Sn(s,a),e[2]=a,e[3]=s,e[4]=d):d=e[4];const h=d,f=Ar[a],p=c.width>0?Math.min(c.width/f,1):1,m=c.width>0?Math.max((c.width-f*p)/2,0):0;let b;e[5]!==h?(b=()=>u(h),e[5]=h,e[6]=b):b=e[6];const g=c.height>0?c.height/p:"100%",x=`scale(${p})`;let j;e[7]!==f||e[8]!==m||e[9]!==g||e[10]!==x?(j={left:m,width:f,height:g,transform:x,transformOrigin:"top left"},e[7]=f,e[8]=m,e[9]=g,e[10]=x,e[11]=j):j=e[11];let y;e[12]!==h||e[13]!==b||e[14]!==j||e[15]!==n?(y=r.jsx("iframe",{src:h,title:n,sandbox:"allow-scripts allow-same-origin",onLoad:b,className:"absolute top-0 border-0 bg-white",style:j},h),e[12]=h,e[13]=b,e[14]=j,e[15]=n,e[16]=y):y=e[16];let v;e[17]!==i||e[18]!==h?(v=i!==h?r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(Qt,{className:"size-5 motion-reduce:animate-none"})}):null,e[17]=i,e[18]=h,e[19]=v):v=e[19];let P;return e[20]!==l||e[21]!==y||e[22]!==v?(P=r.jsxs("div",{ref:l,className:"absolute inset-0",children:[y,v]}),e[20]=l,e[21]=y,e[22]=v,e[23]=P):P=e[23],P}function lc(t){const e=M.c(21),{url:s,device:a,title:n,missing:o,onLoaded:c}=t,[l,i]=Sr(),[u,d]=q.useState(null),[h,f]=q.useState(null),p=l.width>0&&l.height>0;p&&(u?.width!==l.width||u?.height!==l.height)&&d(l);const m=p?l:u;if(!s){let P;return e[0]!==o?(P=r.jsx("p",{className:"flex h-full items-center justify-center px-6 text-center text-xs text-muted-foreground",children:o}),e[0]=o,e[1]=P):P=e[1],P}let b,g,x,j;if(e[2]!==m||e[3]!==a||e[4]!==c||e[5]!==i||e[6]!==h||e[7]!==n||e[8]!==s){const P=Sn(s,a),w=Ar[a];b=h?.src!==P;const k=[...h&&b?[h]:[],{src:P,logicalWidth:w}];g=i,x="absolute inset-0",j=k.map(N=>{const R=N.src===P&&b;return r.jsx("iframe",{src:N.src,title:n,"aria-hidden":R&&h?!0:void 0,sandbox:"allow-scripts allow-same-origin",onLoad:()=>{N.src===P&&(f(N),c?.(N.src))},className:X("absolute top-0 border-0 bg-white",R&&"pointer-events-none opacity-0"),style:ac(m,N.logicalWidth)},N.src)}),e[2]=m,e[3]=a,e[4]=c,e[5]=i,e[6]=h,e[7]=n,e[8]=s,e[9]=b,e[10]=g,e[11]=x,e[12]=j}else b=e[9],g=e[10],x=e[11],j=e[12];let y;e[13]!==b||e[14]!==h?(y=b?h?r.jsx(Qt,{className:"absolute right-2 top-2 size-4 text-muted-foreground motion-reduce:animate-none"}):r.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/60",children:r.jsx(Qt,{className:"size-5 motion-reduce:animate-none"})}):null,e[13]=b,e[14]=h,e[15]=y):y=e[15];let v;return e[16]!==g||e[17]!==x||e[18]!==j||e[19]!==y?(v=r.jsxs("div",{ref:g,className:x,children:[j,y]}),e[16]=g,e[17]=x,e[18]=j,e[19]=y,e[20]=v):v=e[20],v}const ic=/^Co-authored-by:\s*([^<\r\n]+?)(?:\s*<[^>\r\n]*>)?\s*$/im;function oc(t){if(!t)return null;const e=ic.exec(t)?.[1]?.trim();return e||null}function cc(t){return/\[bot\]$/i.test(t)||/-bot$/i.test(t)}function dc(t){const e=oc(t.body);if(e)return e;const s=t.author.trim();return!s||cc(s)?null:s}function Tr(t){const e=M.c(9),s=xe(),a=Ns();let n;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(n={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=n):n=e[3];const o=nr(n);let c;return e[4]!==t||e[5]!==o||e[6]!==a||e[7]!==s?(c=async(l,i,u)=>{try{await ll(o,{blockKeys:i.map(hc),write:()=>il(l.client,i)}),Oe.success(u)}catch(d){const h=d;if(ol(h)){Oe.info(s("siteEditor.discard.changedMeanwhile")),await t.refresh().catch(uc);return}l.source==="local"&&cl(h)&&a.resetQueries({queryKey:Et.contentBackend(t.orgSlug,t.virtualMcpId,"local")}),Oe.error(s("siteEditor.discard.failed"),{description:dn(s,bs(h))})}},e[4]=t,e[5]=o,e[6]=a,e[7]=s,e[8]=c):c=e[8],c}function uc(){}function hc(t){return t.name}function fc(t){const{mode:e,target:s,note:a,allPaths:n,destinationHost:o,publishLockRef:c,onOpenChange:l,refresh:i,onPullRequestChanged:u,onPublished:d,hosted:h=!1,authorName:f,protocol:p}=t,m=xe(),b=Ns(),[g,x]=q.useState(!1),[j,y]=q.useState(),[v,P]=q.useState(null),w=()=>fo(a,h?f?m("siteEditor.publish.defaultNote",{name:f}):m("siteEditor.publish.defaultNoteAnonymous"):m("thread.publishDialog.changesFrom",{branch:s.headBranch})),k=async T=>{try{await T?.()}catch{}},N=nr({orgSlug:s.orgSlug,virtualMcpId:s.virtualMcpId,branch:s.branch}),R=async T=>{try{await Es(N,{kind:"publish",reread:!!T,refreshOnError:!0,write:()=>Zl(s,T)}),En(m)}catch(D){ei(m,D,()=>{R(T)})}},C=async T=>{const D=Xl(T,s.branch);Yl(m,T,()=>{R(D)}),l(!1),await k(d)},A=async()=>{c.current=!0,x(!0),y(void 0),P(null);try{const T=await Es(N,{kind:"publish",reread:!0,refreshOnError:!0,write:()=>Ql(s,w().message)});return await C(T),!0}catch(T){T instanceof Wl&&T.code===Xr&&Yr(b,s.orgSlug,s.virtualMcpId);const D=Jl(m,T);return y(D.message),P(D.detail),!1}finally{c.current=!1,x(!1)}},S=async()=>{c.current=!0,x(!0),y(void 0),P(null);try{await po(s,w(),m),En(m,o),l(!1),await Promise.all([k(u),k(d)])}catch(T){const D=Jn(T,m);y(D.headMoved?D.message:m("siteEditor.publish.failed")),P(D.headMoved?null:[D.pullRequest?`#${D.pullRequest.number} ${D.pullRequest.htmlUrl}`:null,bs(T)].filter(Boolean).join(`
11
+ `)||null),D.pullRequest&&await k(u),D.headMoved&&await i()}finally{c.current=!1,x(!1)}},E=async()=>{c.current=!0,x(!0),y(void 0),P(null);try{const T=await bo(s,w());go(T,m),l(!1),await u?.()}catch(T){const D=Jn(T,m);y(D.message||m("thread.publishDialog.failedSubmitForReview")),D.headMoved&&await i()}finally{c.current=!1,x(!1)}},$=Tr({orgSlug:s.orgSlug,virtualMcpId:s.virtualMcpId,branch:s.branch,refresh:i}),I=async(T,D)=>{try{await Es(N,{kind:"discard",reread:!0,write:()=>hi({orgSlug:s.orgSlug,virtualMcpId:s.virtualMcpId,branch:s.branch,threadId:s.threadId},T)}),Oe.success(D),await i()}catch(Y){Oe.error(m("siteEditor.discard.failed"),{description:dn(m,bs(Y))})}};return{isPublishing:g,publishError:j,publishErrorDetail:v,submit:e==="review"?E:h?A:S,discardChange:T=>{const D=m("thread.publishPopover.discarded",{name:T.name});return p&&T.entry?$(p.backend,[T.entry],D):I(T.filepaths,D)},discardAll:async()=>{const T=m("thread.publishDialog.allChangesDiscarded");if(p){if(p.entries.length===0)return;await $(p.backend,p.entries,T);return}n.length!==0&&await I(n,T)}}}function mc(t,e,s,a,n,o){return["cms-publish-bodies",t,e,s,a,n,o]}const pc=6e4;function bc(t,e){return e?null:t.files.map(s=>`${s.index}${s.working_dir} ${s.path}`).sort().join(`
12
+ `)}function gc(t,e,s){const a=M.c(6);let n;a[0]!==s||a[1]!==t||a[2]!==e?(n=Et.decofile(`${t}/${e}/${s}`),a[0]=s,a[1]=t,a[2]=e,a[3]=n):n=a[3];let o;a[4]!==n?(o={queryKey:n,queryFn:on},a[4]=n,a[5]=o):o=a[5];const{data:c}=Tt(o);return c}function Ir(t){const{orgSlug:e,virtualMcpId:s,branch:a,threadId:n,baseBranch:o,fastPreview:c,recoverSandbox:l}=t,i={orgSlug:e,virtualMcpId:s,branch:a,threadId:n},u=c?{fastPreview:!0}:void 0,d=q.useRef(null),h=async P=>{try{return await P()}catch(w){if(!l||!er(w))throw w;return d.current??=l(),await d.current,P()}},f=fa({...Za(i),queryFn:()=>h(()=>yn(i))}),p=f.data,m=p.changedFiles??null,b=p.headSha??null,g=m?m.length>0:fi(p)||mi(p),x=Tt({queryKey:mc(e,s,a,o,b,bc(p,c)),queryFn:()=>h(()=>Xa(i,p,o,u)),enabled:g,staleTime:c?pc:0,gcTime:c?void 0:0,throwOnError:(P,w)=>!m&&w.state.data===void 0}),j=gc(e,s,a),y=x.data??null,v=m?yr({files:m,lookup:j,diff:y}):So(y);return{status:p,summary:v,allPaths:m?m.map(P=>P.path):Object.keys(y?.diffs??{}),discardablePaths:c?null:new Set(p.files.map(P=>P.path)),changedFilesTotal:p.changedFilesTotal??v.count,changedFilesTruncated:p.changedFilesTruncated??!1,headSha:b,diff:y,bodiesPending:g&&x.isPending,bodiesFailed:x.isError,cardsPending:!m&&g&&x.isPending,refresh:()=>Promise.all([f.refetch(),c?null:x.refetch()])}}function xc(t){const e=M.c(4);let s;e[0]!==t?(s=Et.decofile(t),e[0]=t,e[1]=s):s=e[1];let a;e[2]!==s?(a={queryKey:s,queryFn:on},e[2]=s,e[3]=a):a=e[3];const{data:n}=Tt(a);return n}function vc(t,e){const s=M.c(5);let a;s[0]!==t||s[1]!==e?(a=e?ul(e,t):Et.liveMeta("","no-scope"),s[0]=t,s[1]=e,s[2]=a):a=s[2];let n;s[3]!==a?(n={queryKey:a,queryFn:on},s[3]=a,s[4]=n):n=s[4];const{data:o}=Tt(n);return o}function Rn(t){const e=M.c(27),{backend:s,cacheKey:a,scope:n}=t,o=Ns();let c;e[0]!==a?(c=Et.contentChanges(a),e[0]=a,e[1]=c):c=e[1];let l;e[2]!==s.client||e[3]!==a||e[4]!==o?(l=()=>hl(o,s.client,a),e[2]=s.client,e[3]=a,e[4]=o,e[5]=l):l=e[5];let i;e[6]!==c||e[7]!==l?(i={queryKey:c,queryFn:l,staleTime:0},e[6]=c,e[7]=l,e[8]=i):i=e[8];const u=fa(i),d=u.data,h=dl(s,a,d),f=xc(a),p=vc(s,n);let m;if(e[9]!==s.source||e[10]!==d.changes||e[11]!==f||e[12]!==p||e[13]!==h.data){const P=f&&p?li(f,p):null,w=f&&p?ii(f,p):null;m=Do({changes:d.changes,sides:h.data??null,lookup:f,meta:p,hosted:s.source==="github",...P?{missingRules:P}:{},...w?{missingRuleUses:w}:{}}),e[9]=s.source,e[10]=d.changes,e[11]=f,e[12]=p,e[13]=h.data,e[14]=m}else m=e[14];const b=m;let g;e[15]!==d.changes?(g=Object.entries(d.changes).map(yc),e[15]=d.changes,e[16]=g):g=e[16];const x=b.count>0&&h.isPending,j=f??null;let y;e[17]!==u?(y=()=>u.refetch(),e[17]=u,e[18]=y):y=e[18];let v;return e[19]!==d||e[20]!==h.isError||e[21]!==b||e[22]!==g||e[23]!==x||e[24]!==j||e[25]!==y?(v={changes:d,summary:b,entries:g,sidesPending:x,sidesFailed:h.isError,blocks:j,refresh:y},e[19]=d,e[20]=h.isError,e[21]=b,e[22]=g,e[23]=x,e[24]=j,e[25]=y,e[26]=v):v=e[26],v}function yc(t){const[e,s]=t;return{name:e,version:s.version}}function wc(t){return["smart-review-verdict",t.orgSlug,t.virtualMcpId,t.branch,t.threadId,t.fastPreview?"fast-preview-upstream":"sandbox",t.signature,t.language]}function Pc(t){const e=M.c(27),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:c,status:l,diff:i,enabled:u}=t,[d]=ma(),{language:h}=d;let f,p,m;if(e[0]!==n||e[1]!==i||e[2]!==u||e[3]!==c||e[4]!==h||e[5]!==s||e[6]!==l||e[7]!==o||e[8]!==a){const P=i?Is(i):"";f=u&&!!n&&!!l&&!!i&&P!=="",m=Tt,p=wc({orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:c,signature:P,language:h}),e[0]=n,e[1]=i,e[2]=u,e[3]=c,e[4]=h,e[5]=s,e[6]=l,e[7]=o,e[8]=a,e[9]=f,e[10]=p,e[11]=m}else f=e[9],p=e[10],m=e[11];let b;e[12]!==n||e[13]!==i||e[14]!==h||e[15]!==s||e[16]!==l||e[17]!==o||e[18]!==a?(b=()=>pi({orgSlug:s,virtualMcpId:a,branch:n,threadId:o},{status:l,diff:i,language:h}),e[12]=n,e[13]=i,e[14]=h,e[15]=s,e[16]=l,e[17]=o,e[18]=a,e[19]=b):b=e[19];let g;e[20]!==f||e[21]!==p||e[22]!==b?(g={queryKey:p,queryFn:b,enabled:f,staleTime:1/0,gcTime:6e5,retry:jc},e[20]=f,e[21]=p,e[22]=b,e[23]=g):g=e[23];const x=m(g),j=x.data??null,y=f&&x.isFetching&&!x.data;let v;return e[24]!==j||e[25]!==y?(v={verdict:j,loading:y},e[24]=j,e[25]=y,e[26]=v):v=e[26],v}function jc(t,e){return!er(e)&&t<1}function Dr(t){const e=M.c(30),{orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:c,status:l,diff:i,policy:u,judgeEnabled:d,paths:h}=t,f=d===void 0?!0:d,p=h===void 0?null:h;let m;e[0]!==i||e[1]!==f||e[2]!==u?(m=f&&bi(i,u),e[0]=i,e[1]=f,e[2]=u,e[3]=m):m=e[3];const b=m;let g;e[4]!==n||e[5]!==i||e[6]!==c||e[7]!==b||e[8]!==s||e[9]!==l||e[10]!==o||e[11]!==a?(g={orgSlug:s,virtualMcpId:a,branch:n,threadId:o,fastPreview:c,status:l,diff:i,enabled:b},e[4]=n,e[5]=i,e[6]=c,e[7]=b,e[8]=s,e[9]=l,e[10]=o,e[11]=a,e[12]=g):g=e[12];const{verdict:x,loading:j}=Pc(g);if(!i&&p){let w;e[13]!==p||e[14]!==u?(w=gi(p,u),e[13]=p,e[14]=u,e[15]=w):w=e[15];let k;return e[16]!==w?(k={gate:w,ready:!1},e[16]=w,e[17]=k):k=e[17],k}if(!i){let w;return e[18]===Symbol.for("react.memo_cache_sentinel")?(w={gate:{allowed:!0,reason:null},ready:!1},e[18]=w):w=e[18],w}if(!b){let w;e[19]!==i||e[20]!==u?(w=xi(i,u),e[19]=i,e[20]=u,e[21]=w):w=e[21];let k;return e[22]!==w?(k={gate:w,ready:!0},e[22]=w,e[23]=k):k=e[23],k}let y;e[24]!==j||e[25]!==x?(y=vi(x,j),e[24]=j,e[25]=x,e[26]=y):y=e[26];const v=!j;let P;return e[27]!==y||e[28]!==v?(P={gate:y,ready:v},e[27]=y,e[28]=v,e[29]=P):P=e[29],P}function Sc(t){return["main","master"].includes(t.trim().toLowerCase())}function kc(t,e,s,a){return t===0?a("thread.publishPopover.publish"):s||!Sc(e)?t===1?a("thread.publishPopover.publishOne"):a("thread.publishPopover.publishCount",{count:t}):t===1?a("thread.publishPopover.publishOneInProduction"):a("thread.publishPopover.publishCountInProduction",{count:t})}const Cc=2500;function Nc(t){const{selectedId:e,readyIds:s,lastShownId:a,liveIds:n}=t;return e===null||s.has(e)?e:a!==null&&a!==e&&n.includes(a)?a:e}function Br(t){const e=M.c(16),s=q.useRef(!1),a=xe();let n;e[0]!==t?(n=h=>{!h&&s.current||t.onOpenChange(h)},e[0]=t,e[1]=n):n=e[1];const o=n;let c;e[2]!==t.mode||e[3]!==a?(c=t.mode==="review"?a("thread.publishPopover.submitForReview"):a("thread.publishPopover.publish"),e[2]=t.mode,e[3]=a,e[4]=c):c=e[4];let l;e[5]!==c?(l=r.jsx(ba,{className:"sr-only",children:c}),e[5]=c,e[6]=l):l=e[6];let i;e[7]!==t?(i=r.jsx(Ac,{...t,publishLockRef:s}),e[7]=t,e[8]=i):i=e[8];let u;e[9]!==l||e[10]!==i?(u=r.jsxs(ga,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[l,i]}),e[9]=l,e[10]=i,e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==t.open||e[14]!==u?(d=r.jsx(pa,{open:t.open,onOpenChange:o,children:u}),e[12]=o,e[13]=t.open,e[14]=u,e[15]=d):d=e[15],d}function Ac(t){const e=M.c(3),s=qt(t.virtualMcpId,t.branch),a=s.kind==="protocol"&&s.source==="github";let n;return e[0]!==a||e[1]!==t?(n=oo({open:t.open,hosted:a})?r.jsx(Ic,{...t}):null,e[0]=a,e[1]=t,e[2]=n):n=e[2],n}const Rc=4,Xt="flex h-[45%] min-h-0 min-w-0 shrink-0 md:h-auto md:flex-1";function es(t){const e=M.c(5),{list:s,pane:a}=t;let n;e[0]!==s?(n=r.jsx("div",{className:"flex min-h-0 w-full flex-1 flex-col max-md:border-t md:w-[380px] md:flex-none md:shrink-0 md:border-l md:[&>[data-publish-state]>:first-child]:pr-12",children:s}),e[0]=s,e[1]=n):n=e[1];let o;return e[2]!==a||e[3]!==n?(o=r.jsxs(r.Fragment,{children:[a,n]}),e[2]=a,e[3]=n,e[4]=o):o=e[4],o}function Tn(){const t=M.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:X(Xt,"bg-muted/40 p-3"),children:r.jsx(ft,{className:"h-full w-full rounded-lg"})}),t[0]=e):e=t[0],e}function In(t){const e=M.c(11),{mode:s,title:a,subLine:n,trailing:o}=t,c=s==="review"?Rs:$a;let l;e[0]!==c?(l=r.jsx(c,{className:"size-4 shrink-0 text-muted-foreground"}),e[0]=c,e[1]=l):l=e[1];let i;e[2]!==l||e[3]!==a||e[4]!==o?(i=r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l,a,o]}),e[2]=l,e[3]=a,e[4]=o,e[5]=i):i=e[5];let u;e[6]!==n?(u=n?r.jsx("div",{className:"pl-6 text-xs text-muted-foreground",children:n}):null,e[6]=n,e[7]=u):u=e[7];let d;return e[8]!==i||e[9]!==u?(d=r.jsxs(r.Fragment,{children:[i,u]}),e[8]=i,e[9]=u,e[10]=d):d=e[10],d}function Dn(t){const e=M.c(9),{draftPreviewUrl:s,t:a}=t;let n;e[0]!==s?(n=()=>{s&&window.open(s,"_blank","noopener,noreferrer")},e[0]=s,e[1]=n):n=e[1];const o=!s;let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(xs,{className:"size-4"}),e[2]=c):c=e[2];let l;e[3]!==a?(l=a("thread.publishPopover.preview"),e[3]=a,e[4]=l):l=e[4];let i;return e[5]!==n||e[6]!==o||e[7]!==l?(i=r.jsxs(ye,{type:"button",variant:"outline",onClick:n,disabled:o,children:[c,l]}),e[5]=n,e[6]=o,e[7]=l,e[8]=i):i=e[8],i}function Mr(t){const e=M.c(21),{mode:s,draftPreviewUrl:a}=t,n=xe();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx(Tn,{}),e[0]=o):o=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(ft,{className:"h-3.5 w-48"}),e[1]=c):c=e[1];let l;e[2]!==s?(l=r.jsx(In,{mode:s,title:c}),e[2]=s,e[3]=l):l=e[3];let i,u;e[4]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx(Yt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{}),r.jsx(Ut,{})]})}),u=r.jsxs(r.Fragment,{children:[r.jsx(ft,{className:"h-3 w-20"}),r.jsx(ft,{className:"h-14 w-full rounded-lg"})]}),e[4]=i,e[5]=u):(i=e[4],u=e[5]);let d;e[6]!==a||e[7]!==n?(d=r.jsx(Dn,{draftPreviewUrl:a,t:n}),e[6]=a,e[7]=n,e[8]=d):d=e[8];const h=s==="review"?"default":"brand";let f;e[9]!==s||e[10]!==n?(f=n(s==="review"?"thread.publishPopover.submitForReview":"thread.publishPopover.publish"),e[9]=s,e[10]=n,e[11]=f):f=e[11];let p;e[12]!==h||e[13]!==f?(p=r.jsx(ye,{type:"button",variant:h,className:"flex-1",disabled:!0,children:f}),e[12]=h,e[13]=f,e[14]=p):p=e[14];let m;e[15]!==d||e[16]!==p?(m=r.jsxs("div",{className:"flex gap-2",children:[d,p]}),e[15]=d,e[16]=p,e[17]=m):m=e[17];let b;return e[18]!==m||e[19]!==l?(b=r.jsx(es,{pane:o,list:r.jsx(Bs,{state:"loading",header:l,body:i,note:u,footer:m})}),e[18]=m,e[19]=l,e[20]=b):b=e[20],b}function Tc(t){const e=M.c(26),{mode:s,draftPreviewUrl:a,message:n,onRetry:o}=t,c=xe();let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx("div",{className:X(Xt,"bg-muted/40")}),e[0]=l):l=e[0];let i;e[1]!==c?(i=c("thread.publishPopover.loadFailed"),e[1]=c,e[2]=i):i=e[2];let u;e[3]!==i?(u=r.jsx("span",{className:"truncate",children:i}),e[3]=i,e[4]=u):u=e[4];let d;e[5]!==s||e[6]!==u?(d=r.jsx(In,{mode:s,title:u}),e[5]=s,e[6]=u,e[7]=d):d=e[7];let h;e[8]!==n?(h=r.jsx("p",{className:"px-4 py-6 text-xs text-destructive",children:n}),e[8]=n,e[9]=h):h=e[9];let f;e[10]!==a||e[11]!==c?(f=r.jsx(Dn,{draftPreviewUrl:a,t:c}),e[10]=a,e[11]=c,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=r.jsx(cn,{className:"size-4"}),e[13]=p):p=e[13];let m;e[14]!==c?(m=c("thread.publishPopover.retry"),e[14]=c,e[15]=m):m=e[15];let b;e[16]!==o||e[17]!==m?(b=r.jsxs(ye,{type:"button",variant:"outline",className:"flex-1",onClick:o,children:[p,m]}),e[16]=o,e[17]=m,e[18]=b):b=e[18];let g;e[19]!==f||e[20]!==b?(g=r.jsxs("div",{className:"flex gap-2",children:[f,b]}),e[19]=f,e[20]=b,e[21]=g):g=e[21];let x;return e[22]!==g||e[23]!==d||e[24]!==h?(x=r.jsx(es,{pane:l,list:r.jsx(Bs,{state:"ready",header:d,body:h,footer:g})}),e[22]=g,e[23]=d,e[24]=h,e[25]=x):x=e[25],x}function Ic(t){const e=M.c(3),s=t.mode??"publish";let a;return e[0]!==s||e[1]!==t?(a=r.jsx(xa,{children:n=>{const{reset:o}=n;return r.jsx(va,{fallback:c=>{const{error:l,resetError:i}=c;return r.jsx(Tc,{mode:s,draftPreviewUrl:t.draftPreviewUrl,message:l?.message??"",onRetry:()=>{o(),i()}})},children:r.jsx(q.Suspense,{fallback:r.jsx(Mr,{mode:s,draftPreviewUrl:t.draftPreviewUrl}),children:r.jsx(Dc,{...t})})})}}),e[0]=s,e[1]=t,e[2]=a):a=e[2],a}function Dc(t){const e=M.c(13),s=qt(t.virtualMcpId,t.branch);let a;e[0]!==t.branch||e[1]!==t.orgSlug||e[2]!==t.virtualMcpId?(a={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch},e[0]=t.branch,e[1]=t.orgSlug,e[2]=t.virtualMcpId,e[3]=a):a=e[3];const n=un(a);if(s.kind==="protocol"&&n){let c;return e[4]!==s||e[5]!==n||e[6]!==t?(c=s.source==="sandbox"?r.jsx($c,{...t,backend:s,cacheKey:n}):r.jsx(Mc,{...t,backend:s,cacheKey:n}),e[4]=s,e[5]=n,e[6]=t,e[7]=c):c=e[7],c}if(s.kind!=="legacy"){const c=t.mode??"publish";let l;return e[8]!==t.draftPreviewUrl||e[9]!==c?(l=r.jsx(Mr,{mode:c,draftPreviewUrl:t.draftPreviewUrl}),e[8]=t.draftPreviewUrl,e[9]=c,e[10]=l):l=e[10],l}let o;return e[11]!==t?(o=r.jsx(Bc,{...t}),e[11]=t,e[12]=o):o=e[12],o}function Bc(t){const e=M.c(52),s=Zt()?.taskId??null;let a;e[0]!==t.baseBranch||e[1]!==t.branch||e[2]!==t.fastPreview||e[3]!==t.orgSlug||e[4]!==t.recoverSandbox||e[5]!==t.virtualMcpId||e[6]!==s?(a={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,baseBranch:t.baseBranch,fastPreview:t.fastPreview,recoverSandbox:t.recoverSandbox},e[0]=t.baseBranch,e[1]=t.branch,e[2]=t.fastPreview,e[3]=t.orgSlug,e[4]=t.recoverSandbox,e[5]=t.virtualMcpId,e[6]=s,e[7]=a):a=e[7];const n=Ir(a),o=t.mode!=="review";let c;e[8]!==t.branch||e[9]!==t.fastPreview||e[10]!==t.orgSlug||e[11]!==t.publishPolicy||e[12]!==t.virtualMcpId||e[13]!==n.allPaths||e[14]!==n.diff||e[15]!==n.status||e[16]!==o||e[17]!==s?(c={orgSlug:t.orgSlug,virtualMcpId:t.virtualMcpId,branch:t.branch,threadId:s,fastPreview:t.fastPreview,status:n.status,diff:n.diff,paths:n.allPaths,policy:t.publishPolicy,judgeEnabled:o},e[8]=t.branch,e[9]=t.fastPreview,e[10]=t.orgSlug,e[11]=t.publishPolicy,e[12]=t.virtualMcpId,e[13]=n.allPaths,e[14]=n.diff,e[15]=n.status,e[16]=o,e[17]=s,e[18]=c):c=e[18];const{gate:l}=Dr(c),i=n.discardablePaths;let u;e[19]!==i?(u=j=>i===null||j.every(y=>i.has(y)),e[19]=i,e[20]=u):u=e[20];const d=u;let h;e[21]!==d?(h=j=>d(j.filepaths),e[21]=d,e[22]=h):h=e[22];let f;e[23]!==d||e[24]!==n.allPaths||e[25]!==n.changedFilesTruncated?(f=!n.changedFilesTruncated&&d(n.allPaths),e[23]=d,e[24]=n.allPaths,e[25]=n.changedFilesTruncated,e[26]=f):f=e[26];let p;e[27]!==t.branch||e[28]!==n.status?(p=Pn(n.status)??t.branch,e[27]=t.branch,e[28]=n.status,e[29]=p):p=e[29];const m=n.headSha??void 0;let b;e[30]!==t.fastPreview||e[31]!==n.diff?(b=!t.fastPreview&&n.diff?{expectedDiffSignature:Is(n.diff)}:{},e[30]=t.fastPreview,e[31]=n.diff,e[32]=b):b=e[32];let g;e[33]!==l||e[34]!==n.allPaths||e[35]!==n.bodiesFailed||e[36]!==n.bodiesPending||e[37]!==n.cardsPending||e[38]!==n.changedFilesTotal||e[39]!==n.changedFilesTruncated||e[40]!==n.diff||e[41]!==n.refresh||e[42]!==n.summary||e[43]!==h||e[44]!==f||e[45]!==p||e[46]!==m||e[47]!==b?(g={summary:n.summary,allPaths:n.allPaths,canDiscard:h,canDiscardAll:f,changedFilesTotal:n.changedFilesTotal,changedFilesTruncated:n.changedFilesTruncated,diff:n.diff,bodiesPending:n.bodiesPending,bodiesFailed:n.bodiesFailed,cardsPending:n.cardsPending,refresh:n.refresh,gate:l,headBranch:p,expectedHeadSha:m,...b,hosted:!1,otherWork:!1},e[33]=l,e[34]=n.allPaths,e[35]=n.bodiesFailed,e[36]=n.bodiesPending,e[37]=n.cardsPending,e[38]=n.changedFilesTotal,e[39]=n.changedFilesTruncated,e[40]=n.diff,e[41]=n.refresh,e[42]=n.summary,e[43]=h,e[44]=f,e[45]=p,e[46]=m,e[47]=b,e[48]=g):g=e[48];let x;return e[49]!==t||e[50]!==g?(x=r.jsx(Bn,{...t,source:g}),e[49]=t,e[50]=g,e[51]=x):x=e[51],x}function $r(t,e){return{summary:t.summary,allPaths:[],canDiscard:()=>!0,canDiscardAll:!0,changedFilesTotal:t.summary.count,changedFilesTruncated:!1,diff:null,bodiesPending:t.sidesPending,bodiesFailed:t.sidesFailed,cardsPending:!1,refresh:t.refresh,protocol:{backend:e,entries:t.entries},v8:{blocks:t.blocks}}}function Mc(t){const e=M.c(24),{backend:s,cacheKey:a,...n}=t,o=Rn({backend:s,cacheKey:a,scope:{orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch}}),c=s.source==="github",l=Et.hostedPublishReview(n.orgSlug,n.virtualMcpId,n.branch);let i;e[0]!==n.branch||e[1]!==n.orgSlug||e[2]!==n.virtualMcpId?(i=()=>ti({orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch}),e[0]=n.branch,e[1]=n.orgSlug,e[2]=n.virtualMcpId,e[3]=i):i=e[3];let u;e[4]!==c||e[5]!==l||e[6]!==i?(u={queryKey:l,queryFn:i,enabled:c,staleTime:0},e[4]=c,e[5]=l,e[6]=i,e[7]=u):u=e[7];const d=Tt(u);let h;e[8]!==s||e[9]!==o?(h=$r(o,s),e[8]=s,e[9]=o,e[10]=h):h=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f={allowed:!0,reason:null},e[11]=f):f=e[11];let p;e[12]!==d.data?.alsoChanged?(p=d.data?.alsoChanged??[],e[12]=d.data?.alsoChanged,e[13]=p):p=e[13];let m;e[14]!==p?(m=new Set(p),e[14]=p,e[15]=m):m=e[15];let b;e[16]!==c||e[17]!==n.branch||e[18]!==h||e[19]!==m?(b={...h,gate:f,headBranch:n.branch,hosted:c,alsoChanged:m,otherWork:!1},e[16]=c,e[17]=n.branch,e[18]=h,e[19]=m,e[20]=b):b=e[20];let g;return e[21]!==n||e[22]!==b?(g=r.jsx(Bn,{...n,source:b}),e[21]=n,e[22]=b,e[23]=g):g=e[23],g}function $c(t){const e=M.c(58);let s,a,n;e[0]!==t?({backend:s,cacheKey:a,...n}=t,e[0]=t,e[1]=s,e[2]=a,e[3]=n):(s=e[1],a=e[2],n=e[3]);const o=Zt()?.taskId??null;let c;e[4]!==n.branch||e[5]!==n.orgSlug||e[6]!==n.virtualMcpId?(c={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch},e[4]=n.branch,e[5]=n.orgSlug,e[6]=n.virtualMcpId,e[7]=c):c=e[7];let l;e[8]!==s||e[9]!==a||e[10]!==c?(l={backend:s,cacheKey:a,scope:c},e[8]=s,e[9]=a,e[10]=c,e[11]=l):l=e[11];const i=Rn(l);let u;e[12]!==n.baseBranch||e[13]!==n.branch||e[14]!==n.fastPreview||e[15]!==n.orgSlug||e[16]!==n.recoverSandbox||e[17]!==n.virtualMcpId||e[18]!==o?(u={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,baseBranch:n.baseBranch,fastPreview:n.fastPreview,recoverSandbox:n.recoverSandbox},e[12]=n.baseBranch,e[13]=n.branch,e[14]=n.fastPreview,e[15]=n.orgSlug,e[16]=n.recoverSandbox,e[17]=n.virtualMcpId,e[18]=o,e[19]=u):u=e[19];const d=Ir(u),h=n.mode!=="review";let f;e[20]!==d.allPaths||e[21]!==d.diff||e[22]!==d.status||e[23]!==n.branch||e[24]!==n.fastPreview||e[25]!==n.orgSlug||e[26]!==n.publishPolicy||e[27]!==n.virtualMcpId||e[28]!==h||e[29]!==o?(f={orgSlug:n.orgSlug,virtualMcpId:n.virtualMcpId,branch:n.branch,threadId:o,fastPreview:n.fastPreview,status:d.status,diff:d.diff,paths:d.allPaths,policy:n.publishPolicy,judgeEnabled:h},e[20]=d.allPaths,e[21]=d.diff,e[22]=d.status,e[23]=n.branch,e[24]=n.fastPreview,e[25]=n.orgSlug,e[26]=n.publishPolicy,e[27]=n.virtualMcpId,e[28]=h,e[29]=o,e[30]=f):f=e[30];const{gate:p}=Dr(f);let m;if(e[31]!==d.allPaths||e[32]!==i){let k;e[34]!==i?(k=N=>{const R=Cn(N);return R===null?!wn(N):!Object.hasOwn(i.changes.changes,R)},e[34]=i,e[35]=k):k=e[35],m=d.allPaths.some(k),e[31]=d.allPaths,e[32]=i,e[33]=m}else m=e[33];const b=m;let g;e[36]!==s||e[37]!==i?(g=$r(i,s),e[36]=s,e[37]=i,e[38]=g):g=e[38];let x;e[39]!==d||e[40]!==i?(x=()=>Promise.all([i.refresh(),d.refresh()]),e[39]=d,e[40]=i,e[41]=x):x=e[41];let j;e[42]!==d.status||e[43]!==n.branch?(j=Pn(d.status)??n.branch,e[42]=d.status,e[43]=n.branch,e[44]=j):j=e[44];const y=d.headSha??void 0;let v;e[45]!==d.diff?(v=d.diff?{expectedDiffSignature:Is(d.diff)}:{},e[45]=d.diff,e[46]=v):v=e[46];let P;e[47]!==p||e[48]!==b||e[49]!==y||e[50]!==v||e[51]!==g||e[52]!==x||e[53]!==j?(P={...g,refresh:x,gate:p,headBranch:j,expectedHeadSha:y,...v,hosted:!1,otherWork:b},e[47]=p,e[48]=b,e[49]=y,e[50]=v,e[51]=g,e[52]=x,e[53]=j,e[54]=P):P=e[54];let w;return e[55]!==n||e[56]!==P?(w=r.jsx(Bn,{...n,source:P}),e[55]=n,e[56]=P,e[57]=w):w=e[57],w}function Bn(t){const e=M.c(131),{source:s,publishLockRef:a,onOpenChange:n,mode:o,fastPreview:c,orgSlug:l,virtualMcpId:i,branch:u,baseBranch:d,repoTarget:h,owner:f,repo:p,draftPreviewUrl:m,destinationHost:b,previewServerUrl:g,compareDraft:x,lastPublishedPr:j,onRequestApproval:y,openPullRequest:v,onPullRequestChanged:P,onPublished:w,notLive:k}=t,N=o===void 0?"publish":o,R=j===void 0?null:j,C=v===void 0?null:v,A=k===void 0?!1:k,S=xe(),[E]=ma(),{language:$}=E,I=Zt()?.taskId??null,{data:T}=ks.useSession(),D=Pa(ja(l,i,u)),{allPaths:Y,changedFilesTotal:ae,changedFilesTruncated:H,diff:_,bodiesFailed:z,refresh:ee,gate:Q,hosted:B,otherWork:ie}=s;let U;e[0]!==x||e[1]!==s.bodiesPending||e[2]!==s.cardsPending||e[3]!==s.summary?(U={summary:s.summary,cardsPending:s.cardsPending,bodiesPending:s.bodiesPending,compareDraft:x},e[0]=x,e[1]=s.bodiesPending,e[2]=s.cardsPending,e[3]=s.summary,e[4]=U):U=e[4];const oe=U;let J;e[5]!==B?(J={hosted:B},e[5]=B,e[6]=J):J=e[6];const se=io(oe,J),{summary:F,cardsPending:te,bodiesPending:re,compareDraft:he}=se.shown,[G,pe]=q.useState(null),[Z,L]=q.useState(!1),[K,ce]=q.useState(Fc);let je;e[7]===Symbol.for("react.memo_cache_sentinel")?(je=W=>ce(be=>be.has(W)?be:new Set(be).add(W)),e[7]=je):je=e[7];const fe=je,[Ee,O]=q.useState(null);let ne;e[8]===Symbol.for("react.memo_cache_sentinel")?(ne=[],e[8]=ne):ne=e[8];const[Le,_e]=q.useState(ne);let Ue;e[9]!==s.v8?(Ue=W=>{O(W),_e(be=>[W,...be.filter(me=>me!==W)]),s.v8&&setTimeout(()=>fe(W),Cc)},e[9]=s.v8,e[10]=Ue):Ue=e[10];const mt=Ue,[st,we]=q.useState(null);let De;e[11]!==G||e[12]!==F?(De=Co(G,Ro(F)),e[11]=G,e[12]=F,e[13]=De):De=e[13];const $e=De,Be=[...F.pages,...F.blocks,...F.other],Pe=Be.find(W=>Ie(W)===Ee)??Be[0]??null,Me=Pe?Ie(Pe):null,Se=[...new Set([...Me?[Me]:[],...Le,...Be.map(Ie)])].filter(W=>Be.some(be=>Ie(be)===W)).slice(0,Rc),Fe=!!s.v8,[nt,pt]=q.useState(null),Re=Fe?Nc({selectedId:Me,readyIds:K,lastShownId:nt,liveIds:Se}):Me;Fe&&Re===Me&&Re!==nt&&pt(Re);const de=N==="review"&&!B,V=te?"loading":re?"manifest":"ready",ve=C?.state==="open",ke=s.headBranch,Ce=T?.user;let Ne;e[14]!==Ce?(Ne=ir(Ce),e[14]=Ce,e[15]=Ne):Ne=e[15];let qe;e[16]!==s.expectedDiffSignature?(qe=s.expectedDiffSignature?{expectedDiffSignature:s.expectedDiffSignature}:{},e[16]=s.expectedDiffSignature,e[17]=qe):qe=e[17];let at;e[18]!==d||e[19]!==u||e[20]!==c||e[21]!==l||e[22]!==f||e[23]!==p||e[24]!==h||e[25]!==s.expectedHeadSha||e[26]!==s.headBranch||e[27]!==Ne||e[28]!==qe||e[29]!==I||e[30]!==i?(at={orgSlug:l,virtualMcpId:i,branch:u,threadId:I,fastPreview:c,baseBranch:d,target:h,owner:f,repo:p,headBranch:ke,coAuthor:Ne,expectedHeadSha:s.expectedHeadSha,...qe},e[18]=d,e[19]=u,e[20]=c,e[21]=l,e[22]=f,e[23]=p,e[24]=h,e[25]=s.expectedHeadSha,e[26]=s.headBranch,e[27]=Ne,e[28]=qe,e[29]=I,e[30]=i,e[31]=at):at=e[31];const bt=at,gt=de?"review":"publish",We=T?.user?.name;let Je;e[32]!==Y||e[33]!==b||e[34]!==B||e[35]!==$e||e[36]!==n||e[37]!==w||e[38]!==P||e[39]!==a||e[40]!==ee||e[41]!==s.protocol||e[42]!==gt||e[43]!==We||e[44]!==bt?(Je={mode:gt,target:bt,note:$e,allPaths:Y,destinationHost:b,publishLockRef:a,onOpenChange:n,refresh:ee,onPullRequestChanged:P,onPublished:w,hosted:B,authorName:We,protocol:s.protocol},e[32]=Y,e[33]=b,e[34]=B,e[35]=$e,e[36]=n,e[37]=w,e[38]=P,e[39]=a,e[40]=ee,e[41]=s.protocol,e[42]=gt,e[43]=We,e[44]=bt,e[45]=Je):Je=e[45];const{isPublishing:Ae,publishError:rt,publishErrorDetail:lt,submit:xt,discardChange:It,discardAll:vt}=fc(Je),Xe=Na(l,i).phase==="saving",Ye=B&&A&&F.count===0,Ze=F.count>0||ie||Ye,Dt=!Ae&&Ze&&(de||Q.allowed);let it;e[46]!==d||e[47]!==de||e[48]!==Ye||e[49]!==s.v8||e[50]!==F.count||e[51]!==S?(it=de?F.count===0?S("thread.publishPopover.submitForReview"):F.count===1?S("thread.publishPopover.submitOneForReview"):S("thread.publishPopover.submitCountForReview",{count:F.count}):Ye?S("thread.publishPopover.notLive"):kc(F.count,d,!!s.v8,S),e[46]=d,e[47]=de,e[48]=Ye,e[49]=s.v8,e[50]=F.count,e[51]=S,e[52]=it):it=e[52];const yt=it;let ot;e:{if(de&&ve){let me;e[53]!==C.number||e[54]!==S?(me=S("thread.publishPopover.updatesPullRequest",{number:C.number}),e[53]=C.number,e[54]=S,e[55]=me):me=e[55],ot=me;break e}const W=R;if(!W?.mergedAt){ot=null;break e}let be;if(e[56]!==$||e[57]!==W||e[58]!==S){const me=Zr(new Date(W.mergedAt),$),Te=dc(W);be=Te?S("thread.publishPopover.lastPublishedBy",{when:me,name:Te}):S("thread.publishPopover.lastPublished",{when:me}),e[56]=$,e[57]=W,e[58]=S,e[59]=be}else be=e[59];ot=be}const Bt=ot;let Mt;e[60]!==de||e[61]!==F.count||e[62]!==S?(Mt=de?S("thread.publishPopover.submitForReview"):F.count===1?S("thread.publishPopover.publishOne"):F.count>1?S("thread.publishPopover.publishCount",{count:F.count}):S("thread.publishPopover.publish"),e[60]=de,e[61]=F.count,e[62]=S,e[63]=Mt):Mt=e[63];const _t=Mt,$t=(W,be)=>be.length===0?null:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:W}),be.map(me=>{const Te=Ie(me);return r.jsx(jr,{change:me,bodyPending:re,selected:Pe!==null&&Ie(Pe)===Te,onSelect:()=>mt(Te),confirming:st===Te,onConfirmingChange:ge=>we(ge?Te:null),onDiscard:s.canDiscard(me)?()=>{It(me)}:void 0,isPublishing:Ae,isDiscarding:Xe,v8:!!s.v8,alsoChangedOnMain:!!s.alsoChanged&&s.alsoChanged.has(me.entry?.name??me.blockKey??"")},Te)})]});let et;e:{if(de||!Ze){et=null;break e}if(Q.pending){let Te;e[64]===Symbol.for("react.memo_cache_sentinel")?(Te=r.jsx(Qt,{className:"size-3.5 motion-reduce:animate-none"}),e[64]=Te):Te=e[64];let ge;e[65]!==S?(ge=S("thread.publishPopover.reviewing"),e[65]=S,e[66]=ge):ge=e[66];let At;e[67]!==ge?(At=r.jsxs("div",{className:"flex items-center gap-2 border-t px-4 py-2.5 text-xs text-muted-foreground",children:[Te,ge]}),e[67]=ge,e[68]=At):At=e[68],et=At;break e}if(Q.allowed){et=null;break e}let W;e[69]===Symbol.for("react.memo_cache_sentinel")?(W=r.jsx(wa,{className:"mt-0.5 size-3.5 shrink-0"}),e[69]=W):W=e[69];let be;e[70]!==Q.reason||e[71]!==S?(be=Q.reason??S("thread.publishPopover.needsReviewGeneric"),e[70]=Q.reason,e[71]=S,e[72]=be):be=e[72];let me;e[73]!==be?(me=r.jsxs("div",{className:"flex items-start gap-2 border-t px-4 py-2.5 text-xs text-warning",children:[W,r.jsx("span",{children:be})]}),e[73]=be,e[74]=me):me=e[74],et=me}const wt=et;let ct;e[75]!==vt||e[76]!==Z||e[77]!==Xe||e[78]!==Ae||e[79]!==s.canDiscardAll||e[80]!==F.count||e[81]!==S?(ct=F.count<=1||!s.canDiscardAll?null:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>L(!0),disabled:Ae||Xe,children:S("thread.publishPopover.discardAll")}),r.jsx(rn,{open:Z,onOpenChange:L,children:r.jsxs(an,{children:[r.jsxs(en,{children:[r.jsx(Ys,{children:S("thread.publishPopover.discardAllTitle")}),r.jsx(Zs,{children:S("thread.publishPopover.discardAllConfirm")})]}),r.jsxs(nn,{children:[r.jsx(tn,{children:S("thread.publishDialog.cancel")}),r.jsx(sn,{onClick:()=>{vt()},disabled:Xe,className:X(ya({variant:"destructive"})),children:S("thread.publishPopover.discardAll")})]})]})})]}),e[75]=vt,e[76]=Z,e[77]=Xe,e[78]=Ae,e[79]=s.canDiscardAll,e[80]=F.count,e[81]=S,e[82]=ct):ct=e[82];const Pt=ct,jt=te?r.jsx(Yt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{})]})}):F.count===0&&ie?r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:S("thread.publishPopover.onlyOtherWork")}):Ye?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx($a,{className:"mb-1 size-5 text-muted-foreground"}),r.jsx("p",{className:"text-sm font-medium",children:S("thread.publishPopover.notLiveBody")}),r.jsx("p",{className:"text-xs text-muted-foreground",children:S("thread.publishPopover.notLiveHint")})]}):F.count===0?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(vn,{className:"mb-1 size-5 text-success"}),r.jsx("p",{className:"text-sm font-medium",children:S(de?"thread.publishPopover.nothingToSubmit":"thread.publishPopover.everythingLive")}),r.jsx("p",{className:"text-xs text-muted-foreground",children:S(de?"thread.publishPopover.submitEmptyHint":"thread.publishPopover.emptyHint")})]}):r.jsxs(Yt,{children:[H?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.showingFirst",{shown:F.count,total:ae})}):null,$t(S("thread.publishPopover.pagesGroup"),F.pages),$t(S("thread.publishPopover.blocksGroup"),F.blocks),$t(S("thread.publishPopover.otherGroup"),F.other),z?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.detailsUnavailable")}):null,ie?r.jsx("p",{className:"text-2xs text-muted-foreground",children:S("thread.publishPopover.alsoOtherWork")}):null]}),St=te?r.jsx(Tn,{}):Pe?r.jsx("div",{className:X(Xt,"relative"),children:Be.filter(W=>Se.includes(Ie(W))).map(W=>r.jsx("div",{className:X("absolute inset-0 flex",Fe?Ie(W)===Re?"z-10":"pointer-events-none opacity-0":Ie(W)!==Me&&"hidden"),inert:Fe&&Ie(W)!==Re,"aria-hidden":Fe&&Ie(W)!==Re?!0:void 0,children:r.jsx(Rr,{change:W,diff:_,bodyPending:re,previewServerUrl:g,draft:he,lastPage:D,v8:s.v8,onReady:Fe?()=>fe(Ie(W)):void 0})},Ie(W)))}):r.jsx("div",{className:X(Xt,"bg-muted/40")});let ze;e[83]!==yt?(ze=r.jsx("span",{className:"truncate",children:yt}),e[83]=yt,e[84]=ze):ze=e[84];let He;e[85]!==Pt||e[86]!==N||e[87]!==Bt||e[88]!==ze?(He=r.jsx(In,{mode:N,title:ze,subLine:Bt,trailing:Pt}),e[85]=Pt,e[86]=N,e[87]=Bt,e[88]=ze,e[89]=He):He=e[89];let Ke;e[90]!==Ae||e[91]!==de||e[92]!==$e||e[93]!==F.count||e[94]!==S?(Ke=F.count===0?null:r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"text-sm font-medium",children:S(de?"thread.publishPopover.reviewNote":"thread.publishPopover.versionNote")}),r.jsx(Gl,{value:$e,onChange:W=>pe(W.target.value),placeholder:S(de?"thread.publishPopover.reviewNotePlaceholder":"thread.publishPopover.versionNotePlaceholder"),rows:2,maxLength:vs,className:"resize-none text-sm",disabled:Ae})]}),e[90]=Ae,e[91]=de,e[92]=$e,e[93]=F.count,e[94]=S,e[95]=Ke):Ke=e[95];let Ve;e[96]!==m||e[97]!==S?(Ve=r.jsx(Dn,{draftPreviewUrl:m,t:S}),e[96]=m,e[97]=S,e[98]=Ve):Ve=e[98];let Ge;e[99]!==Dt||e[100]!==Q||e[101]!==Ze||e[102]!==B||e[103]!==Ae||e[104]!==de||e[105]!==y||e[106]!==_t||e[107]!==se||e[108]!==xt||e[109]!==S?(Ge=!de&&!B&&Ze&&!Q.allowed&&!Q.pending?r.jsx(ye,{type:"button",className:"flex-1",onClick:y,disabled:Ae,children:S("thread.publishPopover.requestApproval")}):r.jsxs(ye,{type:"button",variant:de?"default":"brand",className:"flex-1",onClick:()=>{se.hold(),xt().then(W=>{W===!1&&se.release()})},disabled:!Dt,children:[Ae?r.jsx(Qt,{className:"size-4 motion-reduce:animate-none"}):null,Ae?S(de?"thread.publishPopover.submitting":"thread.publishPopover.publishing"):_t]}),e[99]=Dt,e[100]=Q,e[101]=Ze,e[102]=B,e[103]=Ae,e[104]=de,e[105]=y,e[106]=_t,e[107]=se,e[108]=xt,e[109]=S,e[110]=Ge):Ge=e[110];let Qe;e[111]!==Ve||e[112]!==Ge?(Qe=r.jsxs("div",{className:"flex gap-2",children:[Ve,Ge]}),e[111]=Ve,e[112]=Ge,e[113]=Qe):Qe=e[113];let dt;e[114]!==rt||e[115]!==lt||e[116]!==S?(dt=rt?r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-destructive",children:rt}),lt?r.jsx(fl,{label:S("siteEditor.details"),detail:lt}):null]}):null,e[114]=rt,e[115]=lt,e[116]=S,e[117]=dt):dt=e[117];let ue;e[118]!==Qe||e[119]!==dt?(ue=r.jsxs(r.Fragment,{children:[Qe,dt]}),e[118]=Qe,e[119]=dt,e[120]=ue):ue=e[120];let ut;e[121]!==jt||e[122]!==wt||e[123]!==V||e[124]!==He||e[125]!==Ke||e[126]!==ue?(ut=r.jsx(Bs,{state:V,header:He,body:jt,note:Ke,gate:wt,footer:ue}),e[121]=jt,e[122]=wt,e[123]=V,e[124]=He,e[125]=Ke,e[126]=ue,e[127]=ut):ut=e[127];let Ht;return e[128]!==St||e[129]!==ut?(Ht=r.jsx(es,{pane:St,list:ut}),e[128]=St,e[129]=ut,e[130]=Ht):Ht=e[130],Ht}function Fc(){return new Set}function Ec(t){if(!(t==="claiming"||t==="ready"||t==="failed"))return di[t].short}const _c=new Set(["failure","timed_out","cancelled","action_required"]);function Fr(t){return t.status==="completed"&&_c.has(t.conclusion)}function Mn(t){return t.status==="queued"||t.status==="in_progress"}function ps(t){return t.isPending&&t.fetchStatus!=="idle"}function Oc(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr-page"}}function Rt(t,e,s){return e?[...t,Oc(s)]:t}function ht(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"sync",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function aa(t){return{key:"submit-for-review",label:t("thread.headerActions.submitForReview"),action:"create-pr"}}function hs(t,e,s){if(e.filter(Mn).length===0)return t;const n=e.filter(o=>o.status==="completed").length;return{...t,tooltip:s("thread.cmsActions.checksRunning",{done:n,total:e.length})}}function Lc(t){const{lifecycle:e,branch:s,pr:a,checks:n,reviews:o,loading:c,t:l}=t;if(c)return{label:l("thread.headerActions.loading"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.loadingBranchTooltip"),menu:[]};switch(e.phase){case"idle":return{label:t.claimPhase&&Ec(t.claimPhase.kind)||l("thread.headerActions.startingSandbox"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForDaemonTooltip"),menu:[]};case"cloning":return{label:l("thread.headerActions.cloningRepo"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.cloningRepoTooltip"),menu:[]};case"clone-failed":return{label:l("thread.headerActions.cloneFailed"),disabled:!0,variant:"outline",tooltip:e.error||l("thread.headerActions.cloneFailedDefaultTooltip"),menu:[]};case"checking-out":return{label:l("thread.headerActions.switchingTo",{branch:e.to}),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.checkingOutTooltip",{branch:e.to}),menu:[]};case"installing":return{label:l("thread.headerActions.installingPackages"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.installingPackagesTooltip"),menu:[]};case"starting":{if(!(s.kind==="ready"&&(s.workingTreeDirty||s.aheadOfBase>0||s.unpushed>0))&&!t.noReviewableDiff)return{label:l("thread.headerActions.startingApp"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.startingAppTooltip"),menu:[]};break}}if(s.kind!=="ready")return{label:l("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:l("thread.headerActions.waitingForBranchTooltip"),menu:[]};const i=s,u=i.unpushed>0&&!(a&&i.headSha&&a.headSha&&i.headSha===a.headSha);if(t.noReviewableDiff&&!a)return{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:ht([],i,l)};if(i.workingTreeDirty||u)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ht(Rt([aa(l)],a,l),i,l)};if(ar("no local work — checking PR/sync state",{workingTreeDirty:i.workingTreeDirty,unpushed:i.unpushed,aheadOfBase:i.aheadOfBase,behindBase:i.behindBase,branch:i.branch,base:i.base,prMerged:a?.merged??null,prState:a?.state??null}),a?.merged)return!!i.headSha&&!!a.headSha&&i.headSha!==a.headSha?{label:l("thread.headerActions.continue"),action:"create-pr",variant:"special",tooltip:l("thread.headerActions.openNewPrTooltip"),menu:ht(Rt([],a,l),i,l)}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.prMergedTooltip",{prNumber:String(a.number),base:a.base}),menu:ht(Rt([],a,l),i,l)};if(i.aheadOfBase>0){if(a&&a.state==="closed"&&!a.merged)return{label:l("thread.headerActions.reopenPr"),action:"reopen",variant:"default",tooltip:l("thread.headerActions.reopenPrTooltip",{prNumber:String(a.number)}),menu:ht(Rt([],a,l),i,l)};if(!a)return{label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:ht([aa(l)],i,l)};if((o?.mergeableState??"unknown")==="dirty")return{label:l("thread.cmsActions.getLatest"),action:"rebase",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:l("thread.cmsActions.resolveOnProvider"),action:"open-pr-page"}]};const h=n.filter(Mn).length,f=n.filter(Fr).map(m=>m.name);if(h===0&&f.length>0)return{label:l("thread.headerActions.fixChecks"),action:"fix-checks",variant:"default",tooltip:l("thread.headerActions.failingChecksTooltip",{checks:f.join(", ")}),meta:{failingChecks:f},menu:ht(Rt([{key:"publish-anyway",label:l("thread.headerActions.publishAnyway"),action:"merge",tooltip:l("thread.headerActions.squashMergeTooltip",{prNumber:String(a.number),base:a.base})}],a,l),i,l)};if(o?.draft)return hs({label:l("thread.headerActions.markReady"),action:"mark-ready",variant:"default",tooltip:l("thread.headerActions.markDraftReadyTooltip"),menu:ht(Rt([],a,l),i,l)},n,l);const p=o?.unresolvedConversations??0;return p>0?hs({label:l("thread.headerActions.addressFeedback"),action:"resolve-comments",variant:"default",tooltip:l("thread.headerActions.unresolvedConversationsTooltip",{count:String(p)}),menu:ht(Rt([],a,l),i,l)},n,l):o?.missingRequiredApprovals?hs({label:l("thread.cmsActions.waitingForReview"),action:"open-pr-page",variant:"outline",tooltip:l("thread.headerActions.waitingForApprovalsTooltip"),menu:ht(Rt([],a,l),i,l)},n,l):hs({label:l("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",meta:{publishPolicyOverride:"open"},menu:ht(Rt([{key:"review",label:l("thread.headerActions.review"),action:"review"}],a,l),i,l)},n,l)}return i.behindBase>0?{label:l("thread.cmsActions.getLatest"),action:"sync",variant:"default",tooltip:l("thread.cmsActions.getLatestTooltip"),menu:[]}:{label:l("thread.headerActions.upToDate"),disabled:!0,variant:"outline",tooltip:l("thread.headerActions.branchInSyncTooltip",{base:i.base}),menu:[]}}function ra(t){return{key:"view-change-request",label:t("thread.cmsActions.viewOnProvider"),action:"open-pr"}}function fs(t,e,s){return e.kind!=="ready"||e.behindBase<=0?t:[...t,{key:"get-latest",label:s("thread.cmsActions.getLatest"),action:"get-latest",tooltip:s("thread.cmsActions.getLatestTooltip")}]}function la(t,e,s,a){const n=e.length;if(n===0)return t;if(e.filter(Mn).length>0){const l=e.filter(u=>u.status==="completed").length,i=a("thread.cmsActions.checksRunning",{done:l,total:n});return s==="loading"?{...t,loading:!0,tooltip:i}:{...t,tooltip:i}}const c=e.filter(Fr).length;return c>0?{...t,variant:"warning",tooltip:a("thread.cmsActions.checksFailing",{failed:c,total:n})}:t}function Uc(t,e){return!!(t?.merged&&t.headSha&&e.kind==="ready"&&!e.workingTreeDirty&&e.headSha===t.headSha)}function qc(t){return ps(t.prQuery)?!0:t.pr?.state!=="open"||t.pr.merged?!1:ps(t.checksQuery)||ps(t.reviewsQuery)}function zc(t,e){return t.workingTreeDirty?!0:e!==null?e>0:t.aheadOfBase>0}function Hc(t,e){if(!t)return{branchMeta:{kind:"unknown"},publishableChangeCount:null};const s=Object.keys(t.changes).length;return{branchMeta:{kind:"ready",branch:e,base:t.base.resolvedRef??"main",workingTreeDirty:!1,unpushed:0,aheadOfBase:s,behindBase:0,headSha:t.revision},publishableChangeCount:s}}function Kc(t,e){return e?.notLive&&!t.action&&!t.loading?{label:e.t("thread.publishPopover.publish"),action:"publish",variant:"brand",tooltip:e.t("thread.cmsActions.notLiveTooltip"),status:e.t("thread.cmsActions.notLive"),menu:[]}:{...t,menu:[]}}function Vc(t){if(!t)return!1;const{current:e,commits:s}=t;return e?s.findIndex(a=>a.sha===e.revision)>0:!1}function Gc(t){const{branch:e,pr:s,checks:a,reviews:n,publishing:o,saving:c,loading:l,publishableChangeCount:i,t:u}=t;if(e.kind!=="ready"&&t.statusError)return{label:u("thread.cmsActions.retry"),action:"retry-status",variant:"outline",disabled:t.statusRetrying,loading:t.statusRetrying,tooltip:t.statusError,menu:[]};if(l||e.kind!=="ready")return{label:u("thread.headerActions.loading"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(o)return{label:u("thread.cmsActions.publishing"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(t.syncing)return{label:u("thread.cmsActions.gettingLatest"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(c)return{label:u("thread.headerActions.saving"),variant:"outline",disabled:!0,loading:!0,menu:[]};if(s&&s.state==="open"&&!s.merged?s:null){const h=n?.mergeableState??"unknown";return h==="dirty"?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[{key:"resolve-on-provider",label:u("thread.cmsActions.resolveOnProvider"),action:"open-pr"}]}:h==="blocked"||n?.draft?la({label:u("thread.cmsActions.waitingForReview"),action:"open-pr",variant:"outline",menu:fs([ra(u)],e,u)},a,"loading",u):la({label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:fs([ra(u)],e,u)},a,"none",u)}return Uc(s,e)?{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:fs([],e,u)}:zc(e,i)?{label:u("thread.cmsActions.reviewAndPublish"),action:"publish",variant:"brand",menu:fs([{key:"request-approval",label:u("thread.headerActions.submitForReview"),action:"request-approval"}],e,u)}:e.behindBase>0?{label:u("thread.cmsActions.getLatest"),action:"get-latest",variant:"default",tooltip:u("thread.cmsActions.getLatestTooltip"),menu:[],autoRun:e.aheadOfBase===0}:{label:u("thread.headerActions.upToDate"),variant:"outline",disabled:!0,menu:[]}}function Qc(t){return t.conflicting===!0?"dirty":t.conflicting===null?"unknown":t.reviewBlocked||t.unresolvedConversations>0?"blocked":"clean"}function Er(t){const e=M.c(4);let s;e[0]!==t?(s=Ml(t),e[0]=t,e[1]=s):s=e[1];let a;return e[2]!==s?(a={...s,select:Wc},e[2]=s,e[3]=a):a=e[3],Tt(a)}function Wc(t){const e=t.changeRequest;return e?{draft:e.draft,mergeableState:Qc(e),unresolvedConversations:e.unresolvedConversations,missingRequiredApprovals:e.reviewBlocked}:null}function ia(t,e){return t==="open-pr"||e==="resolve-on-provider"?r.jsx(Ga,{size:16}):t==="publish"?r.jsx(Fa,{className:"size-4"}):t==="get-latest"||t==="retry-status"?r.jsx(cn,{className:"size-4"}):r.jsx(Rs,{className:"size-4"})}function Jc(t){const e=M.c(65),{virtualMcpId:s}=t,a=xe(),{org:n}=Cs(),o=Ns(),c=pn(s),{data:l}=ks.useSession(),{deleteRelease:i}=hn(s),{currentBranch:u,setCurrentTaskBranch:d,taskId:h,createTask:f}=Sa();let p;e[0]===Symbol.for("react.memo_cache_sentinel")?(p={open:!1,mode:"publish"},e[0]=p):p=e[0];const[m,b]=q.useState(p);let g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=V=>b({open:!0,mode:V}),e[1]=g):g=e[1];const x=g,j=qa(c),y=j.status==="attached"||j.status==="public-clone"?j.repo:null,{previewServerUrl:v}=bn(s),P=u?Pa(ja(n.slug,s,u)):null,w=P?xn(P.path,P.params):"/",k=El(u?{orgSlug:n.slug,virtualMcpId:s,branch:u,previewServerUrl:v,path:w}:null);let N;e[2]!==u||e[3]!==n.slug||e[4]!==s?(N=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[2]=u,e[3]=n.slug,e[4]=s,e[5]=N):N=e[5];const R=_l(N),C=qt(s,u),A=C.kind==="protocol"&&C.source==="github";let S;e[6]!==u||e[7]!==n.slug||e[8]!==s?(S=u?{orgSlug:n.slug,virtualMcpId:s,branch:u}:null,e[6]=u,e[7]=n.slug,e[8]=s,e[9]=S):S=e[9];const E=un(S),$=Aa(A?C:null,E);let I;e[10]!==A?(I={enabled:A},e[10]=A,e[11]=I):I=e[11];const T=si(n.slug,s,I),D=A&&Vc(T.data?.pages[0]);let Y;e[12]!==n.slug||e[13]!==s?(Y=ml(n.slug,s),e[12]=n.slug,e[13]=s,e[14]=Y):Y=e[14];const ae=Ol(Y,A?R:null),H=A?Ll(v,w,ae):k.url,_=u??"",z=h??null;let ee;e[15]!==n.slug||e[16]!==_||e[17]!==z||e[18]!==s?(ee=Za({orgSlug:n.slug,virtualMcpId:s,branch:_,threadId:z}),e[15]=n.slug,e[16]=_,e[17]=z,e[18]=s,e[19]=ee):ee=e[19];const Q=!!u&&C.kind!=="pending"&&!A;let B;e[20]!==Q||e[21]!==ee?(B={...ee,enabled:Q},e[20]=Q,e[21]=ee,e[22]=B):B=e[22];const ie=Tt(B),U=A?null:ie.data??null,oe=A?Hc($.data,u??""):null,J=oe?oe.branchMeta:U?{kind:"ready",branch:Pn(U)??u??"",base:U.base??"main",workingTreeDirty:yi(U),unpushed:U.unpushed??0,aheadOfBase:U.aheadOfBase??0,behindBase:U.behindBase??0,headSha:U.headSha??""}:{kind:"unknown"},se=oe?oe.publishableChangeCount:U?.changedFiles?yr({files:U.changedFiles}).count:null,F=A?$:ie,te=(J.kind==="ready"?J.branch:null)??u??null,re=J.kind==="ready"?J.base:"main",he=za({orgId:n.id,orgSlug:n.slug,target:tt(y),owner:y?.owner??"",repo:y?.name??"",branch:te}),G=he.data??null,pe=Ha({orgId:n.id,orgSlug:n.slug,target:tt(y),owner:y?.owner??"",repo:y?.name??"",base:re}),Z=Ka({orgId:n.id,orgSlug:n.slug,target:tt(y),owner:y?.owner??"",repo:y?.name??"",branch:te}),L=Er({orgId:n.id,orgSlug:n.slug,target:tt(y),owner:y?.owner??"",repo:y?.name??"",branch:te});let K;e[23]!==Z||e[24]!==G||e[25]!==he||e[26]!==L?(K=qc({pr:G,prQuery:he,checksQuery:Z,reviewsQuery:L}),e[23]=Z,e[24]=G,e[25]=he,e[26]=L,e[27]=K):K=e[27];const ce=K;let je;e[28]!==he?(je=async()=>{await he.refetch()},e[28]=he,e[29]=je):je=e[29];const fe=je,Ee=Fn({mutationFn:()=>ro({hosted:A,branch:u,baseBranch:re,nextBranch:()=>fn(mn(l?.user)),setCurrentTaskBranch:d,deleteRelease:i}),onError:Zc});let O;e[30]!==n.slug||e[31]!==h||e[32]!==s?(O=async V=>(await Ya({orgSlug:n.slug,virtualMcpId:s,branch:V.branch,threadId:h??null},V.base),V),e[30]=n.slug,e[31]=h,e[32]=s,e[33]=O):O=e[33];let ne;e[34]!==u||e[35]!==n.slug||e[36]!==o||e[37]!==a||e[38]!==h||e[39]!==s?(ne=async V=>{Oe.success(a("thread.headerActions.syncedWithBase",{base:V.base})),await Promise.all([o.invalidateQueries({queryKey:sr({orgSlug:n.slug,virtualMcpId:s,branch:u??V.branch,threadId:h??null})}),o.invalidateQueries({queryKey:Et.decofile(`${n.slug}/${s}/${V.branch}`)})])},e[34]=u,e[35]=n.slug,e[36]=o,e[37]=a,e[38]=h,e[39]=s,e[40]=ne):ne=e[40];let Le;e[41]!==O||e[42]!==ne?(Le={mutationFn:O,onSuccess:ne,onError:Yc},e[41]=O,e[42]=ne,e[43]=Le):Le=e[43];const _e=Fn(Le),Ue=Ra(n.slug,s),mt=Ee.isPending,st=Gc({branch:J,pr:G,checks:Z.data??[],reviews:L.data??null,publishing:mt,saving:Ue,syncing:_e.isPending,statusRetrying:F.isFetching&&!!F.error,statusError:F.error instanceof Error?F.error.message:F.error?String(F.error):null,loading:!!ce,publishableChangeCount:se,t:a}),we=A?Kc(st,{notLive:D,t:a}):st,De=we.autoRun&&J.kind==="ready"&&y&&v?`${te}@${J.headSha}`:null,$e=q.useRef(null);if(q.useEffect(()=>{!De||!te||$e.current!==De&&($e.current=De,_e.mutate({branch:te,base:re}))},[De,te,re,_e]),j.status==="detached"){let V;e[44]!==a?(V=a("thread.headerActions.reconnectGithub"),e[44]=a,e[45]=V):V=e[45];let ve;e[46]!==V?(ve=r.jsx(Ct,{asChild:!0,children:r.jsx("span",{children:r.jsx(ye,{size:"sm",variant:"outline",disabled:!0,children:V})})}),e[46]=V,e[47]=ve):ve=e[47];let ke;e[48]!==a?(ke=a("thread.headerActions.githubConnectionRemoved"),e[48]=a,e[49]=ke):ke=e[49];let Ce;e[50]!==ke?(Ce=r.jsx(Nt,{children:ke}),e[50]=ke,e[51]=Ce):Ce=e[51];let Ne;return e[52]!==ve||e[53]!==Ce?(Ne=r.jsx(As,{children:r.jsxs(kt,{children:[ve,Ce]})}),e[52]=ve,e[53]=Ce,e[54]=Ne):Ne=e[54],Ne}if(!c)return null;if(!y||!v){const V=y?"noPreviewServer":"noRepo";let ve;e[55]!==u||e[56]!==f?(ve=u?()=>{const Ce=f?.({runtime:"sandbox",branch:u});Ce&&el("coding_session_started",{thread_id:Ce})}:void 0,e[55]=u,e[56]=f,e[57]=ve):ve=e[57];let ke;return e[58]!==V||e[59]!==ve?(ke=r.jsx(ed,{reason:V,onStartCodingSession:ve}),e[58]=V,e[59]=ve,e[60]=ke):ke=e[60],ke}if(!u)return null;const Be=V=>{switch(V){case"publish":{x("publish");return}case"request-approval":{x("review");return}case"get-latest":{if(!te||_e.isPending)return;_e.mutate({branch:te,base:re});return}case"retry-status":{F.refetch();return}case"open-pr":{G?.htmlUrl&&window.open(G.htmlUrl,"_blank","noopener,noreferrer");return}}};let Pe;e[61]!==Be?(Pe=V=>({key:V.key,label:V.label,icon:ia(V.action,V.key),...V.tooltip?{tooltip:V.tooltip}:{},onSelect:()=>Be(V.action)}),e[61]=Be,e[62]=Pe):Pe=e[62];const Me=we.menu.map(Pe),Se=we.action,Fe=we.label,nt=we.variant,pt=!!we.loading;let Re;e[63]!==a?(Re=a("thread.cmsActions.moreActionsAriaLabel"),e[63]=a,e[64]=Re):Re=e[64];const de=r.jsx(lr,{size:"sm",label:Fe,variant:nt,disabled:!!we.disabled||!Se,loading:pt,...Se&&!we.loading?{icon:ia(Se)}:{},...we.tooltip?{tooltip:we.tooltip}:{},items:Me,menuAriaLabel:Re,onClick:Se?()=>Be(Se):void 0});return r.jsxs(r.Fragment,{children:[we.status?r.jsx("span",{className:"mr-1 hidden shrink-0 text-xs text-muted-foreground sm:inline",children:we.status}):null,de,u?r.jsx(Br,{open:m.open,mode:m.mode,fastPreview:!0,notLive:D,onOpenChange:V=>{V||b(Xc)},orgSlug:n.slug,virtualMcpId:s,branch:u,baseBranch:re,repoTarget:tt(y),owner:y.owner,repo:y.name,publishPolicy:tr(c?.metadata?.publishPolicy),draftPreviewUrl:H,destinationHost:k.host,previewServerUrl:v,compareDraft:R?{kind:"pointer",pointer:R,...ae?{link:ae}:{}}:null,lastPublishedPr:pe.data??null,onRequestApproval:()=>x("review"),openPullRequest:G?.state==="open"?G:null,onPullRequestChanged:fe,onPublished:()=>Ee.mutateAsync()}):null]})}function Xc(t){return{...t,open:!1}}function Yc(t){Oe.error(t instanceof Error?t.message:String(t))}function Zc(t){console.error("site editor: settling after publish failed",t)}function ed(t){const e=M.c(14),{reason:s,onStartCodingSession:a}=t,n=xe(),o=!a;let c;e[0]!==n?(c=n("sandbox.cmsUnavailable.startCodingSession"),e[0]=n,e[1]=c):c=e[1];let l;e[2]!==a||e[3]!==o||e[4]!==c?(l=r.jsx(Ct,{asChild:!0,children:r.jsx("span",{children:r.jsx(ye,{size:"sm",variant:"outline",disabled:o,onClick:a,children:c})})}),e[2]=a,e[3]=o,e[4]=c,e[5]=l):l=e[5];let i;e[6]!==s||e[7]!==n?(i=n(s==="noPreviewServer"?"sandbox.cmsUnavailable.noPreviewServer":"sandbox.cmsUnavailable.noRepo"),e[6]=s,e[7]=n,e[8]=i):i=e[8];let u;e[9]!==i?(u=r.jsx(Nt,{children:i}),e[9]=i,e[10]=u):u=e[10];let d;return e[11]!==l||e[12]!==u?(d=r.jsx(As,{children:r.jsxs(kt,{children:[l,u]})}),e[11]=l,e[12]=u,e[13]=d):d=e[13],d}const zt="The user clicked this action deliberately — execute directly. Do not call user_ask unless you hit an actual problem outside the scope of this intent (missing auth, unresolvable conflict, a check with multiple plausible fixes).";function td(t){return`Reopen PR #${t.prNumber}. ${zt}`}function sd(t){return`Rebase \`${t.branch}\` on the latest base and force-push with --force-with-lease. ${zt}`}function nd(t){return`Sync \`${t.branch}\` with everyone else's work: \`git add -A\`, commit any pending local changes with a concise conventional-commit message (skip if the working tree is clean), \`git pull --rebase\` to bring in anything pushed directly to \`origin/${t.branch}\`, then \`git rebase origin/${t.base}\` to catch up with the base branch. Resolve any conflicts that come up, then push the result (force-with-lease only if the rebase rewrote commits already on the remote). ${zt}`}function ad(t){const e=(t.failingChecks??[]).map(s=>`\`${s}\``).join(", ");return`PR #${t.prNumber} has failing checks: ${e}. For each: read the logs, diagnose the root cause, apply the smallest fix that makes it pass, commit, and push. ${zt}`}function rd(t){return`Mark PR #${t.prNumber} ready for review. ${zt}`}function ld(t){return`Read the unresolved review threads on PR #${t.prNumber}. For each thread: understand the reviewer's ask, apply the needed changes, commit, push, reply explaining what changed, and resolve the thread. If a comment is a question that doesn't need a code change, reply with the answer and resolve. ${zt}`}function id(t){return`Review PR #${t.prNumber}. Read the full diff, analyze every changed file for correctness, security, code quality, and alignment with the repo's patterns. Post specific line-level review comments on concerns, then submit an overall review (approve / request changes / comment) with a concise summary. Do not modify the code — this is a read-and-comment pass. ${zt}`}function oa(t){switch(t){case"publish":return r.jsx(Fa,{className:"size-4"});case"create-pr":case"reopen":return r.jsx(Rs,{className:"size-4"});case"rebase":case"sync":return r.jsx(cn,{className:"size-4"});case"fix-checks":return r.jsx(wa,{className:"size-4"});case"mark-ready":return r.jsx(vn,{className:"size-4"});case"resolve-comments":return r.jsx(kl,{className:"size-4"});case"merge":return r.jsx(ai,{className:"size-4"});case"review":return r.jsx(xs,{className:"size-4"});case"open-pr-page":return r.jsx(Ga,{size:16})}}const ca=new Set(["reopen","rebase","fix-checks","mark-ready","resolve-comments","review","sync"]),da=new Set(["publish","create-pr"]);function od(t){const e=M.c(44),{t:s,button:a,actionBusy:n,changeRequestPending:o,savePending:c,onAction:l}=t,i=a.action;let u;e[0]!==i||e[1]!==n?(u=n&&i!==void 0&&ca.has(i),e[0]=i,e[1]=n,e[2]=u):u=e[2];const d=u,h=o&&i==="merge";let f;e[3]!==i||e[4]!==c?(f=c&&i!==void 0&&da.has(i),e[3]=i,e[4]=c,e[5]=f):f=e[5];const p=f,m=!!a.disabled||d||h||p||!i,b=!!a.loading||h;let g;e[6]!==a.tooltip||e[7]!==d||e[8]!==p||e[9]!==s?(g=d?s("thread.headerActions.chatIsRunning"):p?s("thread.headerActions.saving"):a.tooltip,e[6]=a.tooltip,e[7]=d,e[8]=p,e[9]=s,e[10]=g):g=e[10];const x=g;let j;if(e[11]!==n||e[12]!==a.menu||e[13]!==o||e[14]!==l||e[15]!==c||e[16]!==s){let A;e[18]!==n||e[19]!==o||e[20]!==l||e[21]!==c||e[22]!==s?(A=S=>{const E=n&&ca.has(S.action),$=c&&da.has(S.action),I=S.action==="merge"&&o,T=$?s("thread.headerActions.saving"):E?s("thread.headerActions.chatIsRunning"):S.tooltip;return{key:S.key,label:S.label,icon:oa(S.action),disabled:!!(E||$||I),...T?{tooltip:T}:{},onSelect:()=>l(S.action)}},e[18]=n,e[19]=o,e[20]=l,e[21]=c,e[22]=s,e[23]=A):A=e[23],j=a.menu.map(A),e[11]=n,e[12]=a.menu,e[13]=o,e[14]=l,e[15]=c,e[16]=s,e[17]=j}else j=e[17];const y=j,v=a.label,P=a.variant;let w;e[24]!==i||e[25]!==b?(w=i&&!b?{icon:oa(i)}:{},e[24]=i,e[25]=b,e[26]=w):w=e[26];let k;e[27]!==x?(k=x?{tooltip:x}:{},e[27]=x,e[28]=k):k=e[28];let N;e[29]!==s?(N=s("thread.headerActions.moreActionsAriaLabel"),e[29]=s,e[30]=N):N=e[30];let R;e[31]!==i||e[32]!==l?(R=i?()=>l(i):void 0,e[31]=i,e[32]=l,e[33]=R):R=e[33];let C;return e[34]!==a.label||e[35]!==a.variant||e[36]!==m||e[37]!==y||e[38]!==b||e[39]!==w||e[40]!==k||e[41]!==N||e[42]!==R?(C=r.jsx(lr,{size:"sm",label:v,variant:P,disabled:m,loading:b,...w,...k,items:y,menuAriaLabel:N,onClick:R}),e[34]=a.label,e[35]=a.variant,e[36]=m,e[37]=y,e[38]=b,e[39]=w,e[40]=k,e[41]=N,e[42]=R,e[43]=C):C=e[43],C}function cd(t){const e=M.c(9),{label:s,children:a}=t;if(!s){let l;return e[0]!==a?(l=r.jsx(r.Fragment,{children:a}),e[0]=a,e[1]=l):l=e[1],l}let n;e[2]!==a?(n=r.jsx(Ct,{asChild:!0,children:r.jsx("span",{children:a})}),e[2]=a,e[3]=n):n=e[3];let o;e[4]!==s?(o=r.jsx(Nt,{children:s}),e[4]=s,e[5]=o):o=e[5];let c;return e[6]!==n||e[7]!==o?(c=r.jsx(As,{children:r.jsxs(kt,{children:[n,o]})}),e[6]=n,e[7]=o,e[8]=c):c=e[8],c}function dd(t){return{label:t("thread.headerActions.loadingBranch"),disabled:!0,loading:!0,variant:"outline",tooltip:t("thread.headerActions.waitingForSandboxBranchTooltip"),menu:[]}}function ud({virtualMcpId:t}){const e=xe(),{org:s}=Cs(),{data:a}=ks.useSession(),n=pn(t),{deleteRelease:o}=hn(t),{currentBranch:c,setCurrentTaskBranch:l,createTask:i,taskId:u}=Sa(),d=al(),{openSidePanel:h}=bl(),[f,p]=q.useState({open:!1,mode:"publish",policyOverride:null}),m=Ci({connectionId:tl,orgId:s.id,orgSlug:s.slug}),b=Ai(m),[g,x]=q.useState(!1),j=q.useRef(""),y=qa(n),v=y.status==="attached"||y.status==="public-clone"?y.repo:null,{lifecycle:P,branch:w,phase:k}=Ni(),N={orgSlug:s.slug,virtualMcpId:t,branch:c??"",threadId:u??null},C=Tt({queryKey:sr(N),queryFn:()=>yn(N),enabled:!!c,staleTime:15e3,refetchInterval:K=>Ls(K.state.data)?5e3:!1}).data??null,A=w,S=P,E=A.kind==="ready"?A.branch:null,$=c??E??void 0,I=(A.kind==="ready"?A.branch:null)??$??null,T=za({orgId:s.id,orgSlug:s.slug,target:tt(v),owner:v?.owner??"",repo:v?.name??"",branch:I}),D=T.data??null,Y=Ka({orgId:s.id,orgSlug:s.slug,target:tt(v),owner:v?.owner??"",repo:v?.name??"",branch:I}),ae=Er({orgId:s.id,orgSlug:s.slug,target:tt(v),owner:v?.owner??"",repo:v?.name??"",branch:I}),H=Ha({orgId:s.id,orgSlug:s.slug,target:tt(v),owner:v?.owner??"",repo:v?.name??"",base:A.kind==="ready"?A.base:null}),_=A,z=tr(n?.metadata?.publishPolicy),ee=Ra(s.slug,t),{previewUrl:Q}=Ri(),{previewServerUrl:B,projectDefault:ie}=bn(t);if(y.status==="detached")return r.jsx(cd,{label:e("thread.headerActions.githubConnectionRemoved"),children:r.jsx(ye,{size:"sm",variant:"outline",disabled:!0,children:e("thread.headerActions.reconnectGithub")})});if(!v)return null;const U=I?Lc({lifecycle:S,branch:_,claimPhase:k,pr:D,checks:Y.data??[],reviews:ae.data??null,noReviewableDiff:Ls(C),loading:ps(T),t:e}):dd(e),oe=JSON.stringify({label:U.label,branchKind:_.kind,workingTreeDirty:_.kind==="ready"?_.workingTreeDirty:null,unpushed:_.kind==="ready"?_.unpushed:null,aheadOfBase:_.kind==="ready"?_.aheadOfBase:null,lifecycle:S.phase,headBranch:I,noReviewableDiff:Ls(C)});j.current!==oe&&(j.current=oe,ar("header button",{label:U.label,tooltip:U.tooltip,action:U.action,chatBranch:c,sandboxBranch:E,sandboxRouteBranch:$,headBranch:I,branchMeta:A,effectiveBranchMeta:_,lifecyclePhase:S.phase,prNumber:D?.number??null,prState:D?.state??null}));const J=K=>(h(),d.sendMessage({parts:[{type:"text",text:K}]})),se=d.isStreaming,F=_.kind==="ready"?_.base:"main",te=async()=>{await T.refetch()},re=async()=>{const K=c,ce=fn(mn(a?.user));ie==="cms"?i({runtime:"cms",branch:ce}):await l(ce),K&&K!==F&&await o(K)},he=async K=>{if(!(!v||g)){x(!0);try{const ce=ir(a?.user);await dr(s.slug,tt(v),{number:K,coAuthor:ce}),Oe.success(e("thread.headerActions.publishedPr",{prNumber:String(K)})),await te(),await re()}catch(ce){Oe.error(ce instanceof cr?ce.detail??uo(ce.reason,e):ce instanceof Error?ce.message:e("thread.headerActions.failedToMergePullRequest"))}finally{x(!1)}}},G=(K,ce)=>p({open:!0,mode:K,policyOverride:ce}),pe=K=>{if(I)switch(K){case"publish":G("publish",U.meta?.publishPolicyOverride??null);return;case"create-pr":G("review",null);return;case"merge":D&&he(D.number);return;case"sync":if(se)return;J(nd({branch:I,base:F}));return;case"open-pr-page":D?.htmlUrl&&window.open(D.htmlUrl,"_blank","noopener,noreferrer");return;case"review":if(se)return;D&&J(id({prNumber:D.number}));return;case"reopen":if(se)return;D&&J(td({prNumber:D.number}));return;case"rebase":if(se)return;J(sd({branch:I}));return;case"fix-checks":if(se)return;D&&J(ad({prNumber:D.number,failingChecks:U.meta?.failingChecks??[]}));return;case"mark-ready":if(se)return;D&&J(rd({prNumber:D.number}));return;case"resolve-comments":if(se)return;D&&J(ld({prNumber:D.number}));return}},Z=g||se,L=r.jsx(od,{t:e,button:U,actionBusy:Z,changeRequestPending:g,savePending:ee,onAction:pe});return $?r.jsxs(r.Fragment,{children:[L,r.jsx(Br,{open:f.open,mode:f.mode,fastPreview:!1,recoverSandbox:()=>b.mutateAsync({virtualMcpId:t,branch:$,...u?{threadId:u}:{}}),onOpenChange:K=>{K||p(ce=>({...ce,open:!1}))},orgSlug:s.slug,virtualMcpId:t,branch:$,baseBranch:F,repoTarget:tt(v),owner:v.owner,repo:v.name,publishPolicy:f.policyOverride??z,draftPreviewUrl:Q,destinationHost:null,previewServerUrl:B,compareDraft:Q?{kind:"sandbox",previewUrl:Q}:null,lastPublishedPr:H.data??null,onRequestApproval:()=>p(K=>({...K,open:!0,mode:"review"})),openPullRequest:D?.state==="open"?D:null,onPullRequestChanged:te,onPublished:re})]}):L}function hd(t){const e=M.c(33),{orgSlug:s,virtualMcpId:a,branch:n}=t,o=xe(),[c,l]=q.useState(!1),i=qt(a,n),u=i.kind==="protocol"&&i.source==="local"?i:null;let d;e[0]!==n||e[1]!==s||e[2]!==a?(d=n?{orgSlug:s,virtualMcpId:a,branch:n}:null,e[0]=n,e[1]=s,e[2]=a,e[3]=d):d=e[3];const h=un(d),{data:f}=Aa(u,h);if(!u||!h||!n)return null;let p;e[4]!==f?(p=f?Object.keys(f.changes).length:0,e[4]=f,e[5]=p):p=e[5];const m=p;let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=()=>l(!0),e[6]=b):b=e[6];let g;e[7]!==m||e[8]!==o?(g=m>0?o("decoServe.changes.buttonCount",{count:m}):o("decoServe.changes.button"),e[7]=m,e[8]=o,e[9]=g):g=e[9];let x;e[10]!==g?(x=r.jsx(ye,{size:"sm",variant:"outline","data-testid":"local-changes-button",onClick:b,children:g}),e[10]=g,e[11]=x):x=e[11];let j;e[12]!==o?(j=o("decoServe.changes.title"),e[12]=o,e[13]=j):j=e[13];let y;e[14]!==j?(y=r.jsx(ba,{className:"sr-only",children:j}),e[14]=j,e[15]=y):y=e[15];let v;e[16]!==n||e[17]!==h||e[18]!==u||e[19]!==c||e[20]!==s||e[21]!==o||e[22]!==a?(v=c?r.jsx(xa,{children:N=>{const{reset:R}=N;return r.jsx(va,{fallback:C=>{const{resetError:A}=C;return r.jsx(Js,{title:o("decoServe.changes.title"),body:r.jsx("p",{className:"px-4 py-6 text-xs text-muted-foreground",children:o("decoServe.changes.loadFailed")}),onClose:()=>{R(),A(),l(!1)}})},children:r.jsx(q.Suspense,{fallback:r.jsx(es,{pane:r.jsx(Tn,{}),list:r.jsx(Js,{title:o("decoServe.changes.title"),loading:!0,body:r.jsx(Yt,{children:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx(Ut,{}),r.jsx(Ut,{})]})}),onClose:()=>l(!1)})}),children:r.jsx(fd,{orgSlug:s,virtualMcpId:a,branch:n,backend:u,cacheKey:h,onClose:()=>l(!1)})})})}}):null,e[16]=n,e[17]=h,e[18]=u,e[19]=c,e[20]=s,e[21]=o,e[22]=a,e[23]=v):v=e[23];let P;e[24]!==y||e[25]!==v?(P=r.jsxs(ga,{"aria-describedby":void 0,className:"flex h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-none flex-col md:flex-row md:h-[calc(100dvh-6rem)] md:w-[calc(100vw-6rem)] gap-0 overflow-hidden p-0 sm:max-w-none",closeButtonClassName:"top-3.5 right-3.5",children:[y,v]}),e[24]=y,e[25]=v,e[26]=P):P=e[26];let w;e[27]!==c||e[28]!==P?(w=r.jsx(pa,{open:c,onOpenChange:l,children:P}),e[27]=c,e[28]=P,e[29]=w):w=e[29];let k;return e[30]!==w||e[31]!==x?(k=r.jsxs(r.Fragment,{children:[x,w]}),e[30]=w,e[31]=x,e[32]=k):k=e[32],k}function Js(t){const e=M.c(22),{title:s,trailing:a,body:n,loading:o,onClose:c}=t,l=o===void 0?!1:o,i=xe(),u=l?"loading":"ready";let d;e[0]!==s?(d=r.jsx("span",{className:"truncate",children:s}),e[0]=s,e[1]=d):d=e[1];let h;e[2]!==d||e[3]!==a?(h=r.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[d,a]}),e[2]=d,e[3]=a,e[4]=h):h=e[4];let f;e[5]!==i?(f=i("decoServe.changes.hint"),e[5]=i,e[6]=f):f=e[6];let p;e[7]!==f?(p=r.jsx("p",{className:"text-2xs text-muted-foreground",children:r.jsx(Ja,{text:f})}),e[7]=f,e[8]=p):p=e[8];let m;e[9]!==i?(m=i("decoServe.changes.close"),e[9]=i,e[10]=m):m=e[10];let b;e[11]!==c||e[12]!==m?(b=r.jsx(ye,{type:"button",variant:"outline",className:"w-full",onClick:c,children:m}),e[11]=c,e[12]=m,e[13]=b):b=e[13];let g;e[14]!==p||e[15]!==b?(g=r.jsxs(r.Fragment,{children:[p,b]}),e[14]=p,e[15]=b,e[16]=g):g=e[16];let x;return e[17]!==n||e[18]!==u||e[19]!==h||e[20]!==g?(x=r.jsx(Bs,{state:u,header:h,body:n,footer:g}),e[17]=n,e[18]=u,e[19]=h,e[20]=g,e[21]=x):x=e[21],x}function fd(t){const e=M.c(54),{orgSlug:s,virtualMcpId:a,branch:n,backend:o,cacheKey:c,onClose:l}=t,i=xe();let u;e[0]!==n||e[1]!==s||e[2]!==a?(u={orgSlug:s,virtualMcpId:a,branch:n},e[0]=n,e[1]=s,e[2]=a,e[3]=u):u=e[3];let d;e[4]!==o||e[5]!==c||e[6]!==u?(d={backend:o,cacheKey:c,scope:u},e[4]=o,e[5]=c,e[6]=u,e[7]=d):d=e[7];const h=Rn(d);let f;e[8]!==n||e[9]!==s||e[10]!==h.refresh||e[11]!==a?(f={orgSlug:s,virtualMcpId:a,branch:n,refresh:h.refresh},e[8]=n,e[9]=s,e[10]=h.refresh,e[11]=a,e[12]=f):f=e[12];const p=Tr(f),m=Na(s,a).phase==="saving",b=o.describe.readOnly,[g,x]=q.useState(null),[j,y]=q.useState(null),[v,P]=q.useState(!1),{summary:w}=h;let k,N,R,C,A;if(e[13]!==g||e[14]!==o||e[15]!==j||e[16]!==p||e[17]!==v||e[18]!==m||e[19]!==b||e[20]!==h.blocks||e[21]!==h.entries||e[22]!==h.sidesFailed||e[23]!==h.sidesPending||e[24]!==w.blocks||e[25]!==w.count||e[26]!==w.pages||e[27]!==i){const $=[...w.pages,...w.blocks],I=$.find(ae=>Ie(ae)===g)??$[0]??null;let T;e[33]!==w.count||e[34]!==i?(T=w.count===0?i("decoServe.changes.title"):w.count===1?i("decoServe.changes.titleOne"):i("decoServe.changes.titleCount",{count:w.count}),e[33]=w.count,e[34]=i,e[35]=T):T=e[35],A=T;const D=(ae,H)=>H.length===0?null:r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("div",{className:"px-0.5 text-2xs font-medium text-muted-foreground",children:ae}),H.map(_=>{const z=Ie(_);return r.jsx(jr,{change:_,bodyPending:h.sidesPending,v8:!0,selected:I!==null&&Ie(I)===z,onSelect:()=>x(z),confirming:j===z,onConfirmingChange:ee=>y(ee?z:null),onDiscard:b||!_.entry?void 0:()=>{p(o,[_.entry],i("thread.publishPopover.discarded",{name:_.name}))},isPublishing:!1,isDiscarding:m},z)})]});let Y;e[36]!==o||e[37]!==p||e[38]!==v||e[39]!==m||e[40]!==b||e[41]!==h.entries||e[42]!==w.count||e[43]!==i?(Y=b||w.count<=1?null:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"ml-auto shrink-0 text-2xs text-muted-foreground transition-colors hover:text-destructive disabled:opacity-50",onClick:()=>P(!0),disabled:m,children:i("thread.publishPopover.discardAll")}),r.jsx(rn,{open:v,onOpenChange:P,children:r.jsxs(an,{children:[r.jsxs(en,{children:[r.jsx(Ys,{children:i("thread.publishPopover.discardAllTitle")}),r.jsx(Zs,{children:i("thread.publishPopover.discardAllConfirm")})]}),r.jsxs(nn,{children:[r.jsx(tn,{children:i("thread.publishDialog.cancel")}),r.jsx(sn,{onClick:()=>{p(o,h.entries,i("thread.publishDialog.allChangesDiscarded"))},disabled:m,className:X(ya({variant:"destructive"})),children:i("thread.publishPopover.discardAll")})]})]})})]}),e[36]=o,e[37]=p,e[38]=v,e[39]=m,e[40]=b,e[41]=h.entries,e[42]=w.count,e[43]=i,e[44]=Y):Y=e[44],R=Y,N=w.count===0?r.jsxs("div",{className:"flex flex-col items-center gap-1 py-10 text-center",children:[r.jsx(vn,{className:"mb-1 size-5 text-success"}),r.jsx("p",{className:"text-sm font-medium",children:i("decoServe.changes.empty")})]}):r.jsxs(Yt,{children:[D(i("thread.publishPopover.pagesGroup"),w.pages),D(i("thread.publishPopover.blocksGroup"),w.blocks),h.sidesFailed?r.jsx("p",{className:"text-2xs text-muted-foreground",children:i("thread.publishPopover.detailsUnavailable")}):null]}),k=es,C=I?r.jsx("div",{className:X(Xt,"relative flex"),children:r.jsx(Rr,{change:I,diff:null,bodyPending:h.sidesPending,previewServerUrl:null,draft:null,lastPage:null,v8:{blocks:h.blocks}},Ie(I))}):r.jsx("div",{className:X(Xt,"bg-muted/40")}),e[13]=g,e[14]=o,e[15]=j,e[16]=p,e[17]=v,e[18]=m,e[19]=b,e[20]=h.blocks,e[21]=h.entries,e[22]=h.sidesFailed,e[23]=h.sidesPending,e[24]=w.blocks,e[25]=w.count,e[26]=w.pages,e[27]=i,e[28]=k,e[29]=N,e[30]=R,e[31]=C,e[32]=A}else k=e[28],N=e[29],R=e[30],C=e[31],A=e[32];let S;e[45]!==N||e[46]!==R||e[47]!==l||e[48]!==A?(S=r.jsx(Js,{title:A,trailing:R,body:N,onClose:l}),e[45]=N,e[46]=R,e[47]=l,e[48]=A,e[49]=S):S=e[49];let E;return e[50]!==k||e[51]!==C||e[52]!==S?(E=r.jsx(k,{pane:C,list:S}),e[50]=k,e[51]=C,e[52]=S,e[53]=E):E=e[53],E}function md(t){const e=M.c(5),{virtualMcpId:s,branch:a}=t,n=xe(),o=qt(s,a);if(!pd(o))return null;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx(Ct,{asChild:!0,children:r.jsx("span",{"data-testid":"content-version-badge",className:"shrink-0 rounded border border-border px-1.5 py-px font-mono text-2xs leading-4 text-muted-foreground",children:"v8"})}),e[0]=c):c=e[0];let l;e[1]!==n?(l=n("decoServe.version.v8"),e[1]=n,e[2]=l):l=e[2];let i;return e[3]!==l?(i=r.jsxs(kt,{children:[c,r.jsx(Nt,{side:"bottom",className:"max-w-xs",children:l})]}),e[3]=l,e[4]=i):i=e[4],i}function pd(t){return t.kind==="protocol"?t.hasSchema!==!1:t.kind==="unavailable"&&t.source!=="local"}function bd(t){const e=M.c(11),{virtualMcpId:s,branch:a}=t,n=xe(),o=qt(s,a);if(!(o.kind==="protocol"&&o.source==="local"&&o.describe.readOnly))return null;let l;e[0]!==n?(l=n("decoServe.readOnly.label"),e[0]=n,e[1]=l):l=e[1];let i;e[2]!==l?(i=r.jsx(Ct,{asChild:!0,children:r.jsx("span",{tabIndex:0,"data-testid":"deco-serve-read-only",className:"shrink-0 rounded-full bg-warning/10 px-2 py-0.5 text-xs font-medium text-foreground",children:l})}),e[2]=l,e[3]=i):i=e[3];let u;e[4]!==n?(u=n("decoServe.readOnly.tooltip"),e[4]=n,e[5]=u):u=e[5];let d;e[6]!==u?(d=r.jsx(Nt,{side:"bottom",className:"max-w-xs",children:r.jsx(Ja,{text:u})}),e[6]=u,e[7]=d):d=e[7];let h;return e[8]!==i||e[9]!==d?(h=r.jsxs(kt,{children:[i,d]}),e[8]=i,e[9]=d,e[10]=h):h=e[10],h}function gd(t){const e=!t.hasEntity&&!t.servingLocally,s=t.hasEntity&&!t.localPreview&&!t.tunnelUndecided&&!t.servingLocally&&t.showsRepositoryActions;return{hidden:e,localFiles:!e&&t.servingLocally,draftSelect:!e&&t.hasEntity,publish:e||!s?null:t.runtime==="cms"?"cms":"code"}}function mu(t){const e=M.c(2),{blocksOnly:s}=t;let a;return e[0]!==s?(a=s?r.jsx(xd,{}):r.jsx(_r,{}),e[0]=s,e[1]=a):a=e[1],a}function xd(){const t=M.c(2),e=Va(Ti());let s;return t[0]!==e?(s=Fl(e)?r.jsx(Nr,{value:!1,children:r.jsx(_r,{})}):null,t[0]=e,t[1]=s):s=t[1],s}function _r(){const t=M.c(32),e=Zt(),{org:s}=Cs(),a=pn(e?.virtualMcpId),n=e?.currentBranch??null,o=bn(a?.id).runtime,{url:c,undecided:l}=ka(a?.id),{connection:i}=Ca(a?.id??e?.virtualMcpId),u=a?.id??e?.virtualMcpId,d=!!a,h=!!i,f=!!c,p=!!l;let m;t[0]!==a||t[1]!==o||t[2]!==d||t[3]!==h||t[4]!==f||t[5]!==p?(m=gd({hasEntity:d,servingLocally:h,localPreview:f,tunnelUndecided:p,showsRepositoryActions:!!a&&$l(a),runtime:o}),t[0]=a,t[1]=o,t[2]=d,t[3]=h,t[4]=f,t[5]=p,t[6]=m):m=t[6];const b=m;if(!u||b.hidden)return null;let g;t[7]!==n||t[8]!==u?(g=r.jsx(md,{virtualMcpId:u,branch:n}),t[7]=n,t[8]=u,t[9]=g):g=t[9];let x;t[10]!==n||t[11]!==b.localFiles||t[12]!==u?(x=b.localFiles&&r.jsx(bd,{virtualMcpId:u,branch:n}),t[10]=n,t[11]=b.localFiles,t[12]=u,t[13]=x):x=t[13];let j;t[14]!==n||t[15]!==s||t[16]!==b.localFiles||t[17]!==u?(j=b.localFiles&&r.jsx(hd,{orgSlug:s.slug,virtualMcpId:u,branch:n}),t[14]=n,t[15]=s,t[16]=b.localFiles,t[17]=u,t[18]=j):j=t[18];let y;t[19]!==n||t[20]!==a||t[21]!==b.draftSelect?(y=a&&b.draftSelect&&r.jsx("div",{className:"flex min-w-0 shrink items-center justify-end",children:r.jsx(eo,{virtualMcp:a,currentBranch:n})}),t[19]=n,t[20]=a,t[21]=b.draftSelect,t[22]=y):y=t[22];let v;t[23]!==a||t[24]!==b.publish?(v=a&&b.publish&&r.jsxs(r.Fragment,{children:[r.jsx(sl,{orientation:"vertical",className:"mx-1 data-[orientation=vertical]:h-4"}),r.jsx("div",{className:"flex shrink-0 items-center justify-end gap-1",children:b.publish==="cms"?r.jsx(Jc,{virtualMcpId:a.id}):r.jsx(ud,{virtualMcpId:a.id})})]}),t[23]=a,t[24]=b.publish,t[25]=v):v=t[25];let P;return t[26]!==g||t[27]!==x||t[28]!==j||t[29]!==y||t[30]!==v?(P=r.jsxs(r.Fragment,{children:[g,x,j,y,v]}),t[26]=g,t[27]=x,t[28]=j,t[29]=y,t[30]=v,t[31]=P):P=t[31],P}export{mu as S};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-site-editor-DSqJlDXx.js","assets/index-BNmzMNlZ.js","assets/index-BQfNeaI1.css","assets/chat-context-C56OVvQP.js","assets/use-panel-navigate-BrjENNrA.js","assets/thread-route-D01w_vQB.js","assets/use-project-scope-DryffHrf.js","assets/repository-binding-BZ7FmJ0X.js","assets/use-mcp-client-ClU7gdfw.js","assets/auth-CEIITB7d.js","assets/autosend-CbkP_bEt.js","assets/thread-intent-cB2EtHpg.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-Bk0Yni6j.js","assets/task-board-DreQgJBj.js","assets/schema-DoiqvTL7.js","assets/slugify-CEUa2lfQ.js","assets/use-decopilot-events-C4OBhauN.js","assets/use-ai-providers-Bsehd5pg.js","assets/location-V0VwTJTt.js","assets/use-organization-settings-DeXdcCtZ.js","assets/site-draft-actions-DwqQ-cQC.js","assets/separator-BeYssz5V.js","assets/site-editor-toast-CT4NtD1f.js","assets/use-session-runtime-CQOTzbKn.js","assets/experiments-tab-choice-DZqY092h.js","assets/sandbox-url-D3mC8qhT.js","assets/utils-DeFulDMz.js","assets/ZoomOut-B1U_CHeD.js","assets/Image01-CW7Pcq-W.js","assets/use-sandbox-events-ClbDdVRn.js","assets/sandbox-git-api-CH_-QFpD.js","assets/shell-layout-DYY0I41_.js","assets/Building02-DinMBe3_.js","assets/UserSquare-DsAVH788.js","assets/agent-icon-CVEMdYFU.js","assets/AlertCircle-COLuN3Qe.js","assets/Tool01-Bon-ixH5.js","assets/ArrowUp-CRFAWnPc.js","assets/ArrowLeft-BYNlToA0.js","assets/LinkBroken01-Ctb4MZUK.js","assets/ShoppingBag01-usYkWunw.js","assets/CheckCircle-DCMOdEuL.js","assets/ChevronUp-4EkxqYyz.js","assets/ChevronSelectorVertical-Dwu4Nr-2.js","assets/Copy01-Tog1jA1S.js","assets/CreditCard01-B7MC6SfH.js","assets/DotsVertical-qUaZHjqd.js","assets/Globe04-CGEgYyKw.js","assets/SwitchHorizontal01-DcP8c_x_.js","assets/Key01-D_nzK0xg.js","assets/Link01-CpcYQ7Qt.js","assets/Minus-DoRDGpun.js","assets/Monitor01-L9jyZGZ2.js","assets/Sun-B7TolJAG.js","assets/Play-Du5BNsRy.js","assets/Plus-BfnmJh1R.js","assets/SearchMd-JUAl7Zv6.js","assets/Trash01-cH2tYIUn.js","assets/Upload01-Bo60o4T6.js","assets/Users01-Bo_9DitT.js","assets/XClose-DhoOL-T1.js","assets/use-clock-tick-jRUiEK1v.js","assets/command-N9BazZHl.js","assets/index-kd3fyZ9a.js","assets/integration-icon-BrTM8z-s.js","assets/project-icon-9kbQzXfH.js","assets/new-project-dialog-BzJmdXI6.js","assets/label-BCxqhVIq.js","assets/repository-import-picker-Bjws7k2-.js","assets/use-navigate-to-agent-CvuO-uuz.js","assets/repository-picker-DkvIZLAj.js","assets/tooltip-DibJz0Jl.js","assets/index-CaH8ekvn.js","assets/useInfiniteQuery-DWVaUM2t.js","assets/infiniteQueryObserver-ClGIthQz.js","assets/collection-search-BIuQ3VPN.js","assets/use-debounced-value-BtR2lyTj.js","assets/required-auth-layout-Dn8nNstE.js","assets/use-org-sso-DdzTjSOo.js","assets/shell-layout-CE2Eihra.css","assets/toolbar-icon-button-ByMmG3VL.js","assets/popover-DauDBkON.js","assets/tabs-BwD6LFyC.js","assets/active-indicator-CCMhAsc_.js","assets/use-releases-BQePeR_j.js","assets/serial-task-queue-CGOeQgpr.js","assets/virtual-mcp-D_aBBfQL.js","assets/url-slug-CPCergXm.js","assets/use-fast-preview-draft-url-BUDoPHon.js","assets/section-preview-url-7zfngvgW.js","assets/preview-link-C762yHOt.js","assets/variant-draft-pointer-BeAKcq_c.js","assets/parse-sections-B30A8ECY.js","assets/index-B9NLvHLf.js","assets/tool-namespace-Crbzrqv8.js","assets/drawer-B7ajVnwC.js","assets/use-mobile-nW9hYb6L.js","assets/use-mcp-prompts-CFFfSPcj.js","assets/usage-stats-DDafRqWC.js","assets/form-Gz8fbLdb.js","assets/utils-CVEq3hMx.js","assets/markdown-P8cO0xLZ.js","assets/use-copy-Dpm_jhm-.js","assets/input-BS4EACP3.js","assets/icon-button-TQkFyvqB.js","assets/file-type-icon-may_hs3N.js","assets/chat-draft-DNgi8tda.js","assets/select-CTAm_W2d.js","assets/index-BdQq_4o_.js","assets/use-deco-credits-DRIA1g3T.js","assets/toggle-group-BIu6qfZV.js","assets/use-open-billing-url-6zduD8ZA.js","assets/index-BNtuHmZB.js","assets/checkbox-B6N4ay58.js","assets/ai-providers-logos-DD3qZ33J.js","assets/input-DZSiMfCa.js","assets/suggestion-Dd_Uy5Bv.js","assets/use-org-fs-BcT14y41.js","assets/question-004-sINsf4GQ.js","assets/feature-paywall-C1_xpbwO.js","assets/plan-ladder-CN5p5ylK.js","assets/add-connection-dialog-8gQOdlVv.js","assets/extract-connection-data-ClMH8dL9.js","assets/metadata-D72DunRR.js","assets/connection-CQKYiXol.js","assets/connection-card-CvmG6XsV.js","assets/connection-slug-CITJ0kGN.js","assets/textarea-y7TWtoua.js","assets/use-connection-CAR6Cxbr.js","assets/schema-DEyBWI2y.js","assets/connection-form-helpers-ytOA1Nl6.js","assets/authenticate-and-persist-oauth-CN-ocXe3.js","assets/mcp-oauth-DBMA8wIh.js","assets/mcp-oauth-C9hLQucs.js","assets/collection-tabs-m2567Q_Z.js","assets/badge-DeNt4-FX.js","assets/use-infinite-scroll-0YRynoMy.js","assets/useSuspenseInfiniteQuery-6Ovi3jRe.js","assets/use-task-board-events-DlFBtyOL.js","assets/use-chat-layout-state-DpOxQYv4.js","assets/input-Bwd_JSM8.css","assets/pair-Dh_1oqHi.js","assets/collapsible-D3gNdr7N.js","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CKUvsXnq.js","assets/types-BdOsWOEi.js","assets/omit-sandbox-map-jj4lCB2U.js","assets/sheet-C52S-h6R.js","assets/use-thread-outputs-D8Bvo55q.js","assets/releases-api-BDl7LEw1.js","assets/use-content-sync-bYlxy6np.js","assets/named-rule-uses-D5gjZwOp.js","assets/secret-ciphertext-cTA7BSVY.js","assets/alert-CYZdSIKq.js","assets/device-hint-SeLRi17j.js","assets/editor-B7sIq_vQ.js","assets/save-changes-debug-nBi-n9eV.js","assets/sandbox-lifecycle-context-DMfngoi-.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/index-DusHyRie.js","assets/use-sidebar-collapsed-CUSnfCt-.js","assets/resizable-BYZDi11K.js","assets/agent-site-editor-DDGTF8rc.css","assets/agent-site-editor-content-B9B2SztQ.js","assets/agent-view-guard-Bvqt9A7d.js","assets/use-main-panel-tabs-QcdwwtJ8.js","assets/use-mcp-tools-CsGOzrhW.js","assets/resolve-tab-icon-DLcHhSBW.js","assets/use-task-metadata-DcdDwiSS.js","assets/preview-source-BsRLGWUP.js","assets/use-project-native-view-presence-OgGOYaV4.js","assets/match-site-slug-config-D3fUJ6vX.js","assets/use-file-configs-CuVchUT-.js","assets/site-slug-DebpOoQq.js","assets/feature-gate-Wo8Dn-M0.js","assets/content-tab-BwyJP-DI.js","assets/blocks-tab-states-PBqE8hLO.js","assets/slider-rNbrBC-4.js","assets/index-C6_m0mjP.js","assets/tooltipContext-BzrsG1UN.js","assets/CategoricalChart-Bx8yFu23.js","assets/index-DgWAoWIc.js","assets/ActiveShapeUtils-gwLrBsiR.js","assets/Sector-DL6Ad47o.js","assets/symbol-C3kEOGZ_.js","assets/empty-state-Cc_qF1X6.js","assets/held-block-view-DTUWWRfL.js","assets/switch-nUFQi60k.js","assets/scroll-area-Cfsm1vBV.js","assets/monaco-editor-CBJkBgIU.js","assets/calendar-GMyXKkbA.js","assets/editor-classes-BinXFbFk.js","assets/core.esm-BYOMVmVh.js","assets/sortable.esm-Cw5kBwgn.js","assets/combobox-BEVN0Tvl.js","assets/search-input-DBKkXR0y.js","assets/asset-utils-DcPLl2K6.js","assets/mustache-Crsi4VAX.js","assets/date-utils-CrvIKg-s.js","assets/use-move-blocks-BKlQlSno.js","assets/empty-state-RpLaBfip.js"])))=>i.map(i=>d[i]);
2
+ import{k as O,l as V,m as H}from"./named-rule-view-BVCpec2I.js";import{h as N}from"./named-rule-uses-D5gjZwOp.js";import{ag as A,au as L}from"./parse-sections-B30A8ECY.js";import{be as y,c as _,b as T,a4 as M,bj as U,j as c,n as F}from"./index-BNmzMNlZ.js";import{E as B}from"./empty-state-RpLaBfip.js";import{u as K}from"./chat-context-C56OVvQP.js";import{u as $,l as q}from"./site-editor-toast-CT4NtD1f.js";import{i as Q,u as G,S as z}from"./blocks-tab-states-PBqE8hLO.js";import{a as J}from"./use-panel-navigate-BrjENNrA.js";const P={running:0,everyone:1,off:2};function ce(s,e){const i=A(s,"experiments");if(i.kind==="conflict")return[];const o=e?.published??null;return Object.entries(i.values).map(([n,l],a)=>{const m=O(o,"experiments",n,l),b=m==="changed"?V(o,"experiments",n):void 0;return{order:a,row:{name:n,share:l,status:L(l),uses:e?N(e,"experiments",n):0,entryState:m,...b!==void 0?{publishedShare:b}:{}}}}).sort((n,l)=>P[n.row.status]-P[l.row.status]||n.order-l.order).map(n=>n.row)}function de(s,e){return H(s,e?.published??null,"experiments")}function ue(s){const e={contentPageVariant:s.focus?.pageVariant,contentSection:s.focus?.section,contentVariant:s.focus?.variant};return s.blockKind==="page"?{contentPageId:s.blockKey,contentCollection:void 0,contentItem:void 0,...e}:{contentPageId:void 0,contentCollection:"sections",contentItem:s.blockKey,...e}}let I=null;function W(){return I??=Promise.all([y(()=>import("./agent-site-editor-DSqJlDXx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164])),y(()=>import("./agent-site-editor-content-B9B2SztQ.js"),__vite__mapDeps([165,1,2,166,167,141,5,4,6,7,8,9,11,12,13,14,15,16,17,36,37,38,39,40,41,42,29,34,43,44,45,35,46,47,48,30,49,50,51,52,53,54,55,56,57,58,59,60,61,62,130,168,147,102,26,95,3,10,18,19,20,21,96,73,74,97,77,98,99,100,101,69,103,104,105,106,107,108,25,109,110,84,85,111,112,113,114,115,116,83,117,118,119,75,76,120,121,122,123,124,125,126,89,127,128,66,129,131,132,133,134,135,136,137,138,139,140,142,143,144,63,145,146,148,33,64,65,67,68,70,71,72,78,79,80,81,149,150,31,27,169,170,171,172,173,174,175,88,176,177,178,179,180,181,182,183,184,185,186,94,24,28,32,187,188,160,154,155,189,190,191,157,192,193,194,195,196,197,198,199,152,159,200,201,202]))]).catch(s=>{throw I=null,s}),I}function X(s){return e=>{if(!e)return;const i=()=>{s().catch(()=>{})};if(typeof requestIdleCallback=="function"){const t=requestIdleCallback(i,{timeout:2e3});return()=>cancelIdleCallback(t)}const o=setTimeout(i,200);return()=>clearTimeout(o)}}const Y=X(W);function R(s){const e=_.c(7),{icon:i,title:o,description:t,action:n}=s;let l;e[0]!==n?(l=n?{children:n.label,onClick:n.onClick}:void 0,e[0]=n,e[1]=l):l=e[1];let a;return e[2]!==t||e[3]!==i||e[4]!==l||e[5]!==o?(a=c.jsx(F,{children:c.jsx(F.Content,{children:c.jsx(F.Container,{children:c.jsx(B,{icon:i,title:o,description:t,buttonProps:l})})})}),e[2]=t,e[3]=i,e[4]=l,e[5]=o,e[6]=a):a=e[6],a}function fe(s){const e=_.c(28),{virtualMcpId:i,icon:o,copy:t,skeleton:n,children:l}=s,a=T(),{org:m}=M(),b=K(),p=b?.currentBranch??null,h=$(i,p);U(h.kind==="protocol"&&h.source==="github");const{openPanel:S}=J();if(!p){const r=t.noDraftTitle,k=t.noDraftDesc;let d;e[0]!==a?(d=a("sectionsEditor.namedRules.openEditor"),e[0]=a,e[1]=d):d=e[1];let u;e[2]!==S?(u=()=>S("content"),e[2]=S,e[3]=u):u=e[3];let f;e[4]!==d||e[5]!==u?(f={label:d,onClick:u},e[4]=d,e[5]=u,e[6]=f):f=e[6];let v;return e[7]!==t.noDraftDesc||e[8]!==t.noDraftTitle||e[9]!==o||e[10]!==f?(v=c.jsx(R,{icon:o,title:r,description:k,action:f}),e[7]=t.noDraftDesc,e[8]=t.noDraftTitle,e[9]=o,e[10]=f,e[11]=v):v=e[11],v}if(Q(h)){let r;return e[12]===Symbol.for("react.memo_cache_sentinel")?(r=c.jsx(z,{}),e[12]=r):r=e[12],r}if(h.kind==="pending"){let r;return e[13]!==n?(r=c.jsx(c.Fragment,{children:n}),e[13]=n,e[14]=r):r=e[14],r}if(h.kind!=="protocol"){let r;return e[15]!==t.loadFailed||e[16]!==t.loadFailedHint||e[17]!==o?(r=c.jsx(R,{icon:o,title:t.loadFailed,description:t.loadFailedHint}),e[15]=t.loadFailed,e[16]=t.loadFailedHint,e[17]=o,e[18]=r):r=e[18],r}const g=b?.taskId??null;let x;return e[19]!==p||e[20]!==l||e[21]!==t||e[22]!==o||e[23]!==m.slug||e[24]!==n||e[25]!==g||e[26]!==i?(x=c.jsx(Z,{orgSlug:m.slug,virtualMcpId:i,branch:p,threadId:g,icon:o,copy:t,skeleton:n,children:l},p),e[19]=p,e[20]=l,e[21]=t,e[22]=o,e[23]=m.slug,e[24]=n,e[25]=g,e[26]=i,e[27]=x):x=e[27],x}function Z(s){const e=_.c(30),{orgSlug:i,virtualMcpId:o,branch:t,threadId:n,icon:l,copy:a,skeleton:m,children:b}=s,p=T();let h;e[0]!==t||e[1]!==i||e[2]!==n||e[3]!==o?(h={orgSlug:i,virtualMcpId:o,branch:t,threadId:n,previewUrl:null},e[0]=t,e[1]=i,e[2]=n,e[3]=o,e[4]=h):h=e[4];const S=h,g=q(S),x=G(S),r=g.data,k=x.data;if(!r||!k){if(g.isError||x.isError){const v=a.loadFailed,w=a.loadFailedHint;let C;e[5]!==p?(C=p("sectionsEditor.namedRules.tryAgain"),e[5]=p,e[6]=C):C=e[6];let E;e[7]!==g||e[8]!==x?(E=()=>{g.refetch(),x.refetch()},e[7]=g,e[8]=x,e[9]=E):E=e[9];let j;e[10]!==C||e[11]!==E?(j={label:C,onClick:E},e[10]=C,e[11]=E,e[12]=j):j=e[12];let D;return e[13]!==a.loadFailed||e[14]!==a.loadFailedHint||e[15]!==l||e[16]!==j?(D=c.jsx(R,{icon:l,title:v,description:w,action:j}),e[13]=a.loadFailed,e[14]=a.loadFailedHint,e[15]=l,e[16]=j,e[17]=D):D=e[17],D}let f;return e[18]!==m?(f=c.jsx(c.Fragment,{children:m}),e[18]=m,e[19]=f):f=e[19],f}let d;e[20]!==t||e[21]!==b||e[22]!==r||e[23]!==k||e[24]!==i||e[25]!==n||e[26]!==o?(d=b({orgSlug:i,virtualMcpId:o,branch:t,threadId:n,decofile:r,meta:k}),e[20]=t,e[21]=b,e[22]=r,e[23]=k,e[24]=i,e[25]=n,e[26]=o,e[27]=d):d=e[27];let u;return e[28]!==d?(u=c.jsx("div",{className:"contents",ref:Y,children:d}),e[28]=d,e[29]=u):u=e[29],u}export{fe as S,R as a,ue as c,ce as e,de as r};
@@ -0,0 +1 @@
1
+ import{c as u,r as g,j as n,H as F,$ as G,a0 as H,a as E,k as P,b as O,n as y,L as M}from"./index-BNmzMNlZ.js";import{C as V}from"./chat-context-C56OVvQP.js";import{C as x}from"./index-DusHyRie.js";import{L}from"./index-BEX8cmtV.js";import{B as K}from"./blocks-preview-workspace-context-aUwmyorT.js";import{e as T,p as W,s as J,a as U,r as z,T as $,u as R,b as q}from"./site-editor-toast-CT4NtD1f.js";import{u as Q,L as B,P as X,S as Y}from"./preview-tab-ClK0lOMy.js";import{C as Z}from"./content-tab-BwyJP-DI.js";import{T as tt}from"./tab-icon-glyph-Bzpngl6a.js";import{r as et}from"./resolve-tab-icon-DLcHhSBW.js";import ot from"./agent-site-editor-DSqJlDXx.js";import"./use-panel-navigate-BrjENNrA.js";import"./thread-route-D01w_vQB.js";import"./use-project-scope-DryffHrf.js";import"./repository-binding-BZ7FmJ0X.js";import"./use-mcp-client-ClU7gdfw.js";import"./auth-CEIITB7d.js";import"./autosend-CbkP_bEt.js";import"./thread-intent-cB2EtHpg.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-Bk0Yni6j.js";import"./task-board-DreQgJBj.js";import"./schema-DoiqvTL7.js";import"./slugify-CEUa2lfQ.js";import"./use-decopilot-events-C4OBhauN.js";import"./use-ai-providers-Bsehd5pg.js";import"./location-V0VwTJTt.js";import"./use-organization-settings-DeXdcCtZ.js";import"./use-mobile-nW9hYb6L.js";import"./use-sidebar-collapsed-CUSnfCt-.js";import"./use-chat-layout-state-DpOxQYv4.js";import"./agent-icon-CVEMdYFU.js";import"./AlertCircle-COLuN3Qe.js";import"./Tool01-Bon-ixH5.js";import"./ArrowUp-CRFAWnPc.js";import"./ArrowLeft-BYNlToA0.js";import"./LinkBroken01-Ctb4MZUK.js";import"./ShoppingBag01-usYkWunw.js";import"./ZoomOut-B1U_CHeD.js";import"./Building02-DinMBe3_.js";import"./CheckCircle-DCMOdEuL.js";import"./ChevronUp-4EkxqYyz.js";import"./ChevronSelectorVertical-Dwu4Nr-2.js";import"./UserSquare-DsAVH788.js";import"./Copy01-Tog1jA1S.js";import"./CreditCard01-B7MC6SfH.js";import"./DotsVertical-qUaZHjqd.js";import"./Image01-CW7Pcq-W.js";import"./Globe04-CGEgYyKw.js";import"./SwitchHorizontal01-DcP8c_x_.js";import"./Key01-D_nzK0xg.js";import"./Link01-CpcYQ7Qt.js";import"./Minus-DoRDGpun.js";import"./Monitor01-L9jyZGZ2.js";import"./Sun-B7TolJAG.js";import"./Play-Du5BNsRy.js";import"./Plus-BfnmJh1R.js";import"./SearchMd-JUAl7Zv6.js";import"./Trash01-cH2tYIUn.js";import"./Upload01-Bo60o4T6.js";import"./Users01-Bo_9DitT.js";import"./XClose-DhoOL-T1.js";import"./tooltip-DibJz0Jl.js";import"./index-CaH8ekvn.js";import"./toolbar-icon-button-ByMmG3VL.js";import"./shell-layout-DYY0I41_.js";import"./use-clock-tick-jRUiEK1v.js";import"./command-N9BazZHl.js";import"./index-kd3fyZ9a.js";import"./integration-icon-BrTM8z-s.js";import"./project-icon-9kbQzXfH.js";import"./new-project-dialog-BzJmdXI6.js";import"./label-BCxqhVIq.js";import"./repository-import-picker-Bjws7k2-.js";import"./use-navigate-to-agent-CvuO-uuz.js";import"./repository-picker-DkvIZLAj.js";import"./useInfiniteQuery-DWVaUM2t.js";import"./infiniteQueryObserver-ClGIthQz.js";import"./collection-search-BIuQ3VPN.js";import"./use-debounced-value-BtR2lyTj.js";import"./required-auth-layout-Dn8nNstE.js";import"./use-org-sso-DdzTjSOo.js";import"./sheet-C52S-h6R.js";import"./resizable-BYZDi11K.js";import"./core.esm-BYOMVmVh.js";import"./sortable.esm-Cw5kBwgn.js";import"./context-menu-C4h1P6Vl.js";import"./create-organization-dialog-DqU6G9od.js";import"./form-Gz8fbLdb.js";import"./project-apps-CNRV3DAE.js";import"./use-recent-apps-CMgGjBH4.js";import"./use-session-runtime-CQOTzbKn.js";import"./experiments-tab-choice-DZqY092h.js";import"./sandbox-url-D3mC8qhT.js";import"./utils-DeFulDMz.js";import"./use-sandbox-events-ClbDdVRn.js";import"./sandbox-git-api-CH_-QFpD.js";import"./held-block-view-DTUWWRfL.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Dh_1oqHi.js";import"./collapsible-D3gNdr7N.js";import"./use-copy-Dpm_jhm-.js";import"./usage-stats-DDafRqWC.js";import"./tool-namespace-Crbzrqv8.js";import"./utils-CVEq3hMx.js";import"./markdown-P8cO0xLZ.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-CKUvsXnq.js";import"./types-BdOsWOEi.js";import"./omit-sandbox-map-jj4lCB2U.js";import"./use-connection-CAR6Cxbr.js";import"./use-mcp-prompts-CFFfSPcj.js";import"./use-thread-outputs-D8Bvo55q.js";import"./file-type-icon-may_hs3N.js";import"./secret-ciphertext-cTA7BSVY.js";import"./alert-CYZdSIKq.js";import"./parse-sections-B30A8ECY.js";import"./blocks-tab-states-PBqE8hLO.js";import"./slider-rNbrBC-4.js";import"./index-C6_m0mjP.js";import"./index-BdQq_4o_.js";import"./tooltipContext-BzrsG1UN.js";import"./CategoricalChart-Bx8yFu23.js";import"./index-DgWAoWIc.js";import"./ActiveShapeUtils-gwLrBsiR.js";import"./Sector-DL6Ad47o.js";import"./symbol-C3kEOGZ_.js";import"./empty-state-Cc_qF1X6.js";import"./switch-nUFQi60k.js";import"./textarea-y7TWtoua.js";import"./popover-DauDBkON.js";import"./scroll-area-Cfsm1vBV.js";import"./monaco-editor-CBJkBgIU.js";import"./editor-B7sIq_vQ.js";import"./calendar-GMyXKkbA.js";import"./select-CTAm_W2d.js";import"./editor-classes-BinXFbFk.js";import"./toggle-group-BIu6qfZV.js";import"./active-indicator-CCMhAsc_.js";import"./combobox-BEVN0Tvl.js";import"./search-input-DBKkXR0y.js";import"./tabs-BwD6LFyC.js";import"./use-file-configs-CuVchUT-.js";import"./asset-utils-DcPLl2K6.js";import"./match-site-slug-config-D3fUJ6vX.js";import"./sandbox-lifecycle-context-DMfngoi-.js";import"./variant-matcher-override-B4pYtxaz.js";import"./variant-draft-pointer-BeAKcq_c.js";import"./section-preview-url-7zfngvgW.js";import"./use-fast-preview-draft-url-BUDoPHon.js";import"./preview-link-C762yHOt.js";import"./useQueries-B8DPRYfS.js";import"./device-hint-SeLRi17j.js";import"./virtual-mcp-D_aBBfQL.js";import"./url-slug-CPCergXm.js";import"./app-preview-url-9Od4s8Sz.js";import"./preview-source-BsRLGWUP.js";import"./use-task-metadata-DcdDwiSS.js";import"./mustache-Crsi4VAX.js";import"./use-content-sync-bYlxy6np.js";import"./checkbox-B6N4ay58.js";import"./date-utils-CrvIKg-s.js";import"./use-move-blocks-BKlQlSno.js";import"./badge-DeNt4-FX.js";import"./empty-state-RpLaBfip.js";import"./site-draft-actions-DwqQ-cQC.js";import"./separator-BeYssz5V.js";import"./use-releases-BQePeR_j.js";import"./serial-task-queue-CGOeQgpr.js";import"./index-B9NLvHLf.js";import"./drawer-B7ajVnwC.js";import"./input-BS4EACP3.js";import"./icon-button-TQkFyvqB.js";import"./chat-draft-DNgi8tda.js";import"./use-deco-credits-DRIA1g3T.js";import"./use-open-billing-url-6zduD8ZA.js";import"./index-BNtuHmZB.js";import"./ai-providers-logos-DD3qZ33J.js";import"./input-DZSiMfCa.js";import"./suggestion-Dd_Uy5Bv.js";import"./use-org-fs-BcT14y41.js";import"./question-004-sINsf4GQ.js";import"./feature-paywall-C1_xpbwO.js";import"./plan-ladder-CN5p5ylK.js";import"./add-connection-dialog-8gQOdlVv.js";import"./extract-connection-data-ClMH8dL9.js";import"./metadata-D72DunRR.js";import"./connection-CQKYiXol.js";import"./connection-card-CvmG6XsV.js";import"./connection-slug-CITJ0kGN.js";import"./schema-DEyBWI2y.js";import"./connection-form-helpers-ytOA1Nl6.js";import"./authenticate-and-persist-oauth-CN-ocXe3.js";import"./mcp-oauth-DBMA8wIh.js";import"./mcp-oauth-C9hLQucs.js";import"./collection-tabs-m2567Q_Z.js";import"./use-infinite-scroll-0YRynoMy.js";import"./useSuspenseInfiniteQuery-6Ovi3jRe.js";import"./use-task-board-events-DlFBtyOL.js";import"./releases-api-BDl7LEw1.js";import"./named-rule-uses-D5gjZwOp.js";import"./save-changes-debug-nBi-n9eV.js";function I(e){return e.kind==="unavailable"&&e.source==="local"&&(e.problem?.reason??"not-answering")==="not-answering"}const it=e=>e;function rt(e){const t=u.c(10),{candidates:o,invalidLink:c,shell:m,editor:i}=e,r=c===void 0?!1:c,s=m===void 0?it:m,[p,l]=g.useState(null);if(p){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=()=>l(null),t[0]=f):f=t[0];let h;return t[1]!==p||t[2]!==i?(h=i(p,f),t[1]=p,t[2]=i,t[3]=h):h=t[3],h}let a;t[4]!==o||t[5]!==r?(a=n.jsx(nt,{candidates:o,invalidLink:r,onConnect:l}),t[4]=o,t[5]=r,t[6]=a):a=t[6];let d;return t[7]!==s||t[8]!==a?(d=s(a),t[7]=s,t[8]=a,t[9]=d):d=t[9],d}function nt(e){const t=u.c(17),{candidates:o,invalidLink:c,onConnect:m}=e,i=c===void 0?!1:c,[r]=F(),{language:s}=r;let p;t[0]!==m?(p=D=>m({endpoint:D}),t[0]=m,t[1]=p):p=t[1];let l;t[2]!==o||t[3]!==p?(l={candidates:o,onFound:p},t[2]=o,t[3]=p,t[4]=l):l=t[4];const a=Q(l),{state:d,access:f,needsGesture:h}=a;let k;t[5]!==o||t[6]!==s?(k=new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(o.map(T)),t[5]=o,t[6]=s,t[7]=k):k=t[7];const C=k;let j;t[8]!==f||t[9]!==a.start||t[10]!==h||t[11]!==d?(j=f==="denied"?{kind:"denied"}:h?{kind:"needs-gesture",onStart:a.start}:d.problem?{kind:"problem",problem:d.problem,host:T(d.problem.endpoint)}:{kind:"looking",paused:d.status==="paused"},t[8]=f,t[9]=a.start,t[10]=h,t[11]=d,t[12]=j):j=t[12];const _=j;let S;return t[13]!==C||t[14]!==i||t[15]!==_?(S=n.jsx(B,{wait:_,hosts:C,invalidLink:i}),t[13]=C,t[14]=i,t[15]=_,t[16]=S):S=t[16],S}const v="deco-serve",w="working-tree",st={id:"",slug:"",name:"",logo:null},mt={id:v,slug:v},pt={virtualMcpId:v,taskId:null,openTask:()=>{},createTask:()=>"",createTaskWithMessage:()=>{},activeTask:null,isThreadLocked:!1,lockedHarness:null,lockedBranch:null,currentBranch:w,setCurrentTaskBranch:()=>{}};function at(){const e=window.location.hash,t=new URLSearchParams(e.replace(/^#/,"")).has("endpoint"),o=t?W(e):null;return t&&window.history.replaceState(null,"",window.location.pathname+window.location.search),o&&J(o),{candidates:U(o,z()),invalidLink:t&&!o}}const ct=[{id:"site-editor",to:"/site-editor",label:"preview"},{id:"content",to:"/site-editor/content",label:"content"}];function lt(){const e=u.c(6),t=O();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:dt},e[0]=o):o=e[0];const c=P(o);let m;e[1]!==t||e[2]!==c?(m=ct.map(r=>n.jsx(y.Tab,{asChild:!0,active:c==="content"==(r.id==="content"),children:n.jsxs(M,{to:r.to,activeOptions:{exact:!0},children:[n.jsx("span",{"aria-hidden":"true",className:"flex size-4 shrink-0 items-center justify-center",children:n.jsx(tt,{icon:et({tabId:r.id,kind:"system",connections:[]})})}),t(`common.mainPanelTabs.${r.label}`)]})},r.id)),e[1]=t,e[2]=c,e[3]=m):m=e[3];let i;return e[4]!==m?(i=n.jsx(y.Tabs,{children:m}),e[4]=m,e[5]=i):i=e[5],i}function dt(e){return e.matches.at(-1)?.staticData.siteEditorView}function N(e){const t=u.c(14),{children:o}=e,c=O(),{connection:m}=q(v),i=R(v,w);let r,s;if(t[0]!==i||t[1]!==o||t[2]!==m||t[3]!==c){s=Symbol.for("react.early_return_sentinel");t:{if(r=m?T(m.endpoint):"",i.kind==="protocol"){s=o;break t}if(i.kind!=="unavailable"||I(i)){s=n.jsx(Y,{headingLevel:2,waiting:!0,title:c("decoServe.connect.reaching",{host:r})});break t}}t[0]=i,t[1]=o,t[2]=m,t[3]=c,t[4]=r,t[5]=s}else r=t[4],s=t[5];if(s!==Symbol.for("react.early_return_sentinel"))return s;let p;t[6]!==i.problem?(p=i.problem??{reason:"not-answering"},t[6]=i.problem,t[7]=p):p=t[7];let l;t[8]!==r||t[9]!==p?(l={kind:"problem",problem:p,host:r},t[8]=r,t[9]=p,t[10]=l):l=t[10];let a;return t[11]!==r||t[12]!==l?(a=n.jsx(B,{wait:l,hosts:r}),t[11]=r,t[12]=l,t[13]=a):a=t[13],a}function ut(e){const t=u.c(6),{onLost:o}=e,c=R(v,w);let m;t[0]!==c?(m=I(c),t[0]=c,t[1]=m):m=t[1];const i=m;let r,s;return t[2]!==i||t[3]!==o?(r=()=>{i&&o()},s=[i,o],t[2]=i,t[3]=o,t[4]=r,t[5]=s):(r=t[4],s=t[5]),g.useEffect(r,s),null}const A={threadOpen:!1,contentOpen:!0,threadVisibilityExplicit:!1,toggleThread:()=>{},toggleContent:()=>{}};function ft(){const e=u.c(11),{data:t}=E.useSession();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={select:ht},e[0]=o):o=e[0];const c=P(o),m=!!t?.user;let i;e[1]!==m?(i={rail:m},e[1]=m,e[2]=i):i=e[2];const r=c??"preview";let s,p,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsx(lt,{}),p=n.jsx(x.Thread,{children:null}),l=n.jsx(ot,{}),e[3]=s,e[4]=p,e[5]=l):(s=e[3],p=e[4],l=e[5]);let a;e[6]!==r?(a=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:r,contentNavigation:s,children:[p,l]})}),e[6]=r,e[7]=a):a=e[7];let d;return e[8]!==i||e[9]!==a?(d=n.jsx(L,{outsideOrg:i,children:a}),e[8]=i,e[9]=a,e[10]=d):d=e[10],d}function ht(e){return e.matches.at(-1)?.staticData.siteEditorView}function vt(e){const t=u.c(8),{children:o}=e,{data:c}=E.useSession(),m=!!c?.user;let i;t[0]!==m?(i={rail:m},t[0]=m,t[1]=i):i=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(x.Thread,{children:null}),t[2]=r):r=t[2];let s;t[3]!==o?(s=n.jsx(L.Content,{children:n.jsxs(x,{...A,threadless:!0,contentKey:"guide",children:[r,n.jsx(x.Content,{children:o})]})}),t[3]=o,t[4]=s):s=t[4];let p;return t[5]!==i||t[6]!==s?(p=n.jsx(L,{outsideOrg:i,children:s}),t[5]=i,t[6]=s,t[7]=p):p=t[7],p}const b=()=>{},xt={connection:null,set:b,clear:b};function pr(){const e=u.c(3),[t]=g.useState(at);let o;return e[0]!==t.candidates||e[1]!==t.invalidLink?(o=n.jsx(G,{value:!0,children:n.jsx(H,{org:st,project:mt,children:n.jsx(rt,{candidates:t.candidates,invalidLink:t.invalidLink,shell:jt,editor:kt})})}),e[0]=t.candidates,e[1]=t.invalidLink,e[2]=o):o=e[2],o}function kt(e,t){return n.jsxs($.Provider,{value:{connection:e,set:b,clear:b},children:[n.jsx(ut,{onLost:t}),n.jsx(V,{value:pt,children:n.jsx(K,{children:n.jsx(ft,{})})})]})}function jt(e){return n.jsx($.Provider,{value:xt,children:n.jsx(vt,{children:e})})}function ar(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(X,{virtualMcpId:v})}),e[0]=t):t=e[0],t}function cr(){const e=u.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=n.jsx(N,{children:n.jsx(Z,{virtualMcpId:v})}),e[0]=t):t=e[0],t}export{cr as SiteEditorContent,ar as SiteEditorPreview,pr as default};